Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitch
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Search Wiki

 

Search Forums

 

Author Topic: Changing encounter tables in r/b  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

Codabra

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Changing encounter tables in r/b
« on: July 02, 2017, 07:28:07 am »
Hello people of glitch city. I was wondering if it is at all possible to change encounter tables in r/b permanently. Also I'm not asking about the old man glitch that only gets you three. It's also highly limited.

Thanks!
I can't do any programming it's just computer mush to me. However I'll force you to teach me with my codabra powers.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Changing encounter tables in r/b
« Reply #1 on: July 02, 2017, 08:46:46 am »
"Permanently" changing the tables is trivial if you are ROM hacking the game, but if you want to "mod" the unmodified game to do just that, you will need ACE.
First, use an exploit like MrCheeze's virus (for the permanent ACE), and have the custom code do this : (written in C for better understanding)

Code: [Select]
struct EncounterTable {
  (...) /* Same struct as the game uses */
}

/* Used to store which maps are modded this way, and how they should be modded */
struct ModifMarker {
  char mapID;
  struct EncounterTable *ptr;
}


struct EncounterTable customTableRoute1 = {
  (...)
};

struct ModifMarker moddedMaps[] = {
  {
    mapID = 1, /* Route 1's ID */
    ptr = &customTableRoute1
  },
  {
    (...)
  }
};


/* Function ran by the virus's hook */
void customFunc() {
  for(int i = 0; i < (...) ; i++) {
    if(moddedMaps[i].mapID == *wCurMap) {
      memcpy(wGrassMons, moddedMaps[i].ptr, sizeof(struct EncounterTable));
    }
  }
}
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Codabra

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Changing encounter tables in r/b
« Reply #2 on: July 02, 2017, 08:51:58 am »
I mean by glitches I'm not making a Rom I have no understanding of programming at all contrary to my name
I can't do any programming it's just computer mush to me. However I'll force you to teach me with my codabra powers.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Changing encounter tables in r/b
« Reply #3 on: July 02, 2017, 12:57:33 pm »
Okay, so you would need a customized save file. It's a complicated process, mostly version dependent, so... I won't do it. Not motivated enough.

If you want to know :
1. It's possible
2. It's complicated
3. It's a *very* heavy operation. But it's possible.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Parzival

  • The Betrayed, The Cleansed, The Reborn
  • GCLF Member
  • *
  • Offline Offline
  • It begins.
    • View Profile
    • YT Channel
Re: Changing encounter tables in r/b
« Reply #4 on: July 02, 2017, 08:57:24 pm »
#movethisthread


 :P
Ask me about betrayal.
Ask me about depression.
Ask me about death.
Ask me about destruction.
Ask me about hardship.
I've been through s**t.
If you need to talk to someone, my PM inbox is always open.

I'm working with a small team on a few secret projects. I don't know when they'll be released, but when they are, they'll be below.


Codabra

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Changing encounter tables in r/b
« Reply #5 on: July 04, 2017, 03:45:25 pm »
So how would it be done?
I can't do any programming it's just computer mush to me. However I'll force you to teach me with my codabra powers.

TheZZAZZGlitch

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Unknown opcode fc at 801a
    • View Profile
Re: Changing encounter tables in r/b
« Reply #6 on: July 04, 2017, 05:54:41 pm »
It is possible with arbitrary code execution - a subclass of glitches that allows the player to run any code they desire on the console, essentially making it possible to do anything with the game. The most popular and most human-friendly method of acquiring arbitrary code execution on Gen I games is through a glitch item called 8F.

Once it's possible to run any code within the game, one might construct a stub of code that will run constantly in the background and would keep overwriting the encounter tables - just like a Gameshark would do.

Note that this isn't exactly changing the encounter tables "permanently". It only creates an illusion of a permanent change, by constantly overwriting the encounter tables loaded in RAM. If the save file is deleted, everything will be back to normal. Even restarting the game and reloading the save file would reverse the process. We can get around the second restriction by adding some extra code, but the first problem cannot be avoided.

There's at least one thing that glitches cannot and will never be able to do - permanently change the ROM. It's impossible to permanently modify the cartridge by just pure glitching. With enough work it's possible to simulate the ROM changes, by loading code into RAM and running it there - but it's still your original cartridge on the inside. Wipe the save file and everything will be gone.
qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF