1983.Â Like all games written for the early Apple II computer, the original Dino EggsÂ --Â with all the features I had designed into itÂ --Â needed to fit into a limited space. Â ExactlyÂ 48K of RAM memory.
How much is 48K?
Todayâ€™s home computer â€“ or smartphone, tablet, or micro SD card â€“ can easily contain 8 Gig of memory.Â This is over 160,000 times more than 48K.
(That does not count the additional and separate caches of memory that today's devices rely on, like video memory.Â Nor does it count the additional hard drive space available to laptop and desktop computers â€“ a resource unavailable to the early Apple IIâ€™s.)
How little is 48K?
If you typeÂ text into Windows Notepad, you'll exceed 48 K in about 20 screen fulls.
If you record CD-quality audio, you'll exceed 48K in a half-second.
Video?Â Forget about it.
All of these calculations refer to uncompressed data.Â And that's part of the point.Â Nothing was compressed or dynamic within the Apple II.Â With a few exceptions, every byte was written to remain a whole byte and stayed where you put it.Â If you wanted a byte to mean more than 8 bits, you needed to write your own self-modifying code, or game-specific data compression/extraction routines.
The review of Dino Eggs published in Softalk magazine -- Thank you, Al Tommervik and Margot Comstock! -- was based on an early development disk of the game that used an extra 16K of memory within the Apple II referred to as â€śLanguage Cardâ€ť memory.
Softalkâ€™s game reviewer mistakenly assumed this meant that the commercial version of Dino Eggs would require 64K of RAM, and said so in his review.Â
My game publisher was livid with anger and fear. Â At that time, for an Apple II product to require 64K was practically a death sentence for sales.
So, how did I squeeze Dino Eggs into 48K?Â Reviewing my source code thirty-two years later, hereâ€™s what strikes me:
As revealed by an early sketch of Dino Eggs in my previous post, I conceived of the game's horizontal creatures as "roaches." Â On screen, they became proto-snakes and proto-pedes. Â In the code, they remained roaches.
"DEPG3" was the behind-the-scenes hi-res page on which all my source graphics were stored. Â Even though it was never directly visible on the Apple II hi-res pages, DEPG3 used the same pixel-addressing scheme as the Apple's hi-res pages 1 and 2. Â This saved time and code when moving graphics aroundÂ from page to page during the game.
In lines 1047 and 1050, the code branches (BNE, BCC)Â to the pre-existing jump (JMP) in line 1040 rather than branching around a newly-entered jump, thus saving three bytes per branch. Â Also, the assembler could accept onlyÂ so many labels per file of source code --Â so "ATLVL-3" is a make-shift way ofÂ labelingÂ line 1040.
One step at a time.Â Effectively, there was only "one thing going on" within the Apple II at any given time. There was nothing to hand anything off to.Â Even when you called the floppy disk read/write routines, you couldnâ€™t do anything else until they were done and handed control back to you.Â There was nothing happening "on the side" or in parallel.Â There was no way of telling anything â€śLet me know when that happens.â€ť
If you were giving the speaker a little "tick", you weren't updating the screen, or doing anything else.Â Any interleafing of routines had to be written into the code.
Speed.Â The Apple II clocked in at 1 Megahertz (basically a million cycles per second).Â Roughly speaking, computer speeds today are 3,000 times faster (if you compare them cycle to cycle) â€“ or 24,000 times faster (if you compare the number of bits processed per second).
So, hereâ€™s an odd picture.Â While 160,000 running copies of Dino Eggs could fit inside todayâ€™s typical computerâ€™s 8 Gig of RAM, the same computerâ€™s typical processor could not keep all of those instances running at original speed.Â It could manage to run only 24,000 of them.
Only 24,000 instances of Dino Eggs running within one computer at the same time?Â Pathetic!
These 24 mini-screens representÂ 0.1% of the instances of Dino Eggs that â€“ in gross theory â€“ a typical contemporary computer could keep running simultaneously at original speed.
Pixels.Â Animation was made possible by hires-page flipping.Â If you poked byte $C054, the Apple II displayed memory locations $2000 to $3FFF as a grid of 280Â by 192 pixels on the screen.Â If you poked byte $C055, it displayed memory locations $4000 to $5FFF in the same format.Â This was the powerful curtain behind which we programmers could construct our magic.
The fundamental challenge was:Â How many of the â€śbackstageâ€ť pixels could you change before having to flip the pages â€“ thus makingÂ the â€śbackstageâ€ť page into the visible page â€“ while keeping the frame rate (animation speed) sufficiently fast?
There was no native support for sprites or collision detection.Â Every pixel was just a pixel that you turned on or off.Â The system has no special awareness of any pixels being â€śin frontâ€ť or â€śbehindâ€ť or being part of a moving figure.
Odd-numbered pixels could be green or orange.Â Even-numbered pixels could be violet or blue.Â Any two adjacent pixels (of any color) could create white or black.Â Only seven bits of each byte were visible -- an odd number --Â thus any given byte value would display as different colors in different columns on the screen.
All this made for an odd set of graphic handcuffs.Â And yet, amazingly, it worked. Â I have found that technical limitations â€“ even strange, arbitrary technical limitations like those described above â€“ often don't ruin the aesthetic results, but can actually enhance them.
Sometimes the smaller the keyhole â€“ the greater the effort in squeezing things through that keyhole â€“ the higher the quality as a result.
I felt very comfortable with my ability to illustrate and animate using those huge chunky 8-bit 6-color pixels. Â Gradually over the years â€“ as evolving technology gave me more and more pixels and more and more colors to work with â€“ I became less comfortable with my abilities.
Around 1963.Â My earliest encounter with a computer was an indirect one. Â I was about 7 years old and visiting the Chicago Museum of Science and Industry with my father.Â The museum had dedicated a large room to the display of a computer that could play Tic-Tac-Toe Â with visitors.Â The size of the room was necessitated by both the size of the computer and the size of the crowds it attracted.
In my memory, it plays like a dream sequence from an episode of Mad Men.Â A large sweaty roomful of dress-suited men wearing fedoras, the air heavy with testosterone and Old Spice.Â Each man in the swarm, my father among them, pressing politely yet assertively forward to get his chance at the single computerized console of nine fat pushbuttons.Â Each man convinced that he can beat the computer at Tic-Tac-Toe .
But, of course, none of them could.Â The strategy for not losing a game of Tic-Tac-Toe Â is a fairly simple one.Â If you know the strategy, a tie is the worst that can happen.Â Thatâ€™s what the computer had been programmed to do.Â Not lose.
But all this was so new, the challenge fascinated and obsessed every male in that room.Â Even at the age of seven, I could feel the energy swirling from male to male around me:
Surely I can beat it...!
No, surely I can beat it...!
No, surely I can...!
I didnâ€™t have a chance (or the perspective at that age) to examine the computerâ€™s visual display â€“ the crowd was so thick, I donâ€™t think I ever got closer than 25 feet to it -- but it no doubt involved individually-wired 60-watt incandescent light bulbs, theatrical gel color filters, a hand-built wooden frame, and lots of black felt and dark curtain.
But I will never forget the urgent press of the men in that room.Â That energy remains at the essence of our industry.
Fundamentally -- what we do doesnâ€™t have anything to do with video resolution, or the number of pixels.Â It doesnâ€™t have anything to do with speed, or hand-eye coordination.Â It is about framing a story.Â It is about framing a challenge.
"Surely I can beat this thing...!"
Fast forward to 2013. Â Thirty years after I wrote the original Dino Eggs, I have a chance to revive and expand the game.Â
What in the world could something like â€śDino Eggsâ€ť be now?
To Be Continued...