Zoom out

Toranks

Active member
I have seen screen zoom-in effects in some games. But I have not seen zoom-out effects (increase the visible stage and make the characters smaller). I want when player 1 and player 2 move away from each other, the screen zooms out so that both players can be covered. Is there a way to make it possible?
 
Well... yes and no. You can have the effect, but no existing sprite games ever "zoom out". Let me explain. First thing to know is that zooming in is very simple:

[list type=decimal]
[*]Define a screen the same size as main display, and set it to duplicates all display contents.
[*]Lock the camera point (usually center of the screen or on a character initiating some big action).
[*]Set the screen's drawmethod to draw the screen at expanded size and you're done.
[/list]
You can slap a zoom in effect to any existing module in five minutes and it will look good.

Zooming out is a whole different ordeal. First, the screen you define to apply the zoom effect has to be proportionately larger than the main screen resolution. In other words, if you have a widescreen 480*272, and want your zoom out down to 75%, the screen must start at 600*340. No big deal really. But what happens when you actually apply the zoom? If your level isn't designed for it, you'll get huge areas of black boxing. To counter this, your level must be designed stupidly large, or scrolled vertically to keep areas in view while the zoom takes place. That's a ton of math, and existing sprite games (i.e. Neo-Geo) that do this never have more than a couple of background layers to worry about. An ambitious OpenBOR module probably has four or five minimum, and potentially dozens.

None of that covers mechanical elements. OpenBOR, and pretty much every sprite game relies on doing a lot of things just out of view. Spawning enemies, clearing out unused items, and so on. Changing what is visible to you doesn't do anything to change engine logic. You'll have to handle that on your own.

For these and lots of other reasons, the professionals never build games to zoom out. Games that appear to zoom out are designed with the maximum "zoom out" as their default state. When you play the game, they just start zoomed in, and revert back to give you the illusion of a zoom out effect. It's still not easy, but much simpler than starting with a zoomed in design and trying to go the other way.

Anyway - short version is yes, it is possible, but something few people will ever bother with due to the planning involved.

DC
 
Thank you. It was a request from my brother for a game that we are playing together, but what you say makes it not worth it. We will have to keep the characters close so that they can always be seen together and that's it, it is only a annoyance but also a challenge.
 
Back
Top Bottom