Qhimm.com Forums

Read this first! => FAQs and Tutorials => Topic started by: DynamixDJ on 2016-04-11 18:55:28

Title: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-11 18:55:28
Helpful Charts by DynamixDJ

Welcome to the first in a series of charts that I intend to create for the benefit of the FFVII community. You can also find a list of available charts via my Pastebin Homepage (http://pastebin.com/u/DynamixDJ), just remember to view the "raw" version!

Charts 001 - Enemy Formations: V1.1.1
View HERE (http://pastebin.com/raw/MUcyFwwi)
Download HERE (https://drive.google.com/file/d/0B8OpCQuDA-lKdlJiQ3I5bHFLMjQ/view?usp=sharing) (894 KB)

Example:
Code: [Select]
Enemy Formation Section:

\============================================================================/
 \                                                                          /
  \                 [011E] Cromwell                                        /
   |  Scene 205:    [011F] Manhole                                        | 
  /                 [0120] Manhole(Lid)                                    \
 /                                                                 (S CD)   \
/============================================================================\
|   USED | 1 Cromwell x2      | AT 00  | Sector 4/ | md8_b1   14 | EXP:  1600|
|R1 #820 |                    | Normal | 8 Gantries|             |  AP:   160|
|ED 0334 |                    | Attack | B 1A PGDA |             | GIL:  3000|
|-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -|
| Special • Setup Flag ED set - Preemptive Strikes OFF                       |
|————————o————————————————————o————————o———————————o—————————————o———————————|
|   USED | 1 Cromwell         | AT 00  | Sector 4/ | md8_b2   14 | EXP:  2400|
|R1 #821 | 2 Cromwell x2      | Normal | 8 Gantries|             |  AP:   240|
|ED 0335 |                    | Attack | B 1A PGDA |             | GIL:  4500|
|-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -|
| Special • Setup Flag ED set - Preemptive Strikes OFF                       |
|————————o————————————————————o————————o———————————o—————————————o———————————|
|   USED | 1 Manhole          | AT 00  | Sector 4/ | md8_b1   12 | EXP:   900|
|R1 #822 |   Manhole(Lid)     | Normal | 8 Gantries| md8_b2   12 |  AP:    80|
|ED 0336 | 2 Manhole x2       | Attack | B 1A PGDA |             | GIL:  3000|
|        |   Manhole(Lid) x2  |        |           |             |           |
|-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -|
| Special • Setup Flag ED set - Preemptive Strikes OFF                       |
|         • Battle Flag FFF6 set for Manhole(Lid); Invisible & non-          |
|           targetable                                                       |
|         • Battle Flag FFF7 set for Manhole(Lid) x2; non-targetable         |
|————————o————————————————————o————————o———————————o—————————————o———————————|
|   USED | 1 Manhole          | AT 00  | Sector 4/ | md8_b1   11 | EXP:   900|
|R1 #823 |   Manhole(Lid) x2  | Normal | 8 Gantries| md8_b2   11 |  AP:    80|
|ED 0337 | 2 Manhole          | Attack | B 1A PGDA |             | GIL:  3000|
|        |   Manhole(Lid) x2  |        |           |             |           |
|-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -|
| Special • Setup Flag ED set - Preemptive Strikes OFF                       |
|         • Battle Flag FFF6 set for Manhole(Lid); Invisible & non-          |
|           targetable                                                       |
|         • Battle Flag FFF7 set for Manhole(Lid) x2; non-targetable         |
\============================================================================/
 \                                                                          /
  \                 [011D] Behemoth                                       /
   |  Scene 206:    [011E] Cromwell                                       | 
  /                 [0121] Crazy Saw                                       \
 /                                                                 (S CE)   \
/============================================================================\
|   USED | 1 Behemoth         | AT 00  | Sector 4/ | md8_b1   10 | EXP:  1500|
|R1 #824 |                    | Normal | 8 Gantries| md8_b2   10 |  AP:   100|
|ED 0338 |                    | Attack | B 1A PGDA |             | GIL:  2200|
|-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -|
| Special • Setup Flag ED set - Preemptive Strikes OFF                       |
|————————o————————————————————o————————o———————————o—————————————o———————————|
|** USED | 1 Crazy Saw        | AT 00  | Sector 4/ | md8_b1    9 | EXP:  1600|
|R1 #825 | 2 Crazy Saw        | Normal | 8 Gantries| md8_b2    9 |  AP:   160|
|FD 0339 |                    | Attack | B 1A PGDA |             | GIL:  2600|
|————————o————————————————————o————————o———————————o—————————————o———————————|
|** USED | 1 Crazy Saw        | AT 00  | Sector 4/ | md8_b1    8 | EXP:  1600|
|R1 #826 |   Cromwell         | Normal | 8 Gantries| md8_b2    8 |  AP:   160|
|FD 033A |                    | Attack | B 1A PGDA |             | GIL:  2800|
|————————o————————————————————o————————o———————————o—————————————o———————————|
|   USED | 1 Cromwell         | AT 02  | Sector 4/ | md8_b1    2 | EXP:   800|
|R2 #827 |                    | Back   | 8 Gantries| md8_b2    2 |  AP:    80|
|FD 033B |                    | Attack | B 1A PGDA |             | GIL:  1500|
\============================================================================/

Enemy Encounters Section:

•————————————————————————————————————————————————————————————————————————————•
| ~ 733  "md8_b1"   - Sector 8 Upper Catwalk Area                  : Enc 48  |
|------------------------------------------------------------------+---------|
|  #820 : 2x Cromwell                               : NA : R1 : ED : Enc 14  |
|  #822 : 3x Manhole                                : NA : R1 : ED : Enc 12  |
|  #823 : 3x Manhole                                : NA : R1 : ED : Enc 11  |
|  #824 : 1x Behemoth                               : NA : R1 : ED : Enc 10  |
|  #825 : 2x Crazy Saw                              : NA : R1 : FD : Enc 9   |
|  #826 : 1x Crazy Saw, 1x Cromwell                 : NA : R1 : FD : Enc 8   |
|S #827 : 1x Cromwell                               : BA : R2 : FD : Enc 2   |
|S #828 : 2x Cromwell                               : BA : R2 : FD : Enc 2   |
|S #829 : 2x Cromwell                               : PA : R1 : FD : Enc 4   |
| - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -|
| Background 1A - Sector 4 / Sector 8 Gantries      : Training Rating:    ** |
•————————————————————————————————————————————————————————————————————————————•

•————————————————————————————————————————————————————————————————————————————•
| ~ 734  "md8_b2"   - Sector 8 Lower Catwalk Area                  : Enc 48  |
|------------------------------------------------------------------+---------|
|  #821 : 3x Cromwell                               : NA : R1 : ED : Enc 14  |
|  #822 : 3x Manhole                                : NA : R1 : ED : Enc 12  |
|  #823 : 3x Manhole                                : NA : R1 : ED : Enc 11  |
|  #824 : 1x Behemoth                               : NA : R1 : ED : Enc 10  |
|  #825 : 2x Crazy Saw                              : NA : R1 : FD : Enc 9   |
|  #826 : 1x Crazy Saw, 1x Cromwell                 : NA : R1 : FD : Enc 8   |
|S #827 : 1x Cromwell                               : BA : R2 : FD : Enc 2   |
|S #828 : 2x Cromwell                               : BA : R2 : FD : Enc 2   |
|S #829 : 2x Cromwell                               : PA : R1 : FD : Enc 4   |
| - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -|
| Background 1A - Sector 4 / Sector 8 Gantries      : Training Rating:    ** |
•————————————————————————————————————————————————————————————————————————————•

Stay tuned for more charts to come! It is worth mentioning however that my walkthrough (http://www.neoseeker.com/final-fantasy-vii/faqs/1733032-dynamixdj.html) is my main focus and drive for the time being, and until it is complete I'm not going to be working too heavily on my charts. I have over a dozen in mind to make, and you'll all have to be patient, as they won't be dropping any time soon!  ;)
Title: Re: Helpful Charts by DynamixDJ
Post by: Sega Chief on 2016-04-11 20:20:56
So there's a flag to disable pre-emptives; that's interesting. Having info on formations will also help with planning to save space.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-11 21:24:57
It's also quite helpful to see how much EXP etc is available for each formation, as you can monitor the progression rate of the rewards, area by area.

I'm trying to think of a formula to find the EXP average of an area (and AP and GIL). I don't see why this wouldn't work:

Encounter 1 = 800   Exp, enc 22 (Normal Battle)
Encounter 2 = 1000 Exp, enc 21 (Normal Battle)
Encounter 3 = 1700 Exp, enc 21 (Normal Battle)
Encounter 4 = 650   Exp, enc 8   (Special Battle)
Encounter 5 = 4000 Exp, enc 2   (Special Battle)

[(800 * 22) + (1000*21) + (1700 * 21) + (650 * 8 ) + (4000 * 2)] / (sum of all encounter rates, 74) = 1507 EXP Average

I don't see any reason why this formula wouldn't work, but then again I'm not a mathematician! There is a factor that I'm not accounting for, and that is that the special battle check occurs prior to the normal battle check. 'm not sure if that makes a difference or not.... Actually, it does, seeing as the encounter rate of a normal battle is actually slightly less given the fact that you may not encounter one in the first place... in this instance, a 10/64 chance.

Do I just settle with 1507 EXP average, or can we work the compounding initial formula into the equation??

10 / 64 = 15.625

[(800 * 22) + (1000*21) + (1700 * 21)] * (1 - 0.15625) = 62,690.625
62,690.625 + (650 * 8 ) + (4000 * 2)] / 74 = 1025 EXP Average

Nearly 500 difference.
The other possibility:

[(800 * 22) + (1000*21) + (1700 * 21)] / 64 = 1,161
[(650 * 8 ) + (4000 * 2)] / 64 = 206
1161 + 206 = 1367 EXP Average

The last one feels right to me.
Thoughts??
Title: Re: Helpful Charts by DynamixDJ
Post by: Sega Chief on 2016-04-12 09:41:34
I'm not a mathematician either, but as far as the encounter rate goes I'd expect the second value to be more accurate.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-12 10:45:21
I'm actually inclined to think the third formula is the one that fits, but I'm just not 100% sure....

I summon thee, NFITC1!!!!
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-12 16:36:17
Ooh, MATH! THIS I can do.

Based on my analysis of the code, it will first calculate whether or not a "special battle" will occur out of a chance of 64. Failing this it will pick from the remaining groups out of a new 64 chance.

Code: [Select]
ENC_VALUE = [0..63]
For x = 0 to 3
   if (special_battle(x).chance < ENC_VALUE )
      return special_battle(x)
   endif
Next x
ENC_VALUE = [0...63]
For x = 0 to 5
   if ( battle(x).chance < ENC_VALUE )
      return battle(x)
   endif
Next x
(If nothing gets returned it does the calculation again)

Let's take your base formation group as the example:
Quote
Encounter 1 = 800   Exp, enc 22 (Normal Battle)
Encounter 2 = 1000 Exp, enc 21 (Normal Battle)
Encounter 3 = 1700 Exp, enc 21 (Normal Battle)
Encounter 4 = 650   Exp, enc 8   (Special Battle)
Encounter 5 = 4000 Exp, enc 2   (Special Battle)

Then what we have is this:

( (650 * ( 8 / 10) ) + (4000 * ( 2 / 10 ) ) ) * (10 / 64) + ( (800 * (22 / 64) ) + (1000 * (21 / 64) ) + (1700 * (21 / 64 ) ) * ( 54 / 64 )
( 650 * .8 + 4000 * .2 ) * .15625 + ( ( 800 * 0.34375 ) + ( 1000 * 0.328125 ) + ( 1700 * 0.328125 ) ) * 0.84375
( 520 + 800 ) * .15625 + ( 275 + 328.125 + 557.8125 ) * 0.84375
1320 * .15625 + 1160.9375 * 0.84375
206.25 + 979.541015625 = 1185.791015625

Rationale:
Since we have two groups of battles (blue are considered first) then we can calculate the average of them individually based on their weights. These are the bolded values on line 4. Since there is an unequal chance of these occurring we can't just add them and divide by two. We have to treat them as weighted values as well. This will become:

(weighted average of each special battle encounter) * (total special encounter rate / 64) + ( weighted average of each regular battle encounter ) * ( [ 64 - total special encounter rate] / 64 )

HOWEVER! This is not entirely the correct answer. It's CLOSE and ideal, but randomly generated numbers do not have a uniform distribution (https://en.wikipedia.org/wiki/Normal_distribution). Based on a few simulations I ran (10000 encounters with this encounter rate) the average was a little off (I'll get to that momentarily). This, of course, assumes the world map and the field share identical scene choosing methods: choose special encounters first then normal. Using the same RNLUT that the field uses I got an entirely different result. Go figure. Here's what I got:

Calculated average: 1185
World Map simulated average: ~1171
Field simulated average: ~1160

So why are the simulations and calculation so different?
Calculations: This is based on the assumption that all values have a likely chance of being used. The first value that is selected is the special battle encounter chance. This may or may not do anything to the average so a new value gets chosen. This happens roughly 54 out of 64 times for the above example. We then have a NEW percentage of chances for the remaining normal battles.
World Map: The world map has no RNLUT so it uses system RNG calls. This has the effect of the Normal Distribution mentioned above. This is just the way computers work. So, the middle percentages of each step have a slightly higher probability of being chosen. This takes some statistics explaining to account for, but I won't bore you all with the details. Suffice to say, this is pretty accurate to our calculation when considering this effect of randomly generated numbers.
Field: This uses the infamous RNLUT which attempts to prevent the normal distribution problem. Assuming there are no random values flying around outside of battle choosing, this will be the effect. We'll get an even distribution of 0s to 32s which we don't typically find in straight system RNG calls. But we're not calling them at the same rate. Since we sometimes get one and sometimes get two, the results get skewed a bit. Within 10000 runs, the formations each got called the following number of times:
Code: [Select]
special 1: 1497
special 2: 214
normal 1: 2570
normal 2: 2858
normal 3: 2862
From this we can see that the special 1 : special 2 ratio is not the 8 : 2 that our example table uses. Nor is the normal1 : normal 2 : normal 3 close to 22:21:21. If anything it's more like 20:22:22. Basically, the RNLUT doesn't solve the Normal Distribution issue either.

So it's up to you how you want to report it. The World Map average is about 98.8% of the calculated value and the Field is 97.9%. You can express the calculated as the "ideal, yet impossible average per battle" which will scale properly per area and still give a good indication of how good an area is on giving exp per formation. i.e. One area might have a calculated average per battle of 1580 and the world map equivalent would be 1564, but another area calculated at 1600 won't actually be 1550 or so.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-13 03:09:10
Hahaha that was a powerful Summon! You may now return to wherever it is that Summons go when their animations have finished playing, somewhere in the battle folder I assume!

I just about understand the maths behind all of this, and I'm thinking damn! That's a lot of maths to do for each area! I might have a fiddle with Microsoft Excel to input the formula's in that way. There is one small discrepancy with your calculations however:

( (650 * ( 8 / 10) ) + (4000 * ( 2 / 10 ) ) ) * (10 / 64) + ( (800 * (22 / 64) ) + (1000 * (21 / 64) ) + (1700 * (21 / 64 ) ) * ( 54 / 64 )

See the bit in bold? This bit I'm not getting. The sum of all the normal battle encounter rates is 64, not 54... Have you made a mistake, or am I not seeing it right?

Also, in regards to the World Maps, i know that the encounter chance doesn't work in the same way for the World Map as it does for the Field Map; the field map will do one check for the special battles, considering the encounter values for all of the Special battles, combined, and then move onto the normal battles. However, on the World Map, a check is performed for each individual battle slot, of which there are 4. So in the example used, the first check will be an 8/64 for spcl battle 1, then the 2nd check occurs which is 2/64, and then the normal battle check. All of this occurs after the Mystery Ninja check, and then the Chocobo Battle chance, which I'm not even considering into the equation, for obvious reasons.

Anyway, do you suspect that the variation in the way in which special battles are treated are the cause of the differentiation between World and Field Maps in the projected averages?
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-13 15:16:23
Hahaha that was a powerful Summon! You may now return to wherever it is that Summons go when their animations have finished playing, somewhere in the battle folder I assume!
You can't contain me!!!

Quote
Have you made a mistake,
How dare you! I never usually get something correct on the first pass of a problem; But I'm actually good at math and don't often make mistakes.

Quote
or am I not seeing it right?
This. And I figured as much, but I thought I'd let you mull it over for a while and decide whether or not you wanted to know WHY that's the case. Aren't I nice? :)
See, at the beginning a random number capped at 63 ([0..63]) will be generated and, in this case, the special formations have a 10 in 64 chance of appearing as you did notice is the total of their encounter rates. If no special formations are selected another [0..63] will be "rolled" and the normal battles will be chosen from that. Since this leaves only 10 values in the first role for the special formations, then that must mean the remaining 54 values will yield normal battles. OF THOSE normal battles, 22 will yield the first formation, 21 will yield the second, and 21 will yield the third. That's a separate 64 chance selection as indicated by multiplying the actual experience values by ( x / 64 ). Even if they don't total up to 64 the chance is still x / 64 for that formation and a ( 64 - x ) / 64 chance for it to NOT be chosen.


Quote
Also, in regards to the World Maps, i know that the encounter chance doesn't work in the same way for the World Map as it does for the Field Map; the field map will do one check for the special battles, considering the encounter values for all of the Special battles, combined, and then move onto the normal battles. However, on the World Map, a check is performed for each individual battle slot, of which there are 4. So in the example used, the first check will be an 8/64 for spcl battle 1, then the 2nd check occurs which is 2/64, and then the normal battle check. All of this occurs after the Mystery Ninja check, and then the Chocobo Battle chance, which I'm not even considering into the equation, for obvious reasons.

Anyway, do you suspect that the variation in the way in which special battles are treated are the cause of the differentiation between World and Field Maps in the projected averages?
Well, there's a pickle, to be sure. It looks to me like the WM has the same formation choosing power that the field has. The WM doesn't use the system's RNG like I suspected for formation selection (however, it does when determining if a battle should occur). It uses a pre-computed table of "random" values that changes after so many calls (520, to be exact) and not specifically to formation selection. The Mystery Ninja uses two of these calls right off before checking where you are or even your terrain type. The special battles call this a little less predictably.

The real issue is between calculation and simulation. The calculation I gave you is correct whether on the map or in the field. The simulation for WM calls is wrong, but it's more complicated than I expected and I probably won't redo it. We can relabel this "Truly random simulation average" and the WM would probably be somewhere between the calculated and field values.

Either way, it's 98.3±.5% of the calculated value so that's statistically spot on.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-13 15:58:09
NFITC1, as a person, statistically you are spot on! Thank you for clearing this up, I understand it all now!!!
The only "hard" bit will be inputting all of these formulas into a spreadsheet which I haven't done since the days of school, but I 'm fairly confident that it can't be that hard, I'll fiddle around tonight!

Even if I can't contain you, I can still try, but first I need to obtain the Contain Materia.... Spare some Mimett Greens, anyone??? (I ran out of gil playing Super Dunk  :D)

NICE 1!!!!

-EDIT- I've just realised, seeing as we're taking an average, can 1185.791015625 be rounded up? Also, in an example where there are no special battles, can I assume that [(800 * (22/64)) + (1000*(21/64)) + (1700 * (21/64))] / 64 is a correct formula?

-Edit again- HAHAHAHAHAHAHAHA!!!!!!! I've just read the super-small print:
Quote
How dare you! I never usually get something correct on the first pass of a problem; But I'm actually good at math and don't often make mistakes.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-13 23:32:41
I've just finished making a Reward Average Calculator (https://docs.google.com/spreadsheets/d/1XwItLfJprN27O2ZBEktjrO8qu5vpuBW0SZlq4wLnCno/edit?usp=sharing). Thanks a bunch, NFITC1!!!!
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-14 01:56:28
in an example where there are no special battles, can I assume that [(800 * (22/64)) + (1000*(21/64)) + (1700 * (21/64))] / 64 is a correct formula?

Nope. Then you've got too many divide-by-64s in there. Drop that last one and it's correct.

I've just finished making a Reward Average Calculator (https://mega.nz/#!0oYiyT5A!y_Y6V9Zum9TtFdaxv7O5Mw66nd3JRatdSFs-4PkoSHE). Thanks a bunch, NFITC1!!!!
That's great! I was going to suggest adding AP and Gil columns to that and you already did. I approve. :)
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-14 03:01:52
Quote
Nope. Then you've got too many divide-by-64s in there. Drop that last one and it's correct.
Yeah I realised this as I was making the spreadsheet  :)

I've just updated it, I've now added a master formula to it! ;)
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-14 14:14:32
If you want to go one step further, you should include the total HP of the enemy party. It would use the same averaging formula as the others and it would give a good representation of how fast they could be won.
Perhaps one strong enemy has 1500 HP and gives 500 EXP, but four weaker enemies have a total of 1500 HP and give 400 EXP. I'd rather go after the stronger battle.
BUT, if I can do 10 weaker battles in the same time I can do 8 stronger ones for the same EXP then it's more advantageous to do the weaker ones.

Also, the encounter rate should be a factor as well. If an area's average EXP is 2500, it won't be better if it has a third the encounter rate of an area with an average of 1500.

Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-14 15:57:15
On a quick break, so this'll have to be brief

You're correct, adding the HP average wold be benificial. I shall do just that when I get home tonight.

I am taking the area's encounter rate into consideration when I reevaluate the * rating I have given for each area, but not mathematically; I'm not fitting it into the equasion, I'm not exactly sure how.

Anyway, I was trying to figure out exactly how the World Map averages differ from the field map averages; I concluded that if there is a difference, that it was probably minute, but I couldn't quite work out how the formula differs from the current formula; by my reckoning, the functions were different, but the end result was the same. Then someone sent an email this morning offering a World Map formula:

(650*(8/64)) + (4000*(2/64)*(56/64)) + ((800*(22/64)) + (1000*(21/64)) + (1700*(21/64)))*(1 - (8/64) - (2/64)*(56/64))
equals = 1174.7009

Red = shouldn't the first part of the formula be (650*(8/64)) + (4000*(2/64))*(10/64)?
Blue = This seems to make sense, given the fact that 2 checks are taking place. Can you confirm/deny?

-Edit- Goddamn it Nameless Face, you know I'm slightly obsessive compulsive, right? If I'm going to include HP averages, then my brain DEMANDS that I also include Lv, MP, Strength, Defence, Magic, MDefence etc. OCD DICTATES!!!! It's all good, I'm already planning on how I'm going to continue to map out my calculator when I get home. Thanks also to Gurthawoe for helping me with my spreadsheet! Also, he has clarified my question in red, it makes sense now! :)
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-14 19:30:37
I am taking the encounter rate into consideration when I reevaluate the * rating I have given for each area, but not mathematically; I'm not fitting it into the equasion, I'm not exactly sure how.
Since the higher the encounter rate the longer between encounters, it could just be divided by the total: ( [equation] / (formation_encounter_rate / lowest_encounter_rate) ). Then it's relative to the most frequent encounter rate. 12 seems to be lowest on the WM and 24 in the fields.

Anyway, I was trying to figure out exactly how the World Map averages differ from the field map averages; I concluded that if there is a difference, that it was probably minute, but I couldn't quite work out how the formula differs from the current formula; by my reckoning, the functions were different, but the end result was the same. Then someone sent an email this morning offering a World Map formula:

(650*(8/64)) + (4000*(2/64)*(56/64)) + ((800*(22/64)) + (1000*(21/64)) + (1700*(21/64)))*(1 - (8/64) - (2/64)*(56/64))
equals = 1174.7009

Red = shouldn't the first part of the formula be (650*(8/64)) + (4000*(2/64))*(10/64)?
Blue = This seems to make sense, given the fact that 2 checks are taking place. Can you confirm/deny?
Those are all wrong. The World Map does use moderately different calculations, but none of those are right. This is what happens:

Pre-Emptive materia (PEM) grants, at most, 85 / 256 to the pre-emp rate. It also prevents back attacks and side attacks. We'll call its rate PEMr which has a minimum of 16.
If PEMr is greater than 16, we double it.
If the PEMr is greater than or equal to [0..255] then we skip special formation battles entirely.
Special battles:
    A: [0..63] is used to determine if either back-attack formation1 or formation2 are used. Somehow, having a mastered Pre-Emp materia affects this rate (either halves or doubles)
    B: If those fail and we have more than 1 character in our party, a new [0..63] is used to determine if we get a side attack
    C: If the above fail, there is a new [0..63] to determine if we get pincered
Normal Battles:
    D: We use one [0..63] to determine if we get formation 0 - 5

So:

( 1 - (PEMr / 256) ) *   //special formation check
    (( (back1 / 64) + (back2 / 64) ) //back attack formation selection chance
    +
    ( ( 1 - ( (back1 + back2) / 64 ) ) * //back attack formation fail
        ( ( side / 64 )  //side attack formation chance
        +
        ( 1 - ( side / 64 ) )  *//side attack formation fail
            ( pince / 64 ) ) ) ) //pincer formation chance
+
( PEMr / 256 +  //special formation fail
    ( (1 - (PEMr / 256) ) * ( 1 - ( (back1 + back2) / 64 ) ) * ( 1 - ( side / 64 ) ) * (1 - (pince / 64) ) ) * //special formation pass, but formation selection fail
    ( ( form0 / 64 ) + ( form1 / 64 ) + ( form2 / 64 ) + ( form3 / 64 ) + ( form4 / 64 ) + ( form5 / 64 ) ) //normal battle selection

This is particularly ugly for several reasons. First off, the percentage chance trickles down into the next checks sometimes. Not all the time, but I'm going to assume that it will. If we only have one party member then the formula changes. Secondly, the chances that a normal battle occurring are greater than just the inverse of the chances a special formation is CHECKED for. We also have a variable that we have control over. The PEMr can make a drastic difference.
Pincer attacks are pretty rare being a success of "special battle check" and failing both pre-emp and side attack battle checks.

Let's apply this to a full formation entry with no mastered Pre-Emp and more than one party character (from TFergusson's guide):

Quote
Cosmo Area - Canyon
  Normal Battle #1:  11/64 Chance       Back Attack #1:     2/64 Chance
     Row 1: 2x Skeeskee
     Row 2: 1x Skeeskee                    Row 1: 2x Desert Sahagin
  Normal Battle #2:  11/64 Chance       Back Attack #2:     2/64 Chance
     Row 1: 1x Griffin
  Normal Battle #3:  11/64 Chance          Row 1: 3x Skeeskee
     Row 1: 1x Golem                    Side Attack:       10/64 Chance
  Normal Battle #4:  11/64 Chance          Row 1: 3x Skeeskee
     Row 1: 2x Skeeskee                 Ambush:             4/64 Chance
     Row 2: 1x Griffin                     Grp 1: 1x Desert Sahagin
  Normal Battle #5:  10/64 Chance          Grp 2: 1x Desert Sahagin
     Row 1: 1x Desert Sahagin
     Row 2: 2x Desert Sahagin
  Normal Battle #6:  10/64 Chance
     Row 1: 2x Desert Sahagin

Skeeskees = 222
Griffins = 260
golems = 300
desert sahagins = 230

Normal 1: 666
Normal 2: 260
Normal 3: 300
Normal 4: 660
Normal 5: 690
Normal 6: 460
Back Attack 1: 460
Back Attack 2: 666
Side: 666
Pincer: 460

Do it:

( 1 - (PEMr / 256) ) *   //special formation check
    (( (460 * 2 / 64) + (666 * 2 / 64) ) //back attack formation selection chance
    +
    ( ( 1 - ( (2 + 2) / 64 ) ) * //back attack formation fail
        ( ( 666 * 10 / 64 )  //side attack formation chance
        +
        ( 1 - ( 10 / 64 ) )  *//side attack formation fail
            ( 460 * 4 / 64 ) ) ) ) //pincer formation chance
+
( PEMr / 256 +  //special formation fail
     ( ( 1 - (PEMr / 256) ) * ( 1 - ( (2 + 2) / 64 ) ) * ( 1 - ( 10 / 64 ) ) * (1 - (4 / 64) ) ) * //pincer attack formation selection fail
    ( ( 666 * 11 / 64 ) + ( 260 * 11 / 64 ) + ( 300 * 11 / 64 ) + ( 660 * 11 / 64 ) + ( 690 * 10 / 64 ) + ( 460 * 10 / 64 ) ) //normal battle selection

With no Pre-Emp materia:

0.9375 * ( ( 14.375 + 20.8125 ) + 0.9375 * (104.0625 + 0.84375 * 28.75) ) + ( 0.0625 + (0.9375 * 0.9375 * 0.84375 * 0.9375 ) ) * ( 114.46875 + 44.6875 + 51.5625 + 113.4375 + 107.8125 + 71.875 )

Put it all together and you get 527.5466135 per battle.

With maxed Pre-Emp:

0.3359375 * ( ( 14.375 + 20.8125 ) + 0.9375 * (104.0625 + 0.84375 * 28.75) ) + ( 0.6640625 + (0.3359375 * 0.9375 * 0.84375 * 0.9375 ) ) * ( 114.46875 + 44.6875 + 51.5625 + 113.4375 + 107.8125 + 71.875 )

Put it all together and you get 512.3372760713 per battle.

Please note: These only apply to the World Map formation selections. The field functions exactly like I calculated before.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-14 19:53:07
OK, I'll try to digest all of this when I get home, but I just want to say that at no point during the calculations am I going to account for the Mystery ninja encounters, Chocobo Encounters or the effect of equipping a Mastered Pre-empt.

So, I appreciate you going through all of the trouble to explain the affect that pre-emp has, but it's not going to affect my calculator. I've just noticed, you've taken the 2 Back attacks together as one chance. Is this exactly how it works? So after the Myst Ninja and Chocobos, there are three (not four) special battle checks before moving onto the Normal Battles?
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-14 19:59:39
OK, I'll try to digest all of this when I get home, but I just want to say that at no point during the calculations am I going to account for the Mystery ninja encounters, Chocobo Encounters or the effect of equipping a Mastered Pre-empt.
Nor should you because these are not part of normal grinding. In some cases, Pre-Emp might work against you.

So, I appreciate you going through all of the trouble to explain the affect that pre-emp has, but it's not going to affect my calculator. I've just noticed, you've taken the 2 Back attacks together as one chance. Is this exactly how it works? So after the Myst Ninja and Chocobos, there are three (not four) special battle checks before moving onto the Normal Battles?
You don't want to know how many hours I spent staring at the code and making absolute certain that's how everything worked. The Math behind it took just as long.

EDIT:
I just realized that FFIX was released today and I spent all my time on THIS rather than bingeing FFIX. Just consider that when acknowledging my contribution. :P
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-14 21:29:54
Quote
You don't want to know how many hours I spent staring at the code and making absolute certain that's how everything worked. The Math behind it took just as long.
Hang on a minute, when I skimmed over your post whilst having quick 5 min break, I didn't read it correctly. I thought that this formula was for pre-emps only, but I've just studied it, and it's starting to make more sense now. You've already answered my q regarding both back attacks being considered in one check.

I'd formulated half a dozen questions on my journey home, but I keep re-reading your post to find you've already answered them. I was genuinely perplexed earlier, but now I think I have enough to go to add this to my calculator. Thanks a bunch NFITC1!

As is the nature of everything I set myself, this quick 5-minute calculator is becoming a big project. Gurthawoe has helped me out by included a "VLookUp" function which pulls the data as it has been entered on plan 2, so in theory I could turn this into a complete database, as well as a calculator! A modder could input the total statistics for each formation in an area within plan 2, let's say "gonjun2", then within plan 1 simply search gonjun2, or even just #515, and you'll be able to see an average for every stat! At this rate, I'm never going to finish my walkthrough (http://www.neoseeker.com/final-fantasy-vii/faqs/1733032-dynamixdj.html) that I started a year ago and am still a long, long way away from completion!  :cry: The release of the remake is my deadline! I may leave the database for now..... added to my "to-do" list

-edit after reading edit-
Quote
EDIT:
I just realized that FFIX was released today and I spent all my time on THIS rather than bingeing FFIX. Just consider that when acknowledging my contribution. :P
And your help and consistent contributions to my many projects is valued more than anything! You've helped me the most Mr NFITC1, best belie' dat!!!

You can blame my hurried work breaks for the unintentional misreading of your workings! Thanks for the help, i really do appreciate it!
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-14 22:13:11
What you should be asking is how can any kind of average weighted or otherwise be greater than any individual element.
I think I miscalculated the max pre-emptive rate average and left out a number. The nonpreemptive rate should still be correct.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-14 22:20:26
Lol, I hadn't clocked onto that.

NFITC1, how can any kind of average weighted or otherwise be greater than any individual element???

-edit- errrr, (1 - (85/64)) = 0.33203125 (not 0.3125)
I still need to spend more time with it before I understand it fully...
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-15 03:56:25
I've just finished making a Reward Average Calculator (https://docs.google.com/spreadsheets/d/1XwItLfJprN27O2ZBEktjrO8qu5vpuBW0SZlq4wLnCno/edit?usp=sharing). Thanks a bunch, NFITC1!!!!

OK, i've been busy with this. I haven't entered the world map formulas yet, but I have enabled it so you can simply type the name of the enemy into the battle slots along with their quantity, then assign an encounter rate and it'll work the rest out for you! This is turning into something quite cool actually!!!
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-15 14:31:26
Lol, I hadn't clocked onto that.

NFITC1, how can any kind of average weighted or otherwise be greater than any individual element???
Because I don't always get things right the first time and sometimes make mistakes. The formula is correct, but I left out a  number when calculating. I've corrected it all on that post and you can see how max preemping rates can hurt you.

-edit- errrr, (1 - (85/64)) = 0.33203125 (not 0.3125)
I still need to spend more time with it before I understand it fully...
No it's not. (1 - (85 /64 ) ) is -0.328125. What we're looking for in that slot is ( 1 - ( 170 / 256 ) ). The PEMr is doubled when considering if there will be a special battle like this. Normally there would be a 1/16th chance that it won't even be considered. With a higher PEMr there's a greater chance (as high as 170 / 256 or 66.4%) they will be skipped. The chance for getting an actual preemp battle (making one of the normal battles preemptive) is still 85 / 256.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-15 16:01:39
Yes, I'm not sure why I typed 85/64, I meant (1-((256-85)/256)). I've been working out of 64 for so long that I keep typing that by default.

2 questions..... usual case of fast typing (I have 17 mins to eat my lunch and type my questions).

1) Does a mastered pre-emp also halve chances of the special battle enc ratings on the field maps? If so, I believe it won't be too difficult to work it into the calculator.

2)I've been thinking about your suggestion to also account for the enc rate for the area. I could change the */***** training rating for a "training value". Would this formula work, where a is enc value for area, x is EXP, y is AP and z is GIL:

Training Value = (x/a)+(y/a)+(z/a)

Also, I've been thinking about working HP into the training value. It won;t work. With your example of 1 enemy with 1500HP and 4 enemies totaling 1500HP, Def and MDef would need to be taken into account, as the four "weaker "enemies could actually be harder to kill. The LOWER the value of the HP/Def/Mdef average, the higher the rating, whereas the HIGHER the EXP/AP/GIL rating the higher the rating, so I would need to work out a modifying formula, perhaps the same as the one used in Damage calculation - [Def = 512-Def] [MDef = 512-MDef], I'm not sure how to work out HP...

There is another reason why i shouldn;t account for HP/Def/MDef into the training value. Let's talk about the Mythril Mines. It's common knowledge that the N western cave is better than the N eastern cave, iirc this is because of the appearance of 5x Crawler. Now, Speaking hypothetically, let's say that the NW enemies are notably stronger in terms of average HP/Def/MDef, and vice-versa for the NE cave. This could bring the training value of the NW cave low enough to match the NE cave. Let;s say your party is slightly OP, or you enjoy spamming Beta and you're able to 1 hit kill all enemies in both caves, in which case the HP/Def/Def would be unjustifiably bringing the Training Value down, when the NW cave is blatantly better than the NE cave.

With this in mind, I think the best thing to do is to just settle with taking Enc, av EXP, av AP and av Gil into consideration for the "training value" rating.

With not time to re-read, I hope all this makes sense!!!!

-edit- have you checked the latest version of my calculator?
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-15 16:35:02
1) Does a mastered pre-emp also halve chances of the special battle enc ratings on the field maps? If so, I believe it won't be too difficult to work it into the calculator.
Not as directly as the WM does. It will halve the chance of a back attack or pincer attack, but they will still be considered regardless of the PEMr.

2)I've been thinking about your suggestion to also account for the enc rate for the area. I could change the */***** training rating for a "training value". Would this formula work, where a is enc value for area, x is EXP, y is AP and z is GIL:

Training Value = (x/a)+(y/a)+(z/a)
That might work, but that's a good average training location. It'd probably be better to say, per reward, which each zone is better at. eg. Region1 has better AP than Region2, but Region2 has better Gil.

Also, I've been thinking about working HP into the training value. It won;t work. With your example of 1 enemy with 1500HP and 4 enemies totaling 1500HP, Def and MDef would need to be taken into account, as the four "weaker "enemies could actually be harder to kill. The LOWER the value of the HP/Def/Mdef average, the higher the rating, whereas the HIGHER the EXP/AP/GIL rating the higher the rating, so I would need to work out a modifying formula, perhaps the same as the one used in Damage calculation - [Def = 512-Def] [MDef = 512-MDef], I'm not sure how to work out HP...
Let's not get into my plan to calculate it using DPS. :)

There is another reason why i shouldn;t account for HP/Def/MDef into the training value. Let's talk about the Mythril Mines. It's common knowledge that the N western cave is better than the N eastern cave, iirc this is because of the appearance of 5x Crawler. Now, Speaking hypothetically, let's say that the NW enemies are notably stronger in terms of average HP/Def/MDef, and vice-versa for the NE cave. This could bring the training value of the NW cave low enough to match the NE cave. Let;s say your party is slightly OP, or you enjoy spamming Beta and you're able to 1 hit kill all enemies in both caves, in which case the HP/Def/Def would be unjustifiably bringing the Training Value down, when the NW cave is blatantly better than the NE cave.

With this in mind, I think the best thing to do is to just settle with taking Enc, av EXP, av AP and av Gil into consideration for the "training value" rating.
It's certainly the most sensible thing to do. :)

-edit- have you checked the latest version of my calculator?
Not yet. I tried dl-ing it once and Mega threw an exception at me. I'll try again soon.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-15 17:12:43
Quote
That might work, but that's a good average training location. It'd probably be better to say, per reward, which each zone is better at. eg. Region1 has better AP than Region2, but Region2 has better Gil.
TBH, I'll probably add the individual Av values, the * rating, AND the rating value!!!

Quote
Not yet. I tried dl-ing it once and Mega threw an exception at me. I'll try again soon.
I said I wasn't going to work on building a database just yet. I lied  :D
Try typing in an enemy's name into the relevant field. Only 6 enemies can be searched for at present, check Sheet 2 labelled "beast"

-Edit- AVERAGE ENEMIES PER BATTLE!!! That's definitely getting worked into the calc :D
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-16 02:21:34
Quote
Normal Battle #4:  11/64 Chance       
     Row 1: 2x Skeeskee                 
     Row 2: 1x Griffin                     

Skeeskees = 222
Griffins = 260
golems = 300
desert sahagins = 230

Normal 1: 666
Normal 2: 260
Normal 3: 300
Normal 4: 660
Normal 5: 690
Normal 6: 460
Back Attack 1: 460
Back Attack 2: 666
Side: 666
Pincer: 460

This should be 704  :P
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-16 13:40:58
Quote
( 1 - (PEMr / 256) ) *   //special formation check

With a mastered Pre-emp at 85, this should be 0.66796875

You have the value 0.3359375, which is ( 1 - ((255 - PEMr) / 256) )

Reads other posts..... (255/3=85). This is why I'm getting confused. It's not ( 1 - ((255 - PEMr) / 256) ) at all, it's still ( 1 - (PEMr / 256) ), however....

Quote
The PEMr is doubled when considering if there will be a special battle like this. Normally there would be a 1/16th chance that it won't even be considered. With a higher PEMr there's a greater chance (as high as 170 / 256 or 66.4%) they will be skipped.
Sorry, could you possibly clarify for me exactly when the PemR is doubled? I'm working it into my calculator; you can set the PEMr to 16 by default to give you normal averages, and then increase it to see if equipping the Pre-Emp Materia helps your averages or not. Before I can really input it into the calc, I need to be 100% sure of it. With PEMr @ 16, you have calculated it as that, 16 to pull the value 0.9375. Does the rate become doubled as soon as it exceeds 16?

Also, you say that on the field maps a mastered pre-emp will halve the chance of all back & Pincer attacks. Just to clarify, we're talking [IF PEMr = 85 then (BA1, BA2 & PA ENCr / 2)]. This is all or nothing? Less than PEMr 85 and nothing happens?
Thanks

-Edit- My * rating has only been given to screens in which random encounters are enabled., with 1 exception; the Winding Tunnels in Sector 4 (which I have given **** given its exceptionally high enc rate... in a manor of speaking). If I am to give this area a rating value, what would be an appropriate value for the area's enc rate? I can;t give it 1, because that could make this area seem as good as the Swamp Area. I'll have a play around with various values to find a figure that seems correct. You said that the highest encounter chance possible was 12 iirc? I'll try giving this area 10 and then see what happens

-double edit- I've also given the Midgar Marsh a training * rating. of exactly 1 * I beleive
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-16 21:36:24
Calculator updates and moved to Google Sheets:

https://docs.google.com/spreadsheets/d/1XwItLfJprN27O2ZBEktjrO8qu5vpuBW0SZlq4wLnCno/edit?usp=sharing
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-17 12:25:13
With a mastered Pre-emp at 85, this should be 0.66796875

You have the value 0.3359375, which is ( 1 - ((255 - PEMr) / 256) )

Reads other posts..... (255/3=85). This is why I'm getting confused. It's not ( 1 - ((255 - PEMr) / 256) ) at all, it's still ( 1 - (PEMr / 256) )

Except this is a check on if the special formations will be disregarded entirely. Without Pre-Emptive Materia, this is always 1/16 that their consideration will just be skipped (240 / 256 that they will be considered). With ANY PEMr greater than 16 this rate is doubled and the skip condition maxes out at ~2/3 ( ~1 / 3 that they will be considered).

