• 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: [FR] More Map Event Objects

239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
The maximum number of object templates on a map is 64, yet Gamefreak decided to limit the maximum number of visible objects on the map to 16 for some reason. But what if you have a big map or intensive scripting event? createsprite is nice for temporary sprites, but they won't stick around after trainerbattles or warps. This project expands this number to 30 (29 including the player). It involves using some unused saveblock space to save the current map event objects and repointing gEventObjects (0x2036E38) and gMovementScripts (0x2039830).

Here's a GIF of a map with 17 event objects with events 16 and 17 being assigned a movement script (old lady) and a interaction script (tuber girl):
UNdmqxH.gif


Here is the repo. I've tested up to 20 event objects with weather without any bugs yet.

gMovementScripts is repointed to 0x203c000 by default, and gEventObjects to 0x203c078 by default. You can change these in src/defines.h and ./ram_repoints. These ram addresses are incompatible with most other hacks/projects (mainly the CFRU). gMovementScripts is 4bytes per event objects, so 120 bytes. gEventObjects is 36 bytes per event object, or 1080 bytes. I'm also pretty sure the ram doesn't need to be in the save data, as the event object states are saved to saveblock1. I've tested with non-save block ram with no issues so far.

Also note that this type of feature is much more easily implemented in decomps for those still wondering why they are so great.

Bugs: find a list of known bugs here. There are likely some limiter checks missing, and the Vs Seeker will still only search the first 15 objects still (this will require more ram repointing/vs Seeker re-structuring)
Credits: here is a list of credits.
 
Last edited:

Dr. Seuss

Will finish GS Chronicles, I swear!
523
Posts
10
Years
This is amazing! I made a berry passage in my hack and since the berry trees in my hack are overworld sprites I faced several issues with minisprites just disappearing. I'll check if it is compatible with my project.
 
239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
This is amazing! I made a berry passage in my hack and since the berry trees in my hack are overworld sprites I faced several issues with minisprites just disappearing. I'll check if it is compatible with my project.

The only compatability issue should be the RAM, which you can set to anything you like in ram_repoints and src/defines.h. I don't think it needs to .sav compatible, either, since I increased the number of event objects that are saved in the first saveblock. Currently the only caveat to this hack is that the game still only loads 16 palettes, but if you're planning on having a lot of the extra event objects be berries/trees you should be okay if they share a palette.
 
51
Posts
9
Years
  • Age 33
  • Seen Nov 18, 2023
Good job! Is compatible with Complete Fire Red Upgrade? Which ram offset should I use in the case?
 
239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
Good job! Is compatible with Complete Fire Red Upgrade? Which ram offset should I use in the case?

The default RAM values are not, but those are easily modified in ram_repoints and src/defines.h. If you are using JPANs saveblock hack, 0x203c000 - 0x203cec4 is open, you just need 120 bytes for gMovementScripts and 1080 bytes for gEventObjects. You can also likely use non-save RAM, as the event objects are loaded into saveblock1 upon saving. 0x203e000-0x203f000 is free if you remove the help system.
 

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
  • Seen today
I'm pretty sure you forgot about quest log which stores obj info in its own struct.

Check sub_815A008 and sub_815A1F8 for example.
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
I'm pretty sure you forgot about quest log which stores obj info in its own struct.

Check sub_815A008 and sub_815A1F8 for example.

Yeah, I found those in the past couple days, I just haven't pushed them yet. I still need to find limiters for all of the event palettes. This project will require a ton of repointed ram, so it may be best to save it for decomps, though.
 

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
  • Seen today
Yeah, I found those in the past couple days, I just haven't pushed them yet. I still need to find limiters for all of the event palettes. This project will require a ton of repointed ram, so it may be best to save it for decomps, though.

Yes. Rather than this, do you have interest in helping us with pokefirered?
It's already around 55% but currently not many people (only 2) are frequently contributing to it
 
Back
Top