2022-08-17 14:19 EDT

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002946FSSCPSEXPspublic2013-11-24 02:33
Assigned Toniffiwan 
PlatformOSOS VersionWin 7
Product Version3.7.1 
Target VersionFixed in Version3.7.1 
Summary0002946: shields-on and shields-off can cause total ETS energy to increase/decrease
DescriptionFiring the shields-on and shields-off SEXPs can cause odd behaviour with the ETS gauges. For example, putting all energy into shields, and then using shields-off will leave the player with no ETS energy at all. Attempting to increase weapons or engines at this point will crash debug builds, but apparently work as if drawing from shields as normal on release builds. Let's say you put all energy into weapons. Now, if you shields-on, the shields will return, but will still be at full energy, and so the total ETS energy has doubled. It's probably easier for you to play around with the sample mission I've provided than my trying to explain any more.
Steps To ReproduceDownload and run attached mod, play ETSbug.fs2. Instructions in-game.
TagsNo tags attached.
Attached Files

related to 0002950resolvedniffiwan shields-off & shields-on sexps don't work in multi 



niffiwan (developer)

Well, shields-on / shields-off don't rebalance the ETS indexes when called, they just modify the ship flag leaving the ETS in a "broken" state. i.e. the code assumes that the ETS will always sum to 12, and if it doesn't, it'll hit an int3() when it tries to increase an index past 8, but has 0 left to subtract from the one remaining index (with the shields index marked as unavailable)

Need to add some extra processing of indexes to this:
void sexp_shields_off(int n, bool shields_off )


niffiwan (developer)

Fix committed to trunk@10014.


niffiwan (developer)

Last edited: 2013-11-06 06:01

View 3 revisions

Can you please grab the next nightly and confirm that this issue is fixed?


FelixJim (reporter)

The issue does seem to be fixed, but as side effect using shields-on will result in ETS settings with nothing in shields, whereas before you'd have whatever was in before using shields-off. This would be a headache for the player to rebalance, especially after every in-mission jump, and those have become pretty popular over the last few years. Normally I'd call this an issue for FREDers to deal with, except many mods have already been released assuming old behaviour, and this could cause balance issues for unobservant players.

All this said, I can't honestly think of a perfect solution to this. Stealing 1/3 of both engines and weapons energy would accommodate players who never touch the ETS settings, assuming you could handle edge cases like all energy in weapons correctly. It probably would be a more or less reasonable distribution under any circumstances, and players who are playing around with the ETS settings will probably have to re-jig everything in any scenario.


Goober5000 (administrator)

I think rebalancing ETS equally after shields-on is the most reasonable solution.


MjnMixael (manager)

Rebalancing will work. You could also just expect FREDers to use the new get/set ETS sexps.. but that doesn't deal with old missions, obviously.


niffiwan (developer)

Just to clarify, we're talking about the same effect as pressing CTRL-D when shields-on is called? i.e. set all indexes to 4 / INTIAL_????_RECHARGE_INDEX

(then just deal with edge cases of ships missing weapons/engines)


niffiwan (developer)

Fix committed to trunk@10023.


niffiwan (developer)

That was pretty easy - let me know how this looks in the next nightly.


FelixJim (reporter)

Looking good, but now using shields-on when the shields are already on will still rebalance the ETS settings. I don't know how big a problem that would be, but maybe it would be cleaner if nothing happened at all? A mention of the ETS rebalancing in the SEXP help wouldn't go amiss either.


niffiwan (developer)

Ah yes, I did notice that problem but I didn't think it'd be a big deal. I've got an idea of how to deal with that, just a few more checks for state changes and it should be good to go.

I'll update the help as well.


niffiwan (developer)

Fix committed to trunk@10032.


niffiwan (developer)

3rd time lucky? :)

While fixing this, I noticed that alter-ship-flag had the same problem, it should also be fixed. See 2nd attached test mission for a test case.


niffiwan (developer)

Have you had a chance to confirm that the problem is gone in the latest nightlies?


FelixJim (reporter)

Oops, sorry. Just tested on 10145 and I couldn't find anything else to nitpick and complain about; it all worked just as I'd expected, including the alter-ship-flag version.


niffiwan (developer)

Thanks :)

+Related Changesets

-Issue History
Date Modified Username Field Change
2013-11-01 13:16 FelixJim New Issue
2013-11-01 13:16 FelixJim File Added: ETSbug.7z
2013-11-02 05:36 niffiwan Note Added: 0015378
2013-11-04 02:48 niffiwan Assigned To => niffiwan
2013-11-04 02:48 niffiwan Status new => assigned
2013-11-06 02:44 niffiwan Changeset attached => fs2open trunk r10014
2013-11-06 02:44 niffiwan Note Added: 0015383
2013-11-06 02:44 niffiwan Status assigned => resolved
2013-11-06 02:44 niffiwan Resolution open => fixed
2013-11-06 02:46 niffiwan Note Added: 0015384
2013-11-06 02:46 niffiwan Status resolved => feedback
2013-11-06 02:46 niffiwan Resolution fixed => reopened
2013-11-06 02:47 niffiwan Note Edited: 0015384 View Revisions
2013-11-06 02:59 niffiwan Relationship added related to 0002950
2013-11-06 06:01 niffiwan Note Edited: 0015384 View Revisions
2013-11-06 10:34 FelixJim Note Added: 0015387
2013-11-06 10:34 FelixJim Status feedback => assigned
2013-11-06 12:54 Goober5000 Note Added: 0015388
2013-11-06 14:34 MjnMixael Note Added: 0015390
2013-11-06 14:43 niffiwan Note Added: 0015391
2013-11-07 02:59 niffiwan Changeset attached => fs2open trunk r10023
2013-11-07 02:59 niffiwan Note Added: 0015396
2013-11-07 02:59 niffiwan Status assigned => resolved
2013-11-07 03:01 niffiwan Note Added: 0015397
2013-11-07 03:01 niffiwan Status resolved => feedback
2013-11-07 11:32 FelixJim Note Added: 0015398
2013-11-07 11:32 FelixJim Status feedback => assigned
2013-11-07 17:16 niffiwan Note Added: 0015400
2013-11-08 22:48 niffiwan Changeset attached => fs2open trunk r10032
2013-11-08 22:48 niffiwan Note Added: 0015402
2013-11-08 22:48 niffiwan Status assigned => resolved
2013-11-08 22:49 niffiwan Note Added: 0015403
2013-11-08 22:49 niffiwan Status resolved => feedback
2013-11-08 22:49 niffiwan File Added: ETSbug2.fs2
2013-11-16 00:36 niffiwan Note Added: 0015412
2013-11-22 12:39 FelixJim Note Added: 0015455
2013-11-22 12:39 FelixJim Status feedback => assigned
2013-11-24 02:33 niffiwan Note Added: 0015461
2013-11-24 02:33 niffiwan Status assigned => resolved
2013-11-24 02:33 niffiwan Fixed in Version => 3.7.1
2013-11-24 02:33 niffiwan Resolution reopened => fixed
+Issue History