Index


RISC World

Football Manager for RISC OS

Paul Johnson

All programs, irrespective of what they are or do are made of two distinct parts; the plan and the code. These work on the basic equation of amount of time planning is inversely proportional to the amount of time required coding - that is to say, the longer and better the plan, the less time it normally takes to get the job done. A classic example of that is SoftEase's TextEase application. Before one line of code was written, every single part of the program was planned and designed on paper - look at the result, one of the finest applications on any platform.

The method

Right, let's look at the task in hand: Football Manager.

Football is a simple game. Twice a week a bunch of talented chaps come together and kick a ball around for 90 minutes. At the end of the match, the winner is the one who has put the ball in the back of the net the most. The more you win, the higher up the league table you go. Sometimes a player hurts themselves or decides to move on, but for most of the time, it's train, travel, play. Sounds incredibly boring, and when expressed like that, it is!

But then as with any macrosphere, when you start looking closely, far more things come into play. Player fitness, suspension, finances and team tactics. On top of that, you have the whims and caprices of the board and fans as well as dodgy agents who make very strange demands. Finally, we have the transfer market. When you add these all together, you soon appreciate there is more to this than meets the eye.

I've missed something : cups. In addition to the league, we also have the FA cup and as you go into the higher leagues, the League Cup, UEFA, Super League, Champions league, Internationals.

Finally, there is the root of all evil - money. Will your team attract a half decent sponsor willing to inject cash into your side over a given period? Who will gain the broadcast rights to screen your matches (or even just the highlights) and how much can you expect to get from this? Can your broadcaster be trusted or will they renege on payment and declare themselves bankrupt rather than payout?

As I say, the closer you look at a macrosphere, the more complex everything becomes. Add onto that having to code this all up and the task becomes mammoth. If we break these down, we can bring things into focus simpler. As this will be written using C++, the task should be simpler due to encapsulation techniques employed by the language.

Okay, let's break the game up into some broad groups and areas. We have the leagues, the players, management and money.

Leagues

Leagues consist of teams. Teams have team statistics. The team stats are goals for, goals against, goal difference, won, lost, drawn and points. Each league has a number of teams.

The league works like this. Each team will have a number of points. The higher the points, the higher up the table the team is. No matter where in the table a team is, if the number of points are the same, then the goal difference (goals scored - goals conceded) is used. The better the goal difference, the higher up the table you go. If the goal difference is the same, it's down to the number of games won.

Example
Team W L D F A P Diff Liverpool 8 2 2 20 2 26 +18 Everton 6 5 1 15 3 19 +12 Arsenal 6 5 1 13 3 19 +10 Millwall 6 5 1 10 0 19 +10 Manchester United 5 3 4 16 6 19 +10

There is no problem seeing who's on top. The next four teams all have the same number of points. Everton is in second due to their better goal difference. Arsenal are above Millwall as they have scored more goals. Man United are at the bottom of this example as they have not won as many games.

Actually, the team names aren't important. The logic behind it is. In steps involved.

  • 1. Sort the teams in order of points.
  • 2. Sort the teams with the same number of points using goal difference.
  • 3. Sort the teams with the same points and goal difference on the number of games won.
  • 4. If (3) has failed, use the number of goals scored.

For the vast majority of the time, steps 3 and 4 aren't used.

The second part of the league is planning the games.

We could just say that our team plays team 2 to team 22 for home then team 2 to 22 for away, but that is not the way fixture lists evolve.

I'm sure you're all used to the "multiplication" boxes; you may have used them at school many moons ago. Simply, they look like this.

     1     2     3     4     5     6
1    1     2     3     4     5     6.
2    2     4     6     8    10    12.
3    3     6     9    12    15    18.
4    4     8    12    16    20    24.
5    5    10    15    20    25    30.
6    6    12    18    24    30    36.

You read the top row, read the left most row and where they meet, it's the answer. Now, if we say that team 1 is Liverpool, 2 is Everton, 3 is Manchester City, 4 is Arsenal, 5 is Bolton and 6 is Manchester United, we can very quickly draw up a fixture list. Obviously, team 1 can never meet or play team 1. The fixture list table now looks like this.

     1     2     3     4     5     6
1    X   
2          X  
3                X
4                      X
5                            X
6                                  X

We now fill in the blanks.

We know that we have to play each team twice; home and away. Say we give a home game a 1 and an away game 0. We know there are 21 teams per division (excluding our team). We generate two random numbers : where the game is played and who is being played. For ease, the left hand row designates the home fixture and the top row the away fixture. The first number out is 0 and the first team is 6. The first game for Liverpool is against Manchester United at Old Trafford. We place a 1 in the away section against number 6. Go around again. Next one out is 1 and the team is 5. (Liverpool vs Bolton at Anfield). 2 is placed in the appropriate place. This carries on until all of the Liverpool fixtures are created. This then needs to be replicated for the other teams, though in all honesty, what they get up to is purely academic!

Okay, that's the league table and fixture list. The final part to this is the promotion and relegation.

