• Vote in May Mapping Competition to select a winner!
  • 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!

TFS 1.X+ Creature is being drawn on top, even tho its not

Evatar

New Member
Joined
Oct 27, 2009
Messages
15
Best answers
0
Reaction score
1
I wasn't rly sure if this is a client-side or server-side issue, ill change the tag, just let me know.
1.3 Nekiro's 8.6 here.

A simple gif that says everything. I would also mention that even tho there is a god character here, the same issue occurs with normal characters.
stacking5.gif

Tile.cpp code, that i thought that might be responsible for that, I only managed to make it so look/push will return/push topmost (graphic-wise) creature, but expected behaviour would be player landing on top of the stack after stairhop, visually aswell.

C++:
Creature* Tile::getTopCreature() const
{
    if (const CreatureVector* creatures = getCreatures()) {
        if (!creatures->empty()) {
            return *creatures->begin();
        }
    }
    return nullptr;
}

const Creature* Tile::getBottomCreature() const
{
    if (const CreatureVector* creatures = getCreatures()) {
        if (!creatures->empty()) {
            return *creatures->rbegin();
        }
    }
    return nullptr;
}

Creature* Tile::getTopVisibleCreature(const Creature* creature) const
{
    if (const CreatureVector* creatures = getCreatures()) {
        if (creature) {
            const Player* player = creature->getPlayer();
            if (player && player->isAccessPlayer()) {
                return getTopCreature();
            }

            for (Creature* tileCreature : *creatures) {
                if (creature->canSeeCreature(tileCreature)) {
                    return tileCreature;
                }
            }
        } else {
            for (Creature* tileCreature : *creatures) {
                if (!tileCreature->isInvisible()) {
                    const Player* player = tileCreature->getPlayer();
                    if (!player || !player->isInGhostMode()) {
                        return tileCreature;
                    }
                }
            }
        }
    }
    return nullptr;
}

const Creature* Tile::getBottomVisibleCreature(const Creature* creature) const
{
    if (const CreatureVector* creatures = getCreatures()) {
        if (creature) {
            const Player* player = creature->getPlayer();
            if (player && player->isAccessPlayer()) {
                return getBottomCreature();
            }

            for (auto it = creatures->rbegin(), end = creatures->rend(); it != end; ++it) {
                if (creature->canSeeCreature(*it)) {
                    return *it;
                }
            }
        } else {
            for (auto it = creatures->rbegin(), end = creatures->rend(); it != end; ++it) {
                if (!(*it)->isInvisible()) {
                    const Player* player = (*it)->getPlayer();
                    if (!player || !player->isInGhostMode()) {
                        return *it;
                    }
                }
            }
        }
    }
    return nullptr;
}
Expected behavior
  1. Player A enters the stack
  2. Player B enters the stack
  3. Player B is on top of Player A

Thanks in advance
 
Last edited:

M0ustafa

1337
Premium User
Support Team
Joined
Mar 4, 2017
Messages
1,602
Best answers
197
Reaction score
603
Location
Egypt
Where is the issue here? Isn't this how its supposed to work?
 
OP
Evatar

Evatar

New Member
Joined
Oct 27, 2009
Messages
15
Best answers
0
Reaction score
1
Where is the issue here? Isn't this how its supposed to work?
The sprite of the first player on the stack is overlapping the latest player
 

M0ustafa

1337
Premium User
Support Team
Joined
Mar 4, 2017
Messages
1,602
Best answers
197
Reaction score
603
Location
Egypt
Still this is how its supposed to work, 2 players are below me on this screenshot.
If I am wrong someone correct me or I might be misunderstanding what he mean exactly.
still.PNG
 

oen432

Excellent OT User
Joined
Oct 3, 2014
Messages
651
Best answers
20
Reaction score
608
Location
Poland
The sprite of the first player on the stack is overlapping the latest player
Even name is on top, it's not just the sprite.
What if you use non-god player?
 
OP
Evatar

Evatar

New Member
Joined
Oct 27, 2009
Messages
15
Best answers
0
Reaction score
1
@up
(...)I would also mention that even tho there is a god character here, the same issue occurs with normal characters.(...)
About the name, yeah, you are right, it's not just the sprite Q.Q

Still this is how its supposed to work, 2 players are below me on this screenshot.
If I am wrong someone correct me or I might be misunderstanding what he mean exactly.
I want to achieve this behavior
  1. Player A enters the stack
  2. Player B enters the stack
  3. Player B is on top of Player A
And it works mechanic's wise, if you push the stack you will push the most recent creature that entered it, hovewer when we look closely, we can see that the God character is on top of the most recent character
 
Last edited:

celohere

Well-Known Member
Joined
Nov 27, 2007
Messages
187
Best answers
7
Reaction score
76
Seems to be a client issue , are you using otclient? If so, use the regular tibia client and see if you can confirm this problem.
Edit: I took a look in Nekiro's sources and is not a server issue, you can see here, the creatures are being added in the top:
 
Last edited:

M0ustafa

1337
Premium User
Support Team
Joined
Mar 4, 2017
Messages
1,602
Best answers
197
Reaction score
603
Location
Egypt
No it isn't, I compiled Nekiro's latest source and tested on Cipsoft client to get sure and its source side.
I think he is supposed to create issue on Github.
 

celohere

Well-Known Member
Joined
Nov 27, 2007
Messages
187
Best answers
7
Reaction score
76
No it isn't, I compiled Nekiro's latest source and tested on Cipsoft client to get sure and its source side.
I think he is supposed to create issue on Github.
I checked on my personal server using otclient v8 and the creatures are actually being shown in reverse order. Using the cipsoft client I don't have this problem.
This is on cip client and thats the right order:
tibia cliente.png

Now the view from otclient(wrong order):
otcliente.png
Edit : You can see in his gif in the first post, when he clicked to look in the players stack , he saw the character that wasnt shown on the top
 
Last edited:

fabian766

Intermediate OT User
Joined
Apr 22, 2008
Messages
86
Best answers
15
Reaction score
134
Location
Poland
I checked on my personal server using otclient v8 and the creatures are actually being shown in reverse order. Using the cipsoft client I don't have this problem.
This is on cip client and thats the right order:
View attachment 45873

Now the view from otclient(wrong order):
View attachment 45874
Edit : You can see in his gif in the first post, when he clicked to look in the players stack , he saw the character that wasnt shown on the top
I don't know what version you use but cipsoft reversed creature stack order on 8.53 onwards so it works like in the Evatar gif. If you actually use 8.60 like Evatar and your server sends creatures in reverse you'll sooner or later get debugs because of violating stack order.

It can't be changed server-side simply because you can't change stack order of creaturemove packet(unless you use otclient). If something is wrong here then it is the behavior of Tile::getTopVisibleCreature function.
 

celohere

Well-Known Member
Joined
Nov 27, 2007
Messages
187
Best answers
7
Reaction score
76
I don't know what version you use but cipsoft reversed creature stack order on 8.53 onwards so it works like in the Evatar gif. If you actually use 8.60 like Evatar and your server sends creatures in reverse you'll sooner or later get debugs because of violating stack order.

It can't be changed server-side simply because you can't change stack order of creaturemove packet(unless you use otclient). If something is wrong here then it is the behavior of Tile::getTopVisibleCreature function.
I'm using 8.0 version , and my stack order is not the same , but using otclient i receive the reverse stack order.
 

fabian766

Intermediate OT User
Joined
Apr 22, 2008
Messages
86
Best answers
15
Reaction score
134
Location
Poland
I'm using 8.0 version , and my stack order is not the same , but using otclient i receive the reverse stack order.
8.0 isn't 8.53 and higher that's why you've this stack order, otclient actually receive correct stack order just draw it reversed(it was coded only for 8.53+ behavior), since you're using otclientv8 you'll need to ask Kondra if he can correct it(if you actually care about it).
 

celohere

Well-Known Member
Joined
Nov 27, 2007
Messages
187
Best answers
7
Reaction score
76
8.0 isn't 8.53 and higher that's why you've this stack order, otclient actually receive correct stack order just draw it reversed(it was coded only for 8.53+ behavior), since you're using otclientv8 you'll need to ask Kondra if he can correct it(if you actually care about it).
Not really 😅
 
Top