Kevin Song
I'm a student at UT (that's the one in Austin) who studies things.
Previously, all our simulations were physical in nature, i.e. we were trying to capture some essence of physics.
However, we can also simulate things which don't directly involve physics.
These are "rules-based" simulations.
For example, many games can be simulated using rules-based simulations.
Stockfish (white) vs GPT-3.5 (black) in the most hilarious game of all time.
<condition>
is true about neighboring cells, then do <X>
.By JohnnyNyquist - File:Ca110-interaction.png, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=18642205
Cells are in a row. Each cell has two neighbors. The cell's state in the next timestep depends on its current state and its neighbor's states.
We can stack changes in various frames to form 2D images:
Even one-dimensional cellular automata have universal computing power!
The automata shown is known as "Rule 110". It has been proven that anything that is computable on a "real" computer can also be computed using Rule 110.
By JohnnyNyquist - File:Ca110-interaction.png, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=18642205
John Conway, 1937-2020
At each step:
# Neighbors | Action |
---|---|
0-1 | Die (or stay dead) |
2 | Maintain Current |
3 | Respawn (or stay alive) |
more than 3 | Die (or stay dead) |
there are other squares out here but they don't matter for these examples
....
....
....
....
# Neighbors | Action |
---|---|
0-1 | Die (or stay dead) |
2 | Maintain Current |
3 | Respawn (or stay alive) |
more than 3 | Die (or stay dead) |
# Neighbors | Action |
---|---|
0-1 | Die (or stay dead) |
2 | Maintain Current |
3 | Respawn (or stay alive) |
more than 3 | Die (or stay dead) |
How many values do we have to look at to determine the state of each cell in the next timestep?
Where are these values located in the grid?
grid[i, j] = conway_rules(grid, i, j)
Agent-based systems have autonomous agents which sense their environment and act on it. Agents have:
Even without global structure or understanding, complex behaviors can emerge!
Agents are ants on a grid.
At every step, an ant follows these rules:
Also a universal computer (of course...)
From Wolfram MathWorld
Assume ant direction maps to one of the directions/ ints SOUTH (0), EAST (1), NORTH (2), and WEST (3).
What does this code do to the ant?
direction = (direction-1) % 4;
Oftentimes, small flying or swimming animals (birds, insects, fish) will form groups which seem to develop their own movement rules.
However, it is extremely unlikely that all the members are receiving telepathic commands from a leader.
A gridless agent-based simulation of flocking which assumes that every member of the flock tries to meet three rules:
Note: video is from 15 years ago, so quality is a little low
https://github.com/mravelo5874/neural-cellular-automata
CA rules are learned, not prescribed, but this is otherwise just a CA in 3D (voxel) space.
Implement a simple version of one of the following:
To help with drawing the grid, you may want to look at drawGrid.pde on Canvas.
Images from https://en.wikipedia.org/wiki/Three-body_problem
small dt
time
large dt
Computation for physics
Target draw time
Pretty much every modern game engine will have some sort of physics simulation code in it.
Yep. Finding out which ones work and which ones don't is a complicated dance of mathematics, computer science, and just trying stuff out to see what works and what doesn't.
Tons of work and engineering. Surprisingly, you don't need that many points to make a good cloth, but you need lots of springs.
General rule for physical simulation: think of some constraint/relation you want your system to satisfy, then use that to write your physics.
What would be a good rule to apply in this case?
By Kevin Song
I'm a student at UT (that's the one in Austin) who studies things.