Page 1 of 1

Possible object ID and group label ID clash

Posted: 07 May 2019, 03:20
by Berserk Cyborg
So I started to look into issue 304 again. Continuing off my previous notes I found why the group labels were being triggered. It was due to seeing the rock next to the oil resource (which itself triggers another group label when seen). Yes, you read that right.

The problem: A sufficiently low ID assigned to an object can then change the trigger value of a group label if it gets seen (preventing eventGroupSeen from firing).

Re: Possible object ID and group label ID clash

Posted: 10 May 2019, 19:13
by NoQ
Whoa, nice one. Group labels are arbitrary user-picked integers, right? So the ID doesn't need to be low-enough; any ID may theoretically collide.

Re: Possible object ID and group label ID clash

Posted: 10 May 2019, 23:54
by Berserk Cyborg
NoQ wrote: 10 May 2019, 19:13 Group labels are arbitrary user-picked integers, right? So the ID doesn't need to be low-enough; any ID may theoretically collide.
Ah, yes. That gave me an idea. See this.

Newly created game objects seem to start with ID values in the 160000+ range. Campaign maps usually have a mix of very low ID objects with some reaching the 100000+ range. Maybe it's enough to just make camNewGroup() choose integers that don't share another object's ID value. I highly doubt we'll ever get past the 1000s.

Re: Possible object ID and group label ID clash

Posted: 12 May 2019, 01:41
by NoQ
This does affect skirmish AI scripts as well, right?

Re: Possible object ID and group label ID clash

Posted: 12 May 2019, 06:12
by Berserk Cyborg
NoQ wrote: 12 May 2019, 01:41 This does affect skirmish AI scripts as well, right?
Sure. I don't think any skirmish AI makes use of group labels yet. In any case 355 should do the trick.