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 / Load 3D Models at startup as templates, or only when required?

Author
Message
Ben_UK78
13
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 22nd Nov 2013 14:17
Hi All,

I was just wondering what the correct approach is in GDK to loading objects.

Say we build a new space ship in game, do we load the model from the HD at that point (or is we change 'sector' and load in 100 ships etc), or do we load all models at the start of the same to hidden models and clone from these whenever we need a new model of that type?

What is the correct theory on loading game assets like this?
Ben_UK78
13
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 22nd Nov 2013 17:21
Well, I have just read my own post. I was obviously in a hurry since it reads as if I am either 8, or born somewhere and live under a tree.

Since 14 people have read this and no-one has commented I just thought I would add that I am not looking for any code - just for whether it is best to load objects into memory at the start of a game and then clone them when needed or whether you can load 3D models from the HD as and when required without slow down.

I am just trying to get the code design right from the start and am not sure which way I should be doing it.

Thanks
The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 24th Nov 2013 04:36
Since you're asking this kind of question, it sounds like you're new to programming and need experience. And the best way to gain your own experience is to experiment with different ways and see for yourself, without worrying about getting it all perfect the first time. You can create brief little experiments to gain certain pieces of information and draw your own conclusions.

It sounds like your issue is - how much time does it take to load an object? And how much time does it take to clone an already existing object? And do you want to be doing extra stuff between frames during gameplay?
The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 24th Nov 2013 04:55
After my first comment, I think I just realized what you're asking. I didn't quite understood your question at first. If I understand your question now, then here are two commands that may answer your dilemma:

dbHideObject(int object)
dbShowObject(int object)

P.S. You mentioned object cloning. I prefer cloning over instancing, because I've found instancing to be buggy (some instances don't get rendered).

Login to post a reply

Server time is: 2024-04-16 12:43:56
Your offset time is: 2024-04-16 12:43:56