Vertical Scrolling Technical Question

Back in the day, when men or where men and sheep where scared, we had the vertical scroller, e.g 1943 springs to mind, these sort of games have gone out of fashion, but as I’ve been reminiscing, and playing some old classics on my “Super Console X” I bought recently, and I been looking for a new idea to prototype and possibly go further with, as I’ve started things in the last year but found them a little lacklustre, so they are on hold.

So this is what I have I made a so far “see screenshot”, I made a series of tiles 16x16, in Photoshop and created some code to define a play area if you will, based on the width of the device, this always shows the play area in portrait mode, with effectively no edges.

But here is what I weird about, as this is a scrolling background from top to bottom, there could be thousands of tiles that would make up the play area scrolled in effectively a single line at a time.

Is this cost-effective for a mobile device, and will the FPS still be high enough? I’ve also thought of doing the following.

A) – It would be best to move all visual tiles in a single pass and the tiles that where just off the viewport, this could be done several ways but in a parent GameObject would be the easiest e.g just move that would effectively move all other tiles present.

B) – Have some sort of pooling system so it would use tiles from the stack and not instantiate a bunch and then destroy them afterwards.

C) – Only instantiate/active the tile “line” that is just off-camera, and not all tiles that are needed for the play area.

D) – Could a texture2D be used, for example, paste the sprites on a texture and scroll this, or just use a Photoshop created map? I do use my own Tile Editor and that can save the tiles as a single png, but in your option would this be cost-effective on memory etc.

Any advice would be greatly appreciated

So what I believe you are saying is that there is one screen background that you want to recycle? Then it would be best to move the bottom row to the top in order while they’re are just out of view; always reusing the same tiles to give the appearance that the background is infinitely looping while only using slightly more then is needed to be on the camera.

@adehm

It’s funny sometimes you design things in your mind or on paper, that are backwards in thinking, after I wrote this post, and went away, I had a slap forehead moment, why did I think of moving the Tiles(GameObjects), when moving the camera was so much better, effectively A/B are now redundant.

I’ve been trying to figure out different idea’s whether they are on paper or using something like “trello”, or “hack a plan”, instead of just jumping into coding, after 5 years of unity I’ve learnt a lot and prototyping a proof of concept or idea’s is hugely beneficial, usually, the one major factor of projects not getting finished is the programmers’ inability to code their idea’s in the first place and yes I have projects like this myself “from years back” or they just got boring after 6 months of work, but all that is for another time I think.