Zoom Out Woes

mersox

Active member
Hi guys. I am trying to implement a zoom out feature in my game, sort of what the Spider-Man arcade game had. Check it out at minute 2:30 --

https://www.youtube.com/watch?v=0_Y80vd0Qgk

However, in my case, when zoomed out the game doesn't show you a bigger field compared to when you play at normal size:

TMNT_Rescue_Palooza_0_9_1%20-%200013.png


Here's the zoom out "char" that I created and spawned in the level:

name zoomout
type none
subtype  noskip
setlayer 999
shadow 0

anim idle
loop      0
delay    10
offset    0 0
frame    data/chars/misc/empty.gif
@cmd setglobalvar "zoomentity" getlocalvar("self")
@cmd setglobalvar "zoomx" 0
@cmd setglobalvar "zoomy" 0

@cmd setglobalvar "zoomvalue" 260
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 250
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 240
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 230
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 220
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 210
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 200
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 190
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 180
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 170
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 160
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 150
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 140
  frame  data/chars/misc/empty.gif
@cmd setglobalvar "zoomvalue" 130
  frame  data/chars/misc/empty.gif


delay 1
@cmd  killentity getlocalvar("self")
  frame  data/chars/misc/empty.gif

EDIT: I forgot to clarify that I would like to be able to see the stage beyond the black bars... any ideas on what I can do to solve this?
 
I always believed that 2D games that boasted such features must be the pinnacle of programming wizardry!

This would be amazing to see in an OpenBOR game, but I've never seen anything like it yet.
 
oldmanwinters said:
I always believed that 2D games that boasted such features must be the pinnacle of programming wizardry!

This would be amazing to see in an OpenBOR game, but I've never seen anything like it yet.

If I'm able to pull it off, I will use this feature in a room of the Technodrome where you'll face the robots from Enter The Shredder :D
(as well as another top secret enemy that as of now only Powder knows about). If I can't pull it off... I guess I'll just reduce the size of the robots :/
 
the zoom out should be 100%, so start the stage zoomed in. otherwise there needs to be more in the image to zoom out too.


edit:

a rough example, the red is the zoomed in part, when you zoom out the entire map is seen.
2d_games_pixel_art.png
 
BeasTie said:
the zoom out should be 100%, so start the stage zoomed in. otherwise there needs to be more in the image to zoom out too.


edit:

a rough example, the red is the zoomed in part, when you zoom out the entire map is seen.
2d_games_pixel_art.png

The background I am using is bigger than what openbor shows. Using your example, if I were to zoom out, everything outside the red square would look black. It's weeeeeird, man.
 
Not sure, but I've messed with this before, OTOH, you can't go outside the original resolution the mod is at, so you are zooming the 320x240 allocated screen space, it will always be black outside this area. 

I don't think u can achieve what you want the way you're trying to do it.  :(

you have to be zoomed in on the red part to begin with, so you're reverting back to 100% zoom, not zooming out. 

MOD_0002.png

MOD_0003.png


- The stage images and chars could be re-scaled in this stage and mixed with zoom to get the desired effect you want.  (instead of just zooming out, 2x size everything first in photpshop)
- The entity controlling the zoom might work better as a screen panel entity, so it can be perfectly centered on the screen, instead of zooming on the player, like in my example.

 
BeasTie said:
Not sure, but I've messed with this before, OTOH, you can't go outside the original resolution the mod is at, so you are zooming the 320x240 allocated screen space, it will always be black outside this area. 

I don't think u can achieve what you want the way you're trying to do it.  :(

you have to be zoomed in on the red part to begin with, so you're reverting back to 100% zoom, not zooming out. 

MOD_0002.png

MOD_0003.png


- The stage images and chars could be re-scaled in this stage and mixed with zoom to get the desired effect you want.  (instead of just zooming out, 2x size everything first in photpshop)
- The entity controlling the zoom might work better as a screen panel entity, so it can be perfectly centered on the screen, instead of zooming on the player, like in my example.

I see what you mean and I was afraid this would be the case. Oh well. Thank you for your reply, BeasTie.
 
BeasTie is right, you have to plan around it from the start... and incidentally, this is true of ALL games that have that feature. You can't just build a normal level and zoom it out - resolutions don't work that way. You have to design the entire stage, if not the whole game around having this feature. That's true no matter what you're using. It's a HUGE PITA and why you don't often see it in 2D games.

At least with OpenBOR you can go in either direction. Most of the time developers were limited to one way or the other. The Neo-Geo is a great example - it could only go smaller, not bigger. "Zoomed in" sprites and stages were drawn that way, then scaled back down as needed.

IOW, yes you can do this with OpenBOR, and you've got it better than developers did back in the day, but it's still by no means easy and you'll probably have to start from scratch to make it work.

DC
 
@Ilu's, Did you use it in the level bigining ( zoom out) and special moves (zoom in) ?

I was thinking in something like  this video shows, its an exeple of zoom entity in construct 2,  im realy interested in something like this in openbor engine.

https://www.youtube.com/watch?v=xQtO5wkse7U
 
Having a level zoomed in would look pixelated then when you zoom out it would be normal. I think having a seperate level picking up where you left off would be better just resize the background and use drawmethod on heroes.
 
@kdo - yeah this can be done using the zoom script, you would just have to setup something to trigger the zoom at those parts of the map you wanted it.

@msmalik681 drawmethod won't scale the hit and attack boxes thou. :(
 
Hello guys...
Finaly i found a way to make this zoom in and zoom out trigger, im learning a lot traing to find the solutions, but i find a solution end with it comes new challenges.
But i notice some issue, if the screen is in zoom in mode and the player goes walking for a direction like up,down, right or left...if player goes out the zoom area some black borders is showed juts where the background should be.
So if the screens scroll out of zoomin area the screen get black.
Any idea to how to solve this?
 
My mod is  top down and has original grafics, the idea is make something like Hyper light drifter...
Just take a look at black boarders...

[attachment deleted by admin]
 
This happens thanks how the zoom code works. It creates a new screen to be drawn into, and the code creates a screen using the horizontal and vertical resolution. So, if you use a 480x272 resolution, it will create a screen with this size.

The solution I found is to make a bigger screen. I've tested on my game and it works.

Search for this line:
Code:
zoom_scr = allocscreen(openborvariant("hResolution"),openborvariant("vResolution"));

And change to:
Code:
zoom_scr = allocscreen(openborvariant("hResolution")*2,openborvariant("vResolution")*2);

Just remember: you need to have WHAT to draw. In other words, you need to make the background bigger than the walkable area/map (you can limit it using walls)

Take a look at the image bellow. At the right side, the engine have what to draw (the background). But at the left, there isn't anything (since the background is drawn from left to right)
C1CxxW7.png
 
Back
Top Bottom