Menu

Creating new entities at runtime in CIGI 4.0

Help
Michael
2017-10-24
2017-10-24
  • Michael

    Michael - 2017-10-24

    Hello,

    After reading the CIGI 4.0 standard, it seems like we are unable to create new entities on the fly and that the entities and their IDs must be known ahead of time.

    This is kind of insane to me, as it's a common case that a user would want to add X amount of an entity at runtime. For example, we have customers who will place X amount of vehicles on a map. Do we really need to guess (and thus limit) the number of ModelA's the user might place and do something like this?

    ModelA is ID 1
    ModelA is ID 2
    ModelA is ID 3
    ModelA is ID 4
    ModelA is ID 5
    ...

    Hopefully I'm missing something... is there a mechanism for this? Or what other solutions have others come up with?

     
  • C. Schroeder

    C. Schroeder - 2017-10-26

    Can you explain in more detail why you believe CIGI 4.0 prevents on-the-fly entity creation? The only significant difference between CIGI 3.x vs. 4.0 regarding entity creation was the split of the Entity Control packet into a smaller Entity Control packet for entity creation and infrequent control parameters and the new Entity Position packet for the frame-by-frame entity position updates. CIGI 4.0 also adds entity Animation Control, Velocity Control, & Acceleration Control packets.

    If you want to pre-allocate a group of entity IDs during host initialization before assigning an initial entity type, simply set the Entity Type = 0 and Entity State = Inactive at the time of creation. When you are ready to use one of these entities, send an Entity Control packet specifying the new Entity Type and Entity State = Active followed by an Entity Position packet with the initial position for the entity.

    I hope this helps clarify entity creation in CIGI.

    Best regards,

    Curt

     

Log in to post a comment.