Tuesday, 7 June 2016

Converting Venture to C#

As I am between jobs, I thought I would set myself a project to work on.  Simplest one I fancied doing was converting my old iOS adventure game library to C#.  The theory being, write it once in .Net Core 1.0 and then use Xamarin forms to port it to Win10, Android and iOS.

So, I have got the basics working.  First task was reading the XML config for the game into some sort of data structure.  This was done by creating classes for each "element" and then using XmlType and XmlAttribute to map it onto the XML.  Then you can use

XmlSerializer deserializer = new XmlSerializer(typeof(GameDetails));
Stream s = GetResourceStream(xmlFileName);
using (TextReader textReader = new StreamReader(s))
{
     gd = (GameDetails)deserializer.Deserialize(textReader);
}

to read the xml file into a complete data structure.  Much easier than the iOS way.  Only slight hitch with Core 1.0 is that you have to pass a Stream to the XmlSerializer and not simply the file name.  Also, Core makes it harder to access files as it is multi platform and they all treat files differently.

Next I added NCalc which is a library for evaluating expressions.  So it can take the string "2+2" and return 4 as the answer.

Then i set up some unit tests and used those to get the engine working.  One test to check the XML loaded correctly and another to check the Conditions and Expressions evaluated correctly.  More to test the PageText and Buttons were evaluated correctly.

Saturday, 16 May 2015

Upgrading from MVC4 to MVC5

So Googles login in feature broke in the standard MVC4 web app form M$.  The only option seemed to be to upgrade a few things.  In the end I made a new web app project in VS2013 and copied everything into that.  A couple of gotchas though.

  • Google Connect now requires HTTPS to work.  This meant getting a IP address for my web site and getting it signed.  HTTP seems to redirect to HTTPS without any hassle.
  • MVC5 now uses Bootstrap for all its responsive/CSS formatting.  This means you should probably recode your HTML a bit.  It looks much nicer than the old one though.
  • It appears to use new tables for storing its user admin data in.  
It took about a day of copying code and pages over from one solution to the other.  Not bad really.

Wednesday, 18 February 2015

Mac App Store - an epic fail?

While the iOS app store is a great success, the app store for the Mac looks like a bit of a failure.  If you look at the free/paid charts and see what the most popular apps are you will see what I mean.

Lets start with the free one.  The top 10 apps are


  1. OSX Yosemite
  2. M$ Remote Desktop
  3. Xcode
  4. Unarchiver
  5. Memory Clean
  6. Slack
  7. Bit Defender
  8. Instragram
  9. RAR Extractor
  10. M$ One Note


That is an OS update, two M$ business tools, two zip utilities, Developer tools, a dubious memory cleaner and anti virus.  To begin with it implies most Mac users are business users who do most of their work in a M$ environment.  Zip utilities should really be standard with OSs these days, rather than an add on.  Then there is Xcode.  Does this mean that more people out there are developing new apps (for iOS probably) tun are downloading free apps on the Mac?

Then there are the paid apps.  I won't list them but in at #5 is Final Cut Pro, at £230 and at #8 is Logic Pro X at £150.  How low are sales if a £200 professional video editing app is the fifth most popular app?  we are talking niche market here.  Why would you even launch an app at £0.79 and how many would you need to sell to get to #180 in the paid list?

You can only hope those charts are summarised some how and not actually indicative of weekly or monthly sales figures.  

Monday, 26 May 2014

Bitcoin Shizzle

So, for the last few months I have been looking into Bitcoin (and various crypto currency matters).  I missed out on the first great peak and don't want to miss out again.  Of all the CCs out there, there are a few main ones.
  • Bitcoin.  This is the daddy of them all and is the one most people have heard of.  
  • Litecoin.  People say that Litecoin is going to be the next big coin.  Or the also ran depending on how you look at it.
  • Dogecoin.  This is the charismatic upstart.  It goes for high profile stunts and is still very low value.  
  • Darkcoin.  This is the moody one in the corner wearing a trench coat.  It is all about privacy and so, is probably going to be popular amongst the "Silk Road" crowd.
To this end I have had a go at mining and buying various coins.  Solo mining is a no go as the chances of finding a block are minuscule.  You can mine with a pool (like Slush') and that will give you some return, however it may not be much.  The rate of mining is described in the # of Hashes you do in a second.  If you are mining MHs then forget it.  It has got to be at least a couple of GHs though people talk bout THs and PHs these days.  To run with the mining analogy, you will be the chap by the river panning for gold with something about the size of a jam jar while the big tractor things surround you.

Buying coins feels a bit dodgy as you do it via arrangements set up through websites.  These involve the seller sticking the coins in a safe place, you transferring the money to their bank account and then you getting the coins.  This is probably the main thing stopping BTC taking off.


Wednesday, 27 November 2013

Domain transfer gotcha

So I decided to move www.thirdprize.org from GoDaddy to NetCetera when my original hosting expired.  GoDaddy doen not support MVC4 and I fancied learning it.  They had it locked so the original attempt to transfer the domain failed.  I unlocked it, did the paperwork and tried again.  This time it seemed to work and my URL started to point at my newly created, newly hosted web site.  I used it quite happily for about a month, even rewriting my apps to use it to retrieve data.

So you can imagine my suprise when on the day of the original expiration, my URL started to point to a GoDaddy holding page.  It seems the original transfer did not go through and I had to initiate it all over again.  This meant my website and my apps were out of order for a good day or so.

As of time of writing, either the apps are working or the web site is working.  Not both at the same time.

So, moral of the story?  Always make sure your transfere went through successfully, even if it looks like it has.

Sunday, 10 November 2013

WebcomiX to be rewritten

After a year or so on the market, it is about time WebcomiX got a rewrite.  Rather than the clunky collection of UiViewControllers it currently is, it is going to become a sleek new UiNavigationController based beast.  Tabs at the bottom for navigation and the usual table views for listing and accessing comics.

So far an afternoons work has produced a Storyboard based prototype that links all the screens together and shows how it will look and behave.  Using a navigation controller based setup means the title and toolbars are built in.  This means I just have to look after the previous/next buttons.  There will also be a tab dedicated to promoting this and my other apps.



Tuesday, 22 November 2011

Modern Warfare 3 - Noob Solo Review

One of the things that put me off getting MW3 was the so called short campaign.  I have had it for a couple of weeks now and I have to say that for the beginner (this is my first MW game) the reputed 5 hour campaign is way off.  I have clocked in 8+ hours and I'm not even half way yet.  If you are UberLeet and only ever play with the pistol (as any other weapon would make it too easy) then you probably could zip through it in less time.  I want to enjoy the ride and take in the atmosphere.

For the solo player there is also the Spec-Ops games.  These are a bit like GOWs Horde mode where you have to see how many waves of baddies you can withstand.  There are also some general challenge games where you have to complete timed courses, etc.  I haven't played these much yet but they look like they add a few hours to the game.

Say 15/20 hours for your first run through and half that for a second/harder level and you are probably getting your monies worth from it.  Add Spec-Ops and you are probably talking £1 per hour of entertainment.

So as a non multiplayer player, I would give the game 8/10.  The plot is just a bit too far fetched to be believable and your companions don't really have a personality between them, but the game play is great.

Update:
I will keep it at 8/10 but I have since realised that completing the single player campaign once counts as 50% of the campaign % score.  I am guessing you have to do it twice (or even three times to get all the achievements) to get 100%.