[bug] displayable defined in certain way going nuts

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

[bug] displayable defined in certain way going nuts

#1 Post by SONTSE »

Hi! Wasn't here for a long time so sorry if missed thread etc.

So here is example code to replicate bug.
What I expect:
a red square bouncing down with random speed.
What I get:
until 7.3.2: exactly what I expect
since 7.3.3: square flickers like crazy

Note:
this applies to any displayable, not only Solid()s
and to any transformations not just offset, flickering appears within domain of that transformation

Code: Select all

image red_square = Solid('#f00',xysize = (100,100))

transform test_transform:
    truecenter
    yoffset 0
    choice:
        ease 1 yoffset 100
    choice:
        ease .5 yoffset 100
    ease 1 yoffset 0
    repeat

image red_square_transformed:
    'red_square'
    test_transform
    
image what_square = ConditionSwitch('True','red_square_transformed')

label main_menu:
    return
label start:
    show what_square
    'foo'
    'bar'
    'baz'
    return

drKlauz
Veteran
Posts: 239
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: [bug] displayable defined in certain way going nuts

#2 Post by drKlauz »

Can confirm bug, 7.3.5.606.

I believe problem started from this commit:
https://github.com/renpy/renpy/commit/7 ... 2d2e4739cf

renpy/display/layout.py, DynamicDisplayable class, line ~1264

Code: Select all

    def update(self, st, at):
        child, redraw = self.function(st, at, *self.args, **self.kwargs)
        child = renpy.easy.displayable(child)

        if child._duplicatable:
            child = child._duplicate(self._args)
            child._unique()

        child.visit_all(lambda c : c.per_interact())

        self.child = child

        if redraw is not None:
            renpy.display.render.redraw(self, redraw)
Quick guess is DynamicDisplayable recreate child displayable, recalculating transform state, resulting in transform taking different path every time.
If i comment child._unique() line then code in first post works, not sure how it will affect other parts tho. Overall it is really rabbit's hole i rather not jump in.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

drKlauz
Veteran
Posts: 239
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: [bug] displayable defined in certain way going nuts

#3 Post by drKlauz »

P.S.: There is already issue about this or very closely related bug on github - https://github.com/renpy/renpy/issues/2064
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

Post Reply

Who is online

Users browsing this forum: No registered users