Author Topic: Reverse Afterburner support patch  (Read 6059 times)

0 Members and 1 Guest are viewing this topic.

Offline SparK

  • 23
Reverse Afterburner support patch

[OLD] http://files.fringespace.org/spark/misc/reverse_afterburner.patch
[FINAL] http://files.fringespace.org/spark/misc/revAB.patch

I need opinions and reviews, some feedback and suggestions

the main idea is to be able to add
+Aburn Max Reverse Vel:      0.0
+Aburn Rev accel:         0.0

to the ships.tbl
these parameters are optional and if not present or zeroed the default behaviour will take place

I got help from a lot of people on IRC
« Last Edit: January 27, 2010, 12:39:16 pm by SparK »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Reverse Afterburner support patch
This is awesome. I would like to see this feature very much.

 
 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Reverse Afterburner support patch
It would basically cause reverse thrust to behave like forward thrust.

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Reverse Afterburner support patch
Assuming Z is set to regular reverse...

Press Z + afterburners to go in reverse burn (aka backwards really fast).
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Reverse Afterburner support patch
I'll just repeat that this is fantastic and would do oh-so-much, especially if reverse afterburner speed can be set independently.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Reverse Afterburner support patch
I'll just repeat that this is fantastic and would do oh-so-much, especially if reverse afterburner speed can be set independently.
I for one wholeheartly agree with this.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline SparK

  • 23
Re: Reverse Afterburner support patch
Code: [Select]
+Aburn Max Reverse Vel:      0.0
+Aburn Rev accel:         0.0

any value you put there will be your reverse speed
you can set it to be sluggish by using 60.0 on max speed and 0.1 on accel
or you can make a super ship and use 300.0 and 5.0

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Re: Reverse Afterburner support patch
Does standard backwards thrust already work in the same way as forward thrust?  I was footling around with ship tables a while back in an attempt to mimic Descent-style motion, and I seem to remember not being able to completely control how quickly the ship would transfer from full forward to full reverse velocity.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Reverse Afterburner support patch
No. That's what the acceleration field is for.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: Reverse Afterburner support patch
This would be grand, I agree.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline Sushi

  • Art Critic
  • 211
Re: Reverse Afterburner support patch
Looks good overall. A couple of nitpicks/questions:

Code: [Select]
- if ( goal_vel.xyz.z < -pi->max_rear_vel )
+ if ( goal_vel.xyz.z < -pi->max_rear_vel && !(pi->flags & PF_AFTERBURNER_ON) )
  goal_vel.xyz.z = -pi->max_rear_vel;
Maybe it would make sense here to cap the rear velocity to afterburner_max_reverse_vel when appropriate instead? The fact that we are essentially removing a check when afterburner is on without explicitly handling the new case makes me a bit nervous.

Code: [Select]
+ goal_vel.xyz.z = ci->forward* pi->afterburner_max_vel.xyz.z;
+ if(ci->forward < 0.0f){
+ goal_vel.xyz.z = ci->forward* pi->afterburner_max_reverse_vel;
+ }
This works, but it's probably better to only assign once. In other words, format this as an if/else or as a ? : ternary.

Code: [Select]
ramp_time_const = pi->forward_decel_time_const;
- // hmm, maybe a reverse_accel_time_const would be a good idea to implement in the future...
+ if ( pi->flags & PF_AFTERBURNER_ON )
+ ramp_time_const = pi->afterburner_reverse_accel;
Same thing here.

Code: [Select]
+ /* SparK 2010-01-18: this guy is buggin me out, I need reverse burners to be an option.
  // AL 12-29-97: If afterburner key is down, player should have full forward thrust (even if afterburners run out)
  if ( check_control(AFTERBURNER) ) {
  ci->forward = 1.0f;
  }
+ */
Don't comment this out. If it really is unneeded logic that is already duplicated in physics.cpp, then just cut it out completely.

Code: [Select]
- dest_ci->forward_cruise_percent = 0.0f;
- dest_ci->fire_countermeasure_count = 0;
- dest_ci->fire_secondary_count = 0;
- dest_ci->fire_primary_count = 0;

- dest_ci->forward_cruise_percent = src_ci->forward_cruise_percent;
- dest_ci->fire_countermeasure_count = src_ci->fire_countermeasure_count;
- dest_ci->fire_secondary_count = src_ci->fire_countermeasure_count;
- dest_ci->fire_primary_count = src_ci->fire_countermeasure_count;
Why are you removing these lines?

 

Offline SparK

  • 23
Re: Reverse Afterburner support patch
ok, will do

but...  :eek2: WTF the last lines! i didn't remove that... will fix, don't worry


edit:

fixed everything, except for that negative max speed checker because I'm setting goal_vel already, why would i check if its smaller than the value I just set it to? :P
(I don't think afterburner_max_reverse_vel can be smaller than afterburner_max_reverse_vel)

sorry for those erased lines, they were added in the last update i did but somehow i reverted my files to a previous release...

(patch on the same link)
http://files.fringespace.org/spark/misc/reverse_afterburner.patch
« Last Edit: January 19, 2010, 01:04:30 pm by SparK »

 

Offline Sushi

  • Art Critic
  • 211
Re: Reverse Afterburner support patch
I'd still change this:

Code: [Select]
+ if(ci->forward < 0.0f)
+                  goal_vel.xyz.z = ci->forward* pi->afterburner_max_reverse_vel;
+ else goal_vel.xyz.z = ci->forward* pi->afterburner_max_vel.xyz.z;

to this:

Code: [Select]
+ if(ci->forward < 0.0f)
+                  goal_vel.xyz.z = ci->forward* pi->afterburner_max_reverse_vel;
+ else
+                  goal_vel.xyz.z = ci->forward* pi->afterburner_max_vel.xyz.z;

in both places where it applies, but that's the only quibble I have left (and it's just a style-consistency nitpick :p).

Otherwise... looks good to me. Anyone else have comments or suggestions on this patch?

  

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Reverse Afterburner support patch
All I can say is that it works... we needed it specifically for FringeSpace, and he completed it.
Does what it says it will do.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Reverse Afterburner support patch
Appears to, but that's the kind of thinking that's gotten us into messes before.  Like with changes to default AI behavior.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline SparK

  • 23
Re: Reverse Afterburner support patch
remember it does nothing without the + flags on ships.tbl

 

Offline Sushi

  • Art Critic
  • 211
Re: Reverse Afterburner support patch
remember it does nothing without the + flags on ships.tbl

Right. As long as the current behavior remains unchanged without the new flags (which, as far as I can tell, is the case) then we should be good.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Reverse Afterburner support patch
Just wait until people start spotting the AI firing its afterburners at random non-tabled intervals! Then where will Sushi be!

 

Offline SparK

  • 23
Re: Reverse Afterburner support patch
this one works if you are on high forward speed too: ;)
http://files.fringespace.org/spark/misc/revAB.patch

also Sushi, I fixed the else\n stuff
thnx Zacam for the feedback on irc