Advanced Civ

Oh, you're actually right. I was comparing the viewport sizes on the minimap, but I didn't realize the zoom was greater in the mod compared to vanilla. I does look like the actual landmass is roughly the same in the mod (left) and vanilla (right).
By Antiquity I meant Classical, so yeah, that's the ripe time for war when you get access to swordsmen/horse archers/etc.
Hm, that screenshot of yours does look fine in terms of free space for settling. I remember feeling way more boxed in with default settings (I was playing a large map though, not huge, but still with default number of civs). Maybe I just got really unlucky, or maybe I'm playing that badly and not expanding fast enough. I guess I'll watch a couple of AI-only games to figure it out.

By the way, there's another issue I've noticed that I wanted to tell you. For some reason map regeneration doesn't work for me with your mod, even though it was working fine in vanilla. What I'm doing is I click on "Map Mode", click the button to regenerate and with your mod the game for some reason just freezes and I'm forced to kill the process with the Task Manager. It's not a big deal, just a little bit annoying.
 

Attachments

  • mod.jpg
    mod.jpg
    149.7 KB · Views: 36
  • vanilla.jpg
    vanilla.jpg
    164.4 KB · Views: 30
I was comparing the viewport sizes on the minimap, but I didn't realize the zoom was greater in the mod compared to vanilla. I does look like the actual landmass is roughly the same in the mod (left) and vanilla (right).
I see; hard to tell for me visually either way. Debug mode (Ctrl+Z, requires the chipotle cheat code in th CivilizationIV.ini) should show plot coordinates when Shift is held down. The highest coordinates (upper right corner) indicate the map dimensions. Shift+F2 also shows some map statistics (with the cheat code; additionally requires Debug mode in AdvCiv), but they seem difficult to interpret. AdvCiv can also write a logfile with map statistics (messageLog in CivilizationIV.ini, LOG_MAP_STATS in GlobalDefines_devel.xml).
By Antiquity I meant Classical, so yeah, that's the ripe time for war when you get access to swordsmen/horse archers/etc.
Right. 🙂

Smaller map sizes do have a little less space per player. And it doesn't take a lot of bad luck to be in Willem's spot, say. My impression has been that growing the capital to size 3 before the first settler is often not optimal in the mod when neighbors are close. There won't be much Barbarian activity then (and they start out gentler in the mod anyway), so those Warriors trained while growing won't be so useful. Hm, could also be a matter of space left between cities. I'll admit that maps with a lot of space feel freer when it comes to city placement.

Map regeneration in WorldBuilder: That's one for the "after years of playing TIL" thread (don't recall its exact title). I had no awareness of this button. Apparently runs into some endless loop. I'll look into it. Seems to be handled by the EXE. I wonder if it's any different from the button on the Esc menu – other than not being blocked once two civs have met each other (edit and past turn 0). If it's the same effect, then it won't properly reset parts of the game state. Might be fine when used early in the game.
 
Last edited:
@keldath: I've finally addressed a couple of "rarely" failing assertions in AI code. The main benefit really being that those assertions will no longer distract you and me. A decent chance that this has introduced some actual problem. ;)

game.aiplay is a command on the developer console. Maybe a good time to take a closer look at that strange console – which is distinct from the Python console. help lists all the commands. It's Game.AIPlay in that list, but the commands aren't case-sensitive. A lot of commands really, but few that I could actually find a use for. player.changegold maybe; though placing Great Merchants through WorldBuilder usually does the trick too. I wonder how these commands are implemented. Probably largely it's own thing somewhere in the EXE with a simple parser and handler functions. Hm, game.aiplay probably mostly just calls CvGame::setAIAutoPlay and later CvGame::reviveActivePlayer. Which, looking at the BtS code, destroys the cities and units of the active (human) player and gives that player a Lion (unit ID 0) at coordinates (0,0). Since I've only been using the command when the AI Auto Play mod isn't available, that's the only effect I've seen. However, since AdvCiv (through the AI Auto Play mod) changes the behavior of those two CvGame functions, it actually seems to work just like Ctrl+Shift+X in the mod. So my recommendation against that command was probably misguided.

Seems that map regen via WB simply calls CvGame::regenerateMap in the DLL. My guess is that the procedure runs in a different thread due to being launched from WorldBuilder and that this somehow causes a deadlock. I think I'll have to go back to older versions to hopefully figure out why it's not a problem in the original game, Maybe I can fix the long broken Autorun (edit: ) QuickStart function (in CivilizationIV.ini; part of yet another auto play mechanism) while I'm at it.

