Hear ye! Hear ye! My fellow citizens and collected peasants!
Hexagge is a one-person indie game project. I've always enjoyed city builders and strategy games, and being a programmer and tech enthusiast, of course, I eventually concluded that I should make one myself. These Dev Diary posts are intended to present the game's developmental progress and potentially seek feedback and community engagement throughout.
I intend to focus heavily on the aspects I enjoy. After all, why not make a game that I would enjoy playing? Based on that, Hexxage will have two main focuses: building big cities with perfect layouts and optimizing massive, overly complicated production chains.
I've been playing around with the idea of making a game like this since 2016. It originally started as a simple text-based web game inspired by A Dark Room and Banished. It took me a while to dig it up, but I perpetually keep a backup of everything.
The project never got a real name, still in a folder generated by Github's random assignment, Lamp-Tanuki-Giggle. It is 100% functional for what it is. You collect resources, the people eat and age, build new structures to support new jobs, and expand the population. Developing further while keeping this format made the game mechanics abstract and complex without visual representation.
A few renditions later, we have the next project, Teh-Gmea. I never got to the game aspects of this project. It was all about creating the grid system and world generation. The world would generate infinitely as you explored it until your browser crashed. You can see the resources would spawn in different colored circles. It also created initial structures represented by the brown lines (roads) and grey squares (buildings). The grid could identify where you clicked and fully supported mouse and touch screen interaction. I used a Cordova platform, which allowed me to turn the web app into an Android or iOS application, releasing it on three different platforms without supporting three separate programs. I started integrating a JavaScript game framework called Phaser but then work got busy, and the project got shelved. I continued planning and brainstorming through the years. I have a ton of Google Docs with notes, but nothing ever got put to code.
Side Note: I have no idea what XCOA stands for. My backups are fantastic. My documentation is not always.
Then the world started ending in 2020, so like most people that had too much free time on their hands, I started working on new skills and hobbies. One of these new skills was teaching myself Unity. Game development was of interest to me, so it made sense to take a crack at it. I made, tweaked, and expanded on about a dozen different demo games. I even made a practice game from scratch inspired by the breeding system of Ark.
You bred different shapes to get more complex polygons and other colors. It focused on hard light effects and crystalline sound effects. It works, and I had ideas to take it further, but its motivation faded quickly as I started playing with grid systems again. I dusted off my old notes and started a new project called Village. I got an infinite grid in place and even worked out one of my brainstorming ideas—the concept of moving buildings around after you build them, likely with the help of magic.
Then I started working on world generation and hit a wall. I had three conditions for my world generation. First, it needed to generate infinitely so players could make their cities as large as they wanted. Second, it couldn't generate everything at once, so there had to be an exploration system of some sort, but the world had to stay consistent no matter how you went about exploring it. Third, the world generation had to be seed-based so that if you entered the same seed, you would get the same world. With any two of those requirements, I had a good idea of accomplishing it. I was lost on how to do all three at once. The part where it had to stay consistent was the biggest problem. After about a month of research and experimentation, I learned how to implement a Perlin Noise generation algorithm.
Provided by Matthewslf from the Perlin Noise Wikipedia Page
I won't turn this into a technical document on Perlin Noise algorithms, but here is a basic overview. You use a mathematical model to generate gradients based on vectors within a grid and smooth everything together. Then based on where the gradient values fall, you determine what type of terrain is present. A good example is that a low value becomes water areas, and a high value becomes mountainous. You can also combine different layers to determine other features, such as where trees and rocks appear.
Provided by Red Blob Games
That takes us to the current project. I transitioned from a square grid to a hex grid to make world generation and calculating distances and radii easier. The project got initially titled hexagon_village, but that is too wordy, so Hexag-ge was created. I present to you version PreAlpha-001.
This certainly isn't the game’s final look, as all the assets are basic polygons or assets pulled off the Unity store with minimal post-processing, but you have to start somewhere. Also, it currently isn't functional as a game just yet. I have spent a lot of time thinking and planning to make sure what I have is an excellent foundation to move forward with.
In Hexagge, the world is broken up into hexagon tiles. Each tile is a different terrain type, such as grass or water. The terrain type is chosen based on the biome the tile is located in and the height of the tile. Low areas are water tiles, and high areas are mountain tiles. Each tile can have either a building or a resource on it. Biomes, tiles, and resources are all determined by noise layers. The noise layers are generated based on a seed, which is currently always random. Everything is in place to give you the option to pick a seed, but I haven't got that far yet.
The center tile and the next two rows of tiles are guaranteed not to be mountains or water, making sure you have somewhere to start. The initially generated world will be randomly sized and shaped. You will need to send someone out to explore to expand the starting area. This keeps the potentially infinite world manageable and, to a small extent, adds to the management part of the expansion as the person exploring won't be able to do other jobs. You are always guaranteed to start with some water source, be it a water tile or an aquifer (I'll come back to the aquifers in a bit). The game also gives you a wagon at the center tile as a starting storage building. The wagon is intended to be filled with resources to get you started, but currently, it has 100 lumber, potatoes, and water. You also begin with four adults, two teenagers and two children, but they aren’t represented graphically yet.
Time in the game is based on ticks. Time in Hexagge is ultimately tracked in years, starting at zero and incrementing to show how long you've been playing. Each year is broken into four seasons: spring, summer, autumn, and winter. Each season is split into three days: early, mid, and late. I've planned for a day at base speed to last 5 minutes of real-time, and based on the information from Unity, we're looking at about 50 ticks per second, so that means each day lasts 15,000 ticks. You start at mid-spring as I intend to make late autumn to early spring more dangerous for the villagers with winter weather in later updates. Starting mid-spring gives you the maximum amount of time possible to get situated before things get bad. The world lighting does a little sun animation to indicate time’s passing, creating a day/night cycle. This doesn't do anything mechanically, but I think it will look nice when all the houses have lights shining out during the night. I also ensured it doesn't get so dark that it impedes the player.
There are only two types of buildings currently: the wagon and the hovel. You can't build more wagons as there will be other more permanent storage structures for you to make. The hovel will be the most basic type of housing. It will only house a small family of 4, won't provide any happiness or comfort, and is pretty much there to keep people from being homeless. The hovel is cheap and builds quickly, making it useful for rapid expansion. The concept of moving the buildings is still here. I intend to put some time restrictions on it, but the idea is you can move a building to any available tile at will. I always enjoy achieving the perfect layout in city builders, but deconstructing and reconstructing to accomplish that is just a chore. There are no effects or animations to the action yet, but that will come later.
There are only a few types of resources available: trees, rocks, shrubs, and aquifers. They also don't do anything yet as I haven't made anything to interact with them. The intention is the trees will give you lumber and possibly spawn more shrubs, the rocks will be an early source of stone, the shrubs will be food and maybe a medical source, and the aquifers, along with the apparent water tiles, will be a water source. There is a main distinction between different resources: above ground or underground. Above ground resources are automatically visible (if you know what they are) and are destroyed if you place a building on the same tile. Underground resources have to be located through some exploration method and structures can be set over them. The intention for some resources will be to have a building on the same tile to collect them. To locate the aquifers, you need to dowse. On a later update, you will build a well over the aquifer to collect water.
Despite the people not being anything more than an invisible game object right now, they do quite a bit. They will move into available housing, form families, eat and drink, age, and inevitably die. There currently isn't a way to collect more food and water, so right now, everyone dies of thirst in a couple of days. As people age, they get placed into separate categories: child, teenager, adult, elder. Children and elders don't contribute in any meaningful way. Adults can form families and are intended to work and expand the population. Functionally there is no difference between teenagers and adults right now. The idea for later is that teenagers of lower class and education will continue to function as adults, going out to form families and work. Teenagers of higher class and education will continue to serve as children, hopefully improving through education, allowing them to start stronger as adults. Currently, a person is considered a child until age 2, a teenager until 3.5, and an adult until 11. Likely a person will die of old age 2 or 3 years after becoming an elder. The people also manage themselves automatically, mainly to build and grow families. They will not break up or split a family for any reason.
- They focus on making sure everyone is in a home if available. Priority is given to families with children, families without children, and finally, those who are single.
- We move single women in with single men to make new families.
- Move families without children into homes with more space.
- Move single men into vacant or mostly vacant homes away from their original family
It took a while to put this all together due to the main focus of planning out the framework for everything in advance. I also went through a few cleanup and optimization passes and documented everything making sure I was prepped to move forward. The next focus will be the main menu allowing you to pre-generate the world before starting and saving/loading games.
