Amerio.Stephane Posted April 24 Posted April 24 Hello, In 2.21, at start-up, if I send a DIS entity with (site=1,app=1,id=2001), then an extraneous "__IG entity dummy (id: 67537 type: 0) is created" Creating more DIS entity doesn't create extraneous one though; it looks like only the first one does this. I couldn't find any ill side effect (yet), but it doesn't look like an expected behavior to me. Also, why does the CIGI default entity appears as yellow (synced), but not the DIS one? Bonus question: what is this NodeDummy_xxxx? (it contains a player and a light omni)
silent Posted April 27 Posted April 27 Hi Stephane, So far it's quite hard to tell what is going on, we tried to reproduce it with your host in DIS Mode: And so far were unable to reproduce the same behavior: Could you please tell us a bit more about the reproduction steps and could it be reproduced with an empty project as well? Quote Bonus question: what is this NodeDummy_xxxx? (it contains a player and a light omni) It appears to be a node that can be created programmatically, although that is only an assumption at this point. We would need to better understand under which circumstances it initially appears, as that may provide us with some useful insights. Thank you! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted April 27 Author Posted April 27 11 hours ago, silent said: Could you please tell us a bit more about the reproduction steps and could it be reproduced with an empty project as well? Can't reproduce it in an empty project, and I've traced it to our on_process_Entity_State_PDU() callback. It's not yet clear how, but it looks like we manipulate in some way the entity before it's actually 'registered', or something like that, hence creating it once in the callback and a second on exit maybe (not sure at all, just guessing here). I'll dig deeper, but definitively not a trivial bug. 11 hours ago, silent said: Quote what is this NodeDummy_xxxx? (it contains a player and a light omni) It appears to be a node that can be created programmatically Oops, my bad, I forgot to disable a test-plugin; this has nothing to do with you. I'll take care to always name explicitly the nodes we create to avoid confusion. (for example, the Free player of ig_debug 1 is created with a default name, hence my confusion this too could have been some Unigine tooling). Sorry for the noise! As for why the CIGI entity is appearing yellow, I'll dig deeper too, as this can came from us too. 1
Solution Amerio.Stephane Posted May 1 Author Solution Posted May 1 @silentI found the bug that creates an extraneous DIS entity! Quite tricky, and a bug exists on both sides (yours/mine). In 2.21, entity ID changed from int to int64_t (all good, I suppose to accommodate for DIS site/app/id), and the API changed accordingly. But my compilers only emits a small warnings when writing: int id32 = ig->getView(viewId)->getParentEntityID(); which truncates the int64_t to an int. This is the bug on my side, easy to fix and totally my fault for not paying attention to warnings. But to debug that, I relied heavily on Log::message and the Syncker debug view. And the Syncker displays the ID as an int, not an int64: here, 67536 is the truncated int64 value for 4295034832. So I couldn't find it. So in reality, the IG was creating the entity 4295034832 and displaying it as 67536, and I was asking for the non-existing entity 67536 with ig->getEntity(id32), which actually creates it, and the Syncker also shows it as 67536 (quite confusing!). So you need to check in your IG/DIS/Syncker code that you actually prints int64_t with the correct specifier: %" PRId64 " instead of %d How to Portably Print int64_t in C: Fixing Compiler Warnings with C99 Standard Format Specifiers — codegenes.net // WRONG int id32 = ig->getView(viewId)->getParentEntityID(); Log::message("entityId32=%d\n", id32); // GOOD int64_t id64 = ig->getView(viewId)->getParentEntityID(); // but bad logging Log::message("entityId64=%d (truncated)\n", id64); // will be truncated and shown as an int32 // GOOD logging Log::message("entityId64=%" PRId64 "\n", id64); // #include <inttypes.h> required This would also be worthy of a special note in the IG C++ documentation and in the migration documentation, as it can bite others too. Enabling all warnings and recompiling the project, I found quite a few "conversion from '__int64' to 'long', possible loss of data" in the Unigine code. You might want to track and check them too.
silent Posted May 4 Posted May 4 Hi Stephane, Quote So you need to check in your IG/DIS/Syncker code that you actually prints int64_t with the correct specifier: %" PRId64 " instead of %d Indeed, the issue is in the incorrect int conversion to string. We will fix this in the future updates (maybe in the upcoming hotfix 2 as well). Thank you! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts