Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Mouse acceleration; or something
Topic Started: Jun 19 2008, 10:49 PM (293 Views)
ashrat3000
Member Avatar
u3d raytracer
[ *  *  *  *  *  * ]
Most games have something called mouse acceleration or fix mouse lag. This fixes the cursor so it doesn't lag behind where the mouse is actually telling it to be. How does it work?

그대를 사랑해


Offline Profile Quote Post Goto Top
 
Bami
Member Avatar
Guess the character, win a prize
[ *  *  *  *  * ]
If you're referring to Halo's Mouse Acceleration (which is horrible), or Valve's mouse smoothing (which is sort-of okay).
Instead of setting the mouse position to the centre, then every step get the difference between the centre and the new position, and reset the mouse, they average the mouse acceleration and use that to "predict" where the mouse is going next, and then average that next position with the mouse actual position.

In other words, instead of using the data directly, average the position with the predicted position based on the previous position.

If you mean the fact that if you have a cursor and it lags behind the "real" cursor, that's just a windows quirk when drawing.
Game maker gets the cursor position after windows has already drawn the window and updated the new mouse position. The difference will be exactly one frame, or 1/monitor refresh rate, so usually 1/75th of a second.

Most games actually get the mouse position directly from hardware or windows API, and not the cursor position.

You can try getting the cursor position in the begin step event, but otherwise then that I don't know any possible way to get that properly fixed in gamemaker.
Here are the thrill seekers, corrupt and immoral.
Posted Image
Offline Profile Quote Post Goto Top
 
Zedman3d
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Quote:
 
Most games actually get the mouse position directly from hardware or windows API, and not the cursor position.

Doesn't sound too difficult for a DLL programmer on the GMC. Ask around.
Edited by Zedman3d, Jun 20 2008, 01:30 AM.
Quote:
 
Eanbro: My problem with C++ is that not everything is included to start making projects with it.
Quote:
 
Dr.B: Your problem with C++ is that you want it to be like Game Maker...
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
There is another type of mouse lag, where the players rotational orientation is sent to a server and not updated for the player until it is returned by the server. :wacko:
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Off-topic · Next Topic »
Add Reply