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 Professional Discussion / Detecting Video Flush

Author
Message
Anigma
14
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 15th Jun 2012 02:07
Quote: "Recently Todd Riggins suggested a decoy image that you check each loop, and if it doesn't exist you reload everything. For some reason that seems to work now... "


How long is the game loop? I'm just curious. I'd love for this to be the solution as it's simple, elegant and doesn't require a million "if this exists then do this with it" statements. My only concern is that longer game loops will still crash because the video flush can happen at any time within that loop.

-Anigma

It compiled! Ship it!
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Jun 2012 02:56
how about a dba file with the individual function to perform a check at each required object call in the loop...

I cant explain this well enough right now... but basically another way is to run a function call to a dba which checks for every external file... I think TGC needs to fix this one asap... this debate will string on in a DO:SYNC:LOOP... until someone fixes the issue...

I could however look at disabling the screen refresh when the mouse is no longer avilable and jump to a sunroutine maybe...

GIDustin
17
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 15th Jun 2012 05:28
Quote: "How long is the game loop?"


My current game is 12k lines long. Obviously not all of them are called each loop, but I am have yet to crash it with CTRL+ALT+DEL since I added a decoy image. But, I tried the decoy image method months ago and it failed 25% of the time so I am not sure what is different. Perhaps my coding techniques changed or something...
Non Sequitur M
16
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 15th Jun 2012 07:45
Quote: "how about a dba file with the individual function to perform a check at each required object call in the loop..."


Aka, a shell script? You boiled my post down to the basics, V. Lol.

Quote: "would it be possible for the flush to occur between a check and a command? So for example with this line:

if object exist(x)=1 then position object x,x1,y1,z1"


Yes, but A: It would be very rare for that to occur(especially in a large program), and B: There's nothing you can do if it occurs there.

Quote: "My current game is 12k lines long."


Holy...

---

Question: Does this error also affect arrays, memblocks, variables, and other such data structures, or just a/v data?

-Amo
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Jun 2012 07:47
Quote: "Aka, a shell script? You boiled my post down to the basics, V. Lol."


is that a good thing?

Quote: "Question: Does this error also affect arrays, memblocks, variables, and other such data structures, or just a/v data?"


Good question

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 15th Jun 2012 10:03
Quote: "Recently Todd Riggins suggested a decoy image that you check each loop, and if it doesn't exist you reload everything. For some reason that seems to work now..."

Yes I have found that this works for me. I have yet to see a crash using this system.

Quote: "Question: Does this error also affect arrays, memblocks, variables, and other such data structures, or just a/v data?"

I have found that arrays can also be destroyed. I kept getting "array does not exist or is out of bounds" errors even once I reloaded all the data so I had to re-declare the arrays and re-populate them to avoid crashes. I'm not so sure about other data structures though.

MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Jun 2012 10:06
Quote: "Quote: "Question: Does this error also affect arrays, memblocks, variables, and other such data structures, or just a/v data?"
I have found that arrays can also be destroyed. I kept getting "array does not exist or is out of bounds" errors even once I reloaded all the data so I had to re-declare the arrays and re-populate them to avoid crashes. I'm not so sure about other data structures though."


what if one was to use a physical array file such as an .xml file?

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 15th Jun 2012 13:07
Quote: "what if one was to use a physical array file such as an .xml file?"

You mean not storing the data in memory but always reading it from the HDD/SSD? Wouldn't that be kind of slow? Obviously the data wouldn't be lost but whether the file would remain open for reading I don't know...

MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Jun 2012 13:11
I do not think loading time can be a big drag specially not when using an unsynced loading method... but this issue is going to overshadow my efforts and I feel kind of evil asking a user not to lock their desktop while the game/app is running...

GIDustin
17
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 15th Jun 2012 16:17 Edited at: 15th Jun 2012 16:26
Quote: "Question: Does this error also affect arrays, memblocks, variables, and other such data structures, or just a/v data?"


It does not affect memblocks. That is how I am currently dealing with this. When I load an image, I then make a memblock from that image. Once media is lost, I recreate all the images from those memblocks. It seems to work fairly well.

Edit: Also, my arrays are never destroyed or messed with, and I use arrays for almost everything, so I am not sure why you guys would have problems with those...

And, saving every image as a memblock increase RAM usage, but at least my program doesn't crash!
Non Sequitur M
16
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 15th Jun 2012 21:13
Quote: "is that a good thing? "


Yeah. I was just stating a fact. Lol.

Quote: "I feel kind of evil asking a user not to lock their desktop"


As you should! I don't think people would like seeing this in the manual/readme:

"Don't lock your computer, don't press ctrl+alt+del, don't press alt+tab, and pray to whatever you believe in that another program doesn't take focus!"

Quote: "And, saving every image as a memblock increase RAM usage, but at least my program doesn't crash! "


Hmm... I never thought of that. Lol.
Marabas
14
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 16th Jun 2012 16:19
This has always been a bug bear in my coding history with DBPro. I wrote a number of applications both freeware and commercial and the only ones that made the cut were those created in "other than DBPro", i.e. Delphi, etc. This is a real shame since my most favorite language has always been DBPro (and now GDK).

I firmly believe that the reason people complained about software being buggy or unfinished was down to this issue.

My biggest mistake was writing my most commercial (i.e. the one that sold for the most money) graphics based application in DBPro. After a year of complaints about it being buggy, unfinished, unprofessional, etc, etc, I had to stop selling it. I never did get around to rewriting it in something else because things that are so easy in Dark Basic Pro are a pain in the wotsit to code elsewhere.

Please can we have a solution to this problem rather than just some workaround code. I want to write things in Dark Basic Professional and sell them online but this can't happen until this problem is squashed once and for all.

Sorry for my bad grammar but I just woke up and saw the thread and got excited at the prospect of this being finally solved.

Signature removed by moderator. Please do not give out the meaning of life in an open forum.

Login to post a reply

Server time is: 2025-08-09 02:25:15
Your offset time is: 2025-08-09 02:25:15