78 Commits
Author SHA1 Message Date
Goober5000 2a998f182f set ETS indexes despite power level
Fixes a crash of the player ship has a power level of 0.
2026-06-03 23:12:46 -04:00
Goober5000 26fd770c97 add an ETS comment
Clarify the conditions here.
2025-05-18 22:58:47 -04:00
Goober5000 9ea44f0479 ETS updates
Two updates to the energy transfer system.
1. Previously, for fighters missing a system (e.g. shields), the energy would be treated as if all energy from that system was routed to the other systems.  So, for example, a fighter's typical speed would be faster without shields than with shields.  A new AI profile flag now treats the other systems as if the energy had not been transferred.
2. At some point in development, Volition intended the `$Power Output` ships.tbl field to affect ETS.  A new AI profile flag now treats the power output as a factor of energy applied to energy systems.
2025-05-14 01:33:28 -04:00
Mike Nelson d41cb49661 make sure drop shadows don't polute the color context (#6689) 2025-04-17 08:33:15 -04:00
wookieejedi 310a170bca Fix/cleanup using intrinsic no shields and ship loadout switching (#6641)
* Fix/cleanup using `intrinsic no shields` and ship loadout switching

The flag `intrinsic no shields` is used to allow switching between both shielded and unshielded craft in loadout. There is one edge case that was not accounted for though, which is that if a ship has no shields, and is switched to a ship with shields, the mission will start with that ship having a current shield strength of 0 and only slow get it's shield strength up via shield recharge.

This is not expected behavior, so this PR adds the extra conditional check that if that flag is on, then treat shield percent as full instead of empty. This ensures that switching to a ship with shields in loadout will begin the mission with full shield strength (instead of 0 and waiting for a full recharge).

Tested and works as expected. If desired I can put this behind a game settings flag, but I figured this was the expected behavior (and I'm not even sure how many mods besides FotG uses `intrinsic no shields`.

* also fix initial ets setting with intrinsic no shields

* format consistency
2025-03-24 08:20:08 -04:00
Mike Nelson 60777154be Hud config upgrades (#6581)
* base working version

* localization and minor tweaks

* add retail UI controls

* Add way to hide gauges from Config view

* convert hud config from index matching to id matching

* clang
2025-03-22 22:47:38 -04:00
Goober5000 a92368da96 Merge pull request #6624 from Goober5000/shield_tweaks
some refinement of shield quadrants
2025-03-11 00:58:50 -04:00
wookieejedi e89917e20d Allows mods to fully disable energy transfering (#6623) 2025-03-08 17:41:12 -05:00
Goober5000 44cdb29135 some refinement of shield quadrants
Remove the `n_quadrants` field because it is entirely redundant to the size of `shield_quadrant`.  Also, be more rigorous about the difference between `shield_get_quad(i)` (which can fluctuate) and `shield_quadrant[i]` (which gives the exact quadrant strength).  Finally add some C++ casts and move some checks to better places.
2025-03-08 01:10:59 -05:00
Mike Nelson 32befb83a9 fix ets copy/paste error (#6619) 2025-03-06 10:47:22 -05:00
Mike Nelson 22f34e7d91 config rendering for escort and ets gauges (#6574) 2025-02-28 21:36:24 -05:00
Mike Nelson 5b736b1ddc Hud config framework (#6495)
* Add scaling for vfnts and scale multipler to gr_string

* nullptr

* Add scaling to a couple other string operations

* Add scaling features to additional bitmap drawing methods

* Implement framework for rendering hud gauges in config mode

* fix merge error

* address feedback
2025-02-03 07:01:47 -05:00
Goober5000 0e98d01ce5 use the ship pointer version of shield_get_max_strength() where appropriate 2025-01-12 16:52:16 -05:00
Asteroth 729e448fe5 review fixes 2023-10-30 02:10:18 -04:00
Asteroth c017ef9b8a fix for ets changes when engines are <15% 2023-10-29 23:54:36 -04:00
Goober5000 79702273d5 some tweaks and clarifications 2023-10-15 16:55:50 -04:00
Goober5000 89b33ebbc5 add a maneuver-despite-engines flag
This flag ignores engine status when determining whether and how a ship can maneuver.  Implements #5503.
2023-09-13 22:36:58 -04:00
Asteroth bc09f0672b better hud gauge load safety 2023-07-07 01:20:11 -04:00
wookieejedi f2987aa749 Fix max Z speed when using ETS and engine damage tracking (#5368)
* Fix max Z speed when using ETS and engine damage tracking

Follow up for #5137 and #5292. This engine strength check thus needs to be added to all instances where `max_vel.xyz.z` is updated, so a function was created and added in respective locations. Fixes #5367.

* cleanup and adding validity assertations

* cleanup outdated comments

* might as well make the cleanup look nice

* update to account for more edge cases

* cleanup
2023-04-23 22:01:05 -04:00
Asteroth ac9636733f ets fixes (#5317) 2023-04-11 06:31:04 +09:00
Asteroth e3cd5c819f removal of current_max_speed (#5292) 2023-04-01 16:13:08 -04:00
Goober5000 a0181e715d prevent ship from managing ETS if it is playing dead
This was the bug found recently that was thought to be related to #2157.  It turns out that ships will manage ETS even if they are playing dead, which caused a ship to accelerate during a ship-maneuver as it directed more power to engines.  So this PR adds a "$ships playing dead don't manage ETS:" flag to control this behavior.  Tested and works.

This also capitalizes two flags that did not have an initial capital letter.
2023-01-06 03:04:11 -05:00
Kiloku 05495cd1bc Add optional Drop Shadows to HUD (#4543)
* Add drop shadows to HUD text

* Add drop shadow to reticle

* Add control to toggle Drop Shadows

* Double render reticle shadows

* Use gauge_color instead of creating a temp var

* Add shadows to ETS gauges

* Set shadow default to false and adjust formatting

* Restore numbering for controlsconfig
2022-09-01 22:06:00 -04:00
Baezon 8e2d93211c add shield regen hit delay 2021-06-21 21:01:51 -04:00
wookieejedi 1d7070cf12 add claryifying parentheses 2021-02-03 18:18:04 -05:00
wookieejedi 828a993eb6 Fix speed differential for retail cap ships
As astuetly determined by @Baezon `the speed differential for retail cap ships is caused by 'ships with no shields can manage ETS', being part of the bugfixes with target version`. This PR adds two flags per Discord suggestion, one for all ships and one for only small ships.
2021-02-03 17:14:39 -05:00
Phantom Hoover 0151f1b5a8 Add ships.tbl flags to tune most aspects of ETS behaviour. 2020-11-21 23:07:21 +00:00
wookieejedi 950f248b03 Fix to Non Shielded Ships Manage ETS
This one line fix properly specifies which ship to use for ETS managment. The recent merge of `Non-shielded ships manage ETS` had a object reference error, so this rectifies that. Thanks to Axem for finding this!
2020-10-11 11:23:14 -04:00
wookieejedi 443b3cd217 fix copy paste error 2020-10-06 14:07:19 -04:00
wookieejedi dabe025967 feedback and cleanup 2020-10-05 21:43:46 -04:00
wookieejedi 886e7f4f18 Flag to allow ships with no shields to manage ETS
Using the `No_shields` flag for ships is common usage in multiple mods, and as it turns out ships with that flag set will not have the AI manage ETS values due to an early return in the `ai_manage_ets` function. This PR adds an AI flag to allow ships with no shields to manage ETS regarding weapons and engines. This flag was tested and works as expected.
2020-10-05 19:57:09 -04:00
JohnAFernandez fd7af0bdf8 Move unsetting of Wep Cheat to Gamestate code
Where it belongs.
2020-07-21 01:52:02 -04:00
wookieejedi 52030b1cc6 Add Shield and Weapon Regen Rates to Ship Object and Expose to Scripting
Previously a ship's shields and weapon regeneration per second rates were only stored in the ship_info strut, thus they should not be changed during a mission or via scripting (see #2236 and and #2239). There are many precedents for taking a ship_info value ans copying it to a ship_object value so the value can be changed on a per ship basis in mission (auto aim FOV is one of many examples). This PR thus copies the shield and weapon recharge values to the ship_object and exposes those new values to scripting.
2020-06-23 10:45:45 -04:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium 8f06e338a4 Add typesafe handle types and use it in game sound system
This adds a new class which allows to create type safe resource handle
types. At the moment, the engine uses ints pretty much everywhere for
providing handles to resources created by the specific subsystems. Since
all ints are the same to the C/C++ typesystem it is perfectly legal to
pass a sound handle to the graphics API as a buffer handle which will
obviously cause issues.

This adds a new type called "ID" which is a wrapper class for a generic
handle but with added type safety. An instance of this class cannot be
passed to a function expecting another type of handle which provided
compile-time type safety for these APIs.

As an initial test I converted the game sound handles to this new type.
I already found a bug in the mainhall system thanks to this new type.
The mainhall used the game sound handles as sound instance handles which
probably meant that that specific code never really worked right. I
removed the code since there was no better alternative for fixing it.
2018-04-22 16:22:45 +02:00
asarium 0522566790 Replace direct usages of Snds vector with a function call
This will make it easier to validate the used handles and is generally
better since it doesn't require a global sounds vector.
2017-10-09 15:02:29 +02:00
niffiwan bf21913708 Updates to max shield recharge fix
Use a helper function in appropriate places, add comments where not
Avoid a potential div/0 & add Assertion to shield_get_max_strength
2016-10-16 16:31:11 +10:00
niffiwan 4c44934d7a Fix issues with $Max Shield Recharge
Fix unlimited transfer of energy to shields (energy lost)
Fix thresholds in ai balance shields, rearm timer & call4help
Fix scaling in shield pain flash
Fix variable number of shield segments in shield pain flash
Lastly includes formatting tidy-up in shield pain flash
2016-10-15 20:01:07 +10:00
Fabian Woltermann 770fce8de5 Bitset flags -- take 2 (#775)
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
2016-08-12 16:13:50 -07:00
asarium 1bcd5400d3 Move build system to CMake 2016-07-22 12:07:19 +02:00
Echelon9 47af1ff851 Simplify duplicative hud/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
zookeeper 8cd19aa588 Merged model point shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10135 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan 2c03139f97 Fix mantis 2889: add sexps's ets-get-value & ets-set-values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9986 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
m_m 6021fb4bea Some new scripting functions as requested by Axem: Access to the CargoSize of a weapon class Access to the AltName of a ship class Access to the actual capacity of a weapon bank Access to the callsign of a ship Access to the alternate ship type of a ship Access to the maximum velocity of a ship with respect to its engine energy level
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9923 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan 2cded90031 Mantis 2419: add a new ETS gauge that behaves like the retail one 2012-05-28 08:13:35 +00:00
Swifty 3affb86b52 Removed configOverride from HudGauge class since we don't even use it. 2012-02-05 03:41:31 +00:00
Zacam 876289a4b2 From ni1s: -Wreorder warnings clean up for GCC output. 2011-10-19 07:36:21 +00:00
The_E 092ea635c3 Fix for issue with the "no ETS" flag where subsystems were not getting recharged properly. 2011-04-05 12:05:32 +00:00
The_E 76e7f656d1 Adds "no ets" ships.tbl flag. 2011-01-23 16:03:04 +00:00