Illumina + Helicopters
by Ian Roach · 11/16/2006 (3:52 pm) · 8 comments
Time for my weekly .plan update.
This week ive been working on the 3rd person camera and also implementing my flying vehicles.
Third Person Camera
Ive been tweaking back and forth on where my camera will position when moving, still not quiet there yet, but i do have it in a pretty good over the shoulder location. My next trick is to use it across all things (vehicles/turrets e.t.c)
Not related to the camera, but ive also now been able to get multiple crosshairs for different occasions, so a smaller/less visible crosshair is used when not using the iron sights, but it switches to a larger/more focused crosshair when using the iron sights.
Helicopters
I took the excellent helicopter resource available here, and adapted it to work with my assualt helis. It currently flies well, but still feels too "Floaty" and can basically stop dead in midair, with no affect to my gravity or no inertia, so it kind of feels like a hovervehicle atm. If anyone knows how to give it a more "heavier" feel please let me know.
As part of implementing helicopters, ive been trying to use the "playThread" commands to plan multiple animations.
My vehicle currently has 4 animations, all of which i want to trigger when i mount. However using playThread multiple times on different thread numbers doesnt seem to work. Likewise using setThreadDir to reverse the animation when i dismount doesnt work either.
If anyone is familiar with playThread,setThreadDir and stopThread i would love your help :)
Here is a movie of my helicopter in action
www.singlecellgames.com/helis.avi <- 21 meg, xvid
----------------
My task for the next week is to cleanup the camera, tweak my player movement settings, fixup animation issues and look into general interface/cleanup.
If all goes well, expect a new demo in a few weeks :)
This week ive been working on the 3rd person camera and also implementing my flying vehicles.
Third Person Camera
Ive been tweaking back and forth on where my camera will position when moving, still not quiet there yet, but i do have it in a pretty good over the shoulder location. My next trick is to use it across all things (vehicles/turrets e.t.c)
Not related to the camera, but ive also now been able to get multiple crosshairs for different occasions, so a smaller/less visible crosshair is used when not using the iron sights, but it switches to a larger/more focused crosshair when using the iron sights.
Helicopters
I took the excellent helicopter resource available here, and adapted it to work with my assualt helis. It currently flies well, but still feels too "Floaty" and can basically stop dead in midair, with no affect to my gravity or no inertia, so it kind of feels like a hovervehicle atm. If anyone knows how to give it a more "heavier" feel please let me know.
As part of implementing helicopters, ive been trying to use the "playThread" commands to plan multiple animations.
My vehicle currently has 4 animations, all of which i want to trigger when i mount. However using playThread multiple times on different thread numbers doesnt seem to work. Likewise using setThreadDir to reverse the animation when i dismount doesnt work either.
If anyone is familiar with playThread,setThreadDir and stopThread i would love your help :)
Here is a movie of my helicopter in action
www.singlecellgames.com/helis.avi <- 21 meg, xvid
----------------
My task for the next week is to cleanup the camera, tweak my player movement settings, fixup animation issues and look into general interface/cleanup.
If all goes well, expect a new demo in a few weeks :)
#2
Heres my mount dismount functions for playthread
function AssaultFighter1::playermounted(%data, %obj, %player)
{
%obj.schedule(500, "playThread", 0, "Lgear_Lower/Raise");
%obj.schedule(500, "playThread", 1, "Missile Bay");
%obj.schedule(500, "playThread", 2, "cotpit");
%obj.schedule(500, "playThread", 3, "Thrusters_Pitch");
}
function AssaultFighter1::playerDismounted(%data, %obj, %player)
{
//set all threads to play in reverse
%obj.setThreadDir(0, false);
%obj.setThreadDir(1, false);
%obj.setThreadDir(2, false);
%obj.setThreadDir(3, false);
//play in reverse
%obj.schedule(500, "playThread", 0, "Lgear_Lower/Raise");
%obj.schedule(500, "playThread", 1, "Missile Bay");
%obj.schedule(500, "playThread", 2, "cotpit");
%obj.schedule(500, "playThread", 3, "Thrusters_Pitch");
}
Problem is , it doesnt work :( animation names are correct, sometimes some of the animations play, sometimes they dont.
11/16/2006 (5:52 pm)
Thanks Tim, ill definetely adjust gravity, i assume the lower the negative the number the higher the gravity ?Heres my mount dismount functions for playthread
function AssaultFighter1::playermounted(%data, %obj, %player)
{
%obj.schedule(500, "playThread", 0, "Lgear_Lower/Raise");
%obj.schedule(500, "playThread", 1, "Missile Bay");
%obj.schedule(500, "playThread", 2, "cotpit");
%obj.schedule(500, "playThread", 3, "Thrusters_Pitch");
}
function AssaultFighter1::playerDismounted(%data, %obj, %player)
{
//set all threads to play in reverse
%obj.setThreadDir(0, false);
%obj.setThreadDir(1, false);
%obj.setThreadDir(2, false);
%obj.setThreadDir(3, false);
//play in reverse
%obj.schedule(500, "playThread", 0, "Lgear_Lower/Raise");
%obj.schedule(500, "playThread", 1, "Missile Bay");
%obj.schedule(500, "playThread", 2, "cotpit");
%obj.schedule(500, "playThread", 3, "Thrusters_Pitch");
}
Problem is , it doesnt work :( animation names are correct, sometimes some of the animations play, sometimes they dont.
#3
11/16/2006 (6:58 pm)
Well your game takes place a bit in the future right? maybe helicopters will hover so perfectly then :-)
#4
11/16/2006 (7:22 pm)
J Sears : True . they are more hover vehicles then helis anyway, but it still seems abit too easy to control :)
#5
Im not sure if this has anything to do with your problem, but one thing Ive noticed about setThreadDir() is that it does not kick in until the animation is restarted. in other words, you cant change the direction while a thread is running, and you can't pause and change the direction either. you have to completely stop the animation first, then you can setThreadDir() and play it in reverse.
also, did you make sure you exported the animations as blend animations? they need to be since you're playing more than one simultaneously.
11/17/2006 (8:16 am)
Ian, are you sure vehicles support animations?Im not sure if this has anything to do with your problem, but one thing Ive noticed about setThreadDir() is that it does not kick in until the animation is restarted. in other words, you cant change the direction while a thread is running, and you can't pause and change the direction either. you have to completely stop the animation first, then you can setThreadDir() and play it in reverse.
also, did you make sure you exported the animations as blend animations? they need to be since you're playing more than one simultaneously.
#6
11/17/2006 (8:27 am)
Vehicles (to my knowledge) does not support blended animations.
#7
It could be that the animation thread is being re-used for something else, causing your threads to fail (the default thread id's my already be in use).
11/17/2006 (9:16 am)
Ian, I'd recommend simply writing the animation stuff in C++. I did that for the planes in air ace and multiple threads definitely DOES work ok.It could be that the animation thread is being re-used for something else, causing your threads to fail (the default thread id's my already be in use).
#8
11/19/2006 (7:25 am)
@Ian - this looks awesome. Great explosions, and cool texturing of the landscape. The design of the buildings is spot on too - nice work!
Torque Owner Tim Heldna
Play around with that number to adjust gravity.
Check out the updateForces function if you want to modify maneuvering.
//------------------------------------------------------------- //Thread Animation Commands //------------------------------------------------------------- %obj.playThread(0,"Anim"); //play the animation %obj.stopThread(0,"Anim"); //stop the animation %obj.pauseThread(0,"Anim"); //pause the animation %obj.setThreadDir("Anim",1); //set animation direction forward %obj.setThreadDir("Anim",0); //set animation direction backward%obj = shape to play animation onAnim = name of the animation