Author Topic: [feature request] excluding weapons from linked fire penalty  (Read 4742 times)

0 Members and 1 Guest are viewing this topic.

Offline fightermedic

  • 29
  • quite a nice guy, no really, i am
[feature request] excluding weapons from linked fire penalty
as you know with
$disable linked fire penalty:                        NO
you can have linked weapons fire with lower rate of fire, as in fs1
could we get a weapon flag to exclude a weapon from this? i'd like for some purely ballistic weapons to not be affected by this, while energy based weapons still are
>>Fully functional cockpits for Freespace<<
>>Ships created by me<<
Campaigns revised/voice-acted by me:
Lightning Marshal 1-4, The Regulus Campaign, Operation: Savior, Operation: Crucible, Titan Rebellion, Fall of Epsilon Pegasi 1.1Aftermath 2.1,
Pandora's Box 2.2, Deep Blood

Other Campaigns I have participated in:
The Antagonist, Warzone, Phantoms & Echo-Gate

All the stuff I release is free to use or change in any way for everybody who likes to do so; take whatever you need

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: [feature request] excluding weapons from linked fire penalty
So you'd want a way so that ballistic+ballistic or ballistic+energy = no linked penalty, but energy+energy = linked penalty.  It sounds like there'd need to be a list of weapon types each can be paired with without penalty, either on a per-weapon basis in the weapons table, or in the ai_profiles table.  It might also be prudent to incorporate a means of dictating exactly how much linking penalty delay is present on a per-weapon basis (in theory weapons with higher energy drain may cause greater delay) and a way to cause further delay if a ship has more than 2 primary weapon bays and the player links all 3 of them together.
The Trivial Psychic Strikes Again!

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [feature request] excluding weapons from linked fire penalty
So you'd want a way so that ballistic+ballistic or ballistic+energy = no linked penalty, but energy+energy = linked penalty.  It sounds like there'd need to be a list of weapon types each can be paired with without penalty, either on a per-weapon basis in the weapons table, or in the ai_profiles table.  It might also be prudent to incorporate a means of dictating exactly how much linking penalty delay is present on a per-weapon basis (in theory weapons with higher energy drain may cause greater delay) and a way to cause further delay if a ship has more than 2 primary weapon bays and the player links all 3 of them together.

While that would make the request much more robust, it's also far and away more complicated. The original request is simply 'does this weapon get any linked penalty?'. You've changed it to 'under what circumstances might this weapon be exempt from linked penalty'.

It's almost like you've tacked on a whole new set of requests.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: [feature request] excluding weapons from linked fire penalty
Looking at the code... Code checks through armed weapon banks and then determines the penalty to the firewait (i.e. time between shots). Given how the code works it seems that normal weapon flag would be the most prudent method for implementing such an option.

So in essence what you want is:
Normal weapon + Flagged weapon = normal waits between shots on both
Normal weapon + Normal weapon + Flagged weapon = Linked wait between shots with normal weapons, normal wait between shots on flagged weapon

Or did i misunderstood anything?

EDIT:
What is needed (should i even consider implementing this) is a DEFINITE DESCRIPTION as to what it should accomplish.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: [feature request] excluding weapons from linked fire penalty
fightermedic's request has a lot of merit (and is actually a more elegant way of doing things than the rather clumsy global setting), and shouldn't be that hard to do. Adding additional settings here just sounds like a lot of granularity for something that isn't really going to matter all that much during gameplay.

Looking at the code... Code checks through armed weapon banks and then determines the penalty to the firewait (i.e. time between shots). Given how the code works it seems that normal weapon flag would be the most prudent method for implementing such an option.

So in essence what you want is:
Normal weapon + Flagged weapon = normal waits between shots on both
Normal weapon + Normal weapon + Flagged weapon = Linked wait between shots with normal weapons, normal wait between shots on flagged weapon

Or did i misunderstood anything?

That's what I'm thinking too.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: [feature request] excluding weapons from linked fire penalty
that looks good to me, it adds a good deal of flexibility without making things overly complicated from a modding perspective and would allow fightermedic to implement the scenario outlined
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 

Offline fightermedic

  • 29
  • quite a nice guy, no really, i am
Re: [feature request] excluding weapons from linked fire penalty
yo, thanks for considering this
just to make it clear, this is what i'm looking for:
flagged + flagged = no penalty
flagged + normal = no penalty
flagged + flagged + normal = no penalty
flagged + normal + normal = no penalty for the flagged one, penalty as if only 2 weapons are linked for the normal

however, it might be easier to implement it like this, which wouldn't be ideal, but ok:
flagged + normal = no penalty for flagged, penalty as if linked for the normal one
flagged + normal + normal = no penalty for the flagged one, penalty as if 3 weapons are linked for the normal
flagged + flagged + normal = no penalty for the flagged ones, penalty as if 3 weapons are linked for the normal

in a perfect world, we would have 2 flags, making both variants possible
one flag to exlude a weapon from being counted towards linking penalties at all
and one to not apply linking pnealties to this specific weapon
>>Fully functional cockpits for Freespace<<
>>Ships created by me<<
Campaigns revised/voice-acted by me:
Lightning Marshal 1-4, The Regulus Campaign, Operation: Savior, Operation: Crucible, Titan Rebellion, Fall of Epsilon Pegasi 1.1Aftermath 2.1,
Pandora's Box 2.2, Deep Blood

Other Campaigns I have participated in:
The Antagonist, Warzone, Phantoms & Echo-Gate

All the stuff I release is free to use or change in any way for everybody who likes to do so; take whatever you need

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: [feature request] excluding weapons from linked fire penalty
Something like this (which is totally untested) could do the trick... Comments? I'll test it later (tomorrow possibly) but it wouldn't hurt to have an opinion on it beforehand.

Code: [Select]
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10047)
+++ code/ship/ship.cpp (working copy)
@@ -10128,11 +10128,11 @@
  polymodel *pm = model_get( sip->model_num );
 
  // Goober5000 (thanks to _argv[-1] for the original idea)
- if (!(The_mission.ai_profile->flags & AIPF_DISABLE_LINKED_FIRE_PENALTY))
+ if ( !((winfo_p->wi_flags3 & WIF3_NO_LINKED_PENALTY) || (The_mission.ai_profile->flags & AIPF_DISABLE_LINKED_FIRE_PENALTY)) )
  {
  int effective_primary_banks = 0;
  for (int it = 0; it < num_primary_banks; it++)
- if (Weapon_info[swp->primary_bank_weapons[it]].wi_flags3 & WIF3_NOLINK)
+ if (Weapon_info[swp->primary_bank_weapons[it]].wi_flags3 & (WIF3_NOLINK | WIF3_NO_LINKED_PENALTY))
  continue;
  else
  effective_primary_banks++;
Index: code/weapon/weapon.h
===================================================================
--- code/weapon/weapon.h (revision 10047)
+++ code/weapon/weapon.h (working copy)
@@ -115,6 +115,7 @@
 
 #define WIF3_NOLINK (1 << 0) // This weapon can not be linked with others
 #define WIF3_USE_EMP_TIME_FOR_CAPSHIP_TURRETS (1 << 1) // override MAX_TURRET_DISRUPT_TIME in emp.cpp - Goober5000
+#define WIF3_NO_LINKED_PENALTY (1 << 2) // This weapon does not count into linked firing penalty
 
 
 #define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
Index: code/weapon/weapons.cpp
===================================================================
--- code/weapon/weapons.cpp (revision 10047)
+++ code/weapon/weapons.cpp (working copy)
@@ -648,6 +648,8 @@
  weaponp->wi_flags3 |= WIF3_NOLINK;
  else if (!stricmp(NOX("same emp time for capships"), weapon_strings[i]))
  weaponp->wi_flags3 |= WIF3_USE_EMP_TIME_FOR_CAPSHIP_TURRETS;
+ else if (!stricmp(NOX("no primary linked penalty"), weapon_strings[i]))
+ weaponp->wi_flags3 |= WIF3_NO_LINKED_PENALTY;
  else
  Warning(LOCATION, "Bogus string in weapon flags: %s\n", weapon_strings[i]);
  }
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline fightermedic

  • 29
  • quite a nice guy, no really, i am
Re: [feature request] excluding weapons from linked fire penalty
cool stuff, from what i do understand of the code this would be the first behaviour described by me?
 keep it up!
>>Fully functional cockpits for Freespace<<
>>Ships created by me<<
Campaigns revised/voice-acted by me:
Lightning Marshal 1-4, The Regulus Campaign, Operation: Savior, Operation: Crucible, Titan Rebellion, Fall of Epsilon Pegasi 1.1Aftermath 2.1,
Pandora's Box 2.2, Deep Blood

Other Campaigns I have participated in:
The Antagonist, Warzone, Phantoms & Echo-Gate

All the stuff I release is free to use or change in any way for everybody who likes to do so; take whatever you need

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: [feature request] excluding weapons from linked fire penalty
cool stuff, from what i do understand of the code this would be the first behaviour described by me?
Yes
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Sushi

  • Art Critic
  • 211
Re: [feature request] excluding weapons from linked fire penalty
If you end up implementing this, you should probably update the wiki to discourage use of the AI profiles flag in favor of the weapon flag.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [feature request] excluding weapons from linked fire penalty
AIP flag is more global, which suits mods that don't intend to use the penalty at all, though. I don't see why to discourage it's use.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [feature request] excluding weapons from linked fire penalty
AIP flag is more global, which suits mods that don't intend to use the penalty at all, though. I don't see why to discourage it's use.
I concur. Maybe a note should be added mentioning the weapon flag, but I see no reason to discourage the AIP flag just because you can do the same thing by adding this flag to every weapon.
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 Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: [feature request] excluding weapons from linked fire penalty
New option committed to the code in r10147

"no primary linked penalty" - weapon flag
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline fightermedic

  • 29
  • quite a nice guy, no really, i am
Re: [feature request] excluding weapons from linked fire penalty
YES!
hooray
thanks a ton
>>Fully functional cockpits for Freespace<<
>>Ships created by me<<
Campaigns revised/voice-acted by me:
Lightning Marshal 1-4, The Regulus Campaign, Operation: Savior, Operation: Crucible, Titan Rebellion, Fall of Epsilon Pegasi 1.1Aftermath 2.1,
Pandora's Box 2.2, Deep Blood

Other Campaigns I have participated in:
The Antagonist, Warzone, Phantoms & Echo-Gate

All the stuff I release is free to use or change in any way for everybody who likes to do so; take whatever you need

  

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: [feature request] excluding weapons from linked fire penalty
awesome stuff
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art