English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 04 January 2017, 00:05   #1
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Playing module makes shapes to flicker

I loaded a module on my game, used PlayModule to play it and now most of my shapes (being blitted every frame using a double buffer) are flickering.

I noticed it's only the shapes with 8 colors (4 and 2 colors shapes aren't affected) - I am using dual playfield and the shapes are on the foreground.

Am I doing something wrong ?
Shatterhand is offline  
Old 04 January 2017, 00:32   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by Shatterhand View Post
I loaded a module on my game, used PlayModule to play it and now most of my shapes (being blitted every frame using a double buffer) are flickering.

I noticed it's only the shapes with 8 colors (4 and 2 colors shapes aren't affected) - I am using dual playfield and the shapes are on the foreground.

Am I doing something wrong ?
Is it a lot of blitting you're doing?

Try removing some of the objects temporarily to see if its a case of the module player is sending the game engine over a frame and causing the blits to not be completed before the frame has completed.
Galahad/FLT is offline  
Old 04 January 2017, 03:00   #3
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
12 16x16 shapes.

But they are "enemies", I can shoot them down, and even when there's only one, still flickering. Then there's a "boss" shape, 32x32px , alone on screen, also flickering.

In the other hand. I've tested the game with a lot of shapes on screen up until I do skip a frame... and there's no flicker and some slowdown.

The game isn't slowing down, it doesn't seem to be skipping a frame, it's just flickering the 3 bitplanes shapes.

Oh, testing on real hardware, 68k A600 2mb Chip Ram.
Shatterhand is offline  
Old 04 January 2017, 03:04   #4
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Also everytime I end the program with the module playing I get a "Program Failed Error" and then a Guru Screen, even if I stop the module before quitting.

Though Blitz 2 is kinda unstable, I always get a Guru after I quit it too.
Shatterhand is offline  
Old 04 January 2017, 05:56   #5
Pat the Cat
Banned
 
Join Date: Dec 2016
Location: Nottingham, UK
Posts: 481
Hmmm... might be a hardware problem. Loose connection on the video circuitry somewhere. It can be the amplified sound vibrates the Amiga, shaking connections. With a very loud amplifier, of course.

Long shot, much more likely to be a software issue causing a hardware issue, but I've seen some strange Amiga screens and faults.
Pat the Cat is offline  
Old 04 January 2017, 06:46   #6
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
The flicker is likely to be because the blits haven't finished before the frame is flipped. Are you flipping the frame after a VWAIT, or from an interupt?

In any case I've never had much luck with Blitz's built in Octamed support, I strongly recommend Leffman's OMED library: http://eab.abime.net/showthread.php?...ge=3&styleid=1
earok is offline  
Old 04 January 2017, 15:10   #7
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Quote:
Originally Posted by earok View Post
The flicker is likely to be because the blits haven't finished before the frame is flipped. Are you flipping the frame after a VWAIT, or from an interupt?

In any case I've never had much luck with Blitz's built in Octamed support, I strongly recommend Leffman's OMED library: http://eab.abime.net/showthread.php?...ge=3&styleid=1

Right after the Vwait. But considering the VWait (and then the frame flip) is executed only after I do all the QBlits, shouldn't I skip a frame instead of having flicker ?

I'll test it later, but I find curious that only the 8 colors shapes are flickering. In a later state of the game I draw more stuff with 4 colors that *do* make the game skip a frame from time to time, but the 4 colors shapes do not flicker, just the 8 colors one (even when there is only 1 one of them on screen, and more of the 4 colors shapes)

I am using a simple ProTracker mod, but I'll take a look into this OMED Library, thanks Earok.. but I'd guess it only works with Octamed modules, not ProTracker ones ?
Shatterhand is offline  
Old 04 January 2017, 15:24   #8
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
Here's a tip for making sure that module plays correctly, no need to worry about placing it right after the VWait, instead it will execute between every frame, so it won't slow the music down if the unthinkable should happen and your code slows down to <50fps.

Code:
SetInt 5
   [code for playing MED Module]
End SetInt
Also, converting a ProTracker MOD to OctaMED should be 1/1 in most cases anyway.
Anakirob is offline  
Old 04 January 2017, 22:13   #9
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Shatterhand View Post
Right after the Vwait. But considering the VWait (and then the frame flip) is executed only after I do all the QBlits, shouldn't I skip a frame instead of having flicker ?
That is an interesting point..

I wonder if it could be something along these lines though:

- VWait is called
- Tracker system is updated on VBlank interrupt (I presume this is how the system you're using works?) which chews up the CPU for part of the time that the screen draws
- So when the front and back bitmaps are flipped, it's already part of the way down the screen.


Though as you've mentioned, such a scenario should affect 2 and 4 colour BOBs too.. which I can't think of an explanation for.
earok is offline  
Old 04 January 2017, 22:52   #10
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Made a quick test here, replaced the 8 colors BOBs with 4 color ones.

Still flickering.

What you say makes sense because the other BOBs arent flickering, but they are at a lower part of the screen.

I am using Blitz Basic PlayModule function, that's all. just "LoadModule" and then "PlayModule"
Shatterhand is offline  
Old 04 January 2017, 23:15   #11
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 862
I've had this problem. Not good practice maybe, but I experimented with moving the vwait to random parts on the main loop until the flickering went away.
Coagulus is offline  
Old 05 January 2017, 13:15   #12
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
Quote:
Originally Posted by Shatterhand View Post
Made a quick test here, replaced the 8 colors BOBs with 4 color ones.

Still flickering.

What you say makes sense because the other BOBs arent flickering, but they are at a lower part of the screen.

I am using Blitz Basic PlayModule function, that's all. just "LoadModule" and then "PlayModule"
The standard module replayer is a bit crap, I think the one you want to use is LoadTrackerModule, etc.
Anakirob is offline  
Old 05 January 2017, 17:45   #13
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Quote:
Originally Posted by Anakirob View Post
The standard module replayer is a bit crap, I think the one you want to use is LoadTrackerModule, etc.
Yeah, it's clear it's crap. Whenever I end a program with a Module loaded, Blitz just crashes. When it's an executable and I quit it, I get a "CAN'T FREE MEMORY" error. If I try to free the Module, the game just hangs.

But there's no mention of LoadTrackerModule on Blitz 2 manual. Is this some other library, or it was something added on Amiblitz? (if that's the case, I can't use Amiblitz because I want the game to run on stock old 68k machines, Amiblitz needs an FPU )
Shatterhand is offline  
Old 06 January 2017, 01:15   #14
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
I don't know about LoadTrackerModule, but you can try out StartTracker, part of Neil's CIA tracker lib. It's on one of the BUMs and is installed with Ultimate Blitz CD.
idrougge is offline  
Old 06 January 2017, 08:33   #15
Graham Humphrey
Moderator
 
Graham Humphrey's Avatar
 
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
LoadTrackerModule is part of the same CIA tracker library the StartTracker command. It's a huge improvement and works really well, the only limitation being that it only works on Kickstart 2 and up, which I am assuming is too limiting if Shatterhand is writing a game for a stock 68000 machine (of course, if it was an AGA game there would be no issue so in that case fill your boots).

I would seriously recommend using the MED player commands, they're much nicer and won't do anything unpredictable.
Graham Humphrey is offline  
Old 06 January 2017, 14:56   #16
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Yeah, Athough I have an A600 with Kick 2, I'd like my friends with a stock A500 to be able to play the game too

I'll try this, though now I am trying to optimize the whole game, since in advanced levels the screen gets cluttered enough that the game misses a frame from time to time. I spend the whole last night testing a lot of different stuff to see what gives me the best performance, went to bed, had an idea and had to sleep over it
Shatterhand is offline  
Old 12 January 2017, 05:16   #17
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Ok, I downloaded Octamed, converted the .mod I was using to .med, and tried it.

Still get flicker, though a lot less intense.. I actually had the feeling the flicker was happening only when all 4 channels were used at the same time. But not only flicker, I also got shit quickly appearing ramdonly on display from time to time, it really felt like the machine was nearly dying to play that music... and in the middle of the game running it just crashed. But I did *NOT* followed Anakirob's tip to play the song on a interrupt, and I'll try that tomorrow.



One funny thing is that when I wanted to comment the command to play the song I accidentally commented the Vwait command instead and ran the game. I'd expect stuff to be flickering like that, but what surprised me is that the game was running *real* fast with the music also playing a lot fast, so I'm still guessing the music playing is not taking that much of a hit in the cpu at all.
Shatterhand is offline  
Old 12 January 2017, 13:37   #18
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
I know you are using a double buffered display, but are you 100% sure you're drawing to the buffer which is NOT the currently active display? If you are blitting to the buffer which is currently being displayed then that could cause flickering shapes.

Last edited by Anakirob; 12 January 2017 at 15:59.
Anakirob is offline  
Old 12 January 2017, 15:44   #19
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
I don't know if this is related, but is this play routine synced to VBL or CIA?
Amiga1992 is offline  
Old 12 January 2017, 15:57   #20
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
The default MOD playing routines are synced to the VBL and the MED playing routines are synced to whenever you call them, usually during or just after the VBlank.
Anakirob is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Shapes Retro1234 Coders. Blitz Basic 53 17 March 2017 11:41
HippoPlayer very slow down system when playing module michaljarz support.WinUAE 6 21 February 2016 20:34
Shapes (PD) Devlin HOL data problems 0 17 July 2015 19:03
FS: Scandoubler/Flicker Fixer DCE Flicker Magic lopos2000 MarketPlace 15 23 October 2007 11:18
What Makes a Game Worth Playing for You? Dastardly Retrogaming General Discussion 7 09 April 2004 21:49

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:10.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12756 seconds with 13 queries