Tuesday, 18 March 2014

TA Championship Soccer v0.9.7

For the latest version of TA Champion Soccer (v0.9.7) - these are the key points of the release.

Date: 18th March 2014

New Features;
  • Transfer AI - AI clubs now buy your players
  • Clean up of Player Screen
  • Fixed login issues with Facebook
  • Millions of bugs and issues
Testing Focus;
  • The years rollover correctly
  • Previous years data is correct and viewable
  • Fitness and long-term stats are realistically maintained 
In The Pipeline;
  • Multi-player, 'network' games
  • Live match games
  • Substitutions and suspensions
  • Overhaul of match engine
Side Projects;
  • Static data
  • 'Time machine' for player data - select any year as a start point

Tuesday, 5 June 2012

The Greatest Game Ever Written

(I wrote this years ago, but thought sod it, and here it is...)

Ah!

When the waiting finally stopped, and the world and it's reviewers finally got their grubby mits on GTA IV, the praise was universal and gushing. A glace at Megacritic and you can clearly see it's received more 100% scores in over half it's reviews.

It therefore *must* be the greatest game ever written, but I hasten to differ. Not beg, but hasten!

I'd try and offer some counter points first - a few acknowledgement of what GTA IV does well - before launching into my criticisms, but I'm not going to bother. You can use that link above to find many words on the wonders of GTA IV without me re-treading old paths.

So. What is wrong with GTA IV? One thing from one review I read of the game was that GTA IV was an advancement in the series to where you "no longer need patience to play the game". I think the review was from Eurogamer but I can't be bothered to look it up. On the strength of this statement I was initially excited; the game had obviously been polished to perfection. The truth of the matter was indeed.

Lets take a fundamental; this game is about steeling cars, it is of course called "Grand Thieft Auto". So - following that fundamental point - the game itself should predominantly be about driving cars... the basis of skill on which the game is played should be about your ability to drive cars....? Now - throughout the course of playing the game, I can't actually remember a single incident when my l33+ driving skills were ever much called into action. Many mission involve taking person A to place B - which is completely without challenge (most of the side missions involve doing exactly that - and usually involves them getting straight back in the car and driving all the way back. Sorry... remind where this is actually fun?) - a few missions involve chasing bad guys in cars and trying to take them out, but that is usually more easily accomplished by simply following them and either waiting till the AI screws up and you take them out easily while they are attached to a lamppost or simply waiting till the end of the journey where they get out of the car and they are removed without hassle.

Most of the actual missions are cut from one cloth. Meet a guy, they tell you to kill someone, you jump in the car (making sure not to use a nice car since you are bound to lose it when going on a mission, so all your nice cars end up in your parking spaces and never actually get used) drive to the place, you get out the car and shoot them up - and the fundamental element of skill in this is the shooting. The game isn't "Grand Thieft Auto" but "Murder in the First, by shooting people". Car driving is largely irrelevant. But thats okay, you say, because since the game is 90% shooting, and I love shooters, that part of the game will undoubtedly be very polished? You probably already know how un-true this is.

The on foot element of the game is woeful, even comically bad. Most of the time shooting is simply hit left aim-y-thing, jam right trigger till bad guy is dead and repeat. Absolutely no skill what so ever. In fact - the only area where this could involve any skill would possibly in shot selection, although that is totally broken - it's almost impossible to convince the target to loose it's currently selected victim and select the one you want. Your direction is totally irrelevant when you press aim as it'll simply go for the nearest bad guy that is currently hiding behind a wall as opposed to the guy shooting you to shit that you are looking at.

The cover system would be a nice addition to all this but in the end serves as the place of most frustration and indeed the only way I ever actually die. Pressing the "cover" button will put you in cover. While in cover, there are 10 buttons on the pad that effectively do nothing. But rather that use one of them to do one of only two actions available (other than aim/shoot obviously) is break cover and head to other cover. Unfortuantely these two action are triggered by the same button - yeah - the same one that puts you into cover. God forbid that you could press "run" and the direct you wish to run to break cover, oh no. After all that might waste one of the 10 unused buttons - that would be far too sensible. Instead, you get the fun of being caught between two objects (or two walls in a corridor, say) in which *all* you can do is simply bounce between the two, with an additional disorienting camera spasm to boot. When you have the pleasure of breaking cover and becoming unattached to nearby furniture, you then have the unenviable position of being shot to crap while the character finally responds by actually running.

Hmmm.... luckyly for us, Rockstar have solved this problem! As stated before, you don't need patience to play this game, right? Because whenever you die, you can re-spawn to replay the mission again instantly! Awesome! Adding a feature like that shows they care of course? It does of course, break any sense of jepardy or achivement but at least it's a hell of a lot easier than actually trying to fix the fucking useless control mechanism.

After all control isn't exactly an important aspect of games, is it?

So, lets re-cap. We've a driving segment that requires no skill, we the predominant shooting sections who's only skill is patience and persistance - a guarantee to progression. And.... er.... well that's it. That's all GTA is for the most part.

"But wait! Col, mate, you are missing the point", I hear you say "it's not just about the missions, there are loads of other side-missions that exploit some of the areas you want, like the races for car driving skill...." Oh, yeah - the races... those races of which I've never failed to finish first....? Those ones? Those really challenging races...?

And talking of irrevance - could someone explain to me the meaning of money in the game. Money is given as a constant reward for ****

What it boils down to, it that GTA IV is effectively a point and click adventure. It's probably the reason why I've spent so much time on Guitar Hero III and Rock Band. Those are both games that rely entirely on player skill. If I'm not good enough, replaying infinitely won't make me succeed (not without actually improving my skill.) I'll never complete the game unless I'm actually good enough.

"But Col, mate, it's not about skill, it's about immersion - it's about story and characters".... ah, yes - those characters - my friends and girlfriends and employers and even family members - those characters, which bar one, I'd quite happily murder every single one. They are all either two dimensional or fucking irriatating. Being told to kill someone is uninteresting whether it's told by 2-dimensional gangster #1, 2-dimensional gangster #2, 2-dimensional gangster #3 OR 2-dimensional gangster #4.

Focus!

I've finally gotten round to picking up this blog, and now I'm going to use it as a developer diary for the game I'm producing. The game is an Online Football Manager game. Probably been writing it now for about 4 years. I've done 100% of the work, and only in my spare time. It's finally starting to get to a playable state. Check it out;

www.otbcs.co.uk/tacs

Thursday, 7 May 2009

Frakkin' Hibernate vol 1. "deleted entity passed to persist"

Well, I haven't posted to this blog in what seems like a decade. As usual - so much has happened in my personal life, but that is another story for another blog (or, at least, another blog post).

Today, I'm here to talk about Hibernate, some of the problems I've had, in the hope that writing them down, not only helps me think around the subject but also commits it to memory.

I've attempted to author O/R frameworks myself, in the form of a fast lane reader for a previous company, back in the days when decent and mature O/R frameworks were a rarity. That said, I like Hibernate - I appreciate how impossibly hard something like an O/R framework is to keep simple, and Hibernate does a pretty good job. I like it's principal where you simply treat the objects as normal objects, never expect anything automatic to have (like automatic persisting) and bingo - simple and elegant.

Doesn't stop it being a pain in the back-side.

For a start, some of the error messages could be more vague. If they tried, really hard. Maybe. It has a raft of quirks that aren't really acknowledged in error messages.

Finding solutions to errors can be a real pain. Mostly because with Hibernate and JPA, Annotations and XML configuration, Spring managed or not, different package configuration and versions - what ever error you have, it's very difficult to pinpoint and solve the specific issue.

Take the inspiration for this post; "deleted entity passed to persist" was the given error message. Like any other programmer in the world, you encounter a problem, bosh it into Google and search for those who'd have the problem before and try their solutions, which if they don't solve the problem will usually teach you something new. Now - try that - and search for it in Google (here), and witness the number of like mind people - then find one that actually has a solution. Yep! None!

Now the basic premise is this;

class Parent extends BaseDomainObject {
@OneToMany( mappedBy="child", cascade=CascadeType.ALL, fetch=FetchType.EAGER ) // bi-directional
private Set clubMatchRecords = new OrderedHashSet();
}

