RNG Research
4 years ago

Edited cause I got the encounter mechanic wrong. More units moving give better odds, not equal. Plus math was spotty.

Neutral encounter mechanics are here. Explains why I encountered twice as many Ghosts as Skeletons in Pogrom Forest with my test data - Ghosts have lower LUK.

Every 10 game minutes for an encounter check is 40 frames on fastest speed 3 = 0.67 seconds. There is first a 1-10 roll for which unit is checked to be moving and if so, rolled for an encounter. A full 10 units deployed and moving is 10x the encounters, if all are within the same LUK range.

We have some downtime on Sharom Border while units deploy so can take laps hunting Hawk Man. Conveniently tied for lowest LUK in the game at 42, giving a 10% encounter rate if #1 is rolled for Opinion Leader, or 15% if #2 is rolled with Witch as leader.

For just our Opinion Leader's unit moving, odds of neutral encounter within 240 frames = 4.0 seconds spent on ocean tile for 6 checks are 1 - (1 - 1/10×0.1)^6 = 5.85% with no manip. Witch also moving on Ocean, or Forest for Golem, and edited with enough kill power, is 8.70%. Odds of either are 1 - odds of neither = 14.01%. I don't like further 1 in 10 odds of item drop...then odds of useful item, but I thought of a backup strat:

  1. After killing Hawk Man, Opinion Leader becomes level 2 after the Usar fight. This otherwise requires a Wizard kill on English SNES, PSX and Saturn releases and that takes a Tarot card and Tactics shenanigans. The level up normally doesn't matter since you don't get another level up at Sirius and get a guaranteed one at Debonair. Same level after Debonair.
  2. The trick is you instead fight Kapella, who is 6 levels higher than level 2 Opinion Leader, versus 5 with Sirius, for another guaranteed level up. Now you're 1 level ahead the whole game. Is a riskier fight but potentially faster with this Tarot strat for Ianuki Lord:
  3. Warren's hitrate on Kapella is 60%. Generic Wizard hitrate rises from 40% to 50% with guaranteed Mystic Mace equipped. If 60% Ianuki/Sonic Blade also hits, it's a 1 round kill. I calculated a 34% chance to no Tarot kill without Mystic Mace and 44% chance with. Going Forest over Lake delays Sunshine until Antalia and Zeteginea shops but Moonbeam from Dalmuhd Desert shop can work as one due the long stages.
编辑者 作者 1 year ago
Krayzar 喜欢这个

I'm testing the damage formula before making a calculator for it. Easy to load a save and advance the RNG with Joker, or use a Strength Potion or Promotion on a non-combatant, or Recruit at Town, or use a Dowsing Rod to pull a buried treasure.

I recorded the damage from the same battle with 0 to 20 Jokers used right before it started and each result was unique. I then testing combinations of RNG advancement to duplicate a battle outcome:

  • 1 Joker = 1 Strength Potion
  • 2 Jokers = 1 Dowsing Rod = 2 Strength Potion
  • 3 Jokers = 1 Promotion = 2 Dowsing Rods = 2 Strength Potions + 1 Dowsing Rod
  • 4 Jokers = 1 Recruit at Town
  • 5 Jokers = 1 Dowsing Rod + 1 Promotion = 3 Dowsing Rods
  • 7 Jokers = 2 Promotions = 4 Dowsing Rods
  • 8 Jokers = 2 Recruits at Town

Doing 1 Recruit + 1 Dowsing Rod, 1 Recruit + 1 Promotion, 3 Promotions, 3 Recruits, 3 Strength Potions all had unique results. Would be nice if each method advanced the RNG a consistent amount but we can't have nice things.

The one consistent observation was the order of operations doesn't change the battle. Same outcome with RNG mechanics in any order, even though the buried treasure is different depending on when Dowsing Rod is used before or after Promotion or Strength Potion or what have you.

Krayzar 喜欢这个

I've been making gradual progress in RNG research. One way of maniping a Dream Crown or Trade Ticket is on Galf's stage that 100% and Devil paths play. There's a 4 Phantom + Sorcerer unit that the Sun card leaves the Sorcerer weak enough that my level 5 Canopus finishes off with Thunder and moves next. Then there's the 4 Wraith + Lich unit that, uniquely, is completely wiped out by Sun.

Obviously, this strategy dodges the half of the problem of maniping a neutral encounter. I recorded a Sharom Border test run on Saturn where I did pull a neutral Hawk Man. No item but the EXP gets the Opinion Leader a level up at Usar. Can see how slow this approach is:

Meanwhile, on Galf's stage, a level 16 Opinion Leader would level up from either Sun kill or get to 18 from both. This makes the approach low investment and you can deploy another unit to do it. Quite a bit more enemy units to work with using Sun + Death combo or defeating a 2nd or 3rd stage unit with Death, but either approach loses more time.

Of the 32 item pool, I wonder if Crystal Ball last in the list isn't obtainable in SNES, similar to how Nue's Shield isn't. 1 in 31 for the first 8 items, which includes Dream Crown and Undead Staff, I'll take it. I hacked in 200 Summoning Chimes to generate neutral encounters to get "the feel" of what I'm dealing with. The shortest amount of encounters between items was 2 and the longest 28. The theoretical 1 in 10 odds seem correct.

If there are 2 desirable items for 1 in ~16 odds, 1 in 160 odds is reasonable to manip. Summoning Charm sells for 25k goth or can sub as a Fool card with chance of failure. Blood Kiss sells for 31k, a Promotion is decent since it gives the full stat range on level up and AGI Potion on Debonair/Tristan has a 5-10 point spread. Kind of like raising accuracy 5%. Maybe 1 in 80 of a good outcome.

I tested Tarot cards for one Skeleton encounter I got an item on. Damage ones besides Judgment didn't change anything, proving the game checks if damage is possible and doesn't waste calling the RNG. I saw before Tower doesn't either if every target is Low/High Sky. Sun didn't change the item, implying item is rolled for once the unit is defeated. Judgment prevented obtaining any item, as did using a Joker. Not surprising but does mean we can advance the RNG, probably making any consistent starting frame from reset viable.

PlayStation would be perfect since the 5 class icons seem to uniquely determine what frame you loaded on but its RNG advances even on the item and battle menus and the time spent on text boxes.

Speaking of neutral encounters, I found the mechanics in my Sega Saturn official strategy guide. Plus other mechanics but all have been seen on Japanese websites. Main point is there was much less reverse engineering done in Ogre Battle than I thought. We're still in the Wild West.

Sheex, Krayzar, Spockrocket 喜欢这个

I appreciate the likes. Was motivational to make more progress. Prepare yourself for bathroom reading.

The ancient tasvideos thread continues today. I linked the 100% World TAS on SFC I found on YouTube, investigated the 2x Tarot card in a row glitch that Dragondarch was the first to notice, added some frame data and spelled out an improved Deneb recruitment process to only revisit Diaspola once and save ~16 seconds. That Discord idea still sounds good.

ADDRESSES FOR TAROT DRAWS AND NO DUPLICATE INTERPRETATION

I wanted to research Tarot card draws from Liberation and Joker-ing on English SNES. Turns out the draw mechanic is interchangeable. Whichever card you draw last from Liberation or Joker can't be drawn next by either process. The bonus card you pull on a new game does not count as a draw. As in, you can liberate Lans' city and draw it.

The card you will draw from Liberation-Joker is stored at 0x7E03A8, which was realized in ancient times given the Game Genie codes. Setting to 0x00 is Magician, 0x0C is Death and 0x15 is World. Can draw as many you want in a row.

What I realized is the last card you draw is stored at 0x7E1783. If you set that to 0x00, you will never draw Magician. However, if you enable 7E03A8=00, the restriction is overridden and you will draw only Magicians.

My interpretation is on Liberation-Joker, the game RNG cycles, comes with a new card and checks the last card. If they do not match then the new card is drawn and updated at both addresses. If they do match then the RNG cycles again and maybe uses a different number of bits.

I compared lists of Joker pulls with and without 0x7E1783=16 to allow all cards to be duplicated and got 2x Hermit and 2x Justice in a row across the first 128 pulls. The duplicate Justice changed the next few cards but got back on track with the "control sample" of 128 draws with no cheat code that generated no duplicates.

Speedrun Forum popup said my post was too long so cutting off here.

Spockrocket Krayzar 喜欢这个

Part 2

TAROT CARD REDRAW MECHANIC

Then there's site I call Fireseal63 (RIP) Krayzar linked on page 1 that was the only place for original mechanics knowledge. The info wasn't always copied / plagiarized correctly in GameFAQs guides and not verified in general, never mind all releases:

https://web.archive.org/web/20190316232151/http://space.geocities.jp/fireseal63/ogrebattle.html

There are at least 2 differences on PSX but what's relevant here is the redraw mechanic that is kind of hard to interpret. Through testing I realized "redraw" means if the game pulls one of those cards, it has a chance to not keep the card and cycle through the RNG again and keep whatever comes up on the 2nd cycle. DeepL translation:

Tarot Draw

The tarot card drawn will not be the same as the previously drawn tarot card both when liberating cities and churches and when using the “Joker's Fuda”.

The tarot card drawn at the time of liberation is not completely random, but may be redrawn only once, depending on the tarot card drawn and the LUK of the leader of the liberated unit.

It will be redrawn when LUK is 51 or higher

Hangman Death Temperance Devil Tower

It will be redrawn when LUK is 49 or lower

Magician Priestess Empress Emperor Hierophant Lovers Chariot Strength Hermit Justice Star Judgement World

It will be redrawn Probability = (absolute value of LUK-50) / 50

Tarot cards drawn when using “Joker's Tag” are not originally intended to be redrawn, but due to a bug, the redraw decision is made and the available tarot cards are biased.

--------

In theory, redraw is 0% at 50 LUK and 100% at 0 or 100 LUK.

With Liberation and Joker pulls confirmed equivalent by my testing, I recorded 128 Joker pulls with 0, 50 and 100 LUK on the Opinion Leader on English SNES and all pulls were identical.

I extended from 128 on 50 LUK and record 300 pulls. Sadly no looping back through the order at #257, meaning at least 9 bits of entropy are used. With 300 pulls, we'd expect ~13.6 drawn of each card. With perfect RNG for the sake of argument, standard deviation with Normal approximation is sqrt[(300)(1/22)(1 - 1/22)] = 3.6 and 3.7 with Poisson. I don't think we need to form a confidence when you look at the results:

  1. Magician: 18
  2. Priestess: 19
  3. Empress: 21
  4. Emperor: 17
  5. Hierophant: 14
  6. Lovers: 21
  7. Chariot: 17
  8. Strength: 18
  9. Hermit: 18
  10. Fortune: 19
  11. Justice: 13
  12. Hanged Man: 6
  13. Death: 4
  14. Temperance: 5
  15. Devil: 3
  16. Tower: 5
  17. Star: 12
  18. Moon: 11
  19. Sun: 12
  20. Judgment: 17
  21. Fool: 19
  22. World: 10

It would seem the redraw mechanic is bugged at a minimum in English SNES. My interpretation: You always draw as if you had 87 (87.5) LUK. The 5 "bad" cards are 3.5x less likely to be drawn than normal. Given chance of pulling on the redraw, keeping the bad card is 0.25 + 0.75 x (1/21) = 2/7 (~28.5%), equivalent to 3.5x less when we invert. 1 in X trials of a probability is (1 / probability).

Someone really did look at decompiled assembly code and discover the "good" and "bad" cards lists but maybe didn't step through the entire subroutine in debug mode to confirm the | LUK - 50 | / 50 step happens. Division in Ogre Battle is also inexact.

I always perceived the WR full game runs to have very good Tarot luck and while that's basically a necessity, I think I'm showing such luck isn't quite rare as it seems. If you want Devil for Debonair or Mizal, you should start with it.

What we really need are Lua scripts to draw a few thousand cards for every release and narrow down the period of the RNG for SNES/SFC and Saturn.

One thing I remembered, the Finnshore website (RIP) had a ROM hacking map that listed address 0x32958 for "drawn tarot events". Too bad 2 skillful hackers didn't go all the way and give the RNG algorithm for cards and buried treasures. I know enough SNES assembly to attempt it but results not guaranteed.

Dragondarch, Sheex 2 其他 喜欢这个