Results 1 to 3 of 3

Thread: Totally bonkers bribery mechanics

  1. #1
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Totally bonkers bribery mechanics

    Ok, after deciding to settle for some qualitative results, I decided to test what determines the cost on a successful bribery attempt. I found out it only depends on the bribee's loyalty attribute and all the modifiers don't seem to affect the cost, only the chance. I did my tests with a single spearmen unit (stat-wise very similar to the levy spearmen from vanilla) with 0 and with 6 xp

    However, there's a problem: The function isn't monotonous!



    Exact data:
    Spoiler Alert, click show to read: 
    Code:
    Loyalty	Cost (0 XP)	Cost (6 XP)	Ratio (0xp / 6xp)
    -3	3115	4603	0,68
    -2	4239	5727	0,74
    -1	6490	7978	0,81
    0	8740	10228	0,85
    1	14039	15676	0,9
    2	20688	22474	0,92
    3	26867	30621	0,88
    4	11636	13719	0,85
    5	11235	13467	0,83
    6	10384	12765	0,81
    7	9083	11613	0,78
    8	8607	11285	0,76
    9	9293	12120	0,77
    10	9980	12956	0,77


    Not bad enough that the cost shows a sudden severe drop at a loyalty of 4, the cost doesn't even seem to scale uniformly with army quality so it could well be there's some hidden inversions there, too.

    This is so seriously screwed and insane that I believe there must have been some kind of oversight at work. At first I presumed it was some integer number overflow (i.e. the game wrapping the number around after reaching 2^15 or 2^16) but that doesn't fit either.

    Some number crunching using gnuplot to fit:

    f(x) = b*x + c (values -2 to 0)
    g(x) = g1*x^2 + g2*x + g3 (values 0 to 3)
    h(x) = h1*x^2 + h2*x + h3 (values 4 to 7)
    i(x) = i1*x + i2 (values 8 to 10)



    Spoiler Alert, click show to read: 

    *******************************************************************************
    Fri Oct 12 23:55:07 2007


    FIT: data read from "bribery.txt"
    x range restricted to [-2.00000 : 0.000000]
    #datapoints = 3
    residuals are weighted equally (unit weight)

    function used for fitting: f(x)
    fitted parameters initialized with current variable values



    Iteration 0
    WSSR : 1.23565e+006 delta(WSSR)/WSSR : 0
    delta(WSSR) : 0 limit for stopping : 1e-005
    lambda : 1.1547

    initial set of free parameter values

    b = 1700.4
    c = 10136.5

    After 4 iterations the fit converged.
    final sum of squares of residuals : 0.166667
    rel. change during last iteration : -1.84833e-006

    degrees of freedom (FIT_NDF) : 1
    rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 0.408248
    variance of residuals (reduced chisquare) = WSSR/ndf : 0.166667

    Final set of parameters Asymptotic Standard Error
    ======================= ==========================

    b = 2250.5 +/- 0.2887 (0.01283%)
    c = 10228.2 +/- 0.3727 (0.003644%)


    correlation matrix of the fit parameters:

    b c
    b 1.000
    c 0.775 1.000

    *******************************************************************************
    Fri Oct 12 23:56:37 2007


    FIT: data read from "bribery.txt"
    x range restricted to [0.000000 : 3.00000]
    #datapoints = 4
    residuals are weighted equally (unit weight)

    function used for fitting: g(x)
    fitted parameters initialized with current variable values



    Iteration 0
    WSSR : 7.05427e+007 delta(WSSR)/WSSR : 0
    delta(WSSR) : 0 limit for stopping : 1e-005
    lambda : 3.10913

    initial set of free parameter values

    g1 = -3096.5
    g2 = 14578.7
    g3 = 7965.2

    After 5 iterations the fit converged.
    final sum of squares of residuals : 0.05
    rel. change during last iteration : -3.22514e-007

    degrees of freedom (FIT_NDF) : 1
    rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 0.223607
    variance of residuals (reduced chisquare) = WSSR/ndf : 0.05

    Final set of parameters Asymptotic Standard Error
    ======================= ==========================

    g1 = 674.75 +/- 0.1118 (0.01657%)
    g2 = 4773.45 +/- 0.35 (0.007332%)
    g3 = 10227.9 +/- 0.2179 (0.002131%)


    correlation matrix of the fit parameters:

    g1 g2 g3
    g1 1.000
    g2 -0.958 1.000
    g3 0.513 -0.688 1.000


    *******************************************************************************
    Fri Oct 12 23:59:43 2007


    FIT: data read from "bribery.txt"
    x range restricted to [4.00000 : 7.00000]
    #datapoints = 4
    residuals are weighted equally (unit weight)

    function used for fitting: h(x)
    fitted parameters initialized with current variable values



    Iteration 0
    WSSR : 6.63552e+008 delta(WSSR)/WSSR : 0
    delta(WSSR) : 0 limit for stopping : 1e-005
    lambda : 19.8074

    initial set of free parameter values

    h1 = 1
    h2 = 1
    h3 = 1

    After 8 iterations the fit converged.
    final sum of squares of residuals : 0
    abs. change during last iteration : -3.30872e-024


    Hmmmm.... Sum of squared residuals is zero. Can't compute errors.

    Final set of parameters
    =======================

    h1 = -225
    h2 = 1773
    h3 = 10227


    *******************************************************************************
    Sat Oct 13 00:01:58 2007


    FIT: data read from "bribery.txt"
    x range restricted to [8.00000 : 10.0000]
    #datapoints = 3
    residuals are weighted equally (unit weight)

    function used for fitting: i(x)
    fitted parameters initialized with current variable values



    Iteration 0
    WSSR : 4.41373e+008 delta(WSSR)/WSSR : 0
    delta(WSSR) : 0 limit for stopping : 1e-005
    lambda : 6.4291

    initial set of free parameter values

    i1 = 1
    i2 = 1

    After 6 iterations the fit converged.
    final sum of squares of residuals : 0.166667
    rel. change during last iteration : -5.05772e-011

    degrees of freedom (FIT_NDF) : 1
    rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 0.408248
    variance of residuals (reduced chisquare) = WSSR/ndf : 0.166667

    Final set of parameters Asymptotic Standard Error
    ======================= ==========================

    i1 = 835.5 +/- 0.2887 (0.03455%)
    i2 = 4600.83 +/- 2.609 (0.0567%)


    correlation matrix of the fit parameters:

    i1 i2
    i1 1.000
    i2 -0.996 1.000


    At -3 this seems to be capped so I didn't include that point.
    What's interesting is that h(x) actually gives a very good fit for all except the last three values (it hits the three values it was fit to perfectly and seems to do the same for the -2 and 0 values; -3 is hit almost exactly, too). However the whole thing remains a mystery and I wonder what CA did to generate those values. It's simply totally insane (I think they just included it to see if somebody actually notices - or they smoked some really bad **** that evening)

    For the 0xp test things change slightly. The first 4 points follow the same proportionality, but now the second differentiation has a negative value at loyalty 3 and also differs at 4 and 5, while the rest is similar again.


    --------------------------------------------------------------------------

    See what I tried before at the org: http://forums.totalwar.org/vb/showthread.php?t=93070
    Last edited by alpaca; October 12, 2007 at 05:28 PM.

    No thing is everything. Every thing is nothing.

  2. #2

    Default Re: Totally bonkers bribery mechanics

    How did you change the XP of the unit? Made sure none of the factors that would touch anything below stayed the same for each test?

    Code:
       <bribery>
          <bribe_to_family_tree bool="false"/>
          <base_character_chance float="0.4"/>
          <religion_modifier float="0.66"/>
          <combined_attribute_modifier float="0.2"/>
          <briber_attribute_divisor float="3.0"/>
          <bribee_attribute_divisor float="3.0"/>
          <army_size_modifier float="0.035"/>
          <base_settlement_chance float="0.8"/>
          <settlement_loyalty_modifier float="0.01"/>
          <settlement_population_modifier float="0.0001"/>
          <faction_standing_divisor float="10.0"/>
          <max_bribe_chance float="100.0"/>
          <min_bribe_chance float="1.0"/>
          <bribe_chance_modifier float="1.0"/>
       </bribery>
    excerpt from descr_campaign_db

  3. #3
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Totally bonkers bribery mechanics

    Quote Originally Posted by Mersk View Post
    How did you change the XP of the unit? Made sure none of the factors that would touch anything below stayed the same for each test?

    Code:
       <bribery>
          <bribe_to_family_tree bool="false"/>
          <base_character_chance float="0.4"/>
          <religion_modifier float="0.66"/>
          <combined_attribute_modifier float="0.2"/>
          <briber_attribute_divisor float="3.0"/>
          <bribee_attribute_divisor float="3.0"/>
          <army_size_modifier float="0.035"/>
          <base_settlement_chance float="0.8"/>
          <settlement_loyalty_modifier float="0.01"/>
          <settlement_population_modifier float="0.0001"/>
          <faction_standing_divisor float="10.0"/>
          <max_bribe_chance float="100.0"/>
          <min_bribe_chance float="1.0"/>
          <bribe_chance_modifier float="1.0"/>
       </bribery>
    excerpt from descr_campaign_db
    I spawn the unit using the spawn_army command.
    And no, I didn't change anything in the campaign db in between. I tested these separately with the same character/unit combination and they didn't seem to have an effect on the cost at any rate.

    No thing is everything. Every thing is nothing.

Posting Permissions

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