Bypass TerrainBuilder.AnalyzeChokepoints()?

YnAMP disable it when launching the worldbuilder, AFAIK it's not needed when creating a map (I can't be certain of that point), but the game will crash if you try to load and play a map without it (the moment you create a city)

If you're using YnAMP, you can use this internal value (set in config database) to skip it when loading a map outside the worldbuilder. As said it will crash as soon as a player create a city, but it's useful to have a look at how it's rendered in game.
Code:
<GameInfo>

    <Parameters>
        <Row ParameterId="FastLoad" Name="DEBUG: Fast loading for map visualization" Description="" Domain="bool" DefaultValue="0" ConfigurationGroup="Game" ConfigurationId="FastLoad" GroupId="MapOptions" SortIndex="991000"/>
    </Parameters>  
   
</GameInfo>
 
AFAIK it's not needed when creating a map (I can't be certain of that point)

AnalyzeChokepoints() does serve a purpose it seems. On large maps, such as the ones in AEP Earth, (not calling) it does sometime produce an error which won't generate the map properly, even in WorldBuilder. FYI
 
Last edited:
Never had that with any of YnAMP maps, but noted, thanks.
 
Never had that with any of YnAMP maps, but noted, thanks.

Actually, it maybe due to a different error. Today I discovered some map seeds will produce the error I may've seen before. It happens when placing natural wonders. I thought it might be due to commenting out AnalyzeChokepoints() but it looks like it occurs regardless. FYI.
 
Sorry to necropost: but (in GS) it doesn't crash if you don't call the function but barbs won't spawn and the AI don't know where to settle (and so wonder around). So I'm guessing @Gedemon this is the purpose of AnalyzeChokepoints().

Importantly, I've noticed in the XP2 map scripts AnalyzeChokepoints() is called twice! :confused:

Does anyone know why? Is this an error or oversight?
 
Sorry to necropost: but (in GS) it doesn't crash if you don't call the function but barbs won't spawn and the AI don't know where to settle (and so wonder around). So I'm guessing @Gedemon this is the purpose of AnalyzeChokepoints().

Importantly, I've noticed in the XP2 map scripts AnalyzeChokepoints() is called twice! :confused:

Does anyone know why? Is this an error or oversight?
My guess is that AnalyzeChokepoints() scans the map for land regions that are divided by mountains and other impassable tiles, and then uses those regions to assign names to continents. Sort-of like AreaBuilder.Recalculate(), but perhaps with impassable tiles treated differently.

The first call happens right before TerrainBuilder.StampContinents(), which makes me think that continent stamping depends on the output of AnalyzeChokepoints().

After TerrainBuilder.StampContinents() comes AddTerrainFromContinents(), which uses continental boundary info to place volcanoes. But since volcanoes are impassable, GS makes a second call to AnalyzeChokepoints() in case continental boundaries might have changed.

Not having named continents might explain the in-game instability when commenting out AnalyzeChokepoints(). Settling a city probably makes the game try to fetch the name of the continent that the city was founded on; barbs might be distributed semi-evenly among continents; the AI might use continents to determine which land is its "home turf".
 
you don't need to call AnalyzeChokepoints() for opening/generating a map in the WB, and continents are still created then IIRC.

IMO it's only AI related, as you had to call it again to prevent crashes when changing some terrain type mid-game (like water<->land) using the tuner.

So I think you're right for the new position of the second call, but don't think the first is needed, maybe they forgot to remove it (which cost some additional time during large map generation)
 
So I think you're right for the new position of the second call, but don't think the first is needed, maybe they forgot to remove it (which cost some additional time during large map generation)

Yes, I think so too.

But that is a little disquieting. Sloppy. Not what you'd expect from Firaxis. No, I'm not being sarcastic though if the shoe fits...
:lol:
 
Top Bottom