Scrolling tricks

News,announcements,programming,fixes,game patches & discussions.

Moderator: troed

User avatar
exxos
Site Admin
Site Admin
Posts: 4995
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Scrolling tricks

Post by exxos » Tue Aug 21, 2018 3:16 pm

PeteW wrote:
Tue Aug 21, 2018 3:08 pm
No idea what bobs, joeys or world blocks are, so am interested to find out :)
bobs replace sprites... sprites take up a lot of CPU power and limited to 15 on screen. Bobs use pre-shifting to reduce CPU workload, and are a lot faster. Its almost just like a image copy from bank to screen, so no limits how many you can have as they are more like "pasted" on the screen.

Joeys are similar to bobs, but use single bit planes (may even be options for that , cant remember). Less colours than bobs, but are faster to draw, so use less CPU time.

World blocks are similar to bobs, but are designed to be used to replace STOS's MAP routines.. Again a lot faster and better utils for it.
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

troed
Software Moderator
Software Moderator
Posts: 471
Joined: Mon Aug 21, 2017 10:27 pm

Re: Scrolling tricks

Post by troed » Tue Aug 21, 2018 4:29 pm

(All the discussions about joeys, bobs etc are of course very STOS specific. Petaris comments are general)

For the trickiest of tricks, us demo coders do those. Not always possible to generalize for games.

In general pre-shifting is the way all fast routines work, and then you copy the required amount of bitplanes. A few games (Lethal Xcess etc) use sync scrolling which is a serious "abuse" of the ST hardware and displaces the whole screen with all its content using basically no CPU time. That of course requires you to redraw all other graphics in new places the whole time instead.

Petari
Trusted Guru
Trusted Guru
Posts: 558
Joined: Tue Nov 28, 2017 1:32 pm

Re: Scrolling tricks

Post by Petari » Tue Aug 21, 2018 5:44 pm

It is worth to add that there are 2 basic ways for undraw sprites when background scrolls, or just sprite changes pos , shape on screen:
That is related with scrolling, because drawing background will 'automatically' undraw all sprites of moving objects. So, if it goes enough frequently, like 15 fps or more, that will be fine. Then need only to draw sprites. Example: Harlequin.
Other way is to undraw every sprite before drawing it to next pos. In that case no need to update background if no scrolling. Example: Creatures.

Worth to mention HW support for scrolling - STE and blitter: STE HW scroll is basically support for shifting screen by 1-15 px, so it can do fine scroll without involving preshifts, CPU shifts. And it has register for line skip, so can display just part of much wider background than screen. But I think that it could be better - should allow more line skip, because what have is only some 4 screen width. And fine scroll is for whole screen, so in case of splitted screen, when only part is scrolling it needs some extra measures, which are not simple.
Blitter can do shifts internally parallel with data copy, so ideal for scrolling without need for preshifts. And of course, you can set it to scroll only desired area of screen easily.
There is 2 kind of people: one thinking about moving to Mars after here becomes too bad, the others thinking about how to keep this planet habitable.

Gargoyle
Posts: 31
Joined: Mon Aug 28, 2017 12:04 am

Re: Scrolling tricks

Post by Gargoyle » Thu Aug 23, 2018 11:47 pm

Petari wrote:
Tue Aug 21, 2018 12:57 pm
Gargoyle wrote:
Tue Aug 21, 2018 12:09 pm
If you use less colours with world map tiles, does that help speed up scrolling or does this only apply to screen copying commands?
Less colors will surely make it faster. For instance Uridium uses only 2 bitplanes for background - and that's enough, since original was not with more colors. If screen copy is faster then scrolling is faster too - because actually that copy is what takes most time in all it.
Just need to not mix fast screen draw (update) with fast scroll self - if scroll step is small, screen will not scroll/move fast left-right, up-down.
Of course, to large step is not good, then it will be too jumpy .
I'll have to experiment with this, I might even post a whole set of videos on the STOS Coders YouTube page showing the differences in speed, number of bitplanes, number of pixels scrolling (using missing link pre-shifted frames) if it does yield anything interesting.

PeteW
Posts: 75
Joined: Wed Jul 25, 2018 8:09 pm

Re: Scrolling tricks

Post by PeteW » Tue Aug 28, 2018 9:23 pm

Home from holiday and was idly working my way through some old demos. Came across the 'ripdis' demo, which is a new one to me. The main menu is quite a nice scrolling sotb rip off. It scrolls well and seems to use more than 16 colours.
20180828_210627.jpg
20180828_210627.jpg (3.43 MiB) Viewed 312 times
Things like the clouds and mountains clearly have quite limited palettes, but the sky and main sprite seem to utilise a good number of colours.

I can see that the scrolling has probably been achieved by not having the trees, or indeed any moving sprites, collision detection etc, but I was curious how they achieved what appears to be an extended colour pallete?

User avatar
exxos
Site Admin
Site Admin
Posts: 4995
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Scrolling tricks

Post by exxos » Tue Aug 28, 2018 9:46 pm

Looks like raster background for the sky..

maybe 3 colours for clouds, 3 for grass, 3 for mountains.. plus some red lookings bits. would fit in 16 colours I think...
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

PeteW
Posts: 75
Joined: Wed Jul 25, 2018 8:09 pm

Re: Scrolling tricks

Post by PeteW » Tue Aug 28, 2018 9:50 pm

Interesting, so does a raster background not count as colours then?

I find the tiny use of red and blue on the main sprite interesting - hardly seems worth using 2 colours over?

User avatar
exxos
Site Admin
Site Admin
Posts: 4995
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Scrolling tricks

Post by exxos » Tue Aug 28, 2018 9:57 pm

PeteW wrote:
Tue Aug 28, 2018 9:50 pm
Interesting, so does a raster background not count as colours then?
No, background colour is normally black, and gets switched colours very fast... it still 1 colour in the palette, but its colour gets changed quickly to other shades.. so you can get many colours out of 1 kind of thing.

Its nothing new..

I mean I did this in STOS long time ago..
M4D1_00002.png
M4D1_00002.png (4.6 KiB) Viewed 303 times
PeteW wrote:
Tue Aug 28, 2018 9:50 pm
I find the tiny use of red and blue on the main sprite interesting - hardly seems worth using 2 colours over?
Makes it look cooler I guess, use colours for something :)
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

DoG
Posts: 28
Joined: Sat Apr 07, 2018 12:26 pm

Re: Scrolling tricks

Post by DoG » Tue Aug 28, 2018 10:02 pm

You could change the palette on every scanline if you want to. 2 bitplanes (4 colours) are faster to scroll then four (16 coulours). Thats why the mountains, cloud only have three colours.

You could also scroll 1 bitplane on top of another bitplane and get some cool effects with sinus path or somthing.

PeteW
Posts: 75
Joined: Wed Jul 25, 2018 8:09 pm

Re: Scrolling tricks

Post by PeteW » Tue Aug 28, 2018 10:13 pm

Each of the parallax layers for the ground appear to only be 2 colours each. I assume this helps speed too?

With the raster effect taking up one colour, can this also be used as a static single colour elsewhere?

Post Reply