No Corner Camping

If you liked this item, please rate it up on Steam Workshop page.

Author: Jadawin

Last revision: 13 Oct, 2021 at 20:14 UTC

File size: 813.06 KB

On Steam Workshop

Description:

TWW2 is no longer getting patches or DLC, so my mods are also considered final and will not receive any more updates. Therefore I disabled comments on all of them to avoid constantly getting notifications for the same dumb questions that have been answered a thousand times already. Any comments or announcements I might make in the future will be posted under my collection here:
https://steamcommunity.com/sharedfiles/filedetails/?id=1766089433
—–

Corner & edge camping is lame, but also effective, so in a tough spot it’s tempting to use it. How many poor AI armies have been abused & fruitlessly run up against the invisible walls of the battlefield trying to flank around player frontlines? No longer!

This mod should make it impossible to set up a corner or edge camp. Whenever a unit is standing still and not in melee while being closer than 100 meters to any of the four edges of the map, it will automatically be given a move order towards the center of the map.

A unit near the edge will behave normal while it is already moving or fighting. So if your units somehow got caught by an enemy close to the map edge, or are pursuing routing enemies to there, they can still fight normally.

Units entering the map as reinforcements will be affected by the mod and sent towards the map center. But you can of course issue new orders to them as soon as they become controllable. Just make sure that your move order takes them far enough away from the edge, unless they are attacking an enemy there.

The AI never intentionally cheeses with the map edges, so its units are not affected by the mod.

Probably works in MP as well and should affect all player-controlled units, but not tested.

Known issues:
1. Non-flying units don’t move away from the edge if the center of the map is not accessible (but this affects only a small number of battle maps)
2. After loading a battle, the camera moves around automatically for a split second before returning to its start position. This is necessary because the game does not give modders any way to access basic map data like what map is the battle even taking place on, how big is it and where are the corners. The only way to get this info is with a trick where I try to move the camera very far out in all four directions. The game will only actually move it to the edge of the map so by then querying the camera position I can find out where the edge of the map is.