britown

Creative-Type Impersonator

🌸请别在工作死🌸


I sometimes like working on never-to-be-finished video game projects


Right now I'm making a game called Chronicles.


Wanna make a game? Here is a list of great C++ libraries to use.


I maintain a Letterboxd in much the way that I assume people maintain bonsai trees.


This is Owen:
Owen
And this is Molly:
Molly
Furthermore, this is Max:
Molly

eniko
@eniko

I think when people hear "write your own engine" they imagine a situation where they're writing specific code for each platform just to create a window and an OpenGL (or whatever 3D rendering API) context and then hooking into the message pipe and yadayadayada. I absolutely do not recommend you go around calling CreateWindowEx and doing all of that manually.

There are great free and open source libraries available to do that shit for you. SDL2, RayLib, and many other smaller and less known libraries. I use RayLib in my fantasy console project and I gave the source to a friend who, with almost no alterations, managed to get it running on a Raspberry Pi. This is a solved problem. You don't gotta do this.


mrhands
@mrhands

When you grab SDL2 for your little game/engine you're like 90% of the way there.

At the studio I worked at, we used to roll our own window creation, input handling, etc., and it's huge pain in the ass. I've processed input directly from the Raw Input and Xinput APIs in Windows, and I'm here to tell you:

You should just let SDL2 handle that.

Not only is it a cross-platform library that works on basically anything with a CPU (GPU optional), but the library already handles the annoying platform-specific edge cases for you. And once you have created your window with SDL_CreateWindow(), you can still specify that you want an OpenGL rendering context for it, or a Vulkan one, or even a Metal one.

Now you just have to build the rest of the fucking game.


britown
@britown

Especially for Windows, support has just gotten better over time. I haven't had to compile my own version to step into it in the debugger once in Chronicles and that's saying a lot!

Want to support..... all? Gamepads? Load this text file and it just works.

And if you want to use ImGui there's already sdl2 platform back ends written in the example folder. You can get an imgui sdl2 program window running from scratch in like 15 minutes: https://github.com/ocornut/imgui/tree/master/examples/example_sdl2_opengl3

It's low level audio interface has also vastly improved in case you wanted to do something silly like generate your own audio streams 👀


You must log in to comment.

in reply to @eniko's post:

I'm amazed that in 202x when consumer devices are all multicore and probably have an additional much weaker core somewhere for IO, we're still polling pads instead of getting interrupt-driven input queues!

(Which is mostly to say: missing inputs because you dropped a frame shouldn't be a thing any more and yet somehow it is even in AAA titles that know they'd behave better if it wasn't...)

But yeah. I remember things as they were in the late 90s and early 00s. Even got kicked out of an IRC channel once because someone who'd written silly amounts of C++ architecture astronautics announced how his all-owning 3D engine had reached a major milestone, I quipped "what, it renders a triangle?" and I was right! (and then politics happened and I was let back in)

Far more of it's about understanding how you want to think about the job you're doing and how to make that happen than anything else, and for 2D work... I'm a PL nerd because I don't want to have to take somebody else's model!

in reply to @mrhands's post:

The textbook Game Engine Architecture has a ton of good information too. Not all of it is pertinent to indie devs, but a good bit of it is and I found it helpful to have it broken down. Just beware of outdated library or tool recommendations in the older editions.

Absolutely! I had that book for many years, but got rid of it when I moved countries. It's an excellent resource overall, but there's a heavy focus on aimation tech. Which does make sense since the author was an animation programmer at Naughty Dog.

Can't for the life of me find any good resources for using SDL to make 3D games. Any recommendation? Books, web tutorials. I'm trying to wrap my head around how it's used with/instead of just raw OpenGL.