Planets that Build and Explore Themselves
A few months ago I went a bit nuts with procedural development and put together a generator for creating 2D tile-based planets. The planets themselves are 200 x 50 tiles (in general), but each tile optionally resolves to a 28 x 28 map that intermixes with neighboring tiles. For those that don't care to do the math, I believe that works out to almost 8 million tiles per planet. (Maybe "a bit nuts" is an understatement). It *seems* to work so far because you can first clear the map black in larger and larger chunks at the 200 x 50 level (with better sensors until each planet is automatically revealed), then land for more detailed interaction on the ground. With planets this large, however, I've got to constrain how the player changes them. One thought I've had is that the planets actually explore and colonize themselves automatically over time. Each time you discover a world you have first dibs on all the easily accessible resources and can put down temporary bases. However, news of your find gets back and eventually planets become revealed and built up automatically. One downside with this is that it turns exploration into a race, but given the scale of the universe that might not be a bad thing. Thoughts?
--------------------Just waiting for the mothership...
Turning exploration into a race doesn't sound like a bad thing. The only thing that I'd try to avoid is the downward spiral that can happen once one of the players has the lead. If there isn't any auto-balancing mechanism, for example the areas that are explored have to also be defended, then you might encounter a scenario where no one can ever catch up to the leader.
Another mechanism that you might consider comes out of, "Romance of the Three Kingdoms". Who is controlling the automation? In RoTK the player had to go out and recruit individuals, and these individuals could be assigned as regional governors. The trade off there was that it took time to recruit, and depending on the state of your empire that was an efficient or inefficient use of your turn. Recruiting the wrong individuals was also a wasted effort in many cases.
It creates an interesting and scalable system where over time the game becomes more automated, and as your empire grows that is really want you want because making all of the decisions becomes too tedious. It sounds like you might want something like that since you will be dealing with issues of scale.
Another mechanism that you might consider comes out of, "Romance of the Three Kingdoms". Who is controlling the automation? In RoTK the player had to go out and recruit individuals, and these individuals could be assigned as regional governors. The trade off there was that it took time to recruit, and depending on the state of your empire that was an efficient or inefficient use of your turn. Recruiting the wrong individuals was also a wasted effort in many cases.
It creates an interesting and scalable system where over time the game becomes more automated, and as your empire grows that is really want you want because making all of the decisions becomes too tedious. It sounds like you might want something like that since you will be dealing with issues of scale.
Emergent gameplay works best when there's a back and forth between player and computer. Rather than turning exploration into a race, this could present an alternative path, where a player influences the development of a planet.
The first player to explore a planet can place their bases in the prime locations to obtain resources. Future colonizers will either locate themselves in other locations, or join that outpost. Over time these outposts develop into cities, nations, etc.
This creates another game, where you're trying to win a planet for your empire/faction/friends. Ship colonists back and forth and you can see to it that your favored city becomes the major power on the planet. Set up orbital defenses or an empire you're at war with might also place a settlement.
An exploration-focused player would drop a mostly automated mining settlement in the most valuable location, and send down a few away teams to explore the ruins on the planet. In the long run that mining settlement will be marginalized by newer colonists focused on creating a civilization. Thus the explorer gets a big initial resource boost, but must constantly be finding new planets.
A development oriented player would instead focus on setting up a more permanent base in a location that could support a big city (lots of water and arable land...maybe somewhere with good defensive terrain) and encouraging settlement. They'd try to get settlements all across the globe quickly, so multiple nations don't start showing up. In the short run they see little benefit, but in the long run the people they supported are in control of a planet, giving them important political/military power.
I bet you could do some neat stuff with wars being fought between nations on a planet, or coalition governments on a diverse planet. Rather than defeating an opposing settlement, can you infiltrate it with your own people?
The first player to explore a planet can place their bases in the prime locations to obtain resources. Future colonizers will either locate themselves in other locations, or join that outpost. Over time these outposts develop into cities, nations, etc.
This creates another game, where you're trying to win a planet for your empire/faction/friends. Ship colonists back and forth and you can see to it that your favored city becomes the major power on the planet. Set up orbital defenses or an empire you're at war with might also place a settlement.
An exploration-focused player would drop a mostly automated mining settlement in the most valuable location, and send down a few away teams to explore the ruins on the planet. In the long run that mining settlement will be marginalized by newer colonists focused on creating a civilization. Thus the explorer gets a big initial resource boost, but must constantly be finding new planets.
A development oriented player would instead focus on setting up a more permanent base in a location that could support a big city (lots of water and arable land...maybe somewhere with good defensive terrain) and encouraging settlement. They'd try to get settlements all across the globe quickly, so multiple nations don't start showing up. In the short run they see little benefit, but in the long run the people they supported are in control of a planet, giving them important political/military power.
I bet you could do some neat stuff with wars being fought between nations on a planet, or coalition governments on a diverse planet. Rather than defeating an opposing settlement, can you infiltrate it with your own people?
NPC managers and detailed colonization are both good ideas but there is still the problem of constraining the player so that you're not trying to save gigs of data reflecting the changes they've made. If, for instance, you can turn tiles from one type to another (building roads or cultivating land) then there has to be some limit or you'll be tracking who knows how many tiles across multiple planets (which would be almost 2GB if a player was nuts enough to continuously develop one planet).
An alternate approach might be to treat the planets as two types of maps, one which can be explored tile by tile, another which acts as a sort of colonization overlay that's abstracted into territories. The territories would probably have to be randomly determined so there's some strategic balance to claiming one versus another, but each could have X resources, Y defense bonuses and Z capacity for colonization. You could, after a fashion, even connect locations via vector roads and have improvements that fit within the area.
Maybe something like this (though a lot less chunky):

So you would be restricted from making improvements or changes to any actual tile, but you'd be able to abstractly harvest resources or build using the overlay map. This idea could incorporate managers as multipliers to base productivity and allow for adding lots of improvements to upgrade any territory.
An alternate approach might be to treat the planets as two types of maps, one which can be explored tile by tile, another which acts as a sort of colonization overlay that's abstracted into territories. The territories would probably have to be randomly determined so there's some strategic balance to claiming one versus another, but each could have X resources, Y defense bonuses and Z capacity for colonization. You could, after a fashion, even connect locations via vector roads and have improvements that fit within the area.
Maybe something like this (though a lot less chunky):

So you would be restricted from making improvements or changes to any actual tile, but you'd be able to abstractly harvest resources or build using the overlay map. This idea could incorporate managers as multipliers to base productivity and allow for adding lots of improvements to upgrade any territory.
--------------------Just waiting for the mothership...
Are you set on tiles?
Looking at the map you posted and thinking about I can’t help but feel a region based approach might not be a better. A region would represent a significant geographical area. It might be an ocean, an archipelago, desert, etc.. Development would be done at the region level. Increasing urbanization levels, production levels, transport networks, plus special buildings like space elevators. You probably also want some developments to specific to certain regions, and positions on the planet. For instance space elevators can only be built in regions around the equator, harmonic factories only in crystal plains, and a Divine Wind extractor only on a methane ocean.
This would help create a trade off when initially colonizing a planet because you’d have to decided between a regions benefits and the developments that could be built else where. Do you choose the equator region which would allow for cheap off world transport, or the polar region with extensive ruins? Perhaps there could be some rules in place around claiming planets? The intergalactic homesteaders and anti monopoly act might limit an organization to claiming no more then one unoccupied region a year on any charted planet with the discover allowed to claim up 3 regions upon discovery and registration with the galactic surveyors office. The discoverer might also get a payment for each region claimed there after.
Exploration of region could go down to the tile level as you said; with discover adding bonuses to that region.
You wouldn’t want to go to detailed I would think or you’ll get into the issues you mentioned with each planet taking up a massive amount of space in your db. For that again I’d encourage clever tricks like generating the exploration maps on the fly using fixed seeds and variants supplied to the exploration engine. Then you just need to store the region state and variants. I assume this is all running off an SQLite db?
Looking at the map you posted and thinking about I can’t help but feel a region based approach might not be a better. A region would represent a significant geographical area. It might be an ocean, an archipelago, desert, etc.. Development would be done at the region level. Increasing urbanization levels, production levels, transport networks, plus special buildings like space elevators. You probably also want some developments to specific to certain regions, and positions on the planet. For instance space elevators can only be built in regions around the equator, harmonic factories only in crystal plains, and a Divine Wind extractor only on a methane ocean.
This would help create a trade off when initially colonizing a planet because you’d have to decided between a regions benefits and the developments that could be built else where. Do you choose the equator region which would allow for cheap off world transport, or the polar region with extensive ruins? Perhaps there could be some rules in place around claiming planets? The intergalactic homesteaders and anti monopoly act might limit an organization to claiming no more then one unoccupied region a year on any charted planet with the discover allowed to claim up 3 regions upon discovery and registration with the galactic surveyors office. The discoverer might also get a payment for each region claimed there after.
Exploration of region could go down to the tile level as you said; with discover adding bonuses to that region.
You wouldn’t want to go to detailed I would think or you’ll get into the issues you mentioned with each planet taking up a massive amount of space in your db. For that again I’d encourage clever tricks like generating the exploration maps on the fly using fixed seeds and variants supplied to the exploration engine. Then you just need to store the region state and variants. I assume this is all running off an SQLite db?
Writing Blog: The Aspiring Writer
Novels:
Legacy - Black Prince Saga Book One - By Alexander Ballard (Free this week)
What sort of changes to the planet are most important, and how can you minimize the data needed to represent those?
Cities/Space Elevators/Mines/Outposts/etc strike me as the most interesting thing to put down. Fortunately, those should be cheap: they don't have to be much larger than a single tile. They should be easy to minimize as well, either through cost or through rules about how close two cities can be to each other.
Cities will tend to be connected by road networks. This strikes me as the most costly, as these could get very dense. I'd recommend just abstracting them away, either the assumption is they are there but the interface doesn't display them, or long distance travel is done with aircraft or hovercraft that don't need laid roads. Otherwise you'd need an algorithm where you can store a seed and have a network of roads laid out, and where adding new cities update the network without removing old roads. Doable, I'm sure, but hard. Player placed roads would almost certainly violate your data constraints.
Terraforming might be desirable in a space civilization game. Turning a lifeless rock into a thriving planet could be very cool. At the very least, having forests recede as the planet urbanizes seems necessary for realism. This would be one of those very data intensive things if the player is doing it by hand. But you could just calculate this at the region or plantary level with height maps. Have your map generator produce, instead of a map of tiles, a map of heights. Then you store a water level: anything with height less than that gets water drawn on it. the player's actions can adjust that water level, opening the door to turning a barren rock into a watery planet, or melting a planet's icecaps to flood an enemy's cities.
The same with life: generate a separate height map for life. Anything below X is rock/dessert, anything between X and Y is plains, anything above Y is forest. Terra forming would slowly increase the life level: patches of grass slowly stretching across the terrain. Industrialization would do the opposite: great forests would shrink down into pockets of preservation land.
That way the player can have all sorts of impacts on a planet, but you only need to store a couple seed values, plus water-level and life-level. And a few X,Y points for the major constructions.
Cities/Space Elevators/Mines/Outposts/etc strike me as the most interesting thing to put down. Fortunately, those should be cheap: they don't have to be much larger than a single tile. They should be easy to minimize as well, either through cost or through rules about how close two cities can be to each other.
Cities will tend to be connected by road networks. This strikes me as the most costly, as these could get very dense. I'd recommend just abstracting them away, either the assumption is they are there but the interface doesn't display them, or long distance travel is done with aircraft or hovercraft that don't need laid roads. Otherwise you'd need an algorithm where you can store a seed and have a network of roads laid out, and where adding new cities update the network without removing old roads. Doable, I'm sure, but hard. Player placed roads would almost certainly violate your data constraints.
Terraforming might be desirable in a space civilization game. Turning a lifeless rock into a thriving planet could be very cool. At the very least, having forests recede as the planet urbanizes seems necessary for realism. This would be one of those very data intensive things if the player is doing it by hand. But you could just calculate this at the region or plantary level with height maps. Have your map generator produce, instead of a map of tiles, a map of heights. Then you store a water level: anything with height less than that gets water drawn on it. the player's actions can adjust that water level, opening the door to turning a barren rock into a watery planet, or melting a planet's icecaps to flood an enemy's cities.
The same with life: generate a separate height map for life. Anything below X is rock/dessert, anything between X and Y is plains, anything above Y is forest. Terra forming would slowly increase the life level: patches of grass slowly stretching across the terrain. Industrialization would do the opposite: great forests would shrink down into pockets of preservation land.
That way the player can have all sorts of impacts on a planet, but you only need to store a couple seed values, plus water-level and life-level. And a few X,Y points for the major constructions.
Roads can be easily handeled by joining cities with the shortest/easiest path. A technological civilisation will be abel to survey the land and work out the best path for a road between cities. This way all the player has to do is state which cities are to be joined by a road and the pathing algorithm says where it goes. You don't need to store details of each tile, just the start and end cities (and probably the path of the road if you don't wan to recalculate it each time).
Settlements can be handeled a similar way. Instead of storing the data for any changes the city makes to the terrain, you just calculate it based on aspects of the city and a procedural algorithm. For example, A city need food, so a certain area around the city will need to be farmland, so this changes the tiles displayed (without changing the tiles themselves and so not needing to be stored) and then bases the food production of the city from that. If the city need more food production the size of this envelope can be increased as the city need.
I agree. If it becomes harder and harder to catch the leader in such a race (a positive feedback loop), then the player/AI oppoent with a slight lead near the start can almost be certain of winning, and if this is the case, then it is pointless for other players/AIs to even try to compete.
To make it a fun game, a Negative feedback loop must be added into the system to slow down the leader. Give the players who are behind some way of catching up or slowing down the pla7yer/AIs ahead of them.
When a player (or AI) discovers a planet, then they could have a grace period before the opther players/AIs hear about it, organise colony ships and get there. Also, in this grace period you could allow positive feedback loops to exist wihtout any negative feedback loops. This would give the first coloniser a head start in developing the playent and getting access to any resources.
However, after this grace period, the negative feedbacks kick in and limit the grow rate of the leader.
One idea for the negative feedback loops could be with specialisation and generalisation of the settlements. Early on, as the settlements will need to be self supporting being a generalist type city is an advantage. However, specialist cities can be more efficient and produce in greater quantities, thereby giving advantages to cities that specialise.
When a player/AI colonises a planet, they can't bring along a lot of people, so settlements tend to be small, and starting new settlements is costly, and splitting up your population means that population growth is slowed. So a player can't get enough settlements early on to allow them to bspecialise, meaning they need to be generalists.
However, as other player/AIs colonise the planet, they bring in more population and more settlements. As there are more settlements and population, these late commers can specialise almost strait away, but then it also allows the original coloniser to specialise too.
It also give the original coloniser a choice. If they think they can split up their initial population, they can grab lots of resource points quickly, but at the cost of growth rate. However, they could choose not to split up and foccus instead in growth rate.
If the player thinks that the other players/AIs aren't going to colonise their planet soon, then there is an advantage in splitting up. But, if they think the other players are going to colonise the planet soon, then there is an advantage in a higher greowth rate, and then splitting up later.
Settlements can be handeled a similar way. Instead of storing the data for any changes the city makes to the terrain, you just calculate it based on aspects of the city and a procedural algorithm. For example, A city need food, so a certain area around the city will need to be farmland, so this changes the tiles displayed (without changing the tiles themselves and so not needing to be stored) and then bases the food production of the city from that. If the city need more food production the size of this envelope can be increased as the city need.
Quote:
Original post by: Eric Seiler
Turning exploration into a race doesn't sound like a bad thing. The only thing that I'd try to avoid is the downward spiral that can happen once one of the players has the lead. If there isn't any auto-balancing mechanism, for example the areas that are explored have to also be defended, then you might encounter a scenario where no one can ever catch up to the leader.
I agree. If it becomes harder and harder to catch the leader in such a race (a positive feedback loop), then the player/AI oppoent with a slight lead near the start can almost be certain of winning, and if this is the case, then it is pointless for other players/AIs to even try to compete.
To make it a fun game, a Negative feedback loop must be added into the system to slow down the leader. Give the players who are behind some way of catching up or slowing down the pla7yer/AIs ahead of them.
Quote:
Original post by: Wavinator
Each time you discover a world you have first dibs on all the easily accessible resources and can put down temporary bases. However, news of your find gets back and eventually planets become revealed and built up automatically.
When a player (or AI) discovers a planet, then they could have a grace period before the opther players/AIs hear about it, organise colony ships and get there. Also, in this grace period you could allow positive feedback loops to exist wihtout any negative feedback loops. This would give the first coloniser a head start in developing the playent and getting access to any resources.
However, after this grace period, the negative feedbacks kick in and limit the grow rate of the leader.
One idea for the negative feedback loops could be with specialisation and generalisation of the settlements. Early on, as the settlements will need to be self supporting being a generalist type city is an advantage. However, specialist cities can be more efficient and produce in greater quantities, thereby giving advantages to cities that specialise.
When a player/AI colonises a planet, they can't bring along a lot of people, so settlements tend to be small, and starting new settlements is costly, and splitting up your population means that population growth is slowed. So a player can't get enough settlements early on to allow them to bspecialise, meaning they need to be generalists.
However, as other player/AIs colonise the planet, they bring in more population and more settlements. As there are more settlements and population, these late commers can specialise almost strait away, but then it also allows the original coloniser to specialise too.
It also give the original coloniser a choice. If they think they can split up their initial population, they can grab lots of resource points quickly, but at the cost of growth rate. However, they could choose not to split up and foccus instead in growth rate.
If the player thinks that the other players/AIs aren't going to colonise their planet soon, then there is an advantage in splitting up. But, if they think the other players are going to colonise the planet soon, then there is an advantage in a higher greowth rate, and then splitting up later.
Quote:
Original post by TechnoGoth
Are you set on tiles?
Looking at the map you posted and thinking about I can’t help but feel a region based approach might not be a better.
Not sure if I'm set, Civ was my initial template for planet exploration. I'd prefer not to have hard boundaries when you move your explorers about manually, but maybe tiles could very obviously be linked to regions or even have spots that "unlock" or activate regions after you explore enough.
The themed regions is an idea with a lot of potential, especially if each theme had a trade-off. An archipelago, for example, could be either a resort or a space elevator site, but not both, whereas a desert could be a shipyard or solar farm but not both.
Quote:
Then you just need to store the region state and variants. I assume this is all running off an SQLite db?
Not yet but I'm moving in that direction.
Thanks for the great ideas.
--------------------Just waiting for the mothership...
Polama and Edtharan thanks both. I use an elevation map for initial terrain generation but never thought of using it for water and life. I will have to explore that a lot more deeply.
Thinking about this more I haven't decided whether or not you should be allowed to interact tile by tile in civilized areas, as there's far more potential for tedium than with exploring frontier. So maybe cities and roads might be very abstract, and I've even considered stacking cities and improvements in a pane that activates whenever you click on a territory. This would really speed up travel not to mention management, and maybe even cut down on what would be a highly repetitive tile map.
Thinking about this more I haven't decided whether or not you should be allowed to interact tile by tile in civilized areas, as there's far more potential for tedium than with exploring frontier. So maybe cities and roads might be very abstract, and I've even considered stacking cities and improvements in a pane that activates whenever you click on a territory. This would really speed up travel not to mention management, and maybe even cut down on what would be a highly repetitive tile map.
--------------------Just waiting for the mothership...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement