K-Mod: Far Beyond the Sword

Hi Karadoc,

A happy tester of PAE with K-Mod dll experienced a repeatable crash to desktop and provided a save a few turns before.

I don't have a big experience with a debugger, but playing until the point of the crash, I received a lot of Assert failure reports.

If you are interested, here is below a list with the files and lines from K-Mod

Spoiler :
CvGameCoreUtils l.2122
CvPlayer l.12031, 12487
CvPlayerAI l.3599
CvPlot l.6523, 6633, 6648
CvSelectionGroup l.3411
CvSelectionGroupAI l.191
CvUnitAI l.5827, 11360, 11448


But the one that caused the crash was the following: in CvGlobals.cpp, line 1985,
in CvBuildingInfo& CvGlobals::getBuildingInfo(BuildingTypes eBuildingNum) the Assert FAssert(eBuildingNum > -1);

It looks like the number was indeed -1.

Then appeared a Tab "vector" where the debugger stopped at line 463 with the following item:

std::vector<CvBuildingInfo*, std::allocator<CvBuildingInfo*>>*const

or at least something similar...

I don't know what to do or to think. Are those assert failures the sign of serious conflicts between the two mods? What could have caused the crash?

I realise now that PAE has enormous changes done via Python and that it might interfere with your code, I don't know (I guess it shouldn't but???).

What do you think? Any clue or tip will be greatly appreciated because I'm a bit desperate right now... :(
 
Well,

In general, once the first assert fails, all bets are off and you can basically ignore the rest of the problems.
For example, eBuildingNum == -1 means "no building", and if the game is trying to access the building information when there is no building then there may be unpredictable results (ie. the game will either get quasi random building information, or it will simply crash.)

When one assert fails, pretty much anything can happen after that because the game is already doing stuff it isn't meant to be doing.

(That said, the CvGameCoreUtils l.2122 assert isn't a big deal. The fact that it fails means there is a bug, but the only bad thing that might happen is that the pathfinder might find the wrong path sometimes. So not all assertion failures are fatal, but in general I think it's safe to assume that they all mean a bug exists somewhere.)

Anyway, the way to debug this stuff is to look at the first assertion failure that comes up, and use the debugger to work out what caused it to fail. (eg. if eBuildingNum == -1, then obviously that function was erroneously called with -1. The debugger can trace back to tell you which line of code did that, and then you can read the code to work out why it did it.)
 
Thank you, Karadoc.

I guess I'm not very good with the debugger and I don't know how to "look at the first assertion failure that comes up, and use the debugger to work out what caused it to fail."

I'm a bit puzzled by your answer though. Actually, the first assert failure that came was in CvSelectionGroupAI l.191 FAssertMsg(false, "unit stuck in a loop");

But it was with a save at a certain point of time, 4 turns before the crash. If I had a save 8 turns before the crash wouldn’t the first assert failure be different?

And not all of those asserts seem related to each other. We are talking about pathfinding, defender units, buildings, culture, religion, commerce.

I had a crash myself with another game and some of the assert failures were the same. Also, it crashed at the same place, in CvGlobals.cpp, line 1985, FAssert(eBuildingNum > -1);

It's true that I made some changes in the dll and I might have messed it. But my changes were minimal and can be documented if needed.

So I guess my project of bringing together PAE and K-Mod is collapsing because there were other reports of crashes since. I probably should not have started that, I don't have the skills to cope with all these errors. :(
 
@isenchine, it does sound like there are a bunch of unrelated bugs going on with that merge. The "unit stuck in a loop" assert generally signals that the AI is trying to give a command that its unit is not actually capable of performing (and so the unit does nothing, and the AI issues the same command again over and over - still convinced that it is the right thing to do).

It seems unlikely that your 'minimum changes' would make bugs spring up all over the place unless you added some new variables to CvSelectionGroup.h or something like that which ended up causing a buffer overflow somewhere (which has the potential to pretty much screw up everything).

In any case, I'm sorry but I can't really commit to helping you debug this kind of stuff. If you do identify a K-Mod bug, I can fix it, but I can't commit to helping look for bugs in other people's mods.

@Alexej, I don't know what Diversica is, but based on what isenchine is dealing with the answer is "probably not". Since K-Mod has little changes scattered through pretty much every part of the game, there will almost always have to be some manual tinkering with the files to make them merge with other mods.
 
hi;

:cool:

see PAE thread page 117 for why i chose the name

could you recommend a couple of modder; coder; programming people that may be willing

to assist with this merge?

thank you

The Pirate:cool::cool::cool:
 
It seems unlikely that your 'minimum changes' would make bugs spring up all over the place unless you added some new variables to CvSelectionGroup.h or something like that which ended up causing a buffer overflow somewhere (which has the potential to pretty much screw up everything).

Thank you, Karadoc.

I did not change CvSelectionGroup.h. I just did five things basically:

1) disable BUG options (CvDLLButtonPopup.cpp), delete a lot of BUG additional information stuff in several files (reason: Pie doen't want Bug options).

2) disable Global Warming in CvGame.cpp and h (reason: Ancient/Classical eras).

3) put back the healthy/unhealthy tag for buildings in several files (reason: Ancient/Classical eras + minimal changes to xml files - BuildingInfo heavily modified in PAE).

4) disable 'DISORGANIZED_PROMOTION' for Barbarian ships (reason: minimal changes to xml files - PromotionInfo heavily modified in PAE).

5) in CvXMLLoadUtilitySet.cpp: added GlobalDefines_K-Mod and commented out Global Warming terrains and features (reason: to avoid a clash with PAE's GlobalDefinesAlt.xml + disable Global Warming)

Recently, I was looking at CvEnums.h and was wondering why you did not include FLAVOR_ESPIONAGE which is in GlobalTypes.xml? I added FLAVOR_GREECE and FLAVOR_ROME in both files.

That's it.

About scenarios: some people were complaining about scenarios crashing with K-Mod dll. I guess I'm missing a piece of information here because I can't see what makes a scenario so different that they could not be played with the same dll as for a custom game.

The difference for me is that you start in a more advanced game, with already some complexity, cities, buildings and units all over the place and that bring you closer to the crash. What do you think?

I tried Scenarios with K-Mod dll v. 1.40 unmodded by me: same result.

I ran them with a debug.dll. For two important scenarios, the first assert failure was about the same stuff: in CvCity.cpp - about Corporation-Commerce. You have to know that PAE is using Corporations as 'Cults' and they are probably heavily modified with Python. The two scenarios crashed at the same place than of the two previous normal saves: in CvGlobals.cpp, line 1985,
in CvBuildingInfo& CvGlobals::getBuildingInfo(BuildingTypes eBuildingNum) the Assert FAssert(eBuildingNum > -1);

That's all for today. Again, thank you very much for any tip, advice, opinion.

EDIT: now, with several different testings, I'm convinced that it is a building causing the crash. Which one, I still have to find out.

EDIT2: Found the problem (at least I hope...). Conflict in PAE in the files BuildingInfos and CivilizationInfos. See my post on page 118 of PAE.
 
The AI seems a bit too raze-happy, especially when it comes to cities on other landmasses. I've seen Bismark in war with Churchill on other continent razing two of England fairly well-placed coastal cities. One was explainable, but Churchill capitulated after Bismark razed the second, so it's not like Churchill was going to recapture it anytime soon, and now Bismark is deprived of a strategic base belonging to him on Churchill's continent.
 
Well the Germans burned northern france and most of Europe so really it would make sense they would be razing.

real life = this game
 
We're talking about the beneficialness of the AI behaviour here.

Besides, Civ4 razing leaves behind virgin land not under anyone's political control. The Germans, on the other hand, were very keen at assuming political control.
 
Hi!

I've transladed almost all the spanish texts but strategy texts... Two things,
One, did you change any text from diplomacy texts?
and the other one, the tag TXT_KEY_ENVIRONMENT_EXPECTED_EVENTS doesn't change for spanish text. Only appears in english.

Greetings.
 

Attachments

Chicen Itza or whatever is called freaking sucks.

I just changed it to give 50% tile defense bonus for forts, and reduced build time.

this is seriously probably the shittiest wonder ever lol.
 
@Rual, thanks for that. I'll use your translations in the next version, and I'll fix the the environmental advisor so that TXT_KEY_ENVIRONMENT_EXPECTED_EVENTS is used.

As for the diplomacy text, K-Mod uses the "actual quotes" mod which changes lots of diplomacy text.

--

I agree that Chicken Pizza is a very weak wonder... maybe one day I'll try to do something about it, but not today. (You might have noticed that the Space Elevator in K-Mod gives +100% spaceship production rather than just +50%.)

--

As for the timing of the next update, I don't expect it to be very soon. I've made some AI tweaks and minor bugfixes, but I don't think I've yet done enough to justify a new version.
 
Any notoriously bad...

1. Civics

2. Unique units

3. Unique buildings


That people would one day like to see fixed?

Personally, I'd like the salon looked into, its extra benefits (+1 free artist) can be near worthless if you arent going to a culture win (and its late to arrive in the tech tree).

Maybe if it was +1 free citizen specialist, so that you could pick which extra specialist you wanted, then it would be more attractive..
 
The AI seems a bit too raze-happy, especially when it comes to cities on other landmasses. I've seen Bismark in war with Churchill on other continent razing two of England fairly well-placed coastal cities. One was explainable, but Churchill capitulated after Bismark razed the second, so it's not like Churchill was going to recapture it anytime soon, and now Bismark is deprived of a strategic base belonging to him on Churchill's continent.

Yes, I have played a few games lately - Prince, Small Tectonics, Lakes (30% water), 7 AI - AI seems to prefer razing to keeping territory when it would clearly be better to keep the cities in question. Often get to expand peacefully into warzone, so AI is simply wiping my neighbour out for me :)
 
I feel that serfdom is still underpowered. The big problem with serfdom that it doesn't give the possibility to generate production in hammer-poor cities and to utilize excess food as opposed to both competing civics. May be something like +1 hammer per farm (on top of current bonuses) would help.
Also, something really should be done with corporations and spies. Corps are simply too powerfull and the fact that only one civ can have full benefit of a corp doesn't help much. One may want to buff state property but it will make state property the only right choice for a civ without corps and this is bad too. My own idea would be to buff state property AND increase the number of corps so that practically any civ in a game would be able to grab at least one. But additional corps are clearly beyond the scope of this mod.
Spies work like unkillable sentries practically making the fog of war irrelevant. My idea would be to give them a special promotion limiting their line of sight to a tile on which they are standing. This is actually easy, I suspect, can be done in XML.
 
Whenever I think about how best to improve Chichen Itza, I can't help but think it should have something to do with city growth or healthiness or something like that. I know very little about what Chichen Itza is - but if I remember correctly, it's actually a kind of irrigation system or something like that.

So, to me it would make more sense if Chichen Itza had the benefits that the Hanging Gardens currently have. I don't see why the Hanging Gardens should have anything to do with growth or health, and so they should probably do something else instead. I don't have any firm ideas for what it should do.

All this swapping and changing of the benefits of wonders may or may not be a good idea... but I'm not sure it's really worth it. Everyone is use to the current bonuses, and so I'm not sure they should be changed unless there are some obvious gameplay benefits. Making Chichen Itza a bit more powerful would probably be positive for gameplay, but I only want to change this stuff once - and I'm not yet decided how it should be changed. (and I'm not in a hurry.)

--

By the way, I think giving serfdom +1 :hammers: on farms would be absurdly powerful.
 
Chichen Itza is not an irrigation system, it's just a temple city/complex.
 
Back
Top Bottom