Friday, March 28, 2014

Getting Back Into Gaming

The new generation of consoles is out! Which means that I would normally buy the last generation of console, play a couple of games, get bored, and not using it anymore (I have a PS2 sitting here which hasn't been used in years).

I got to thinking about the cost and trying to justify it though and realised.... I don't need it. It's not that I don't want to play games anymore. It's just that I was looking at my options and something occurred to me. What if I just had a gaming PC? I'm sure I could build something comparable to the consoles of yesteryear at around the same cost for a modded console (it's important that I don't feel restricted by the damn things).

So I started to have a look and realised that the cost for MS Windows alone is a horribly significant cost.... that's insane. There are loads of really cool OSes out there and few of them demand $170. With a limit of $450, that makes up more than ⅓ of the total build cost. Yuck.

Windows XP is about to lose all support which means that hopefully people will be getting rid of their copies cheaply. Trademe currently has a copy with the certificate of authentication for $30. It makes an interesting, albeit insecure proposition. Do you really need the Internet for gaming? Can you forego a bunch of things like a web browser?

I spoke to a friend about my wanting to do some gaming and she told me that she used a separate hard drive for the same purpose. i.e. her normal computer with a hard drive that she'd plug in if she wanted to play games. I like the idea as it means you're not messing around too much with bootloaders. i.e. Windows ALWAYS wants to mess up your master boot record (MBR).

So I got to installing Windows XP on a separate hard drive. Once I got it installed I decided that I didn't want to mess around with unplugging and plugging in a hard drive when I wanted to play games. I could make it a little cleaner by putting in a SATA hard drive caddy... but why? Once Windows is installed on another drive, plug all the hard drives in at once boot into Linux and update grub. Easy.

GRUB's kind of ugly though. I mean it does some brilliant things. But why not go graphical? In goes BURG... Change the icon for Windows to be an icon of a game pad... Easy. Next, get rid of the graphical boot of Windows. This isn't at all necessary. It's just that I don't want to use it as Windows... I instead want to remove any Windows branding. It's to be a gaming platform...

There's a few bits I have no idea how to approach. Like the "Welcome" screen.... that flashes up for a second before loading up the desktop (and then thrashing the hard drive). The thrashing the hard drive bit is annoying. Although the desktop is up, you can't do anything for a minute or so. It's only going to get worse too.

I'm almost tempted to find myself a copy of Windows XP X64 due to the memory limit. I have 16GB in my computer. Windows XP can access 3GB of it - though the games I've tried thus far have absolutely no problem with it. In reality this is unlikely to be too much of a problem as I'm much less likely to have multiple intensive applications open at the same time.

Configuring Windows.... Set everything to performance. I don't need animations or the sort. Especially given that the end goal is to not use the Windows UI at all if I can help it. I disabled the paging file in the hope that it would lead to less hard drive thrashing.

The aim now is to write an interface in python and SDL (pygame)... something that can read a xml file or something similar to Linux's desktop files and build an interface from that. This requires a way to read .lnk files and grab some important information - the executable and the working folder. We also need a couple of other bits of information:-

  • An image to display.
  • Possibly a cd/dvd ROM identifier so that it can tell if a game disk is in the drive (though I'm finding myself tempted by the idea of taking a copy of the disk and storing it on the hard drive and using a iso mounting tool to manage it).
  • Tags so that you can group games by genre, publisher, title (i.e. Portal could contain Portal and Portal 2) etc.
  • An image to display.
  • Other executable with a description of their action i.e. uninstall, configure etc.
Equipment I'm considering buying.... another hard drive. I'm using quite an old drive at the moment that's quite loud but good enough for testing with. An xbox controller and receiver.

I'm writing this here as I want to be able to show off the software at some point if ever I build it...

Wednesday, March 19, 2014

The Accountants are in Charge and the Accounts Still Aren't Looking Great

We're coming up to an election in September and the current polling numbers are looking dismal. Dismal dismal dismal.

The problem for me is that we live in a place where people tend to vote for things to change or for things to stay the same. So National came in on us needing a change.

The problem with that? Well... we needed a change. No two ways about it. The Labour Party was imploding and no longer listening to the people and so... well... things needed to change. So the vote went to National.

But National aren't creative. They don't come up with solutions. They ignore problems and try to reduce EVERYTHING to a monetary value. They are accountants. Which, occasionally need to take the helm. But you wouldn't leave accountants in charge unless you want your business to lose value.

National debt has risen quite significantly. Sure, you'd expect some rise during the economic crisis and a bit more for the Christchurch rebuild, but that's ridiculous. I'm really not a fan of beating someone over the head with national debt, but since 2008, when National got voted in, the rise has been significant and constant.

We're facing a whole skew of problems around employment, housing, education etc. and it looks like we're looking for creative solutions.... from accountants. If the argument is reduced down to money, money and money, National aren't doing a great job but seem to be doing incredibly well in a smear campaign around Labour's ability to handle the finances.

Our attitudes need to change. We need to be looking at what's good for the country, not all trying to be right. What do I mean by this? The media has unprecedented power in influencing voters. If they say they've run a poll and the results show that National are going to win and can form a government WITHOUT coalition partners, then those numbers suddenly jump. Why? Because people want to be right. Hell, I want to be right. I don't think we can possibly afford for things to stay the same. I wish the rest of the country realised it.

Anyway.... my slogan for this election: "You can't leave the accountants running the creative department".

Saturday, March 15, 2014

The Remote Project - The Buttons

So obviously I need buttons... Around 25 of the buggers... Try finding an Arduino with that many inputs. I suppose I could use a shift in register.... but it's not really needed.

While looking up information on building my own keyboard (it's one of those things I'd probably have a go at if I had a 3D printer), I found information on button matrixes. I'm going to give you my abridge version here....

Suppose I want 9 buttons. I only need 6 pins on the Arduino. I only need two bits of information - an X and Y as it were. Using the diagram below, if I put a charge on A and then measure 1, 2 and 3, I can tell if any of the buttons in the A column have been pressed. Repeat for B and C. Simple!
Fig 1.

There are some (really quite odd) cases where things can go a little wrong... like someone is pressing lots of buttons... Using the example in the first image in Fig 2. When checking B, it appears that B1 and B2 are pressed. To fix this, use diodes which are basically a one way valve. The other two images show what happens when you add diodes in.

Fig 2

 
This is where I started getting obsessive. I wanted to throw together something that would be nice and compact. And I wanted to do it using vero strip board.... What is vero strip board? It's basically a fibreglass board with copper rails running down it (and holes pre-drilled).

Roughly like that.... You can then use a drill bit to break the tracks. After obsessing over it, I finally came up with a design. Unfortunately, the design I landed on requires surface mount components (when I'd already brought non-smc so ended up buying the diodes twice). They'll come in handy.... They better.... I've got 1,000 of them.

So the design I landed on:

is something like this. Expand it out to be 5 buttons by 5 buttons.... I've just about finished this bit except that I've had a delay due to having to buy new diodes.

Friday, March 14, 2014

The Remote Project - The Specifications

Currently on my coffee table I have:
  • A wireless keyboard (to control a Raspberry Pi)
  • A TV remote
  • A digital tuner remote
  • An AV Receiver remote (with the volume buttons no longer working)
  • A DVD remote
I hate it... I really hate feeling a tiny bit guilty because I can't be bothered turning off EVERYTHING... that'd take too many remotes... For the Raspberry Pi I'm considering a opto-isolator to be able to turn it off and on remotely.
Sound at all familiar? I was looking for a replacement to the AV Receiver remote when I thought to myself "this is silly". For the price of a replacement, I could potentially get rid of all of the remotes on the coffee table and get it down to just one.

Now you probably think I'm thinking of a universal remote. I've had a play and I hate them. I mean, there are probably some really cool ones out there but I doubt any of them could replace the keyboard for the Raspberry Pi.

And there's always the phone option... but then smart phones aren't great for battery life. So chances are, if I'm sitting down watching TV, the phones on the other side of the room charging. Besides which, this brings it's own problems. For example, I'd have to show everyone else how to use their phone to control all of the devices (inserting an IR blaster, putting the volume up, designing an app and putting in remote codes).

So it'd be real nice to just have a really simple remote that could just sit on the coffee table and do what it needs to do (and I'm damned if I'm going to buy a cellphone/tablet just for this purpose).

I got to thinking...

I could control the Raspberry Pi with an Arduino Leonardo receiving signals from a remote control. I've got one sitting around that cost me around $12 (off ebay. It's a mini). A Leonardo can tell a computer that it's a keyboard so... it just seems way too easy.

For the remote itself I'd need a bunch of buttons. Around $2 for 100 off ebay.

I'd need something that both communicate with the Leonardo AND send out infrared signals... for which an Arduino mini seems ideal. (also lying around - $5).

This is where my design has gotten a little silly. I wanted a way for the remote to communicate with the Leonardo controlling the Raspberry Pi. In which case, transceivers all around! I could have just used an IR (Infra Red) receiver on the Leonardo though cost wise, they're much a muchness (except that I still had to buy an IR receiver to be able to record signals from the existing remotes). So $2 for 2 transceivers and $1.90 for the IR receiver (it was cheaper to buy one from China with free shipping than it was to go to the local electronics store to get one).

I toyed with the idea of printing up my own PCB though I really wasn't keen. It would have been kind of cool but I REALLY hate working with chemicals that I have to be cautious of. I've had a few vero strip boards lying around for ages which I figured will have to do.

It's worth noting I'm actually not that much of an electronics guy. While I see other people talking about ... stuff... power rectifiers and stuff.... All I really want to do is come up with something that does something useful and I understand (not for the sake of understanding but rather to accomplish something).

So from my initial costings... (knowing full well I'm probably going to have to get a few more bits and pieces)...

Item

Cost (NZD)

Arduino Leonardo (1)12.00
Arduino Mini (1)5.00
Momentary micro buttons (25)0.50
Vero Strip Board (1)1.10
Arduino Transceivers (2)2.00
IR Receiver (1)1.90
Diodes (I'll explain later) (25)0.27
IR LED (1)0.01
Total $22.78

That total's looking brilliant at this stage given that a replace remote for the AV receiver was going to cost at least a tiny bit shy of $50.

In my next post on this subject I'll go over the buttons... (A button matrix and designing it for the vero board).

Wednesday, March 12, 2014

The Interaction Realisation

Something that Facebook is teaching me... I think quite differently from A LOT of people. I'm finding myself at odds with a whole bunch of people that I actually like and get along with in meat space...

We're coming up election year and I'm finding a whole lot of bollocks about proof.

National's only metric being about finances... They're not doing brilliantly there... but then they're not doing too badly either. So as you'd expect, I'm finding myself at odds with a very right wing agenda. Surely there's more to life than just money. I mean we value our tourism trade right? And that's based upon natural beauty in which case we need to protect our environment.... otherwise why bother with advertising dollars around The Hobbit/Lord of the Rings? And should people get a say about mining in their areas? (think deep sea drilling and fracking etc.) Or should we trust the organisations gaining the most from these activities to be honest and truthful about their practises and the safety provisions put in?

This, to me, is all related to the fact that capitalism doesn't work and will never work because we talk about things such as "corporations". They have rights just like people do. They have a right to privacy. For example, they don't have to disclose where they've sourced their ingredients from or how much people have been paid along the chain in order to produce those goods. Think chocolate with it's terrible record of slavery (this practise still continues) and clothing with it's sweat shops. We as consumers can't make informed decisions based upon ethics and are thusly forced to make decisions based almost entirely on economics because anything that could vaguely be seen as unethical is hidden from us.

But then we've got the rationalists. The rationalists talk about putting together a party for parliament except that I just don't see the point. Firstly, their tagline is insulting.

Basically they say they'll do things with a reason. Hell - every party in parliament is representing reason... You and I may not agree with it but it's still reason. What's the difference? Rationalists want to base the running of the country on scientific proof.

Would this then cut funding towards art? To certain types of art? How do you measure the enjoyment to art in general? Do you have to collect various different pieces of art and show it off and get a meaningful sample of pieces of art and people to measure the enjoyment level (probably via pupillary response i.e. how much the pupil dilates and constricts)? Do we then get only certain types of art funded in the country? And budgets around things that we don't really talk about. My favourite example here is Plunket:

A mother walks in at the end of her rope. A Plunket person tells them to go and have a nap in the back room for an hour or two while they look after the kids.

Now... if you "measure" the value - depending on where you "measure" it, the value changes. To the mother, this act is priceless. She needed it and she got it.

To the person looking after the kids, it's a little bit of money (2 hours work) and a feel good feeling.

To the head office it's a damn cost... 2 hours of pay for probably very little work output.

The only place the value is measurable (how do you quantify "priceless" and "feel good") is where the value is a negative... So my contention is that there's something more. We all know it. We need to be able to acknowledge it.

It's okay to do something nice - just for the feel good feeling. It's okay to act ethically even if it's not a marketing/branding opportunity and could potentially lead to a loss of profits. It's okay to think of people first rather than just the bottom line... We aren't always going to be able to quantify it. Which is a bit of a blackhole in terms of politics.... But it shouldn't be. We should be able to acknowledge this - that the stuff that is good doesn't necessarily have to have measurable outcomes. Usually these things have longer term outcomes - such as employment levels further down the line. It's tempting to try and quantify everything in the present when a lot of the time we aren't going to see measurable results for a few years.