160 likes | 324 Views
3D Game Programming All in One. By Kenneth C. Finney. Chapter 22 The Game Server. The Game Server. Server-side code to support the requirements Completes some game concepts from other chapters Check off fulfilled requirements. The Game Server. Player Character
E N D
3D Game Programming All in One • By Kenneth C. Finney
The Game Server • Server-side code to support the requirements • Completes some game concepts from other chapters • Check off fulfilled requirements
The Game Server • Player Character • Spawning using markers in mission files • Code will randomly select a marker from those available
The Game Server • Vehicle Mounting for Players • Player model needs to be scale-adjusted • Create a sitting pose • Add collision code for mount • Add mount & dismount code • Decides where to put player after detaching from vehicle
The Game Server • Vehicle • Add mount nodes to vehicle model • Driver is mount0 node • Passenger is mount1 • Add mount support to vehicle datablock
The Game Server • Vehicle • WheeledVehicleTire and WheeledVehicleSpring datablocks are needed to define tire and suspension
The Game Server • Triggering Events • Needed for scoring • Trigger events are generated when player enters, leaves, or remains in, a defined area
The Game Server • Scoring • Track player accomplishments • Maintain scores on server • Server transmits score info to all players according to game rules • Scoring can be based on anything measurable, like money, enemies killed, etc.
The Game Server • Money • 'Easter Egg' hunt for money in Koob • Coins are placed around game world at random • Coin count is based on face value
The Game Server • Money • Coin placement algorithm: • Pick random location • Determine height of terrain (or structure) surface at location • Place coin just above surface • Repeat for each coin type
The Game Server • Deaths • Each client is tracked on the server • Each death increments a counter • Each death invokes a death animation • Each Death invokes a death cry sound effect
The Game Server • Kills • Kills are detected by the client code on the server • Client code notifies the shooter of the kill • Shooter client increments a kill counter
The Game Server • Lab 1: Update Koob Server • Add code to server to continue building up Koob • Update art resources (models) to support requirements • Add scoring event triggers
Summary • Player characters can be programmed to spawn wherever you like, such as the location of marker • Player characters can be programmed to mount, dismount, and control vehicles • Events can be triggered when a player enters a defined area • Scoring: based on triggers, collecting items, or interacting with other players—but not limited to these activities.