Hero’s Quest Post Mortem

Posted by (twitter: @SirGFM)
August 25th, 2015 6:15 pm

Click to go to the entry's pageTools

  • Language: C
  • Library: SDL2 + GFraMe (on version 2.0.0-rc3, when the jam ended)
  • MusicVMML
  • SFX: sfxr bfxr
  • Editor: Vim
  • Tilemap editor: Tiled
  • Timelapse: Chronolapse
  • Image editor: GIMP
  • Palette: DawnBringer’s 32 Col Palette V1.0
  • OS: Ubuntu 14.04
  • Streaming: Open Broadcaster Software

My current setup was pretty much the same as I had planned. The only major difference is that I actually streamed during most of the jam, while I had thought I wasn’t going to do so…

Since I’ve done some majors modifications on my library, I was worried with random bugs that I could stumble upon. I did take part of a small jam before the LD to be sure that everything worked, but when it’s only the second time you are actually using something to make a game, you can never be too sure that it will work, right?

There were actually lots of small bugs (I think I did 10 commits to the lib, during the jam), but I was able to tackle’em… There was one that was specially hard to track. After I finished the jam and booted to Windows to “port” my game, it was breaking when parsing the objects… Well, turns out Windows can’t fsetpos on text file… or, at least, on unix-styled text files…

What went right

  • Graphics: Sorry, I must say it like this… They came out so damn good! I’ve been trying for a while to make a game with 32×32 or 24×32 sprite, but I had always failed… until now! Also, I finally felt like I was able to properly use a palette (specially on the rock).
  • Audio: It’s been so long since I was happy with a song I’d written… It isn’t even quite that long, but at least it’s not an 4 seconds loop like last LD.
  • Genre: Finally something that isn’t a platformer (nor a shooter) and is still (kinda) playable. It’s also a beat-em-up, which I’ve been meaning to do for a long while…
  • (Lack of) Time management: Instead of worrying about having an initial plan and trying to achieve that, I tried to do everything that I would need to implement an idea, without actually making the game itself, but making what I had the most polished I could. By the end, I was able to add some story and build a simple level using everything I had prepared, but I didn’t lose any time to ideas that couldn’t be implemented…
  • GIFs: I can finally export GIFs on linux!! And from the game itself!! _o\ \o\ \o/ /o/ /o_

What went wrong

  • Graphics: Yeah, I’m really effing proud of my graphics, but… It took too much of my time, the player only really have two animations (the others were hacked together from those), I reused the enemy like there was no tomorrow to simply have some variety…. There’s a lot to still working on this one…
  • Audio: Once again, even though I’m proud of the song, the SFX are quite bad. It’s missing a lot of small details that I like (the steps when walking, the sword’s ‘swoosh’ [Yeah, it’s a sword… XD])… But, with 25 minutes left, I had to choose what I was going to do…
  • Gameplay: I knew it would be quite a “developer’s difficulty” game, still there was no time to do this properly, so… Yeah, I just didn’t really care about it. This is what I must get better before/at next LD!
  • Lack of Time Management: Even with all the advantages I listed, it was quite a gamble… It could had gone pretty bad…
  • System’s RAM: There was something eating up on my PC’s RAM… I think it was Chronolapse, since everything calmed down after I closed it on Sunday (after restarting my computer twice)… I really should either check it out before next LD or completely give up on it and start streaming only… If I can make the stream’s video into a timelapse kind of thing… it may be worth it….

All in all, I really enjoy LD! It had been quite a while since I last felt like I tried so hard during a game jam (even if I focused mostly on polished instead of on gameplay…).

Read on for a all of text (and some GIFs)…

First Day (Friday’s night) – “Let’s think of an idea and draw the player”

Here the jam starts at 10 P.M. After going out to dinner with my family, I got home late for the theme announcement. Still, I was only half-an-hour late so it wasn’t much of a deal…

When I saw the theme, I felt divided. I didn’t want a repeated theme but I also quite liked it… I had a pretty nice idea about a game where you must defeat the dark lord but, in doing so, you are overwhelmed by despair after defeating him and becames the next dark lord… and so the cycle would go… You can read about that idea here and here.

I knew it was too big of a game to actually finish it on time, but I decided to take a different approach from my usual one: instead of planning out everything from the start and trying to reach that, I planned the game and then didn’t really bother forcing me to keep on track; I would see where the game was going and try to keep developing it in that direction… This way, if I run out of time (which I did!), I wouldn’t take the “Oh gosh! There’s no way I’ll finish in time! What do I cut?” approach, I would be more on the “OK, I have all these features… How do I turn it into an actual game?” side…

It did (kind of) work out, but the game quality suffered from it… Until the later half of the last day, I wasn’t too sure what the game was actually going to be about.

I actually got to draw the main character’s sprite and one of the enemies: a slime. In the end, that ended being the only enemy… XD

Saturday morning (and early afternoon) – “Gotta write the base code”

I started to code the base engine. It was the first time I did a beat-em-up, but I had some ideas to how to detect collision “per-lane”. I read this great postmortem by sos for Badass vs Hipsters, in which he explained how all hitboxes were offset from the actual sprites and all… Unfortunately, the images seem to be all broken. :(

See how the hitboxes are at the sprite's feet (or however you call that on a slime)? Also, can you see how you can pretty much stunlock an enemy to death? XD

Following that idea, I create a basic “mob” type, which would carry all the logic for pretty much anything at all. I simply had to modify the pre-physical update and using different AIs (or the player’s input) and I would have entities that behaved differently. Adding a wall, later on, was also pretty easy. I just had to add a non-moving, not-agressive entity… pretty easy. :)

The first fun thing happened around this time. Because of a wrong malloc, my code was breaking at random parts… Since the error was being triggered when calling malloc (according with gdb), I tried to check my system’s free RAM… well, this image explains way better than I ever could:

At least, no swap was being used... yet...

I had only 125 MB of free RAM… Of course, that wasn’t the cause of the problem, still it was something that could annoy me with slow downs (or even worse, crashes before I committed something). It was my first time streaming and I also had Chronolapse, Gimp, Chrome, etc. open… So yeah, I was abusing it… but it shouldn’t be using all that memory! After rebooting another time, later that day, I gave up on streaming for sometime, but my RAM continued to get eaten by something… After I stopped timelapsing, all was good again. I still don’t know the cause, but it seems that Chronolapse was causing it my computer (Ubuntu 14.04 64 bits)… I’ll have to check it, later…

Saturday afternoon & evening/night – “Not late enough: let’s do the animations and the background. Also, particles!”

Around 4 P.M. (UTC -3) , I “already” had a player that could move around (but wasn’t animated), the slime’s animation and the base code for doing collisions (which, even though they weren’t handled, they could easily be made to work). The only logical thing to do was draw the player’s animation, right? … There were so many bad and stupid decisions along the making of this game that, looking back, it’s kinda incredible that I was able to pull it off… XD

It was around sometime around 5~6 P.M. when I finally started to draw the backgrounds. Yeah, I still had no other “gameplay” other than a player moving around… Anyway… Also, around this time my computer probably started running out of RAM again and I decided to stop streaming (though I think I still was timelapsing it…)

At first, I wanted the game’s native resolution to be 320×240, but there was simply too much space to fill with stuff. >__< I downsized it to 160×120 and, after a few tries of “simply drawing it”, and decided to use a small “art hack” that I rarely use: drafting:

Ugh... that's just... horrible... >__< I was even going for 160x160 sprites, but I failed to make 'em loop seamlessly... >_<

That wasn’t working out… So I went to pixel joint to get some inspiration and got two great images (this and this) that I based my background on. It worked, but I later had to redo it to be able to loop it nicely. Since I was trying to go all out with graphics, I just had to add falling leafs to the background… It would take a little while to add to the game, but it would be worse it. By the time I was finished with the background, it looked like this (in game):

Who needs a game when you can spend all your time doing this cute walk/run animation and spawn lots and lots of particles? *-*

Saturday “until-after-midnight” – “Ok, better start to turn this into a game”

With “all that” in game, I started to code things that would make it look like an actual game. This is also where things started to get even more *fun*.

The first thing I did was to get the camera to follow the player. That’s quite easy to do… except there was a mistaken condition (on the lib) that made the game exit. After I fixed that, I found it another bug on the camera system… So much for a well tested lib… XD

I got everything working though…. after fixing a funny bug on my parallax code (that’s actually hard coded on the game, since there’s no implementation on the library for this)

