Posted by: skoormit
« on: Yesterday at 04:53:00 PM »This one is a doo-hoo-hoozy.
TL;DR: In extreme cases, fleets that want to launch AMMs but have no more in stock will spam enough game log messages to crash the game.
Details:
On two separate occasions, I launched about 34 salvos of 5 missiles each, targeting a waypoint at a planet with a hostile fleet.
These salvos were launched 5 minutes apart.
Both times, in a short time after the first salvos arrived on target, the game crashed with an out-of-memory error.
I have been attacking this fleet periodically for many, many years.
The fleet used to fire a large number (many thousands) of AMMs at my incoming missiles.
But eventually they ran out of AMMs to launch.
Now, for every increment while a salvo of mine is visible to them, this fleet is generating thousands of game log entries of the form:
This most recent time, I saved the game immediately prior to the first salvo arriving on target.
In the last increment of that save, the hostile fleet generated 16,324 such entries.
In that save, FCT_GameLog contains 1,272,442 records.
Of those, 1,268,840 are these "cannot lauch" entries.
Side discussion:
You might wonder why am I launching this way.
I have eliminated the fleet's PD capabilities and I have soaked all of their AMMs.
The missiles I am launching now have the Retargeting capability, an onboard sensor, and are very slow.
Each increment, some small percentage of the remaining missiles will hit whatever ship is the current target.
If those hits are enough to kill the target, the remaining missiles pick another target.
Rinse, repeat. In theory, a large salvo of these will just keep attacking until the entire fleet is gone.
In practice, there's one problem: sometimes the hits in a given increment do not kill the target, but instead destroy all of the engines and/or missile jammers.
As a result, the remaining missiles now have a 100% chance to hit, and so, in the following increment, they all hit.
End of entire salvo.
To mitigate these overkill losses, I launch very small salvos, spaced many minutes apart.
Each salvo should get all of its hits in before the next salvo arrives.
So my maximum losses from any given overkill event is (usually) a single salvo.
The upshot of this is that, after each salvo arrives, the game runs 5-second increments until all missiles in that salvo have hit.
This takes 10, 20, sometimes 30 increments for a salvo.
And because the hostile fleet is trying to launch AMMs every single increment, and is logging a message for every single missile that they are unable to launch an AMM for, well, we get this super bloated game log that crashes the game.
How to fix?
Might be easy...maybe instead of writing the event each time a ship wants to launch missiles but is out of them, you only write it the first time. This means keeping up with which fleets have written such a message this increment.
Or maybe each fleet gets a counter that is reset to 0 at the start of each increment, and you increase it by one instead of writing this message.
Then at the end of the increment you write one such message per ship with a non-zero counter, and append "x[N]" to the message, where N is the value of the counter. Then reset the counters back to zero.
TL;DR: In extreme cases, fleets that want to launch AMMs but have no more in stock will spam enough game log messages to crash the game.
Details:
On two separate occasions, I launched about 34 salvos of 5 missiles each, targeting a waypoint at a planet with a hostile fleet.
These salvos were launched 5 minutes apart.
Both times, in a short time after the first salvos arrived on target, the game crashed with an out-of-memory error.
I have been attacking this fleet periodically for many, many years.
The fleet used to fire a large number (many thousands) of AMMs at my incoming missiles.
But eventually they ran out of AMMs to launch.
Now, for every increment while a salvo of mine is visible to them, this fleet is generating thousands of game log entries of the form:
Quote
Ship so-and-so cannot lauch [SIC] a such-and-such as no missiles of the required type are available in the ship's magazines.
This most recent time, I saved the game immediately prior to the first salvo arriving on target.
In the last increment of that save, the hostile fleet generated 16,324 such entries.
In that save, FCT_GameLog contains 1,272,442 records.
Of those, 1,268,840 are these "cannot lauch" entries.
Side discussion:
You might wonder why am I launching this way.
I have eliminated the fleet's PD capabilities and I have soaked all of their AMMs.
The missiles I am launching now have the Retargeting capability, an onboard sensor, and are very slow.
Each increment, some small percentage of the remaining missiles will hit whatever ship is the current target.
If those hits are enough to kill the target, the remaining missiles pick another target.
Rinse, repeat. In theory, a large salvo of these will just keep attacking until the entire fleet is gone.
In practice, there's one problem: sometimes the hits in a given increment do not kill the target, but instead destroy all of the engines and/or missile jammers.
As a result, the remaining missiles now have a 100% chance to hit, and so, in the following increment, they all hit.
End of entire salvo.
To mitigate these overkill losses, I launch very small salvos, spaced many minutes apart.
Each salvo should get all of its hits in before the next salvo arrives.
So my maximum losses from any given overkill event is (usually) a single salvo.
The upshot of this is that, after each salvo arrives, the game runs 5-second increments until all missiles in that salvo have hit.
This takes 10, 20, sometimes 30 increments for a salvo.
And because the hostile fleet is trying to launch AMMs every single increment, and is logging a message for every single missile that they are unable to launch an AMM for, well, we get this super bloated game log that crashes the game.
How to fix?
Might be easy...maybe instead of writing the event each time a ship wants to launch missiles but is out of them, you only write it the first time. This means keeping up with which fleets have written such a message this increment.
Or maybe each fleet gets a counter that is reset to 0 at the start of each increment, and you increase it by one instead of writing this message.
Then at the end of the increment you write one such message per ship with a non-zero counter, and append "x[N]" to the message, where N is the value of the counter. Then reset the counters back to zero.