Opened 7 years ago

Closed 6 years ago

#6207 closed defect (fixed)

WME: Chivalry - Mouse is sluggish in save/load menu

Reported by: misterhands Owned by: somaen
Priority: low Component: Engine: Wintermute
Keywords: Cc:
Game: Wintermute

Description

Latest Win64 nightly build
Chivalry is not Dead

The mouse cursor becomes slow, sluggish, less responsive when in the in-game Save/Load menu.

Ticket imported from: #3594776. Ticket imported from: bugs/6207.

Change History (9)

comment:1 Changed 7 years ago by digitall

Owner: set to somaen

comment:2 Changed 7 years ago by somaen

This stems from the huge amount of draw calls to the same surfaces over and over when drawing tiled images. I have done some optimization to this now, which should atleast make the problem half as bad (I went from 8 fps to 18 fps in the load-menu myself).

comment:3 Changed 7 years ago by misterhands

Well, I just tried with the latest nightly and I don't really see any difference, at least in mouse response or CPU utilization.

I noticed that my CPU usage goes from 0-5% in game, to a steady 10% in the main menu, to a whooping 25% in the save/load menu (which means that basically 1 core is fully used on my quad core).

It's strange that a static menu would be so much more taxing than the actual animated game itself... maybe you could make these crazy draw calls slow down a bit.
Anyway, it looks like there is still room for optimization in that code ! :-)

comment:4 Changed 7 years ago by somaen

Try to add "show_fps=true" to the configuration-entry for Chivalry (you'll need to manually edit the config-file), that should give show you the current FPS.

I also just made some changes that should limit the sluggishnes to whenever the mouse is moving over the menu-items, and even then it should be about 4-5x faster than before.

comment:5 Changed 7 years ago by misterhands

This is noticeably better now.
Like you said, CPU usage, FPS and mouse response are now under control,
except when moving the mouse over the menu items, in which case I get :

Main game menu : FPS 45-50 ; CPU 12-14% ---> OK
Save/load menu : FPS 19-26 ; CPU 20-24% ---> still a bit sluggish but better

I don't think anybody is likely to complain that the FPS drops when shaking their mouse over the menu items, so I think you can consider this bug fixed.
That is, unless you want to refine things further !

May this bug (excessive draw calls causing high CPU load and sluggishness) manifest itself in other situations or games ?

comment:6 Changed 7 years ago by somaen

Possibly, as the issue is basically all about how Tiled-Images are drawn in WME, so if some game happens to use a lot of them, then you might get a similar slowdown.

comment:7 Changed 7 years ago by somaen

Priority: normallow

comment:8 Changed 6 years ago by somaen

Resolution: fixed
Status: newclosed

comment:9 Changed 6 years ago by somaen

I just updated the code with a fallback that should solve it for now (when the amount of draw-calls gets large enough the engine now simply uses full-screen draws until the amount falls down again).

Note: See TracTickets for help on using tickets.