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 / Game Randomly stops running?

Author
Message
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 17th Apr 2013 17:55 Edited at: 17th Apr 2013 20:46
So I'm trying to make a massive game but I keep running into this issue. When I load in my 150th object it stops running and disappears without a error report or anything. Any ideas? I'm thinking it's the max polygon count and if so anyway around it?

Correction: 118 (84 buildings, 1 blitz map (256x256image*120) & The rest are knights)
Arbrakan
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 17th Apr 2013 23:08
How do you load your objects ?
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 00:48
Quote: "I'm thinking it's the max polygon count"

I doubt it's this. Each limb has a vertex limit, but DBPro itself doesn't. You could load a million 65536 vertex objects of you had enough (V)RAM.

It could be related to anything. Perhaps the object is corrupt in some way. if you could, try loading the objects in the reverse order and see if the issue occurs with the same object, or after loading the same number of objects.
Also, see if you can slow down the object loading, and watch your RAM usage in Task Manager to see if you're not running out of memory.

You could also try error logging to see exactly at what point in the code it's failing.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 19:27 Edited at: 18th Apr 2013 19:47
If it is the RAM what would be the way around it without having higher specs?

@Arbrakan

Quote: "How do you load your objects ?"


I load them using "load object "Knight.x",Obj" when I click the right mouse button but I made it sure it just loads one each click.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 19:54
Quote: "If it is the RAM what would be the way around it without having higher specs?"

Use lower polycount objects.
Load fewer objects.
Use smaller textures.
Load less sounds/music.
use a lower screen resolution.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 20:04
Okay it isn't the RAM then because I have used a lower resolution and it didn't make a diffrence
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 20:08 Edited at: 18th Apr 2013 20:09
You can't lower the screen and dismiss RAM as an issue simply because it didn't instantly fix your problem. The screen uses video ram, not normal ram anyway. It could still be an issue. (Granted VRAM would be a very minor part)

Have you tried loading less objects? (Since the issue occurs after loading the 150th object)
Have you tried reducing the polygon count?
Have you tried reducing texture sizes?

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 20:24
Okay i just check and my memory got to 2.71GB used so it quite a bit under but it stopped because it couldn't load the 3d object which it loaded many times before.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 20:37
It's possible the application is running out of available memory.
Have you tried reducing the polygon count? You need to see if this is an issue as DBPro is capable of loading millions of objects at once.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 21:29
Okay it diffidently isn't the max polygon count because I spawned in 9915 squares and it was high with okay frame rate it only stopped because i had a object which was that number so it caused a error.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 21:32 Edited at: 18th Apr 2013 21:35
Quote: "Okay it diffidently isn't the max polygon count because I spawned in 9915 squares"


You still haven't said how many polygons each object your loading has. You need to add up the polys in on object, and times it by 150.
The 9915 squares (Cubes?) have 118980 triangles, if this number is lower than the other number, then it could still be a problem...

(And you haven't actually directly answered any of the questions I've previously asked, only made assumptions about factors you haven't fully explored.)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 21:41
It's above as it's only 33 knights with 741 Vertices so 24453 in total.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 21:46
Quote: "118 (84 buildings, 1 blitz map (256x256image*120) & The rest are knights"

What about the 84 buildings, and the 1 blitz map....?

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 21:52
I didn't change them at all between the tests
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 22:48
The polycount of each object.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 23:06
What do u mean?
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2013 23:21
You have only told me the poly count of the knights. (24453)
But you haven't told me the polycount of the 84 buildings, nor the blitz terrain. Add them all up, and see if that figure is greater than the figure for the 9915 squares (I assume you meant cubes?) (Which is 118980 polys)

Only when you know what the total polygon load is for your entire scene, can we determine if that is causing your problem.

Also, when you load these objects, are you calling Load Object 117 times, (once for each building and knight) or do you save yourself a lot of hassle by calling load object once, then instance object for the remaining objects. (Instance object will share just the one object, and will drastically reduce the RAM usage of your game. (Due to only loading 1 building, and 1 knight, but displaying many of them. Think of it like a sprite, you load one image, then can paste sprite many time using only one copy of the image. Instance object does the same thing.)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 23:32
I am calling load object each time so I will change that. Also I though the buildings wouldn't matter as they are used in both of the test I ran. I'll try the load once thing now
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Apr 2013 23:41
Thanks that worked amazingly. It adds the object so much quicker and such a higher fps. Is there any reason you would do load object after doing it once and why does it fix the problem.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 19th Apr 2013 00:28
Load object adds object into the scene.
Instance object will copy existing objects, taking up 0 extra RAM.
There is also a clone object which is a bit of both. It creates NEW objects from existing objects cutting loading time.

Told you it was a RAM issue. lol



1 word of advice. Instanced object can be positioned, rotated and scaled, but they cannot have different textures from the original object. Basically, every instanced object will look exactly the same, besides it's rotation and scale. (There's also some issues with animating instanced objects, and I believe shading them too.)
Instancing objects is a good thing though.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 19th Apr 2013 09:46
Thank you very much and yea you were right; I forgot completely about RAM. Now I can get to nearly 5000 knights and my entire world which is 30720x30720(what ever the measuring is in dbpro). This is all shown and still getting 47fps
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 19th Apr 2013 12:13
I'm glad I could help.

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: 19th Apr 2013 13:05 Edited at: 19th Apr 2013 13:06
It's possible that instance object will cause you a few problems later on, because a lot of data is shared between all of the instanced objects (rotation and scale for example).

I recommend using clone object instead, and additionally telling it to use the animation data from the original object by setting the flag to 1. This will save a lot of memory if your knight has animation:



I had the same problem with my RTS, and that solved the problem.

Quote: "If it is the RAM what would be the way around it without having higher specs?"


Objects are loaded into VRAM, not RAM. The task manager will tell you nothing about how much Video-RAM your GPU is using, you'll have to install a GPU monitoring tool, such as MSI Afterburner.

TheComet


Level 91 Forumer - 9600 health, 666'666 keystroke power (*2 coffee)
Abilities: sophisticated troll, rage
Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 19th Apr 2013 17:41
Thanks everyone and 'TheComet' it doesn't work after 185 objects.
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 19th Apr 2013 18:37
Is it at all possible for you to separate the code in question and post it up here with test assets?

Flamertor
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 19th Apr 2013 22:14
Well Chris the media is from the fps packs so I can't upload it without breaking the term of use. Another thing is the instance object thing works just fine and I can rotate them etc. So I think I'm fine Thanks for offering your help though.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Apr 2013 14:18
Quote: " Instanced object can be positioned, rotated and scaled, but they cannot have different textures from the original object. Basically, every instanced object will look exactly the same, besides it's rotation and scale."


I'm sure it is possible to make them look different though.

Login to post a reply

Server time is: 2025-05-17 18:56:21
Your offset time is: 2025-05-17 18:56:21