Sprite Position Bug -- Are other creators seeing this?

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.
Message
Author
User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Sprite Position Bug -- Are other creators seeing this?

#1 Post by Rosstin »

I don't know why no one is discussing this, because it's killing multiple projects I'm working on that don't even share code. This is definitely a serious engine bug.

We've had this bug forever in Queen... if the player skips animations in any way, by clicking quickly, by scrolling backwards and forwards, some of the game sprites get placed in a 'default' position. IE, the character is placed in the center of the screen, on top of the bottom of the screen.

After a lot of careful testing I am 99% sure this is a bug in the Renpy engine. I wish I could isolate this bug further but it's not 100% consistent to repro. It happens frequently enough to be BAD, though.

This looks fine for a lot of games, to the extent that I think our team is one of the few teams that has noticed this bug. But I've heard about it affecting other games as well. (Even if you don't have full-body sprites like we do, it can be annoying to see your characters appearing in the center of the screen if you wanted them on the left or right.) Basically for any game that has more than one character on-screen at once, this will cause problems.

We're releasing on Steam very soon and I really want to fix this embarrassing bug once and for all.

If anyone has a suggestion to fix this other than "cut off the characters feet" I'd really appreciate it. I really don't to ship to Steam with this bug in the game if I can possibly kill it.

Image
Image

User avatar
78909087
Veteran
Posts: 277
Joined: Sat Aug 16, 2014 2:33 pm
Completed: Dungeons and Don't Do It, Wake Up
Projects: Lethe
IRC Nick: Pacermist
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#2 Post by 78909087 »

Bump, because I've noticed this bug in a lot of games- even completed ones- using Ren'py.

I assumed it was unavoidable (and due to impatience most people wouldn't have in a game) but if there's a fix, I'm totally behind finding out what's up.

So you're not crazy, and neither am I. Sweet.
I am not friends with the sun.
Image

User avatar
ketskari
Veteran
Posts: 296
Joined: Tue Dec 21, 2010 6:22 pm
Completed: Asher, Sunrise, Tell a Demon
Projects: Asher Remake, TEoA
Organization: Sun Labyrinth
Tumblr: sunlabyrinth
Deviantart: sunlabyrinth
itch: sunlabyrinth
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#3 Post by ketskari »

I get this when I move sprites with ATL. If the player skips, it will skip the ATL. So I usually do something like this:

Code: Select all

##Sprite's entry position
show mark at markscn1_01
mark "I've arrived in the scene."

##The animated position
show mark at markscn1_02
mark "I'm moving."

##The sprite in the final position
show mark at markscn1_03
mark "Now here's my final pose so that if the player skips the animation, I'll still end up where I'm supposed to be."
And those transforms look something like this:

Code: Select all

transform markscn1_01:
    zoom 1.0
    xalign .35 yalign 0.0

transform markscn1_02:
    parallel:
        zoom 1.0
        linear 1.0 zoom 1.2
    parallel:
        xalign .35 yalign 0.0
        linear 1.0 xalign .5 yalign 0.0

transform markscn1_03:
    zoom 1.2
    xalign .5 yalign 0.0
I just wrote this quickly from memory so there might be errors, but I find that having a transform for the sprite's final position after animation solves the problem of skipping disrupting the sprite's location.

(Of course, if you're doing something more like "show sprite at left with move" or something, then I have no idea.)

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#4 Post by Rosstin »

Thank you for the code snippet. We need to isolate this and bring it to the attention of Pytom. It's making my games look unprofessional and I can't live with that...

I want to give Pytom a small project file where we demonstrate the bug, and he can reproduce it.
Image

User avatar
Laiska
Veteran
Posts: 323
Joined: Sat Jan 11, 2014 1:14 am
Completed: Queen At Arms, Cerulean, The Shadows That Run Alongside Our Car, Vicarwissen
Projects: Caramel Mokaccino
Tumblr: minesweeperaddict
Deviantart: koyoba
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#5 Post by Laiska »

Just to add on my two bits I believe this to be a fairly recent problem—I don't recall this ever happening before 6.99. We only started seeing the behavior after that first version jump and there were no changes in our sprite code.

This is something that also happened in Cerulean, our jam game made in July, wherein on skipping or backtracking sprites placed at the custom left/right positions I made would spontaneously appear at center, on top of other sprites.

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#6 Post by Rosstin »

Maybe we should just revert back to whatever came before 6.99 then. Whatever updates were brought by 6.99 aren't worth this glitch.
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#7 Post by Rosstin »

I have an idea.....

right now if I type....

Code: Select all

show eileen at floor_left with move
the glitch happens occasionally during skipping or backtracking/forwardtracking.

HOWEVER, what if I used...

Code: Select all

show eileen at floor_left with move
show eileen at floor_left
I think that we would not observe this glitch.

I can probably write some regex that will convert all of our scripts to this multiline solution.
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#8 Post by xela »

1) This is not a bug.
2) This always worked this way, reverting to version $%^&* is not useful.

This is something you can easily fix by plainly setting the displayable to it's final state (you always should know what that is if you care about it) after applying a set of ATL instructions to it that does something over time. I threw together a plain example of this issue and a short example on why we do not want it "fixed" by the devs:

Code: Select all

transform my_move():
    pos (100, 300)
    linear 5 pos (600, 300)
    
transform extra_move():
    linear 1 pos(400, 100) zoom 1.5
    
image red = Solid("F00", xysize=(50, 50))

label start:
    show red at my_move # We give control to the my_move set of instructions.
    pause # If we skip before completion
    show red at Transform(zoom=1.5) # And transfer control
    "red square remain in limbo..."
    
    "So, if we must have the Square at predetermined position for the next set of instructions, we simply:"
    show red at my_move
    pause
    show red at Transform(zoom=1.5, pos=(600, 300))
    "And it ends up in at the right place even after skipping (Fixing the Issue at hand!)..."
    
    hide red
    
    "So why the heck does Ren'Py not plainly calculate the last state for every animation and pushes it there before giving control to the next set of instructions???"
    "There are many examples, but one of the simplest:"
    show red at my_move
    "Do not wait for last position and click..."
    show red at extra_move
    "If we forced atl to completion here and player reads the text and plainly clicks for the next one, red square would have jumped before the next instruction!"
    "That would have looked silly and unprofessional as well :( ! And would have been almost impossible to fix... while the fix for the issue of this thread is obvious and simple."
    "There are other more complex examples which can show that current strategy of handing this issue is superior to forcing it to completion."
    return
Like what we're doing? Support us at:
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#9 Post by Rosstin »

Thank you, Xela, this is super helpful.

OK, so if I do this...

Code: Select all

    show red at my_move
    pause
    show red at Transform(zoom=1.5, pos=(600, 300))
Will it also fix the problem when players scroll backwards through text?

And in my code I think this would look like...

Code: Select all

show a at floor_left with move
pause
show a at floor_left
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#10 Post by Rosstin »

xela wrote:

Code: Select all

    show red at my_move
    pause
    show red at Transform(zoom=1.5, pos=(600, 300))
    "And it ends up in at the right place even after skipping (Fixing the Issue at hand!)..."
Xela, this isn't a good solution for me because the pause statement messes up text flow.

THIS solution seems to work better for me....

Code: Select all

    show solRoscoe flip behind solAilantan at leftish with dissolve
    show solRoscoe flip behind solAilantan at leftish
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#11 Post by Rosstin »

I'm trying to write some regex code to make this find and replace task easier

Code: Select all

show .* with (d|p|e|m)
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#12 Post by Rosstin »

This fix didn't work.... why? T_T

If I skip through this code I see this:

Image

Code: Select all

    "I gave him a defiant glare as he unsteadily attempted to get to his feet."
    r "{i}Fox{/i}." 
    "The Archmagus's voice was raspy, as if it was taking him extra effort to make noise."
    show r angry at floor_left_crouching with moveinbottom
    show r angry at floor_left_crouching
    voice "vox/r/R_damage_2.mp3"
    r angry "You can't get out of a lecture by attempting to paralyze my larynx, and if you didn't want to listen then you should not have bothered coming here."
    r "This matter is not the joke you seem to think it is."
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#13 Post by Rosstin »

Xela, your "pause" fix WORKS but I can't emphasize enough how much that solution will piss off and frustrate our players. It causes the game to literally pause as if there were CONTENT at that pause statement. There has to be a better way.
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#14 Post by xela »

Rosstin wrote:your "pause"
You misunderstood...

Pause is a part of an example to illustrate the problem and explain it's cause which apparently didn't work :( You are not supposed to add pauses, the solution is to set end-states after ATL instructions which are applied over time.

linear 5 pos (600, 300)

show red at Transform(zoom=1.5, pos=(600, 300)) <== There is a point in code where you can set the image to it's final state manually if player is skipping/fast-reading even if 5 seconds haven't passed! It's that simple... a plain problem with a simple solution.

This fixes the issue, there could be half a billion lines of text, other images, animations and etc. in between (instead of pause), I put pause there as a placeholder instead of that. There HAS to be a point in your game where you KNOW that the animation must run it's course, that is where you show the image of the same tag at it's end-state so there are no more issues with skipping/fast reading and etc.
Like what we're doing? Support us at:
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#15 Post by Rosstin »

Alright, I'm gonna do my best to understand this so we can fix our problem. Are you telling me that I should write custom ATL statement like that?

It's not that I don't understand what you are saying, but I have only a vague idea how to implement what you're telling me.

I still can't understand why this code doesn't work.

Code: Select all

    "The Archmagus's voice was raspy, as if it was taking him extra effort to make noise."
    show r angry at floor_left_crouching with moveinbottom
    show r angry at floor_left_crouching
    voice "vox/r/R_damage_2.mp3"
    r angry "You can't get out of a lecture by attempting to paralyze my larynx..."
Even this code doesn't work.

Code: Select all

    "The Archmagus's voice was raspy, as if it was taking him extra effort to make noise."
    show r angry at floor_left_crouching with moveinbottom
    r "..."
    show r angry at floor_left_crouching
    voice "vox/r/R_damage_2.mp3"
    r angry "You can't get out of a lecture by attempting to paralyze my larynx..."
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Ocelot