Hacker News new | ask | show | jobs
by jiggawatts 620 days ago
There's more than one way to "implement a universe", but one hypothetical way to run a simulation is to alternate the simulation of forces and effects/causes.

A simulation could use particles with attributes like position, velocity, and also a "sum of forces". Then each update has the following steps:

1. Reset the sum of forces for all particles to zero.

2. For all particles, add the contribution to the forces on it from all other particles.

3. For all particles, update the next particle position based on the collected forces.

In the above, there's no intermediate state between updates, everything moves to the next position synchronously from the perspective of in-universe observers. (The external simulation can update particles one-at-a-time, but this is not an "observable" inside the simulation.)