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,218
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 offline  
Old 09 November 2022, 12:16   #102
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,218
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 offline  
Old 09 November 2022, 13:32   #103
Megalomaniac
Registered User
 
Join Date: Sep 2022
Location: Eastbourne
Posts: 1,205
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,804
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 Today, 19:07   #108
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,804
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 Today, 20:30   #109
AestheticDebris
Registered User
 
Join Date: May 2023
Location: Norwich
Posts: 526
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  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 23:23.

Top

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