Finally got time working and it lowkey cooked me.
Tuned the chunks first: fixed a bug where every chunk was seeding molecules from the world origin instead of its own bounding box center, so everything was spawning as one giant sphere. Classic. Also added a toroidal world so walking off one edge brings you back from the other.
Then I spent wayyyy too long on MACE. Got the full force evaluation pipeline working, then turned it on and organic molecules flew off to hundreds of thousands of Angstroms in one step. The timestep was just too large for C-H bonds.
I ended up replacing MACE with harmonic bond springs for now. 200 N/m between each bonded pair, 1 fs internal timestep, and the molecules actually vibrate correctly with ~0.14 Å bond fluctuations. Shape is fully preserved. MACE is still in the codebase but the harmonic model genuinely looks better for visualization anyway.
Also wired up the full MD UI: time toggle, temperature slider, speed slider (live, no restart needed), and an electron clouds toggle that swaps to stick bonds during dynamics. Sticks update in-place by writing vertex positions directly into the GeomNode so it doesn’t fry the frame rate.
I’m probably gonna ship this next devlog…
Log in to leave a comment
*