Jump to content

Fates RN Regression Project


Crimean Archivist
 Share

Recommended Posts

How did we find dynamic growths in Shadow Dragon anyway? I've looked for the credited author on the main SF page (Nitrodon) and that person has been inactive since 2011. If there's something that needs to be tracked in order to be sure I want to be keeping tabs on it.

Edit: Thinking it over, and I don't think a dynamic system is likely. Unlike growth rates, which can be fixed in an array and modified easily, the function that calls the RN never "knows" what it's getting. It would have to make modifications to RNs as they came in because a 99 value array would be a big waste of space. That would mean that a result at 41 could affect the result at 99 after enough trials, and that would spell all kinds of disaster.

Dota 2 uses Pseudo-random distribution where certain attack procs have their probability modified based on previous misses and hits. The net effect is that you're less likely to get two bashes in a row (for example) but also less likely to go 15 attacks without getting a single bash.

Link to comment
Share on other sites

  • Replies 119
  • Created
  • Last Reply

Top Posters In This Topic

Okay so I edited above some cases it doesn't work.

But if (z*(A+B)-A*100)/B < 0

int(-(z(A+B)/A)*x/(z(A+B)/B) + z(A+B)/A dx) from x = 0 to 100

Should work? Note that for z <50, I think it might be symmetric, so it may make more sense (given how things are setup) for say 25%, to just take 1 - (weighted prob for z=75). Also note that this formula gives the same solution as the previous one for cases of (z*(A+B)-A*100)/B = 0, like z = 75, A = 3, B = 1. It's 83.333..% as it should be.

Not sure on the rewriting yet, but I want to say it's possible with these integrals as is. Out of time atm, and probably need to recheck previous formulas too.

Edited by XeKr
Link to comment
Share on other sites

How would we even go about testing for a dynamic system?

We'd take the data we already have and start checking pairs. We expect say 67 * 1.1 percent of the trials following a miss at 67 to be hits. Reapply to many hit chances and look for some kind of pattern.

The damning factor would be whether resets affect the dynamic adjustment cache. If resetting the game resets the cache, then a lot of our currently collected data is worthless for testing dynamic hit rates. We'd have to go into My Castle battles and just continually farm until we gathered a substantial amount of data, then check those using the method above. It'd be a task unto itself.

Progress on my end is going to be slow over the next few days; I have a lot of work due. I'll make an update if any significant advances occur.

Edited by BlenD
Link to comment
Share on other sites

Yikes, if I can find time between school and work I'll put together a google doc that people can record more detailed data in the case that our current data does turn out obsolete.

I'll also start recording data on my end, though it'll just be as I go instead of farming for specific values.

Link to comment
Share on other sites

Nearly 13000 data points. 83 has fallen outside of the confidence interval for the 3A+B model (measured value 96.2, sample size 186), although just barely. However, it looks like it may be another fluke, as the points on either side of it, as 82 and 84, which are both higher-confidence values, have lower averages and fit more cleanly.

It might be dynamic, but from my understanding of a dynamic model, it doesn't change the expected value, only the standard deviation. I'm not sure why there's so much flux between certain points, and I'm not certain how to take this F(A, B, z) = P and make it into something useful. This has only become more complicated as it's continued and it's maddening.

I'm pretty certain with 13000 points, we're far enough along to say something significant about the system, if only we know where to look. Here, I'm sharing my current data set with everyone in hopes that maybe someone will notice something useful.

Edit: I have something. All weighted models have a linear region where the slope is (A+B)/A from point to point. Using Excel's SLOPE function on a large enough number of points with high confidence in the linear region should produce a line of best fit for that region. I need a couple more high-confidence values between 50 and 70 (we'll ignore the low region for now) and we should be good to go.

Edit 2: Here are the linear regions for different models:

(3A+B)/4 -- 25 to 75

(2A+B)/3 -- 33 to 66

(4A+B)/5 -- 20 to 80

I think (3A+2B)/5 is effectively out at this point and (A+B)/2 doesn't have a linear region.

On the values from 55 to 75 (varying confidences, many points with sample size <100), SLOPE returns a line of P = 1.2899*Z, very close to (3A+B)/4's slope of 1.3333. That's promising. Will keep testing, but I've got a good feeling about that.

Hit Value Hits Misses
1 0 5
2 0 7
3 0 5
4 1 2
5 1 4
6 1 6
7 0 4
8 2 8
9 16 188
10 2 6
11 0 4
12 1 1
13 0 6
14 4 8
15 2 11
16 5 15
17 18 89
18 0 8
19 1 7
20 4 10
21 5 12
22 25 88
23 40 143
24 3 9
25 5 9
26 2 13
27 152 361
28 2 19
29 8 11
30 6 14
31 28 87
32 10 20
33 11 15
34 2 12
35 7 18
36 110 212
37 8 20
38 17 15
39 11 12
40 11 18
41 93 120
42 14 23
43 20 25
44 17 19
45 33 33
46 53 75
47 23 29
48 30 43
49 136 127
50 37 31
51 26 41
52 47 29
53 39 35
54 31 28
55 106 77
56 178 128
57 59 38
58 44 23
59 74 38
60 58 19
61 81 46
62 69 27
63 208 88
64 67 23
65 91 39
66 507 195
67 257 61
68 68 14
69 82 28
70 133 42
71 104 25
72 102 17
73 101 20
74 218 40
75 350 74
76 199 36
77 144 28
78 208 40
79 175 15
80 136 21
81 174 11
82 413 42
83 179 7
84 213 14
85 237 11
86 181 6
87 226 13
88 179 6
89 237 9
90 163 9
91 195 9
92 163 1
93 211 4
94 464 4
95 244 4
96 175 5
97 221 4
98 225 1
99 217 1

Edited by BlenD
Link to comment
Share on other sites

Bumping own thread for possible breakthrough.

Now it's just (3A+B)/4 and (4A+B)/5 in the running. It all comes down to whether the linear region decays towards 1.25 or towards 1.33.

SLOPE currently at 1.322.

Edited by BlenD
Link to comment
Share on other sites

The return value of SLOPE keeps oscillating between 1.27 and 1.30. This isn't helpful at all.

I also can't shake the thought that something is missing, like we're trying too hard to make this for a model that is easy to conceive. When I get back at it tomorrow I'm going to try to set up a Gauss-Newton analysis. That will be able to maintain a number of variables and minimize wow -- we can go for a simplified approximation of that function after we find it.

Edit: MATLAB doesn't like this system and won't optimize any farther than my initial estimate. Bother.

Edited by BlenD
Link to comment
Share on other sites

I'm not much of a mathematician and most of the statistics talk is over my head, so take this for what it's worth. I'm just throwing a layman's idea out there to hopefully spark the real genius of others since the project has slowed down.

I've been looking at it like this:

Display, Actual, Disparity
9, 7.84% -1.16
23, 21.86% -1.14
27, 29.63% 2.63
36, 34.16% -1.84
41, 43.66% 2.66
49, 51.7% 2.7
56, 58.17% 2.17

63, 70.27% 7.27
66, 72.22% 6.22
75, 82.55% 7.55
82, 90.77% 8.77
94, 99.15% 5.15

In a 2RN system, what I'm calling the disparity should have roughly as many negatives as positive values below and above ~50 Hit. But with a few exceptions, for the high confidence values they're mostly positive and the disparity increases with HIT. This makes me wonder if a 3rd value is being added. Of course, because 2RN diverges from 1RN more at the extremes, it couldn't be a static value.

Maybe something like: ((3A+B)/4) + 200/(HIT+50)

In a 2RN system, +200/HIT+50 would bolster the lower values and become more negligible as HIT increases. The +50 to HIT would prevent absurd values from occuring at HIT<10.

I don't know how to model this so it's just something I think might represent the data. I'll try gathering outcomes at 1 HIT and see if that reveals anything; in a pure 2RN system it should be close to 0% whereas with a +modifier it should return the value of the modifier.

Edited by Verile
Link to comment
Share on other sites

post-21742-0-10970100-1458625548_thumb.png

I've been going at it from a couple of different angles. I'm trying to figure out how to give myself a min/max slope for different regions so that I can bound the data and their errors above and below by values based on other values. Right now I have the error bars set to cap at the highest of all low bounds to the left and the lowest of all high bounds to the right, and I'd like to narrow that further.

I have a hunch that the function has a maximum slope at 50 and a minimum at 0 and 100, like unweighted 2-RN before. If that's true, then the slope at 4 should be either equal or greater than the slope at 3. The difficulty is implementing this when the error bounds for adjacent points can be wildly off from each other.

When looking at the graph, you can ignore most of the values < 30 -- a lot of those still have sample sizes of 20 or less.

Link to comment
Share on other sites

It is literally going to take an hour for each 19% interval, so I'll update it whenever I get the hankering to have my butt kicked on Nohr Chapter 27.

Hit%    Hits   Miss
19      0      1
Link to comment
Share on other sites

Verile's idea got me thinking, since we have seen multi-term equations from IS before, namely FE9's Forge calculations.

Cost(stat) = [10(base stat)abs(stat increase)+(stat increase)^2]/2(stat)^2

At any rate, I added a polynomial fit (up to n = 6) and suffice to say we can pretty safely rule out anything on the order of 4-6. 3 is possible, but unlikely. I wish Excel would let me do a logistic fit. True Hit as we know it, for example, can be pretty closely approximated by

