• 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.2 Weird monster behavior

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
587
Solutions
4
Reaction score
315
Location
Europe
Hello,
i dont ask support that often but i guess i have no choice. So i was testing some stuff on localhost which is zero ping and i noticed that monsters have weird delay before they die, so what i mean is when you kill a monster it shows that it has zero health but it takes couple milliseconds before he dies so its kinda ugly problem you can even imagine what would happen if you had this stuff hosted.

Source: [8.60] The Forgotten Server 1.2 (https://otland.net/threads/8-60-the-forgotten-server-1-2.236489/)
 
There is always a way. Just because the creature object needs to be alive for a bit longer, the client doesn't need to know that. The question is how to make it better, feel free to send pull requests to the repo if you have a solution. (I don't).
Well i dont have solution, maybe someone will find a smart way of this.
 
There is always a way. Just because the creature object needs to be alive for a bit longer, the client doesn't need to know that. The question is how to make it better, feel free to send pull requests to the repo if you have a solution. (I don't).
Just set a flag "m_shouldDie" when onDie, that makes nothing server side, but on the client side, if the client receives this flag, it makes monster "die"?
I mean it's not elegant, but should do the thingy.
 
Just set a flag "m_shouldDie" when onDie, that makes nothing server side, but on the client side, if the client receives this flag, it makes monster "die"?
I mean it's not elegant, but should do the thingy.
I dont know it sounds like a very unstable solution, but maybe it just sounds like that.
 
Hello,

I think the problem is with tfs arfitecture itself and we are talking about that piece of code:
1592513374487.png

Take a look what happens here - We have task called every 100ms, but it handles only one creature list (one of 10), so we have period ~= 1s.
What about detecting hp <= 0 in the combat module and calling creature->onDeath() immediately ? Do you see any risks ? Where do we have racing conditions?
 
Back
Top