jueves, 29 de octubre de 2009

My first big program

Around 1990 my uncle Ibrahim and my aunt Enriqueta, gave me a great gift, a computer. I don’t remember the brand but it was a Commodore 64 equivalent, not really sure if it was a TRS-80. The Computer had Floppy Disk and also came with a Tape Recorder, and a couple of games in cassettes. Unfortunately the connection cable for the Tape Recorder was absent, but that was no problem for someone with initiative. After some experiments, and accidentally deletion of a couple of games, I made my own connectivity cable. The advantage of having the cable was that I was able to read and also save information in cassettes.

At that time I was already a fan of Robotech, so I start a personal project to create a Robotech Game. For the computer, the development language was BASIC. The Idea was simple, as with the series, the SDF1 will appears somewhere in the orbits of the outer planets and will need to return to earth.

That was a good project because I needed to make a lot of research. First I investigate a lot for the planets. Size, gravity, orbit, distance, year period, etc. I was trying to have a scale planetary system. The only thing I skipped was the elliptic orbits. All my planets had circular orbits. Once I had the orbits I included the spaceship, with the random start location. When I was remembering the project with a friend, he told me how I manage to get all that information together, specially at that time and without Internet; thinking backwards, maybe in the past we spend more time making research, but it gave us (at least to me) a satisfaction feeling of getting things done.

The game was easy, the ship will only move linearly, this is, it will not be orbiting around the Sun (there was no need for it as I want only to have fun), then with each step you indicate the acceleration and time span. As you accepted the values the computer make calculations and show the new position of the ship (and the planetary system). Sometimes you were able to see the planets in the screen. Also a zoom factor allows seeing all planets in the same screen or only a certain section of the system, always the SDF1 in the center of the screen. The goal was to get to the Earth, in pixels speaking, the SDF1 and the Earth need to be at the same position at the same time. This means we need to slow down as we get closer to Earth.

A subsecuent version of the game allows the SDF1 to move to any place in the solar system, moving not only in 1 axis. The game had random objectives, get to some planet because it needs our support. In this new version we need to stop exactly at the planet with a velocity of cero. The execution was also in turns. We first need to accelerate and at some point we need to slow down. Problem was that the planet was also moving, so, we need to anticipate its location for the time we get to it. For this problem the game had a suggestion option; given the required time, the game computes the final planet location and estimates the required acceleration/deceleration to accomplish the mission.

Again it requires some investigation to infer the required formulas to implement all options.

All programs were stored in cassettes using the Tape Recorder.

As I move on in technology, pass the computer to somebody else, but kept the good memories.

No hay comentarios: