There hasn’t been anything huge since my last post, but quite a few small things. Most of it has focused around improving the herbivore behaviour through things like pathfinding improvements, some tweaks to how actions happen, and various bugfixes. I’ve also added a UI overlay to start showing some simple game stats – soon to be expanded upon – and implemented a few workflow improvements to help keep track of my ideas and progress.
Last post I talked about how the herbivores were performing too efficiently, leading both to a lot of “swarming” behaviour as well as degrading performance. I’ve addressed this in two main ways: introduce more complexity to the decision making progress so that it’s less efficient and predictable, and by making pathfinding a bit less expensive.
Some of the adjustments I’ve made:
- Actions now have a configurable “duration”; e.g. after eating, walking, etc., an entity will wait a number of cycles before doing another action.
- Entities have an ideal number of children; after they reach that number they become far less likely to create any more.
- If an entity’s pathfinding “fails” it will now idle for a short period; wandering in random directions, instead of immediately attempting to pathfind again.
- If pathfinding fails, the entity is also supposed to “blacklist” the object it was walking to so it will pick a new target, but this might not be working.
- Entities no longer route their path before every single movement; they’ll instead remember a previously routed path and follow it for a number of cycles before re-calculating.
On top of these specific adjustments, I’ve also made a bunch of tweaks to individual parameters for both the grass and herbivores to try to get to a state of equilibrium. I’m aiming for a scenario where both types of entities can survive for a long time while also not killing the frame rate. It’s getting close – the herbivores are much less explosive and the grass a lot more resilient, and the game tends to stay above 60FPS, but over a long enough period it’s inevitable that the herbivores will eat all grass and then die for lack of food.
This is a pretty minor thing overall, but an important first step. So far I’ve just added some text that tells me some basic info about the game state – this can help me gauge how various factors impact the game’s performance. As well, now that I know how to create and update text on the screen, it gives me an avenue to start displaying properties of individual entities.
To replace the Google doc I was previously tossing ideas into, I’ve started using Jira to track ideas/tasks/bugs/etc., though that’s pretty boring. I’ve also started uploading my work to github (https://github.com/dlouwe/tinyfeelingrobots) to A) keep myself a bit more structured/mindful in how I work on things, and B) maintain a working backup of my changes, and C) allow any errant soul the chance to check the thing out for themselves. I am 95% sure that this has all of the project files necessary to load the thing up in Unity with minimal/no configuration, but I also don’t entirely know what I’m doing!
A side effect of using these tools is I’ve had to somewhat formalize a name for this project: Tiny Feeling Robots. Because I’m not creative and I like iteration. 🙂
We’re inching ever so close to the actual purpose of the dang thing, which is to start allowing the properties of entities to change over time and observing what kind of shenanigans that causes. The only thing that I’m really waiting on for that is being able to view entity properties while the game is running. Technically I can do that using the Unity editor, but that’s not very practical. So, depending on how easy that is to set up, we could potentially see some shenanigans in the next blog post!