The Evolution of LeManager's Match Engine
How we went from chaos to realistic football simulation through three engine iterations
The Evolution of LeManager’s Match Engine
Without going into too much detail, the current match engine at the time of this writing is V3. Here’s how we got here.
V1: The Original
The V1 was based on events (passes, substitutions, goals, and so on) basically everything happening during a match. We had a few constraints in place to conform with football rules, but the engine could generate any events in any order, and this is where problems emerged.
You could have a corner at one side followed immediately by a corner on the other side, or goals appearing out of nowhere with no buildup. The matches lacked flow and logical progression.
V2: The Sequence Engine
This version produced realistic game phases initially, but quickly revealed its limitations. Sequences were events chained together, for example, a pass followed by another pass, followed by a shot and its outcome.
Like V1, events were chosen by probabilities, but V2 was too rigid and felt scripted because we had a fixed number of sequence types: build-up, defense, and so on. To make it more organic, we would have needed to create hundreds of variations for each type. We needed something more flexible and logical.
V3: The Event Chain Engine
This engine represents a significant step forward. We start with the kickoff event and let the engine decide what outcome to choose from a restricted list based on probabilities.
For example: a corner might have three possible outcomes, pass, cross, or out of play. All three have probabilities, modified by player attributes and other factors. If the engine chooses cross, that outcome then has its own possibilities: header, volley, or goalkeeper interception. The engine selects one and continues the chain.
With this approach, we produce realistic phases that flow naturally while avoiding the scripted feeling of the previous version. Each match unfolds organically based on the decisions made throughout the chain.