hunar4321/particle-life

Updating state is not really done "correctly"

Opened this issue ยท 5 comments

As all the rules modify state, later rules are influenced by the effects of earlier rules... if this should be a "correct" simulation, all forces had to be calculated first, then applied to to the state. But the simulation is much more interesting with this bug ;)

The modified Javascript file fixes that. I may modify the C++too but this might change the parameter settings to different numbers in order to reproduce similar patterns. For now, I'll leave it like that.

Yes, not even sure you can get the same results if you make the simulation "correct"

One other point to note is that the fx fy values are also iteratively updated, which means that if you were going to fully GPU parallelise the fx fy calculations, it wouldn't be possible in the current method as the earlier atom x, y positions are updated. If you fully calculate the fx fy values in parallel before applying any values to any given atom x y, it just doesn't look very good. I experimented with this using gpu.js and whilst it works (using matrices rather than objects), nothing looks anything as interesting as when the updates are applied progressively.

You can, of course, apply parallelism to each individual atom, but there is no real performance benefit, in fact it is worse than using the basic matrices.

Great minds thing alike.
A 3D version was also implemented here.
The VR experience really makes a difference

Great minds thing alike. A 3D version was also implemented here. The VR experience really makes a difference

I don't have VR but I imagine interacting with the particles with attraction/repulsion gestures can be so fun