KevKelley Posted September 18 Share Posted September 18 I had noticed that on occasion some of the sprites (not all) disappear for one frame. I tried getting picture to demonstrate. While my game does have some flicker, I had noticed sometimes a couple sprites that have no overlap, like the Balloon Boy and the Toolbox (both copies - player4 and player5) would flicker off for one frame. I am not sure if anyone had ever noticed something like this before or if there is something I am missing that may be contributing to some disappearing.. 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted September 19 Share Posted September 19 Where is the toolbox in the first screenshot? I'm not seeing it. Can you find any pattern to where you see these sprites disappear for a frame? That may give some clue. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted September 19 Author Share Posted September 19 2 hours ago, Karl G said: Where is the toolbox in the first screenshot? I'm not seeing it. Can you find any pattern to where you see these sprites disappear for a frame? That may give some clue. I’ve been trying to find a pattern. In the two images, the boy and toolbox disappear (I think that the bird and top balloon just flickered). I know I have flicker, but I also try and keep the bottom pretty separate from each other and when the balloons go off screen or reappear I have them go above the boy and man on the sidewalk. I had noticed that the bottom sprites disappeared when all 3 balloons were on screen, so I don’t suspect it is due to them causing the sprites below to flicker. My best guess, and I will have to check, is that when I have some sprites share a horizontal plane (i.e. the bird, spark, and balloon) it messes with the flicker management in DPC+ kernel. I don’t know much about it under the hood so I will see if I can pinpoint a cause. I do find it interesting and if I am close I will just try and make creative ways to reduce the flicker. For instance, I just added the balloons reduce size when flying off screen. Or maybe I reposition some things subtly, like have the boy move. This isn’t a big issue but since it is almost complete I am trying to polish it off and learn in the process. Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted September 19 Share Posted September 19 I think the DPC+ kernel needs 5 scanlines (might be more, might be less) between sprites to consider them to be in different zones. So, I believe the flicker you are seeing is due to the nature of the sprite sorting algorithm... to quote myself from another thread: Quote 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 can't be certain that this is the issue you are running into... There's always the potential that there's a variable being trampled. 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted September 20 Author Share Posted September 20 So after some observation I noticed it occurred when certain things would happen. One instance would be when I would use my “cheat” to test the game. But the other time was when I would grab a balloon. The balloon boy and lives would disappear (when I was testing the toolbox did not appear yet). So I went to the balloon grab code and the only thing I could think of was I added a “drawscreen” in there. When I removed that drawscreen I didn’t see the sprites disappear in further extended tests. So I wonder if it is because when I grab the balloon I reposition the sprite so when drawscreen is initiated, my moving the sprite and immediately using drawscreen messed with the sorting algorithm. So now I will have to test to see if there is any benefit to the drawscreen command and if the trade off of a couple sprites disappearing for a frame is worth it. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted September 20 Author Share Posted September 20 And as another possibility, I had noticed in my grab code I reposition the sprite… but I removed the change in y-coordinate because I already reposition it in another section. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted September 20 Share Posted September 20 1 hour ago, KevKelley said: So I went to the balloon grab code and the only thing I could think of was I added a “drawscreen” in there. When I removed that drawscreen I didn’t see the sprites disappear in further extended tests. That's probably it. For your extra drawscreen, you probably aren't setting the DFRAC* lines that are supposed to go in the game loop for that frame. 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted September 21 Author Share Posted September 21 On 9/19/2023 at 11:21 PM, Karl G said: That's probably it. For your extra drawscreen, you probably aren't setting the DFRAC* lines that are supposed to go in the game loop for that frame. That did the trick. Thanks! I completely overlooked those! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.