Anonymous 03/04/25 (Tue) 19:24:07 No. 2672 >>2693
I've been writing a largely custom game engine in C, C99 specifically because it's the best supported version of the language that isn't completely archaic. I'm using SDL, mostly because I want the thing to run in environments that aren't just the older version of Windows that I'm on. In doing so, I've realized two things: First, I kind of wished I used C++. I still think C is the better overall language, and I don't exactly regret using it, but there's been a lot of situations where C++ features would've removed a lot of busywork on my end. For example, I have multiple circularly-linked lists that hold different structs but are otherwise identical in terms of access and modification, and they'd be a perfect candidate for templates. Right now, I'm handling them with a combination of boilerplate and weird post-hoc macro hacks that I put in to reduce said boilerplate when it became too much for me to manage. Second, I've come to realize just how much of a game engine is just bookkeeping : loading data, saving data, keeping logic running at consistent speed, normalizing coordinates so the scene can be rendered, maintaining the data structures necessary for things like rendering and audio playback, etc. The problem with most of these things is that it's hard to know if they're working individually, because you need to have several of the other features up-and-running first before you get any direct feedback; I need to treat them all as one big thing, at least in the short-term, and that's a style of programming that I am not at all used to. There is no point to this thread, by the way, I just wanted to share.
Anonymous 03/04/25 (Tue) 20:32:53 No. 2674 >>2677
you're using a framework to build a game engine huh... I guess that's like using react to make a CMS. But typically when I hear of game engine dev people are doing it from a low level and building their own scripting engines and such
Anonymous 03/04/25 (Tue) 20:33:38 No. 2675
But I'm just trying to make a fuss. It's a good project either way
Anonymous 03/04/25 (Tue) 21:55:17 No. 2677 >>2679
>>2673 >Are you going to go on to make your own games on it Yep! I was going to use GameMaker, but I wanted access to the source code of my game, so I figured the best solution was to make an open source GameMaker-like engine myself.
>Also if most of the game engine is bookkeeping, what are the parts of it that you use for optimizing the engine to the type of game you want to make? I'm still very early in development (I can't even display proper sprites!), so I haven't had had much room to make specific optimizations yet. The biggest one I can think of is that I've inlined certain functions.
With that said, the engine is being built with 2D games in mind, and every choice I'm making is in service of making 2D games specifically run fast on relatively lowend hardware.
>>2674 SDL is mostly a compatibility layer over platform-specific APIs, and that's the extent of what I'm using it for. I'd considered building something like it myself, but I decided that the time and effort simply wasn't worth it, since anything I made would end up looking like SDL anyway.
You're right that it saves a lot of work though.
Anonymous 03/05/25 (Wed) 00:37:43 No. 2678 >>2680
>GameMaker what about GDevelop?
Anonymous 03/05/25 (Wed) 04:02:59 No. 2679 >>2680 >>2693
>>2677 How does SDL handle 3D systems? When I used it a long time ago it was with a simplistic 2D asset game
Anonymous 03/05/25 (Wed) 19:35:48 No. 2680 >>2693
>>2678 I considered it, but it's too heavy for my liking, too much of a runtime, which is unfortunate, because I like a lot about it. I want something that's capable of running quickly on basically any hardware that's capable of running SDL. I grew up with a really crappy computer, so minimizing resource usage is important to me.
To put it into reference, rather than using a dedicated scripting language, right now the plan is to handle all scripting in C directly, with scripts being called via function pointers.
>>2679 It doesn't. For that kind of thing, you're expected to handle it in something like OpenGL directly.
Anonymous 03/05/25 (Wed) 23:13:51 No. 2685
>>2682 Truth be told, I don't fully get it either. This is far and away the most ambitious programming project I've ever undertaken, and it has very much been a learning experience.
Anonymous 03/06/25 (Thu) 22:01:01 No. 2693 >>2694 >>2698
>>2679 >>2680 You can use SDL with OpenGL. I did it once. I wouldn't ever recommend making a 3D engine from scratch though, it's a loooot of work. It can be fun, but you aren't gonna get a finished game engine or finished game out of it.
>>2672 OP, is your goal to learn programming and about game engines, or is it to make a finished game? If it's the latter, I would recommend using an engine like Unity or Godot, or a more comprehensive game framework like Love2D. You'll finish it twice as fast. If it's the former, more power to you, I hope you learn a lot.
Anonymous 03/06/25 (Thu) 22:03:14 No. 2694
>>2693 raw 3D programming is very challenging because highschools don't provide us with good frameworks towards understanding quaternions
Anonymous 03/07/25 (Fri) 06:14:13 No. 2695
thats very cool anon the part that I stalled on was making a 'level loading' system because everytime i try and learn bison/lexx to make a real parser for the level files i give up
Anonymous 03/07/25 (Fri) 16:01:36 No. 2698
>>2693 >OP, is your goal to learn programming and about game engines, or is it to make a finished game? A bit of both. I do plan to build a finished game (actually multiple!) off of this, but much of the reason I'm making my own engine is indeed so I can become a better programmer.
With that said, if push comes to shove, I'm more than willing to use libraries if it means getting the engine done in a reasonable amount of time. I'm already using SDL and I'm most certainly going to use a JSON-parsing library for resources like level-layouts and save files, and a UTF-8 library for text.
Anonymous 03/11/25 (Tue) 01:10:09 No. 2716 >>2720 >>2721
Quick update, a big thing I've learned working on this is the importance of documentation. I'm at the point where my code does too many things that are too complex for a quick read to suffice anymore, so I've taken to writing descriptions of everything using code comments.
Anonymous 03/11/25 (Tue) 17:37:11 No. 2721
>>2716 Might as well take the time to create proper documentation, comments can only take you so far.