Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sex Bumbo
Aug 14, 2004
It doubled the latency or something?

Adbot
ADBOT LOVES YOU

haveblue
Aug 15, 2005



Toilet Rascal

Stanlo posted:

It doubled the latency or something?

That would be a 50% decrease. A 200% decrease would be performance so bad that the router poo poo itself and dropped traffic for every computer in the room.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

wlievens posted:

OpenCL is the new hottie in the GPGPU world, if I recall correctly.

Edit: also, how the frak do you get a 200% decrease in a positive number??
So to be clear, what I'm talking about is a kernelspace thing, and not a library like OpenCL.

And I worded it badly; I meant to say the performance was cut in half.

edit: here's the paper

Contero
Mar 28, 2004

Where is a place to go for some nice lowpoly textured tree models? Preferably in .obj format. I'm not having much luck with the few that are offered free on turbosquid.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Contero posted:

Where is a place to go for some nice lowpoly textured tree models? Preferably in .obj format. I'm not having much luck with the few that are offered free on turbosquid.

Write an algorithm to do it. (And then sell it.)

If I weren't busy, I'd do exactly this.

Contero
Mar 28, 2004

Avenging Dentist posted:

Write an algorithm to do it. (And then sell it.)

If I weren't busy, I'd do exactly this.

I am busy! :(

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Avenging Dentist posted:

Write an algorithm to do it. (And then sell it.)
http://arbaro.sourceforge.net/

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

Dijkstracula posted:

Actually, there were a few papers at SOSP this year about offloading part of your operating system to various peripherals, with the GPU being the ultimate goal, so it's at least being considered. (Ironically, the paper that pushed the network stack onto the machine's nic saw a 200% performance decrease so it's not necessarily going to be a good idea)

Noooooooooooooooooooooooooooooooo


:argh:

UberJumper
May 20, 2007
woop
Is there a decent algorithm for calculating ambient light colors based on the time of day?

Contero
Mar 28, 2004

UberJumper posted:

Is there a decent algorithm for calculating ambient light colors based on the time of day?

Umm..

1. Pick some colors you think it should be at certain times of the day
2. Linearly interpolate between those colors for the times in between

Applebee123
Oct 9, 2007

That's 10$ for the spinefund.

UberJumper posted:

Is there a decent algorithm for calculating ambient light colors based on the time of day?

Here is a guide about the colours of light throughout the day:

http://www.itchy-animation.co.uk/tutorials/light03.htm

UberJumper
May 20, 2007
woop

Contero posted:

Umm..

1. Pick some colors you think it should be at certain times of the day
2. Linearly interpolate between those colors for the times in between

Do you have a good example of this?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

UberJumper posted:

Do you have a good example of this?

Did you ever take algebra in middle school? It's like writing a linear function given two points on the line.

Alcool Tue
Nov 6, 2009

by Ozma

UberJumper posted:

Do you have a good example of this?

code:
list=[]

for each in range(start,end,step):
    list+=[each]

print list
Some people call me the master programmer. Hope this helps!

UberJumper
May 20, 2007
woop

Alcool Tue posted:

code:
list=[]

for each in range(start,end,step):
    list+=[each]

print list
Some people call me the master programmer. Hope this helps!

Err..

Okay let me rephrase this.

I have two Red Values r1, r2 they are both integers between 0-255.

The value of r1 starts at 0 ms, and the value of r2 should begin at 20,000 ms.

How can i make r1's color so it flows nicely into r2.

Shavnir
Apr 5, 2005

A MAN'S DREAM CAN NEVER DIE

UberJumper posted:

Err..

Okay let me rephrase this.

I have two Red Values r1, r2 they are both integers between 0-255.

The value of r1 starts at 0 ms, and the value of r2 should begin at 20,000 ms.

How can i make r1's color so it flows nicely into r2.

Really?

Take the ratio of time that has passed between 0ms and 20,000ms and multiply it by the degree of change between r1 and r2. Its really simple algebra.

Contero
Mar 28, 2004

UberJumper posted:

Err..

Okay let me rephrase this.

I have two Red Values r1, r2 they are both integers between 0-255.

The value of r1 starts at 0 ms, and the value of r2 should begin at 20,000 ms.

How can i make r1's color so it flows nicely into r2.
Might as well just spell it out...

t = (currentTime - startTime) / (endTime - startTime);
newRed = startRed*(1-t) + endRed*t;

Scarboy
Jan 31, 2001

Good Luck!
MathHelper.Lerp(r1, r2, t); if you use XNA and want a nice helper function

This is really really simple stuff that you should know.

shodanjr_gr
Nov 20, 2007
I'm doing some hacky ND-buffer creation on the iPhone. However it seems that at the moment OpenGL ES 2.0 does not support floating point textures, so it is not possible for me to grab the depth buffer from my current render and use it. Thus I have to do multipass rendering and pack the normalized Z-value into a 4 channel texture.

What would be the optimal way to do that, inside a shader?

UberJumper
May 20, 2007
woop

Contero posted:

Might as well just spell it out...

t = (currentTime - startTime) / (endTime - startTime);
newRed = startRed*(1-t) + endRed*t;


Thanks everyone i'm just an idiot. Using this formula kept resulting in random jumping. I ended up tearing it apart making some sort of :cthulhu:.

Turns out GetTickCount() is returning exteremly large numbers at random occurances. Which then causes bizarre things.

E.g if i comment out everything except a simple tick count update that returns delta time.

code:
<snip many many lines>
DeltaTime> 2
DeltaTime> 1
DeltaTime> 2
DeltaTime> 4294967295
<snip many many lines>
This happens at random there is no pattern or reasoning i can tell behind this. Anyone have any ideas?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

UberJumper posted:

This happens at random there is no pattern or reasoning i can tell behind this. Anyone have any ideas?

The number you get should be indicative of the problem. (What's 4294967295 in base-2?) GetTickCount is a lovely function anyway. timeGetTime and QueryPerformanceCounter are better.

BATH TUB
Jun 27, 2003

Avenging Dentist posted:

The number you get should be indicative of the problem. (What's 4294967295 in base-2?) GetTickCount is a lovely function anyway. timeGetTime and QueryPerformanceCounter are better.

QueryPerformanceCounter is great if your definition of time doesn't include "increasing monotonically"

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

timecircuits posted:

QueryPerformanceCounter is great if you use chipsets from a decent manufacturer or bother to patch the issues with the crappy ones

Fixed that for you. :)

Avenging Dentist fucked around with this message at 21:25 on Nov 9, 2009

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
You need to keep your audience in mind in that case, chipset updates aren't exactly the most intuitive thing to find, mainly because finding out who even makes your computer's chipset if you didn't build the machine yourself is far from intuitive.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

OneEightHundred posted:

You need to keep your audience in mind in that case, chipset updates aren't exactly the most intuitive thing to find, mainly because finding out who even makes your computer's chipset if you didn't build the machine yourself is far from intuitive.

I didn't say you had to just use QPC no matter what. For systems that aren't a piece of poo poo, it's essentially the perfect solution, but for lovely ones, you can fall back on another timer, or do some double-checking to make sure things aren't getting fouled up because of HAL/BIOS bugs.

BATH TUB
Jun 27, 2003

Avenging Dentist posted:

Fixed that for you. :)

Telling your user to buy a new motherboard doesn't count as a workaround, dude.

I'm running a late '07 Macbook Pro and QueryPerformanceCounter() returns wonky results, even when it's run on a single processor. Then again, maybe I shouldn't be buying flimsy chipsets from such a fly-by-night manufacturer!

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

timecircuits posted:

Telling your user to buy a new motherboard doesn't count as a workaround, dude.

I'm running a late '07 Macbook Pro and QueryPerformanceCounter() returns wonky results, even when it's run on a single processor. Then again, maybe I shouldn't be buying flimsy chipsets from such a fly-by-night manufacturer!

That could be because QueryPerformanceCounter is a Windows API call!! (You'd want to use the HPET then, which an x86 Mac should probably have.)

EDIT: Incidentally, I'm pretty sure the HPET is required for Vista-era Windows Logo testing, and QPC under Vista+ should use the HPET when available.

Avenging Dentist fucked around with this message at 22:13 on Nov 9, 2009

BATH TUB
Jun 27, 2003

Avenging Dentist posted:

That could be because QueryPerformanceCounter is a Windows API call!! (You'd want to use the HPET then, which an x86 Mac should probably have.)

No wonder I couldn't get DirectX to install... :facepalm:

MSDN doesn't have a god drat thing on HPET. There's a bunch of information on QueryPerformanceCounter(), except for the most important part -- that 10% of your calls will return horribly inaccurate results.

http://www.ccsl.carleton.ca/~jamuir/rdtscpm1.pdf looks like a good place to read about how to use HPET in your code. (It's okay to yell at your users for not having modern enough hardware, as long as you don't name any brands.)

edit: No wonder, I was running XP and getting all sorts of horseshit when I was testing qpc() with batches of floating point divides. Checking the difference of timeGetTime() and QueryPerformanceCounter() isn't such a bad compromise though; you only get weird data about every ten calls.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

timecircuits posted:

edit: No wonder, I was running XP and getting all sorts of horseshit when I was testing qpc() with batches of floating point divides. Checking the difference of timeGetTime() and QueryPerformanceCounter() isn't such a bad compromise though; you only get weird data about every ten calls.

Yeah, I was going to say. XP doesn't support HPET (there are conflicting reports that SP2 installs a driver for it that it promptly never uses), but I think if someone is using an 8 year old OS, you can let them get stuck with a mediocre timing function like timeGetTime (or play the heuristics game).

Ludicrous Gibs!
Jan 21, 2002

I'm not lost, but I don't know where I am.
Ramrod XTreme
Hey, it's me again, the guy with the collision detection problems. I did some Googling for continuous collision detection as suggested by a couple posters in this thread, and came across this Gamasutra article. It seemed like what I was looking for, so decided to give it a shot. I basically copied the example code line for line, but changed a few variable names here and there.

After the initial contact, it tends to keep returning collisions for a pair of objects, regardless of how far apart they become. It also returns collisions for a pair of objects on the same x plane moving horizontally at the same speed with no contact between boxes.

Here's how it looks in my source code:
code:
class AABB {
public:

	AABB(const D3DXVECTOR3 &position, const D3DXVECTOR3 &extents): ext(extents), pos(position)
	{ }

	CustomVector pos;
	CustomVector ext; // x, y, z extents

	const bool overLaps(AABB &test) const {
		const D3DXVECTOR3 T = test.pos - pos;
		return fabs(T.x) <= (ext.x + test.ext.x)
			&&
			fabs(T.y) <= (ext.y + test.ext.y)
			&&
			fabs(T.z) <= (ext.z + test.ext.z);
	}
	
	const float AABB_min(long i) const {
		return ((AABB*)this)->pos[i] - ((AABB*)this)->ext[i]; }

	const float AABB_max(long i) const {
		return ((AABB*)this)->pos[i] + ((AABB*)this)->ext[i]; }
};

bool ScriptStore::AABBSweepTest(D3DXVECTOR3 &ext_a, D3DXVECTOR3 &prev_a, D3DXVECTOR3 &cur_a, 
								D3DXVECTOR3 &ext_b, D3DXVECTOR3 &prev_b, D3DXVECTOR3 &cur_b, 
								double &u0, double &u1)
{
	AABB A(prev_a, ext_a);  // previous state of a
	AABB B(prev_b, ext_b);	// previous state of b
	CustomVector va = cur_a - prev_a; // displacement of a
	CustomVector vb = cur_b - prev_b; // displacement of b

	CustomVector v = vb - va; // relative velocity

	CustomVector u_0(0, 0, 0);
	// first times of overlap along each axis

	CustomVector u_1(1, 1, 1);
	// last times of overlap along each axis

	// check if there was overlap on previous frame
	if(A.overLaps(B))	{
		u0 = u1 = 0;
		return true;
	}

	// find possible first and last times of overlap
	// along each axis
	for(int i = 0 ; i < 3 ; i++) {
		
		if(A.AABB_max(i) < B.AABB_min(i) && v[i] < 0)
			u_0[i] = (A.AABB_max(i) - B.AABB_min(i)) / v[i];
		else if(B.AABB_max(i) < A.AABB_min(i) && v[i] > 0)
			u_0[i] = (A.AABB_min(i) - B.AABB_max(i)) / v[i];

		if(B.AABB_max(i) > A.AABB_min(i) && v[i] < 0)
			u_1[i] = (A.AABB_min(i) - B.AABB_max(i)) / v[i];
		else if(A.AABB_max(i) > B.AABB_min(i) && v[i] > 0)
			u_1[i] = (A.AABB_max(i) - B.AABB_min(i)) / v[i];

	}

	// possible first time of overlap
	u0 = max(u_0.x, max(u_0.y, u_0.z));

	// possible last time of overlap
	u1 = min(u_1.x, min(u_1.y, u_1.z));

	// there was only a collision if the first time of overlap happened before the last time
	return u0 <= u1;

}
And CustomVector is just a class I derived from D3DXVECTOR3, because of the need to overload the [] operator.
code:
class CustomVector : public D3DXVECTOR3 {
public:

	CustomVector() : D3DXVECTOR3()
	{ }
	CustomVector(D3DXVECTOR3 init_vect) : D3DXVECTOR3(init_vect)
	{ }
	CustomVector(float x, float y, float z) : D3DXVECTOR3(x, y, z)
	{ }

	float& operator [](int i)
	{ 
		if(i == 0)
			return x;
		else if(i == 1)
			return y;
		else 
			return z;
	}

	bool operator ==(float f)
	{
		return (x == f) && (y == f) && (z == f);
	}
};
I've used breakpoints to determine that the values that keep getting passed into the sweep function are valid. So, either I hosed up somewhere, or the author of the article did. Unfortunately, since the article's 10 years old, there isn't much chance of getting ahold of him. My geometry kung-fu is weak, so before I spend a dozen hours or more poring over this code, I thought I'd post it here and see if anyone can identify the problem.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
For one thing, you're not accounting for when v[i] == 0, which is going to give you problems.

EDIT: Also the logic looks really suspect in general (also also your code is a mess).

EDITx2: Nevermind, your velocity vector is just the reverse of what I'm used to. But you aren't accounting for the case where v[i] < 0 and B.max(i) < A.min(i) (and its obvious corollary when v[i] > 0).

Avenging Dentist fucked around with this message at 02:30 on Nov 10, 2009

Walorski
Feb 21, 2004
I'm Polish
Ok, I need some help. I've kinda' stopped following this thread lately, but last I remember, there were a few people offering advice in this thread that have actually been in the business. The problem is that my English teacher wants me to get an Annotated Bibliography, including some interviews, for an essay over my major. It's really about the problems getting into your field of work after you're done with college. I want to work on video games, and a computer science degree sounded like a good place to start. The worst that can happen is I have a college degree out of it, and I can work on games as a hobbyist. Anyway, If anyone doesn't mind e-mailing me back the answers to some questions, that would be just fine for an interview. As for credentials,I just need a name, company, position, and a game you've helped with(optional). I'll just trust that you're not pulling my leg. Preferably I'd like answers from people who've gotten a paycheck for their services, but I don't mind if Indie or garage studio types answer either. I'll take what I can get. Oh, and any of the questions you don't feel like answering, you don't have to. On the same note, if I worded it lovely and you want to make up your own meaning of the question or throw any other advice in there, that would make my day.

What type of education do you have? If it's a college degree, what program, majors, minors, etc. did you get?

I'm working on my computer science degree at the moment. Do you think this is a good or bad idea?

Did you have to move far away for your job? Are there jobs like yours available locally?

How long after your education did it take you to find work? How did you first start out?

How important is it for each person on a team to understand how to do the other guy's job? Like a level designer needing to know how to make models, or programmers knowing about the overall design?

On the subject of programmers, is there a need for specialized programmers? Are there some that specialize in net code, or some that specialize in AI? How important is it for one programmer to be well versed in all aspects of coding?

What is your favorite game engine you've used? What about programming language, and why you prefer that one?

It cheapens my survey(Don't feel obliged to answer), but how do you get paid, and how much? I'm wondering how much it varies between people. For instance, if a free indie game project gets off the ground, then do all the people working on the project get paid later? I'm just guessing because I have no idea how it works.

My last question is more open ended. What would you say is the biggest problem with your line of work? People, hours, attitudes, whatever bothers you the most, I want to know what it is, and preferably how you'd like to see it done differently.

Any other advice or wisdom you'd like to pass on is more than welcome.

Sorry for spamming the thread, this just looked as good of a place as any. Please email any responses to my e-mail address, which is my user name @gmail.com. No harm in posting it here, but I don't know if I can use that as an interview.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
There are several A/T threads about that topic, which would be a better place to ask. I don't work in the industry, but I'll relay some second-hand answers that keep popping up:

In general, yes, you want a comp sci degree, but an internships would be extremely helpful since experience weighs pretty heavily. A killer demo is about the best thing you can possibly make.

Location-wise, there are casual game developers all over the place but the big development hotbed is Los Angeles. It's also burgeoning in Portland, Raleigh, and the San Francisco bay area.

Favorite programming languages and favorite engines are probably going to fall away from most useful. Unreal Engine is by far the most useful to have right now, failing that, Unity. Mobile developers LOVE Unity. Lua is becoming a very popular embedded language in in-house engines as well.

Sex Bumbo
Aug 14, 2004

Ludicrous Gibs! posted:

It also returns collisions for a pair of objects on the same x plane moving horizontally at the same speed with no contact between boxes.

Not sure why it would keep returning collisions but if the relative velocities are the same, it's going to skip everything in the for loop and compare 0 <= 1 at the end due to u0 and u1's initial values.

The constant returning of collisions is probably due to how you're handling collisions.

Also, if you're interested, there are fancy pants SSE collision data structures in <xnacollision.h> in the DXSDK.

Sex Bumbo fucked around with this message at 18:38 on Nov 10, 2009

Ludicrous Gibs!
Jan 21, 2002

I'm not lost, but I don't know where I am.
Ramrod XTreme
Thanks for the responses, guys. It's pretty apparent that there are some big holes in the article author's implementation, and I'm going to have to try and understand the underlying math a bit better.

Stanlo: I took a look at the XNA collision code, but unfortunately, it doesn't seem to deal with the problem I'm facing, which is AABB sweeping. The Gamasutra article's AABB class works fine for simple collision tests; I'm just concerned about catching collisions that occur between updates.

Edit: gently caress, gently caress, gently caress. Upon reading pg. 1 of the article, the sweep test is supposed to give you possible times of intersection for interpolation purposes. You need to double-check them to make sure. That'll teach me to skim over multi-page articles. :downs:

Ludicrous Gibs! fucked around with this message at 02:48 on Nov 12, 2009

Hanpan
Dec 5, 2004

So, Unity3D indie is free now. I've been using it a lot as of late and I definitely recommend checking it out. Has anyone managed to make anything cool with it yet?

almostkorean
Jul 9, 2001
eeeeeeeee
Thanks to the people above that let me know about DirectInput/XInput. I ended up ordering a 360 wheel/pedals and it works great and was very easy to setup.

Now I'm having trouble modeling how the gas pedal should work. The simulator I have calculates RPMs, and I'm basically using a percentage of how far the pedal is pushed in to tell how much the RPMs should increase. This works for when you want to accelerate quickly, but how can I make it more like a real automatic car, where your RPMs "level out" when you leave the pedal at the same spot? If anyone can point me in the right direction it would be much appreciated

edit: also, this is probably a long shot, but if anyone knows or has done car engine sound sampling let me know. I'm trying to get samples of car engines at specified RPM values. I have access to a dyno if need be, but don't know much about what equipment I will need, and what the best way to actually record the sound is.

almostkorean fucked around with this message at 18:40 on Nov 12, 2009

Fecotourist
Nov 1, 2008

almostkorean posted:

The simulator I have calculates RPMs, and I'm basically using a percentage of how far the pedal is pushed in to tell how much the RPMs should increase. This works for when you want to accelerate quickly, but how can I make it more like a real automatic car, where your RPMs "level out" when you leave the pedal at the same spot? If anyone can point me in the right direction it would be much appreciated

It sounds like you don't have access to a rigorous physics simulation, so a trivial model that may be good enough is something like
code:
rpm += K*timestep*(RPMfinal - rpm)
Where RPMfinal is computed from the throttle input (and optionally road gradient, etc.) and K is a constant related to the power/weight ratio of the car. Drag is implied in the value of RPMfinal.

The1ManMoshPit
Apr 17, 2005

There's now a free (for non-commercial applications) version of the Unreal Engine available: http://www.udk.com/index.html

Looks pretty cool. With that and free Unity there certainly are some interesting choices out there for amateur/indie game devs or even just for loving around with ideas.

Hanpan posted:

So, Unity3D indie is free now. I've been using it a lot as of late and I definitely recommend checking it out. Has anyone managed to make anything cool with it yet?

I've never used it myself, but these guys do all their stuff in Unity, and at least one of them is a goon. I dunno if he posts in CoC though.

Adbot
ADBOT LOVES YOU

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Has anyone here had any luck developing games in Silverlight? If so, could you elaborate on how it went / is going?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply