[Closed] Graphic glitches since updating to 8.1
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.
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.
[Closed] Graphic glitches since updating to 8.1
Sorry for the double post, I think I put this question in the wrong part of the forum. Anyway, trying my luck in the 'Questions' thread.
I have updated Ren'py to 8.1.1 (from 8.0.1 previously) and I have run into graphical glitches that didn't use to happen before in my game, not changing any of the code.
First, when opening or reloading the game, sometimes all buttons on screen have a black mark where the text should be. Hovering with the mouse over the buttons removes the black marks, and they don't come back until a later restart/reload (I doesn't happen on every restart/reload either, it's pretty random).
Going to the console, I see a bunch of new 'Leaking texture' messages show up, which I assume are related:
Second and maybe related issue: I use a version of the ProportionalScale class to resize pictures at init to the game's resolution, which are then used as backgrounds. After updating to 8.1.1, the first background picture displayed after starting the game (summoned with 'show') is not actually resized to the current resolution, but all other pictures shown afterwards seem to resize normally. While the first background picture does not show at the right size, going full screen then back to window mode solves the problem and the picture is then shown proportionally.
I never had these glitches before so I don't really know where to start to fix them. It never happened previously in 8.0.1 (in fact I have it still installed, and going back to that version everything works fine).
The game UI uses an edited version of a legacy theme (crayon), if that means anything.
Thank you for your insights.
I have updated Ren'py to 8.1.1 (from 8.0.1 previously) and I have run into graphical glitches that didn't use to happen before in my game, not changing any of the code.
First, when opening or reloading the game, sometimes all buttons on screen have a black mark where the text should be. Hovering with the mouse over the buttons removes the black marks, and they don't come back until a later restart/reload (I doesn't happen on every restart/reload either, it's pretty random).
Going to the console, I see a bunch of new 'Leaking texture' messages show up, which I assume are related:
Second and maybe related issue: I use a version of the ProportionalScale class to resize pictures at init to the game's resolution, which are then used as backgrounds. After updating to 8.1.1, the first background picture displayed after starting the game (summoned with 'show') is not actually resized to the current resolution, but all other pictures shown afterwards seem to resize normally. While the first background picture does not show at the right size, going full screen then back to window mode solves the problem and the picture is then shown proportionally.
I never had these glitches before so I don't really know where to start to fix them. It never happened previously in 8.0.1 (in fact I have it still installed, and going back to that version everything works fine).
The game UI uses an edited version of a legacy theme (crayon), if that means anything.
Thank you for your insights.
Last edited by goldo on Fri Mar 08, 2024 10:17 am, edited 1 time in total.
- 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: Graphic glitches since updating to 8.1
That class is using undocumented internal functions, and so it's possible something has changed to make it stop working. I'd suggest not using it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Graphic glitches since updating to 8.1
Thank you. For the record, I have updated to 8.1.2 and will report if the glitches are still there.
Re: Graphic glitches since updating to 8.1
Just to report that I have the same glitches with 8.1.2.
I guess I understand ProportionalScale() might be out of order, but unless I'm mistaken that doesn't explain the behavior of plain textbuttons turning black (which do not use the ProportionalScale class).
I guess I understand ProportionalScale() might be out of order, but unless I'm mistaken that doesn't explain the behavior of plain textbuttons turning black (which do not use the ProportionalScale class).
- 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: Graphic glitches since updating to 8.1
Does it happen in games without ProportionalScale? Once the internal state is corrupted, anything can go.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Graphic glitches since updating to 8.1
Unfortunately, I don't have other complex games available to compare.
For the record, here is the full code for the ProportionalScale class I am using. If anyone knows a fix, I would welcome it.
Thank you!
For the record, here is the full code for the ProportionalScale class I am using. If anyone knows a fix, I would welcome it.
Code: Select all
class ProportionalScale(im.ImageBase):
'''Resizes a renpy image to fit into the specified width and height.
The aspect ratio of the image will be conserved.'''
def __init__(self, imgname, maxwidth=None, maxheight=None, bilinear=True, **properties):
img = im.image(imgname)
super(ProportionalScale, self).__init__(img, maxwidth, maxheight, bilinear, **properties)
self.imgname = imgname # Stores relative path from the 'game/' folder
self.image = img
if maxwidth: # Set maxwidth as None to ignore
self.maxwidth = int(maxwidth)
else:
self.maxwidth = config.screen_width
if maxheight: # Set maxheight as None to ignore
self.maxheight = int(maxheight)
else:
self.maxheight = config.screen_height
self.bilinear = bilinear
def load(self):
#<Chris12 NotFound>
# Loads a neutral image instead of failing, in case an image does not exist
try :
child = im.cache.get(self.image)
except IOError :
# renpy.notify("Missing: " + self.imgname) # Commented out because it causes bugs in the CG gallery. Requires investigation
child = im.cache.get(Image("backgrounds/not_found.webp"))
#</Chris12 NotFound>
width, height = child.get_size()
ratio = min(self.maxwidth/float(width), self.maxheight/float(height))
width = ratio * width
height = ratio * height
if self.bilinear:
try:
renpy.display.render.blit_lock.acquire()
rv = renpy.display.scale.smoothscale(child, (width, height))
finally:
renpy.display.render.blit_lock.release()
else:
try:
renpy.display.render.blit_lock.acquire()
rv = renpy.display.pgrender.transform_scale(child, (newwidth, newheight))
finally:
renpy.display.render.blit_lock.release()
return rv
def predict_files(self):
return self.image.predict_files()
Re: Graphic glitches since updating to 8.1
Sorry to necro this thread, but I finally found the culprit, it's this function:
I didn't write it, so I'm not sure what's wrong with it. This is called on the 'Home' screen to predict a gallery of portraits and profile pictures.
Code: Select all
#<PredictImages>
# Threading is necessary, because otherwise the screen only shows AFTER ALL images have been loaded.
# That would actually make things slower. With threading, the images load in the background as intended.
def predict_images(girls, predict_portraits = True, predict_profiles = True):
def predict_images_helper():
try:
# Predict all portraits first since they are needed immediately.
for girl in girls:
if predict_portraits and girl.portrait is not None : renpy.predict(girl.portrait.get(side=True))
# After that, begin loading the profile images
for girl in girls:
if predict_profiles and girl.profile is not None : renpy.predict(girl.profile.get(profile=True))
except: pass
if girls is not None and len(girls) > 0:
t = threading.Thread(target=predict_images_helper)
t.daemon = True
t.start()
- 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: Graphic glitches since updating to 8.1
This is simply bad - with very few exceptions, Ren'Py functions can't be called outside of the main thread. (IIRC, renpy.queue_event is the only one, and you can also update data in the store.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Graphic glitches since updating to 8.1
Thanks, I have removed it from my game and will let the creator know if I can get a hold of him.
Who is online
Users browsing this forum: GetOutOfMyLab