Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / stupid flickering sprites!

Author
Message
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 17th May 2003 18:14
i am making a 2D game called pacfire which runs in 60 fps.

i am using this sort of loop

**************
sync on
sync rate 30

rem load stuff

do

rem draw stuff

sync
cls

loop
***********

no matter what i do i can't stop the sprites from flickering i have tried changing the fps and tried it on two different PCs!

WHAT THE HECK IS WRONG HERE!
I don't know i can't tell!
I push the button and run like hell!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 17th May 2003 21:31
A remove the cls, why have you put that in, that would erase the screen?
B for a game that runs at 60fps you would do better to use sync rate 60
if you still have problems then post again,

Mentor.

Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 17th May 2003 21:54
put a cls at the top of your code

freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 17th May 2003 22:30
both tips of mentor and darkness were good... you have to combine them like this:

LREM 8888
22
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 18th May 2003 22:27
On one computer I tried DB1.08 (Windows xp) and that flickered every time you were in 2D mode! Maybe it's confined to sprites on other computers... Mind you, Db1.13 fixed it...

An orange can't be a tomato but a tomato can be orange...
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 19th May 2003 19:04
don't use sprites, use the paste image command instead (every frame)
it's lots faster and you won't have any flickering problems

i think it has to do something with the memory, because on most pc's sprites start flickering after a certain amount of them or after a certain time
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 19th May 2003 21:47
Sorry freak - there is no difference (in speed) between sprite and paste image. They are exactly the same. Except you loose a lot of control/extra functions with paste image. If you call the sprite correctly (and have your program sync'ing correctly) there is no more reason why a sprite should flicker than an image should.

"i think it has to do something with the memory, because on most pc's sprites start flickering after a certain amount of them or after a certain time"

Highly highly unlikely.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 19th May 2003 22:00
okay... so paste image is also that slow :s
what's the alternative then?
or am I wrong about that slowness?
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 19th May 2003 22:18
Well if anyone set the sync rate to 30 I'm hardly going to expect it to whizz along, it's bound to lag. But at a sync rate 0 there's no reason why paste image or sprite won't shift at a nice rate, especially if the sprites background state is turned off and you handle the refresh yourself (then it'll be significantly faster). But it all depends how many sprites are on-screen, what size they are, etc.

Cheers,

"Gentlemen, we are about to short-circuit the Universe!"
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 19th May 2003 22:22
especially if the sprites background state is turned off and you handle the refresh yourself (then it'll be significantly faster)

so that's why paste image is faster, coz they are just sprites without the refresh option?
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 22nd May 2003 20:30
paste image doesn't work, i'm using that for the main menu and that flickers too! I've never had this problem before

I don't know i can't tell!
I push the button and run like hell!
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 22nd May 2003 20:53
you might consider converting your game to 3d and using textured plains

[href]www.bernardfrancois.com[/href]
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 24th May 2003 19:22
I also HATE 3D

I am also using DB 1.08 on XP, it could be a bug in the DB program!

If I enhanced it, could that work?

I don't know i can't tell!
I push the button and run like hell!
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 24th May 2003 21:03
do you still have a cls in your main loop??? that would make everything flicker

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL [email protected] to work on the new Star Strike project!!!
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 24th May 2003 21:59
i took it out, everything still flickers and the score and ammo has lots of numbers all on top of each other HELP ME

I don't know i can't tell!
I push the button and run like hell!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th May 2003 02:36
Code!!!

Give us code and we can fix it. Don't, and all we can do is guess.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th May 2003 03:15
I wonder if it's just the back buffer not being cleared. Since you mentioned your runnign XP and this is known problem with DB.

Try clearing the screen (the buffers) upon start up..



l8r,
Kevin Picone
[url]www.underwaredesign.com[/url]
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 25th May 2003 12:45
the numbers and text on top of each other is because it isn't in a 3d enviroment i think?? text commands showing varibles are only updated in a 3d environment with the sync command, or thats what happens with me if you aren't using any 3d objects you have to clear the text/numbers manually.
eg


thats what i do in 2d games

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL [email protected] to work on the new Star Strike project!!!
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 26th May 2003 01:45
@ rich -

there is no difference (in speed) between sprite and paste image

i was doing a remake of nemesis for the retro thing and i am carrying on with it. Now on level 2 there's loads of these little purple balls

At the end of the level there's quite a lot of these little balls and my frame rate drops to about 12fps. But after I shot about half of them my frame rate goes up again. Now I tried paste image instead of using sprites (just for the purple balls) and my frame rate stayed right up at 33 (i set it at 30). The only thing i changed was paste image instead of sprite.
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 26th May 2003 01:49
sorry this is DB board - i got DBPro - wine makes me slow

so is paste image quicker than sprite in DB pro?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th May 2003 04:36
The default setting for sprites in DBPro is to save the background before drawing to put it back later. You can use SET SPRITE to switch this off, which will speed things up a bit.
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 27th May 2003 13:54
FOUND THE PROBLEM!


i am running DB 1.08 on XP

the other computer which i tested it on also has DB 1.08 on XP

BUT! i tried it on my friend's computer which is running DB 1.12 on XP AND THEY DON'T FLICKER

it seems to be a compatability problem with XP and DB 1.08

I don't know i can't tell!
I push the button and run like hell!
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 27th May 2003 14:13
BUT! i tried it on my friend's computer which is running DB 1.12 on XP AND THEY DON'T FLICKER
it seems to be a compatability problem with XP and DB 1.08


you can't be sure that's the problem. there are lots of other factors that could cause that flickering problem
for example, what are the specs of the pc on which it works and what are the specs of the pc on which it don't works?

I rather think it has something to do with the memory of the pc or the video card.
This is my theory about this:
When not all the sprites fit in the memory, there can be only drawn a certain number of them in each frame, for example you use 7 sprites and there only fit 5 of them in the memory. Then the first frame, 5 sprites are drawn. The next frame, 5 (of which one or more different sprites than these drawn in the first frame) sprites are drawn. So because you have every frame other sprites drawn, you'll have a flickering effect.
Something that might help proving this theory: Mostly you have a white flickering (so one frame you see the sprite, another frame you just see a white box). Maybe you see that white color because the background color is set to white. So to proof this theory, just change the background color (using the INK foreground color,background color command) and see if the flickering is an alternation of your sprite and a box in the background color you just set.

[href]www.bernardfrancois.com[/href]
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 27th May 2003 20:01
can't you just upgrade to the latest version of dbc???, works fine with my xp

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL [email protected] to work on the new Star Strike project!!!
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 28th May 2003 08:44
o_O Make sure you dont paste the sprite in the loop...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 28th May 2003 19:26
my pc - the first one i tried it on is:

AMD K6 II - 500mhz
256MB RAM
8 MB VIA GRAPHICS

my other test pc

AMD DURON - 600mhz
128MB RAM
8 MB VIA GRAPHICS

i don't know my friends spec but it's 1GHZ+

Maby it's something with the VIA graphics or the AMD prosecors

I don't know i can't tell!
I push the button and run like hell!
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 28th May 2003 20:14
I don't think it has anything to do with the processor speed. I see both of the two pc's have only 8mb video ram. I think that's the problem... a lack of ram which causes the flickering as I described above

I bet your friend has more than 8mb of ram

I also sometimes had a sprite flickering problem on a pc with a 16 mb ati card, but now I have 128mb ddr videoram on my video card and I haven't seen any flickering sprite since then

[href]www.bernardfrancois.com[/href]
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 31st May 2003 00:07
yeah, well the game is done now

[href]htpp://www.rodman58.freeserve.co.uk/pacfire2003.zip[/href]

it isn't on my real website:

http://website.lineone.net/~davidprice/home.htm

please check them out

I don't know i can't tell!
I push the button and run like hell!

Login to post a reply

Server time is: 2025-05-19 08:09:08
Your offset time is: 2025-05-19 08:09:08