When I set about creating the Half-Byte Computer/Console, one of the things I, personally, wanted to do with it was create a small, easy to program, micro-micro computer that harkened back to my childhood, otherwise known as the 1970’s. In order to do so, I needed the language that I learned back then, Tiny Basic, to work on the device. I did both and it works great. However, one of my goals with this combo was to play Tiny Trek.
Now, Tiny Trek is small, compared to its big brothers that ran on computers with gobs of memory (you know, 8k) and something called ‘Microsoft Basic’ or ‘Microsoft Basic-80’. These behemoth Treks’’ would clock in at around 4k to 7k or more. Tiny Trek, however, was small, about 1.5k.
Wow, that’s BIG! At least, it is when you have less than 1024 bytes (1k) of RAM to work with.
I am still looking for a solution to the RAM squeeze.
Anyway, My goal of running Tiny Trek in Tiny Basic is yet to be resolved. HOWEVER…I have decided to code it in Arduino C. This way, the code can be what ever size it needs and I can have more memory for graphics. I am also considering making it multiplayer, instead of the computer being the Klingons, one player can be Klingon and one can be the Federation.
Only problem is time, which is in very short supply right now and I’ve got several other things ahead of this, but, I can still plan it out, right?
So…here’s my thoughts on multiplayer Tiny Trek for Arduino. You won’t need a Half-Byte computer, but if you do….let me know!
Input and Output
Since this is supposed to be a simulator, I’m thinking we don’t need a full keyboard, so a keypad will work just fine. I have a few sticky back keypads that I can use. They have 0-9 and a-d and few other keys. They should work just fine. I was also thinking of using the Wii Nunchuk, but I am thinking that is overkill and limited in use. But, I may have dedicated buttons for phaser/photon torpedo and shields up/down.
I’m going to use video and audio, but I am also thinking that a small status display is in order. I have a few 2×16 lcd panels, but they use the serial I/O, which will be used for communication between the two computers, so I may use the little Nokia 5110 LCD’s. They are similar in resolution to the video, so I could swap screens if needed. I’m thinking the little screen could show energy, torpedo inventory, shield status and other info. Video would show the short range/long range display.
For now, serial will be used to communicate with the two computers. As each computer will be running independently, I’m thinking code in each version of the game will have to have a main loop that will then monitor communication from the other computer and alert the user accordingly. It also needs to ‘run’ the ships functions and service the UI. Our snappy 328’s are perfect for this. Oh, it also has to monitor the keypad and update the secondary screen. No problem.
The game, as stated above, will start and run in a loop. This loop will simply call various functions that will then control the game. This main loop will:
The game modules contain the library computer, short and long range scanners, battle mode, navigation, ships condition.
Game play will be very similar to the 1970’s version in which you have to seek out and destroy the dreaded Klingons. Instead, however, of having to destroy x number, you have to only get one…but that can be hard as that one is another player who will play unpredictably AND it will be much more difficult to destroy the ships. There will be only one starbase for the Federation and one for the Klingon. You must protect your base as it CAN be attacked. You cannot, however, use phasers or torpedos while ‘docked’. The Klingon CAN, however, attack while you are docked. Undocking will use one move and you will be vulnerable while doing so. Klingon bases can cloak for a short time.
Victory is achieved when you destroy your opponent. You do so by: forcing them to use up all shields and power. When both are depleted, they will be given the opportunity to surrender. If they do not, you must destroy them. If you do not, they can escape and the game will end in a draw.
In addition to the keypads and secondary screens, I’m thinking the PIN 13 LED can be used for the RED ALERT. It blinks when your opponent is in range. Some cool things that can be done…the previously mentioned buttons for phaser/photon torpedo control and shield control, there could also be a self destruct (have not thought much about it, though.) You could get as complicated as you want, provided you have enough pins.
Serial is the best way to talk to the computers, but that does not mean they have to be wired. There are cheap bluetooth modules that communicate serially and then there is the super cool and super cheap ESP8266 WiFi boards. And, the best part is that you only need a few lines of code to set them up, no additional libraries are needed.
So, there you go, a multiplayer, interactive Tiny Trek for Arduino. What do you think? Leave your ideas, suggestions, whatever in the comments below.
Hoping it wont be too long before I can start this. Of course, I need someone to play with…maybe an Internet option too….hmmm….