About the Galaxy Seeds

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Message
Author
User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

About the Galaxy Seeds

#1 Post by Num7 »

The Galaxy Setup screen always keeps every settings from the last played game, including the seed. By keeping the seed, it allows you to play on the same exact map as you did in your previous game.

Although it's all right to bring back the previous seed (in case you'd want to play in the same universe again), wouldn't it make more sense to generate a new random seed every time the Galaxy Setup screen is opened to create a new game?
If this post contains code, it's released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#2 Post by Geoff the Medio »

It's been proposed to have a randomize button next to the seed box. I think that would be better than automatically entering a random seed for the reason you mentioned: being able to regenerate the same galaxy as was previously played. For testing in particular, this is quite useful to have happen automatically.

User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

Re: About the Galaxy Seeds

#3 Post by Num7 »

Maybe I can try to add a randomize button for the seed.

Would that be something you guys want me to do?

If so, what's the maximum of a seed? And can a seed contain letters as well?
If this post contains code, it's released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#4 Post by Geoff the Medio »

MarcThibeault wrote:Would that be something you guys want me to do?
Sure...
If so, what's the maximum of a seed? And can a seed contain letters as well?
The seed sent by clients to the server is a (arbitrary) string, which is converted to a number by the server using a hash function.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: About the Galaxy Seeds

#5 Post by Dilvish »

A little more info -- I think what had previously been settled on as ideal was that what appears in the seed textbox would have two components -- one portion of which can be randomly scrambled by an adjacent 'Randomize' button, and a second portion which is a coded specification of the galaxy settings (number of stars, various densities, number of AIs in a single player game, etc). That way the seed string can be shared as a galaxy specification (like in a forum post) which can recreate the galaxy identically, but which can also be easily randomized for a new game. For that to work, loading a new (compatible) string into the box would adjust the rest of the settings appropriately. Some people might want an extra button that would scramble the entire thing, including all settings like number of stars, but discussing the possibility of that as an extra button should probably be left for later, the clutter probably would outweigh the value (imho).

On a side note, I think another excellent option to think about implementing would be the "Add a binary flag and related checkbox in the options screen to make the game use the default location for the resources directory," explained further on the programming work page
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#6 Post by Geoff the Medio »

If I pressed randomize, I'd expect it to keep the set galaxy parameters, not randomly pick new ones.

If a seed is to be able to specify those parameters, it needs to be by using a series of special indicators in the seed, which would not appear in a randomly generated seed, and which are unlikely to appear in someone typing in something.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: About the Galaxy Seeds

#7 Post by Dilvish »

Geoff the Medio wrote:If a seed is to be able to specify those parameters, it needs to be by using a series of special indicators in the seed, which would not appear in a randomly generated seed, and which are unlikely to appear in someone typing in something.
When I was thinking about implementing this (but not quite getting around to it), I was planning on having the seed include two segments of fixed length, the one being randomized, and the other encoding the galaxy settings. Starting to edit the value would grey out the start button and the overall seed would be parsed for validation and setting of the various galaxy options once enter was hit or there was a click outside the combo-seed textbox. Though normally you'd expect people to just use block copy-paste operations for getting or setting the value (if not using the other option setting elements).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#8 Post by Geoff the Medio »

Dilvish wrote:Though normally you'd expect people to just use block copy-paste operations for getting or setting the value (if not using the other option setting elements).
Copy and paste don't presently work in FreeOrion.

User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

Re: About the Galaxy Seeds

#9 Post by Num7 »

I was able to produce the following:
randomseed1.png
randomseed1.png (39.23 KiB) Viewed 4492 times
I was unsure where to put the random button because the galaxy preview would allows overlap it if I was just to put it after the seed textbox. I decided to fool around a bit and make the seed textbox a bit smaller. Just let me know how you'd like the Setup window to look with the random button. Where and how it should be.

And, how long should the seed be?
If this post contains code, it's released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#10 Post by Geoff the Medio »

To the right of the seed text box is the best place.

It doesn't need to be as large as you've made it though. There are some default/mouseover/clicked icons to use for it in the default/data/art/icons/buttons/ directory including this:
Image
8 characters of random generated seed is probably fine. You could also pick a random (suitable) word from the stringtable in order to produce memorable seed words instead of character jumbles.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: About the Galaxy Seeds

#11 Post by Dilvish »

As for length of the random seed portion, it looks like you're using upper and lower case, A-z, plus the ten decimal digits (for radix 62); in checking if it had a formal name I noticed a suggestion to drop the uppercases of 'o' ('O') and 'i' ('I') to avoid font-dependent confusion with zero ('0') and lowercase 'L' ('l'), which makes sense, so that would leave us radix 60 (sexigesimal). I suppose uppercase 'o' and 'i' don't necessarily need to be barred form user input, they could just be treated as synonyms for zero and lowercase 'L'. (That's my suggestion anyways.) So with that system, two digits would get us 3600 distinct seeds, 3 digits ~200k seeds, and and 4 digits would get us to ~13M possible seeds.

Before I got this submitted I see Geoff has suggested 8 chars, I think getting us to ~187 T possible seeds, which sounds fine too (folks do like to have a mind-boggling amount of available variety :D )
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

Re: About the Galaxy Seeds

#12 Post by Num7 »

I listened to both of your suggestions and I did the following:
The attachment randomseed3.png is no longer available
I made the button a dice icon, it looks really clean. I also removed capital i and o to avoid confusion with the numbers, which seems logical if seeds are to be shared between 2 people in order to reproduce game experiences, making them easier to read.

I don't know yet how to get my hands on random words from a string table. In that case here, I tend to prefer totally random seeds though. 60^8 possibilities for one single galaxy configuration. Seems quite reasonable.

I produced a patch so that you can check it out and commit it if you guys are comfortable with it.
Attachments
randomseed3.png
randomseed3.png (13.07 KiB) Viewed 4485 times
If this post contains code, it's released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#13 Post by Geoff the Medio »

You should probably removed 0 and l as they are just as easily mistaken for another character as the ones you did omit.

Please remove the include of stdlib.h and instead use one of the random functions in Random.h.

The storage size of the number that the seed is converted to server side might be less than 60^8.

Could you add a tooltip describing what clicking the randomize button will do?

Getting words from the stringtable would require some custom coding to select only appropriate single words. There possibly some useful starting point code in the chat autocomplete, though.

User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

Re: About the Galaxy Seeds

#14 Post by Num7 »

Here's the update:
randomseed4.png
randomseed4.png (19.55 KiB) Viewed 4459 times
I removed zero and l.
I added a mouse over tooltip.
I'm no longer using stdlib.h.

EDIT:
I noticed that the seed textbox is smaller in the multiplayer setup window, but the dice button doesn't appear.
If this post contains code, it's released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About the Galaxy Seeds

#15 Post by Geoff the Medio »

You're not explicitly including stdlib.h but you're still using the rand() function from it, rather than something from Random.h such as RandSmallInt.

Post Reply