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

[Bug] Game crashes due to missing construction tape as constructor wonders off the site #35

Open
1 of 2 tasks
lockheed opened this issue Apr 11, 2024 · 3 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@lockheed
Copy link

lockheed commented Apr 11, 2024

Operating System

Linux

Source of bug?

  • Original M.A.X. v1.04
  • M.A.X. Port

M.A.X. Port Version

Latest git

M.A.X. and DOS or DOSBox Versions

No response

What is the issue you encountered?

I attach a game that crashes inevitably at the end of this turn. Savegame attached.
Would you be able to identify the cause?
SAVE6.DTA.zip

Anything to add?

No response

@lockheed lockheed added the bug Something isn't working label Apr 11, 2024
@klei1984
Copy link
Owner

Thanks for reporting.

Did you build the game in Release mode?

In Debug mode builds assertion tests are active and I get the following assertion which hints at the problem.
image

The same happens in original dosmax, which even gives more info on the error.
image

You probably found an original dosmax defect. I will do a root cause analysis later. For the time being, here is a saved game file which is made after I worked around the error in a debug session. You can continue to play with it (until the next crash).

SAVE6.ZIP

@lockheed
Copy link
Author

lockheed commented Apr 12, 2024

Excellent. Thanks.
Yes, I regularly do get those error windows but 19 times out of 20 clicking Ignore just progresses the game.

@klei1984
Copy link
Owner

klei1984 commented Jun 2, 2024

The cause for this assertion failure is defect 12.
kép

The engineer or constructor leaves the building site while it is effectively still constructing a building. Root cause is not known for defect 12 yet. The parent unit of the construction slab is the constructor to the right, therefore mouse click on the 2x2 tile big slab selects the constructor at the other location.

The constructor's remaining build_time parameter is 1 meaning it is not finished building. Its build_list has one planned job, to create an eco-sphere. The unit plays its working on a building sprites instead of the idle sprites. The unit has a target location that is not the actual location, and both the current and previous unit order is await order in init state. This means that the unit will get a find path task on game reload to be able to reach target location. This means that when the building manager task searches for a close vicinity constructor to build a new depot, our faulty unit will be selected for the job. Starting at the next turn the build_time parameter counts down to zero and the game crashes as under the constructor there is no slab or cone or tape "unit" to be found that could be destroyed signalling the completion of the construction.

Unfortunately the saved game file contains the corrupted state of the unit, it is not possible to diagnose the issue further using debugging the saved file. I will try to provoke a computer player in another game to commit the corruption.

@klei1984 klei1984 changed the title [Bug] Game crashes [Bug] Game crashes due to missing construction tape as constructor wonders off the site Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants