51 Commits

Author SHA1 Message Date
Aryadev Chavali
3b02b934d8 some cleanup and changes 2026-03-20 03:14:02 +00:00
Aryadev Chavali
d338fabddc base: set mutation chance to simulation size
This results in the expected value of the number of mutations at any
one iteration to be 1, which is good.
2026-03-20 03:13:09 +00:00
Aryadev Chavali
ed60314841 README fixup 2026-03-18 19:39:59 +00:00
Aryadev Chavali
566cd7d792 complife.org: added notes 2026-03-18 18:00:18 +00:00
Aryadev Chavali
dd085bb835 simulation: move around implementations for reading ability 2026-03-18 17:41:26 +00:00
Aryadev Chavali
6599bca3bf simulation: extract pair picking strategies into their own functions 2026-03-18 17:34:52 +00:00
Aryadev Chavali
f0d4657071 main: add single_tick to iterate through steps in rough lockstep
Obviously we're not using a hard measure to stop threads in exactly
one step or anything.
2026-03-18 17:31:11 +00:00
Aryadev Chavali
e5640d19f2 simulation: adjust colours 2026-03-18 17:31:08 +00:00
Aryadev Chavali
5679a80c3f simulation: neighbour based iteration strategy
Instead of randomly picking two cells, randomly pick the first then
choose a neighbour.  Changes are more local and thus we should see
clearer fluid movement instead of the chaos from before.
2026-03-18 17:29:09 +00:00
Aryadev Chavali
f784cf13e6 simulation: make mutation completely change cell
Instead of just offsetting the cell, just completely generate a new
one.  Way more fresh cells that way.
2026-03-18 17:28:56 +00:00
Aryadev Chavali
ded310ed35 main: some bug fixes for UI control 2026-03-18 14:52:02 +00:00
Aryadev Chavali
723c2ffc8a simulation: only draw grid outline if DRAW_PROGRAM_OUTLINE is 1 2026-03-18 14:51:49 +00:00
Aryadev Chavali
c9b820b5a8 main: 2D camera (with zoom) and program printer on mouse click 2026-03-18 14:10:46 +00:00
Aryadev Chavali
ac470ca080 simulation: extract constants out to base.h from simulation_draw 2026-03-18 14:10:34 +00:00
Aryadev Chavali
59befd5a16 base: adjust recommended constants 2026-03-18 10:52:52 +00:00
Aryadev Chavali
59945a1237 draw grid lines for programs in dark gray 2026-03-18 10:50:03 +00:00
Aryadev Chavali
4ed1def5b8 vendor in Raylib 5.5 directly 2026-03-18 10:47:49 +00:00
Aryadev Chavali
6461e2f544 simulation: make a_b_concat a static 2026-03-18 10:47:20 +00:00
Aryadev Chavali
a69b14bf4d main: threads sleep if paused 2026-03-18 10:47:11 +00:00
Aryadev Chavali
b68f9b2e6e simulation: draw cells Left-Right rather than Down-Up 2026-03-18 10:46:21 +00:00
Aryadev Chavali
a2978d01e7 update for recommended logs 2026-03-18 10:19:12 +00:00
Aryadev Chavali
bd2d51b57c main: parallelise mutation and iteration
Construct threads which mutate and iterate the simulation.  This makes
them not dependent on the Target FPS of the main thread.
2026-03-18 09:53:44 +00:00
Aryadev Chavali
deec79a3bf simulation: separate out mutation into its own function 2026-03-18 09:53:27 +00:00
Aryadev Chavali
41c4a39e05 Set mutation chance super low and check for end case in mutation 2026-03-18 09:36:35 +00:00
Aryadev Chavali
07a47952c3 main: true primordial soup 2026-03-18 09:33:58 +00:00
Aryadev Chavali
7ab65da761 simulation: add mutation (disabled) and fix bf interpreter
So I was using safe subtraction to fix the heads at 0, but BF itself
wraps heads around the tape if they overflow/underflow.  This
completely changes the presentation of the simulation.
2026-03-18 09:33:03 +00:00
Aryadev Chavali
eebe39c241 simulation done 2026-03-18 01:02:07 +00:00
Aryadev Chavali
23add2c55f added simulation file for actually performing sim 2026-03-17 23:22:18 +00:00
Aryadev Chavali
5110ce8c42 bf: move SIZEOF_PROGRAM to base.h 2026-03-17 21:33:07 +00:00
Aryadev Chavali
39e8b37f5b update complife.org 2026-03-17 21:32:59 +00:00
Aryadev Chavali
75d45ee79a build.sh: adjust for new bf interpreter 2026-03-17 21:32:59 +00:00
Aryadev Chavali
4ba7d3c554 bf: added notes regarding '{' and '<'. 2026-03-17 21:32:59 +00:00
Aryadev Chavali
071fe2ff98 bf: extract loop_end to its own function 2026-03-17 21:32:59 +00:00
Aryadev Chavali
c6433b4429 bf: cond_stack -> loop_stack 2026-03-17 21:25:49 +00:00
Aryadev Chavali
146921bdef main: adjustments 2026-03-17 21:22:26 +00:00
Aryadev Chavali
99134c3a32 program_iter -> bf, simulation to be redone 2026-03-16 14:45:30 +00:00
Aryadev Chavali
2e78cf5e45 vec: vec_pop and vec_data 2026-03-16 14:45:23 +00:00
Aryadev Chavali
c29e70b1da complife.org: added todo 2026-03-11 00:10:42 +00:00
Aryadev Chavali
0bba1894dc neighbour based algorithm for threads
It does seem to affect since sim falls into a "stable" configuration
where cells rarely change quite quickly.  I'm thinking of making a
better colouring algorithm to see if I can get better images.
2026-03-10 22:50:38 +00:00
Aryadev Chavali
0e1229569a simulation: added TODO regarding choosing neighbours for p2 2026-03-10 22:21:43 +00:00
Aryadev Chavali
fabd593eff main: threaded simulation
The actual computation is embarrassingly parallelised - the only part
that requires a mutex is the picking of any two programs due to the
fact that both programs may be affected following a compute block.
This is why we do a uniqueness check in thread_pick.
2026-03-10 22:19:34 +00:00
Aryadev Chavali
30f8e65cc2 main: added pause (KEY_SPACE) and "inspect this cell" (MOUSE_BUTTON_LEFT) 2026-03-10 21:37:00 +00:00
Aryadev Chavali
6039ab720f simulation split out from main 2026-03-10 21:20:25 +00:00
Aryadev Chavali
2b8a3cbda2 main: split off program iteration to its own unit 2026-03-10 21:12:10 +00:00
Aryadev Chavali
07d9de99d7 move to src folder 2026-03-10 21:09:10 +00:00
Aryadev Chavali
24f4962d8c extracted prick into their own header files and deleted lib 2026-03-10 21:08:24 +00:00
Aryadev Chavali
f811665ae9 Basic computational life as a single file done! 2026-03-10 21:03:19 +00:00
Aryadev Chavali
87e84587d8 simulated life paper 2026-03-10 21:03:13 +00:00
Aryadev Chavali
9781384d30 added some prick libraries for useful data structures 2026-03-09 07:19:47 +00:00
Aryadev Chavali
c26e462429 basic raylib boilerplate 2026-03-09 07:19:01 +00:00