City Builder Project

I got some positive feedback on City State and knew that city builders were a genre that I could feasibly make unlike a 4X. While I could have continued to work on city state it has some really inefficient code and a design that doesn't allow for a ton of expansion room. I also wanted to make something with a proper tech tree that has a longer time span.

So I have experimented a bit with creating a new city builder. So far I have made two attempts which both didn't quite work out, but I have learned a lot from them and am planning out a third idea. This is my design notes and retrospective on those projects. 

Both these projects were made in Unity, but for the third game I might try Godot.

City of Cards

The first idea I tried was what I called City of Cards. It was to be a city builder where you collect different cards and they served as the buildings. It was inspired by a game called Terraformers which has similar mechanic for building cities, where players pick cards that they can then store and play later to build buildings and other things.

Since City of Cards only has one city I saw no point of storing the cards. Instead there would be a top/"market" row of cards similar to many board games like Through the Ages or Star Realms. Players could build cards directly from that row, provided that they have enough resources. Buildings would cost resources like wood, stone or iron to build. To build buildings players also need population which increase over time as long as they are producing food. 

To get more advanced buildings players can then also research new technologies by producing science. By doing that the new buildings will be added to the "deck" that top row randomly draws from. 

Screenshot of City of Cards. The card row is above, the building built below. 

One core principle for these projects was to not have any military, wars or violent conflicts for the game. Partly because I felt like there was already a lot of games with conflict in them and I wanted focus on other elements. But also because I wanted to have a focus on just building a good city for your citizens. I wanted to make a game where that was the goal and maybe also the win condition. 

To do this I made a system where there is a number of different "needs" resources and your citizens will over time require more and more of them. I didn't want a simple happiness system because I wanted variety to incentivized and I liked the idea of a challenge being "your citizens wants Entertainment". The player could then go "oh I will build a theater". In a system where there is just happiness system, players could just get 10 theaters, but here they might need a theater to for Entertainment, a gold mine for Luxuries, a park for Nature and Vineyard for Delicates. Still it could provide a lot of options when it comes to picking buildings and technologies. "Hmm Calender gets me plantations that will help with producing food and Delicates. But on the other hand Masonry will help my stone production and if I can set up marble quarry that will produce Art. What do my people want the most?"

I didn't have a planned victory condition for City of Cards. Maybe it would just run for a set number of turns and score you based on how many happy citizens you had. I did however have a lose condition, which would be if you got your happiness stayed zero for 3 turns. In that case you would lose your job as immortal mayor and get a game over. This could also later be modified by decision you make. If there was an option to pick governments/policies, authoritarian could lower the minimum happiness threshold, while democracies would give bonuses but raise the bar.

One problem I identified with this idea was that it kinda accurately portrayed consumerism. The constant demand for more stuff could create a fun challenge from a city building/resource gathering view. But there would be no way to stop. I felt like there should be a way to say "i have a cool, solarpunk city with clean power, mag lev trains and art museums, you don't need more stuff now, right?".

While writing this I actually got an idea for in a future project try to make the victory condition be getting at least one of every need. Having one of each need (and keeping it like that for a few turns) could be an interesting victory condition that puts your citizens in focus.

Image of Needs in the game. There is Art, Nature, Luxuries, Delicates, Entertainent and Travel

Image of Needs in the game

The design ideas I put in my document when I started planning the game

Another idea that I really like that I got while designing the game that never got implement was to have more things than just buildings in the card row. 

There could be projects like chopping forests, holding festivals and exploring space that could give instant or temporary bonuses without being buildings.

There could also be events, both positive and negative that pop up and take up space in the card row. There could be systems for things like Climate change that creates negative cards like pollution and smog in the card row. Smog could just be a null card that doesn't do anything but blocks one spot in the card while its there. To not draw them players would have to invest in green energy. There are many interesting things that could be done with it I think

As the game progressed the buildings would also start to require resources to produce. An initial farm costs 5 wood and produces 2 food per turn. An irrigated farm, the second tier of farming, produces 5 food per turn however it also consumes 1 tool. As you progress you through the tech tree you would unlock new, more powerful buildings, but they would also require new resource inputs and a more complicated supply chain. In the late game you could have a single hydroponics farm producing 20 food a turn, but requiring power and tools. To get that power you might have a wind power plant or a oil power plant, which in turns requires an oil well that requires machine parts. Setting up the supply chain would be part of the challenge of the game, similar to games like Factorio or many Minecraft mods.

A "City" in City of Cards

I like a lot of the concepts and ideas from City of Cards and I think something like it could work. But it suffered a lot from the lack of connection to the world/terrain. Your city doesn't feel like a city, it's just a bunch of cards. You keep selecting new cards and buildings but you don't place them anywhere. It didn't quite work. I was considering why it didn't work, while board games without maps like 7 Wonders and Through the Ages do and honestly I don't know entirely. I think part of the problem is that they are multiplayer board games and this is a city builder. You gotta be able to see the city in a city builder. 

