Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

Better Grenade Handling

This mod is for people who want their colonists to behave professionally while wielding explosives. Avoiding friendly fire is the core feature. Better Grenade Handling v1.1.3 If you encounter any bugs - let me know. I'll try to fix them as soon as I can. Showcase Never target enemies if friendly fire is possible [img]https://i.imgur.com/wix34ui.gif[/img] [img]https://i.imgur.com/ZFUsFDS.gif[/img] Automatically target non-stunned mechs [img]https://i.imgur.com/4UljkcS.gif[/img] [img]https://i.imgur.com/0g2ZACb.gif[/img] Pawns are more careful with explosives around [img]https://i.imgur.com/HDSGCOQ.gif[/img] [img]https://i.imgur.com/m8KvD19.gif[/img] Partial mortar support [img]https://i.imgur.com/uNnmPpt.gif[/img] Full list of features [list] [*] Pawns will avoid launching an explosive if there is at least 1 ally in blast radius + forced miss radius, including friendly factions/caravans too. [*] Pawns will, however, launch incendiary projectiles, such as molotov, if overall heat armor of an ally is >90% or flammability is less than 10% (impids, phoenix armor) [*] Pawns will launch toxic projectiles if allies in affected area have sufficient protection, like gasmask. Toxic raiders launch toxic projectiles no matter what. [*] Pawns avoid traversing over area where explosive is about to impact or is already present. Only works for friendly factions. [b]Mortars are supported[/b] [*] If pawn is forced to launch an explosive(bypasses friendly fire checks) then any ally that happens to be in the blast area will flee out of it. [b]Mortars are supported[/b] [*] Pawns equpped with EMP won't target already EMP-stunned mechs - eliminates the dumb behavior when they target the same mech over and over again. Also they automatically target enemies wearing shield-belts - a capability the vanilla game clearly lacks. [*] Pawns try to cause as much damage with explosives as possible by choosing much more tightly packed groups of enemies through the in-game target score system. Increases the DPS. [*] You can customize some parts of the mod to your liking. Supported languages: English and Russian. [*] All of the above applies to enemy raiders too. Now they will value their own lives more and won't shoot rockets at you if it involves any friendly fire. [/list] Source code/No-Steam version [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fgithub.com%2FUracosVereches%2FBetterGrenadeHandling][img]https://i.imgur.com/odLDvKD.png[/img][/url][github.com] Donate I accept donations on [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fboosty.to%2Froyalspudi%2Fdonate]https://boosty.to/royalspudi/donate[/url] [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fboosty.to%2Froyalspudi%2Fdonate] [img]https://i.imgur.com/IW3YJlW.png[/img] [/url][boosty.to] Technical debrief This mod was particularly challenging to optimize. Since you have to check for pawns in a specific radius - you always have +1 loop to deal with. Achieving considerable performance was roughly ~80% of total effort. This mod is still probably going to add 0.1-0.2 ms overhead that scales linearly depending on how many grenadiers and targets you have on the map. But it barely matters, we’re bringing an entire weapon category back to life after the devs abandoned it. And outside of any combat it is barely visible in profiler. How it works: Firstly, we check for friendlies initially when a pawn enters combat(drafted or whatever). Not always the case though. Then we check for friendlies every time any Thing in game changes its position(Thing.Position set method patch). It is built on 2 assumptions: 1) Initially, we assume that moved thing is an ally that we don't want to hit. It's a cheap O(1) check - just compare distance from target to ally. Add target we're aiming at to blacklist if conditions are met. 2) After that we assume that moved thing may be an enemy that is moving towards our ally. This time it's O(n) since we need to search for any possible ally in blast radius around our target. Add target to blacklist if at least 1 ally has been found. I tried to be brief though, there is a lot more little details under the hood. There is also trajectory prediction system that I've been working on, but abandoned shortly after. Check it out on github if you ever want to finish it.

Зависимости мода

Логотип мода

Harmony

Загрузить 416.1 KB