LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
285 stars 157 forks source link

City state settlers can spawn on top of mountains #7315

Closed Dromin closed 2 years ago

Dromin commented 3 years ago

1. Mod version (i.e Date - 12/1): 12-1

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

3. Error description: Okay, so I like to play on the highlands map and I've seen this happen many times before (thanks to the Convenient Start mod giving my initial settler extra vision), but this time it was a particularly egregious case 😆 See screenshots below. Appearantly there is no check that prevents city state settlers from spawning on top of mountains. This results in various types of weirdness.

In this particular case, the city state settler spawned on a mountain close to the spot where I decided to settle my capital. Obviously it couldn't settle there, so the next turn it teleported to the other side of my capital. (Side note: that was actually the first time I've seen them do anything like teleporting themselves. Previously they would either walk around on the mountains until they found a way out, or just... sit there in the same spot for the rest of the game and never actually settle a city.) They couldn't settle there either because they were touching my borders, so they moved 1 tile down and planted their city pretty much right on top of my capital. (Side note 2: appearantly the restriction that you have to settle at least 3 tiles away from an existing city does not apply to city states; not sure if this is intentional?) I went back a few autosaves at that point, declared war and captured their settler before they could settle. However, this does not remove the city state from the game, as would happen if I had conquered their city. So the city state is still displayed in the list on the right side of the screen, can still give quests etc. and their warrior is still standing in the same spot next to my border, even though the chances of it settling an actual city are zero now because their settler turned into a worker when I captured it.

In fact, I'd say that I find city states in this situation in most of the highlands games I play. Sometimes, like now, there is only a warrior left with no indication of what happened to the settler (... well, except this time I know exactly where it went, lol). I image it was taken by barbarians before it could find a suitable spot to settle. Sometimes the settler is still sitting on top of the mountain and never settles a city. There was also that one case in which the Bratislava settler was still hanging out in a corner of the map until the industrial era, not even on top of a mountain (although I assume it originally spawned on top of one) but embarked in a small sea. It kept moving back and forth as if it was trying to find a spot to settle, but Ur was in the way. Then it was chased to the other side by barbarians and finally founded a city really late-game. And on several occasions I have freed a city state settler from a barbarian encampment; they usually settle a city on the spot right after being freed.

4. Steps to reproduce (optional): Play highlands map for a ridiculous number of hours because you have no life.


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): /
  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): /
  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 image image
RecursiveVision commented 3 years ago

This is a funny bug. Don't think I've ever seen anything like this before. :D

Dromin commented 3 years ago

lol, I aim to please 😛

ilteroi commented 3 years ago

as far as i understand this, it would be a problem of the map script. couldn't reproduce in any case.

RecursiveVision commented 3 years ago

@Dromin Does the Highlands map come with VP? If not, it's a mod conflict. I'm not familiar with all the maps, but it's not listed as an additional mod in your list.

ilteroi commented 3 years ago

ok, now i see it ... but no idea what to do about it. if it's only this one mapscript, no big deal?

image

RecursiveVision commented 3 years ago

Maybe someone like @azum4roll would have a better idea of how to handle this?

Dromin commented 3 years ago

@RecursiveVision I think the Highlands map came with the vanilla game. My bad, I didn't realize that it would be the map script that determines city state starting location 😅 Settler teleportation however is most likely being caused by VP (given that this was the first time I saw them do that, and I'm definitely seeing a big increase in "missing" city state settlers since updating to 12-1).

EDIT: And as I posted this I realised that the increase in missing city state settlers is probably caused by the fact that civilian units captured by barbarians no longer try to move towards the nearest barbarian encampment. Previously I would often find and free them from nearby encampments as described above, but now they'd just be standing around unprotected and much more likely to get picked up by an AI scout passing by.

RecursiveVision commented 3 years ago

@ilteroi The thing about Barbarian civilians is probably a bug?

ilteroi commented 3 years ago

cannot confirm that

Dromin commented 3 years ago

I'll make a report as soon as I can get a good screenshot.

Dromin commented 3 years ago

Issue report: https://github.com/LoneGazebo/Community-Patch-DLL/issues/7327

azum4roll commented 3 years ago
    if plotType == PlotTypes.PLOT_OCEAN or plotType == PlotTypes.PLOT_MOUNTAINS then
        return false
    end

Mountain check does exist in Highlands, so I don't know why that happens.

EDIT: Wait, there's a TYPO. It should be PLOT_MOUNTAIN not PLOT_MOUNTAINS. Guess we found a vanilla bug!

If you want to fix it, fix the typo on line 550 of Highlands.lua

RecursiveVision commented 3 years ago

@LoneGazebo Does the CP modify any vanilla mapscripts?

RecursiveVision commented 2 years ago

Fixed this at last.