Skip to content

Conversation

@ephphatha
Copy link
Contributor

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

@AJenbo
Copy link
Member

AJenbo commented Jul 14, 2022

looks like it's currently causing a gameplay change, let me know if you need help replaying the demo or narrow it down otherwise.

@ephphatha
Copy link
Contributor Author

looks like it's currently causing a gameplay change, let me know if you need help replaying the demo or narrow it down otherwise.

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 :/

@AJenbo
Copy link
Member

AJenbo commented Jul 14, 2022

NetSendCmdLoc is throttled where I don't think that is the case for NetSendCmdLocParam1. Try creating a variant of NetSendCmdLoc with out it and see if that resolves it.

@ephphatha
Copy link
Contributor Author

ephphatha commented Jul 14, 2022

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.

@ephphatha
Copy link
Contributor Author

NetSendCmdLoc is throttled where I don't think that is the case for NetSendCmdLocParam1. Try creating a variant of NetSendCmdLoc with out it and see if that resolves it.

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...

@ephphatha ephphatha changed the title Use pointer for pcursobj, position for position based network messages Use cursor position for position based network messages targeting objects Jul 19, 2022
Comment on lines +118 to +119
// This should probably be cursPosition so paths to large objects are consistent
NetSendCmdLoc(MyPlayerId, true, CMD_OPOBJXY, object.position);
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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 😂

Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants