• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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: Why the really tall grass doesn't work in firered and how to fix it.

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
If you're not interested in the techical details scroll down

As you probably know you can change the behaviourbyte of the grass block from 2 (normal grass) to 3(tall grass) in advancemap. However no animation is played for 3.

Everything starts at 083A70BC which is a table of functions. The interesting entries are at index 1 and 2: 080683C8 and 08068414. They end with:
Code:
08068402         MOVS    R0, #4
08068404         BL      overworld_effect_start
Code:
0806844E         MOVS    R0, #0x11
08068450         BL      overworld_effect_start
(the numbers that "overworld_effect_start" uses are the same as for the do_animation npc script command)
overworld_effect_start has a script collection (081D96AC) with it's own bytecode (dispatch table is at 083CBE30). The commands in bytecode are:
Code:
0 load graphics
1 load palette (v1)
2 load palette (v1)
3 call asm
4 end
5 combination of 0 1 3
6 combination of 0 3
7 combination of 1 3

Effect 0x4:
Code:
07 083A5348 [b]080DB349[/b] 04
Effect 0x11:
Code:
07 083A5348 [b]080DB5F5[/b] 04
Part of the function called from animation 0x4:
Code:
...
080DB368         LDR     R0, =0x083A0010 @ array of pointers to object templates (see [url]http://www.pokecommunity.com/showthread.php?t=238937[/url])
080DB36A         LDR     R0, [R0,#0x10]  @ selects the array-entry for the normal grass
...
080DB378         BL      template_instanciate
...
Part of the function called from animation 0x11
Code:
...
080DB614         LDR     R0, =0x083A0010 @ array of pointers to object templates (see [url]http://www.pokecommunity.com/showthread.php?t=238937[/url])
080DB616         LDR     R0, [R0,#0x3C]  @ selects the array-entry for the tall grass
...
080DB624         BL      template_instanciate
...
Code:
083A5420 grass_normal:object_template <0xFFFF, 0x1005, unk_083A36F0, \
083A5420                                    off_083A541C, stru_083A53DC, \
083A5420                                    rotscale_table_empty, objc_grass_normal>
Code:
083A593C grass_tall: object_template <0xFFFF, 0x1005, unk_083A36F0, \
083A593C                                    off_083A5938, stru_083A58F8, \
083A593C                                    rotscale_table_empty, objc_grass_tall>

The last entry in this structure is the callback that executed once every frame. Those are almost equal except for:
Code:
...
080DB46C         BL      complex_function
080DB470         LSLS    R0, R0, #0x18
080DB472         CMP     R0, #0
080DB474         BEQ     loc_080DB48C
...
Code:
...
080DB71C         BL      put_0_into_r0_and_do_nothing
080DB720         LSLS    R0, R0, #0x18
080DB722         CMP     R0, #0
080DB724         BEQ     loc_080DB73C
...

To make the tall grass work, a function, equivalent to the one used in the function for normal grass, needs to be written at the same offset.

HOW TO FIX IT
Start overwriting at 08059f34 with 00 21 00 06 00 0e 02 28 01 d0 d1 28 01 d1 01 20 00 e0 00 20 00 21 70 47 03 28 f5 e7

eh 08059f34 0x2100
eh 08059f48 0x2100
eh 08059f4a 0x4770
eh 08059f4c 0x2803
eh 08059f4e 0xE7F5

Have fun and please credit me.

EDIT
If you want to enable the tiny grass too overwrite at 0805A0EC with 0C 30 09 E0. (It's mapped to behaviour byte 7)
 
Last edited:

Derlo

Tired....
135
Posts
16
Years
Man if there's one thing I always wanted to fix was that ...
Great job!
I wonder know if you have tried enable other animations from the 3rd generation? Like the grass with ash on it ...

I tried to do one thing:

08068402 MOVS R0, # 4
08068404 BL dp02_exec_aka_do_animation

This #4 refers to animations that will be loaded into tile ... I tried to change this for any other byte below #40. And what I got was that instead of the normal animation of grass other animations were loaded (in fact I think all the animation tiles had been carried).

For example:
* If you place a # 01, the animation will be loaded, is when we use the cut on the grass tiles.
* And if you put # 07, the animation will be loaded is the grass with ash on top (which I referred to earlier), merged with a setmaptile with some tile of the second tileset.

And so on ...

Maybe this way there is how to enable other animations or even create new ones.

Good luck and thanks!
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
I think that the ashgrass is also available via behaviourbytes but deactivated just like the tall grass. Finding a patch for that shouldn't be hard. I'll make one if I have time. And thank you Derlo for the animation-number of the ashgrass.
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
Patch for tall grass on behaviourbyte 0x03 and ash grass on behaviourbyte 0x24

eh 08059f34 0x2100
eh 08059f48 0x2100
eh 08059f4a 0x4770
eh 08059f4c 0x2803
eh 08059f4e 0xE7F5
eh 08059f50 0x2824
eh 08059f52 0xE7F3
eb 0806e820 0x04
eh 0806ebdc <special tile with ash>
eh 0806ebe0 <special tile without ash>
eh 0806ec00 <grass tile without ash>

You fix it with a hex editor, right?
Yes.
 
Last edited:

Derlo

Tired....
135
Posts
16
Years
Great job man!
It worked perfectly ..

I'm making a list of all the animations I've ever encountered.
When this is done, I'll post here.

Good luck and thanks.
 

r0bert

Quitifyingly awesome.
370
Posts
13
Years
I have a small problem:I'm using XVI32 and I can't find the offset.Should I use a different Hex-editor?
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
I have a small problem: I'm using XVI32 and I can't find the offset. Should I use a different hex-editor?

You can't even use a hex-editor correctly? I am disappoint. Sorry, I was in a bad mood when I wrote this.

I wrote addresses/pointers not offsets. In GBA the ROM Origin is 08000000. So if you want the offset you have to subtract this number from the address.
 
Last edited:

Derlo

Tired....
135
Posts
16
Years
Remember...
All of bytes, are written on the offset: 08068402. (Normal Grass)
And will activates when any OW steps on the tile.



01 - Animation of the HM CUT on the grass tiles. (Some leaves turning around the player)
02 - Same as before. (But without the animation of the leaves)
03 - Apparently nothing.
04 - Normal Grass.
05 - Ripple on the water when an OW step in puddles of water. (The animation appears only in these coordinates: x = y = 0d 13)
06 - Bar with a sprite POKEMON random. (The POKEMON that is shown depends on the coordinates X) [When load repeatedly times, Break the rom.]
07 - Grass with ashes on top, mixed with a setmaptile with some of the tiles.
08 - Loads the OW of HM SURF (pokemon in which the player stands on top in the water)
09 - Loads the HM SURF to the player.
0A - Dust when an OW performs a jump on the floor.
0B - Apparently nothing.
0C - effect when an OW performs a jump in the grass tiles.
0D - Footprints in the sand. (Animation is not complete, only one tile of the animation)
0E - effect when an OW performs a jump in the water tiles. (Splash)
0F - Apparently nothing.
10 - Splash of footsteps in the water.
11 - Apparently nothing.
12 - Another animation of grass. Very interesting ...
13 - Another animation of grass diferent than the previous. (The tile always gets excited. "shaking" lol.)
14 - Another animation of the grass #12. (The tile always gets excited. "shaking" lol.)
15 - A type of hole in the sand. [Possibly a WARP] (animated constantly)
16 - Submerge the water. [Possibly a WARP] (animated constantly)
17 - Apparently nothing.
18 - Same as # 0D
19 - Animation of Pokeballs in Pokecenter.
1A - 1D - Apparently nothing.
1E - Pokemon landing after using HMFLY. (The Standing animation always loaded in the player's position)
1F - 22 - Apparently nothing.
23 - BIKE Trail in the sand. (Animation is not complete, only one tile of the animation)
24 - Apparently nothing.
25 - Player using the Pokeball and POKEMON. (Possibly HM Strength)
26 - Player using the Pokeball and POKEMON. (Teleport to last WARP)
27 - Apparently nothing.
28 - Player using the Pokeball and POKEMON.
29 - 2A - Apparently nothing.
2B - Break the rom.
2C - Bar with Sprite POKEMON (Break the rom.)

2D - appears a drawing of a Pokeball in the left corner of the screen, then fades. (Possibly is not a tile)
2E - 30 - Apparently nothing.
31 - When we are sucked into the sand. (WARP)
32 - Splash water. (WARP)
33 - Animation SWEETSCENT.
34 - Apparently nothing.
35 - Bubbles on the floor.
36 - 39 - Apparently nothing.
3A - Leaves turning around the OW player.
3B - Bar with a sprit of a POKEMON.
3C - 3D - Apparently nothing.
3E - animation of the machine that records the data on FAMEHALL.
3F - Teleport to the center of the map.
40 - Apparently nothing.
41 - Animation VS.SEECKER. (Break the rom.)
42 - 44 - Apparently nothing.
45 - The screen flashes. (As a Flash)
46-9F - Resets the ROM or Break the rom.

EDIT:
A0-A1 - Resets the ROM or Break the rom.
A2 - Lock the screen, and the movements of the OW are slow.
A3-B7 - Resets the ROM or Break the rom.
B8 - Movement of the OW slower and damage their image.
B9-DD - Resets the ROM or Break the rom.
DE - Apparently nothing.
DF-E7 - Resets the ROM or Break the rom.
E8 - Apparently nothing.
E9-EE - Resets the ROM or Break the rom.
EF - Apparently nothing.
F0-F7 - Resets the ROM or Break the rom.
F8 - Apparently nothing.
F9-FF - Resets the ROM or Break the rom.
 
Last edited:

sonic1

ASM is my life now...
77
Posts
15
Years
That's the limit. There isn't more than that.

It is? Well, i'm not sure, but the command doanimation uses a word as parameter, not a byte. But i'm not sure, as there can be a table or something...

~Sonic1
 

Quilava's Master

Shattered Dreams '13
694
Posts
16
Years
  • Seen Aug 14, 2023
This is beyond incredible. I definitely wish to implement this in Shattered Dreams. What I love most is how easy it is to understand for anyone who's ever worked with a hex editor! Many thanks Knizz! But I do have a question regarding the ash grass. Will it work in accordance with the "Soot Sack" item in the same vein as it did in RSE?

Note: I would have tested this myself before asking but my laptop is out of commission right now.
 
Last edited:

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
It is? Well, i'm not sure, but the command doanimation uses a word as parameter, not a byte. But i'm not sure, as there can be a table or something...

~Sonic1

It is a table it is at 081D96AC. And it has 0x46 entries.

This is beyond incredible. I definitely wish to implement this in Shattered Dreams. What I love most is how easy it is to understand for anyone who's ever worked with a hex editor! Many thanks Knizz! But I do have a question regarding the ash grass. Will it work in accordance with the "Soot Sack" item in the same vein as it did in RSE?

Note: I would have tested this myself before asking but my laptop is out of commission right now.

I have no idea. I think this ash-grass doesn't even have pokemon encounters so it's at least broken in ONE way.

On the topic of animation ids, could you make a new tile that animates when stepped on?

Can? Yes! Want? If you pay me. I can give you a few tips though if you're serious about it. Contact me via email, PN, MSN or IRC.
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
excuse me for being noobish, but how can you activate the other animations?

Which other animations? You mean except for tall grass and ash? You can't. That'd require new patches. But no one wrote them yet. But lot's of animations are activated already. Just open AdvanceMaps block-editor and play around with the behaviour-byte.
 

shinyabsol1

Pokemon DarkJasper!?
333
Posts
13
Years
  • Seen Nov 23, 2022
So this activates the previously blocked tall grass animation...great! I'll try it when I have the time. Thanks!

One question though: does this mean the tall grass animation can now be edited into a new grassy patch animation?
 

knizz

192
Posts
16
Years
  • Seen Oct 28, 2020
So this activates the previously blocked tall grass animation...great! I'll try it when I have the time. Thanks!

One question though: does this mean the tall grass animation can now be edited into a new grassy patch animation?

When I said patch I meant "small modification".

You can replace the images used in the animation and edit their order. Just edit the corresponding "unknown_structure". (More infos in first post)
 
Back
Top