• 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!

[Tutorial] Adding more tiles to game window - Updated 7/6/2018

I'm using TFS 1.1 and I have bug while going down, the character is going down, but gamemap, minimap is still on default floor
sugdtnxmyetycvergijyjirqsqxruupzbymszyzsakswioomrvymutcjdqkdpfseouwdimshiryzqvhdckzywdeiwcpjnwcusoho

After a relog the screen is black:
rycxqqrlhgsubyuqitvhujlcreddwmrekezdbkrwsthovpriagzcxjnhmzgmmopuoojwzqoyczoacxhcmudpmpgarrqbeejeenzg


Tried to change:

Code:
//moving down a floor makes us out of sync
    //east
    msg.AddByte(0x66);
    GetMapDescription(oldPos.x + 9, oldPos.y - 7, newPos.z, 1, 14, msg);

    //south
    msg.AddByte(0x67);
    GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);
To something similar to the //moving up a floor~, but I can't get this to work :l



@edit

In some places it's working.
 
Last edited:
I'm using TFS 1.1 and I have bug while going down, the character is going down, but gamemap, minimap is still on default floor
sugdtnxmyetycvergijyjirqsqxruupzbymszyzsakswioomrvymutcjdqkdpfseouwdimshiryzqvhdckzywdeiwcpjnwcusoho

After a relog the screen is black:
rycxqqrlhgsubyuqitvhujlcreddwmrekezdbkrwsthovpriagzcxjnhmzgmmopuoojwzqoyczoacxhcmudpmpgarrqbeejeenzg


Tried to change:

Code:
//moving down a floor makes us out of sync
    //east
    msg.AddByte(0x66);
    GetMapDescription(oldPos.x + 9, oldPos.y - 7, newPos.z, 1, 14, msg);

    //south
    msg.AddByte(0x67);
    GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);
To something similar to the //moving up a floor~, but I can't get this to work :l



@edit

In some places it's working.

Did you follow all of my instructions? Looking at your code right there... it doesn't look like you did.
 
I was playing around with this a few years back and could never get it working on the latest server builds. Once again you have shown your talent Flatlander, nice work :)

This is how I'm using it.

148nip5.png


Looking forward to more of your threads!
 
I was playing around with this a few years back and could never get it working on the latest server builds. Once again you have shown your talent Flatlander, nice work :)

This is how I'm using it.

148nip5.png


Looking forward to more of your threads!
PROPS TO YOU!

I am excited every time I see a project not using tibia sprites :)
 
http://pastebin.com/nrj7Tpix my protocolgame.cpp.

@up
I am doing project without tibia's spirites and That why I want also it. Thanks for any help.

@2x up
Nice.
Just looking at your protocolgame.cpp. You should be able to change almost everything just following the tutorial.

It is slightly different, but it is very easy to figure out.

You should still be able to follow the thread and make these changes, they almost match-up perfectly with your protocolgame.cpp.

After you attempt to make these changes, if it causes issues on your server, or has compiling errors let me know.
 
Just in case anyone else has the same issue:

When using other versions of TFS, they will not be EXACTLY the same as mine. I just got a message in my inbox and this is how I explained it:

Oh come on.
I didn't say you could copy+paste, I said it was very similar.

Ok here is what you do.
When following my tutorial.
ALL I did, what replace the number 8 with Map::maxClientViewportX.
And the number 6 with Map::maxClientViewportY

So on line 1028 and 1029 of your protocolgame.cpp you have this: (Yours may be slightly different, but this is the canSee function)
Code:
        return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) &&
                (y >= myPos.y - 6 + offsetz) && (y <= myPos.y + 7 + offsetz));
AHA! I see an 8 and a 6!!!!!!
Code:
        return ((x >= myPos.x - Map::maxClientViewportX + offsetz) && (x <= myPos.x + 9 + offsetz) &&
                (y >= myPos.y -Map::maxClientViewportY + offsetz) && (y <= myPos.y + 7 + offsetz));
But then you look at mine in the tutorial and it looks like this:
Code:
if ((x >= myPos.getX() - Map::maxClientViewportX + offsetz) && (x <= myPos.getX() + (Map::maxClientViewportX+1) + offsetz) &&
(y >= myPos.getY() - Map::maxClientViewportY + offsetz) && (y <= myPos.getY() + (Map::maxClientViewportY+1) + offsetz)) {
So you realise, OHHH he changed the 9 and the 7 too, by adding (+1) to it! HOW EASY!!!

So you do that too and end up with this:
Code:
        return ((x >= myPos.x - Map::maxClientViewportX + offsetz) && (x <= myPos.x + (Map::maxClientViewportX+1) + offsetz) &&
                (y >= myPos.y -Map::maxClientViewportY + offsetz) && (y <= myPos.y +(Map::maxClientViewportY+1) + offsetz));

See! It is so easy, You cannot copy + paste the whole thing, just replace the numbers with what I put in the tutorial.
 
I compiled, but when I change this
return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) &&
(y >= myPos.y - 6 + offsetz) && (y <= myPos.y + 7 + offsetz));

