HDIAndrew / EFS

12 stars 0 forks source link

Setting any numbers in the Difficulty section of EFS.ini to 263 or more freezes the game #73

Closed YeOldeEBM closed 1 year ago

YeOldeEBM commented 1 year ago

Description:

In EFS.ini there's the Difficulty section. If any of them are set to 263 or more (the default highest is 200 for Ridiculous) and all Houses are set to that difficulty, the game will freeze on random galaxy generation or when attacking a ruin in Historical. Some sort of issue with difficulty averaging (or lack thereof) when generating a Rebel stack, it seems.

For example, if four Houses are set to Ridiculous while the fifth is set to Difficult, the game will function. If all five Houses are on Ridiculous, the game freezes at the start of map generation with a random galaxy, or when attacking a ruin in Historical.

Expected behavior:

The game doesn't freeze with higher Difficulty numbers when all Houses are set to the same difficulty.

Actual behavior:

The game freezes with 263 or more Difficulty when all Houses are set to the same difficulty.

Game version:

1.5b5 and 1.5g1; 1.5b4 and earlier are fine. Some issue with the Ruin adjustments between b4 and b5, perhaps?

Steps to reproduce:

  1. Go to the Difficulty section of EFS.ini (line 94) and set beginner=263
  2. Start a new game with a random galaxy as any House
  3. The game freezes immediately upon generating the map

Alternately, load up the Historical galaxy and attack a ruin somewhere. As soon as the ruin is attacked, the game freezes.

Additional information:

https://user-images.githubusercontent.com/16946359/187326918-ff01b0c1-f27f-4906-967e-46c3f573854a.mp4

HDIAndrew commented 1 year ago

Good find! Probably not fixing for 1.5, but excellent one on which to work

YeOldeEBM commented 1 year ago

I figure it's an obscure enough bug that few players will ever encounter it, so there's no rush.

Matt-Caspermeyer commented 1 year ago

If a player sets the difficulty setting in EFS.INI too high, it can cause and issue where Min Units is more than Max Units for random galaxy (and ruin generation). Since I did not have a check for Min Units to ensure that it was less than MAX_STACK and did not check to ensure that Max Units was at least as high as Min Units, then there was an issue if Min Units was greater than MAX_STACK.

The fix properly clips both Min Units and Max units so that this issue is no longer possible.

Testing done

Followed the steps above and random galaxies no longer hang / crash when the difficulty level factor is set too high.

It is my hope that we can get this into a GC2 in the near future.