Page 1 of 1

[Bilka] [0.18.45] Map generator goes haywire

Posted: Sat Aug 08, 2020 6:51 am
by mrvn
I'm building a map generator for an islands map. Till now I just used --generate-map-preview to test the code resulting in this:
462892369.png
462892369.png (254.25 KiB) Viewed 3988 times
But when I start the game for real and generate a map preview in the GUI I get this:
gui.png
gui.png (1.96 MiB) Viewed 3988 times
When I start the game the map actually has all those dark blue squares in it which totally destroys the feel of the map.

Why does the command line map preview differ from the GUI preview and game? All the map generator code is in prototypes/map-gen-settings.lua.

Note: I made the screenshots with mode mods loaded but the problem remains with just cargo-ships. Map looks different but equally broken.

Re: [0.18.45] Map generator goes haywire

Posted: Sat Aug 08, 2020 7:23 am
by mrvn
Small update. I had to turn off prototype-caching in config.ini because it made my character sprite from I, Robot disappear and let me walk on water. With that option commented out I still see the corruption in the map preview but when I generate the map for real it seems to be OK.

I turned off sprite/atlas caching too but that didn't fix the map preview. So something is really broken.

Re: [0.18.45] Map generator goes haywire

Posted: Mon Aug 24, 2020 7:59 pm
by Rseding91
The command line option to generate a preview uses a bunch of special different logic compared to what the game actually uses.

I've thought about just deleting it and replacing it with what the preview screen uses but it's not a 1-1 replacement because the preview doesn't do 'scaling' (zooming out) of the results like the existing command line one 'can' do. however, that's near useless because it isn't the actual code that runs when you make a new game so it's never going to be perfect - and may have ohter bugs (as you're seeing).

Additionally the person who wrote the command line version no longer works for Wube and as far as I know none of us are interested in maintaining the command line version.

So I guess that leaves 2 options:

1. Don't use the command line option or accept it may be different from what the game actually does
2. I delete the existing command line option and replace it with what the preview GUI does

Re: [0.18.45] Map generator goes haywire

Posted: Mon Aug 24, 2020 8:01 pm
by Bilka
Hey, the corruption is most likely related to the if-else-chain that you are using. I have a simpler reproduction for this, but no promises for a fix for now.

Re: [0.18.45] Map generator goes haywire

Posted: Tue Aug 25, 2020 10:48 am
by mrvn
Rseding91 wrote: Mon Aug 24, 2020 7:59 pm The command line option to generate a preview uses a bunch of special different logic compared to what the game actually uses.

I've thought about just deleting it and replacing it with what the preview screen uses but it's not a 1-1 replacement because the preview doesn't do 'scaling' (zooming out) of the results like the existing command line one 'can' do. however, that's near useless because it isn't the actual code that runs when you make a new game so it's never going to be perfect - and may have ohter bugs (as you're seeing).

Additionally the person who wrote the command line version no longer works for Wube and as far as I know none of us are interested in maintaining the command line version.

So I guess that leaves 2 options:

1. Don't use the command line option or accept it may be different from what the game actually does
2. I delete the existing command line option and replace it with what the preview GUI does

That doesn't really address the problem. The preview GUI is the one that's buggy. The CLI and game (with prototype caching off) do the right thing.

Is the preview GUI different from the real game generator or is it pure luck the game generates right?

Re: [Bilka] [0.18.45] Map generator goes haywire

Posted: Wed Oct 14, 2020 4:40 pm
by Bilka
Thanks for the report, fixed for version 1.1.