Results 1 to 11 of 11

Thread: Gains Formula

  1. #1
    Veteran
    Join Date
    Aug 2008
    Posts
    498

    Gains Formula

    It has come to my attention that while my research into the gains formula has been publicly available for some time now, many people are still not aware of it. This thread is just simply designed to fill in those people. Some of this is straight forward, some is more complicated, if you don't understand something feel free to ask questions and I'll try to answer them.

    I put most of this stuff together back around March-April, and have had a few (top) kingdoms testing/using it since and so far (when used properly) has been 100% accurate every single time. The danger is though it is VERY easy to mis-calculate something or fail to account for a factor, so until you are used to it don't expect perfect results.

    Province Networth Factor (PNF):
    Relative Province Networth (rpnw) = TargetsNW / SelfNW
    IF rpnw < 0.567, then PNF = 0
    IF 0.567 < rpnw < 0.9, then PNF = 3 * rpnw - 1.7
    IF 0.9 < rpnw < 1.1, then PNF = 1
    IF 1.1 < rpnw < 1.6, then PNF = -2 * rpnw + 3.2
    IF rpnw > 1.6, then PNF = 0

    Kingdom Networth Factor (KNF):
    Relative Kingdom Networth (rknw) = TargetKingdomNW / SelfKingdomNW
    IF rknw < 0.4, then KNF = 0.6666
    IF 0.4 < rknw < 0.9, then KNF = rknw * 2/3 + 0.4
    IF rpnw > 0.9, then KNF = 1

    In english:

    relnw = targetnw/yournw
    if relnw <0.9 then:
    prov factor = 3 x relnw -1.7
    If 0.9 < relnw < 1.1 then full gains
    If above 1.1
    prov factor = -2 x relnw +3.2

    KDNW is above 0.9 (again target/self), then full gains
    If below 0.4 then 2/3 gains
    If between those two then:
    kdnw factor = relkdnw *2/3 +0.4

    Attack types

    These are base gains, so apply all modifiers to these numbers:

    TM = 12% land, Conquest = max 6.8% land, Plunder = 50% gold, 60% runes/food, Learn = 9.375% books, Massacre = 9.5% peasants, 8.5% thieves and 5% wizzards.

    OOW - Max gains are 135% of base gains, or 20% of your land (Whichever is smaller), base losses are 7.5%, non-land hits impart 6% gains protection, land hits impart (%land x 2.75) % gains protection.

    WAR - Max gains are 20% of either yours or targets land (whichever is smaller, this doesn't include explore pool which makes it 22% effectively). Minimum gains are around 3.6% land for Trad March.

    Building credits = Land x 0.55 x percent nw
    percent nw = targetsnw/yournw
    Spec credits = Targets Def x 0.0055 x relative nw (max 1)
    relative nw = min(targetsnw/yournw,yournw/targetsnw)

    I have scripts on IRC which use many of these things such as !nw (!nw help) - which uses the gains formula, !gbp and !gains - gives information on these, and ChainDef - which calculates a targets def based on a posted attack message (useful mostly in chains). Feel free to try them out or PM me for more information or if you want me to provide these services to your kingdom.

    Finally, obviously this isn't all that I know about this stuff, but I feel that it is appropriate to let everyone have equal access to things like this at least. I hope you enjoy it and find it useful. If you want to learn, be patient, it took longer than 5 min to figure it out, and it'll take you longer than 5 min to learn it all properly.

    Useful links:
    http://www.wiki.utopia-game.com/inde..._%26_Defending
    http://www.youtube.com/watch?v=dP8gR8HPrLI
    http://thedragonportal.net/
    http://clampy.webdrisign.com/ClampbotReadme.txt

    P.S. Bijo has included the gains formula into Ultima available at the dragon portal, and the latest DPbot includes some of these functions.
    That nerdy guy that obsesses with game mechanics.

  2. #2
    Post Demon
    Join Date
    Aug 2008
    Posts
    1,750
    Building credits = Land x 0.55 x percent nw
    percent nw = targetsnw/yournw
    Spec credits = Targets Def x 0.0055 x relative nw (max 1)
    relative nw = min(targetsnw/yournw,yournw/targetsnw)
    Sure about this on the new code? Because I got some weird results when I used it to calc max def, and ended up removing it from my bot due to that. Possible that I did something wrong though

  3. #3
    Veteran
    Join Date
    Aug 2008
    Posts
    498
    It's been working fine for me (after some tweaking to fit the change in attack messages), I haven't seen a def estimation off by more than 1% yet, so working fine for me. Were there War heroes involved?
    Also in war the build credits is effectively 0.5 not 0.55 as you don't get build credits for explore pool land.

    Though as it was kindly pointed out to me you can't get more build credits than land taken.
    That nerdy guy that obsesses with game mechanics.

  4. #4
    I like to post KuhaN's Avatar
    Join Date
    Oct 2009
    Location
    tracy, california
    Posts
    4,732
    How the hell
    "Go back to the gym because you f'king suck at utopia, noob." -Godly



    My classic black theme for Utopia - Updated 5/13/15

    Quote Originally Posted by darkl1ght View Post
    Unfortunately, no amount of razes will improve your war record
    Greatest strategy thread/question of all-time.

  5. #5

  6. #6
    Director of Age Changes
    Join Date
    Nov 2008
    Location
    EU
    Posts
    1,936
    Hmm... I'm gonna test this out :P
    Nice work.
    Discord: Hex | IRC: Hextor / Avenger

  7. #7
    Post Fiend
    Join Date
    Mar 2009
    Posts
    162
    A kingdom-mate has been unable to gain more elite credits than elites he has lost in battle. He is an Orc, War Hero and is attacking targets close to his Networth. He seems to be gaining just as many credits as elites he is losing in battle. For example, he just attacked and lost 411 Ogres and gained 411 elite credits. There hasn't been a new 'cap' put in on credits, has there?

  8. #8
    Enthusiast ThZ's Avatar
    Join Date
    Nov 2009
    Posts
    457
    could very well be, there have been some updates lately, but no update announcement...

  9. #9
    Veteran
    Join Date
    Aug 2008
    Posts
    498
    No cap that I'm aware of, I've seen hits which gain more credits than losses (even on non-war heroes). Perhaps your friend needs to get some more hospitals to help lower those losses?
    That nerdy guy that obsesses with game mechanics.

  10. #10
    Post Demon
    Join Date
    Aug 2008
    Posts
    1,750
    Quote Originally Posted by AppleAssault View Post
    A kingdom-mate has been unable to gain more elite credits than elites he has lost in battle. He is an Orc, War Hero and is attacking targets close to his Networth. He seems to be gaining just as many credits as elites he is losing in battle. For example, he just attacked and lost 411 Ogres and gained 411 elite credits. There hasn't been a new 'cap' put in on credits, has there?
    Then he's hitting provs with too low def and/or has too few hospitals. An Orc WH in my kd just hit, lost 700 elites and gained 1200 credits, so there's no cap.

  11. #11
    Post Fiend
    Join Date
    Mar 2009
    Posts
    162
    Thank you all. I figured their wasn't a cap but wanted to verify before I slapped him around for being so silly. :)

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •