Horrendous mouse lag in packaged game

I have a top-down shooter where I use the mouse to aim the player so you point in the direction of the mouse cursor. I have a navmesh which ideally needs to be dynamic because there are doors which can block doorways. While playing in editor enemies spawn in and attack the player, I can then freely aim and shoot them. This is all fine and dandy in editor.

Now here’s where it makes no sense at all…

When I package the game in development/shipping, as soon as there are a few enemies spawned my character cannot rotate itself properly as you can see in the video. Note: this was not an issue in 4.5.

And this ONLY happens when:

  1. A mouse button is down (left/right/middle).
  2. There are 5+ active AI characters ON the navmesh

If I then set the navmesh rebuild at runtime to false and then package it again, my aiming works again. I have no idea how a dynamic navmesh can affect mouse input but it does! Obviously with this setting set to false my enemies think they can run through doors, not exactly ideal.

My guess would be you have some undesired navmesh rebuilding happening. Could you post a video of the issue with navmesh debug drawing enabled? You’ll need to use an unpackaged game for it. And yes, I know you don’t experience the issue in the editor, I just want to what’s happening in terms of navmesh generation.

Cheers,

–mieszko

Hi Mieszko,

You’re right about it being caused by navmesh generation but it still makes no sense (not to me) that the problem only happens when I’m holding down a mouse button and it doesn’t occur in editor.

In the first part of this video you can see my enemies create holes in the navmesh for other enemies to avoid which is done by setting 'can ever affect navigation' = true on one of the components. I like the enemy behaviour because of this, otherwise they all just go in single file.

The second part of the video shows the packaged game and how the navmesh generation messes things up.

At the moment it just seems that any mouse button down + navmesh generation creates lag getting the current mouse position. And considering it wasn’t an issue in 4.5 it feels like a new bug.

If the mouse cursor is set to show on the player controller or set to true in blueprint, it will cause massive mouse look lag when there are tons of AI on the screen. If you make sure the mouse cursor is always hidden, then the mouse look lag goes away.

Hey sr3d,

We’ll be looking into your issue on your other post, here:

Thanks!

Hello, also experiencing this in 4.12.5

to people looking at this and having problems / lag with mouse click drag

more info can be found here…