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 / Real problems for some users

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th May 2014 16:10
Hello all!

So my game, Malevolence, has come out on Steam Early Access recently and 95% of users have the game working just fine (a bug here and there, sure, but nothing which renders the game unplayable and can't be fixed in patches)

But there are a small number of users who simply can not run the game. It just crashes out for them whenever they do a particular thing.

Sometimes it's because they're trying to load a model. Sometimes it's because they're trying to load a sound file. Sometimes it's because of an MP3. All of the files are valid, uncorrupted and work perfectly well for 95% of other users.

I know that various systems are set up differently but surely DBpro uses some sort of standardized systems for loading things? I'll go into details on the different types of crashes and perhaps someone who's had experience with this kind of thing can shed some light on the matters? Any help would be greatly appreciated!

Sounds: A couple of users just can't load sounds when using the LOAD 3DSOUND command. Any file given to them causes a crash, despite the file working just fine for everyone else.

Music: Some players can't load in MP3s using LOAD MUSIC but can load OGGs with no problems. Others can't even load OGGs meaning the game crashes on first run since the title screen needs to play music.

Models: I'm not sure if this is related to the 2GB memory cap I've heard about but Malevolence loads maybe 80mb of models maximum at any given time and then instances (or clones where appropriate) the models to build the world up, but I get people just crash out "can not load model" for no reason despite them having been successfully loading that model during previous gameplay. I've even done memory mapping so that I can see if they're blowing out their memory and they're not. I've also checked my garbage collection and everything is being wiped correctly when I do my asset purges. No extraneous data is being left behind, I've done checks to make sure of it. It's just something going wrong with the actual LOAD OBJECT command. Is there some alternate way to load in models that perhaps I'm missing?

Sorry if this sounds brusque, I don't mean it to be at all. I just hope someone can shed some light on this matter. Surely others have had the project before, too? Any help at all would be great to have!


Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 13th May 2014 16:48 Edited at: 13th May 2014 16:49
This is short reply but hopes that helps..

Not sure if is it related, but Lee stated recently, the FPSCR blog, that there was a memory bug in Load Objects commands.

Does the code uses error recovery ? (I mean errors by the commands, and interrupting the program). An option would be to "retry" to load the faulty data.
IanM proposed this way:
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18&msg=2508739#m2508739

All hail the new flesh
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 13th May 2014 16:56
Converting all objects to DBO helped when I had a similar problem. As of loading objects, we definitely need an alternative. Converting all objects to memblocks, saving them in a sort a split form and loading them in would work I think.

"Get in the Van!" - Van B
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th May 2014 17:12
Actually I should have mentioned that, that all the objects are DBO.

Sometimes it's a "could not load image" command, too, despite them having loaded the image perfectly fine 10 minutes earlier.

The memblock option sounds interesting... And worth experimenting with!

Also, I didn't know about the load object bug, Le Verdier! Good to know I'm not going TOTALLY crazy. I'll look into that, too!


tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 15th May 2014 10:00
I have had random crashes of a different kind in the Newton DLL and it drove me mad for years. It was due to corrupt memory. A function was given an address and writing at a memory position it had no right to use (12 bytes too far).

Perhaps something similar is at play with DBPro's handling of media when it gets to a certain number of images and models, etc. ?

For your "can't load image X" generic error message, a certain number of retries should be done just in case it is a file access issue of some kind.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th May 2014 13:07 Edited at: 15th May 2014 13:10
Hi CumQuaT, congratulations for delivering reliable functionality as much as 95% of your users, I would say that is a remarkable accomplishment in any development platform.

I do value the experience of your team, and understand that you may be aware of what I will say, but I feel it would not hurt to establish a point to consider.

I feel it is really difficult to make good judgement on cause of error given the vast array of hardware and software combinations which could be at fault. I just cannot see any solid evidence from what you stated that the problem is caused by your application. The back-end of your software will include the Dark BASIC library 'middle man' for the Direct X API, the hardware and the operating system.

When an object fails to load on one machine and not another, the difference is not going to be your application or the Dark BASIC library; nothing changed there. The difference is the user's system or there combination of drivers leading to conflicts. The same applies to the music problem. I have seen a number of high profile games and media players crash due to codec and audio driver issues.

What I would do is try to establish a report of performance patterns per hardware manufacturer per driver build. Recommend that the users having trouble submit their specifications. This report needs to indicate an overview of the performance and will hopefully indicate a pattern indicating which drivers tend to cause the given problems; and any inconsistencies.

Hopefully such a report will draw a clear picture of what is really going on.

It may also be worth using an alternative music playback API and supply the option to enable it in your user option screen.

@Tiresius
Hi Tiresius, I have not seen comments from you for years!

Dimis
15
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 15th May 2014 14:10
Hi guys.

Highly interesting subject, since that's a problem that I have to deal with, eventually. I made a thread about it last Christmas, here's the link if you want to take a look, some explanations were provided concerning memory fragmentation among other things.
http://forum.thegamecreators.com/?m=forum_view&t=209351&b=1

I started to experience loading problems in my project, after my media files increased in size significantly. It seems that those problems start to appear when a game continuously loads / deletes files from memory. I managed to work around that problem by having all my media files preloaded at start. That made the problem disappear, although this is a temporary solution and it will only work for a demo, not for a full size game, since my media files will exceed the 2GB memory limit.

Using memory blocks could be a solution, but i am not sure, i haven't tested it yet.

@ CumQuaT. Please if you have any luck solving that issue please make sure to post about it. It is driving me crazy thinking that i will have to deal with it again.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th May 2014 17:12 Edited at: 15th May 2014 17:14
Hmm, interesting. It will be a good idea to start creating a stress test program to find out where the problem is. Have it continuously load and unload certain assets to attempt to simulate the resource loading process without having to compile unrelated code.

Out of interest, are the assets which cause problems particularly large in size, number of limbs, number of vertices etc? Is the exact same files every time, and the same files on each PC?

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 15th May 2014 18:29
Hello all! Thank you for the tips. Chris, that's a smashing idea and I do believe I'll take it on.

I've been playing around with the MatrixUtil error handling routines and have been building up a modular system which should help speed things along massively.

If my experimentation with it works well, then I'll definitely re-post the code here for all to use, as my early experimentation has been EXTREMELY positive...

Watch this space, people... Watch this space...


Dimis
15
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 15th May 2014 22:38
Yeah, the stress testing program is a good idea.

Chris, here's the thing. in my game, problems initially appeared when i started to use enhanced animations and normal mapping, with high res textures(2048x2048), which i did at the same time. the more animations and high res image files i have been adding, (more memory consumption) made the crushes happen more often. although i have optimized all my models enough, so that they can use shaders. And no, it was not the same file that caused the problem, it was always a random media file that failed to load.
So i do believe that that this is a memory related problem. or maybe it is a combination of things, i don't know. all i can tell is that it can happen with any type of media file, image, sound, animation, as long as it is some MB large.

Good luck solving that problem CumQuaT, i will be waiting patiently for your results.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th May 2014 16:54 Edited at: 16th May 2014 16:55
Thanks guys, I hope all goes well. The trick with automated test procedures is to try to simulate the kind of situations which tend to cause you problems, minus the time it takes to compile the whole program.

@Dimis
Something smells fishy; a 2048 texture is nothing heavy. You only have two characters on the screen! Run a test program to exclude certain features of the characters to pin point the burden.

Now I have had no luck getting Enhanced Animations to work with my characters, so you are further ahead then I am in Enhanced Animation expertise. But I know a thing or two about textures and shaders. Most likely your graphics card can load textures at 8192 pixels, so 2048 pixel image should be light work. Use the Get Maximum Texture Width()/Height() commands to confirm.

The most memory a 2048 texture can consume is about 16 megabytes. Most of the latest graphics cards have at least 512 megabytes of video RAM; any serious video gamer is going to spare an extra few notes for 1024 megabytes. So loading no more than 20 or 30 of them should be at worst impossible on an old machine, but no big deal on todays hardware. Well, as far as I know, texture size does not consume system RAM whilst running in the 3D simulation. It only consumes RAM whilst being loaded or manipulated by the CPU; I could be wrong...

Where possible have objects share texture space, delegating image atlas locations for different types of objects; for example a top left part of a texture could be wood, and the bottom could be metal. All metalic and wooden objects could share these textures, reducing the number of load calls, loops, files, texture stages, updates, the list goes on.



As for geometry it is best to avoid loading big .DBO or .X files. Besides stalling the program if you are using a single process, it is a bit messy. The larger the file the more chance you have of data corruption that is difficult to pin point.

As far as I know if you happen to have lots of RAM used up by your program, and you attempt to load big files, the parsing process during the load call might consume more RAM than one realizes. Think of RAM as a number of employees who need to recieve a delivery of goods then present it to the customer. Lots of employees are required to unpack, log, count and put away the stock, but only one needs to present the goods to the customer. If you are limited to a few employees, taking big deliveries creates a backlog, and with memory backlogs leads the crashes.

Break up the world and complex characters into separate objects, then join them by origin, side by side or by adding limbs in code. I know that CumQuaT already knows this already since his game is contains a huge world. Instance over cloning; where possible vertex repetition over instancing (You can repeat vertices using shaders or vertexdata commands)

With shaders, try to compile them in assembly code where possible using FXC.exe in the DX9 SDK. In the best case scenario these compiled shaders load really fast and consistently. Keep the loops and branch statements to the absolute minimum. It sounds funny but it is true, for every FOR loop or IF statement you write in your shader, you actually increase the chances of it crashing not during gameplay but during the load call! There is a lot of compilation and testing going on during that Load Effect call. You may choose to bypass a number of calculations during the load call with the DoNotGenerateData parameter.

Good luck

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 20th May 2014 14:30
Hi guys! Not a fix yet, but a very interesting little tidbit to know...

People can download this file and patch any executable to make it large address aware! I had an older test computer which could only run my game at 4fps run it at 35fps after patching!

http://www.ntcore.com/4gb_patch.php

Use the new 4GB application patcher from NTcore, which skips the patching step in the later part of the above mentioned article. Take note to run the program as an administrator if Window's UAC is turned on (by right-clicking the exe file and selecting "Run as Administrator").


Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th May 2014 15:49
I've seen issues with 3D sound on some PC's, even ones with decent sound cards - I think it's a driver issue somewhere.

TBH, I think the only workaround is to have standard sounds as a backup - like let the user disable 3D sound, and use normal sound commands instead, maybe even fake the 3D a bit, with volume and panning. It depends how you've handled sound effects. Personally, I always make a seperate sound effect system, so I call a function to play a sound for example, then I can centralize any controls there - like setting master volume, maybe even tweaking the frequency so identical sounds don't sound so identical.

I am the one who knocks...
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 20th May 2014 16:30
@ Van B
True

@CumQuaT
Interesting concept.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th May 2014 17:34
Ok, so I've got something sortakinda working. Here's the system I've been using. It's a modified version of the Matrix1Utils code (of course it works fine if you re-write it to work with anything else, not just images):




So to use this, instead of typing:

LOAD IMAGE "MyPicture.jpg", 1

I would type:

LOAD_IMAGE("MyPicture.jpg", 1)

This will attempt to load the image up to 100 times before crashing out. If the problem is a missing file, this entire process happens in the blink of an eye, but I found that the missing file crashes were happening in seemingly momentary lapses in the computer's memory. Generally after you try a few more times it sorts itself out.

In addition to this, I patch all my EXE files with this:

http://www.ntcore.com/4gb_patch.php

Which, as I mentioned earlier, makes your application 4gb memory aware, giving you much more memory to play with.

Is it a perfect solution? Absolutely not.

But it seems to work for the most part, and it's the best I could come up with for this solution. There simply seems to be something inherently flawed with DBPro's memory handling subsystem which causes this

Sorry I can't be of more help, guys, but this is all I've got.


Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th May 2014 18:17
Interesting.

I wonder whether there's something else going on in Windows behind the scenes. I have strange refresh issues on this laptop which I haven't sorted out yet.

For example, if I open a folder in Windows and delete a file then on every other system I've had the file is deleted from disk and the displayed folder contents list is updated at almost the same time. On this laptop most of the time the list is updated so the deleted file no longer appears (normal behaviour - or at least it used to be). However, quite frequently it doesn't update and it seems the file hasn't been deleted. - but it has. So you get a Windows error if you try to delete the file again, open it, etc. I then have to explicitly refresh the window for the visual list to be updated.

A second example, again on this laptop, relates to this forum. I've noticed that I have to hit the IE refresh button before things like the list of unvisited threads gets updated. Is there a setting somewhere that needs fixing or is there a timing issue on this machine?

I mention these because your problem seems to have some similarities. Has anyone else seen these refresh/timing issues on W7 or laptops?



Powered by Free Banners
Dimis
15
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 31st May 2014 19:22
@CumQuaT
Ok, I will give it a try later, after i am done with my demo and move on to the rest of the game.

@Chris Tate
I did some tests. As i said before i can fit all my media files in memory, if i load all of them at the beginning of the program and nothing goes wrong, no memory issues of any kind. Problems start when my program starts to delete/load files while it is running. I hope CumQuaT's suggested method will produce positive results.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st May 2014 19:43 Edited at: 31st May 2014 19:44
Quote: "Problems start when my program starts to delete/load files while it is running.
"


Do you mean delete resources from memory, or from the hard drive?

PS: Why is your WIP still locked, are you not permitted to have it reopened? Might be worth starting a new one.

Dimis
15
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 31st May 2014 19:51
deleted from memory, not from the hard drive.

i didn't bump my thread and it got locked... again.
maybe i should start a new one, the first one served it's purpose anyway, i guess.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st May 2014 23:23 Edited at: 31st May 2014 23:36
Go for it man, I'm eager too see your latest work.

You might as well not delete anything from memory whatsoever; SO WHAT if the game uses up 800 or so megabytes of RAM; if anything that would be prefered because there is no need to wait for anything to load during gameplay. These days it is quite acceptable for a video game to consume at least 800 megabytes of RAM.

We DBPRO developers often dwell too much in the past, one of the flaws of reading 10 year old documentation. Most PC's have at least 4GB RAM.

Anything more than 1.5GB RAM to run a video game is down to unoptimized resources IMO, you should not need more than 1GB of RAM to make a good game; afterall being a good game has little to do with RAM usage as you no doubt know.

Shaders can help you reduce your content count by calculating geometry and textures on the fly without requiring more asset loading. A decent sound library like FMOD can generate sound in a similar fashion.

One of my articles to go with my next project update talks about interchangeability; that is when one creates an additional interchangeable asset, one multiplies ones possibilities; and when one makes use of modular content, one can generate new content rather than loading new content.

Login to post a reply

Server time is: 2026-07-06 00:10:37
Your offset time is: 2026-07-06 00:10:37