130 likes | 211 Views
The CSE 331 Version. By Jeff Golden and Paul Madrid. The Project. Implement Risk for the computer. Requires: Graphics plus user interface Multiplayer capabilities Network support Can support: AI modules Other user interfaces. Language.
E N D
The CSE 331 Version By Jeff Golden and Paul Madrid
The Project • Implement Risk for the computer. • Requires: • Graphics plus user interface • Multiplayer capabilities • Network support • Can support: • AI modules • Other user interfaces
Language • Risk is written in C++ using OpenGL as the graphics library. • Why C++? • Could not find sockets library • ISE graphics library not suitable for games
Client/Server Model • Server • The game is stored on the server. • The server performs all move validations. • Server sends messages and results to client. • Server can be on the client machine or remote. • Client • Client receives messages from server. • Client displays the game map and other game data • Client receives user input, translates it, and sends it to server.
Server Issues • Move validation: • How can we detect adjacent countries? • How can we tell when certain moves are valid? • Process communication: • Stream communication in sockets? • What language do processes speak?
Move Validation • Use a graph for adjacencies. • We implemented a Graph ADT for this purpose, inheriting from the STL map container. • Keep track of game states for proper move validation. • Also helps eliminate need for multithreading.
Process Communication • Create abstract Socket class • Allows cross-platform socket communication. • Allows C++-stream-style I/O. • Define a communication protocol • FTP-like syntax • Covers all information a viewer would need • Plain text
Client Issues • Graphical • How does the viewer display the stored data? • Receiving/sending messages? • Interface • Easy way for user to communicate?
Graphical • Data • Number of armies at center of country. • Countries colored according to owning player. • Status through a pop-up box. • Messages • When received from the server, will be displayed in the lower part of screen. • When sent by user, will also be displayed in lower part of screen.
Interface • Main Window • Divided in three: the map component, message component, and a dice box. • Mainly for display of data. • Menu-system • Context-menu-style system • All commands necessary at disposal of player through context-menu.
Division of Labor • Jeff worked from the client end of the project. • Learned OpenGL GLUT and developed the client through it. • Developed user interface • Developed bitmaps and other graphics • Paul worked from the server end of the project. • Implemented Graph and Socket classes, and all game data classes • Wrote game logic • Determined command syntax
Expansion • AI Modules • If they can follow command syntax, they should be able to work. • Other user interfaces • Text based • Variants of graphics based • Three-dimensional
References • Josuttis, Nicolai M. The C++ Standard Library: A Tutorial and Reference. Addison-Wesley Publication Co. 1999. • Neon Helium Productions. NeHe Productions (OpenGL). Url: <Http://nehe.gamedev.net> • Risk Home Page! Url: <http://www.ascu.unian.it/~bepi/risiko/index_e.html> • Risk: The World Conquest Game. Parker Brothers, Ltd. 1994. • Rosen, Kenneth H. Discrete Mathematics and its Applications. McGraw Hill, 1998.