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 / DB Classic 'Flashing Version'

Author
Message
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2007 01:09
I need your help!

I know others have mentioned this issue before so I know it's not just me...

More often than not, when I run my DBC programs, they flash like crazy. I've dug out every single version of V1.13 (I do have a few) and have the same problem with all of them - including the latest 2007 download from the thread at the top of this board.

With the help of all of you, I'd like to solve this problem once and for all because the workaround I used to use no longer works!

Basically I used to use:

Set Display Mode whatever
Sync On: Sync Rate 0: CLS 0: Sync


at the start of my programs and all worked fine.

Now most of the time, all those programs which I added that to are flashing when I run them. I might have to run a program 5 or six times before I lose the flashing...

So, first of all, how many of you are also having this problem?

I'd like to track down once and for all if this is a problem to do with the OS, the system DBC is running on or DBC itself. I'm fairly sure however that the flashing issue is only occuring with Windows XP and doesn't happen for anyone who uses Windows 98 or ME.

I'm using XP Pro on an AMD Athlon64 3500+ processor with 2Gig of DDR2 memory - which I upgraded fairly recently but I can't confirm if this was when all the problems started.

Would you therefore be good enough to provide the following information:

1. Do you suffer from the screen flashing effect?
2. The version of DBC you are using.
3. The size of your DBC.EXE file.
4. The Windows version you use (XP Pro/XP Home/Win98/WinME).
5. Your machine specs - CPU & Memory should be enough

(I've included item 5 in case it is a CPU speed issue).

Hopefully, between us, we should be able to track down the exact cause of this problem and maybe find a cure.

I can't provide a program for you to run as the flashing doesn't occur with a small snippet. But anyone who has experienced it will know what I'm talking about and anyone who uses XP who has not experienced it can possibly put those of us who have, out of our misery...

TDK_Man

Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 10th Jul 2007 01:20
1. Do you suffer from the screen flashing effect? yes
2. The version of DBC you are using. It says version one
3. The size of your DBC.EXE file. Any size.
4. The Windows version you use (XP Pro/XP Home/Win98/WinME). XP Home edition
5. Your machine specs - CPU & Memory should be enough ??

Did someone say 3D scanning on my desk, or was that just an AdBot?
What happens when when you mix coke, pop rocks, vinegar, and baking soda?
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2007 02:39
Quote: "2. The version of DBC you are using. It says version one"


They are all version 1. You need to supply the xx part as in V1.xx. The latest official version released was version 1.13.

To find this information, go to your DBC directory with Windows Explorer and run DB.EXE by double-clicking on it. When it appears on-screen it should say the version number in the bottom left corner on the status line.

Quote: "3. The size of your DBC.EXE file. Any size."


While still in Windows Explorer right-click on DB.EXE and choose Properties. Note down the value next to 'Size' (just underneath Location).

I have versions of DBC that are 4726784 bytes, 4608000 bytes and 4710400 bytes. All say V1.13 when I run them!

If anyone has XP and a version of DBC which is a different size but doesn't have the flashing problem, that might be the version to use - but please let us know if it's the Enhanced version or not.

Quote: "5. Your machine specs - CPU & Memory should be enough ??"


What is the processor and memory in your computer. It might turn out to be down to a timing problem - meaning that the flashing only occurs for users with a certain type of processor above a certain speed. Or possibly only with those using DDR2 memory.

These are the sort of thing we need to investigate, so partial information isn't much use.

TDK_Man

Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 10th Jul 2007 04:02 Edited at: 10th Jul 2007 04:09
KK sorry about that... here are the ones I didn't fill in properly:

Question 2: Version 1.13 (enhanced)
Question 3: 4.50 MB (4,726,784 bytes, that's the kind that you hate )
Question 5: Here's the information I think I'm supposed to have:
Intel (R)
Pentium(R) 4 CPU 1600MHz
1.59 GHz, 512 MB or RAM

Did someone say 3D scanning on my desk, or was that just an AdBot?
What happens when when you mix coke, pop rocks, vinegar, and baking soda?
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2007 05:06
After experimenting a bit this evening I'm convinced that it's a timing problem due to DBC being used on faster machines than those available when it was released.

As what I've discovered is related, but not exactly the same - but still useful to know about, I've started another thread.

TDK_Man

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Jul 2007 05:24
isnt that a case of starting the program with CLS as the very first command on its own line, or was that from the win2k DBC days?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2007 05:32
I was using a similar work-around to stop the flashing and it worked fine. But now, even those programs are now flashing again.

But, I think I've got to the bottom of it now - see my 'Recent Machines Too Fast For DBC' post.

TDK_Man

heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 10th Jul 2007 17:53
I have already posted what I believe to be the reason for the flashing,
and the solution.

http://forum.thegamecreators.com/?m=forum_view&t=109529&b=10

I'm unique, just like everybody else.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2007 22:33
Quote: "I have already posted what I believe to be the reason for the flashing, and the solution."


Which doesn't work for me - or I wouldn't have started this thread!

TDK_Man

heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 03:13
You've always typed that you use Sync.

I always recommend Wait.

Big difference.

Syncs are not be the best solution for two reasons.

The graphics subsystem speed not keeping up with the computer causes problems with the buffers not being updated before subsequent commands alter the graphics creation parameters.

Wait 2s cured ALL my problems on my 900MHZ ATHLON running Windows98 using a variety of video subsystems including nVidia, ATI and onboard chipsets.

I don't think that the flashing problems will start showing up with faster computers because they will have faster graphics and (unlike a Sync) a Wait 2 on a 1GHz CPU is the same as a Wait 2 on a 5GHz CPU.

I'm unique, just like everybody else.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 03:16
The other reason not to Sync in the middle of building the screen is raggedy screen updates.

You should build the screen and display it once with ONE SYNC.

TDK, you sure are posting like you don't want the solution.

This IS the solution to the flashing.

I'm unique, just like everybody else.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 03:51 Edited at: 11th Jul 2007 04:03
Quote: "I can't provide a program for you to run as the flashing doesn't occur with a small snippet. But anyone who has experienced it will know what I'm talking about and anyone who uses XP who has not experienced it can possibly put those of us who have, out of our misery..."


Run this small once and you will see garbage.


Applying your Sync fix... run this 10 times to test the result
(it's easy just press F5 then F12 ; F5 - F12...)
It still flashes much of the time on my system.


Here I replaced the Syncs with Wait 2s.
Run the example.
Does it flash on your system?


The text flashing is banished on mine.

The flashing on the background is a seperate fix.
Cls : Wait 2: Cls at the beginning will fix that!



I'm unique, just like everybody else.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 04:10
The trick is to think out your changes carefully and then group the text changing activities in the main loop so any text attribute set calls are executed the absolute minimum amount of times.
Otherwise your execution speeds will suffer to get a stable display.

Another strategy is to place the attribute change calls well after any text display functions have been called, then the need for the delay is decreased.

I'm unique, just like everybody else.
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 11th Jul 2007 05:08
i just leave auto sync on and mine always runs fine

The problem with the gaming community is people think that the resolution of a game defines how good it is. I am not afraid to make a game where the main character is 50x50.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Jul 2007 06:05 Edited at: 11th Jul 2007 15:01
Sorry heartbone, but I don't know how better to explain this:

You say: To fix the flashing use Wait 2 or Wait 3

I say: It doesn't work for me!

My programs that have

Set Display Mode whatever
Sync On
Sync Rate 0


at the start all flash when I run them. When I say flash, I mean the whole screen flashes on and off - often with a square in the middle of the screen where the mouse pointer was. I'm not even using any Set Text commands!

Cls : Wait 2: Cls did not stop it either.

Quote: "Wait 2s cured ALL my problems on my 900MHZ ATHLON running Windows98 using a variety of video subsystems including nVidia, ATI and onboard chipsets."


Well good for you - I'm not using that machine. You are not even using XP like I am. Have you tested your solution on a 3Gig+ machine running XP. You haven't said you have so far.

Quote: "You should build the screen and display it once with ONE SYNC.

TDK, you sure are posting like you don't want the solution.

This IS the solution to the flashing."


Posting like you don't want the solution? Seeing as your fix works for you but not for me, the whole point of this thread is to try and determine under what conditions the problem actually occurs and whether its a problem with OS, machine or version of DB. What part of 'it didn't work for me' do you not understand.

Your posts can be rather condescending at times and they are starting to irritate a little now. Hopefully this is your writing style and is unintentional...

I repeat, your solution worked for you. It didn't work for me with the flashing problem that doesn't have anything to do with Text.

Whether it should have or not, Sync worked for me in the past. Now it doesn't. Wait works for me now, but not with 2 or 3 milliseconds. Yes it needs a delay - for more than just the Set Text commands too!

Your above code snippets refer to the multiple fonts and sizes on the same screen problem - not the full screen flashing problem I am talking about. As does the thread you linked to.

As you are using a 800MHz machine and Windows 98, there's every chance that you've never even experienced what we are talking about...

TDK_Man

Dark Dragon
18
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 11th Jul 2007 17:11
what I do for the flashing screen is use the "backdrop on" if I used 3d objects and "backdrop off" for text and 2d sprites. If you are using them together, I'm not sure....
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 18:46
Quote: "Your posts can be rather condescending at times (snip) As you are using a 800MHz machine and Windows 98, there's every chance that you've never even experienced what we are talking about..."


I feel the same way about some of your posts too.

TDK_Man, as I am running all of these tests on
Microsoft Windows XP Professional Service Pack 2
using a Pentium(R)4 CPU
3.00 Ghz, 0.99GB of RAM...

So I can't believe that you even ran my examples because it REPRODUCES the flash very well....
and fixes it!

Have it YOUR way.
MY programs work well.

I'm unique, just like everybody else.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 11th Jul 2007 18:58
Quote: "i just leave auto sync on and mine always runs fine"


Pixelator, you are correct that is another solution, but when you get big projects the auto updates seem to lead to less than desirable results. Sync On does seem to cause the flashing behavior.

Dark Dragon, that does indeed work as well but I don't want to turn on 3D for a 2D project.

I left out the last Wait 2 for the flashing screen fix.
Cls HUE : Wait 2 : Cls HUE : Wait 2 at the start before any other screen modification activity seems to work well.

Will someone else execute this first snippet

and this last one

to see it the problems are 1) reproducible and then 2) fixed with these changes?

I'm unique, just like everybody else.
tha_rami
19
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 12th Jul 2007 00:08
1. Do you suffer from the screen flashing effect? YES
2. The version of DBC you are using. 1.13
4. The Windows version you use (XP Pro/XP Home/Win98/WinME). Vista Ultimate...
5. Your machine specs - CPU & Memory should be enough. 3.0Ghz, 2GB

heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 14th Jul 2007 17:57
Will someone else execute this first snippet

and this last one

to see it the problems are 1) reproducible and then 2) fixed with these changes?

I'm unique, just like everybody else.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2007 01:21
I don't experience flashing (I use an older machine and operating system for DBC - windows 98, AMD 1.5ghz 1gig memory) but I wonder if it's the runtime version of DirectX that is the problem as opposed to the speed of the machine. Since DBC is based on Directx7 and functions are deprecated all the time as windows versions cycle up, it could be the problem. If anyone has an extra harddrive, or can set up a partition to run Windows 2000 or less on their high powered machine, they should see if DarkBASIC is still flashing. It's a bit of work to install an operating system, but it would be a test to help explain the problems. The thing to do would be also install runtime directx no higher than 8.1 .

I don't know if the lower version of DirectX could be installed on a newer operating system once it has been upgraded to a higher version of directx, but if it could, then this might be a test to conduct as well.

Enjoy your day.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Jul 2007 07:32
Heartbone:

All I can say is that

Cls HUE : Wait 2 : Cls HUE : Wait 2

...at the start of my programs doesn't work for me - as I've been saying all along. Even using Wait 50 only works part of the time though 100 seems to work OK - for me!

Maybe 70 or 80 also works, but as it doesn't matter how long the wait is where it's used, I think it's pointless wasting time finding out the smallest exact Wait value that works every time.

Also, I don't think I have any code that doesn't have Set Display Mode and Sync Rate 0 at the start and the use of this might be part of the problem.

I haven't run your snippets myself because they are regarding the text size flashing problem which a) I don't get (because a Sync or a Wait fixes it and b) that's not what this thread is about.

I don't mean to be a pain, but you are offering us the solution to a problem we are not talking about in this particular case.

I do agree however that your provided solution does fix the problem you are talking about.

Quote: "I wonder if it's the runtime version of DirectX that is the problem as opposed to the speed of the machine."


You could well be right.

As far as I know, you can't downgrade DirectX, but it's possible that DX9 could be the culprit. When I get time, I might put a spare drive in as drive C: and install XP on it without updating to DX9.

My XP install CD comes with DX8 if I remember correctly...

TDK_Man

heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 15th Jul 2007 10:48
On my XP system the first snippet will quite often trigger the flashing background and of course always the flashing text.
Perhaps the use of Sync Rate 0 is a big part of the Waits not eliminating that flashing problem.

I've never used that command, as I recognized that it would cause programs to behave differently on different systems, not a good thing.
I always use timer based display updates since I don't want my programs speeding and becoming unplayable up on future systems.

Latch, good ideas. I hope that you are wrong about the DirectX.

I'm unique, just like everybody else.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Jul 2007 19:48
@ TDK
Which order are you putting SYNC RATE 0 and SET DISPLAY MODE, I find the SET DISPLAY MODE command can be a little temperamental.

I am king of the noobs!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Jul 2007 21:08
I've tried it both ways around but I've always used Set Display Mode first, then Sync On and finally Sync Rate 0.

This has always worked for many years without problem. It's only when I first started using XP the problem occurred but the work-around stopped the problem back then.

Fairly recently the problem returned again and it has to be either the speed of machines compared to back then, DirectX9 as Latch suggests or quite possibly a combination of the two.

The whole point of all this is not for me to fix the problems for my own machine, but for you all to realise that the problem exists with your own DBC programs running on other people's machines!

I just think it would be useful to be able to say "put this bit of code in ALL of your programs or they will flash on some computers".

But to do that we have to track down the exact cause of the problem - and that's the tricky part.

TDK_Man

Serge Adjo
19
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 17th Jul 2007 17:35
I have mentionned this issue to Lee Bamber... I believe that a new update will come, DBC will be Vista capable, I hope, without BUGS!
I'am SERDJO THE BEST CODER!

De la part de SerDjo
http://perso.orange.fr/Serdjo.L/
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Jul 2007 04:29 Edited at: 30th Jul 2007 04:40
@TDK

By any chance, have you tried different values for the compatability settings in the setup.ini file in the DB main folder?




Also you mentioned sometimes you have to run the program 5 or six times before the flashing will stop. What if you put your work-around code in a loop and ran it say 10 or more times at the beginning of the program? For 1.13 enhanced, what about sticking FLUSH VIDEO MEMORY within your original work-around code somewhere? Any of this make any difference?

How about initializing the 3d screen by creating an object then deleting it, the turning backdrop off and running your work around - or any combination of this and the above?

Enjoy your day.
roddman
18
Years of Service
User Offline
Joined: 24th Jul 2007
Location: Over There
Posted: 30th Jul 2007 08:19
Flush Video Memory command seems to help, although it still flashes at least once. Using that command looks like it slows the flashing down or... something.

On another note my current project uses a window instead of full screen mode, and i've seen that the background (desktop, icons, etc...) are re-drawn faster when using Flush command. whereas previously the window would come up but the background would not re-draw for a few seconds. Thanks Latch

Cory
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 30th Jul 2007 18:01
I've NEVER SEEN the background flashing in windowed mode.
Has anyone else?

I'm unique, just like everybody else.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jul 2007 21:04 Edited at: 30th Jul 2007 21:05
@roddman
Yeah the window thing happens for me too, looks quite worrying when the start bar and everything go black leaving just the backdrop.
Is the FLUSH VIDEO MEMORY command available to DBC? I've never seen it.
PS I have enhanced version 1.13 but it's quite old, is this still the latest update? (have they stopped updating DBC?)

@TDK
have you told TGC about this, it seems like it will become a major problem very soon.

I am King of the noobs!
roddman
18
Years of Service
User Offline
Joined: 24th Jul 2007
Location: Over There
Posted: 31st Jul 2007 03:24
I use the old enhanced version and it works fine. I had never heard of it either until Latch started talking about. I don't know if that command helps or not, I can't tell any more.

Cory
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 31st Jul 2007 17:51
DBC enhanced

FLUSH VIDEO MEMORY
This command will erase all images and textures stored in Video Memory allowing automatic texture management to refill the memory with the textures used at that moment. Good when your scene changes location and the old textures are no longer needed.


Quote: "I've NEVER SEEN the background flashing in windowed mode.
Has anyone else?"


How about windowed mode as heartbone asked?

Enjoy your day.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Jul 2007 19:45 Edited at: 31st Jul 2007 19:51
@Latch
I still don't really understand. Does that mean you'd have to reload all your images?
I'm gonna test it out

[EDIT]
Tried it. It isn't syntax highlighted so I'll have to add it in.
Now the start bar is white until I click
when are you supposed to use this command?

here's my test.


I am King of the noobs!
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 31st Jul 2007 22:34
It seems flush video memory should erase textures and images you have stored. If you had a world with multiple levels, if you load a new level, you might use flush video memory to clear out all of the textures to save memory and increase performance just before you load the next level.

I suggested it as a test at the start of the program just to see if it would make any difference in how DBC behaved in terms of flashing... in case there was any "memory residue" in video memory that was causing problems. The thing to do would be to test it with heartbone's or TDK's suggested workarounds. You'd have to place it at different points in the workarounds to see if makes any difference.

Enjoy your day.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 1st Aug 2007 21:34 Edited at: 1st Aug 2007 21:38
Ah, I'm kind of getting it now
I thought DB dealt with that automatically?
This "flashing" happened with my Jack & the Beanstalk program (on TDK's computer).
I used data statements to create bitmaps and then grabbed images from the bitmaps, the program doesn't actually need CLS, maybe that has something to do with it. Here's the code if it helps.



Your sig was erased by a mod because it's larger than 600x120
I didn't know about that rule and it was 659 x 126!
Isn't that a little OTT? I'm gonna have to re-make it because of 65 pixels!!!

Login to post a reply

Server time is: 2025-08-08 20:38:46
Your offset time is: 2025-08-08 20:38:46