Pages: 1
Posted on 05-13-13, 08:51 pm (rev. 6 by  MeroMero on 10-07-13, 03:53 pm)
Death by cuteness

Karma: 6574
Posts: 9/598
Since: 05-01-13
Suggestion in the title already.

I know I may come as arrogant to ask you something like this because I'm a new member but it would be really neat if you could implement this (especially for the zoom since it is one of the most difficult sprite to understand and manipulate imo).

Anyway I will share my finds.

NOTE : All the units used here are in tiles (as a reminder 1 tile = 16 pixels).

Sprite 245 first.

Pretty easy here, the pump's position as well as its movement range are simplified by a 1x1 square (position) and a 16x16 square (range).

(nybble 7=0, nybble 9=0) The black 1x1 square can take any of the 256 positions within that white 16x16 square.
(nybble 7=1, nybble 9=0) The red 1x1 square can take any of the 256 positions within that red 16x16 square.
(nybble 7=0, nybble 9=1) The green 1x1 square can take any of the 256 positions within that green 16x16 square.
(nybble 7=1, nybble 9=1) The blue 1x1 square can take any of the 256 positions within that blue 16x16 square.

Here the 4 mini-squares have both nybbles 8 and 10 at 0, of course changing the nybble 8 will place those squares higher and the 10 will place them farther on the right.

That's it for this sprite.

Now onto the sprite 84 (the more complicated one).

x=nybble 6
y=nybble 7
z=nybble 10\2 (yes \2 and not /2)

In-depth analysis :

The active range (highlighted here in red and green) is always a zone whose equivalent area can be calculated by the following formula; 2y*(x-z).
Exceptions :
_if x=0 then the active range will have an "infinite" width;
_if y=0 then the active range will have an "infinite" height;
_if both are 0 then the active range will have both an "infinite" width and height;
_and if somehow z>=x with x!=0, then congratulations you got yourself a useless sprite since the resulting zone will be 0 tile² and thus the zoom will never activate.

Notice that the only case where you can manipulate the zoom while being under the sprite is when the y setting is 0, otherwise the zone is ALWAYS above the horizontal axis.

Red zone will always be left to the vertical axis.
Green zone will always be right to the vertical axis (it's actually no more no less than the flipped image of the red zone).
Entering the red zone will trigger the zoom left (nybbles 8-9).
Entering the green zone will trigger the zoom right (nybbles 10-11).
Red and green zones can't overlap (due to their symmetrical natures) and at most they may have 1 common boundary, and that's if z=0 (the rightmost part of the red zone with the leftmost part of the green zone).

When entering an area, if a sprite 84 is present, it will be in a dormant state so to activate it you MUST enter in the red zone.

The zoom will only works if Mario is in the zone AND if he is close enough to the sprite, even if the range is set to have an "infinite" width and/or height.

Zoom (left and right) can be any value between 0 and 255, doesn't matter since a modulo 32 is applied to the result afterwards (well it technically still matters for the zoom right due to that z-value at nybble 10).
By default the camera's zoom-setting is always 16, regardless of the presence or not of the sprite 84.
The zoom value is actually the width (in tiles) rendered by the camera.
Width:height ratio is always 4:3 so it means that to keep the best results it is recommended (though not mandatory) to fill both zoom values with numbers divisible by 4.

As said earlier you can put any value between 0 and 255 inclusive but bear in mind that there are 3 limiations outside of the modulo 32:
_if zoom%32<8 then the result is rounded up to 8;
_if zoom%32>24 then the result is rounded down to 24;
_and if zoom%32=0 then the camera will use the last non-zero zoom-setting.

I though it would be smarter to make a topic rather than explain all of this in the sprite database since this sprite is definitely a pain in the ass if you don't know how it works, and I myself think having a visual of that sprite would be beneficial for everyone.
With all this new information, we can now achieve somewhat cool zooming-out effects like in NSMBU's Tilted Tunnel.

And done.

I hope that the data came as transparent as possible, let me know if something didn't came accross as clear.
Posted on 05-14-13, 05:20 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10020
Posts: 3317/4457
Since: 06-08-11
Wow you've got some interesting investigation here. Thanks a lot.

We'll definitely add visual representation. The first INE is easy. The second one I'm not very sure how to represent it. It should draw the activation areas, but then What about the zoom factors..?

Also its a shame it won't let you place the pipe with the cork *under* the inflator thing. It would be really cool, it would propel you up probably.
Posted on 05-14-13, 07:47 am (rev. 1 by  MeroMero on 05-14-13, 12:48 pm)
Death by cuteness

Karma: 6574
Posts: 10/598
Since: 05-01-13
Thanks for the feedback.

It may seem obvious but still it's good to specify that the red and green can't overlap of course and at most they may have 1 common boundary, and that's if z=0 (the rightmost part of the red zone with the leftmost part of the green zone), first post have been updated.

For the zoom, you're talking about the nybbles 8 to 11 right? Then I say leave it as-is, I can't think of a good way to visually represent a zoom value, nevertheless it will still be good even without those values.
You just have to remember that those values represent the width in tiles used by the camera, multiply by 0,75 to get the corresponding height and you're good to go.

For the cork-pipe, Well even if you can't put the pump directly above the bung, you can still jump on it provided you are fast enough (try my level 2-3 to see what I mean).
Posted on 03-30-14, 11:38 am
Fuzz Ball
KirbyFanatic64 (LOL)

Karma: 1361
Posts: 768/950
Since: 11-13-11
This thread answers my problem with Sprite 84 clearly. Nice investigation!

Great games must be fun, not fancy.

Music Hacker needed! PM me if you wish!
Pages: 1