How to find the random seed of a saved game?

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report. For problems building from source, post in Compile.
Post Reply
Message
Author
Magnate
Space Squid
Posts: 66
Joined: Sat Nov 08, 2014 3:44 pm

How to find the random seed of a saved game?

#1 Post by Magnate » Sun Oct 08, 2017 8:39 am

Hi folks,

I want to re-run a particular game using the same galaxy. I didn't write down the seed because I could swear it used to be visible somewhere - either in the savefile name, or somewhere in the Options, or even in the Message window when you load up. I can't see it in any of those places and wonder if it's been removed or if I mis-remembered. Can anyone help?

Thanks

User avatar
Vezzra
Release Manager, Design
Posts: 4609
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: How to find the random seed of a saved game?

#2 Post by Vezzra » Sun Oct 08, 2017 8:47 am

The "[Game - Galaxy]" article in the Pedia shows all the game settings, including the seed. Please note that in order to recreate a specific galaxy, all game settings must be identical, not only the seed. If you change e.g. the number of systems, you'll get a different map and game, even if all the other settings are the same.

Morlic
AI Contributor
Posts: 238
Joined: Tue Feb 17, 2015 11:54 am

Re: How to find the random seed of a saved game?

#3 Post by Morlic » Sun Oct 08, 2017 8:52 am

If it is an XML save, then you can open and read the file with a standard text editor. Otherwise, you could always load the savegame and resave it as XML save.

Then search for "<m_seed>". You willl also find the rest of the galaxy setup data there. For example

Code: Select all

<galaxy_setup_data class_id="2" tracking_level="0" version="1">
	<m_seed>0</m_seed>
	<m_size>35</m_size>
	<m_shape>3</m_shape>
	<m_age>2</m_age>
	<m_starlane_freq>3</m_starlane_freq>
	<m_planet_density>3</m_planet_density>
	<m_specials_freq>0</m_specials_freq>
	<m_monster_freq>0</m_monster_freq>
	<m_native_freq>0</m_native_freq>
	<m_ai_aggr>5</m_ai_aggr>
	<m_game_rules class_id="3" tracking_level="0" version="0">
		<count>0</count>
		<item_version>0</item_version>
	</m_game_rules>
</galaxy_setup_data>
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Magnate
Space Squid
Posts: 66
Joined: Sat Nov 08, 2014 3:44 pm

Re: How to find the random seed of a saved game?

#4 Post by Magnate » Sun Oct 08, 2017 8:23 pm

Magic, thanks folks

Post Reply