Results 1 to 4 of 4

Thread: Formula Question

  1. #1
    Post Fiend
    Join Date
    Jan 2012
    Posts
    110

    Formula Question

    So I am going through the game mechanics - writing a simple province simulator code for elf/sage.

    I have a problem with this bit in percentage-based building effect calculation:

    Percentage Based Buildings = Base Effect * BE * % of building * (100% - % of building)


    Taken from the guide (Under 'Building Effects')
    Take the case of banks for example. Base effect is 1.25%.
    So if I have: 100% BE and 22.6% Banks,

    Percentage based building effects = 1.0125*1.00*0.226*(1 - 0.226) = 0.1771
    i.e. 17.7% higher income

    But province reports for the same numbers give me:

    Produce 2,575 gold coins per day
    21.89% higher income (0.67%)

    I do have 7.8% alchemy science, but that can't have factored into the calculation of building effects.

    What am I doing wrong?

  2. #2
    Moderator for:
    Utopia Forums
    Palem's Avatar
    Join Date
    Jul 2008
    Posts
    22,030
    Quote Originally Posted by igotnomilk View Post
    Take the case of banks for example. Base effect is 1.25%.
    So if I have: 100% BE and 22.6% Banks,

    Percentage based building effects = 1.0125*1.00*0.226*(1 - 0.226) = 0.1771
    i.e. 17.7% higher income

    But province reports for the same numbers give me:

    Produce 2,575 gold coins per day
    21.89% higher income (0.67)
    Bolded the mistake. Underlined the correction below.

    1.25*.226*(1-.226)=.218655

    The slight difference shown is prolly a rounding error on the information provided to you (i.e. your BE might be like 99.9, but rounded to 100)

  3. #3
    Post Fiend
    Join Date
    Jan 2012
    Posts
    110
    Cheers Palem. I always thought percentages were converted to decimal form in utopian formulae.

  4. #4
    Moderator for:
    Utopia Forums
    Palem's Avatar
    Join Date
    Jul 2008
    Posts
    22,030
    It's calculating the bonus, not the overall effect.

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
  •