Double-speed Olmec and boulder
Verified against the spelunky.ai port v0.1.13 on .
Double-speed Olmec and boulder is a quirk of Spelunky Classic in which Olmec and the idol's boulder are moved twice each step, so each covers twice its speed.
Olmec and the boulder that the golden idol lets loose are moving blocks, which the game moves by their speed every step. Their own code then moves them by that speed again, so each covers twice the speed its code sets. Nothing on screen says so: it shows as an Olmec who flies faster than his numbers, and a boulder that rolls at 8 to 10 pixels a step where its code says 4.5.
What happens
#Olmec hops toward a player standing still. He leaves the ground at 8 pixels a step, where his speed is 4, and drifts left 4 pixels a step, where his speed is never more than 2. Over the player he stops, then slams down 10 pixels a step, where his speed is 5, and crushes him [1].
The player has taken the idol, and the tiki head drops the boulder onto him. Its speed is 4.5 pixels a step as it rolls off, and once it's clear of him it moves 10, 8, 10 and 8 pixels a step [2].
Why
#Each step, the game first moves every moving block (oMovingSolid, which Olmec and the boulder are) by its speed,
pushing and carrying the player [3]. Away from the player, that's the
plain move at the end:
else
{
x+=xVelInteger
y+=yVelInteger
}scripts/gameStepEvent.gml:215-219, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).Then each block's own step runs. Olmec's moves him by the same speed again, with moveTo, which stops at blocks:
if (carryPlayer or collision_rectangle(x-1, y, x+66, y+62, oPlayer1, 0, 0))
{
oPlayer1.x += xVel;
oPlayer1.y += yVel;
}
moveTo(xVel,yVel);objects/oOlmec/step.gml:3-8, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).The boulder's does the same [4]. Both moves turn a fraction of a pixel into whole pixels the same way, by the step's count [5], so in the open the two moves are the same and each covers twice its speed [6]. The game's other moving blocks, such as the Ceiling Trap and the Smash Trap, either only set their speed and leave the moving to the game, or move by variables of their own, so they move once.
Reproducing it
#It happens in every Olmec fight and to every boulder the idol sets off. In the first clip's replay, Olmec hops toward the player on frame 2908: his y goes 496, 488, 480, 472 on 2909-2912, with his speed -4 and slowing; his x goes 72, 68, 64, 60 on 2925-2928, with his sideways speed never past -2; and slamming, his y goes from 416 to 426 on 2954, with his speed 5. Gaining a fifth of a pixel a step after that, his speed is turned into 5 or 6 whole pixels for each of the two moves, so he falls 10 or 12 pixels a step. The slam crushes the player on 2964 [7]. In the second's, the boulder's speed is 4.5 from frame 813, and its x goes 118, 128, 136, 146, 154 on 817-821 [8].
In the port
#The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs [6], and the oracle's fingerprints of the two replays pin the moves. No option turns it off.
FAQ
#- How fast does Olmec move in Spelunky Classic?
He leaves the ground at 8 pixels a step, drifts across at up to 4, and slams down at 10, gaining to 12. His code sets half of each, 4, 2 and 5 to 6, but he's moved by it twice a step.
- How fast does the golden idol's boulder roll?
It sets off at 8 and 10 pixels on alternate steps, about 270 pixels a second, and slows as it rolls. Its code sets 4.5 pixels a step, which it covers twice.
- Why do Olmec and the boulder move twice?
The game moves every moving block by its speed each step, before the blocks' own code runs, and Olmec's and the boulder's own code then moves them by the same speed again. The game's other moving blocks leave the moving to the game, so they move once.
- Does it make Olmec or the boulder harder?
It's how they've always played: the speeds players know are the doubled ones. Code that reads their speed, such as Olmec's check for a slam, sees half the speed they move at.
See also
#- Related
References
#- Clip quirks/olmec-double-speed
- Clip quirks/boulder-double-speed
scripts/gameStepEvent.gml:23-233objects/oBoulder/step.gml:7scripts/moveTo.gml:22-36- Quirk 1 (docs/quirks.md)
- Replay
fidelity/replays/enemy-olmec-crush-seed-1.txt - Replay
fidelity/replays/trap-boulder-crush.txt