So, I've been toying with the idea for some time of making a simple map viewer and/or editor for worldbuilder saves. So I decided to drum together something real quick. Behold my advanced map viewer:
More usefully, I added a Balance Checker that does a breadth-first traversal from each player's starting position to determine each player's sphere of influence. The program then counts the various resources found within that sphere, and calculates other useful metrics such as the total food potential of the sphere.
I think this could be a useful tool for balancing maps, and I'd also like to add some bulk editing operations that are missing in the WorldBuilder program.
Here's another example of the tool in action, using a Lakes map. The screenshots are from the 1.0 version with crappy graphics.
For those not playing PB4 there's an interesting analysis of the PB4 map in the PB4 lurker thread as well.
[strike]1. Balance report fails with index out of bounds exception if there are more players than teams. (So in other words if the map is for a teamer game).[/strike] Fixed in version 1.06.
But be warned that it's something I whipped together in a couple of hours and is woefully incomplete as yet. The program will crash if it encounters unknown contents in the worldbuilder file, such as Player colors it hasn't seen before.
novice Wrote:But be warned that it's something I whipped together in a couple of hours and is woefully incomplete as yet. The program will crash if it encounters unknown contents in the worldbuilder file, such as Player colors it hasn't seen before.
Or, um, the instant I push any buttons (Windows 7, 64 bit). Depending on how much work you intend to do, feel free to PM me for more details, or just ignore it and I'll just work without it.
Darrell mentioned in one of the other threads that this would be a really cool thing to integrate into a map script, so I'll copy my thoughts on that in here. Building on your notion of a sphere of influence, you could basically create a map script that would generate highly balanced yet potentially quite asymmetric maps. One way to do it could be something like this:
1. Randomly place a set of N starting positions, with a reasonable minimum spacing.
2. Compute the Voronoi diagram for the map based on those N points. If some of the cells end up with what you deem to be too many or too few neighbors, try again from step 1.
3. For each of the N starting positions, generate an equal-sized random land shape contained within its Voronoi cell, constituting its sphere of influence. Depending on map parameters, you could ensure that the land within each cell touches the land within each neighboring cell, or enforce the opposite restriction, creating a continents map.
4. Place resources and terrain in a balanced way within each sphere of influence.
If you want swathes of wilderness, you could optionally achieve this by generating some number of "phantom" starting positions, treated in the same way as the others, except that you don't actually place a player there when you're done. That could unbalance things though, since some players could have easier access to the wilderness than others.