Specialization
Colony Sim
Overview
[Simulation Overview GIF Placeholder]
My specialization is a colony simulatior similar to games like Dwarf Fortress or RimWorld which were the main inspirations for this project.
The player is a top-down observer of the world and can place objects and give indirect objectives for the agents to follow - such as "Build road", "Construct wall" or "Chop down tree". The AI will then prioritize the tasks after their own wants and needs.
The simulation has four diffrent agents:
The Woodcutter - He focuses on chopping down trees.
The Builder - He focuses on building.
The Farmer - He focuses on farming
The Cook - He focuses on cooking.
The agents then also have needs such as hunger, sleep and social which they will try to keep at max by eating , sleeping or talking to other agents.
There are also different buildings in the simulation, such as walls, storage, campfires and beds. The agents will respond to them if they exist, such as if there are no beds they will sleep on the ground, but if there are beds, they will sleep in them, or the campfire, if there is a campfire and there are uncooked food around, the agents will try to cook the food and eat the cooked food.
Motivation
My main motivation for making this specific project is because i have always had a love for colony/city simulations, but ive never had any chance to really sit down and focus in on a simulation like this.
I have a deep love for AI in video games, watching someone play one of my games and interact with an AI that ive designed is what really makes me happy, it is the reason i want to work with games and game AI.
Besides the joy of working with simulations like this, i also wanted to improve my AI programming skills and showcase my passion for gameplay AI.
I came into this project knowing i would have to make a proper AI task system and priority system, a needs system and a well developed pathfinding system. Later on i also noticed i wanted to do a dialogue system for the social aspect.
Social System
Another system i enjoyed working on a lot is the social system. When i started making the project i was just gonna have agents increase their social need by being close to each other but then i spent some time in other games checking how they did it and i loved the idea of agents talking to each other, so i added a simple memory to every agent and made them talk to each other and agree/disagree depending on their job. So in the case to the left, a cook is talking to a farmer and they both agree that planting and sowing is an enjoyable activity.
This gives alot of life to the simulation and it is one of my favorite things to add to these type of projects.
GIF PLACEHOLDER
Quality of Life Features
Now this part was something i told myself that i had to do from the very start of the project and it paid off massively. Being able to see the paths of the agents alone saved probably half of my bug fixing time in an instant. I cannot stress enough how much these features saved me in time and probably in headaches.
[Yellow - Farmer Blue - Builder Brown - Woodworker Red - Cook]
GIF PLACEHOLDER
GIF PLACEHOLDER
One part i want to highlight is the dynamic pathfinding system. The underlaying system is an A* pathfinding system and then the system adds weights to the diffrent tiles depending on what sort of tile and what type of buildings are nearby. In this case, grass tiles make you slower and roads make you faster, so the agent adds more weight to the grass and less to the roads making them more preferable to walk on.
The ai can also make choices depending on if there are other agents nearby or if a place is desired, such as with eating locations or social locations.
Dynamic Pathfinding
The Job system is a huge part of the simulation. Every agent has their own job assigned to them at the start of the simulation and they take tasks that they enjoy doing first , such as the woodworker taking wood cutting jobs first, or the builder taking building jobs first.
This was a major part of the simulation as you can see the diffrent agents prioritise and work together instead of everyone just blindly taking whatever task is the closest. Leading again to a simulation that feels more alive.
Job System
Conclusions
I have always been someone that rushes into things and dont do the heavy lifting at the begining of a project by planning out my work. This was the project where i learned the value of doing heavy planning and scheduling my time in a reasonable fashion. Without it, i most probably wouldnt have made the project in the time span that i did.
The other lesson i learned was the value of debugging tools, it was something that i added as soon as i could instead of spending hours going over what was actually wrong with the current bug, i could just see their current task and how their paths looked.
In conclusion, i learned alot and i loved working on this project. I was hoping to get more features into the project, but that will have to wait for another day as the specialization time has run out.