2010/11/18

Making Powers Configurable

v0.10 added hero powers in a pretty crude way. I added power variables as needed until the entire first set was complete. With that finished, now I need to move all the powers out to config files.

Power config files will contain variables like name, description, requires_mana, animation type, graphics and sounds, etc. Then I’ll have to modify the PowerManager class to handle any variation on powers, instead of branching on specific powers. PowerManager will also handle an arbitrary collection of images and sounds.

The Powers menu will be changed under the hood. A config file will allow slotting any power into the given slots. Powers could be swapped out. New powers could be added for even-numbered stat combinations. In the future, the entire layout of this menu will be configurable (but probably constrained to the given window size).

Each power will still rely on a base type. Current base power types:

  • consume (for single-use items like potions)
  • nonDamage (various special effects)
  • missile (Shoot, Piercing Shot, Shock)
  • missileX3 (currently only used by Multishot)
  • groundRay (currently only used by Freeze)
  • single (nonmoving area attacks that are dangerous on a single frame, like Burn and Quake. Includes melee attacks.)

New power types will simply be added as needed. I don’t mind having base types that are very niche (only used by one power) but it would be nice if I can generalize them (e.g. turn Missile x3 into MultiMissle that can handle X missiles separated by Y degrees. Should be possible to make a multimissle spell that, for instance, shoots missiles out in a complete circle around the player). Ground Ray will still be pretty niche, but at least similar powers can be done with a different visual style (e.g. a flame wave or shockwave).

Hooks will need to be added for powers that work in special ways. E.g. Block is an entire state, not just a power that occurs briefly. Vengeance is a power that is activated and expended in areas of the code unrelated to Powers in general. In the case of Block, it might simply need to be its own power type. Vengeance could belong to a new class of powers that trigger upon attack (Life Stealing could be added to this type).

All this effort so that we can easily slot powers for monsters…

Enemy Powers

Enemies don’t have PMOD stats in a meaningful way. Instead, enemies will have four fixed slots for powers.

  • Physical Melee (usually a melee swing attack)
  • Physical Ranged (shooting a bow/crossbow or throwing a projectile)
  • Magical Melee (a close-ranged spell)
  • Magical Ranged (often a missile spell)

Furthermore, enemies will have % chance per frame of activating these powers. This % can be zero (e.g. some creatures can simply have no magic, or no ranged). First, the enemy will determine whether he’s in melee range or physical range. Then, a random chance to active the appropriate powers.

Each power (in the config file) will have a unique numeric ID. Then, each enemy file will allow assigning these power IDs into the four creature power slots.

Further behavior will be determined by simple % chances to act. E.g. some creatures will favor staying at ranged, so they will not approach the hero (instead, staying back and using ranged powers).

2010/11/16

Cave Tilesetdef

The “Tilesetdef” file for the Cave tileset is complete and checked in.

For those wondering, this is the file spec:

The first line is the name of the .png file for the tileset. It’s assumed this file will be in the images/tilesets folder.

Each line after that contains the following data:

  • index,x,y,w,h,offset_x,offset_y

where

  • index is a two-digit (always two-digit) hex value from 00-ff. This corresponds to map layer data in the map files (note, often the map files are encoded in decimal instead, so you might have to do the conversion to match them up)
  • x,y is the top-left corner of this tile image
  • w,h is the width-height of this tile image
  • offset_x and offset_y describe where the tile should be drawn in relation to the base/floor tile slot. Assuming a rhombus-shaped isometric tile, the offset (0,0) is the exact center of the rhombus. Screen left (-x) and up (-y) are positive offsets.

Tilesets are not arranged exactly the same way each time e.g. swapping tilesets on a map does not yield a usable map. But the tiles are put into these basic categories. (The categories above 0f are not enforced in any way, this is just to help keep them organized)

  • tiles 00-0f are reserved for collision types
  • tiles 10-3f are floors
  • tiles 40-7f are walls
  • tiles 80-bf are standalone objects
  • tiles c0-ff are oddly-shaped, multi-tiled, or special tiles

2010/11/14


Cave Tileset

The first version of the Cave Tileset is complete. Check it out over at Open Game Art! I still need to create the tilesetdef file so it can be used in-game. I might get around to that tomorrow.

Rather than create full cave maps now, I’m sort of doing cave room sketches in Tiled. Putting together interesting set pieces. Then, later, it’s just a matter of copy/pasting and connecting them up to make larger, thematic caves.

Cave Sketches

Cave Sketch

In the above render I’m experimenting with a serene sort of cave with a monolithic rock surrounded by water. I love when game maps have landmarks that don’t require explanation but instead leave you in wonder. Also, you see I’m using cave litter sparingly. Too much and the scene is cluttered; too little and it seems empty and unfinished.

Cave Sketch

Here’s a hub room for a mining operation. Would work great as a classic “first dungeon” for a young, frightened adventurer.

Cave Sketch

You are in a maze of twisty little passages, all alike.

2010/11/11

File Format Changes

I made two small changes in some of the file formats. I wanted to make these changes now before too many people rely on them. Basically these new values make much more sense.

  • Save game spawn line (x,y) location is now tiles, instead of map units
  • Map Event location (w,h) is now actual tile width/height, not (w-1,h-1)

If you try the latest code and want to preserve your save game, simply delete the entire line that starts with “spawn=”. This will cause you to spawn at the beginning of the starting map, with everything else intact.

Contributor Map

I put up a new Google map showing contributors from around the world. It’s rather blank so far; I’m contacting major contributors now to get permission to pin them to the map! (If you have contributed, please contact me!)

2010/11/02

Art Week

I have next week off from work. Staying at home. Letting the brain rest. So I’m also putting a moratorium on new osare code next week.

Instead, I’ll spend the week relaxing and making osare art. I’m hoping to put together the beginnings of two new tilesets: grasslands and caves. I started making grass and water tiles way back, but I think I can improve on them now.

2010/10/29

And next up…

Version 0.11 will likely center around monsters. Now that the hero has Powers, it’s only fair if we get skeletal archers and goblin witch-doctors.

Features coming up soon that will probably go towards 0.11

  • Monsters will have four slots available for powers: physical melee, physical ranged, magical melee, magical ranged
  • Move Powers to config files so they’re easy to alter/add
  • Add A* pathing to help monsters navigate around obstacles
  • Enemies enter combat when their nearby ally enters combat
  • Render a few equipment variations of existing monsters

Anything much further ahead is wildly subject to change, but here’s a rough roadmap to the future. Some of these might be broken into multiple releases.

0.12

  • NPC Vendors
  • NPC Dialog
  • Very primitive quests

0.13

  • Title Menu
  • Load/Save Game Menu
  • Character Creation Menu

2010/10/17

v0.10 Progress

I have most things I want done for v0.10. The only thing I’d want to add in this release is placing potions on the action bar. But seeing as there isn’t an easy way to get potions right now, it isn’t an immediate priority.

Time for testing. If you try the current source from Google Code let me know what you think.

For this upcoming release I will include a good README file that explains controls and what works vs. what doesn’t.