1 / 13

A Game Framework

A Game Framework. Special Topics in Problem Solving Fall 2001 Document author: Alberto Lerner (lerner@cs.nyu.edu). Goal. Create a proper infra-structure for the development and the deployment of 2-player games software-based players. X. 3. chooses a move (send move). Tic-Tac-Toe.

fynn
Download Presentation

A Game Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Game Framework Special Topics in Problem SolvingFall 2001 Document author: Alberto Lerner (lerner@cs.nyu.edu) Special Topics in Problem SolvingFall 2001

  2. Goal • Create a proper infra-structure for the development and the deployment of • 2-player games • software-based players Special Topics in Problem SolvingFall 2001

  3. X 3. chooses a move(send move) Tic-Tac-Toe 2-player games 1. looks at the boardstate (get state) 2. considers possiblemoves (compute move) PLAYER 1 The Board PLAYER 2 Special Topics in Problem SolvingFall 2001

  4. 1. looks at the boardstate (get state) ... Tic-Tac-Toe 2-player games Is the game over? Is there a winner? X PLAYER 1 The Board PLAYER 2 Special Topics in Problem SolvingFall 2001

  5. Supporting several games • There is a get state, compute move and send move tasks in most 2-player games • But for each game, the way each one is done changes How can one infra-structure support several games? Special Topics in Problem SolvingFall 2001

  6. Mixing HTML with code getstate.php tictactoe.php <html> ... <?php include($game); ?> <?php board2html(...) ?> Function board2html(…) { … echo(“<table>”); for($i=0; $i<3; $i++) { echo (“<td>”); ... Independent of the game(getstate.php, sendmove.php,etc) One implementation pergame Special Topics in Problem SolvingFall 2001

  7. How does PHP work? HTTP Server Page response (4) Page with HTMLonly Page request PHPinterpreter (3) (1) (2) Page with HTML+ PHP Special Topics in Problem SolvingFall 2001

  8. Developing a game tictactoe.php • Developing a game means implementing the necessaryfunctions for that game in PHP • The framework accepts newgames files via an option on itsmain page • The file is parsed and saved under the name of the game • Interactive play can then be arranged among interested players function newgame() function loadgame()function savegame()function board2html() function board2xml() function mov2html() function mov2xml() function getplayer() function getemail() function getmsg() function whoseturn()function sendmove() Special Topics in Problem SolvingFall 2001

  9. (1) CreateGame.php (2) GetState.php (3) Thinking time (4) SendMove.php E-mail notification (5) Interactive Human Players HTTP Server PLAYER 1 PLAYER 2 Special Topics in Problem SolvingFall 2001

  10. Players can be software (1) PHP spawns an interpreteror an executable program HTTP Server (2) The board state is sent thrustdin (3) Thinkingtime PHPinterpreter (4) The move issent thru stdout PLAYER 1 PLAYER 2 Special Topics in Problem SolvingFall 2001

  11. Developing a player player.??? • Developing a player means implementing the move choicein any tool that can communicatevia pipes • The framework accepts newplayers files via an option on itsmain page • The player file is saved undera player name • Software players can be chosen as adversaries in human-softwareor software-software plays read board state from stdin compute move send move to stdout Special Topics in Problem SolvingFall 2001

  12. Summary • The architecture team implements the necessary back-end php functions for a game and stores it in the framework • The other teams build the software based players and stores them in the framework • The framework provides the necessary html+php front-end pages for interactive human or interactive program plays using the games and players created by the teams Special Topics in Problem SolvingFall 2001

  13. References • PHP www.php.net • The Game Frameworkwww.cs.nyu.edu/~lerner/GameFrameworkIndex.html Special Topics in Problem SolvingFall 2001

More Related