Tuesday, September 29, 2009

Ighalsk - release 0.1.8

I've just released Ighalsk v0.1.8: you can download the source code here.

Changes since the last release include:
* Throughout the code, Profession has now been replaced with Epithet. That is, Heroes now have an Epithet, which summarises their powers. This brings out more clearly that the powers and abilities of a Hero are inherent rather than the result of training. It also implies (at least in my mind) that the Hero is unique, and shouldn't expect to run into opponents with similar powers and strengths when following Quests.
* The available Epithets for Heroes are now "Mighty", "Philosophical", and "Blessed" (as described here). That is, instead of "Joni the Warrior", a Hero would now be called "Joni the Mighty".
* When generating a level, corridors are now checked whether they overlap with existing open spaces before they are placed (and won't be placed if they do overlap). This makes evading monsters considerably easier - previously, the corridors were too tightly packed together and often did overlap; now, monsters often get stuck and have to wait until the Hero comes closer. (Yes, I guess I could implement path-finding (or at least a look-ahead of a few moves) when I get a spare couple of months, but I'm concerned that that would also slow down the game, which seems to have slowed down already over the last release or two for some reason.)
* Increased the size and number of rooms and corridors in levels, while keeping the number of monsters the same. This goes with the above change - now there can be more rooms and corridors without them being tightly clustered together. Reducing the monster density also means that there's not such a desperate scramble for survival when the Hero first enters the level. I'm still not altogether happy with how the rooms look on a level - the BSP algorithm mentioned on Roguebasin looks like it would generate better-looking levels.
* A Hero now has different physical, mental and spiritual strengths, depending on their epithet; a strength may add to the weapon damage, depending on the weapon. In particular, Mighty Heroes have physical strength of 4 and other strengths of 0; Philosophical Heroes have mental strength of 3 and other strengths of 0; Blessed Heroes have spiritual strength of 2, physical strength of 1 and mental strength of 0. So for example, a Mighty Hero using any bladed, blunt or piercing weapon will get 4 extra damage with that weapon; a Blessed Hero with such a weapon would get 1 extra damage, and a Philosophical Hero would get 0 extra damage. The exact values, as with so much else, will get balanced later, when the combat system is stable.
* Added a Character screen which displays the Hero's attributes, including the total resists (due to armour worn) for different weapon (damage) types such as fire, blade, or blunt, and the damage that the current wielded weapon will do, due to both the weapon itself and the Hero's strengths. This screen also displays the gold that the Hero is carrying; previously, the only way to know how much gold the Hero had was to try to buy something from a shop.
* Added descriptions of quests, which can be accessed from the Palace screen. This involved a few unexpected fixes, in that the description is read in from a text file and reformatted - but then spaces have to occur in the right places, I wanted to be able to have paragraphs in a description, and a couple other minor problems. Still, hopefully I'll be able to reuse the same format in other places (like monster and epithet descriptions).
* I also replaced one system test with a unit test for speed and simplicity - the unit test should still catch the same bug that the system test was designed to catch.
* Similarly, I refactored the Movement class to simplify it: it now only sends messages to one viewer object, where previously it also sent them to each viewer object in a list. (In the current implementation, there was only ever one viewer object in that list.) If necessary, with the refactoring, the sole viewer object could always forward messages to other viewers on a list - but I doubt that that will be necessary for this game.

Next I might focus on monsters again. I'd also like to introduce variable damage for weapons, probably using a Dice class. The constructor method for this class would take a string of the form "4d5+6", which would represent 4 dice, each with 5 sides, with 6 added to the result. (Or if you'd prefer, each die could have 20 sides, and each number could be repeated 4 times.) Each dice object would then have a "roll" method to randomly generate a value.

I would like to also introduce monster memory sometime soon - that's memory that the Hero has of monsters, not memory the monsters have of the Hero. It might be helpful to know what a Bladeworm or Nightcat looks like, though hopefully a Vampire Moth is self-explanatory ...

Tuesday, September 1, 2009

Ighalsk - release 0.1.7

I've just released Ighalsk v0.1.7 (you can download the source code from here). A lot of little things have changed since the last release:

  • The Monster Editor can now be navigated using buttons as well as keys; it also supports more than 12 monsters.

  • The Hero (PC) can now die - yes, this is a necessary feature - perhaps unfortunately; I've been playing "Lego Star Wars" with my son, and it is refreshing that characters in that game just fall apart and quickly come back together again after dying. There have been some interesting discussions of permadeath in roguelikes recently here and here.

  • After examining an item, the next screen is either the Inventory or the Equipment screen (whichever screen the item was examined from). Previously the next screen had been the map of the current level; I've now implemented a stack of states, pushing the old state onto it every time the state changes, and popping off states after examining an item. This should be useful for other screen transitions as well.

  • Treasures are now generated and placed randomly on quest levels, and can even be picked up by the Hero.

  • There's also more to buy with treasure: I've added 3 new, more powerful and more expensive weapons in the Weapon Shop, one for each type of Hero (profession).

  • I've added 9 new monsters, using the Monster Editor, and 2 new families of monsters (worm and plant).

  • This gave me enough monsters to fill in level 2 of each of the 3 quests.

There were also a couple of small refactorings that shouldn't affect game play but will make the code easier to maintain and extend.

These aren't present in v0.1.7, but here are some draft descriptions of the different types of Hero (originally mentioned here):

You were born with strength and athleticism far surpassing those of ordinary men and women. You are trained in the use of an incredible variety of weapons, and in the tactics of war. You have wrestled bears to the ground, defeated a squad of enemy soldiers single-handed, and executed flawless tactical retreats.

You are divinely blessed. You have been given the gifts of healing and protection. You are called on to fight evil and bring peace to the land. At your approach, flowers blossom, birds sing more sweetly, and undead gibber in terror.

You have spent many hours studying books and in the company of your own thoughts, and thereby learnt many mysteries. You can influence the universe and shape matter and energy using only the power of your mind. You have also practised the arts of argumentation, and can use them to reduce untrained and unshielded interlocutors to a state of helpless confusion. You know the names of stars, the greater and lesser syllogisms, and the secret delights of pyromania.

A friend also suggested another type of Hero, which I'm thinking of calling *Cunning*, but this type needs more features to support it and so might not make it into Ighalsk for a few releases yet ...