For simplicity (and as I don't want to have to enter the entire sub-division 3 leagues), I will say that once you're relegated from Division 3, that's it, game over. You can also not be promoted from the Premier League when (and if) you win it.

Promotion playoffs.

The top 2 are automatically promoted. No questions asked. The third promotion slot is decided by a mini-knockout competition. The winner of this goes up with the other two.

Relegations

Bottom 3 in each division go down. Easy as that.

Cups

For the lower league teams, we are only concerned with the FA Cup. Rounds 1 - 5 are the normal ones (though premier teams don't come in until round 2), 6 is the quarter finals, 7 the semis and 8 the final. It is simple enough to draw this up. Generate a random number and play them. Next round, do the same, then the same, then the same. Each time, the number of teams available will be halfed.

The winner plays the winner of the Premier league for the charity shield at the start of the next season. Initially, this will 100% not be your team!. If the winner of the FA and Premiership are the same, then the FA winners will play whoever came in second.

Foreign cups.

Champions league is a set of mini-leagues (4 teams), after the league is finished, it's through to the knockout stage up to the final. It used to be two sets of leagues, but that has now been changed.

UEFA cup is a knockout tournament.

Intertoto cup - whoever comes in 4th in the premier league enters this (plus one other). Win this knockout tournament and you go through to the UEFA cup.

These need not concern the lower league cups.

Players

Players are just normal people, like me or you. Sure, some get paid in excess of £30,000 a week, but at the end of the day, they are just skin and bones like the rest of us. Like the rest of us, they are prone to the same ailments (colds, muscle sprains, bad hair days etc.).

Each player has their own attributes

Name,      Age, Skill, Fitness, Position, Value,      Injured, Salary.

These translate into something like:

Owen,      22,  9,     18,      A,        21,000,000, N,       80,000.

...or in the 3rd Division.

Timbrell,  35,  2,     3,                 21,000,     Y,       250.00

You can see the gap. This gap is known here are the "reality" gap.

Imagine you're at the bottom of the 3rd division, money is too tight to hit the transfer market, a good amount of your team is injured and your next match is against a Premier side. The chances of you winning are remote. I'm not saying it won't happen, but it's remote. Face it, the players in division 3 are mainly part timers - they will neither be as skilled or as fit as a premiership side. When calculating the odds during the match, these attributes must be taken into account. It could work out that for every 6 attacks they have, you have one. Then again, they may never score and on your only attempt, you blast it in. By incorporating the player stats, we can introduce a good element of reality. (Unfortunately, this element of reality was missing from both the original and the follow-up versions. On a number of occasions, I played in FA Cup finals containing 2 fourth [as was] division teams).

With each match, if a player is constantly played, their fitness level will drop. If it drops too far, the player will just be too tired to play and is more likely to trip, fall, graze their knee and be out for a week. Rest the player for a week (2 matches) and they'll be as right as rain, perhaps not full fitness, but able to play.

Players can also be injured and when this happens they cannot play (well, duh!) and must be given time to recover. After the injury gets better, it will take a couple of weeks to get match fit again.

Players also need practise in passing, shooting, controlling and saving (for goal keepers). Some players may play better on the left than the right. Most players can also play in alternate positions (attackers playing midfield, midfield and defence being interchangeable) but when this happens, their effectiveness diminishes the further from their natural position. This is at it's most extreme when a goalkeeper plays in attack.

Players also have their dark side; their agents. These can cause a hell of a lot of embarrassment to players by trying to cause trouble, make speculative comments and basically be PITAs to teams and managers.

The final part to any team is their formation. Is it a good idea to play 1 man up front as the sole attacker with 5 in midfield when the other team have 4 in defence?

You can appreciate by now the difficulties in analysing a game as simple (on the outside) as the beautiful game.

Management

The toughest position to be in any football team is not that of the player, but that of the chap who sits behind the door with the word "Manager" written on. He has to be able to determine the team tactics, team formation, the money side of things (though in reality, this is the finance directors job). He has to be able to take the tough decisions on who's in and out, be able to resolve team disputes and moreover, be able to take the flack when the results are not exactly going your way.

In the football manager game, the manager does everything from taking out a bankloan, keeping an eye on finances, buying and selling players, deciding who is playing as well as keep a track on the players. There are no second in commands, no finance directors, just you.

The manager will gain points during the season depending on how his team does.

Money

Obviously, no game would be complete without the element of money. There are three sources of money; sponsorship, TV and prize.

Sponsorship tends to be a fixed number of seasons deal whereby the club gets (say) 50,000 pounds per season for 3 seasons with a bonus of 10,000 if they win something decent. Unless a team really does badly, sponsorship tends to be a guaranteed income for a number of seasons. The club is given this money during the closed season after the FA cup (for the game at least!).

TV money is a consortium affair whereby a division has a negotiated contract to televise a fixed number of matches over a number of seasons. The contract works by each team getting a share of the contract with an extra amount per televised match. Obviously, the better you are doing, the more matches of yours will be shown. The lower leagues will not get anywhere near as much as the higher leagues - how many people would rather watch Enfield vs Cambridge compared to (say) Liverpool vs Man. United? Pay per view will not happen until a team hits the premiership.

Prize money is easy. If you are promoted, you get money. If you win a cup, you get money. It's a once a season affair.

You will also get money from gate receipts.

That's the good side. The bad side of money are the bills; people won't play for nothing. There are wages, ground costs, council costs, rates, water charges, ground maintainence - the list goes on and on and on. To keep this simple, all the bills (except players wages) will be lumped together.

Right, that's the game synopsis. Next time, I'll make a start with the game plan and see what RISC OS parts need to be identified prior to coding.

Paul Johnson

 Index