Home > Musings > Broken Bottle: 7drl post mortem

Broken Bottle: 7drl post mortem

March 21st, 2011

I’ve enjoyed reading some other post mortems and figure that now it’s a week after the challenge I might do my own.

Broken Bottle splashscreen image

I made this splashscreen image to alleviate some coding stress - only took a few minutes with a stock image and some Photoshop filters

Broken Bottle was a vague idea I had for a while – I wanted to make a really gritty post-apocalyptic game, with a dark world and a flawed hero. I wanted something far more serious than the Fallouts. I wanted the player to feel unnerved by certain game actions, and I wanted alcoholism to play an important role in gameplay. I wanted a sprawling open wasteland game, with various areas to explore and factions to encounter (yeah, that never made it in). I had a general idea of a story about an alcoholic that had abandoned his daughter. I never thought I’d try any of this in 7 days…

It was only on the eve of the challenge that I decided I would definitely give it a go. I had planned before (and publicly announced before) that I would be making a sequel to UNSTOPPABLE, but as the Saturday approached I became more and more unhappy with this limited scope and this idea resurfaced. I was also disappointed to find out no one was planning a T-Engine based game after ToME4 won Roguelike of the Year. Finally on Friday night I thought screw it, I’m making a post-apocalyptic game, and I’m going to use the T-Engine. I can learn Lua and a whole new engine in 7 days, right? Initially my idea was to be called “Mineshaft Gap”, a simple jokey game involving exploring caverns and killing commies. But as I started writing an intro text some of my darker designs crept in, and Broken Bottle began to take shape in my head.

Picking up Lua and the T-Engine from scratch wasn’t easy, especially since the documentation for the latter is very thin on the ground. My only real programming experience beforehand is making quite simple games in FreePascal. I had never used other people’s algorithms before, and even wrote my own line-drawing and circle-drawing code. This was more than a step into the unknown – it was a completely different world. My only reference source was a small example game provided with the T-Engine itself, and the utterly massive ToME4. Scary stuff!

On the first day I stripped out bits of the example module I didn’t want (like all the talent code) and started getting the interface set up in my desired style. This took… a crazy amount of time. Simply setting up a little list of the player stats was a mammoth task. I copied code from ToME4, I fiddled, I tweaked, I went through error after error until finally it began to take shape. I made rats and dogs as my first basic enemies, and used the standard dungeon generator that comes with the engine. At the end of day 1 a very very basic game was in place, and I continued adding things bit by bit. Most of Sunday was spent tweaking the interface more to use only washed out colours (annoyingly the T-Engine over-rides this in certain areas) and gave a simple end-game. With the start and end done I just needed a middle.

ToME4 screenshot

Much code copypastad courtesy of ToME4 - many thanks to DarkGod! Wish my game looked so pretty :(

Lua was easier to get used to than I expected. The only thing I had to look up was how to comment. The T-Engine is a bit more mysterious though, especially as I’d never worked with multiple code files and object-orientated stuff before. Some things came easy, others were aggravating. Putting in an inventory system was pretty painless, even though I’d never coded items before – the engine sorts out most of the grunt work. Making weapons cause extra damage in combat took many painful hours though, as I tried various approaches and encountered problem after problem. DarkGod was very useful on IRC, but he wasn’t always there, so I was often in the dark, tearing my hair out as I tried to understand the errors.

On Tuesday I started writing some story pieces in work. I hadn’t planned to have much of a story, but it all just came naturally, and I’m quite proud of what I wrote (it’s the highlight of the game really). I had to physically stop myself putting in too much humour. As it is I partly regret the Palin reference – it’s just wrong in tone. The last thing I wanted is a game plagued with poor reference-based humour like Fallout 2. Getting the hallucinations/dreams in took some work, as did having them spread out the right amount so they’re not seen too quickly or so far apart that they’re never seen in the game. As it is I guess the drunken dreams should come easier, but I’m happy enough with the implementation. I also added in alternative descriptions to most enemies for when the character is drunk, with the intention being to have the world feel different when inebriated. I never got to fully expand on this as much as I would have liked.

Broken Bottle hallucination example

The story became important for me, both for its own reading merit and setting the grim scene

As the days went by I got very worried – a lot of important features were still missing, like negative effects from alcohol abuse or withdrawal, and every bit of coding always took longer than I expected. Most importantly I needed the piranha mechanics. The piranhas were an idea I’d had for a long time (inspired by Brazilian street kids) and the game wouldn’t be the same without them. With a bit of help from DarkGod though I manage to get them stealing and running away – the code itself is actually very simple, since most of the work happens engine-side. He also helped me with making them flee from gunshots (and with making gunshots even happen). I’d initially wanted the children to only approach the player in packs, but I scaled back that idea due to time constraints. I’m very happy with how they are in the game, and every time someone tells me “I hate those fucking piranhas!” I know I have done my work well :)

The last night of coding was painful, as my to do list was still very long. My girlfriend was staying over and she really didn’t appreciate me staying up coding till 5am :/ But I was still trying to get combat working properly, and every change I made just seemed to make new errors. I was sleep deprived from the week in general, and doing the most basic correction was an effort of will. Eventually I got the combat doing what I wanted, I retuned various things and got the game shipped out 4 hours before my 9am deadline. Ah, the sweet slumber that welcomed me after…

Broken Bottle piranhas

Fucking piranhas! :P

Alas, the game had some bugs. Nothing game-breaking, but the 1.1 release was still vital. It fixed a big bug with the piranhas stealing items (I forgot to give them inventories for the items to go *into*) and a bug when trying to kill yourself, whilst also tweaking a few things. I took the opportunity to add character sheets (copied some stuff from ToME for that) and removed HP regen based on feedback that it was too easy to just rest up between fights.

1.1 ain’t perfect, but I’m happy enough with it. It’s not exactly a work of art that will move you to your soul, but I hope the somewhat unnerving story and atmosphere will be appreciated by some. If I were to go further I’d add far more varied text to the game, with different combat messages based on enemy type and weapon type and drunkenness. I also had plans for achievements (well, “traits” – some would be negative) that never made it in. There might be some other tweaks too, like changing the effects of alcohol, and some of the dialogue could do with being more Americanised (I wanted a Grapes of Wrath feel to the language used). As it is I’m proud enough of doing what content I did get in and working, and the linear nature of the game doesn’t make it replayable enough to really justify updating much further. And, after all, it’s a 7drl, and my 7 days are long up.

Watch this space for a report on the highlights of the 2011 7DRLs. I’ve reviewed 28 so far…

  1. March 28th, 2011 at 02:45 | #1

    Withdrawal will cause random losses of stamina, which get more severe the further into withdrawal you progress. However you can still regen stamina normally, so playing on is still possible, though low stamina equipment is best used. When on very low stamina you are far less likely to hit in melee. Of course the problem is that the best way to restore stamina is drinking, so remaining teetotal is exceptionally hard. Originally I intended to have far more varied withdrawals effects, but I had problems getting them implemented, so the stamina reductions were a quick hack.

    I did not drink whilst developing the game, as it was made in only 7 days and I was particularly unsocial during the week. Also trying to code whilst hung over is a nightmare… :P

  2. Addict
    March 27th, 2011 at 06:02 | #2

    Mr. Developer,

    Speaking of broken bottles, I assume that you had undergone to some drinking during your project?

  3. Addict
    March 27th, 2011 at 05:58 | #3

    What a cool concept, hehe.

    I was just wondering what happens if the main character/hero/heroine of the game did go into withdrawal and had all stamina depleted? The rest button wouldn’t help too much, would it? I guess that means at least the melee attack is disabled since the (drunken) hero/heroine would be unable to keep focus in the pro-long withdrawal stages?

Comments are closed.