Z = 100/(1+exp(-0.188(x-50))

which is just a logistic function centered at 50 with bounds 0 and 100. If you vary the k (0.188) a little bit you can get more or less a perfect fit. If we had a true logistic fit, though, the slope at 50 would tell us everything we need to know.

Link to comment
Share on other sites

I did some more trials to see what would turn up.

Display, Outcome H/M, Actual

01, 5/495, 1%

02, 10/490, 2%

Surprisingly, the results perfectly matched the expected outcome of 1RN.

Probably rules out a polynomial like you said, unless the added value were quadratic but that seems unnecessarily complicated.

I'll continue brute forcing in intervals of 1 Hit over the week and see if I can smoke out a pattern.

As an aside, I'm surprised the Japanese haven't already figured this out, and if they have, that none of the Japanese fluent here have turned it up.

Edited by Verile
Link to comment
Share on other sites

We have a point at 9, which is reasonably close to 6 or 7, so if you want to brute force another value, try to target somewhere between 14 and 18. That would give us at least one value with a sample size > 200 every 7 Hit values for the lower region, which I can do a linear regression on and see how close to slope = 1 we get. The evidence is definitely in favor of 1-RN in the low range.

Link to comment
Share on other sites

It might be dynamic, but from my understanding of a dynamic model, it doesn't change the expected value, only the standard deviation. I'm not sure why there's so much flux between certain points, and I'm not certain how to take this F(A, B, z) = P and make it into something useful. This has only become more complicated as it's continued and it's maddening.

THis is only true if the system acts on both positive and negative modifiers. FE11's dynamic growths , for example, increase the expected value because negative dynamic growths are treated as zero.

Edited by sirmola
Link to comment
Share on other sites

I'm going to work this out: say I have a growth rate of 30 in a stat. There is a 30% chance that the stat will grow, and a 70% chance that it will not. In the event of a success, these values remain the same. In the event of a failure, the chances change to 33% and 67%.

Under normal circumstances (no dynamic growths), the EV is n*p, which for 15 levels is 4.5.

Under these adjusted probabilities, the first trial is 0.3, the second is 0.321 (0.7*0.33 + 0.3*0.3), and the third is 0.33444 (sum of all paths to success, HHH, HMH, MHH, MMH). The fourth is 0.3478989, and so on. In four trials, the base EV is 1.2, and the dynamic EV is 1.3033389, a +8.6% increase.

All right, I'm convinced. I'll look into it.

Link to comment
Share on other sites

All right, I have a model for dynamic hit rates, and I know it fits because I've checked it mathematically. So the next step for testing dynamic hit rates is to go back into My Castle and repeatedly test the same values.

There's a bit of variance depending on the coefficient, but basically, if dynamic hit rates are correct, it should be impossible to miss a certain number of times consecutively. For this segment I request that everyone record long-form data of Hit, Outcome, in the order measured.

We can't test the positive condition, we can only check against the negative condition.

If the step size is 10% of the value (rounded down), then it should be absolutely impossible to miss 10 times more than you hit in any string of trials (whether length 10, 20 or 200) at a Hit value of 50.

At other values:

@ 50: M <= H + 10
@ 60: M <= H + 7
@ 75: M <= H + 4
@ 80: M <= H + 3

I suggest testing at 75-80. The probability that you could surpass the maximum if dynamic is false is pretty high, relatively speaking. We can't lean on each other's data for this, though.

The success probability of the function has a limit, which can be taken as the EV of it, so I'm going to model some variants with static increments and ones of different proportions and see which fit the current data the best. The EV for 10% increment at 75 is -5 on our measured, for what that's worth, but I haven't checked any others yet.

Edit: Just from preliminary checks against the EVs of all of the data so far, this doesn't look like it fits, even at high increments. The change in probability diminishes much faster at high hit rates to the point where the impact is insubstantial. I'm going to start testing it against low hit rates to see what happens.

Edit 2: I've now tested the floor and ceiling of all possible increment types for different hit rates. While there is a marked increase at some values (the hit rate effectively doubles in the limit for some low values), the absolute ceiling for high values is below our measured values. It's not even a question of confidence values; the dynamic model does not allow there to be an 82% success rate at a value of 75, it caps at 80%. Other values, especially high values, are similarly over their dynamic-model predicted limit.

In the process, though, I did develop a formula for iterating through from trial to trial, which could be useful if applied to dynamic growth rates. I'd just need someone to help me build it into a web applet or something.

Edited by BlenD
Link to comment
Share on other sites

Arena Hitrates are BS anyways (on a totally different lvl from main story). though supposedly missing in DLC... I would seriously hope this isn't true because that's very, very bad for any game, when a supposedly 100% misses. I've already mentioned not wanting it to be dynamic. as for the other possibility mentioned in that thread, rounding. does anyone know if this might be the case, since Hit/Avoid does have that /2 in the formula? even if it was true, rounding is still bad. 100% missing or 0% hitting because they were actually 99.5% and 0.5% is really bad for any game.

Link to comment
Share on other sites

Not sure if this could be taken as evidence of a dynamic system or not, but

http://www.gamefaqs.com/boards/114533-fire-emblem-fates-conquest/73485449

In this topic, people are reporting missing when the listed hit rate is 100%.

Arena Hitrates are BS anyways (on a totally different lvl from main story). though supposedly missing in DLC... I would seriously hope this isn't true because that's very, very bad for any game, when a supposedly 100% misses. I've already mentioned not wanting it to be dynamic. as for the other possibility mentioned in that thread, rounding. does anyone know if this might be the case, since Hit/Avoid does have that /2 in the formula? even if it was true, rounding is still bad. 100% missing or 0% hitting because they were actually 99.5% and 0.5% is really bad for any game.

If I see an image of this, I'll take this seriously. I'm really averse to taking something from a GameFAQ's thread as fact when GameFAQ's is just really bad about being wrong about things -- and the comments in the thread are evidence that these people don't quite understand how the game handles number values.

Every past FE has rounded prior to use in calculations, so all values in Hit calculations should be integers. If they're not, I'd have a hard time believing that was intentional and would expect it to be patched out (actually, I would expect it patched before international release). A glitch in the displayed value is I think more likely than a rounding error, and I don't think that's terribly likely.

Edit: As far as I can tell, a rounding issue at Hit = 100 is actually impossible. The simplest approximation of an unweighted 2-RN system (pseudocode) is:

R1 = Math.rand()%100;

R2 = Math.rand()%100;

If (R1+R2 < 2*Hit) return success;

If Hit = 100, it doesn't matter what the combination of RN's is -- even if they're both 99.9999999, the result is less than 100. If you just store a raw random number value as an int, you're going to kill everything after the decimal point. IntSys would have to have switched from using either floor or store pretty much exclusively to using either ceiling or a more general round function to make that happen.

If it's really possible to miss at 100, it will happen to one of us soon enough, and hopefully we'll be able to get screenshots.

Edited by BlenD
Link to comment
Share on other sites

All right, one more thing I'm going to throw out there to pursue, once again from Verile's suggestion.

A split system (as in, a hard split system, with two different formulas) is ugly. Very ugly. And more code to implement than a single formula. However, we know that the data on one side is roughly P = Z, while on the other, it follows some kind of transform.

However, it is possible that there is a linear term and a nonlinear term that diminish near their appropriate extremes. This would be something like

P = (2*Z)/Z^2 + Z^2/(100 + Z)

This is an extremely rough estimate not based on any particular trends in the model, but the point is that the maximum of the first term is near the low end of the spectrum, and the maximum of the second term is on the high end. To get one that might be valid, we just have to follow the same constraints as any previous model:

  • Uniformly increasing from 0 to 100
  • Value at Hit = 0 is 0 (all terms cancel at 0, likely all terms multiplied by Z)
  • Value at Hit = 100 is 100 (or very, very close, if we want to try to explain the reported miss at 100)

After we find a good baseline, we can tweak it to fit our data as best as possible. As of right now, a good target would be a slope very close to 1 in the lower half and very close to 4/3 in the first segment (50-75) of the upper half.

Link to comment
Share on other sites

17600 points. No new evidence, but the error margins for (3A+B)/4 are decreasing, making it the best model so far for the upper half, hands down. In comparison:

Sum of the squares of the errors from Hit = 50 to 99:

  • (3A+B)/4 -> 579.73
  • (4A+B)/5 -> 743.24
  • Unweighted 2-RN -> 748.21

I also made a post about the system in a stats group I'm in on LinkedIn, so they may be able to provide some insight on how to narrow down possibilities more effectively than simply collecting more data. I've played a little bit with prediction intervals to no avail.

That's all I've got for now. I tested Hit = 4 about 350 times and the 1-RN model holds for that value as well, so status quo today.

Edited by BlenD
Link to comment
Share on other sites

With additional data, 3 points for (3A+B)/4 have fallen outside of their respective confidence intervals, close behind their unweighted brethren with 4 points.

I set up the calculations necessary to keep track of a logistic model and the respective odds ratios for each pair of points. The idea there is that as confidence increases the ratio of odds ratios, given by

Odds(x) = P(H)/[ 1 - P(H) ]

Odds Ratio = Odds(x+1) / Odds(x) = e^beta1

the beta1 value is a constant which should in the limit rest at a specific value. The data will then fit a model of the equation

P(x) = 1 / [ 1 + e^-(beta0 + beta1 * x) ]

The center for this model is chosen for us at 50, so beta0 is simply -50*beta1.

At present, this model is the least accurate using our measured data, because each data point is some unpredictable difference E from its actual value and this can't be eliminated from the beta1 term, but it's another method of data validation. There's also the method of treating each point as the CDF of a normally-distributed probability function, where dP represents the change in probability from point to point. This method would require us to have a sequence of about 10 very high-confidence values so that we could adequately bound their mins, maxes, and the intermediate slopes.

Link to comment
Share on other sites

Here's a dump of ~1200 points. Lunatic, blue/red/green units together, but staff separated (if any of that mattered).

If I were to keep going with collecting data, would you want me to create an entire new spreadsheet?

HRv1.txt

Link to comment
Share on other sites

If I were to keep going with collecting data, would you want me to create an entire new spreadsheet?

As in, your own, independent data-collection spreadsheet? At risk of sounding conceited, I'd say that I have a clear head start on you there (20000+ points, counting your data) and that keeping all or at least most of the information in one place would be to our advantage. I've recently started including the raw hit/miss counts for each point in updates to the initial post in this thread, and I am going to insert the most recent graph of the data in future updates for others to analyze.

That said, you can certainly take the raw data and perform your own analysis on it to see if you come up with any leads.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...