• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Weather hacking

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
The purpose of this thread is researching weather effects and updating them to the way they are in later generations. So far this only contains the overworld snow effect but I hope to post more in the future.

Spoiler: Three snow flakes, FR
So yeah, LU-HO can't count. There's 16 of them. There are three things that need to happen for the snow to behave like the light snow in gen IV/V:
  • At 0x07C23E, put 4B E0 to stop the snowflakes from melting
  • Edit the byte at 0x07BE56 to change the number of snowflakes. I suggest something around 0x20
  • Copy 041CE1F732F80D4AD921C900885C to 0x079DBE to fix the spawning of snowflakes when returning to the overworld
  • To stop the screen from becoming darker: 805C03280DDB04280BD0062803DD0D2807DC0B2805DB012204E0 at 0x07A85E, 00 at 0x07BE46, 6CA1 at 0x07A0D0
That's it! And here's a patch that does all of this in case you're really lazy.


Spoiler: Underground flashes, FR
I don't know what could possibly make LU-HO call it this. It's obviously the harsh sunlight from Ruby. Mr.Pkmn was kind enough to share the way he fixed it:
  • pal_fade_2 doesn't allow the screen to be brightened in FR. To make it work, insert this extension of the routine anywhere and put 014887460000XXXXXXXX at 0x07A2AA (XXXXXXXX is a reversed pointer to where you inserted the routine), and 20220270 at 0x07AC2A.
    Spoiler:
Spoiler:
Spoiler:
 
Last edited:

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
I've just added some information on implementing the harsh sunlight from Ruby into FireRed, as well as some general information on how weather works.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
I did take my routine from Emerald, and the table is included at the bottom of it. Have you shared the source anywhere?
 

Mr.Pkmn

Ordinary ASM Magician
53
Posts
15
Years
  • Seen Nov 17, 2023
I would say "it's not time yet" but since you're so close i'll save you some headaches

Spoiler:
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Thanks a bunch! I'll add it to the op when I'm at my pc again.
(And I think it's never bad to share routines if you can help people with it! If you have anything else to contribute, please do. I'll clean up Jambo's code for in-battle hail when it snows in the OW soon but I noticed you had once asked a question about that, so perhaps you've got something already :b)
 

Mr.Pkmn

Ordinary ASM Magician
53
Posts
15
Years
  • Seen Nov 17, 2023
Nope i didn't touch the matter. I do know you can't make infinite hail (but 255 turns are enough)

Would be interesting to make a blizzard weather using the sandstorm one
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
I believe Jambo did create permanent hail. And yeah, I plan on at least replicating all forms of weather present in Platinum and want to use sandstorm (and perhaps some snowflakes and screen darkening) for blizzard.
 
116
Posts
16
Years
The purpose of this thread is researching weather effects and updating them to the way they are in later generations. So far this only contains the overworld snow effect but I hope to post more in the future.

Spoiler: Three snow flakes, FR
So yeah, LU-HO can't count. There's 16 of them. There are three things that need to happen for the snow to behave like the light snow in gen IV/V:
  • At 0x07C23E, put 4B E0 to stop the snowflakes from melting
  • Edit the byte at 0x07BE56 to change the number of snowflakes. I suggest something around 0x20
  • To stop the screen from becoming darker: 052804D0012203E0 at 0x07A872, 00 at 0x07BE46, 0807A16C at 0x07A0D0
That's it!
I have been found a bug for the weather of snow flakes. It always showed me the dark screen to every things exclude the hero's overworld while starting to fly from the city that has the snow flakes or flying to the city which has the snow flakes.
attachment.php


attachment.php


attachment.php


attachment.php


PS: Sorry for my poor English.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Ughhhhh. Thanks for this, I'll try fixing it as soon as possible.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
I believe Jambo did create permanent hail. And yeah, I plan on at least replicating all forms of weather present in Platinum and want to use sandstorm (and perhaps some snowflakes and screen darkening) for blizzard.

I'll upload my code for Snow Warning on the Ability Resource Thread fairly soon. Just need to formally write it up again.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Snow is a really weird case: the screen turns black on warps too, though none of this happened when I was testing it at first. I'm trying to figure out which step I forgot.
 
89
Posts
10
Years
Just some info for Emerald:
The corresponding offsets for changing the snowflake effect in Emerald are:
07A0D0-0AB47C (Pointer to routine causing darkening (pointer to overwrite: 080AB51C [1C B5 0A 08]))
07A872-0ABD2A (Screen darkening during snowflake effect)
07BE46-0ACFA6 (Screen darkening during snowflake effect)
07BE56-0ACFB6 (Number of falling snowflakes)
07C23E-0AD39E (Snowflakes melting)
And the offsets containing the image & palette of the weather particles are:
0x54DAD0 (image, uncompressed)
0x54C270 (palette, uncompressed)
The particles are arranged in the following order: large "three snowflakes" snow particle, small "three snowflakes" snow particle, large diving bubble, small diving bubble, then all the ash particles, in slightly different positions, and finally the rain particles.
Again, this is for Emerald.
 
Last edited:

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
I've updated the thread: it now contains the proper way to fix snow, as well as Mr.Pkmn's way to fix sun. I'll be away for a few days but I'll add the Emerald stuff, RAM structures, battle weather and more when I return.
 
3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024
So I've noticed that when on a map that had it's screen darkened by weather (in my case, rain), when I use a warp the screen flashes blue instead of black. I did some testing, and I've figured out that it's related to how you removed the screen darkening from snow, but I'm not sure how.

Have you encountered this before too?

Also, do you think you could be a bit friendlier with your formatting and separate the byte values you posted with spaces?
 
89
Posts
10
Years
The removal of the darkening during snowfall appears to break other weathers that include the darkening effect (e.g. regular rainfall). Also, the maximum number of snowflakes (the byte at 0x7BE56 [FireRed]/0xACFB6 [Emerald]) that can be onscreen is 0x36 (54)
 
5,256
Posts
16
Years
So I've noticed that when on a map that had it's screen darkened by weather (in my case, rain), when I use a warp the screen flashes blue instead of black. I did some testing, and I've figured out that it's related to how you removed the screen darkening from snow, but I'm not sure how.

I can confirm that this happens with all of the "white" flashes, i.e. exiting from a cave to outdoors or fadescreen 0x3.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
So I've noticed that when on a map that had it's screen darkened by weather (in my case, rain), when I use a warp the screen flashes blue instead of black. I did some testing, and I've figured out that it's related to how you removed the screen darkening from snow, but I'm not sure how.

Have you encountered this before too?

Also, do you think you could be a bit friendlier with your formatting and separate the byte values you posted with spaces?
Got back to hacking today, and all warps look fine to me. Could you either post a link to a patch here or join the irc ('chat' link in my sig)?
As for the spaces: I put everything down this way on purpose so the string of bytes can easily be copied into a hex editor.
The removal of the darkening during snowfall appears to break other weathers that include the darkening effect (e.g. regular rainfall). Also, the maximum number of snowflakes (the byte at 0x7BE56 [FireRed]/0xACFB6 [Emerald]) that can be onscreen is 0x36 (54)
Same applies here: nothing breaks for me. Could you either post a link to a patch here or join the irc ('chat' link in my sig) too?
And what do you notice with numbers above 0x36? For me everything works fine up to 0x39.
I can confirm that this happens with all of the "white" flashes, i.e. exiting from a cave to outdoors or fadescreen 0x3.
.-. I'm really getting confused here. Join the irc please.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Alright, I've fixed the blue screen during fades. It just requires adding two more four-byte strings, so it can be applied over the existing hack. I've also included a patch for the lazy among us.

EDIT: scrap that. I messed up :(

EDIT 2: everything should work this time. If you applied the two changes from the last fix, then undo them. The longer string I just added should cover everything.

EDIT 3: just updated the OP once more; there was a glitch where if you entered a map, walked to the left or right for some tiles, then opened something (like the bag) and returned to the map, the snowflakes would spawn where you originally entered the map. Then the game would detect that they (or a part of them) are off the screen, think you've just taken a step that moved them out of view, and place them on the opposite side of the screen, giving all of them the same x coordinate. This happens because the game uses global_sprite_displace to spawn snowflakes within your view, and also uses it to see if they've gone off the screen. However, the snowflakes are spawned before global_sprite_displace is set :/. This update calls the function at 0805AE28 to update global_sprite_displace right before running the weather functions, which seems to solve the problem.
 
Last edited:
Back
Top