News:

11 March 2016 - Forum Rules

Main Menu

JRPGs: DoubleXP/DoubleGold

Started by Psyklax, November 29, 2017, 04:45:56 PM

Previous topic - Next topic

Psyklax

Quote from: Shadic on January 06, 2018, 12:02:45 PM
could I use your EXP/Gold formula edit for my own project?

Uh, in what way? You're hacking one of the games I've done? Well, you could just write in your readme file "hey guys, my hack will be better if you use this guy's patch as well" with a link or something? If I can see what you're actually doing then maybe I'll let you put my hack into yours with a credit, but I'd like to know where it's going first. :)

By the way, here's a bunch of patches for you guys! ;)

http://s346165667.websitehome.co.uk/psyktrans/2x-20180107,zip

Dragon Warrior 3 on GBC is done, but I'm still figuring out the SNES version. It appears the code refers to specific positions in the stack, which is a TERRIBLE idea, because when I did a subroutine jump, it knocked the stack pointer by one, thus crashing the game. Who the hell programmed that?!

Anyway, there's also an updated patch for Final Fantasy 3 (NES) which halves the time to increase your job level (thanks for the heads up, Reiska!), and I removed the fast running feature I used to have - I've gone off the idea. :) I also finally fixed Dragon Warrior 2 (NES) so I'll be completing that game soon. :D

I must point out to everyone in the thread that all of these patches are preliminary: I've not officially released any of them, because I want to iron out any kinks.

Shadic

Quote from: Psyklax on January 07, 2018, 08:56:04 PM
Uh, in what way? You're hacking one of the games I've done? Well, you could just write in your readme file "hey guys, my hack will be better if you use this guy's patch as well" with a link or something? If I can see what you're actually doing then maybe I'll let you put my hack into yours with a credit, but I'd like to know where it's going first. :)
I'm just doing a "modernization" patch of my own, updating names, exp/gold gain, shop costs, etc. But a few values (Metal Slime, Gold Golem) would ideally go over the 255 limit.

Psyklax

Quote from: Shadic on January 13, 2018, 10:02:41 PM
I'm just doing a "modernization" patch of my own, updating names, exp/gold gain, shop costs, etc. But a few values (Metal Slime, Gold Golem) would ideally go over the 255 limit.

I'm a bit confused: are you saying you want to set those enemies to give you more than 255? Because the game code doesn't support that. Open FCEUX and set an execute breakpoint for $EA0A, and you'll see that the game stores one byte for the XP total to $00, and stores zero to $01. But if you change $00 and $01 to FF, you'll get 65,535, so it's clearly possible to get more than 255 from an encounter. The problem is, the game ignores the most significant byte when loading the XP total, so if the enemy is 144 normally and doubled, you only get 32 (because 256 is ignored). Of course I could change the routine so that the carry flag is also considered, which would solve the problem.

Anyway, time for an update! :)

Thanks to KingMike's assistance, I've made an update to my Final Fantasy 6 (SNES) patch! Now when you get later in the game and earn Magic Points for your Esper stuff, you'll earn double. I'd never have been able to do it without someone providing me with a late-in-the-game save file, so big thanks to KingMike for stepping up! ;)

Also in the pack is Dragon Quest 3 (SNES), which complements my previous patches for DW3 on GBC and NES. I think I may have to take another look at my DW3 NES patch, since it was one of the first ones I did and I want to make sure it's okay, given what I've been learning since then.

http://s346165667.websitehome.co.uk/psyktrans/2xp-20180114.zip

I've now reached the point where I think I'll officially release a few patches. I've now completed Dragon Warrior/Quest 1 and 2 on NES, SNES and GBC, so I know the patches work correctly.

Also, when you reach the last shrine before the final castle in DW2, FAQs will sensibly recommend that you reach level 30 before trying. Well, I made it there in the 20s and really couldn't be bothered to grind at that stage, even with double XP. So I used my hacking skills to make Game Genie codes that will give you super XP from a battle, then turned them off when I was up to the level I wanted. :) And I'll share them with you now!

On Dragon Warrior 2 (NES), there's an internal check to allow you to earn no more than 9,999 XP from any battle, even though there isn't a single battle in the game that could earn you anything close to that. So I just replaced the branch instruction with one that does the opposite (ie load 9,999 XP if you get LESS than that, not MORE).

EUSPEPEP - gives 9,999 XP for every fight

Of course, if 9,999 isn't enough, you can use these two codes to change 9,999 to the maximum of 65,535.

NNSOKOYE + NNVPOPYX - gives 65,535 XP for every fight (with EUSPEPEP)

(for testing purposes, I used just the first patch to play through the entire game from scratch. :D It didn't take nearly as long, obviously)

For the Game Boy Color version, I've also made a Game Genie code, but this one always gives you 65,535 XP. The GBC version also includes a maximum routine, so this code replaces the jump instruction with a load instruction, meaning the code just continues to load the maximum into the XP total.

26D-67B-2AA - gives 65,535 XP for every fight

As for the SNES version, I used Pro Action Replay to patch the RAM, whereas Game Genie patches the ROM. It just puts 255 in $7E0ED9, which is where the most significant byte of the XP total is kept. Therefore, you always earn a MINIMUM of 65,535 for each fight, as well as adding the least significant byte.

7E0ED9FF - gives minimum 65,535 XP for every fight

Have fun with the patches, and the codes! :)

Shadic

Quote from: Psyklax on January 14, 2018, 03:30:39 AM
I'm a bit confused: are you saying you want to set those enemies to give you more than 255? Because the game code doesn't support that. Open FCEUX and set an execute breakpoint for $EA0A, and you'll see that the game stores one byte for the XP total to $00, and stores zero to $01. But if you change $00 and $01 to FF, you'll get 65,535, so it's clearly possible to get more than 255 from an encounter. The problem is, the game ignores the most significant byte when loading the XP total, so if the enemy is 144 normally and doubled, you only get 32 (because 256 is ignored). Of course I could change the routine so that the carry flag is also considered, which would solve the problem.

Oh. Well... Crap.  :-\

KingMike

I find it hilarious that, as I recall, in the first SNES SD Gundam Gaiden, the game's equivalent to the Metal Slime appears in Chapter 3. I think it was worth like 35,000 EXP and attacked in groups, making it really easy to hit the 65,535 EXP per battle gain limit.
"My watch says 30 chickens" Google, 2018

Psyklax

Quote from: Shadic on January 14, 2018, 01:19:25 PM
Oh. Well... Crap.  :-\

I think you missed the part where I said "I could change the routine so that the carry flag is also considered, which would solve the problem". :D I would just have to do an arithmetic shift on the byte in $00, then rotate the carry into $01 (if none of that makes sense, don't worry, it's assembly maths stuff ;) ).

Let's do it right now, shall we? :D

Open the game in FCEUX (or in a hex editor) and go to $EA1F in the ROM. There are four bytes we're interested in: A9 00 85 01, which means "LDA #$00; STA $01", or "load the Accumulator with the number zero, and store it in $01 in RAM". This is an odd bit of programming: it's as if the game accommodates using a 16-bit value for the XP in battles, but explicitly doesn't use it, instead writing zero to the most significant byte. Fortunately, we CAN use it! :)

Change A9 00 85 01 to 20 60 FF EA, which means "JSR $FF60; NOP", or "jump to the subroutine at $FF60, then do nothing for a cycle". We need three bytes to make the jump, but we're replacing two instructions that use two bytes each, so there's one byte we don't need. We just replace it with an instruction that tells it to do nothing. So now we're ready, we put our subroutine at $FF60 (in RAM), which in this particular ROM will be at $FF70, so go there.

You'll see a bunch of FFs, meaning there's some empty space for us. Type 06 00 26 01 60, which means "ASL $00; ROL $01; RTS", or "do an arithmetic shift left on what's in $00; rotate left on what's in $01; go back to where you were in the program". An arithmetic shift moves the bits either left or right, and moves the highest (or lowest) bit into the carry. Learn about binary, bits and bytes if that still makes no sense. :) Rotate does the same thing but the difference is that ASL puts zero in the lowest position, which ROL puts the Carry into the lowest position. So if your first byte is doubled and goes over 255, that activates the Carry flag, and the second byte then gets that Carry added to it. Make sense? :)

Anyway, let's give it a try. Enter those two things, then get into a fight with a Slime. Normally that gives you 1 XP, now it gives you 2. Yay! But let's go further. The XP for that encounter is stored at $106 in RAM, so go there when you get into a fight and (if it's a Slime) it'll have $01 stored there. Try changing it to $81 (129 in decimal). If everything goes right, it should give you 258 when you win. Give it a try. ;)

Of course, you'll need to do something similar with the Gold as well (I'll have a look at that later if you're interested). Also, if you're fiddling with "exp/gold gain, shop costs, etc", you might need to take them into account, if you're always earning double from battles. And don't forget that you'll still earn a maximum of 510 using this method. If you want to make it quadruple instead of double, you'll need a few more bytes of instructions. Still, I think 510 should be enough. :)

Happy hacking! ;)

Shadic

Thank you very much for walking me through this.. It's very helpful.  :thumbsup:

Unfortunately, I did what you said and it appears to be working for monsters below 255 EXP, it doesn't surpass that limit.

Here's a video showing the discrepancy between what it says (Adding 510) EXP, and what it does (adds 254).

Psyklax

Quote from: Shadic on January 15, 2018, 04:29:50 PM
discrepancy

Ah, I see. I should've paid more attention to what I was doing. :)

It seems like it says on-screen how much you get, but what you actually receive is different. I'll have a look at it, and the Gold as well. It's most likely that it's filling your XP with the untouched value at $106, while the values used in $00 and $01 are just for text purposes.

Shadic

I've also seen this while using the DW1 Mass Data Editor, actually. For most items it'll modify item cost without issue, but certain objects (it's been some time, but I believe Herb, Torch, Dragon's Scale, and Wings), editing the items away from their base values can cause strange discrepancies as well!

Psyklax

#89
Quote from: Shadic on January 17, 2018, 01:03:52 AM
I've also seen this while using the DW1 Mass Data Editor, actually. For most items it'll modify item cost without issue, but certain objects (it's been some time, but I believe Herb, Torch, Dragon's Scale, and Wings), editing the items away from their base values can cause strange discrepancies as well!

I don't think that's related. In fact, I don't know why you may have had problems with that, but if you're serious about hacking then you'd dump those tools. Ain't nothin' you can't do with a good debugging emulator, a hex editor, and some knowhow. ;)

I'm looking again at the game: the problem I had is that making $00 and $01 have my 16-bit number is fine to write on the screen, but of course the game doesn't care about $01 when adding to your actual experience. At $EA17, the routine (after telling you how much you XP you earned) loads the value in $00, adds it to your experience total, then replaces it with the new total. If it goes over $FF (255) then it adds one to the most significant byte. If the MSB goes over $FF, then it loads $FF to both, because that's the maximum XP for the game (65,535). Of course, there's nothing to stop you using a 24-bit number for your total XP, but I don't think it's worth the effort. If you want to see this routine in action, add a breakpoint in the debugger for "execute" at EA17, then win a fight.

Now, that's all well and good, but we need to add $01 to the MSB, in addition to all I just mentioned. The simple answer is to continue what I did earlier: do a jump and include an instruction to add $01 to $BB (the MSB of your experience). The tricky bit is deciding in what order to do things. We need four operations: add $00 to $BA, increase $BB (if necessary), add $01 to $BB, put $FF in $BA and $BB (if necessary). I'm working on the routine now and I'll edit this post when I'm done. :D

EDIT: okay, here we go. :) First thing to mention: this requires changing the previous double XP patch I gave you, and it ONLY works for the XP, not the Gold, so it's a bit limited.

At $EA29 in the ROM, put 20 54 FF 50 0C, which jumps to my new routine, and on returning, skips all the code that was copied to that routine.

Then, at $FF64, put this: 18 65 BA 85 BA 90 04 E6 BB F0 09 A5 01 18 65 BB 85 BB 90 06 A9 FF 85 BA 85 BB 60 (copy-paste it in there). It'll be a pain to explain everything in this, but most of it is copied from the original routine in the game. It just adds a new part to add $01 to $BB. I'm sure I could use fewer bytes in this part and change something in the other part, but for now it'll do.

You can test that this works by doing an execute breakpoint to $EA13, then when it stops, changing $00 and $01 to whatever you want, and it should add the right amount to your XP total. I'll need to fiddle with it a bit more to do double XP again.

EDIT2: Aha! I've finished my routine, and it's so nice I think I'll use it in my final version of my patch, even though it's not really necessary (because no enemies in the original game give you more than 127 of either). It uses two routines that cover both XP and Gold, one to double them and another to make sure the 2nd byte is used. I'll post later.

EDIT3: Changed my mind, I'll properly release it as a patch and add it to the RHDN database. :) Hopefully later today, if I find the time.

Psyklax

Well, long time no post! :)

Just thought I'd tell everyone my attention shifted away from this project to translating a game for the PC-98, but a post on the Newcomer's Board reminded me that I had loads of these patches in the works that I haven't properly released - even ones that I haven't posted about here. So I've already released a couple and I'm in the process of releasing more, so you'll find them popping up in the RHDN database soon enough - or just go to my website.

Feedback is very much appreciated! :) Unlike translations - where I play through every line to make sure it's 100% good - this is more a 'fire and forget' approach, because I can't be expected to complete an entire RPG just to check that my little doubling routine worked out fine. If I did a patch but it requires doing more than just experience and gold, like with the SNES Final Fantasy games, I need to know.

Anyway, time to get back to translating... ;)

ultimaweapon

How many RPGs have you done so far w/ DoubleXP/DoubleGold?
Trust in the Heart of the Cards

Psyklax

Quote from: ultimaweapon on February 11, 2018, 10:13:34 PM
How many RPGs have you done so far w/ DoubleXP/DoubleGold?

See the little globe next to my avatar, on the left? That's a link to my website. ;) Otherwise you can click on my username and find my contributions to the database.

ultimaweapon

OK cool. I'll check your site out.

BTW, do you plan to do any of the PSX rpgs suck as Final Fantasy 7, Final Fantasy 8, Legend Of Legaia, or Legend Of Dragoon with DoubleXP/Double Gold?
Trust in the Heart of the Cards

Psyklax

Quote from: ultimaweapon on February 13, 2018, 03:05:45 AM
do you plan to do any of the PSX rpgs

Never say never. :) I have no experience with 32-bit CPUs, but it would be a nice challenge.

lilo-san

I was just trying the FFV patch: http://s346165667.websitehome.co.uk/psyktrans/finalfantasy5.zip

When I saw I get 1 ABP point.

Is there any plans to come back to work on this patch? I will be playing the full game soon so I could test it.

C_CliFF

#96
Quote from: lilo-san on July 27, 2020, 07:00:32 PM
I was just trying the FFV patch: http://s346165667.websitehome.co.uk/psyktrans/finalfantasy5.zip

When I saw I get 1 ABP point.

Is there any plans to come back to work on this patch? I will be playing the full game soon so I could test it.

Sorry for late response, didn't see it until recently. The patch here is not accurate on EXP, money and ABP was never implemented so you can use mine I did instead:

http://www.romhacking.net/hacks/5665/

Edit: Upon request, here is a version which gives EXP,Gold and ABP 4x and 8x as well.

https://easyupload.io/uhdax8

Will only be available for a month (since I don't know which upload service good enough) but double is available on this site, since that was the intention of the whole topic.

[email protected]

Will you be interested in doing a double exp/meseta hack for Phantasy Star IV(USA)
The only patch I could find includes hell/purgatory mode(I just want x2 exp/meseta)

Red Soul

I assume this isn't targeting DS games?
Text wall below, sorry!
Spoiler

The most egregious case I can think of is Black Sigil - Blade of the Exiled.
The enounter rate in that game is insanely high and the rewards are in no way comensurable to the effort.

It's a shame because the game is graphically excellent and the sound is all right too. If I remember correctly, it was
actually going to be a late GBA release but then moved to the DS.

There were a lot of complaints about encounter rates back when the game was new, as I recall. Devs claimed it was an anti-piracy measure to punish those using flashcards/emulators, but I honestly doubt that was the case; far more likely is that they got some numbers wrong and the game shipped as it was and they couldn't/didn't bother to fix it.

The bottom screen UI seems to have a gauge that might have been used to count down the steps towards the next combat encounter, but it never moves. I'm not a hacker but it seems something is seriously bugged in that game.
[close]

Volcannon

I too would be interested in just having the Double EXP/Meseta mod from Phantasy Star IV.
It's Nerf or NOTHING!!!