LINK DEMO: https://youtu.be/zK_ddzEXcII
A game written using C# in Godot that creates a simulation that can be observed, but not modified, of a world inhabited by Wizbits - small magic creatures that are supposed to evolve by reproducing themselves.
The purpose is to observe their evolution accross multiple generations, how the Wizbits that are better adapted to their surroundings survive for longer and reproduce more, leading to better offspring.
The Wizbits can move freely around, need to consume Mana pellets to sustain themselves, reproduce, and attack each other using spells.
Their behaviour is dictated by an AI - a neural network created uniquely for each Wizbit, which can also evolve when new generations are created.
The link to Trello can be found here : https://trello.com/b/Xt5yt4hK/magic-evolution
- I want to be able to set certain parameters of the simulation
- I want to be able to see the Wizbits' characteristics
- I want to be able to see interactions between Wizbits and the environment
- I want to see competition between Wizbits (spells)
- I want to see the Wizbits creating new generations
- I want to see some kind of stability in the Wizbit population
- I want to notice diversity in the environment
- I want the Wizbits' features to be evolvable
- I want the Wizbits' abilities to be evolvable
- I want to see general data about the simulation in real-time
The tasks we planned were:
- Creating the Wizbit and defining an outline for its behaviours
- Creating a world with diverse types of environments
- Designing the AI that dictates the Wizbit's actions
- Having the Wizbit's abilities and characteristics, as well as its AI, be evolvable by creating genomes that can be mutated
- Creating a User Interface - a main menu as well as windows that display information about the simulation during the game
The UML Diagrams can be found here: https://github.com/grig95/MagicEvolution/tree/master/project_structure
- Branches: https://github.com/grig95/MagicEvolution/branches
- Commits: https://github.com/grig95/MagicEvolution/commits/master/
- Merge(s) :
- Pull requests: https://github.com/grig95/MagicEvolution/pulls?q=is%3Apr+is%3Aclosed
Those can be found in the scripts files, namely in the folders for:
- Wizbit (https://github.com/grig95/MagicEvolution/blob/WizbittAdaptation/scripts/Wizbit/Wizbit.cs)
- NeuralNetwork ((https://github.com/grig95/MagicEvolution/tree/WizbittAdaptation/scripts/AI/NeuralNetwork))
- WorldGenerator (https://github.com/grig95/MagicEvolution/blob/master/scripts/WorldGeneration/WorldGenerator.cs)
We've used a Factory Design Pattern to create the Genomes:
https://github.com/grig95/MagicEvolution/blob/master/scripts/GenomeFactory.cs
We've used the NUnit Framework to do the Automated Testing, the code can be found in this folder:
And the test output here:
Here are the outputs as well to visualise easier:
We used AI to help us do the Unit Testing, we asked ChatGPT:
-
how to set up the framework for testing in Godot C#, and the result can be found here:
https://github.com/grig95/MagicEvolution/blob/WizbittAdaptation/message.txt
-
how to set up a TestRunner class for running tests in Godot:
And of course, for various other little things :)
In our project, we have a menu for wizbit stats that prompts up whenever we press a wizbit. Sounds good, right? Except when the window just appears, isn't updated and can't be closed, like here:
Issue: Wrong approach for the menu design.
Solution: Decided instead of having a hidden menu always present that we update with the right data, we shall have one that can be closed and is instantiated whenever we click a wizbit with his data.
finalgit add commit: https://github.com/grig95/MagicEvolution/commit/27918cbf06108d1a8d52bc6f218a8bef84817895
Wizbit use raycasting for vision and aiming spells. Sounds good enough, right? Right, until they start targeting their most powerful enemy - themselves.
We found this out when we saw that some wizbits, instead of being killed by other wizbits, simply die from a spell. In this screenshot, we can see the difference between a wizbit killed by a someone else's spell and killed by its own spell - as he is not attacked.
After merging branches, we found some irregularities with the mana bottle size:
Compared to a wizbit:
So we played a bit with its scaling and size, and fixed it in our commit called Bug Fix(Mana).