24
edits
Changes
→Training Resources, Starting Pixels and Timings
Castlevania graphics are made up of foreground sprites (simon, candles, hearts, enemies) and background tiles. The game is building up these background tiles ahead of what is actually on the screen behind the scenes so that it can scroll smoothly as Simon moves. Around half a screen offscreen, the game is drawing a column two blocks wide. When that is complete, the game moves onto the next column. It looks something like this:
[[File:CV1_ScrollGlitch1. updated.png|550px]]
=== Tile Update Algorithm ===
We are now going to choose which actual blocks on the column will be updated. The game manages a special variable called the Block Counter that determines that location. This variable maps to the tiles vertically like so:
[[File:CV1_ScrollGlitch2Block_Counter_mapping.jpgpng|550px]]
The block counter has a value between 0 and 7, inclusive; however, only the values 1-6 actually map to blocks.
=== How non-glitched walking normally works ===
A player usually just walks in one direction for a while. As they walk through a new Column Update Window, the column 1.5 screens away starts getting updated. The Column Update Window is 32 pixels wide and we update tiles every other pixel, so we will run the tile upgrading algorithm 16 times (32/2). This will cause the block counter to go from 0 -> 7 and then 0 -> 7 again. This updates every tile value twice. Updating it twice doesn’t cause any harm - it just puts the same value there.
''NOTE - Technically there is a 50% probability of it being 15 times, not 16. This is because the first value is always overridden to 0. If that happens on the tile updating frame, the counter will still be held at 0. ''
=== What causes the scroll glitch to happen? ===
If the block counter is only updated every other frame, it seems impossible to actually make the trick predictable. Luckily, there is a neat math trick that solves this. This is best explained with an example:
If you move 1 frame, did you move the block counter? You don’t know. There is a 50% probability you did. If you move 2 frames, did you move the block counter? You moved the counter one and only one time with 100% certainty. This is because you either updated on the first frame or the second frame. It can’t be both or neither!
Note that these are simplifications. There are scenarios where you can do fewer turnbacks if you get lucky ( a combination of turnbacks being too short but getting lucky with the frame counter). In addition, you often want to execute extra turnbacks to raise consistency (discussed later).
''TECHNICAL NOTE - This is oversimplified. There are some details around having an odd number of pixels on the last walk forward that leads to one extra counter iteration. I don’t think this is a missing aspect of the algorithm, just some tricky off-by-one math. I got frustrated and stopped trying to nail it down exactly. ''
=== Scroll Glitch Execution Approaches ===
For all strategies, there is an important starting pixel where you want to start your turnbacks. This is the pixel that will have the block counter 1 below your target block regardless of whether. You can find this pixel with visuals for each of the level 5 tricks at: https://castlevaniaspeedrunsfurther down this page.com/Cv1/level5
=== 2 - 14 Turnback Method ===
Unfortunately, this approach does have a few downsides. First, each turnback will cost an extra 4 frames. In addition, you will often have to do one extra turnback relative to the two pixel turnback. If targeting block 2 or 3, I would recommend 4 turnbacks. Anything below that, I would recommend 3 turnbacks.
=== Training Resources , Starting Pixels and Timings ===
ROMHack - A romhack is available on the CV1 discord. When used, it will print out Simon’s pixel coordinates. In addition, it will print the Block Counter.
The starting pixel coordinates for the scroll glitches are:
{| class="wikitable" style="margin:autoleft"
|+
|-
! Header text Stage Number !! Header text Pixel !! Savings**
|-
| Stage 6 Crusher || TO FILL IN 1D9 & 1B9 || ~ 9 sec
|-
| Stage 13 7 Coffee || A4 255 & 1F9 || ~ 1.4 sec
|-
| Stage 14 Wall 13 Griddle || 328 A4 || ~ 12.5 sec
|-
| Stage 14 Ceiling Drop Bacon || TO FILL IN45C or 43D || ~ 3.5 sec
|-
| Stage 14 Advanced Egg || 2C4* || ~ 6 sec
|-
| Stage 14 Cheese || 328 || ~ 8 sec|-| Stage 14 Race || 21C || ~ 8 sec|-| Stage 17 Clocktower || TO FILL IN 219 & 1FB || ~ 6 sec
|}
<nowiki>*</nowiki>Touching pixel 2B9 is needed before turning around
<nowiki>**</nowiki>Timings are approximate, also you may not see the same time savings if you don't play the rest of the level as optimal as your prior splits, example the 12 second saving of Stage 13 might turn into 6 seconds if you missed other things in level 5.
Stage 13:
Start on 7A turn around, backwards jump and turnaround to land on A4 -> A1. The a 14 frame Walk to B0 then B0 2 frame turnaround AE. Then a 14 frame walk end on BC quick left turn around (between 2-5 frames?) and then walk right.
[[File:CV1_13-SG-1.png|250px]]
[[File:CV1_13-SG-2.png|250px]]
[[File:CV1_13-SG-3.png|250px]]
[[File:CV1_13-SG-4.png|250px]]
Stage 14
Start on 2FE then backwards jump and turn and land on 328. Whip turnaround 328 -> 326, then move to and do a whip turn around 334 -> 332.
[[File:CV1_14-SG-1.png|250px]]
[[File:CV1_14-SG-2.png|250px]]
[[File:CV1_14-SG-3.png|250px]]
=== Emulator Training Tools ===
I have created a set of scroll glitch training tools (along with other cv1 helper tools). These currently require using bizhawk, although I will likely port to other emulators in the future.
https://www.speedrun.com/cv1/resources
Helpful tools included are:
1. Create lines onscreen to show turnback locations
2. Auto-death tool - kills you if you miss a scroll glitch
3. Turnback-Turnforward diagnostic printout (to highlight if you really are hitting 2-14 or 4-12)
Note, if you are using original hardware, the above tools may be a little annoying as the input latency is different. I would still recommend trying them though as many scroll glitch execution strategies are not latency sensitive.
=== Rhythm Sounds ===
If you are trying to learn a whipless rhythm approach, sounds can also be a helpful aid. You hit the buttons on the appropriate beat. Every frame is 1/60th of a second (technically 1/60.09), so you can use that to create a beat. One style is to do 4/60th of a second followed by 12/60th of a second. Another is to just have a metronome set to 16/60th of a second and time either your forward or backward presses to that beat.
Below are two videos with rhythm of whipless scroll glitch turnbacks for 4-12 pattern. To execute 4-12 wiggles, do a turnback on the short note, and move forward on the long note.
{{#ev:youtube|Zn2FFhDc5WE|550}}
{{#ev:youtube|-WG7e4nAnp4|550}}
=== Acknowledgements ===
InfoManiac
Originally discovered the scroll glitch. The initial method only worked on TAS
Challenger
Implemented almost all the current scroll glitches in TAS that have since been ported to RTA by others.
NatGoesFast
Accidently did a scroll glitch on stream. An investigation of this led to the whip based RTA strategy discussed above.
SBDWolf
Found the whip based RTA viable approach for stage 13 and stage 14. Also figured out probably 75% of the basic block updating algorithm and RTA strategies such as odd/even frames approach. Also was the first person to use these scroll glitches to get WR. (May have also found the crusher room scrollglitch).
Shockratease
Along with SBDWolf, did extensive investigation and teaching on the scroll glitch. Suggested using 16/60th beats instead of two-part beats.
Kajong0007
Created the Romhack mentioned above, which has been used extensively by runners to better learn the trick.
JayCee
First person to remove whips for turnbacks and use it in runs. The removal of whips also enabled a lot of additional scroll glitch areas (crusher, clocktower) which did not seem viable otherwise. This inspired additional scrollglitch innovations.
Trisk (tr1sklion)
Wrote this document. Found the Block Counter and Column Update Window in the game bytecode. Validated and enhanced the earlier algorithm approximation SBDWolf modeled. Wrote the Bizhawk training tools. Pioneered the 4-frame turnbacks strategy and most correction strategies.
== Videos ==
SBDWolf talking about the scroll glitches
{{#ev:youtube|rmlBCzdVlOc|550}}
{{#ev:youtube|yaRmDa_T-oo|550}}
Here's Shockra Tease talking about both Scroll Glitches
{{#ev:youtube|Dw7NkOzp8tE|550}}
Advanced Stage 14
{{#ev:youtube|zxLs7h2cL6Y|550}}
Displaced Gamers Video on the code
{{#ev:youtube|wd18YNZB0D4|550}}