Advanced Civ

I've tried a Direct IP connection game with three instances of AdvCiv 0.69e running on the same PC. No problems with music. I can't test a LAN game. Also no music (no sound at all?) in single-player?

Hi f1rpo! Thanks for investigating! Yes, with AdvCiv mod loaded, it's as if music is switched OFF*, no matter the single/multi player setting, which is very weird. My friends have the same problem too. Once you unload the mod music is here again during game.

*To be very specific : the music on the menu is OK, it's the music during a game that is switched OFF.
 
Can someone compile the latest, even if it's labeled 096f_beta or something?
Been waiting for the city cost update for months now :)

or is that not even in yet?
 
@Elkad: City cost changes are implemented:
manual for v0.97 said:
The city count in the formula for number-of-cities maintenance counts vassal cities half (as in K-Mod) and is capped at a map-size-based upper bound between 36 (Tiny) to 42 (Huge).
Currently, the maintenance multiplier on Huge maps is about 80% of the multiplier on Standard-size maps. In BtS, that ratio is 67%. (But BtS also has a default player count of only 11 and Huge maps are 8.6% larger than in AdvCiv.) Perhaps 80% is geared too much toward peaceful victories; maybe 75% would be a better baseline – to be adjusted to initial player count and sea level.

I've just written the last bit of AI code for city trades, which, tentatively, makes v0.97 feature-complete. Obviously, there will be bugs and balance problems, but I've run some tests in the last couple of weeks, so it's mainly a matter of making sure that the most recently added code doesn't frequently crash or produce crazy results. So maybe tomorrow or the day after, I should be able to upload a beta version that I'd welcome getting feedback on. (I know such effort estimates of mine haven't usually been reliable; what can I say.) After that, a changelog (draft of the release notes) should be the next priority. The manual (.odt) is almost up to date; a summary of the city trade changes in the main part is still to be written. Then I'll have to play a game or two myself and, lastly, run (mostly automated) tests of various game options.
 
Hi f1rpo! Thanks for investigating! Yes, with AdvCiv mod loaded, it's as if music is switched OFF*, no matter the single/multi player setting, which is very weird. My friends have the same problem too. Once you unload the mod music is here again during game.

*To be very specific : the music on the menu is OK, it's the music during a game that is switched OFF.
Thanks for working with me on the issue. Unfortunately, I'm pretty clueless about it. Perhaps, once I upload that beta version, you could check if the problem persists. Though I haven't consciously done anything to fix it. Just to make sure: Music on the menu still plays after loading the mod, right? And (non-music) sounds, e.g. when selecting a unit? I may have to upload a build with some extra assertions eventually to hopefully find out at which point music playback fails on your end. Audio log looks normal? (Well, probably does ...) Here's mine for reference:
Spoiler audio.log :
Code:
[51248.375] Audio Manager: Loading Audio Defines file XML\Audio\AudioDefines.xml...
[51248.500] Audio Manager: Successfully loaded Audio Defines file XML\Audio\AudioDefines.xml.
[51248.500] Audio Manager: Loading 2D Scripts file XML\Audio\Audio2DScripts.xml...
[51248.734] Audio Manager: Successfully loaded 2D scripts file XML\Audio\Audio2DScripts.xml.
[51248.750] Audio Manager: Loading 3D Scripts file XML\Audio\Audio3DScripts.xml...
[51248.984] Audio Manager: Successfully loaded 3D scripts file XML\Audio\Audio3DScripts.xml.
[51249.000] Audio Manager: Successfully loaded Soundscape scripts file XML\Audio\AudioSoundscapeScripts.xml.
[51249.000] Audio Manager: Initializing
[51249.000] Audio Manager: Attempting to initialize the audio system.
[51249.000] Audio System: Initializing Miles Audio System...
[51249.000] Audio System: redistribution directory: ..\Miles\win32
[51249.000] Audio System: Starting Miles.
[51249.015] Audio System: Opening the sound driver.
[51249.046] Audio System: CAPS: Total HW Bytes: 0
[51249.046] Audio System: CAPS: Max Contiguous Free HW Bytes: 0
[51249.046] Audio System: CAPS: Total HW 3D Buffers: 0
[51249.046] Audio System: CAPS: Static HW 3D Buffers: 0
[51249.046] Audio System: CAPS: Streaming HW 3D Buffers: 0
[51249.046] Audio System: CAPS: Total Mixing HW 3D Buffers: 1
[51249.046] Audio System: CAPS: Static Mixing HW 3D Buffers: 1
[51249.046] Audio System: CAPS: Streaming Mixing HW 3D Buffers: 1
[51249.046] Audio System: SPEAKER CONFIG:
[51249.046] Stereo
[51249.046] Audio System: Initializing base audio system...
[51249.046] Audio System: Calculating and distributing voices.
[51249.046] Audio System: VOICES: Total: 128
[51249.046] Audio System: VOICES: Streams: 10
[51249.046] Audio System: VOICES: 2D: 54
[51249.046] Audio System: VOICES: 3D: 64
[51249.046] Audio System: Initializing 2D samples...
[51249.046] Audio System: Successfully initialized 2D samples.
[51249.046] Audio System: Initializing 3D samples...
[51249.046] Audio System: Successfully initialized 3D samples.
[51249.046] Audio System: Successfully initialized base audio system.
[51249.046] Audio System: Successfully initialized Miles Audio System.
[51249.046] AudioManager: Successfully initialized the audio system.
[51249.046] AudioManager: Successfully initialized the audio manager.
No, it was the game freezing type.
Oh well, in that case, I'll revert to my earlier reply – don't know why it happens, but v0.97 might be able to recover from it.
 
Here goes the pre-release version (edit: no longer the latest version). Forgot the 48-civ DLL; I can add it if needed.

Profiling of the recently added AI code is by the way also still to be done. I did run a benchmark test in the end: 8% slower than the previous one from three weeks ago. Not dramatic – and still 43% faster than v0.96 – but hopefully I can mostly eliminate that degradation.

Addendum regarding number-of-cities maintenance: Can be adjusted through MAX_CITY_COUNT_FOR_MAINTENANCE in GlobalDefines_advc.xml.
 

Attachments

Last edited:
Oddity already. 097pre.
In the city screen, using the arrow keys, I can't left-arrow past my starting city (wrap around the list backwards).
right-arrow wrap around back to my starting city just fine.

Save from a 096e game.
 
Last edited:
097 is here! what a good news day.
the amount of hours you put into this man...honorable.

almost 50% in run time?...wow. maybe my ol'cpu can run a game better now.

---
i think we spoke one time on the city screen , where exit cant be done by right click anywhere, but only on city spot, unlike vanilla.
in Regards to what Elkad reports.
 
almost 50% in run time?...wow. maybe my ol'cpu can run a game better now.
Perhaps "% faster" is a slightly misleading statistic. The test took 633 seconds last summer with 0.96 (I don't think there were performance tweaks in the minor releases since then), currently 442 seconds. 422 would be 2/3 of the old time and thus 50% faster. Not a great amount of time saved really.

@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.

I also slightly mucked up one of the city trade denial conditions ("not right now ..."); that's not supposed to affect human-owned cities. I'll upload another DLL before long.

i think we spoke one time on the city screen , where exit cant be done by right click anywhere, but only on city spot, unlike vanilla.
in Regards to what Elkad reports.
Left-clicking on a tile outside of the city radius and double-clicking the city center no longer exit, both to avoid accidents (seeing that single-clicking the city tile enables citizen automation). Instead, right-clicking the city center now exits and keeps the camera centered on the city. I've been finding that quite useful. Anyway, those are all pre-0.96 changes iirc.
 
@f1rpo:
When I run 0.97pre under wine, it page faults and dies before any loading screen appears. 0.96 ran without problem, and vanilla BtS and RevDCM still do. I've attached the backtrace wine produced. The closest I have to a lead is the modules table towards the end of the backtrace, which vaguely suggests it's something about cvgamecoredll or msvcr71.

Do you know what could have caused this? Is there a way I can produce a more specific error?
 

Attachments

There's a GlobalDefines setting though: CITY_SCREEN_CLICK_WILL_EXIT
nice, good thinking,
but im not gonna change it, its fine as you did, just was curious.

carp
you say you played with DCM, can you tell how was the ai with ranged attacks/bombards?
 
you say you played with DCM, can you tell how was the ai with ranged attacks/bombards?
Not really, sorry. The last time I played it (years ago) I wasn't good enough to judge the AI quality, and this time around it was just for debugging (i.e. can the mod reach the main menu without CTD). I can tell you the AI didn't know how to keep the revolution systems from breaking it into little pieces.

(Which reminds me of the AI-RP tension @Leoreth pointed out: most anyone playing a mod named Revolutions wants to see some rebel civs forming at some point, but not from any of their cities, so either the AI is also savvy and the signature feature is half-absent, or the AI effectively self-sabotages for the player's entertainment. Neither case is unworkable, but both tend to feel like missed opportunities. I still enjoyed that mod, though.)
 
@carp: I'm not used to reading crash dumps and I've never used Wine. So, fwiw, it looks to me like "the" (CvGameCore) DLL is only very briefly involved, that the crash occurs in msvcr71.dll and that most of the call stack, the addresses around 0x01380000, aren't covered by the module table, falling in between d3dx9_33.dll and CvGameCoreDLL.dll.Or maybe I'm just not reading it carefully enough. Anyway, if the previous version of the mod worked (and supposedly still does), then I don't see how anything other than the DLL could be (directly or indirectly) responsible for such an early crash. In a quick test, player options and graphics options were loaded from XML before the progress bar appeared. Some code for loading the XML cache is also run, but most of that is disabled in the mod (and was already disabled in v0.96). Some(?) XML schema files are loaded, but that doesn't really involve the DLL.
Is there a way I can produce a more specific error?
I don't suppose running the Visual Studio debugger under Wine is an option. Anything interesting in the logs? There should be something in init.log. I can upload a build with assertions; assuming that popups from failed assertions appear under Wine (they're shown through a function named DialogBoxIndirectParamA in WinUser.h). I kind of doubt that any of the existing assertions will fail, but I could insert a few dummy assertions in order to trace how far the initialization/ loading code gets in the DLL. I'd prefer for the mod to be compatible with Wine.
 
@f1rpo:
I'm not used to reading crash dumps and I've never used Wine.
Yeah, me neither. Thanks for being willing to look into this anyway.
Anyway, if the previous version of the mod worked (and supposedly still does), then I don't see how anything other than the DLL could be (directly or indirectly) responsible for such an early crash.
That's what I was thinking.
In a quick test, player options and graphics options were loaded from XML before the progress bar appeared. Some code for loading the XML cache is also run, but most of that is disabled in the mod (and was already disabled in v0.96). Some(?) XML schema files are loaded, but that doesn't really involve the DLL.
Part of the standard Civ4-on-*nix setup is disabling XML and filesystem caching in CivilizationIV.ini because that doesn't (or didn't use to?) work reliably cross-platform. I don't think this is just XML-related, but it could involve some CvGameCore-XML-wine interaction.
I don't suppose running the Visual Studio debugger under Wine is an option.
Eh, never say never. I'm willing to give it a shot tomorrow.
Anything interesting in the logs? There should be something in init.log.
init.log is so uselessly short I'll just paste it here:
[1739896.470] DBG: CIV Init
[1739896.470] VERSION: App: C:\Program Files (x86)\Civ 4\Beyond the Sword\Civ4BeyondSword.exe
[1739896.471] VERSION: Build: Thu May 14 07:17:10 2009
[1739896.471] VERSION: 3.1.9.0 (128100)
[1739896.884] VERSION: Mod Loaded: Mods\AdvCiv\
[1739896.889] DBG: FILE Cat Init

The only other log the run got far enough to create is resmgr.log, which is empty. :shrug:
I can upload a build with assertions; assuming that popups from failed assertions appear under Wine (they're shown through a function named DialogBoxIndirectParamA in WinUser.h). I kind of doubt that any of the existing assertions will fail, but I could insert a few dummy assertions in order to trace how far the initialization/ loading code gets in the DLL. I'd prefer for the mod to be compatible with Wine.
If you send it to me, I'll run it and report back. You may have better luck printing straight to stderr or stdout instead of making a series of dialogs, and it'd make for easier copypasta. Or if you think it'd be better to just skip to VS debugger, that's an option.
 
hey,
void InvasionGraph::Node::initMilitary() {
....
autoplay ctd on this line: MilitaryBranch::HomeGuard* hg = new MilitaryBranch::HomeGuard(*pm[HOME_GUARD]);
...
}

HOME_GUARD is 0 on the debug.

at war with enemy - (war builder city placements and some units)
swordsman moved to attack my city.
 
init.log is so uselessly short I'll just paste it here: [...]
The last entry ("FILE Cat") comes from the EXE, apparently after reading or otherwise dealing with the catalogCiv4BeyondSword...dat files in the file cache folder. That and the "Mod Loaded" message get written after the DllMain and global static constructor calls (so those are OK apparently) and before the CvXMLLoadUtility constructor call. Before any further messages, the progress bar for loading XML should appear. Yup, pretty useless.
Eh, never say never. I'm willing to give it a shot tomorrow.
Well, you sound like you know (how to find out) what you're getting into. I suppose you wouldn't have to bother with the compiler from 2003 because you don't need to compile the debug DLL yourself. So perhaps it's not that much trouble. If you can't get it to work, maybe GenerateCrashDumps=1 in CivilizationIV.ini can help. That said, if the crash, ultimately, occurs in msvcr71.dll ... :undecide: 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'm attaching a DLL with debug symbols, assertions enabled and tracing output in the CvXMLLoadUtility constructor, LoadPlayerOptions, LoadGraphicOptions and CvGlobals::init functions. Somehow fprint and fprintf(stderr,...) don't write to the Visual Studio console; no idea where their output ends up. 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.
 

Attachments

HOME_GUARD is 0 on the debug.
Always is 0:
Code:
enum MilitaryBranchTypes {
   HOME_GUARD = 0,
Sounds like pm[0] is NULL. That probably means that the UWAICache of the player presented by the Node object hasn't been initialized. (The id attribute of the Node says which player that is.)
at war with enemy - (war builder city placements and some units)
swordsman moved to attack my city.
City placement through WorldBuilder? That would be PlatyBuilder I guess. Might cause problems if a player's first city is placed that way; though I don't really see how it would go wrong.
 
Back
Top Bottom