Skip to content

Rurek404/Darwin_World

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

162 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Version Build Tool Course

🌍 Darwin World - Evolutionary Simulation

Darwin World is a Java desktop application that simulates an evolving ecosystem based on Charles Darwin's theory of natural selection.

Developed as a part of the Object-Oriented Programming Course at AGH University of Krakow.

✨ Key Capabilities

  • 🛠️ Customize: Configure various parameters related to the map, animals and simulation settings.
  • 👁️ Observe: Monitor the living ecosystem and its dynamics in real time.
  • 📊 Analyze: Export population statistics to CSV for analysis.

The sample of map view
Sample of the map view in the Basic Variant.


📖 Project Overview

🗺️ The World

  • The world of our game is simple. It consists of a regular, rectangular area divided into square fields.
  • Most of the world is covered by steppes, on which there are few plants that animals eat.
  • Some areas are treated as jungles, where plants grow much faster. The jungle is located in the middle of the map.
  • In the default variant, the map behaves like a globe - crossing the left or right edge wraps the animal around to the opposite side, while reaching the north or south pole causes it to bounce back and reverse its movement direction.

🐾 Animals

  • The animals are herbivores, travelling in search of survival and a partner to reproduce.
  • Each animal has a certain amount of energy, which decreases each day.
  • Finding and eating a plant increases the energy level by a certain amount. If an animal's energy drops below (or equal to) zero - it dies.
  • Every animal's movement is driven by a unique sequence of genes acting as its internal 8-way compass. During the simulation, the animals are facing the current direction.
  • Animals can only breed if they have gathered sufficient energy, which is sacrificed to be given to their newborn.
  • The child has its own unique mix of genes, partly inherited from both parents.

🧬 Simulation Dynamics

Daily changes to the world include:

  1. removing dead animals from the map,
  2. turning and moving each animal,
  3. consuming plants,
  4. breeding of animals capable of reproducing located in the same field,
  5. growing new plants.

The simulation illustrates how the population adapts and changes over time, allowing the user to track behavioral patterns depending on the state of the ecosystem.

👑 Special Variant: The Habsburg Curse

This advanced game mode introduces biological sex and the severe evolutionary consequences of inbreeding to the ecosystem.

  • In the configuration, the user should determine the percentage of energy loss depending on the relationship.

Habsburg variant view
The Habsburg variant active - animals are differentiated by their biological sex.


🚀 Features

⚙️ Configuration

The simulation is highly customizable. The user can set a lot of parameters or use ready-made configurations.

Configuration view
The configuration panel allowing deep customization of the ecosystem.

As a user, you can choose:

  • the height and width of the map,
  • starting count of grass (and energy from it) and animals,
  • daily grass growth and energy cost,
  • starting animal energy, minimum amount of energy to breed, breeding cost,
  • length of animal genome and minimum/maximum number of genome mutations,
  • (in Habsburg Variant) penalty for incest - percentage of energy loss.

🖥️ Visualization & UI Features

  • 🔍 Map Scaling: The map automatically adjusts to the chosen size. On very large maps, animal pictures are replaced by simple geometric shapes to keep the simulation running smoothly.
  • 📈 Live Monitoring: A live chart updates during the simulation. You can choose which statistics to track. Animals have energy bars under them, and animals with the dominant genotype have the crown to highlight them. In the Habsburg variant, animals have different colors depending on their sex.
  • 🎯 Animal Tracking: When you pause the simulation, you can click on any animal to check its details.
  • 📁 Saving and Exporting: You can save and load your simulation settings. The application can save the daily statistics to a CSV file if this option is selected in the start window.
    • The exported file contains the following information for each day:
      • number of animals living on the map,
      • number of plants,
      • number of free fields on the map,
      • average energy level,
      • average lifespan,
      • average number of children.

🎥 Project Showcase

simulation.mp4

A brief demonstration of the evolving ecosystem and live statistics in action.

💻 Usage

🛠️ Technical Requirements

  • To run the application on your computer, you should have Java 25 installed.
  • You can install it from Oracle

▶️ Running

To build and run the application locally using Gradle, execute the following commands in your terminal:

  1. Clone the repository:
git clone https://github.com/Rurek404/Darwin_World.git
  1. Navigate into the project directory:
cd Darwin_World/ooproject
  1. Run the application:
    • On macOS/Linux:
    ./gradlew run 
    • On Windows (CMD/PowerShell)
    gradlew.bat run

👥 Authors

  • Jan Ślosarczyk   GitHub
  • Patrycja Piasecka   GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages