This project is a physics-based simulation developed in Bevy, focused on the evolution of virtual creatures called "crabers". These crabers live in a 2D space and evolve over time through natural selection and genetic mutation.
Run it now in your browser: Here
- Have rust and cargo installed.
- Clone the repo.
Running locally:
- Run
cargo run --release
in the root directory.
Running in a browser:
- Run
rustup target install wasm32-unknown-unknown
to install the wasm target. - Run
cargo install wasm-server-runner
to install the wasm server runner. - Run
cargo run --target wasm32-unknown-unknown --release
to build the wasm build.
Building a WASM build:
- Run
cargo build --release --target wasm32-unknown-unknown
to build the wasm build. - Run
wasm-bindgen --out-dir ./out/ --target web ./target/
to generate the wasm bindings. - Copy the
index.html
to theout/
directory. - Run some kind of web server in the
out/
directory. I usepython3 -m http.server
.
- Evolution: Crabers evolve over time through natural selection and genetic mutation.
- Neural Brain: Crabers have a dynamic neural structure for their brains, evolving connections over generations.
- Genetic Traits: Each craber has DNA defining basic characteristics like color, size, and maturity factors.
- Physics-Based Movement: Crabers can move forward/backward and strafe left/right in a fluid medium with drag. They can also turn or steer.
- Sensory Inputs: Include relative speed, angle to nearest food, angle to nearest organism, genetic closeness, pheromone sense, current energy level, and health.
- Reproduction: Crabers reproduce asexually upon reaching maturity and having sufficient energy. Offspring may have mutations.
- Food Sources: Random blobs of "food" spawn in the environment.
- Pheromone System: An experimental feature for inter-craber communication and interaction.
- Horizontal Gene Transfer: Crabers can transfer genetic information to other crabers through a "gene transfer" action that might happen if both parties are willing and bump into each other [TBD].
- Basic movement and collision physics for crabers.
- Simple genetic system for craber traits.
- Initial implementation of the neural brain with predefined inputs and outputs
- Inputs:
- Relative speed
- Angle to nearest food
- Angle to nearest organism
- Genetic closeness
- Current energy level
- Health
- Outputs:
- Forward/backward acceleration
- Left/right acceleration
- Rotational acceleration (turning/steering)
- Inputs:
- Basic environment setup with food source spawning.
- Basic growing and maturity system for crabers.
- Simple reproduction mechanics without advanced features.
- Cleanup and do all code
TODO
s.
Nice to haves:
- WASM Build
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. TBD
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Bevy Engine: For providing the game engine.
- Contributors: Everyone who has contributed to the project.