kwsch / PKHeX

Pokémon Save File Editor
https://projectpokemon.org/pkhex/
Other
3.68k stars 689 forks source link

Control of current swarming (mass outbreak) species for generations 3 and 4. #3245

Closed RodrigoTR04 closed 3 years ago

RodrigoTR04 commented 3 years ago

Generations 2, 3, 4, and 5 have a swarming mechanic that allows the capture of species otherwise not available in certain games or versions, while generations 2 and 5 can be manipulated with in-game methods generations 3 and 4 cannot.

Possible solution is to add an option to control which is species is swarming at the time to allow their availability. (Ex. Surskit in Emerald version which can only be obtained through this method).

There are no alternatives for swarm control in generation 3 because it is not possible to control the console time in any manner and generation 4 because the game notices when the clock is altered or the cartridge is inserted in a different console and locks swarms until 12:00 AM.

More information for swarms (Mass outbreaks as Bulbapedia also calls it) can be seen here: https://bulbapedia.bulbagarden.net/wiki/Mass_outbreak

kwsch commented 3 years ago

Needs to be documented where these values are stored in the save file, and how they trigger different swarms.

SpiredMoth commented 3 years ago

A while back I wrote a script for PKSM for manipulating swarms in Gens 4 and 5, building off of documentation I found in Project Pokémon's Technical Documentation pages. My swarm documentation for Gen 4 and Gen 5 might be easier to understand than the script itself.

I remember my tests of the script being successful for Pearl, Platinum, HeartGold, Black/White (may have only tested one but can't remember which) and Black 2. We did receive a report on FlagBrew's Discord server about Cacturne swarms not working in White 2 but I haven't been able to confirm that myself yet due to lack of a suitable W2 save (and laziness).

Bl4ckSh4rk commented 3 years ago

Gen 3

Block 3
0xBFC - 0xC0F (RS)
0xC90 - 0xCA3 (E)

0x00 - 0x01 Species ID
0x02 - 0x03 Location Map Index
0x04        Level
0x05 - 0x07 00 00 00
0x08 - 0x09 Move 1
0x0A - 0x0B Move 2
0x0C - 0x0D Move 3
0x0E - 0x0F Move 4
0x10        00    
0x11        Appearance rate (50% (0x32) by default)
0x12        Days the outbreak will last (2 by default; counts down daily)
sora10pls commented 3 years ago

@SpiredMoth I tested W2 using your docs and had... different results. Table below.

00      Route 1             Farfetch’d
01      Dreamyard           Hypno
02      Route 6             Plusle (B2) / Minun (W2)
03      Route 9             Swalot
04      Desert Resort       Hippowdon
05      Route 5             Natu
06      Route 7             Furret
07      Route 12            Doduo
08      Route 8             Quagsire
09      Route 11            Masquerain
10      Route 13            Swellow
11      Abundant Shrine     Slowpoke
12      Route 15            Fearow
13      Route 16            Pineco
14      Route 18            Hoppip
15      Reversal Mountain   Cacturne
16      Route 3             Volbeat (B2) / Illumise (W2)
17      Route 20            Sudowoodo (B2) / Mr. Mime (W2)
18      Route 22            Ariados (B2) / Ledian (W2)
SpiredMoth commented 3 years ago

I have no idea what's going on then. I've retested all options of my script on B2 and got the same results as my docs. I doubt GameFreak would have rearranged the swarms between B2 and W2, and according to the report only Cacturne on W2 fails to work.

Valnoob: Hi, I don't know if I m in the good chan. I just would like to advert the scripts for Cacturne Swarm's on White2 only doesn't work. I tried everthing and a lot of differents roms but nothing. It perfectly work on Black2 and the other swarms works W2 but not Cacturne only
SpiredMoth: That makes absolutely no sense since the code executed is identical between B2 and W2
SpiredMoth: How are you checking whether it works or not?
Valnoob: I know.. I didn't want to come here cause I know that but I didn't find any solution
Valnoob: With repel. I tried with Farfect'f and Pineco and it works
Valnoob: My save on W2 is my main save on B2 but the other codes works, only Cacturne's swarms not
sora10pls commented 3 years ago

@SpiredMoth After some quick testing with Black 2, it looks as though there is in fact a difference between versions. Your list is accurate for Black 2, and mine is accurate for White 2 (had a friend double verify), but my theory is that during development and implementing version exclusives, they messed up the indexing.

B2 00 Farfetch’d      W2 00 Farfetch’d
B2 01 Hypno           W2 01 Hypno
B2 02 Plusle          W2 02 Minun
B2 03 Volbeat         W2 03 Swalot
B2 04 Swalot          W2 04 Hippowdon
B2 05 Hippowdon       W2 05 Natu
B2 06 Natu            W2 06 Furret
B2 07 Furret          W2 07 Doduo
B2 08 Doduo           W2 08 Quagsire
B2 09 Quagsire        W2 09 Masquerain
B2 10 Masquerain      W2 10 Swellow
B2 11 Swellow         W2 11 Slowpoke
B2 12 Slowpoke        W2 12 Fearow
B2 13 Fearow          W2 13 Pineco
B2 14 Pineco          W2 14 Hoppip
B2 15 Hoppip          W2 15 Cacturne
B2 16 Cacturne        W2 16 Illumise
B2 17 Sudowoodo       W2 17 Mr. Mime
B2 18 Ariados         W2 18 Ledian

Notice how W2 Illumise is pushed down all the way to index 16; this misaligns the indexes with B2. If Illumise were to be put where W2 Swalot is, and every subsequent index goes down by 1, then everything is perfectly aligned again!

Lusamine commented 3 years ago

This can now be edited in generations 3-5 in the Block Data editor (see 48024f1245a52c2073e302c44bbd836d126bbffc and 9ef93552c9a9cb95fff048f7cac844c74a1a6346). See above comments for values that can be used to modify swarms. It'll be up to the community to document any additional values needed.