Post news RSS What’s new: Attack/Defend flow, Actor Emotes, and Monster AI

Great progress today with full attack/defend flow (dodge/parry/block) now in, actor emotes, Monster AI, starting equipment, and more!

Posted by on

Here's what's new in the code:

Full attack/defend flow

I've fully implemented the meleeAttack action, which support dodging, parrying, blocking, and (if none of those happen) dealing damage. All of those are hooked into the event/action system, so they fully support buffs (increase to dodge, reduction to parry, etc) and ItemPowers (which are essentially buffs under the covers). Damage dealt takes the attacker's wielded weapon into account, and Damage reduction takes the target's armor into account to determine what % gets through.

Actor Emotes are in

I'd like to avoid the typical message log found in many roguelikes; one of the challenges is conveying what's going on without words. I'm attempting to tackle that in-part with Emotes which appear over Actors. These are either numbers or bubbled-icons; numbers are used to display damage dealt or healed, and bubbled-icons show a variety of information about the Actor; e.g. they've just aggro'ed:


or Blocked:


Parried and dodged have similar icons. I've opted to not put the emote bubble around attack actions, but may change that. I'm not a huge fan of the visual, but am mostly working to get the infrastructure working right now. The emote have a nice little bounce effect as well and also fade in/out.

When an actor takes damage or gets healed, a number emote animates over their head:


Basic monster AI

Monsters now have aggro state (binary), and when they see the player they chase and attack. The mobs' visibility is correct (e.g. they can't see the player through walls), and they move intelligently (using A* to get to the player rather than just moving in a straight line). They aren't yet smart enough to move around other mobs (just need to figure out how to work that into the algorithm). The code is prepped for future more intelligent AI as well (using skills to attack, pack AI, etc).

Level-appropriate items

Loot items that are dropped are now level appropriate. Each ItemDefn defines a min/max level range for the item to drop at; I now precreate a list of items (by rarity) for each level, and choose from that when picking an item to drop.

Classes now start with equipment

I extended the PlayerClassDefn object to include starting equipment. I can now specify a comma delimited list of items (by itemId) and they're automatically given to the player on creation; e.g. this:


... translates into this in the game:


All in all, a good day!

GrindCrushLLC - - 81 comments

Nice one, looking cool.

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.