SRL Archive - Reflection Development

Models


TRiLeZ

2010-06-16 21:46:33


Before I start coding something for Simba, I have to get some feedback.

You're able to get the model points after some calculations, but they are constant points, meaning that you would have to pull the model points from the object / npc / player model right when you want to use them. To do this, the model object must be stored in a variable. The problem with doing this is freeing the model object from the SMART client, and that most of the model objects would not get freed up from the SMART client, slowing SMART down(?). What's everyone's opinion on this?

Method

2010-06-16 22:52:30

Wait, what? Why wouldn't you be able to grab the model and its points to build a wireframe and then free it when you are done?

TRiLeZ

2010-06-16 23:56:43

From: Method
Wait, what? Why wouldn't you be able to grab the model and its points to build a wireframe and then free it when you are done?


After getting all objects and their model points, their wireframes won't move along with the objects if you move…

Method

2010-06-17 00:05:29

From: TRiLeZ
After getting all objects and their model points, their wireframes won't move along with the objects if you move…


If you need the wireframes again, you can just grab them once more. Whether or not you moved or they moved seems irrelevant to me.

Am I missing something obvious here??

i luffs yeww

2010-06-17 01:22:50

I just think he's saying that once you get them once, they're shown, but they aren't "rebuilt" when the camera moves. Maybe they're all loaded when the "local" section of the map is loaded, and aren't based off your position? (I think that may be what he's saying. :p)

Drakan

2010-06-18 06:02:28

So? It's like that for everything… Unless I'm missing something as well… TileToMS only works once, then if the camera moves you have to call it again. Maybe I'm confused as well?

TRiLeZ

2010-06-18 14:49:23

From: drags111
So? It's like that for everything… Unless I'm missing something as well… TileToMS only works once, then if the camera moves you have to call it again. Maybe I'm confused as well?


When you get an object, you have it's position so you can calculate where it is when ever you want. If I incorporate model grabbing in the object grabbing functions, it's only calculated once. Nevermind that though, I guess people will have to make sure they're not moving while they're grabbing models / don't move after they grab a model that they want.

This does however create a speed problem. It takes an average of 750ms to get a normal tree model. If you call a function like GetAllObjects, it will go really slow. Also, if you just want to get a normal tree, it will have to get the models of everything that is nearer to you than the normal tree.

masterBB

2010-06-18 16:38:44

So this will only be usefull for objects close to your char…?

TRiLeZ

2010-06-18 17:06:16

From: masterBB
So this will only be usefull for objects close to your char…?


It's useful for objects, npcs and players, which you can see on your screen.

masterBB

2010-06-18 17:13:25

But you said: "Also, if you just want to get a normal tree, it will have to get the models of everything that is nearer to you than the normal tree."

So if something, lets say a rock, is a bit far away. It will only load the closer other rocks too? Or does it also loads the dwarfs, environment stuff, etc?

TRiLeZ

2010-06-18 17:17:07

From: masterBB
But you said: "Also, if you just want to get a normal tree, it will have to get the models of everything that is nearer to you than the normal tree."

So if something, lets say a rock, is a bit far away. It will only load the closer other rocks too? Or does it also loads the dwarfs, environment stuff, etc?


I was saying if you used FindNearestObject, it would go through all of the objects and their models until it finds the normal tree, in which you're looking for.

Smartzkid

2010-06-18 18:18:20

Is it possible to code it in native code and call through JNI?

What is causing the bottleneck?

Drakan

2010-06-21 08:31:32

From: TRiLeZ
I was saying if you used FindNearestObject, it would go through all of the objects and their models until it finds the normal tree, in which you're looking for.


Not necessarily. You don't have to actually get the model of the object until after you found the right one. But you also said it takes 750ms to load one of them… That seems unnecessarily long. But that's just me.

3Garrett3

2010-06-21 10:57:03

From: drags111
Not necessarily. You don't have to actually get the model of the object until after you found the right one. But you also said it takes 750ms to load one of them… That seems unnecessarily long. But that's just me.


It might just be better to allow the script maker to decide if waiting that long is really worth it. I know that some people might say "Hey, well using some of SRL's functions are that slow" and iirc, when we used to have reflection in kyab, and early reflection in SMART, the object finding took at least 1 second before it found the right spot.

TRiLeZ

2010-06-21 18:14:46

From: drags111
Not necessarily. You don't have to actually get the model of the object until after you found the right one. But you also said it takes 750ms to load one of them… That seems unnecessarily long. But that's just me.


It takes 750ms to calculate where all of the model points are…

Also, how would you be able to check if the object is the right one if the only place where object data is grabbed is in GetInteractableAt, which has no checks?

Smartzkid

2010-06-22 00:35:29

Sorry if I'm stating the obvious, but the client manages to do it quickly enough?

Drakan

2010-06-22 19:53:34

From: TRiLeZ
It takes 750ms to calculate where all of the model points are…

Also, how would you be able to check if the object is the right one if the only place where object data is grabbed is in GetInteractableAt, which has no checks?


I know it takes 750ms to calc all the points. Thats the part im saying is unnecessarily long. However, in a function like FindObject or something like that, only load the model if the object was found >.>? (finding by ID's)

Nava2

2010-06-22 20:36:20

Whats the point of this? :s

TRiLeZ

2010-06-22 20:44:33

From: Nava2
Whats the point of this? :s


Model clicking. Accuracy.