DylanCope / Evolving-Protozoa

An interactive environment where protozoa-like entities live, die, and have offspring whose behaviours and morphologies can change.
MIT License
231 stars 24 forks source link

Everything despawns given enough time #10

Open guyfunguy2 opened 1 year ago

guyfunguy2 commented 1 year ago

Overtime, plant life and protozoa disappear and the counter doesn't go down to let the plants reproduce. image

DylanCope commented 1 year ago

Thank you for reporting this - can you give a bit more info such as whether or not you have turned up the speed of the simulation? (this is a somewhat experimental feature rn)

And also could you provide a zip file of your save?

David-Hari commented 1 year ago

I've experienced this too.

In both of my save files so far, after running for around 100,000 time steps the number of protozoa drop to a small unvarying number (around 200 in my first save file, 400 in the second). Number of plants stays near the 7000 limit yet there does not seem to be that many on screen.

I'm using the default settings.

Here is my save file. I deleted some of the earlier .dat snapshots as it was taking up too much space. Hopefully they are not needed.

I'm on Windows 10, i9-12900K, GeForce RTX 3080, 64GB RAM. My Java version is as follows:

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
David-Hari commented 1 year ago

I just read on the main page that running faster can "lead to glitchy physics or cells that die fast". I was running at 10 times speed and with UI hidden, so it was running pretty fast.

I also notice in the master branch the option to run at 10 times speed has been commented out. I want to be able to run it as fast as my processor allows (when UI is hidden), and I noticed that CPU usage was lower when the speed was lower. Does running at only 5 times speed mean it's not doing as many instructions per second as 10 times (again, when UI is hidden)?

David-Hari commented 1 year ago

Even running at x5 speed it seems to slowly die. At around 1000 generations the numbers are down from what they first were.

David-Hari commented 1 year ago

There seems to be a discrepancy between the Tank.nProtozoa variable and the actual number of protozoa entities in the tank. Which suggests that Tank.handleDeadEntities isn't being called when some protozoa die.

DylanCope commented 1 year ago

Thank you for raising this issue. Unfortunately, I haven't really had the time to debug and patch this. If its possible, could you take a couple screenshots of the situation? One normal screenshot, then press F3 and take another screenshot, then press SHIFT+F3 and take a final one. That should trigger some debug rendering tools.

As for your questions from above - hiding the UI won't change the behaviour of the sim itself. It just removes the time spent rendering and maybe waiting to maintain FPS (if you have a good enough PC lol).

As for changing the time speed-up factor, this changes the delta value passed to the update(float delta) method, which controls how much to step the variables of the simulation. In general, the same number of computations should be done regardless of the value of delta. However, this isn't always the case. Somethings only happen and fixed intervals and fewer special events may happen to coincide within the same time buckets when delta is small. For these reasons I might expect a small decrease in CPU usage for low delta values, but its hard for me to say definitively how much difference this should make (if any).