Jump to content

Photo

How do Coleco games smooth scroll?


3 replies to this topic

#1 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,358 posts

Posted Thu Oct 11, 2012 8:24 AM

By some happenstance I went from playing WonderBoy on the SG-1000 and then Super Cobra on the Coleco. I noticed Super Cobra did not do that chunky tile-by-tile scrolling. It actually seemed to smoothly scroll horizontally. How do Coleco games produce the smooth scrolling effect? Which games do it?

#2 ColecoDan OFFLINE  

ColecoDan

    Stargunner

  • 1,832 posts
  • Location:Illinois

Posted Thu Oct 11, 2012 8:33 AM

One of the homebrew guys would be better answering the technical aspects. I believe it has mostly been done by saving all the different screen changes that the scrolling would need.
Most of the smoother games are homebrew games and WonderBoy is supposedly coming out this year or next year from Pixelboy so you can compare between the two versions since you played the SG-1000. I believe it is a port from that version.

#3 Pixelboy OFFLINE  

Pixelboy

    Quadrunner

  • 8,242 posts
  • Location:Montreal, Canada

Posted Thu Oct 11, 2012 8:57 AM

As Dan said, it's mostly done by updating static tiles in VRAM to "fake" a scrolling effect.

Let's say you want to scroll an 8x8 piece of background in increments of 2 pixels horizontally. You would define that piece of background in a tile, then you would use two other (different) tiles to draw that same piece shifted 2 pixels to the right (or left): One tile will contain 25% of the piece, and the other tile will contain 75% of the same piece. Then you would use two more tiles to do another shift: One tile will contain 50% of the piece, and the other tile will contain the other 50%. Add two more tiles for another shift (One tile will contain 75% of the piece, and the other tile will contain the remaining 25%) and you have all the tiles you need to create your scrolling effect, you just need to display the appropriate tiles at the appropriate time to create the illusion of scrolling. As you can imagine, managing a lot of tiles this way can get pretty complicated, and given that the number of available tiles in VRAM is limited, it's not something you can do easely however you want.

Scrolling is much easier on later hardware like the NES, because the hardware offers the possibility of displaying the entire screen with an offset, so you don't need to predefine series of tiles as explained above.

#4 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,896 posts
  • Coding something good
  • Location:Mexico City

Posted Thu Oct 11, 2012 9:34 AM

For the more technical involved, a small discussion of how I did the scroll in Princess Quest.

In the highest resolution VDP mode (mode 2) the screen as you see is composed of 8x8 tiles, there is a frame of 32 columns by 24 rows, each eight rows can have 256 different tiles.

In order to do smooth scroll, you should define tiles shifted by pixel AND combined with following tile (by example, 6 pixels of tile plus 2 pixels of following tile)

For fast update you change the screen (32x20 tile indexes or so) each two frames so you leave one frame for internal game logic (no way to do it updating pixels, that would be 4K-6K bytes, and VDP is very slow)

Need to say that VDP limits colors roughly and you should play tricks to combine different colors, like leaving at least 8 pixels space between tiles of different color.

If your game uses less graphics, you can redefine a small number of tiles continuosly.

And of course I saved some "untouched" tiles to draw letters for score, record, energy and lifes.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users