World/map generation problem

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
troilus
Engineer
Engineer
Posts: 3
Joined: 29 Nov 2021 12:47

World/map generation problem

Post by troilus »

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? :roll:
Eddi
Tycoon
Tycoon
Posts: 8269
Joined: 17 Jan 2007 00:14

Re: World/map generation problem

Post by Eddi »

uhm, isn't that the default behaviour?
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: World/map generation problem

Post by Taschi »

Eddi wrote: 30 Nov 2021 03:12 uhm, isn't that the default behaviour?
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.
User avatar
troilus
Engineer
Engineer
Posts: 3
Joined: 29 Nov 2021 12:47

Re: World/map generation problem

Post by troilus »

Taschi wrote: 30 Nov 2021 06:25
Eddi wrote: 30 Nov 2021 03:12 uhm, isn't that the default behaviour?
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.
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.:(
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.
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: World/map generation problem

Post by Taschi »

What version are you on?
User avatar
troilus
Engineer
Engineer
Posts: 3
Joined: 29 Nov 2021 12:47

Re: World/map generation problem

Post by troilus »

Taschi wrote: 01 Dec 2021 05:05 What version are you on?
12.1
Chuggers
Engineer
Engineer
Posts: 1
Joined: 20 Dec 2021 08:42

Re: World/map generation problem

Post by Chuggers »

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.
User avatar
troilus
Engineer
Engineer
Posts: 3
Joined: 29 Nov 2021 12:47

Re: World/map generation problem

Post by troilus »

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.
Thanks! I'll try that. :P
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 16 guests