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
 
sloan profile image
Sloan the DEV Moderator •

We loved your post so we shared it on social.

Keep up the great work!

Collapse
 
montmont20z profile image
Melvin Cheah •

Thanks you very much! Your kind words means a lot to me!😀🥰

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
 
aniruddhaadak profile image
ANIRUDDHA ADAK •

Impressive

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
 
alexus85 profile image
Alex Petrik •

thanks for sharing, it reminded my beginnings with C++ :)

Collapse
 
volodyslav profile image
Volodyslav •

Cool 😎 you encouraged me to learn it

Collapse
 
embernoglow profile image
EmberNoGlow •

Good job!

Collapse
 
montmont20z profile image
Melvin Cheah •

Thanks you! Appreciate you kind words!

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
 
montmont20z profile image
Melvin Cheah •

Absolutely — modern tools are impressive. This project was mainly about learning how things work under the hood.

Collapse
 
nube_colectiva_nc profile image
Nube Colectiva •

Good job, creating projects and experimenting is an excellent way to improve as a programmer 👍🏼

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.