Jump to content
IGNORED

flickering sprites - is there more than one way to do this?


Recommended Posts

When multiple sprites need to appear on the same row, a common technique is to flicker between them. In professional games it usually looks OK, if a bit ghostly, but whenever I've tried it the results look pretty bad. Is there more to it than just drawing different sprites on alternating frames? Maybe it's a question of my color choices and contrast, or my emulator settings? If using a 2 line kernel, do I need to offset the sprites by 1 scan line every second time they're drawn? Any other best practices for this technique?

Link to comment
Share on other sites

When I tried my flicker test on a real Atari and TV, it looked especially bad. Instead of the two sprites looking ghostly, they looked solid but were cut-through with alternating blank lines. I assume this is an interaction between a 2 line kernel and a 480i display. One of the sprites ends up appearing only on the even lines, and the other sprite only on the odd lines. If the TV could display 240p instead of 480i, it might look better.

Link to comment
Share on other sites

Here's an example of what I'm seeing. Please ignore everything except these two circled objects in the lower-left corner. The code is drawing these two objects on alternate frames, so each one is drawn 50 percent of the time.

 

colors3(5).a26

 

flicker-test.thumb.png.7b3ef2215baf1173a2b8924317745ddb.png

What I'd expect to see:

 

Both objects appear 50 percent translucent since they're only drawn half the time. But the effect is stable, with no stuttering or strobing or irregularity. The objects look completely filled, with no gaps or missing lines.

 

What I actually see:

 

Javatari: The objects look completely filled, but there's severe strobing and stuttering, a very unpleasant look. One of the objects may look more solid than the other, and this effect will switch at irregular times.

 

Stella: Sometimes I see strobing and stuttering similar to Javatari, though not as severe. It seems to depend on what else is happening on my computer (M1 Macbook Air), and if I get a pop-up notification for new email, it makes the strobing effect worse. At other times the objects look like what I'd expect: translucent, but stable. In either case, the objects look completely filled.

 

Real Atari 2600, connected by RF cable to a TCL flat-panel LCD television: There's no strobing or stuttering, but the objects don't look filled with 50 percent transparency. Instead, they appear with alternating lines of 100 percent and 0 percent. It's like a masking effect instead of translucency. 

Link to comment
Share on other sites

16 minutes ago, bigmessowires said:

Real Atari 2600, connected by RF cable to a TCL flat-panel LCD television: There's no strobing or stuttering, but the objects don't look filled with 50 percent transparency. Instead, they appear with alternating lines of 100 percent and 0 percent. It's like a masking effect instead of translucency. 

The LCD TV is trying to be helpful... and de-interlacing the image for you, eventhough it's not interlaced.  There might be a setting that you can change to turn off image processing effects like this (something like switching it into a "game" mode).

 

But, you might be better off getting a device like the RetroTink to process and convert the signal to HDMI instead.  OR use an old CRT TV, if possible.

Link to comment
Share on other sites

14 minutes ago, bigmessowires said:

Javatari: The objects look completely filled, but there's severe strobing and stuttering, a very unpleasant look. One of the objects may look more solid than the other, and this effect will switch at irregular times.

 

Stella: Sometimes I see strobing and stuttering similar to Javatari, though not as severe. It seems to depend on what else is happening on my computer (M1 Macbook Air), and if I get a pop-up notification for new email, it makes the strobing effect worse. At other times the objects look like what I'd expect: translucent, but stable. In either case, the objects look completely filled.

 

It's very difficult to keep a consistent frame rate on a multi-tasking system so your likely to see stuttering when the computer is under load.

 

Increasing the phosphor value in the TV emulation is a good way of mitigating the problem. In Stella the setting is in the TV Effects tab of the Video & Audio Preferences window.

image.png.73549f14dd7ee1b8e88aafebd459f22d.png

 

 

 

Link to comment
Share on other sites

Thanks all! I think I understand now. Unfortunately my TV doesn't seem to have a game mode for the antenna input. I'll search out a real CRT or a line-doubler. Adjusting the phosphor settings in Stella does help some.

 

But this raises a question - is flickering considered an OK technique to use if you're designing a new game? Not flickering would obviously be better, if possible, but I thought flickering was pretty standard. If it's going to look bad in most emulators and most modern TVs, though, maybe it's best avoided like @Gemintronic says.

 

I'm not sure what the alternative to flickering is. As you can see in my screenshot, I'm building a maze exploration game with details TBD. Scattered in the maze, I plan to have a collection of stationary objects (power-ups, triggers, gates?) and moving objects (the hero and some bad guys). I can design the levels so that two stationary objects are never on the same row, and try to constrain the moving objects to separate horizontal bands too. But there will still always be some places where three or more objects can appear on the same row, and where flickering will be needed: for example if the hero and a bad guy both converge on the same power-up at the same time. 

 

I wonder if there's a perceptual effect that makes some flickering look less annoying than others. In Asteroids EVERYTHING flickers, but it doesn't really bother me, it's just how the game looks. In Jr. Pac Man the ghosts sometimes flicker and sometimes don't. Even the Jr. Pac Man himself flickers if there's a bonus item nearby. But once again, this doesn't really bother me, and I never even noticed it until I used Stella to step frame by frame. I wonder if flickering of solid-colored objects is less noticeable than flickering a multi-color bitmap, like I'm doing in my demo?

 

Link to comment
Share on other sites

There are a few common techniques for avoiding the flickering problem:

 

* Flicker mitigation - design your game so that virtual sprites avoid being on the same horizontal band

* Venetian blinds - alternate rows where virtual sprites are drawn like Video Chess

* Use other objects as sprites - the ball, missiles and playfield can be mangled into sprite-like shapes but usually takes more time

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...