[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: 95
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 8 VN's so far
Contact:

[bug] displayable defined in certain way going nuts

#1 Post by SONTSE » Thu May 07, 2020 7:53 pm

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
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)

drKlauz
Regular
Posts: 194
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

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

#2 Post by drKlauz » Fri May 08, 2020 8:30 am

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
Regular
Posts: 194
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

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

#3 Post by drKlauz » Fri May 08, 2020 8:53 am

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