How CreateEntity PDU works?

444 views Asked by At

I'm trying to learn DIS for a small project that I've in mind.

Basically I've a process that run a scenario, and it can receive external commands for creating and removing entities.

I've another process, a map, that can send commands to the scenario process, and I've two cases:

  • The map process send a command for creating a new entity, the scenario process receives it, and creates the new entity.
  • The map process can create a new entity without external commands (i.e. triggered by internal scenario logic). This new entity should be notified in DIS.

DIS CreateEntity PDU has following fields:

  • OriginatingEntityID
  • ReceivingEntityID

Which data should be inserted here by the map process in order to send the CreteEntity command? How can I specify which kind of player I want to create (F15, Soldier)?

In the second case, how can I notify that a new player was created without external commands?

In second case

1

There are 1 answers

0
JP Lebel On

It all depends on the design of your simulation.

A SM (simulation manager - that you have to create) would create EntityIDs and you would use these ID in your CreateEntity PDU. You can also hard-coded them or create your own custom algorithm to generate them. DIS, by itself, doesn't define an EntityIDs generation mechanism but it does require that each EntityID to be unique.

That being said, DIS requires all entities to be updated at least once per 5 secs (not that much true for DIS v7 since that delay can now be managed per entity).

Most of the DIS compatible software I know monitor the EntityState PDU to detect new objects. If an object hasn't been seen for more than 5 sec, you can assume it has been destroyed.

Hope this helps.