Open jannaahs opened 3 years ago
Hey, i'm currently using the software to manage a server we're using. We have an issue though where we need the server to load the map as if it were loading on your own PC for the first time (showing the cutscene etc) but using a specific map seed generation. We're speedrunners and need to reload the same seed over and over for each run, unfortunately we're unable to use the save game feature as it requires a save made offline and uploaded and this doesn't count as it's not a 'fresh' run on the map. I see the map generator was added as a way to use the json file for map generation but i cannot for the life of me figure out how to use the --map gen json server commands anywhere - any ideas?
Testing with Vanilla factorio:
.
at all or a 0
at the first does not work (no symbol added)<input tpye="range"/>
"Unable to parse the request body: json: cannot unmarshal string into Go struct field EnemyEvolution.enemy_evolution.destroy_factor of type float32"
. Destroy-factor = 0.005.http: superfluous response.WriteHeader call from github.com/OpenFactorioServerManager/factorio-server-manager/api.GenerateMapPreview (handlers.go:525)
Testing with Mods (all Angel's mods):
factorio-server-manager | 2021/07/01 14:49:59 /opt/factorio/bin/x64/factorio <nil>
factorio-server-manager | 2021/07/01 14:50:06 Error in creating Factorio save: exit status 1
factorio-server-manager | 2021/07/01 14:50:06 Error creating map preview exit status 1
Generating map also failes (i guess it has the same reason):
@C0bai please visit our discord server: https://discord.gg/SB647WmSbU
This looks like there is still plenty of work. I have to figure out how I can add the mod support. This might be complicated and complex.
Regarding the error message, I have created a new issue #287 since it happens on other views as well. I will fix it separately because it should not wait until the map generator is finished.
I'm not sure how we want to support modded ores. I have downloaded https://mods.factorio.com/mod/bobores and tried to figure out where I can get the information of the added ores.
Unfortunately, they're added with in a LUA file - one file for each ore. This means we have to generic parse all LUA files.
@knoxfighter do you have any idea how we can handle it?
In the end it's always possible to either not have a map generator or only for non-modded saves.
@knoxfighter do you have any idea how we can handle it?
Yes, we can add LUA and read out the Mods by ourselves. I have some experience with that, cause of my factorio intellij plugin.
For now i would say, we should ignore mods. Just add a message on top, that with mods, that alter ores, the generation is broken. I will look into that sometime. Most mods will work, only some overhauls like Bobs, Angels or Industrial Revolution will break it.
To deal with mods it's probably a lot easier to just have factorio do the heavy lifting:
/c game.write_file("map-gen-settings.json", game.table_to_json(game.player.surface.map_gen_settings))
It is possible to get all data information with the startup parameter: --dump-data
The map generator replaces the possibility to create a save file with all possible settings you know from factorio.
Unfortunately there are some known issues related to the map template selection (default, island, death world, ... ). I wasn't sure how to map certain values so the template selection doesn't match the ingame templates. Therefore I have added some todo comments.
Open todo: