Jump to content
IGNORED

Issue with sprite jumping in Bb


kikipdph

Recommended Posts

When, for example, a sprite jumps from y 140 to y 30, all the sprites located between y 30 and 140 flicker, including the one that jumped. This is happening in the DPC+ kernel.

So, let's say:

player3y = 140 player2y = 50 if joy0fire then player2y = 30

When someone presses the button on the joystick, player2 will jump to position 30, but all the sprites on the lines in between, as well as player2, will flicker.

Is there a simple solution for this?

Link to comment
Share on other sites

1 hour ago, kikipdph said:

When, for example, a sprite jumps from y 140 to y 30, all the sprites located between y 30 and 140 flicker, including the one that jumped. This is happening in the DPC+ kernel.

So, let's say:

player3y = 140 player2y = 50 if joy0fire then player2y = 30

When someone presses the button on the joystick, player2 will jump to position 30, but all the sprites on the lines in between, as well as player2, will flicker.

Is there a simple solution for this?

Without seeing specifics the only thing I can think of is that either the top or bottom of player2 sprite is too close to the other sprites resulting in a flicker. I cannot recall but I thought the safe space in between sprites in DPC+ is somewhere around 15 pixels. 

Link to comment
Share on other sites

1 hour ago, KevKelley said:

Without seeing specifics the only thing I can think of is that either the top or bottom of player2 sprite is too close to the other sprites resulting in a flicker. I cannot recall but I thought the safe space in between sprites in DPC+ is somewhere around 15 pixels. 

That's not the problem you're mentioning, and it doesn't flicker continuously, just once. Take a look at the example in the video.

I've noticed some other things as well. Could it possibly be related to my PC? For example, if the "gosub" isn't close to "drawscreen," the game doesn't work on the Atari, even though the emulator doesn't show any errors.

But that's a different topic. Watch the video, and when a new item appears, all the sprites skip and flicker.
In the video, due to the aspect ratio, it may not be visible every time, but in reality, every time a new item appears

 

Link to comment
Share on other sites

Recently I tried to make a scrolling pinball table and got similar flickering using the multi sprite kernel.  It's a reach but maybe related?  Use UP or DOWN on joystick to scroll the playfield and sprites.

 

My hunch is that something I am doing is triggering flicker mitigation in the kernel when virtual sprites reach a boundary.  But, my understanding of graphical kernels is very poor.

 

mysteryflicker.binmysteryflicker.zip  

 

mysteryflicker.thumb.png.47fcbb5eef372703b8f509acbedf6d3c.png

Link to comment
Share on other sites

6 hours ago, Gemintronic said:

Recently I tried to make a scrolling pinball table and got similar flickering using the multi sprite kernel.  It's a reach but maybe related?  Use UP or DOWN on joystick to scroll the playfield and sprites.

 

My hunch is that something I am doing is triggering flicker mitigation in the kernel when virtual sprites reach a boundary.  But, my understanding of graphical kernels is very poor.

 

mysteryflicker.bin 4 kB · 0 downloads mysteryflicker.zip 3.88 kB · 0 downloads   

 

mysteryflicker.thumb.png.47fcbb5eef372703b8f509acbedf6d3c.png

 It's less noticeable on a dark background.

Edited by kikipdph
  • Like 1
Link to comment
Share on other sites

Hmm. The only thing I am wondering that I would look at in my code is if is either where the placement of the repositioning of the sprite is in relationship to the drawscreen and messing with what @Gemintronicmentioned about the flicker mitigation. 
 

The only other thing I could think of is maybe skipping a frame and then reposition it to avoid any conflicts. 

Link to comment
Share on other sites

5 hours ago, KevKelley said:

Hmm. The only thing I am wondering that I would look at in my code is if is either where the placement of the repositioning of the sprite is in relationship to the drawscreen and messing with what @Gemintronicmentioned about the flicker mitigation. 
 

The only other thing I could think of is maybe skipping a frame and then reposition it to avoid any conflicts. 

 

Positioning the sprites in relation to the drawscreen doesn't help.

I haven't tried anything else.

Link to comment
Share on other sites

The sprite sorting routine in the bBasic multisprite kernel is designed to both (A) put the sprites in drawing order while also (B) trying to rotate the order of the sprites that currently overlap.  Those two disparate things are handling by a single sorting algorithm, so compromises have been made to support both.  I believe the DPC+ bBasic kernel uses the same or a similar algorithm.

 

I'm betting that, because you're moving a sprite from the very end of the sort list to the very beginning, you're trigger a case where the sorting algorithm needs a frame or two to recover.

 

The easiest way for you to workaround that would be to keep the sprites in order.  i.e.  If you remove sprite 5, put the data from 4 into 5, 3 into 4, 2 into 3, and the put your new sprite in 2.

  • Like 1
Link to comment
Share on other sites

6 hours ago, splendidnut said:

The sprite sorting routine in the bBasic multisprite kernel is designed to both (A) put the sprites in drawing order while also (B) trying to rotate the order of the sprites that currently overlap.  Those two disparate things are handling by a single sorting algorithm, so compromises have been made to support both.  I believe the DPC+ bBasic kernel uses the same or a similar algorithm.

 

I'm betting that, because you're moving a sprite from the very end of the sort list to the very beginning, you're trigger a case where the sorting algorithm needs a frame or two to recover.

 

The easiest way for you to workaround that would be to keep the sprites in order.  i.e.  If you remove sprite 5, put the data from 4 into 5, 3 into 4, 2 into 3, and the put your new sprite in 2.

 

That sounds like it might be a workaround.  Don't know if it feels good since in my mind you'd need to spend at least 5 extra vars on virtual Y coordinates and non-assembly sorting routines running every main game loop.

 

I haven't brought this up with RevEng since I'm always not %100 percent on if it's just my ugly coding.

  • Like 1
Link to comment
Share on other sites

7 hours ago, splendidnut said:

The sprite sorting routine in the bBasic multisprite kernel is designed to both (A) put the sprites in drawing order while also (B) trying to rotate the order of the sprites that currently overlap.  Those two disparate things are handling by a single sorting algorithm, so compromises have been made to support both.  I believe the DPC+ bBasic kernel uses the same or a similar algorithm.

 

I'm betting that, because you're moving a sprite from the very end of the sort list to the very beginning, you're trigger a case where the sorting algorithm needs a frame or two to recover.

 

The easiest way for you to workaround that would be to keep the sprites in order.  i.e.  If you remove sprite 5, put the data from 4 into 5, 3 into 4, 2 into 3, and the put your new sprite in 2.

The easiest way is to stop programming Atari games :)

  • Haha 1
Link to comment
Share on other sites

Ah, sorry... I missed the fact there's no flexible way to load sprite graphics.  Such as:   player2sprGfx = BirdGFX   or player2sprGfx = player1sprGfx.

 

Also, realized that it will still take a bit of time to shift all that data since it's ALL the sprite variables that need to be shifted.

 

So, it's probably best if someone takes a closer look at the kernel sorting routine to see if this could easily be remedied.

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

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...