World/map generation problem
Moderator: OpenTTD Developers
World/map generation problem
Hi all, how to set the generation_seed that game always generate new seed map after restart a game on dedicated server?
Or any other ways to achieve that?
Or any other ways to achieve that?
Re: World/map generation problem
uhm, isn't that the default behaviour?
Re: World/map generation problem
Yes, it is, and if my code analysis from https://github.com/OpenTTD/OpenTTD/issues/9433 is correct, there isn't even a way to provide a fixed seed through the configuration file, only through the -G and -g command line switches.
So, if OP's server keeps creating identical maps, the most likely culprit is a customized launcher script which contains the -G command line switch.
Re: World/map generation problem
Thanks! But I really don't know why seed doesn't change after I reatart the game by type "Exit" and "openttd -D" on the server. It's a linux server.Taschi wrote: ↑30 Nov 2021 06:25Yes, it is, and if my code analysis from https://github.com/OpenTTD/OpenTTD/issues/9433 is correct, there isn't even a way to provide a fixed seed through the configuration file, only through the -G and -g command line switches.
So, if OP's server keeps creating identical maps, the most likely culprit is a customized launcher script which contains the -G command line switch.
Steps:
1.openttd -d start a game
2.getseed and seed is 0001
3.exit to end server
4.openttd -d start a game
5.getseed and seed is 0001
6.Edit openttd.cfg and change the seed to 0002
7.openttd -d start a game
8.getseed and seed is 0002
9.exit to end server
10.openttd -d start a game
11.getseed and seed is 0002
13.check openttd.cfg and seed is 0002
14.Delete generation_seed = 0002 line in openttd.cfg
15.openttd -d start a game
16.getseed and seed is 0003
17.check openttd.cfg and new line in [network] "generation_seed = 0003"
Last edited by troilus on 30 Nov 2021 10:01, edited 3 times in total.
Re: World/map generation problem
What version are you on?
Re: World/map generation problem
I was having the same problem on my server that I had to reset after a given year with "reset_game_year", I got around the problem by using the "on_dedicated.scr" script with the single command "newgame". You just put the script file in /openttd/scripts/
Using "restart" or exiting and restarting the dedicated server will use whatever the last seed was, and that seed is put in the config as far as I know. The "newgame" command works the same as generating a world in single player, and chooses a random seed.
I hope this helps, I'm not 100% sure my explanation is super accurate but this is the solution that fixed this issue for me.
Using "restart" or exiting and restarting the dedicated server will use whatever the last seed was, and that seed is put in the config as far as I know. The "newgame" command works the same as generating a world in single player, and chooses a random seed.
I hope this helps, I'm not 100% sure my explanation is super accurate but this is the solution that fixed this issue for me.
Re: World/map generation problem
Thanks! I'll try that.Chuggers wrote: ↑20 Dec 2021 10:32 I was having the same problem on my server that I had to reset after a given year with "reset_game_year", I got around the problem by using the "on_dedicated.scr" script with the single command "newgame". You just put the script file in /openttd/scripts/
Using "restart" or exiting and restarting the dedicated server will use whatever the last seed was, and that seed is put in the config as far as I know. The "newgame" command works the same as generating a world in single player, and chooses a random seed.
I hope this helps, I'm not 100% sure my explanation is super accurate but this is the solution that fixed this issue for me.
Who is online
Users browsing this forum: No registered users and 11 guests