Closed aeviou closed 1 year ago
Hmm. First of all, there is no event for that.
Sceen moves can be detected by listening to entity updates on CDOTAPlayer
, for the respective properties.
I am not sure what exactly you mean by "removing any data that involves camera movement".
Can you rephrase what exactly you're trying to achieve?
I'm trying to find the pathing of a player's mouse movement in between two clicks (player movement or ability/spell casting). my goal is to track the speed and precision that a player is able to move their mouse between two points. I'm trying to do this by tracking m_iCursor
and collecting that tick data that occurs between a player orders.
My issue is that if a player uses edge pan then there won't be a direct path between point A and point B, as the player will move their mouse to the edge of the screen. This would be similar for camera dragging.
So, basically the following:
And now you want the "distance of A and B" in m_iCursor
units?
Hmm. My goal is to record the pathing of all mouse movements between any two given clicks for each player.
m_iCursor
m_iCursor
However I am only interested in recording pathing where the player intended to move their mouse from Point A to point B directly. So I want to be able to identify the following scenario in order to avoid recording it:
Ok, that makes it clear. Generally, you should be able to find out if scrolling happened between time of A and time of B, if the viewport changes. That will include both edge pan and middle mouse pan. Maybe you can throw out data points where
m_iCursor
was detected to be "on the edge" during that time?This will throw out a few false positives for middle mouse scrollers clicking something on the edge of the screen. But shouldn't be too many, I guess.
Great, thanks so much!
x
and y
I want to check m_iCursor == 0
and if m_iCursor == xUpperBound
and m_iCursor == yUpperBound
. How would you go about calculating these upperBound
s?I can probably figure the latter one out myself but I have no clue on where the viewport information is located.
CDOTAPlayer
entities: position is CBodyComponent.m_cell[XY]
and CBodyComponent.m_vec[XY]
, they are the camera position of the player.m_iCursor
are. I would just write a little test that goes over a replay and records the maximum values.Thanks! Really appreciate it.
Good luck!
Is there an event that detects the camera itself moving? I see on #133 that you can obtain the camera from
CDOTAPlayer
andCDOTAUserMsg_SpectatorPlayerClick
but I'm not sure if there's a way to detect screen moves. It's hard to find an approach that accounts for screen drag or WASD camera movement.My goal is to detect the mouse movement that occurs between player clicks and removing any data that involves camera movement. I'm thinking of calculating the distance between the two points that are clicked and if the distance of the mouse coordinate aren't identical to the distances calculated from
CDOTAUserMsg_SpectatorPlayerClick
then I assume the camera has moved.Do you have any ideas or thoughts? Any help would be appreciated!