The Client Side
(Ryan is doing this with some help from Ben)
The client is basically a glorified terminal. It takes input from the
keyboard and mouse and sends it to the server for processing. To do
this it uses the send()
command defined in the network communications layer. Then another
thread receives updates (via call-back) from the server on the state of
the world and it redraws it based upon the associated camera.
Though this is a long way in the future, one potential weirdness of
the client is that it probably won't send voice communications to the
server for reprocessing, but directly to the other team members using
multicast.
Protocol
- NEW
Informs the server that a new client is connecting and requests
that the entire game world be sent to it.
- DELETE
The client is disconnecting and all references to it should be
deleted from the game.
- STATUS
The client requests that on the next update time the entire world
be sent out rather than just the delta.
- ACTION action
The player wishes to perform some action. Valid values for
action are:
- Up
- Down
- Left
- Right
- Up-Left
- Up-Right
- Down-Left
- Down-Right
- KEYDOWN key
A key is being depressed by the player. Currently there
are only two valid values for key; "Button-1" (jump)
and "Button-2" (light), but see below for future possible
extensions.
- KEYUP key
A key has been released by the player. As with keydown, only
"Button-1" and "Button-2" are valid options.
- MOUSE X-AXIS num Y-AXIS num
Mouse movement has occurred and the two numbers represent how many
degrees (in radians) to rotate the player's model and camera. The
reason we are sending the amount to rotate and not the actual mouse
movement numbers is that eventually the user should be able to
choose how sensitive the mouse should be.
Proposed additional protocols
- KEYDOWN character
The key represented by any literal "character" has been pressed
down. (Allows players to type in cheat-codes).
- KEYUP character
The key represented by character has been released.
- JOYSTICK axis coordinate
The joystick's potentiometer for axis (either x or y or
perhaps w if we get sidewinders) is reading coordinate
after being normalized to an integer between 0 and 1000. Origin
is in the upper-left corner.
Todo List
Integrate client with server and communication
layer.
Get full screen mode working.
Create error logging system.
Dynamic lighting effects.
Add mesh for ground and be able to deform the
terrain.
- Add animations.
- Shadows.
Integrate DirectSound into client.
- Add joystick (maybe force feedback) support.
- Create on-screen status bar representing the current state of the
player.
ben@nospam.cs.washington.edu
Last modified: Fri Apr 17 22:43:49 PDT 1998