Jump to content

Lagging when using Shift- modifier key


wowgetoffyourcellphone
 Share

Recommended Posts

When using shift to place multiple buildings or to batch train, a large drop in framerate is noticed. I am not sure if it is my computer's local config [like some kind of "easy keys" option or something triggered by the shift key] or if it's a 0 A.D. problem. I've noticed this for a long time now, but just now mentioning it.

Edited by wowgetoffyourcellphone
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I can't reprodue it, I get 54 FPS before and while pressing.

The building placement should not influenced at all by holding shift, as that is only tested when doing the mouseclick.

I suspected it's the massbartering. The numbers in that dialog are updated when pressing or releasing the key (see massbarter in misc.xml).

Does the framedrop occur while keeping it pressed or only on keydown/release?

You could rename your user.cfg to use the default config and see if the problem persists.

Next the specific lagging hotkey should be identified. Could rip out the mentioned massbarter event, or reassign hotkeys from Shift to something else.

  • Thanks 1
Link to comment
Share on other sites

If I was allowed to guess wildly, I'd say windows behaves differently than linux with regards to sending the keydown/keyup even to the GUI and updates the barter panel all the time while holding it - whereas on linux only when actually pressing the first time or releasing.

Someone could add this debug line to misc.xml to see if that's the case

	<object hotkey="session.massbarter">
		<action on="Press">
            warn("Updating barter panel"); // INSERTION
			updateSelectionDetails();
			updateBarterButtons();
		</action>

		<action on="Release">
            warn("Updating barter panel"); // INSERTION
			updateSelectionDetails();
			updateBarterButtons();
		</action>
	</object>

 

Link to comment
Share on other sites

Actually it works this way on linux too. We can see it with the toggle trade dialog hotkey (Ctrl+B).

When pressing it, it toggles once. While keeping it pressed further, after a second it starts to toggle back and forth.

But I totally can't see any FPS decline, not even 1 FPS, no matter if I'm at 50 or 20 fps.

We could figure out which of the hotkeys is the performance heavy one.

But I also recall causative sometime saying that the frequency of the event is different on windows than linux, that would explain it.

@causative do you remember in which context that was? (We had added a custom frequency  in rP19658, g_StatusBarUpdate, but that's not a hotkey frequency).

Link to comment
Share on other sites

4 hours ago, elexis said:

Also can someone who does experience the lag test if the lagging is gone if the 'session.massbarter' and 'session.batchtrain' part of misc.xml is deleted? I suspect both of them are equally lagging?

Yes, removing this reduces or eliminates the lag.

Another thing that causes lag [I think] are sound calls, especially when they are first played.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

4 hours ago, elexis said:

Actually it works this way on linux too. We can see it with the toggle trade dialog hotkey (Ctrl+B).

When pressing it, it toggles once. While keeping it pressed further, after a second it starts to toggle back and forth.

But I totally can't see any FPS decline, not even 1 FPS, no matter if I'm at 50 or 20 fps.

We could figure out which of the hotkeys is the performance heavy one.

But I also recall causative sometime saying that the frequency of the event is different on windows than linux, that would explain it.

@causative do you remember in which context that was? (We had added a custom frequency  in rP19658, g_StatusBarUpdate, but that's not a hotkey frequency).

It might have been someone else.  I don't use windows myself.  The only vaguely related thing I could find in my IRC logs is that Windows does not prevent alt+tab from reaching the application - so alt+tab will toggle status bars - and Linux does.

  • Like 1
Link to comment
Share on other sites

36 minutes ago, Imarok said:

Refs #4915

Actually I don't think it's a 0 A.D. issue; the game seems to be behave as it's supposed to. On Fedora, the “repeat keys” feature is activated by default, but it can be turned off or have a different sensitivity:

5a96860903896_Screenshotfrom2018-02-2811-32-14.thumb.png.f630ceb1303fca2b259278c563de7248.png

Likewise, I'd expect other operating systems to be able to toggle this non-0 A.D. feature as well.

  • Like 1
Link to comment
Share on other sites

7 hours ago, Nescio said:

Actually I don't think it's a 0 A.D. issue; the game seems to be behave as it's supposed to. On Fedora, the “repeat keys” feature is activated by default, but it can be turned off or have a different sensitivity:

5a96860903896_Screenshotfrom2018-02-2811-32-14.thumb.png.f630ceb1303fca2b259278c563de7248.png

Likewise, I'd expect other operating systems to be able to toggle this non-0 A.D. feature as well.

Perhaps, but I don't remember experiencing shift key lag from other RTS games. Maybe I will test another RTS game and see.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
On 3/2/2018 at 11:50 AM, elexis said:

On our machines the hotkey event is sent less often than on your machines, so we didn't notice it being a problem.

If the GUI updates it less often than the hotkey event frequency, the lag should be gone independent of the hotkey event frequency.

Has this been fixed? 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...