warlords patrick levoshko se 558 – multiplayer game design

17
Warlords Warlords Patrick Levoshko Patrick Levoshko SE 558 – Multiplayer Game SE 558 – Multiplayer Game Design Design

Upload: arlene-chapman

Post on 18-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

WarlordsWarlords

Patrick LevoshkoPatrick Levoshko

SE 558 – Multiplayer Game DesignSE 558 – Multiplayer Game Design

Page 2: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

22November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

WarlordsWarlords

This game is a multiplayer version of the Atari game “Warlords.” This game is a multiplayer version of the Atari game “Warlords.” Warlords is a 2D game and can be played by two to four players.Warlords is a 2D game and can be played by two to four players.

Each player will control a paddle to protect his or her castle from the Each player will control a paddle to protect his or her castle from the cannon ball. Since there is no out of bounds, once the cannon ball is cannon ball. Since there is no out of bounds, once the cannon ball is launched it will continue to rebound around the arena until the game launched it will continue to rebound around the arena until the game is over. If the cannon ball hits a players paddle, it will be reflected is over. If the cannon ball hits a players paddle, it will be reflected away harmlessly.away harmlessly.

Behind each paddle is the castle wall which will fall apart as the cannon Behind each paddle is the castle wall which will fall apart as the cannon ball strikes it. This castle wall protects the players avatar; if the ball strikes it. This castle wall protects the players avatar; if the avatar is hit by the cannon ball that player loses.avatar is hit by the cannon ball that player loses.

The game continues until there is only one avatar alive.The game continues until there is only one avatar alive.

Page 3: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

33November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

WarlordsWarlords

The game client was designed using Panda3d and Python for the game engine.The game client was designed using Panda3d and Python for the game engine.

The backend server is using Python and server data is being handled by SQLiteThe backend server is using Python and server data is being handled by SQLite All player account information is saved for future login, etc.All player account information is saved for future login, etc. Server data is queried against during login/account registration to make sure players do not Server data is queried against during login/account registration to make sure players do not

register twice or are not already logged in.register twice or are not already logged in.

Models, artwork and sounds are taken from various places on the internet.Models, artwork and sounds are taken from various places on the internet.

The game is based on the 1980 Atari game “Warlords”.The game is based on the 1980 Atari game “Warlords”. http://en.wikipedia.org/wiki/Warlords_(video_game)http://en.wikipedia.org/wiki/Warlords_(video_game)

Page 4: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

44November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Server LogonServer Logon

Server Information

User Account Information

System Status

User Options

Page 5: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

55November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Server LogonServer Logon

Server Information : The current server to which the user is trying to connect.Server Information : The current server to which the user is trying to connect.

User Account Information : User account input.User Account Information : User account input.

System Status : Status returned by the client or server to be displayed to the user.System Status : Status returned by the client or server to be displayed to the user. Invalid user name or password.Invalid user name or password. User already logged into server.User already logged into server. Error connecting to server.Error connecting to server.

User Options : Options in which the user can select.User Options : Options in which the user can select. Quit returns the user to the server select window.Quit returns the user to the server select window. Create New Account brings the user to the register window.Create New Account brings the user to the register window. Login attempts to log into the selected server.Login attempts to log into the selected server.

Page 6: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

66November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

User RegistrationUser Registration

Server Information

User Account Information

System Status

User Options

Page 7: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

77November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

User RegistrationUser Registration

Server Information : The server the user is trying to register to.Server Information : The server the user is trying to register to.

User Account Information : The account information which the user is trying to User Account Information : The account information which the user is trying to register under.register under.

System Status : Status returned by the client or server to be displayed to the user.System Status : Status returned by the client or server to be displayed to the user. Not a completely filled out form.Not a completely filled out form. Mismatch in passwords.Mismatch in passwords. Account already exists.Account already exists.

User Options : Options which the user can select.User Options : Options which the user can select. Quit returns the user to the server logon window.Quit returns the user to the server logon window. Register attempts to register with the currently selected server.Register attempts to register with the currently selected server.

Page 8: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

88November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Player LobbyPlayer Lobby

ChatWindow

ChatEntry

Players List

ActiveGame List

User Name

System Status

User Options

Page 9: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

99November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Player LobbyPlayer Lobby

Chat Window : All chatting done in the lobby is printed here. After 15 messages it Chat Window : All chatting done in the lobby is printed here. After 15 messages it clears.clears.

Chat Entry : Enter a chat message. User hits enter to send the chat.Chat Entry : Enter a chat message. User hits enter to send the chat.

User Name : User name of current user.User Name : User name of current user.

Players List : Listing of all currently connected users to the lobby or in a game.Players List : Listing of all currently connected users to the lobby or in a game.

Active Game List : List of all active current games including who is hosting and who is Active Game List : List of all active current games including who is hosting and who is playing.playing.

System Status : Status returned by the client or server to be displayed to the user.System Status : Status returned by the client or server to be displayed to the user. Players lobby login/log out messages.Players lobby login/log out messages. Game creation or joining status, along with how many more members the game is waiting Game creation or joining status, along with how many more members the game is waiting

for.for.

User Options : Options which the user can select.User Options : Options which the user can select. # Players ranges from 2 to 4 for a new game.# Players ranges from 2 to 4 for a new game. Start Game creates a game on the server with the given # players.Start Game creates a game on the server with the given # players. Join Game will join the user to the current game waiting for players.Join Game will join the user to the current game waiting for players. Quit Game returns the user to the login screen.Quit Game returns the user to the login screen.

Page 10: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1010November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Warlords ClientWarlords Client

Player Name

Player Castle

Player Paddle

Startup Directions

Arena Wall

Page 11: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1111November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Warlords ClientWarlords Client

Player Name/Castle/Paddle : Player interface to the game.Player Name/Castle/Paddle : Player interface to the game. Explained more on the next slide.Explained more on the next slide.

Startup Directions : Controls displayed to all players.Startup Directions : Controls displayed to all players. The client which is also the server has a message notifying that player how to launch the The client which is also the server has a message notifying that player how to launch the

ball. Only the server launches the ball to start the game.ball. Only the server launches the ball to start the game.

Arena Wall : The ball reflects off of the wall to keep in play.Arena Wall : The ball reflects off of the wall to keep in play.

Page 12: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1212November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Warlords ClientWarlords Client

Arena Wall

Player Paddle

Castle Wall

Player Avatar

Cannon Ball

Page 13: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1313November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Warlords ClientWarlords Client

Player Paddle : The player uses the left and right arrow keys to move this back and Player Paddle : The player uses the left and right arrow keys to move this back and forth in order to block the cannon ball from hitting his or her castle walls and avatar. forth in order to block the cannon ball from hitting his or her castle walls and avatar. The player’s paddle is gold, while the opponents’ are blue.The player’s paddle is gold, while the opponents’ are blue.

Cannon Ball : Used by the players to destroy another players castle and avatar.Cannon Ball : Used by the players to destroy another players castle and avatar.

Arena Wall : The ball reflects off of the wall to keep in play.Arena Wall : The ball reflects off of the wall to keep in play.

Castle Wall : Walls which protect a players avatar from the cannon ball. Each hit of Castle Wall : Walls which protect a players avatar from the cannon ball. Each hit of the wall by the cannon ball breaks a little off.the wall by the cannon ball breaks a little off.

Player Avatar : If the player’s avatar is hit by the cannon ball, that player loses.Player Avatar : If the player’s avatar is hit by the cannon ball, that player loses.

Page 14: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1414November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Network Design DetailsNetwork Design Details

All clients use TCP to communicate with the game lobby server.All clients use TCP to communicate with the game lobby server.

All clients use unreliable UDP to the talk to the game server (which is another player All clients use unreliable UDP to the talk to the game server (which is another player client).client).

Page 15: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1515November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Game Design DetailsGame Design Details

The client which started the game in the lobby is chosen to also be the server.The client which started the game in the lobby is chosen to also be the server.

The client-server handles all game state data.The client-server handles all game state data. Notifies all clients when the cannon ball collides and what the position is after the collision.Notifies all clients when the cannon ball collides and what the position is after the collision. Notifies all clients when a player’s wall is hit with the position of the hit.Notifies all clients when a player’s wall is hit with the position of the hit. Notifies all clients when a player exits the game or has lost/won.Notifies all clients when a player exits the game or has lost/won.

The client-server handles all data being passed between clients.The client-server handles all data being passed between clients. Notifies all clients when a player’s paddle changes direction/stops/starts.Notifies all clients when a player’s paddle changes direction/stops/starts.

All clients use Dead Reckoning for cannon ball and player paddle position except All clients use Dead Reckoning for cannon ball and player paddle position except when notified by the client-server.when notified by the client-server.

Page 16: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1616November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Some Technical Issues FacedSome Technical Issues Faced

Trying to get the cannon ball and game state to match up was difficult. Although still Trying to get the cannon ball and game state to match up was difficult. Although still not perfect it is much more smooth.not perfect it is much more smooth.

The server sends 3 packets in unison with the ball position to each client after a collision.The server sends 3 packets in unison with the ball position to each client after a collision. The server sends a packet every 5 frames with the ball position.The server sends a packet every 5 frames with the ball position.

Tried 3 variations for game physics.Tried 3 variations for game physics. Ended up using panda3D collision detection and vectors to decide on velocity of the cannon Ended up using panda3D collision detection and vectors to decide on velocity of the cannon

ball.ball. This causes an issue where sometimes the cannon ball will get stuck on a paddle.This causes an issue where sometimes the cannon ball will get stuck on a paddle.

Originally the lobby server was created to handle a one-on-one game.Originally the lobby server was created to handle a one-on-one game. Had to design a way to handle multiple games running at one time and how to join Had to design a way to handle multiple games running at one time and how to join

them/know when the game was filled with the amount of players asked for.them/know when the game was filled with the amount of players asked for.

Tried to design the best way for clients to move the paddles while updating the Tried to design the best way for clients to move the paddles while updating the server/other clients without too much jitter.server/other clients without too much jitter.

The client only sends the paddle position when being moved/stopped, otherwise the other The client only sends the paddle position when being moved/stopped, otherwise the other clients assume that the paddle is moving in the same direction.clients assume that the paddle is moving in the same direction.

Page 17: Warlords Patrick Levoshko SE 558 – Multiplayer Game Design

1717November 11, 2008 - MGDNovember 11, 2008 - MGD Patrick LevoshkoPatrick Levoshko

Current State of DevelopmentCurrent State of Development

All major code for the game is complete.All major code for the game is complete.

The models, graphics and sounds are finalized.The models, graphics and sounds are finalized.

Warlords is currently in the play testing and bug fixing stage of development.Warlords is currently in the play testing and bug fixing stage of development.