Jump to content
IGNORED

Best practices for flicker mitigation in CVBasic?


Recommended Posts

Anything that I spout off here is uneducated conjecture.  So, forgive me in advance.

 

What I think I understand is that we technically have 64 16x16 sprites.  8 of which can be visible on screen.  The first 4 have highest priority.

 

How do you mitigate flicker when more than 4 sprites are on the same horizontal line?

 

My only thought would be to rotate the 8 visible sprites such that each object gets to be sprite 0 every 8 frames.

Link to comment
Share on other sites

1 hour ago, Gemintronic said:

Anything that I spout off here is uneducated conjecture.  So, forgive me in advance.

 

What I think I understand is that we technically have 64 16x16 sprites.  8 of which can be visible on screen.  The first 4 have highest priority.

 

How do you mitigate flicker when more than 4 sprites are on the same horizontal line?

 

My only thought would be to rotate the 8 visible sprites such that each object gets to be sprite 0 every 8 frames.

I have not looked closely at CVBasic yet; however, the chip is capable of 32 sprites on screen.  The TI is limited to 28.

Sprite rotation is the solution, however, designing the game to limit horizontal sprite alignment is the best method.  I know, that is limiting.

 

On the TI, I use "tiles" in place of sprites when possible.  or even overlap them.  

Example: Kickman 

You have 8 ballons on a row.  But they only need to be a sprite when they drop.

 

 

  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, 1980gamer said:

I have not looked closely at CVBasic yet; however, the chip is capable of 32 sprites on screen.  The TI is limited to 28.

Sprite rotation is the solution, however, designing the game to limit horizontal sprite alignment is the best method.  I know, that is limiting.

 

On the TI, I use "tiles" in place of sprites when possible.  or even overlap them.  

Example: Kickman 

You have 8 ballons on a row.  But they only need to be a sprite when they drop

 

Yeah, that was another idea percolating in my head.  Have four active sprites that become tiles every 8 pixels.  Very sneaky :)

  • Like 1
Link to comment
Share on other sites

Data sheet: https://peacockmedia.software/tms/TMS9918datasheet.pdf

 

There's a flag - Fifth Sprite Flag (5S) - that tells you if there's more than 4 sprites on a row. Could be useful.

 

More conjecture... I haven't used this either... I've only either ignored it in "fast" cases, or I've made sure only a few sprites are on the same row, by design. Anyway, personally, I'd cycle just a few of the sprites. For example, I'd keep sprites 0-2 or whatever as key sprites (player, main enemy, bullet, etc.), and cycle the remaining sprites (secondary enemies, extra colors, etc.) either all the time, or only depending on whether the sprites are vertically close to each other.

  • Thanks 1
Link to comment
Share on other sites

9 minutes ago, 5-11under said:

Data sheet: https://peacockmedia.software/tms/TMS9918datasheet.pdf

 

There's a flag - Fifth Sprite Flag (5S) - that tells you if there's more than 4 sprites on a row. Could be useful.

 

More conjecture... I haven't used this either... I've only either ignored it in "fast" cases, or I've made sure only a few sprites are on the same row, by design. Anyway, personally, I'd cycle just a few of the sprites. For example, I'd keep sprites 0-2 or whatever as key sprites (player, main enemy, bullet, etc.), and cycle the remaining sprites (secondary enemies, extra colors, etc.) either all the time, or only depending on whether the sprites are vertically close to each other.

5th sprite flag, good call.

Also, the lower the number sprite. the higher display priority it has.  That is, if you always want to see "pacman" make it sprite 0 and the ghosts 1-4.

 

Another trick I have tried, but I forget if it worked. (age) is to make sprites that don't impact the others if you know they will be on the same row.

I will have to try this again.    What I mean is something like this.

Sprite 1      Sprite 2

00011000  00000000

00000000  00011000

00100100  00000000

00000000  00100100

01000010  00000000

00000000  01000010

00011000  00000000

00000000  00011000

 

In theory, you could put 8 of these on a row.

These are 8x8   it is hard to make things look good, maybe why I forgot about it.

 

 

  • Like 2
Link to comment
Share on other sites

I tried it with space_attack.bas and it worked wonderfully!  You have to shoot things while EVERY enemy is close to see anything resembling flicker.

 

@nanochess What is the recommended maximum amount of sprites while using the new cvbasic_epilogue?  Seems like 9 or 10 on the same horizontal line hardly flicker at all.

 

noflicker.thumb.png.db9a815cfcb80099d921ebcb90475227.png

  • Like 2
Link to comment
Share on other sites

2 hours ago, Gemintronic said:

I tried it with space_attack.bas and it worked wonderfully!  You have to shoot things while EVERY enemy is close to see anything resembling flicker.

 

@nanochess What is the recommended maximum amount of sprites while using the new cvbasic_epilogue?  Seems like 9 or 10 on the same horizontal line hardly flicker at all.

 

noflicker.thumb.png.db9a815cfcb80099d921ebcb90475227.png

I would recommend to not have more than 8 sprites in the same line.

 

It helps a lot that enemies keep moving, so the brain "forgets" the flickering.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

In addition to rotating priority of your sprites another trick to reduce the impact of flickering when your game must have a lot of sprites in the same horizontal region is to cycle through colors for a sprite.  Sprites for shots, spaceships, aliens, etc are good candidates.  By not being a static color the eye is far less likely to notice when a flicker does occur.  I used this for Robotron where even without enemy sprites on the screen you already have 5 horizontal sprites when you fire sideways.

  • Like 1
Link to comment
Share on other sites

Generally i try to avoid situation where more than 4 sprites be in a row ,  but one little trick i use sometimes  , is the case you have sprites that are compounded of 2 superposed sprites (to have 2 colors sprite) , i play on sprite priority of each layer.  It means a sprite never disappear completely .  when you have multiple colored sprites , you have to take care that you have always one of the layer of each colored sprites having the first priorities.

  • Like 1
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...