LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
286 stars 158 forks source link

Lighthouse not producing city connection to capital #4427

Closed austin-wangyu closed 6 years ago

austin-wangyu commented 6 years ago

1. Mod version (i.e Date - 4/23): Most current as of 5/23/18

2. Mod list (if using Vox Populi only, leave blank):

3. Error description: See title, though each city has lighthouse, produces unhappiness due to lack of city connection as well as lack of income from city connection. Fish and other resources receive the lighthouse food and gold bonus, though.

4. Steps to reproduce (optional): As Carthage, settle a whole bunch of cities along the coast. No clue why they don't work, they can't all be blockaded at the same time this early on.


Supporting information: Please note that you can attach .zip files by dragging-and-dropping them. If possible, zip up all supporting data and post that way.

  1. Log files (always attach your Logs folder, located at My Documents/My Games/Sid Meier's Civilization 5. Make sure you have enabled logging before experiencing an error! Go here to find out how: http://forums.civfanatics.com/showthread.php?t=487482): Unfortunately did not have logging enabled before this. Have enabled now for future reference.

  2. Save game (always attach a save that was made a turn before the error; located at My Documents/My Games/Sid Meier's Civilization 5/ModdedSaves): Before lighthouse glitch.zip

  3. CvMiniDump.dmp file (attach if experiencing a game crash. Located at Program Files/Steam/steamapps/common/Sid Meier's Civilization V):

  4. Screenshots (optional): image

austin-wangyu commented 6 years ago

Update: even after unlocking Lighthouse tech it still didn't resolve.

Mzimoxs commented 6 years ago

In Vanilla Civ5 you need the road tech to unlock city connections (so wheel)

ilteroi commented 6 years ago

can't reproduce.

image

there's basically only two conditions: you need a path of revealed coastal water plots to the capital.

that explains the problem with hippo regius. for utique it's hard to tell, maybe explore a bit more around the peninsula to the south?

ryanmusante commented 6 years ago

Ilteroi is correct, I play exclusively with Carthage. The route to the south end does not have a sea connection to Carthage. Utique has same problem condition. There is still fog covering the coast tiles that will connect and create a lighthouse upon revealing them. Another option for sea connection is to the north where the horesemen barbarian is, there is also fog there.

Move the pathfinder to the edge of the land to reveal tiles, next turn. Problem solved.

_20180524_062340

Mzimoxs commented 6 years ago

The coastline to Utique is already revealed. The fog of war is over the tiles under the coast tiles.

ryanmusante commented 6 years ago

There are two tiles uncovered at Utique that would allow the sea connection. It is to the lower left as highlighted in green.

Mzimoxs commented 6 years ago

The tiles you highlighted ARE explored. You wouldn't see the tile yields otherwise.

Iamblichos commented 6 years ago

Here's a test to verify @ilteroi. Open up your save from the screenshot above. Have IGE loaded, place some boats in the water to reveal those tiles, do turn. Problem fixed? Should be.

supermerill commented 6 years ago

They seems revealed for utique. Maybe because the CS isn't allied with you and so, it blocks the path?

ilteroi commented 6 years ago

enemy territory doesn't block trade routes.

those two tiles are not really revealed yet, it's just a trick of the camera.

Mzimoxs commented 6 years ago

Again: They are revealed. Else you wouldn't see the yields (2 food for coast).

ryanmusante commented 6 years ago

But does showing yields count technically as being "revealed" to the AI? Or does it require the entire tile to be unmasked from the cloud for the properties to be available?

Iamblichos commented 6 years ago

Couldn't load your save....which version are you using? and what mods?

Albertolona commented 6 years ago

Look more carefully at his screenshot and notice the real reason why Utique is not connecting.

Utique is NOT a coastal city so he can't have built a lighthouse there.

Mzimoxs commented 6 years ago

yes it is. The tile 7 from Utique is coastal. And also that wouldn't explain Gades and Saguntum

Albertolona commented 6 years ago

Yes I see that now thanks.

bigcat88 commented 6 years ago

IMHO: CS block city connection. Just use IGE to make CS friendly and connection will appear

Zarggg commented 6 years ago

(My mistake, the city banner was tricking my eyes into thinking a coast tile was a land tile.)

ilteroi commented 6 years ago

wow quite the thread for a rather simple issue. can anyone load the save, put an explorer on the peninsula and see what happens please?

austin-wangyu commented 6 years ago

Jeez sorry about this crazy mess, the save was from before the screenshot as it had requested. I do not have the save from the screenshot. However, from the save file I've attached (which I'm not sure why people cannot open, please let me know if there's something I need to do), I took this screenshot: image

Note how Utique was connected to the capital, and the city state border does not extend to the coast of my continent. I think it confirms that the city state border does break the capital connection, as well as the fact that there was no clear path to Hippo from Carthage, so despite there being a lighthouse, there was no connection. The city state border disconnected Utique, Gades, and Saguntum.

Speculation ofc, since I have little experience playing with Vox Populi/Carthage. Sorry about not having the save for the screenshot

Iamblichos commented 6 years ago

@ilteroi I tried to load his save but was unsuccessful. @austin-wangyu What version of VP are you using AND are you using any other mods??

austin-wangyu commented 6 years ago

4-20-5, no other mods

Update: rip just realized that there is a more recent version of VP 5-20-3, my bad y'all.

ilteroi commented 6 years ago

well, now i'm confused. so it was alright before the CS border expanded? seems obvious, but here's the code:

//  --------------------------------------------------------------------------------
int TradeRouteWaterValid(const CvAStarNode* parent, const CvAStarNode* node, const SPathFinderUserData&, const CvAStar* finder)
{
    if(parent == NULL)
        return TRUE;

    const TradePathCacheData* pCacheData = reinterpret_cast<const TradePathCacheData*>(finder->GetScratchBuffer());

    CvMap& kMap = GC.getMap();
    CvPlot* pNewPlot = kMap.plotUnchecked(node->m_iX, node->m_iY);

    if (!pNewPlot->isRevealed(pCacheData->GetTeam()))
        return FALSE;

    //ice in unowned territory is not allowed
    if (pNewPlot->isIce() && !pNewPlot->isOwned())
        return FALSE;

    //ocean needs trait or tech
    if (pNewPlot->isDeepWater())
        return pCacheData->CanCrossOcean();

    //coast is always ok
    if (pNewPlot->isShallowWater())
        return TRUE;

    //check passable improvements
    if(pNewPlot->isCityOrPassableImprovement(pCacheData->GetPlayer(),false) && pNewPlot->isAdjacentToShallowWater() )
        return TRUE;

    return FALSE;
}

no check for tile ownership. i'm stumped.

LoneGazebo commented 6 years ago

is there a pokey lil barb boat on the fogged coast tile?

austin-wangyu commented 6 years ago

@LoneGazebo I'm not sure which coast tile you're referring to?

ilteroi commented 6 years ago

hey guys, i think i was looking in the wrong place. sorry, the correct piece of code is

int WaterRouteValid(const CvAStarNode* parent, const CvAStarNode* node, const SPathFinderUserData& data, const CvAStar*)
{
    if(parent == NULL)
        return TRUE;

    PlayerTypes ePlayer = data.ePlayer;
    TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam();

    CvPlot* pNewPlot = GC.getMap().plotUnchecked(node->m_iX, node->m_iY);

    if(!pNewPlot || !pNewPlot->isRevealed(eTeam))
        return FALSE;

    if(pNewPlot->getOwner()!=NO_PLAYER && !pNewPlot->IsFriendlyTerritory(ePlayer))
        return FALSE;

    CvCity* pCity = pNewPlot->getPlotCity();
    if(pCity && pCity->getTeam() == eTeam)
        return TRUE;

    if(pNewPlot->isWater())
        return TRUE;

    return FALSE;
}

so there is an ownership check after all. the question is if minor players' territory should be excluded from the check, ie allowed for routes?

bigcat88 commented 6 years ago

@ilteroi no, it was always like that. If someone need a road throw CS then ally it or make friendly.

LoneGazebo commented 6 years ago

@ilteroi since roads overrule CS ownership for connections, and you can't build roads at sea, I feel like CS tile ownership shouldn't affect water routes.

ilteroi commented 6 years ago

uuh i smell a forum poll

LoneGazebo commented 6 years ago

let's just change it and change it back if people balk. I feel like this a QoL change.

ilteroi commented 6 years ago

i just took a look but it seems roads trump plot ownership only if there's an active quest to build a road.

LoneGazebo commented 6 years ago

@ilteroi hmm...well, then maybe we leave it. I thought roads overwrote cs ownership in all instances.

Iamblichos commented 6 years ago

I'm with @LoneGazebo change it. But I like changes. Seriously though, seems stupid that CS ownership of a tile would block water if !AtWar()

ilteroi commented 6 years ago

well then this isn't only about water connections anymore.

but i agree, the logical thing would be to allow connections through plots you can enter peacefully. so minor and major with open borders.