Creatolution
Sander Sats
My plan is to make a kind of a evolution sandbox world where creatures live, evolve and multiply (and die). The idea is to have different survival strategies (predation vs herbivorism and everything in between). Plants will slowly grow food that the creatures can eat. The creatures will multiply through interaction and their offspring will have some combination of their parents traits with low chance of random mutations (not sure how I will manage who reproduces with who - different species?). The "player" will be able to move around in the world to observe the action (possibly with the ability to speed up/slow down the passing of time) but the creatures will be autonomous. If I have time, there might be some UI for the player to set up starting conditions/create creatures but at the moment this seems quite far fetched.
For the technology I will be using Unity. The initial plan is to have a flat world with top-down view, though it could become a full 3D world if things go smoothly.
I think one of the biggest difficulties will be modelling the creatures (hoping to make the appearance reflect the abilities in some way). Another difficulty might be creating a world that can sustain itself (that the creatures don't die out). Also scaling the world may become an issue performance wise.
In the end there should be a link to the final build, repo and a 10-20 sec final result video.
Milestone 1 (03.03)
- Set-up Unity developing environment (1h).
- Create a plane with moving creatures on it (simple basic shapes initially) (3h)
- Give the creatures some ability to sense their surroundings (3h)
Setting up the environment went mostly smoothly and as planned.
Getting the creatures to move on a field not so much. Initially I just drew some random boxes and tried to get the camera to move around. At first I tried using keyboard input directly for x and z coordinates, but soon realized this is a dead end and went with mouse controlled FPS style observerver view.
After creating the world and some creatures I started animating them. At first I went with just adding some random x and z position adjustments to the creatures on update. But then I realized that it would make much more sense if the creatures would randomly turn and just move in the direction they are facing. After some vector to angle and vice versa conversion hassle, I had creatures that walk around randomly (in future milestones I might change the movement randomization to randomly pick a target where they want arrive at instead of picking a direction every update - this should make their movement less fidgety).
After getting the creatures to move, I started working on "vision". The way I implemented it, is by having a circle for the distance of vison and an angle from the front of the creature for having a direction for vision. The target detection is defined through layers at the moment, but this could change. Here is a creature detecting the target egg (the red line shows that it has been detected).
Here is a picture where another creature has two eggs in it's vision range, but only one in the angle, so the red line is drawn only to the one that is actually visible.
And here is another creature almost looking at the target, but still missing it due to narrow field of vision.
Milestone 2 (17.03)
- Add creature interaction - chasing or evasion behavior (2h)
- Add some basic metabolism (2h)
- Add creature spawning. Initially most likely just random spawning but will try to get to mating behavior in the next milestone (3h)
Added very basic creature interaction. It turned out to be much more of a hassle than I initially thought - one huge headache is all the vector math and another is the physics (the creatures go into crazy spins or fall through the floor etc). But currently we have 2 types of creatures: carnivores and herbivores. Herbivores don't do much - they just run away from carnivores if they see them. Carnivores on the other hand chase herbivores and attack them (eventually killing the poor creature).
Some of them are exhibiting naughty behavior :D
For metabolism, I added stamina and stamina regeneration. Movement takes stamina and resting gives it back. When creatures run out of stamina they go into rest mode until they have reached a stamina threshold or they have rested long enough. I guess health and dying also goes under metabolism in a way.
I also added two creature spawners (one for each type of creature) - they have a timer and they spawn a creature periodically into a random spot in the environment with randomized attributes.
As you can see, the spawners are doing a pretty good job
Milestone 3 (31.03)
- Enhance creature interaction - more diverse behavior (possibly including mating) (4h)
- Extend metabolism - add food sources for herbivores (2h)
- Look into how animation works (try something simple for attack animation) (1h)
This milestone didn't really go as well as I had expected. I managed to implement attack animations and plants for herbivores to eat, but struggled a lot with improved creature intelligence and still didn't manage to get to the mating behavior. However I managed to do quite a bit of bug fixing and smoothing out other things.
For herbivores I added some trees into the environment that drop fruits around them. The herbivores can "attack" them to eat if they find them. Trees also grow over time (and eventually they will also die of age when I get to it) and don't bear fruit until they are a certain size.
The animations are currently very simple - just moving and rotating some basic shapes.
For creature behavior, I added improved pathfinding logic, also turning isn't instant anymore. Creatures also stop to turn around when they are facing the wrong way.
I was hoping to add some memory to the creatures that they don't forget what they were doing when they lose sight for a second - it sort of works, but not well enough.
I also wanted to add intelligent direction selection in case of multiple dangerous creatures around but didn't manage to finish that either.
I added some raycasting to the spectator camera so it doesn't go through walls anymore - much better handling.
Overall I spent around 11 hours on this milestone.
Here is the world with trees and fruits:
And here is the build: Attach:milestone-3-build.zip
Milestone 4 (14.04)
- Add mating behavior (so two creatures will produce offspring that are a combination of their traits) (4h)
- Add a game menu (even if it is just "quit" and "restart") (2h)
- Add walking animation (1h)
- Fix camera not being able to rotate endlessly (1h)
Sadly I did not manage to find time to work on the project for milestone 4 :(
Milestone 5 (28.04)
- Add time controls (speed up and slow down) (4h)
- Add statistics displays about what sorts of creatures are currently alive - atleast predators compared to herbivores, but will also add mean attribute values (aggression, speed etc) if I have time (3h)
You can add development notes here, or remarks on the progress / result. Screenshots and videos are always good!