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.

DLL Talk / DLL Request - 'Instances++'

Author
Message
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 17th Jul 2006 09:47 Edited at: 17th Jul 2006 09:53
A few patches ago I was able to convince Mike to make it possible to alpha map instances independently of the source object. Of course you dont want to be able to set EVERYTHING independently (then a instance just becomes a clone), but instances are 10x faster than clones (especially when creating/deleting), so sometimes its in your best interest to use a instance.

I think instances would be much more useful if they started off by mirroring the source object in every way, then YOU (the programmer) had to tell it what features you wanted to be independent. Something like this...



That would create a instance that shares everything about the source object EXCEPT position, rotation and uv coords.

Would it be possible to create a DLL that does something like this (for sdk pref)? Right now im trying to set the uv coords for my billboards (so I can 'scroll' to different textures), but because they are instances im unable to touch the uv coords.

I understand that its a question of control vs performance, but look at how much the 'alpha mapping' fix affected things (it didnt). A couple independent parms really dont change much.

I hope somebody will look into this!

Thanks!

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 17th Jul 2006 10:14 Edited at: 17th Jul 2006 10:26
Hmm this is interesting. Back around 5.8 I ran some tests comparing instances to clones, and remember seeing some pretty big performance differences. I just ran some more tests and things seem a bit better in u6. I created and deleted 100 instances and clones, each test was only about 2ms apart. Since (in my case) im dealing with mostly simple 2d plains, perhaps clones may work for me afterall..

Let me give clones another look, ill let you know how it turns out. I would still be curious to hear how hard you think it would be to make such a 'improved instances' dll.

*edit

WOW! I knew I wasnt crazy! So like I said, in dbpro u6.2 I was able to create/delete 100 simple plain instances in about 1ms, and clones in about 3ms. HOWEVER, in darksdk (the ghetto version) I ran the same test and got 1ms for instances, and 18ms for clones!

So hopefully when the sdk gets patched ill finally be able to use clones..

All you need is zeal
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 17th Jul 2006 12:02
@Zeal :
In fact clones and instances are both good in different situation
Instances are good for static objects (cos they use the same frame than the original object). You can them make slow motion effect on the original object (for trees, herbs, etc...) and all instances will automatically use the slow motion effect (it's what I've done in X-Quad Editor, 1 call modify all instances of the objects :p) and, the Clones are better for enemies, NPC and all other animated objects. They're a bit faster than simple created/loaded object and does not use the same frame than the original object.
I advice all to use Instances/Clones in the same way cos it's the best way to get more performance

All we have to decide is what to do with the time that is given to us.
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 17th Jul 2006 12:15 Edited at: 17th Jul 2006 12:16
Quote: " (cos they use the same frame than the original object). "


Can you elaborate on that?

Also, ive never heard a official confirmation as to the EXACT differences between instances and clones. From what I understand, EVERYTHING about a clone really 100% independent of the source (the ONLY benefit of a clone is slightly faster creattion), and the ONLYTHING independent about a instance is position, rotation, and alpha. Is that correct?

I just wish I could set the uv coordinates for each instance could do so many things with that...

All you need is zeal
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Jul 2006 00:43
make tests with animùated objects.

Load an object and make an instance of it.
Play animation on original object. Instance object will automatically play the animation without the need for you to start playing on it.

Load an object and make a clone of it.
Play animation on original object. Clone will remain at the frame 0 when original object play the animation.

Instance share 99% of original object data (except position, rotation, scale and some extra parameters ..)
Clone share less of data (it share texture and original mesh if I remind. Other data are created for the clone)

All we have to decide is what to do with the time that is given to us.

Login to post a reply

Server time is: 2024-11-22 06:53:16
Your offset time is: 2024-11-22 06:53:16