How to increase memory usage (ren'py project lags sometimes)

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
Sunkra
Regular
Posts: 36
Joined: Tue Oct 31, 2017 8:15 pm
Projects: Aeterna
Contact:

How to increase memory usage (ren'py project lags sometimes)

#1 Post by Sunkra »

Hello everyone.

In rare occasions where I have multiple ATL puppets (characters) in the scene or load a lot of them at the same time, the game will lag for a moment before loading all the desired puppets at once whilst ignoring any transition effects like dissolve.

I read about increasing the game's file cache with the following line:
define config.image_cache_size = X
The standard value given in the documentation for X is 8, I've increased this number to 100, 500 and even 1000, all without improvement to loading smoothness of my ATL art assets. I've injected this line of code into the options.rpy since no documentation I found specified which file it should be inserted into.

Any ideas for solutions? Forcibly increasing memory allocation to my project might help too, though I wouldn't know how.

My Ren'py project has a resolution of 1920 x 1080 and puppets have a resolution of 1080 x 500. Each puppet consists of multiple layers (body, clothes, faces, eyes, hair, etc.).

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: How to increase memory usage (ren'py project lags sometimes)

#2 Post by Remix »

First suggestion would be to add a

renpy.free_memory()
renpy.start_predict_screen( 'screen_name' )
a bit before the screen is shown. Remember to stop_predict_screen afterwards

If not using screens for them, the renpy.start_predict( *displayables ) might help, though it runs on every interact until told not to.

Also see:
renpy.get_image_load_log
renpy.profile_memory
renpy.profile_screen
(some may be Ren'py 6.99.13 or even 6.99.14)
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: No registered users