Advanced Civ

If you can't get it to work, maybe GenerateCrashDumps=1 in CivilizationIV.ini can help.
Already had that enabled, but good to make sure.

f1rpo said:
I suppose you wouldn't have to bother with the compiler from 2003 because you don't need to compile the debug DLL yourself.
About that....
f1rpo said:
If it does work, it will show a dialog and then attempt to write a ca. 3 MB file Civ4BeyondSword.exe.dmp to the Windows temp folder, which I could then debug in Visual Studio. (The "full dump" is much larger, but wouldn't be needed.)
I don't think it worked. I replaced AdvCiv's dll with the debug version, ran it, saw it crash at the same juncture (with a basically identical backtrace). Then I re-indexed and searched all of C: for the .dmp and it wasn't found. I'm not sure whether it tried and failed to write, or died before then.

If you're game to try another debug DLL:
f1rpo said:
Somehow fprint and fprintf(stderr,...) don't write to the Visual Studio console; no idea where their output ends up.
The web (https://stackoverflow.com/questions/5248704/how-to-redirect-standard-output-to-output-window-from-visual-studio) suggests this is Visual Studio being GUI-centric, not fprint being broken. I think it'd be worth trying it on the premise Wine will know what to do. I get stdout/stderr messages from other games, anyway.
f1rpo said:
So I'm trying OutputDebugString (writes to the VS console) and assertion popups (both through WinBase.h :sad:) instead. The MessageLog isn't available that early.
Unless Wine or AdvCiv has a VS console, I doubt OutputDebugString would work. Assertion popups depend on whatever they depend on, too. I wouldn't worry about collecting the debug info into a log file. Just spit it out and my terminal emulator will collect it just fine.
 
Last edited:
[...] PlatyBuilder - i disabled it a while ago - normal WB.
Oh. I never even knew about the city button. Obviously a scenario editor needs to have one. :blush:
pm[0] - ok - suggestion? if ( pm[0]) != null) ? i think you can reproduce and check on your end quite ealy.
Not by just placing some cities and units on turn 0, declaring war and ending the turn a couple of times. Can you reproduce it and tell me how? That pointer really shouldn't be NULL at that point.
FYI - u probably missed it and quite busy, though, my usual PM is there :)
Only busy, but thanks still for the bug report.
 
Not by just placing some cities and units on turn 0, declaring war and ending the turn a couple of times. Can you reproduce it and tell me how? That pointer really shouldn't be NULL at that point.
yes, happens a few times.

PM coming up... ive been busy.
 
hey ,
i think you have a bug ...

look at bool CvUnitAI::AI_pillageAroundCity
line 13561 : FAssert(AI_getGroup()->AI_isDeclareWar(/* advc: */*pBestPillagePlot));
you marked off an entire block:
ool CvUnitAI::AI_bombardCity()
ool CvUnitAI::AI_cityAttack

FAssert(AI_getGroup()->AI_isDeclareWar(/* advc: */:hammers:*pBestPillagePlot));
 
Looks OK in the code editor (screenshot attached), and I don't think it would compile if the compiler saw it differently. It does look weird though, so a space should be inserted before *pBestPillagePlot.
 

Attachments

  • VS-screenshot.jpg
    VS-screenshot.jpg
    96.5 KB · Views: 61
@f1rpo:
Linux debugging update: tried a few things, little to no progress. I've got 3 versions of AdvCiv in my mods folder (.96e, .97pre, .97dbg), each with their own CvGameCoreDLL.dll, and I've tried running them under Wine with various debug flags. The resulting logs aren't very enlightening.

Next steps:
Visual Studio does not run well (or at all?) on Wine, so that's out. Instead, I'm going to see if I can't get it on a Windows laptop and make myself some more verbose DLLs. I'll let you know if that works, I need help, or I give up.
 
@Elkad: Thanks. That's apparently something I've broken in my pursuit of speed. I thought that backwards traversal of city lists was unused; – not so. Easy to fix.

Every feature is used. Release it once for 5 minutes, and someone will adopt that feature as the "best thing ever", and demand you put it back, even after you discover it breaks everything else.
It's a law.

In this case, opening my capital and then hitting left-arrow to get to my newest city is a habit I've had for a lot of years.
 
Every feature is used. Release it once for 5 minutes, and someone will adopt that feature as the "best thing ever", and demand you put it back, even after you discover it breaks everything else.
It's a law.

In this case, opening my capital and then hitting left-arrow to get to my newest city is a habit I've had for a lot of years.

Spoiler :
workflow.png


I've been playing with 0.97-pre and, normally I can beat the K-mod AI on monarch and AdvCiv AI on prince, I haven't been able to beat the AI on prince yet without reverting a save. I've come close a couple of times but post-industrial the AI pulls out very far ahead.

I see at least 1 AI in every game has a tendency to snowball. I saw runaways/starting conditions discussed earlier. My thoughts on this are that since the AI is much smarter and can exploit good starting conditions more effectively, the balance of power is much more sensitive to starting resources. That and the AI is much more geopolitically aware and, it makes decisions almost like a human would, it thinks about the big picture more. Which can allow the AI to turn a small advantage into a big one through conquest. At least that's the impression the AdvCiv AI gives me.

I think the best solution is to normalize starting conditions to some degree. Another idea is to give more pacifist leaders an edge in diplomacy, staying on the good side of warmongering AI if they feel threatened by them. Since the AI can declare with a friendly attitude, I don't know what the AI could do to keep the peace. Maybe the powerful/warmongering AI can demand techs more often from weaker neighbors for peace deals instead of conquering them. The pacifist AI could switch civics and religions to appease the warmonger.

I also didn't know how much I wanted high res world views until I saw it. This is 2048 resolution. Thanks for implementing it @f1rpo
Spoiler :
8800_20200402145351_1.png


Edit: another thing I wanted to add is that the AI is very uncooperative when it comes to making peace deals. Just getting the AI to bargain is like pulling teeth, and even then they just declare war again as soon as the peace deal runs out. It makes the game very annoying at times.
 
Last edited:
Visual Studio does not run well (or at all?) on Wine, so that's out. Instead, I'm going to see if I can't get it on a Windows laptop and make myself some more verbose DLLs. I'll let you know if that works, I need help, or I give up.
Too bad. It may well be some completely unnecessary thing that I've changed. If nothing else helps, we could still use binary search to determine which Git commit introduced the problematic change. Compiling some 5-10 debug DLLs from older code wouldn't be too much trouble for me.
Every feature is used. Release it once for 5 minutes, and someone will adopt that feature as the "best thing ever", and demand you put it back, even after you discover it breaks everything else.
It's a law.
In the this case, I hadn't thought of the UI and human players at all. The city lists get traversed by AI code all the time, and it's always forward and starting at the capital. It's fine though, we can have it both ways. Firaxis had implemented the iteration step like this
Code:
CvCity* nextCity(int* pIterIdx, bool bRev=false) const
{
   return (!bRev ? m_cities.nextIter(pIterIdx) : m_cities.prevIter(pIterIdx));
}
i.e. checking the direction flag bRev each time. My (vague) understanding is that CPU branch prediction should handle that very well, but maybe not if the function gets inlined. Now I use a separate function "prevCity" for going backwards. (Git commit)
And I turned off that "no click to exit city view" as soon as I figured out how.
If more people prefer the old setting, I can of course set it back to the BtS default.

I've been playing with 0.97-pre and, normally I can beat the K-mod AI on monarch and AdvCiv AI on prince, I haven't been able to beat the AI on prince yet without reverting a save. I've come close a couple of times but post-industrial the AI pulls out very far ahead.
I must say you're all quite brave to play with this largely untested version. (But then, what can you do if it takes me forever to get there. And apparently it mostly works once it gets past the loading screen.)
Another idea is to give more pacifist leaders an edge in diplomacy, staying on the good side of warmongering AI if they feel threatened by them. Since the AI can declare with a friendly attitude, I don't know what the AI could do to keep the peace. Maybe the powerful/warmongering AI can demand techs more often from weaker neighbors for peace deals instead of conquering them. The pacifist AI could switch civics and religions to appease the warmonger.
The AI can, in theory, declare war when Friendly, but, especially among AI civs, which don't build 0 military, it really shouldn't happen until the late game. Dialing up tribute demands would be easy to do (changes in Civ4LeaderHeadInfos.xml might suffice), but I'd prefer to know what problem I'm solving exactly before taking any steps. In my book, it's fine if 1 out of 7 AI civs emerges as a hegemon over the course of the Industrial era. At what point does it actually happen, on what type and size of map (mainly Pangaea when it comes to snowballing conquests?), can we get examples in the form of saves, replays or screenshots.
I also didn't know how much I wanted high res world views until I saw it. This is 2048 resolution. Thanks for implementing it
Great that someone will use it. Personally, I'm too attached to having BtS compatibility, i.e. starting replay files through a double click.
Edit: another thing I wanted to add is that the AI is very uncooperative when it comes to making peace deals. Just getting the AI to bargain is like pulling teeth, and even then they just declare war again as soon as the peace deal runs out. It makes the game very annoying at times.
Noted, but I'd have to know specifics (a savegame probably) to do something about it.
 
Edit: another thing I wanted to add is that the AI is very uncooperative when it comes to making peace deals. Just getting the AI to bargain is like pulling teeth, and even then they just declare war again as soon as the peace deal runs out. It makes the game very annoying at times.
i noticed that too in 096,
but i changed the attitude threshold for most of the leaders to be more inclined to do some treaties.

VDNKh
p.s i like hard ball AI. :)
 
OK, why can't I kill privateers blockading me?

Edit, can't even attack them when they are in neutral culture.
I'm using Carracks.
 
Noted, but I'd have to know specifics (a savegame probably) to do something about it.

Game I'm playing right now, BC-0150 is me right about to capture Angkor Thom, AI refuses to negotiate. Even with a lower power ratio I clearly have the initiative. Then BC-0025, right about to capture
Hariharalaya after a force there left to attack my cities, their holy city no less, and just now they are willing to negotiate when my power ratio is ~1. I don't mind a hardheaded AI but when it's always taking my attention away from teching I start to fall behind, Persia is already starting to get ahead.

it's fine if 1 out of 7 AI civs emerges as a hegemon over the course of the Industrial era. At what point does it actually happen, on what type and size of map (mainly Pangaea when it comes to snowballing conquests?), can we get examples in the form of saves, replays or screenshots.

Last game I played, got invaded by France a little before I discovered rifles. I'm trying to figure out how to solve this game. France is already way a head of everyone in production, and even with my big lead in commerce I'm only just a few tech ahead of him all the way up till I get invaded, if I solely focus teching.
 

Attachments

Can't kill Privateers with Frigates either.

Ahh, I need to be at war with the owner... And of course I either have to guess, or savescum until I figure out who that is.
 
OK, why can't I kill privateers blockading me?
Because I've gotten confused by a function CvUnit::isEnemy(eTeam,kPlot). I've now added a comment: "Says whether this unit's combat owner in kPlot as viewed by eTeam is hostile to eTeam (same as in BtS)." :shifty:

My current DLL has a new issue with AI trade memory. I'll see if I can get that fixed tonight and upload it; else tomorrow. Using your own Privateers should work as a workaround. Or let them attack you. Or WorldBuilder.
 
Is there a strategy discussion thread or guide for this mod? I'd like to see how people play on Emperor+ in this mod.

One area I'm struggling in is conquest - the immortal culture change makes little sense to me. In my current Emperor game, I conquered the Dutch empire with Praetorians, and kept about 3 of its ~6 cities. It's now hundreds of years later and those cities are still in constant cycles of rebellions, and two of them are down to 1 population each but still rebelling all the time. The only one that has somewhat stabilised is near my own borders. Doesn't make much sense to me that a 1 pop city guarded by a Praetorian is still in constant rebellion cycles. Makes me wonder what sort of gameplay the mod is aiming for - should we just be razing cities and rebuilding new ones - does that help?

It also seems like the AI behaviour in this mod has buffed peaceful strategies quite a bit - seems like religions are much easier to found and the AI is less likely to build several good wonders.

Is it a conscious design choice to make conquest harder and peaceful games easier?
 
Razing them doesn't help either. When you resettle, your new city will immediately go into revolt and stay that way.

The only solution is to stuff 30 archers in the thing and build culture buildings until you overtake the owner. Which takes 2 turns less than forever if it's a well established city (like a Creative capital).

Note, once you get to rifling or so, it magically all goes away. One or two riflemen will happily pacify a massive enemy capital.
 
That doesn't make much sense to me, if I've burnt their old city to the ground and brought in my own people to resettle, why would my people care about the old culture?

Also if that's right re rifles, that also seems pretty inconsistent.

So how do we deal with it strategically? Minimise pre-rifling wars? Doesn't seem to model actual history very well.
 
If you look upthread (a long way), the intent appears to be "take a couple cites, and then park your army in them forever".

The newest (beta) version at least tells you how many units you need to stabilize a city, which is useful.

But an early conquest war is pretty darn hard to do. You have to leave so many units behind you can't keep pushing. And of course if the enemy isn't dead, you get stuck with homeland anger and various other issues as well.

Example. My current game.
Turn 314 (1898AD, marathon, huge, 18civs, no techtrades), I just took Amsterdam (sz14) about 4 turns ago.
A couple civs have rifling, but I don't.
5 maces and 5 cannon in the city (healing/occupying). Chance of revolt is 7.7%. It's 15% revolt empty, and if you don't have enough units, it'll revolt nearly forever. I need another 66 garrison points to get to 0%.

Hague, sz11, took 1t ago. 8 cannon, 7 maces. 2.6% revolt chance. (and only 77% to reduce occupation, which I am still in)

I took london in 1550AD, quite a while ago, killed off the owner completely, and built HE in it. I'm at 46% culture.
It only takes a warrior to hold it now (2 power), but if I take that warrior out, it goes right back to 15% revolt chance.

My general rule is 20 units to keep an established city from revolting. It seems to be holding about right in this latest version as well (first game I've played in it).
 
Back
Top Bottom