So, you want to make a game engine (2023) (lisyarus.github.io)

49 points by kugurerdem 5 hours ago

27 comments:

by damienmeur 12 minutes ago

I cannot recommend more to try the Ray Tracer challenge and if possible without AI.

It helps you build a full ray tracer / 3D engine only guided with tests, really powerful to learn test driven development.

What s cool is that just being driven with tests still allows you to do it in any language you want.

Plus you ll learn a quintillion of stuff about mathematics. This is really the kind of project that makes you go to a real senior SWE

by kyzcdev 5 hours ago

I believe the instinct to develop a game engine or framework comes down from loving programming and being passionate about mastering a tool. We humans love mastering something and we love masters, when we build something from scratch we own it, we are master of it and we lead the decision. That's so comforting and pleasurable, and the reward we see at the end of the path motivates us. But on the process it's too hard.

Nowadays I have the urge to combine a physics engine, rendering engine, ecs engine to develop my own game which I guess I'll quit in the middle.

As developers I believe we should limit ourselves from doomcoding.

by whstl 4 hours ago

I dunno if I agree it's doomcoding.

I have worked briefly in the game industry long ago (not in engine teams though) and ended up writing a few engines for myself after leaving, a couple quite complete.

It’s just a hobby like another. I have zero interest in writing a full game on top of it, or even publishing it.

But do you know who NEVER gives me grief about it? People I know who work at Unity or [previous employer] writing AAA engines.

My last monstrosity is a Rust one with zero dependencies other than the std-lib/OS, Metal/DX12/Vulkan, its own physics engine, spatial audio, vm for scripting and other stuff. I will probably do nothing with it other than having updated my skills in a lot of areas.

by daledavies 5 hours ago

I think we have to try these things at least once. My own attempt to write a javascript framework ended with me realising that I needed to put more effort into planning and research, which was a valuable lesson for me.

by kyzcdev 4 hours ago

Yes building tools from scratch is a great way to learn. In my carrier a rewrote bunch of front-end frameworks, but then instead of rewriting everything from scratch I decided to simplify existing structures.

Once I tried to create my own front-end framework from scratch. I created signal library, mounting/unmouting, context etc but never able to write v-dom diffing or using existing vdom libraries.

Then I decided just implement my API on top of Preact. Preact did vdom-diffing for me and mounting/unmounting which was enough for my need.

The final project looked nothing like Preact, it even had it's own context system, data loading, signals, setup + render and context which just hooks itself into Preact Context but taught me a lot about how a front-end framework work.

by vector_spaces 4 hours ago

Right, I think the usual point here that if your goal is to make a game, then this is usually the painful route and conveniently one that up-fronts the likely more exciting and comfortable part for a software engineer, namely the software engineering. It also tends to defer the very important business of learning rather quickly whether our idea even leads to a fun game in the first place

That said, it's still a worthwhile exercise that one can learn a lot from.

by kyzcdev 4 hours ago

Balance is required for everything. There was a youtuber called Randy, he tried to build everything from scratch using C and it took him 6-7 years to finally release a game. Meanwhile I watched a youtuber who just made games from fake-ads in Unity and marketed it well and earned bunch of money.

Do we want money or do we want to get the pleasure of being an engineer and make money as a side quest?

There was a video of tsoding about why he doesn't have a job, he says "when I have enough money for my needs I just go into coding instead of working". I like his vision. He likes coding for the sake of programming and earns money as a side quest.

by lstodd 3 hours ago

There is another angle: what if you want to express yourself, but, say, Unity is too limiting? Existing game engines were made to express existing ideas and while there is some stretch they do have hard limits.

by drivers99 4 hours ago

What's doomcoding? (It's not mentioned in the article and it doesn't appear to be a related term when I google it.) It sounds negative ("doom" + "we should limit ourselves" from it) but everything you said in the context before that sounds good.

by foobarian 26 minutes ago

I took it to mean the frameworky coding you kind of get sucked into when you start a project when you realize off-the-shelf libraries are flawed or you could do so much better. Like the old trope of getting a task to write a billing system but first writing a full text mode UI framework, menu system, etc.

by kyzcdev 4 hours ago

Coding for pleasure I mean. We start a project and then get bored. Like Doomscrolling, for pleasure.

by nsyne 4 hours ago

I don't think I agree with this. Doomscrolling has a negative connotation - of wasting your time and being unhealthy for the mind. I don't see coding the same way. Sometimes, I code to finish a project and it's a major milestone and I feel accomplished. Other times, I just code something because it sounds like I'd enjoy it and it's fun. I feel fulfilled nonetheless, even if it goes nowhere. I wouldn't equate it to doomscrolling.

by kyzcdev 2 hours ago

Yes coding itself is not like doomscrolling. I wanted to use that term because I lost so much time bu trying to reinvent stuff.

I wanted to make a game, and had an idea, but then I thought "why not making a game framework so I make my game". It was fun to build a game framework by mixing PixiJS, Rapier2D, ECS, writing my own loop logic and state management but then I lost the motivation. I just coded a framework for pleasure but at the start my point was making a game.

The desire to build something can cause our idea to be dropped.

by em3rgent0rdr 3 hours ago

"Pridecoding"?

by ml_giant 3 hours ago

Maybe just “coding”?

by kaycebasques 30 minutes ago

"Creating"

by jewel 3 hours ago

"Hobbyhacking"?

by socalgal2 2 hours ago

The instinct to make a game engine is it's well known how to do it and you just follow examples all over the the place and each few days you check off a box and feel like you're making progress. It's much easier than making a game itself. There is no known list of do X, do Y, do Z that leads to a game. In that sense, games are harder than game engines because a game is unknown, a game engine is well known.

IF you want to make a game engine, building one is progress

If you want to make a game, building a game engine is the illusion of progress. When you're done making the engine you'll be no further along on your game than if you'd used an existing engine. Usually you'll be behind because those other engines have so many features and tools that you have yet to implement. Sure, you don't need every feature, but you may be surprised at all of the little things you end up having to write.

by indy 4 hours ago

It helps to just write games and then over time an engine will emerge from the common code you carry across projects.

Starting from a checklist of features for a game engine almost always ends in wasted effort

by lstodd 3 hours ago

Exactly.

by cjk 4 hours ago

For me, the interest in engine-making is to give myself a toolkit that is suited for the kinds of games I want to make, rather than an engine that is trying to be everything to everyone. Also to avoid the Unreal Engine monoculture.

by badsectoracula 4 hours ago

(Considering the linked section) that is more or less how Petra Engine[0] came to be - making a gamejam game[1] for MSDOS over a few weeks. Though while i did make it for that specific game, i always had in mind that i may want to use it for other games in the future too so i tried to make it more "generic" and keep the engine and game bits separate while avoiding too many game-specific stuff (didn't fully manage it though - in the end i've been removing PAP-specific things and a bunch of hardcoded stuff over the years whenever i feel like using it).

That said, despite making a bunch of demos[2][3][4][5] since 2021 when i made the game, i never made any game using it after that as i always lose interest - perhaps i do need to be making an engine from scratch to keep myself interested :-P.

[0] http://runtimeterror.com/tech/petra/ (note the version is very old and i've made a lot of improvements since then - this includes the Codeberg repository which i'll move somewhere else at some point)

[1] https://bad-sector.itch.io/post-apocalyptic-petra

[2] http://runtimeterror.com/pages/iv/images/44d7537fb719e00fdcd...

[3] http://runtimeterror.com/pages/iv/images/d22ff83dd5e5109e02e...

[4] http://runtimeterror.com/pages/iv/images/1da6a4bce430a8d8507...

[5] https://www.youtube.com/watch?v=zx9KmkTLcB0

by doctorpangloss 3 hours ago

> perhaps i do need to be making an engine from scratch to keep myself interested

you're not the only one. jonathan blow has made tons of money selling games and also needs to write a whole programming language for 100h to keep him interested enough to yield 1h of content.

i can't really say much about the people who say don't program game engines (or whatever thing they don't like) in terms of opportunity costs (a generous name for this category of complaining), other than they would be bad at both making art and making money.

by socalgal2 2 hours ago

> i can't really say much about the people who say don't program game engines (or whatever thing they don't like) in terms of opportunity costs (a generous name for this category of complaining), other than they would be bad at both making art and making money.

What a ridiculous take. Making a game engine is to games like building a camera is to making movies. Once a blue moon some new camera enables some new technique (the Matirx), but mostly people just use the tools that exist.

The same is true in games. Tons of super popular and successful games didn't write their own game engine and made both art and money.

I'm watching a friend, claiming he wants to make a game company, burn through all of this money instead making a game engine. If he succeeds, great! But I suspect he'll just run out of money before he's even started working on a game. If it was fun to make, great too. But I think he'll look back on it as throwing away an oppotunity.

by badsectoracula 2 hours ago

> I'm watching a friend, claiming he wants to make a game company, burn through all of this money instead making a game engine. If he succeeds, great! But I suspect he'll just run out of money before he's even started working on a game. If it was fun to make, great too. But I think he'll look back on it as throwing away an oppotunity.

Been there, done that, didn't regret a thing since i'm certain i'd have given up way earlier (assuming i'd ever bother starting) if i had to use an existing engine :-P.

(ok, i never had money to "make a game company", the most money i ever had was to be able to spend ~2 years living frugally while making my own stuff, but it is close enough since i think someone could say i should have used some existing engine instead - which is true, except i'd hate doing that)

There are people who want to make games, people who want to make engines and, perhaps a minority, people who want to make games and engines :-P.

(though FWIW in my case i never felt the tech side was much of a limitation, it is art/content that ends up being the bottleneck and makes everything crawl down and the stuff i like to do aren't the kind of stuff you could do with procgen, minimalistic styles or other similar approaches for saving on the art/content side)

by dvh 4 hours ago

Making game engine is the fun part, making actual game with it is the boring part.

by jujube3 21 minutes ago

Claude, build me a game engine. Make no mistakes.

Data from: Hacker News, provided by Hacker News (unofficial) API