Sign in to follow this  
sipickles

Controlling NPCs

Recommended Posts

Hi, My Client is really coming along and its time to bring the server app up to par. My present dilemma is what mechanism to use to control the NPCs (non player charaters) on the clients. Obviously the server is managing their behaviour and informing interested clients, who are then performing the correct movement and animation. Should my server: 1) send out control messages in realtime, ignoring lag to some degree 2) cycle through objects, updating each at preset intervals, sending packets of strings of commands - move here, wait 1 second, move there, wait 2 seconds etc. Period of update could be related to in game variable, such as alert level. 3) Send control messages saying - move, arriving here at this time, compensating for lag to some degree 4) something else....! Its not a super fast pace FPS, but sometimes the pace cranks up in battles. Most of the time, NPCs are fairly placid, going about their business.... Some are frankly lazy, I expected more from them.... :) What do you think? Thanks Simon

Share this post


Link to post
Share on other sites
Valid point.... I just meant not the players character.

That is moved in direct response to the players input, giving a lag-less illusion.

Sending snapshots from a client is a bad idea right? too much trust in the client... So whats best in order to keep objects and servers informed?

CLIENT->SERVER
Send messages to server when client changes movement? eg:

ROLL_START
ROLL_STOP
YAW_START
ACCELERATE_START
ACCELERATE_STOP
YAW_STOP

Therefore trying to keep a version of a players position, etc, on the server. The server is always right and will bring incorrect clients into line, in theory!

SERVER->CLIENT
Inform client(s) of new position, rotation and speed of object(s). Use blending to force client from dead-reckoned position to actual server position.

Thoughts appreciated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this