Jump to content
  • Advertisement
  • entries
  • comments
  • views


Sign in to follow this  




I've decided that I need to implement an aggro system. The turn-based scheduler works by giving each unit in turn a chance to move, and the camera follows the active unit, zooming around the map. While other units are moving, the player is idle. This means that if the map is heavily populated with units, it can be a long time before the player gets to move again. Seriously. Consider that the pacing is currently set at 1/2 second (tweakable). Given 10 movement points per round, that means a unit will spend 5 seconds moving. Granted, spellcasts and other actions can consume more movement points, but the animation staging for a spellcast consumes 3 turns worth of time, so if a spellcast is <3 movement points cost, then you're actually spending more real time for a given movement point. Only for actions that take more than 3 movement points to perform do you start to win back real time. Since many spells are small scale and small cost, I estimate an average of, say, 7 seconds per unit. Multiply by 40 units (where I currently have my test spawn set at) and you're look at 280 seconds for all of those enemy units to finish. That's almost 5 minutes of waiting for a single 10-point combat round. Ugh.

So my answer is an AggravationState component. Enemy units default to a sleep state, and sleeping units are not given a turn for the current round. When a round is staged, units are queried to see if they are willing and ready to act. For AI mobs, this query now involves asking the AggravationState component if anything has happened to make it want to act. Currently, this component does a radius sweep of the map to see if any enemy units are within sufficient proximity to trigger wakefulness. Additionally, as units move they broadcast an event on each hex they move, which all units listen for and which will trigger proximity wakefulness on any unit in range. (This second part is to account for movements that might bring the unit in range of an enemy for only a portion of the path; by rights, even that small amount of exposure should trigger proximity.) Currently, no line of sight is performed, although that is on my plate for this evening, time permitting. If a currently awake unit in an "awake" state (as opposed to "alert", "angry" or "enraged") finds nothing in its proximity sweep then it is safely put back to sleep. (Eventually, I'd like to provide an override for this, for units that shouldn't sleep.)

The aggro component is still in its infancy. It doesn't provide any LoS, no audio-based alarms, it currently doesn't implement damage tracking acts that might trigger an angry or enraged state, etc... and it's extremely easy to game, at least until I implement a proper turn initiative system for the units. But even still, it has greatly decreased the waiting time spent on heavily populated levels, and has brought back some of the intimate, tightly-connected feel that GC once had when it was still a single-pov action RPG.

Because screenshots are fun:


That is a first whack at an apprentice cauldron for brewing potions. Potions will mostly be used for stat boosts (permanent or temporary) although some crafting resources will come from a cauldron as well.

I'm in the process of sketching out a full, if small-scale, scenario as a true gameplay test. It should be fun.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!