Thursday 8 October 2009

Micro Men

"Micro Men" BBC4 , last night. It'll probably be repeated ad nasuem and its on the IPlayer. Watch it, if you grew up on 1980s 8 bit computing. The story of Sinclair Research vs, Acorn Computers, a battle I always thought was Sinclair vs. Commodore. But that was my view from the 3rd year comprehensive trenches.

This docu-drama (ugh) does warn that some scenes are inventive for narrative purposes, and I suspect that the potrayal of ol' Uncle Clive was exagerated. But at one point he's harangued by his advisers to concentrate on the Spectrum, not the QL. They mention the size of the game market and the docudrama Clive turns "Oh yes, Clive Sinclair, the man who gave the world Jet Set £@@!ing Willy." as he tries to push computing forward.

He may or may not have said that. He may or may not have felt that or continue to do so. But still, Sir Clive Sinclair, in the million to one chance you are reading this: be proud.

Yes, we grew up playing Jet Set Willy, Knight Lore and thousands, thousands of others. But we also learnt programming. We learnt the tricks and methods that still serve to this day. We learnt squeeze a lot out of a little ( and how many mobile app developers value that experience today ?). My parents were workers, working class down to the bone. We could never have afforded a £500 computer, they could barely afford a ZX81, or the Spectrum upgrade a year later. We had to sell that ZX81 to buy the spectrum . But they managed, and so I learnt. I played games, and I love them. I still do , but through it all I learnt as well.

Today I'm a Software Developer at a large company. There are thousands, maybe millions of us out there who cut our teeth on Sinclair tech. Without that where would we all be today? All our software would come from the states, British software would hardly exist. Sir Clive Sinclair gave the word much more, so much more than Jet Set Willy.

He gave the British Software Industry its workers.

He gave the world the British Geek.

He gave the world the man I am today.

Be proud Sir Clive, be very proud.

Tuesday 18 August 2009

A Loud Argument

There are always casualties in war Lister. If there wasn't it would just be loud argument with lots of shoving.


So, PERCOM, the Battlestar character utility, is pretty much finished ! Thanks to unit testing I've got the Cortex trait system in place, and a nice dialog for selecting a trait with a given dice value. The skills, traits and equipment has been changed over, and the currency units have gone from credits to cubits. The only leftover is the archetypes . They wont take long, all I really need are :

  • Pilot
  • Marine
  • Commander
  • Technician
  • Medic
  • Scientist
  • Civilian


And the civilian one is going to be unbiased, all skills and attributes will have equal weighting. So aside from the archetypes, and perhaps finding a better name (I hate PERCOM) its done. Perhaps I'll call it recruiter.....

The next issue I want to face is this : Combat with more than a couple NPCs. This gets really bogged down really easily. A 10 vs 10 fight really gets a lot of dice rolling and slows down the combat a lot. Previously I've mitigated this where I can by having fewer but tougher opponents.

But the upcoming campaign I'll be running involves a party of cadets and training officers. Thats a lot of potential NPC's, and a lot of dice rolling that is out of player control. This is distracting and the GM often feels the need to rush this so the players don't feel excluded.

How am I going to fix this problem ? Well, thinking on it, I have two options.

Mathematical Option
Use some maths so the NPC combat boils down to 1 or two dice rolls. Ideally two, with the PC friendly lot get one roll that the PCs can make and the hostiles one roll that GM makes. A little table (probably a spreadsheet) will distribute wounds to the losing roll, depending on the roll difference.

The Software Option
All the NPCs (even Cylon skin jobs) are held in data files from PERCOM. I could write another program that reads all those characters in and runs the NPC side of combat. Each character would be player or hostile flagged, and have a selection mechanism for picking their immediate target. It would track wounds, stun and have and handle initiative ordering. You would need to be able to add the players but mark them as players.

You hit a "start round" button and each NPC makes an attack or the action lined up by the GM in the software. When a player takes an action it can pause and ask for the dice roll. It would need to let the GM just skip the action if something was happening beyond its ability to track. It would also need adjustments to wounds and characters on the fly. Player attacks would have to be entered manually, of course.

Essentially it would just be a character spreadsheet, with macros. The disadvantage is that the NPC actions would just become the GM reading "Fred aims at the third cylon, fires, and scores a glancing blow." before clicking next.

So Which One?
I favour the software solution, but then it sounds something cool to write. I can't see how to realisticly shorten the combat with the mathematical solution without ending up with arbitrary values and results that seem beyond control.

Its more than a Loud Argument isn't it ?

Tuesday 11 August 2009

Hooray for Unit Testing - Part Two

Following on from my last post about refactoring my character program from Serenity RGP to Galactica, I can now report that last night I finished fixing all the unit tests. So when I ran the program did it work or crash out badly? How comprehensive was my unit test coverage?



In theory , with all the tests fixed it should start. I should see Traits appearing as Dice values rather than Major or Minor. I timidly started the app, bracing myself for the biggest stack trace I'd ever seen.....



And it worked. Just like that, started up and displayed a character, with two complications (a D4 and a D2) and one D6 Asset. Wow, I hadn't expected that . Hoped for, but not expected.



Then I tried to add a new Trait and it bombed. Oh well, close enough to be pleased with. I was planning to refactor the GUI anyway, listing a bunch of Traits to choose from as a straight list , with each dice version of a trait as a seperate choice. I want a list of traits with each dice in a column to the right. Click on the dice for the trait you want.



Also on the boned list were the archetypes. This was a system where you could set up certain types of character (Fighter, Politician, Toilet Cleaner) and each archetype had weightings to favour or disfavour attributes and skills. Since the skills set and trait list were changed between systems I've dumped the old archetypes for now, I'll either retranslate them from Serenity or just write them again.



Now, should I look at the non-rectangular windows effects in java 6 and see if I can get the app to work with cut off corners?

Tuesday 4 August 2009

Hooray for Unit Testing

I'm faced with doing asome NPC's for a Battlestar Galactica campaign thats coming up in my local RPG group. Now the systems pretty similar to the Serenity one, both being different versions of the Cortex RPG system. The big difference is in Traits, which in serenity can be Minor or Major in Serenity now can be a Dice from D2 to D20.

For example :

"Allure (minor)" becomes "Allure (D2/D4)"
"Dead Broke (minor or major)" becomes "Broke (D4-D12)"


I've got an NPC program for Serenity which I wrote and evolved over two campaigns and I'm reworking that to work with Galactica. My Trait object's go from being having an enum of Major Minor and Both, to having a list of dice types. This just means removing a field and replacing it with a List, and correcting all the ensuing errors that occur, followed by some UI work. Nothing major.

But can I be sure that something subtle isn't broke, some small corner of the app that shall remain forever buggered? No, you never can be. But the unit testing coverage gives me a lot more confidence that I would have had without it. I'm not even through fixing all the errors but I know that the three major parts of the app that touch traits now work with the the dice list, and I haven't even run it yet.

Unit testing lowers refactoring time. Hooray for unit testing !

Tuesday 28 July 2009

Juiced Louse About This House

Juiced2 on the xbox360, another one of those racing games where you get to put stickers, extra plastic and funny lights on your car. It was a Christmas present from a friend, and sadly I've not played it for a while , other games getting in the way.

But last night I got the racing itch, so having applied so powder and fired up the xbox I started again. It's usual racing game fare, start with some low-end car that you've just taken the L plates off and work your way up. But surprise surprise the second level cars include.... MR2 GTS. Red, and looking just like the one in my driveway, albeit with better paint and less polygons.

Its a strange feeling, driving something on screen like a maniac that I drive steadily and carefully to work everyday. I'm pretty sure the real MR2 doesn't slide that easily but I'm not prepared to find out. I'm also pretty sure the K&N induction system isn't £350, its closer to £75. Maybe the virtual mechanics charge an extra £250?

It all makes me think - how do you afford buy and kit out a sports car when you're under 25 (probably under 21) and not old enough to grow a beard? Wheres the juiced3 where all the men are fat balding and driving mid life crises cars and all the "babes" have 3 kids in tow?

Ah, the unforanate colision of games and reality. Lets hope it never gets here !

Wednesday 15 July 2009

Days of Swine and Roses

So I've been exposed to swine flu. I've had a few aches, couple of sneezes and a very slightly sore throat - and those symptoms are on the wane today. Is that it? Talk about an extreme range of consequences , from slight niggle to death. Imagine a computer virus like that , payload varies between slight pauses all the way to formatting your hard drive and stealing your bank details to pay someone to beat you up. Weird.

Well, thats the swine, now for the roses.

Is there some company that builds dating website software ? A quick google says yes, so that probably explains why they all have payment schemes like this
  • £10/mo if you buy 12 months
  • £15/mo if you buy 6 months
  • £20/mo if you buy 3 months
  • £35/mo if you buy 1 months

Good lord, Imagine this pricing from a petrol station (50p a litre if you buy a whole tank, 75p for half tank, £15 to fill up a small lawn mower). eHarmony does this, as does match.com and all the others. While £120 is a small price to pay for the love of your life, its big one when the same money will let you meet women in person and includes beer, food and dancing.

Here, as a consumer, is what I see as wrong with current crop of dating websites.


  1. The pricing structure frankly looks greedy.
  2. You've no idea if a member is a subscriber and thus whether they can reply to you or not.
  3. Some of them don't even tell you if a member is active or not - are you looking at someone who signed up three years ago and never came back ?

Here's how I would do a dating website :

  • The matching , photo and descriptions section wouldn't change. The current players seem to ahve that right.
  • Instead of paying for time you pay for contacts. Pick a price, 10p, 50p, £1 whatever, but keep it on the low. £1 is ideal.
  • You buy contact credits in blocks or individually.
  • Each contact credit can be spent contacting one member. This gives you a 30 day communiction channel to that member only.
  • When you contact a member they don't need to spend a credit to reply, it's free but only to the person who spent the credit. I'm willing to bet that someone who gets a couple of contacts they can talk to for free would consider buying contact credits themselves.
  • If you are lucky enough to meet the contact of your dreams and live happily ever after you can trade your remaining contacts in for flowers, chocolates, whips, whatever.
  • If you don't sign in for three months then the site will stop listing your profile.
(I originally thought 50p a contact, with a contact credit being required to reply. But then it just seemed simpler to double the contact price and make replying free. Phone calls work the same way after all).

Is this a viable business model ? Do the existing players in the market really get most of there money from those that pay over £100 for a year of subscription ?

I think not. Mobile phones in this country didn't take off until pay as you go arrived, and this is just pay as you go dating.

I think this could be a winner, I just need a snappy name.....

CheapDate ? eMiser ? Ebenezer Scrooges Emporium for Desperate Loners ?

*sigh*

Tuesday 16 June 2009

Making a mockery

My Android development continues well and I've started work on my second app, with plans for a free version and a paid for version ( around the $1-2 mark ). Being a seasoned dev I decided that this one should have automated testing. Unit tests for each class, and an automated testing system for putting it through it's paces on the emulator.

Now I expected the second one to cause problems and I was quite prepared for there to not be any automated testing systems for Android, at least not at that level. What I wasn't expecting was the difficulty of unit testing. Android (in 1.5 at least) has several utility classes for testing. Theres a ActivityUnitTestCase which seems to be the android equivalent of TestCase in JUnit. Then theres ActivityInstrumentationTestCase which seems to be a mechanism actually launching and manipulating an activity inside of either the emulator or an actual device.

The problem is both of these requirement me to add something to the device or emulator, some kind of instrumentation package. Yes , thats right - to the device. Acceptance testing, ok thats unavoidable but unit testing ? Come on, I shouldn't have to run my unit tests inside an emulator.

I want to run my unit tests inside the IDE or inside an ant task . I should be able to mock out Android classes and just test how my code interacts with the mocks. Why can't I do this (using the excellent easymock) :

expect( MockActivity.findViewById(R.id.someButton) ).andReturn( mockButton );

One word : Dalvik. The Android plugin is compiling all the code to dalvik bytecode and the only dalvik jvm on my machine is inside my emulator. Running it inside Eclipse doesn't work and never will.

Thanks google, I'm sure an awful unit testing setup wont make your market apps worse.

Wednesday 6 May 2009

Interregnum And Attitude

Wow, left this blogg to fester for a while didn't I? A couple of simple reasons - I just didn't get round to it. The second reason is corperate desktop stupidity. My previous blogg posting practice was to edit the blogg entries during the evening then quickly upload them at work the following morning, meaning I always got to sleep on what I'd said before exposing it to the world. But late March all our work machines were migrated to the corperate standard, and this blogg became invisible to me. Now they've fixed all this and we're looking at a firewall configuration appropriate to developers rather than call centre workers I can continue my occasional early morning uploads.

How do you regulate a corperate desktop for a developer ? Everywhere else I've ever worked my desktop machine has been my own space - I install what I need to keep working as effectively as I can. I've had to ensure I don't break licensing agreements and manage the IP side on my own but that was part of the job. If I need something that costs then the company should pay for it, if I don't need it then I don't install it.

But now it's different , they keep telling me its not "my" machine but it belongs to the company. Yes, that's always been the case but now it's more emphasised. There's an approved software list, you see websites blocked, and there's tray icons for system services that restrict my machine or log things. I can't even turn off the screensaver or change the damn wallpaper - even though a I'm not a salesman who constantly shows his screen to customers.

It feels like I'm not trusted, and thats a bad feeling to work under. As the economy picks up and developer jobs become plentiful again I'm sure we'll see developers leaving. I'll probably be one of them, this job is fast losing what little shine it had.

Thursday 29 January 2009

Focus People, Focus !

There's a post on Jonath Giles blog proposing a new version of Java Swing, which he refers to as Swing 2.0 . In a nutshell he believes that there exists a need for a proper swing upgrade/replacement which is not JavaFX based. An upgrade containing:


  • Generics Based models
  • Support for Enumerations
  • Support for varargs
  • Stricter enforcement of event dispatch thread rules
  • Improved support for bean binding and validation.

Now these are all good ideas and wholeheartedly supported these ideas three days ago when I posted my reply. I was even willing to help with the project and had ideas about where we could start. But now I'm not too sure about the whole idea.

If I could wave a magic and wand and conjure a Swing 2.0 with all of these features would I ? Swing is complex, little tricky to learn, and even trickier to get right. JavaFX is much easier to learn and getting enough exposure in the java world that it might just succeed and take hold. If JavaFX is a real contender to that RIA crown do we really want Swing2.0 diverting precious attention and developer mindshare away from it ?

Given an choice of successfull JavaFX and a new better Swing I think I'd plump for the former. If we don't support JavaFX what are we left with?

That horrid html/css/javascript stack that poses for a GUI, what we'll be left with. *Shudder*

Wednesday 21 January 2009

New Hopes - Obama & JavaFX

SPOILER ALERT
If you don't want to know how the inauguration of President Elect Barrack Obama went (presumably you've taped it) then skip the next paragraph.

I watched the news yesterday and saw the inauguration of President Obama and one message/thought/feeling seemed to be flowing out of America - hope for the future. The oath was fumbled a bit but that made it seem all the more human. In many ways it kind of reminded of the Labour election victory in 1997 over here [the UK]. Of course, that was by comparison much a lower key event but the message of hope was there as well. People well and truly though the country had turned a corner.

And the other thing this reminded me of was the JavaFX platform. For years now the java developers have been stuck on the server side. Applets went nowhere, flash became popular and the only appreciable way to earn a living doing UI's was the HTML/CSS/Javascript jumbo. It's really hard to make any mark with a swing application these days. Java UIs, well, weren't going anywhere and sometimes even going backwards.

But, despite a year and a half long beta and a slight stuttered launch (I've heard a rumour that they accidently left hardware accelleration switched off by default in the 1.0 install) it appears to be gaining ground. You can even begin to hope again.

Obama & JavaFX ? I hope both of them succeed.

Tuesday 6 January 2009

Tinkering with JavaFX

One of my hobby goals for the holiday season just gone was to look at JavaFX and see if it was worth using for a project. I even had a project in mind : The character generator for the Battlestar Galactica RPG. I've written one for the Serenity RPG called Composure and the two systems are close to identical. I could re-use all the model code for the BSG version and try a fancy new JavaFX GUI .

Here's what happened.
  1. A Google for "eclipse javafx plugin" produced openjfx which hadn't had a release since June, nearly six months before JavaFX was released.
  2. I found another plugin at Project Kenai which requires a full J2EE version of Eclipse ( a big download in itself), doesn't have an update URL and is a really early release.
  3. I installed NetBeans and did the JavaFX tutorial.
Now NetBeans seemed as foreign to me as I expected it would, but I perservered. I got a lot of the tutorial done, and liked what I saw. I then hit a point where the JavaFX would not run . I got an unhelpful NullPointerException in the stack trace that told me nothing and strange spanner icon in the file window. No red errors and no tooltip over the spanner icon. Am I using NetBeans wrong or am I using JavaFX wrong ? How could I tell?

To be fair I hit the same problems when I switched from TextPad to Eclipse back in 2005 but then I had an office full of fellow developers I could ask. Today I don't know anybody who uses NetBeans and experience told me what a forum post would probably get me (Nothing, "RTFM noob!" or some derivative). Besides it was that strange lull time between Christmas and New Years - who would be on the forums that could help ?

I could handle learning NetBeans, I really could. I could handle learning JavaFX and indeed it does look both promising and usefull. But it's both at the same time thats the problem. What did I do ?

I gave up. Frak it, it was just a little holiday tinker project. I'll keep using swing for now. If and when a decent plugin emerges for Eclipse I'll try JavaFX again. I wonder how many other Eclipse devs will feel the same?

Talk about cutting off the air supply ......