[ home / bans / all ] [ qa / jp / sum ] [ maho ] [ xmas ] [ f / ec ] [ b / poll ] [ tv / bann ] [ toggle-new / tab ]

/maho/ - Magical Circuitboards

Advanced technology is indistinguishable from magic

New Reply

Options
Comment
File
Whitelist Token
Spoiler
Password (For file deletion.)
Markup tags exist for bold, itallics, header, spoiler etc. as listed in " [options] > View Formatting "


[Return] [Bottom] [Catalog]

File:1000000523.jpg (78.25 KB,563x400)

 No.2672

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.

 No.2673

File:1444426678495.png (58.32 KB,400x275)

Well I think it's good you shared because that's pretty cool. Are you going to go on to make your own games on it too, or do you just want to do the engine?

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?

 No.2674

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

 No.2675

But I'm just trying to make a fuss. It's a good project either way

 No.2677

>>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.

 No.2678

>GameMaker
what about GDevelop?

 No.2679

>>2677
How does SDL handle 3D systems? When I used it a long time ago it was with a simplistic 2D asset game

 No.2680

>>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.

 No.2682

File:[Piyoko] Himitsu no AiPri ….jpg (213.88 KB,1920x1080)

This sounds pretty cool, but I don't understand any of it.

 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.

 No.2693

>>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.

 No.2694

>>2693
raw 3D programming is very challenging because highschools don't provide us with good frameworks towards understanding quaternions

 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

 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.




[Return] [Top] [Catalog] [Post a Reply]
Delete Post [ ]

[ home / bans / all ] [ qa / jp / sum ] [ maho ] [ xmas ] [ f / ec ] [ b / poll ] [ tv / bann ] [ toggle-new / tab ]