News: Go to the wiki and do the Flying Ship tutorial May 22, 2012, 02:21:25 pm
Welcome, Guest. Please login or register. *

Anatomy of an Action
Pages: 1
  Send this topic  |  Print  

  Anatomy of an Action
Author Message
0 Members and 2 Guests are viewing this topic.
Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« on: May 02, 2008, 10:52:01 pm »

Aside from simply moving around, characters may perform a variety of actions to interact with their environment.  These could range from the mundane of opening and closing doors to attacking with a sword or casting a magical spell.  All actions fundamentally follow the same principles, as I will detail. 

Actions are split into three phases; there is preparation time, execution time, and recovery time.  Preparation time is the duration between when the command was given by the player and when the actual action begins.  Execution time is the duration when the action is actually happening.  Finally there is recovery time, which is the time between when execution ends and when another action can begin its preparation.

To use the example of a sword attack, preparation time is the time it takes to raise the sword into attacking position.  Execution time is the actual swing of the sword, and during this period it is dangerous to an enemy.  Recovery time is the time it takes to return the sword back to its default position and to be ready for another action.

The actual time that preparation, execution, and recovery take is unique to each action.  Some may be so fast that a specific phase may be effectively instantaneous.  Others may be very slow; it all depends on the timing of the action in particular.  In any case, these times will be measured in milliseconds, so from a human's perspective they are actually quite fast.

Different action may impart different limitations on each phase.  One common trait will be that an action may prohibit or limit movement during specific phases.  This includes the ability to turn, although restrictions of movement and turning are independant (you can have one or the other or both on an individual action).  Some actions may force preset movements.  For instance, the lunge skill will send a player flying in a specific direction.  Once initiated, he loses all control over the process, following the set course.  This is the same in principle; the player loses control over movement, even though a certain amount of motion is "forced" upon him by the action.

Another feature is cooldown time.  This will be used sparingly, most likely for the spellcasting domain.  A cooldown is a duration after an action's recovery time expires in which you cannot begin preparations for that same action.  This is essentially a way of saying you cannot use this specific action twice in a row, and must wait a while before you can use it again, but you're free to use any other action.  As mentioned, most actions will not have cooldowns, and can be used repeatedly if desired.

From a graphical perspective, the sprites must sync up to show us visually what I have described here, passing with a degree of fluidity through each phase of animation as each phase of the action happens.  Once we have a general template for how we will handle actions, it will be much easier to create new types of actions, implementing the various spells and abilities that will make up the skill repetoire of our player characters and other creatures in game.

Feedback/comments/ideas are encouraged as usual.
Logged
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #1 on: May 03, 2008, 10:11:35 am »

All I can say is that it makes perfect sense, I guess. It would be easiest to create some kind of Action class, interface or whatever, which takes care of the measuring and state, so the player class won't have to.

I've thought of a good player movement mechanism. I'm busy today, but I'll see if I can work it out tonight.
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #2 on: June 13, 2008, 09:38:06 am »

Started writing on the bus.  Ideas have been bubbling around in my head for a while now, but it was the first time I put them on paper.  I liked what I saw, so I've transcribed it and posted it here.  Questions/comments welcome as usual.


This section will cover physical attacks.  Attacks will come in a variety of forms and strengths, and will be impacted by the type of weapons used.  All attacks will have a threat map which describes which areas they threaten at which times, and to which degree.  How we decide to implement that will be a major task.

In addition to its base strength, an attack may hit a target with varying degree of force depending on exactly where it struck.  This is called the attack's "hit class".  The cleaner the hit, the more powerful the attack will be.  Hit classes are used not only for damage, but also for effects such as parries, which occur when two attacks collide.

There are a total of six hit classes, although only five can occur under unassisted conditions.

Hit Classes:

0 - Miss: you didn't contact anything
1 - Glancing Strike: you barely made contact; a glancing blow deals very little damage, but may interrupt sensative actions.
2 - Minor Strike: you make contact, but the attack isn't a good one, dealing less than normal damage.
3 - Moderate Strike: you make solid contact, causing regular damage.
4 - Powerful Strike: your enemy takes the full brunt of your attack, causing extra damage.
5 - Critical Strike: you hit the enemy with the perfect "sweet spot" of your attack, dealing maximum damage.
6 - Lethal Strike: this only occurs when a special condition upgrades the hit class of an attack past critical strike; a lethal strike deals massive amounts of damage.  Although technically not an assured kill (as its name might suggest) few characters would survive a hit of this type.

