1 2 3
10 11
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
Wow, never thought this thread would be dug up. This has been on my mind since my last post on this thread. I would love the chance to do a run of this but I could never figure out the luck manipulation.
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Joined: 3/16/2006
Posts: 289
That's because this falls under the "hardly manipulatable" category. Much like Shining Force. I was attempting to do that, but it turned out that for every battle there's only like 2 possible outcomes that I could ever find. This game does the same thing, except even worse!
I am just a silhouette, a silhouette of a memory of a solitary night .. nothing more.
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
Heh yeah, that's what I saw. I was able to manipulate the stat increases you get when you level though. That was about it.
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Joined: 3/16/2006
Posts: 289
Hmmm...that might not be such a bad thing. If you figure out how what stats do what, then you could force the stats you need the most. It sure would make fighting a little bit easier.
I am just a silhouette, a silhouette of a memory of a solitary night .. nothing more.
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
True, but I'd still need to fight to get levels so I can get the stat increases. While I can manipulate fights to have multiple enemies and max exp, it would still take a while if I couldn't manipulate the fights themselves.
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Joined: 10/3/2005
Posts: 1332
Wouldn't you do all your levelling on the overworld, where you have a bit of control over the randomness? IIRC, that's where all the brains are. Tasty, tasty brains.
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
Yeah that's probably what I would do. By manipulating the fights so I get the monsters I want I could easily fight S. Brains every time. How do I use the memory RNG values Nitrodon found to manipulate the fights?
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Joined: 10/3/2005
Posts: 1332
How do I use the memory RNG values Nitrodon found to manipulate the fights?
That, I've been meaning to figure out. Nitrodon might already know, but if not, it's probably a simple matter of setting watches on the addresses he listed earlier, and learning from observation.
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
Yeah, that's what I figured. Question is, how do I do that? I've never done luck manipulation like this before, I could never figure it out. Which version of SNES9X should I use for this? Should I use the most recent one or wait for the 1.51 release?
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Active player (287)
Joined: 3/4/2006
Posts: 341
The RNG routine multiplies the 2-byte value in the addresses I mentioned by 0x0383, then stores the result in the same addresses and returns the new high byte (7e006e). High RNG values cause hits, more damage, and other things. Information about battle algorithms can be found in Nati's character FAQ on GameFAQs. I have personally confirmed all of those algorithms with the game's ASM code with the exception of hit rate (which is a close approximation, but understandably the author doesn't know that there are only 11 different values for hit rate).
Joined: 3/16/2006
Posts: 289
*wow* It's just incredible that you can do that Nitrodon! Are you a 1337 Ninja coder or something? Anyways, this is how I understood what you said: Manipulting the fights while fighting will be next to impossilbe, but manipulating fights that you want that go generally how you want them to won't be too much trouble.
I am just a silhouette, a silhouette of a memory of a solitary night .. nothing more.
Active player (287)
Joined: 3/4/2006
Posts: 341
Shadow Byrn wrote:
*wow* It's just incredible that you can do that Nitrodon! Are you a 1337 Ninja coder or something? Anyways, this is how I understood what you said: Manipulting the fights while fighting will be next to impossilbe, but manipulating fights that you want that go generally how you want them to won't be too much trouble.
I'm not a 1337 Ninja coder or anything like that. All it took to determine those was patience, programming knowledge, a 65816 instruction list, and a debugging emulator. Luck manipulation after you are already in a battle is slow on the overworld and impossible in dungeons. However, manipulating the first 2-3 rounds of battle is relatively easy by starting the battle or conversation at a different frame. Apprentice battles would depend on the frame you exit a monster-infested area instead of the frame you start the conversation.
Former player
Joined: 7/2/2005
Posts: 309
Location: Baltimore, MD
Ah, ok. I read through Nati's character FAQ on GameFAQs and have an idea of the formulas now. I'm going to re-read the luck manipulation FAQ on this site to refresh myself on how to do it, then I'll take a shot at a practice run up to the first dungeon and see how that goes. Hopefully it works out.
Guybrush: "I'm selling these fine leather jackets." Wally: "Really?" Guybrush: "No. I 'm lying." Wally: "In that case, I don't want one!" Currently working on: Nothing at the moment.
Joined: 10/3/2005
Posts: 1332
Had some fun this afternoon. I got all the way to Melenam using Lux and Esuna, playing at 85% most of the time. It turned out quite a bit better than I had expected. Lux doesn't need equipment, and he hits harder than the alien, so I managed to kill Romus at level 3. In retrospect, I should have bought two b power at the start, manipulated a bunch of potions (as I did after killing Romus, just to see if I could) and then bought one or two b prtct before taking on Romus. None of the apprenti wanted to fight me, not that I think fighting an apprentice would be a good use of time, so I ended up using my last b power on a Trick to get a sapphire. ...I probably should have joined with the Demon. He learns vacuum earlier than Esuna, IIRC, and I can use that to kill brains/everything. Then again, vacuum is expensive; Valsu's buffing spells are cheap, and can be used against bosses. Anyway, it's probably possible to get to Melenam in 20 minutes using a more efficient strategy, (sans backtracking) and with better fight evasion and manipulation, especially on the overworld... If I learned anything from doing this, it's that regular battles aren't worth diddly-squat compared to bosses. Movie.
Joined: 4/19/2006
Posts: 3
Location: United Kingdom of Great Boredom
That was highly entertaining to watch, and I'd love to see you finish the game off like this. I'm bringing this thread back to the first page in the hope it could generate some more interest, and possibly some attention from Dromiceius or anyone else who wants to have a go. This is a fantastic game, and a finished run would be entertaining for the same reason as the Earthbound run currently published - it doesn't skip any of the plot.
Joined: 10/3/2005
Posts: 1332
Plot? ....Oh, right. That thing about the Crystals 'n whatnot. ;) I thought I'd take this opportunity to point out that I did make an attempt to improve the little test in my post above. Had a better strategy: I grab the mirror in one of the bedrooms in Lemele's castle, along with an opal (or something) hidden in the upper-right corner of the same town. Selling both of those items nets 200 g, which need to be spent on B-Power, because you can't get any more until after the second Pison, and I couldn't get any farther without. ...I think. I'm pretty sure that's how it went. Anyway, my attempt was stymied by luck manipulation. I never figured out exactly how the RNG works, and what numbers I should be looking for when attacking... though it's a huge problem in any case, as waiting a full second for the RNG to advance is really painful when you've gone to the trouble of being frame-perfect. It's not like it's that difficult to kill monsters, but killing them AND making them drop potions is a major pain in the ass when using trial-and-error. But it is doable.
Active player (287)
Joined: 3/4/2006
Posts: 341
According to my disassembly, the RNG state is at 7E006C (low byte) and 7E006E (high byte), and the algorithm consists of multiplying that number by 0x0383 and returning the high byte. The routine is at C2/95F2 if you wanted to look, assuming you were successful in learning assembly language. The only reason the RNG advances every couple seconds in overworld battles is because of the waves rolling onto the shore.
Joined: 10/3/2005
Posts: 1332
I actually did that, and I managed to observe that the RNG does work as you say, but when it came to actually predicting when to attack via the game's damage formula, I couldn't make any sense of it. So, with reference material in hand, I tried stepping through the code to see and understand for myself what the damage formula looks like in ASM... it looks like I was going to trace backward from C4/4EDA (where the game writes the enemy HP value, minus damage) until things made more sense, but got distracted. Care to spell it out for a noob, Nitrodon? :)
Active player (287)
Joined: 3/4/2006
Posts: 341
The routine that deals damage to an enemy is at C4/4ECA-C4/4F43. At C4/4EFF, it calls C2/79D3 to determine the amount of damage dealt. Excuse any vagueness or omissions in my comments; This game was the first game I did much hacking on, and thus I was inexperienced with ROM hacking when I did this.
C2/79D3: 22 AF 72 C2  JSR $C272AF   (get player data)
C2/79D7: C2 20        REP #$20
C2/79D9: A0 0C 00     LDY #$000C
C2/79DC: B7 56        LDA [$56],Y   (power)
C2/79DE: 85 40        STA $40
C2/79E0: A0 1E 00     LDY #$001E
C2/79E3: B7 56        LDA [$56],Y   (status)
C2/79E5: 89 20 00     BIT #$0020    (if power up)
C2/79E8: F0 02        BEQ $79EC
C2/79EA: 06 40        ASL $40
C2/79EC: A0 12 00     LDY #$0012
C2/79EF: B7 56        LDA [$56],Y   (equipped weapon)
C2/79F1: 29 FF 00     AND #$00FF
C2/79F4: 85 42        STA $42
C2/79F6: 0A           ASL
C2/79F7: 18           CLC
C2/79F8: 65 42        ADC $42
C2/79FA: A8           TAY
C2/79FB: C2 20        REP #$20
C2/79FD: A9 3A 4F     LDA #$4F3A
C2/7A00: 85 50        STA $50
C2/7A02: E2 20        SEP #$20
C2/7A04: A9 C0        LDA #$C0
C2/7A06: 85 52        STA $52
C2/7A08: C2 20        REP #$20
C2/7A0A: B7 50        LDA [$50],Y   (weapon data pointer)
C2/7A0C: 85 53        STA $53
C2/7A0E: C8           INY
C2/7A0F: C8           INY
C2/7A10: E2 20        SEP #$20
C2/7A12: B7 50        LDA [$50],Y
C2/7A14: 85 55        STA $55
C2/7A16: C2 20        REP #$20
C2/7A18: A7 53        LDA [$53]     (weapon power)
C2/7A1A: 18           CLC
C2/7A1B: 65 40        ADC $40
C2/7A1D: 85 40        STA $40
C2/7A1F: A0 1E 00     LDY #$001E
C2/7A22: B7 56        LDA [$56],Y
C2/7A24: 89 00 08     BIT #$0800    (if defend)
C2/7A27: F0 08        BEQ $7A31
C2/7A29: A5 40        LDA $40
C2/7A2B: 4A           LSR
C2/7A2C: 18           CLC
C2/7A2D: 65 40        ADC $40
C2/7A2F: 85 40        STA $40       (x1.5)
C2/7A31: 22 D3 72 C2  JSR $C272D3   (get enemy data)
C2/7A35: C2 20        REP #$20
C2/7A37: A0 1C 00     LDY #$001C
C2/7A3A: B7 59        LDA [$59],Y
C2/7A3C: 4A           LSR
C2/7A3D: 85 42        STA $42       (defense/2)
C2/7A3F: A0 1E 00     LDY #$001E
C2/7A42: B7 59        LDA [$59],Y
C2/7A44: 89 08 00     BIT #$0008    (if defense down)
C2/7A47: F0 02        BEQ $7A4B
C2/7A49: 46 42        LSR $42
C2/7A4B: A0 14 00     LDY #$0014
C2/7A4E: B7 59        LDA [$59],Y   (enemy armor)
C2/7A50: 29 FF 00     AND #$00FF
C2/7A53: F0 66        BEQ $7ABB     (branch if no armor, i.e. not an apprentice)
C2/7A55: 85 44        STA $44
C2/7A57: 0A           ASL 
C2/7A58: 18           CLC 
C2/7A59: 65 44        ADC $44
C2/7A5B: A8           TAY 
C2/7A5C: C2 20        REP #$20
C2/7A5E: A9 3A 4F     LDA #$4F3A
C2/7A61: 85 50        STA $50
C2/7A63: E2 20        SEP #$20
C2/7A65: A9 C0        LDA #$C0
C2/7A67: 85 52        STA $52
C2/7A69: C2 20        REP #$20
C2/7A6B: B7 50        LDA [$50],Y   (armor data pointer)
C2/7A6D: 85 53        STA $53
C2/7A6F: C8           INY
C2/7A70: C8           INY
C2/7A71: E2 20        SEP #$20
C2/7A73: B7 50        LDA [$50],Y
C2/7A75: 85 55        STA $55
C2/7A77: C2 20        REP #$20
C2/7A79: A7 53        LDA [$53]     (armor defense stat)
C2/7A7B: 29 FF 00     AND #$00FF
C2/7A7E: 18           CLC
C2/7A7F: 65 42        ADC $42
C2/7A81: 85 42        STA $42
C2/7A83: A0 13 00     LDY #$0013
C2/7A86: B7 59        LDA [$59],Y   (accessory)
C2/7A88: 29 FF 00     AND #$00FF
C2/7A8B: F0 2E        BEQ $7ABB     (branch if no accessory)
C2/7A8D: 85 44        STA $44
C2/7A8F: 0A           ASL
C2/7A90: 18           CLC
C2/7A91: 65 44        ADC $44
C2/7A93: A8           TAY
C2/7A94: C2 20        REP #$20
C2/7A96: A9 3A 4F     LDA #$4F3A
C2/7A99: 85 50        STA $50
C2/7A9B: E2 20        SEP #$20
C2/7A9D: A9 C0        LDA #$C0
C2/7A9F: 85 52        STA $52
C2/7AA1: C2 20        REP #$20
C2/7AA3: B7 50        LDA [$50],Y   (accessory data pointer)
C2/7AA5: 85 53        STA $53
C2/7AA7: C8           INY
C2/7AA8: C8           INY
C2/7AA9: E2 20        SEP #$20
C2/7AAB: B7 50        LDA [$50],Y
C2/7AAD: 85 55        STA $55
C2/7AAF: C2 20        REP #$20
C2/7AB1: A7 53        LDA [$53]     (accessory defense stat)
C2/7AB3: 29 FF 00     AND #$00FF
C2/7AB6: 18           CLC
C2/7AB7: 65 42        ADC $42
C2/7AB9: 85 42        STA $42
C2/7ABB: C2 20        REP #$20
C2/7ABD: A5 40        LDA $40
C2/7ABF: 38           SEC
C2/7AC0: E5 42        SBC $42
C2/7AC2: 90 2C        BCC $7AF0     (branch if negative)
C2/7AC4: 85 40        STA $40       (base damage)
C2/7AC6: 4A           LSR
C2/7AC7: 22 6B 95 C2  JSR $C2956B   (random number 0 to (damage/2)-1)
C2/7ACB: C2 20        REP #$20
C2/7ACD: 85 44        STA $44
C2/7ACF: A5 40        LDA $40
C2/7AD1: 4A           LSR
C2/7AD2: 4A           LSR
C2/7AD3: 85 42        STA $42       (damage/4)
C2/7AD5: A5 40        LDA $40
C2/7AD7: 38           SEC
C2/7AD8: E5 42        SBC $42
C2/7ADA: 18           CLC
C2/7ADB: 65 44        ADC $44       (adjusted damage)
C2/7ADD: 30 11        BMI $7AF0
C2/7ADF: F0 0F        BEQ $7AF0
C2/7AE1: 85 40        STA $40
C2/7AE3: A0 1E 00     LDY #$001E
C2/7AE6: B7 59        LDA [$59],Y
C2/7AE8: 89 04 00     BIT #$0004    (if enemy defense up)
C2/7AEB: F0 02        BEQ $7AEF
C2/7AED: 46 40        LSR $40
C2/7AEF: 6B           RTL

C2/7AF0: A9 01 00     LDA #$0001    (damage = 1)
C2/7AF3: 85 40        STA $40
C2/7AF5: 6B           RTL
Critical hits are checked at C4/4F0E and are determined at the beginning of the round, before you get a chance to select an action. If my notes were better organized, I might even be able to tell you where that code is.
Joined: 10/3/2005
Posts: 1332
Thanks, that's very helpful. I understand almost all of what you posted. There's just one thing that baffles me. I stepped through a test, starting from C2/79D3, and ending at C2/7AEF, so see exactly how it reaches the "adjusted damage" value. That would be simple enough, except for this:
$C2/95A7 A5 41       LDA $41    [$00:0041]   A:00E1 X:08C0 Y:0000 P:envmxdiZc
$C2/95A9 A8          TAY                     A:0003 X:08C0 Y:0000 P:envmxdizc
...Which doesn't make sense, because at that point in the execution, there should be a zero in $41:
$C2/9580 64 41       STZ $41    [$00:0041]   A:F0B4 X:08C0 Y:0005 P:envMxdizc
Instead, it ended up returning a 3. The only explanation I can think of is that it has something to do with the 17 RORs that were performed on $40 between C2/9580 and and C2/95A7. So my question is, if all it did is rotate a bunch of zeros, then how did it produce a 3?
Active player (287)
Joined: 3/4/2006
Posts: 341
The command at C2/9582 clears the "M" flag, and thus sets the accumulator and memory to 16-bit mode. Thus, when C2/95A0 rotates $40, it uses $41 as the high byte. You appear to understand this part. ROR actually rotates 17 bits (in 16-bit mode): the 16-bit $40 and the carry flag. If the carry flag is set from the ROR at C2/959E, it will be rotated into $40.
Joined: 10/3/2005
Posts: 1332
Excellent! It makes perfect sense now. Thanks again. :)
Joined: 8/1/2004
Posts: 91
uhh... *confused look* While that looks like English, I don't understand a word of it. I tried my hand at the tediously trial-and-error method of luck manipulation, and I gotta say it sucks. Getting a fairly good battle an the overworld isn't very difficult, but manipulating anything for after the battle is a pain. It does seem trying to luck manipulate prior to battle (read: change the location and frame of entering battle) is superior to trying to luck manipulate after the battle has begun. Also, I had the same idea of getting the two opals in Lemele and selling them for B Power while they are still quickly obtainable. I haven't spent enough time to test this theory, but I think reaching Level 4 or Level 5 prior to killing Romus might end up saving more time than it would cost, and it would also result in having more gold to buy a few extra B Prtct in Rablesk before heading to Pison, Bonro, Zellis, Melenam, and beyond. That said, I'm probably saying nothing that Dromiceius doesn't already know. Regardless, I'm sure there are other people who would love to have some kind of visual aid for pre-battle manipulation (sans Potions unfortunately) and the Opals in Lemele, so I think I'll post a link to my puny start for this game. It'll probably be the last time it looks at all impressive. http://dehacked.2y.net/microstorage.php/info/1350021597/ThreeMinutes.smv
Joined: 10/3/2005
Posts: 1332
Oh, snap! There's another opal in the castle! Can't believe I didn't know that. You didn't grab the mirror in the right-hand bedroom, though- that's another extra 100g. I'm not sure what to spend it on. B Prtct should be unnecessary if Valsu is in the party. But then, if the Alien is in the party and two crits can be set up in the second round of battle, then it may be possible to kill bosses without boosting defense, in which case, it would be necessary to spend more on B Power instead of B Prtct. Buying a potion costs about 250 frames, which may or may not be more than luck manipulation costs... and judging from your video, I think manipulation will be the better choice. More testing needs to be done, in any case. I'm going to try to get back to figuring out the luck manipulation side of things tomorrow... hopefully before the weekend, at least. Stupid day job.
Joined: 8/3/2004
Posts: 325
Good luck with this guys, I love this game
1 2 3
10 11