This addon fixes many Warfare bugs and adds new behavior to loner/ecologist factions.
1. Drop the 'gamedata' folder into your Anomaly root directory (merge it with your existing 'gamedata' folder). If there are conflicts, you will need to see if a manual merge is possible using a tool like WinMerge. Conflicts within game_relations.script, ui_options.script, includes.ltx, offline_combat_simulator.ltx, and ui_st_options.xml are easily merged. If other files are incompatible with some other addon, let me know and I might be able to make a patch.
2. (optional) Load the 'Alife Overhaul' warfare preset (menu is top-right of screen). If you do not use this preset, make sure that free stalkers and ecologists are participants in warfare. Do NOT disable them from participating. I also highly suggest disabling patrols/random patrols for these two factions.
Warfare is an extremely cool idea, but its implementation with Anomaly is somewhat... incomplete. It deserves to be more than a tacked-on mode. This addon aims to fix that through a combination of bug-fixing and new features.
This addon is compatible with existing save files, and should have minimal effect on non-warfare games.
1. Loner and Ecologist behavior overhauled
It always seemed weird to me how Warfare treated loners and scientists as monolithic factions just like Duty/Freedom. Loners should be looking out for themselves, and scientists should be studying the Zone, right? With this addon, they now do exactly that, similar to how STALKERs behaved in Call of Pripyat.
Loners now travel to vacant resource points on their level / linked levels during daylight hours, spending a short amount of time at each one checking if there are any artifacts to be collected. As evening draws near, they will look for bases where they can spend the night safely, preferring loner-owned bases when possible. A small percent of squads (5%) will hunt mutants instead of artifacts, traveling to lair locations during the day. The 'night activity chance' affects the chance for loners to continue artifact/mutant hunting instead of returning to a base for the night.
Ecologists now similarly travel to non-hostile resource points on their level / linked levels during daylight hours. However, they spend much longer at each point, and return to base much sooner. Furthermore, they always prioritize ecologist bases as their nighttime destination, and will only go to neutral bases if no ecologist base is within reach.
Loner and ecologist spawns are now independent of resource count. They will spawn as novice/advanced/veteran completely randomly.
2. 'Disappearing squads' bug fixed
This bug was actually a result of two faulty systems: bad mutant spawn/targeting and an issue with 'full' offline combat where squads wouldn't fight back against some mutant attackers and just slowly die.
Mutant spawning/targeting has been fixed (see #4,5), and 'full' offline combat has been fixed to allow most 'story' squads to be killed. Now, you can specify additional restrictions in offline_combat_simulator.ltx. "ignore_squads" will prevent warfare from ordering the squad around, while "special_squads" forbids them from offline combat even in warfare.
Additionally, scientist bunker guards, bar guards, and the darkscape trader/mechanics have been added to the ignore list so that they aren't affected by the new loner/ecologist behavior schemes.
Thanks to Tronex and Illinaru for their original fix and guidance, respectively.
3. Neutral factions can take over loner/ecologist points
Due to the new loner/ecologist behavior, these factions will have a much more random and widespread presence throughout the Zone, which would normally be a nuisance for factions trying to control it.
Now, neutral factions will be able to take over points owned by loners/ecologists. Non-base points can be captured outright using only one squad. Base points require you to have more squads present than they do in order to gain control. Other factions will also target non-base resource points owned by loners/ecologists, and send idle squads to capture them.
4. Mutant spawning fixed/overhauled, missing mutant types added back in
In vanilla Warfare, mutant spawn timers were NOT SAVED when you switched levels or reloaded the game - they would reset to 0% progress to next respawn. If you had your mutant respawn timer set to something reasonable like >12 hours in-game, you would never see them respawn unless you slept for a really long time. And when they did spawn, they would often spawn on top of your owned resources/bases, killing your squads and making you instantly lose a bunch of points.
Now, mutant spawn timers are properly saved, so you can set your mutant spawns to whatever you like. Additionally, mutants will now only spawn on pure lair points (no resource/base attributes). Rare mutants will have, by default, a 3% chance of spawning south of Red Forest/Radar/Limansk levels, and a 10% chance of spawning within those levels or further north. Labs will have a 50% chance of spawning rare mutants, so be prepared! These numbers can be changed in the warfare general options menu.
Warfare's mutant spawn list was missing a bunch of mutant types from it, including poltergeists, fractures (those long-limbed freaks), lurkers, psysuckers, psydogs, and rats. These have been added to the spawn lists, and will now appear.
5. Mutant location targeting properly implemented
Vanilla Warfare had a strange way of moving mutants around. Every 1/60th of your mutant respawn timer, it would try to move mutants to a different location, with no restriction on if that location was occupied, a base, resource, lair, etc. This would cause your occupied points to be constantly overrun with mutants while the rest of the map had none. They additionally had a 10% chance of moving off-level. In practice, this meant that all mutants would eventually try to switch levels, which is bad because they use the SAME level changers as npc stalkers do (this is why you'd often mysteriously lose control of locations near level-changers). Even worse is that these locations were NON-RANDOM, meaning they were always trying to go to the same spot.
These problems have been fixed. Mutants will now wait for a random period in-between their low and high mutant respawn timers, after which they will have a 95% chance of targeting a random unoccupied location on their level, and a 5% chance of targeting a random empty location on a linked level. They will also have a 5% chance of attacking a STALKER-occupied location.
6. Quest fixes: assault tasks, smart control tasks
These quests are now warfare-compatible. You'll start seeing previously-missing quests such as 'eliminate mutants', 'raid enemy faction outpost', 'hostage rescue', etc.
More quest types will also get Warfare compatibility in future versions.
7. Warfare squads seek shelter from emissions
Previously, squads at locations with no shelter would just wait patiently and die. Now, these squads will seek out the nearest shelter during an emission, prioritizing the closest empty or non-hostile spots first. After the emission, they will immediately return to their original post.
8. Hybrid offline combat mode
Hybrid offline combat uses smart-terrain-based offline combat, but squads on terrains within a short range can also aid in the attack/defense. For example, attacking one part of an Agroprom base will allow most of the rest of the base to counterattack. It's main purpose is to provide less-taxing offline combat than full simulation, but with more robust-ness than single smart terrain simulation. You will notice that large bases with multiple nearby smart terrains will be much more difficult to capture offline. Note that pure lair smart terrains are not allowed to reinforce nearby terrains. This preset is also functional for non-warfare games.
I suggest using either 'Full' or 'Hybrid' offline combat for the best experience.
9. Base respawn timer reset upon ownership change, altered respawn timer formula
A base point that changes control between two factions will have its respawn timer re-calculated based on the new owner's respawn timers. This will allow you to give some factions much longer respawn times (ex Monolith) without breaking balance if the point switches hands.
The respawn time formula now depends on number of controlled bases, with minimum respawn time being the time to respawn if you own only one base, and maximum respawn time being the time to respawn if you own all the bases in the Zone. The actual respawn time is linearly interpolated based on these numbers and the fraction of bases in the Zone you control. This will make a disparity in bases less of a death sentence and hinder snowballing. However, each new base you take will always be a net gain.
In the future, I may add alternative respawn time formulas as menu options.
10. Fixed faction loadout resource formula
There was a weird point where getting more than 50% of all of the Zone's resources would make your squads LESS likely to spawn as advanced/veteran squads, with a minimum at 80% ownership.
This has been fixed - now, resources points will always increase your chances for an advanced or veteran squad to appear.
11. Random patrols spawn/targeting fix
Random patrols now spawn only on unoccupied locations, and can now target same-level locations. They will now only target occupied locations if that location has a single squad present (no more suicide attacks!). Previously, they would often spawn on top of your occupied bases/resources, and always target a random location off-level.
12. Warfare trader/mechanic spawn fix
Before, random squad count would cause warfare traders/mechanics to spawn based on that count. This would cause frequent lag spikes/frame drops as one trader npc would continuously trade with another trader npc (since they had infinite money). They would also occasionally spawn even when the default npcs still existed.
These issues have been fixed. Now, Warfare trader/mechanic/medic/barman squads will only have 1 npc no matter what. You also won't have traders/barmen spawning even if Barkeep, Petrenko (Duty trader), etc. are still alive. Unfortunately, this only affects new games or future trader/mechanic spawns.
13. Fog of war fix for dynamic relations (credit: Lignar)
The default implementation of FoW breaks dynamic relations by turning off relation changes.
Lignar has very courteously pointed out this issue and how to rectify it, so now it's fixed. Thanks Lignar!
14. Location targeting changes and active re-assignment
Locations that are purely lairs (no resources, not a base, not a territory) have been highly de-prioritized from faction targeting. In the event that a squad does somehow end up on a pure lair point, they will be automatically re-assigned to a valid target. This behavior can be suppressed from your faction by enabling manual faction control. Monolith and zombified squads do not follow this behavior, and are allowed to camp on lairs.
Overflow squads (squads beyond the smart terrain capacity) will now search for targets among all levels if no valid linked-level targets exist.
15. More logical base/resource/territory designations
Locations now have more logical base/resource/territory properties. Locations with housing, emission cover, and defensibility are now bases - points lacking one or more of these properties are territories.
Locations near anomaly fields now consistently have the 'resource' property, with one resource point per anomaly field. Lairs and resources are no longer automatically considered territories, unless explicitly defined as such. These changes should have negligible impact on non-warfare games, since I didn't touch the faction priorities.
16. Updated Warfare PDA tab (credit: Illinaru)
The Warfare tab now shows number of resource and base points each faction owns instead of total locations. Bonus points added from specific faction settings are distinguished from actual captured points. The PDA ranking is based on a faction's total number of bases and resources occupied (i.e. it only counts useful points). Thanks Illinaru!
17. Warfare Alife Overhaul preset
A preset made to go with this mod. I suggest that everyone use it as a basis and customize it how they see fit. There is only one mandatory setting: free stalkers and ecologists MUST participate in warfare, or you won't see any of the new behavior. I also highly suggest that you do not enable patrols or random patrols for loners/ecologists - I'm not sure how the patrol targeting will interact with new behavior schemes.
This preset tries to make each faction a bit different but still relatively balanced. It was not designed for random starts. Suggested population factors of 1.0 for stalkers and 1.5 for mutants with patrol pop factor 0.
1.1.4 (coming soon)
1.0.5 - Squads will now seek out shelter from emissions if their current location has none.
1.0.2 - Dynamic relations now works with fog of war. Courtesy of Lignar.
1.0.1 - Base patrol squads can now target lairs as well as territories. This has been added to the preset as a special trait of Duty, since they're known for mutant hunting.
#. Quest restoration and fixes
This is an ongoing effort to enable Warfare compatibility for quests that either never show up or are broken in Warfare.
#. Clear-cut random patrols
Right now, the tooltip doesn't tell you if a squad is a normal squad or a random patrol. I'll see if I can add distinguishing labels to random patrol squads.
#. Story mode questlines in Warfare
Alpha version is an optional file available as of v1.1.4. DoctorX story questlines are tested and functional. I haven't finished testing the 4 main storylines, so I can't make any guarantees on stability or functionality. Requires a new game with both 'story mode' and 'warfare' options ticked.
Werejew for creating Warfare
Tronex for their original warfare/offline combat scripts
Illinaru for their warfare addon (Illinaru Warfare Balance), which was the basis for the PDA change, and for their advice
Lignar for providing the solution to the fog of war dynamic relations issue
If you would like to use any of this addon as part of a separate overhaul, feel free to do so. And if you feel like crediting me at all, that would make you a pretty cool person.