Page 1 of 1

Layered Side Image ghosting with dissolve transform

Posted: Sun Feb 03, 2019 4:27 pm
by wyverngem
I'm using a transform to dissolve when a new side character speaks. However, it has been creating this ghosting effect where the body layer will dissolve before the rest of the layered attributes leaving the face for seconds more. Is there a way to fix this, Here's my code.

Code: Select all

define config.side_image_change_transform = change_transform
transform change_transform(old, new):
    contains:
        old
        alpha 1.0
        linear 0.3 alpha 0.0
    contains:
        new
        alpha 0.0
        linear 0.3 alpha 1.0

Code: Select all

layeredimage side nina:
    xalign 1.0 ypos 575
    always "images/chars/nina/nina_base.png"
    group eyes:
        pos (125, 113)
        attribute open default:
            "nina_eyes_open"
        attribute glance:
            "nina_eyes_glance"
        attribute sad:
            "nina_eyes_sad"
        attribute laugh:
            "nina_eyes_laugh"
        attribute bright:
            "nina_eyes_bright"
        attribute closed:
            "images/chars/nina/blink.png"
    group face:
        pos (111, 73)
        attribute normal default:
            "nina_face_normal"
        attribute calm:
            "nina_face_calm"
        attribute cry:
            "nina_face_cry"
        attribute empty:
            "nina_face_empty"
        attribute laugh:
            "nina_face_laugh"
        attribute scowl:
            "nina_face_scowl"
        attribute smile:
            "nina_face_smile"
        attribute tears:
            "nina_face_tears"   

Code: Select all

image nina_eyes_open:
    "images/chars/nina/o.png"
    choice:
        pause 4
    choice:
        pause 9
    choice:
        pause 6
    "images/chars/nina/blink.png"
    pause 0.1
    "images/chars/nina/ob.png"
    pause 0.1
    repeat

Re: Layered Side Image ghosting with dissolve transform

Posted: Sat Apr 11, 2020 3:42 pm
by Nodus Tollens
Hello! I'm having a similar issue (sorry that I'm bumping with no solution :( ), the weirdest thing being that it did work well for some time, the delay was almost nonexistent, and it started with one character. In my case, it's the appearance of a side image that has 3+ layers. There's an illusion that kind of makes the character appear 'twice', one over the other.

I had to flatten the images and just use them separately... then this disease moved to another character's side image. Body + face work fine, but any other layer and there's this ghosting effect.

I changed absolutely nothing in those layered images structure, nor in the transition, ever since it used to work fine.

I tried using LayeredImageProxy, but it doesn't flatten the copied image. It does save a lot of code though :)

What might be causing the issue? My transition is:

Code: Select all

transform change_character(old,new):
    block:
        old
        alpha 1.0
        linear 0.1 alpha 0.0
    block:
        new
        alpha 0.0
        linear 0.1 alpha 1.0
I can't remember why, but it didn't work with contain.

Re: Layered Side Image ghosting with dissolve transform

Posted: Thu Apr 30, 2020 8:32 pm
by wyverngem
I'm in the same boat still, and I think it is the transform I use too. I think that I'll just have to flatten the images and use stills instead of layers if I want to continue to use this transition effect.

Re: Layered Side Image ghosting with dissolve transform

Posted: Sat May 02, 2020 7:29 am
by Nodus Tollens
Okay so I solved it by using Flatten() to combine old and new character side images. It doesn't seem to be affecting the performance, but it's described as an expensive operation, so I guess it has to be used with caution.

[edit] so the code looks like this:

Code: Select all

transform change_character(old,new):
    block:
        Flatten(old)
        alpha 1.0
        linear 0.1 alpha 0.0
    block:
        Flatten(new)
        alpha 0.0
        linear 0.1 alpha 1.0
One more thing I'd like to know is how to make the first part of the transition conditional (if changed to e.g. 1 second, in reality it takes two, the first second dissolving a nonexistent old side image...). I guess this might be a question for another topic, but if anyone knows, could you let me know or point me to a relevant topic?
Thank you :)

Re: Layered Side Image ghosting with dissolve transform

Posted: Mon May 04, 2020 10:13 pm
by wyverngem
So I went ahead and put the Flatten in the code. It does work. There is no ghosting effects and the animation still blinks. Yet, a new issues is caused where the quality is noticeable different between the original and the face. -_- Wish I could help, but I don't really know.

Re: Layered Side Image ghosting with dissolve transform

Posted: Tue May 26, 2020 4:16 pm
by Nodus Tollens
Hm, maybe that's what was meant by "expensive"... I never noticed the loss, but I believe there might be some with larger sprites or side images. Thank you for the valuable information! I guess this thread could be marked as half-solved :D I wonder what caused this effect though, it wasn't noticeable before and I can't recall making any change that might affect it. Meh.

Re: Layered Side Image ghosting with dissolve transform

Posted: Tue May 26, 2020 6:28 pm
by Zetsubou
I ran into this problem when first implementing layered images, but I'm afraid I don't remember the exact cause.
I think it was one (or all) of these configs: side_image_change_transform, side_image_same_transform, character_callback

IIRC, I removed those and instead used
define config.say_attribute_transition = dissolve
define config.say_attribute_transition_layer = "master"
to achieve an effect similar to what I had before