TI-83 Indy500 Invisible Walls

In high school, we were all required to have Texas Instrument calculators, and most of us had TI-83s.  Some kids had computer attachments for theirs, which they used to download games, and then spread them throughout the school.  We’d turned our School-Mandated Learning Equipment into game consoles. And the best part was that most of the games were running from a scripting language whose source you could edit!

The most popular of these games was a “racing” game called Indy 500.  You were an upside-down “^” symbol in the middle of the screen, and you could move yourself horizontally.   The track consisted of two columns of capitol “I”s on your left and right, which swerved back and forth as they scrolled up the screen.  Your job was to stay between the columns of I’s.  If you ran into one, game over.

We had tournaments to see who could last the longest during Biology class.  There was one kid, Jim, who was kind of a rich kid.  He was popular, but everyone knew he was kind of a douche with a sense of entitlement.  He wasn’t a bad guy, but we all loved to see him in a tough spot.  During these competitions, he started to complain about running into “invisible walls.”  He swore they were there, and we all laughed at him.  Some other people said they’d hit invisible walls too, but not nearly as loudly or as often as Jim, and usually not while he was around.

I, of course, had my nose in the source code of the game.  The copy running on my calculator had no collision detection; you could drive straight through the walls, and you could never lose.  I told them I’d turned my car into a tank.  They wouldn’t let me in the competitions.

I wrote the collision code back into my version of the game, and asked if I could join their competitions.  They still suspected me of cheating, first because I won every time, but this was normal.  Later, they got very upset with me when other players who used my calculator also did better than usual, although nobody could put a finger on why.  You still died if you hit the walls.

This annoyed me, because I hadn’t cheated.  I looked at the collision detection on another player’s calculator, in the fresh version of the code, and sure enough, there was a bug.  The game stored how far apart the walls were, and decremented this number every 20 moves, increasing the difficulty of staying between them.  It also stored the horizontal position of the wall on the left for each horizontal row on the screen.  If you were at the position of the section of left wall on your horizontal row, you crashed.  If you were at the left wall’s position plus the current width of the track, you crashed.

The bug was that the game only stored how far apart the walls were at the bottom of the screen.  They could be farther apart than that where you were.  So, if you were at the rightmost edge of the legal playing area of the screen when the wall width decremented, the game would think you’d crashed when you were still in bounds.

In an effort to clear my name, I explained all this Brett, the kid who was in charge of the competitions.  His reaction was “So there really are invisible walls?  You can’t tell Jim.”

It turns out that my fixing of the collision detection, which was to store the width of the track at each level of the screen until it was past the player, was also slowing game ticks significantly.  Three variable assignments cost maybe 90 milliseconds per tick, which made the game run about 1.6 times slower.  That, along with the lack of invisible walls, was why I was winning.

It turns out you can still find this game! https://www.ticalc.org/pub/83/basic/games/arcade/racing/ has it about halfway down the page. The contents of the file aren’t readable, though. You probably need an actual TI-83 to read the binary as source.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: