Colour Cycling - An Old School Technique

Started by
9 comments, last by aregee 9 years, 7 months ago

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
"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty
Advertisement

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.

throw table_exception("(? ???)? ? ???");

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.

That's really cool.

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...

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

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

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.)

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...

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.

This topic is closed to new replies.

Advertisement