Author Topic: Maneuvering thrusters.  (Read 3839 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Maneuvering thrusters.
1) Screenie:


2) Table entry samples (After "$Trail:" stuff, right before subsystems)
Code: [Select]
$Thruster:
+Texture: Missiletrail03 ;;Graphic that will be used for trail, rendered like beams
+Radius: 3.0 ;;Radius of cylinder
+Length: 5.0 ;;Length of thruster trail
+Used for: ("pitch up") ;;What will trigger this thruster
+Position: (0.0 0.0 0.0) ;;Where the thruster is
+Normal: (0.0 1.0 0.0) ;;What direction it will point
$Thruster:
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
+Used for: ("pitch down")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 -1.0 0.0)

3) Use types:
Code: [Select]
flag_def_list Man_types[] =
{
{"Bank right", MT_BANK_RIGHT},
{"Bank left", MT_BANK_LEFT},
{"Pitch up", MT_PITCH_UP},
{"Pitch down", MT_PITCH_DOWN},
{"Roll right", MT_ROLL_RIGHT},
{"Roll left", MT_ROLL_LEFT},
{"Slide right", MT_SLIDE_RIGHT},
{"Slide left", MT_SLIDE_LEFT},
{"Slide up", MT_SLIDE_UP},
{"Slide down", MT_SLIDE_DOWN},
{"Forward", MT_FORWARD},
{"Reverse", MT_REVERSE},
};

4) Build (Includes sample .tbm used for testing):
http://fs2source.warpcore.org/exes/latest/C02042006.zip
-C

 

Offline FireCrack

  • 210
  • meh...
Re: Maneuvering thrusters.
Hmm, couldn't you do some math to auto-determine when, and with what intensity, the thruster should fire depending on it's position and normal?

Either way good work on this, i'l probably try to make some data for all my HTL models.

A more pertinent suggestion may be to be able to specify a "fire sound" and a "loop sound"
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Maneuvering thrusters.
I can see TBP making good use of this feature.  It's been a long time coming.  Thanks WMC.  BTW, firstly I'd like to know where in a table file that these entries be added.  Just before or after the $afterburner data?  Secondly, I know you've created this for the intention of supporting the RCS thrusters on the Vipers for BtrL, but I seem to recall the thrusters appearing like cones.  Are you gonna include a figure for narrowing of the thrustertrail (I think the term is +attenuation, like in the BEAM sections)?
The Trivial Psychic Strikes Again!

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Maneuvering thrusters.
That's awesome! (Even if it does mean som poor chap is now going to have to go through and implement it on all fighters. ;) ) Well done.  :yes:

Quote from: Trivial Psychic
firstly I'd like to know where in a table file that these entries be added. Just before or after the $afterburner data?
"2) Table entry samples (After "$Trail:" stuff, right before subsystems)"

Quote from: Trivial Psychic
Secondly, I know you've created this for the intention of supporting the RCS thrusters on the Vipers for BtrL, but I seem to recall the thrusters appearing like cones. Are you gonna include a figure for narrowing of the thrustertrail (I think the term is +attenuation, like in the BEAM sections)?
Assuming it doesn't translate the texture it uses, I'd imagine it'd just be a case of drawing the cone onto the texture itself - perhaps animating it with 2 or 3 frames to make it flickker.
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Maneuvering thrusters.
New entry style:
Code: [Select]
#Ship Classes
$Name: GTF Ulysses
$Thruster:
+Used for: ("pitch up")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 1.0 0.0)
+Texture: exp20
+Radius: 3.0
+Length: 5.0
+StartSnd: boom_2
+LoopSnd: BS_SRed
+StopSnd: boom_3
$Thruster:
+Used for: ("pitch down")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 -1.0 0.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
#End

As you can see, I've added sounds for starting, stopping, and looping. The looping sound hasn't been working for me so far, unfortunately, and I haven't been able to figure out why yet.

Animations are also now supported and tested.

I'm looking into a more efficient way of rendering these things atm...
-C

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Maneuvering thrusters.
I've noticed you've got a normal of 1.0 for pitch-up, and -1.0 for pitch down.  Does that mean that the listed normal is opposite of what one would think when referencing positions in MODview.  If I want my ship to thrust up for example, I would have one or more thrusters on the ventral, fire downwards, and downwards is typically a negative normal.
The Trivial Psychic Strikes Again!

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Maneuvering thrusters.
I've noticed you've got a normal of 1.0 for pitch-up, and -1.0 for pitch down.  Does that mean that the listed normal is opposite of what one would think when referencing positions in MODview.  If I want my ship to thrust up for example, I would have one or more thrusters on the ventral, fire downwards, and downwards is typically a negative normal.

Hmm, that is odd. Looks like FS2 uses reverse rotational velocity from what I thought, and it didn't work quite right with normal velocity. Both seem fixed now, though it could be tested a bit more.

http://fs2source.warpcore.org/temp/C03042006.zip

