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 / Weird: Flickering images on HUD problem

Author
Message
Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 29th Aug 2007 03:07 Edited at: 29th Aug 2007 03:10
Hi All, just encountered the following flickering problem and was wondering if anyone else has come accross something similar. My Hud is a large plain textured with a PSP image, onto which I glue various other textured HUD plains (e.g. a shield text, shield bar, a scanner etc). Now the problem is this is: when my ship moves a certain distance from the universe origin, the bottom part of some of these "glued" images starts flickering. I just dont get it. The flickering seems to be linked to the following:

1. The distance from the origin of my universe (e.g. once my ship's x or y coord gets beyond +-256)
2. My ships orientation - after the flickering of some images starts, once my ship turns left or right, the flickering leaves one image but starts in another.

And for the images affected, it is only ever the very bottom part of the image(not the whole image). E.g: if the image looks like

xxxxx
xxxxx
xxxxx
yyyyy

then only the yyyy's flicker and in fact only a very thin bottom part of the yyyys flicker.

Can anyone let me know why this might be happening? I'm not doing anythign fancy in the code once the ship gets to certain points and so I cant see that being the reason.

Cheers.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 03:17
That sounds like a syncing problem, the screen can't keep up. Try pasting all the HUD images to an off screen bitmap and then grabbing the image from it and using that. Might help, but I promise nothing

Your signature has been erased by a mod because it was rubbish.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Aug 2007 06:48
When you say gluing, what do you mean? Are you gluing the planes to the ship as limbs or are you LOCKING the planes to the camera?

Enjoy your day.
Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 29th Aug 2007 07:04
I'm gluing the plains to the main HUD plain i.e. the main HUD plain is a big rectangle at the bottom of the screen. The other plains (e.g. laser energy bar, scanners etc) are glued to it, so that I only have to update the position of the main HUD plain each loop and not the 10 or so other other HUD icons.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2007 15:00 Edited at: 29th Aug 2007 15:02
There's a LOCK OBJECT ON command that does all of this for you. It locks the object to the screen. Your HUD will always remain in the same position without you bothering to update its position.

The flickering could be caused by the objects overlapping, and the redrawing routine doesn't know which one to draw first, so they flicker. Making each object into a limb of the HUD will cause all of the objects to be drawn at the same time, and eliminate the flicker. If that's what is causing the problem.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 15:47
Why is your HUD 3D?
That'll be slowing it down.

Your signature has been erased by a mod because it was rubbish.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2007 16:38 Edited at: 29th Aug 2007 16:42
Quote: "Why is your HUD 3D?
That'll be slowing it down."


A HUD is usually 3D plains. They are very fast because they don't use hardly any polygons. This is a 3D game afterall. You wouldn't want to mix 3D and 2D together, that would be slow.

Dark Dragon
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 29th Aug 2007 16:54
Quote: "You wouldn't want to mix 3D and 2D together, that would be slow."

yup.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 20:53
@Pincho
Really? Didn't know that, thanks.

Your signature has been erased by a mod because it was rubbish.
Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 29th Aug 2007 21:10
Me neither...

Acording to Grandma, I am now enemy of the evil republic, who captured Paris Hilton and couldn't manage it.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Aug 2007 22:35
Why not make the HUD a 2D image which pasted over the 3D view?

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 22:50
That's what I suggested but apparently that slows it down.

Your signature has been erased by a mod because it was rubbish.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Aug 2007 23:21
I can't see why. I've not had any problems with that method before.

The last time I used the method was in a driving game where I had the dashboard of a Seat Cordoba.

Hmmm... I wonder where that got to. I'll have to see if I can dig it out. Haven't seen it for years...

TDK_Man

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Aug 2007 23:35
Well, that was amusing!

I found it and hadn't realised how bad it was...

Untouched since written back in 2003, here's an example of a 3D program with a 2D HUD. There's no flickering.

http://www.computechtenerife.com/alpine.zip

F1 switches from tracking cam to cockpit.
F10 to start the race.

Unfortunately, I never finished it.

Hangar18:

Have you tried doing it like this with images instead of plains - building up the image on a hidden screen. Just leave the areas of the image black where you want the 3D image to show through and paste the image using a 1 for the transparency flag.

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 23:51 Edited at: 30th Aug 2007 00:01
Quote: "Have you tried doing it like this with images instead of plains - building up the image on a hidden screen. Just leave the areas of the image black where you want the 3D image to show through and paste the image using a 1 for the transparency flag."

Now that's just exactly what I said.

I'll check out your driving game TDK
I only managed a 5 minute lap, I got lost 3 times lol
Nice course but not very good to be honest

Your signature has been erased by a mod because it was rubbish.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Aug 2007 00:26
Quote: "Now that's just exactly what I said"


I know, but he never answered the question!

TDK_Man

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Aug 2007 01:18
Quote: "Why not make the HUD a 2D image which pasted over the 3D view? The last time I used the method was in a driving game where I had the dashboard of a Seat Cordoba.
"


I've never seen anyone do this before. I always thought it would cause problems.

Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 31st Aug 2007 00:21
Thanks all! Some great ideas I can play around with - I'm sure the fix lies in at least one of them.
Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 3rd Sep 2007 01:17
Well I think I've found an answer and discovered something really quite interesting about DB and image sizes in the process. My understanding of images was that creating them as factors of 2 is supposed to be optimal when it comes to texturing. E.g. image pixel sizes of say 256x256 or 128x128 is better than 200x200 or 100x100 because DB works best with factors of 2 (e.g. 256=2^8). All my images were done in PSP using factors of 2 but it seems this is the very thing causing the flickering!! By chance I changed one of my images from being a 256x256 to 300x300 and guess what? - no more flickering. Weird I know, but it seems to be true.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 3rd Sep 2007 03:19
I have a feeling it will come back lol

In programming, nothing exists

Login to post a reply

Server time is: 2026-07-05 17:55:00
Your offset time is: 2026-07-05 17:55:00