Multi-Player Tiny Trek for Arduino

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

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

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

Communication

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.

Game

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:

  • monitor serial i/o
  • update the video
  • monitor the keypad
  • update the secondary screen
  • run each game module
  • do it all over and over until game won or ship is destroyed

The game modules contain the library computer, short and long range scanners, battle mode, navigation, ships condition.

Game Play

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.

Hardware

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

Star Trek Tech: It’s all coming true?

In 1966, when Gene Roddenberry sold his ‘Wagon Train to the Stars’ concept to Desilu Productions, and, ultimately, to NBC, things like personal computers, tablets, ultra compact mobile phones and pretty much everything in his concept, were all the stuff of science fiction. It just didn’t exist. Star Trek’s ‘writers guide’ was chock full of plot devices like the transporter, wireless earpieces, tricorders, phasers, communicators and warp drive. None of it was  real. In fact, 99% of the technology just did not exist.

Fast forward to the mid-1980’s when the Next Generation came out. A lot had changed. Personal computers were taking shape and starting to become household items. Cell phones were starting to take hold in mainstream life, though they were still very big and very expensive. Video technology was advancing. We had ‘regular’ space flight with the Shuttle program and Russia’s space program. We had actually been to the moon.  Things like transporters, replicators, PADDS, phasers, photon torpedoes,etc. were still not there. But, it was much easier to visualize such things because of the leaps in consumer and industrial electronics.  Most scientists, though, still didn’t believe warp drive and transporters were possible, at least not in the foreseeable future.

By the mid 1990’s, however, another leap in technology over science fiction began and, by the time Star Trek: Enterprise debuted, were pretty close to that original vision. Flat screens were taking off, hand held ‘flip phones’ were the hot thing and many resembled the communicator from the original show (and Enterprise.) Lasers, which were around in the 60’s, were much more commonly used and even developed as weapons. Even tricorders were getting more real. So, how much of the science fiction based technology is here now and what’s to come of the rest?

So read on and see where we are with Star Trek tech.

Communicators

Cell phones have been around since 1973, but did not become a practical and affordable consumer device and service until the late 1990’s.  Motorola led the way with its Star Tac, the first popular flip style phone, It also strongly resembled the original communicator in Star Trek. Cell service blanketed much of the country and large swaths of the planet.  Iridium, a satellite service, was the first to make cell service available where ever their satellite network could be ‘seen’, which was pretty much everywhere. The 2000’s saw cell phone technology explode and the phones became small computers that could also place phone calls.  Today’s smartphone (which can trace its roots back to the early 1980s with AT&T’s Simon) packs more computing power than NASA had during the moon shots.

Tricorder

The tricorder was amazing. A portable computer, always connected. A portable lab.  A sensor powerhouse. This thing could detect life, answer complex chemistry problems, do all sorts of things. While no one device exists (that I know about, anyway) there are devices with many of those capabilities.  Many smartphones come close.  A medical equipment company even manufactured and sold a device that not only looked a lot like McCoy’s tricorder, they named it something very similar. With today’s 3D printers, cheap microcontrollers and equally cheap sensors, I doubt it won’t be long before someone builds one that looks just like Spock’s tricorder and does much of the same scientific work.  More complex tasks (which would call for higher power chips) aren’t out the question. I’d say these things are no longer the stuff of science fiction.

Wireless earpiece

Uhura looked stunning with that earpiece in or out of her ear.  Indeed, not only was she a beautiful lady, the earpiece itself looked great. The same cannot be said of today’s Bluetooth earpieces. In fact, it seems that only Uhura can pull off looking good and normal while wearing it. Appearance aside, Bluetooth earpieces are actually quite remarkable. They are much smaller than Uhura’s, probably do much more (we only knew she could hear, they never used them for anything else.) While they have a ways to go in the aesthetics department (and, for stereo, apparently in pairing and continuous use without skipping) before they become as cool as the Enterprise’s inventory.

Replicators

Replicators were only hinted at in the original, and then only for food, but the Next Generation show made liberal use of them.  We do not yet have instant replication, we do have 3D printers. These printers, which use ink-jet technology, come in a variety of sizes and employ a variety of techniques to make a three-d object. The common method is to melt strands of plastic. Others use tiny little beads. All build up the object from the bottom to the top.  Results vary and the technology is getting better and better. There are also food printers. These ‘build’ food out of organic material. There are even 3D printers that can recreate body parts out of living cells. It is quite remarkable.

Computers

Computers were around when Star Trek was created. They were big, expensive and very user unfriendly.  The computers of Star Trek used touch, switches, ‘tapes’ and voice.  It is easy to forgive the ‘tape’ moniker as that was the prevailing term of the day and everyone knew what it meant. It was the voice interface, however, that was intriguing.  Spock could carry on a conversation with the computer and both could understand what the other was saying. Today’s speech recognition technology has improved to the point where it is now a mass market tool.  Automated phone systems, Apple’s Siri, Microsoft’s Cortana, Google’s system…all work well.

The Next Generation’s PADD device has also come to fruition. Microsoft had long pursued the tablet computer, but it took the market prowess of Apple to make them common. Today, there are small tablets that resemble the PADD from the Next Generation.

Phasers, photon torpedoes

While phasers and photon torpedoes do not exist as portrayed, we do have powerful lasers that are used as weapons. These things can burn, blind you and cut. They cannot, yet, blow things up or vaporize things, they are, nonetheless, used as both weapons and tools. No pistols or rifles yet, but truck and plane mounted lasers are here today. As for photon  torpedoes, there are rumors of plasma like devices that may, one day, become torpedoes or missiles.

Warp Drive

Like Transporters, warp drive was once believed to be impossible.  That NASA is, apparently, even thinking about it shows that we could, in fact, build such a device.  They even have a design that resembles a Vulcan warp capable craft with an ode to the Enterprise.  The theory behind warp drive is sound, but, for us, the problem becomes power. We, currently, just cannot generate enough to create and sustain a warp bubble.  But, there is work being done here.

Transporters

It seems, everyday, I read about some scientist successfully transporting light-and, now, a particle-a few feet. The research is progressing, but there are many, many hurdles to overcome. Where do you store the trillions of billions of pieces of information that make up a person? How do you break down matter, then put it back together without harming it? You don’t. You have to destroy the original to make the copy. How many times can you do that before you introduced errors? The important thing is that progress is being made.

Commander Data

Now, here’s something that always puzzled me with the Next Generation. They’ve done all of these amazing things. Cured the headache. Cured cancer. Warp Drive. Tackled disease, hunger, human greed.  But…there’s only ONE ANDROID that works? Weak.  Anyway, today’s androids are a far cry from Cmdr Data, but we are very close, at least in form.  Humanoid robots are getting better and better. The mechanical aspect is nearly perfected.  Many human robots are made to look like robots on purpose: so they don’t scare those who would be using them. It’s the computational end where the work really needs to happen. Artificial intelligence.  I once tried to write code that would mimic walking into a McDonald’s and ordering a Big Mac.  Do you realize how difficult that is? The sheer number of steps involved is amazing. And I only started with walking into the restaurant. Not getting out of a vehicle.  Think, the next time you go into a fast food joint, about everything you did to walk in, place your order and then eat. Seems easy, but not when you are teaching a machine to do so. AI is smart, but needs to be smarter if we are to engage it like a Cmdr. Data.

Deflector Shields

Still science fiction devices, but not for much longer. Work is being done to direct energy in a way to reflect anything coming toward it. Many techniques have been discussed but, as with warp drive and transporters, energy is the key.

ION Drive

ION drive is real and has been employed on several space probes.  The propulsion is slow, and it takes time build it up, but, the technology does work.

Sickbay’s Diagnostic Beds

When Star Trek was first broadcast, Roddenberry received several requests about the diagnostic bed.  What did they use for the sound? What type of sensors did it have? These were questions from doctors-smart people-who knew that it was make believe but were interested anyway. Roddenberry, supposedly, toured the set with a few of these people and the effects guys allegedly gave them a sample of the sound.  Well, it must have made an impression as today we have these beds. I’ve seen them myself. My late father in law had a heart attack in Myrtle Beach, South Carolina while we were on vacation. The heart center rooms had these beds that could, with few physical connections, detect his heart rate, oxygen levels, temperature and a slew of other things. It was remarkable.

Dr. McCoy’s HypoSpray

Another part of the Trek mythos that is now fact.  Hypospray guns are commonly use to administer vaccines and other medicines.

As you can see, what was once science fiction is, mostly, science fact. We still have a way to go before we meet Surak or experience Shakespeare in the proper Klingon way, but we’ll get there.

BASIC Stamp, VB.NET and LED’s=a great Starship Simulation

sttrk2While taking a break from my XGS PIC Tiny Basic project, I’ve been experimenting with my Basic Stamp Homework board.  While playing around with the seven segment LED counting circuit, I realized that I had a pretty nifty little computer that could interact with software on my Windows computer while also making something happen on it, something that interacts with the physical world. Like lighting up an LED or moving a servo.  That got me thinking about interactive smart games.

While pondering this, I was also looking for a small, Star Trek game that I could adapt as an example game for my XGS PIC Tiny Basic project.  Suddenly, I remembered an article in an old Interface Age magazine that outlined a very complex starship simulation. In the article, the author wrote about networking several microcomputers (it was a late ‘70s magazine) that would each run part of the simulation and one ‘central’ micro would bring it all together. Hmm…Star Trek, BASIC Stamp, Windows…

So, I whipped up a two LED circuit (ok, I ‘built’ it from the book) with a red and a green LED.  I wrote some simple code to:

  • light up the appropriate LED based on the ‘ship condition’
  • search for the nasty Borg (I updated the game)
  • alert the Windows computer when a Borg cube was ‘found’
  • the Windows computer displays the Borg threat on an Next Generation style screen
  • do not much else at the moment.

Now, when I’m done with the Tiny Basic project, I’m going to explore this game a bit further. Imagine having several of these Basic Stamps connected, each running, say, a borg simulation, the ships computer or even another alien species hunting both down. You could get quite elaborate and since each Basic Stamp would be dedicated to a specific function, you only need to worry about communicating with the Windows computer and that is something that the Basic Stamp does very well.

An enterprising soul (hmm) could build a Next Gen looking housing and mount switches, LED’s, etc. for an even more engrossing game.  The possibilities are endless.

CES 2012: the replicator and Roku

This past week was highlighted by the Consumer Electronics Show in Las Vegas. This is typically the trade show where companies show off the gee-whiz technology products for the coming year. Indeed, some really nifty tech has been introduced and showed off at CES.  Every year, at least one product or category tends to stand out. Last year, it was 3D television and tablet computers.  This year? Well…nothing, really. Oh, there were lots of both, but no one stand out product or category.

In fact, the show seems to be kind of a dud.  Granted, I was not there in person, but, then again, with all of the coverage and live blogging, I didn’t need to be.  In fact, I don’t feel the need to even really cover it since it is already over covered.  However, I do feel like I need to say something about it…it is, after all, a big deal.

So…did anything catch my eye? Well, yeah, a few things did.  The MakerBot Replicator 3D Printer, for me, is the most exciting product shown off at the show. The printer, much like the replicator on the Star Trek the Next Generation program, MAKES THINGS. Yes, it is a true 3D printer.  Feed it a pattern and it will, layer by layer, build a real 3D model for you.  Now, you won’t be able to replicate, for example, a television or a full size auto, but you will be able to make individual parts, toys, forks and other small things.  This is great for prototyping, toy making, replacing smaller parts, etc.  I see all kinds of uses for this thing.  Miss that Lego brick? No problem…print a new one.  And therein lies the problem too.

As with video and audio, copyright infringement will come into play.  Go ahead, make that Lego brick and risk breaking the law.  Just imagine the wheels at the Lego company when they figure out how easily their product can be reproduced.  These printers and the material are currently very expensive but they are coming down in price.  $2000 will get you a dual color MakerBot replicator.  Next year, they may cost half that.  As soon as they break the $299 barrier, that is when you will see a real cry from companies that, previously, did not normally have to worry such things as homemade parts.  Oh man…DRM on 3D patterns.  Progress.

Another product that caught my eye was the Roku HDMI stick. Until, that is, read more about it. ON the surface, it looks great. Roku’s next set top box is not a box but a dongle. An HDMI dongle. They squeezed an entire Roku into something not much bigger than a USB stick.  Pretty amazing…but…most HDMI equipped sets will not be able to use this thing as it uses a different type of HDMI connector…one that is not yet on most devices.  Sigh.  I would buy one, two or more of these things but…not going to replace my TV’s any time soon.

So, two products out of thousands.  Not good.  I am starting to think I have gotten jaded.  I’ve grown so used to be being wowed and, when I’m not, I’m really bummed and that is how I feel about CES this year. Just not much happened.  Other than Nintendo demoing the Wii U to a handful of people, that is.  Oh well, I guess there is always next year. Or Apple’s next big announcement…I wonder what that could be.

Digg This

They did what? Thank Hedy, Bing, Lucy and Arthur for our techie life

A recent Facebook post from someone in the Windows group got me thinking about contributions by people whom you would not otherwise associate the contribution.  This particular post was about Hedy Lamarr and the Spread Spectrum method that is the basis of most modern communication systems.

Hedy LamarrYep, Hedy Lamarr, the gorgeous and glamorous star from Hollywood’s earlier days is one of two people responsible for the foundation of Wi-Fi, Bluetooth and cell phones.  How’s that?  Turns out, Lamar was a mathematical whiz.  Taking an idea from her neighbor that involved multiple player pianos playing at the same time.  Lamar and the neighbor, George Antheil, patented the idea in 1942.  The idea was also submitted to the Navy as a means of protecting radio guided missiles (using piano rolls to switch 88 frequencies on the fly) but was ultimately rejected.  The idea was put into use in the 1960’s during the Cuban Missile Crisis.  Of course, the idea is in wide use today and is taken for granted, but in 1941, when the patent was submitted, it was ahead of its time and was due, in part, to an amazing actress named Hedy Lamarr.Patent drawing

Bing Crosby also lent his hand, or funding, rather, to technology. During the 1940’s and through most of the 1950’s, many television programs, especially variety shows, were broadcast live.  When coast to coast live programming became a reality, this meant that those news and variety shows had to be done twice: once for the east and once for the west.  Bing Crosby, tiring of this practice for his show, commissioned his laboratory to come up with a better way.  Kinescope recording was the standard method at the time for recording shows. This process involved placing a movie camera in front of a video monitor and filming it.  The result, while viewable, was less than ideal as it meant a muddy picture, film that had to be processed and edited and cost.  Bing’s labs, in conjunction with Ampex Corporation, developed the first practical magnetic video recorder, a direct descendant of today’s (or yesterday’s) VCR.

Lucille Ball also left her mark on pop culture and, indirectly, on technologies in use today. How’s that? Well, America’s favorite redhead was owner of DesiLu Studios.  So what? Well, DesiLu is the original studio that produced Star Trek and, as head of said studio, Lucy gave the final word on productions.  She reportedly liked Gene Roddenberry and loved the Star Trek premise. When the original pilot was rejected, she stood firm behind the show and it, ultimately was sold to NBC.  While Lucy unloaded the studio in 1967 to Gulf + Western, she had left her mark and didn’t realize it.  Many astronomers, inventors, scientists and a few business people have said that it was Star Trek that influenced them and many of those people have gone on to be responsible for many aspects of our lives. Perhaps the most public of those influences is NASA. Not only was a space shuttle named after the iconic starship, but Lt. Uhura herself worked at NASA for several years.  A person you may not have heard of, but has certainly left his mark on technology is Rob Haitaini, a designer for Palm. He is the person who designed the UI for the Palm OS. He has credited Star Trek as the inspiration for his work. Arguable, Palm set the standard for small, touch oriented devices such as those seen in the Star Trek the Next Generation program, which, again, would never have been made if it were not for Lucy. The original show also portrays many devices we take for granted: Bluetooth earpieces like the one used by Uhura, ultra portable communications in the form of cell phones (the communicator, which also suffered similar problems that we have with the phones), portable computing and others.  While Lucy’s motivation may have been profit, that she stuck with the show as long as she could says a lot about her. Lucy, we still love you.

Arthur C. Clarke, well known science fiction author, is responsible for pretty much our modern means of entertainment and communication…sort of. In 1945, Clarke proposed the notion of extra-terrestrial relay stations.  His idea was to use such stations to relay radio signals around the globe. These stations would be in a geo-synchronous orbit so they appear to be in a fixed point overhead.  That orbit is roughly 22,500 miles above the earth.  Though this idea was put forth in a slightly different manner some twenty years earlier by a German named Herman Oberth.  Clarke acknowledged this in a later work.  Regardless, Clarke is widely acknowledged as the ‘father of the satellite’ and, as such, is indirectly responsible for the delivery mechanism for the way in which 99% of our phone calls, television, internet and even astronomical observations are handled.

So, you have two actresses, a crooner and a science fiction author who, collectively, had a tremendous influence on our lives.   Kudos to them and kudos to the thousands who actually made all of this stuff just work.

Digg This

What’s old is new? Is that always a good thing?

So, Netflix is finally making available the Star Trek series.  Four of them, so far (oddly, Deep Space Nine seems to be missing) including the Original Series.  I’ve been watching the Original Series, starting with the ‘Cage’, the original pilot that never aired on NBC during the series original run. While watching, I noticed that the shots of the Enterprise looked really good…too good.  Then I remembered that Paramount remastered them for a new round of syndication, trying to entertain today’s fickle audience and, I suppose, to make them look more modern because of the 2009 film.  Fair enough.

For the most part, the remastering works.  The sound is crisp, the music seems sharper and the visuals are much cleaner.  And therein lies the problem.  The work is too good.  The remastered prints don’t seem to fit the time the show was produced. The new special effects don’t mix well with the rest of the episodes.  For example, take any shot of the Enterprise orbiting a planet. It looks fantastic.  Then, however, the episode switches to a planetary scene which is obviously made up of paper mache, styrofoam and cardboard. The backgrounds are obvious paintings. So, in one scene, you have this modern, digital like scene of the Enterprise and, the next, you have a set that looks like my son painted it in elementary school.

I understand why Paramount would want to do this, but I think simply cleaning up the visuals and enhancing the sound would be enough.  (The only issue I have with the visuals is the color…they pumped it up way too much in places, but that’s ok, it works.)  Re-doing the effects, however, was probably not worth the effort.  It would be like taking a movie like Gone With the Wind and adding 3D to it.  Yeah, the gimmick might work for those who had never seen it, but it would add little and probably even detract from it quite a bit.

Sometime making something old look new is worth it, most of the time, not so much.  In this case, it’s a mixed bag.  Somethings, like an old Civil War rifle, you don’t want to clean it up. Having it show it’s age is what makes it valuable, unique and worthy of  owning. And yeah, Star Trek is an old TV show, but preserving it intact says a lot about the time in which it was made.  The people who did those effects had little budget, yet accomplished quite a bit and that should not be erased simply because a 14 year old boy might think it looks dumb.  At 14, you can’t appreciate anything, let alone what a group of artisans could do with a little money and a lot of creativity.

I use Star Trek as an example, and I don’t mean to imply that Paramount is trying to deceive anyone. They aren’t. The old versions are still around and can still be had.  And that is true with many remastered movies and shows.  I fear, though, that as time goes on, these remastered versions are what will be commonly available and the originals will be forgotten. Like Star Wars.  I have not seen the original, as seen in 1977, in a decade.  Even before Lucas reshot certain scenes, the film had been altered.  I think the only copies still around are the original CED and LaserDisc releases. Maybe VHS/Beta, not sure. 

I remember a few years ago, there was a flirtation with colorization of old black and white films and TV shows.  A lot of movies were colorized, but were met with a lot of resistance, so much so that Congress got involved. However, a new process has resulted in better looking colorization, so good that it is hard to tell that the films were not in color to begin with.   However good the process may be, the fact is that these films were not originally in color and making them color alters the film in ways that could not have been planned for, regardless if the producer/director wanted it in color or not.  It still alters the original and not always for the best.

Don’t get me wrong, I’m not against a little soap and water. I do think, however, that it should be used where appropriate and with good thought.  Replacing portions of a work with something new just because it might appeal to a small group of people is just wrong. 

Digg This