The (Pixel) Perfect Guide
(Original animation by Poldi here: http://forum.kingoft...d-geffi-sprite/)
This guide will explain what pixel perfect jumps are and how they are different from other jumps. Hopefully a better understanding of pixel perfect jumps will help everyone. I will include a useful little trick that can mostly be used to help save saw jumps later in this guide.
Special thanks to Fezzik, for his great arguements, (counter-) examples, videos, images (especially the non-blurry merged pictures), and setting up testing in his bases.
- (5 images, 5 GIFs) Physics: Explains how the game works
- (0 images, 7 GIFs) Definitions: Explains and clears up what is what and why.
- (0 images, 8 GIFs) Pixel perfect jumps: Kind of trivial what this is about.
- (0 images, 8 GIFs) Path dependent jumps: Similar to the previous section.
- (0 images, 7 GIFs) The inline saw saving guide: A little help to save those saw jumps.
- (1 images, 9 GIFs) Exceptions and special cases: Nifty cases, hopefully super interesting.
- (1 images, 6 GIFs) Exceptions and special cases (part 2): More nifty cases and super interesting stuff.
- (1 videos) Video guides: Skip to this section if you are interested in learning a variety of paths.
All of the GIFs (moving images) are hidden in spoilers to help minimise data traffic. On average they are 4-8 Mb each. A Wi-Fi connection is recomended.
First, I will explain the current physics the game uses. Lets start from the beginning. Phones, tablets, and monitors have screens that are composed of pixels (little tiny squares that only colour a portion of the image). However there are many variations of the screen sizes, so the game physics cannot be based on pixels, otherwise there would be a lot of problems.
This is how your thief looks if you take a closer look at the pixels it's built from:
However, to be fair for everyone, the game uses a higher level structure to form its physics. The game actually runs itself on a different model, and then projects itself into the form of pixels. So to understand the game, we must examine how exactly it is built up from basic elements.
Any space where the thief can move (dungeon, maze, etc.) is made up of a grid. All the elements (square/location/position) of the grid can be defined with a set of coordinates. Here is an example of how that would look. (Obviously the game uses a denser grid, so it can draw smooth, small objects).
This grid is the basis of the physics, everything is calculated here, and then projected onto your screen. That is why there are very few jumps where you are visually in the air, but you can still jump.
Now that we have a grid, we can put objects in it. I wont really be talking about traps, since they are pretty straightforward and cannot be manipulated. So we can pass traps, platforms, and gravity switches and get right to the thief. The thief can move in two dimensions. Up/down and left/right. Any other visual effects (ie. a parabola of a jump) is just a combination of these two.
Once the game is in a position, and has all the data (ie. did the player jump?), it will refresh. However, this does not happen once every second, or the game would be very laggy. Instead, it refreshes multiple times every second, and stays in that condition until next step. This condition is called a frame. Therefore, the game constantly goes from one frame to the next, calculating what to do in between. When I am talking about frames, I will assume all the information not stored in just the image, such as the speed and direction of objects, is available for ongoing calculations. (Therefore It will be more similar to states, than simple images.)
(The short version: Frames will be used to describe the dimension of time in the game.)
Movement on the X axis: The thief has a constant speed. Horizontally, it is always moving, unless there is an obstacle in its path. For demonstrative purposes, we could say the thiefs' X coordinate grows by 6 in every frame. The current existing models we have suggest there usually is no acceleration on the X axis.
Since we are talking about movement/frame ratios, this image will help demonstrate that the thief doesn't actually slide, but "teleports" continuously in a line. This is the root of all path dependent & pixel perfect jumps.
However, when the thief jumps, it slows down horizontal movement a little (This probably happens during taking off from the ground and while landing on the ground). This means that there are exceptions like jumping or contact with objects (ie. walls) which may nudge the coordinates a little. Also, when the thiefs' head bumps into the ceiling at the peak of his jump, it will look like he gets a tiny "boost" in his X axis trajectory, while hitting the ceiling too early will make the thief start falling very fast (Example is given later). The jump when the theifs' head scrapes the ceiling can be called a max length jump. This name comes from the fact the thief jumps from the highest point on the wall that doesn't get effected drastically by the cieling, allowing the maximum distance to be travelled horizontally.
Example: Thief speed vs. cannon bullet speed
Movement on the Y axis: The thief has a constant speed of 0 on the Y axis. When the thief jumps, it starts with a speed going upwards. However, there is a form of gravity in the game, which behaves like real gravity. I'm not going to go into a physics lesson here. Another tip: while sliding on walls, the thief is locked into certain Y axis coordinates. That means walls can be used as great starting points for tight jumps.
Example: Ceiling effects
Corner physics will not be explained because superjumps are now impossible to save. Due to this, corner physics are quite simple now. Also explaining the rare bugs that can still happen would over complicate this thread.
Lets summarise all this with an example that shows how the coordinates of the thief are effected.
Lets assume the following rules are the physics (all of this is just representative)
- The thief has a constant X axis speed of 5 squares per frame.
- At the moment of jumping and landing, the thief gets -1 square on the X axis
- A jump lasts 2 frames, and it has a max height of 5 squares
These imaginary rules and numbers are far from what really happens while jumping, but it will help understand sufficiently because it is very simple.
Situation 1: This is the path for passing a saw jump.
Situation 2: And this is a path that fails on the saw jump. The thief would not survive the last jump here
Basically, there are a bunch of numbers. If you look really hard, you can even find a small inconsistency, but lets just leave that for the attentive. In the second picture, the thief ends up two squares left of the coordinates of the first picture. This is caused by the extra jump.
To summarise, every time the thief jumps, his X axis coordinates are moved a few squares out of sync. This tiny difference could be what makes or breaks any jump.
Now that we (hopefully) understand how the thief behaves in dungeons, lets define some expressions I will use in the guide. This is necessary, so that this thread can be clear, understandable, and arguable.
Edited by Oliver666666, 13 February 2017 - 10:49 AM.