Logo Platform
logo amplifiers simplified

Balanced Galaxy Generator

Reply
Copied to clipboard!
0Send private message0Send private message0Send private message
12 years ago
Jul 17, 2012, 8:03:09 PM
Calavoow wrote:
And finally we could work on rebalancing the galaxy, which could (temporarily) be done by regenerating untill the galaxy is balanced.


I highly recommend to fix "small" balance problems by increasing the size or tier of one nearby planet. For "large" balance problems such as a two system constellation, I agree regenerating is the best approach. Regenerating, especially if the exit criterion is a difficult one, can lead to large/huge/infinite runtime of the generator.
0Send private message
12 years ago
Jul 6, 2012, 4:00:43 PM
Please send a PM to amplimath to guarantee legality. I did this before uploading all the xml's, and he replied pretty quickly. Your point score seems pretty reasonable. For myself, I decided not to worry about resources, because most players on my thread you quoted seemed to feel that the "first impression" was most important. If you start in a location which is reasonable, but you learn later you have no T-70, most people seem to view this as a "good challenge" rather than a "ragequit opportunity".



Also, I recommend that you use two levels of equalization: weak, and strong. Many players seemed to feel that having a "marginal" start location was a "good challenge", and they did not want this taken away. Still, these players would probably not enjoy the one system constellation start position which was posted as an example. These players would use "weak" equalization, where only if the point value was *extremely* low, some benefit would be added. Your suggestion is "strong" equalization where weak positions would be improved, and possibly strong positions would be reduced in order to bring their score in line with other players. Just something to think about.
0Send private message
12 years ago
Jul 6, 2012, 4:54:13 PM
I saw that as well. It could be as simple as setting the maximum allowed margin between player starting area scores a little higher/lower. But it would probably be easier (also for the user!) to deliver a one-size fits all solution for everyone.
0Send private message
12 years ago
Jul 6, 2012, 5:10:45 PM
I would recommend an allocation as approximately follows:



System Value:

(10 Base+Planet Values)*1/(10+Total Distance from home)



Planet Type:

Class I: 10

Class II: 8

Class III: 4

Class IV: 2

Other: 2





Anomaly Modifier:

Garden of Eden: +5

Most Positives: +3

Weak Positives: +1

Mixed Effects: 0

Most Negatives: -3





Planet Size:

Tiny:40%

Small:50%

Medium:60%

Large:80%

Huge:100%



Sum total weight, compare starting locations.



Increase the size of all Type I Planets of the lowest player by 1. If still behind, Tier 2, etc. Repeat until the lowest player is above 80% the total value of the highest player.



Example system: 12 away from home system.

1 Huge Garden of Eden Terran system.

2 Large Lava Planets

1 Medium Tundra with Acid Rain.



(10+15+1.6+1.6+3)=31.2 /22= 1.42

If this was the home system it would be worth a little more than twice as much.



Most these numbers are based on estimated real values of the systems in question. The +10 per system exists to represent the large bonuses single isolated systems can realize independent of their planets. This value, admittedly, needs some work.
0Send private message
12 years ago
Jul 6, 2012, 5:20:40 PM
Calavoow wrote:
But it would probably be easier (also for the user!) to deliver a one-size fits all solution for everyone.


Good luck with that smiley: smile Just a suggestion, but if you are going to distribute one custom galaxy generator, you can distribute two, one with weak equalization and one with strong.



@ ketobor, perhaps you already agreed but did not mention it; I feel that the contestedProbability term is a critical one. Very often I have seen a nice arm with good planets, and *two* home systems: one in the middle of the arm, and one deep into the end of the arm. Unless the middle player is very poor, they will quickly block the end player from access to all the nice systems. So if a system is "closer" to one player, none of the other players should get any points for it.
0Send private message
12 years ago
Jul 6, 2012, 5:57:16 PM
Ketobors formula results in the score of a certain system, which would be another way to calculate systemWorth. Afterwards we could still calculate its worth to each player by multiplying it with the contestedProbability. It seems to be a good alternative to my formula, of which I will notice how good it actually is when things are finally implemented and tweaking can begin smiley: stickouttongue.
0Send private message
0Send private message
12 years ago
Jul 16, 2012, 9:06:43 PM
Thanks for the update! 99.9% of interested players will not be able to build and install from a repository. I highly recommend to make a simple zipfile which can be unzipped over the current installation directory, as I have packaged my mods. Even if it is just slightly different from vanilla, this will help you to get a lot more feedback.
0Send private message
12 years ago
Jul 17, 2012, 10:51:17 AM
One of my friends is currently trying to optimize the current galaxygenerator in its creation process and wants to add additional balancing factors into it.

