New games every week!
Flickering Blog
8th February 2017

Developments


Have you noticed any flicker on my Android games, lately!?

-=-=-

When I was creating my new framework, I saw a lot of flicker when I tried to run my games on my Archos Gamepad.
Luckily, when testing on the Razer Forge TV, the flickering seemed to more or less disappear after the first second or so.. Like it was a loading delay, or a quirk, or something.
But it remained on my Archos Gamepad.
TeamOUYA Review didn't mention any flickering, so I figured it was probably just a weird issue on my end.

And yet, the flickering continued on my Gamepad..

Yesterday I started to dig through my code, determined to find the solution to the flicker.
I double checked my double buffer code, triple checked my render code, and quadruple checked my update code.

All seemed like it was probably ok.. Or at least, without me seeing it on the Razer, or TeamOUYA complaining about it..
It was, more than likely, just me being too damn picky.
I opted to give up, not to worry about it, and try it another day.

So, instead, I sat back and relaxed, and turned to YouTube.
"Oooh," I exclaimed, "Otakupunk's reviewed his first game from this year's AGameAWeek batch!!"



.. And there it was.
The Flickering..
The same exact bloody flickering I'd spent all morning trying to track down.

...God damnit!!

So, I reopened the code, and dug a little deeper.

I spent several hours sifting through my code with a fine toothed comb.
I set up little notices in the debug output, with timestamps everywhere.
Whenever it starts a render, when it starts an update, when it finished rendering, and when it finishes updating.
Lots of complex numbers flickering across my screen at a nice and steady 60fps!
..
And I think I've found it.
.. I think.

The issue seemed to happen whenever the renderer managed to outpace the update, and it tries to draw 2 frames with the same data.
I was seeing output like so. (where U=Update, R=Render)
U R U R U U R U R U R U R R U R U R U R U U R U R U R U R R U R U R
For the most part, the two were syncopated, as they should be, but every so often one or the other would skip a beat, or more accurately, one would happen quicker than the other..
It's like the two repeats weren't quite lining up the way they should.

An odd quirk, which didn't ever seem to happen in HTML or Windows targets.. That I know of!

... Even in instances where I wasn't doing anything in my game code, and was simply drawing a single sprite in the middle of the screen, the odd tempo mismatch would still happen.
Hmmm..?

Anyway, a couple* of tweaks later, and I'm no longer finding the flicker on my Archos Gamepad, at least, so that's an improvement.
The fix required that I no longer clear out the buffer, but also that I pre-prepare the buffer in case it skips a beat.

I now need to update all four games to use the new code, which shouldn't take too long. I've also got another little tweak to throw in, but otherwise I should be able to upload new versions of the 4 games by the end of the week.
.. I hope!

*So many tweaks!! Oh so many tweaks!!!

Daily Doodle : Hello Bunny



Platdude's managed to successfully teach his rabbit how to poke it's head out of the trick hat.
Next, trying to get it to find the carrot in his sleeve.

Misc..


I finally found you.
I think that was it.
I hope that you're done, now.
Or I'll throw a fit.


-=-=-

If you'd like to stuff my mailbag, (Please do!!) you can do so right here, at https://bit.ly/AGAW_Mail. Send comments, questions, game ideas, thoughts and more, and they'll usually show up on my daily blog, the very next day.
Views 10, Upvotes 1  
Daily Blog
New games every week!
Site credits : Site built from the ground up, in php, using Programmer's Notepad 2, and a very bored Jayenkai.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - Flickering - AGameAWeek