ATM it doesn't matter what type of damage kills the tree, whether it be from biters eating them to clean a path to you driving over them with a tank or car for any reason or just destroying them by poisoning, burning, grenadine, rocket or just shooting them with any gun.
Any action that triggers the on_entity_died event that results in the destruction of an entity of type tree, that is not a sapling will have a 66% chance of being recorded into a FIFO buffer or seed record queue.
Of these recorded events there is a 50/50 chance of either initiating the spread of 1 or 2 new seeds to a random position with in the set max_seed_fall_distance as a radius.
After a period of time governed by the set ticks_to_germination + how many other trees were destroyed prior to the event multiplied by ticks_between_updates the game code will test if the randomly chosen spot is viable to place a sapling.
If the sapling is place-able, its data will be popped off the seed record and placed onto the end of the sapling record queue, but if the sapling is not-place-able the data is simply popped off and discarded.
The sapling queue is handled in a similar fashion to the seed queue but places a random tree type from the tree_names list instead of a sapling, then based on a random dice roll will have repropergation_chance % (I really must remove the "re" from that variable name)
to begin the cycle again.
The biggest problem with the idea of limiting the growth to (or excluding the growth from) an particular damage type is the lack of information given by the on_entity_died event as it only returns the entity that died and the force that did the killing (if any).
Their is no direct information on how the entity died that I can see.
If I am wrong about this please please let me know?
as this would resolve the problem easily :)
With the limited information given from the event in regards to our problem of damage type
I don't see any fast way of implementing this feature.
I have had two ideas on how to do this but neither has really inspired any confidence.
My first idea was to search the force object and retrieve its players list and find the what weapons that the players had.
Unfortunately I quickly realized that this would turn into a bug fest as I would be unable to determine which player did the poisoning etc or which weapon was actually responsible.
ie if you drove over a tree (or destroyed it in any fashion that you would expect regrowth) but your friend on the other side of the map was holding the type of weapon that excludes the regrowth.
Also any of these types of scenarios quickly compound after taking into account that weapons can be switched in the mean time between firing them and the entity dies event, eventually making it impossible, by the fact that capsules can be used from any inventory position and need not (probably can't) be used from the weapons slots.
My second idea looks more promising!
By using the on)trigger_created_entity event and creating a data structure that marks no growth zones, I then would be able to exclude and remove seeds and trees from their queues that fell into these areas.
But unfortunately Factorio is a real-time game (well only unfortunate for this type of code)
The AussyBush MOD already makes use of two potentially massive data queues and I get around the potential lag and game performance hits, by never searching them.
The simple pop from the front is expensive enough, but unfortunately I haven't worked out a way to use a stack, that functions as expected.
I would say on average, burning down the odd forest here and there (<200 trees) the AussyBush MOD consumes ~0.050, however on my stress tests, where I play pyromaniac and burn down every tree (nearly) on a 38mb save I have managed to push it to ~0.780 and it actually starts to effect the FPS/UPS (don't know how much the FPS is due to my MOD or the Black Wednesday type fires), but implementing a search on these data structures is just not going to be possible in real time.