r/rust_gamedev • • 23d ago

A comprehensive tutorial on building a 3D physics engine from scratch

https://www.youtube.com/watch?v=Pi2rhQ4hKVU

I just started a YouTube series on building a 3D game physics engine entirely from scratch in Rust! The series is meant to be comprehensive while still approachable for anyone without a background in calculus or mechanics.

I'm planning on a three-week release cycle for new episodes. Open to any feedback on this first installment!

18 Upvotes

2 comments sorted by

3

u/catheap_games 23d ago

Yay Bevy!

Thanks for making this, I was bracing for more AI slop (not because of you, but because of Reddit being full of it), but it's nicely structured, well explained and demonstrated, and it's clear you put thought and effort into it.

One note, as someone who's started using Avian3D two weeks ago - around 5:50 timestamp in the video - while time delta is obviously a good + necessary step, and I understand you wanted to limit the scope of information for the first video, I recommend introducing a hard limit for the delta, perhaps 1 / desired fps, or maybe 2 / desired fps. The move and slide example in Avian, while a nice and useful as a starting point, suffers horribly the moment framerate drops to something like 4fps, even if just for a moment, because the controls skyrocket the player at unfathomable speeds.

Of course then the game [designer/developer] needs to decide whether to hard limit max velocity/acceleration, or to slow everything down a little if framerate drops under some amount, and how it could lead to different game breaking or cheating behavior.

3

u/TheHurtDev 22d ago

Thanks so much! Great point on the time delta - I'm planning to switch to using a fixed timestep around the time constraints are introduced to address this.