Flying vehicle
by Gotland_0001 · in Torque Game Engine · 05/10/2006 (5:55 am) · 15 replies
We are working on a project here in school and all of us are a bit new to Torque but it seems that there are not bone or animation support for the flying vehicles in Torque at present, am I right?
Our problem is that we have a organic flying creature so we need the flying but we also need the bone and animation support so that we can animate the character properly as he flies around.
In other words:
* Flying physics
* Full animation
Or is there someone that has some neat tricks up their sleeve that we can pull on the engine to get it?
Any help would be deaply appreciated.
Our problem is that we have a organic flying creature so we need the flying but we also need the bone and animation support so that we can animate the character properly as he flies around.
In other words:
* Flying physics
* Full animation
Or is there someone that has some neat tricks up their sleeve that we can pull on the engine to get it?
Any help would be deaply appreciated.
#2
It looks like there is no easy answer on how to do it so we are thinking on follow these instructions but change the movement so that the player get something resembling flying instead and then touch it up with commenting out all the parts of the Player code that makes you fall when you are in the air...
I have not started it yet because I am working on some other gameplay features at the moment but it is the best Idea I have found at the moment.
05/10/2006 (6:36 am)
Our lead designer gave me the swimming resource: RESOURCEIt looks like there is no easy answer on how to do it so we are thinking on follow these instructions but change the movement so that the player get something resembling flying instead and then touch it up with commenting out all the parts of the Player code that makes you fall when you are in the air...
I have not started it yet because I am working on some other gameplay features at the moment but it is the best Idea I have found at the moment.
#4
It's a pretty simple matter to make the player ignore gravity, if that's what you mean.
If you want to I can hook you up with some code you can look at that basically makes the player a flying vehicle but without the rolling (I'm working on that as we speak) and some simplified physics.
If you got msn we can talk there, or you can call me by phone if you prefer.
Send me an email if you're interested. (check my profile)
Good luck anyhow!
Edit: Nice link Bruno, haven't seen it before. Looks like that would work too.
05/10/2006 (6:57 am)
Quote:
It looks like there is no easy answer on how to do it so we are thinking on follow these instructions but change the movement so that the player get something resembling flying instead and then touch it up with commenting out all the parts of the Player code that makes you fall when you are in the air...
It's a pretty simple matter to make the player ignore gravity, if that's what you mean.
If you want to I can hook you up with some code you can look at that basically makes the player a flying vehicle but without the rolling (I'm working on that as we speak) and some simplified physics.
If you got msn we can talk there, or you can call me by phone if you prefer.
Send me an email if you're interested. (check my profile)
Good luck anyhow!
Edit: Nice link Bruno, haven't seen it before. Looks like that would work too.
#5
Player class uses matrix methods of storing rotational and positional info, and vehicles (which many times need ungimballed motion) use quaternions.
Player by default does not network anything but Z-axis rotation (yaw only, no pitch or roll) as a networking optimization.
Your challenge here would be to analyze the networking and math behind the physics of the Vehicle class, and apply it to the Player class. Not trivial, but IMO a bit easier than the reverse direction (giving the animation functionality that Player provides above and beyond ShapeBase into Vehicle).
05/10/2006 (11:37 am)
The one major "barrier" (it's not a big deal if you understand networking in Torque) for using Player as a full 6 degrees of freedom flying vehicle is in two parts:Player class uses matrix methods of storing rotational and positional info, and vehicles (which many times need ungimballed motion) use quaternions.
Player by default does not network anything but Z-axis rotation (yaw only, no pitch or roll) as a networking optimization.
Your challenge here would be to analyze the networking and math behind the physics of the Vehicle class, and apply it to the Player class. Not trivial, but IMO a bit easier than the reverse direction (giving the animation functionality that Player provides above and beyond ShapeBase into Vehicle).
#6
Aren't you exagurating a bit? I'm by far a skilled programmer and I'm almost done with my modification of the playerclass, and it has been 2 days. I might be missing something but so far it works great on my end.
05/10/2006 (12:18 pm)
Stephen,Aren't you exagurating a bit? I'm by far a skilled programmer and I'm almost done with my modification of the playerclass, and it has been 2 days. I might be missing something but so far it works great on my end.
#7
05/10/2006 (12:21 pm)
I don't think he was exaggerating, just preparing :) When you say it works great Stefan, does this include network?
#8
As I said, not trivial, but not extremely complex if you have that core understanding.
05/10/2006 (12:26 pm)
@Stefan: You've been using Torque for quite a while, not everyone reading this thread has--I just wanted folks to understand we're not talking script changes here, but code changes that require core understanding of two of the most complex systems in Torque: networking and quaternion/matrix math!As I said, not trivial, but not extremely complex if you have that core understanding.
#9
Of course saying it's "easy" depends who you're asking, so I guess you're right.
@Tim Heldna: Of course! It was a priority to get it working in a network enviroment as that's why I'm using Torque :)
I had a few updating errors on rotating around the X axis (in my implementation the armthread/look animations do not exist anymore) but that was just a matter of updating mRot.x in PacketData.
05/10/2006 (12:51 pm)
@Stephen Zepp: Sorry, I didn't mean it that way.. I had no prior C++ experience at all before joining this community and only recently started digging into the engine core.Of course saying it's "easy" depends who you're asking, so I guess you're right.
@Tim Heldna: Of course! It was a priority to get it working in a network enviroment as that's why I'm using Torque :)
I had a few updating errors on rotating around the X axis (in my implementation the armthread/look animations do not exist anymore) but that was just a matter of updating mRot.x in PacketData.
#10
05/10/2006 (12:53 pm)
@Stefan: hehe..you need to give yourself more credit--you're one of the more experienced ones around! No one at all knows everything--I teach Torque technology, and I learn something new every Boot Camp!
#11
05/10/2006 (12:55 pm)
So from your experience Stefan, would it be viable to create a helicopter in this manner? Or would the physics required be better left to a tweaked flyingVehicle class?
#12
@Tim: I thought there was a helicopter resource already, which was based on flyingVehicle.
To answer your question I'd have to ask, what type of physics are you looking for? Very realistic ones? (I recall you working on a military simulation)
Edit: Just noticed you were co-author of the resource. Don't you consider it complete?
05/10/2006 (1:22 pm)
@Stephen: Thanks, and yeah I understand what you are saying.. Learning while teaching, that's gotta be something special.@Tim: I thought there was a helicopter resource already, which was based on flyingVehicle.
To answer your question I'd have to ask, what type of physics are you looking for? Very realistic ones? (I recall you working on a military simulation)
Edit: Just noticed you were co-author of the resource. Don't you consider it complete?
#13
05/10/2006 (8:46 pm)
It's fine, I always look at alternative ways of doing things. I was just thinking of how useful animations would be.
#14
It is a fast and dirty way to solw it but it works fine for us and our school project.
Warning, remember that the dummy model handles the collision and that you have to get the StaticShape to mount on the dummy so that you get your center for turning and movement correct.
05/15/2006 (2:28 am)
We solwed our animated flying vehicle by creating a small dummy model that is fully invisible thanks to a completly transparen PNG texture and then mounted a animated Static Shape on it ;)It is a fast and dirty way to solw it but it works fine for us and our school project.
Warning, remember that the dummy model handles the collision and that you have to get the StaticShape to mount on the dummy so that you get your center for turning and movement correct.
#15
[ur]http://www.garagegames.com/mg/forums/result.thread.php?qt=32256[/url]
05/15/2006 (4:38 am)
Like Gotland says... but check this thread for more details...[ur]http://www.garagegames.com/mg/forums/result.thread.php?qt=32256[/url]
Torque Owner Stefan Lundmark
I would definatly consider modifying the playerclass. Now, I don't know if it's easy to bring in bone animations to flyingVehicle, but to me it does sound difficult so I went with the playerclass instead.
I'm working with the above modifications as we speak, let me know if there's anything I can help you with.