New Star Blog

Sunday, March 25, 2007

Localise This

This week has been a bit of a strange one. It started slowly due to the task of translating NSS3 into Polish for games magazine KomputerSwiat (look out for it in Poland.) It proved to be a lot more time consuming than I'd hoped, as is often the case with seemingly "simple" jobs, but once I'd got my head back into NSS4 my work rate gathered pace and is currently running at full tilt.

If you didn't know already, in NSS4 I intend to offer the option of playing as a player or a manager (or even a player-manager). This means that as your career as a player comes to an end you can move into management and continue your game. My first assignment for the week then was to bring in some of the management features that are needed such as tactics and team selection. For computer controlled teams I implemented some manager AI (artificial intelligence) to pick the best team available, taking into account various things such as skills, form, energy, confidence and so on. Players that are picked will receive a match rating based on their performance, which determines their form, but they will use up a certain amount of energy during the match (depending on their stamina) which they will need to recover during the week. With some players recovering faster than others, and match form fluctuating it means the computer managers aren't picking the same team each week. There's still a lot of AI work to be done (at the moment the computer managers don't changes their tactics at all) but it's a good start. For the human managers (that's you) I have set up a simple tactics editor and team selection screen.

Using the same system you can also select your first eleven and the substitutes. First you click on the player icon, then click on the player name in the list. By clicking on two players already selected you can switch their positions.

With that in place I realised that I was only a step away from have a reasonably playable game. Admittedly a very shaky one (competitions aren't yet finished, player abilities don't change over time, there's no transfer market etc) but if I can implement a match engine then we have a management game where you can pick the team, choose your tactics and win the league. This will of course make testing the competitions far more interesting. One thing I've been keen to do since the outset was bring back the text match engine from NSS2. It's clear to me that some people simply prefer to play matches with the click of a mouse button, rather than wrestle with a joypad, as NSS2 continues to sell a few units every week. Ideally then you will have a choice of text or 3D action matches in NSS4. I will be completely re-writing the text match engine simply because it will need to deal with real players (if you remember, there wasn't a player database in NSS2) and besides, I'm a much better programmer now than when I wrote NSS2. The trouble with text matches though is that they require an awful lot of words. "He heads the ball on." "That's a great tackle!" You know the kind of stuff. So if I want to localise NSS4 (translate it into various languages) then I aught to get the localisation system in place early on. As I'm programming the game in BlitzMax I set about searching the BlitzMax forum for some ideas on the best way to go about it. I had already thought of using XML files when 'hey presto!' it turns out that a chap called Brucey had already written a free module that did exactly that. A few hours later and NSS4 in is completely translatable. I simply offer the English text file to some clever multi-lingual people like Fabrizio (go and say hello to him on the NSS forums) they return it back in another language and 'alacazam!' the game is localised.

So now that important feature is in place I can set about creating a text match engine. I better get on with it. See ya!

Thursday, March 01, 2007

Have a break. Have a Crackdown.

I decided to take a little break over the weekend as I was going slightly insane working on the tournament creations. It didn't help when someone pointed out that the Scottish Premier League does a funny split after 3 rounds, and another person mentioned that American leagues tend to play teams that aren't even in the same division! Then of course there are regional divisions that will need to manage promotion and relegation correctly. I thought I was so close to completing the tournaments and then the carpet was pulled out from under my feet!

Often when I hit a wall I turn to a gaming console for, wait for it, consolation. (Oh dear.) So during my time-out I picked up Crackdown for the Xbox 360. It's a great game in the vein of Grand Theft Auto but with an amazing physics engine that really sets it apart. Shooting the tires of innocent truckers and watching the lorry fly off a bridge shouldn't be so much fun, but I'm afraid it is. Must be some form of stress relief.

So, getting back to the grind stone, I decided to nudge the data editor a little closer to completion. I'm currently working on an autostat feature that will create random abilities for the players. I say random, but they will be influenced by the player's Position, Age, Squad Status, Club Strength, Height and Weight. Basically if the club's strength is 80 (out of 100) then a defenders tackling skill will be somewhere around the 80 mark too. Of course, his dribbling skills won't be all that if he's 6' 5" and weighs in at 14 stone, and his shooting will be pretty low (otherwise he'd be a striker right?).

It may sound quite straight forward but it's quite tricky getting the balance right, especially when you have to take into consideration the age of a player. Youngsters will generally have lower abilities than a player in his mid-twenties but some abilities such as Pace will be highest during a player's earlier years and decline slowly as they get older. Still, it's all good fun and will serve me well later when the game has to generate new players as the seasons pass and old players retire to that beach bar in Tenerife. (Hopefully some will stick around and replace the retiring managers, but that's a concern for another day.)

So that's where we are now and I'm eager to get another version of the editor out this week. Then I can get back to setting up the ramshackle tournaments - inbetween crazed bouts of van sniping, no doubt.