Friday, 24 October 2014

Elite Dangerous - Longevity

I've said many things about Elite Dangerous on these pages, and I keep going on about it, so I have to admit I'm interested.  I'm not happy about being interested, but one just has to watch the game being played or even see screen shots and you're instantly engaged.

As an old Elite hand and a Frontier Fervent Fanatic I have a series of expectations about the game, and in comparison to Eve-Online I had to admit the idea of paying once and not being a subscriber appeals.


One of the main problems I had with a subscription is that as a married man, working and trying to live life, the amount of game time I get is quite limited.  In a week I might only get to play an hour or two, so paying to subscribe to a game for the other 166 hours that week annoys me, it is just such a waste.

I however do understand why companies need to fund their service, they need to pay the developers yes, but they also need to pay to keep the lights on, and server bandwidth is not free.  It is cheap, but it's not free, energy is very costly also.

So, they're running their game server and you're paying.

However, this isn't the funding model Frontier Developments have seemingly declared for their title, they've stated that you will pay once for the title and play there after.

The multi-player information then does state that the connectivity will be a mix of peer-to-peer and server infrastructure, this makes sense as all the dynamic market elements and what players know as "Open Play" must have some short of server back-bone, despite what some players would lead you to believe.

My question to Frontier Developments, and I have posted this off to them, has been "How in the long run do they plan on funding the server", essentially I ask because the kick-starter funding literally funds the development to a point, and the amount funded is not huge.

One pays for the game also at purchase, either now for £50 in BETA or later for £39.99 (estimated), but that's it?

I can not really understand how a server is going to be funded without some sort of revenue, players will stop joining, sales will plateaux and fall.... So, might more micro-transactions appear?... Just as there are currently skins for sale?... Might a subscription be introduced for "Open Play"... Perhaps the game falls down to Single Player only, or Group play only?...

Personally I miss my adventures hosting the Frontier Club, where peeps sent in their disks with saved games, I copied them back to everyone else's disks and mailed them back... Good fun.

Thursday, 23 October 2014

C++ BCD Encoding Tutorial

What is Binary Coded Decimal?... Well, when I did my A-Level the book I read described it as encoding the numeric values 0 through 9 into 4 binary bits, and then shuffling them into bytes, so you can represent the values precisely, without worry of the bit representation (big or little endian) of the system in use, and using less memory...

How can it take less memory?... If I store perhaps, 123 that's going to take 3 bytes!  I could put that into 1 byte... Yes you could because a single byte will hold 0 to 255.

But, what if you represent an integer?  4 bytes, the most significant word (two bytes) maybe little or big-endian, with BCD you can program your machine to move the values back correctly.

Lets take a look at some code:


This is only the first part however, we're encoding 1 digit as 8 bits....

We can define this encoding and then load our bytes back in whatever computer architecture we want.  This is very useful to remember when we talk between different endianess machine, such as old macs, Amiga's, Atari ST's... Even Spacecraft!

But storing 0 through 9 into 8 bits is a little wasteful, how many bits can represent 0 through 9 easily?... How about a nibble, or 4 bits?...

To do this we nave to flipflop through each digit character in our loop, and we shift the current binary left 4 bits then mask append the new value as we go round the loop...


This saves us space and gives us the output:

Technically the final blue nibble should have been shifted 4 bits left, but I'll leave you to fix that up.

I hope this quick tutorial has you thinking about encoding and how it works to help make data more easily cross platform.

And if you don't know what "Endianess" is, go search for it, but think about communications, about older systems, about different processor types... and then their applications in different systems, historical systems support, emulators and games.

--- Full Source code below ---

#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <bitset>

typedef unsigned char byte;
typedef std::vector<byte> BCDEncoding;

BCDEncoding EncodeIntegerIntoNibbles(const int& p_Value)
{
    BCDEncoding l_result;

    // Convert our integer into a string
    std::ostringstream l_oss;
    l_oss << p_Value;
    std::string l_string = l_oss.str();

    byte l_Value;

    byte l_Binary;
    bool l_FlipFlop = false;

    // Iterate over each character of the number, and add them to the encoding
    for (std::string::iterator l_itr = l_string.begin();
        l_itr != l_string.end();
        ++l_itr)
    {
        char l_current = (*l_itr);
        switch (l_current)
        {
            case '0': l_Value =0; break;
            case '1': l_Value =1; break;
            case '2': l_Value =2; break;
            case '3': l_Value =3; break;
            case '4': l_Value =4; break;
            case '5': l_Value =5; break;
            case '6': l_Value =6; break;
            case '7': l_Value =7; break;
            case '8': l_Value =8; break;
            case '9': l_Value =9; break;     
        }

        // First cycle, we load the bottom 4
        // bits of our binary byte with the
        // value, and the top 4 bits with zero's...
        // So just assign the value
        if (!l_FlipFlop)
        {
            l_Binary = l_Value;
            l_FlipFlop = true;
        }
        else
        {
            // In the second cycle, we move the bottom 4 bits up
            // then mask the second value part with the binary mask
            // 00001111, so we get the new lower half value... 00001111
            // being 15...
            l_Binary <<= 4;     /// Move up 4 places
            l_Binary |= (l_Value & 15);     // Set binary lower mask to the value 4 bits
            l_FlipFlop = false;

            // Now, we have the completed binary (2 nibbles) for a byte
            // we can add to our encoding
            l_result.push_back(l_Binary);
        }
    }

    // Finally, if we were part way through a binary
    // digit encode, we need to add that digit
    if (l_FlipFlop)
    {
        l_result.push_back(l_Binary);
    }

    return l_result;
}

BCDEncoding EncodeInteger(const int& p_Value)
{
    BCDEncoding l_result;

    // Convert our integer into a string
    std::ostringstream l_oss;
    l_oss << p_Value;
    std::string l_string = l_oss.str();

    // Iterate over each character of the number, and add them to the encoding
    for (std::string::iterator l_itr = l_string.begin();
        l_itr != l_string.end();
        ++l_itr)
    {
        char l_current = (*l_itr);
        switch (l_current)
        {
            case '0': l_result.push_back(0); break;
            case '1': l_result.push_back(1); break;
            case '2': l_result.push_back(2); break;
            case '3': l_result.push_back(3); break;
            case '4': l_result.push_back(4); break;
            case '5': l_result.push_back(5); break;
            case '6': l_result.push_back(6); break;
            case '7': l_result.push_back(7); break;
            case '8': l_result.push_back(8); break;
            case '9': l_result.push_back(9); break;
        }
    }

    return l_result;
}

void PrintEncoding(BCDEncoding& p_Encoding)
{
    std::cout << "Encoding : Length [" << p_Encoding.size() << "]" << std::endl;
    int i = 0;
    for (BCDEncoding::iterator l_itr = p_Encoding.begin();
        l_itr != p_Encoding.end();
        ++l_itr)
    {
        std::cout << "[" << (i++) << "] = " << std::bitset<8>((*l_itr)) << std::endl;
    }
}

int main()
{
    BCDEncoding l_Enc = EncodeInteger(1);
    PrintEncoding(l_Enc);

    l_Enc = EncodeInteger(24);
    PrintEncoding(l_Enc);

    l_Enc = EncodeInteger(123);
    PrintEncoding(l_Enc);

    l_Enc = EncodeIntegerIntoNibbles(123);
    PrintEncoding(l_Enc);
    
}

Wednesday, 22 October 2014

124,000

Hey folks, huge news for my humble blog, page views have doubled in three months... Yes, from an all time high of 62,000 views since July we've had double that number of viewers over again, and our total count is now 124,000 views...

You know if every view gave me £1 I could pay off my mortgage!

Anyway, what have I been up to?... Well, I've been trying to extol the virtues of redirecting TCP/IP connections from one server accepting and validating them to a secondary server to process the data remote clients are trying to dump... And I've been wholly unsuccessful because the other technologist who's working on this project doesn't want to really do as I'm asking... Which is very frustrating.

I'm also trying to avoid buying/playing Elite Dangerous, I'm interested, but I stand by my pledge not to play it... For now...

WarThunder, been playing lots of Simulated Battles and I even got one of my replays used by the magnificent Jingles.

You can find my full coverage of it here:

My old Seitek X45 joystick is showing its age, so once the new house move is done and a few debts paid I maybe going into the market for a new joystick.

Coding projects, I have a tutorial I want to put up about BCD or Binary Coded Decimal, unfortunately some developers believe just using the value int x = 0; means X is in BCD... its not folks its just binary... I'll explain in the tutorial I think...

Right then, onwards and upwards.

Tuesday, 21 October 2014

BBC Top Gear - To Argentina - DO NOT APOLOGISE!

If they apologise I'll have a fit... I will seriously throw my rattle out my pram... Fuck Argentina, they conducted an illegal war against a British protected territory, whom has repeatedly stated its people wish to remain British... I am so suck of Argentina and this topic...

Just go on YouTube find a documentary about the Falklands war and read the Argentine comments...

One guy was trying to claim the Brooklyn class CRUISER the General Belgrano was a transport ship... Are you fucking retarded?... It was a CRUISER when it was laid down in the '30's and it was still a cruiser when we sunk the bastard!

It just seems whenever there's something to distract the Argentine people about they wheel out the Falklands... And the people follow like kittens being shown a ball of yarn.... Wake up people your politicians are hiding shit from you.

Like the Military Junta of 82 was hiding it was disappearing thousands of people... Remember them, not some trifling war they used to try and swing your opinion, and grow up you lost, grow a set of balls over it!


WarThunder - Gaijin's Russian Bias Shows Doesn't It.

Last night I went for a few flights in various BF109's in WarThunder... It was an utter and total disaster, I didn't make a single air kill, and twice ended up getting bounced whilst in the middle of my dive on a target and having to try and flee.  And only once did my attempt to flee and calling for help get a return from my team mates... So my thanks to those chaps that time, you kicked arse...

However, after a couple of hours I had my BF109E-3, BF109F-1 & 2, BF109F-4 and BF109F-4/trop all in repairs... My frustration was palpable.

I reviewed my replays, I thought about what I was doing wrong, and I thought about my opponents... Some of them were just excellent pilots and out flew me, I accept that, however, I looking at the roster of opponents who had shot me down... La-5... La-5.... Hmmm... La-5..... I-185... There were a lot of higher battle rating (BR) opponents than my measily E-3 or F-2 (the two planes I flew repeatedly)...

Now I'm no fool, my aircraft handling though not perfect is okay and in Simulated Battle you expect an amount of luck, but my luck was running so bad.  I switched to Realistic Battle, maybe I could identify what I was doing wrong by seeing the target tags coming towards me...

I could not see any tags... I don't know if this is a feature now, or something about skills, or just a bug... But I had to close to within 1km of a target dot before I got to see its label text... and when friendlies were tangling with enemy planes I saw the blue of the friendly from miles, but never saw the enemy... Tracers and flame and death, I saw plenty of, but actual aircraft/player legend text, not a jot of it...

So at one point I'm in the F-4, and I'm 800 meters above a pair of La-5's... I know I'm going to die, so I invert, pull through a half loop, and when out of the loop I'm the right way up going to opposite direction at about 550km/h... And I accelerate away, I'm going maybe 580km/h, and I reckon I'm around 10km away from where I saw the targets, I'm low on ammo anyway, and 7 minutes of fuel, so I report heading to base.

I check my shoulder, just as a stream of red tracer goes past... both La-5's are right there... they've climbed 750ish meters and caught up over 10km from behind a plane going away from them at over 550km/h... I dive away from them and am going 715km/h, opening the distance between us... But their fire is hell accurate, I can see the separation on the mini-map its over 800 meters between us, but they're still shooting...

These are La-5's... with twin 20mm cannon, their cannon should be dry>?!>?! What the hell... I lead them off and over the airfield, they break off only when the AA has holed one... but as I break into a rising climb turning my now 600km/h speed into about 900 meters of altitude and levelling off to assess my situation, the other LA-5 does what can only be described as a UFO move, it rolls and almost flat spins around and comes back at me, acceleration was incredible, the aircraft was level with me, having used his speed to climb... and he's flying straight and level.... over 8km... be cross the airfield and forced me into a split-S to avoid his head on in what felt like 10 seconds... I literally had no come-back.

When we read historical accounts of the performance of the La-5 it does not stand up to the scrutiny of its performance in game, I get that Gaijin have their own ideals of history, they say as much in one of their news posts:

"the British have their own history and their own view on the Second World War and we, the descendants of our Soviet heroes had our own war and own memories of it" - WarThunder Blog.

You don't have memories young sir, you are not over 80 years old and were of an age to have served, your parents at a push, or your grandparents certainly may have, but you do not have memories.  What you have are recollections, those rosey tinted, glossy postcard photograph ideas of what it was like.  And I can only really stress that in my opinion the balance of plane performance, especially Russian plane performance, is rather more rosey than it should be according to the history at hand.

"the La-5FN excelled at altitudes below 3,000 m (9,843 ft) but suffered from short range and flight time of only 40 minutes at cruise engine power. All of the engine controls (throttle, mixture, propeller pitch, radiator and cowl flaps, and supercharger gearbox) had separate levers which served to distract the pilot during combat to make constant adjustments or risk suboptimal performance. For example, rapid acceleration required moving no less than six levers. In contrast, contemporary German aircraft, especially the BMW 801 radial-engined variants of the Focke-Wulf Fw 190 front line fighter, had largely automatic engine controls with the pilot operating a single lever and electromechanical devices, like the Kommandoger├Ąt pioneering engine computer on the radial-engined Fw 190s, making the appropriate adjustments. Due to airflow limitations, the engine boost system (Forsazh) could not be used above 2,000 m (6,562 ft). Stability in all axes was generally good. The authority of the ailerons was deemed exceptional but the rudder was insufficiently powerful at lower speeds. At speeds in excess of 600 km/h (370 mph), the forces on control surfaces became excessive. Horizontal turn time at 1,000 m (3,281 ft) and maximum engine power was 25 seconds." - 

Or perhaps
"In comparison with the Bf 109 the La-5FN possessed a slightly higher roll rate, however the Bf-109 was slightly faster and had the advantages of a smaller turn radius and higher rate of climb." - Hans-Werner Lerche (ISBN 0531037118)

Even ignoring the performance issues, why was my BF109F4 being pitted against La-5's?... The F series of 109 was ubiquitous yes, but in 1942 when the F4 was really at its height the La-5 was still under development:

"from the first tests, which began toward the end of March 1942, it became clear that the new variant was a marked improvement over the basic model" - about the LA-5 from www.century-of-flight.net.

The timeline does not work out, the La-5 should not have been present to shoot me down perhaps?... But its UFO like performance is clearly not warranted from the history.

I know already what Gaijin's response would be, if they dained to give one, and that would be that this is a BETA, and that things can change, but I believe for too long and too many comparisons; which I have been through; the Russians get the better of it over the Americans, the Americans get the better of over the Japanese and the Germans generally struggle to compete save when we get to the very highest tiers.

The BF109F series under-perform, the accepted best aerobatically able 109's and they're pitted against floating Russian crates which historically were not overly available*, the BF109G series are often forced to fight off of their comfort zone, i.e. the BF109G-6 designed to intercept bombers is pushed into dogfights with other fighters, where its climb/weight disadvantage soon tell...

To then rub salt into already open wounds I flew out in a Russian plane, in simulated mode, for the first time ever, took the Yak-7 which was completely stock out for a fly out... Immediately entered a low-level dogfight and in both the horizontal and vertical could out turn and out perform German BF109F1's and an FW190A-1... And got two kills!.... I gave up playing for the night right there, disgusted how easy the kills were, when ammunition, aiming and the general low-tech of the Yak-7, a trainer pushed back into front-line service, bested some of the finest fighter aircraft the Luftwaffe fielded.



* Losses of La-5's in 1942 dropped dramatically, this wasn't because the La-5's were doing well, but that so few La-5 were produced that there were none-left for the jagdflieger to shoot down, only in 1943 as production ramped back up did losses increase in relation ship to the number of available aircraft.  This is the kind of history ignored by Gaijin and their apparent blanket rosey tinted view of history.

Monday, 20 October 2014

Gloriously Impatient

Good news, good news... Most all the decorating is done!

Yes, in the last three weeks, we've gutted the bathroom, laid new floors, painted lots and lots of gloss onto surfaces, repainted the kitchen, sanded and re-varnished hard wood floors and generally made the house a better place to be.

The reason being, we're moving back to the old house at Brinsley, we're not sure on the old rental market or valuations so that's all going on, but our old tenant is leaving so we're having a new hearing system put in up there and going into that.

The major difference will of course be the lack of storage, the Brinsley house has not got a Utility room, nor a cloak room, nor a loft space, nor an 18 foot out building... So where will we be putting our crap?.... Who knows.

The Virgin Connection is being switched over on the 16th November, so that gives you a heads up when I'll do full dark before hand.

The one worry we have at present is, I headed up to the Brinsley house to give the tenant her finalising letter and get a schedule for her moving, so I could get the plumbers in on the case with the heating, and instead of the tenant another girl hung herself out the window... "What you want?"...

"I want to come in"

"No F**king likely perv"

"No, you miss understand, I'm the landlord, the owner, I have an appointment to measure up for my new heating system, where's XXX"....

"Oh I live here now"....

Oh no you don't lassie, and so she's been oiked out, turned out the tenant could not fully afford it after her last relationship broke down and she got this girl in from her work to share the bills... This girl is the dirtiest schmuck I've ever seen... Uses feminine hygiene products thrown in corners of her bedroom, the carpet stank, she had dirty clothes and rubbish everywhere....

And when I mentioned this needed cleaning up she said "You starting?"... To whit I could only look at the used tampon and say "No, but it looks like you have".

Dirty, disgusting pig... 

The ex-tenant has to therefore pay to clean that carpet professionally, and clean the whole house...

The other thing I noted was that nearly every light bulb in the place was popped... These were new light fittings put in before they took possession, they're less than 11 months old, how did they pop them?.. And how, if "they've been gone ages" did they see, because the landing and stairs run down the middle of the house and are very dark....

Anyway, the lots of decorating will continue I think Friday is a key day, with the estate agents coming.. Then Sunday we have the bathroom ceiling being plastered, so when he's done I'll paint the bathroom wall and lay a new bit of lino... and finally when that ceiling is dry I can paint it.... I don't envisage many WarThunder or Code hours to myself in that time.

However, what I do have in the works is my own personal, and hopefully comprehensive, series (4 parts) covering my fascination with the BF109 fighter, I'm posting this 4 part history from my own sources soon, and also developing a series of "In Game" videos for the type.

I already have one large (45 minute) video ready for upload, but that was from pre-v1.43, so I'm trying to get sometime flying the type post patch.  And when I say "Flying", we're talking exclusively Simulator Battle level detail.

Saturday, 18 October 2014

AO.COM... Yes, a review of a website for you all, this lot have a real mixed experience for you, my experience went from being quite happy with my purchase to utterly and totally dismayed by them, so much so that I ended up having to call them and threaten them with a cease and desist order.


Lets explain, Monday our tumble drier died, Tuesday the house was getting over run with washing drying, so Wednesday the wife asked me to sort a new drier... We're strapped for cash, so cheap cheap, was the order of the day, I checked Coop Electrical, and they had a drier, but you had to pay delivery and it'd take a few days, and we have the estate agent coming... yadda yadda yadda...

So I looked elsewhere, and remembered a TV advert for "AO, Lets go"... bringing their site up, same drier, same price, free next day delivery... bargain?>!?!... I ordered, and at the end of my ordering process it asked me to update whether I wanted to be contacted with offers, and I declined.

However, I had set all the contact details, the email, the mobile number to my wife...

Next thing I know she calls me, "Who are these AO that keep calling?"... Oh, I thought maybe they were trying to arrange the delivery...

No! They were telemarketing, trying to sell the wife cover for £2 a month or week or something for the drier, the drier which a) had not even arrived yet and b) she knew nothing about and c) which I had declined contact on.

So I sent them a nice e-mail asking them to stop... because by then the office was closed, but they kept on calling, 16 calls later and the guy was pestering my wife, she said he was pleasent enough, but when she said "I am sorry, I do not do anything with the bank, I can not set up, and do not want to set up any payments for protection" the guy said... "Go find a bank statement, the husband won't want to miss this offer, get the bank statement and read me the numbers, I'll set it all up my end"!!!

THE FUCKING CHEEK OF THAT!

I'm pretty sure that's illegal, and the pressure it was putting on my wife, you must understand she suffers anxiety, social anxiety, that I've even got her to answer the phone is a big thing, but to have this arsehole calling and hassling her was totally unacceptable.

So, come Thursday lunch the calls not abating I asked the wife to read me the number and I called them, and I got this gal, now she was not the one calling, and I said it's not her fault personnally, but it is the fault of the company, she took my info and appologised.

Meanwhile the drier was delivered and my wife asked the driver about the calls, "Oh christ" he says "the number of complaints they have".

Pressure sales, pushing and pestering, pissed me off... And it seems they're more than aware of it, bunch of wankers.

I'll never be buying from them again, and I'm pretty sure if you read this you should take my sage advice and avoid them too.  Coop Electrical, just as good, zero hassle, and we've had fridges and driers and washers from them before.

We will never be buying from AO again!

Also of interest, I used the wifes e-mail, yet just after browsing their site I was receiving junk mail in my inbox... "You've left something in your basket"... HOW THE HELL DID THAT SITE GET MY E-MAIL?... Clearly through accessing data on my machine, cookies most likely, but... That's against EU law, they've just passed a law saying that sites using cookies must inform you they're doing so... The AO site did no such thing, I got spammed, and when I hit unsubscribe you get someone dressed in a badger on the site giving you gip, it's all just not very funny after the pertubation of bullshit they've put us through, over buying one drier, once...

NEVER AGAIN, AVOID THEM!