Inter-Entity Interaction

For this post, I’m going to go over the first interactions between entities.

Monster and NPC contact

The first monster, the Slime, will do damage when its hitbox touches an NPC’s hitbox. When the NPC takes damage, it will enter a knockback state and won’t be able to be damaged again by that one monster for a period of time. Other monsters will be free to do damage, however, so monsters ganging up on one NPC will do damage much faster than one monster alone.

During knockback, the NPC will slide away from the last monster to cause damage. The NPC will also take damage on each hit, and will lose hitpoints until there are none left. At this point, the NPC will be killed.

Monster and Monster contact

All monsters, when in contact, will push themselves away from each other, so that there won’t be monsters inside of other monsters. I’ll have to be careful not to have them push each other into blocks, since I don’t want them to get stuck. I assume I’ll have to apply acceleration in opposite directions or something. I’m not really sure how I’m going to deal with physical collision response. I’ll figure something out.

I think that I’ll wind up having all entities push each other away from one another. I have only ever done this kind of thing in my ludumdare 10 entry. There were no boundaries to have to worry about, so I was free to push each colliding sprite completely outside of each other. I have a world to collide against so I’ll have to deal with that somehow. Maybe I’ll just do the push with the incremental movement function I already have.

When NPC takes damage

It would make the most sense for an NPC to run away when she gets hit, but that might get annoying. I’ll add a Flee state that will be active for a certain amount of time, or maybe a distance from the attacking target.

When Player takes damage

The player weill be knocked back just like the NPCs will be. The difference is that after the knockback, there will be a temporary invincibility period. The player will blink to show this visually, and the entity clipping will be turned off during this period. It will be possible for alot of monsters to hit you at once, or one monster to combo you with several quick hits, but I want to make sure you won’t be in stun lock forever. Allowing for that kind of thing is unfair and not fun.

Damage counters

Like in the last version of ActionRPG, I want to have damage counters pop out of whatever takes damage, so you can see visually that there was damage done and how much it was. I may not put this in right away, since it’s only a visual indicator. I want to focus on only the core code.

Letting the Player fight back

Finally, I want to give the player a weapon and let him do damage to the monsters. I’ll be building this pretty well exactly like I did in ActionRPG, with a horizontally arcing sword attack, but I also want to add a vertical arc and a thrusting attack. Eventually I’d like to set up the battling system to work like they do in the 3d Zelda games, with the z-targetting system.

When I have most of the above into the game, I’ll have satisfied the fighting system core requirement. I’ll start looking at either the Town levelling or more stuff with the NPCs. I want to get into the NPC class stuff soon so they can start doing something useful.

Advertisements

Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s