I'm gonna try to convince him to come into this thread for the purpose of working together. :d
0Send private message
12 years ago
Jul 17, 2012, 5:08:54 PM
I'm already in this thread, but only lurking smiley: wink



But i think, i'll crawl through the sources when i got a free weekend or some free days from overtime.



Maybe we can find a faster solution than to rewrite the whole generator smiley: wink
0Send private message
12 years ago
Jul 17, 2012, 7:43:58 PM
Tehlak wrote:
I'm already in this thread, but only lurking smiley: wink



But i think, i'll crawl through the sources when i got a free weekend or some free days from overtime.



Maybe we can find a faster solution than to rewrite the whole generator smiley: wink




I wouldn't mind to work together. I just have to find some time somewhere smiley: wink



My work up till now has mostly been prepatory. But I made a test harness so that you could run the generator without starting the game itself, which is very usefull for debugging (because you can also simple run in debug mode). I also made something to calculate the population on planets. Which would be usefull for the calculation of a score for each player.



The next step is to implement the scoring for each planet/starsystem.

After that comes the calculation of scores for each player.

And finally we could work on rebalancing the galaxy, which could (temporarily) be done by regenerating untill the galaxy is balanced.



davea wrote:
Thanks for the update! 99.9% of interested players will not be able to build and install from a repository. I highly recommend to make a simple zipfile which can be unzipped over the current installation directory, as I have packaged my mods. Even if it is just slightly different from vanilla, this will help you to get a lot more feedback.


I would publish it as a zip or maaaybe an installer, but it is not published yet smiley: wink It still needs some work.
0Send private message
12 years ago
Jul 6, 2012, 8:21:00 AM
Hello everyone. This is still a work in progress so for now this will be an idea/brainstorm discussion thread about the modifications necessary for the generation of a balanced galaxy with the Endless Space Galaxy Generator.



To keep the process simple, I would like to have some function that would calculate how good a players' starting position is. So far we have the point evaluator by davea in this thread from which we could use some ideas, but this evaluator is not written in C# and it uses the output XML file. The idea is to use this point system to execute some post-generation balancing step that would balance the generated galaxy so that each player has a reasonably balanced starting position.

The parameters this function would depend on are as follows:

  • Planet type
  • Planet size
  • Anomalies
  • Luxury resources
  • Strategic resources
  • System planet amount: a 1 planet system is worth a lot less than a 5 planet system. But only because you can put more Population in it. So a better parameter may be System Population. This can also be merged with planet size.
  • Distance from home planet
  • Contested with other players (lets say a planet is within a certain range of players, then we calculate a probability that each player grabs this system and split the score over the players)
  • (Moons [andtheirtemples])
  • ???



The exact implementation of the function is a point of discussion but my current idea would be as follows:

[CODE]systemWorth = systemMaxPopulation * ( sumOf{ planetType * (planetPopulation + anomalies + resources) } )

playerSystemWorth = systemWorth * distanceFromHome * contestedProbability[/CODE]

The total player score would then be the sum of all playerSystemWorth values for that player.

The systemWorth function depends quadratically on the population, so as to increase the score of a system that could house a lot of inhabitants a lot more than smaller systems. I would like to discuss about the points a certain system should be worth and some more exact implementation details (ask yourself what each variable should be in each case).



Did some preporatory work on the score calculations and calculating each systems' population is now possible.

Currently I am trying to modify as little code as possible, so that changes can be easily found and understood when reading through the code. I ofcourse have to hook my code into the generation process somewhere, so it cannot be completely separated but a few lines is all that is necessary.

I will try to get back to this in the near future. I will upload my code to GitHub when it has been allowed by the devs. But I need to do something else before I can work on this.



The second step will be to use the outcome of this point system to modify the galaxy generation process in such a way that each player would be at about the same score as every other player.



Update: You can find the Git Repository for this project here: https://github.com/Calavoow/EndlessSpace-GalaxyBalancing
0Send private message
12 years ago
Jul 17, 2012, 8:19:36 PM
davea wrote:
I highly recommend to fix "small" balance problems by increasing the size or tier of one nearby planet. For "large" balance problems such as a two system constellation, I agree regenerating is the best approach. Regenerating, especially if the exit criterion is a difficult one, can lead to large/huge/infinite runtime of the generator.




Agreed. I think trying to upgrade a planets' tier somewhere and recalcuating the players' score would prove to be an easy way to fix small imbalances.
0Send private message
12 years ago
Jul 20, 2012, 5:08:29 PM
Hey folks, kinda new to the forums here, but this discussion has intrigued me. Unfortunately I lack the expertise to be of any real help in the actual production of a galaxy-balancing solution or I'd offer my services there, but what I can offer is the lessons learned from a great deal of time spent playing 4X games, mostly in multiplayer.