@Lanstro: Thanks for weighing in and making me feel less like I'm imposing highly idiosyncratic preferences. Well, I appreciate everyone at least trying to make sense of my choices and coming to terms with most of them, very much including @Yorok 🔜 I'll check out those savegames and get back to you.
 
Last edited:
@xyx: Thanks for your thoughts.One fundamental source of instability is that the AI war evaluation is based on a single predicted outcome of the war. That means, any tiny change in the power ratio can tip the scales on whether the AI believes that a war is a stalemate or will lead to the conquest of a city. Considering multiple trajectories, as simulation-based algorithms normally do, would take too long. However, I could actually implement two trajectories (one slightly optimistic, one slightly pessimistic) for situations when performance isn't an issue, e.g. so long as an AI civ knows fewer than 100 cities. I think, in the late game, outcomes tend to be clearer (greater disparities in military power) anyway.

Another fundamental change I've been considering is to move all AI decisions about trades offered to humans and deal cancellation to the start of the human turn. Currently, AI offers are locked in during the AI turn, and several other civs may take their turns before the offer is put to the human. So the AI may cancel a deal and lose access to another resource before the cancellation popup gets shown. Ideally, any AI-to-human offers should immediately result in a diplo popup. That'll require some trickery as the EXE is responsible for showing diplo popups. I'm not sure if the turn order is the only cause of erratic deal cancellation. How often do you reckon it happens per game?It's intentional that the overall power ratio hardly matters when the AI doesn't believe that the war enemy can reach its cities within 25 turns, or when it believes that the cities will be of too little value to the enemy to bother. The AI can't be certain of this, but erring on the side of not paying for peace when there is no imminent danger seems reasonable to me because a powerful enemy may well attack again 10 turns later or at any convenient moment. Also, a civ that has lost its core cities doesn't have much to lose. It should still try to survive of course, but, in general, the more an AI civs falls behind, the more willing it should be to take risks.

Asking for payment after losing cities seems a bit too audacious but is perhaps not really an issue if the demanded payment is a negligible expenditure for the winner.It may well be that the AI fails to recognize this sometimes. A screenshot (or savegame) might be helpful here and also for the refusal to capitulate and anger in conquered cities. I rarely win games through Domination, so it's possible that wars of conquest in the late game are more frustrating than I realize. In any case, I already have an AI function for evaluating (simply based on the power ratio) the abstract possibility of an enemy invasion past the 25-turn time horizon of the military analysis. It's currently only used for deciding whether to start a war, but it would be easy enough to (optionally) also take it into account when computing the peace terms.So far so good. Having a sufficient number of units within the AI's borders is a prerequisite for capitulation. The idea is that the AI only capitulates at gunpoint. After you've just taken a city, even if you're very powerful, who knows if you'll bother (war weariness, maintenace, supply, other potential wars) to conquer another. Perhaps you were already aware of this behavior; anyway, I should probably add a loading-screen hint about it. Also, an XML option for disabling the boots-on-the-ground check would be easy for me to implement.Well, that's not good. :(I think of it as emigration -- of course, they never arrive anywhere because the game lacks a migration mechanism, and when there isn't even any nearby city to take the immigrants in, then this fiction really doesn't work. :undecide:I think the way it works currently is – for a worst-case example:
A size-20 city with 100% culture of the former owner receives
40%*100%*20=8 anger :c5angry: from "being ruled by a foreign culture" (formerly "yearn to join our motherland") when the borders are open – as in BtS (well, I guess BtS would round down to 7). When the borders are closed (doesn't matter in BtS), it's 150%*40%*100%*20=12 and, when at war, 200%*40%*100%*20=16 (12 or 11 in BtS). 12 anger after making peace should lead to a loss of more than half of the population only in rare circumstances. 16 is indeed a lot. :think: Setting CLOSED_BORDERS_CULTURE_ANGER_MODIFIER to 25 would reduce that to 14 and hopefully wouldn't affect smaller cities much because the current anger seems about right for those.That's an unintended side-effect, but I thought it's kind of flavorful that Barbarians can take advantage of wars between civs. The units could also be marauders. The fogbusting change can be reverted by setting MIN_BARBARIAN_STARTING_DISTANCE in GlobalDefines_advc.xml back to 2.

As for "more barbarians in the early game": High on my to-do list is to decrease Barbarian spawning near tiles where they have recently been spawned or killed. I do think that too many Barbarians spawn in the late Classical era and beyond when the civs don't get all the land under control.
Got to this comment from the manual and even though it is for an older version of the mod I believe the behaviour is still the same in v1.1. AI hardly ever capitulate when they really ought to. For example, here is a screenshot of Monte with only 1 city left and enough units to take the city right next to it, but he still refuses. I saw the same thing in other games with Toko, Pacal, and Suryavarman. Didn't seem to matter how long/quick I fought with them for, how many of their units I killed or if I captured/razed their cities. They just fight to the death.They most often say "It looks like your offensive has run its course" rather than the one in the screenshot, but they just say that even when I can take their city in that turn with a stack of doom right next to the city.
Civ4ScreenShot0016.JPG
 
I agree that he should capitulate in the screenshot. I suppose we're not savegame-compatible(?). Maybe an overflow occurring on large maps when the would-be master has a very large military. Perhaps I'll run some big game on auto play and try taking over the leading civ in the late game and going after the weakest civ - to see if that'll reproduce the issue. The "offensive run its course" reason should be easier to narrow down: If putting additional units into the enemy's borders does not make it go away, also not after ending the turn once, or if the number of units required is unreasonable, then it's apparently not working as intended.
 
I agree that he should capitulate in the screenshot. I suppose we're not savegame-compatible(?). Maybe an overflow occurring on large maps when the would-be master has a very large military. Perhaps I'll run some big game on auto play and try taking over the leading civ in the late game and going after the weakest civ - to see if that'll reproduce the issue. The "offensive run its course" reason should be easier to narrow down: If putting additional units into the enemy's borders does not make it go away, also not after ending the turn once, or if the number of units required is unreasonable, then it's apparently not working as intended.
Goodluck! I don't know how you aren't burn out AF but I'm happy you are still working on this mod!

The map was standard size, big-and-small, islands mixed-in.

Yeah won't be save compatible because I changed some xml stuff like adding in my own music. Didn't change anything related to the AI or map scripts or difficulty config etc.
 
@f1rpo
The main benefit really being that those assertions will no longer distract you and me
huh, interesting.
well cant keep up with your updates, looks like you back in hard core with updates , civ7 watch out!

as for the python console, i guess maybe the developers of civ used it perhaps.
never tried to run stuff from there.
my auto play runs with ctrl +shift + x :) if you recall :)
 
It's really mostly tying up loose ends – and the usual bugfixing after a release. It's not headed anywhere.
my auto play runs with ctrl +shift + x :) if you recall :)
Wasn't it 'Z'? Ctrl+Shift+X is the normal shortcut since jdog5000's days. No matter. ;)
(Always a relief when the emoticons get unencumbered from their Christmas decorations.)
 
Yeah won't be save compatible because I changed some xml stuff like adding in my own music. Didn't change anything related to the AI or map scripts or difficulty config etc.
You could upload the whole mod folder (or XML one) if you can't narrow it down to a few files to make game compatible and save time on testing from scratch.
Seems that map regen via WB simply calls CvGame::regenerateMap in the DLL
Is there a way to do that from either consoles? The button is removed in WTP and I'd still like to regenerate the whole script, not just terrain.
🙂 I rather keep getting asked about the absence of the option than why I haven't improved it.
Hilarious! The taste of most your adjustments may not suit me very well, but I sure respect your willfulness to uphold them. It's still closer to optimal than vanilla imo, which on top of your AI's performance and optimizations is very impressive, thanks for all your work.
 
Last edited:
@f1rpo
hey mate,

long ago,
i commented this out:

plot.h
// advc.opt: It's fine to change the size, but might want to double check if it can be avoided.
BOOST_STATIC_ASSERT(MAX_PLOT_NUM > MAX_SHORT || sizeof(CvPlot) <= 268);

i tried to compile with it uncommented ->
CvPlot.h(1036): error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
1> with
1> [
1> x=false
1> ]
1> d:\cuv4stuff\cvgamecoredll\CvPlot.h(1036) : see reference to class template instantiation 'boost::STATIC_ASSERTION_FAILURE<x>' being compiled
1> with
1> [
1> x=false
1> ]
1>NMAKE : fatal error U1077: '"
......\Microsoft Visual C++ Toolkit 2003 SP1\bin\cl.exe"' : return code '0x2'

any thoughts on why this line wont work at my end?
 
This has probably been spoken of, no way to use python 3.8 or so in civ4?
I think it was discussed in some form in the C2C subforum and probably nothing became of it. Alongside the existing Python 2.4 environment, I assume. I wouldn't know what exactly this entails and if it's technically very challenging to let the MSVC 2003 DLL interact with some recent Python environment. At the least it sounds laborious and apparently no one has done the work.

The static assertion is just intended as a warning that (substantially) increasing the size of CvPlot could hurt performance. I imagine that Doto has made some (perhaps minor) additions to CvPlot. Probably best to just keep the assertion commented out. Or you could assign sizeof(CvPlot) to some variable somewhere and check in the debugger what the size is and put that number in the assertion instead of 268. That way, you'll be alerted if you increase the size (again) in the future.

Debug mode: Is it loading the right ini file? I use a different one when attaching a debugger, so sometimes I make a change in the wrong one. But I suppose all yours would have the cheat code entered. Should the status of the cheat code correspond to the checkbox under Game Details? I don't even what that dialog looks like when everything is in order.

You could upload the whole mod folder (or XML one) if you can't narrow it down to a few files to make game compatible and save time on testing from scratch.
I got lucky and ran into a suitable situation on the first attempt. The strongest civ was even already at war with the weakest when auto-play ended, and the weakest has just one city left. And refuses to capitulate although it is one turn away from being conquered by one of its three war enemies, the other two also having stacks closing in. Seems to be an issue with the AI hoping that the aggressors will just not bother. Highly inappropriate given the circumstances. Though it may be true that the war is not worth continuing for long just for the sake of that one city (which, inevitably, is always the capital and therefore looks important but is really just some backwater). I'll make adjustments. That may also improve matters wrt. civs left free and alive at one or two cities (@Rawwwrr). From looking at the code, I don't think this is a recently introduced problem.
Is there a way to do that from either consoles? The button is removed in WTP and I'd still like to regenerate the whole script, not just terrain.
It's not exposed to Python. help on the other console shows a bunch of map commands for regenerating or clearing some elements. Combining several of those looks impractically tedious.
The taste of most your adjustments may not suit me very well, but I sure respect your willfulness to uphold them. It's still closer to optimal than vanilla imo, which on top of your AI's performance and optimizations is very impressive, thanks for all your work.
Crimes against slavery? :P Well, probably other reasons too. I'm now resisting major balance changes (forward or backward) also because I don't want to deal with the ripple effects.
 
Crimes against slavery?
I understand why whipping is OP and 24 is a fine number, you actually could go lower as said in the manual if you keep Granary at 50% foodkept, but I much more prefer the design where those 50% are split into more buildings, though not 25/25, as value increases with each following percent. Here's my design for History Rewritten:
Now to whipping (slavery hurrying). Base HR nerfed it to oblivion: not only cities require 24+4/pop food, limiting effective whipping to size-2 cities (maybe 3-4 for Imperialist), but Granary costs crazy 80 hammers while contributing only 25% food saving. What whipping was supposed to address originally are food-heavy and hammer-starved starts like on Flood Plains, but if you have to pay 80 hammers to access the "solution", you lose so much momentum that it cripples you anyway. So while I agree that 50% is just too much, Granary should at least be worth it's opportunity cost.

My solution is simple - Granary gets a whipping discount, but by building it you lose exactly the momentum you are supposed to have in excess - growth. Granary is -1 food +1 commerce, net neutral, punishing yellow hill abusers, compensating grass settlers. Food multiplier (30% now) is in place, use it's power to catch-up. Still should be smart to wait for size 3 if worked plots don't provide at least 3 excess food.

A city starts with 22 food requirement for growth. Suppose you have 2 food surplus, so it would take 11 turns before it's ready to become size-3, the (usually) optimal time to whip. If you have no improvements, you break even on yields working tiles with boni/FP/coast, but let's say you work a common tile with an improvement yielding 1 extra point while growing. You pay 22 food + 11 opportunity cost to get 40 hammers without a Granary, leaving you with 7 extra that an Agrarianism civ would get from a farm. It falls off with 2-3 more population (3 food/size in Casual Terrain Plus). Granary offsets this by 2 population, except you grow slower. May be worth setting initial growth value higher while buffing the hurry multiplier.
That was before I realized CIV4HurryInfo is a thing (thanks to AdvCiv, actually), so I was limited to fixed 30:hammers: value. Now that I am not, I plan to return base food-to-grow value higher and raise the hammer amount, so that whipping efficiency decreases slower with population. I also consider giving important buildings like Granary a malus (inverse of Kremlin, because I can't code a tag for local effect) to hurrying that is later offset by another building (raising it's importance, which is an extra benefit of the design).

Oh, and another important thing - one can easily afford to nerf whipping even harder, if you shift some yields from boni to improvements base, I enjoyed this touch a ton in the original History Rewritten, but most Civ4 players prefer dramatic asymmetry afaik.
I'm now resisting major balance changes (forward or backward) also because I don't want to deal with the ripple effects.
Well, that's your right, I'm already surprised at how much you've changed despite aiming to make AdvCiv mostly "unaltered gameplay" type of mod.
 
Last edited:
This has probably been spoken of, no way to use python 3.8 or so in civ4?
How often I wish for this. Even 2.7 would be amazing, it is incredible how many basic Python features are missing from 2.4 (context managers, ordered dicts, ternary operators...). It doesn't even have its own documentation on the Python website, and often you have to piece its features together from the 2.7 docs and the occasional "introduced in Python 2.x" comment, which infuriatingly often lists Python 2.5.

But like f1rpo said, more adept and willing-to-get-their-hands-dirty people have tried and nothing came of it, sadly.
 
Just a couple of addendums to my reply to @Yorok's older post (and then I'll be away from my PC for at least a day):
In random event of fire destroying the forge in a city I picked the option of paying gold in order to preserve the forge. Forge was preserved, but game displayed incorrect message of "A fire has destroyed the forge in the ...".
The text for the choice that saves the Forge says (if I'm looking at the right text): "Organize a rebuilding effort." So the story is that the Forge always gets destroyed. It's still confusing and would be better to merely say that a "a fire has broken out" or something like that. There seem to be four different announcement texts that, I guess, can appear randomly. Not worth it to me to copy and rephrase all those. And I do think it's a somewhat common problem with event announcements – they're arguably not supposed to indicate how the event was handled, but it seems that they frequently suggest a particular outcome. Directly above the Careless Apprentice texts, I see Hymns and Sculptures saying that a Great Artist has ermerged and Inspired Missions saying that religious influence has been expanded, and I don't think either of these outcomes are guaranteed.

Regarding the Financial trait:
This contradicts statement from manual "or a total yield of at least 3 commerce" and unmodded game (in it any tile with at least 1 commerce gets +1 from golden age and then +1 from financial trait too (because total yield is 2)).
I can't confirm that the unmodded game boosts 1-commerce tiles during a Golden Age. Well, I've only tried it with a UI mod (screenshot attached), but the code also seems pretty clear – and deliberate:
Spoiler :
C++:
int CvPlot::calculateYield(YieldTypes eYield, bool bDisplay) const
{
	// ...
	if (ePlayer != NO_PLAYER)
	{
		if (GET_PLAYER(ePlayer).getExtraYieldThreshold(eYield) > 0)
		{
			if (iYield >= GET_PLAYER(ePlayer).getExtraYieldThreshold(eYield))
			{
				iYield += GC.getDefineINT("EXTRA_YIELD");
			}
		}

		if (GET_PLAYER(ePlayer).isGoldenAge())
		{
			if (iYield >= GC.getYieldInfo(eYield).getGoldenAgeYieldThreshold())
			{
				iYield += GC.getYieldInfo(eYield).getGoldenAgeYield();
			}
		}
	}

	return std::max(0, iYield);
}
The trait gets applied before the Golden Age. So that's also where I put the check for the new effect.

I've fixed the Jungle on Ivory Camp thing. Probably affected gemstone Mines too. K-Mod broke this twelve and a half years ago.
 

Attachments

  • Civ4ScreenShot0001.jpg
    Civ4ScreenShot0001.jpg
    438.6 KB · Views: 35
I have encountered very strange aggression that I don't think is fair at all. Montezuma (lower right) went to war against me and took Edirne (upper left) despite not being anywhere near my borders. He basically went through Saladin's borders just to wage war against me. Even if he holds Edirne it makes no sense to take it because he can't possibly hold it or prevent revolts/culture flipping in it.
 

Attachments

  • bs.png
    bs.png
    6.8 MB · Views: 35
One little question, is this icon, like three little arrows above the city bar, that indicates that city is connected to capital, is somehow deleted from this mod ?
 
Back
Top Bottom