Skip to content

grig95/MagicEvolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic Evolution

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.

User Stories

The link to Trello can be found here : https://trello.com/b/Xt5yt4hK/magic-evolution Screenshot 2024-06-16 at 20 21 28

  1. I want to be able to set certain parameters of the simulation
  2. I want to be able to see the Wizbits' characteristics
  3. I want to be able to see interactions between Wizbits and the environment
  4. I want to see competition between Wizbits (spells)
  5. I want to see the Wizbits creating new generations
  6. I want to see some kind of stability in the Wizbit population
  7. I want to notice diversity in the environment
  8. I want the Wizbits' features to be evolvable
  9. I want the Wizbits' abilities to be evolvable
  10. I want to see general data about the simulation in real-time

Backlog

The tasks we planned were:

  1. Creating the Wizbit and defining an outline for its behaviours
  2. Creating a world with diverse types of environments
  3. Designing the AI that dictates the Wizbit's actions
  4. Having the Wizbit's abilities and characteristics, as well as its AI, be evolvable by creating genomes that can be mutated
  5. Creating a User Interface - a main menu as well as windows that display information about the simulation during the game

Diagrams

The UML Diagrams can be found here: https://github.com/grig95/MagicEvolution/tree/master/project_structure ai (4) drawio

dependinte drawio

Source Control

Comments

Those can be found in the scripts files, namely in the folders for:

Design Patterns

We've used a Factory Design Pattern to create the Genomes:

https://github.com/grig95/MagicEvolution/blob/master/scripts/GenomeFactory.cs

Unit testing

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: Screenshot 2024-06-16 at 20 00 49 image

Using AI

We used AI to help us do the Unit Testing, we asked ChatGPT:

gpt

And of course, for various other little things :)

Bugfixes

Wizbit Stats Menu

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:

image

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.

image

finalgit add commit: https://github.com/grig95/MagicEvolution/commit/27918cbf06108d1a8d52bc6f218a8bef84817895

Suicidal Wizbits

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.

image

Fixing commit: https://github.com/grig95/MagicEvolution/commit/2ea72ec5d1bfb5d33caf057711af872eadf9a125#diff-ea53cdbcbf91e3c4a5ac9c3cd9b72a61d206773fbe14b9720486607015c30fe6

Small bug, Huge Mana Sprites

After merging branches, we found some irregularities with the mana bottle size:

image

Compared to a wizbit:

image

So we played a bit with its scaling and size, and fixed it in our commit called Bug Fix(Mana).

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •