Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

'Tile Chaos': An obscure glitch effect - Page 1

'Tile Chaos': An obscure glitch effect

Posted by: Torchickens
Date: 2017-12-28 07:14:13
I like to call this effect "Tile Chaos". This effect has already been known and is caused by some glitch moves (their animation), as well as invalid D057 (Red/Blue) or D056 (Yellow) values greater than 01 and throwing a Master Ball.

Basically from what I gather the game attempts to play a glitch animation, but corrupts the screen causing many glitchy animated sprites to appear. If you have animations disabled you can avoid the ones caused by glitch moves.

Examples:

…On invalid D057 values:
https://www.youtube.com/watch?v=AOOymRAy_PQ

[img]https://i.imgur.com/XZiYWGt.png[/img]

(This is possible if an unterminated name glitch item corrupts that value to be greater than 02 and you throw a Poké Ball.

…On glitch moves:
https://youtu.be/fi6n84FgdiU?t=371
http://glitchcity.info/wiki/AttackDex/Y:184

[img]https://i.imgur.com/EMx5s9f.png[/img]

I think the Japanese glitch community may already have a name for this, so I may try to see if they have a name for it later. I also don't know whether Glitch City had a name for it when it did the old ItemDex had a name for it, as I've noticed it on one glitch move so far.

I don't know if there's any use for this but it's a nice effect to say the least.

Re: 'Tile Chaos': An obscure glitch effect

Posted by: 0ErrorYT
Date: 2017-12-29 00:29:27
Happens all the time to me when doing corruption, it's kinda annoying though as it soft locks/crashes.
I would of shared, but I thought most people on the site already knew.

Re: 'Tile Chaos': An obscure glitch effect

Posted by: RST 38
Date: 2017-12-29 11:58:42
I've decided to look more into it, so here you go.

Animation System
The animation system in Gen I games is based on command streams, a specialized assembly if you would like.
Every command is either:


Frame blocks are the stuff that build complex animations, an array of… not tiles, but gameboy sprites actually.
So you might ask:
Then why does the entire screen gets flooded with garbage, intead of just a few glitchy sprites floating around?
Well, remember that buffer overflows don't exist to GameFreak, so the DrawFrameBlock writes past OAM buffer and into the screen data.

Why does it happen when modifying D057 then?
It seems like some code responsible for preparing PokeBall throw animation,
doesn't properly initialize address D11E(wPokeBallAnimData in disassembly). This address determines two things:
the number of animations(4 if caught, 6 if not) in its high nybble + the number of shakes in its low nybble.

The high nybble ends up being zero.
And we all know that having zero as a loop counter right from the start in Gen I is not a good thing…
So, the TossBallAnimation function has an animation array that it iterates through and plays in this loop.
      Its contents: Poof Effect, Hide Mon Sprite, Shake, Poof on break, Show Mon Sprite
                          (later two if not caught, throw animation depends on ball type)

After it done iterating through this array, counter still has 250 animations!
Interpreting unrelated data as animation IDs doesn't end well, causing this effect.

More tehnical info probably comming soon

Re: 'Tile Chaos': An obscure glitch effect

Posted by: Torchickens
Date: 2017-12-29 13:39:22
Wow! This is really useful. Thanks RST 38 (and welcome to the forums).  :D

I'll go and add this to the wiki article.

Re: 'Tile Chaos': An obscure glitch effect

Posted by: RST 38
Date: 2017-12-30 09:17:33
First of all, the OAM overflow was just a hypothesis, I didn't actually check it yesterday because 12 PM is kinda late.
But, it turned out to be true anyways.

So, here you go, as promised…

More Tehnical Infoes
The whole animation system is pretty complicated and has some layers, so I decided to organise it as a tree


Fun fact: the corruption per one SubAnimation can reach up to:
$4 bytes/tile * $FF tiles/frameblock * $FF frameblocks/subanim = $3F804 bytes or 260100 bytes
In another words, one SubAnimation can overwrite the entire Gameboy memory… 3 TIMES

Also, I don't seem to find how to reference the attached image in the BBC tag "img".
Should I upload the image somewhere else first?
And the attachment got a little bit huge…

Re: 'Tile Chaos': An obscure glitch effect

Posted by: Parzival
Date: 2017-12-30 11:21:23
Like this:
[img=your-image.url.here][/img]
The tag only works if it's online somewhere.