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 / App takes 178 meg to run - eep!

Author
Message
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 10th Apr 2011 19:36
Hi folks

My latest masterpiece ( :-| ) uses quite a lot of media. I happened to have Task Manager running while working on it today. It used 178 meg of memory!?

I remember when my Amiga A500 had 512K!

Is it unusual for a DBP app to have such a large footprint? Should I be trying to reduce it by only loading media in when I need it, then deleting it from memory - rather than loading all of it at once at the start of the game?

Thanks for any advice.

Jambo
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 10th Apr 2011 20:14
178mb isn't really a lot for a game, I wouldn't worry about it.

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Apr 2011 23:37
I don't even have half my game assets loaded yet, and mine takes up just over 1GB. 178Megs is nothing..

Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 11th Apr 2011 02:17
Well I feel quite relieved about that

Cheers for the messages.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 11th Apr 2011 12:23
Well, what caused the surprise? Do the media looking at them in their folder weight much less than 178Megs?
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 11th Apr 2011 20:33
Yeah, the media folder weighs in at 18.1MB!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Apr 2011 22:20
Some of that may be compressed. Images and .X files tend to be.

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 11th Apr 2011 22:46
oh...

Well, my guess would be that it is Microsoft's fault. A prime example of not even trying to use less space, since the hardware industry is advancing at such a high speed.

You know, building OS's which require 1G ram as minimum requirement and such.. Blah...
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 12th Apr 2011 00:36
Quote: "
Well, my guess would be that it is Microsoft's fault. A prime example of not even trying to use less space, since the hardware industry is advancing at such a high speed.

You know, building OS's which require 1G ram as minimum requirement and such.. Blah..."

How is it Microsoft's fault? If anything, the problem is that Dbpro is not efficient...

Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 12th Apr 2011 22:28
It's pretty normal for software of any kind to use at least as much memory as the totality of its component file structure occupies on the hard drive. If it's too much data to store in memory at one time, or if takes too long to precache the whole lot in advance, you'll need to write a hotswap technique that will load in assets as you need them, and dismiss them as they expire. You don't need to load the "Low Health!" warning image until you're low on health, and when you've healed yourself you don't need that image loaded anymore. When you're in a room that doesn't have any Battle Orcs in it, the program won't require the battle orc model to be loaded in memory. Once you approach the doorway to a room that has a battle orc in it, load up the mesh. When you leave the room, free it up again.
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 13th Apr 2011 03:38
Thanks to all for the helpful input.
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 13th Apr 2011 05:05
@Agent, that would be a lot easier to do if DBPro had threading capability. Then you could load and delete assets dynamically without pausing your entire program for it.


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Apr 2011 13:25
Are you using a lot of variables or arrays? They can take up quite a bit of space...

TheComet

Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 13th Apr 2011 18:12
Dar, that's true, but it's still the industry standard technique to solve this problem, and DBPro can do it just fine without threading.

Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 13th Apr 2011 20:09
Reading all the messages above, it would seem like the best practice (if the media is reasonably small, say <50MB) is to load all the media at startup, but then create and delete objects as they are needed. That would have to be done 'intelligently' tho, i.e. hiding and then reusing objects like bullets, rather than deleting them when they're out of sight.

Login to post a reply

Server time is: 2026-07-17 14:00:10
Your offset time is: 2026-07-17 14:00:10