Game Development Community

RTS Starter Kit and Collison

by Univ. of Michigan Dearborn (#001 · in RTS Starter Kit · 03/02/2006 (10:22 pm) · 31 replies

I'm working on an RTS with the starter kit. I need collision detection with the rtsunits. My plan is to take the collison code from the player and put it into the rtsunit, as was one of the solutions I've found on the forums.

Before I start plugging away at it, however, I was wondering if anyone has already done it. If so, is the code available anywhere? And/or do you have any advice for getting started? Is is an easy enough change to make?

Thanks in advance,

-Nick
Page«First 1 2 Next»
#21
03/13/2006 (10:19 am)
YAY! Collisons are working! Thank you all!

Now I just need to fix the Z-loc problem. lol

If anyone has any input on that, It would also be appretiated. :]

-Nick
#22
03/13/2006 (11:19 am)
Nic-
The first target is probably to look at the z-pos code that we commented out in order to get collisions working.
#23
03/13/2006 (11:32 am)
Yea. That's what I'm looking at right now.

-Nick
#24
03/13/2006 (8:23 pm)
A problem... The collisions don't appear to be working for Triggers.

The rtsunits aren't triggering the triggers.

-Nick
#25
03/14/2006 (1:59 am)
Hmmm, I think triggers are tied to something else, I'll check it out!
#26
03/15/2006 (3:49 am)
Z-pos can be had by adding the following after Player::updatePos() change:

location = getPosition();

then add back the code commented out for
PROFILE_START(RTSUnit_Z);
and
PROFILE_START(RTSUnit_UpdatePos);

seems to work
#27
03/15/2006 (7:04 pm)
James

Well it doesn't fix the floating units. Though the collison it still here.
#28
03/16/2006 (4:20 am)
Hmmm, my units are stuck to the ground. Used to be after walking up a hill and then back they
would stay at the z-pos of the hill. Now they do not.

Did you add "location = getPosition();" just
before adding back the two pieces of code that were commented ?
#29
03/16/2006 (9:34 pm)
Hmm... Ok I maybe I have the code in the wrong order? I'll have to play around with it. But going to be away for the weekend, so I'll play around with the code when I get back. Thanks for the help btw!

-Nick
#30
03/29/2006 (12:57 pm)
Got it! Thank you James! The units are now correctly on the ground.

Now I've just got to get triggers working. The units can still walk right through them without triggering them. I'm working on the problem. If anyone has any ideas, help would be much appretiated!

-Nick
#31
05/07/2006 (10:52 pm)
@ Nick (UMD #001)

I believe triggers are handled by updateMove() whereas collision is handled by updatePos(). If I understand things correctly you need to get updateMove working in RTSunit.cc in order to get triggers working.
Page«First 1 2 Next»