Random Map Generator Crash
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Random Map Generator Crash
Random Map Generator Crash
When i use Random Maps, sometimes it crashes on Maps creation.
It happens with default map generator, on very big maps, especially when setting mountain very high and clicking often on "create new map".
But more often with custom Maps Genrator, as well more likely on big Maps and repeated generation.
Any Idea why that is? I feel like it should not happen.
May PC is pretty solid, so it should not be hardware related like too low on memory or something.
Is it long known and just dealt with?
When i use Random Maps, sometimes it crashes on Maps creation.
It happens with default map generator, on very big maps, especially when setting mountain very high and clicking often on "create new map".
But more often with custom Maps Genrator, as well more likely on big Maps and repeated generation.
Any Idea why that is? I feel like it should not happen.
May PC is pretty solid, so it should not be hardware related like too low on memory or something.
Is it long known and just dealt with?
The best bet is your own, good Taste.
-
dwarftough
- Posts: 622
- Joined: August 4th, 2019, 5:27 pm
- Contact:
Re: Random Map Generator Crash
Does it crash the whole game or just shows an error? More information on how you get the result and what you see would be nice
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
MP versions of classical mainline campaigns: UtBS, TRoW, SotA
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
Biased RNG in MP
MP versions of classical mainline campaigns: UtBS, TRoW, SotA
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
Biased RNG in MP
Re: Random Map Generator Crash
I tried it myself just moving the sliders for "Width", "Height", "Number of Hills", and "Max Hill Size" all the way to the right, and when I clicked "Close" it crashed immediately.
It didn't display any message, but there is this message in the log:
It didn't display any message, but there is this message in the log:
Code: Select all
error mapgen: No castle location found, for 2 players aborting.
Re: Random Map Generator Crash
crash the whole game to desktop, like it cannot handle too much of height iterations or whatever, causing an overflowdwarftough wrote: ↑September 4th, 2025, 5:34 pm Does it crash the whole game or just shows an error? More information on how you get the result and what you see would be nice
the error massage i didnt check so far, but yes, crashes immediatly, sometimes after clicking a bit generating another map.gnombat wrote: ↑September 4th, 2025, 6:28 pm I tried it myself just moving the sliders for "Width", "Height", "Number of Hills", and "Max Hill Size" all the way to the right, and when I clicked "Close" it crashed immediately.
It didn't display any message, but there is this message in the log:
Code: Select all
error mapgen: No castle location found, for 2 players aborting.
now i would have thought that this is something well known, as it happened also in 1.16 version (and most likely earlier, but i didnt care too much about random map genration before), i just decided to ask why it is, because it kinda annoys me, to crash to desktop every time (as said especially it happens also with well known random map generators like URM, and even more then). big maps, big mountains seem to crash generator.
and i also once tried generating maps for SXRPG (quite some years ago) but got to a point where it crashed all the time, and i didnt know what the exact reason was, maybe code, maybe generator, so i gave up on this one.
The best bet is your own, good Taste.
Re: Random Map Generator Crash
It seems like this is issue #1415 although that is marked as "Closed". 
Re: Random Map Generator Crash
Cannot reproduce a crash with the method mentioned by gnombat. I do get the mapgen error in the log but wesnoth does not crash and shows no map instead.
Would be good to get a backtrace from someone that can reproduce the issue.
Would be good to get a backtrace from someone that can reproduce the issue.
"If gameplay requires it, they can be made to live on Venus." -- scott
Re: Random Map Generator Crash
- Attachments
-
backtrace.txt- A (truncated) backtrace from version 1.18.5.
- (15.63 KiB) Downloaded 21 times
Re: Random Map Generator Crash
Ok, so generate_river_internal recurses a bit too much so you can run out of stack space. Looks like it recurses for every river hex. We should rewrite that to tail call recursion or really no recursion.
"If gameplay requires it, they can be made to live on Venus." -- scott