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 / 3D Objects not shown! Video memory problem? When I press Alt+Tab or Windows Key then objects appear!

Author
Message
Rylex
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 24th Nov 2013 00:10 Edited at: 24th Nov 2013 00:21
Hi everybody,

I would like to ask if anybody here has had a similar problem like me at the moment. At first I'd like to mention that the problems occurs on my Atom Netbook with 2GB RAM and 256MB integrated graphics. DarkBasic itsself says I have more than 50MB free video memory and more than 260MB free total memory.

The problems appears on other low graphics systems, too.

When the application starts (after I change the screen resolution) I empty the video memory using the following code:



After that I load different images. Some are 1024x1024 used as textures. Others are just 256x256 or 512x512.
Then I create objects like trees and stones and seagrass and so on using meshes.

1. I load the mesh file
2. I load the texture
3. I create a new object with the mesh from 1. and use the texture from 2.
4. I always delete the not used meshes and textures after the objects are created. But doing so does not make a difference. If I don't delete them nothing changes.

The game does not run smooth but that's because of the old system. Now the interesting part: The 3D objects are not shown even though there is free video memory (50 MB) if I use some smaller textures for the objects then some of them are drawn and some are not:

The game looks like this from above:


Then I press the Windows Key or Alt+Tab ... and after that I go back to my game... and guess what? All objects are correctly being displayed!

Take a look at this picture:


There are 1500-1700 objects in total that are being loaded. But why are they not displayed when I start my game? The game runs fullscreen but Windows mode doesn't help. Using windowed mode the objects are not displayed and pressing Alt+Tab does not help at all. Using stay active in the code doesn't help.

I've tried both DarkBasic 1.13 or the latest 1.21 version - it's exactly the same error. I've also tried different setting for the setup.ini... no luck so far!
Does anybody know a trick here? On a normal up to date system there are no problems... but I want my game to run on slower systems, too and don't understand how DarkBasic uses textures and RAM and video memory.
Yes 1500 objects are a lot of objects... When I use the make object method with the meshes ... is this the best way to do so? I don't want to load too much different images. Is this the best way to make sure the texture is only loaded once and then used for different objects?

I tried to use image flag 1 or 2 for direct loading or texture compression but it didn't help. Using texture compression has a bug, too. When you load an image with texture compression for example on numer 100 and map this image to a matrix. If you change the screen resolution and then try to load the image again on number 100 using texture compression the game crashes. Even if you try to delete the image after chaning the screen resolution the game crashes. You can delete the image as long as you don't change screen resolution.

I use the latest Intel driver and Windows 7 32-Bit.
A friend of mine has exactly the same problem with my game on a similar Atom Netbook but his system is newer. On other older systems some objects are shown and loaded - but not all are displayed when the game is being started. You always need to press Alt+Tab.

I would be glad if anybody could help me here!

Thank you very much!

Rylex

P.S. This is the upper part of my setup.ini
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 25th Nov 2013 15:14
should test it on other computers. Can you make an executable file and download it?

DirectX 9.0c (February 2010)/ DBClassic v1.20
Rylex
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 25th Nov 2013 21:06 Edited at: 25th Nov 2013 21:31
Hi Silverman,

I tested it today on an old Pentium 4 with 3.4 GHz and an old Geforce 8600 GTS 256 MB. All objects were loaded and the game ran with approx. 17-25 FPS/s on 1920x1200 resolution.
I still need to optimize the objects and reduce poly count.

What I experienced on my Atom Netbook:

When I start the test the following numbers are shown on status inside my game:

Free video memory: 47906816
Free Total memory: 249233408

When I press Alt-Tab and switch back to game then the following numbers are shown:

Free video memory: 53731328
Free Total memory: 255057920

so the funny thing is that BOTH (!!!) free video memory and total free memory increased exactly 5824512.

I don't want to provide a public test but if you are really interested in testing then I'll contact you with a private message.
Thanks!

Rylex

Edit: You've got private message with details to a test download. Thank you!
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 26th Nov 2013 14:48 Edited at: 26th Nov 2013 18:46
hi Rylex,

hey, I did not know you could send private messages, thank you!
my computer:

OS: Microsoft Windows XP Professional (version 5.1.2600; build 2600)
Processor: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz (architecture: x86; 1997 MHz)
Physical Memory: 2038 MB
Video: Mobile Intel(R) 945GM Express Chipset Family(shared memory)
DirectX* Version: 9.0
Minimum Graphics Memory: 8 MB
Maximum Graphics Memory: 224 MB

I very often get the same error: Error 93, so the game starts 1 out of 10 times(work only in windowed mode, in my setup.ini: [STARTUP]
window=1). I see all objects at startup. It is smooth, average 20 fps. And graphically, it is very good!

When I start the test the following numbers are:

Free video memory: 0
Free Total memory: 166543360

When I press Alt-Tab and switch back to game:

Free video memory: 0
Free Total memory: 172367872

the total free memory has increased from 5824512 like you!


EDIT : I rebooted my PC and it works well, there is no problem to launch the game now!

DirectX 9.0c (February 2010)/ DBClassic v1.20
Rylex
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 28th Nov 2013 18:09
Hi Silverman,

Thank you very much for your testing and the feedback!
Does the game itself now work with fullscreen mode or do you still only get windowed mode? I mean after the restart.

I'm glad you like the graphics so far... but this will all still be improved. I guess it's not bad for an old DarkBasic Classic game.

Perhaps you have some friends who could help here or have an idea about this memory problem.

My hint for you: Press "v" when the game starts and then "p" for pause. Then make a screenshot with the printscreen key. Then Press Window Key or Alt+Tab and paste the image into a photo program. Now switch back to the game where top view is still active and press Printscreen again and paste the new image into the photo program. If the images are the same then all objects are loaded.
If not you will clearly see the difference.

Best wishes

Alex

Login to post a reply

Server time is: 2024-04-18 10:21:49
Your offset time is: 2024-04-18 10:21:49