Jump to content

ruadath

Member
  • Posts

    1,855
  • Joined

  • Last visited

Posts posted by ruadath

  1. Nice job with the clear. Are you sure the Hammer won't be useful to you later on? I guess you can make do with other forged weapons or something

    12 hours ago, disjunct.ion said:

    THANKS INHERENT AI RANDOMNESS

    What's really annoying about this (in both Awakening and Fates), is that the enemy AI decisions are based off a separate frame dependent RNG rather than the regular RNG sequence so this behavior isn't even consistent when using Battle Saves or Suspend.

  2. Well, they're both already available here

    and here

    But yeah I can now provide verification seeds with ease (if anyone actually cares about that). It also makes future RNG abuse even easier, so maybe I'll get back to that playthrough... (after wrapping up some current things, hopefully)

  3. It works the same for both FE9 and FE10, and in fact it's almost the same as the GBA RNG. A more detailed post may follow later (if I'm not too lazy), but here is the the tl;dr

    • Calculation of the next RN is exactly the same as for GBA (bitshift+xors of the last 3 rns)
    • There are a total of 8 possible initial seeds from power on
    • The game then burns some "small number" (0~20 roughly) of RNs from this initial seed on the first frame

    The cool thing here (in my opinion) is that the number of possible initial states from power on in only ~100 or so, which gives us a notion of reliability (in the same sense as for GBA arrow retracing) for both of these games.

    This also means that TAS for both of these games are now possible, and the regular speedrun can probably be improved too via clock abuse manipulations (this latter claim is untested).

  4. 
    

    function nextrng(r1,r4)

    return AND(XOR(r4,SHIFT(r4,19),r1,SHIFT(r1,-11),SHIFT(r1,8),SHIFT(r1,-3)%16777216),0xFFFFFFFF)

    end

    function rngsim(n)

    local rngbase=0x021BC09C

    local result = { memory.readdword(rngbase), memory.readdword(rngbase+4), memory.readdword(rngbase+8), memory.readdword(rngbase+12) }

    for i = 5, n do

    result = nextrng(result[i-4],result[i-1])

    end

    return result

    end

    while true do

    local nsim = 47

    rngs = rngsim(503)

    for i = 1, nsim do

    gui.text(236, 8*(i-1)-190, string.format("%3d", (rngs%2147483648)%100))

    end

    gui.text(210,-190,"RNG1:")

    gui.text(210,-182,"RNG2:")

    gui.text(210,-174,"RNG3:")

    gui.text(210,-166,"RNG4:")

    gui.text(186,-158,"Next RNs:")

    emu.frameadvance()

    end

  5. Almost. I have the pRNG, need to get the valuations like I did with SD. It's a little bit trickier this time because the modulus appears to be a function of the framecount, but hopefully it won't be too bad.

    EDIT: Also the initial seed is harder

    UPDATE: Never mind, only the level up works weirdly, the valuation works nearly identically to last time. lua script should be available soon.

  6. Lua script is now available

    function nextrng(r1)
            local seed = {0x18EE6547,0x8C7732AF, 0x463B9957, 0xA31DCCA7}
            return AND(XOR(r1, SHIFT(r1, -3), SHIFT(r1, -4), SHIFT(r1, 3), SHIFT(r1, 4), seed[r1%4+1]),0xFFFFFFFF)
    end
     
    function rngsim(n)
            local rngbase=0x02196E08
            local result = { memory.readword(rngbase)+memory.readword(rngbase+2)*65536 }
            for i = 2, n do
                    result[i] = nextrng(result[i-1])
            end
            return result
    end
     
    while true do
            local nsim = 47
            rngs = rngsim(503)
            for i = 1, nsim do
                    gui.text(236, 8*(i-1)-190, string.format("%3d", (rngs[i]%2147483648)%100))
            end
            gui.text(160,-190,"Previous RN:")
            emu.frameadvance()
     
        end
    
    

    EDIT: Clock function is monic and linear in seconds, which means any initial seed is possible. This means for TAS/LTC planning purposes, it suffices to hack the initial RNG state to whatever you want since it is always possible (and very easy) to calculate a clock time that will generate the desired seed.

  7. Sorry, I've been a bit busy with family stuff yesterday and today, but I'll get a spreadsheet up soon. I actually realized there was an error (an off by one error in mapping 32 bit strings and 0-99 numbers) in my data collection process, so hopefully when I get around to regenerating stuff later today/tomorrow it will be easier to figure out the pattern.

  8. It's not an issue of not being to generate the data (and in particular, I'm not trying to figure out the clock seeds yet). Right now the issue is that I have a bunch of data in a spreadsheet that looks like

    HEX RN

    ABB6 BA1A 0

    923D 5A37 2

    But I'm unable to figure out a general pattern from these examples. I tried doing this bit by bit (figuring out values for 0000 0001, then 0000 0002, then 0000 0004, etc.), but this approach doesn't seem to be working because the function isn't linear (or at least, this isn't apparent). Once I figure this out, I'll be able to get a lua script ready easily, since I already figured out how the game moves form 1 hex string to the next.

  9. Hey guys,

    I revisited this game recently in an attempt to crack the RNG formula and found it somewhat easier than expected. In particular, I already managed to crack the PRNG, so that I can calculate all of the random numbers in advance.

    My only issue is... interpretation... while my script readily obtains the 32 bit hexadecimal numbers produced by the game's RNG, I haven't been able to figure out how the game converts these values to a random number between 0 and 99 (it's not as simple as division like it was in the GBA games). I can do stuff in game to get the associated random number for any string, but I'm looking for a mathematical formula so I can get a lua script ready and post it to the website. If anyone has some experience with figuring out this kind of stuff, I'd appreciate some help.

    For anyone interested in helping, I can grab data relatively quickly by modifying Lena's in game HP growth rate and giving her a first level up to figure out what the value is. Hopefully we can wrap this up fairly quickly and get this up and running!

  10. FWIW I have recently done some rerouting of Lyn Mode with the new strats (including the Erk crit kill chapter 5 hype) through chapter 6, but before I post anything I need to figure out if I can still get Chapter 7 done in 3 turns without Javelins (otherwise the turn save doesn't matter). Actually, I was confused, I 6-turn Chapter 7, but I still need to reroute without the Javelin.

    Videos may be up soon, but I want to figure out some optimization stuff before I post (e.g. I can EXP starve Florina even more than normal, but I'm not sure I want to).

  11. As it turns out, Finn's position at the end of turn 1 affects the RNs that enemies burn, so by positioning him slightly further away, it is possible to gain significantly better levels for Leif, which would obviously be helpful/useful. The reason this came up again is that in a recent discussion it was brought up that the Thracia 776 TAS can probably be improved by implementing this strategy into the playthrough.

    This clear completes the chapter (which I define as skipping the option to save the game) in 2 minutes and 26 seconds, roughly 46 seconds faster than the full game TAS on nico nico. If not having Dagdar ends up being a problem, I can wait on turn 2 without doing anything and recruit his entire company for the cost of about 14 seconds without messing anything up.

    Again, there are no real plans to pursue this any further seriously at the moment (especially given general business in RL). I do have a TAS input file available though, so if anyone wants to work on this, let me know and I'll send you a PM.

  12. A note here; it was pointed out to me that if Kaze gets a HP Tonic and Def Tonic, and I have Sakura heal him the second time, then he can survive the last EP in Attack Stance without dodging anything. This means that it will always be possible to finish the chapter without crits or Kaze dodging anything (at the expense of some EXP to Rinkah, but not much, and she gets more WEXP in return)

×
×
  • Create New...