• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Miscellanous / Other] Fighting System

Status
Not open for further replies.
Level 2
Joined
May 7, 2012
Messages
21
Good day.
I want to tell you about Fighting System.
I’m apologize for my English and post’s structure, please focus on the proposed idea.

I’ve been dreamed about system where dodge, parry and critical hits is not a special abilities but a part of unit’s stats and they are depended on difference between opponents’ skills. I think I reach my goal.

Some theory:
1. Attack Rate – arrange where random value is selected on each hit. Usually consists Dice and Modifier. Dice – a basic dice that rolls on unit’s attack. d2, d4, d6, d8. Modifier – constant bonus or penalty on attack. For example, d4+1 (from 2 to 5) or d8-1 (from 0 to 7). That taken on hit value named Attack Value.
2. Attack Value – random number from Attack Rate arrangement. Constant for every hit.
3. Defence – border that protects the unit. If Attack Value is equal or lower than Defence, attack is failed, otherwise attack successfully hits the target.
4. Critical Range – constant value. If Attack Value overcomes Defence more then Critical Range value, that attack considers as critical. Let set it to 4. 4 is ok.
5. Hit Confirm – some units’ ability. Hit Confirm adds to Attack Value to check “does Attack Value overcomes the Defence?” but ignored on “does Attack Value overcomes the Defence more than Critical Range?”.
6. Crit Confirm – some units’ ability. Crit Confirm adds to Attack Value to check “does Attack Value overcomes the Defence more than Critical Range?” but ignored on “does Attack Value overcomes the Defence?”.

Let see the example. We have an orc blade master, Attack Rate is d6, Defence is 2, Crit Confirm 1. Also we have a footman, Attack Rate is d4, Defence is 2 (he has a shield!). Orc attacks first. Roll d6… 2! Not enough to overcome footman’s Defence – he knows how to parry and how to use a shield. Footman attacks, roll d4… 4! Hit! Orc takes damage. Orc attacks again. Roll d6… 5! Hit! Also that’s a critical hit: 5-2+1 = 4! Footman takes a huge damage!

I have to explain something. Initial unit’s Attack Rate is d2 and initial Defence is 0. With every fencing skill gradation Attack Rate increases dice by one step and Defence takes +1. Also in that example footman has a shield that grants +1 Defence.

AR DEF Example
d2 0 Peasant
d4 1 Militia
d6 2 Fencer
d8 3 Close Combat Hero

For example, two peasants are fighting. Just stand there and poke each other with pitchforks. Every attack is successful. After that one of them takes a spear training and on the next fight he easily avoids enemy’s hayfork (Defence 1 against Attack Rate d2, 50% miss) and on lucky hit can pierce something important (Attack Rate d4 can do a critical hit against Defence 0 with a 25% chance). But really good fighter can kill him with no problems (Defence 1 against Attack Rate d8 has a 12% chance to parry and Attack Rate d4 against Defence 3 has only 25% to hit).
Animals could have low Attack Rate, custom Defence and some Crit Confirm.

How that can be done in WC3? We have to make some magic in World Editor but there is nothing impossible. First of all we need Unit Indexer and Bribe’s Damage System which allows to catch the damage dealt in close combat and modify it as we wish.

First: set Armor Damage Reduction Multiplier to 0 at Advanced -> Gameplay Constants. There is no easy way how we can catch the Armor value.
Second: set the Combat->Damage Base to 0, Combat->Damage Number of Dice to 1, Combat->Damage Sides per Dice to required Attack Rate.
Third: set the Combat->Defense Base to required value. Just for convenience.

I’ve handled Defense value by triggers in following way:
When unit taking a damage that damage considering as Attack Value. Every unit type has an assigned Defense and every unit has a reference to hit unit type.
UID – unit id in UnitIndexer, integer.
FS_typeID – unit type id, integer.
FS_UIDtoTypeID – dynamic array that uses UID as index and stores FS_typeID, integer.
FS_typeDefence – dynamic array that uses FF_typeID as index and stores Defense value for appropriate unit type.
Request in one line looks like that:
Code:
FS_typeDefence[ FS_UIDtoTypeID[ UID ] ]
Bad news: damage that unit deal on hit have to be defined by triggers to.

I uploaded some explaining screenshots and map (undone) where i used that system.
 

Attachments

  • trigger_calcExample.png
    trigger_calcExample.png
    33.9 KB · Views: 114
  • trigger_init.png
    trigger_init.png
    48.5 KB · Views: 115
  • trigger_updateTable.png
    trigger_updateTable.png
    13.3 KB · Views: 107
  • EICv0.46a.w3x
    175.8 KB · Views: 82
Status
Not open for further replies.
Top