Jump to content

Sky JEditor - another save editor for Pokemon Mystery Dungeon Explorers of Sky


matix2267

Recommended Posts

I haven't tested these, but found the exact values here (I'm pretty sure this is the quicksave area):

0x1C187-0x1c188: Team Member 1 Current Health

(Yay, no bit shifting!)

0x1c189-0x1c18a: Team Member 1 Max health

Additionally, in PkmnEx, HP2 is the max HP, and HP1 is the current HP at the time of entering the current floor, both as shown by the game.

I'll update this post when I have more.

[edit]

By the way, you can safely have your held item editor access 50 items.

There's 100 held items, 50 for the main story, 50 for the special episode. The 51st item is the 1st item of the special episode. 49 and 50 can hold usable items, you just can't fill those slots in-game.

Link to comment
Share on other sites

I haven't tested these, but found the exact values here (I'm pretty sure this is the quicksave area):

0x1C187-0x1c188: Team Member 1 Current Health

(Yay, no bit shifting!)

0x1c189-0x1c18a: Team Member 1 Max health

Additionally, in PkmnEx, HP2 is the max HP, and HP1 is the current HP at the time of entering the current floor, both as shown by the game.

I'll update this post when I have more.

[edit]

By the way, you can safely have your held item editor access 50 items.

There's 100 held items, 50 for the main story, 50 for the special episode. The 51st item is the 1st item of the special episode. 49 and 50 can hold usable items, you just can't fill those slots in-game.

I think it's actually 0x1c188-0x1c189 (remember that the game stores everything in little endian) and it should be 10 bits long (like the other hp fields), it's only that it starts at byte boundary. I'll investigate that a bit more.

You're right that hp1 is current hp (updated when entering the floor) but hp2 is actually base hp (without bonuses like Brick-Tough IQ skill).

Thanks for info about those 50 items. It's funny because you can't enter dungeons if you have more than 48 items, though the game gives no error about it.

Quicksave data starts at 102400 bytes and is 22528 bytes long. First four bytes are checksum (standard format), the next few bytes (8?) look like magic number (it repeats a few times throughout the data).

EDIT:

Starting at 0x1C170 bytes there are 20 pkmn each 429 bytes(!) long. First 4 pokemon is party, the next 16 slots are for enemies.

Bytes 0-1 are always 0xAA, 0x55; bytes 10-11 species id, 12-13 again species id (why is it duplicated?), 18 is lvl, 24-25 current hp, 26-27 base hp, 28-29 seems to be hp boost (it's 10 with Brick-Tough IQ skill), 32-35 stats (atk, spa, def, spd -- standard order), 36-39 current exp.

Bytes 337-360 are attacks, each 6 bytes long: flags (1 byte same as in SkyAttack/SkyAttackEx class), unknown (1 byte), id (2 bytes), pp (1 byte), ginseng (1 byte).

Bytes 69-76 might be current position but IDK why it's duplicated 4 times.

EDIT2:

New version v0.5c:

- you can now edit number of adventures had

- added editing active pokemon to GUI (codebase was ready from v0.2c)

- added loading/storing of quicksave data, no features yet except fixing checksum

EDIT3:

New version v0.6:

- huge GUI refactoring

- implemented editing pokémon from quicksave

Edited by matix2267
Link to comment
Share on other sites

  • 3 weeks later...

In Explorers of Time/Darkness, when a Pokemon is released from the Chimecho assembly, the level is reduced to 0, which is the invalid bit. (The bit that you labeled isvalid in your code is always 0 in T/D.). I think, but have not tested, that the same applies in Explorers of Sky: the first bit means nothing and the level is the only thing that matters in this case.

Haven't seen anything for PkmnEx though; putting a Pokemon in standby changes some unknown data just before the name. (Time/Darkness again)

Link to comment
Share on other sites

In Explorers of Time/Darkness, when a Pokemon is released from the Chimecho assembly, the level is reduced to 0, which is the invalid bit. (The bit that you labeled isvalid in your code is always 0 in T/D.). I think, but have not tested, that the same applies in Explorers of Sky: the first bit means nothing and the level is the only thing that matters in this case.

I don't have TD to test, but in Sky it is this bit that marks removed pokemon (the game always moves everything after released pokemon back one place and the last pokemon gets duped but has that one bit reset (level stays the same)). I also checked that zeroing this bit anywhere in the middle of Chimecho assembly works fine -- the pokemon gets removed (which is not true for items, mixing valid and invalid items would screw things up), it is also possible to have valid lvl 0 pokemon.

Link to comment
Share on other sites

  • 2 weeks later...

So apparently DeSmuME 0.9.10 has broken raw save file loading (the ones without extra 122 bytes at the end), and since SkyJEd doesn't add those extra bytes DeSmuME has trouble loading edited saves. You may need to revert to 0.9.9 or use "File->Import Backup Memory" to properly load it. I'm working on a quick-fix for this EDIT: implemented in v0.6b, can't attach it for now because something is buggy with forums EDIT2: attached finally, see main post.

More info here: http://forums.desmume.org/viewtopic.php?id=9896

Edited by matix2267
Link to comment
Share on other sites

  • 6 months later...

It's been over a year since I started this project and I have been very busy lately so this project wasn't updated for quite some time, but I'm back to tell you that throughout the last few months I have been checking this thread often to see if there are any questions, problems or feature requests.

New version v0.7d:

- updated resources (some location & IQ skill names)

- added Croagunk swap shop stock editing

Also I'd like to know if there's any feature you guys would like to see, please post about it.

Things from the top of my head that might be interesting:

- GUI improvements:

- edit streamlining (drag&drop, hot-keys, sort/auto manage)

- graphics for pokemon/items, possibly overview mode (like in PC storage in main pokemon series)

- satus bar to show non-important messages (like "saved" after clicking to save (currently there's no confirmation that it was successful))

- notification about unsaved changes when closing program

- notification/tooltip/color/anything when editing stored pokemon that is actually active (possibly link edits)

- more editing options for quicksave data:

- restore resumed quicksave

- dungeon tile editing

- reverse engineering all the unknown values in quicksaved pokemon

- more editing options for main data:

- taken jobs, bulletin boars, bottle, Spinda cafe client, friend rescue requests

- storyline data (new game+?)

- others?

- different versions (these would be huge undertaking):

- Time/Darkness

- Red/Blue rescue team

- auto update

Edited by matix2267
Link to comment
Share on other sites

- Time/Darkness

- Red/Blue rescue team

Your source code was VERY helpful in porting editing over to these versions. If you look on my codeplex, Sky Editor -> Library -> JEditor Source -> Save, you'll find VB versions of your Java classes, along with versions that have been adapted to work with Red/Blue/Time/Darkness. Since it's based on your source, feel free to use it in your program.

Link to comment
Share on other sites

v0.7e:

- huge refactoring (use actions and .properties files)

- preserve trash bytes (not editable yet)

- preliminary support for better character encoding (currently characters are not 1:1 mapped between Unicode and PMD)

v0.8:

- researched some unknowns in pokemon data (evolution level & tactics)

- better character encoding & editing of trash bytes (with colors)

Please tell me if I broke anything.

Edited by matix2267
Link to comment
Share on other sites

  • 4 weeks later...

I'm using gradle now to manage dependencies (currently only one).

Side effect of this change is different way of launching SkyJEd:

Windows: double-click on bin/SkyJEd.bat.

Unix: run: './bin/SkyJEd' from your favorite shell.

New GUI (DesignGridLayout) should be much more usable and have less bugs.

Most windows are now resizable and I can once again use native look&feel.

There is still one issue with buttons not sticking to the bottom.

If I broke anything or you have any suggestions, please tell me.

Changelog:

v0.8g: use gradle for distributions (this is so that I can easily add dependencies to project)

v0.8h: use DesignGridLayout for GUI (much simpler and better overall, windows are now resizable and do not get jumbled on different platforms)

v0.8i: restore native look&feel (removed in v0.2c due to GUI bugs)

Link to comment
Share on other sites

  • 11 months later...
New version

Changelog:

v0.8j: can now edit egg in Chansey's Care (i forgot to upload this version, sorry for that)

v0.8k:

- implement friend rescue request parsing (no GUI yet)

- implement friend rescue team, items and money editing (can be used to edit quicksaved rescue progress)

download in main post

Good to see research is still being done on PMD saves!

I did some R&D a few months ago using your source, and discovered the reason there's two IDs for the Pokémon in Quicksave. I looked in the source for the latest version, and your hypothesis is correct. The first ID (the one with the bit index of 80 in my code) is whatever Ditto is currently transformed as. The second ID (bit index of 96 in my code) is what the Pokémon actually is (which is the same in most cases, except for Pokémon that can use Transform).

Link to comment
Share on other sites

Good to see research is still being done on PMD saves!

I did some R&D a few months ago using your source, and discovered the reason there's two IDs for the Pokémon in Quicksave. I looked in the source for the latest version, and your hypothesis is correct. The first ID (the one with the bit index of 80 in my code) is whatever Ditto is currently transformed as. The second ID (bit index of 96 in my code) is what the Pokémon actually is (which is the same in most cases, except for Pokémon that can use Transform).

I have the same indices as you for the pokemon IDs so we read data from the same place :)

Since Ditto's transform changes attacks there should be a second place where attack data is stored (one for Ditto and the other for transformed pokemon), but I don't have much time to test it right now.

As you might have already noticed there's actually three sets of held items 50 items each: main story, special episodes, and friend rescue (no padding between them and right after those starts kangaskhan storage). Similar thing for the active pokemon data although there are 81 bit padding between those since they are 2265 bits apart and pokemon data is only 4*546 = 2184 bits long, I have no idea what that padding is. For the money it is even weirder since there's no padding between main story held money and special episode held money, but between special ep. and friend rescue held money there's 14 bits of padding (it's not another money thing since that is 17 bits long) and then there's another 7 bits padding before stored money.

One thing I noticed is that the last part of save (the very short one that starts after quicksave data) is changed when you start friend rescue and is cleared when you finish it (when Pelipper says "I must save your game").

Link to comment
Share on other sites

Since Ditto's transform changes attacks there should be a second place where attack data is stored (one for Ditto and the other for transformed pokemon), but I don't have much time to test it right now.

I'm don't think Transform gives you the target Pokémon's moves. I edited my ROM's personality test last night to play as a Ditto (because I can), used Transform (which had 1 PP), and had no more moves. Then I looked it up.

http://bulbapedia.bulbagarden.net/wiki/Transform_(move)#Pok.C3.A9mon_Mystery_Dungeon_series

I'm disappointed. A play through that could have been really interesting died there. The PP can be edited with ROM hacking with current research, but everything else can't.

IAs you might have already noticed there's actually three sets of held items 50 items each: main story, special episodes, and friend rescue (no padding between them and right after those starts kangaskhan storage). Similar thing for the active pokemon data although there are 81 bit padding between those since they are 2265 bits apart and pokemon data is only 4*546 = 2184 bits long, I have no idea what that padding is. For the money it is even weirder since there's no padding between main story held money and special episode held money, but between special ep. and friend rescue held money there's 14 bits of padding (it's not another money thing since that is 17 bits long) and then there's another 7 bits padding before stored money.

One thing I noticed is that the last part of save (the very short one that starts after quicksave data) is changed when you start friend rescue and is cleared when you finish it (when Pelipper says "I must save your game").

By "padding", I assume you mean all 0s? If so, I would guess that there's either some meaning to the padding, or it's left over from unused storage fields.

Link to comment
Share on other sites

  • 1 month later...

Hey, I've been really enjoying your tool. It's been amazing and I truely use it a lot. However, I noticed a minor bug, nothing game breaking just something that could be easily addressed. And that would be that the Parameter quantifier in item editing caps at only 99 in the program, when I have seen parameters in game able to exceed over 2 billion. This is especially true when your try to edit the contents of a treasure box and you can't put in ay item ID over 99 even though it has that in-game. So, I was just hoping that perhaps you could raise the cap to the maximum integer value.

Link to comment
Share on other sites

Hey, I've been really enjoying your tool. It's been amazing and I truely use it a lot. However, I noticed a minor bug, nothing game breaking just something that could be easily addressed. And that would be that the Parameter quantifier in item editing caps at only 99 in the program, when I have seen parameters in game able to exceed over 2 billion. This is especially true when your try to edit the contents of a treasure box and you can't put in ay item ID over 99 even though it has that in-game. So, I was just hoping that perhaps you could raise the cap to the maximum integer value.

When I've been researching this part for some reason I thought this value only represents the number of stackable items (gravelerocks, sticks etc.). I will change it with next update (no ETA at the moment, and I'm not really sure what will that change be). I was hoping to some day work on supporting other game versions but that would be really a lot of work and I don't have that much time right now. It's good to hear that you find the program useful :)

The cap can't be INT_MAX because this value has only 11 bits available in the save so maximal value would be 511 (this means that you can't have seen it at 2 billion :P ). I should perhaps make the GUI change so that when one is editing a box the number spinner should change to some drop-down list of all items.

Link to comment
Share on other sites

  • 2 years later...

Any chance of Japanese save support for this? I tried using it, but ended up getting a corrupted save out of it. A lot of the data that's shown off when editing seemed to be correct, like the mon data (just with weird names), and the item data.

Link to comment
Share on other sites

  • evandixon unpinned this topic
  • 1 year later...

Pardon my ignorance, but I am not used to romhacking at all. I wanted to try Sky JEditor for just one simple thing -  to give my Chikorita starter Grasswhistle. I've tried opening the Windows Batch File and all that, but even after I update the Pokémon and save the changes, nothing happens in my ROM. Can someone help me figure out what's wrong?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...