Page 1 of 1

Add possibility to filter on force in LuaEntityDamagedEventFilter

Posted: Mon Nov 28, 2022 10:24 am
by Masamune00
Hello,

Idea suggestion
Would it be possible please to add an option to filter on force in "LuaEntityDamagedEventFilter" ?

Reason
In our scenario we can sometimes result in having a lot of attacks at same time by lot of biters at different location to big defenses (a long line of flamers with like 3 row or more of lasers), resulting in a lot "on_entity_damaged" being fired, which is bad performance wise.

We got 2 forces for biters, one that needs to trigger on_entity_damaged (but very small amount of biters), one that doesn't (a lot and a lot more of biters compared to the other force).

I think it would be better performance wise if this event "on_entity_damaged" is not even triggered if it's not the force we wanted in the code by using "LuaEntityDamagedEventFilter" with a new force filter option.

Sure we have a check at the beginning on "entity_damaged" but it doesn't prevent the event being triggered for nothing (there is no need for event to be triggered when it's the wrong force).


Thanks in advance,
Regards,
Masamune00

Re: Add possibility to filter on force in LuaEntityDamagedEventFilter

Posted: Thu Oct 19, 2023 7:58 pm
by Masamune00
Hello, I hope it's fine to bump it just one time.

It would be very nice to have this new possibility.