This is the first time I'm really trying to mod the game trough the DLL, more specifically the modified DLL from Kmod, found here. In particular, what I'm trying to achieve for now is to simulate some sort of attrition feature, similar to that used in Rise of Nations (RoN). The basic idea would be:
-Add a new int variable for units to represent attrition. I think it should be independent from the unit's HP. This variable may change depending on the type of unit, techs researched and promotions. I'll try to add a Supply Wagon unit as well, just like RoN, which affects all of it's adjacent tiles.
-At the end of each turn, check every unit on the map and the plot where this unit is stationed. Given the ownership of the plot, the unit may lose one point of attrition. Specifically, this will happen if the unit is stationed in an neutral or 'no-rite-of-passage' territory. If, however, the unit is within one's own territory, one with rite-of-passage or an tile adjacent to a Supply Wagon unit, it's attrition points reset to the default value. In case the attrition count gets to 0, the unit is killed.
I believe this mechanic could make exploring the map or invading an enemy more challenging, opening opportunities for exploits (for example, targeting the enemy's supply wagon could cripple the invading army). Given that the whole checking-and-updating attrition should be done at the end of each turn, where should the place to call such function be?
-Add a new int variable for units to represent attrition. I think it should be independent from the unit's HP. This variable may change depending on the type of unit, techs researched and promotions. I'll try to add a Supply Wagon unit as well, just like RoN, which affects all of it's adjacent tiles.
-At the end of each turn, check every unit on the map and the plot where this unit is stationed. Given the ownership of the plot, the unit may lose one point of attrition. Specifically, this will happen if the unit is stationed in an neutral or 'no-rite-of-passage' territory. If, however, the unit is within one's own territory, one with rite-of-passage or an tile adjacent to a Supply Wagon unit, it's attrition points reset to the default value. In case the attrition count gets to 0, the unit is killed.
I believe this mechanic could make exploring the map or invading an enemy more challenging, opening opportunities for exploits (for example, targeting the enemy's supply wagon could cripple the invading army). Given that the whole checking-and-updating attrition should be done at the end of each turn, where should the place to call such function be?
Last edited: