-
Notifications
You must be signed in to change notification settings - Fork 943
Use cursor position for position based network messages targeting objects #4987
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
Conversation
be7476c to
b07d10e
Compare
|
looks like it's currently causing a gameplay change, let me know if you need help replaying the demo or narrow it down otherwise. |
40fc4ce to
8fd6b06
Compare
8fd6b06 to
d6832b6
Compare
The demo desyncs about 2 minutes in while highlighting a monster, doesn't appear directly related to this change. Not sure why that's started failing :/ |
|
|
|
Yeah, I pass in playerId as MyPlayerId to ensure the first case evaluates to the same result. LocParam1 always checks WasPlayerCmdAlreadyRequested, Loc only checks if playerId==MyPlayerId Edit: In fact every call to NetSendCmdLoc uses MyPlayerId as playerId, that condition is always true. |
There's a slight difference in how many times certain commands get throttled between master and this PR. That ends up with the demo walking one tile further north after opening the western sarcophagus in the pair of two around 1:58 through the demo. The demo triggers throttling on the westernmost chest and two of the sarcophaguses, the repeated commands seem to get triggered 1-2 more times on master for these objects... |
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
7937c9f to
db664e0
Compare
| // This should probably be cursPosition so paths to large objects are consistent | ||
| NetSendCmdLoc(MyPlayerId, true, CMD_OPOBJXY, object.position); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally worked out what was breaking the timedemo test.
Large objects like sarcophagi can end up with different pathfinding depending on which tile the cursor is over when interacting with them. Using the object position isn't correct as this is always the southernmost tile, the cursor might be over another tile and the player might want to path to a different edge.
However repeated mouse actions break pathing and force navigating to the southernmost tile. This gets triggered twice in the demo, the pathfinding diverges if I try fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! That can't have been easy to track down. I guess who ever fixes this have to also record a new demo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is why I'm trying to avoid fixing it 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least you added a comment :)
pcursobj was used as a pointer so might as well make it an actual pointer. This also allows cleaning up some of the network messages to work off a position instead of ignoring the passed info and relying on index instead