Combat Bot Booster


Boosts lifetime of bots but gives them limited ammo, bots expire when ammo runs out

Content
5 months ago
0.16 - 2.1
744
Combat

a UPS hit

a month ago
(updated a month ago)

I like the mod's idea but with the way its trigger is designed to process every damage in the whole game the idle load with a bunch of Space Age platforms (shooting asteroids as they travel) is quite significant. I took a liberty on trying to redesign it in a way that will be more performant. Not saying that I found an ideal solution but the idle load on my system dropped from about 0.150ms to something like 0.010ms. I also played a bit with the idea of using the remaining lifetime counter as an ammo metric. This way you can tell the number of remaining shots just by the number of thousand seconds of lifetime that the game shortens to quite convenient "13.5 k s" for example. I don't want to steal your downloads so if you'll like the proposed changes, by all accounts you can just use my code as it is on the linked modpage or use it as an example and I won't make my standalone fork public. I made it for my personal use mostly.

https://mods.factorio.com/mod/combat-bot-booster-remake

a month ago

Hi there

Thanks, that's interesting. I haven't actually been personally using this mod in quite a long time, just keeping it ticking over between major Factorio versions, so any UPS hits have gone unnoticed.

That said, I'm kind of surprised by this. The loop is basically "do nothing" if the damage didn't come from a bot (though I can see that enough very simple checks like that could eventually cause a UPS hit), and if I understand your code correctly this won't change if any player has bots deployed - it'll still be running that same check and bounce usage back up?

Another way around it (though also imperfect) is to trigger based on on_entity_died instead, and lower ammo counts accordingly. It'd be less "realistic" (though that was never an aim) and large enough deaths/tick would run into the same issues eventually, but should raise the bar a bit. It would also make Zapp Branigan proud.
I don't suppose you have a save game handy to demonstrate the UPS hit? I can try and take a look some time.
Thanks
Jack

a month ago

Hi, the performance impact I was talking about is not actually that terrible, it's just noticeable enough to bother me if open the game from a low end machine. And it more specifically affects Space Age with its constant asteroid kills on space platforms. Yes, my code doesn't change the base mod logic, only prevents it from being active passively when no bots are deployed near the player (which is 99% of the time typically so the cumulative saves do matter). I don't have a lot of experience with Factorio modding, so that's just the way I solved it. Don't think a transition to on_entity_died is mandatory...

New response