1. Introduction

This is a demo for the open source football match engine OpenFootie. A football match engine is a simulation engine of a football match. OpenFootie is a text-based engine which means that the output is a textual description of the football match. This pretty much describes the OpenFootie project, especially if you are familiar with match engines and relevant football management games. In the following section, I am going to elaborate a bit on match engines "theory", which will allow for a better description of the OpenFootie project as well. Feel free to skip section 1.1 if you only want to read a description of the demo.

1.1 Match Engines

Match engines are popular from football management games, where the player assumes the role of a team's manager and tries to lead his team to glory. We may say that the match engine part is the core of those games, where the manager's decisions pay off or turn to disaster. The first match engines were text-based, while later on, 2D and 3D graphic match engines were produced.

A review of match engine technology would be out of scope of this document; I will only mention that the motivation for starting OpenFootie was the discrepancy between the number of commercial match engines (which were part of games, i.e. not stand-alone) and the open source ones (part of games or stand-alone).

In the following paragraphs, I am going to give an overview of a match engine, and attempt a definition as a side-effect. These are only personal opinions, since there is no formal standard of what a match engine is.

Just like every type of software, we may view a match engine as processing of an input in order to produce an output. This rudimentary view lends itself as a framework for the classification of match engines.

1.1.1 Input

For match engines which belong to a context of a game, the input is designated by the game itself and its features. We can define as minimal input the starting lineups of the opponent teams, along with their tactics.

The starting lineup of a team should be more than player naming. In the context of a match engine, we are interested in the player's abilities or "attributes" which will affect his team's performance. Therefore, each player is associated with a set of attributes and each attribute has a ranking which shows how good (or bad) a player is on a particular skill.

The amount of granularity of tactics definition can be very large indeed, to the level of individual player instructions. The minimal tactics definition is the simple support for "fixed" tactics such as "4-4-2" or "4-3-3". When defining the starting lineup, each player must be associated with a position on the pitch.

Finally, in real world football the coach/manager can alter the input according to the match outcome: he can substitute players and change the team tactics. In the context of a simulation engine this reflects the fact that the input should be able to change during the match, instead of just being defined at the start of the game.

1.1.2 Output

The output is the presentation of the match outcome to the user. This can be done in a couple of self-explanatory ways: visual and textual. The ideal match engine produces a visual output which matches the ideal and natural output of real life football. However, a 100% faithful representation of a football match by a software falls short of the neccessary abstractions, making the outcome not 100% realistic. In addition, stats production (text-based summary of the match outcome) may be helpful in assessing a team's performance beyond the visual representation; what I am saying is that a textual approach is a good value for the cost of implementing it, taking into account the actual scope of the corresponding project as well.

1.1.3 Processing

So, how the input of a match engine (players' attributes + tactics) should map to an output (textual description or visual representation). This is an interesting question, since in my opinion a realistic match engine is not only a visual one that faithfully represents the output of a match (in fact this is a different "kind" of realism) but one which would map the input to the output as closely to the way these would be mapped to real life football as possible. I hope I haven't confused too much, nevertheless I will be more descriptive: each match engine has some algorithm that does just that: maps the input (however fine-grained, i.e. realistic) to an output (different levels of realism too between games/match engines). In the commercial match engines this is done arbitrarily with the focus drawn on the visible parts, i.e. the input and output for actually assessing the match engine and teams' performances. OpenFootie's scope is to offer a transparent (through being open source) way of mapping input to output, not in the sense of producing a visually realistic output but in the sense of that a well-defined input will yield a valid output in terms of potential outcomes (results, stats, performance, etc.). Again, I am not to say that a good 2D or 3D match engine would not be welcome, just that at the first stages of this match engine project, I am interested in the validity and transparency of a match engine algorithm.

The above goals are not in contradiction with the use of abstractions. What would constitute a "perfect" match engine? In terms of processing, if we could know the exact position of each player at the field at a specific time, with the players behaving as in real life in terms of their movements and actions then processing-wise this match engine would be perfect. To illustrate the contrast with input and output, this perfect match engine described above does not neccessarilly have to be visual, although that would be the only practical way to validate its realism. The input of course is totally arbitrary. Take for instance a real life player. This player must be mapped to a set of attributes-values pairs which will identify the player's ability and should be translated to a specific performance in the simulated match. As perfect as the processing of the match may be, the connection with the input as defined for the specific match engine is a different problem.

In the same sense that creating a 100% realistic 3D match engine is not something to be sought after at the first stages of the development of a match engine, the same stands for the processing. The approach I decided to follow regarding OpenFootie is that of leveraging statistics to simulate a football match. At first, I built a probability model based on the description of an existing match. Match facts are codified in a special format. For instance, the action of a goalkeeper kicking the ball high towards the opponents' half is likely to result to an aerial challenge and/or a header. Based on this "action -> outcome" event modelling, we can re-shuffle the model football match events (in a meaningful way of course) and produce new football matches. There are more details to be provided, but they are out of scope of this document. It is in my plans to provide a further analysis of the internals of OpenFootie as part of developer's documentation. Nevertheless, I hope I gave you an idea about what OpenFootie is about, as well as my motivation for starting it.

1.2 Pub Soccermanager

It is virtually impossible for a match engine to be self-contained. You need a way to provide an input and render the output. My goal is to make OpenFootie a library that can be plugged to different applications with different scopes and goals between each other as well. Pub Soccermanager is a demo for a soccer manager game that will serve as a reference context of the OpenFootie match engine. There are various reasons for this. First of all, OpenFootie is planned to be a library and as such it will need at least a host application to come into action as well as to be tested. It is also a more convenient paradigm in terms of input, output and certainly interactivity. I think more or less the above reasons are obvious. One additional reason is that by seeing OpenFootie in action as part of a bigger application, I can spot more easily what it needs to be done, in terms of pluggability with varying host applications. Last but not least, it is more fun to play with a demo which is already there on the web than attempting to make sense out of a library. In fact, OpenFootie is runnable from the desktop, but it is not as flexible and not at all interactive compared to the online demo Pub Soccermanager. Why named it "Pub" soccer manager? Well, a prior version of this application was used for testing and running OpenFootie with the plan of going "public". There were some modifications for that public version, which essentially became the default one for both public display and "internal" use. This version was named "pubmanager" against the "internal" version and kept this name for going live.

2. Features

For the time being, Pub Soccermanager is just a demo of a soccer manager game. The player may only play friendly matches and certainly there is room for improvement in terms of usability. The improvement of Pub Soccermanager is an ongoing progress both in terms of usability and features. This document attempts to describe Pub Soccermanager in its current state, so that its weaknesses and features are discussed and presented explicitly to the user.

2.1 Teams/players

The teams to select from are national teams. At this stage the set of teams is most of the teams qualified for the 2010 World Cup. New teams are planned to be continuously added, eventually supporting most of FIFA national teams. The players' names are not of real players. Each player is associated with one optimal position and has a set of attributes ranging from "Very Poor" to "Excellent".

2.2 Matches

The matches functionality will be described in this section. For specifics of this functionality regarding the match engine itself, you are encouraged to review the match engine documentation found in the OpenFootie downloads.

2.2.1 Prematch

The user can select from this set of 28 teams two opponents to play against each other. A team cannot play versus itself. There are two modes of play: "Human" and "CPU". Any combination is possible: the user can set the two selected teams to play against each other being a neutral spectator and without the ability to intervene, or you can easily control both teams if you want to experiment with the match engine outcomes. The most usual option is of course that of a human-controlled team playing against a CPU-controlled one.

I would like to make a couple of comments here: for the time being the PubSoccermanager is single-user. The only way for two human players to play against each other is to be on the same computer. However, it is planned that online human vs. human games will be supported (although some important changes in the gameplay must be made and it will be significantly different from the single-user version). In addition, the only actual challenge for a player is to select a team and play against a CPU-controlled team. In the near future, user registration will be supported, so that a user can keep records and stats of games played. Of course registration shall be optional and anybody will still be able to play on equal terms. For registered users, I will keep public stats and provide rankings between users. The games that will be taken into account for those rankings will be the "Human vs. CPU" ones, while every game will be recorded for the user's review, irrespective of being counted for the user ranking or not.

Once the opposing teams are selected, the user is able to select the tactics and lineups for the teams under control. If the match will be with two CPU-controlled teams, then the user is redirected to the prematch page which shows the lineups and the position of each player on the pitch according to tactics.

There are currently 10 "fixed" tactics to choose from. To select the players for the lineup, click the "Select players button". A pop up window will be shown, displaying each of the squad players, along with his recommended position and a selection box for mapping the player to a tactics position. If you want to remove a player from a position (because you changed your mind, or you want to put another player in the same position, simply select the "..." option to make the position available again).

You can also skip the player selection stage altogether by clicking the "Auto-selection" button. Your team's lineup is picked automatically and you can advance to the match generation.

After you finished with your tactics and lineup selection, and provided that they are valid click on the "Done" button to be transferred to either the second user-controlled team or to the prematch page. There you see the lineups as mentioned above and you only have to click "Play" for the match to start or "Exit" if you want to cancel the match.

2.2.2 During the match

Now, you should be transferred to the match production page. What is shown there is pretty much self-explanatory (team statistics, timer, ball possession and scorers). The duration of each match is fixed to 3 minutes of real time (1.5 minute for each half). In the following paragraphs I will describe the actions that are available to a user during a match.

A match can be paused as it is played. This is for the user-manager to perform changes to tactics and/or lineup or just browse through statistics and match information. Only when a match is paused the user may perform any action during the match. Above the "Pause" button, there are the "Player ratings" and "Match report" buttons.

Clicking the "Player ratings" button will show a popup with the ratings of each player. Although this is not the strongest point of the match engine (see the documentation for details), it can give you an idea of how each player is performing, especially during the match. For a thorough and accurate demonstration of individual performance, player statistics are available, as we will see below.

Clicking the "Match report" will show a popup displaying a simple description of the match events.

The tactics page is also available during the match. After you pause the match, simply click on the name of the team whose information you want to see. If it is a team you control, you can perform any change you like in either tactics or lineup without any restrictions (apart from the obvious reason of keeping things simple, the official excuse is that the restrictions are context (competition) bound and not directly related to the game itself). Clicking a "Statistics" button, which was not active during team selection before the match, a popup will be shown with each player's individual statistics. If you don't control the team, this is the only action you can take in its tactics selection page. When you return to the match main page, the match resumes automatically (i.e. you may only review one team tactics page each time you pause the match).

The match is paused at half time. You can click on the "Half time" button to start the 2nd half, when you are done with your tactics and/or browsing or if you just want to move on.

2.2.3 After the match

After 90 minutes of virtual time, the match naturally ends (no injury time supported yet). The final page is similar to the match production one. There are corresponding buttons to read the whole match report, to view the player ratings and to view individual stats for both teams' players. There is also an option to restart the match with exactly the same settings (no need to pick the same players again). If you'd like to repeat the match with the same teams but picking a different lineup and/or tactic then quit and start a new friendly from scratch (or perform your changes after the first minutes of the new match). Clicking "Exit" will get you back to the main page.

3. What's next

This concludes a simple presentation of the Pub Soccermanager demo along with some introductory information that underly its scope. Except from the site improvements (such as support for user registration) the next feature is to add support for simple tournaments. As I said this is a work in progress, so have fun!
Andreas Tasoulas
PubSoccermanager demo documentation
© 2010
Last changed: 21 Oct 2010