Playing with universe gen

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
LienRag
Cosmic Dragon
Posts: 2146
Joined: Fri May 17, 2019 5:03 pm

Re: Playing with universe gen

#16 Post by LienRag »

Interesting, will encourage exploration of far corners of the Galaxy, and add some diversity to the game.

But it would depend a lot of galaxy parameters I guess ?
And I wouldn't want to have either no Acirema because the galaxy shape/density doesn't allow it, nor having a few Acirema or Furthest clear their surroundings of all other Natives in an important part of the Galaxy...

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

Re: Playing with universe gen

#17 Post by Oberlus »

wobbly wrote: Thu Jun 01, 2023 8:57 am Any thoughts?
The buffers could be larger (than 150uu) on more sparsely populated galaxies, and smaller on densely populated ones. (number of empires + number of natives)/(number of systems) is a good measure for density.

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

Re: Playing with universe gen

#18 Post by wobbly »

LienRag wrote: Thu Jun 01, 2023 11:38 am Interesting, will encourage exploration of far corners of the Galaxy, and add some diversity to the game.

But it would depend a lot of galaxy parameters I guess ?
And I wouldn't want to have either no Acirema because the galaxy shape/density doesn't allow it, nor having a few Acirema or Furthest clear their surroundings of all other Natives in an important part of the Galaxy...
Well they'd be statistically less common in a crowded universe but still possible, as its stopping isolationists being placed near non-isolationist, but not preventing non-isolationists being placed near isolationist. The only things truly enforced would be distance from the player/AI empires and sharing the same system.

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

Re: Playing with universe gen

#19 Post by wobbly »

As far as I can tell so far, the empires in 24th game (4 player, ring, team) were clumped together a little too closely again. I've had an idea in my head for a few weeks now, but I'm stumbling on the details. So the aim is to get a fairer distribution of neighbors and hopefully open up more galaxy shapes to MP. What I'm trying to minimize is difference in no. of neighbors:

neighbors(empire with most neighbors) - neighbors(empire with least neighbors).

The skeleton of the idea is instead of looking for x starting spots where x is number of empires, look for x + 1 starting spots which gives x + 1 layouts to compare. Still struggling on exact details and picturing what the actual effect would be.

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

Re: Playing with universe gen

#20 Post by BlueAward »

Maybe something along the lines of farthest first traversal

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

Re: Playing with universe gen

#21 Post by BlueAward »

Is there some "minimum distance from other capital" constant/variable? Perhaps easiest iterative implementation that spaces out all empires would be to increase that constraint, start with "pretty high" value and lower it until successful universe generation or hitting a value that says "nope"?

One question would be how high to start that would be higher than now but still within reason. Or maybe it could as well be unreasonable and do binary search to find maximum distance that works for given seed and is between "current minimum" and the "unreasonable" value

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

Re: Playing with universe gen

#22 Post by Oberlus »

I like a twist of wobbly's N+1 idea: delimit at start something like 5*#empires blobs of #systems/(6*#empires) systems. Some would be crappy, unable to grow to the average blob size. Then collect a set of "best blobs" that are not adjacent to any previously selected best blob, and assign empires to each blob. Since all empire blobs are surrounded by unassigned blobs, all of them are granted to be relatively far from other empires. There would be a certain number of blobs to create that enhances this process and ensures relatively uniform maximum minimum distance between capitals, that would depend on galaxy shape. But there should be less finetuned numbers that allow for a good trade-off between uniformity and variability/surprise.

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

Re: Playing with universe gen

#23 Post by wobbly »

BlueAward wrote: Fri Jun 09, 2023 11:51 am Is there some "minimum distance from other capital" constant/variable? Perhaps easiest iterative implementation that spaces out all empires would be to increase that constraint, start with "pretty high" value and lower it until successful universe generation or hitting a value that says "nope"?

One question would be how high to start that would be higher than now but still within reason. Or maybe it could as well be unreasonable and do binary search to find maximum distance that works for given seed and is between "current minimum" and the "unreasonable" value
Sounds like how its done now? With the distance to try for set here:
https://github.com/freeorion/freeorion/ ... py#L46-L50

So it tries to find good spots all at least 10 distance apart and if it fails it'll try for 9 then 8, then 7,

Trouble is it doesn't solve the problem of some players getting more neighbours. If you have a 3 arm spiral and place 1 player at the centre and the other 3 at the edges they are all the maximum distance from nearest neighbour, but the empire at the centre clearly has 3x as many neighbours.

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

Re: Playing with universe gen

#24 Post by BlueAward »

Okay then I guess what I was saying was that 10 is too little in practice for recent sizes of galaxy and may lead to clumping of empires and some empty areas, and it would be good to spread out starting locations further apart for example by making it higher than 10 as easiest way to go about it.

Even what Oberlus is saying is about somehow spreading empires apart rather than directly ensuring number of neighbors

Neighbors is not so easy to define I would think, even in MP23 I would not say you had 3 neighbors only two (o01eg and me)... I can probably find a system equally spaced from capitals of Endhu Oberlus and me and if I went there first would it mean I had three neighbors?

I may have to look at current code to speak more on point, perhaps depending on expectations some general topology should be constructed ground up from starting locations rather than trying to find good locations in a totally random galaxy, and the rest filled in with some general constraints

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

Re: Playing with universe gen

#25 Post by wobbly »

