[Verse-dev] Identity of verse nodes

Eskil Steenberg eskil at obsession.se
Mon Dec 19 16:38:15 CET 2005


Hi Long time, too long.

>
> Node names are NOT
> unique per session;

Scary statement.

What Emil means is that every session connected to the same server must 
get the same node names even if the ids doesnt have to be the same. The 
names should how ever be unique in the session, in other words, you cant 
have two nodes named the same thing.

Thing is that the current server doesnt actually check this... But it 
should.

> they are part of the shared data and will be seen
> as identical by all clients. Doing that is however made more difficult
> by the lack of a call such as:
>
> verse_send_node_subscribe_by_name(const char *name);
>
> i.e. there is no way to, given a textual name, subscribe to that node.

Sounds easy and useful... until you think too hard.

First of all you wouldent actually subscribe to a node. you would 
subscribe to the creation and destruction of a node. it would for 
instance be bad if you used verse_send_node_subscribe_by_name and got a 
bunch of verse_send_g_layer_create back when you thought you subscribed 
to a bitmap node. Then again you wouldent know what you got back since 
you wouldent even have a node id.

No, what the server would have to do is to store that this session is 
subscribing to nodes to any  node with a specific name. Would this mean 
that it would have to send a create node command if any node changed 
name to that specific name? probably. So the whole thing would 
complicate the server quite a bit.

And other then that, its not very "versey" if we did add a 
verse_send_node_subscribe_by_name why not a:

verse_send_g_layer_subscribe_by_name
verse_send_c_curve_subscribe_by_dimensions
verse_send_b_layer_subscribe_by_type

We could easily double the number of functions in the API this way. And 
i would be reluctant to do that. The of course we come in to the ultra 
scary realm of :

verse_send_node_subscribe_that_i_can_see

It just turns out that its impossible to make an API that works 
perfectly for everything. And this is why node IDs ARE session unique, 
so that you can implement a server that only shows you part of the world 
according to what ever rule you want.

Finally and perhaps coming back to the issue Ludde was asking for: 
identifying nodes:

In my experience,  node names are often not  that good to use. They are 
good because you know two apps use the same node, but thats rarely what 
you want.

Much more often i use tags. Tags are much more flexible, because a 
object can have more then one tag. For instance if you want two apps 
that render a world form one objects point of view, one is a visual 
rendering client, and one is a audio rendering client. Wouldent it be 
better if they searched for the tags "camera" and "listener"  rather 
then a unique node name? the you could easily  connect and disconnect  
camera and listener, you could have multiple cameras,  you could make 
anything in to a camera without having to change its descriptive name.

Tags are often much more flexible then names, and you can also include 
extra data such as what kind of camera or listener.

Cheers

E





More information about the Verse-dev mailing list