How Do I Prevent Lag on Startup

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
ThePurpleAnon
Newbie
Posts: 7
Joined: Sun Feb 18, 2018 9:02 pm
Projects: Sakura's Song and Dance Club!
Organization: ThePurpleAnon
Deviantart: ThePurpleAnon
Contact:

How Do I Prevent Lag on Startup

#1 Post by ThePurpleAnon »

Hi! Me again... My game has a splash screen with a little animation of the logo. Following the animation, there is a dissolve transition between the splash screen and the main menu, and every time it plays, without fail, the game gives up and gives 3 frames of dissolve instead of the full smooth transition. Is there a way to preload assets or transitions to prevent this?

Also, if it helps, the code for the logo is as follows:

Code: Select all

transform logointro:
    parallel:
        xalign 0.5
        yalign 1.5
        linear 0.0 rotate 180 zoom 0.5 yzoom 1.3
        easein_back 0.5 yalign 0.5 zoom 1.5 yzoom 1.0
        pause 0.25
        ease_cubic 0.125 rotate 370
        ease_cubic 0.125 rotate 347
        ease_cubic 0.125 rotate 376
        ease_cubic 0.125 rotate 341
    parallel:
        easein_quint 0.5 rotate 360
        pause 0.25
        easein_quint 0.35 zoom 1.8
        easein_quint 0.15 zoom 0.0
In the words of my dear uncle:

"Why not? Why not try it out of a goat?"

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: How Do I Prevent Lag on Startup

#2 Post by irredeemable »

How are you handling the dissolve? Can you post the code from your splashscreen label?

User avatar
ThePurpleAnon
Newbie
Posts: 7
Joined: Sun Feb 18, 2018 9:02 pm
Projects: Sakura's Song and Dance Club!
Organization: ThePurpleAnon
Deviantart: ThePurpleAnon
Contact:

Re: How Do I Prevent Lag on Startup

#3 Post by ThePurpleAnon »

I'm actually handling the dissolve from a config variable in options.rpy

Code: Select all

define config.end_splash_transition = Dissolve(.2)
In the words of my dear uncle:

"Why not? Why not try it out of a goat?"

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: How Do I Prevent Lag on Startup

#4 Post by irredeemable »

Hey, 3 frames in .2, that's still 15 fps--not terrible. :P The main menu is predicted automatically, not sure if there's anything more you can do unless you've customized it in a way that is very inefficient.

User avatar
ThePurpleAnon
Newbie
Posts: 7
Joined: Sun Feb 18, 2018 9:02 pm
Projects: Sakura's Song and Dance Club!
Organization: ThePurpleAnon
Deviantart: ThePurpleAnon
Contact:

Re: How Do I Prevent Lag on Startup

#5 Post by ThePurpleAnon »

The 3 frames of dissolve in the .2 seconds, while not sounding very bad, usually goes like this:

first frame: 0.17 seconds
second frame: 0.02 seconds
third frame: 0.01 seconds
main menu screen

It's very jarring, and not exactly top-level performance.

I'm not sure if it's to do with the fact that my graphics card isn't the best, maybe it's that it's a 1080p game that I'm running on my 768p laptop, but it's just disgusting looking.

Is there some sort of code that I can use to preload the transition, or some way to prepare the game to display the main menu, or am I just out of luck?
In the words of my dear uncle:

"Why not? Why not try it out of a goat?"

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: How Do I Prevent Lag on Startup

#6 Post by irredeemable »

Prediction of the main menu is literally one of the first things Renpy does on startup. As far as I know there is no way to further optimize it taking into consideration the transition. FWIW:

Code: Select all

label splashscreen:
    scene black
    show logo at logointro
    pause 1.0
    return
worked fine for me with an 800kb png and a default menu, though my PC is a little to the right of the curve. One thing you might try is using an ATL alpha transformation to fade out your logo before it transitions to the menu.

User avatar
ThePurpleAnon
Newbie
Posts: 7
Joined: Sun Feb 18, 2018 9:02 pm
Projects: Sakura's Song and Dance Club!
Organization: ThePurpleAnon
Deviantart: ThePurpleAnon
Contact:

Re: How Do I Prevent Lag on Startup

#7 Post by ThePurpleAnon »

That did help a bit, thanks! I think it might mostly be my computer though, because I'm displaying that logo (29.7 KB) above and image of my own logo (10.6 KB - 36.2 KB, it's random which image shows up), and it's just bad performance. However, when I actually get into the game, it's mostly fine. It's just when the game encounters new information it hasn't seen in the current session that it freaks out.
In the words of my dear uncle:

"Why not? Why not try it out of a goat?"

Post Reply

Who is online

Users browsing this forum: Google [Bot]