How to reduce loading times?

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
Twain
Newbie
Posts: 7
Joined: Fri Aug 12, 2016 4:24 am
Contact:

How to reduce loading times?

#1 Post by Twain »

I've been working on a renpy game but reloading it for bug/play testing is taking longer and longer as the game increases in size to the point where it becomes a time drain. I've got a lot of scripts, images, composites etc.

Are there tricks or certain ways of doing things which can help reduce (re)loading times? Or at least prevent the increase of loading times as much as possible?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: How to reduce loading times?

#2 Post by PyTom »

How many script files do you have? Having multiple small script files should be faster than one big one.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Twain
Newbie
Posts: 7
Joined: Fri Aug 12, 2016 4:24 am
Contact:

Re: How to reduce loading times?

#3 Post by Twain »

Thanks for replying.

It currently has about 150 scripts . Most of them far below 100 KB in file size. I use those to store composites of images etc . Eight of them are about 1 MB in size (but their rpyc versions sometimes 2 MB)

Would chopping those bigger scripts into smaller ones have any noticeable impact?
Is there an optimum size? Or maybe a way to load a script when the need arises in game instead of all at once in the beginning?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: How to reduce loading times?

#4 Post by PyTom »

Hm... Are you trying to do anything that hits the disk as part of the image load? I'd be really interested in seeing what you're doing - since it strikes me that having scripts that long leaves for quite a bit of opportunity for the init code to be very slow.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Twain
Newbie
Posts: 7
Joined: Fri Aug 12, 2016 4:24 am
Contact:

Re: How to reduce loading times?

#5 Post by Twain »

I'm afraid I'm not really sure what you mean by "hits the disk as part of the image load?", but I don't think I'm doing something especially strange.

I wouldn't mind sending you a private message with a link to the scripts etc on a "for your eyes only"- basis. Just some general "good practice" guidance tips is the most I was hoping for, but of course I'd be thrilled for you to take a look at the scripts. Still, I understand if my "for your eyes only" caveat is a deal breaker. I'd like to add any sort of lesson learned(or things to avoid) to this post for others to learn from, but I'd like for the scripts themselves not to go public.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: How to reduce loading times?

#6 Post by PyTom »

While I don't sign NDAs, I'm happy to treat games sent to me as confidential. (I'd need the full game, since I'd want to see if there are other data files that are causing this problem.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Twain
Newbie
Posts: 7
Joined: Fri Aug 12, 2016 4:24 am
Contact:

Re: How to reduce loading times?

#7 Post by Twain »

That's fine and certainly more than I could ever hope for when starting this thread. I sent you a pm with a link to the full game. Thanks again.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: How to reduce loading times?

#8 Post by PyTom »

Try hitting "Force recompile" in the launcher. That sped things up quite a bit for me. It still takes ~5 seconds, but most of that is just pulling things off disk.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Twain
Newbie
Posts: 7
Joined: Fri Aug 12, 2016 4:24 am
Contact:

Re: How to reduce loading times?

#9 Post by Twain »

Thanks for taking the time to give it a look. I'm sorry to say I was dumb enough to forget the files I sent you weren't made in the latest version of Renpy so I think the first time you tried to load it, it was unnecessarily slow and the forced recompile simply set things straight again. I didn't experience a faster loading time neither after a forced recompile(with the older Renpy version), nor after updating to the latest version of Renpy and doing another forced recompile. The opposite actually. The older Renpy version seems to be faster at loading. But those five seconds you mentioned are looking awfully good, so I'm guessing it's time for me to start thinking about getting some better hardware.

Post Reply

Who is online

Users browsing this forum: Google [Bot]