Author Topic: acceleration time doesn't work on dumbfires?  (Read 4181 times)

0 Members and 1 Guest are viewing this topic.

acceleration time doesn't work on dumbfires?
I gave the fury rocket an acceleration time of 50s  with a target velocity of 9999m/s  but it wouldn't work. the rockets inherit the ship's velocity and just kind of drift around. I gave the hornet and interceptor missiles acceleration and they do work as expected .

the weapon.tbl wiki says it's supposed to work for both homing and dumbfire secondaries so I suspect this is a bug

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: acceleration time doesn't work on dumbfires?
Hard to say, not knowing what the table differences between those weapons are (no idea what "fury rocket" is).

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: acceleration time doesn't work on dumbfires?
Presumably the Fury dumbfire fom FS1?

 
Re: acceleration time doesn't work on dumbfires?
both the interceptor and fury are secondary weapons from freespace/fsport

the interceptor has homing, the fury does not

Code: [Select]
; ----------------------------------------------------------------------------------
$Name: Interceptor
+Title: XSTR("GTM-9 Interceptor", 560)
+Description:
XSTR("Standard Issue
Fast Target Lock", 561)
$end_multi_text
+Tech Title: XSTR("GTM-9 Interceptor", 560)
+Tech Anim: cb_interceptor
+Tech Description:
XSTR("All-aspect seeking - laser tracking senses energy reflected off a target from the primary weapon systems of the target, increasing single-pass kill probability - medium payload (18.5 Kt) - missile is designed to pierce reinforced hull, thus securing itself to the target, prior to detonating (15 ms delay).

This is the standard issue fighter killer in the GTA.  Designed to take out fighters with minimum hassle, a simple lock is all that is needed to grab the enemy's attention.  Short lock time, good speed, and decent payload makes this the best missile to use against all but the strongest ships.  Its effectiveness against large targets, however, is less than a typical laser run, making this primarily a ship-to-ship missile.", 562)
$end_multi_text
$Model File: Interceptor.pof
$Mass: 15.0
$Velocity: 9999
$Fire Wait: 2.0
$Damage: 150
$Blast Force: 60.0
$Inner Radius: 0.0
$Outer Radius: 0.0
$Shockwave Speed: 0
$Armor Factor: 1.0
$Shield Factor: 0.8
$Subsystem Factor: 0.5
$Lifetime: 5.0
$Energy Consumed: 0.0
$Cargo Size: 4.0
$Homing: YES
 +Type: ASPECT
 +Turn Time: 1.0
 +Min Lock Time: 2.0
 +Lock Pixels/Sec: 70
 +Catch-up Pixels/Sec: 100
 +Catch-up Penalty: 30
$Acceleration Time: 50.0
$LaunchSnd: 91
$ImpactSnd: 88
$FlyBySnd: -1
$Rearm Rate: 2.0
$Flags: ( "player allowed" )
$Trail:
 +Start Width: 0.25
 +End Width: 0.5
 +Start Alpha: 1.0
 +End Alpha: 0.0
 +Max Life: 0.7
 +Bitmap: MissileTrail02
$Icon: icon_interceptor
$Anim: interceptor
$Impact Explosion: ExpMissileHit1
$Impact Explosion Radius: 7.0

^ this will approach 9999m/s when fired




Code: [Select]
$Name: Fury
+Title: XSTR("GTM-3 Fury Missile", 554)
+Description:
XSTR("Standard Issue
Maximum Compatibility", 555)
$end_multi_text
+Tech Title: XSTR("GTM-3 Fury Missile", 554)
+Tech Anim: cb_fury
+Tech Description:
XSTR("Small, fast dumbfire missiles - fired in swarms - GTA fighters can carry more Fury missiles than conventional missiles, due to their small size - used for distraction and other tactical measures - very small payload (3 Kt).

Use is recommended in close combat situations and against larger targets where tracking is a non-issue.", 556)
$end_multi_text
$Model File: Fury.pof
$Mass: 0.1
$Velocity: 9999.0
$Fire Wait: 0.30
$Damage: 30
$Blast Force: 0.2
$Inner Radius: 0.0
$Outer Radius: 0.0
$Shockwave Speed: 0
$Armor Factor: 1.0
$Shield Factor: 0.5
$Subsystem Factor: 0.6
$Lifetime: 3.0
$Energy Consumed: 0.0
$Cargo Size: 0.5
$Homing: NO
$LaunchSnd: 90
$ImpactSnd: 88
$FlyBySnd: -1
$Rearm Rate: 12.0
$Flags: ( "in tech database" "player allowed" )
$Trail:
 +Start Width: 0.1
 +End Width: 0.2
 +Start Alpha: 1.0
 +End Alpha: 0.0
 +Max Life: 0.3
 +Bitmap: MissileTrail01
$Acceleration Time: 50.0
$Icon: icon_fury
$Anim: fury
$Impact Explosion: ExpMissileHit1
$Impact Explosion Radius: 3.0

^ this will just float around where you fired it

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
Sounds like a bug to me! Submit it to Mantis so a coder can someday get around to fixing it.
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 AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: acceleration time doesn't work on dumbfires?
Well, we've got a problem in the collision code:
Code: [Select]
//SUSHI: Fix bug where additive weapon velocity screws up collisions
//Assumes that weapons which don't home don't change speed, which is currently the case.
Other than that, though, the code for handling acceleration time for non-homing weapons is in weapon_process_post() and looks like it should be working:
Code: [Select]
// a single player or multiplayer server function -- it affects actual weapon movement.
if (wip->wi_flags & WIF_HOMING && !(wp->weapon_flags & WF_NO_HOMING)) {
[snip]
} else if (wip->acceleration_time > 0.0f) {
if (Missiontime - wp->creation_time < fl2f(wip->acceleration_time)) {
float t;

t = f2fl(Missiontime - wp->creation_time) / wip->acceleration_time;
obj->phys_info.speed = wp->launch_speed + MAX(0.0f, wp->weapon_max_vel - wp->launch_speed) * t;
} else {
obj->phys_info.speed = wip->max_speed;;
}

vm_vec_copy_scale( &obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.speed);
}

Please post your fs2_open.log file.  Instructions on how to do this can be found in this post.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
I can confirm he speaks truth.

Silly rockets, that's not accelerating. That's zero speed.
The particlespew seems to think it's going the proper speed though.
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 AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: acceleration time doesn't work on dumbfires?
Zero speed makes even less sense; its speed gets set to 0 on launch, but the same is true of homing weapons with an acceleration time as well. The fact that it works with homing weapons (and the logic for acceleration_time in weapon_home() is basically identical to the logic used in the code I quoted earlier) means it should also work with dumbfire weapons.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
For some reason when acceleration is used on dumbfires, the rockets only inherit some of the ship's speed (as pink_supervisor already pointed out). And if there is nothing to inherit, you get above pic. I also checked if there was a difference with $use additive weapon velocity: set to Yes or No, but there was none.
Clearly something mysterious is going on~
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 zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: acceleration time doesn't work on dumbfires?
I can probably fix whatever the underlying problem is (it's my code after all), but it'd be a whole lot more smoother if someone could patch together a minimal FS2-based test case to reproduce with (even if it's just a simple -wep.tbm).

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
Well this took a whole minute to setup, not sure why you needed help with this, but here you go!



[attachment DELETED!! by Strong Bad]
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 zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: acceleration time doesn't work on dumbfires?
Thanks! I think I more or less figured out what's happening. The code is supposed to handle dumbfires, but apparently that part isn't working somehow. I'll see what I can do!

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Minecraft
    • Steam
    • Something
Re: acceleration time doesn't work on dumbfires?
Y'know, if used intentionally, you could do some really fun stuff with zero-acceleration missiles. :drevil:

 

Offline niffiwan

  • 211
  • Eluder Class
Re: acceleration time doesn't work on dumbfires?
 ;7

Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: acceleration time doesn't work on dumbfires?
This should fix it.

The problem was that all primaries and non-homing secondaries got a flag which made them use more simple physics calculations because the assumption was that they would always just travel at the same static speed. I never noticed that because apparently I only tested by dumbfiring homing secondaries, not firing actual non-homing secondaries. So, I just had to add an extra condition to make non-homing secondaries using $Acceleration Time not receive that flag.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
Huzzah  :yes:
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 Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: acceleration time doesn't work on dumbfires?
Is that why we can't have homing primaries as well? They can turn towards the target, but they'll always travel in straight line. Would that be possible to enable homing on primaries? I can see some interesting stuff that could be done with that.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: acceleration time doesn't work on dumbfires?
Is that why we can't have homing primaries as well? They can turn towards the target, but they'll always travel in straight line. Would that be possible to enable homing on primaries? I can see some interesting stuff that could be done with that.
...Homing primaries don't work?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: acceleration time doesn't work on dumbfires?
Last time I tested they didn't. Granted, this was a while ago. If this was changed, it must have been done recently.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: acceleration time doesn't work on dumbfires?
Yeah as Dragon said, unless someone changed that recently, homing primaries have never ever worked.
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