-
Notifications
You must be signed in to change notification settings - Fork 751
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
Certain seeds cause dungeon generation to get stuck in an infinite loop #5346
Comments
As was mentioned in Discord, you can also reproduce using debug commands in a Multiplayer game.
And it was confirmed to hang in vanilla Diablo as well. |
The issue here is that it fails to connect two doors, walking in the opposite direction, hitting a wall and not turning around. beginning 22x10, end 10x12, dir: 3
After 1600 iterations:
|
It's stuck moving left and right between 31x11 and 38x11. So looks like it decided to plow though the C corner and get stuck inside that wall. |
I suppose a solution can be to add a std::future call and add a timeout, incase we don't get generation within time we stop that thread and try to regenerate with a different seed. I am new to this codebase, if pointed to generation code I'll be happy to implement it. |
If you intend to time it out, you can avoid the thread management and use |
I think it's doable |
Isn't this the halting problem? |
No, a key component of the halting problem is highlighted in that first sentence on Wikipedia.
We would only need to determine what the conditions are for this particular loop to become infinite, not any arbitrary algorithm. Then we could hardcode an edge case or workaround for it. |
Operating System
Linux x64
DevilutionX version
1.4.1 (latest release)
Describe
Some seeds, such as the 3 in the attached test case cause the program to hang during dungeon generation. I've attached a test case demonstrating the issue.
To Reproduce
Expected Behavior
Program does not hang
Additional context
No response
The text was updated successfully, but these errors were encountered: