Create and Fuck your AI Cum Slut -70% OFF
x

Ren'Py Ren'py coding issues.

JD-NaughtyAtticGaming

Newbie
Game Developer
Sep 16, 2024
18
219
Hello,

I'm the developer of the game Sweet Affection and I've been having this issue with the script today.
An issue that I've never ran into before.

Whenever I'm trying to make a build with Ren'py, this error pops up after a while.

You don't have permission to view the spoiler content. Log in or register now.
Yes, I know that I'm using an ancient version of Ren'py.
This is because this ren'py was heavily modified to deal with the vast amount of images and size of the game. (30+ GB)
I never ran into any issues in the past couple of years.

The image in question is fine and the game itself starts normally as well in the ren'py menu and the event plays out normally
I tried removing that image in question from the script but the error simple moves towards the next image in the script and gives the same error.

I'm really lost right now and not sure what I'm supposed to do.
And I'm hoping that perhaps one of you guys/girls know something about this.
 

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
1,871
3,459
Would probably need to show the code around that line in the traceback.

If I understand that check, I think Ren'py looks for code that loops more than a preset time interval. I've seen other games that had issues with false flags of that function and they used to bypass(?) the check.
 

JD-NaughtyAtticGaming

Newbie
Game Developer
Sep 16, 2024
18
219
Would probably need to show the code around that line in the traceback.

If I understand that check, I think Ren'py looks for code that loops more than a preset time interval. I've seen other games that had issues with false flags of that function and they used to bypass(?) the check.
Thank you for the response, here is the script in question.

You don't have permission to view the spoiler content. Log in or register now.
 

gojira667

Member
Sep 9, 2019
363
371
Thank you for the response, here is the script in question.
I've seen errors wrongly flagged before. E.G. Crying about a style when the actually error was in a different RPY file and not style related.
In that case commenting out the style usage then let Ren'Py show the underlying error.

What happens if you move Images3.rpy & Images3.rpyc out of the project and try to build? Alternatively, comment out all new image defines there since the last version.

Strange error in that it launches fine.
 

gojira667

Member
Sep 9, 2019
363
371
This is because this ren'py was heavily modified to deal with the vast amount of images and size of the game. (30+ GB)
I never ran into any issues in the past couple of years.
Heavily modified :HideThePain:, in what way?

In fact it might be the size as in it's taking too long for Ren'Py to do the build which is triggering the infinite loop. Turning Tricks' renpy.not_infinite_loop(delay seconds) might be just the thing. :unsure: Don't know if you can just put it in Images3.rpy or if it needs to go in whatever loop is run during build distributions...
 

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
1,871
3,459
Heavily modified :HideThePain:, in what way?

In fact it might be the size as in it's taking too long for Ren'Py to do the build which is triggering the infinite loop. Turning Tricks' renpy.not_infinite_loop(delay seconds) might be just the thing. :unsure: Don't know if you can just put it in Images3.rpy or if it needs to go in whatever loop is run during build distributions...
Ya, 22000+ lines of code in a single file is a bit much. Why not break those up into separate .rpy files? It doesn't matter where those image declarations go, as Ren'py will INIT them before starting the game loop.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,653
2,338
Completely (well probably) unrelated to the issues you are having...

But it is worth bearing in mind that RenPy automatically creates a displayable (an image object) for each image file in your /game/ folder and sub-folders. You are then coming along and adding a second displayable by manually adding an image statement for each image you are using.
Effectively, RenPy is keeping track of twice as many displayables than it technically needs to. It's not a huge overhead, but in the case of your game with so many images - I can't imagine it's insignificant.

Unfortunately, your game is already out there in the wild - so this isn't something you can alter in the middle of development. I mention all this as background reading if you ever work on a new game...

The auto-imported image/displayable is always lower case.
And by default will not include the folder names.

So...
"Home/SBedroom/Level11/Z-11PM-S-Lv11-Together (30).jpg"

... will be auto-imported as ...

image z-11pm-s-lv11-together (30) = "Home/SBedroom/Level11/Z-11PM-S-Lv11-Together (30).jpg"

One feature of RenPy is the way it treats spaces within a displayable identifier. Anything before the first space is the displayable's image tag (effectively a unique id). Anything after the first space is an image attribute (with each attribute separated by further spaces).
So in the example above:
Image tag = "z-11pm-s-lv11-together"
Image attributes = [ "(30)" ]

I highlight the use of spaces within image filenames because they have significance within RenPy and not in a way that the majority of RenPy developers are aware of (It pretty much dates back to when games were a mix of background images and foreground sprites).

A lot of new RenPy developers create files like ThisIsMyPicture.png, then code something like:
scene ThisIsMyPicture with fade
... and are then frustrated when the image doesn't appear. They then go and add a load of image statements to get around the perceived problem.

Except, if they'd coded:
scene thisismypicture with fade
... it would have worked fine.

Obviously it's much easier to think about if the image filenames are already lowercase.

I'm a little surprised that RenPy allows hyphens as part of the displayable name. python tends to prefer underscores, since a hyphen can often me used as a numerical "minus" operator.

I guess my point is that if you plan ahead, using lowercase filenames and underscores instead of spaces and/or hyphens - you can avoid all that manual effort of typing image statements for things RenPy will auto-import for you.

There is a tiny part of me that wonders if the infinite loop thing is tied to the tagging and attributes.
Since...

"Home/SBedroom/Level11/Z-11PM-S-Lv11-Together (30).jpg"
-and-
"Home/SBedroom/Level11/Z-11PM-S-Lv11-Together (31).jpg" , etc
... would all have the same image tag "z-11pm-s-lv11-together, just with different image attributes ( "(30)", "(31)", etc ).
I just don't see any obvious way it could be flagged as a loop. So it's probably unrelated.
 

JD-NaughtyAtticGaming

Newbie
Game Developer
Sep 16, 2024
18
219
We managed to solve it by making some modifications into the execution file. :)
The problem (I think) was quite simply the game becoming too big for Ren'py to handle.

Thank you for all the responses and help, I appreciate it. :)
 
  • Like
Reactions: osanaiko

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,338
19,779
In fact it might be the size as in it's taking too long for Ren'Py to do the build [...]
It can't since image statements are processed at init level and he said (at least in the other thread he started, and where I answered) that the error happen when the game is running.


Turning Tricks' renpy.not_infinite_loop(delay seconds) might be just the thing. :unsure:
Then there's high risk that Ren'Py would just stay stuck.
The error is tricking Ren'Py, since its cause can [n]not[/b] come from this file where there's only declaration lines. What mean that there's actually something that looks like an infinite loop, but somewhere else in the game; possibly a place that use "Z_11PM_S_Lv11_Together_29".