Research Project
This was my final year research project for this project I wanted to look deeper into machine learning. I decided the aspect I wanted to look more into was genetic algorithms. I wanted to use a genetic algorithm, to control not just an individual but a group of NPC to achieve a goal and to be able to adapt to problems that occur.
I started by creating an area for the NPCs to live in so they could wander around as a person would. This was done by using a previous AI wander movement algorithm I worked on. Once that was done I gave each slime a genome sequence which was made of four strings which created its DNA.
Once I had my genome I need the slime to have a life, so I added a timer which would slowly age the NPCs using a world clock. When the NPC reaches a certain age they will have a chance to die, each time they age from that point they will roll a die to see if they die or not.
Now that we have an NPC that dies, we need them to be able to reproduce so they do not go extinct. When an NPC reaches a certain age it will be able to reproduce, It will look within a range of itself and seek out a mate. Once it finds a mate it will determine if it’s suitable to reproduce with, if so it creates an offspring if not it attempts to find another mate. The offspring will get the DNA of its parent 1 and parent 2 by a method you predetermined.
Now that I have an NPC population reproducing and dying. I created graphs to track the stats of the overall population per year. On the side of the screen is all of the setting / Information used in the run.
To add a more dynamic feel, I added the ability to trigger a random event. These events would affect the NPC based on its aptitude for a certain statistic. E.g high speed with a speed event will result in a higher chance of death.
I also add the ability to set an endpoint so you can run the program and once it finishes, it will log the results and settings.
I used C++ and SFML for this project.






