{"action":"created","issue":{"url":"https://api.github.com/repos/ambarket/botbattle/issues/8","labels_url":"https://api.github.com/repos/ambarket/botbattle/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/ambarket/botbattle/issues/8/comments","events_url":"https://api.github.com/repos/ambarket/botbattle/issues/8/events","html_url":"https://github.com/ambarket/botbattle/issues/8","id":65138075,"number":8,"title":"Test Arena","user":{"login":"Akiira","id":6109207,"avatar_url":"https://avatars.githubusercontent.com/u/6109207?v=3","gravatar_id":"","url":"https://api.github.com/users/Akiira","html_url":"https://github.com/Akiira","followers_url":"https://api.github.com/users/Akiira/followers","following_url":"https://api.github.com/users/Akiira/following{/other_user}","gists_url":"https://api.github.com/users/Akiira/gists{/gist_id}","starred_url":"https://api.github.com/users/Akiira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Akiira/subscriptions","organizations_url":"https://api.github.com/users/Akiira/orgs","repos_url":"https://api.github.com/users/Akiira/repos","events_url":"https://api.github.com/users/Akiira/events{/privacy}","received_events_url":"https://api.github.com/users/Akiira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-30T05:24:17Z","updated_at":"2015-03-30T23:09:03Z","closed_at":null,"body":"I was looking at code and commits for the test arena branch and noticed that we are probably going to be communicating with the game manager through stdin and stdout. I was under the impression the test arena input and output would be through a separate process, thus the reason for the Player class to have getters for its stdin and stdout. \r\n\r\nRefactoring the code for game manager to use stdin and stdout would not be too difficult but perhaps it would be easier if the TestArena just had its own dedicated game manager. That way GameManager can stay specialized for tournaments and we can more easily do the TestArena. \r\n\r\nI wrote up a ArenaGameManager class and an ArenaGameInstance class that should be much easier to use. It always sends the games HTML to stdout (I assume this is what you need on your end) and reads from stdin for the humans move.\r\n\r\nIf there is additionally functionality or constraints that are needed on these classes, or if I have misunderstood what is needed from the game managers let me know and I will fix them."},"comment":{"url":"https://api.github.com/repos/ambarket/botbattle/issues/comments/87872547","html_url":"https://github.com/ambarket/botbattle/issues/8#issuecomment-87872547","issue_url":"https://api.github.com/repos/ambarket/botbattle/issues/8","id":87872547,"user":{"login":"ambarket","id":7129261,"avatar_url":"https://avatars.githubusercontent.com/u/7129261?v=3","gravatar_id":"","url":"https://api.github.com/users/ambarket","html_url":"https://github.com/ambarket","followers_url":"https://api.github.com/users/ambarket/followers","following_url":"https://api.github.com/users/ambarket/following{/other_user}","gists_url":"https://api.github.com/users/ambarket/gists{/gist_id}","starred_url":"https://api.github.com/users/ambarket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambarket/subscriptions","organizations_url":"https://api.github.com/users/ambarket/orgs","repos_url":"https://api.github.com/users/ambarket/repos","events_url":"https://api.github.com/users/ambarket/events{/privacy}","received_events_url":"https://api.github.com/users/ambarket/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T23:09:03Z","updated_at":"2015-03-30T23:09:03Z","body":"Server to client communication will work with periodic ajax requests from client and a queue of game states in the server's testArenaInstance associated with that game. \r\n\r\nFor the server to gameManager communication the original plan as I remember it was something like the following...\r\n\r\nFor bot v bot test arena. Everything is the same as a tournament game with the added requirement that the game states are sent over stdout. I was thinking that even though we could run the entire game before sending the results back to the client this may not be ideal since these games could potentially take a good amount of time to run. E.g. with bots that just move back and forth forever always applying the most defensive strategy. Instead we may want to just send every single turn via stdout immediately as its generated, that way people can see immediately what their bots are doing and will kill the game early if its not worth watching to the end. Also sending out immediately will probably simplify the subclassed GameResults object specified below.\r\n\r\nFor human v bot. I think this can be implemented with the same exact logic as bot v bot with a few simple changes\r\n* subclass of Player that is HumanPlayer (To make things clean the current player should be extended into a subclass for BotPlayer). \r\n* This HumanPlayer will use the GameManager stdin and its own stdin, and have an unlimited timeout. And will have an overloaded implementation of sendBoardToPlayer (or whatever its called), that simply does nothing with it.\r\n* Not sure how the timeout was done but this would require it to be an attribute of the Player objects, not the GameInstance. Presumably that wouldn't be too hard to change though.\r\n\r\nOnly change left then is to make the GameInstance send results over stdout. My thought was to subclass GameResult to ArenaGameResult (Or whatever you're using to store the saved GameStates for tournaments) This subclass would overload saveGameState (or whatever its called) to just send the game states over stdout as they're received instead of storing them in some data structure for later use. \r\n\r\nThis way the main game loop in GameInstance doesn't change. All that changes is the concrete types of the Player objects and GameResults object that the GameInstance uses.\r\n\r\nAlso as part of the initial command line arguments (or just one JSON argument) we had specified that a boolean flag (or String for easier readability) would be passed indicating whether it is to run a Tournament or just a Test Arena instance. Based on that flag it would then read the rest of the arguments and interpret them. \r\n\r\nI haven't read the code so I don't know how far away this is from what is implemented and it very well may make more sense to just use different version of GameManager and GameInstance for the arena. \r\n"}}