Here's a fuller thrust table:
Code: [Select]
#Ship Classes
$Name: GTF Ulysses
$Thruster:
+Used for: ("pitch up")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 -1.0 0.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
$Thruster:
+Used for: ("pitch down")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 1.0 0.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
$Thruster:
+Used for: ("bank right")
+Position: (0.0 0.0 0.0)
+Normal: (-1.0 0.0 0.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
$Thruster:
+Used for: ("bank left")
+Position: (0.0 0.0 0.0)
+Normal: (1.0 0.0 0.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
$Thruster:
+Used for: ("pitch up" "reverse")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 0.0 1.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
$Thruster:
+Used for: ("pitch down" "forward")
+Position: (0.0 0.0 0.0)
+Normal: (0.0 0.0 -1.0)
+Texture: Missiletrail03
+Radius: 3.0
+Length: 5.0
#End
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Maneuvering thrusters.
Oh, a word about optimization.

Thruster rendering is grouped together by each frame being displayed, among all thrusters of all ships. This means that if you have two ships with a different thruster image each, or two ships using the same two-frame thruster animation, the thrusters should render at roughly the same speed.

It also means that if you fire 20 thrusters at the same time with a 30-frame animation, they'll render as fast as if they were firing with all firing with the same static image. Although you'll still need the extra memory for the animation.

This is all theory, though, so don't take it as the end-all-be-all of thruster usage. Especially considering each thruster is just two triangles...
-C

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Maneuvering thrusters.
Well, I battled my way through all the debug build's media VP related errors, and am happy to report that it works fine for me. :)

I haven't tried the sounds yet or with AI ships, but here are some settings that make the effect more visible and in the correct places:

Code: [Select]
#Ship Classes
$Name: GTF Ulysses
$Thruster:
+Used for: ("pitch up") ;;rear,top, right
+Position: (1.5 0.5 -4.6)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("pitch up") ;;rear,top, left
+Position: (-1.5 0.5 -4.6)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("pitch up") ;;front,bottom, right
+Position: (4.5 -2 3)
+Normal: (0.0 -1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("pitch up") ;;front,bottom, left
+Position: (-4.5 -2 3)
+Normal: (0.0 -1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("pitch down") ;;rear,bottom, middle
+Position: (0.0 0.2 -5.7)
+Normal: (0.0 -1.0 0.0)
+Texture: thruster02-01
+Radius: 2.0
+Length: 8.0
$Thruster:
+Used for: ("pitch down") ;;front,top, right
+Position: (4.9 -0.6 1.8)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("pitch down") ;;front,top, left
+Position: (-4.9 -0.6 1.8)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("roll left") ;;front,right
+Position: (6.3 -2.1 3.1)
+Normal: (0.0 0.0 1.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("roll left") ;;rear,left
+Position: (-4.9 -1.2 -2)
+Normal: (0.0 0.0 -1.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("roll right") ;;front,left
+Position: (-6.3 -2.1 3.1)
+Normal: (0.0 0.0 1.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("roll right") ;;rear,right
+Position: (4.9 -1.2 -2)
+Normal: (0.0 0.0 -1.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("bank right") ;;middle,right, top
+Position: (4.9 -0.7 0.5)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("bank right") ;;middle,left, bottom
+Position: (-4.9 -2.2 0.5)
+Normal: (0.0 -1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("bank left") ;;middle,left, top
+Position: (-4.9 -0.7 0.5)
+Normal: (0.0 1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
$Thruster:
+Used for: ("bank left") ;;middle,right, bottom
+Position: (4.9 -2.2 0.5)
+Normal: (0.0 -1.0 0.0)
+Texture: thruster02-01
+Radius: 1.0
+Length: 6.0
#End
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline FireCrack

  • 210
  • meh...
Re: Maneuvering thrusters.
link in your last post isn't working, this one is correct.

http://fs2source.warpcore.org/exes/latest/C03042006.zip


When i run VA's table i get the banking thrusters firing when the ship yaws, havent checked to see if it's a problem with the table or the code though, or if prehaps i'm neglecting the way the thrusters are placed.
« Last Edit: April 03, 2006, 08:53:05 am by FireCrack »
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Maneuvering thrusters.
It's the autobank causing it as far as I can tell.

Edit:
Would it be possible to have the length scale with the input? Ie, if I were to move the stick halfway right, the resulting plumes would be at half length? It's not a big issue, but it'd be a very nice touch. :)
« Last Edit: April 03, 2006, 11:29:13 pm by Vasudan Admiral »
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Maneuvering thrusters.
That's a very nice feature...  :yes:


Just wondering... could this be used to simulate the swril effect for the (legendary) barrelroll?

BTW I just got some ideas where I could use this feature... ;)
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Maneuvering thrusters.
It's the autobank causing it as far as I can tell.

Edit:
Would it be possible to have the length scale with the input? Ie, if I were to move the stick halfway right, the resulting plumes would be at half length? It's not a big issue, but it'd be a very nice touch. :)

Try this build and see if it does what you want:
http://fs2source.warpcore.org/temp/wmc/va_test.zip

EDIT: I've got the modified source for the trial effect sitting on my desktop right now, just so I know what it is...
« Last Edit: April 04, 2006, 04:34:39 am by WMCoolmon »
-C

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: Maneuvering thrusters.
Wow that's awesome - great work. :yes:

Now we just need a tiny little thruster plume animation and all is set. ;)

Edit: Just a note, the effect looks better when you use thrusters with half the radius and length of those I posted above.
« Last Edit: April 04, 2006, 04:51:20 am by Vasudan Admiral »
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities