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 / complaining about windows 7 and screen invalid

Author
Message
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 13th Mar 2013 03:20 Edited at: 13th Mar 2013 04:08
why is it that my code works fine with windows xp, even vista....then i move it over to windows 7 and it only catches screen invalid randomly....mostly failing?

I dont mean the screen invalid switch either.... that detects just fine....

im talking about when you catch stuff is missing from memory....and then you start the task of reloading everything. even testing to dump graphics if its there...crashes some times with windows 7.

anyone else finding the same thing? i am also running a 64 bit windows version..... i realy dont know what to say.

My new model prop app was holding up to screen dumps realy good yesterday.....and now today it doesnt hold up at all.

the crappy thing is that i catch the screen dump every time... i can get it to write a message saying "yup screen memory gone" but when it comes to reloading and setting all back up....it only works randomly on windows 7......grrr

SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 13th Mar 2013 03:23 Edited at: 13th Mar 2013 04:05
if a mod or tgc team member would like to see code.....i dont realy want to share it but will to one of them.....because this is realy bad if i cant get the dang thing to reload from a screen dump.

like i said...it works fine on xp,vista... (i will hold to my word that its un crashable on those 2 systems) but does not always work on 7....and have no idea about 8



edit: here is my findings on debugging the thing

it crashes on a line that tests to see if a mesh exists....and deletes it if it does...

this line crashes:
Quote: "
if mesh exist(250)=1 then delete mesh 250
"


now it should tecnicaly be safe to test if the mesh exists....even though i know it doesnt.

i have tried to comment out the line as well and crashes on the line that makes the mesh from an object..... and yes the object has been reloaded already.


What realy sucks.....is if im making objects with limbs and meshes and thats having trouble.....what about if i had vertex data locked on a screen dump. I have a feeling this is even gunna be a worse problem.



edit again:
also i know the code works well because the same code is used for my edit undo/ edit redo.... wich work just fine all the time. when my screen takes a dump....my application simply loads in the last undo file saved. Again works just fine on xp,vista all the time....but works randomly on windows 7.


here is a screen shot of crash....with the loading window in there and camera reset and the grid reloaded... its showing that i caught it. but it doesnt always like using meshes after a dump has happened.

Attachments

Login to view attachments
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 13th Mar 2013 13:43
well like most people hafta do..... im just gunna code a work around.

Ill just make a crash file and have the program delete the crash file if it manages to reload from a screen dump....and if it doesnt i will have the program look for the crash file on startup and reload the scene where it was at.

Its just a bummer a guys got to do that just to make this work.

If im spending hours drawing something and it crashes....well id rather be able to load it back where it was then start over from scratch.

Stab in the Dark software
Valued Member
22
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Mar 2013 23:45
We are currently developing a game engine with resource management for a lost device scenario.
So far we have not had any issues on Windows 7.
I could be that it is not actually crashing on that line, DBPro is notorious for giving the wrong line number.
Are you using hard coded obj and mesh numbers or are you using "Find free ...." commands from Matrixs1 dlls?
There was a problem with Matrixs 1 dlls, but he fixed it. If you are using his dlls check the version.
Link to post about bug.

http://forum.thegamecreators.com/?m=forum_view&t=195737&b=1



[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 14th Mar 2013 01:02
i did some testing and it holds up right to that line. dbp actualy doesnt report a line either ...just crashes. Now that you mention matrix.dlls i am using those to create new objects from vertex/index info.... and then making meshes from those objects to add back as limbs. maby its related to that but im not sure.

also i am not using find free from that package. I am however using your fix : SD Repair Hierarchy #

now this command...was it only needed on objects loaded in from a dbo format? will it harm anything if its not?

Stab in the Dark software
Valued Member
22
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Mar 2013 01:58
Quote: " I am however using your fix : SD Repair Hierarchy #

now this command...was it only needed on objects loaded in from a dbo format? will it harm anything if its not?"



SD Repair Hierarchy refreshes the parent relationships for the object.
We determined that this problem was occurring when loading; ".3ds",".x",".dbo" files.
Calling this command will not cause any problems.

How often does this crash occur?

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 14th Mar 2013 06:25
Quote: "How often does this crash occur?"


well.... it happens about 1/2 the time.

Same scene ...everything and then i purposly hit ctrl alt del to dump the memory and go back in.

I have my load screen pop up everytime telling me that my code has captured the screen dump and begins to test objects and delete if they exist....then it loads all new back in.

from what i've tested....as long as i dont need to use the mesh stuff....it wont crash but unfortunetly the way my software works it uses several limbs to make up a single object for easy animation support.

Its funny that i can actualy create a dump file and then try to load stuff in and if it does crash....at the start of my app it will look to see if that dump file is there and load it. I think this is the best fail safe for me so any drawing work will not be lost on a screen invalid dump.

Thanks for the info on that command.... i just know it fixed a problem i had with connecting limbs back where they needed to be.

cheers!

Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 24th Mar 2013 03:42
Here's a proof of concept bare bones example of recovering from screen invalid.
http://forum.thegamecreators.com/?m=forum_view&t=202959&b=1

It requires the game be programmed a specific but non-limiting way.

SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 8th Apr 2013 05:42
unfortunetly....it is coded to recover correctly.... and it catches the hang every time. it just doesn't always like making a mesh afterwards from bare bone geometry. (that's the only thing that's hanging it on my app) but may have something to do with the matrix dlls.... anyways what I've done is had it create a dump file incase it crashes.....this way if it does it just loads the dump file up and nothing will be lost.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Apr 2013 18:32 Edited at: 8th Apr 2013 18:33
This "suggested method" for testing for a device reset is not well thought through at all.



The reason why? The code above assumes the device reset occurs here:



And whoever thinks that it does occur there every time is sadly mistaken. A device reset can occur at any point during runtime in a DBP application. For example, if it were to happen here:



The program will not catch it in time and crash.

The reason why it's working most of the time is because the program spends most of its time refreshing the screen (the "sync" command). Thus, the chance of a program crashing can be calculated with the following formula:

a = time spent processing code
b = time spent refreshing the screen
x = chance of crashing in %

x = 100*a/b

TheComet

Taumatawhakatangihangakoauauotamateapokaiwhenuakitanatahu is a hill
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is a town
Chargoggagoggmanchauggagoggchaubunagungamaugg is a lake
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 10th Apr 2013 06:09 Edited at: 10th Apr 2013 07:02
Thanks for looking into my code. I have tested it to work, and it seems to work perfectly.
I will check into this later tonight, I'm on my phone right now.

Short answer is this: You are right about the screen device being lost any time. But you're wrong about it mattering. It doesn't matter. The game assets (images/objects/sprites) are only flushed when sync is called. More specifically only when the first sync is called after the device has been recovered.

If you lock your screen in windows, the program will continue to operate without interruption. When you unlock it and come back to the desktop, it's that first sync that then flushes the game assets. Since you start accessing non-existent or deleted assets the program crashes. So testing for a deleted image right after every sync can detect the problem allowing recovery methods.

I have tested and observed this specific behavior. The code appears flawless. I will check again and welcome any assistance.

Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 10th Apr 2013 10:34 Edited at: 10th Apr 2013 10:40
Quote: "This "suggested method" for testing for a device reset is not well thought through at all."


I just tested it. I put a Sleep 10000 right where you suggested it would fail. This guarantees the device is lost at that point. The code works fine.
I added a counter that keeps adding up on screen. When you unlock Windows and come back to the Desktop, you can see it was counting all along. The crash occurs the moment you return, and the program recovers perfectly.

The code is bulletproof, and works just as I explained above.

http://forum.thegamecreators.com/?m=forum_view&t=202959&b=1

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Apr 2013 17:23
@ Mage

Quote: "Short answer is this: You are right about the screen device being lost any time. But you're wrong about it mattering. It doesn't matter. The game assets (images/objects/sprites) are only flushed when sync is called. More specifically only when the first sync is called after the device has been recovered.

If you lock your screen in windows, the program will continue to operate without interruption. When you unlock it and come back to the desktop, it's that first sync that then flushes the game assets. Since you start accessing non-existent or deleted assets the program crashes. So testing for a deleted image right after every sync can detect the problem allowing recovery methods."


You are right. It seems that even though the reset occurs at any point in time, it is only acknowledged after calling "sync".

I wonder if it's still OK that the program is using a lost device for the rest of the code before "sync" is called? From what I've tested so far, it doesn't seem to matter.

TheComet

Taumatawhakatangihangakoauauotamateapokaiwhenuakitanatahu is a hill
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is a town
Chargoggagoggmanchauggagoggchaubunagungamaugg is a lake
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 11th Apr 2013 01:18
From what I understand of the issue it doesn't matter. However I haven't tested absolutely every command and plugin. Some plugins are picky about how things are deleted. Enhanced Animations seemed to crash for me each time an object was deleted before it was unloaded from the plugin. I haven't tested it, but it's a good candidate for a plugin that won't work. However there might be a work around or maybe no issue at all.

Aside from a plugin that syncs the screen for you or is picky about deleting deleted assets, I can't see plugins being a big issue.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Apr 2013 18:35
DarkPHYSICS will whinge if the graphics object is deleted before the physics object. (And I'd assume DarkDYNAMIX will too)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Apr 2013 19:01
From looking at the disassembly, I wonder if it's possible to inject a call to a lost device check. DBP seems to do some error checking after every command executed anyway, so if you were to include a device lost call there...

TheComet


Level 91 Forumer - 9600 health, 666'666 keystroke power (*2 coffee)
Abilities: sophisticated troll, rage
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 12th Apr 2013 03:09 Edited at: 12th Apr 2013 03:28
Even in my code.... I test all images and objects before I try to access them.

eg

if image exist(1)=1 then blah

or if object exist(1)=1 then blah

or if camera exist(0)=1 then blah

See my code is fail safe..... I do not use screen invalid() to catch it either cause at the start of your app it gives false values.

Also from switching in and out of other apps or minimizing it gives false values sometimes.

I always rely on media missing to go and reload everything again and redraw everything again.


However it is possible the program could still crash between media existing and suddenly not being there. but I have never encountered this error ever....



if I can pop up a message telling me yup... screen invalid... this means I caught the action. This is the case for my application. It catches it every time but seems to dump if I try to make an object from a mesh that I make sure is deleted or erased first before reloading and trying to use again.

and its random.....sometimes it works.....sometimes not.


If you can make your code run...with media missing and objects missing and it doesn't crash...then you have a solid foundation to catch a screen invalid

eg.


I know.... exactly how to catch a screen invalid. This mini code above proves it. all my code is based similar to what you see there. what im saying is that there seems to be a bug with dbp with making meshes from the command (make object new) from the matrix dlls and then trying to make a mesh from that object.....crashes sometimes on windows 7 but does not on xp or vista at all!!!

SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 12th Apr 2013 03:37
humm....oddly I cant remake the error on a small scale.

ill keep testing to see what I can come up with. but I think I can prove it.

Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 12th Apr 2013 05:41 Edited at: 12th Apr 2013 07:05
Quote: "See my code is fail safe..... I do not use screen invalid() to catch it either cause at the start of your app it gives false values."

Yeah that command is pretty useless.

Quote: "Even in my code.... I test all images and objects before I try to access them."

This isn't wrong, and this can be a convenient small scale technique. For example having a character portrait for characters in dialog. You can generate pictures as they are needed, then keep them for any further use.

The problem with this technique is that it doesn't scale well. On a large project you end up with spaghetti code, or abort/recovery clauses everywhere. On an extreme scale it can start to affect performance. Instead if you organize your assets well you can simply catch the screen loss and procedurally reload everything in one clean/clear section of code.

On top of all of that, lets look at practicality. Lets say reloading everything takes 40 seconds. If you don't reload everything in one bulk load like I suggested and instead reload things as they are accessed in game code, your game ends up with a big performance hit as the game attempts to play and choppy load assets at the same time. You can even end up with all out stuttering or momentary pauses between frames. You can't background stream loading in DPB without using some type of threading plugin. The performance hit will likely last longer than the bulk load would have. I would consider this a worst case scenario.

You need to avoid negative player experience.

One more thing: If you are going to reload everything bit by bit when it's accessed in the game code instead of doing a single managed full reload, parts of the game can disappear. Rocks, trees, anything in the game world that the code doesn't touch won't get reloaded.

Login to post a reply

Server time is: 2025-05-17 16:23:46
Your offset time is: 2025-05-17 16:23:46