The game is a multiplayer simple real time strategy housed in a Flash application. Players run the Flash client, and are connected to a server written in another language (the language is irrelevant). Players compete against one another in games of 2~8 players.
My aim is create some way for people to create an AI agent to play in the same realm against human players, or other AI agents. Akin to the Broodwar AI competitions, but in a much simpler game.
The current model
has players logging in to the lobby. Games seeking players are listed in the lobby. Once the game acquires the amount of players required to start (defined by the host at game room creation time), the players are then pushed into a game, and leave the lobby. Games then run through to completion; players who disconnect are left stagnant until destroyed or they login again and are reconnected to the game.
In a perfect world
the flash client (Using an MVC type model) would be able to interface in some way with the users AI agent, handing data to the agent, and receiving commands from the agent. In this way the user could observe the game in the flash client while in play, as well as choose games for the agent to participate in. This model would be ideal for debugging purposes, as to not interrupt play on crash, and since commands can only be sent (with malformed commands being ignored, with an error callback) users could pick out major bugs quickly.
flash is a prissy little nitwit when it comes to communicating client side to client side. The only realistic options I can see would be to create a second client interface in another language (say .Net) that would be used to interface the AI agent, the player would then login to the flash client and enter games/observe in the above mentioned manner. OR the flash client would create a second socket pointed at the local host. A suitable API would be created to manage the communication protocol (as a DLL or similair) that would handle all data values of the game, and sending commands. This API would be extended by the users AI agent, and the player would login to the flash client and join/observe games.
The Big Question:
From experience or observations, what would be the most suitable model for this type of a system? I have no qualms with either, but due to the long timeframe of implementing each system (I work alone) I'd rather start off on the right path, and end up with an easy to use model. Any suggestions at all are very welcome!