Page 1 of 1
Performance issue on screen hover function
Posted: Mon Jul 08, 2013 7:11 pm
by nyaatrap
When a screen has many buttons, the hover function slows down performance horribly.
Code: Select all
screen tt_screen:
default tt=Tooltip("")
grid 20 20:
for i in range(400):
textbutton "[i]" action SelectedIf(True) hovered tt.action("{}".format(i))
label start:
show screen tt_screen
$ui.interact()
The above code uses integers on the hover function. But when buttons store several variables and long strings, even just 10 buttons produces noticable slow down.
Re: Performance issue on screen hover function
Posted: Tue Jul 09, 2013 6:17 am
by xela
I've noticed a considerable delay even with 7 - 10 buttons, tooltip and hovered... works a LOT faster with hovered only on the buttons where it's absolutely required...
Re: Performance issue on screen hover function
Posted: Tue Jul 09, 2013 10:13 am
by jack_norton
That's one of the main reasons why I disabled tooltips (beside the fact that I want my games portable to touch devices). I was showing other screens on hover (the spells tooltips in Loren for example), and indeed was slowing down even with just one hover button

but not sure there's a solution...
Re: Performance issue on screen hover function
Posted: Tue Jul 09, 2013 12:14 pm
by nyaatrap
Problem is not just performance, also key response. While hovering, keys counldn't updated realtime and causes operational errors.
Re: Performance issue on screen hover function
Posted: Tue Jul 09, 2013 5:05 pm
by xela
nyaatrap wrote:Problem is not just performance, also key response. While hovering, keys counldn't updated realtime and causes operational errors.
Never caused actual Errors... I have 280 items in a game with the same issue, I've limited amount of items displayed at any given time through paging to 18 (tooltip displaying item descriptions) but it was still slow and unpleasant. Never had to deal with any errors even with all items being loaded into a viewport simultaneously...
Re: Performance issue on screen hover function
Posted: Tue Jul 09, 2013 8:17 pm
by nyaatrap
When you hit 60 keys in a sec while performance is slowed down 1 key/1sec, it takes 1 min to done an action of the last key you hit and there's no way you can escape from this loop untill all key actions are done. It's as if ren'py is crashed.
Re: Performance issue on screen hover function
Posted: Wed Jul 10, 2013 4:17 pm
by PyTom
I'll note that Ren'Py is a visual novel engine - the 400 button case is not something it was meant to support. That doesn't mean I won't try to improve performance - but we are starting to move into the case where you're going beyond the VN focus.
Re: Performance issue on screen hover function
Posted: Wed Jul 10, 2013 5:33 pm
by jack_norton
Besides, I've never seen a game with 400 buttons on screen

But yes is not really a "test case". If I remember correctly in my specific Loren case, using cache for the icons was speeding up a bit. But to be honest with the latest version things have improved much in terms of speed.