public class Child extends BaseDomainObject {

@ManyToOne( cascade=CascadeType.ALL, fetch=FetchType.EAGER ) // bi
@JoinColumn( name="parent_id" )
private Parent parent;
}

(Note : OrderedHashSet is simply a combination of Set and List, allowing an indexed set, BaseDomainObject is er... the base domain object. What can I say... I like obvious names)
(Note 2 : observe the use of the Standard Colin Notation (SCN) in the code... :) )

This sort of setup is prevailent in many tutorials (for example, here; http://mikedesjardins.us/wordpress/2008/01/new-jpa-tutorial-pizza-shop/)

The problem? This line...;

@ManyToOne( cascade=CascadeType.ALL, fetch=FetchType.EAGER ) // bi

Basically, with a delete, it tries to delete the parent, and marks it as deleted. It the then tried to delete the child, the child in turn cascades the delete to the parent and hence an error is thrown.

cacade = Parent -> Child -> Parent

I've got to admit, looking at it now, it seems so obvious, but when you've Object graphs 5 layers deep, all with multiple collections of children etc., it's very hard to actually spot what is going on. Still, lesson learnt.

One of the reasons I'm highlighting this as a factor as it affects the design stage rather than the code stage. The life-cycle of objects, how they created and destroyed becomes a design concern and really should be tackled by designers before coding.

This, along with another issue have been my biggest "gotcha" of Hibernate so far. The other issue? Again - it's another that requires an element of pre-design, and hence it's significance. It's down to lazy retrieval of Collections of a abstract classes. To fully access the children, have them form of the correct type of objects (i.e. have collections of Animal be of types Cat and Dog, rather than a complex Animal proxy type), for valid object comparisions, the fetch type needs to be EAGER. Hence the designer should take this into consideration when designing the object model.

Thinking about it - does it also break polymorphism...? It's been a while since I had to deal with this issue and now I'm curious! Hmmm...

It does work as a general rule of thumb, that if an object needs to cascade from parent to child, it should also be an eager fetch, and vice versa, if there no need for cascade or eager fetch, there is no need for the other (i.e. going back up the object stack).

Finally, hibernate does loads of great things but I'm struggling to find one feature - create or drop the database programmatically? I'd like to set up a test suite to drop, create, populate, run some tests and be able to repeat the process again for other test suites. The problem is that I can't find in the API of JPA or Hibernate programatical means to do this. We've got a fraking XML property we can set to do this once at start-up (or once of each and every test) and hence once during testing but flexibility.... I'm sure it's there somewhere but bugger I can find it! *bangs head on wall*

Thursday, 23 October 2008

One of life little problems - solved!

How long have I been programming? Since I was 8... that's 23 years, and hence I'm a little annoyed that I've only just come up with something that seems so obvious in retrospect.

It is a solution to the classic program formatting dilemma.

First a couple of examples;

// Java Standard
try {
XMLDocument response = agent.request(xmlRequest, logger);
} catch( FailureReport failureReport ) {
throw new GSSystemException(failureReport);
}

// C/C++ Standard
try
{
XMLDocument response = agent.request(xmlRequest, logger);
}
catch( FailureReport failureReport )
{
throw new GSSystemException(failureReport);
}
The above illustrates the difference between the 2 notations. The first, the IBM Standard Java format, is something I've never really liked since everything looks so bunched up - bunched up code is much harder to read - I end up putting random whitespace in anyway, but with no level of consistancy.

The C/C++ notion is much better in terms of readability, but doesn't have the symemtry of the Java Standard and suffers from a fatal flaw; it's not Java Standard!! :)

But we have the solution! How to write *almost* standard Java code with out any of the issues;
// Colin's much better method

try {

XMLDocument response = agent.request(xmlRequest, logger);
}
catch( FailureReport failureReport ) {

throw new GSSystemException(failureReport);
}
As you can see, it's exactly the same as the C/C++ notion, but with the brackets at the end, a la Java Standard but with the whitespace preserved... see what I mean about it being obvious?

The great thing is the only bit that isn't really standard is the fact that the "catch" clause is dropped to the next line - but I'm not sure that is specified anyway, since I've since lots of code with the dropped line... and no - I can't be bothered to check!

Wednesday, 8 October 2008

Why I stopped worrying and learnt to love the UK MegaBase

Oooh - check me out and my multiple posts with in a month... :)

There has been a lot of talk for many years about producing a massive database of everything ever, so that the Government can spy on us, frame us for crimes we didn't commit and... er... tell us to pick up litter and the like. It's never going to actually catch terrorists, as well we all know. The latest idea being touted is another variation on the theme, only this time is just the secret service as opposed to the actual government, for all the difference that makes.

So... this is Government IT project... how much fear can be levelled at such a thing? Personally, for all the reactionary emotions it envokes in me, I can't actual worry about it. Not even for a minute. For a start the only comparable project was the 2.3bn HNS database which ended up costing 12bn... that is a ratio of 6:1 over budget. I'd also hazard a guess, the bigger the project, the larger the ratio by a matter of a an exponent rather than a fraction. Regardless, a 12bn project is going to cost at least 72bn if we take the model of the NHS database. This coupled with choice facts such as, would the project even be able to deliver all of it's functionality or would be massively scaled down to the point of uselessness - if indeed the bloody thing was ever actually delivered, again reduces my fear by significant amounts.

But the real clincher is this, if by some miracle the government can muster the exorbitant funds needed to achieve it, that it actually gets delivered, that it actually does a fraction of what it's supposed to do on the tin - what will have been created? We are talking a massive amount of data in what is most likely the most unsecure system ever built - this is the government remember - security is hardly a specialism when it comes to data. This is down to it's nature - the system is going to have everything (or lots of things depending on the variations of scenarios) fed into it, from so many channels it will intrinsically unsecure. But to stretch the scenario in the governments favour, even if it was relatively secure, breaches will happen - it's inevitable.

So... you are Mr. Hacker McBlackHat and you've finally cracked into the UK MegaBase and you've yottabytes of data you could steal, but obviously you've got to be selective - you can't nick everything after all, even with your massive hard drive, it isn't exactly UK MegaBase size - so what do you go for? Personally, any hacker breaking into the UK MegaBase is going to have some political motivation or if no politcial motivations at least a sense of irony, so I guess you'll be going for the details of politicians? That CCTV camera footage of them with an attractive young lady when their phone record told their wife they'd told their wife they be in meetings with foreign dignitaries? The addition of £100,000 to their private bank account when they'd suddenly changed their mind on a political issue? The politicians pastoral best-friend being caught on camera with a lade? For everything that common Joe Public should fear of being caught of politicians should have that fear 10 fold.

Now, tell me, when the politicians see their colleagues careers being destroyed due to a spotty teenager running a script, when it's cost gazillions of pounds and still doesn't actually work, and when a another, different, government could easily be voted in to simply oppose this one issue... how long it is ever going to last...?

Thursday, 2 October 2008

A Daily WTF

Ah! The first blog post that was never followed up... how many of them must exist...? I do have some valid excuses - I've split with my 3 year long girlfriend (nearly typed "3 year old girlfriend" then, but caught myself), I've been trying to sort out the decimated state of my flat, the company I've been working for is going down the shit pan and my band has split up. Yes, I possibly should've blogged this as I went along, but it was necessarily foremost in my mind. I will be getting back on this, tho'. I guess there'll be less reviews as I've no longer the company of the person whom I watch so much sci-fi with, but there you go!

The Daily WTF is one of my favourite sites - it's much like, say, the stupid things people have said thread, but for dump arse computer code - a stupid things people have coded thread, if you like. I've had a nice work based WTF today, which I'd like to share.

Since I need some dental work done, I'm planning to sign up for my works dental heath care scheme. I phone the companies benefits people and I'm told that I'm not on the HR system... which is funny considering how much they are willing to pay someone who apparently doesn't work for them. So, I ask the girl if I could have HR's number and I was told that they wouldn't actually speak to me, and that I'd have to go through my manager. Turns out, they don't actually have a phone number - just an email address. For a department who's primary function is to deal with employees it seems slightly ridiculous that there is actually no facility or ability for those employees to speak to them - even managers aren't allow direct contact...!

Anyway - I'm sure to make another post later - keep on a roll! :)