I've recently been tinkering with galaxy generation seeds trying to find a good starting setup for myself and my buddy when we play coop, and one thing I've noticed is generating a huge dense spiral 8 takes a good 15+ seconds on a modern gaming machine. On small, tourney-style maps regeneration is probably valid, but beyond that, as someone else said, you're definitely going to need to tweak to balance. Even if you're only running say 10 iterations and taking the best of the lot, that's 2+ minutes at a loading screen for a huge dense galaxy.



On that note, I wonder if it's possible to hand-craft a starting constellation or 2 (or 8) and then generate the rest of the galaxy around that. That would make it possible to give everyone either identical or identically-valued starting areas (since the systems around home have a big impact in the mid-game, and even somewhat in the end-game since you can't create new planets to fill out low-planet systems and the like) with the rest of the galaxy a random hodgepodge that doesn't need balancing. Though you could also do several interesting things to that area. Like, turn it into a hotly-contested resource-heavy battlefield, a wasteland of barely-sustainable, bombed-out forward outposts, a maze of death-trap pirate systems, etc.



Anyway, just my 2 cents.
0Send private message
12 years ago
Jul 21, 2012, 5:34:24 PM
Thanks for your reply Libra00. After we/I have done some balancing I will need some feedback on how good the balanced outcome is. If it is true that galaxy generation is so slow then I will have to revise my strategy or optimise the generation algorithm. Now I don't think the loading screen is only generating a map, because it could be loading other resources too. But I will have to test the time it takes to generate a (huge) galaxy and for that matter multiple galaxies in a row.

As for the rest, I am trying to create as simple a solution as possible first. Now I won't rule out any other cool stuff that becomes possible when working on the map generator, but I simply don't have a lot of time on my hands to go and do extensive modifications.
0Send private message
12 years ago
Jul 29, 2012, 1:52:59 PM
I finally made some time to work on this little project and it now calculates the worths of systems according to the following formula:

[code]systemWorth = systemMaxPopulation * ( sumOf{ planetType * planetPopulation * anomalyWorth } )[/code]

It seemed more reasonable to use anomalies just as planetTypes as a modifier between 0.5 and 2 for the total planet worth.



Here is a snippet of the log:

[code]This system contains the following planets:{

Type: PlanetTypeArid, Size: PlanetSizeMedium, Anomaly: , Population: 5 , typeWorth: 1.5 , anomalyWorth: 1 , Planet Worth: 37.5

Type: PlanetTypeDesert, Size: PlanetSizeMedium, Anomaly: , Population: 4 , typeWorth: 1 , anomalyWorth: 1 , Planet Worth: 16

Type: PlanetTypeArctic, Size: PlanetSizeSmall, Anomaly: , Population: 3 , typeWorth: 1 , anomalyWorth: 1 , Planet Worth: 9

Type: PlanetTypeGasMethane, Size: PlanetSizeLarge, Anomaly: , Population: 3 , typeWorth: 0.5 , anomalyWorth: 1 , Planet Worth: 4.5

Type: PlanetTypeBarren, Size: PlanetSizeMedium, Anomaly: , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 6

Type: PlanetTypeLava, Size: PlanetSizeLarge, Anomaly: , Population: 4 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 10.6666666666667

}

And has total population: 22

Total system worth: 1840.66666666667



This system contains the following planets:{

Type: PlanetTypeBarren, Size: PlanetSizeLarge, Anomaly: PlanetAnomaly40 , Population: 4 , typeWorth: 0.666666666666667 , anomalyWorth: 0.5 , Planet Worth: 5.33333333333333

Type: PlanetTypeLava, Size: PlanetSizeMedium, Anomaly: , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 6

Type: PlanetTypeLava, Size: PlanetSizeSmall, Anomaly: PlanetAnomaly24 , Population: 2 , typeWorth: 0.666666666666667 , anomalyWorth: 0.666666666666667 , Planet Worth: 1.77777777777778

Type: PlanetTypeArid, Size: PlanetSizeSmall, Anomaly: PlanetAnomaly04 , Population: 4 , typeWorth: 1.5 , anomalyWorth: 1.5 , Planet Worth: 36

}

And has total population: 13

Total system worth: 638.444444444444



This system contains the following planets:{

Type: PlanetTypeArid, Size: PlanetSizeMedium, Anomaly: , Population: 5 , typeWorth: 1.5 , anomalyWorth: 1 , Planet Worth: 37.5

Type: PlanetTypeAsteroids, Size: PlanetSizeTiny, Anomaly: , Population: 1 , typeWorth: 0.5 , anomalyWorth: 1 , Planet Worth: 0.5

Type: PlanetTypeBarren, Size: PlanetSizeLarge, Anomaly: , Population: 4 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 10.6666666666667

Type: PlanetTypeLava, Size: PlanetSizeMedium, Anomaly: , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 6

}

And has total population: 13

Total system worth: 710.666666666667



This system contains the following planets:{

Type: PlanetTypeGasHydrogen, Size: PlanetSizeHuge, Anomaly: , Population: 4 , typeWorth: 0.5 , anomalyWorth: 1 , Planet Worth: 8

Type: PlanetTypeArctic, Size: PlanetSizeMedium, Anomaly: , Population: 4 , typeWorth: 1 , anomalyWorth: 1 , Planet Worth: 16

Type: PlanetTypeBarren, Size: PlanetSizeLarge, Anomaly: PlanetAnomaly49 , Population: 4 , typeWorth: 0.666666666666667 , anomalyWorth: 0.5 , Planet Worth: 5.33333333333333

Type: PlanetTypeLava, Size: PlanetSizeMedium, Anomaly: , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 6

}

And has total population: 15

Total system worth: 530



This system contains the following planets:{

Type: PlanetTypeArctic, Size: PlanetSizeMedium, Anomaly: PlanetAnomaly17 , Population: 4 , typeWorth: 1 , anomalyWorth: 1.5 , Planet Worth: 24

Type: PlanetTypeGasHelium, Size: PlanetSizeHuge, Anomaly: , Population: 4 , typeWorth: 0.5 , anomalyWorth: 1 , Planet Worth: 8

Type: PlanetTypeOcean, Size: PlanetSizeLarge, Anomaly: PlanetAnomaly36 , Population: 8 , typeWorth: 2 , anomalyWorth: 0.666666666666667 , Planet Worth: 85.3333333333333

Type: PlanetTypeBarren, Size: PlanetSizeMedium, Anomaly: PlanetAnomaly22 , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 0.666666666666667 , Planet Worth: 4

}

And has total population: 19

Total system worth: 2305.33333333333



This system contains the following planets:{

Type: PlanetTypeDesert, Size: PlanetSizeMedium, Anomaly: PlanetAnomaly35 , Population: 4 , typeWorth: 1 , anomalyWorth: 0.666666666666667 , Planet Worth: 10.6666666666667

Type: PlanetTypeJungle, Size: PlanetSizeMedium, Anomaly: , Population: 6 , typeWorth: 2 , anomalyWorth: 1 , Planet Worth: 72

Type: PlanetTypeArctic, Size: PlanetSizeMedium, Anomaly: , Population: 4 , typeWorth: 1 , anomalyWorth: 1 , Planet Worth: 16

Type: PlanetTypeDesert, Size: PlanetSizeMedium, Anomaly: PlanetAnomaly27 , Population: 4 , typeWorth: 1 , anomalyWorth: 0.666666666666667 , Planet Worth: 10.6666666666667

}

And has total population: 18

Total system worth: 1968



This system contains the following planets:{

Type: PlanetTypeLava, Size: PlanetSizeSmall, Anomaly: , Population: 2 , typeWorth: 0.666666666666667 , anomalyWorth: 1 , Planet Worth: 2.66666666666667

Type: PlanetTypeLava, Size: PlanetSizeSmall, Anomaly: PlanetAnomaly23 , Population: 2 , typeWorth: 0.666666666666667 , anomalyWorth: 0.666666666666667 , Planet Worth: 1.77777777777778

Type: PlanetTypeBarren, Size: PlanetSizeSmall, Anomaly: PlanetAnomaly02 , Population: 2 , typeWorth: 0.666666666666667 , anomalyWorth: 1.5 , Planet Worth: 4

Type: PlanetTypeLava, Size: PlanetSizeMedium, Anomaly: PlanetAnomaly37 , Population: 3 , typeWorth: 0.666666666666667 , anomalyWorth: 0.666666666666667 , Planet Worth: 4

}

And has total population: 9

Total system worth: 112[/code]



Next step is to attribute these values to players!

And maybe strategic/luxury resources could be added too.
0Send private message
12 years ago
Jul 29, 2012, 3:16:06 PM
Good progress. For me, the key point is to make sure players do not ragequit early, due to lack of any interesting nearby planets. If this is going to happen, it is usually early, before strategic resources are even revealed. I would recommend to continue on with assigning to players, including the term for shared planets. Tuning the value for resources can be added later, if needed.
0Send private message
?

Click here to login

Reply
Comment