English Amiga Board


Go Back   English Amiga Board > Main > Retrogaming General Discussion

 
 
Thread Tools
Old 09 November 2022, 12:15   #101
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,219
Smooth horizontal scrolling on the ST in games such as Chuck Rock (probably Wolfchild, Carvup etc.. too), used preshifted block pairs. This meant that you had to be careful about the layout of tiles on your map, but it used the minimum necessary preshifted data, so it didn't take a huge amount of memory to store.

You could also build the code for each line (that was called 16 times), to fetch the data, and move it into screen memory efficiently.

This is effectively how games like Cobra on the Spectum achieved smooth scrolling too.
DanScott is online now  
Old 09 November 2022, 12:16   #102
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,219
Quote:
Originally Posted by ImmortalA1000 View Post
if you want to scroll horizontally in less than 16 pixel jumps you need to allocate duplicate 32k screens with preshifted tiles for however many pixels you really want to scroll.
nope, not really... see my post above
DanScott is online now  
Old 09 November 2022, 13:32   #103
Megalomaniac
Registered User
 
Join Date: Sep 2022
Location: Eastbourne
Posts: 1,210
Should it have said "if you want to scroll horizontally in less than 16 pixel jumps without making significant design compromises if designing for an ST, or without cutting back on detail if converting from elsewhere you need to allocate duplicate 32k screens with preshifted tiles for however many pixels you really want to scroll". (my italics)?
Megalomaniac is online now  
Old 09 November 2022, 14:02   #104
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,806
Quote:
Originally Posted by DanScott View Post
Smooth horizontal scrolling on the ST in games such as Chuck Rock (probably Wolfchild, Carvup etc.. too), used preshifted block pairs. This meant that you had to be careful about the layout of tiles on your map, but it used the minimum necessary preshifted data, so it didn't take a huge amount of memory to store.

You could also build the code for each line (that was called 16 times), to fetch the data, and move it into screen memory efficiently.

This is effectively how games like Cobra on the Spectum achieved smooth scrolling too.

Could you explain that a bit more? For the case if I ever try to code an ST game, that is...

Love to read about clever coding techniques.
Tigerskunk is offline  
Old 09 November 2022, 14:23   #105
Keops/Equinox
Registered User
 
Keops/Equinox's Avatar
 
Join Date: Feb 2008
Location: .
Posts: 110
Quote:
Originally Posted by DanScott View Post
nope, not really... see my post above
+1

In a 16 pixel-wide block, if you start preshifting a tile, you have to start including in those 16 pixels the next possible tile(S) existing to the right, the ones that will be displayed right after the current tile on the same line, because their preshifting "bleeds" into the current tile. If you don't do that, you will have a horrible discontinuity.

That means you have to consider all the possible associations of TileA-TileB on screen for 32 pixels, and because memory is not unlimited, you can only have a limited number of tile association for your game with that technique, which sets constraints for level artists.

If you don't want to have that constraint for preshifted tiles on ST, you will have to draw 2 tiles per 16-pixel block, using an OR each time for the second tile within your 16-pixel block, which will more than double the cost of drawing those tiles but will let you arrange them in any way you want.

Last edited by Keops/Equinox; 09 November 2022 at 14:48.
Keops/Equinox is offline  
Old 10 November 2022, 00:12   #106
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Quote:
Originally Posted by DanScott View Post
nope, not really... see my post above
OK that's another way of doing it but if you want to 'scroll' the entire screen in single pixel jumps that's how you could do it. Depends on your game engine and genre of game you are writing which is going to work better.
ImmortalA1000 is offline  
Old 15 November 2022, 13:11   #107
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
I have just checked out the longplay of Turrican 2 on the ST and it has the parallax scrolling shmup level. OK it's not as fluid as the C64 version but it is impressive.

I'd give it a go but ST cracks rarely have decent trainer options, 99% of the time it's useless unlimited lives/credits.
ImmortalA1000 is offline  
Old 19 August 2024, 19:07   #108
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,806
Quote:
Originally Posted by DanScott View Post
Smooth horizontal scrolling on the ST in games such as Chuck Rock (probably Wolfchild, Carvup etc.. too), used preshifted block pairs. This meant that you had to be careful about the layout of tiles on your map, but it used the minimum necessary preshifted data, so it didn't take a huge amount of memory to store.

You could also build the code for each line (that was called 16 times), to fetch the data, and move it into screen memory efficiently.

This is effectively how games like Cobra on the Spectrum achieved smooth scrolling too.
@DanScott: Would you care to elaborate a bit more on those techniques?

I am a bit dabbling in ST coding at the moment, and would love to find out how some of that tricky stuff worked.. What do you mean by "block pairs" ?

Plus that "You could also build the code for each line (that was called 16 times), to fetch the data" sounds quite mysterious to me...
Tigerskunk is offline  
Old 19 August 2024, 20:30   #109
AestheticDebris
Registered User
 
