Fair distribution of EPs among stars.

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.
Post Reply
Message
Author
User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Fair distribution of EPs among stars.

#1 Post by eleazar » Sun Mar 09, 2008 1:15 am

continued from here after some thought.

It's not vital yet, but it would be nice to iron this out. Questions like this: "Are you assuming that the distances between populated systems will typically be much larger than the distances fleets can be supplied?" are hard to address when the planetary distribution is irregular.

The EP wheel was devised in large part to make terraforming equally fair a species at any point on the wheel. I presume that the number of inhabitable EP types will also be fairly distributed... or at least that's the best place to start things. If we get everything balanced in a "fair" universe, then might be the time to consider balancing inferno-dwellers if we want inferno planets to be rare.

Ideally each EP would have a unique color (or pair of colors) where it was most likely to find the preferred planets. I finally figured out how to do that (see attachment). This is the best justification for having any game significance for different colored stars.

And of course a fair universe would also not tilt the balance in favor of different EPs with different age settings. Instead age can simply increase the probability of neutron stars and black holes, which while not favoring any particular inhabitable planet type, have fewer and smaller planets.

With the assumption that playable races won't live in asteroids or gas giants (at least before 1.0) the attached file should produce an EP-neutral universe with all universe age settings. This settings may be arguable less realistic, but they are easier for the player to understand.


As a v.8 feature perhaps the distribution of EP types could be controlled according to the needs of the races actually playing... and/or AI races could be chosen to balance out the EPs not chosen by humans.
Attachments
EP-fair-universe.zip
universe_tables, and a spreadsheet showing how the weird planet distribution numbers are fair.
(34.23 KiB) Downloaded 103 times
Last edited by eleazar on Mon Mar 10, 2008 4:45 pm, edited 1 time in total.

User avatar
Krikkitone
Creative Contributor
Posts: 1414
Joined: Sat Sep 13, 2003 6:52 pm

Re: Fair distribution of EPs among stars.

#2 Post by Krikkitone » Mon Mar 10, 2008 3:58 pm

Well a few points.

1. it is not just EP fairness in terms of Numbers of planet but sizes of planets

Are certain EPs more likely to be large or small planets?


2. As for having an equal distribution of EP among the races that are in a particular game, that I think is worthless... If Everyone else happens to be Ocean and you pick desert , lucky for you. it could be a game setting (Equal EP competition, Random EP competition, or Only player EPs ... ie the AIs will only pick races with the same EP as a Human players' races.. or nonPlayer EPs... the AIs will only pick Races as far as possible from the Human player's races). However I would expect Random to be the Standard Setting... As for our preset races, I would favor getting some degree of balance there

3. It might be possible to have the 'effect' more than just more neutron stars/black holes to age, perhaps stars have more or less total planets (because more of them have lost/gained planets) That way there is still the color Indicator. Perhaps the "Giant" version of a star has fewer planets over all (they were swallowed up or unable to form) and older galaxies have more "Giant" stars. (or Neutron stars/blackholes)
So the FO Astronomical evolution would go
Star (any color)->Giant Star (any color) [fewer planets]->Neutron Star/Black hole (no color, fewest planets)

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Fair distribution of EPs among stars.

#3 Post by eleazar » Mon Mar 10, 2008 4:45 pm

Krikkitone wrote:1. it is not just EP fairness in terms of Numbers of planet but sizes of planets

Are certain EPs more likely to be large or small planets?
Yes, that's an issue i forgot to mention in my post. The current system is more likely to give planets of certain sizes to certain EPs. My generation chart above gives each EP the same chance at various planet sizes.

Of course we may choose to tweak each EP's size, and/or probability of occurring, so that each EP offers different gameplay, but that's something that should be done purposefully and carefully. It would best be achieved by purposeful deviations from a "fair" baseline... not by trying to craft rules that balance the current somewhat chaotic distribution.

Krikkitone wrote:2. As for having an equal distribution of EP among the races that are in a particular game, that I think is worthless... If Everyone else happens to be Ocean and you pick desert , lucky for you. it could be a game setting (Equal EP competition, Random EP competition, or Only player EPs ... ie the AIs will only pick races with the same EP as a Human players' races.. or nonPlayer EPs... the AIs will only pick Races as far as possible from the Human player's races). However I would expect Random to be the Standard Setting... As for our preset races, I would favor getting some degree of balance there.
Yes, in the last paragraph of my first post, i mention that we may want to regulate EP distribution according to the species in that game and/or choose AI's EPs to balance things out. But since we currently have only 1 race, the best way to simulate what the universe will be like with multiple species is to set up the universe as if there was an even distribution of EPs.

Krikkitone wrote:3. It might be possible to have the 'effect' more than just more neutron stars/black holes to age, perhaps stars have more or less total planets (because more of them have lost/gained planets) That way there is still the color Indicator. Perhaps the "Giant" version of a star has fewer planets over all (they were swallowed up or unable to form) and older galaxies have more "Giant" stars. (or Neutron stars/blackholes)
So the FO Astronomical evolution would go
Star (any color)->Giant Star (any color) [fewer planets]->Neutron Star/Black hole (no color, fewest planets)
Currently IIRC all that the universe age can effect is the probability of stars of various colors appearing.

Also there are no "Giant versions of a star". There are simply 6 colors of stars (+ black hole) which i have recently given different sizes to each color to help distinguish them.

User avatar
marhawkman
Large Juggernaut
Posts: 938
Joined: Fri Jan 20, 2006 9:34 pm
Location: GA

Re: Fair distribution of EPs among stars.

#4 Post by marhawkman » Wed Mar 12, 2008 4:38 pm

Hmm... Here's a thread about something similar from a year or two ago. (back when I made a mod of Freeorion, yeah we're not even at 1.0 and there's 2 mods :))

http://freeorion.org/forum/viewtopic.php?f=6&t=1322
Computer programming is fun.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Fair distribution of EPs among stars.

#5 Post by eleazar » Sat Mar 15, 2008 4:23 am

marhawkman, how did you get your tallies?

i tried looking in the save-file, but i can't find planet type anywhere.

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

Re: Fair distribution of EPs among stars.

#6 Post by Geoff the Medio » Sat Mar 15, 2008 6:55 am

Planet type is stored in the <m_type> tags in a save file, which appear within <item ... class_name="Planet" ...> tags, where ... is other stuff in a tag. The contents of ... might vary from version to version of FreeOrion, but class_name="Planet" should be the same.

Note that a given Planet may appear in the file more than once, but not all Planets will appear the same number of times. Each Empire's exploration and known data about the Universe is encoded, including what Planets it knows about, separately from the whole universe. If you restrict the count to planets within the <universe ... > tags, you'll count each one only once, though.

A Planet's m_type is encoded as an integer, with these correspondances (from enums.h, for PlanetType)
  • PT_SWAMP = 0
    PT_TOXIC = 1
    PT_INFERNO = 2
    PT_RADIATED = 3
    PT_BARREN = 4
    PT_TUNDRA = 5
    PT_DESERT = 6
    PT_TERRAN = 7
    PT_OCEAN = 8
    PT_ASTEROIDS = 9
    PT_GASGIANT = 10
Other classes have their own <m_type> tags with numbers that are unrelated to the Planet ones, so you can't just look for any <m_type> within the <universe ...> tags.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Fair distribution of EPs among stars.

#7 Post by eleazar » Sat Mar 15, 2008 7:37 pm

geoff, thanks...

Now that's it's easy to crunch the numbers, something rather broken is made evident: The universe generator has some very strong biases towards certain planet types.

* I zeroed out everything having to do with planets in the universe_tables.
* I generated a 500 star galaxy, and saved before taking a turn
* I used a text editor to count all instances of the planet types
* I got the following results:
  • swamp 100
    toxic 363
    inferno 361
    radiated 379
    barren 339
    tundra 106
    desert 109
    terran 121
    ocean 87
    asteroid 119
    gasgiant 742
In all my tests "Radiated" was the highest followed by these three: "toxic", "inferno", & "barren." Ocean was always the least plentiful. Swamp, tundra, desert, and terran were usually about equal. There are always vastly more gas giants than asteroids

I am stuck using a slightly out of date version (rc 4, or maybe 5), the last one i could get to work on my mac, so it's possible my results aren't duplicated in current versions. I'd be interested to see if other people get these sort of results.

EDIT: it looks like it reads the tables all wrong. I changed the frequency of neutrons and black holes, and everything else was zeroed. The number of these star types changed, and the number of barren planets changed massively.

Also with everything zeroed, i get a nearly equal mix of tiny, small, and medium... and absolutely no large or huge worlds.

User avatar
marhawkman
Large Juggernaut
Posts: 938
Joined: Fri Jan 20, 2006 9:34 pm
Location: GA

Re: Fair distribution of EPs among stars.

#8 Post by marhawkman » Sun Mar 16, 2008 7:59 am

O_O! what did you do?!?

BTW I made my tables the hard way. Create a crapload of scout ships and explore everything. :?

Anyways, as you may have noticed, your data is pretty close to mine. The generation is complicated. There's (I think) three seperate tables that influence planet generation.
Computer programming is fun.

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

Re: Fair distribution of EPs among stars.

#9 Post by Dilvish » Sat Feb 08, 2014 9:01 pm

I just added some planet type summary reporting to the universe generation code so that we could know a little better just how this is turning out. Some of my results are below. It looks like most of the planet distributions are much more even then they had been at the time this thread started, which is very good. Looking at the universe tables it's not clear to me that the heavy weighting of Asteroids and especially Gas Giants is really intended, but at least now there's an easy way to check things.

Code: Select all

planet summary for default settings
2014-02-08 12:43:38,376 DEBUG Server : Planet Type Summary for a total of 240 placed planets
2014-02-08 12:43:38,376 DEBUG Server : 	        Swamp: 5.0%
2014-02-08 12:43:38,376 DEBUG Server : 	        Toxic: 8.8%
2014-02-08 12:43:38,376 DEBUG Server : 	      Inferno: 8.8%
2014-02-08 12:43:38,376 DEBUG Server : 	     Radiated: 6.2%
2014-02-08 12:43:38,376 DEBUG Server : 	       Barren: 4.6%
2014-02-08 12:43:38,376 DEBUG Server : 	       Tundra: 6.2%
2014-02-08 12:43:38,376 DEBUG Server : 	       Desert: 7.1%
2014-02-08 12:43:38,376 DEBUG Server : 	       Terran: 7.9%
2014-02-08 12:43:38,376 DEBUG Server : 	        Ocean: 5.0%
2014-02-08 12:43:38,376 DEBUG Server : 	    Asteroids: 14.6%
2014-02-08 12:43:38,376 DEBUG Server : 	    Gas Giant: 25.8%

with other seeds:

2014-02-08 12:29:10,091 DEBUG Server : Planet Type Summary for a total of 194 placed planets
2014-02-08 12:29:10,091 DEBUG Server : 	        Swamp: 4.1%
2014-02-08 12:29:10,091 DEBUG Server : 	        Toxic: 5.2%
2014-02-08 12:29:10,091 DEBUG Server : 	      Inferno: 7.7%
2014-02-08 12:29:10,091 DEBUG Server : 	     Radiated: 4.6%
2014-02-08 12:29:10,091 DEBUG Server : 	       Barren: 3.6%
2014-02-08 12:29:10,092 DEBUG Server : 	       Tundra: 6.2%
2014-02-08 12:29:10,092 DEBUG Server : 	       Desert: 3.6%
2014-02-08 12:29:10,092 DEBUG Server : 	       Terran: 5.7%
2014-02-08 12:29:10,092 DEBUG Server : 	        Ocean: 6.2%
2014-02-08 12:29:10,092 DEBUG Server : 	    Asteroids: 17.0%
2014-02-08 12:29:10,092 DEBUG Server : 	    Gas Giant: 36.1%

2014-02-08 12:48:12,422 DEBUG Server : Planet Type Summary for a total of 211 placed planets
2014-02-08 12:48:12,422 DEBUG Server : 	        Swamp: 7.6%
2014-02-08 12:48:12,422 DEBUG Server : 	        Toxic: 7.1%
2014-02-08 12:48:12,422 DEBUG Server : 	      Inferno: 6.2%
2014-02-08 12:48:12,422 DEBUG Server : 	     Radiated: 9.0%
2014-02-08 12:48:12,422 DEBUG Server : 	       Barren: 5.7%
2014-02-08 12:48:12,422 DEBUG Server : 	       Tundra: 5.2%
2014-02-08 12:48:12,422 DEBUG Server : 	       Desert: 4.7%
2014-02-08 12:48:12,422 DEBUG Server : 	       Terran: 6.6%
2014-02-08 12:48:12,422 DEBUG Server : 	        Ocean: 6.6%
2014-02-08 12:48:12,422 DEBUG Server : 	    Asteroids: 15.2%
2014-02-08 12:48:12,422 DEBUG Server : 	    Gas Giant: 26.1%

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: 12250
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Fair distribution of EPs among stars.

#10 Post by Geoff the Medio » Sat Feb 08, 2014 9:18 pm

Dilvish wrote:...heavy weighting of Asteroids and especially Gas Giants...
Probably not for asteroids at least.

Post Reply