I’m trying to decide how to accomplish the following: I’m using a relatively coarse grid and each node can be occupied by an enemy ship or an explosion (the fireball of which lasts several seconds), or both at the same time. Some AI entities will want to avoid ships, others avoid explosions, and still others both. So I need to be able to represent both things as being present, at the same time, in a single node, as well as allow different AI entities to decide which types to avoid. Obviously I can use flags and tags to cause certain AIs to regard one kind as passable whilst another AI regards the same as impassable. However, the problem comes in where I am unable to represent the presence of both types of obstacles in a single node. How would I go about doing that?
Secondly, the explosions can overlap and expire at different times. So I was thinking of using a GraphUpdateObject per-explosion and define an area to tag the occupied nodes as containing an explosion. The problem, however, is that explosion A and B may overlap, and A may expire before B, meaning when A expires and resets the occupied nodes to the “normal” tag, the nodes still covered by B will no longer correctly reflect that they are occupied by explosion B since their tag will have been set back to normal by A. It would be awesome if there was some sort of way to increment and decrement the number of GraphUpdateObjects affecting a given node, so that the tag won’t be reset until all of the occupying objects has left the nodes in question. Any ideas how to accomplish this? I thought of perhaps just incrementing the penalty, but this applies to every object that wishes to pass through the node, whereas I only want certain objects to care about the presence of the explosion, and others to ignore it.
Thanks!