trueaxis.com Forum Index trueaxis.com
True Axis Physics SDK Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some game engine questions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Mark Tanner



Joined: 24 Feb 2005
Posts: 5
Location: USA

PostPosted: Tue Apr 12, 2005 12:58 pm    Post subject: Some game engine questions Reply with quote

Hello Luke,

I am converting an existing game to use TrueAxis, so I am coming across several (luckily small) questions. Surprisingly it was possible to get TrueAxis working near perfect in less than one day Very Happy Great stuff!

In any case, here are the things I'm wondering about. Looks like a lot but each issue is pretty straightforward:

1. Unit/world scale. If a graphics engine uses 1 inch/unit, would TrueAxis scale well or would it be better to convert to 1m/unit and back when getting TrueAxis' transforms? In a inch/unit world, the sizes and gravity are a lot larger.

2. The game environment is city-type (many box-like buildings around 10m WxHxD). To create the 'floor' so that no objects fall through, would it be better to use one big poly (2 tris) say 500mx500m or split this up into several smaller polygons? I'm wondering since one large poly would be very different in size to the rest of the city's meshes.
(BTW I'm adding all of these meshes and the floor to the one AABB mesh like as advised in the help file.)

3. To play sound fx on collisions, I understand to use the recent collision list inside the dynamic object. But what would be a typical way to use the collision's info to determine a large enough collision took place to warrant playing a sound effect? I see that some collisions cause an intersection depth of 0.0f - 0.5f, some a very small impulse, etc. Should I do a value of depth*impulse to determine a collision's 'strength' or is there a better way? Basically not sure which collision info members are best to use.

4. Since the game engine is in a working state, I need to ragdoll existing bone-animated characters. This is a bit different from the ragdoll sample.

The characters are already animated in some pose and need to be converted into a ragdoll without too much change in their pose.
I got this working fine except I'm not sure about some of the joints parameters:

For a socket joint, the center normals, do these point away from the bone towards the joint? For example taking a typical upper/lower leg setup, does the lower leg normal point towards the knee joint or away from it along the bone?

For other joints, the 'm33DefaultRotationOfOtherObject' matrix, is this the local(?) bone matrix at character creation time or at the time of converting to ragdoll?

5. In the ragdoll sample, I see that it is ok to set the collision exclusion id's even before that particular dynamic object has been assigned an id? Just checking.

6. Limiting rotation. Imagine shooting a barrel in a game world. The first hit will move and rotate it a bit. But if you keep shooting at it while not yet at rest (for example while in the air), you can get it to rotate at too high velocity. How can I limit this so that it won't look like spinning too much?

7. Does 'debug' rendering the AABB mesh work in release mode? I seem to be able to render it compiling in debug mode but it crashes in release mode. Rendering the dynamic objects works in both it seems.

8. When deleting jointed objects, do I first ->release the joint then the two dynamic objects?

9. Finally, I sometimes see jittering of dynamic objects when they hit the floor. For example a box will almost come to rest but then jump around a bit. Can I prevent this without having it come to rest too quickly so that it looks dampened?

Thanks for taking the time for this!

Mark
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Wed Apr 13, 2005 12:55 pm    Post subject: Reply with quote

Thats a lot of questions...

I'll trie to answer everything.

Mark Tanner wrote:
Hello Luke,
1. Unit/world scale. If a graphics engine uses 1 inch/unit, would TrueAxis scale well or would it be better to convert to

1m/unit and back when getting TrueAxis' transforms? In a inch/unit world, the sizes and gravity are a lot larger.


True Axis is sensitive to scale and it will work better if you use meters as the scale. (Unless all your objects are very

small)

Mark Tanner wrote:

2. The game environment is city-type (many box-like buildings around 10m WxHxD). To create the 'floor' so that no objects

fall through, would it be better to use one big poly (2 tris) say 500mx500m or split this up into several smaller polygons?

I'm wondering since one large poly would be very different in size to the rest of the city's meshes.
(BTW I'm adding all of these meshes and the floor to the one AABB mesh like as advised in the help file.)

True Axis isn't well tested with such large polygons but there probably isn't to much that can go wrong with one larg axis

alligned polygon. However, generally speaking, you will get better accuracy by spitting into smaller polygons.


Mark Tanner wrote:

3. To play sound fx on collisions, I understand to use the recent collision list inside the dynamic object. But what would be

a typical way to use the collision's info to determine a large enough collision took place to warrant playing a sound effect?

I see that some collisions cause an intersection depth of 0.0f - 0.5f, some a very small impulse, etc. Should I do a value of

depth*impulse to determine a collision's 'strength' or is there a better way? Basically not sure which collision info members

are best to use.

You probably want to use impulse for this. You could check how much the velocity changed in the last frame.

Mark Tanner wrote:

4. Since the game engine is in a working state, I need to ragdoll existing bone-animated characters. This is a bit different

from the ragdoll sample.

The characters are already animated in some pose and need to be converted into a ragdoll without too much change in their

pose.
I got this working fine except I'm not sure about some of the joints parameters:

For a socket joint, the center normals, do these point away from the bone towards the joint? For example taking a typical

upper/lower leg setup, does the lower leg normal point towards the knee joint or away from it along the bone?

For other joints, the 'm33DefaultRotationOfOtherObject' matrix, is this the local(?) bone matrix at character creation time

or at the time of converting to ragdoll?


m33DefaultRotationOfOtherObject lets you set up the joint how you like nomatter the configuration of the 2 objects at the

time. It gives the position of one object relative to the other that the joint will work in. Each objects actuall

configuation at the time is irrelevant.

If you want the add joint function to use their current configuartion, set the m33DefaultRotationOfOtherObject parameter to

be objectB.GetFrame() * objectA.GetFrame().GetInverse()

There are some types for this somewhere in an earlier post.


Mark Tanner wrote:

5. In the ragdoll sample, I see that it is ok to set the collision exclusion id's even before that particular dynamic object

has been assigned an id? Just checking.


Yes, this should be fine.

Mark Tanner wrote:

6. Limiting rotation. Imagine shooting a barrel in a game world. The first hit will move and rotate it a bit. But if you keep

shooting at it while not yet at rest (for example while in the air), you can get it to rotate at too high velocity. How can I

limit this so that it won't look like spinning too much?


You can just alter the angular velocity your self with the SetAngularVelocity and GetAngularVelocity functions.

There will probably be some more parameters for tweeking things like max anular velocity sometime in the not to distant

future.


Mark Tanner wrote:

7. Does 'debug' rendering the AABB mesh work in release mode? I seem to be able to render it compiling in debug mode but it

crashes in release mode. Rendering the dynamic objects works in both it seems.


That will have to be looked into. It should have been fixed for version 1.0.0.3 but this sounds like a new bug.

Mark Tanner wrote:

8. When deleting jointed objects, do I first ->release the joint then the two dynamic objects?


Joints don't have a release but you can remove them with a function on the DynamicObject they where created with.

When a dynamic object is released, all the joints attached to it should be cleaned up automatically.


Mark Tanner wrote:

9. Finally, I sometimes see jittering of dynamic objects when they hit the floor. For example a box will almost come to rest

but then jump around a bit. Can I prevent this without having it come to rest too quickly so that it looks dampened?
Mark


See if this improves if uses meteres instead of inches.
Back to top
View user's profile Send private message Send e-mail
Mark Tanner



Joined: 24 Feb 2005
Posts: 5
Location: USA

PostPosted: Sun Apr 17, 2005 5:18 pm    Post subject: Reply with quote

Luke, thanks for the answers. I have been rewriting the code taking these into account.

The only issue left is still playing sound fx for collisions. For example, a barrel rolling along the floor generates a lot of collisions; I check the impulse and also the velocity and determine if a sound effect should be played, but this still sounds a bit too random.

It must be a combination of impulse, velocity, etc. Can you think of any better way to determine a collision?

Thanks!
Back to top
View user's profile Send private message
Ultrasauce



Joined: 28 Feb 2005
Posts: 62

PostPosted: Sun Apr 17, 2005 8:57 pm    Post subject: Reply with quote

Yeah, i'd have to agree. I'm playing with it a bit and I'm finding that although TA has proven to be awesome, I can't figure which way is best for sound integration.

Any tips or recommendations, Luke?
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Mon Apr 18, 2005 3:18 am    Post subject: Reply with quote

Intuitively I would think the best way to choose whether a should should be played would be to check how much velocity has changed between frames. This way the sound will play baced on the change in movement which should make sence to the person watching. Thats how I would try to do it.
Back to top
View user's profile Send private message Send e-mail
Ultrasauce



Joined: 28 Feb 2005
Posts: 62

PostPosted: Mon Apr 18, 2005 4:07 am    Post subject: Reply with quote

how about collisions... such as a clanking sound when a metal barrel gets hit by a bullet?
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Apr 18, 2005 9:42 am    Post subject: Reply with quote

I'd use the velocity change, then check the list of collisions to what surface caused it.

The main problem with checking individual collisions alone is that if you have a box underneath a heap of stacked boxes, it will recieve large impulses, but you don't want a sounds played in this case because no impact has taken place.

I supose you could try to calculate the change in velocity at each collision point along the collision normal, that might be more usefull for sound intergration.
Back to top
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Mon Apr 18, 2005 2:12 pm    Post subject: Reply with quote

That guest post was from me. It seems that sometimes when I log on to the forum I don't actually get logged on.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group