Advanced Civ

Was the reversed pillage order intentional? Pulls up roads before improvements?

Pretty annoying when I want to knock down an improvement so my auto-workers come rebuild the appropriate thing on it (found new resource, teched calendar, etc)

Edit - I see the change, in .99. Discussion links to talking about being able to pillage roads in own territory, but nothing about why the order is changed.
Only time I can see wanting to pillage my own road first is in MP when I'm facing a Commando-promoted entire army.
 
Last edited:
I was mainly thinking of disconnecting strategic resources – Coal, Oil, or metals to temporarily un-obsolete Warrior. Pillaging one's own roads can also be useful for slowing down rival units that pass through at peacetime. The interaction with automated workers hadn't occurred to me. They should know how to replace improvements appropriately, but (worked or strong) unimproved tiles probably take precedence.

I don't think a "smart" rule - like pillaging the route first only when it's on top of a connected resource - is going to work well, and an extra button or a popup also seems undesirable to me (and is too much work). So either a modifier key (arguably Ctrl as Shift is already part of the Pillage shortcut Shift+P and Alt+P is in use for Sea Patrol) or a BUG option. Will (either way) unfortunately take some extra effort to keep things in sync in network games. I'm inclined to keep route-first as the default behavior since an unintentionally destroyed improvement is normally a bigger loss than a route.
 
Smart would work. If I'm pillaging my copper mine, knock the road down and leave the mine. If I'm pillaging a farm on a banana, knock the farm down and leave the road.

Wait. What about forts? In that case I don't want to disconnect my Oil anyway (unless I have two), so I'll probably send workers manually, but it's still a weird case. Of course road or fort gets disconnected either way.
 
Last edited:
@Jorunkun: Totestra isn't big enough to have the overflow issue (that I've fixed), must be something else. (And Totestra/PerfectWorld has its own lake placement code anyway.)So the loading screen ("Initializing") doesn't even appear? Just freezes after you click "Launch"? (Never seen that.)
Not sure if it actually freezes or just takes forever to get to the "initializing" screen - longest I'd waited was probably a few minutes, but I don't recall this happening before. Will install your latest RC - for which many thanks - and see if the problem persists.

Sorry I haven't been more active on here; there are phases where I have to travel a lot for work and can't play, but looking fwd to long civ sessions over the winter hols.
 
Not sure if it actually freezes or just takes forever to get to the "initializing" screen - longest I'd waited was probably a few minutes, but I don't recall this happening before. Will install your latest RC - for which many thanks - and see if the problem persists.
If it does, then I could try to reproduce it by using the same RNG seed. To that end, you could set self.UsePythonRandom to false in Totestra.py (to get the Python RNG out of the way) and try particular nonzero MapRandSeed and SyncRandSeed values in CivilizationIV.ini until the problem occurs. And, then, with your seed values and ideally also your version of the Totestra script – and maybe a screenshot of your Custom Game settings – I might be able to reproduce the issue. If not, as a last resort, I could send a DLL with debug symbols and you could install a profiler to find out where the game (the DLL; hopefully) is stuck. I've walked people through that before (e.g. in this thread).

@Elkad: I'd also like players to be able to yank out roads under rival stacks somehow, so I think it'll have to be optional somehow. I don't have much impetus to mod currently, so this could take a while. Hope it's not a major nuisance in most games. (Or, if it is, I could quickly compile a DLL that always pillages improvements first.)
 
I'd say wanting to destroy a road under a rival stack is far less likely to occur. In that case, I'd probably accept having to rebuild the farm as well.
Of course if it's a Town, then there is a big cost to doing that, but it also makes sense. There are LOTS of roads in a town, it should be an ordeal. Either accept the loss or block them the normal way (by closing your borders).

Shifting topics, your notes indicated you worked on AutoExplore coding (flee from enemies). Not sure if it's that or unrelated, but my warriors sure seem indecisive on autoexplore lately - step forward to uncover new lands, step back to their prior location, then step forward to that tile again.

Neither of those are gamebreaking, so if you are taking a break, I can deal with it.
 
Shifting topics, your notes indicated you worked on AutoExplore coding (flee from enemies). Not sure if it's that or unrelated, but my warriors sure seem indecisive on autoexplore lately - step forward to uncover new lands, step back to their prior location, then step forward to that tile again.
The Animal phase should be over when they start avoiding enemies, so it might work as intended if there are (non-Animal) Barbarians nearby. I think auto-explore moves are executed before manual moves, so the enemy unit that the automated Warrior is trying to avoid may have become fogged by the time that you inspect the situation. If that's what's happening, then I guess some sort of memory needs to be built into the AI behavior. The AI does take into account the direction that the unit is currently facing in (i.e. the direction of the previous move), but this inertia isn't strong. It could also happen that there is only one direction in which there are still tiles to explore and that direction is blocked by patrolling Barbarians. The current code also doesn't take into account how strong the enemy units are. If it's just Warrior vs. Warrior and maybe a defensive bonus to take advantage of, then taking detours isn't justified. But moving a Warrior next to a Barbarian Axeman – something the BtS AI will happily do – is pretty annoying. Still, if proper AI code is too laborious to write, then it might be best to revert to the BtS behavior at least for human units. And I wouldn't even know what to do about the confusion caused by auto-explorers moving to safety before the human player gets to see the enemy units.
 
It's not because of visible enemies, so it may not be your recent change (or your change at all).
Even in the early game with animals disabled, units just double back on their path briefly and constantly on auto-explore.
 
Maybe the problem is that the AI looks for the best tile to explore in a 9x9 square centered at the current location and then uses the pathfinder to get there. The pathfinder does not have special behavior for exploration, so the generated path can be clearly suboptimal in that respect. For example, in this screenshot
Spoiler :
Civ4ScreenShot0000.JPG
the AI has picked the highlighted target tile and has then moved NW. To maximize exploration, it would've been better to move SW. (The white line shows all the past moves of the Warrior.) On the next turn, the target moves 1S
Spoiler :
Civ4ScreenShot0001.JPG
(which seems OK given that the goody hut wasn't yet revealed) and, again, the immediate move is suboptimal wrt. exploration; should've been SW instead of S.

Same issue in BtS (probably):
Spoiler :
Civ4ScreenShot0002.JPG
Might be more common in AdvCiv due to AI/ automated explorers staying closer to existing cities in the mod.

For a simple tweak, I think I'll just discourage target tiles that can't be reached in a single move; in a way that still allows the AI to path toward e.g. revealed goody huts. A more proper solution would be to pass a flag to the pathfinder that indicates exploration and then move part of the code for finding the best exploration target (currently in CvUnitAI::AI_exploreRange) to a place where the pathfinder can access it too.
 
What needs to be changed in "CIV4HandicapInfo.xml "so that the "AI" on the complexity of "Noble" would study technology more honestly? It became a problem for me that "AI" is far ahead of me in the study of technology, although there are absolutely no prerequisites for this (the development of territories)
 
There are some advantages that the AI gets on Noble - and even below Noble:
Spoiler :
Reduced upgrade cost and unit supply (when outside of friendly territory).
Code:
			<iAIUnitSupplyPercent>50</iAIUnitSupplyPercent>
			<iAIUnitUpgradePercent>50</iAIUnitUpgradePercent>
Slightly reduced inflation, war weariness:
Code:
			<iAIInflationPercent>80</iAIInflationPercent>
			<iAIWarWearinessPercent>80</iAIWarWearinessPercent>
Extra combat bonuses against Barbarians:
Code:
			<iAIAnimalBonus>-25</iAIAnimalBonus>
			<iAIBarbarianBonus>-25</iAIBarbarianBonus>
+0.3 "first impression" attitude between AI civs (gets rounded in the end):
Code:
			<iAIAttitudeChangePercent>30</iAIAttitudeChangePercent>
And in GlobalDefines, 10 free production in the capital at game start to allow the AI to quickly produce another unit for exploration without leaving its capital undefended:
Code:
	<Define>
		<DefineName>INITIAL_AI_CITY_PRODUCTION</DefineName>
		<iDefineIntVal>10</iDefineIntVal>
	</Define>
Upgrade cost is a significant factor. (But, in my book, it's fair because the AI has to garrison all its cities and all those units need to be kept up to date.) Or maybe the AI civs are making a lot of tech trades (unless you've disabled tech trading, obviously); a lot of potential for tech trades on those gigantic maps that you play on. The attitude thresholds are the same for AI-AI trades as for human-AI trades, so this would be a matter of AI civs having good relations with each other. Perhaps you could enter Debug mode (Ctrl+Z) and take a look at the breakdown of commerce and expenses on the Financial Advisor (F2). There should be a menu on the upper left that allows you to see the finances of rival players. Do they actually generate more commerce/ research than you do? Are their expenses smaller? If not, then I doubt that spending less gold on upgrades is the main thing that gets the AI ahead of you; more likely, it's tech trades then. Research costs should be the same for the AI as for the humans (iAIResearchPercent=100). Well, and I guess there's always a possibility that the AI is gaining some unintended advantage through a bug in the mod.
 
Can't reproduce that; screenshot attached. I've tried a smaller screen size too, same result. Also haven't been able to reproduce the issue that you mentioned in a PM with the GP bar not appearing unless at least two specialists are assigned that sounds like it might be related. Edit: part of reply moved to private conversation
I have this issue as well.
Issue: cannot adjust number of Spy specialists or hover over their text.
How to replicate: 1.) Use a screen resolution of 1366x768 or less, and 2.) in the BUG menu > City Screen > Layout > Specialists, have either BtS or Chevron selected.
What happens: the screen is too small and there is no place for the game to put the "Specialists" heading (the heading which is similar to "Trade Routes" and "Buildings"). I believe that this invisible "Specialists" heading may be blocking the mouse from interacting with the Spy specialist area of the screen.
This happens only in AdvCiv and not vanilla BtS or K-mod.
Workaround: In the BUG menu > City Screen > Layout > Specialists, use the Stacker option, at least temporarily when one wants to adjust the number of Spy specialists.
 

Attachments

  • cannot adjust Spy specialists.JPG
    cannot adjust Spy specialists.JPG
    293.4 KB · Views: 54
@Fimbulvetr: Thanks for stopping by.
Apart from decisions about war and peace, I haven't attempted anything ambitious with the AI. The Caveman2Cosmos team still has some bigger plans, but they're kind of digging themselves out of a hole. K-Mod also got included in Realism Invictus and History Rewritten, which are still being developed. Civ 4 Reimagined is also based on K-Mod, got started around the same time as AdvCiv and is still alive. Agree that it would've been a pity for karadoc's work to just slip into oblivion. Oh, and the Rhye's-and-Fall world might still adopt (part of) AdvCiv.

Hope you keep track of people using advciv. After playing AdvCiv, it is difficult going back to dumbAI and less interesting playing only against very warlike AI. I like being able to create long-term alliances (though I do question why all Civs inevitablly convert to free religion as the game progresses, even the ones who have religious civics as their favourite. It makes keeping strong alliances difficult into the modern era.

Do you keep the first post of this thread updated with any mods that use advciv? I've been interested in playing other mods but unless the AI can play competently then it isn't so interesting. Every few months I come back to see if there have been any changes worth starting a new game. I've put quite a few hundred into Advciv already.
 
Attaching a hotfix for those two UI issues. Thanks for making me aware. Who knew that so many people use such peculiar window dimensions. :)
Indeed had to do with the "Specialists" label – the space normally (on higher resolutions) reserved for that label was being used for the resource list rather than for the specialist buttons.

@TheOtherOne: Yes, I intend to keep the opening post up to date. So ... nothing is happening, I'm afraid. I guess you're right about Free Religion being adopted unanimously. I'll try to look into that.
 

Attachments

  • CvMainInterface.zip
    60.8 KB · Views: 13
Checked, both problems are gone

UPD:
By the way, I noticed another problem, I don't know the problem is in the BUG itself, or it's in fashion, but when I hover over the list I get a huge loss of FPS, most likely it's in the animation, which opens up additional information about civilizations. In mods where there is no acimation, there is no loss in performance. I don't think the problem is in the PC (RTX 3070, Risen 5 5600). The problem does not appear immediately, apparently you need to dial a large number of familiar civilizations, and perhaps it's something else
 
Last edited:
Attaching a hotfix for those two UI issues. Thanks for making me aware. Who knew that so many people use such peculiar window dimensions. :)
Indeed had to do with the "Specialists" label – the space normally (on higher resolutions) reserved for that label was being used for the resource list rather than for the specialist buttons.
I tried applying this hotfix by copying it into AdvCiv\Assets\Python\Screens and replacing the old CvMainInterface.py file, but it didn't fix the non-interactable Spy specialist problem for me unfortunately.

As for:
UPD:
By the way, I noticed another problem, I don't know the problem is in the BUG itself, or it's in fashion, but when I hover over the list I get a huge loss of FPS, most likely it's in the animation, which opens up additional information about civilizations. In mods where there is no acimation, there is no loss in performance. I don't think the problem is in the PC (RTX 3070, Risen 5 5600). The problem does not appear immediately, apparently you need to dial a large number of familiar civilizations, and perhaps it's something else

I believe that this is due to the Expand-upon-hover option. Do you get frame-drops if that option is disabled? (BUG Menu > Scores > Expand on Hover (bottom left area))

I poked around and found that the cause of the lag while hovering over the scoreboard is due to the "Expand on Hover" option. This occurs even when all the underscored options in "Column Order" are deleted. So, the game lags while hovering the cursor over the text in the scoreboard, regardless of whether or not the scoreboard actually expands out.
View attachment 564747
 
Last edited:
@crullerdonut Yes, this solves the problem, the panel does not expand when hovering, respectively, there is no drop in performance. But, obviously, the information is now incomplete.
 
Last edited:
@crullerdonut Yes, this solves the problem, the panel does not expand when hovering, respectively, there is no drop in performance. But, obviously, the information is now incomplete.
While the cursor is on the scoreboard, the scoreboard data is constantly (4 times per second) recalculated. This is the only (reasonably easy) way that my code in the DLL is able to tell whether the cursor has been moved away. I don't think this causes noticeable delays on Standard-size maps, but, in large games, it can be an issue. If you disable "Expand on Hover", then you can remove the underscores from the "Column Order" box to get the same info as before, i.e. basically to keep the scoreboard permanently expanded. The order of the columns might be a little awkward that way; this order —
!?2WSZCJEPTUNBDRAHQM*LO​
— corresponds to the order in K-Mod (except for the "J" – the Golden Age/ Anarchy indicator is an AdvCiv addition).
I tried applying this hotfix by copying it into AdvCiv\Assets\Python\Screens and replacing the old CvMainInterface.py file, but it didn't fix the non-interactable Spy specialist problem for me unfortunately.
I'll experiment some more, maybe the resource list is still taking up too much room in some situations.

@TheOtherOne: Regarding Free Religion, I've checked my old savegames and wasn't able to find an egregious example of religious leaders switching to Free Religion. I guess it only happens quite late in the game. If you or someone else come across such a situation, a savegame would be helpful.
 
Top Bottom