Autopilot in Coopetition
From #openttdcoop wiki
After our first successful Coopetition Game I thought about the usage of Brianettas Autopilot in Coopetition Games.
Note: Some of this ideas are already in preparation for a possible league/ladder system and we are far away from it. The first three ideas are important for Coopetition Games in general.
Autopilot should handle a lot of technical things I am going to list here:
Handling the Game Start
Autopilot should manage the game start, after starting the server both teams have time to get in contact with the map (the rules define the time). After this time Autopilot will start the game with an announcement.
5 minutes until the game starts. 1 minute until the game starts. 10 seconds until the game starts. 3 2 1 Game Started - Good luck and enjoy your ride!
Brianetta says: This can be done, but will require a specially re-written autopilot.
Handling the Companies and Players
If the game is in progress, Autopilot should automatically pause the game when a player de-syncs or looses his connection. Actually OpenTTD can not restrict the company count to a special value.Brianetta says: Yes, it can...; TrueLight says: max_company = 2 (supported not in 0.4.8, but in trunk)But Autopilot could check if there are more then two companies in the game and delete the third company. And of course Autopilot should manage the player count, any fifth player should be kicked out immediately!
Player 3 lost his connection. Game Paused. Game will continue in 3, 2, 1 second/s. Game continued.
Brianetta says: Again, a rewrite is needed, but it's possible.
Handling of the Game Time
As we play always until 1.1.1968 (this date can maybe change too if we have clearer rules) game should be paused at this day by the Autopilot. All players should be announcend if another year is over by our lovely Autopilot to be informed when the last year starts.
6 Years until game ends 2 Years until game ends This is the final year, from now on your train income counts The game is over - Congratulations to all Players
Brianetta says: Unfortunately, autopilot has no way of retreiving the date from the console. It might be possible with network code, but that's a major re-write. Thanks to TrueLight we are informed about the new year via the console http://devs.openttd.org/~truelight/patches/?file=coop_date.patch
If possible the game should be saved to a special folder where we can check all the data.
Game successfully saved.
Brianetta says: This is intended to be a feature of autopilot 2
Easy Administration via Webinterface
I am not sure if Autopilot is able to interact with a Database yet. But it would be awesome to be able to configure the Autopilot via an easy-to-use Interface before the game starts! Some other great possibilities came with this thing, but I wont talk about them! Brianetta says: Not at the moment it isn't possible. Settings are kept in openttd.cfg, so what you really need is a web based editor for that. It's something I might work on.
If possible, there should be a counting of clients refering to the company. Since Coopetition is a 2vs2 game, the server should pause when there are less than 4 players on the player-companies. Brianetta says: This is possible, but has issues. Clients joining the server will only be checked for team or company membership after a short delay. Of course, when clients quit, autopilot can know immediately if they were in a company, because it can store that information.
Server changes to help the autopilot
I (E1ko) was talking with TrueLight about possible changes in the OpenTTD server application. I had an idea about providing more data for the autopilot like "Year 1968 started" and so on. TrueLight said it is easy to do but he needs to know what exactly we want. So we need to discuss with Brianetta what sort of data will help him.
|Idea||Player||Draft of idea||Testing||Completed||Remarks|
|Handling the Game Start||Osai||first version created||In progress||In progress|
|Handling the Companies and Players||Osai||first version created||In progress||In progress|
|Handling of the game time||Osai||first version created||In progress||In progress|
|Auto-Savegame||Osai||first version created||In progress||In progress|
|Easy Administration via Webinterface||Osai||first version created||In progress||In progress|
|Server changes to help the autopilot||E1ko||have to know what exactly we want||In progress||In progress|