Life simulation written in rust

Overview

Life simulation written in Rust, inspired by this very old screensaver: https://sourceforge.net/projects/primlife/

Demo: https://joelthelion.github.io/life_web/demo/

Biots are allowed to evolve through mutation and natural selection. Biots have a simple genome giving them unique characteristics:

  • Green allows them to collect energy from the sun
  • Red allows them to eat other biots
  • Dark blue allows them to defend
  • Light blue allows them to move around

A special trait, intelligence (denoted by a square), allows them to move towards the nearest edible biot instead of randomly. All non-green traits cost energy.

You might also like...
A gravitation simulation with Barnes-Hut algorithm implementation.
A gravitation simulation with Barnes-Hut algorithm implementation.

Gravitation Particles A Barnes-Hut implementation of n-body gravitation simulation in Rust. Running the project The video rendering feature is impleme

A simple Rust and WebAssembly example implementing the Game of Life
A simple Rust and WebAssembly example implementing the Game of Life

rust-wasm-game-of-life rust-wasm-game-of-life is a simple Rust and WebAssembly example implementing the Game of Life based on Rust and WebAssembly boo

2-player game made with Rust and
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Conway's Game of Life implemented for Game Boy Advance in Rust

game-of-life An implementation of a Conway's Game of Life environment on GBA. The ultimate game should have two modes: Edit and Run mode which can be

A first-time implementation of Conway's Game of Life in Rust: Adventure and Commentary

A Commentary on Life This project documents the process and final result of my first-ever attempt at implementing Conway's Game of Life. I'll be using

This is an implementation of
This is an implementation of "Game of Life" by Horton Conway in Rust using raylib.

Game-of-Life This is an implementation of "Game of Life" by Horton Conway in Rust using raylib. What is Game of Life? The Game of Life, also known sim

Conway's Game of Life, visualised using Rust and WebAssembly

Game of Life, using Rust and WebAssembly Tutorial Built with 🦀 🕸 by The Rust and WebAssembly Working Group About Conway's Game of Life, which consis

A game of life🔬 simulator on an infinite♾️ plane
A game of life🔬 simulator on an infinite♾️ plane

game-of-life A game of life 🔬 simulator on an infinite ♾️ plane NOTE: This is a toy project! I did this just for fun, not as a packaged product. Abou

A simple implementation of Conway's Game of Life using Fully homomorphic Encryption

Game of life using Fully homomorphic encryption A simple implementation of Conway's Game of Life built using Zama's concrete-boolean library. Build Ju

Comments
  • significantly decrease size of resulting Wasm file

    significantly decrease size of resulting Wasm file

    Explanation about the flags:

    • opt-level = 3 is actually redundant and can be removed but I prefer to have it here to state the intent. Could also be "z" for smallest possible size.
    • lto = "fat" means that we want full link-time-optimization support.
    • codegen-units = 1 means that we only want one codegen unit instead of the default which usually is 16. The effect is slower compile times for release mode but also improved optimization potential.
    • panic = "abort" means that we do not want to have backtraces and exception-like behavior in our Wasm file which is not really bad since it is unsupported in Wasm atm anyways and just heavily bloats our Wasm file.

    Using the above configs drop the Wasm file size from ~2MB to ~500kB on my local system.

    Furthermore we could use a wasm-opt -O3 pass over after the initial cargo build --release command. On my system this further reduces the Wasm file size by roughly 10-15%. The downside is that wasm-opt creates a dependency on the Binaryen toolkit which might not exist on your platform.

    opened by Robbepop 2
  • fix bug and avoid biots interacting with themselves

    fix bug and avoid biots interacting with themselves

    I did this fix in my fork of your project and it works there: https://github.com/Robbepop/life_web/blob/main/src/biot_collection.rs#L47

    Additionally this gets rid of the workaround with the offset.

    opened by Robbepop 1
Owner
Joel Schaerer
Joel Schaerer
Game of life implementation written in Rust.

Game of life Game of life implementation written in Rust. Part of my journey in learning Rust. Pattern files The patterns are based on the example pat

Hashem Hashem 2 Nov 17, 2022
Conway's game of life written in Rust.

This is my implementation of Conway's game of life to get my hands dirty with Rust. Rules of the game: Any live cell with two or three live neighbors

null 0 Apr 9, 2022
Game Of Life using webgpu, written in Rust

Game of Life using webgpu ✨ Description This is the implementation of the tutorial Your first WebGPU app in Rust where we're using webgpu to implement

BADR 4 Aug 17, 2023
3d car simulation in rust

3d car simulation in rust This project is developed with intention to learn: programming on rust, computer graphics, physics simulation, geometric alg

Alexi Chepura 45 Dec 31, 2022
A velocity-based falling sand simulation built with Rust and Bevy

⏳ Bevy Falling Sand A velocity-based falling sand simulation built with Rust and Bevy! This simluation uses bevy_rapier to generate colliders that reg

Tomato 7 Oct 30, 2023
Rust boids simulation using Reynolds model running with Bevy engine.

example.mp4 About Rust boids simulation using Reynolds model running with Bevy engine. The following parameters can be updated while the simulation is

Daniel Di Dio Balsamo 7 Nov 15, 2023
A sci-fi battle simulation implemented in the bevy engine.

Bevy Combat It's a bevy port of my ECS Combat Unity demo. Check out the web demo in your browser. You can use the - and = keys to speed up and slow do

ElliotB256 47 Dec 22, 2022
Abstreet - Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit

A/B Street Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a project t

A/B Street 6.8k Jan 9, 2023
Wheeled vehicle simulation using Bevy engine with Rapier's joints

⚠️ Legacy branch! ⚠️ 'master' branch is currently broken due to migration to newer rapier and bevy_rapier so unless you want to compare old and new ve

null 29 Nov 14, 2022
A networked (p2p), cross-platform physics simulation example using rollback netcode

bevy_gaff (work in progress) bevy_gaff is an attempt at making a networked (p2p), cross-platform physics simulation using rollback netcode. It synchro

Johan Klokkhammer Helsing 13 Sep 5, 2023