Witherwyn: Now with Shiny Things!

v. 0.02 demonstrates:

  • Simple melee combat, with Player vs. Monster and Monster vs. Monster
  • Rudimentary inventory support
  • More object-oriented map structure
  • Reworked tile and entity management system
  • Roguelikes are apparently notorious for the number of rewrites their code bases require before one can complete a finished game. I did my first one this week. I decided that my goal of having user-edittable resources was all well and good, but was complicating the process of managing tiles and managing entities (the player, items, monsters, ect…). The key problem is that you can let the user make up new tiles easily, but it’s difficult to make the random dungeon generator understand where and when to use them. At some level, this information has to be hard-coded. So I bit the bullet and did that with the new GameData class which replaces the TileSet and TileResolver classes.

    Inspiried by looking at the source to IVAN (also known as “Iter Vehemens ad Necem”), I decided that I would be better off if I changed the MapElem struct into a full-fledged object. I did this and moved some of the map logic into the new MapTile object. Most people on rec.games.roguelike.development said this was an unecessarily wasteful way to go. A lot of respondents were UNIX clerics and think that using ten extra kilobytes is a Big Deal. I saw no difference in Witherwyn’s memory footprint after the change.

    I got some simple melee combat working. The game crashes if you died, though, so try to avoid it. To attack a boogaboo, just run into it. In the future I’m going to add floating number animations above the target of an attack which shows how much damage was taken (like the Blademaster doing a criticial strike in Warcraft III). In the near future, you will be able to equip weapons and armor.

    I subclassed Entity into Critter and Item objects. Critters re any Entity that has an inventory (the player and monsters). Items are anything that can be picked up. Inventories hold items. Pressing ALT-I or clicking on the “inventory” menu item will open the inventory window. Eventually the items shown there will have context menus for manipulating them. I’m going to augment the inventory screen with an equipment list so that you can drag and drop items onto your character to equip them.

    Witherwyn Google Count: about 30

    Leave a Reply

    Your email address will not be published.

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Notify me of followup comments via e-mail. You can also subscribe without commenting.

    Next Post
    »