DEV Community

Cover image for I Built a Game Engine from Scratch in C++ (Here's What I Learned)

I Built a Game Engine from Scratch in C++ (Here's What I Learned)

Melvin Cheah on January 07, 2026

I Built a Game Engine from Scratch in C++ (Here's What I Learned) I crashed my GPU 47 times before I saw my first triangle on screen. F...
Collapse
 
carban profile image
carban

Wow! I love when someone research and learn how things works deeply and even better, starts creating something from scratch. You are so talented, go ahead!

Regards!

Collapse
 
montmont20z profile image
Melvin Cheah

Thank you — that means a lot. I enjoy digging into how things work and building from the ground up; your encouragement really helps. I’ll keep posting progress updates here.
P.s. That makes me feel worth on my hair loss 😉

Collapse
 
peter_truchly_4fce0874fd5 profile image
Peter Truchly

Great journey and conclusion! Nothing beats doing things on Your own. I could feel that boost by reading Your article.

I would add one more reason why anybody might want to do their own engine: You are free to experiment with non-mainstream techniques. Like you mentioned voxels, there are interesting Voxel Ray Traversal algorithms to explore, moreover You could also use implicit surfaces, constructive solid geometry and many options for light calculation (yes, even more interesting stuff than ray tracing).

If You like optimizing stuff: a "postcard sized path tracer" might be an interesting thing to decode and optimize, perhaps even turn it into a real game engine with unique way how to define geometry and lighting.

Collapse
 
montmont20z profile image
Melvin Cheah

Thanks — excellent suggestions and much appreciated!

I totally agree that doing your own engine opens the door to experimental geometry and lighting approaches (voxel grids, implicit surfaces / raymarching, CSG, bespoke light transport). I plan to explore a few of those directions:

Thanks again for these concrete ideas — they’re exactly the kind of directions I want to try. If you have any favorite papers or toy projects (small repos or demos), I’d love to see them.

Collapse
 
lissy93 profile image
Alicia Sykes

That's really neat!! Kudos to you!

Collapse
 
montmont20z profile image
Melvin Cheah

Thank you! That means a lot to me.

Collapse
 
tkouleris profile image
Thodoris Kouleris

Very nice! I remember back in mid 2000's I created a breakout game in cpp using SDL libraries. The process teach me a lot! Great work!!!!

Collapse
 
montmont20z profile image
Melvin Cheah

Thank you! Glad that you went through the process and come out on top😁. That is why I am advocating building a game engine for everyone who is interested in graphics programing.

Collapse
 
ghavamy profile image
ghavamy

Did you notice your collision works better than unity? 😀

Collapse
 
montmont20z profile image
Melvin Cheah

Thanks for the complement! But Unity definitely does better job than solo dev like me 😂

Collapse
 
seagamesai profile image
seagames

I can't write code, but I used Seaverse and finished this game in three minutes. Modern technology is truly remarkable.

Collapse
 
embernoglow profile image
EmberNoGlow

Good job!

Collapse
 
montmont20z profile image
Melvin Cheah

Thanks you! Appreciate you kind words!

Collapse
 
felix-tech profile image
felix

Wow, it reminds me of the feeling of playing games when I was a kid.

Collapse
 
montmont20z profile image
Melvin Cheah

Thanks! That’s exactly the feeling I’m aiming for — that sense of curiosity and joy from playing games as a kid.