The CSE 331 Version

13
The CSE 331 Version By Jeff Golden and Paul Madrid

description

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. - PowerPoint PPT Presentation

Transcript of The CSE 331 Version

Page 1: The CSE 331 Version

The CSE 331 Version

By

Jeff Golden and Paul Madrid

Page 2: The CSE 331 Version

The Project

• Implement Risk for the computer.

• Requires:– Graphics plus user interface– Multiplayer capabilities– Network support

• Can support:– AI modules– Other user interfaces

Page 3: The CSE 331 Version

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

Page 4: The CSE 331 Version

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.

Page 5: The CSE 331 Version

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?

Page 6: The CSE 331 Version

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.

Page 7: The CSE 331 Version

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

Page 8: The CSE 331 Version

Client Issues

• Graphical– How does the viewer display the stored data?– Receiving/sending messages?

• Interface– Easy way for user to communicate?

Page 9: The CSE 331 Version

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.

Page 10: The CSE 331 Version

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.

Page 11: The CSE 331 Version

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

Page 12: The CSE 331 Version

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

Page 13: The CSE 331 Version

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.