Tuesday, June 5, 2012

Star Wars RL: Oh No! A Monster Mechanics Post!

Enemies are, in the eyes of most, an essential part of any role-playing game. Star Wars RL is definitely not the exception to this rule. Over time I've changed enemy mechanics quite a bit. I'm mostly satisfied with them now and will outline them in this article. Spoiler warning: if you'd rather not know some important facts about enemies, you should probably skip this article. There won't be any plot or direct enemy spoilers, but there will be some moderate engine digging.

Level: an enemy's level primarily determines how much experience it gives when defeated.

Damage: technically two numbers: minimum damage and maximum damage. Enemies can hit for everything between, and including those two numbers.

Hit Points: a semi-random number. I typically generate a good "base" HP value for an enemy and then randomize it slightly to make things more interesting.

Armor: a semi-random damage shave. Armor reduces damage randomly between numbers "x" and "y", where "x" is 1/4th of "y". Note that outside of a dodge, all attacks must deal at least one hit point of damage.

Dodge: a chance to totally avoid an attack. An enemy with a high chance to dodge tends to have fairly low armor (and vice versa), but this is not necessarily true for some exceptionally challenging enemies.

Critical Strike: once upon a time enemies possessed the ability to critically strike. Ultimately that ability was removed in order to minimize the number of completely random deaths.

Accuracy: an enemy's chance to hit you. Early in the game most enemies have a negative accuracy value, which effectively raises the player's dodge.

Movement Speed: the amount of "bonus energy" the enemy gains or loses per turn. If a monster gathers enough "bonus energy" (i.e., it moves faster than you) it can move two tiles in one turn. If a monster loses enough "bonus energy" (i.e., it moves slower than you) it loses a movement turn.

Attack Delay: essentially the same as movement speed, but for attacking. If a monster has a low enough attack delay, it will occasionally perform double attacks. If a monster has a very high attack delay, it will occasionally lose a turn attacking.

Dodge vs. Accuracy: this is one of the most important formulas in Star Wars RL, but it is designed to be understood easily. Imagine a 100-sided dice is rolled - the resulting number is referred to as "Hit Chance". If the target's dodge minus your accuracy is greater than or equal to "Hit Chance", the target evades the attack.

"Bonus Energy": bonus energy is stored separately for enemy attacks and moves. Every round of action, enemies gain and lose 10 Movement Energy and Attack Energy. If they move slower than you or attack slower than you, they'll lose slightly more of that respective energy. If they move faster than you or attack faster than you, they'll gain slightly more of that respective energy. When enough energy of either type is built up, an enemy can perform that action twice in one round. If an enemy has less than 10 Movement Energy at the beginning of its turn, it cannot move. The same is true for Attack Energy, but regarding attacks.

This pretty much covers all of the essential enemy attributes. Expect at least one more post about enemies in the future once I build an AI I'm happy with.


No comments:

Post a Comment