The tournament system is a web-based interface which allows tournaments to be set up, and the server to create games into players' games lists for play. Generally all that is needed on the client side is to handle scoring of tournament matches appropriately to allow wins and losses to be correctly determined.
One of the key elements of tournament games is that maps must be set up, to give players somewhere to play. The exact nature of how to generate these setups varies by flavour.
To save out a file to allow tournaments, all you need to do is to go into the MP setup screen as usual. If you are using a custom campaign for play, these must be distributed to players beforehand (due to the potential large size of custom campaigns). Once you have set up your MP challenge, at the point where you would ordinarily post your challenge, you hold down the CTRL key before pressing the Create Challenge button. This will display a popup confirming creation of a tournament file (or failure, if something went wrong). Tournament files are stored in the local folder (My Documents/My Games/<your game folder>). They are named TOURNAMENT<N>.DAT and each file gets an increased numeric value (i.e. is not overwritten).
These DAT files can then be uploaded to the server via the web interface for tournaments. Note that skirmish battles are also supported. Once you have created your tournament maps via the website, and uploaded your DAT files, you can go on to set up the rounds etc.
You can script a callback to return the scores at a given turn via a SCORE_BATTLE_CALLBACK in the scenario script, or from the CORE.BSF script (either in CORE or in your campaign folder). This returns either the score for side 0 (the score for side 1 is always 100-side0score, so the return value should be [0,100]), -1 to indicate that the default internal scoring should be used (based on living units), or can return -2 to denote that there are TWO scores in the first two entries of the first work array (i.e. set using SetArray).