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.

Dark GDK / resource management. Any help or advice most appreciated!!!!

Author
Message
Blue Rogue
17
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 17th Nov 2007 19:20 Edited at: 19th Nov 2007 19:29
hi everybody, I've not been able to post for a few months due to working away and the like, but now am free for a few months so have some time to crack on.

My question is how do you guys go about manging resources in game, images, models, sounds etc. I have my own class that assigns id's, creates, destroys, changes the resources as needed, all this is done through a custom dictionary. Ive structured it to get items through name or number and when ever the game needs something it calls to create the item through the manager. I was thinking that this way all in game objects can know about each other very easily and pass relevant data etc

Is this the approach you guys take? any advice or hints?

edit : removed the last bit of that line. Dunno where i was going with that at all!!!!

cheers!

mark
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 18th Nov 2007 14:07
This is basically the approach I've used. My resource class is a singleton class factory that can be called upon anywhere in the program. It loads all of the resources up at the start via an XML file, and then when the program needs an object, or image etc, I clone the primary asset that was loaded.

I've also created classes to wrap the various asset types. Such as CDBObject, CDBImage and CDBSound etc. My CAssets class returns the relevant object type based on the request.

This is actually an opportunity for me to post up my original Red Nose day Asteroids game which uses all this stuff. I'll post up a thread in due course for the whole source and assets.

Paul.

Blue Rogue
17
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 18th Nov 2007 16:39
cheers thanks for confirming that paul

its weird getting away from the patterns used for business apps, but am getting there slowly hehe
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Nov 2007 00:12
google "Scene Graphs", thats a common set of concepts for game programming among other things.

My DBP plugins page is now hosted [href]here[/href]
Blue Rogue
17
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 19th Nov 2007 19:28
thanks CR, I'll have a look and see what I can figure out.

so far the singleton factory seems to be working perfectly. I used to have some really good books on game programming (and why are they always more expensive than normal programming books!) but they got lost last time i moved.

Login to post a reply

Server time is: 2024-11-16 20:55:21
Your offset time is: 2024-11-16 20:55:21