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.

Newcomers DBPro Corner / load object 1 time for mutiple use

Author
Message
Retro Addict
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Georgia, USA
Posted: 12th Feb 2004 21:58
I'm looking for a way to load the same object (for enemy players) in a for/next loop and not have to load the object 200 times. Here's the code I have:

for e = 1 to 200
load object "H-Tank.x",e
scale object e,1500,1500,1500
position object e,rnd(x#),0,rnd(z#)
next e

any help would be appreciated.

PC Specs: AMD 1800+ 256M DDR, Geforce MX440 - DB v1.13

To DB or not to DB............duh DB!
Retro Addict
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Georgia, USA
Posted: 12th Feb 2004 22:56
Sorry, this is for DBC

PC Specs: AMD 1800+ 256M DDR, Geforce MX440 - DB v1.13

To DB or not to DB............duh DB!
Brian T
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: Western Massachusetts, USA
Posted: 13th Feb 2004 01:00
Well, you could load the .x model once and then make as many object copies as you want using the clone command. In tests that I have run this works a lot faster. I have found one problem however- Whenever I clone a .x file with more than one texture the cloned object loses all textures. (I'm not sure if this is a problem with DBP or my modeling software, which is 3D Canvas Pro.) To get around this I discovered that you can clone objects with multiple textures if they are .3ds models. However, these load a bit slower and tend to render darker, so getting all your objects to color match becomes a pain. I posted this problem below but no one offered any advice. I've only been using DBP for a few weeks so I'm by no means an expert- but this may at least save you a bit of time. Another faster approach (as Rob mentioned to me) is to create a saving program that will load the model, convert it into a mesh, convert the mesh into a memblock and save the memblock to the game directory. Then your main program can load the memblock, convert that to a mesh and then individual objects can be converted as required using the change mesh command. But then I think you have to texture it which I have found is a very slow process. As the total number of objects in the world increases, the speed of texturing an object gets slower and slower. I have not fully tested this technique yet- I'll be making a benchmarking program to see which technique works the fastest for my space adventure project. I'm not sure how much of this will apply to DBC as I have never used it but looking through the forums they seem to be fairly compatable. Good luck. P.S. You may want to scale the objects ahead of time in the modeling software to speed things up even more. (Though scaling is very very fast- but I like things to be optimized to the max.)

* There is no experience like creating your own universe *
Retro Addict
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Georgia, USA
Posted: 13th Feb 2004 15:25
Thanks for the input. With DBC, anything that can be optimized I' all for (so my programs will run on as many pc's as possible). The object that i'm usings come from the dark matter package (i am horrible at making my own). i do not know how to scale the models myself. once i get fairly proficient at db, i may try to dabble in modeling....I'll see what db can do about taking a model and clone it.

PC Specs: AMD 1800+ 256M DDR, Geforce MX440 - DB v1.13

To DB or not to DB............duh DB!
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 14th Feb 2004 13:37
there is no clone command in DB Classic.
Fluffy Paul
21
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 15th Feb 2004 14:46
Might be worth converting the model into a memblock and copying the memblock multiple times.

Ending a sentence with a French word is so passé
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Feb 2004 15:11
Easier than memblocks, just create a mesh from the object, then create objects from the mesh

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php

Login to post a reply

Server time is: 2024-11-26 05:45:56
Your offset time is: 2024-11-26 05:45:56