I've kicked it around a fair amount and found a very good parabolic fit vs. lone spies in cities, but unfortunately it doesn't work well at all for spies in open field. Let me post it here, and maybe it'll spark insights.
My big clue into the workings came from, not Jim Irwin's idea on Compuserve, but by plugging the terms from Excel's polynomial regression equations from my spreadsheet into a quadratic equation editor such as found here. If you plug in the terms for the first five rows (each curve is My Spy Skill from 1 to 10; the first five rows are vs. TheirSkill 1...5), you'll find that they are going something like
(X+1)(X-6)
(X+1)(X-11)
(X+1)(X-16)
etc., where My Spy Skill is X... but the equations have a constant in front of them ("A" in the quadratic) that I couldn't make much sense out of.
Note: I cut off the curves, for the graph, at the point where the value reached 100 (for TheirSpy=1 and 2). More on this later.
The second clue was when the quadratic page reminded me I could take the derivative of the equation and find it's maximum - interestingly, the maxima of the first five curves were 5, 7.5, 10, 12.5, and 15 (it was moving to the right by 2.5 each time). Eventually it dawned on me that this constant "A" was in fact simply the value of Y at maximum X - in other words, the equation's results at the highest point on the parabola. By using this as a denominator, you lock the results into being 100 at their highest point.
Terms:
M = My Spy Skill
T = Their Spy Skill
A ~ 1 = First constant (in left hand term)
B ~ 5 = Second constant (modifier in right hand term (RHT))
C = 1 = Third constant (added to T in RHT)
D = 1 = 4th constant (added to RHT)
as follows.
First, the governing equation:
(M+A)(M-((B(T+C))+D) (Eq. 1)
Then the denominator simply needs to be equal to the maximum value that the numerator can reach; this will cause it to be 100% at the maximum (top of the parabolic arc). So we take the derivative with respect to M (omg! calculus in the real world?? nah - RTW is just a game!) then solve for M to get its value at maximum:
Multiply terms so we can get derivative:
=(M+A)(M-((B(T+C))+D)
=(M+A)(M-(BT+BC+D))
=(M+A)(M-BT-BC-D)
=M^2-MBT-MBC-MD +AM-ABT-ABC-AD
derivative with respect to M is:
2M-BT-BC-D+A (Eq. 2)
Solve for M:
0=2M-BT-BC-D+A
-2M=-BT-BC-D+A
2M=BT+BC+D-A
M=(BT+BC+D-A)/2 (Eq. 3)
This shows the point where M is a maximum. So we plug this into the equation, IOW, substitute the value of M (from eq. 3) into eq. 1, as the denominator. Or:
Eq. 1
-------
Eq. 1, substituting eq. 3 for M
let's simplify the denominator a little:
Eq. 1, with Eq. 3 substitued for M:
= (Eq3+A)(Eq3-((B(T+C)+D))
= (Eq3+A)(Eq3-BT-BC-D)
= (( (BT+BC+D-A)/2 )+A)(( (BT+BC+D-A)/2 )-BT-BC-D)
put 1/2 in front of each term, so you can multiply the insides by 2:
= 1/2*(BT+BC+D-A+2A) * 1/2*(BT+BC+D-A-2BT-2BC-2D)
notice how a lot of stuff gets subtracted in the second parens...
= 1/4*(BT+BC+D+A)*(-BT-BC-D-A)
pull out the negative and behold, you have a square...
= -((BT+BC+D+A)^2)/4 (Eq. 4)
Final equation (Eq 1 divided by Eq 1 with Eq 3 subbed for M) is:
(M+A)(M-BT-BC-D)
= -----------------
-(BT+BC+D+A)/4
-4(M+A)(M-BT-BC-D)
= -----------------
(BT+BC+D+A)^2
In all my playing, I found that C and D both always equal pretty much 1, so this simplifies (for lone spies in cities, only!) to:
-4(M+A)(M-BT-B-1)
= ----------------- (Eq. 5)
(BT+B+1+A)^2
For a rough approximation, I found that A=1 and B=5 was quite nice. However, by successive aproximation, the best fit I could get (least error vs. game data) was A=.975 and B=5.2. I figure that 1 & 5 may be right from the programming perspective, but small rounding errors in the bowels of the equation, too little for the developers to worry about, made this second set be a better fit. (That or the equation is actually a lot more complicated - but in small ways that don't make much difference, and which could be very hard to pick out.)
An example of the equation at work: For My Spy Skill (M) = 1 and Their Spy Skill (T) = 1, Eq. 5 is:
-4(M+A)(M-BT-B-1)
= ----------------- (Eq. 5)
(BT+B+1+A)^2
-4(1+1)(1-5*1-5-1)
= -----------------
(5*1+5+1+1)^2
-4*2*(1-5-5-1)
= -----------------
(5+5+1+1)^2
-4*2*-10
= --------
12^2
80
= ---
144
= .5556
versus actual game value of 55, for Me=1 and Them=1.
Also you have to programmatically cut off values when they reach 100 - but this is easy because you can compute the location of the maximum via Eq. 3 and see if you have exceeded it. E.g. for Row 1 (T=1):
M=(BT+BC+D-A)/2 (Eq. 3)
=(5*1+5*1+1-1)/2
=(5+5)/2
=5
which we can readily see is indeed the place where Row 1 goes to 100.
Like I said, these fit the game data extremely well for lone spies in cities - but fall on their face for spies in the open. For one thing, there's so little data in the Spies In Open matrix that Excel has trouble generating regression lines. (Little vertical movement, and lots of stepstairs due to being in single digits a lot.) So I can't see any pattern from their quadratic results. I tried playing with them a lot but still can't make it fit.
I left my spreadsheet at work, where I have all this math plugged in - I'll post it come next week.
A couple more things -
* I have a testbed game with Julii and Brutii each having ten spies of skill 1 to 10. If anybody wants a copy, email me at mikestar@speedfactory.net (which will make replying easy).
* In my original big post (with the raw data), I made a FLASH concerning how Gauls are different (and other cultures may well have other levels of difference, too). The above equation may easily extrapolate to them; you can see how Gaul's no so different. Spies in Open Field seem to be an especially tough case. I wish I had time to collect data vs. e.g. Gaul, but I won't in the next few days. (You'd probably have to jack around Gaul's spies' skills, or whatever other races you wanted to test versus.) For what it's worth, I was thinking this might be linked to the permanent 15% unrest discussed elsewhere - like, some game value essentially meant "there's +1 Culture difference for Julii vs. Gauls, which means all Gaul cities have +15% unrest, and all spy attempts are shifted slightly harder by tweaking the equation x amount" - but the discussions suggest that the 15% is not faction specific; it's city specific. So it leads to a question of whether this shift in the spy values is versus cities or factions. If it is versus factions, there has to be a faction-vs-faction table somewhere. Anyway, I wouldn't be surprised if C or D are what is changed, or maybe A or B is bumped up or down by 1.
Bookmarks