Megaman style scrolling

BlitzMax Forums/BlitzMax Programming/Megaman style scrolling

QuickSilva(Posted 2008) [#1]
I`m trying to get an effect similar to the old NES Megaman games in that they smoothly scroll the play area like an normal 2D platformer but at key points they switch to a page flip style scroll. What would be an elegant way to mix these two styles together?

Here`s a video of what I mean.

http://www.youtube.com/watch?v=5SQ3Nww66v4

First sections use page flip scrolling then cleverly change to smooth scrolling. Megaman games use this technique quite a lot but I actually find it pretty hard to implement a mix of the two styles myself.

Any help is most appreciated,
Jason.


Yan(Posted 2008) [#2]
A page flip is just a smooth scroll with one large step, is it not?

[edit]
Ok, having actually watched the movie. :o/

It appears that it's using a simple loop to scroll the map for all vertical movement and a normal 'progressive' scroll for horizontal map movement.

Should be easy enough to replicate.

As an aside, I'm certain I've played Megaman but any memory of it has completely leaked out of my brain. 8o/
[/edit]


QuickSilva(Posted 2008) [#3]
That would be pretty easy I agree if the page flip was only on the verticals but it also happens at key points on the horizontal levels too although this is not shown in the video.

(My mistake, it is at about 1.40 just before the boss fight.)

Jason.


Yan(Posted 2008) [#4]
Oh yeah, I didn't notice that, my apologies.

Could you not simply have 'scrollControl' flags on your control/collision layer?


ImaginaryHuman(Posted 2008) [#5]
I don't see that it's difficult, basically you make an engine that does smooth scrolling. Then you give the player a rectangle of screen space within which they can move without scrolling occurring, you can make this rectangle whatever size you like. The player can move within the rectangle but when they get to the edges they `push` the scroll position. You can then make the rectangle 1 x 1 pixel and this forces the scrolling to lock onto the player position, or you can expand it to maybe a half of the size of the screen so the player can move around a little bit without scrolling but then when he gets nearer to an edge the screen scrolls with him, or you can make the rectangle the same size as the screen. When he gets to the very edge of the screen area, then, the screen would scroll - the only difference you have is that instead of the player pushing the edge of the screen, you consider it a special case and instead freeze-frame the player and animate the change of the scroll position from the player being at one side of the rectangle to being at the other, or however else you want to animate it.


computercoder(Posted 2008) [#6]
I see it like ImaginaryHuman does. I'd like to add you can place other points of detection in there as well. For instance, at the end of the area before the boss, the flip occurs. You could make it like that so that when you are at the end of the level and doing the pass into the boss chamber its set to always flip regardless of the direction. Use this with ImaginaryHuman's ideas, and I think you've got it.


QuickSilva(Posted 2008) [#7]
Thanks for the help everyone.

Jason.


MGE(Posted 2008) [#8]
Code a smooth scrolling tile map, everything else is easy once you get that going.


Grey Alien(Posted 2008) [#9]
Yeah why not just have a multi-directional smooth scrolling map anyway, like Turrican? Are you just trying to capture a retro feel with a more limited technical scrolling?


ImaginaryHuman(Posted 2008) [#10]
Yah one of the main reasons they used jump scrolling in the past was because at the time of the jump they can render the new section of the level into a semi-permanent buffer and would not have to keep drawing tiles every frame, since back in those days the backbuffer was totally preserved between frame flips. It was a way of cutting down on rendering time on very relatively slow cpu's/systems back then. You don't need it for those reasons anymore, and indeed can't use it that way anymore because backbuffers are unreliable after a flip. But if you're going for the retro feel or whatever, good for you.


QuickSilva(Posted 2008) [#11]
I just liked the way in Megaman games the technique was used to create tension before heading into a new area, but yes, a retro feel is what I`m after.

Jason.