New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Movement desync #259
Comments
This is impossible to fix as it's either a client bug or we don't have the correct packet data needed. You see the problem is not the length of the hitlock itself but the problem is when the hitlock is applied. Without any means to get the client to use the actual aMotion value we send to it, it is impossible to fix. If you want to fix it you need to modify the client so that it does not ignore the aMotion value we send to it. |
And where does that attack animation length come from that the client uses? |
Probably hardcoded into the client, or it simply depends on the number of attack animation frames in the GRF. |
I added two extra fix position codes to the source and it, most of the time, fixes this issue. The client will update where you are when you take damage and thus showing you where you stopped moving. You will not really see the flinch animation but you will see where you are standing. if ((type&0x02 && !ud->walkpath.path_pos) // Force moving at least one cell. and
} |
Client: 2012-04-10 Revision: 14739 Mode: RENEWAL |
Is there hope to fix this or can we close this issue as unable to fix? |
It is basically a client bug. The client ignores the values we send it for aMotion and just uses whatever it has hardcoded for a specific monster. It's impossible to fix unless someone creates his own client. If projects like RObrowser get more stable they might have implemented it much better. If you only care about positioning and not about animations, though, you could send fixpos packets before every attack and before being stopped every time. I tried that and it works almost perfectly fine but looks really strange. |
I think I finally found a way to make the impossible possible. I now understand how the client works here. Basically when you send a clif_damage packet to the client, you can send "sdelay" (where we put AttackMotion) as value. The client will ignore all values above 432 and 432 stands for 1.0x animation speed. 216 for example means play the animation at double the speed. Each monster has an attack animation and can define the frame in the attack animation on which it displays the damage and makes the target flinch / stop. If the damage frame is undefined, it instead displays the damage / flinch / stop at the very end of the animation. You can extract the information after how many milliseconds the damage frame will be shown at 1x animation speed from the spr/act files of the client in the sprite\몬스터 folder. Let's call this value "ClientAttackMotion". Knowing this, we can do the math of what value to send as sdelay to the client to make it show the damage frame at the exact moment we apply the damage and stop the target on the server. Basically if "AttackMotion" is smaller than "ClientAttackMotion", we need to send the following as sdelay: For cases where "AttackMotion" is greater than "ClientAttackMotion", we need to reduce the time we wait until we apply the damage to "ClientAttackMotion" (currently this is hardcoded to 1000ms instead). This should fix all position lag for normal attacks at least. |
* Fixes #259. * Initial attempt to resolve position lag with normal attacks against monsters.
- Added a new config synchronize_damage, when set to "yes", the client will display the damage of normal monster attacks at the exact time it is applied on the server, removing position lag (fixes #259)
Git Version: 12628 - 2014-12-04 05:04:30 (luciar)
Client Date: 2012-04-10
Src Mods: NONE
General settings:
How to reproduce & Description:
The dev guys already corrected a lot of things regarding the movement lag/desync issue, but still there is at least one issue:
When I get hit and in my desire to break free I click somewhere to move, the character displays the flintch movement for it's whole duration, but in the meantime the server receives my movement commands and starts to move my character on the server side. On the client side this results in my character jumping from one location to another.
So, the client we usually use is an official one, with some minor modifications. On the other hand, the server side was written from sketch. So I think it is logical to say, that we should follow the client's "guide" if we want to mimic the official behav. If the client says "you shouldn't move during hitlock", then why do we allow the server side to move the player? Or perhaps we should allow the player to move, because the client still sends the move commands during hitlock, but we miss a packet that tells the client to cancel the flintch movement. Either way, it is pretty annoying that if a single mob hits us during movement, we desync in movement.
Another theory I have is that in case of monsters, the hitlock works better, becuause they simply won't issue a new movetoxy() command during their hitlock/flintch time, but since players can click whenever they wish, they do issue a move command in the urge to break free, and maybe this case is not handled correctly.
The text was updated successfully, but these errors were encountered: