Performance issue on screen hover function

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Performance issue on screen hover function

#1 Post by nyaatrap » Mon Jul 08, 2013 7:11 pm

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.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Performance issue on screen hover function

#2 Post by xela » Tue Jul 09, 2013 6:17 am

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...
Like what we're doing? Support us at:
Image

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Performance issue on screen hover function

#3 Post by jack_norton » Tue Jul 09, 2013 10:13 am

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...
follow me on Image Image Image
computer games

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Performance issue on screen hover function

#4 Post by nyaatrap » Tue Jul 09, 2013 12:14 pm

Problem is not just performance, also key response. While hovering, keys counldn't updated realtime and causes operational errors.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Performance issue on screen hover function

#5 Post by xela » Tue Jul 09, 2013 5:05 pm

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...
Like what we're doing? Support us at:
Image

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Performance issue on screen hover function

#6 Post by nyaatrap » Tue Jul 09, 2013 8:17 pm

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.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Performance issue on screen hover function

#7 Post by PyTom » Wed Jul 10, 2013 4:17 pm

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.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Performance issue on screen hover function

#8 Post by jack_norton » Wed Jul 10, 2013 5:33 pm

Besides, I've never seen a game with 400 buttons on screen :lol:
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.
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: No registered users