BYOND Version:512
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 73.0.3683.103
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
When multiple animations are running it appears that animations will randomly end or cause other behavior. I do not have an example of the "other" behavior but I do have an example of animations just ending briefly for no reason.

The "other" behavior is related to pixel movement. While multiple objects are animating it cause the animation to sort of stutter in a random spot in it's path then resume. What this does is move the icon back and forth in a flash think of instant teleportation but it's entirely visual as I've gotten no evidence the object is actually there.

Numbered Steps to Reproduce Problem:
I created a bar demo awhile back to demonstrate some glowing effects that lummox also took a look at. When we finally got the steps for animate to work correctly there was something else that popped up in my inspection.

I found another odd effect when it comes to triggering the flash action. You don't have to rapidly press flash but as the bars are running the update function if you press flash it will periodically jump the bars instead of keep it constant. This demo has nothing else running besides these functions so this is fairly isolated.

In order to see this in action run the demo below and hit update so that the bars are moving. As they are moving you will notice instantly the blue bar will jump to full. What's meant to happen is that the blue bar is going in reverse of the green bar so while the green fills the blue empties. You can also hit the flash procedure and it will randomly cause the bars to fill or move a bit.

Code Snippet (if applicable) to Reproduce Problem:
Here is a download link for the bar demo.

icon = 'icons/bar.dmi'

STOP = 64

color = "#F00"
screen_loc = "5,7"

color = "#0F0"
icon = 'icons/bar.dmi'
screen_loc = "5,6"

color = "#00F"
icon = 'icons/bar.dmi'
screen_loc = "5,5"

START = 64
STOP = 0

filters += filter(type="drop_shadow", x = 0,y = 0,size = 5,offset = 2,color = src.color)



matrix/M1 = new
matrix/M2 = new

M1.Scale(max(min(ceil(START * 64 / 64),64),0) / 64,1)

M2.Scale(max(min(ceil(STOP * 64 / 64),64),0) / 64,1)

animate(src,transform = M1,time = 10, loop = -1, easing = SINE_EASING)
animate(transform = M2,time = 10, loop = -1, easing = SINE_EASING)

Expected Results:
The bars should animate to full and empty smoothly at all times.

Actual Results:
The blue bar will jump to a full state. During flash the bar will also stop animating briefly then resume filling/emptying. The ulterior doesn't happen all the time however so it must be clicked a few times before it starts to do this not super quickly just every second maybe.

Does the problem occur:
Every time? Or how often? Everytime
In other games? Not sure
In other user accounts? Not sure
On other computers? Not sure

When does the problem NOT occur?
This problem doesn't seem to occur when the bars are going in the same direction. IE disable start stop under the blue bar and the animation will run smoothly.
color = "#00F"
icon = 'icons/bar.dmi'
screen_loc = "5,5"

//START = 64
//STOP = 0

The flash bugging the filling/emptying does still occur even if they are going in the same direction.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit to download old versions for testing.)

Currently there are no workarounds other then just not using animate. I did try multiple things to see if maybe I could get it work correctly primarily with messing with different flags or easing and had no luck. In fact some caused wonkier behavior then expected but that's likely a result of using flags that don't need to be enabled.

I fiddled with it a bit and it looks like it's caused by animating the filter (the snap for the blue bar, I mean). If you stop Filter() from being called, the bar works fine.

I'm unsure if this is actually a bug or just the ANIMATION_PARALLEL flag being really picky.

A workaround would be to mount the bars onto another invisible object (most likely with vis_contents) and then animate the transform on that object which will apply to the bar without interacting with its animations directly at all, allowing you to stack animations without using the ANIMATION_PARALLEL flag.

On a side note: you only need to set loop=-1 on the initial step of an animation.