Sorry, could you possibly clarify for me exactly when the PemR is doubled?
At the very beginning and no where else. This "trickles down" into the normal battle consideration by adding to their chances of occurring. eg. If special formations are skipped 2 / 3 of the time the normal battles will increase in frequency by ~2 / 3.

Also, you say that on the field maps a mastered pre-emp will halve the chance of all back & Pincer attacks. Just to clarify, we're talking [IF PEMr = 85 then (BA1, BA2 & PA ENCr / 2)]. This is all or nothing? Less than PEMr 85 and nothing happens?
I said nothing about that. For the record, mastered Pre-Emp and maxed PEMr are two different things. A mastered Pre-Emp materia only adds 48 to this number which is capped at 85, but if one is mastered the only thing I can tell that does anything is side attacks (where you are attacking from both sides) gets its chance doubled ( 20 / 64 instead of 10 / 64 ). This is still affected by the ( 1 - PEMr / 256 ) at the beginning, but it increases the chance that if the back attacks fails their chance that a side attack will occur.

If I am to give this area a rating value, what would be an appropriate value for the area's enc rate? I can;t give it 1, because that could make this area seem as good as the Swamp Area. I'll have a play around with various values to find a figure that seems correct. You said that the highest encounter chance possible was 12 iirc? I'll try giving this area 10 and then see what happens
If you're dead-set on rating each area, I would take all the averages and multiply all the results by [12 / encouter_rate] and then rank those values. You don't even have to present that number to the reader except you should mention that encounter_rate is taken into account during ranking. That will give you the best spread of which areas are actually better for grinding at.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-17 12:49:10
Quote
Except this is a check on if the special formations will be disregarded entirely. Without Pre-Emptive Materia, this is always 1/16 that their consideration will just be skipped (240 / 256 that they will be considered). With ANY PEMr greater than 16 this rate is doubled and the skip condition maxes out at ~2/3 ( ~1 / 3 that they will be considered).
Excellent. I can now start working the World Map formula this into my calculator, accounting for PEMr!!

Quote
I said nothing about that. For the record, mastered Pre-Emp and maxed PEMr are two different things. A mastered Pre-Emp materia only adds 48 to this number which is capped at 85, but if one is mastered the only thing I can tell that does anything is side attacks (where you are attacking from both sides) gets its chance doubled ( 20 / 64 instead of 10 / 64 ). This is still affected by the ( 1 - PEMr / 256 ) at the beginning, but it increases the chance that if the back attacks fails their chance that a side attack will occur.
Yes, when I said mastered, I actually meant maxed PEMr. I'll have to sit down with this one some more when I got to input it into the calc. It could start to get a little messy...
I'm still not entirely sure how and when Bck Atck and Pinc Attacks are affected (halved) by the PEMr on the Field Maps, is it when it is 85 only?

Quote
If you're dead-set on rating each area, I would take all the averages and multiply all the results by [12 / encouter_rate] and then rank those values. You don't even have to present that number to the reader except you should mention that encounter_rate is taken into account during ranking. That will give you the best spread of which areas are actually better for grinding at.
So, is what you're saying - (EXP Av * (12/Enc)) + (AP Av * (12/Enc)) + (GIL Av * (12/Enc))
-edit- ^^That would be for the World Map, field map would be:
(EXP Av * (24/Enc)) + (AP Av * (24/Enc)) + (GIL Av * (24/Enc))
Title: Re: Helpful Charts by DynamixDJ
Post by: nfitc1 on 2016-04-19 21:06:55
Fun Fact:
On the field, if the chosen normal battle formation is the same as the previous battle, the normal formation selection occurs once more. This sort of decreases the chance of the same battle twice in a row.

Code: [Select]
encounterValue = NextRandEncLUT() >> 2;
chosenFieldFormation = normalFieldFormation(5).formID; //fallback formation. Slot 6 will always be selected if 1-5 fail.
for ( x = 0; x < 5; ++x )
{
   formationEncounterValue += normalFieldFormation(x).encounter;
   if ( encounterValue < formationEncounterValue )
   {
      chosenFieldFormation = normalFieldFormation(x).formID;
      break;
   }
}
if ( chosenFieldFormation == previousFieldFormation )
{
   encounterValue = NextRandEncLUT() >> 2;
   chosenFieldFormation = normalFieldFormation(5).formID; //fallback formation. Slot 6 will always be selected if 1-5 fail.
   for ( x = 0; x < 5; ++x )
   {
      formationEncounterValue += normalFieldFormation(x).encounter
      if ( encounterValue < formationEncounterValue )
      {
         chosenFieldFormation = normalFieldFormation(x).formID;
         previousFieldFormation = chosenFieldFormation;
      }
   }
}
else
{
   previousFieldFormation = chosenFieldFormation;
}

There's no way or reason to work this into your averages, I just thought it was interesting enough to share. :)
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-20 01:50:46
You're right, that is very interesting to know.

I've taken the calculator off of Google Drive now, firstly because it wasn't really working properly; the cell functions weren't really C+P'ing correctly, and secondly because this thing is becoming quite spectacular, and the calculator function is now just a feature!

What this calculator can/will be able to do:

And a few other exciting ideas I have for it.

One thing though, the "training value" formula that I use doesn't work. If any enc rate of 128 is doubled to 64, the rating is also doubled. I don't think that the enc rate should have that big of an impact on the overall rating; primarily exp ap and gil. I tried to work it so that increasing the enc rate from 128 to 64 only made the rating value increase by 125%, but I couldn't work it out properly.....  ???
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-21 00:23:39
OK then, it's taken me a helluva a long time to work this formula out, and I'm so chuffed that it worked that I just had to share it. Here is a screenshot of my "Formation" database:

