1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  4. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Best way to calculate fighting power?

Discussion in 'World Editor Help Zone' started by Ofel, Jul 21, 2018.

  1. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    It will not detect damage bonuses from auras, moreover its complicated, requires unit creation for all units types you wish to detect attack damage. Its not good solution.
     
  2. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,042
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    There is currently no way to detect damage before reduction, except if all the reductions are done by you.
     
  3. Lordlycan

    Lordlycan

    Joined:
    Jan 11, 2008
    Messages:
    178
    Resources:
    0
    Resources:
    0
    It might be easier to set up a baseline and estimate upon that whether or not the threshold to engage, disengage or hold position(can be patrolling position) is needed.

    if its for regular melee units you could cheat around a bit and base it of the full building cost of the armies in x area of influence on both sides and compare them. It's less elegant but it might give you a good starting point. You could also consider using information that a player does not have the player won't know. unless you tell the player that your AI ally doesn't engage because the enemy has more units in the unexplored vicinity. He'll likely never notice just like how most people don't notice that melee AI insane bots have increased income.

    There are quite a couple of game design cheats people never noticed. In doom players actually had 110% health where the last 10% was showed as only being 1 health. To give the player more experiences that he survived with only 1 health.
    Ratchet and clank would trip when the player would try to go towards an area that hadn't full loaded yet.
     
    Last edited: Jul 26, 2018
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,663
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Holy shit I never knew that!
     
  5. Lordlycan

    Lordlycan

    Joined:
    Jan 11, 2008
    Messages:
    178
    Resources:
    0
    Resources:
    0
    Jennifer Scheurle on Twitter
    there's a huge thread dedicated to these things.

    Which also reminded me of the Alien xenomorph trick that might be another idea to use for OP.
    Dump all the available data of enemy unit locations in 1 mind. And have that mind give hints to your AI. It might make it a lot easier for you to build your rules of engagement.
     
  6. disruptive_

    disruptive_

    Joined:
    Mar 19, 2017
    Messages:
    149
    Resources:
    0
    Resources:
    0
    The other clunky but possible way, is to centralize bonus attack and armor, ie. green values, with BonusMod library or another similar. Why? because those libraries have "GetUnitBonus" functions. Retrieving attack damage becomes white (damage functions, don't know if on heroes it accounts for primary attribute bonus damage tho, in which case you also count that stat) plus green (get bonus custom functions). In regards of armor you don't even need such mechanism, as the new get armor function returns total armor (white plus green) except in one, functional case. The method is still clunky because, if you're using the also clunky WC3 armor type system (ie. siege v/s fortified) you will need to take unto account those previous damage reduction percentages. Positive and Negative armor formulas then have to be taken unto account to get your ending damage reduction percentage. But all this armor type data is always modifable and accessible (game constants).
    With all this data, attack and armor, you can safely get damage "done" (not really done). The tradeoff is that all "green" values have to use the AddUnitBonus functions. This specially terrible for auras i guess, as those are a staple among hero abilities, and you will need to trigger them yourself.

    For the problem at hand, a not so ambitious way could be, 1. creating and determining an absolute fighting of a particular hero ("engaging unit"), based primarily on it's level, skills leveled and items acquired (all these easily accessible events), basically an integer attached to each unit that is engagable, and 2. determining it's relative fightning power against a particular unit. If engagable units are regular creeps that don't level or have dynamic effectiveness, then this value could be just another integer, based on the unit type id of the creep (rawcode) measured against the unit type id of the hero. A hashtable can be used here. To determine if engaging proceeds or not then relative value is substracted from the absolute fighting power of the engaging unit, ie.
    1. Antonidas (rawcode of 'AAAA') has an absolute fighting power of 1000 (i would use an unit indexer here plus a regular integer array, IE. FIGHTING_POWER[GetUnitId(Antonidas)]), and starts fighting against 2 bandits.
    2. Bandits (rawcode of 'BBBB') and Antonidas have a relative fighting power of 10 (Hashtable['AAAA']['BBBB'] = 10), so the overall engaging power of Antonidas, it's own relative fighting power is 980.
    3. Antonidas proceeds to beat the crap out of the bandits because 980 means direct engage.

    Cons: this a very mechanic way of achieving this, data heavy and arbitrary. But with experience and testing on it's side, it can be tinkered well enough.