English Amiga Board   Amiga Lore


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 16 April 2010, 10:08   #1
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Corkscrew scroller

Watcha boys.

I had that coding itch again over the last couple of days so I decided to have a proper go at making a corkscrew scroller.

I thought about how it could be done for an hour or so, then I made a font for it (yawn! I *hate* making and converting fonts! ) and then I did the fun part and wrote the code and, as always, it's the fun part that's over with the quickest!

I'm sure I'll put this effect into a more substantial intro / demo at some point but for now I hope you like it and that the code is useful to you - enjoy.

EDIT: Source removed - modified and bug fixed version in a later post...

Last edited by pmc; 19 April 2010 at 20:25.
pmc is offline  
AdSense AdSense  
Old 16 April 2010, 10:53   #2
Leffmann
Leffmann with two n's

Leffmann's Avatar
 
Join Date: Jul 2008
Location: Sweden
Posts: 1,522
Nice one

I guess you've been watching Photon's Corkscrew intro First time I saw it I couldn't understand how he could make a sinus scroller in 5 bitplanes run in full frame rate. It took me a while before I figured out how it was done. Pretty clever!
Leffmann is offline  
Old 16 April 2010, 11:32   #3
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Quote:
Originally Posted by Leffman
Nice one
Thanks man.

Quote:
Originally Posted by Leffman
I guess you've been watching Photon's Corkscrew intro
I have seen that but not for a while - I made this one more because I love the one in The Timecircle's Shadow Of The Beast part in their Megascroll multipart demo.

Quote:
Originally Posted by Leffman
First time I saw it I couldn't understand how he could make a sinus scroller in 5 bitplanes run in full frame rate. It took me a while before I figured out how it was done. Pretty clever!
Now that you've figured it out you wouldn't mind telling me would you...?

I asked Photon about how he did it months back but he didn't tell me.

His sinused corkscrew scroller is definitely the nicest one I've ever seen - really beautiful.
pmc is offline  
Old 16 April 2010, 13:35   #4
Leffmann
Leffmann with two n's

Leffmann's Avatar
 
Join Date: Jul 2008
Location: Sweden
Posts: 1,522
The colored wave is a wide, fixed background drawn in the 3 odd bitplanes and he just scrolls it across the screen by changing the bitplane pointers and fine scroll value, and the front and back of the letters making up the actual sinus scroller use the first 2 even bitplanes placed so they perfectly fit over the colored wave.
Leffmann is offline  
Old 16 April 2010, 14:00   #5
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Ah, OK - nice - thanks Leffman!

Obviously there's no straight lines there so the colouring on the letters can't be done the standard way (as per my scroller...) with the copper.

I take it that the colours on the letters are also part of the background scrolled sinus wave and they either show through as "front" or "back" of the letters due to the combination of bitplane colours with the planes the "fronts" and "backs" of the letters are written into.

That's really cool and, as you say, very clever. Props to Photon.

I'd seen an earlier routine done by Altair (http://bitworld.bitfellas.org/demo.php?id=3126) that's nice but it's just a sinused corkscrew scroll minus the colourisation. Obviously they hadn't figured out that extra little bit of Photon magic that makes his version so much prettier.
pmc is offline  
Old 16 April 2010, 20:16   #6
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Age: 100
Posts: 4,088
Yeah, that's the first one (I think?? I never saw it.) I was inspired by Slayer's, which added 3 bitplanes of shading, as Leffmann mentions. And also by his other cracktro scrollers. So I wanted to make him scratch HIS head. Planned placement of the color shades on the cylinder allowed putting a bar 'between' the front and back-facing text.

But apart from that, there's the time for wrapping a (25x15 I think) font, same as in the 'VHS swapping' advertisement in the demo, on a higher cylinder (I think Slayer's was 14-15px high and mine was 19) which requires another trick, to run at full framerate. Note also that spaces between characters are often skipped in 1px sine scrollers to save blits. So 2px space between characters saves 12.5% blit time(!)

No, don't ask me exactly how it was done, I don't remember IIRC I sliced up the font and used deltavalues for the wave in some way.


It's about time for a V2 of this effect I think


Hmm... Slayer's one (and his super-slimy 'infinity loop scroller') cracktros don't seem to be on bitworld and pouet? Shame!! This must be remedied, I'll see if can find the disks... I remember they had Ron Klaren music and one spread 'Human Skeleton 1.0' for a 3D package.
Photon is offline  
Old 16 April 2010, 22:18   #7
Frog
Junior Member

Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,185
There's a nice cracktro with Ron Klaren music (Battle Squadron) on Bitworld with a nice scroller : Crash Land Cracktro and a variant Human Design Cracktro also with Battle Squadron music.
To finish a similar SineCrew Scroller Asm One and always a Ron Klaren music

@PMC : Too bad you've not provide an Amiga Executable of your SineCrew Intro.
Frog is offline  
Old 16 April 2010, 22:35   #8
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Quote:
Originally Posted by Photon
It's about time for a V2 of this effect I think
\o/

That'd be quality.

Quote:
Originally Posted by Frog
@PMC : Too bad you've not provide an Amiga Executable of your SineCrew Intro.
Attached executables of the original version (_lrg) and a new one with a different font (_sml) just for you Frog.

PS. Forgot to say Frog - my routine isn't a sinus one - it's just a normal scroller that has the corkscrew effect on it...

Last edited by pmc; 20 April 2010 at 20:25. Reason: clarity
pmc is offline  
Old 16 April 2010, 23:23   #9
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Age: 100
Posts: 4,088
Ah, there they are, both of them. Just a sloppy search. I saw that there were stubs created, one called Kork Screw, and just assumed too much. Good

So the Slayer one is 14px high... phew, my statement wasn't a lie then

pmc: you must also bend with modulo in the copper!! Much nicer Earlier I made this scroller for Rioter to use. (We were in BRAINS together and then he went to Powerlords and I went to Phenomena.) Note that I only take credit for the scroller (and maybe a little for the music...hehehe...)

Actually Sinescrew is a very good term for the effect, much better than Corkscrewsinusscroller, hehe.

Corkscrew is un-sined and sinescrew is with sine, with or without a bar in the middle it's the same effects. Even if I had to use a trick to go up in size it's still blitted sine-slices. And the bar is just a palette/cylinder arrangement.

OK, /rant. It's just that I try to find good names for fx for the bitworld database, it's a bit of a hobby...
Photon is offline  
Old 16 April 2010, 23:48   #10
Boo Boo
LastSaluteToTheCommodore

Boo Boo's Avatar
 
Join Date: Jun 2006
Location: Village
Posts: 2,766
Checked it out pretty cool - whats next?
Time to get Retro again
Boo Boo is offline  
Old 17 April 2010, 02:44   #11
Frog
Junior Member

Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,185
Quote:
Originally Posted by pmc View Post
Attached executables of the original version (_lrg) and a new one with a different font (_sml) just for you Frog.
Even if it was pleasant to read your very well commented source code, my brain couldn't decode it in realtime to see the proper effect
So thanks for the executable

Quote:
PS. Forgot to say Frog - my routine isn't a sinus one - it's just a normal scroller that has the corkscrew effect on it...
Nice effect, and interesting kind of scrolltext.
Frog is offline  
Old 17 April 2010, 12:56   #12
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Quote:
Originally Posted by Photon
pmc: you must also bend with modulo in the copper!! Much nicer
In the _lrg version (see the original source code I posted for the source of that one...) I added bplcon1 hardware scroll per line to give the scroller an extra curve. Is that different to bending with the modulo regs or just another way to do the same...?

Quote:
Originally Posted by Frog
Even if it was pleasant to read your very well commented source code, my brain couldn't decode it in realtime to see the proper effect
So thanks for the executable
No problem mate, anytime.

Quote:
Originally Posted by Boo Boo
Checked it out pretty cool - whats next?
I'm not sure really

If I get an idea, I try to code it but I don't really plan it out too much.

If you want more of my stuff that you might not have seen then you can find a few routines at: http://retro.untergrund.net/prods.html

All Retro, all the time.
pmc is offline  
Old 19 April 2010, 20:35   #13
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Watcha chaps.

This is the fixed version of my corkscrew code:

Fixed left hand side of screen downward copy bug.

Fixed a bug that caused random shite to appear on the screen at certain increased screen widths.

Added some more equates usage to make the code more readable.

Widened diwstrt/diwstop/ddfstrt/ddfstop to make the scroller go across more of the screen.

Stole () Photon's bplcon1 hardware scroll reg settings from his Powerlords corkscrew scroller cos they add a much prettier horizontal bend to the scroller than the ones I was originally using in mine.

Source and .exe attached.

Last edited by pmc; 03 June 2010 at 10:01.
pmc is offline  
Old 20 April 2010, 22:36   #14
Frog
Junior Member

Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,185
Excellent work.
Just one thing, the scroller could be better in overscan
Frog is offline  
Old 20 April 2010, 22:48   #15
NOB
Zone Friend
 
Join Date: Aug 2005
Location: Germany
Age: 42
Posts: 424
Nice scroller! Reminds me of the first Amiga corkscrew done by Northstar.(http://bitworld.bitfellas.org/demo.php?id=1815)
Seems that the Altair scroller is a modified Northstar scroller.

Last edited by NOB; 20 April 2010 at 22:57.
NOB is offline  
Old 20 April 2010, 23:23   #16
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
Quote:
Originally Posted by Frog
Excellent work.
Just one thing, the scroller could be better in overscan
Thanks Frog

The right side of the scroller goes across the border. I wonder, is there a way to stretch the left side of the scroller across the left screen border too...? I already stretched the visible screen data out to 352 pixels - anyone know the maximum?

Quote:
Originally Posted by NOB
Nice scroller! Reminds me of the first Amiga corkscrew done by Northstar.(http://bitworld.bitfellas.org/demo.php?id=1815)
Seems that the Altair scroller is a modified Northstar scroller.
Thanks man.

I hadn't seen that Northstar demo before - the scroller in that is *really* beautiful.
pmc is offline  
Old 21 April 2010, 00:10   #17
Frog
Junior Member

Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,185
Quote:
The right side of the scroller goes across the border. I wonder, is there a way to stretch the left side of the scroller across the left screen border too...? I already stretched the visible screen data out to 352 pixels - anyone know the maximum?
As i watch it under WinUAE it was thinking it doesn't used maximum overscan... I think 352 pixels is the larger.

Personnaly this kind of scroll remind me some ATARI scrolltext like in the good old Cuddly Demo :
http://www.stupiditiz.com/blabla/the...1989-atari-st/

Text in french but there's some YouTube Video, watch the 3rd one !
Frog is offline  
Old 21 April 2010, 00:13   #18
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,594
I must apologise for not understanding enough French to read your post Frog but the demo you posted the link to looked superb - the scroller in that one was cool!
pmc is offline  
Old 21 April 2010, 22:20   #19
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Age: 100
Posts: 4,088
Yeah, Crab's scroller is an early one and a looker. It wasn't a very uncommon effect early on, I have a vague memory of seeing it in an early cracktro by a famous group whose name escapes me. Whether it was before NS MD 2 I don't know. Maybe it was done by bending whole characters around a tube instead of char slices, not sure.

pmc, horizontal bending is with the scroll register, vertical bending with modulo. Why vertical bending? Well, if you were to write text on say a toilet paper roll and look at it, the parts of the chars that are near top and bottom of the roll will look more 'squeezed together'. For simplicity, let's say the off-screen height of the scrollbuffer is 181 pixels. When you bend it virtually, line 0 in the buffer should be facing straight up and 180th line straight down. Go from 0 to 180 degrees and calculate x and y in a circle with a diameter d that is equal to the height of the tube you want.

Make an 'array' that has d values, and initialize it to all zeroes. For each y you calculate, compare it to what's in the xth array value and replace it if it's larger. When you're done you will have an array with a correct 'bulge'. To get the addresses of each line, start at the top address of the buffer and increment the pointer with the difference in bulge between two consecutive bulgevalues, times the bitplane width in bytes.

You can use the addresses to set bitplane pointers, but subtracting the address from the previous address, and subtracting the bitplane width in bytes, you get the modulo values for a smaller copper.

Overscan: I did test it a while ago and I think you can go $18-$e0 ("$e2"). I guess the simplest way to test is to "drag the anchors" in WB Overscan Prefs in WinUAE and invoke WinUAE's monitor and have a look at the registers or coppers.
Photon is offline  
Old 21 April 2010, 22:42   #20
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere
Posts: 330
I don't know why you keep calling that "corkscrew" scrollers, back then those were called tube scrollers and here are the original ones i think: http://pouet.net/prod.php?which=14564
hitchhikr is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sine scroller - dycp blazeb Coders. Asm / Hardware 6 02 May 2012 11:08
2d side scroller/ platformer. Conundrum Looking for a game name ? 3 27 December 2011 18:33
Sine scroller pmc Coders. Tutorials 87 07 September 2010 15:38
A space 2d multidirectional scroller dabbler Looking for a game name ? 11 21 April 2010 07:48
Flickering sine scroller pmc Coders. Tutorials 4 24 June 2009 10:19

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 09:15.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Page generated in 0.22439 seconds with 11 queries