Zero_master
New Member
- Joined
- Sep 13, 2013
- Messages
- 33
- Reaction score
- 2
Hello,
I'd like to send more tiles from my server to the otclient. From what I can see the server sends out 18, 8 on -x(or west) and 9 on +x(or east), by 14 tiles to the client by default. So far I'm happy with the layout in the file below (Example 1) however, when walking to the west the client has a small delay in loading the tiles. There is no problem with this when walking to the east though. (See example 2)
My question is - How can I make the server send more tiles to the client so it doesn't display the delay?
I've tried changing the several values in "FloorDescription" in the server source (protocol 9.6) with no results. I've also changed some values in the game_interface module.
Has anyone had experience with this before?
Example 1
Example 2
Thanks for your time.
--------------------------------------------------------------------------------
Edit
Problem was solved thanks to help from Flatlander and Summ.
What we did to achieve the solution:
In the server files under Protocolgame.cpp
I replaced
with
As stated by Flatlander - the width and height of the map is x 2 that of the pos value PLUS 2.
I then replaced the appropriate values under "GetFloorDescription" and "AddMapDescription". Make sure you replace the current values with the ones you have set in "void ProtocolGame::AddMapDescription". You will be able to gauge what values need to replace the default values just by falling the trend. I also changed the values for the Spectators:
to
In map.h
I replaced
with
That concludes the changes i made in the server files.
Now over to the client source files:
under map.cpp
was replaced with
I'd like to send more tiles from my server to the otclient. From what I can see the server sends out 18, 8 on -x(or west) and 9 on +x(or east), by 14 tiles to the client by default. So far I'm happy with the layout in the file below (Example 1) however, when walking to the west the client has a small delay in loading the tiles. There is no problem with this when walking to the east though. (See example 2)
My question is - How can I make the server send more tiles to the client so it doesn't display the delay?
I've tried changing the several values in "FloorDescription" in the server source (protocol 9.6) with no results. I've also changed some values in the game_interface module.
Has anyone had experience with this before?
Thanks for your time.
--------------------------------------------------------------------------------
Edit
Problem was solved thanks to help from Flatlander and Summ.
What we did to achieve the solution:
In the server files under Protocolgame.cpp
I replaced
PHP:
void ProtocolGame::AddMapDescription(NetworkMessage_ptr msg, const Position& pos)
{
msg->AddByte(0x64);
msg->AddPosition(player->getPosition());
GetMapDescription(pos.x - 8, pos.y - 6, pos.z, 18, 14, msg);
}
with
PHP:
void ProtocolGame::AddMapDescription(NetworkMessage_ptr msg, const Position& pos)
{
msg->AddByte(0x64);
msg->AddPosition(player->getPosition());
GetMapDescription(pos.x - 14, pos.y - 12, pos.z, 30, 26, msg);
}
As stated by Flatlander - the width and height of the map is x 2 that of the pos value PLUS 2.
I then replaced the appropriate values under "GetFloorDescription" and "AddMapDescription". Make sure you replace the current values with the ones you have set in "void ProtocolGame::AddMapDescription". You will be able to gauge what values need to replace the default values just by falling the trend. I also changed the values for the Spectators:
PHP:
getSpectators(list, destPos, false, true, 18, 18 14, 14);
to
PHP:
getSpectators(list, destPos, false, true, 30, 30, 26, 26);
In map.h
I replaced
PHP:
static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1
static const int32_t maxClientViewportX = 8;
static const int32_t maxClientViewportY = 6;
with
PHP:
static const int32_t maxViewportX = 18; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 18; //min value: maxClientViewportY + 1
static const int32_t maxClientViewportX = 15;
static const int32_t maxClientViewportY = 11;
That concludes the changes i made in the server files.
Now over to the client source files:
under map.cpp
PHP:
void Map::resetAwareRange()
{
AwareRange range;
range.left = 8;
range.top = 6;
range.bottom = 7;
range.right = 9;
setAwareRange(range);
}
was replaced with
PHP:
void Map::resetAwareRange()
{
AwareRange range;
range.left = 14;
range.top = 12;
range.bottom = 13;
range.right = 15;
setAwareRange(range);
}
Attachments
-
example.png611.1 KB · Views: 176 · VirusTotal
-
example 2.png640.9 KB · Views: 174 · VirusTotal
Last edited: