Logo Platform
logo amplifiers simplified

Balanced Galaxy Generator

Reply
Copied to clipboard!
12 years ago
Aug 19, 2012, 2:50:38 PM
Thanks for the interest guys!

But as was recently posted by a developer, they've changed some stuff so that galaxy generator mods don't work anymore. They were going to fix it, but only after Gamescom.
0Send private message
12 years ago
Aug 4, 2012, 5:41:26 PM
davea wrote:
That seems way too complicated. What I did is only about 30 lines of code. For each player, start a list of adjacent systems. Visit all the systems on the adjacent list and compute the new distance from home. If the system hasn't been visited before, or the new distance is less, update the system with the new distance and add all its neighbors to the adjacent list. Repeat five times (stop after going 5 string jumps).



Now each system, has a list of the distance from each player. For each system, assign the point value of the system to the player who is closest, or assign part of the point value to multiple players in case of a near tie.




I want to calculate the minimum distance from a system to a player, your algorithm will not calculate the minimum distance in all cases. And I think now that a better criterium for stopping is the distance from the home planet, not the amount of jumps.

The last part of my post is just saving the results of this calculation so that they can be reused quickly and efficiently.
0Send private message
12 years ago
Aug 4, 2012, 5:56:00 PM
I don't want to debate too much about algorithms, we agree the goal is to calculate the minimum distance. My algorithm updates the distance whenever it finds a new minimum and re-analyzes the adjacent systems. As far as I know this is the optimal approach.
0Send private message
12 years ago
Aug 5, 2012, 5:14:06 PM
I can now calculate the scores of each player, but I'm wondering how to calculate if the map is imbalanced. I was thinking of using the standard deviation as a measure. Do you have any other ideas?



Edit: Standard deviation is implemented, now the balancing can decide if a galaxy is 'imbalanced'. If the galaxy is imbalanced however an Exception is thrown in the subsequent calls (outside of my code). So this should be fixed next.
0Send private message
12 years ago
Aug 5, 2012, 6:18:39 PM
I recommend to definitely eliminate galaxies where a player can only reach 3 planets or less due to small constellation size, regardless of any deviation.



For my implementation, I arbitrarily chose a fixed point threshold as "too weak" after reviewing some sample systems. I chose 50 points by my scale. Standard deviation sounds reasonable too; the only drawback is if every player's system is very poor, then standard deviation will "pass" and all the players will ragequit.
0Send private message
12 years ago
Aug 5, 2012, 6:22:42 PM
davea wrote:
I recommend to definitely eliminate galaxies where a player can only reach 3 planets or less due to small constellation size, regardless of any deviation.



For my implementation, I arbitrarily chose a fixed point threshold as "too weak" after reviewing some sample systems. I chose 50 points by my scale. Standard deviation sounds reasonable too; the only drawback is if every player's system is very poor, then standard deviation will "pass" and all the players will ragequit.




1. What if these 3 systems are really good (tier 1 planets)? I wouldn't mind that.

2. If all players have a very poor start then the game is equal right? If they know the galaxy is balanced then they will know that other players are having the same difficulties.
0Send private message
12 years ago
Aug 5, 2012, 6:35:05 PM
One of the original examples that got the discussion going was a single planet constellation, that is, the only connections to the home planet were through wormholes. I think most players would ragequit on a one or two planet constellation, even if it was positively loaded with huge jungles. Three great systems is arguable. Maybe those would show up as low point values anyway, but I think some term for "tiny constellation" should be there.
0Send private message
12 years ago
Aug 5, 2012, 6:39:11 PM
davea wrote:
One of the original examples that got the discussion going was a single planet constellation, that is, the only connections to the home planet were through wormholes. I think most players would ragequit on a one or two planet constellation, even if it was positively loaded with huge jungles. Three great systems is arguable. Maybe those would show up as low point values anyway, but I think some term for "tiny constellation" should be there.


I don't know why you would quit with a low system count. Less high scoring systems is usually better than many lower scoring systems.



It is easy to implement though.
0Send private message
12 years ago
Aug 11, 2012, 4:20:32 PM
I now integrated my scoring system with the galaxy generator and it now regenerates the galaxy with a new seed. When generating 10 galaxies of medium size this took 50538 milliseconds. Thus we can average this out to 5 seconds per galaxy. I think this is a reasonable number. Testing is required though, so I'm trying to get the generator work again with Endless Space, which isn't going well at the moment (see /#/endless-space/forum/37-modding/thread/15871-galaxy-generator-explained).

When I get it to work I will appreciate it if some people could do some test runs and give me feedback on if the generated galaxies are balanced.
0Send private message
0Send private message
12 years ago
Aug 11, 2012, 7:35:36 PM
Post whatever you can get working here, and I am sure testers will materialize.
0Send private message
0Send private message
12 years ago
Aug 4, 2012, 4:54:57 PM
That seems way too complicated. What I did is only about 30 lines of code. For each player, start a list of adjacent systems. Visit all the systems on the adjacent list and compute the new distance from home. If the system hasn't been visited before, or the new distance is less, update the system with the new distance and add all its neighbors to the adjacent list. Repeat five times (stop after going 5 string jumps).



Now each system, has a list of the distance from each player. For each system, assign the point value of the system to the player who is closest, or assign part of the point value to multiple players in case of a near tie.
0Send private message
12 years ago
Aug 19, 2012, 6:26:21 PM
davea wrote:
99.9% of interested players will not be able to build and install from a repository.




And 99.9% of working Endless Space mod devs are too lazy to use source control smiley: smile
0Send private message
12 years ago
Sep 9, 2012, 4:47:02 PM
I am immensely interested in this. I just took a 2 month break from ES because of my failed attempt at doing something similar to this (I'm not as dedicated a modder as you, to say the least!) and so I really hope this succeeds.

Just a question, though- how are point values for the balancing assigned? Some factions may take advantage of planets that are considered "poorer" moreso than others. For example, I created a faction using the point system that can, from the start of the game, settle any planet at only 25% FIDS cost. As well, they have the Sower bonus and a great deal of production bonuses and approval bonuses. As such, Lava planets would be ideal. Does this take that into account, somehow?
0Send private message
12 years ago
Sep 9, 2012, 5:04:06 PM
zetal911 wrote:
I am immensely interested in this. I just took a 2 month break from ES because of my failed attempt at doing something similar to this (I'm not as dedicated a modder as you, to say the least!) and so I really hope this succeeds.

Just a question, though- how are point values for the balancing assigned? Some factions may take advantage of planets that are considered "poorer" moreso than others. For example, I created a faction using the point system that can, from the start of the game, settle any planet at only 25% FIDS cost. As well, they have the Sower bonus and a great deal of production bonuses and approval bonuses. As such, Lava planets would be ideal. Does this take that into account, somehow?




No, it does not at this moment. It could be implemented ofcourse, but I would like to have a basic working version to extend further ready first.

To implement this feature, there will have to be a bit of code that would change the value of a planet according to the race. Which is possible when you manually enter these values for each race. However, automatically generating the values will be tough if not too hard at the moment, because there is no reasonably simple extraction method of race abilities.
0Send private message
12 years ago
Sep 9, 2012, 5:11:17 PM
Oh agreed, getting the basic system up and running should definitely take precedence- but I don't think it hurts to plan ahead! Rather than doing it based on Race, I think it would be much more flexible to do it based on what attributes a race possesses, but from what you said it sounds like there isn't a way to check that? =( That...really stinks!
0Send private message
12 years ago
Sep 9, 2012, 8:14:07 PM
Well I think you have access to the GalaxyConfiguration.xml file in which the following could be defined:

[code]



GalaxyDisk

GalaxySizeMedium

4

BalancedAverage

GalaxyAgeNormal

GalaxyDensityHigh

StarConnectivityAverage

ConstellationNumberNone

ConstellationConnectivityAverage

ConstellationDistanceAverage

PlanetsPerSystemNormal

PlanetsSizeFactorNormal

ResourceRepartitionFactorNormal







































































































[/code]



As you can see you have Traits with a String (i.e. TraitScience01Norm3). That doesn't mean your program knows what it means yet. You'll have to hardcode that if a race has a certain trait that it would be better for certain planets, lava planets for example.



But to be honest, I haven't looked into race modding so far. So I'm not really knowledgeable (yet) about this.
0Send private message
0Send private message
12 years ago
Sep 17, 2012, 8:13:12 AM
FireStorm wrote:
So does it work atm, even like decently? inclined to try it out..




Thanks for your interest, but I haven't gotten it working yet... But posts like this motivate me to spend some extra time smiley: smile
0Send private message
?

Click here to login

Reply
Comment