Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / NGC Collision (detecting while animating)

Author
Message
Zedane
20
Years of Service
User Offline
Joined: 3rd Nov 2004
Location: Milky Way, Earth
Posted: 5th Jan 2006 23:22 Edited at: 5th Jan 2006 23:22
I am using NGC v.3 for a project, and up until now everything has been going smoothly. I defined an elipsoid to be as large as the player, and gravity and collision worked smoothly. Since the player has a sword, i used a limb to attach to sword to his hand and detected collision seperatly.

But now that I am actually testing to make sure collision is working i am notcing issues. When animating, it does not look like the elipsoid changes in anyway, now i understand that it would not be easy for NGC to mold the ellip to the chara's animation, and i since i knew that from the start, i decided that it was okay, and i just need it to detect collision and the general body (chest head and legs), but now i want to check if an enemy hits a player, and sometimes the enemy does hit, but NGC does not register due to the ellip not being of the correct size.


My questions are this :
1) Is there anyway to detect collision on all parts of the charecter while animating?
2) Is there a fix for the problem that when animating the collision is not allways correctly detected
--basically is there a smarter way to go about collision
3) Can someone fully explain offset ellipsoid, because that may be my problem. Up till now i have just winged it, untill the chara's feet touched the ground.
4)My chara is scaled (500,500,500), and when i do that the ellisoid does not scale with it (i think), what exactly happens when i scale the object (scaleobjpro), and what does NGC not calculate? Should i just make the ellipsoid the size of the object after scaling? Should i re-offset the ellipsoid?

Thanks for your time
Zedane


around here.. normal's just a setting on a hair dryer
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Jan 2006 00:18
First off NGC v3 is very bugged. I would revert back to v2.03 until v4 comes out (testing for v4 is slated to start tomorrow so it shouldn't be too long). If you do not have v2.03 download the trial or email matthew for the full version (if you bought v3 he will give you v2.03).

Quote: "1) Is there anyway to detect collision on all parts of the charecter while animating?"

Not really as DBP doesn't really give direct access to the object's info.

Quote: "2) Is there a fix for the problem that when animating the collision is not allways correctly detected
--basically is there a smarter way to go about collision"

See question 1, but you could setup something manually if you know how the animations and models are setup.

Quote: "3) Can someone fully explain offset ellipsoid, because that may be my problem. Up till now i have just winged it, untill the chara's feet touched the ground."

The offset is there to align your models in all 3 directions if their local 0,0,0 coords are not in the correct location. If your model's 0,0,0 is in the center of the object but at the bottom then the y value will need to be offset by half the object's height to line the ellip back up to it.

Quote: "4)My chara is scaled (500,500,500), and when i do that the ellisoid does not scale with it (i think), what exactly happens when i scale the object (scaleobjpro), and what does NGC not calculate? Should i just make the ellipsoid the size of the object after scaling? Should i re-offset the ellipsoid?"

I don't think NGC recalcs the ellips for new scales as the ellip size is independant of the model size. You will need to update this with a call for the ellipsize. The scaleobjpro only affects polygon collisions in NGC far as I know.

Zedane
20
Years of Service
User Offline
Joined: 3rd Nov 2004
Location: Milky Way, Earth
Posted: 6th Jan 2006 00:26
Thanks,
So now that i have an animated chara, what is the best way to go about collision? Especially since i need fast, precise collision for objects (doing a dynasty warriors clone).


around here.. normal's just a setting on a hair dryer
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Jan 2006 00:33
I don't know of any good way to do collision against animated objects that would be fast. I am either manually coding some animations or faking the collision with zones and timers.

Zedane
20
Years of Service
User Offline
Joined: 3rd Nov 2004
Location: Milky Way, Earth
Posted: 6th Jan 2006 00:35
zones and timers? how does that work? (I wouldnt mind manually doing collisions if i could JUST GET THE DARN THING TO WORK XD)


around here.. normal's just a setting on a hair dryer
Epimetheus
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 6th Jan 2006 04:18
a little off topic from this post, but how would I be able to have my main character be able to push other characters? Such as having the character run through a group of enemies. Thanks.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Jan 2006 09:49 Edited at: 6th Jan 2006 09:49
With zones and timers I setup collision zones around the player and depending on how long the animation has been running (or a span of frames it is at say like 120 to 150) tells me which zone to test against.

Quote: "a little off topic from this post, but how would I be able to have my main character be able to push other characters? Such as having the character run through a group of enemies. Thanks. "


Either use a physics engine or Have a look at the binary moon tutorials.

Epimetheus
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 7th Jan 2006 02:32
yes thats a good idea, but I though it might be possible in using NGC because I have seen a lift in the demo move a character, would'nt the same be possible with character to character collisions, except with reguards to pushing characters out of your way?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Jan 2006 03:09
I guess if you didn't mind the slow down you could do it. Just setup a ellip to poly collision with dynamic response. Have the object you want to do the pushing be the poly and the one to be pushed be an ellip. It would probably be faster to use ellip to ellip and modify the technique used in the binary moon tutorial though as polygon collision is slow. And rotations don't work with NGC properly just yet.

Epimetheus
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 7th Jan 2006 06:17
Okay I'll try both and see which works best, thanks.
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 9th Jan 2006 02:06
i think for this situation it would be fastest (although not very accurate) to play the attacking animation, then detect if the player's body is close enough to the enemy. simply register a hit on the enemy if the player is close enough and the player is attacking.

"Genius is 1% inspiration and 99% perspiration"
Zedane
20
Years of Service
User Offline
Joined: 3rd Nov 2004
Location: Milky Way, Earth
Posted: 10th Jan 2006 02:22
That may work. I will make an object at the tip of the sword and one at the end. and then check the distances. if both objects have collided with the enemy, its a 100% hit. If one is inside, and the other is not, its a simple matter of using a third object, to make sure. If neither is inside, then you check the distance between the enemys collision box, sword, then use a value (that i still must find out) for the animation to decide % of error and use that to figure out if there is a good chance of it hitting or not.
I think ill make my enemies as simple as possible (GOOMBA time!)


around here.. normal's just a setting on a hair dryer
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 10th Jan 2006 02:29
Yeah I just use precalced zones to tell if the enemy is in front of my player so you can't hit him when he is behind you. It is really the same type of setup though. Of course if it is a FPS you could just check to see if the enemy is inside the camera's frustum and then check the distance.

hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 10th Jan 2006 19:02
You dont need all this flashy software to do something as simple as that. I'm making a 3D fighting game and how i detect impact collision is by simply using a distance calculation. You know, the old:

dist = sqrt(sqr(x2-x1)+sqr(y2-y2)+sqr(z2-z1))

When you attack and your 3D object starts doing the animation, the dark basic pro 'limb position' commands return the true limb positions in 3D space. So like to get the x axis position you would use something like:

x# = limb position x(object num,limb num)

You wanna detect a collision between player 1's sword and player 2's chest, use both their limbs in a distance calculation and set a limit value so if the distance is less than the limit a collision has occured. You dont even need to make any extra objects at the sword tip or anywhere else.

Hope that helps.

Login to post a reply

Server time is: 2024-11-22 00:17:10
Your offset time is: 2024-11-22 00:17:10