so I can't log in to the game, because when I do this, then server crashes. What should I do?


In map.h I have

static const int32_t maxViewportX = 44; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 25; //min value: maxClientViewportY + 1
static const int32_t maxClientViewportX = 43;
static const int32_t maxClientViewportY = 24;


In map.cpp I have
void Map::resetAwareRange()
{
AwareRange range;
range.left = 43;
range.top = 24;
range.bottom = 44;
range.right = 25;
setAwareRange(range);
}

But even if i dont use otclient, the problem is still.
 
Last edited:
I compiled, but when I change this
return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) &&
(y >= myPos.y - 6 + offsetz) && (y <= myPos.y + 7 + offsetz));

so I can't log in to the game, because when I do this, then server crashes. What should I do?


In map.h I have

static const int32_t maxViewportX = 44; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 25; //min value: maxClientViewportY + 1
static const int32_t maxClientViewportX = 43;
static const int32_t maxClientViewportY = 24;


In map.cpp I have
void Map::resetAwareRange()
{
AwareRange range;
range.left = 43;
range.top = 24;
range.bottom = 44;
range.right = 25;
setAwareRange(range);
}

But even if i dont use otclient, the problem is still.

That is alot of tiles you are sending to the client.... why don't you try a smaller number?

Code:
    static const int32_t maxViewportX = 17; //min value: maxClientViewportX + 1
     static const int32_t maxViewportY = 17; //min value: maxClientViewportY + 1
     static const int32_t maxClientViewportX = 13;
     static const int32_t maxClientViewportY = 11;

is a good place to start, and you can see if it stops the crash.
 
I compiled, but when I change this
return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) &&
(y >= myPos.y - 6 + offsetz) && (y <= myPos.y + 7 + offsetz));

so I can't log in to the game, because when I do this, then server crashes. What should I do?


In map.h I have

static const int32_t maxViewportX = 44; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 25; //min value: maxClientViewportY + 1
static const int32_t maxClientViewportX = 43;
static const int32_t maxClientViewportY = 24;


In map.cpp I have
void Map::resetAwareRange()
{
AwareRange range;
range.left = 43;
range.top = 24;
range.bottom = 44;
range.right = 25;
setAwareRange(range);
}

But even if i dont use otclient, the problem is still.

In code of Your server try changing value (25) in "configmanager.cpp":
Code:
m_confInteger[MAX_PACKETS_PER_SECOND] = getGlobalNumber(L, "maxPacketsPerSecond", 25);
 
I was looking for and I have not any is not something like that then what should i do?
 
This is absolutely amazing, can't wait to see a server utilizing this and thanks to you a lot of custom servers will give this a try! :D
 
Code:
//going further down
else if (newPos.z > oldPos.z && newPos.z > 8 && newPos.z < 14) {
int32_t skip = -1;
GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportX+1)*2, -3, skip);
Instead of:
Code:
... (Map::maxClientViewportX+1)*2, (Map::maxClientViewportX+1)*2, -3, skip);
Should not be:

Code:
... (Map::maxClientViewportX+1)*2,  (Map::maxClientViewportY+1)*2, -3, skip);

?
 
Ok, solved, problem was with map.

Margoh, How did you fixed this bug?

I'm having the same issue and tried to recompile protocolgame.cpp 3x with different ways... was protocol.cpp the problem or map.h?

Can you tell me?
 
It's bug with server map file, not source bug. Caused by places where black tiles are surrounded by map tiles. I don't rlly know why it is causing erros. Cause in some places where you see "end" of map and black tiles, this bug is not appearing.
 
So, a workaround at the map file should fix it ?

In advice, thanks for you reply!!
 
Yes, probably will fix it. I didn't check if it will, but should fix.
 
Just a question, would it still be possible to connect with a normal tibia client after you did the source changes, or would it debug the regular tibia client? I understand that the regular tibia client would just see the normal amount of squares though. But I could see this being nice for some servers that aren't super customized, so that people could still play with the regular client if they prefer even if they lose out on some squares.
 
have anyone else take into account that the damage that creatures/players are going to receive now will be bigger?
 
Back
Top