Erin Catto
@erincatto.bsky.social
630 followers 190 following 37 posts
I created Box2D. I enjoy all kinds of programming, but specialize in physics and animation. I work in Unreal for my day job (like everyone else). C/C++ and whatever Claude spits out for me. https://box2d.org/
Posts Media Videos Starter Packs
erincatto.bsky.social
You can have AI walking, running, sitting, climbing, etc. They can do anything out of view.
erincatto.bsky.social
Pre-rolling is good for character screens in the UI. For in game cloth this could lead to frame spikes, so my favorite solution is to simulate cloth at a lower rate off-screen.
erincatto.bsky.social
When your graphics programmer tells you to stop simulating off-screen cloth, show them this video.
erincatto.bsky.social
We use this in our CI. We have some tests that run our game and test various game play systems. Catches a lot of bugs before code gets merged.
erincatto.bsky.social
Very cool! Have you considered using voxels? Lots of procedural generation options with those.
Reposted by Erin Catto
werecoder.gamedev.blue
I'm an #IndieDev building a custom engine for my medieval fantasy survival game.

Some things I've done so far:
Simulation with client / server networking
Basic DX12 renderer
Asset pipeline
Character movement and animation
#ProcGen world creation
Basic UI
Basic Audio
Basic Health / Combat
erincatto.bsky.social
Box2D version 3 has a new API written in C to make it easier to wrap. For the revision I also decided to write the internals in C to see if I liked it. It worked out well.
erincatto.bsky.social
A couple barriers to C development are lack of a fast sorting library and a fast hash set and map. I've found these two libraries to be excellent at providing those. They are macro based, but I think the trade-off is worth it. Both work with C99.
github.com/svpv/qsort
github.com/JacksonAllan...
erincatto.bsky.social
Pinched wrists on ragdolls are caused by twist bone poses living in the animation data. Twist bones are procedural and computed based on the pose of animated bones, so they should computed as a post process at runtime to fix this. See www.youtube.com/watch?v=Jkv0... by @bobbyanguelov.bsky.social
erincatto.bsky.social
Silksong is using Unity? So using Box2D?
erincatto.bsky.social
I love physics based walking simulations. I'm also pleased the author was successful using Box2D (v3.1?) www.youtube.com/watch?v=aBp-...
AI Cat Learning to Run
YouTube video by Pezzza's Work
www.youtube.com
erincatto.bsky.social
I revoked your ban. Please make sure your discord account is secure.
erincatto.bsky.social
I tried this many years ago. I didn't like it. Lots of wasteful code subtracting the origin to make stuff work.
Want:
point = 0.5 * point1 + 0.5 * point2
Have:
point = 0.5 * (point1 - zero) + 0.5 * (point2 - zero) + zero
erincatto.bsky.social
Casey presents some optimizations that seem intuitive and they work correctly for determining separation. However, when computing distance and closest points there are some cases which should not be skipped.
erincatto.bsky.social
This video is great for teaching the basics of GJK. However, the approach is flawed for computing distance and only works for determining separation true/false. Unfortunately the author has disabled comments and people keep using this and ending up with broken code. www.youtube.com/watch?v=Qupq...
Implementing GJK - 2006
YouTube video by Casey Muratori
www.youtube.com
erincatto.bsky.social
Conventional wisdom is that you need a complex and expensive direct solver to handle high mass ratios and long chains.

Box2D has an iterative SoftStep solver that uses sub-stepping and soft constraints to handle high mass ratios and long chains.
erincatto.bsky.social
Also recommend this for hot reloading code in VS. It works quit well these days and great for UI work.

add_compile_options("$<$<CONFIG:Debug>:/ZI>")
add_link_options("$<$<CONFIG:Debug>:/INCREMENTAL>")
erincatto.bsky.social
tip: if you work with the generated sln you can edit the cmake files in the sln and hit f5/f7 and it will regenerate the solution in place
erincatto.bsky.social
I use this to avoid bringing in stuff for samples if someone is just using my library.
`if(PROJECT_IS_TOP_LEVEL)`
erincatto.bsky.social
The nice thing about FetchContent is users can pin to a specific version of a library easily using a tag or git commit hash.
erincatto.bsky.social
I recommend cmake these days. I don't like it either but it gets the job done and I can point users at all the cmake info out there. I made an example app with raylib and box2d using FetchContent. github.com/erincatto/bo...
GitHub - erincatto/box2d-raylib: Shows how to integrate Box2D with raylib
Shows how to integrate Box2D with raylib. Contribute to erincatto/box2d-raylib development by creating an account on GitHub.
github.com
erincatto.bsky.social
Nice! Do you have large island threading?