Giter VIP home page Giter VIP logo

slimesimulation's People

Contributors

neb0lle avatar

Watchers

 avatar

slimesimulation's Issues

Multiple species and Interaction

Add support for multiple species with interaction capabilities b/w them.

  • Add support for multiple species with different SpeciesSettings for each.
  • Needs converging and diverging interaction methods for different species.
  • Interaction based on SpeciesSettings.color.

FPS down bad

Issue

  • The FPS in the current setup is really low ~ (10 FPS/ 10000 Agents).
  • Even for smaller sample sizes its still low.

Causes

  • Most of the math is done on the cpu.
  • The whole simulation process is single-threaded.
  • DDTexture() produces a huge performance hit ie; RES * RES iterations.

Possible fixes

  • Use Compute shaders for agent and *pixels array member calculations. (recommended)
  • Optimizing DDTexture() by using a shader.
  • Faster math?

Pixel array not being freed

Problem

The *pixels array allocated in render.cpp never gets freed.

Using freeParray() produces a double free error.

Maybe the UnloadTexture frees the array bcz it loads texture using *pixels data. (Not sure)

Steps to reproduce

  1. Use freeParray() at the end of the main simulation loop.
  2. Close the simulation window.
  3. Leak?
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: TEXTURE: [ID 3] Texture loaded successfully (1000x1000 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 3] Unloaded texture data from VRAM (GPU)
slimesimulation(58977,0x10457c580) malloc: *** error for object 0x140008000: pointer being freed was not allocated
slimesimulation(58977,0x10457c580) malloc: *** set a breakpoint in malloc_error_break to debug

Expected behaviour

No memory leak or double free error.

Specifications

raylib version: 4.5.0
OS: macOS 12.6

Z axis for rendering

Add Z axis index in SpeciesSettings

  • Each species should be rendered on the screen based on Z index.
  • Z index needs to be added as a new member in SpeciesSettings.

Bounds detection issues

Add better bounds detection in Clamp().

  • The current clamp function has issues with agents being rendered out of bounds.
  • At the bounds the texture gets saturated and agents accumulate.
  • agent.angle recalculation using InvResolveAngle() is not accurate at bounds collision.
  • Add feature in Clamp() for random angle agent redirection at bounds collision.

Simulation gen with config file

Option to generate agents based on config file.

  • Agent generation on simulation start with parameters and gen-method.
  • Periodic agent generation based on intervals and other params.
  • Periodic agent decay (Not to be confused with decayRate in DDTexture).

Gpu artifact on startup

Problem

The texture produces an artifact right on initialization but not always.

Randomly comes and goes but never occurs when no agents are initialized.

Bug only exists on macOS. (only M1 tested)

The artifact may be generated from either the texture or pixelarray. (not sure)

Havnt tested on other x86 maybe issue wont persist there ig.

Steps to reproduce

Run the simulation a few times till u get the artifact.
bug

Specifications

raylib version: 4.5.0
OS: macOS 12.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.