MemoryError every time I start a new Renpy game on PC

Darth Vengeant

Active Member
May 6, 2020
943
1,107
I get this every single time I start a new Renpy game. Even when I get a new version of the same game, it does this the first time I start it up. (I should note I play on my PC). It never does it again after though, just that first time.

"I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
MemoryError: "

This rarely ever used to happen. Now I get it every single time for the past few months.

Anyone know why? I have 32gb of RAM, no way that has anything to do with it. Does me having 203 Renpy games data in the AppData\Roaming\RenPy folder have something to do with it?

Furthermore, some renpy games take an entire minute or more to start up, some load right up, I find that odd being as I have a decent PC and a good amount of RAM.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,046
7,393
Are you sure that depends on you, and not on the dev?

My game used to take an entire minute or even more to start, until Sam found the cause in my gallery code... Once I fixed the issue, the game started up right away. I am fairly sure that issue does not depend on you.

As for the memory error, I had an user report this issue in my game as well: At first I have suggested changing the renderer (shift + g), this usually fixes it, but in that reported case changing the renderer did not fix the issue.
I have tried making a custom 64bit version for him, and the issue was fixed.

The fact that it happens on every game, only at the start, is odd though.
Try playing a 64bit renpy game and see if the crashes occur as well.

-edit-
Also no, the amount of folders in that place should not be an issue. Even if the coding in the ren'py engine was a little off, 203 is a really small number to loop through... Especially with a modern computer.
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,823
Check dxdiag report for more information. Maybe the log file gives you more information about the problem.

Worst case is a broken RAM that cause the problem. Run Memory Diagnostic tool to be sure.
 

Darth Vengeant

Active Member
May 6, 2020
943
1,107
Are you sure that depends on you, and not on the dev?

My game used to take an entire minute or even more to start, until Sam found the cause in my gallery code... Once I fixed the issue, the game started up right away. I am fairly sure that issue does not depend on you.

As for the memory error, I had an user report this issue in my game as well: At first I have suggested changing the renderer (shift + g), this usually fixes it, but in that reported case changing the renderer did not fix the issue.
I have tried making a custom 64bit version for him, and the issue was fixed.

The fact that it happens on every game, only at the start, is odd though.
Try playing a 64bit renpy game and see if the crashes occur as well.

-edit-
Also no, the amount of folders in that place should not be an issue. Even if the coding in the ren'py engine was a little off, 203 is a really small number to loop through... Especially with a modern computer.
When I play renpy games I always choose the normal exe if available, not the 32.exe. I always assumed that the one without 32 means 64 bit., so I pick that one. Also, my games don't "install", just run from the exe.

Check dxdiag report for more information. Maybe the log file gives you more information about the problem.

Worst case is a broken RAM that cause the problem. Run Memory Diagnostic tool to be sure.
Dxdiag came up fine. No Errors Found on anything.

Memory Test came back fine. The Windows Memory Diagnostic tested the computer's memory and detected no errors.

My PC isn't THAT old, only 5 years. Running Windows 10 and 32gb of RAM.
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,823
When I play renpy games I always choose the normal exe if available, not the 32.exe. I always assumed that the one without 32 means 64 bit., so I pick that one. Also, my games don't "install", just run from the exe.
Ah... you are one of the guys who can't play RenPy games made with the newer RenPy v7.4.x.

Here is what you can try:

Download the latest available version of RenPy SDK (v7.4.6) and place it in the same directory where you store all your RenPy games.

Run RenPy SDK and select the "broken" game from the left side and try to launch it. If the game won't launch, try to recompile and build a new game for Windows platform.

P.s. What is your GPU vendor/model name and current driver number?
 

smut

Member
Jul 21, 2017
189
121
Probably not the same issue but RenPy games are crashing either on launch or a few minutes into running for me after I installed the new NVidia driver.
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,823
Probably not the same issue but RenPy games are crashing either on launch or a few minutes into running for me after I installed the new NVidia driver.
Try to launch the game holding shift+g or download and launch the game through RenPy SDK.
 
  • Like
Reactions: smut

smut

Member
Jul 21, 2017
189
121
OpenGL worked, thanks. It reduces the refresh rate on both my monitors while running though, but that's tolerable until there's a driver fix (I hope).
 

Darth Vengeant

Active Member
May 6, 2020
943
1,107
Ah... you are one of the guys who can't play RenPy games made with the newer RenPy v7.4.x.

Here is what you can try:

Download the latest available version of RenPy SDK (v7.4.6) and place it in the same directory where you store all your RenPy games.

Run RenPy SDK and select the "broken" game from the left side and try to launch it. If the game won't launch, try to recompile and build a new game for Windows platform.

P.s. What is your GPU vendor/model name and current driver number?
I never said the game wont run. I said in my OP that the first time I load a new game up game update version it crashes with that memory error. It loads after that first initial time. Some games also take a long time to load. But, games load and play. I have only ever had one game that wont load.

I have many places I stop Renpy games, quite a few folders. So, I dont' know what you mean by the directory. The place the PC stores all renpy game data, or where I download them and keep them all? You said place the RenPy v7.4.x. in there, but do you mean the RenPy v7.4.x.exe or one of the other versions?
 
Last edited:

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,823
I have many places I stop Renpy games, quite a few folders. So, I dont' know what you mean by the directory. The place the PC stores all renpy game data, or where I download them and keep them all? You said place the RenPy v7.4.x. in there, but do you mean the RenPy v7.4.x.exe or one of the other versions?
For SDK to find your RenPy games it would be easier to have all RenPy games stored in the same folder (eg. "RenpyGames"). Otherwise you will have to tell SDK the directory of a game manually for each game.

Eg. in "RenpyGames" folder all your Renpy games are stored. There you also should extract RenPy SDK. See my screenshot as example:
1624978785574.png
As you can see RenPy SDK is stored in the same folder where I keep all my Renpy games ("Home/Download/Games").

1624979122854.png
Putting SDK in the same directory as your other RenPy games has the advantage that all games will show up on the left panel. Or will have to change the path to a game each time under preferences.