Hi Martin,
Yes, im planning on making a
network simulation and what I meant by "synchronized
over a network" i was referring to the game entities
that must be in sycn with the server and other clients in their
respective area's of interest.
What i'm trying
to figure out is how to describe an entity from the scene
components that describe how its rendered (and with physics node)
how it behaves in the world.
Being able to
serialize x3d nodes and send them compressed over the network
seems a good way to spawn new types of items into the world for
dynamic updating of the world.
I havent
implemented PROTO yet and need to read up on it first before I
try. So far I just have the X3DBindableNodes, transform, shape,
appearnce, imagetexture, multitiexture, material,
texturetransform, directionallight, indexedfaceset and related
coordinate nodes.
Ive been thinking about the
entity problem and the i'm leaning towards using special prefixes
in the node DEF fields. In this way, no special nodes are needed
that might confuse a 3rd party x3d editor.
So
to signifiy the start of a new entity (say a tank with 1 body, 1
turret and 2 tracks) you could use DEF= "newEnt_Tank"
for the group node, and DEF = "component_Body"
, DEF = "component_TrackLeft" , DEF =
"component_TrackRight", DEF =
"component_Turret"
(or
whatever naming convention you like.)
During
initial traversal to load the scene, callback functions to your
simulation manager could spawn new entities easily by parsing the
DEF names. In the case of an entity within an entity, the
"newEnt_*" marker would make it easy to know
that a new entity should be spawned and that susbsequent children
"component_*" nodes belong to this entity.
What got me into x3d in the first place is
how generic everything is and so I'm searching for an equally
generic method of representing and deriving entities both
functionally in the simulation. Being able to spawn a 6 armed
monster (as opposed to having everything classical 2 arm 2 leg
like in my first person shooters) in a generic fashion.
Its
kinda hard to explain exactly what i'm looking to do. Hope this
makes sense.
-Mike
|