Possible object ID and group label ID clash

For AI and campaign script related discussions and questions
Post Reply
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 747
Joined: 26 Sep 2016, 19:56

Possible object ID and group label ID clash

Post by Berserk Cyborg » 07 May 2019, 03:20

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).

User avatar
NoQ
Special
Special
Posts: 6220
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Possible object ID and group label ID clash

Post by NoQ » 10 May 2019, 19:13

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.

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 747
Joined: 26 Sep 2016, 19:56

Re: Possible object ID and group label ID clash

Post by Berserk Cyborg » 10 May 2019, 23:54

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.

User avatar
NoQ
Special
Special
Posts: 6220
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Possible object ID and group label ID clash

Post by NoQ » 12 May 2019, 01:41

This does affect skirmish AI scripts as well, right?

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 747
Joined: 26 Sep 2016, 19:56

Re: Possible object ID and group label ID clash

Post by Berserk Cyborg » 12 May 2019, 06:12

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.

Post Reply