As you may notice, critical strikes in this game are handled not by luck, but rather by achieving a perfect attack placement.  Lethal strikes can only be generated when a special effect that upgrades your hit class improves you above the level of critical strike.  Your basic hit class is based entirely on the threat map of your attack (which in turn is based off which weapon and which attack you're using) and where the enemy was in that threat map. 

With the exception of parry modifiers, hit classes are capped at level 6.  So if you score a critical strike and have a special advantage of +2 to your hit class, you still only deal a lethal strike. 


Hit Class Modifiers:

Special Bonuses: if attacks, spells, or effects improve or reduce your hit class, they are applied before any other effects.  The sum of all bonuses is tallied and applied at once, so there will only be overflow issues if the net results in an overflow.

Partial Cover: when someone has total cover, they are protected from an attack.  This represents that there is a solid object between them and the source of the damage, "blocking" the threat map from affecting them.  Partial cover occurs in a variety of situations.  True to its name, it's possible that you are partially protected and partially exposed.  It's also possible that the attack struck something else before it struck you, which qualifies to give you a partial cover bonus.  Depending on the quality of the cover, this reduces the hit class by 1 or 2 points, potentially reducing it to a miss. 

Situation Advantage:  in some cases, the attacker may be at an advantage to the defender either due to terrain placement or other effects.  There are three levels of advantage: suppressed, handicapped, and helpless.  Respectively, they increase the hit class of the attacker by 1, 2, and 3 points.  Glancing blows and misses cannot be upgraded via situational advantage.  Partial cover is applied before situational advantage.

Armour Class:  when wearing medium armour, the hit class of all attacks made against you is reduced by 1.  When wearing heavy armour, it is reduced by 2.  This means you need to score a moderate strike just to get the effect of a glancing blow against someone in plate mail.  This is in addition to passive damage reduction.  This bonus is applied last.  Any magical bonuses that do not stack with armour are calculated here.

Immunity: sometimes monsters properties and special effects may create a hit class immunity.  In the event that a monster or creature is immune to a hit class, the class is reduced by one level.  If it's immune to that level as well, it's reduced again.  Boss characters are often immune to lethal strikes, for instance, reducing their effects to powerful but less life-ending critical strikes.


Parry:

In the event that two attacks collide, a parry occurs.  Parries are resolved using a modified hit class.  All modifiers except for armour class are factored into the parry's effective hit class.  Like normal hit modifiers, the value is capped at level 6, a lethal strike.  Then the weapon's size class is added to this value.  This addition is not capped, meaning a longsword (size class 2) which scores a critical strike on a parry will have an effective hit class of 7 for resolving the parry.  This value is only used to resolve the parry, and does not improve damage.

If the difference between the modified hit classes is less than three points, a parry occurs.  This neutralizes most of the effect of the attacks, and may have other impacts if the characters have passive bonuses to their parry skills.  If the modified hit classes differ by three or more points, the weaker weapon fails to parry, and the stronger attack prevails instead.  However, if the difference is exactly three, the stronger attack has its hit class reduced by 1.

Weapons normally vary between size class 0 (daggers and such) and size class 4 (greatswords and such).  Some magical weapons may extend to size class 5, but anything larger is usually only seen in large monsters.  Typically only weapons differing by one size class can realistically parry as equals; any more than a two point difference and the larger weapon will routinely break through the weaker one's defense.

Larger weapons have longer range than smaller weapons, so it should be noted that while a longsword may strike a "lethal hit" with respect to the greatsword it's parrying, this doesn't mean it scored a "lethal hit" against the player wielding the greatsword.  In fact, it may have missed the player entirely.   Moreover, because the larger weapons have the larger threat map, they are more likely to score the better hit class to begin with.

Although it may appear that parries "favour" large weapons (combining both their size class difference and increased threat range bonus), it's important to realize that in any given time frame the larger weapons get fewer attacks than smaller ones, so they need to make them count.  If a smaller weapon can easily neutralize all of the attacks of a big one, there's no reason to wield a big sword in the first place. 
Logged

Pages: 1
  Send this topic  |  Print  
 

Jump to: