Path finding does not consider ZOC of transported units
Reply To bard
In this case, I'd vote for units that do not cause ZOC while being transported.
I guess that's the only possibility, too. I think you are currently seeing the effects of client not knowing the transported unit, and thus not considering it in path finding. The server side, enforcing actual rules, then blocks the move.
Probably it should be a general rule that any unit that the moving unit's owner does not see does not cause ZoC. Unfortunately that would likely be computationally very expensive (server does zoc checking *a lot*, and this would make each check *much* more expensive).
I'd say that for now transported units should not cause ZoC -> fix targeted to 3.0.8.
Later, as we build up the support for things like onboard cannons (that would be visible, and not hidden inside that transport), we should make this ruleset controlled.
Not yet sure what we can do with units hidden by extras (that are inside a base), and which presumably suffer from the very same problem (user does not know about the unit, so finds a path that would violate ZoC as dictated by the server)
Reply To cazfi
Not yet sure what we can do with units hidden by extras (that are inside a base), and which presumably suffer from the very same problem (user does not know about the unit, so finds a path that would violate ZoC as dictated by the server)
It could be applied the same "easy" solution as with transports: units inside an extra with hidden attribute can not cause ZOC. They are hidden after all, and the enemy can't know they are there, it makes sense to me that they can't impose ZOC unless they stop being hidden.
My question would be how is this handled in the case of cities, that also hide units that cause ZOC?
Reply To bard
Reply To cazfi
Not yet sure what we can do with units hidden by extras (that are inside a base), and which presumably suffer from the very same problem (user does not know about the unit, so finds a path that would violate ZoC as dictated by the server)
It could be applied the same "easy" solution as with transports: units inside an extra with hidden attribute can not cause ZOC. They are hidden after all, and the enemy can't know they are there, it makes sense to me that they can't impose ZOC unless they stop being hidden.
The problem here is the computational price I mentioned. Thinking solution to that goes to another ticket, in any case.
My question would be how is this handled in the case of cities, that also hide units that cause ZOC?
Cities themselves cause ZoC, so units inside do not matter.
Reply To cazfi
The problem here is the computational price I mentioned.
To give some perspective: Anything related to unit movement is performance-critical. The cheapest part of it is when units actually move. It's much more expensive when the same code is used to plan movement (i.e. path finding). The really expensive part is when the AI does reverse path finding to see how enemy units are threatening it.
Together those make about 50% of the server CPU time on a typical autogame.
Reply To cazfi
The problem here is the computational price I mentioned. Thinking solution to that goes to another ticket, in any case.
Ok, my suggestion was not worded properly, because I described a situation that would require this "computational price".
I wanted to suggest that any extra with the tag unit_seen = "Hidden" is considered like a terrain tile with the flag "NoZoc", no matter if the unit is actually visible to the enemy. It is still buggy behavior, but it seems less problematic to me than a wrong pathfinding.
Cities themselves cause ZoC, so units inside do not matter.
I see. Then, the same can not be done for bases because it'd allow to block enemy movement without need of units
Reply To cazfi
Reply To bard
Reply To cazfi
Not yet sure what we can do with units hidden by extras (that are inside a base), and which presumably suffer from the very same problem (user does not know about the unit, so finds a path that would violate ZoC as dictated by the server)
Thinking solution to that goes to another ticket, in any case.
-> #47700
Attached patch stops transported units from causing ZoC, ever.
When a unit with ZOC is being transported, it still blocks the movement of enemy units, but the pathfinding does not seem to take it into account. Enemy units move until they are adjacent and then they are unable to use "keyboardless" goto to move.
It can be tested with default civ2civ3 rules by loading a Marine unit into an Helicopter. I'm using v3.0.6 for my tests, I have not tested trunk.
I suppose transported units either should not cause ZOC, or it should be taken into account for pathfinding like any other ZOC.
I use a ruleset where I enabled ZOC in oceanic tiles (affecting naval units) and this issue makes it hard to play. In this case, I'd vote for units that do not cause ZOC while being transported.