Results 1 to 17 of 17

Thread: [HELP] Mouse Data Gathering

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default [HELP] Mouse Data Gathering

    In the interest of making mouse movement even more human like, I wrote a simple program to record mouse movement to a text file for later analysis. You can view the source code at GitHub. Instructions are provided so you can generate the executable yourself.

    Should you have the time, please download the program and run it. It will produce a text file named YYYYmmdd-HHMMSS.txt (when you started the program) in the directory where you started the program. After running it for as long as you can, please compress and upload your log files - feel free to post them in this thread or send them to me via PM. If you do, please also list your mouse's make and model, as it seems like I am not able to properly get mouse information from Windows in some cases.

    Logs of a human playing RuneScape would be the most interesting, but any mouse activity would be helpful.

    Downloads:
    1. WinRec.exe
    2. WinRec_Long.exe

    It is suggested you use WinRec.exe. WinRec_Long.exe is configured to also print out the field names if you wish to see what an event is made of. This program may show up as a virus due to its use of the raw input API. All it records are dated mouse events.

    Cheers,
    R0b0t1
    Last edited by R0b0t1; 12-17-2017 at 12:11 AM.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  2. #2
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    I'll be looking forward to seeing what you do with this. I made something similar that did keyboard input as well. I ended up making a more 'natural' typing method that pressed the next key before the previous was released based on which finger would be used (since this is how I actually type), but it wasn't very practical. I never got around to doing anything with the mouse though. Good luck!

  3. #3
    Join Date
    Mar 2007
    Posts
    5,117
    Mentioned
    275 Post(s)
    Quoted
    900 Post(s)

    Default

    Tried running it for you; got this error


    Forum account issues? Please send me a PM

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Tried running it for you; got this error

    You have to compile with -static, -static-libgcc, -static-libstdc++. If you're running the binaries, OP probably forgot to compile with those linker options.
    Last edited by Kasi; 12-17-2017 at 12:09 AM.

  5. #5
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Tried running it for you; got this error
    Thanks for the feedback. I updated the links in the main post; due to issues with uploading attachments the files are now hosted on GitHub. Statically linking in the C++ library made the files significantly larger.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  6. #6
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Thanks for the feedback. I updated the links in the main post; due to issues with uploading attachments the files are now hosted on GitHub. Statically linking in the C++ library made the files significantly larger.
    You could also try compiling with -s (strip symbols) and -Os (optimize for size) to reduce the size of the binaries

  7. #7
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    @Kasi, the size is too large even with -s. -Os usually doesn't do anything unless you had another -O specified. Max size is 97.7kB. Looks like it's going to have to stay on GitHub.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  8. #8
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    @Kasi, the size is too large even with -s. -Os usually doesn't do anything unless you had another -O specified. Max size is 97.7kB. Looks like it's going to have to stay on GitHub.
    Fair if it doesn't help with the size. I would also like to point out, -Os is amazing. It applies most (if not all) -O2 optimizations that don't increase size as well as applying additional optimizations which reduce code size. So not 100% sure on why you're saying you have to have another optimization level specified when it practically includes -O2. It's also worth pointing out that the latest optimization flag practically overwrites the earlier optimization flag (in command).

    https://gcc.gnu.org/onlinedocs/gcc/O...e-Options.html
    Last edited by Kasi; 12-17-2017 at 01:12 AM.

  9. #9
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    When you say all of those flags have an effect, you need to be comparing them to something. So my post is about switching, say, -O3 to -Os. It looks like with GCC 7.1 the default flags are effectively -Os.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  10. #10
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    When you say all of those flags have an effect, you need to be comparing them to something. So my post is about switching, say, -O3 to -Os. It looks like with GCC 7.1 the default flags are effectively -Os.
    This is incorrect. The default flags should not be -Os. the default optimization flags should be -O0. That is what the standard says. Also, i use MinGW-W64 (GCC 7.2 rather than 7.1). It is not -Os by default. You can practically read the documentation that i previously posted a link to.

    https://i.imgur.com/zrDAvkp.png

    You should really stay away from -O3 unless you have profiled your code and know that it will benefit from -O3. -O3 in most cases makes the compiled code slower due to instruction cache pollution.

  11. #11
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Yes, I know all of this, but when I tested -Os there was no change in size from the default, which is why I said "effectively." -Os may be -O0 with -s, and on modern GCC versions -O0 looks a lot like -O2. From some discussions the GCC developers were having, they mentioned they were having a hard time differentiating the optimization levels on x86 and x86-64 because of insufficient testing.

    I appreciate that you want to help, but reading documentation to someone is not a good way to help. This is the second time in recent memory that someone has tried to be supportive in a non-constructive way.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  12. #12
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Yes, I know all of this, but when I tested -Os there was no change in size from the default, which is why I said "effectively." -Os may be -O0 with -s, and on modern GCC versions -O0 looks a lot like -O2.
    None of this is true. -s is a link option which removes the relocation and symbol tables DURING linking stage. It does not have any effect during compilation stage which happens before linking. And does not optimize code in any way.

    1. You compile your files into object files.
    2. You link(/merge) your object files.

    Optimization takes place at step 1. You straight up can't add -s in this step. -s is a linker flag. It happens when you're linking object files.

    Likewise, you can't optimize during your linking stage(step 2) AFAIK, the code was already optimized in step 1. With this logic, i hope you can see that you can't even begin to suggest that -Os = -O0 + -s.

    Secondly, -O2 cannot be the same or look a lot like -O0. -O0 means optimization is turned off (it's essentially an empty flag which doesn't mean anything). Are you sure you are rebuilding your entire project when you compile? Rather than just building it.

    -Os does have changes compared to -O2. Although it might be hard to spot them without looking closer.

    Sorry if you can't learn that way. Documentation helps me a lot which is why i suggested it.

    Anyhow, I think this topic has hijacked your thread enough and is probably not in the direction of being constructive anymore so i guess i'm done explaining optimization to you.

  13. #13
    Join Date
    Feb 2013
    Location
    Narnia
    Posts
    615
    Mentioned
    8 Post(s)
    Quoted
    252 Post(s)

    Default

    What do you mean by dated mouse events? I am curious to how and what you are recording, it looks like time, device info, event type, and x & y all into one big file? I am not sure how you could parse that into useful information?

    If you created a new text file for each mouse event you could sort out the moue move events and make an interesting position vs time graph/table which you could pull velocities and accelerations from for even more detail in regards to position. You could write a program to read the data and calc velocity and accelerations into more text files. You would need to figure out a time for the mouse to be still for so you know when to write a new file. You could also sort out the button events to find mean, average, and standard deviation of time for a button press. This would be cool to see.

    View my OSR Script Repository!


    Botted to max
    Guides: How to Report Bugs to the Scripter
    ~~~~ Moved to Java. Currently Lurking ~~~~

  14. #14
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Quote Originally Posted by Sk1nyNerd View Post
    What do you mean by dated mouse events? I am curious to how and what you are recording, it looks like time, device info, event type, and x & y all into one big file? I am not sure how you could parse that into useful information?
    It records all mouse events, i.e. buttons presses and movement. Each line is prepended with the date (in Windows FILETIME format, e.g. us since epoch). The mouse event structure is then printed out after it. Parsing it just means interpreting the date and mouse event flags and data. Look at the printf statements in Input.cc.

    Quote Originally Posted by Sk1nyNerd View Post
    If you created a new text file for each mouse event you could sort out the moue move events and make an interesting position vs time graph/table which you could pull velocities and accelerations from for even more detail in regards to position. You could write a program to read the data and calc velocity and accelerations into more text files. You would need to figure out a time for the mouse to be still for so you know when to write a new file. You could also sort out the button events to find mean, average, and standard deviation of time for a button press. This would be cool to see.
    This is basically how the data is structured now - if you parse each line properly you can pick out all events which are movement events. How you suggested analyzing the data was something I was going to do. I left all events in the same file for simplicity, it will be easy to separate them.


    Quote Originally Posted by Kasi View Post
    Anyhow, I think this topic has hijacked your thread enough and is probably not in the direction of being constructive anymore so i guess i'm done explaining optimization to you.
    Again, I appreciate your desire to help, but you haven't explained anything to me that I did not already know. Just because you are typing does not mean that you are helping.
    Last edited by R0b0t1; 12-17-2017 at 08:40 PM.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  15. #15
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Again, I appreciate your desire to help, but you haven't explained anything to me that I did not already know. Just because you are typing does not mean that you are helping.
    Let's avoid the dick measuring. You don't have to prove anything to me. I don't care how much you know. I am simply correcting something incorrect that you said lol.

  16. #16
    Join Date
    Feb 2013
    Location
    Narnia
    Posts
    615
    Mentioned
    8 Post(s)
    Quoted
    252 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    This is basically how the data is structured now - if you parse each line properly you can pick out all events which are movement events. How you suggested analyzing the data was something I was going to do. I left all events in the same file for simplicity, it will be easy to separate them.
    Awesome, I look forward to seeing some of the data displayed. There is a lot you could do with it.

    View my OSR Script Repository!


    Botted to max
    Guides: How to Report Bugs to the Scripter
    ~~~~ Moved to Java. Currently Lurking ~~~~

  17. #17
    Join Date
    Mar 2013
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Interested to hear how you are processing the recorded info. I've considered doing something similar but could never wrap my head around how I would get practically useful information.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •