Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Colour Cycling - An Old School Technique


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 TheComet   Crossbones+   -  Reputation: 1785

Posted 20 August 2014 - 01:27 PM

Seize the Day was a calendar program made by in 1994 by Buena Vista software. It features graphics that at the time, were revolutionary because of the way they handled color cycling. These images were static bitmaps, but by changing color values, they appear animated. What is also impressive about these images is that they had full day night cycles built in, rendered also through color cycling. A few years ago, a html5 version was made. A copy was uncovered online and there is a way to use the program through DOSbox. As well, one of the original programmers for the project, Iam Gilman, has thought of the idea of remaking it, open sourced, for modern machines.

 
This popped up on my blog today and I wanted to share it with you all. The HTML5 demo can be played here:
http://www.effectgames.com/demos/canvascycle/
 
Make sure to play around with the settings on the right. The guy who implemented the HTML5 canvas program mentions that he improved on the technique by linearly blending the cycling colours to produce smoother transitions.
 
Here are the results of what can be done with colour cycling:
 
tumblr_n4w85syp811s559q7o1_500.gif
 
tumblr_n4w85syp811s559q7o2_500.gif
 
tumblr_n4w85syp811s559q7o4_500.gif
 
tumblr_n4w85syp811s559q7o3_500.gif
 
tumblr_n4w85syp811s559q7o6_500.gif
 
tumblr_n4w85syp811s559q7o5_500.gif
 
tumblr_n4w85syp811s559q7o7_500.gif
 
tumblr_n4w85syp811s559q7o8_500.gif
 
tumblr_n4w85syp811s559q7o9_500.gif

Edited by TheComet, 20 August 2014 - 01:31 PM.

YOUR_OPINION >/dev/null

Sponsor:

#2 Ravyne   GDNet+   -  Reputation: 9575

Posted 20 August 2014 - 01:41 PM

Color cycling is a really great old-school technique -- You could eke out even fullscreen animations that the hardware had no business putting out otherwise.

 

Its kind of a shame you don't see it so much nowadays -- certain games pay homage to it, but almost no one actually implements it realistically (Shovel Knight is the only one I can think of off-hand). I *still* have plans to one day implement a very faithful SNES-style graphics-library capable of employing color cycling, roto-zoom, and scanline effects all on the GPU -- doing so isn't rocket science but its not a trivial exercise, either.



#3 frob   Moderators   -  Reputation: 25493

Posted 20 August 2014 - 01:45 PM

Pretty images.

I remember those days; one concern was that if you didn't get it completely rotated in time you could get 'snow' noise at the top of your screen. The longer the dma transfer took the farther down the static went on the screen.

They (Buena Vista) weren't the first to use the technique, I remember games that rotated the EGA palette years before 1994. Several of the early mass-market online networks like Prodigy and CompuServe used them in many games, that was in the 1986-1990 era. Even then people talked about the Commodore Amiga's Copper chip, a dedicated co-processor that could be used to mess with the palette mid-draw, allowing things like procedural background gradient colors that could ebb and flow as the palette rotated.

CompuServe's graphics interchange format for those types of animated images evolved and then served as the standard we all know and love today. You can include animated palette blocks rather than, or in addition to, animated pixel blocks. Making a good palette for animation is much harder than just replacing the pixels, but the format supports it for pixel artists who want to invest all those extra hours.

That style of artwork, designing individual pixels in preparation for cycled palettes, is quite tricky and requires skill to do well, probably far more skill than animations that simply swap out pixel buffers. They could also be much smaller which was critical on old systems. Those pictures are great examples.

Thanks for bringing back the memories.

Edited by frob, 20 August 2014 - 09:41 PM.
Add some nostalgia

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#4 Servant of the Lord   Crossbones+   -  Reputation: 22736

Posted 20 August 2014 - 01:51 PM

That's really cool.


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#5 aregee   Members   -  Reputation: 1031

Posted 20 August 2014 - 05:00 PM

Chrome crashed, and I lost my initial text, so I will be brief.

 

I was going to say that Deluxe Paint on the Amiga computer had this already around 1989-1991, and doing some research, it seems it is the same pictures that was in the PC version of the same program that is used for this effect.

 

The Amiga computer had this "ability" natively in the way it handled graphics: planar opposed to PC's that were using what was called 'chunky pixels' back then.  Planar means that you had a certain number of bit planes you could activate, and all the bit combinations for a pixel was mapped to a colour register rather than writing the colour directly to the pixel, like you do on PC-computers

 

I do remember one colour cycle animation of a bird flying over the screen, and was pretty fascinated how they managed to calculate the correct colour values to make that work, like magic just cycling a few groups of colours from the palette.  The bird wasn't big, but it was cool to watch never the less.

 

Edit: Frob's response slipped my view lol...


Edited by aregee, 20 August 2014 - 05:04 PM.


#6 ChaosEngine   Crossbones+   -  Reputation: 2740

Posted 20 August 2014 - 09:13 PM

Monkey Island-tastic!
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#7 iMalc   Crossbones+   -  Reputation: 2347

Posted 29 August 2014 - 03:39 PM

Ah that brings back fond memories of SimCity 2000.


"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

#8 valrus   Members   -  Reputation: 1002

Posted 31 August 2014 - 12:02 AM

Chrome crashed, and I lost my initial text, so I will be brief.

 

I was going to say that Deluxe Paint on the Amiga computer had this already around 1989-1991, and doing some research, it seems it is the same pictures that was in the PC version of the same program that is used for this effect.

 

The Amiga computer had this "ability" natively in the way it handled graphics: planar opposed to PC's that were using what was called 'chunky pixels' back then.  Planar means that you had a certain number of bit planes you could activate, and all the bit combinations for a pixel was mapped to a colour register rather than writing the colour directly to the pixel, like you do on PC-computers

 

I used to love Deluxe Paint color cycling.  Nothing this sophisticated, but for kicks I liked to take one of the gradient-cycle pens, turn on a bunch of symmetry, and make intricate mandalas.  Then by cycling the colors in the gradient, I would get endlessly looping animated mandalas.  Very easy, but a neat effect.  

 

Historical note: you might be conflating planar vs. linear ("chunky") memory organization and indexed vs. direct color.  Both the EGA and VGA architectures were natively planar, although the famous VGA Mode 13h provided linear addressing.  Color cycling was possible in both planar and linear VGA modes; regardless of how the bits were organized, what they represented was an index into a mutable color table.

 

(Edit: I had said that EGA cycling wasn't possible, because I had made a mental mistake about the EGA color table.  EGA color cycling was possible, too.)


Edited by valrus, 31 August 2014 - 12:14 AM.


#9 aregee   Members   -  Reputation: 1031

Posted 01 September 2014 - 01:00 AM

 

I used to love Deluxe Paint color cycling.  Nothing this sophisticated, but for kicks I liked to take one of the gradient-cycle pens, turn on a bunch of symmetry, and make intricate mandalas.  Then by cycling the colors in the gradient, I would get endlessly looping animated mandalas.  Very easy, but a neat effect.  

 

Historical note: you might be conflating planar vs. linear ("chunky") memory organization and indexed vs. direct color.  Both the EGA and VGA architectures were natively planar, although the famous VGA Mode 13h provided linear addressing.  Color cycling was possible in both planar and linear VGA modes; regardless of how the bits were organized, what they represented was an index into a mutable color table.

 

(Edit: I had said that EGA cycling wasn't possible, because I had made a mental mistake about the EGA color table.  EGA color cycling was possible, too.)

 

 

Regarding the "unlimited" colour cycling.  That made me think of the old "bob"-effects where instead of using double buffering, you used 3 buffers to make it look like you were drawing "unlimited" balls on the screen.  (Not clearing the buffers for each drawn frame.)

 

Regarding planar vs. linear addressing, my mind may be a bit fuzzy.  I remember using a BIOS int to switch to various graphics modes, using VESA, and draw something on the screen afterwards.  All the modes I ever used was linear addressing, but I have a vague memory of there being a 256-colour palette mode too, and I seem to remember some schematics in old assembler code books, where graphics were illustrated as being planar, so I am probably wrong about that.  Just that I seem to remember that one of the big differences between "Amiga vs. PC" back then was just the planar vs linear graphics, and the sound, of course.

 

Wasn't CGA like 4 colour palette, and EGA 16 colours?  Checking Wikipedia, I didn't even know you had 64 predefined colours to choose from in EGA mode.  But before SVGA, I had a Commodore 64, and CGA and EGA never looked anything like what you could do on C=64 and Amiga.  I still remember the old beast of an 80386 SX that didn't even have a math co-processor.  It had 2 MB RAM, and I remember a whopping 40 MB Hard drive.  Windows and DOS took 20+ of those...  I remember upgrading the memory on the graphics card from 256 kB to 512 kB...  Some changes, looking back, lol...



#10 frob   Moderators   -  Reputation: 25493

Posted 01 September 2014 - 02:07 PM

CGA you had two bit-banks, and you needed to pick one of four pre-determined palettes. EGA had 16 colors (four bits) on a palette of 64, again with bit banks to determine what colors to show.  VGA followed the same pattern with a palette of 256 adjustable colors and the traditional bit bank, and they also had a "chained" mode (mode 13h) where you could access it like a traditional array of 8-bit values rather than individual bit banks. It was generally faster to run DMA transfers into the bit banks rather than to use chained mode address the array elements directly.

 

Hardware floating point support wasn't common on the home PC until around 1996. Up until the 386 the floating point was a separate optional (and expensive) co-processor.  The 486 had it built in for some models, but the 486SX was a cheaper version with the floating point disabled. (For most manufactures the SX was just the batches with a defective FPU, they removed a pin and sold it cheaper.) It wasn't until the original Pentium that you could be sure there was a working FPU. It took a few years before there was enough market share that companies could rely on a reasonably large market of FPU-enabled processors, so 1995/1996 was the big transition time.

 

Today most programmers take floating point for granted and assume it is on all chips. The original iphone (2008) included a separate co-processor for floating point, it almost wasn't standard and few of the programmable phones before it had a dedicated FPU. The Nintendo DS (2004) that many people associate with 3D games does not have a floating point processor.

 

Having fully functional, dedicated floating point hardware on every computer is a fairly new phenomenon. Beginners and even a few experienced people may think of them as ubiquitous, but just six years ago I was working on major games for mainstream devices without hardware floating point support.


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#11 aregee   Members   -  Reputation: 1031

Posted 01 September 2014 - 05:23 PM

CGA you had two bit-banks, and you needed to pick one of four pre-determined palettes. EGA had 16 colors (four bits) on a palette of 64, again with bit banks to determine what colors to show.  VGA followed the same pattern with a palette of 256 adjustable colors and the traditional bit bank, and they also had a "chained" mode (mode 13h) where you could access it like a traditional array of 8-bit values rather than individual bit banks. It was generally faster to run DMA transfers into the bit banks rather than to use chained mode address the array elements directly.

 

Hardware floating point support wasn't common on the home PC until around 1996. Up until the 386 the floating point was a separate optional (and expensive) co-processor.  The 486 had it built in for some models, but the 486SX was a cheaper version with the floating point disabled. (For most manufactures the SX was just the batches with a defective FPU, they removed a pin and sold it cheaper.) It wasn't until the original Pentium that you could be sure there was a working FPU. It took a few years before there was enough market share that companies could rely on a reasonably large market of FPU-enabled processors, so 1995/1996 was the big transition time.

 

Today most programmers take floating point for granted and assume it is on all chips. The original iphone (2008) included a separate co-processor for floating point, it almost wasn't standard and few of the programmable phones before it had a dedicated FPU. The Nintendo DS (2004) that many people associate with 3D games does not have a floating point processor.

 

Having fully functional, dedicated floating point hardware on every computer is a fairly new phenomenon. Beginners and even a few experienced people may think of them as ubiquitous, but just six years ago I was working on major games for mainstream devices without hardware floating point support.

 

 

Oh I had a feeling that when you occasionally saw different colours in CGA and EGA, there were always the same colour combinations.

 

Regarding expensive option, I did actually buy a math co-processor for that machine, and it was expensive - just along the line of the whole computer itself.  I paid about 3400 USD back then, not counting inflation...  And that was without any extras.  (No audio card, no co-processor, low memory, etc.)  I am sweating just thinking about it, lol...

 

Wow!  I indeed would expect floating point operations would be common in microprocessors at the beginning of the 2000's.  So what do you do without floating point?  Fixed point math on integers?  Modulo 2 math?  (I remember assembly optimisations in the old days, pre-calculated sine tables with 256 degrees instead of the usual 360 degrees so you wouldn't need to test for wrap-around, etc.)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS