Inspiration
This project was devised as being both a good hackathon contender and a challenge for ourselves. We had been inspired by procedural generation and genetic evolution on separate occasions before, but to combine them was an unknowable task.
What it does
This project uses genetic evolution to transform a grid of randomly colored tiles into a recognizable map, complete with land masses, water pools, and a proto-climate. This happens as a result of the map genetically evolving to become more “fit” for viewing over a user-recommended amount of generations. During each generation, a predetermined population of map tiles have their “DNA” AKA tile data recombined between themselves, where tile mutations have a chance of occurring. After all this is done, a fitness function evaluates the cohesion of properties like land and water tiles, and selects the best maps among the population to compete in the next generation. This repeats until no noticeable improvements happen within a few generations or a stopping point is reached. All of this genetic processing is GPU-accelerated, and every update is displayed to the user in real time, showing them how their map “evolves”.
How we built it
Using primarily Python, tkinter was used to provide a multi platform GUI to let the user control aspects of the genetic algorithm, like the map size and mutation rate. The user also gets to see the map evolve in real time, once they start the process. Graphical acceleration was possible thanks to some cleverly written fitness evaluations empowered by the numba module.
Challenges we ran into
Genetic evolution is an unconventional approach to map generation, which typically happens as a result of procedural generation (or recently, AI). As its name implies, genetic evolution is better for optimization problems like simulated life forms or pathfinding. As a result, manually evaluating the “fitness” of a map is exactly as strange as it sounds.
Accomplishments that we're proud of
We have managed to get the application working on a multi platform level and the patterns it creates are undoubtedly organic. Overcoming how to evaluate fitness of a map was largely trial and error, but it has managed to be done!
What we learned
We learned a variety of new Python modules, language features, and algorithm visualization techniques that will surely prove useful for future projects.
What's next for Geovolution
Next up is implementing a machine learning approach to control the enigmatic genetic fitness function. By the end of this hackathon this feature will either be complete or barely implemented.
Built With
- numba
- python
- tkinter
Log in or sign up for Devpost to join the conversation.