We-the-People-civ4col-mod / Mod

This is the repository where the mod resides.
90 stars 37 forks source link

Large coastal ships can cross the ocean #1035

Open MrZorG33 opened 3 months ago

MrZorG33 commented 3 months ago

for some reason, large coastal ships were able to cross the ocean. image

There seem to be no errors in the settings: < TerrainImpassable> < TerrainType>TERRAIN_OCEAN < bTerrainImpassable>1< /bTerrainImpassable> < /TerrainImpassable>

maybe it's because there's a coral reef nearby? since the ship cannot enter other areas of the ocean, near which there is no reef. you can check out the moving capabilities by loading the attached save. dynamic_test.zip

devolution79 commented 3 months ago

That is valid behavior that we've inherited from BTS. Coastal ships (which cannot cross ocean in general) may still cross ocean tiles within friendly (as in same team) cultural borders.

See this code of block from CvUnit::canMoveInto


        if (eFeature != NO_FEATURE)
        {
            const CvFeatureInfo& kFeatureInfo = GC.getFeatureInfo(eFeature);
            if (m_pUnitInfo->getFeatureImpassable(eFeature))
            {
                if (DOMAIN_SEA != eDomainType || kPlot.getTeam() != getTeam())  // sea units can enter impassable in own cultural borders
                {
                    return false;
                }
                // Erik: The AI may attempt to pathfind into unrevealed ocean plots so have have to check for the plot being revealed
                if (DOMAIN_SEA == eDomainType && !kPlot.isRevealed(getTeam(), false))
                {
                    return false;
                }
            }
        }
MrZorG33 commented 3 months ago

Life didn't prepare me for this...)) in my opinion this is a very strange gaming convention. can this be removed quickly and without consequences for the rest of the code?

victorxup commented 3 months ago

IMO it works as intended now, there is nothing to fix. I think that vast majority of civ players got used to this behavior long ago.