Wednesday, March 31, 2010

Dweller is running on Blackberry devices!

Previous versions of Dweller have unfortunately not run on all Blackberry devices. The game used to crash on most models. The cause of the crash was actually a rather interesting one. In older versions of Dweller all game data (monsters, items etc) were compiled into the code through a single auto generated static class. The class was generated by a parser tool that parsed an XML file containing all the game data. Due to the size of this class and all the static data it for some reason caused a crash and the rather cryptic "invalid constant pool index: 0 in " error message.

So, why didn't I use the XML file straight up and parsed it runtime instead of doing this complicated XML to static class thing? I did it for two reasons: 1) File size. The XML file would take up much more space than a compiled (and obfuscated) class file. 2) XML parsing on J2ME handsets is no piece of cake. There are XML parsers out there, kxml for instance, but they aren't very easy to work with.

My solution to the problem was to convert the XML to class parser into an XML to binary data parser. The parser spits out a couple of streamlined binary files, ready to be read back at runtime by the game. And that did the trick! Blackberry users around the world, rejoice, play and have fun!

Tuesday, March 30, 2010

Dweller 0.14.1 finally released!

I am happy to announce a new release of Dweller, my mobile roguelike. Dweller is a fully playable, completable and bite sized roguelike perfect for boring meetings, train rides and any other time when you need a time killer.

The most notable changes are the improved AI, the improved game balance, the introduction of weapon speeds and two handed weapons and items that increase your light radius.

Full changelog at can be found here and download and installation instructions here.

Have fun!

Tuesday, March 23, 2010

Benromach

During my recent visit to Scotland I had the pleasure of visiting Benromach. This beautiful small distillery, owned and operated by Gordon & MacPhail, is located just outside Elgin. The contrast between huge distilleries like Glenfiddich and Macallan and micro distilleries like Benromach (not sure if that is the correct label to put on Benromach, but in terms of production capacity they sure ain't big) is obvious but of no significance when it comes to the quality of the end product. On the contrary it was smaller distilleries like Benromach that surprised me the most. The standard 10 yo was a joy to taste, and I was struck by the complexity of such a young whiskey. It was also a nice surprise to see a distillery doing some organic bottlings, both peated and unpeated.

New Dweller release imminent

I am doing the final play testing for the next release of Dweller. It's been all too long since I released a new version. The list of changes is really long and should result in a much more pleasant and varied experience.

New features
  • A new door type has been added, the gate. It blocks movement but not line of sight.
  • I have received a lot of help over the years. People that have assisted me in one way or another are now acknosledged in the new Credits & About screen, reachable from the main menu.
  • Added a couple of items that increase the light radius
  • Added two handed weapons that prevent the use of a shield
  • Added items of better or worse than average quality, prefixed "Fine", "Worn", "Strong" and so on
  • Introduced weapon speed to allow for different playstyles using either hard hitting and slow weapons or fast weapons that hit for less
  • Some monsters can now be generated in packs
  • Improved fleeing and pursuing AI behavior
  • Monsters no longer step on known traps
  • Flying monsters (bat, wraith and beholders) are no longer affected by traps on the ground
  • Only intelligent monsters can open doors and pick locks. Stupid monsters need to rely on brute force to get passed a closed door.
Changes to existing features
  • Bashing open a door varies in difficulty depending on if the door is locked, jammed, or if it is a gate
  • The ranger has an increased light radius
  • Hitpoints are always increased by 1 when gaining a level
  • Visibility in the starting forest is no longer limited by the player's light radius
  • Weapons with an added effect (Fire, Poison etc) no longer rely on the player's Magic stat when determining effect
  • The bottom stats bar area is no longer taking up screen space on views that doesn't use it
  • The damage from attacks and spells is now determined using a slightly skewed gaussian distribution instead of a linear
  • Wands now have a limited number of charges. There is currently no means of recharging a wand
  • Items are now ignored when cycling through targets
  • When having an item with a beneficial effect selected in targeting mode only friendly creatures will be cycling through targets
  • When having an item with a harmful effect selected in targeting mode a hostile creature is selected by default instead of starting centered at the player
  • Targeting mode automatically targets an enemy if none is already targeted (previously the player was targeted)
  • Minor change to the Drop one/all menu. If a single item is selected the Drop one/all will be replaced by a simple Drop command
  • Damage done and taken is no longer linear. There is less probability to do max damage.

Bugfixes
  • Solved a fatal bug in monster movement code that could move the monster out from the map (and crash the game)
  • Ammo with a limited amount is no longer kept equipped when depelted
  • Removed double "You are no longer poisoned" messages when leveling up while poisoned
  • Removed double death messages when killing a creature with a ranged weapon using enchanted ammo
  • Made sure that tiled levels (the dungeon and sewer) are surrounded by an impassable border of wall tiles
  • It is no longer possible to go back to a finished game after killing the Goblin King
  • You will now get a proper win if you return to a saved map with the Goblin King on it and you kill him
  • Solved the problem with text flooding the bottom edge of a text box
  • Solved a crash bug when explicitly saving a game with persistent maps, leaving the level, coming back and loading again
  • You can no longer save scum chests. A chest will always contain the same item, no matter when you open it
  • You can no longer save scum scrolls of enchants. The result of a particular scroll of enchant applied to a particular item will always give the same result
  • Solved a potential problem when dropping parts of a stack of items or when cloning a monster
  • It is no longer possible to resist magic cast by yourself on yourself (for instance resisting own teleports)
  • Damage caused by displacement/knockbacks no longer reduce max hitpoints
Stay tuned for a release message here and on rec.games.roguelike.announce in a couple of days!

Monday, March 15, 2010

The 2010 Seven Day Roguelike competition has ended

This years seven day roguelike (7DRL) competition was recently ended with a record number of participating entries. I am really impressed by the number of entries that actually ended in success and playable games. I haven't had time to play them all yet, but I hope to do so in the coming days. I'd like to congratulate everyone that participated (success or failure alike). Well done guys!

Itemization woes pt.2

My quest for well balanced weapons (and in the long run armor and other items) is well under way, and I hope that the next release of Dweller will give the player a lot more choices and allow for different play styles combat wise. The most recent addition after differentiating item attack speeds is the introduction of two handed weapons. Two handed weapons will of course prevent the use of a shield while wielded, but will do slightly more damage and/or have an added effect such as a knock-back or stun effect. Other things I have thought of adding would be class restrictions, but I'm not so sure if that is a good idea. I'm leaning towards simply giving weapons and items stats that make them more attractive to some classes while being shunned by other classes. I'm interested in hearing fellow game developers experience with item balancing. Where to draw the line?

I have also added two basic weapon qualities besides the normally generated weapons. In the next version you will have a chance to come across weapons of a better than average quality, prefixed with "Fine" or similar attribute and weapons of worse than average quality, most likely prefixed with "Worn", "Dull" or similar.

Saturday, March 13, 2010

Itemization woes

In previous releases of Dweller there has been little reason to pick up and use a lot of the items available in the game. A lot of items were not balanced and almost no situation in the game justified use of them. I am trying to rectify this problem in the upcoming release, but even with such a simple game as Dweller it makes for a hell of a challenge. I can really picture the nightmarish endeavour of balancing a game such as World of Warcraft with thousands upon thousands of items, loads of stats, ten different player classes, a multitude of talents and spells. No wonder Blizzard has decided to simplify item stats in their upcoming major content release Cataclysm, due sometime late this year.

In previous releases when I have added weapons and other items it has been done without much thought. I've simply tried to assign stats that I thought might be representative of the item in question. A lot of times this has gone wrong and the item was rendered mostly useless. This time around I'm taking a much more pragmatic approach, using spreadsheets and graphs to try and balance an item in a way that doesn't make it the best item in the game, and everything else becomes useless. It's challenging and fun, and already after only a few hours of tweaking I think I have something much more balanced.

The whole process has had a side effect as well. The game has become slightly more complex. Dweller is meant to be a simple game without too many paramteres to care about, but when it came to balancing out items and allowing for different play styles it was too simple. The Broadaxe was the weapon of choice if you were a warrior. Nothing else could beat it. Now I've introduced an attack speed as well, and by doing so I have opened up for more variation. Now you can either go for big, heavy, slow weapons that deal massive damage, but at the same time gives your opponent more shots at hitting you, or you can go for light and fast weapons that deal less damage, but allows you to hit more often.

Friday, March 12, 2010

To open source or not, that is the question

I have recently been debating with myself wether to open source my roguelike game, Dweller, or continue keeping it closed source. Don't get me wrong, I think open source is good in so many ways, but I've grown very fond of my project and it feels as if I would lose some of the control of the code when opening it up to the public. It's a bit like when your kid starts kindergarten or fist class in elementary school. It's about cutting the umbilical cord and accepting that you won't be the only one for your little project anymore... silly, but still, that's how I feel. I think I need to go ahead with it and I have already started a Google Code project and checked in auxillary code (map and game data parsers). I just need a little more time to clean up some stuff so I don't look like a complete noob when I do my first proper commit of the game code :-)

Thursday, March 11, 2010

FlashPlayer 10.1 and it's implications

I had an interesting read the other day when I read Tinic Uros interesting blog post Timing it right. First of all it was very interesting to get a confirmation of how the Flash Player main loop works. It is basically a polling loop run 120 times per second. It checks timers, local connections, video, audio, frames and actionscript and handles each of them in sequence before doing an update of the screen if necessary. I'm still not 100% clear on how this ties into the FPS you set in your movie. Does it still poll 120 times per second even if you run your movie on 2 FPS?

Anyway, what really caught my attention and got me worried is the way the new Flash Player handles SWFs on hidden broswer tabs/windows. It basically puts hidden SWFs into hibernation by limiting FPS to 2(!), decreases timer intervals and local connections and video. The thought behind all of this is basically sane. There are way to many sites that are massive resource and CPU hogs just because they are running badly written Flash banners or apps. It is not sensible for Firefox (and other browsers) to take up 30-40% of the available CPU time just because it is showing (or rather not showing if the window is minimized or the tab is hidden) a couple of SWFs. What gets me worried though is the implications for applications and games. As one of the comments points out:

"I am thinking about situations where I have an application that is rendering or calculating something in the background that takes longer. Typically it will show a "processing..." progress bar which will make people want to switch over to a new tab to check their mail or browse around to pass the time. Of course with the new timer this will be fatal since the calculation will go to a crawl."

I'm also worried about the limitations put onto the LocalConnection, even when visible. According to the post:

"Local connections are limited and aligned to jiffies. That means a full round trip from one SWF to another will take at least 33 milliseconds. Some reports we get say it can be up to 40ms.".

This will essentially put an end to logging tools such as Arthropod, Alcon and DeMonsterDebugger that make use of local connections to get the log entries out of the door. An application that makes heavy use of logging will push out more logging entries than the local connection can handle. With 33 ms per call it's "only" possible to do about 30 log entries per second, and that may not be enough for some applications. I am very pleased that use a flexible logging framework at work, and for a couple of years now use the SOSmax socket server logger.

Longmorn


I did a trip to Speyside, Scotland a couple of weeks ago. The trip was a massive success and I came home with a couple of nice new acquaintances. I plan to put these recommendations out one by one in the coming weeks and I'm starting off with Longmorn. Longmorn was one of the biggest surprises of the trip. I did not actually visit the destillery (it's only open by appointment and it does not have a visitor centre or shop). I got a taste (or actually quite a few drams) of it from the lovely couple who ran the B&B (Greenhall Gallery in Cragellachie) where I stayed. It was the owners personal favorite, and do understand why. The taste was really rich and complex in the 15 yo that I sampled and I must say I was surprised when I learnt that most of the Longmorn whiskey ends up in blends. Well worth a try and it's a definite buy for me!

In the beginning...

My intention with this blog is to post my observations on all sorts of things I find interesting, annoying or quirky. I do not know what will end up in here, but let me give you a bit of background that will help you and me guess what may end up in here: I work as a professional Flash developer, I play a lot of computer games, I have a love for retro gaming, I'm a father of a small boy and I absolutely love whiskey and good food. Here we go!