BlueAward wrote: Fri Jun 09, 2023 2:40 pm Okay then I guess what I was saying was that 10 is too little in practice for recent sizes of galaxy and may lead to clumping of empires and some empty areas, and it would be good to spread out starting locations further apart for example by making it higher than 10 as easiest way to go about it.
That's easy enough to test, that value I linked to is in the scripting, its changeable without a compile, and the actual min. distance (e.g. if it fails to find spots at max. distance) is in the log files. But like I said before, pushing empires apart only works on a ring, any shape with a central area is a different matter.

Now the crudest method for dealing with the center is to just rip it out of contention. I was thinking of something similar with a little more finesse. Hence the idea of finding extra spots. That way there are "spare spots" that can be removed. Maybe the algorithm removes the centre spots, or maybe it places less in the centre. It just works out which set of size x (no. of empires) is least difference in no. of empires from a set of size (x + y) (no.of empires + no. of spares).

Now to some degree, shapes with a central area are never going to be truly fair (short of 3 empire in a 3-arm galaxy with no central spots), but I'm not aiming for perfection. Just a way to nudge it towards a better balance.

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

Re: Playing with universe gen

#26 Post by Oberlus »

wobbly wrote: Fri Jun 09, 2023 1:48 pm doesn't solve the problem of some players getting more neighbours
BlueAward wrote: Fri Jun 09, 2023 2:40 pm Even what Oberlus is saying is about somehow spreading empires apart rather than directly ensuring number of neighbors
I was too vague. "Best" blob would be measured however we want. Consider number of habitable planets, size of those planets, spread of those planets among systems (because it's better one system with 4 planets and a GG than 5 systems with one planet each), spread of environments, compatibility of the environments in the blob with the empire species... And number of blobs neighboring this one to be closer to the average of number of neighboring blobs across all blobs (so blobs at dead ends, with one single neighbor, and blobs in the center, with 4+ neighbors would be worse than blobs with 2-3 neighboring blobs).

Also consider that spiral galaxies have higher density of planets in the center, so empires starting in the center have more neighbors but also more expansion choices. I mean, there are galaxy shapes that are expected to introduce inequalities between empires, but you can just chose a different shape with the characteristics you wish for.

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

Re: Playing with universe gen

#27 Post by BlueAward »

wobbly wrote: Fri Jun 09, 2023 3:31 pm
BlueAward wrote: Fri Jun 09, 2023 2:40 pm Okay then I guess what I was saying was that 10 is too little in practice for recent sizes of galaxy and may lead to clumping of empires and some empty areas, and it would be good to spread out starting locations further apart for example by making it higher than 10 as easiest way to go about it.
That's easy enough to test, that value I linked to is in the scripting, its changeable without a compile, and the actual min. distance (e.g. if it fails to find spots at max. distance) is in the log files. But like I said before, pushing empires apart only works on a ring, any shape with a central area is a different matter.
OK so I imagined if we're saying there are N systems per player, then it's like an area around the player we would like to give it to them, so the distance we'd expect between players would be like radius of the area. So I'd say that value should start at about 2*sqrt(N). Like if there are 52 systems per player, maybe the HS_MAX_JUMP_DISTANCE_LIMIT should be about 14 or maybe 15. I tried some ring galaxy seeds with 208 systems and 4 players and eyeballing the homeworld locations what can I say, I like more the ones starting with 14 indeed. With this default 10 stuff I'd see those empty areas without players that Daybreak complained about some time ago too, or maybe the "clumping" you have complained, and with 14 I wouldn't see it, so the single goal I wanted to check about higher spacing was met. That's of course anecdotal, only considering ring galaxies, and only concerning with spacing things out. But from the limited testing I've done I liked it for those parameters. May at least be worth considering for topologies (which is different to "shape"!) that should be considered "fair" like ring

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

Re: Playing with universe gen

#28 Post by BlueAward »

yeah the thing I was talking about seems to work well for box galaxy too for example... as long as there are like 4 empires; if you put in 5th, then somebody ends up somewhere in the middle and salty :O (but not like it's unexpected)

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

Re: Playing with universe gen

#29 Post by wobbly »

BlueAward wrote: Fri Jun 09, 2023 8:52 pm OK so I imagined if we're saying there are N systems per player, then it's like an area around the player we would like to give it to them, so the distance we'd expect between players would be like radius of the area. So I'd say that value should start at about 2*sqrt(N). Like if there are 52 systems per player, maybe the HS_MAX_JUMP_DISTANCE_LIMIT should be about 14 or maybe 15. I tried some ring galaxy seeds with 208 systems and 4 players and eyeballing the homeworld locations what can I say, I like more the ones starting with 14 indeed. With this default 10 stuff I'd see those empty areas without players that Daybreak complained about some time ago too, or maybe the "clumping" you have complained, and with 14 I wouldn't see it, so the single goal I wanted to check about higher spacing was met. That's of course anecdotal, only considering ring galaxies, and only concerning with spacing things out. But from the limited testing I've done I liked it for those parameters. May at least be worth considering for topologies (which is different to "shape"!) that should be considered "fair" like ring
Maybe next multiplayer o01eg can set this to 15 server-side? Not sure whether that will cause checksum errors.

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

Re: Playing with universe gen

#30 Post by wobbly »

As an aside, those numbers in options.py could be moved to the in-game menu, you'd just have to work out where. Should they be moved in-game?

Post Reply