My project depends on a number of external libraries. It wouldn’t be possible to get this much done without offloading some of the drudgery to a few low-level packages written by others. I can make windows without getting married to Microsoft, render polygons without worrying myself with the arcane details of the driver layer, and make sound effects while knowing not a blessed thing about audio hardware.
The downside of not writing your code yourself is that you’re dependent on other teams, who might not be all that dependable. A few people have asked what libraries I’m using. So here it is:
Good old Open Graphics Library. While the OpenGL shader language continues to be a mysterious heap of poorly-documented features, hidden keywords, and devious traps for the uninitiated, OpenGL itself is as rock-solid as ever. There are multiple versions of the documentation, there are incredible tutorials, and there’s even a comprehensive book you can read for free. If you’re looking for technical documentation online, this is about as good as it gets.
I’m not sure if I want to fool around with shaders at this point. I’m just not seeing the need. Sure, there are a lot of cool tricks you CAN do with shaders (I wouldn’t mind a quick-and-easy blur on the background layers in my game) but right now it’s just not worth the hassle. I could blow an afternoon fishing around search engines and wading through the tedious jackasses that sometimes answer your technical questions after they’re done insulting you, but that’s a low-productivity / high frustration road and I’m in no hurry to go down it.
Someday GLSL docs will be as thorough and ubiquitous as the OpenGL docs. But that day is not soon.
Simple DirectMedia Layer is another standby in my projects. Sadly, now is a bad time to be using SDL. The documentation seems to be in some sort of upheaval. As of this writing the documentation is focused on the new 2.0 version, and I don’t want to mess around with the new version. The old one does what I need, the new one might have bugs, and migration is time consuming.
On the other hand, the old docs are kind of sketchy and in shambles. I can’t tell what happened and I’m not going to go crawling around in the wayback machine to figure out where the docs are supposed to be and who moved them. All I know was that for a few weeks Google couldn’t find a dang thing. I’d enter
SDL_Init into Google and I’d end up on a six-year-old forum where someone was asking a question and happened to have SDL_Init () in the text of their question. If you’re not a programmer: Imagine you want to know the meaning and spelling of a word, so you search for the definition. But the only result you get is where someone used the word in a sentence. And they did so in the process of asking why the sentence is incorrect. You have no way of knowing the definition and you can’t even tell if they spelled it right.
It’s a little better now. I have a pretty good chance of typing an SDL function into a search engine and ending up at a page that actually documents the thing, but if I want to do something and I don’t know what the function is called I’m basically screwed. I’ll either end up in the 2.0 docs, at a broken link in the old docs, or in a forum somewhere.
The Developer’s Image Library. I began using this way back in Project Frontier. I don’t need docs because the library is already doing everything I need it to do and I never have to touch my image-loading code.
I really thought that OpenAL was going to do for audio what OpenGL did for graphics. But no. The official page is GONE. Most of the docs out there are just little code snippets with links to that now-dead page.
I wouldn’t mind, but some clever monkey left me this present:
1> audio.cpp 1>e:\source\goodrobot\goodrobot\audio.cpp(189): warning C4996: 'alutLoadWAVFile': was declared deprecated 1> e:\sdk\openal\include\alut.h(113) : see declaration of 'alutLoadWAVFile' 1>e:\source\goodrobot\goodrobot\audio.cpp(199): warning C4996: 'alutUnloadWAV': was declared deprecated 1> e:\sdk\openal\include\alut.h(116) : see declaration of 'alutUnloadWAV' 1>e:\source\goodrobot\goodrobot\audio.cpp(226): warning C4996: 'alutLoadWAVFile': was declared deprecated 1> e:\sdk\openal\include\alut.h(113) : see declaration of 'alutLoadWAVFile' 1>e:\source\goodrobot\goodrobot\audio.cpp(237): warning C4996: 'alutUnloadWAV': was declared deprecated 1> e:\sdk\openal\include\alut.h(116) : see declaration of 'alutUnloadWAV' 1>e:\source\goodrobot\goodrobot\audio.cpp(355): warning C4996: 'alutLoadWAVFile': was declared deprecated 1> e:\sdk\openal\include\alut.h(113) : see declaration of 'alutLoadWAVFile' 1>e:\source\goodrobot\goodrobot\audio.cpp(365): warning C4996: 'alutUnloadWAV': was declared deprecated 1> e:\sdk\openal\include\alut.h(116) : see declaration of 'alutUnloadWAV' 1> Generating Code... 1> GoodRobot.vcxproj -> E:\Source\GoodRobot\Debug\GoodRobot.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
That’s what I see every single time I do something that causes my audio system to recompile. The important phrase is this:
'alutLoadWAVFile': was declared deprecated
alutLoadWAVFile is a function you use to load a wave file so you can use it in your program. That message is an OpenAL developer frantically waving a red flag saying, “Hey! You shouldn’t be using alutLoadWAVFile! That’s the old way of doing things and we don’t support it! You should re-write your code to use the new system, which I will not hint at or explain.”
After much searching I discover that
alutCreateBufferFromFile () is the new hotness. I also discover that the new hotness way of doing things is busted, and the old way works just fine. And I can’t sort it out because all the documentation vanished with the website. So the developer of OpenAL metaphorically sabotaged the old version, destroyed the documentation, and killed himself.
What makes this even more fun are all the forum posts where someone asks a reasonable question and some smart-ass replies with: “Why don’t you just use this?” With a link to the now-missing docs. So the death of OpenAL.org has also killed off a good percent of your fallback documentation.
In any case, I get a page of errors in my face whenever I do anything. It still works, but it will be hard if I need to change anything about how the audio system operates. And of course the error messages are annoying, like having a fire alarm go off every time you do something mundane.
A small ray of hope is that the new SDL was supposed to support audio. So if I do ever make the leap to SDL 2.0, it might let me drop OpenAL. That would be one less library to worry about. I don’t know if SDL 2.0 is ready for that yet and I’m in no hurry to mess with it now, but it’s probably going to be good news for developers when it happens.
A programming project where I set out to make a Minecraft-style world so I can experiment with Octree data.
Good Robot Dev Blog
An ongoing series where I work on making a 2D action game from scratch.
Game at the Bottom
Why spend millions on visuals that are just a distraction from the REAL game of hotbar-watching?
The Best of 2013
My picks for what was important, awesome, or worth talking about in 2013.
What was the problem with the Playstation 3 hardware and why did Sony build it that way?