(http://i1308.photobucket.com/albums/s615/DynamixDJ/Formula_zpsyjngevxs.png)

The problem:

I'm lazy and don't want to type in the enemy's names against the "scene" in column N for every scene.

The solution:

To find a "sweeping formula" that searches every relevant cell to see whether or not it is empty, and then to see if it a name already assigned to that scene. I've finally done it!

=IF(NOT($G48=0),$G48,IF(NOT($D49=$N49),$D49,IF(NOT($G49=0),IF
(NOT($G49=$N49),$G49,IF(NOT($D50=$N49),$D50,IF(NOT($G50=0),IF
(NOT($G50=$N49),$G50,IF(NOT($D51=$N49),$D51,IF(NOT($G51=0),IF
(NOT($G51=$N49),$G51,$D$1052),$D$1052))),IF(NOT($D51=$N49),$D51,IF
(NOT($G51=0),IF(NOT($G51=$N49),$G51,$D$1052),$D$1052))))),IF
(NOT($D50=$N49),$D50,IF(NOT($G50=0),IF(NOT($G50=$N49),$G50,IF
(NOT($D51=$N49),$D51,IF(NOT($G51=0),IF(NOT($G51=$N49),$G51,$D$1052),$D$1052))),IF
(NOT($D51=$N49),$D51,IF(NOT($G51=0),IF(NOT($G51=$N490),$G151,$D$1052),$D$1052)))))))

And that's just for cell N50, I still need to work out a formula for the third enemy, and that formula will be twice as long as it also needs to sweep through the J column! At least I know this work! Here is how I worked it out:

N49 = D48. Enemy slot 1 equals the the name of the first enemy in the first formation in that scene.

D=Enemy 1
G=Enemy 2
J=Enemy 3
148~151 are the 4 rows in the formation (IDs 32~35)

Code: [Select]
1
=IF(NOT($G48=0),$G48,IF

2
(NOT($D49=$N49),$D49,IF

3
(NOT($G49=0),IF

3A
(NOT($G49=$N49),$G49,IF

3B
(NOT($D50=$N49),$D50,IF

3C
(NOT($G50=0),IF

3C1
(NOT($G50=$N49),$G50,IF

3C2
(NOT($D51=$N49),$D51,IF

3C3
(NOT($G51=0),IF

3C3A
(NOT($G51=$N49),$G51,"")

/3C3A, 3C3
,"")
/3C3, 3C2
)
/3C2, 3C1
)
/3C1, 3C
,IF

3D
(NOT($D51=$N49),$D51,IF

3E
 (NOT($G51=0),IF

3E1
(NOT($G51=$N49),$G51,"")

/3E1, 3E
,"")

/3E, 3D
)

/3D, 3C
)

/3C, 3B
)

/3B, 3A
)

/3A, 3
,IF

4
(NOT($D50=$N49),$D50,IF

5
(NOT($G50=0),IF

5A
(NOT($G50=$N49),$G50,IF

5B
(NOT($D51=$N49),$D51,IF

5C
(NOT($G51=0),IF

5CA
(NOT($G51=$N49),$G51,"")

/5CA, 5C
,"")

/5C, 5B
)

/5B, 5A
)

/5A, 5
,IF

6
(NOT($D51=$N49),$D51,IF

7
(NOT($G51=0),IF

7A
(NOT($G51=$N49,$G51,"")

/7A, 7
,"")
)))))))

And after all that, I tried this formula on the spread sheet software i use at home, Kingsoft, and the IF Nesting has exceeded its limit. Goddamn it!!

How the hell do I change this formula to fit in with Excels paramaters?

-Edit-
I've just uploaded the spreadsheet to Google Drive once more, C+P'd the formula in, and it worked. Then I downloaded the file, and..... it worked!!!!! go figure. "How to bypass the IF Nesting limitation"
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-21 04:20:17
OK, Here is the formula I've worked for the third enemy slot, but there is a mistake with it, and I'm too tired to try to work it out:

=IF(NOT($J48=0),$J48,IF(OR($D49=$N50,$D49=$N49),IF(NOT($G49=0),IF(OR($G49=$N50,$G49=$N49),
IF(NOT($J49=0),$J49,IF(OR($D50=$N50,$D50=$N49),IF(NOT($G50=0),IF(OR($G50=$N50,$G50=$N49),
IF(NOT($J50=0),$J50,IF(OR($D51=$N50,$D51=$N49),IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),
IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$G50),IF(OR($D51=$N50,$D51=$N49),
IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$D50)),$G49),
IF(OR($D50=$N50,$D50=$N49),IF(NOT($G50=0),IF(OR($G50=$N50,$G50=$N49),IF(NOT($J50=0),$J50,
IF(OR($D51=$N50,$D51=$N49),IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),
IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$G50),IF(OR($D51=$N50,$D51=$N49),
IF(NOT($G51=0),IF(OR($G51=$N50,$G51=$N49),IF(NOT($J51=0),$J51,$D$1052),$G51),$D$1052),$D51)),$D50)),$D49))


Code: [Select]
M51

1
=IF(NOT($J48=0),$J48,IF

2
(OR($D49=$N50,$D49=$N49),IF

3
(NOT($G49=0),IF

3A
(OR($G49=$N50,$G49=$N49),IF

3B
(NOT($J49=0),$J49,IF

3C
(OR($D50=$N50,$D50=$N49),IF

3D

(NOT($G50=0),IF

3D1

(OR($G50=$N50,$G50=$N49),IF

3D2

(NOT($J50=0),$J50,IF

3D3

(OR($D51=$N50,$G50=$N49),IF


3D4
(NOT($G51=0),IF

3D4A
(OR($G51=$N50,$G51=$N49),IF

3D4B
(NOT($J51=0),$J51,$D$1052)

/3D4B, 3D4A
,$G51)

/3D4A. 3D4
,$D$1052)

/3D4, 3D3
,$D51)

/3D3, 3D2
)

/3D2, 3D1
,$G50)

/3D1, 3D
,IF

3E
(OR($D51=$N50,$D51=$N49),IF

3F
(NOT($G51=0),IF

3F1
(OR($G51=$N50,$G51=$N49),IF

3F2
(NOT($J51=0),$J51,$D$1052)

/3F2, 3F1
,$G51)

/3F1, 3F
,$D$1052)

/3F, 3E
,$D51)

/3E, 3D
)

/3D, 3C
,$D50)

/3C, 3B
)

/3B, 3A
,$G49)

/3A, 3
,IF

4
(OR($D50=$N50,$D50=$N49),IF

5
(NOT($G50=0),IF

5A
(OR($G50=$N50,$G50=$N49),IF

5B
(NOT($J50=0),$J50,IF

5C
(OR($D51=$N50,$D51=$N49),IF

5D
(NOT($G51=0),IF

5D1
(OR($G51=$N50,$G51=$N49),IF

5D2
(NOT($J51=0),$J51,$D$1052)

/5D2, 5D1
,$G51)

/5D1, 5D
,$D$1052)

/5D, 5C
,$D51)

/5C, 5B
)

/5B, 5A
,$G50)

/5A, 5
,IF

6
(OR($D51=$N50,$D51=$N49),IF

7
(NOT($G51=0),IF

7A
(OR($G51=$N50,$G51=$N49),IF

7B
(NOT($J51=0),$J51,$D$1052)

/7B, 7A
,$G51)

/7A, 7
,$D$1052)

/7, 6
,$D51)

/6, 5
)

/5, 4
,$D50)

/4, 3
)

/3, 2
,$D49)

/2, 1
)

EDIT I'd made 1 mistake in the first formula, and 3 in the second. Both are fixed and are working fine now!!

Also, I don;t think I made it clear enough the purpose of these formulas. As I fill in the enemies names in the D G & J columns, I want the three enemies that are used within the scene to automatically be filled out in column N, without having to type the enemies names in manually. These formulas sweep each cell of names used within the four formations (columns D G & J) and fills out the 3 enemy slots in column N automatically
Title: Re: Helpful Charts by DynamixDJ
Post by: jmp434 on 2016-04-22 07:24:30
Hi, I have not quite understood the idea of the graphics you talking about? You are being calculated for a new engine for the game?
Title: Re: Helpful Charts by DynamixDJ
Post by: Kaldarasha on 2016-04-22 09:30:03
Don't deal with this. It is useful for moders, who needs to plan their difficulty mod or for those, who make a walkthrough for the game.
Title: Re: Helpful Charts by DynamixDJ
Post by: jmp434 on 2016-04-22 09:32:03
Oh ok, thanks you Kaldarasha :)
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-04-22 10:52:45
Yeah, the idea behind this topic is to make a series of useful charts and other documents that portray more information than can be found in the majority FAQs which have been designed for the gamer; these charts have been designed for the modders.

The above posts are in regards to a spreadsheet that I'm working on that is firstly a database of all enemies, formations, and field maps those formations appear on; and secondly it is a calculator that works out the average EXP, AP, GIL etc for each area. This tool will be particularly useful to anyone who is planning on making a mod; their entire enemy database can be drafted out first.
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2016-06-12 14:45:10
I have updated my Enemy Formation Charts to V1.1:

 - I've given it a Complete and thorough once-over for errors.
 - Average Exp, AP and Gil has been included in the "ENCOUNTERS BY FIELD ID" section.

I'm still working on the calculator that myself and NFITC1 discussed a while back. It's turned into a massive database that can do a whole heap of things. It can already calculate Damage Overflow, and can pull an entire area's worth of enemies + stats simply by inputting the field map ID. I'm currently filling in the enemies Attack Data (nearly 1000 entries, ugh); my plan is to create a bestiary that is as thorough as it can possibly be. If anyone would like to test the work I've already done then PM me and I'll send you the current version.

Anyway, the original purpose of the calculator is finished, which was to calculate the true averages for each screen. here is the absolute best of every area:

http://www.gamefaqs.com/boards/197341-final-fantasy-vii/73867194

-Edit- V1.1.1 Uploaded, which includes the average Qty pf enemies for each area
Title: Re: Helpful Charts by DynamixDJ
Post by: DynamixDJ on 2019-02-21 22:37:37
Fwiw, I've been steadily working on and off this thing for the last three years, and now my Enemy Database & Calculator is finally complete:

http://forums.qhimm.com/index.php?topic=18624.0