Follow-up Comment #3, patch #3775 (project freeciv): I understand the limited application, but even for that, I'm not sure how this helps the AI use classical units, and all uses of uclass_move_type() are on a list I hope to eliminate.
For the classic, civ1, civ2, and multiplayer rulesets, where there aren't such per-terrain restrictions, all the UMT_BOTH units appear to have either fuel or hp_loss_pct restrictions that constrain movement in ways that the current logic doesn't consider when determining potential bodyguards. Such units assigned as classical bodyguards would quickly either die or abandon their charges to survive. For the alien, civ2civ3, and experimental rulesets, the current logic already may not work for S2_5, depending on the exact placement of roads, bases, or other nativity providers. For example, a Mech. Inf. might be selected as a defender for an Engineer, but wouldn't actually be able to provide coverage for the Engineer when building a road over a mountain until the road was built (Alien has even more complex considerations). The above notwithstanding, if there is another ruleset that the AI is able to understand with the current nativity handling that has more complex types that do benefit from this change, I waive my objection, although if I can make the code work without reference to crude nativity, I'll try to patch it away. Although I like the idea of precaching potential followers, I fear that a complete solution would need to involve dynamic bodyguard assignment depending on current targets and comparative pathfinding for the unit and bodyguard to ensure they would be able to travel together and provide coverage over the entire path and during the activity at the destination (which might be only a single turn, for instance a Howitzer attacking a city). Simple precaching based on accessible terrains may not account for cases where the path around inaccessible terrain is too long to be of practical use (or even impossible: consider a thin island bisected by a mountain range), nor for the variable placement of roads and bases over time during the game. For GameLoss, staying in a city is not necessarily sufficient if migration is enabled: the city might not remain there, etc. Similarly, depending on current circumstances, it might be safer for a GameLoss unit to be on transport with some settlers and bodyguards to found a new empire than stay to defend a nearly lost cause in a poor strategic position. That said, city guards do have broader safe nativity ranges (especially if BuildAnywhere), but it may make sense to select units that are capable of attacking a majority of adjacent tiles for proactive defense, AutoAttack, etc. _______________________________________________________ Reply to this item at: <http://gna.org/patch/?3775> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freecivfirstname.lastname@example.org https://mail.gna.org/listinfo/freeciv-dev