• Announcements

    • HEAVY265

      Attention Soldiers Operation Fury Needs you!   02/20/2020

      Attention All Soldiers, Operation Fury needs you.  You need to choose a side and sign up.  
      For more intel on Operation Fury Please click HERE Please go to Special Event Forum (here), And sign up for allied or axis.
      This will be a CRS Lead event on both sides.  Xoom will be heading up the axis side and Heavy265 will be heading up the Allied side. This will be for bragging rights.
      Why are we asking players to sign up you ask. We are trying for a role play experience.   We want this to be a true realistic event.  
      So get up and sign up and let's make this the best event ever!!!!!!!!!!
      Give me your war cry, grrrrrrrrrrrrr
      Heavy265 **out**
Sign in to follow this  
Followers 0
AHWULF

Inf Jitter Bug (Fixed)

27 posts in this topic

Well I've narrowed it down to where the problem is, but don't know why.

When you are spawned in the game and you get the jitter bug, the problem happens because mousemoved events are not being returned often enough. Generally when you are not spawned in (or in the map) you get events every 50ms or so. When you are moving your inf around the mousemoved events only start coming every 200-300ms. This is irrespective of your actually FPS. So FPS of 20 should be about 50ms between movements as you turn (which is translated directly into degrees of motion). However when you have the problem you are only getting 5 updates per second, so the movement is wider (about 5-6 times wider) so you see big jumps instead of smoother motion.

These mousemoved events come from the OS so this is not directly at least the game, which explains why it starting happening between client updates in 129.3.

I need to research this. Note the problem is not 100% occurring, it seems to happen randomly to people.

Remember I am taking care of my mom during the week next week and can't work on the source.

I wish we could figure out what in the OS is causing this to happen. It's kinda bizarro.

Share this post


Link to post
Share on other sites

I think I found a solution, but not sure there is enough time to test before I leave. I tried it once and it did help.

Share this post


Link to post
Share on other sites

Craziness. I'm glad you found what seems to be the source of the problem.

I'm actually surprised the mouse move events are only being broadcast every 20ms at their normal state. Wouldn't that create a slightly odd experience for people with 50+ FPS? Or is 20 FPS right around the threshold of where we just don't notice more subtle visual changes (like a panning image on a screen)?

Interesting stuff. Thanks for sharing.

Share this post


Link to post
Share on other sites

Well the mousemove events happen on a system timer, but the game only looks at the events every frame. In the normal case, the system coalesces mousemove events into one big event if you don't call it very often (plus the game does the same thing). I changed it to not coalescing but it only helped in high fps areas and then oddly only some of the time. So this was only part of the solution. What I will try when I get back is to collect events on a separate timer from the game so they are less affected by low fps.

In any case at 8-10fps or less nothing will help, as there are too few frames drawn to divide up your movement.

It's the 10-15fps area where you really see the choppiness the worst. The coalescing off might help the high fps 25+ people, but since my mac sucks I don't qualify ;-).

The reason it doesn't help all the time has to do with the amount of free ram in the system. If you have less than 200MB free ram then the mouseevents are affected for no apparent reason. So its a twofold problem - coalesced mouseevents, not checking events regularly, and too little free ram.

To permanently fix this I can fix 1+2, 3 has something to do with the use of memory. That's harder as I only have 2.5GB and don't know what happens if you had like 6GB. Fixing this might be easy or really hard, don't know yet.

I did a little research before I left, the game after loading has more than 1 million objects in existence before you ever spawn in. 40% are only 16bytes in size or less. So it could be a case of too many notes (to make an Amadeus (movie) joke),

Share this post


Link to post
Share on other sites

OK I changed the archive file open to not cache the contents (which is stupid anyway but the default on os x), which means you have 200MB or more free ram to play with. On my 2.5GB RAM G5 it means there is enough free ram to avoid the jitters.

Hopefully will be in 130.2 but not sure since I just got back.

Share this post


Link to post
Share on other sites

When the game calls the OS to get mouse and key events, it's taking WAAAY too long while in the game. Anywhere from 2-12 ms per frame. The longer it takes in the OS the less time is available for the game to draw its frames. This might actually affect FPS as well. Sigh, nothing is ever simple...

Share this post


Link to post
Share on other sites

Playing with getting the mouse move events the manual way and skipping the OS event stuff. Seems to take less time! Not all working yet though.

It's funny, when the game is going, getting an event always takes too long and slows down the game. The FPS doesn't appear to change but its an illusion. In some ways its worse with higher FPS since you check for events more often, which thus takes more time each second.

Oddly enough this also slows down launching the game as well. That I can fix by simply not checking for (useless) events as the progress bar displays.

Share this post


Link to post
Share on other sites

OK the mouse fix seems to work much better. Having a key down still takes extra time, thats a lot more work. The only odd thing is there is a minor hitch when i move the mouse back to the center of the screen when it hits an edge, but its hard to see.

Not sure if this will go into 130.2 or 131.

Note that if you are getting 8fps it won't help at all, but should be really smooth with high FPS

Share this post


Link to post
Share on other sites

Fix will be in 1.30.2. I can still redo handling of keyboard inputs to make it even quicker but this should help a lot.

Share this post


Link to post
Share on other sites

The hack I did for making mouse input work isn't the end state, I hope that the internal beta will get a couple people to try it out. On my crappy G5 its better but irritating still when you do keyboard and mouse input together.

I can redo the whole event getting code to a lower level method but it won't get done for 1.30.2. It would require a bunch of testing. I think it will be better.

Don't ask me why all of a sudden getting mouse and keyboard events takes up to 12ms per frame from the OS.

Share this post


Link to post
Share on other sites

Good work on the Stem Cell Research.

The sooner it's fixed, the sooner I can go back to using the iMac and not the PC.

I'm open for testing on the MacBook Pro 17" and the iMac.

Share this post


Link to post
Share on other sites

THe jitter problem is yet another example of how bizarro bugs can be. I made a fix (as above) that both helps and doesn't help. I'm beginning to think the problem may be memory related (like the FPS issues) and the fix (hack) I did isn't necessary if the memory issues can be understood. I think I may have to get APple support on this one (which will cost $). I think FPS stutters and jitter are two sides of the same problem.

Share this post


Link to post
Share on other sites

OK, i checked in the last tweak for the new hackery. I'm asking various mailing lists for help on the underlying bizarro-ness. If I can get the $ I will open a ticket with Apple for real dev support help.

This tweak is playable if you have enough fps. At 7fps it kinda sucks. I made it so you can do a defaults write and turn off the hack and get the old behavior (which of course might jitter).

Share this post


Link to post
Share on other sites

Due to the magic of google, I found the call I was missing. Now mouse back to moving smoothly!

Share this post


Link to post
Share on other sites
Due to the magic of google' date=' I found the call I was missing. Now mouse back to moving smoothly![/quote']

Great! Sounds like some fantastic detective work you did Ahwulf!

Will this fix be included in the next patch for Mac?

S!

ozy06

Share this post


Link to post
Share on other sites
Due to the magic of google' date=' I found the call I was missing. Now mouse back to moving smoothly![/quote']

Did it get in the .4 beta?

I just tested, it did not solve, but did greatly improve.

as always, excellent job!

Share this post


Link to post
Share on other sites

No it works correctly for me. I can move 180 smoothly with the mouse. Note that FPS does matter, at FPS less than about 10 you will see some jitter but that's frames being too slow (mouse and keys only checked once per frame). If you see jitter at 15+ fps then something is wrong. I just tried offline and got smooth mouse at 30fps. Before I made these changes Id get 30 fps and mouse movements stepped at 10 degrees or so.

Share this post


Link to post
Share on other sites
No it works correctly for me. I can move 180 smoothly with the mouse. Note that FPS does matter' date=' at FPS less than about 10 you will see some jitter but that's frames being too slow (mouse and keys only checked once per frame). If you see jitter at 15+ fps then something is wrong. I just tried offline and got smooth mouse at 30fps. Before I made these changes Id get 30 fps and mouse movements stepped at 10 degrees or so.[/quote']

I am getting frames at 20 and up, and noticing subtle jitter. still better then before, tho.

Will check again, see what happens.

Share this post


Link to post
Share on other sites

Holding keys down will still create a subtle jitter; to replace the key event is a lot of work, but the mouse was the worst culprit.

Share this post


Link to post
Share on other sites

Anyone know when this patch-wot-fixes-the-bug gets released? I was hoping the Rats would have updated it for the start of the new campaign but doesn't look like it... hopefully it'll be ready "soon"! ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.