Opened 11 years ago

Closed 11 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
Version: Keywords:
Cc: Game: Wintermute


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 by digitall, 11 years ago

Owner: set to somaen

comment:2 by somaen, 11 years ago

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 by misterhands, 11 years ago

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 by somaen, 11 years ago

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 by misterhands, 11 years ago

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 by somaen, 11 years ago

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 by somaen, 11 years ago

Priority: normallow

comment:8 by somaen, 11 years ago

Resolution: fixed
Status: newclosed

comment:9 by somaen, 11 years ago

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.