Random Idea: Empire Placement

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Message
Author
wobbly
Cosmic Dragon
Posts: 1877
Joined: Thu Oct 10, 2013 6:48 pm

Random Idea: Empire Placement

#1 Post by wobbly »

So was looking at the scripting for empire placement, and if I understand it correctly, It works by creating a list of starting positions = no. of empires that match the following criteria:

A minimum distance of x jumps between empire starting position.
A minimum no. of systems within y jumps of starting position.
A minimum no. of "habitable" planets within y jumps of starting position. (GGs don't count and the scripting is unaware of the empire race, counting the empire race requires a full rewrite).

So you can't guarantee habitable worlds (it doesn't know the empire species), but maybe you can skewer the probabilities by dividing the universe into 2 sets? e.g.

Set A: The 50% (actual % defined in options.py) of the universe with the greatest "spread" of planet types in vicinity. (not sure on best measurement of spread)
Set B: The 50% of the universe with the least "spread" of planet types in vicinity.

So instead of trying to pick a match for the criteria from Set (Universe), it tries Set (A) and if fail moves to Set (B).

Edit: Alternative version with Set (A) being the middle of the range and Set (B) being the outliers.

BlueAward
Vacuum Dragon
Posts: 646
Joined: Mon Aug 08, 2022 3:15 am

Re: Random Idea: Empire Placement

#2 Post by BlueAward »

"Spread" could be something like root mean squared error or similar concept. You count number of planets total in the "vicinity". Possibly even better - sum weighted by habitable size. Presumably count gas giants and asteroids too? Would that not skew the size? That is the tricky part for includkng size.

Divide that number by how many types of environments there are. That's your expected (mean) size (habitable?) per environment in the vicinity. Then do the same per each individual environment, and somehow count the differences between value per environment and the mean value, like root mean square error. If it were zero then everything is perfectly balanced, the higher number the bigger "spread" (variance)

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Random Idea: Empire Placement

#3 Post by LienRag »

Why not ? Should be tested, obviously.
Also, it's possible I believe (didn't look at the specific code, though) to change the environment after the player's race is chosen (so, adding one good medium planet for the player's race in a random number of jumps - or more if we want so).

wobbly
Cosmic Dragon
Posts: 1877
Joined: Thu Oct 10, 2013 6:48 pm

Re: Random Idea: Empire Placement

#4 Post by wobbly »

I guess 1 of my misgivings about skewing starting locations is whether you create a probability "gravity well". e.g. empires close to ideal probability centers are pulled closer together, empires seperated by unideal locations are pushed further apart? Trying to visualize this...

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Random Idea: Empire Placement

#5 Post by Ophiuchus »

wobbly wrote: Wed Feb 01, 2023 3:36 pm So you can't guarantee habitable worlds (it doesn't know the empire species), but maybe you can skewer the probabilities by dividing the universe into 2 sets? e.g.
side note: you can guarantee that after placing the empires by modifying the universe in another pass.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Random Idea: Empire Placement

#6 Post by Oberlus »

To ensure a minimum spread and/or a similar spread of planets sizes or environment for all empires, you have to place the planets and set their environments with that in mind. Otherwise RNG will always mess it. It's really easy to get strong diferences between the spread for locations in that Set(A), so that some players start in significavely worse places than others despite being one of the 50% best places. You could also pick a smaller percentage, but at some point the allocation problem becomes unsolvable, and the algorithm ends up picking bad places anyways. The problem of finding those places is NP-hard. It's much easier (computationally) to do it the other way round: pick HWs looking only for distance to others and number of planets, then set environments of the planets.
Or what Ophiuchus says, reset the environments around HWs on an extra pass to ensure some minimum number of good, adequate and poor planets. Worth doing!

wobbly
Cosmic Dragon
Posts: 1877
Joined: Thu Oct 10, 2013 6:48 pm

Re: Random Idea: Empire Placement

#7 Post by wobbly »

Yeah I considered painting over environment types after empire placement but that's problematic too. You are still not going to get balance without going to extremes and at some point it becomes a little too artificial or symmetrical.

So anyway my idea isn't meant to ensure balance, just make the luck factor less common and less extreme with the minimum of changes to universe generation.

It's not necessarily the best way of doing things, for the moment I'm just floating ideas.

wobbly
Cosmic Dragon
Posts: 1877
Joined: Thu Oct 10, 2013 6:48 pm

Re: Random Idea: Empire Placement

#8 Post by wobbly »

Maybe a real basic paint-over might be:

Find most common planet type(s) (exclude GGs and asteroid). This is the pool of planets eligible for change.
Ensure at least 1 habitable planet for species.
Ensure at least 1 of each environment triplet (e.g. Max gap in planet wheel = 2)
If most common > x random reroll common - x

quarague
Space Floater
Posts: 31
Joined: Thu Jan 05, 2023 8:00 pm

Re: Random Idea: Empire Placement

#9 Post by quarague »

I would try to aim for something that is at least somewhat understandable / deducable for the human player. Suitable numbers for minimum distance between empire, minimum number of systems and minimum number of habitable planets all depend on the parameters of the universe the player generated. I haven't looked at the code but I would expect that if I choose a bigger number of systems in the galaxy I am more jumps away from the other empires (this does work from empirical observation).

Different spots can be easier or harder to start out in due to RNG but I don't really see a need to fix that. If you want to slightly even out unlucky starting positions I would use something like: every empire is guaranteed at least one other good planet in a system reachable in at most two jumps from the starting system. Codewise, that would be achieved by adding in such a planet after placing the empires in the galaxy.

Going far beyond that to me wouldn't improve the game but have a high risk to lead to strange/ undesirable side effects if you put some extreme values in the galaxy generation.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Random Idea: Empire Placement

#10 Post by Oberlus »

quarague wrote: Thu Feb 02, 2023 10:01 amDifferent spots can be easier or harder to start out in due to RNG but I don't really see a need to fix that.
I agree for single player games. I look out for unlucky starts when playing against the AI.
However, in multiplayer games it's something else. Sometimes one player starts with 10 good/adequate planets at less than 5 hops, another player starts with one adequate planet and no good natives to conquer for colonizing other environments. The effect in the game, when both players have similar skills, is that one player already won.
For me, it's like pitching two runners against each other, doing the "ready-steady-go" on different tracks that join much further, near the goal. None of the runners can see the other, will not know who is closer the the goal until the tracks join and can see the other. And once the losing runner reaches the point where tracks join and can see that the other runner is miles ahead, and that the starting position for that player was like 10 meters before the joint while the losing one has to run for a mile to reach the joint. Until then, it seemed like a reasonably fair game, but there was never any chance for that runner to win (or for the other to lose, except by running against the walls instead of forward).

IMO, the desirable solution is to make this parametrizable. Like adding tick boxes for "ensure similar spread of habitable worlds around each empire" or setting a minimum number of habitable planets around each empire.
Stellaris does the latter, and by default all empires will find two good planets, but that can be tailored to 0 or any other number. Thus, we could make fairer MP games while still allowing players to get highly unequal starts if they want.

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

Re: Random Idea: Empire Placement

#11 Post by Geoff the Medio »

Can do something gamey like revealing the whole galaxy before the first turn and letting players bid for or buy their chosen start positions with some resource, with the cost of buying ticking down over time. I think Off World Trading company does something like that.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Random Idea: Empire Placement

#12 Post by Oberlus »

Geoff the Medio wrote: Thu Feb 02, 2023 2:15 pm Can do something gamey like revealing the whole galaxy before the first turn and letting players bid for or buy their chosen start positions with some resource, with the cost of buying ticking down over time. I think Off World Trading company does something like that.
Catan!

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Random Idea: Empire Placement

#13 Post by LienRag »

Bidding is very good, but revealing the Galaxy at start removes one of the X of 4X games...

wobbly
Cosmic Dragon
Posts: 1877
Joined: Thu Oct 10, 2013 6:48 pm

Re: Random Idea: Empire Placement

#14 Post by wobbly »

Geoff the Medio wrote: Thu Feb 02, 2023 2:15 pm Can do something gamey like revealing the whole galaxy before the first turn and letting players bid for or buy their chosen start positions with some resource, with the cost of buying ticking down over time. I think Off World Trading company does something like that.
Could be fun as a game mode. Depends on whether players want to explore or not.

quarague
Space Floater
Posts: 31
Joined: Thu Jan 05, 2023 8:00 pm

Re: Random Idea: Empire Placement

#15 Post by quarague »

I think the concepts of randomness and fairness are just fundamentally at odds for galaxy generation.

The only way to achieve a truly fair game start would be to use a symmetric map. Easiest to fully construct by hand or with some clever programming randomly generate one chunk, copy it a number of times and glue them together. Either way a well prepared attentive human player can figure out the structure and you loose some of the exploration. I think if you want really fair starting positions for multiplayer games that is the only way to go. As wobbly wrote, the designed to be fair maps could be an option and then one could deactive exploring for these.

If you do generate a random map you can do some fixing so that the differences in starting positions are not to big but this is just a question of degree. If the difference is big then it is obvious who had the advantage. If it is small you could have endless arguments whether the winner got there through a slightly better starting position or through better play.

Post Reply