• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Client/Server Player & Map positioning

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,250
Solutions
71
Reaction score
632
GitHub
idontreallywolf
As far as I know tibia Client doesn't actually move the player but everything around it and update it's positions depending on movement direction, but what confuses me is how does the client move the map to that exact same position even after the player logs off ?
 
Not sure what you ment, but if the player is a 1000, 1000, 7 and you teleport it to 900, 900, 7?
In that case it's because the client gets info about the position each time the player logs in.

So it can show w/e when you logout and w/e when you login depending on what the server says.
 
Not sure what you ment, but if the player is a 1000, 1000, 7 and you teleport it to 900, 900, 7?
In that case it's because the client gets info about the position each time the player logs in.

So it can show w/e when you logout and w/e when you login depending on what the server says.

I believe I asked the wrong question... What i wan't to know is how the client positions the environment (map, tiles, items) using the x,y,z coordinates? Player is always at the center of the screen and it isn't the player that moves around, when you press upper arrow key, client is sending data to server and then moving everything around the player downwards (up => move everything down, down = move everything up). So how does the client make sure the environemnt is the same when the player logs in again ?
 
It's just how the client draws it so you're always in the center.

Here is how OTClient "talks" to TFS when you move:

C++:
void ProtocolGame::sendMove(const Position& fromPos, int thingId, int stackpos, const Position& toPos, int count)
{
    OutputMessagePtr msg(new OutputMessage);
    msg->addU8(Proto::ClientMove);
    addPosition(msg, fromPos);
    msg->addU16(thingId);
    msg->addU8(stackpos);
    addPosition(msg, toPos);
    msg->addU8(count);
    send(msg);
}

You can find it under otclient/src/client/protocolgamesend.cpp

Kindest Regards,
Okke
 
Back
Top