Page 1 of 1

On biter nest absorb pollution... Do

Posted: Tue Sep 26, 2017 9:55 pm
by reaperrar
Whenever a biter nest absorbs pollution, I'd like to hook into the event with a reference to the nest and how much pollution was absorbed.
Can that be done?

If not, at a fixed rate I'd like to iterate over all biters nests in tiles that have pollution... with a reference to the tile pollution total and biter nest per iteration. Is that feasible? I'm not sure how to implement this without affecting performance too heavily.

Re: On biter nest absorb pollution... Do

Posted: Wed Sep 27, 2017 3:38 am
by Rseding91
reaperrar wrote:Whenever a biter nest absorbs pollution, I'd like to hook into the event with a reference to the nest and how much pollution was absorbed.
Can that be done?
No, there's no such event and there isn't likely to be one as it would add a large constant overhead for minimal gains as pollution absorption happens frequently.

Re: On biter nest absorb pollution... Do

Posted: Wed Sep 27, 2017 10:40 pm
by reaperrar
Rseding91 wrote: No, there's no such event and there isn't likely to be one as it would add a large constant overhead for minimal gains as pollution absorption happens frequently.
Cheers.

If anyone is interested...
I ended up finding all nests on game init and also added to my array when they are built.
Every game tick my iteration loop only iterates over a certain number of nests per tick (with the entire iteration deferred over multiple game ticks) and using the delta from last tick per nest to scale my calculations.
It isn't entirely accurate due to the deferring (nabbing the tile pollution at iteration time) but it's close enough.