Saturday, 19 March 2011

Go with the (state) flow.

Been very busy with job and stuff since the last update, but work on the game has still been going on in the meantime. Mostly annoyances with a screwed-up state flow that was causing some very wierd behaviour from agents. Mostly in the message phases where agents, settlements and captains respond to messages from other entities. Also delayed messages were occasionally being repeated resulting in huge stacks of delayed messages.

But since last update:
- Properly implemented Retreat states for Captains and Agents. (similarly to the original, if a Captain dies, then his troops disband and run off back home. If their home has changed allegiance, they'll join that settlement's new allegiance.)
- Added Aggression (Min, Med, Max) similar to the original. (i.e., auto Max if attacked by another agent, or defending a settlement).
- Added Captains to anything larger than a medium settlement.
- Captains have 'Marauder' status, which determines whether they stay at home or go on conquests.
- Visual C++, XCode and Codeblocks projects. (I jump between them as occasionally something comes up I wouldn't have spotted on another platform. In particular, on OSX a 3rd party font library I was using was pulling a struct pointer value from a file { it must've dumped the pointer doing an fwrite of a struct with a pointer member } ... and on OSX it was pulling a 64bit pointer instead of a 32bit one, so the graphics were all garbled.)



I could be tempted to move into the graphical phase now, adding a Terrain class, etc. I think I will probably end up using Ogre to do the 3D part as it makes selection of 3D objects very easy, and also handles a lot of tasks that have very little bearing on the game itself. Also, I don't really want to waste time bogged down in certain areas. Ideally, the Game class will run in it's encapsulated form so that it can be plugged in with Ogre or anything else.

2 comments:

  1. Oh, you've got this. Yes, you'll need to add weapons (bows, etc) but this is exactly how melee combat in the original Powermonger worked.

    Are the worker units really collecting resources or are they just growing over time?

    ReplyDelete
  2. Ah yep! The Captains in Castles (the 2 in the movie) have Bows. You can't see it very well in the movie, but the Captains in settlements don't by default. This is why the Captains run out from the settlements.

    At the moment, I'm just using an enum for weapons (wpnBow, wpnPike, etc.). It should probably be a bit-flag though as folks can have multiple weapons and just use the best one.

    Also, the Captains, despite having bows, don't do anything for now, it's just melee implemented.

    The workers are completely wandering at the moment. They all have occupation "ocpDefault" which means they just wander about. "ocpFarmer", "ocpFisherman", "ocpShephard" etc. will get their own State Machines and start to do useful things.

    I figured I'd wait until I started on the Terrain engine before doing these as fisherman, etc. will need nearby water, etc. Also, designated Field tiles for Farmers to go visit.

    I've been keeping up with Inaria, exciting to see things going along with it (and the inevitable frustrations going that come part and parcel!). :)

    ReplyDelete