The other problem was the lack of art. I'm not a artist or a illustrator, nor do I really aspire to be one. But these projects really taught me how some artwork, even my shoddy designer art, enhances a game and makes a prototype feel much more alive.

Prosper

For the second attempt I wanted to focus primarily on one thing, terrain. City of Cards didn't feel like a city and I felt like having some kind of terrain was one way to fix that. It would also allow me to represent exploration in a better way. 

I kept the focus on peace, on citizens and on resources. I also wanted to focus more on art to make the game feel more alive.

Finally I expanded the scope. It didn't make sense for one city to produce all these resources that would be needed for the supply chain, so I let the player found multiple. Of course I knew the dangers of expanding scope to much, but I still wanted to try making a proper civilization building game. I had a couple of noted limitations on the scope, to not go too grand;

I also went for a perspective that you often don't see in a city/civilization building game, a 2D side scrolling view. This was partly inspired by a history book I read a lot as a child A Street Through Time by Anne Milliard (well I read a Swedish translation but still) that shows different eras of a European city in a sideways view. 

Exploring in Prosper. The player can pick one of these 3 terrain alternatives to add to the world.

The first step of creating the game which I called Prosper was to create the terrain generation. I hadn't done any form of terrain generation before but I think the method I opted for worked pretty well. At the start of the game 5 tiles of terrain are created, but after that whenever you explore, the game creates 3 different options for terrain and the player gets to pick one. The player therefore gets a say in how the terrain is created. It also meant that the terrain generator doesn't need to be too perfect, because if the player makes strange terrain, well that's their decision. This wouldn't work in all games, it only really makes sense if you are generating one tile at a time and only from one angle, but since that's case in Prosper it fits. 

The generated options in the game are based on a lot of scriptable objects with different values. There are 5 different terrain types; Tundra, Taiga, Plains, Grasslands, Desert all with different odds for things. After selecting terrain type it then picks elevation (mountains, highland, hills, default and lowlands) and "oceanness" (land, coastal, shallow water, ocean and lake). These are all semi random but with limits so for example there can't be a mountain tile next to lowlands or grasslands next to tundra. Finally the game also generates 0-3 terrain features on the tile. These could be deposits of things like copper, iron or jade, different of forest and jungles or resources like Pearls, Wine or Clay. 

Some of the different terrain features in the game, what they produce and what buildings to build to harvest them. 

The resource to right is produced by default and the ones on the left is harvested with the building. More advanced variants of the resource buildings multiply the amount harvested. Since some tiles have multiple resources the player might need to choose what building to build and resource to harvest.

The change from one to multiple cities also meant that they could each store resources. I could have made all the cities share a global storage but I like the idea of building supply chains with trading between them. Each city can at the start store 25 of each resource (storage capacity can be improved by buildings) and send resources in between each other if they are in trade range. You could have a forest city producing lots of wood that supplies it more urban cities that produce more advanced resources. 

One problem I realized with trading was that it created quite a bit of micromanagement which I wanted to avoid. I thought about trying to implement a way to set up automatic trades, but that would need to be done in a way that's clear and communicative. At one point I checked how it would work if cities automatically sent extra resources to other cities in trade range, but all that meant was the trade barely mattered since you could just wait for all cities to fill up with all the resources you produced.

Early screenshot of the game. Note that cities still have population. I have a list of 10 names, randomly assigned to any created city.

A city in Prosper. This is how many tiles can be seen at once on the screen. Also note that science isn't stored as it's a global resource.

The biggest issue I found with the 2D side view was how it limited city size however. At the each city had a population number which could grow overtime depending on food production like many strategy games. This however didn't really work as, well, the view can only display 7 tiles at once and not being able to see your entire city at once in a city builder seems like a terrible idea. I removed the population mechanic and instead limited cities to 7 tiles, 3 in each direction. 

This sort of worked. Cities became small and specialized and they could trade for resources they didn't produce like I wanted. It did however mean that I needed a new system for food and population. 

Now I saw three ways to solve this. Either scrap the from the side view and go for the traditional top down with tiles or hexagons. This sounds very hard to code, and it also removes a lot of the unique elements from the game. 

Another idea would be to allow one tile to have multiple pops (population units) on it. This would show the scaling urbanization well, but need a good UI for assigning pops and lead to the game requiring too much micromanaging 

Instead I tried something else, by moving population to every tile. Each tile can have a building like normal and also a "housing". By default any tile added to a city is at the 0 pops level, consuming 1 food but allowing you to build a building and take advantage of the tiles natural production. Plains and grasslands the most common terrain both produce 1 food, allowing them to feed the population by themselves. 

Housing does not upgrade by itself, instead it is something the player has to do. This meant that player can do everything at their own pace, but it did remove some challenge compared to the earlier concepts. 

