Game glitches when low fps or weak computer?

Hi,

I had my friend test my rts-like game on his computer, and at the time, he did not have graphics drivers installed on his computer (plus he was using Linux). When he ran my game, first of all the mouse cursor (a custom one) was extremely large (like 1/8 of the screen size) – on windows machines this does not happen. But I’ll chalk that up to it just being linux and nothing else – i’ll have to deal with that later.

But, secondly, and the most head-scratching glitch for me, was that when moving units around on the map, the units would sort of “twitch” back and forth when they came to the end of their path. They usually stand still and the “idle” animation runs fine, but instead they looked like they were rotating back and forth very quickly – then after about 5-10 seconds they would stop twitching and go back to normal.

Thirdly, I noticed while I was recording my gameplay once in order to make a video (and getting very low framerate while playing my game) that every once in awhile when I would issue a move order to my group of units, some units would start moving to the origin of my map (like Vector3(0,0,0)) while the other units in the group would move to where I actually clicked for them to move.

Is this normal? I get the fact that low-end machines can’t handle some processes or perhaps don’t have enough memory maybe, but what would cause the game to act differently, instead of just acting slower in relation to the hardware? What might be the cause for this?

If you run a lot of game logic in your update loops, these are run at framerate, so you need to keep in mind what will happen if they don’t get performed as often as you’re expecting.

Standard framerate dependent issues is things happening slower on slow machines (and much faster on fast machines!) but they can also show up as slightly weirder issues, like when multiple commands could be issued before a single frame which would be mechanically impossible on a faster machine.

It’s common to use Time.deltaTime a lot in calculations to make games ‘framerate independent’, so that at lower framerates, more work is done in each frame, but this can also result in logic bugs, like overshoot. You mention characters rotation jittering when they come to a stop - if you’re doing a final rotation using Time.deltaTime as a component, they might be rotating far more in one frame than they do at higher framerates, allowing them to overshoot their target, then have to approach it from the other direction. (this is just a guess/example btw)

Thanks Flax. That sounds like what is then probably. I do have a large amount of game logic in the update loops. And I also use Time.deltaTime in quite a few places.

So would there be anything I could maybe do to reduce the chances that logic bugs like that would appear? Like doing rotations in fixedupdate instead of regular update (just throwing something out here)? Or is there another way to make the rotations or pathfinding smooth without having to use Time.deltaTime. Just wondering, perhaps I should just not worry about it too much and set a “minimum requirement” on my game that if people don’t abide by they’re kind of screwed lol.

Again, thanks for the great information, I might be able to come up with something over time.