The Mezunian

Die Positivität ist das Opium des Volkes, aber der Spott ist das Opium der Verrückten

Nihilly, the Nihilist – My 1st Dumb Program

The 1st real1 program I e’er remember writing was in what I thought was C++, but was closer to C. The header includes were C-style & none o’ my programs used classes ( though there is a C-style struct ) or STL. The only thing “C++” ’bout this program was that it had a CPP extention & didn’t put “void” in empty parameter lists. Nonetheless, I was confused by these 2, since I called this folder “C++” & remember reading a ( quite terrible )2 book on C++ @ the time.

There was no particular inspiration. When I was a teen I’d oft check out wildly different nonfiction books from my local library. ’Twas in a songwriting book that I learned that imperfect rhymes are better than perfect, since they’re generally fresher ( none o’ that moon-june shit ); ’twas in a podcast book I learned ’bout Audacity; ’twas @ the end o’ an ol’ For-Dummies book ’bout YouTube that I got to read the writer pontificate ’bout how to survive in an apocalypse ( I think the For-Dummies books let writers write whatever the hell they wanted in the last few chapters ); & ’twas in Game Programming All in One that I truly 1st learned how to program, round the spring & summer o’ 2009, I think.

I used to have this idea that a simple “enemy chases you & hurts you if it touches you” was the best simple game idea to do 1st. I think I got the idea from reading ’bout Atari founder, Nolan Bushnell’s, 1st program on some ancient computer, which I read ’bout in yet ’nother nonfiction book, The Ultimate History of Video Games, by Steven L. Kent, a hefty 600+ page book that I highly recommend. Thus, this was the gameplay o’ my 1st game, “Nihilly the Nihilist”… or “Nilly”. I was ne’er consistent on that part. Also, I always pronounced it “Nilly” till I finally learned the proper way to pronounce “nihilist”. You were chased by somewhat KKK-looking guys with white bandanas wrapped round their faces & deep black holes for eyes called “Fucksters”. You can see that this was an immensely edgy fox-&-chicken game worthy o’ Edmund McMillen.

That’s ’bout it for art design. I couldn’t comprehend such arcane concepts as programming backgrounds ( I think I was so paranoid ’bout resource use for some reason that I feared redrawing so many graphics every frame or something — I don’t know. I also thought objects were resource intensive & should only be used for “big” things, whatever those were, for some reason. You can probably see that I still thought o’ computers as some magic too powerful to use without discretion ); therefore gameplay was played o’er plain purple. Not sure what that purple was s’posed to represent — other than a way for hackers to figure out how to steal my passwords, ’course. The title screen was just whatever font Allegro decided, apparently, o’er blue background — presumably inspired by ol’ Final Fantasy games. Maneuvering menus was programmed through a bunch o’ lock integers acting as booleans ( & global, to boot, for some reason ) so that 1 button press wouldn’t cascade through all the options.

If you look @ the linked code, you’ll see that I had a strange method o’ indention. Interestingly, I still used the Allman for braces, though conditional statements & function calls would randomly fall out o’ this pattern. Mo’ importantly, you’ll notice that I didn’t quite understand functions very well. I seemed to view them as simply a means o’ dividing game states, & nothing mo’, while blissfully copypasting large chunks o’ code. Also, for some reason I made every function return an int, e’en though none o’ them are used for anything. Each frame o’ each sprite is just it’s own graphic file plopped right into the big “gameplay” function. @ the time, I certainly didn’t know what the “*” next to the “BITMAP” type was for, but I dutifully copied & pasted it there as the book told me to do.

As a larf, I downloaded Allegro 4 & compiled this program. Unsurprisingly, it’s utterly broken. Content stretches far past the end o’ the screen & everything runs ridiculously fast, like a 90s game that comes free with Cap’n Crunch cereal. I guess that’s to be expected when I was too naive to understand the whole complexity o’ framerate maintenance & I test my software on a 169MB-RAM laptop that was mo’ than a decade ol’ e’en back when I had it ( how I miss you, Grape Faithful ). Also, Valgrind told me it had 16 whole bytes o’ leaked memory, which is, oddly, less than an empty program programmed in D, apparently — a’least on my computer.

As part o’ my nostalgic research, I actually tracked down the book I learned from, which is apparently on GitHub. There I learned that the writer said he was writing his code as C++ projects with mostly plain C to keep his code from sucumbing to C++’s object infection, STDs, & colon cancer. I also learned that apparently the GameCube & Game Boy Advance SDKs, or whatever, used GCC. He also hilariously recommends readers to actually learn C before starting, which I didn’t do.

There were a few other programs I made round this time, too. In my language arts class @ the time I had to memorize the work, the chapter, & the speaker of certain quotes from works like Macbeth & The Waste Lands, so I made some quiz program that showed my amazing understanding o’ functions by having each question have its own function — there was no fucking way that version o’ me would understand the complexities o’ passing string pointers & concatenating them with the parts o’ the question that didn’t differ ’tween questions. I think I did figure out how to have tree tiles based on multidimensional arrays in 1 program. But none o’ it went anywhere, & I soon lost interest & didn’t come back to programming till 2014.

View e’en worse code than Boskeopolis Land.

Posted in My Crimes Gainst Art, Programming