BigCalm : SWOS Java : Tactics File Analysis

Sigh, only after I drew these diagrams did I realise they would be much more useful if I drew them numbering top to bottom, not bottom to top, and starting from zero instead of one. eek.

SWOS Tactics File Hex Analysis


This page attempts to decrypt the SWOS tactics file, in the hope of re-engineering the game.
The manual gives us some hints about how SWOS manages tactics:

The game comes with 10 preset tactics covering all the popular formations used in modern football, plus six slots for you to save your own custom designs to. All of the tactics in the game are based on a grid which defines 35 separate areas of the pitch that the ball can be in at any one time, and 240 separate positions that any one player can be in at any one time. The Edit Tactics menu deals with the six Custom Tactics slots (called 'User A' to 'User F'), and presents you with six tools to help you shape them.


The .TAC files all have 370 bytes and I'll try and work out what they're all used for.
First, the 35 ball areas:
Ball Areas in SWOS

Note that the areas have been measured to be approximately correct.

The tactics file is divided into players positions that they should run to when the ball is in one of the 35 positions. The first 8 bytes of the file are a string containing the name of the tactic, then bytes 9 to 166 (hex) are used to define where the players should run to when the ball is in one of the areas. The goalkeeper is not included in the 10 players. The last few bytes in the file from 167 to 171 are a magic number sequence (probably) and always is the following bytes: 00 FF FF 00 01 FF FF 01 FF FF 00 This was probably used by SWOS to check file validity.

Within the file, player positions are held in sequences. So, for player 1 you have all his possible positions for each ball location in order. For example, player 6 has all his possible positions located within the file in the bytes B8-DA. The diagram below shows the ranges for each player and their customary pitch locations:
Player Numbers, Customary Positions and Locations within Tactics File
Use the following formula to find the byte defining where the player will run to:
(Player No * 35) - 26 + (Ball Location - 1)
The hex location within the tactics file will give you the place that the player will run to.
e.g. If I wanted to find out where player 8 would run to when the ball was in quadrant 35, then I'd calculate this as (8*35) - 26 + (35-1) = 288 = 120 Hex. The value in the file at 0x120 would tell me where the player would run to.



So the only thing left is the player positions. For example, if we have value 7F in 0x120 what does that mean?
7F is a position on the pitch that the player should run to. You can calculate it by using the following picture. The position should be calculated X-Y. So if we're trying to work out where 7F is, it's going to be position 7 on the X-axis, and position F on the Y-axis. In other words, right in the opponents goal mouth (what a goal-hanger).


Again, to re-iterate - if we have byte 7F in position 120 of the file, this means that when the ball is in quadrant 35 (top left corner), player 8, normally the left winger will be madly sprinting towards the goal-mouth of the opponents. This must be from the Davide Ginola tactic....
Player positions
Positions on this diagram should be approximately correct here.



Tactics file was decoded by Jonathan Daniel using WinHex 9.92 SR-4 and Sensible Soccer Euro Champions Edition. I've done it because it'll be very helpful to anyone trying to make a clone.

4th April 2002 Jonathan Daniel 2002