I did also need some reason for upgrading housing. At first I thought about making it so that population multiplied the production on the tile. But after looking at my notes and finding that would make a tile with a hydroponic farm and a skyscraper produce 20 * 6 = 120 food per turn... I realized that was a bad idea.

My initial notes for how the new pop system would work. I wanted to have different variant for housing of each tiers later. A skyscraper might have a lot of pops but a sustainable home might consume less resources per turn.

Instead I made population and housing connect to the goal of the game. Each turn each pop on a tile can consume 1 of the needs resources and in turn produces 1 "score". Producing score could then be goal of the game and the challenge would be doing that in a time frame. A problem with systems like this is the best strategy is generally just to build the best "engine"/production possible and then when you have a decent city focus on score. For a game about keeping citizens happy that wasn't ideal. 

So I added some other uses for pops. First off all many late game buildings will require some pops on the tile, especially "urban" buildings. Secondly I added some buildings that produced a resource amount depending on the pops in the city. For example a school will produce 1 science for each pop in the city its in. 

Part of the tech tree. Techs are not linked directly as per a standard tech tree, instead when you research you get to pick 1 of 3 options. You can advance to the next tier by building that tiers science building. Library --> School --> Workshop -->University --> Observatory, etc

REWRITE


Resources and production is one of the main things in Prosper and the amount of resources steadily expanded over time. As previusly mentioned I wanted not have a "production" resource unlike games like Civilization have and instead show many different resources being used and necessary to build things. This isn't to say that Civilization and other games should have 30 resources, its just about where you put your focus. Late game buildings in Prosper consume Chipsets, which requires rare earths and electronics which in turn require Copper. This means you need to build mines for the those materials and factories to produce them. Then of course these mines and factories require power and the people working there still require food. And so on. Some people might think this sounds dreadfully boring, some like me see a potential for a fun challenging puzzle in it. That's fine.

Still there is of course always a limit to the amount of resources you can have. There are more metals I could add, more things that could be split up. But I try to aim for every resources having multiple uses and ways to produce it. The last addition was adding cloth. Before that cotton plantations and sheep pastures just directly produced clothes. But now you need a weaver/spinning wheel/clothes factory to make it from cloth. Cloth will also be needed to for harbors and shipyards (sails)  and can be used for basics tent buildings instead of wood or clay. 

An example where I could have split up a resource is paper. Paper is needed for libraries and schools and some other administrative buildings. However the first actual paper you make is produced in the medieval period/tier 4 with the Printing technology that allows you make paper mills. which convert wood to paper. Before that you can get "paper" from reed plantations (papyrus),  goat pastures (parchment) and potters (clay tablets). These more basic ways are less efficient than paper mills (and later industrial paper mills) but necessary to progress.  In this sense "paper" stands more for any writing material, but I called it paper 

One mechanic I liked that I made in Prosper was having cases with multiple possibles resources. Many buildings cost Building Material allowing you to use either wood or clay. 

This is something I want to use more of in future games. Cases where you can multiple types of resources, like using different metals for tool production. 

Ultimately the biggest problem I found and the reason I stopped developing Prosper was with the mechanic of multiple cities. If every city has their own resource stored, constantly jumping between them to build something there and add a tile there got annoying. Sometimes when playtesting I would develop one city and completely forget about another. 

I thought about how games like Civilization and Age of Wonders solve this problem and I think its a combination of Global resources and Build Queues. In Prosper science and scores are the only global resources, while other games have some form of gold and culture. Of course I could have made more resources global in Prosper, but part of the core mechanic was supposed to be trade and supply chains. Another thing that differs is Build Queues and with that production. To produce a library in Civilization 6 you simply select in the build menu and start producing it. After the city has generated 90 production it's built. The great thing with this system is that when you have multiple cities the game can then go "London can produce something" and the player then has a reason to go to London and decide what to produce. This adds a incentive to around to their different cities. 

In Prosper building something takes just a click, but to do so you need the right materials. A library requires 12 wood or clay and is then built instantly. As long as the player has materials they can build any number of buildings in a turn. That combined with the small max size of a city means that once it has buildings there is rarely a reason to revisit it, other than occasionally upgrading a building when you research a new technology. Of course I could have made buildings take a few turns to build and even limited it to building one at a time, but I felt like all that would add would be micromanagement. Maybe I will come back some day and try that.  

Notes for the future

The clearest lesson from Prosper was to stick to one city. Leave civilization builder to when I have a bigger budget. Part of the reason for having multiple cities was to allow the player get many different types of resources for their production chains. I think I will try some trading mechanic where the player can trade with "the outside world". I still want to avoid having to make some kind of AI or competing civilization/city though. 

As I previously mentioned I also want to do more with resource alternatives for buildings. And I am going to focus more on making prototype art.