Skip to content

A nice small boids simulator that supports many realtime-tunable parameters for a school project

Notifications You must be signed in to change notification settings

lrshsl/BoidsSimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boids Simulator in Nim

Table of Contents

Docs

Docs are available at docs/.

Getting started

Binaries / Executables

Some binaries may be available in the releases. Use at own risk.

Build from source

What needs to be installed:

  • Git
  • Nim version 1.6 or higher (primarily developed for 2.0) (nim and nimble need to be available and in the path)
    • Recommended to be installed through choosenim, but also in the package repos of many distros
  • nimraylib_now
    • It's a nim package that includes raylib and nim bindings
    • Can easily be installed through nimble install nimraylib_now)

Linux or Mac (probably also works for BSD)

Download the source code:

git clone https://github.com/lrshsl/BoidsSimulator --branch hand_in_release
cd BoidsSimulator

Run using nimble:

nimble run

.. and hope it works!

The window shouldn't be resized while running. If different window dimensions are needed, the desired dimensions can be passed as arguments to the program.

nimble run -- 1000 800

Opimization options can be passed: -d:release for an optimized build or -d:danger for turning off even more checks to maximize performance (must be passed before the --)

nimble run -d:release -- 1000 800
Troubleshooting

Due to dynamic links in the raylib source code, it may be necessary to get some C x11 headers on your system.

Apt based distros (Debian, Ubuntu and distros based on those):

sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev

Pacman (Arch linux):

sudo pacman -S alsa-lib mesa libx11 libxrandr libxi libxcursor libxinerama

Else consult the raylib docs.

Windows

  1. Get an empty usb-stick
  2. Flash it with a linux distro
  3. Boot from it
  4. Install Linux
  5. See chapter Linux ;)

Features

  • Basic boids simulation
  • Tunable parameters
    • Somehow tunable
      • Window dimensions
      • Colors
      • Settings
        • Starting values
        • Presets of parameter values
      • Size of entities
    • UI with instant reloading
      • Cohesion, align and separation factors
      • Number of entities
      • View radius
      • Speed (max and min)
      • Separation from the edges
      • Ui behaviour
  • Fancy colors
  • Optimizations

Current developement focus:

  • Documentation
  • Automatic screen size adaption
  • Refactor code (comments and architecure)

About

A nice small boids simulator that supports many realtime-tunable parameters for a school project

Resources

Stars

Watchers

Forks

Languages