Player control

From TheManaWorld

Jump to: navigation, search

This article is outdated

Parts of this article are outdated and do no longer represent the current state of the project or the intentions of the development team.

This topic is now discussed in the article about the new being movement system. --Bjørn 00:39, 25 July 2006 (CEST)

Communication

Walking on the map is determined by the client through either key pressing or mouse control, then sent to the server as a series of walk commands. The client server relationship here is illustrated as a finite state machine model.

Client side events

Event Handle         Current State      Next State      Information
Walk Key Down        Idle               Walking         Sends the appropriate walk message to
                                                        the server.
Walk Key Down        Walking            Walking         Sends a new walking message to the
                                                        server, overriding the previous one.
Walk Key Up          Walking            Idle            Sends the stop message to the server if
                                                        all walk keys have been released.

Basically, the server gets a walk message, and starts moving the player an amount during it's update process. This continues until the srver recieves a message to stop doing so, or a message to change direction. Each cycle will move the player based on the amount of time elasped since the last cycle, creating a smooth, reliable walking distance based on the amount of time walked, regardless of lag.

Comments

Bjørn: My main problem with the method: it fails to use the inherent advantage of the indirect control by sending just the destination coordinates to the server in the event of a mouse click on a certain spot (reducing traffic and eliminating any form of error that could be introduced by lag). This would just take one additional message:

Event Handle         Current State      Next State      Information
Mouse Down           Idle               Walking         Sends the clicked destination
                                                        coordinates to the server.

Kyokai: Yeah, I meant to talk to you about that. We really have a crossroads with this, whether we decide to calculate the path-finding AI of the players client side or server side. Client side will require extra messages, though save server calculations. The server side has less messages, but adds a potentially heavy load to the server's calculation list. As lead programmer, the decision is really up to you, Bjørn, so do it whichever way seems best.

Bjørn: I say we have CPU in abundance compared to bandwidth, and A* isn't a lot of CPU at all.


Criptos:: Letting the client to only report final destination, opens the posibility to a pretty good teletransportation hack. I think the costo of CPU & Bandwith, means nothing copared to the trouble users with undesairable teletransportation skills...

Ahum, the server will just take the destination coordinates, calculate a path, and have the player walk there if there is a path. No way is the player going to be able to teleport himself. Note that actually this is the way Ragnarok Online does it too. --Bjørn 08:52, 21 Sep 2005 (CEST)

You are absolutely rigth :) Criptos

Personal tools