Coding a Physics Engine from scratch!
Video Overview & Insights
but man, rigid bodies got hands
Here's the obstacle course, playable in your browser (please use Chrome - Firefox is rather choppy): https://zanzlanz.com/g/Skater_Without_a_Crown
Is sub-30 seconds possible? I'm serious, I think it is! I'll repost whoever sends me the WR video on Bluesky after 1 week :D Good luck! Edit: https://bsky.app/profile/zanzlanz.com/post/3m5rhmo5rrc26
If you like what you see, become a Patron! It includes the Haxe source code for "Skater Without a Crown", music from this video, and much more: https://patreon.com/zanzlanz
Really into it? Want the Haxe source code? Join my Patreon! https://patreon.com/zanzlanz
Obstacle course:
Now do it with AVX512 acceleration!
- Play in browser (Use Chrome, please): https://zanzlanz.com/g/Skater_Without_a_Crown
HUGE thanks to @crypticsea for inspiring this video! Please follow his development on YouTube and Bluesky: https://bsky.app/profile/crypticsea.bsky.social
Is it open source?
My other work mentioned:
- "The PowerPoint video": https://www.youtube.com/watch?v=SmYDGnwg4dA
thought he was giving us a tutorial for making physics in scratch
- Infinite Bounce: https://zanzlanz.com/g/Infinite_Bounce
- Differential growth: https://zanzlanz.com/doodles?q=%23differential-growth
psychopath coder
Games mentioned or shown:
- Skate or Don't!: https://store.steampowered.com/app/1828310/Skate_or_Dont/
853
- World of Goo 2: https://store.steampowered.com/app/3385670/World_of_Goo_2/
- Unravel: https://store.steampowered.com/app/1225560/Unravel/
what coding language is this?
- The Floor is Jelly: https://store.steampowered.com/app/295750/The_Floor_is_Jelly/
- Line Rider: https://www.linerider.com/
Dot product: I'm tired boss😭
- Gish (By Cryptic Sea): https://store.steampowered.com/app/9500/Gish/
@anukarimusic is so cool!! I'm so sorry for mispronouncing it in the video AAAH
You kind of sound like Jim Parsons with a deeper voice, lol. (For anyone who doesn't know he voice acted Oh from Home and Sheldon in The Big Bang Theory.)
All music is my own, many "Works In Progress" for this monthly series:
- At 0:00 and 7:53 - WIP made specifically for this video! Download available to patrons.
How to make the episode 7 without reaction diffusion?
- At 1:06 - WIP made for https://youtu.be/aGFYa4TrcA8 Download available to patrons.
- At 2:13 - "Mirror Road": https://youtu.be/CJK30mzQ0-w
I love this video. it tells you how it works, not how to do it. you can just watch the video and do it yourself instead of copying lines of code.
- At 4:40 - WIP made for https://youtu.be/SmYDGnwg4dA Download available to patrons.
- Outro and at 5:39 - WIP made for this series! Starting with https://youtu.be/Z9xFWjdg2IY Download available to patrons.
why not just a = (a_old - 0.08) * 0.98
- At 7:04 - "A Feeling of Tread": https://youtu.be/s-FCmczv9tA
- At 8:58 - WIP made for unrelated series: https://youtu.be/fnR7djDnkyo
video like this remind me how fucking stupid and useless i am. thanks.
- At 10:19 - Instrumental version of "Where Did the Time Go": https://www.newgrounds.com/audio/listen/1213016
Chapters:
I know absolutely nothing about coding but am currently learning. My initial reaction to seeing how difficult it is to not have convex shapes clip through other rigid bodies is baffled as to how simple it seems (because of my ignorance lol)
I’m my mind I’m like why can’t there be a kind of collision detection for the end of the segment? It seems like dot products are excellent but for that specific problem it might not be?
The only thing hitting my brain is wouldn’t it be possible to have or add a collision point at each corner somehow? And if the other shapes detect that convex point (with dot products) have it do what it’s supposed to? (Again I’m being reductive but trying to understand lol)
I still know absolutely nothing about coding but I love learning about this stuff. If someone could explain to me how it’s difficult af I’d love to hear about it!
- 00:00 Intro
- 00:31 Level 1: Bouncing ball
why does he sound like kinger from tadc
- 02:12 Level 2: Angled walls
- 04:35 Level 3: Corners
You sound familiar...
do you know who doodley3d is?
- 05:37 Level 4: Colliding circles
- 07:01 Level 5: Ropes
Just adding more to this cross product, the value of one arrow don't need to be one , u can take two arrows take the angle between them and do ,a b cos(∅), u can imagine it as a shadow of 'a' on 'b'( assuming the sun is above b) and multiplying the length of the shadow with the length of b. U can do the same with a , both of them gives same value
- 08:07 Level 6: Soft bodies
- 08:35 Level 7: Differential growth
As a person preparing for engineering competetive this guy did more dot product than me 😭
- 08:57 Level 8: Rigid bodies
- 10:18 Level 9: Skate or Don't
I LOVE MINEBLOCKS SO WHEN WILL MINEBLOCKS 2 COME OUT?
- 11:24 Finale
#gamedev #gamedevelopment #programming
Amazing content! I am a long time programmer, but my math skills are poor. This is so inspiring. I hope I'll try some of it, then I continue my CRUD dev at work, and have more fun at home. :-)
More User Perspectives
4:40 AMONG US
@Maciej-v6jthis sounds cool but i dont have the attention span or desire to figure this stuff out
@brolynkempif(notTouchingGround)() then
{
object:fall()
}
if(TouchingGround)() then
{
object:dontFall()
}
make a 3d 1 i am doing that
i have no life
sponge screen saver
@Aæugedoes anyone know what program he used to make this?
@Zizami-Dip2what language is this in? i think i recognised the editor as VSCode (despite never really using it) but all these C-family languages look so dang alike! is it C# or something? or am i being stupid and its literally just JS
@aladair12308:44 how did you get the text apearing with a differential growth ? I coded a differential wroght but this effect is incredible.
@sokatunier8607griffpatch for other type of coding
@GlobalSendingServicesThank you! Thanks to your video i made my own version of your physics engine in python 😊
@mikolp.plo_oThis video is just a dot propaganda...
@marekkelo11:33 oh cool... wait, SUB ROSA?????
@Dr.Coomer-e2qWhat coding language are you using?
@kgkediting8205for the rigid body simulation, why not first make the sides made out of multiple pieces and that's how you find the place where it collides on a side, then get the center of mass with some math (from what i remember in school it should be easy). then you just apply the corresponding rotation and some more math to find the speed at which it bounces
@silkfighterelite ball knowledge
@AB-Prince8:47 my mind litterally said “neat” this exact second
@100percentARealNamethank you bro
@alexcoe77I was wondering what language you use? I think it is C# but Im not sure. I know python but I am thinking of switching to C# because I like making things like this.
@BearnitttNow do building a physics engine IN scratch
@DITOWITO1Amazing Video! Could you recommend me learning ressources that you used?
@Amir443124:39 OHMYGOD AN AMOGUS I HAVEN'T SEEN ONE SINCE 2022
@ThumbsUpperYTI laughed a little when I saw the side by sides of you. Didn't age a day, just grew a beard.
@AweTysm_dot_exeWhat is this programming language?
@izao-b9qcould you do a proper tutorial series on this please? by proper I mean going into detail on how these different things work, I feel like a lot of us would love and appreciate it. thanks!
@fireblast_1000So good video learned really much from it
@IdiotischerIncredible video! This will help me so much for my project! Subbed
@threebrickboyslegowhat is the software your using? I think I want to get into this stuff, ITS SO COOL!!!
@MarcieEllis-u7uMusic where
@KlarpimierWeird compliment but your music picks for the first 2 minutes I’ve seen here have been absolutely peak. Insane bass. Fantastic job sir.
@jakewood1942Zanzlanz? I thought you only did bass music? Since when were you a programmer?
@LexarXaryonx