Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random crash issues with ListSet.hpp #38

Open
Baraklava opened this issue May 18, 2022 · 2 comments
Open

Random crash issues with ListSet.hpp #38

Baraklava opened this issue May 18, 2022 · 2 comments
Labels
bug Something went wrong. game ai Relates to how units act and behave in the game. original bug This was an issue in the original game already. partially solved The issue is solved, but not in its entirety.

Comments

@Baraklava
Copy link

Describe the issue
**This is possibly a legacy bug related to the random crashes in the original game, and not specific to OpenLRR. The game crashed in a random manner, not tied to anything specific, at separate occasions. First time I had a lot of miners, some STTs and a Chrome Crusher, trying to clear the map (no creatures), second time I was observing some game behaviour, restarting the level over and over again, and at the time of the error, a monster was attacking the base. I had no vehicles, and only 5 miners.

Note: There have been several errors with different lines/names, might be more than one culprit here. Might need some more assertion throughout the entire thing.
Note 2: Luckily, one can click "Ignore" to go right past them, but it is a bit frustrating for sure.

Steps to reproduce
Since this occured in two separate scenarios and are not guaranteed, I will write down the approximate procudure I was doing:
Scenario A

  1. Start playing Rocky Horror
  2. Play the level for a longer time, preferably with many units, buildings and things going on. For example, try to teleport in 20 RRs, 3 STTs, a Chrome Crusher, and drill all the walls with the CC, without opening the crystal cache.
  3. At some point, the game should give the error and crash
  4. Press "Ignore" to ignore the error/crash

Scenario B

  1. Start playing Rocky Horror
  2. Give a few miners Laser Beams. Let them kill all monsters on the map.
  3. Let a monster attack the base by triggering an emerge.
  4. Restart the mission at some point, preferrably when a few buildings have been destroyed.
  5. Errors should appear after a while. In my experience it gave more consecutive errors
  6. Press "Ignore" to ignore the error/crash.

Additional information

  • Time played this session: 25-30 minutes for first encounter, 15 minutes for second encounter
  • Level: Rocky Horror
  • Game speed: 100-300%
  • Graphics fix: dgVoodoo 2.55
  • Using mods: Debug keys were enabled
  • Windowed mode: Yes

Additional context (optional)
In all cases here I didn't exactly play "as intended", so you might have to play a bit differently to hit the errors. The first time I tried to clear out an entire level, the second time I was trying to observe some game behaviour to implement into MM and restarted the level many times. It is possible that restarting the level was related to some of the crashes, as crashes after several restarts appeared to have more errors pop up.

Screenshots (optional)
1. Appeared after attempting to drill all walls in Rocky Horror with a Chrome Crusher. The Hard Rock walls are the last remaining walls, not counting the 2 walls in front of the cache. Game crashed somewhere in the process of drilling the second-to-last wall, it appears to have been shortly after the drilling started. Also seems there was a Rock Raider right in front of the Chrome Crusher that might've overlapped with it right as it happened?
image

2. New play session a day later. I tried observing how alerts reacted to creatures being killed. Appeared once after restarting the level once, while a monster was attacking the base:
image

3. Still second session. Appeared several times in a row after restarting the level a few times:
image

@trigger-segfault trigger-segfault added the bug Something went wrong. label Aug 11, 2022
@trigger-segfault
Copy link
Owner

trigger-segfault commented Sep 13, 2022

So this is 100% related to the AITask ListSet, I'm able to reproduce it while monitoring the AITask count, and it throws an error the moment 2048 tasks are reached.

The solution will be to gut and replace the original AITask ListSet with one that has a much higher cap. Any functions still referencing the original ListSet will need to be implemented, but I think most (if not all) related functions are already implemented, so this could be a pretty quick fix when I get around to it.

Edit: This is actually partially OpenLRR's fault, the error message for reaching the ListSet limit will hit at half the maximum count of ListSet items. So this is why it's more likely to be hit in OpenLRR than vanilla.

Screenshot:
image

@trigger-segfault trigger-segfault added original bug This was an issue in the original game already. game ai Relates to how units act and behave in the game. bug Something went wrong. and removed bug Something went wrong. labels Sep 13, 2022
@trigger-segfault
Copy link
Owner

The half-capacity issue has now been fixed in 29879f7.

@trigger-segfault trigger-segfault added the partially solved The issue is solved, but not in its entirety. label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong. game ai Relates to how units act and behave in the game. original bug This was an issue in the original game already. partially solved The issue is solved, but not in its entirety.
Projects
None yet
Development

No branches or pull requests

2 participants