Tweaking



Tweaking is a glitch exclusive to the core series Generation IV games that causes the game to improperly load the graphics of an area. It is also sometimes referred to as holepunching to commemorate its discoverer, a GameSpot forums member by the username of "Holepunch".

Cause
All maps in Generation IV are broken up into square "sections" or "chunks" 32 tiles by 32 tiles across. At any given time, only four sections are loaded and visible: the section the player is currently in as well as two sections orthogonally away and one diagonally away, depending on which of the current section the player is in. (For example, if the player is standing in the northwest quadrant of their current section, the sections to the north, west, and northwest will be loaded.) "Load lines" exist halfway across each section at the boundaries between quadrants, so named because when the player crosses over one, the sections in that direction are loaded into memory, while the sections behind the player are unloaded. Through this, the overworld appears seamless.

Using the Bicycle in the fourth gear, however, can cause the player to move too fast for the game to load the areas properly, especially if one changes direction several times while near the intersection of two load lines, thus loading and unloading multiple sections over and over nearly simultaneously. Doing so triggers a bug, causing sections to load improperly. The effects can vary from a game freeze, invisible walls, a completely black area, a completely white area, a change in the location, or even a completely different section fully loading in the wrong place.

The distortion caused by tweaking can be solved easily by crossing a load line away from the distortion, causing it to unload. When the section is loaded again, it will be normal. It can also be solved by looking at a different menu screen such as the Pokédex; upon closing out of the menu, the areas will be properly reloaded.

While tweaking using the bicycle in the fourth gear is the most common method to perform tweaking, the same effects can also occur using only the third gear, although its applications are not as versatile. It is even possible for some limited effects to occur simply by running (as well as ing in, which is at the same speed), mainly invisible walls and Z-axis changing rather than more drastic changes.

Patterns


In the image to the right, the blue lines represent load lines (thus this is the center of a section) and the numbers represent tiles that the player can walk on. (For example, taking one step east from 1 will bring the player to 2, crossing a load line in the process.)

In all patterns detailed below, the patterns can be flipped and rotated to produce displacements in different directions.

Orthogonal displacement
"3124343" (fast bike): Nicknamed a "zorch" after its discoverer, this was the first reliable tweaking pattern ever discovered. It causes the section east of the player to load as a black area onto the section west of the player. Obsoleted by the later-discovered "shortzorch".

"42121" (fast bike): Nicknamed a "shortzorch", this has the same effect as a zorch.

"31213" (fast bike, Platinum and HG/SS): Causes the section east of the player to fully (visibly) load onto the section west of the player. This pattern causes a crash in Diamond and Pearl because of a difference in bike speeds.

"42131" (slow bike, running and surfing in Platinum and HG/SS): Causes the section east of the player to become either a black, walkable abyss with the same collision and unloaded or partially loaded NPCs (slow bike), an unwalkable but visible abyss with unloaded or partially loaded NPCs (running) or a walkable, visible section with unloaded or partially loaded NPCs (running). Both effects caused by this pattern when running can also be done using the "1242131" pattern.

"421312D21" (fast bike): Causes the section south of the player to fully (visibly) load onto the section north of the player. The "D" in this pattern represents the tile to the right of 2.

Diagonal displacement
"12421" (slow bike): Causes the section northeast of the player to fully (visibly) load onto the section northwest of the player. Possible with only the third gear bike since sections diagonal to the player are farther away and load last, making it easier to interrupt the process.

"1242131" or "13431" (slow bike): Causes the section southwest of the player to visibly load onto the section northwest of the player as well as an unwalkable abyss to the north of the player if you're using the "1242131" pattern.

Shortcuts
Depending on the layout of a section, it may be possible to tweak in such a way so as to load a walkable area (either black or visible) onto a section that does not normally contain walkable surfaces. This allows for a number of shortcuts, such as skipping Tohjo Falls and therefore in  by loading a walkable area onto the section where the ledge on Route 27 would normally be. In sections containing buildings that are blocked off by NPCs, it is possible to enter them by tweaking a Z-axis change, allowing the player to walk under or over the tile the NPC would normally occupy. Two examples of minor shortcuts or sequence breaks using this method include obtaining access to Mystery Gift in before the first badge by bypassing the clown blocking the Jubilife TV front door, and completing Azalea Gym before Slowpoke Well by bypassing the Team Rocket Grunt in front of the Gym (though this by itself does not allow Slowpoke Well or Rocket Executive Proton to be skipped entirely, since the game does not trigger the  event that gives the player  unless Proton has been defeated).

These types of shortcuts are possible in all Generation IV games.

Void glitch
The void glitch is a specific application of the tweaking glitch only useful in. First, the player must tweak a black area onto a section that would normally contain buildings, making it possible to walk through their improperly loaded walls. Then, by standing exactly one tile above the entrance to a building, reloading the area, and walking south, the player can end up on the interior map of the building, but in the black void area around the normally accessible portion, similar to the Surf glitch. As with the Surf glitch, it is then possible to navigate through the interconnecting area of this void to normally inaccessible locations, such as Newmoon Island and the Flower Paradise where the event-exclusive and  reside.

Traveling a multiple of 65,536 steps in the void will cause the game to no longer display only black, but rather start copying the map data of normal areas due to an overflow after attempting to load data past bytes (each map tile takes up 65,536 bytes). Only the visual data is loaded like this; almost everything can still be walked through just as in the rest of the void. These areas are nicknamed "Fake Sinnoh" or "Fake Johto/Kanto". 'Fake' regions continue to repeat every 65,536 steps and are about an hour apart when traveling on the Bicycle in fast gear.

As part of the paths to access Darkrai and Shaymin, the player is required to save the game in the void, so the same risks associated with the Surf glitch occur here, such as becoming trapped without a method of escape. It is also possible for, in the worst possible circumstance, the game to immediately freeze upon loading the save file, forcing a new game to be started. This can be tested for however by opening and closing an option on the menu such as the bag (usually referred to as a Black Screen Of Death test), as the game will freeze upon closing the selected menu option, preventing your save from being damaged.

Other notable areas known to be accessible through this glitch include the Hall of Fame, 's room in Turnback Cave, Valor Cavern, Acuity Cavern, the second to last room in Galactic HQ, Spear Pillar and any route, town or city in the game either by using Fake Sinnohs or the Battle Tower void.

After the discovery of the Darkrai and Shaymin paths, it was believed (though not conclusively proven) that the Hall of Origin was inaccessible through this glitch, as it is a closed-off indoor area without a single accessible entry warp, thereby making it almost impossible to safely locate in the void compared to outdoor areas and indoor areas with many warps such as Turnback Cave. It was also known that, unlike Newmoon Island and Flower Paradise, simply finding the Hall of Origin would not allow the player to battle, due to a set of reasons involving map scripts as detailed here. Due to the combination of these two factors, it was believed impossible to catch Arceus through the void glitch for several years. A method to find the Hall of Origin was not discovered until January 2017, by relying on relatively extensive methods to be able to dynamically control the layout of areas in the void. The Pal Park Retire glitch was documented soon afterward, allowing the player to manually activate the script that causes the player to challenge Arceus, finally enabling Arceus to be caught. The currently documented method to catch Arceus involves reaching the Hall of Origin map while still in the void; there is currently no documented way to see the full, visible Hall of Origin (the way it appears after using the Azure Flute).

In, , the void is filled with invisible walls that will trap the player if they go more than a few steps into the void, making it no longer legitimately possible to navigate through its areas, though the void itself is still possible to enter. Currently the only known way to bypass these invisible walls and proceed through the void is with a "walk through walls" cheat code. As a corollary, a "walk through walls" cheat code is the only way to see "Fake Sinnoh" in Platinum, and "Fake Kanto/Johto" at all (in HeartGold and SoulSilver). In addition, in Platinum, Darkrai and Shaymin will not appear in their respective areas unless the player has obtained the proper event item.