Stange animation artifact

Started by
3 comments, last by Zippery 10 years, 10 months ago

All I wasn't sure which forum to place this in as it's quite an odd question. My 2d platformer has an odd problem but I'm not sure it's a real problem as such. I'll try to explain as best I can. When my character jumps into the side of a platform, and then on top of it, it looks, momentarily like there is a 'glitch' in the animation. Thing is, if I put a thread.sleep in to slow the game down, I can't see any such glitch. If I video it and plat it back, again I can't seem to see anything. Has anyone come across something like this before? Could it be an issue bought about by my frame rate? Sorry it's so vague but I'm not sure how else to explain it. It's not a deal-breaker but it is extrememly annoying. Any thoughts would be welcome. Thanks.

Advertisement

Clearly it's caused by gamma rays interacting adversely with the silicon of your CPU.

You're right about the question being vague, though. I doubt even John Carmack could answer this one with such little information, and he's pretty good at programming and stuff. This is likely one of those things that you're just going to have to bite the bullet and figure out for yourself, since you are the one with a) knowledge of the context of the program, b) knowledge of the conditions within which the bug occurs and how to reproduce it and c) access to the source code so you can do some debugging and logging.

I'd say, though, that it might be helpful if you could dump a full set of logging info from your animation system on command. Maybe set a hotkey to enable/disable so that you're not generating multiple megabytes of non-helpful data. Enable logging, do a jump and try to repro the bug, then check your logs and see if you can figure out what state changes are occurring that shouldn't be. Try to log as much as you can regarding animation state; the more information you can collect the better.

Clearly it's caused by gamma rays interacting adversely with the silicon of your CPU.

laugh.png

It's been a long day - that made me laugh - much needed!!

Yeah sorry, I know it's a really vague question. The problem is I can't post a video of it as the problem doesn't seem to be visible in the video when it's been recorded - even though I can see it clearly with my eyes (on the actual device it's running on) wacko.png

I'm gonna do as you suggest and try to log out which animation frames are showing and when... might give me some insight into what's happening.

Cheers!

Yeah sorry, I know it's a really vague question. The problem is I can't post a video of it as the problem doesn't seem to be visible in the video when it's been recorded - even though I can see it clearly with my eyes (on the actual device it's running on)

If you're using third-party video capture (rather than dumping frames yourself from in-game) then it is highly likely that the capture will indeed miss a single-frame glitch in your animation. The awful part, too, is that if you start dumping video yourself, then the increased processing load could throw off timing and cause the problem to disappear; I've had issues like that before.
Got it sorted after looking at my code for the last 3 hours, my collision detection routine was flagging my sprite as being on a platform (which strictly speaking it was) for a split second while it was touching the side of the platform and moving towards it while also jumping - as soon as it reached a certain point it kicked off the animation briefly before stopping it again as the sprite flew above the platform. It was this that I was seeing - I hadn't put a check in to disable animation at that point if the sprite was in an upward jump motion.

Cheers! biggrin.png

This topic is closed to new replies.

Advertisement