Jump to content

Recommended Posts

Posted

Some time ago I had a few misadventures looking into how some stuff worked in the old Gen 4 games. Fast forward to now, where I have a little more experience looking at how games work thanks to studying some other games (specifically Mega Man Battle Network), I came back to take another look at this problem and actually found some interesting data

dpmarshsav.png.20ca0519082b886a195db3ea709b3550.png

The highlighted bytes are the Great Marsh Pokemon, and it's rather interesting how these bytes behave based on the testing I did with them. The first byte controls the daily Pokemon for both Areas 1 and 2, the second Area 3, the third Areas 4 & 5, the fourth Area 6. In the configuration shown in this save file, Areas 1 and 6 had Croagunk, Area 2 had Yanma, Area 3 had Staravia, Area 4 had Drapion, Area 5 had Carnivine. Using an old Gen 4 save editor that had the capability, I changed each area's daily Pokemon to Kangaskhan and watched what happened. Editing Areas 1 and 2 changed the first byte (to 97 and E0 respectively), editing Area 3 changed the second byte from AE to DE, editing Areas 4 and 5 changed the third byte (to 3B and 76 respectively), editing Area 6 changed the fourth byte from B7 to AF.

I don't know exactly how the Pokemon are calculated from this (especially with the first and third bytes), but based on the old editor's data the Great Marsh Pokemon are arranged as follows:

Spoiler

00, 03, 07, 11/17, 1B/27 Croagunk

01, 04, 08, 12/18, 1C/28 Skorupi

02, 05, 09, 13/19, 1D/29 Carnivine

06, 0F/15, 1F/31 Golduck

0A/10, 1A/26, 1E/30 Roselia

0B/11, 10/16, 19/25 Staravia

0C/12 Toxicroak

0D/13 Drapion

0E/14 Exeggcute

14/20 Yanma

15/21 Shroomish

16/22 Paras

17/23 Kangaskhan

18/24 Gulpin

The next four bytes after the Great Marsh are the Swarms, which seems overly complicated for handling one daily Pokemon at a time (Makuhita, in the case of the save shown above), but I think PKHeX is actually able to manipulate this through Block Data (though you need to know what you're doing). Once boiled down, the Swarm values are as follows:

Spoiler

00 Doduo

01 Zigzagoon

02 Cubone

03 Nosepass

04 Phanpy

05 Dunsparce

06 Snubbull

07 Absol

08 Spoink

09 Drowzee

0A/10 Delibird

0B/11 Swinub

0C/12 Voltorb

0D/13 Farfetch'd

0E/14 Skitty

0F/15 Natu

10/16 Makuhita

11/17 Krabby

12/18 Spinda

13/19 Beldum

14/20 Pidgey

15/21 Corsola

16/22 Surskit

17/23 Lickitung

18/24 Smoochum

19/25 Electrike

1A/26 Slakoth

1B/27 Magnemite

72DC and 72DE are the Trophy Garden Pokemon, with C being the current day's Pokemon and E being the previous one. These are far more straighforward than the Marsh and Swarms, with basic hex values:

Spoiler

00 Eevee

01 Bonsly

02 Happiny

03 Meowth

04 Cleffa

05 Clefairy

06 Igglybuff

07 Plusle

08 Jigglypuff

09 Porygon

0A Castform

0B Minun

0C Mime Jr

0D Marill

0E Chansey

0F Azurill

FFFF No Previous Day Pokemon

Now one last interesting tidbit, I did find this data in the game's ram, but there's a bit of a catch

dpmarshram.thumb.png.9324caa14d43c326e4432182ef2e7a09.png

Unfortunately, this data floats around the 02274700-4800 range, so it is impossible to edit by Action Replay without a way to make the locations of these bytes static (even then, the complex nature of the Marsh and Swarm makes them difficult to even live edit in an emulator's memory viewer without knowing how they work). Still, it allows the ability to study this data with the game in motion (and for the record, that day's seed translates to Skorupi in Marsh Areas 1, 2, and 6; Paras in Area 3, Roselia in Area 4, Kangaskhan in Area 5, and a Dunsparce Swarm).

Unfortunately I don't know how all of this translates to Platinum, but it really seemed like this was an area of Gen 4 that hadn't gotten a lot of research, so hopefully it helps (and hopefully someone with a lot more time and patience than I do can finish the research on the Marsh).

  • Like 1
Posted

Funnily enough I also just so happened to look into the Great Marsh very recently and your old post helped a lot with the old save editor and its info.

Basically the only thing you're missing with your observations on what bytes get changed is that a pokemon appearing in a specific area does not change the whole byte, but only 5 bits of it. 

Read as little endian 80 ae 36 b7 becomes b7 36 ae 80 or in binary 1011 0111 0011 0110 1010 1110 1000 0000.

If we now split that into units of 5 bits we get 10 11011 10011 01101 01011 10100 00000 or 2 1B 13 0D 0B 14 00. The 2 shouldn't be used for Great Marsh calculation here.

These values line up with the pokemon you had in your areas if we assign the 5 bit blocks "in reverse". 1B is area 6, 13 is area 5, 0D is area 4, 0B is area 3, 14 is area 2, 00 is area 1.

The following table shows which Pokemon each 5 bit block corresponds to in both DP and Pt once you have the national dex.

Hex Bin Dec DP Pt
00 00000 0 Croagunk Toxicroak
01 00001 1 Skorupi Kecleon
02 00010 2 Carnivine Kecleon
03 00011 3 Croagunk Carnivine
04 00100 4 Skorupi Skorupi
05 00101 5 Carnivine Croagunk
06 00110 6 Golduck Quagsire
07 00111 7 Croagunk Drapion
08 01000 8 Skorupi Skorupi
09 01001 9 Carnivine Croagunk
0A 01010 10 Roselia Quagsire
0B 01011 11 Staravia Kangaskhan
0C 01100 12 Toxicroak Paras
0D 01101 13 Drapion Drapion
0E 01110 14 Exeggcute Exeggcute
0F 01111 15 Golduck Exeggcute
10 10000 16 Staravia Skorupi
11 10001 17 Croagunk Croagunk
12 10010 18 Skorupi Skorupi
13 10011 19 Carnivine Carnivine
14 10100 20 Yanma Yanma
15 10101 21 Shroomish Shroomish
16 10110 22 Paras Paras
17 10111 23 Kangaskhan Kangaskhan
18 11000 24 Gulpin Gulpin
19 11001 25 Roselia Tropius
1A 11010 26 Staravia Gulpin
1B 11011 27 Croagunk Shroomish
1C 11100 28 Skorupi Skorupi
1D 11101 29 Carnivine Carnivine
1E 11110 30 Roselia Croagunk
1F 11111 31 Golduck Tangela

I know that in Platinum, every Pokemon that isn't in the Sinnoh Dex gets replaced with Wooper before you get the National Dex. I don't know how it works with DP, as I was playing Platinum while looking into this.

I also went and tried this with manual hex editing of my save file (and fixing the checksum with PKHeX) and changing the area encounters worked like a charm.

  • Like 1
Posted

Very interesting. So that's how the Great Marsh Pokemon are sorted out (and maybe my initial assumption about what each byte does was slightly off). I was figuring maybe there was maybe something to the little endian order of the bytes when grouped together, but studying them individually is easier to do the other way. Kinda curious what those random two extra bits do, if anything, though.

The post-National Dex slots in D/P are split between Wooper, Quagsire, Azurill, Marill, Bidoof, and Bibarel pre-National Dex but I don't know which ones correspond to which slot (only that Wooper and Azurill take two each and the others one apiece).

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...