Raspberry Pi Bartop Arcade

Images can be found here: https://goo.gl/photos/eC5iNCz3eda9714A9

The original inspiration for this idea came from watching this video: https://www.youtube.com/watch?v=RcsKNryPAzw. It shows how to set up a Raspberry Pi with the Retro Pie linux distro. It was a simple matter to get it up and running once the parts arrived. Of course, you can just run it “out of the box” as-is, but i like to tweak things, so i spent a week or so digging around configuration files and making small changes here and there. All the instructions you need are either in the video or can be found via google searches once you know what to search on from watching the video. Once I had that up and running, it wasn’t too long until i wanted to build an arcade cabinet to house it in.

This is where things get interesting. Because i naturally started with the same set of videos from this guy on how he built his arcade cabinet (see the 3 part video series, starting with this one: https://www.youtube.com/watch?v=K3QXLQ1UXqs). That’s pretty cool, but … wow, it’s also alot to chew off for a first project like this (at least it was for me), so i’m glad thhat he also had a video on building a bartop arcade cabinet. You can check that out here: https://www.youtube.com/watch?v=X6IX27FILus&t=240s.

And from there you can pick your poison with about a hunded different people showing their own custom bartop arcade cabinets. However, I decided to stick to his since his tutorial on the electronics portion had worked out so well. I picked up a copy of his plans ($5 on his store, linked from the video above), and started buying all the materials and tools that i would need.

And for the most part, I followed his plans. But there were definite gaps that he has in his plans and videos that you just sort of have to fill in on your own. Which is why i started looking at other plans in the first place.

Don’t get me wrong – his plans are totally worth it, and the tools list he provide (with links to ebay and amazon for almost everything) are excellent, but it’s not perfect. Here are a few gotchas you’ll run across:

* his videos go very fast and gloss over a lot of things, some of which are covered in his plans, others which you just have to guess at

* one big gloss over is cutting the angles in the wood. i’m not good at just eyeballing stuff, so i went through a lot of trial and error everytime i had to make two pieces meet at an angle. other plans out there give you precise angles to cut the wood at for each piece.

* the link he gives for the routing tool to cut the groove in the wood for the t-molding is good, but the groove it cuts is just a tad too wide for the tmolding (with the link also provided by him). In the video is shows him having to tap the tmolding in with a rubber mallet. In my case, the tmolding just fell out because it was too loose. I had to use hot glue to get it to stay (but once in and dried, it looks fabulous)

* his plans don’t include anything about speaker grills. and without those, you’ll be listening to muffled sound coming through the wood. Several other plans (this video in particular), give a link to a great set of speakers to get off amazon and then using a 1/4″ drill bit, make a grid pattern on each side that the speakers can project from. https://www.youtube.com/watch?v=JjN0kbcG9j0&t=355s

* another mising piece is a handle to carry help carry it with. The link above has that, and i would add a handle if i were to redo mine. it’s very akward trying to lug the thing around with nowhere good to grab hold of

* finally, his templates include the button and joystick layout that you print at full size, place on the control board piece of wood, and drill. which i did. and then i found to my dismay that his plans don’t actually fit (my wood was the corect size, the print was printed accurately, and covered the wood exactly). but he didn’t leave enough room for the joystick and the buttons to all fit. the joystick overlaps one of the buttons and thus you can’t attach it. I had to create my own template and make a new control board. not hard, but time consuming and a bit annoying that he didn’t seem to test his own plans.

But that aside, definitely watch his videos and use them as a starting point. Look at some other videos, see how others have done it, and then pick whichever method works best for you.

Good luck!

The Adventures of Feldon Grimshaw: The Ruined Keep of Hidden Vale

As I awoke this fine morning, I cast about for something to do. Adventuring of late had become rather routine. Wake up. Head into the swamp. Kill some giant spiders, wrestle the crocodiles, and slay the evil undead who dared to cross my path. It was all good and fine, and did increase my skills, to be sure. But today I wanted more. Something a bit more challenging.

As I was eating my breakfast (a tasty rabbit that had wandered into my camp as my stomach started to growl), I poured through my field notes and remembered seeing a ruined keep a few weeks back. I had asked about it at a nearby town and the locals informed me that it was haunted.

Said they:

“Originally a northern outpost of the Vale which kept a lookout for pirates and ruffians on the North Seas, it had fallen under a curse one day when the two brothers who were in charge refused entrance to an old beggar woman who had asked for shelter one night. Of course the old woman was a powerful witch. She cast a spell upon the keep. A terrible plague ravaged the men and one by one they fell. But the dead did not stay dead. Some came back as foul smelling zombies. For others, their flesh fell from their bones and they became living skeletons, doomed to continue their watch for pirates for all eternity upon the walls of the keep.”

“But the two brothers had the worst fate of all. They became powerful lich lords. The most powerful of the undead. But with all this power, they were impotent, as they were unable to leave the keeps throne room. It didn’t take long for the two brothers to go mad and they have been locked in an eternal battle with each other ever since. They continually fight, maim, destroy, and ‘kill’ each other in the worst and most painful ways possible, only to revive moments later and start it all over again. Even the legions of undead steer clear of the throne room.”

Receiving this information, I had decided to pass on this adventure at the time. But I just knew there must be treasure in that keep. Nobody had ever dared face the legions of undead guardians, let alone take on the two lich brothers. Surely all of the pirate ships they had defeated over the years must have held hordes of gold and jewels, which even now must be safe within the keep.

It was settled. I knew what I must do. After breakfast I polished my sword, donned my adventuring garb, readied my arsenal of spells, and made for the keep.

As I drew near, my spirits were high. The weather was warm and beautiful. The sun upon my face gave me courage. The wand at my side hummed with power. Nothing would stop me this day!

The first enemy to fall was a foolish bear in the forest surrounding the keep. I saw it long before it saw me, and i had decided to let it be. But (foolish beast!) once it spotted me, it charged. A quick blast of my “solar burst” spell put him down. I didn’t even bother to skin it. I had a castle to storm! Several wolves also had the misfortune to meet me on the path. Spells were too good for them. I simply whipped out my sword and took off their heads in a single blow.

Finally around lunch I arrived at the outskirts. The pathway was overgrown from unuse. There was a large stone bridge that crossed a canyon and lead straight to the keep. But sitting in the midst of the bridge was an enormous troll! Such a huge hulking beast would be quite the challenge. I had no doubt that I would prevail. But I didn’t want to spend the time or effort on him. My goal was the lich lords and their treasure, not a stinking troll who would likely have a few pieces of slime covered gold in his filthy pockets. Fortunately there was a small pathway that lead under the bridge and up the other side. I took this and easily avoided this unpleasant confrontation.

As I approached the keep, I noticed it was surrounded by a large moat. After discreetly circling around, I discovered 3 entrances. First, there was the main gate – which stood invitingly open. I discounted this immediately as a trap. Second, around to the eastern side, there was a breach in the wall where it had crumbled from age, the elements, and lack of repair (note: undead are terrible at home maintenance). This looked like a good option, but i opted for the third. From the western side there was a ladder which lead up to the main bulwark. It was guarded by a single skeletal archer. Easy pickings. I quickly and quietly dispatched the foe, looted his gold and crept along the defensive wall until I was at the closest point to the inner keep.

At this point, I had no choice but to announce myself. There were at least a dozen skeletal warriors milling around the grounds, keeping their eternal vigil. Fortunately I had surprise on my side. I cast several fireballs, rings of fire, immolation spells and fire arrows at the lot. Meanwhile, my unwitting yet faithful partner (an air elemental I had summoned to accompany me) was showering down lightning bolts, chain lightning and the like. They didn’t stand a chance.

Once the courtyard was cleared, I made my way to the inner keep. It was eerily quiet, but I could sense the malice on the other side seeping through the stone walls. Using a rusty key I had found outside the moat, I was able to move the lever and raise the gate. No sooner was it cracked open then hell itself was let loose upon me.

Expecting this, I had cast several healing spells moments before that had long durations and ongoing healing effects. It was good thing too, because there were just as many skeletons in the inner courtyard as in the outer. And these warriors were armed to the teeth with halberds, large heavy shields, and long rusty swords (I must remember to check the status of my tetanus shot!)

The battle was intense. Skeletons were dying all around me, but even with my healing spells doing their best, I was feeling weak, and I could tell that my magical reserves were getting low as I cast spell after spell. As the dust settled and the creaking of bones ceased, I stood victorious! My poor elemental had not fared as well and was nothing more than a memory.

Rather than enter the throne room, I took a few moments to rest, gather my strength, and organize my spells. It was a good thing for me that the lich lords never left (in fact were unable to leave) the throne room, or I would surely have met my maker this day.

Once I felt ready, I summoned another elemental, cast my healing spells anew, and entered the throne room, ready to face a fierce battle. To my surprise, the lich lords were easy to dispatch. True – every time they struck a blow on me, I reeled in pain and was alarmed at how weak I became. But my spells were having equally devastating effects on them, and I was casting spells faster than they were landing blows. When all was said and done, the lich lord brothers lie dead at my feet. I like to think they were thankful to finally find rest after the many centuries of pain and horror they had suffered at each others hands.

Greedy to find the treasure, I didn’t even bother to heal my wounds. Surely there was nothing left alive that would dare molest me within these walls. Oh foolish adventurer! Horror movie rules #1: NEVER assume that the monsters are all dead. As I traveled around the throne room looking for a treasure chest, I was beset upon by a skeletal archer who sprung up from the ground right before my eyes! He must have been hiding in the throne room for centuries trying to avoid the wrath of the lich lords. But now that they were dead, he seized his moment and attacked. My health dropped so low that all I saw was red … except for my health bar, which appeared to be empty. Thank the maker, it hadn’t quite dropped to 0. I quickly cast every single health spell at my disposal and was able to hold on long enough to hack the creature to death with my sword. And what did I get for my trouble? 14 gold coins, a broken bow and arrow, and some smelly corpse wax.

Where was the fabled treasure? In vain I searched the throne room, the inner keep, the outer keep, the rampart, the grounds inside and out and all around. There wasn’t a single chest to be found. Either it was all a lie, or someone had come before me and silently stolen the treasure ages ago. My only consolation is that I had a hand in breaking the curse of eternal torment on this place, and was able to send several dozen souls to their eternal rest.

Anasazi Ridge Petroglyphs

It’s been a while since i posted on my blog. Mainly i’ve been using Facebook, and/or Google+ for short-form items. But this is rather interesting and a proper blog entry seemed more appropriate.

Over the Christmas break, we visited a few different petroglyph sites. This one, known as the ‘Anasazi Ridge Petroglyphs’ was especially interesting because one of the murals (is that the right word?) is actually a map of the sky. You can see the explanatory image here:

If you like, you can read about it in more depth here: http://ancientworldblog.blogspot.com/2015_08_01_archive.html

And if you are ever in St. George and want to check them out, this page has good directions: http://utahpetroglyphs.org/?p=21

Why the Like button is broken

It’s been a long time since i’ve written a stand-alone blog post. But there have been many instances recently in which people have been offended by the Facebook Like (or similarly, starring something on Twitter or Liking it on Instagram, +1 on Google+, etc.).

Let’s take an example to explain what i’m talking about. Suppose someone in your feed posts a cat video of someone tossing a cat into a bathtub. Someone else clicks “like”. How do you react? Before you answer, go watch this cat video:


Now, here are several reasons someone might have posted it, and why someone else might have liked it:

  • was it funny? i mean, it’s a cat scrambling to get out of the water. how funny is that?
  • was it cute? it’s a cute fuzzy, drenched cat. cutest thing ever.
  • was it offensive? Call PETA – these guys are being cruel to that poor cat. Not only did they toss it in once “because it was hot and needed to cool off”, but they did it again, and didn’t help it when clearly it didn’t want to be in the tub
  • maybe they just clicked ‘like’ because of the person who posted it and they always click like on their posts

If you’re offended that someone clicked like, don’t assume you know their reason for the like. Maybe you think it’s cruel, and they thought it was funny. Maybe you hate cats and think it’s a good thing. There are many opinions in the world. Before you judge someone (not only for clicking like, but also for posting in the first place) – talk to them and find out why they liked it (or posted it), and see if you can come to some agreement. And don’t do this in a public thread on their page. Send them an email or call them or go over to their house and chat. It doesn’t need to turn into a flame war.

Respect each others opinions, find common ground. And, most importantly, as Bill & Ted would say: “Be excellent to each other”.

Why I love Ultima but am worried about Shroud of the Avatar

I’m a big Ultima fan. My first Ultima game was Ultima IV back in my freshman or sophomore year of high school. It was my first expose to an RPG and it was awesome. The cool 8bit graphics. The cute midi sounds. But the story was epic. I kept a notebook with all of the things i found (there were no in-game journals back then). If you didn’t know how to do something, there was no internet filled with cheats. You had to figure it out or ask your friends if they knew. That was it. But i got through the game. I found all the hidden things. I replayed it 2 or 3 times as different character classes.

And never once did i own any property. I was an adventurer. Everything i needed was in my backpack. Some food, some weapons, some reagents. If i wanted a bed to sleep in or a nice meal, i’d find an inn or tavern. Those were the good old days.

After that, i played Ultima III, then Ultima VI (somehow I skipped Ultima V – i must have been pretty busy with school or something). Along comes Ultima VII (more than one of them even). Then Ultima VIII, then a retro pack with all the past games, so i played Ultima 0, 1, and 2. Still never quite got around to 5. Oh well. Of course i played Ultima IX. And finally a few years later, I even signed up to be a beta tester for Ultima Online.

Sadly, after a day or so, i couldn’t take it anymore. Running around digging for gold, chopping down trees, trying to build up skill points. It was kind of boring and i soon lost interest. I hear it got better. I don’t know – i didn’t bother to go back.

But now here we are, several years later (a decade perhaps?) and Richard is at it again. He starts a kickstarter for a new Ultima inspired game: Shroud of the Avatar. How awesome. Another chance to visit one of my favorite all time RPG series. Naturally i sign up so i can play the early beta a year before the game gets released. I follow the updates on a semi-regular basis. I don’t troll the forums for all the minutia (i have a day job now you know), but i keep up on what’s going on. And this is where things start to make me nervous.

For the last several weeks or months, all the talk and excitement has been about virtual property, virtual homes and castles and all the cool furniture you can put in your house. Really? REALLY? I’m an adventurer. I want to go out and slay dragons, rescue damsels, fight evil wizards and save the world. I don’t want to have to worry about bandits robbing my house, paying taxes on property in some city, keeping the grass mowed, and keeping up with the Jonses. That would completely suck the life out of this game.

I’ve played other games where you owned property. Most notably NeverWinter Nights and DragonAge. You don’t start off as a land owner, but if you get far enough in the game you end up with a castle and you have to take care of it. You have to pay for upkeep and defenses and workforce labor, and … those are pretty much the point in the game where i stop playing and move on to something else.

I sincerely hope that Shroud of the Avatar doesn’t require a home to be a fun game. If i can’t carry it in my pack, i don’t want it. It’s extra cruft that will hinder my fun, not enhance it. Having said that, of course i’m still going to give it a try, but the first time i’m forced to buy a house somewhere to continue progressing is the day i stop playing.

Final Entry of 2012

Well, the world didn’t end (which is good, otherwise my end of world prediction would have been totally wrong).

I haven’t posted much this year. In fact, i think personal blog entries are in decline across the board. While there are some people who still write entries almost daily or at least weekly, i’m definitely not one of them. Social networking sites (ala Facebook) have pretty much supplanted the day-to-day electronic “hey, check this out”, and “ooh, i’m feeling…”, or “guess what just happened” posts.

But even so, i’ll continue to keep my blog around and i will even post to it occasionally, but mostly it’ll be for longer items or summaries of lots of littler items. If you want the day to day minutia check out my Facebook, Google+, or Twitter pages.

Here’s a great article i wanted to share. It just goes to show that we’re living in the future. It lists 12 things that happened in 2012 that could have come out of some sci-fi movies from 15-20 years ago. And these are all things that really happened this year!

I grouped these all together because they have a common theme: the merging of technology and biology in some way.

  • A Cyborg Competes Against Able-Bodied Athletes at the Olympics
  • Researchers Create a Robot With Legs That Can Run Faster Than any Human
  • Scientists Enhance the Intelligence of Primates with a Chip
  • The World’s First Cybernetic Hate Crime Occurs at a McDonalds in France
  • A Paralyzed Woman Controls a Robotic Arm Using Only Her Mind
  • Scientists Create an Artificial Retina
  • Researchers Create the First Complete Computer Model of a Living Organism
  • A Child Attends School By Sending a Robot in His Place

Forget about who’s on drugs, now it’s all about what does it mean to be human – how many implants are too many before you can’t compete? Will everyone need implants to stay competitive in high-end sporting competitions? Will that bleed over into everyday life? Job discrimination ala Gattaca if you aren’t genetically enhanced?

If we can make outselves smarter, why not chimps. Or dogs, or cats, or mice? Will they eventually be at the point where they can compete for jobs, demand rights, own property, or even publish scientific papers? And if we can do it on a chip, why bother with bioligy anyway – let’s just do it all in silicone. It’s more durable and takes less resources. Maybe we start with a chip, combine with cybernetic implants, and eventually move on to full-on brain uploads in the cloud!

When will it get to the point where new laws need to be enacted? People always fear those who are different. But maybe eventually “unenhanced humans” will be the oddballs and they’ll be the ones discrimiated against.

Doctors Communicate With a Man in a Coma
Maybe some implants will help and eventually he can control a cyborg body with just his mind.

NASA Starts to Work on a Faster-Than-Light Warp Drive
This is a serious attempt with actual NASA engineers using real (and according to them, plausible) math to achieve faster-than-life travel.

The Earth Experiences its First True Superstorm
Well, maybe not the first, but certainly the first in modern history.

The First Successful Commercial Cargo Delivery to Space Goes Off Without a Hitch
Who needs big government anymore? Maybe we will finally get to take that 2 week vacation to the moon someday (soon-ish).

The First Large-Scale Geoengineering Project is Detected Off Canada’s West Coast
This sounds like a James Bond super-villian storyline.

Self-Driving Cars Become Legal in Several States
It’ll be a while before people are ready to let the car drive itself, but every year the cars get smarter and have more features. Back-up collision detection, anti-lock breaks, off-road steering correction, self-park mode, enhanced HUD’s with relevant traffic/weather information. Slowly but inexorably they’re all moving towards self-driving with humans as simply passengers along for the ride.

Bye bye birdie!

Last night i decided to do a digital reset of sorts. Ok, well maybe it was thrust upon me because silly me forgot to do a backup before i flashed a new custom rom on my phone. ALWAYS DO A FULL BACKUP FIRST!!!!

I usually do a backup. But i’d flashed this particular rom on several previous occasions and it had always worked flawlessly. Enter Murphy and his annoying law. This was at about 11pm. You know that sinking feeling you get when something really REALLY bad has happened and you’re not sure you can fix it? Ya, that’s what i felt when i was looking at my blank screen. Welcome to “you’ve been bricked”.

After several hours of frustration (at 2am i finally gave up, resigned to having to get a new phone soon – wasn’t that going to be a fun conversation to have with the wife. $$$). But wait, the story has a happy ending. Bear with me. I crashed, and woke up early (it’s impossible to sleep in with young school aged kids in the house). And within about 30 minutes my phone was humming along nicely. Moral of the story? Well. 1st moral: ALWAYS BACKUP before you do something potentially dangerous. 2nd moral: Never try to solve complicated tech problems at 2am.

Sadly, since i hadn’t backed up recently, the best i could do was restore an older backup from 2 months ago. Which might not seem all that bad. But … 2 months of angry birds 3 star levels lost? Seriously. That’s what i was most worried about. Everything else i could either get back through “the cloud” or my other backups. But my angry birds data was irretrievably lost :(

But as the day went on and i starting bringing things back online one by one, i realized something. Probably 90% of the “stuff” i had on my phone was digital clutter that i didn’t really care about. I hightly doubt i’ll miss it (including the angry birds, angry birds rio, angry birds seasons, angry birds space, and bad piggies games that sucked so much of my time). I’m curious to see what i do end up putting back on. Liberation!

The problem solver

Nothing says “I’m going to own today” like breaking out the power drill first thing in the morning to solve a problem.

What problem is this? Well, what’s up with all those fat straws in the convenience stores now?  I have a 32 ounce mug that I’ve been using for refills for 15 years now. It’s been perfect … until the last few months when it seems everyone decided that fat straws were better.

Except that my mugs straw hole only fits the skinny straws. Enter the drill. And the 5/9th” drill bit. Problem solved.

I wonder what other problems will fall before me today?

Mobile coding lessons i’ve learned from writing an Android application

I recently completed a major version of an Android client for work.  I guess no program is every really “complete”.  But, it’s at a good stopping point for the moment so i thought i would jot down some of the lessons i learned.  These can really apply to any type of development, not just mobile Android.

  • The network layer is unreliable
First of all, cell phones have flaky connections that come and go.  They might be on wi-fi, they might be on a cell connection. They might be in a tunnel.  Maybe they’re in airplane mode.  Doesn’t matter.  You can’t count on a network always being there, and even when it is there, you have to assume that it will be flaky and return strange errors.  It’s important to have a robust network layer that has retries built into it for various errors such as timeouts, unavailable, etc.  Don’t just assume the backend is down.  Assume first that their connection is temporarily out of sorts, retry a few times, and THEN give up.  That will eliminate 90% of the network errors a user has to be aware of.  Oh, and some phones, vendors, flavors of Android all have weird little network quirks that only they exhibit.  Yet another reason for a robust network abstraction.
  • Deal with threading issues

If you don’t want to die from a thousand little cuts, design your code to be thread-safe from the beginning.  Many phones now have multiple cores and really do execute things in parallel.  Add to that fact that any complex app will likely have multiple IO requests in flight at the same time (whether from the file system, database, or network) that can return asynchronously, and you are ripe for threading problems.  Deadlock, data switching out from underneath you, etc.  Use the threading tools. Synchronize, lock, atomic operations and especially the concurrent package are your friend.

  • Be asynchronous

Seriously.  Don’t block the UI thread for any reason.  If you’re loading a file from the file system, accessing the database, making a network call, or even doing some heavy number crunching, do it on a thread and call back to the UI when you’re done.  Android has some nice abstractions to help with this, including AsyncTask, and Handler classes.  You can also do traditional Runnable’s if you like.  But whatever method you use, make sure you have an async layer built into your app that’s easy to use.  Make sure your main application logic can deal with everything being asynchronous.  Your users will thank you for a snappy app.  Corollary: Don’t block the UI needlessly with modal dialogs unless you absolutely have to wait for a result.  Let the user do other things while your background processes are running.

  • Be aware of constrained resources

Ya this is a fun one.  You have very limited memory in which your application can run.  We’re not on a desktop here.  Some phones are far worse than others as far as how much memory they let you have.  Loading images is especially dangerous for running out of memory.  Have a strategy in place to only keep in memory what you need.  Don’t keep things lying around longer than you must.  Memory is fast, but disk is cheap and certainly faster than the network and definitely better to take a few milliseconds to reload an image from the drive all the time rather than running out of memory and crashing the program.  So load it from the network, save it to disk, cash in memory until you run out, then just have some type of LRU cache.

  • Understand and work with the application lifecycle

This one may be somewhat android specific, but the general idea is sound for anything:  Each activity (screen/window) has a lifecycle.  It’s created, setup, running, paused, and eventually destroyed.  It might also be resumed and restored in the middle of all that.  The framework provides rules about when all these things happen and how you should deal with them.  Make sure you do the correct thing at the correct time.  Expect that since this is a mobile environment with lots of stuff going on that your activity might be asked to pause or shutdown at any time, even mid-process.  Save off your state, be able to restore it, and know how to deal with data inconsistencies that might result.  Don’t expect that x then y then z will always happen.  X and Y might happen, and you’ve started Z, but then a phone call comes in and your activity goes away.  When you come back, what do you do?  Make sure you do the right thing.