Ren'Py Renpy games crashing on startup

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,801
The last successful step in this log is loading the script. This is early, very early.
It's in main.py:449 and following (for the 7.4.9).
And here, there's only:
  • Something that can't be done (Ren'Py do not recognize "load-test" as valid argument) ;
  • The assignation of the place where the save are located ;
  • The loading of the persistent file ;
  • The initialization of the save feature.
A new line is added it the log file at this moment, so Ren'Py don't go this far.

My guess goes for a problem with the persistent file. But why is it present for many games is something I don't understand.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
2,876
6,510
I havent been digging that deep into the Ren'Py code, but my guess was also that it may have something to do with previous saves, persistent file included, since the next step in the log should normally be about loading save slot metadata.

It's why one of my questions was about playing those games before they started failing. Good to know my guess was correct, thanks.

Shouldn't there be a line about loading save slot metadata already logged if loading of the persistent file is failing?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,801
Shouldn't there be a line about loading save slot metadata already logged if loading of the persistent file is failing?
No, the persistent file come first:
Code:
    log_clock("Loading script")

    if renpy.game.args.command == 'load-test': # @UndefinedVariable
        [...]
    [....]
    # Init preferences.
    game.persistent = renpy.persistent.init()
    [...]
    try:

        # Init save slots.
        renpy.loadsave.init()

        log_clock("Loading save slot metadata.")
But I don't really see from where it's coming, and I deeply messed with this part of the code.
If I make it deal with clear invalid persistent file and save files (raw edited the files and remove parts of them), it don't complain and start the game. Using what seen to be a new blank persistent files and ignoring the corrupted save files (they don't show up in the load page).
If I make it use variables or function that don't exist, Ren'Py catch it and warn me ; creating both "traceback.txt" and copying the traceback in log.txt.

The last point is important, because it mean that it's Python itself that crash, and not Ren'Py. And error, or whatever that Python could handle, would have thrown an exception, and Ren'Py catch them all even at this level.
So, I guess that the persistent file itself is valid. But among the data it store, there's one that don't please Python, and I mean don't please it at all.

pantherismytat
The only solution I see is to delete the "persistent file, both in "[userName]/AppData/Roaming/RenPy/[game directory]" and in "[path to the game]/game/saves".
 
  • Like
Reactions: Penfold Mole

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
Trying to play this but the fix posted on page 1 doesnt seem to work, any advice?
swap interval: 1 frames
Using GL DLL.
Windowed mode.
Vendor: 'NVIDIA Corporation'
Renderer: 'NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2'
Version: '4.6.0 NVIDIA 497.09'
Display Info: None
Why do you use outdated drivers? Latest drivers are v516.29.

In case updating your drivers won't fix the issue you have to switch your renderer. Either try to launch the game by holding Shift+g key or extract and add attached file into the game's "game" folder.
 
  • Like
Reactions: horseradish1990

samuel1154

Member
May 7, 2018
412
432
Why do you use outdated drivers? Latest drivers are v516.29.

In case updating your drivers won't fix the issue you have to switch your renderer. Either try to launch the game by holding Shift+g key or extract and add attached file into the game's "game" folder.
Just tried all this including the driver update and unfortunately still not working. When I launch the game with shift + g what renderer should I be selecting?
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
Yea none of them seem to resolve the issue not sure whats wrong, strange as the game worked on my previous GPU
Then download RenPy SDK and try to launch the game through it.

1. Create a new folder and move the game into it.
2. Download RenPy SDK and extract it into the same folder, see step 1.
( )
3. Launch RenPy SDK and make sure the game shows up on the left panel.
4. Select the game and it "launch".
 
  • Like
Reactions: 00panda

samuel1154

Member
May 7, 2018
412
432
Then download RenPy SDK and try to launch the game through it.

1. Create a new folder and move the game into it.
2. Download RenPy SDK and extract it into the same folder, see step 1.
( )
3. Launch RenPy SDK and make sure the game shows up on the left panel.
4. Select the game and it "launch".
Works fine through the SDK like that thanks, any idea as to why?
 

samuel1154

Member
May 7, 2018
412
432
RenPy being a bitch or the compiled and distributed version of the game was made with a bugged/old RenPy SDK version.
Well either way thanks for the help, If I look into it more and find the cause ill let you know incase anyone else in the thread is having issues.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,801
In case updating your drivers won't fix the issue you have to switch your renderer.
I doubt that changing the render will fix the issue.
Where Ren'Py crash is after the display initialization, therefore Ren'Py looked at the available GL API, and didn't found a reason to complain. What mean that theoretically speaking everything is GL2 ready. It' before Ren'Py start to perform its GL test, that the crash happen. And I really mean "before", it don't even reach the point where it create the object that will perform the test.

I don't know what is the issue, but it's not the usual "card to old for GL2".
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
I doubt that changing the render will fix the issue.
Where Ren'Py crash is after the display initialization, therefore Ren'Py looked at the available GL API, and didn't found a reason to complain. What mean that theoretically speaking everything is GL2 ready. It' before Ren'Py start to perform its GL test, that the crash happen. And I really mean "before", it don't even reach the point where it create the object that will perform the test.

I don't know what is the issue, but it's not the usual "card to old for GL2".
The game was compiled with RenPy 7.4.0, which we know had many bugs. Maybe that was the issue. :unsure:
 
Last edited:

00panda

New Member
Jun 11, 2019
3
2
Then download RenPy SDK and try to launch the game through it.

1. Create a new folder and move the game into it.
2. Download RenPy SDK and extract it into the same folder, see step 1.
( )
3. Launch RenPy SDK and make sure the game shows up on the left panel.
4. Select the game and it "launch".
Thanks so much, this help with my windows 7 hp notebook,
 
  • Like
Reactions: cold_arctus

spoobg

New Member
Jun 3, 2018
12
3
Hello,

from a few days, like 2-3 for some reason most of the renpy games started to crash either at start up or after few steps into the game itself.

The last thing I remember installing was the latest nVidia drivers, can't remember anything else new to be installed lately.

Errors are all kind of, most of the time always different ones, here is one for example:

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 100, in script
    menu:
AttributeError: 'list' object has no attribute 'display_reset'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 100, in script
    menu:
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\ast.py", line 1903, in execute
    choice = renpy.exports.menu(choices, self.set, args, kwargs, item_arguments)
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\exports.py", line 1010, in menu
    rv = renpy.store.menu(new_items)
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\exports.py", line 1250, in display_menu
    rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\display\core.py", line 3377, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
  File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\display\core.py", line 3887, in interact_core
    if renpy.display.draw.update(force=self.display_reset):
AttributeError: 'list' object has no attribute 'display_reset'

Windows-10-10.0.22621 AMD64
Ren'Py 8.0.3.22090809
HeroineAdventures2 Release 14
Sun Apr 16 19:43:52 2023
I have installed latest Ren'Py but that did not solved the problem.

Could this new graphic driver somehow screw up renpy? Any tips and ideas how to try fix the problem? Maybe like return the previous graphic drivers?

Thanks in advance

P.S. I just switched to the previous graphic driver, nothing changed. Again errors and crashes in almost every single game. Another errors:

"AttributeError: 'renpy.gl2.gl2draw.GL2Draw' object has no attribute 'renpy'"

"While running game code:
TypeError: 'bool' object is not callable"

I tried to play on another win 11 separate SSD, same results. Tried on a 3rd SSD with a win 10, there I could play 1-2 mins and then starting to get again same all kind of errors...
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,801
Errors are all kind of, most of the time always different ones, here is one for example:

Code:
[...]
 File "E:\_________NEW\___NEW\HeroineAdventures2_v14-pc-002\HeroineAdventures2-pc\renpy\display\core.py", line 3887, in interact_core
    if renpy.display.draw.update(force=self.display_reset):
AttributeError: 'list' object has no attribute 'display_reset'
Wow o_O

Let's be clear, self that suddenly pass from a totally legit Interface object, to a list, is a really big mess and it have absolutely nothing to do with the GPU drivers.
It can only happen if there's an assignation, and this assignation can only be right before the line that throw the error, since the code:
Python:
                if renpy.game.preferences.fullscreen != self.fullscreen:
                    renpy.display.draw.resize()

                # Ask if the game has changed size.
                if renpy.display.draw.update(force=self.display_reset):
                    needs_redraw = True
Therefore, self was still an Interface object two lines before.


I have installed latest Ren'Py but that did not solved the problem.
Using another version that the one for which the game have been developed exceptionally solve the problems, and more often create a tons of new problems.


P.S. I just switched to the previous graphic driver, nothing changed. Again errors and crashes in almost every single game. Another errors:

"AttributeError: 'renpy.gl2.gl2draw.GL2Draw' object has no attribute 'renpy'"

"While running game code:
TypeError: 'bool' object is not callable"
What the fucking fuck. The last error I get it, and it can be a typo or assignation error coming directly from the dev.
But the first one, it can't happen, at no time GL2Draw objects refer to an attribute that would be named "renpy", and at no time it could need to do it.


I don't know what cause this, but over the three errors you shown, two are absurd and should never happen. It's like Python is on drugs and hallucinating.
 

spoobg

New Member
Jun 3, 2018
12
3
Well, personally I really got no idea what happened. I was playing renpy games for years w/o any problems at all and then suddenly before few days this crashing with like 99% of renpy games started from nowhere.

I am using 13900K, 32GB of DDR5 RAM, 3090 video card, CPU and video are custom water cooled. What also confuses me a lot is that this problem exists on three different OS, two of which win 10 and 11 are just clean installs for benchmark and OC purposes.

These crashes does not seems like OC related cause they are happening with all hardware at stock settings and when I OC CPU/GPU/RAM.

Any suggestions and ideas how this can be fixed are much appreciated.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,801
I am using 13900K, 32GB of DDR5 RAM, 3090 video card, CPU and video are custom water cooled.
Your configuration, as well as the OSes, don't matters here.

As I implied, Python is seeing things that don't exist, and it can't be due to the hardware. Even failing RAM have really low chances to lead to such concrete behavior. Python would more surely crash silently that changing a type value or searching for attributes that aren't requested. Plus you would have noticed a problem with all software, not just Ren'Py.
Same for a virus. It corrupting the files in such way that they stay valid Python code is not impossible, but it need to be a virus specifically designed for this. This imply dedication from its author, for a result near to null ; there's no real interest in spending a month or more writing a virus that will only mess with Python users, when a week is enough to write one that would mess with thousand times more peoples.

Would it happen with only one game, I would point to the dev, who would then have tried to tweak Ren'Py by messing with the source of its core. But you say that it happen with all games :/
Also, the traceback you shown is correct. The line number where the error happen is the correct line number, so unless the self assignation have been put in the blank line, the code haven't been changed. And, like I implied, then Python should have failed three lines earlier.
It's also not a version conflict. While this particular line appear recently, the display_reset attribute were already present in the version 6.99.12, therefore in 95% of the games available here. A conflict version could still need to some errors, but not this one.

It's surely not something unsolvable but, unless someone have a better idea, not solvable like that through a forum discussion. It need an in depth investigation that can't really be remotely done.