I still like this broken version quite a lot. I laughed a lot when it first happened... Also, note how the leaf are bound to the screen space, instead of the camera, and just move backward as the player moves forward... so much cooler... XD

Then, since the BG was looping seamlessly, I just had to spend more time fixing it… C’mon, if I’m aiming to do great graphics, I must fix most small issues, right?

Finally, I opened Tiled and start to think about what I would need from the exported objects. My lib has a plugin and its parser, but I made it in quite a lazy generic way: everything but the object’s position and dimensions is returned as string. On the plus side, it allows for adding any desired attribute to an object (well, that was the objective, anyway).

gfm_ld33_0015

Then I imported it into the game (fixing a few more bugs on the lib, along the way) and finally got to start handling collision. Because of a dumb bug (that I wouldn’t fix until Sunday’s morning), I couldn’t get it to work properly… So I just went to sleep at 2 A.M.

Sunday ??? – “What’s happening? What day is it? How much time left is there?”

I think I still was suspicious of OBS, so I didn’t stream until later that day… So we check the commit log to now what happened!

During the morning I got to finally implement some of the AI: enemies started run after the player, flee from it… all that stuff. I also gave up on drawing unique enemies and praised the god of palette swap. With that, I quickly got three different looking enemies! /o/

(again) Since I still wasn’t late enough, I had to add another feature: rendering the sprites from top to bottom. This is quite a simple thing that, when done, people probably don’t even notice… but it’s so less pretty if you don’t do that… Also, the whole point of this new version of my lib was to be able to do that, since last LD I had some slightly weird graphics because of that (when you win that game, the player starts to shoot rainbows, i.e., particles affected by gravity, upward, which aren’t sorted when rendered…). So I just had to do that… stupid priorities…

I went to have lunch while thinking about the song and the background. I had redone it but it was still far from my liking… it was just too bright… So, as soon as I got home, I started to redo it and to try to compose something.

Something to note is that even though I was taking my time to polish a lot of things, I was rushing quite a lot. I pretty much didn’t have time to post any progress… Another thing is that I still hadn’t a game done, I just had a prototype for something that could be a bad game…

I finally got around to adding the player’s animation and testing the combat… I could quite easily defeat the slimes, but I new just how terrible the combat was. Still, it would take quite a while to think about how to fix it, so I simply left it as is.

I finally had to create a level, or I wouldn’t have anything to submit. So I added “levels” to the slimes, so they would get stronger as you moved forward. I also tried to break the game into small “stages”, each with a set of enemies (i.e., a challenge) to be overcome. Well, the enemies’ disposition was pretty much random, and I just made sure to not make it completely unfair and unwinable.

I also wrote all of the game’s story. It became nothing like what I had originally envisioned, but it worked. I couldn’t spend anymore time with those details or I would finish with nothing.

By now, I had 25 minutes until the submission time, so I just opened BFXR and quickly made a few SFXs. Since I’ve used SFXR for sometime now, I can finally get it to generate the SFX that I want… sometimes. The slime’s death SFX is one of those. I just really like making those “spiraling” sounds…

Literally on the last minute I just quickly drew the player’s animation. Yeah, I just modified a few pixels from the “getting hit” one, but I still found it funny to open GIMP at the last minute to do more assets.

Sunday after submit hour – “But I only had to run ‘make’ on Windows….”

When I was writing my final TO-DO list, I decided that I would do my all to finish the linux version in time and then I would abuse the “porting” rule to build for Windows afterward… I don’t fell too happy about that, but I really needed the extra time, so…

Also, the way I build my games, it’s usually as simple as running ‘make’ on MinGW and I have a working game. Well, the binary did compile, but there was a bug on the lib’s parser… I spent quite a while trying to understand why it would return EOF on a character, when the file was clearly being opened two calls prior to the fgetc that was returning that…

Well, turns out I was opening the file in text mode and Windows can’t handle using fsetpos on those kind of files… And the way the parser was made, it tries to parse something and, if it fails, it simply rolls back to the previous position…

So, yeah… lesson learned… properly test your libraries before a game jam!

Thanks for reading (if you made it through that wall of text XD)! I hope you enjoyed it!

Now, let’s go rate more games. /o/

Tags: , , , ,


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]