Overriding an ATL transformation breaks graphics

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
wiimote
Regular
Posts: 38
Joined: Fri Dec 09, 2011 12:13 pm

Overriding an ATL transformation breaks graphics

#1 Post by wiimote »

I've read a couple of threads about this issue now, but it has never been resolved.

Code: Select all

show char:
    xalign 0.0 alpha 0.0
    linear 2.0 xalign 0.5 alpha 1.0
"Hello, character. Do another animation."
show char:
    linear 0.1 zoom 1.2
"Why are you suddenly stuck and transparent?"
Currently, code like this will cause your character to freeze in place mid-transformation somewhere near the left edge of the screen at around 0.5 alpha opacity. ... Unless the player waits and lets every transformation finish 100 percent before advancing, which frankly nobody does. (And no, hard pauses are not the answer.)
About five years ago, if I remember correctly, ATL animations used to mix nicely in Ren'Py when overlapping, but now they just override each other causing all sorts of display issues.

One obvious solution is to use the built-in transitions, perhaps even as components of a ComposeTransition() as shown here:
viewtopic.php?p=329229#p329229
But obviously I want to be much more flexible than that and use all the advantages ATL has to offer.

So, after many years, I would really like to see this crucial Ren'Py issue solved once and for all if that's possible.
Have I been using ATL wrong all this time? Are there any reasonable workarounds that involve python?

Or could this perhaps be considered a bug that may be fixed in the future?
Theoretically, all that needs to be done is to make ATL animations skip ahead to their final state before they are overridden.
From the looks of it, ComposeTransition() is already behaving just like that. So why not ATL?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Overriding an ATL transformation breaks graphics

#2 Post by Donmai »

Hm, looks like the same problem Korova faced here:
viewtopic.php?p=481869#p481869
Thankfully "someone" kindly helped him to find a solution. :lol:
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

wiimote
Regular
Posts: 38
Joined: Fri Dec 09, 2011 12:13 pm

Re: Overriding an ATL transformation breaks graphics

#3 Post by wiimote »

@Donmai: Sorry, there seems to be no relation to this issue I was pointing out.

The issue is that when two ATL transforms overlap on the same displayable, the new transform will completely cancel the old one mid-playback.
Have a slightly different example where the transforms are predefined:

Code: Select all

transform walkinfromleft:
    alpha 0.0 xaling 0.0
    linear 2.0 alpha 1.0 xalign 0.5
    on replaced:                               # not even this will help
        alpha 1.0 xalign 0.5
transform shaking:
     linear 0.04 xoffset 10
     linear 0.08 xoffset -20
     linear 0.04 xoffset 0
     repeat 3
     
show char at walkinfromleft
"I'm gonna click the left mouse button now while you're still walking."
show char at shaking
"Look at you all transparent and stuck at the left edge of the screen."
It wouldn't be that much of an issue if the "on replaced:" command worked as expected.
I think I may be fighting a code issue here that shouldn't even exist in the first place.
Maybe PyTom wants to look into this. I'd be forever thankful.

PS:
A few years back, we used to be able to freely mix animations as long as they were not using the same transform properties, which is why I am still using xoffset for my shaking animation and xalign for making a character walk. You could have a character walk around in an infinite animation loop and occasionally make it shake while walking. All of this functionality was later removed from Ren'Py and replaced with this seemingly erroneous new system. I never figured out why.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Overriding an ATL transformation breaks graphics

#4 Post by Donmai »

Yes, I really don't understand what "override" means.
You can run more than one transform at the same time using the "parallel" statement:
https://www.renpy.org/doc/html/atl.html ... -statement
or you can separate them into blocks:
https://www.renpy.org/doc/html/atl.html#block-statement
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

wiimote
Regular
Posts: 38
Joined: Fri Dec 09, 2011 12:13 pm

Re: Overriding an ATL transformation breaks graphics

#5 Post by wiimote »

Here's a video demonstration of the issue at hand.
https://webmshare.com/play/dvnbd

User avatar
Lord Hisu
Regular
Posts: 58
Joined: Sun Feb 11, 2018 2:31 am
Contact:

Re: Overriding an ATL transformation breaks graphics

#6 Post by Lord Hisu »

I don't know how to solve your problem, but I'm following this topic since I came across this not long ago and wish to know how to proceed for future reference.

wiimote
Regular
Posts: 38
Joined: Fri Dec 09, 2011 12:13 pm

Re: Overriding an ATL transformation breaks graphics

#7 Post by wiimote »

A quick update.
The animation inside the "on replaced:" block is never seen because it is applied to the image that's being hidden.
So the only workaround that comes to my mind at the moment is to use "on replace:" in the transform that's replacing the one that's currently running.
It's far from ideal and requires a lot of extra code and care, but at least this will keep the characters from getting stuck mid-animation.

Example:

Code: Select all

show char:
    xalign 0.0 alpha 0.0
    linear 2.0 xalign 0.5 alpha 1.0
"Hello, character. Do another animation."
show char:
    on show:
        linear 0.1 zoom 1.2
    on replace:
        xalign 0.5 alpha 1.0
"There you are. Centered and fully opaque."

Post Reply

Who is online

Users browsing this forum: Google [Bot]