Join Date: May 2023
Location: Norwich
Posts: 527
Quote:
Originally Posted by Tigerskunk View Post
I am a bit dabbling in ST coding at the moment, and would love to find out how some of that tricky stuff worked.. What do you mean by "block pairs" ?
When you're scrolling a background, the tricky part comes about because you'd normally have to mask+combine the left and right edges of tiles (because the on screen graphics will be half of one tile, half of another).

One trick to make this more performant is to only allow certain transitions between tiles. That way you can use pre-shifted versions that already contain the merged together data and so it can be drawn quicker.

Quote:
Originally Posted by Tigerskunk View Post
Plus that "You could also build the code for each line (that was called 16 times), to fetch the data" sounds quite mysterious to me...
You basically generate specific code for the exact data you're going to generate. So, for example, a sequence of instructions to draw tile A three times, then tile X, then tile Y etc..This means you have to make less decisions, because each row of tiles can use the same instructions rather than checking the tile map each time to figure out what to draw next. It's not for the feint hearted and requires solid optimization to be entirely worthwhile.
AestheticDebris is offline  
Old Yesterday, 00:02   #110
oscar_ates
Registered User
 
Join Date: Nov 2021
Location: Utrecht/Netherlands
Posts: 340
Which chips in Amiga do and help for smooth scrolling? As far as I know copper can change the number of colors in screen only
oscar_ates is offline  
Old Yesterday, 09:49   #111
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,806
Quote:
Originally Posted by oscar_ates View Post
Which chips in Amiga do and help for smooth scrolling? As far as I know copper can change the number of colors in screen only
I guess that's Denise and its scrolling register...
Not much of a problem there..

On the ST it's kind of the holy grail, though.
Tigerskunk is offline  
Old Yesterday, 09:50   #112
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,806
Quote:
Originally Posted by AestheticDebris View Post
When you're scrolling a background, the tricky part comes about because you'd normally have to mask+combine the left and right edges of tiles (because the on screen graphics will be half of one tile, half of another).

One trick to make this more performant is to only allow certain transitions between tiles. That way you can use pre-shifted versions that already contain the merged together data and so it can be drawn quicker.



You basically generate specific code for the exact data you're going to generate. So, for example, a sequence of instructions to draw tile A three times, then tile X, then tile Y etc..This means you have to make less decisions, because each row of tiles can use the same instructions rather than checking the tile map each time to figure out what to draw next. It's not for the feint hearted and requires solid optimization to be entirely worthwhile.
Some very interesting ideas...
Thanks...
Tigerskunk is offline  
Old Yesterday, 10:54   #113
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,219
Quote:
Originally Posted by oscar_ates View Post
Which chips in Amiga do and help for smooth scrolling? As far as I know copper can change the number of colors in screen only
The copper can theoretically write to any of the hardware registers at any position on (or off) the screen.

The colour registers are just 32 of those registers. There's also (among many others), bitplane pointers, bitplane control registers, sprite registers, audio registers etc...
DanScott is online now  
Old Yesterday, 17:33   #114
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,035
Quote:
Originally Posted by oscar_ates View Post
Which chips in Amiga do and help for smooth scrolling? As far as I know copper can change the number of colors in screen only
Dan beat me to it, but copper can do a lot more than simply change colours lol.

It can access most of the hardware registers, triggering blits, interrupts, screen mode changes, sprite multiplexing, sample triggering, changing bitplane pointers, literally any hardware register that can be written to, can be done by the copper.

It's what makes the Amiga.......Amiga!
Galahad/FLT is offline  
Old Yesterday, 22:14   #115
CCCP alert
Registered User
 
Join Date: May 2023
Location: essex
Posts: 635
I presume on Amiga you can move the screen memory pointer to scroll the screen around a large bitmap 1 pixel at a time?
CCCP alert is offline  
Old Today, 14:17   #116
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,035
Quote:
Originally Posted by CCCP alert View Post
I presume on Amiga you can move the screen memory pointer to scroll the screen around a large bitmap 1 pixel at a time?
To do horizontal scrolling on 1 pixel you would use hardware scrolling, then once you've scrolled 16 pixels, change the bitplane pointers and reset hardware scroll to zero.

Scrolling vertically can be done by changing the bitplane pointers, so yes you can easily scroll around a large Bitmap and the Amiga isn't remotely being stressed doing it.
Galahad/FLT is offline  
 


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
modrobert
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
9 Lives - smooth scrolling punkrulesok support.Games 14 22 November 2018 22:24
smooth scrolling.is it possible? kirk support.WinUAE 30 01 October 2007 13:57
smooth scrolling sink support.WinUAE 3 20 July 2007 01:16
Smooth scrolling with WinUAE? Tony Landais support.WinUAE 13 30 May 2007 03:55
Just can't get smooth scrolling Bobbin support.WinUAE 0 23 November 2002 00:52

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09525 seconds with 15 queries