2010/05/24

Containers and Switches

I added support for map containers and switches. Currently these are all “pressure plate” type activation, where you merely walk onto a certain tile area to interact. In most games of this genre you click on objects to interact with them: I’ll add this method soon.

To accomplish these interactions I have two new Event Components for map events: mapmod (edit the current map) and soundfx (play the specified sound effect once). Each map event can have up to eight components. As an example, here are the Event Components for throwing a switch that opens a portcullis:

  • mapmod to change the switch tile from position a to b
  • mapmod to change the portcullis tile from closed to open
  • mapmod to change the collision under the portcullis to walkable
  • soundfx to play a “door opening” effect

Powers Update

Thinking about Powers again. I want to remove passive powers and separate melee vs. ranged powers. The new working list:

Physical Offense
- Shoot (basic ranged attack)
- Rip Strike (melee attack that causes Bleeding)
- Multi Shot (ranged attack that fires three missiles)
- Cleave (melee attack with a wide area of effect)
- Piercing Shot (ranged attack that ignores armor and goes through enemies)

Physical Defense
- Swing (basic melee attack)
- Shield Block (raise shield to increase defenses)
- Warcry (remove debuffs and scare enemies)
- Charge (rush and knockback a target)
- Vengeance (after blocking, deal an accurate heavy attack)

Magical Offense
- Lore (get more info about items or nearby landmarks)
- Arcane Bolt (missile that bounces to another enemy)
- Earthquake (stun nearby enemies)
- Freeze Ray (slow enemies in a straight line)
- Burn (burn enemies in a large distant area)

Magical Defense
- Return (teleport to a previously-discovered safe point)
- Heal (restore health)
- Magic Shield (absorbs damage)
- Teleport (instantly appear at target area)
- Time Stop (freeze enemies for a few seconds or until you act)

I’ll make new icons and update the Build Calculator and Powers pages soon.

2010/05/19

Footsteps

I added footstep sound effects to OSARE (look at the Google Code link for the bleeding edge stuff). The game’s animations are frame-based not millisecond-based so everything slows down when framerate drops; thus I need to play a new footstep noise every time (I can’t just put it on a timed loop).

Oddly, SDL_mixer was having trouble playing sounds this rapidly (2.5 steps per second when running, it would simply skip playing some steps). I toyed with settings until something worked. On the initialization call Mix_OpenAudio(), I changed the last argument from 4096 to 1024 and it made a difference. It seems to work now in OSX and XP. But I don’t know why changing the audio buffer there makes a difference.

I started having the same problem when adding new sound effects, even with the buffer at 1024. I found that reducing their quality (stereo to mono, 44k to 22k) helps. I’m not an audiophile so maybe I’m doing this the wrong way.

2010/05/16


OSARE v.0.05

OSARE version 0.05 is now up.

  • Added map transitions
  • Added a starter dungeon with three wings named Averguard Hold (click for map)
  • Added support for hex or dec map data format
  • Changed definition files to use = instead of :
  • Upgraded zombie steering AI. They now pursue to where they last saw the hero.
  • Started refactoring to prepare for more monster varieties
  • EnemyManager now holds enemy sound effects, so that we only load one copy of each
  • I now use Tiled 0.4.1 to edit map layers
  • Reminder: use the command-line argument -f (or –fullscreen) to play in fullscreen mode.
  • Changed the tileset to use magic pink as the transparency and removed the tileset alpha layer. This should improve performance on most systems.
  • Note to self: in GIMP set Alpha Threshold to 32, then remove the alpha channel onto magic pink.

Download

Upcoming

I’m gathering my resource files (especially the Blender and Tiled files) for a new download archive. Also soon I’ll be putting stuff into Google Code for easy perusal and tracking.

2010/05/15

Editing OSARE Maps with Tiled

I’m using Tiled to do most of my OSARE map editing. Here’s how my current process works:

  • I have specially-made tileset images for Tiled. The indexes for those correspond to the OSARE tilesets.
  • I edit background, object, and collision layers in Tiled.
  • In Tiled 0.4.1 I use the “Store tile layer data as: CSV”
  • I use a text editor to copy the three csv sections from the .tmx file into my OSARE map files
  • Currently I still create the headers, events, and enemies in a regular text editor. I use Tiled’s status bar to get my cursor location to get placement for events and enemies.
  • Note that the Tiled tileset isn’t a perfect copy of OSARE’s tileset. I left it brighter to be easier to see when editing. Also some irregular shaped tiled are cropped to work in Tiled.

There are two types of collision tiles. Empty (0) is no collision. Red (1) is full collision which blocks movement, sight, spells, arrows, etc. Blue (2) is partial collision that only blocks walking, but sight/spells/arrows/flying is still allowed. Blue is used for low obstacles the player can see over and for water/chasms.

Files:

2010/05/09

Tiled

Today I tried using Tiled to edit maps for OSARE. It took a bit of work to set up, but I think it’s worth it.

My maps use CSV for tile data. The latest Tiled release (0.4.1) supports writing map layers in CSV. So I can use Tiled to edit maps, then just grab the piece I need from the output XML file.

Tiled expects tilesets to have consistent tile sizes/spacing, but I pack tiles in my tileset to save space. So I made a new tileset image for my dungeon tiles where each tile is 64×128. Tiled handles this tileset beautifully. I still use the packed tileset for my game, for performance.

Tile index 0 is blank space in Tiled and in my engine. The first tile on the tileset image is given index 1, so I have to position the tiles accordingly.

Also, the CSV map format uses decimal; OSARE uses hex. The easiest thing is to allow map files to define the layer format it uses, that way I can copy/paste layer data directly from Tiled files.

Tiled will be great for laying out the map graphics. With a bit of tinkering I think I can make enemies and events with Tiled’s Object Layer.

Check out this map I’m working on and the accompanying dungeon tileset.

2010/04/29

Free Gamer Blog plug

qubodup has plugged OSARE over at the Free Gamer blog. Sweet!

Map Loading

Collecting my thoughts on map loading. The following things have to occur to dump an old map and load a new one:

  • User steps on a tile tagged with an event.
  • A flag is set to load a new map, with the new map filename and position taken from the triggered event.
  • GameEngine needs to check for this flag because it is the parent of the following objects.
  • MapIso::load(filename)
  • EnemyManager::handleNewMap() // add function to remove all enemies
  • HazardManager::handleNewMap() // add function to remove all hazards
  • Add logic to TileSet: if we already have the correct tileset we shouldn’t reload it.
  • Set the Avatar (x,y) to the trigger event’s destination (x,y).
  • Change MapIso and TileSet to interpret tile indexes as hex 00-ff instead of dec 00-99

2010/04/28

Looking Towards 0.05

I’ve been pretty busy with life and work, so I haven’t really touched anything yet for 0.05. The first step is to narrow down what sounds fun to work on. If I think about the project as a whole it’s overwhelming, but if I focus on a short list of tasks it’s manageable.

Category 1: Map Interaction

  • Map interaction (switch toggle, open door/chest/crate/barrel, extinguish brazier)
  • Map interactions that edit the map (throw a lever to open a secret wall)
  • Map “pressure plate” triggers (e.g. traps or portals)
  • Runtime map unloading/loading

Category 2: Menu Interaction

  • Word Wrap support for font class
  • Upper ASCII on font graphic
  • Draggable Icons (Powers and Inventory menus)
  • Icon database

2010/04/20

Commissions Update

Several artists have contacted me in the last couple weeks to see if help is needed on OSARE. I’m already blown away with the interest in this very early project.

At this point in the project I’m not interested in forming a “team” (simply because that sounds too much like work to me). I can do a significant amount of the game art myself, and the rest I pay commissions to get specific tasks done. Especially for areas I’m not strong in: concept art (I’m a very left-brain artist, so I need creative help), music (not a composer), and items that require good painting skills (finished icons, portraits, etc).

Unfortunately, real life has interrupted my commission plans. I will have to put new commissions on hold for at least a couple months. My car died two days ago. I’m digging into my savings to get a new one. Until I get adjusted to these new payments I won’t know how much I have to spend on commission work.

In the meantime I can work on getting more features into the engine. Really, the bulk of the commission work will happen when OSARE is in beta (mostly feature complete) and production on an actual game begins. At the current pace, OSARE will be close to feature complete in Fall 2010.