Here’s me having a one-way chat with Jeremy as I work through animation bugs. Just a glimpse into the programmer’s mind, and the stream of consciousness Jeremy will have to endure whenever he logs back into Skype.
[5/17/2016 12:30:19 AM] Erik Walle: just found a very interesting pattern in the flight animation bug
[5/17/2016 12:30:33 AM] Erik Walle: it turns on and off on every alternating appearance of the sprite in view
[5/17/2016 7:51:08 AM] Jeremy Sachs: I vaguely recall we made the flying behavior operate on a particular set of rules.
[5/17/2016 9:59:39 AM] Erik Walle: yeah I didn’t dig into it yet
[5/17/2016 9:59:42 AM] Erik Walle: just that tidbit
[5/17/2016 9:59:58 AM] Erik Walle: will take a look tonight, this is the precursor to adding walk animation
[5/18/2016 11:44:21 PM] Erik Walle: hm.. it still frustrates me. not sure about that pattern I mentioned earlier.
[5/18/2016 11:45:42 PM] Erik Walle: The only persistent detail I notice is that it only happens after playing for a while. Everything looks fine for about 10 seconds.. then suddenly one little butterfly stops flapping, you move again and a couple more aren’t moving.. soon nothing moves.
[5/18/2016 11:52:39 PM] Erik Walle: also it seems like they carry over in animatingViews sometimes, and continue animating even when off screen.
[5/19/2016 12:00:27 AM] Erik Walle: oh hey. I see that cull is only triggered when tweens.length == 0..
[5/19/2016 12:01:03 AM] Erik Walle: would that only include movement.. or what having an animation active on the screen cause that cull not to happen
[5/19/2016 12:02:35 AM] Erik Walle: ah ha. A cull is happening, but a butterfly continues to animate offscreen..
[5/19/2016 10:38:37 PM] Erik Walle: ah ha, there are objects in the animatingViews container that have null for an id field. These are the ones that continue to repeat after leaving the screen.
[5/20/2016 9:56:55 AM] Erik Walle: I fixed it last night 🙂
[5/20/2016 9:57:55 AM] Erik Walle: I found that where you were deleting the view, when you were loading up movement tweens, you should have also been removing the viewID from the animatingViews container
[5/20/2016 9:58:13 AM] Erik Walle: but NOT a full collectView, I guess because it’s not culled yet.
[5/20/2016 9:58:27 AM] Erik Walle: Still curious if the cull will just never happen, if something is animating on the screen at all times.
[5/20/2016 11:39:40 PM] Erik Walle: dach, that wasn’t it! now they stop flying when they move onscreen.
[12:36:57 AM] Erik Walle: ok. I got it this time.
[12:37:31 AM] Erik Walle: The problem was, the view ID key was effectively changing, but the entry in animatingViews was not.
[12:38:05 AM] Erik Walle: on any move event with changing position.
[1:50:32 AM] Erik Walle: oh nooo.. now creatures aren’t landing when they’re supposed to! warg
[10:57:53 AM] Erik Walle: sweet, the flying bug was unrelated to my pixi work! I flubbed the refactor of some log.js code. All good again! BUT FOR HOW LONG