City Builder

This project taught me much about procedural world generation, several workflows (mainly SCRUM), AI state machines, and grid-based pathfinding.

I had to evaluate the added worth of systems compared to their cost. For example, at the start of the project, I implemented a different version of the world generation. This original version endlessly generated in chunks on demand. Although this was a fun and exciting feature in isolation, it came at the cost of complexity in the project.

The original system required us to render or disable chunks dynamically, implement a more complex world grid, and do much more performance work. Ultimately we decided that the value the original world generation added to the project was minor compared to the cost of complexity and maintainability that came along with it. Which led to the simpler fixed-size world we use now.

This is a city-building game developed in Unity, where you build and manage a city and its inhabitants. The game occurs in a randomly generated world filled with terrains such as mountains, lakes and forests. Many resources, such as rocks or metal, are scattered throughout the world, which workers can harvest to refine or use directly to craft tools or expand the village.

I developed this project with a game designer over the course of about three months. The game still needs to be finished, and many graphics shown here are placeholders and subject to change. Still, some aspects of it stand out.

Although we experimented with different workflows during the development of this project, we mainly used SCRUM. We had regular weekly meetings to decide what we intended to get done during each sprint. We used Trello's Kanban board to divide the work into smaller tasks with clear user story descriptions that we worked with during each sprint. This workflow was a good fit for us since it eliminated a lot of coordination and unnecessary meetings. It allowed us to use our time more efficiently and maintain an excellent overall structure during the development.

One of the more complex tasks was to generate the game's terrain. The terrain generation was a critical part of the game. It provided the entire playing field on which the rest of the game is built. It had to look good and believable in the eyes of the player in order not to break their immersion. It also needed to function very well with our AI and its pathfinding.

We needed a height map to base the terrain mesh on to generate a believable terrain. To create this height map, we layered perlin noise with different scales, strengths and offset. The more upscaled perlin noise had a more significant influence on the map. These maps would become the mountains and valleys. The middle scales had a lesser impact on the height map, and those would generate hills and boulders. The layer with the smallest scales would create small rocks and bumps to create a more believable texture.

We used the height map data to generate the terrain mesh with greater height map values to represent higher altitudes. We divided the terrain into different tiles represented in a grid. This grid would store the data for each tile in the world which our AI and building system needed.

Overview

Workflow

World Generation

What I learned

IF YOU LIKE MY WORK, CONTACT ME VIA:

+46725482318