Physics preloading is when PowderToy keeps simulating physics. But instead of showing the changes on screen, it keeps going, kinda like a buffer on a video. It does this while paused and unpaused You can set it in the settings It helps people with slow computers (or just slow gpus) play PowderToy simulations that have lots of parts Just try watching a Youtube video without buffering, it would stop every frame to get the next frame
That's my idea.
Also! If the user draws on the screen, the buffer is cleared and started again.
We'd need to save 14100480 (implying 60fps playback) bytes (=13770 KB = 13.44 MB) times the amount of full-pixel layers we have plus 3525120 bytes(= 3442 KB = 3.36 MB) times the amount of wall-pixel layers we have of data to the memory, per second. Compression can help though, but lossless compression isn't very effective. TLDR: 16MB/second RAM usage(implying no compression, heat, deco, pressure, tmp, tmp2, life, ctype or Newtonian)
you're doing it wrong, there are 235008 particles maximum, each is 18, so one frame is 4230144 bytes, totally, in 1Gb there can be 253 frames stored, 4 seconds
Incredibly simple to do, its technical terminology in programming is called 'Frame Skipping'. However, it would provide very little benefit to people as the majority of the time used to update the frame is the logic, not the draw time.
@boxmein(View Post) @mniip(View Post) You'd only have to store particles that actually exist and the differences between frames. (With a full frame every so often if you want to be able to seek)
@mniip(View Post) It would probably be more efficient and easier to just render to an off-screen buffer and play it back as video. Also, you could store the video at 30 FPS (dropping every other frame) to half memory usage