View Full Version : [MODCOMP] Obsolete Buildings


Jean Elcard
Jul 20, 2007, 11:02 AM
Obsolete Buildings

This is more or less a spin-off of an other mod of mine, but I release it as a stand-alone mod component, because it's a really nice and easy to use mechanism. In some way it is similar to TheLopez "Upgradeable Buildings" mod, but there are significant differences in functionality and especially in the way it's coded.

Short Description:

This mod component allows you to specify buildings, which, if built, obsolete other buildings in the same city. "Obsoletes" in this context means, that they will replace their predecessors in the same city and prevent them from being built there again as long as the successor exists in the city. This works also with complex multiple levels of obsoletenesses.

The Facts:


One building may obsolete an arbitrary number of other building classes.
Any number of different buildings are allowed to obsolete the same building classes.
Transitivity: If Building B obsoletes A and C obsoletes B, then C also obsoletes A automatically.
Only in the city buildable buildings show up in the building menue.
Civilopedia shows all buildings which become obsolete by building a certain building and all buildings which obsolete in turn this one.
In the city screen only buildings, you've built in the city already, will show up as becoming obsolete in the help text of a building you are allowed to construct. (see the attached screenshot)

Example:

I've included a rather academical example with no real practical relevance but it demonstrates very well, what the mod does. See the first figure in the attached graph below. The letters stand for different buildings and an arrow from one building to another means, that the first building obsoletes the latter. Blue arrwos are declared in XML and orange arrows are automatically generated transitive connections. You may play around with this example ingame to get a feeling for it.

How to use:

Very easy. Just add a XML tag like this to the building you want to obsolete another building class in CIV4BuildingInfos.xml.


<ObsoleteBuildingClasses>
<ObsoleteBuildingClass>
<BuildingClassType>BUILDINGCLASS_B</BuildingClassType>
<bObsolete>1</bObsolete>
</ObsoleteBuildingClass>
</ObsoleteBuildingClasses>


That's it, but be careful not to create circles like in figure 2 of the attached graph. Your game will crash because of eternal recursion.

Modder who would like to integrate my mod component might be interested in knowing, that I marked all modifications made by me in C++ and XML by comments starting with "OB:".

Download:

Obsolete Buildings v0.1.0 for Civilization IV (Vanilla) v1.74: Link (http://forums.civfanatics.com/downloads.php?do=file&id=6176&act=down)
Obsolete Buildings v0.1.1 for Civilization IV (Beyond the Sword) v3.17: Link (http://forums.civfanatics.com/downloads.php?do=file&id=6525&act=down) (06/20/08)

If you find any bugs please tell me. Otherwise have fun.

Jean Elcard (aka Elgor)

Jean Elcard
Jul 23, 2007, 04:07 PM
Still Version 0.1.0 but I've merged it with the new Civilization IV Patch 1.74 for full compatibility.

Niteshade
Jul 27, 2007, 04:14 PM
Any possibility of using this in BTS? There's a packaged mod that could really benefit from building obsolescence.

Jean Elcard
Jul 28, 2007, 02:45 AM
Any possibility of using this in BTS? There's a packaged mod that could really benefit from building obsolescence.

I'm definitely going to integrate it into BtS, but I'm still waiting for my copy of it.

Jean Elcard
Aug 05, 2007, 04:56 PM
Version 0.1.0 converted to Beyond the Sword 3.02, uploaded and now ready for download!

There were quite some changes necessary to make the mod work again. I've also transformed the example for BtS to the new modular XML. So be sure to activate this in your CivilizationIV.ini:

; Modular XML Loading
ModularLoading = 1

Darkhour
Mar 08, 2008, 01:03 AM
any chance of an update to 3.13?

Jean Elcard
Mar 09, 2008, 05:25 AM
Don't wake the sleeping dragon! ;) If I can find the time, I will take a look, if the needed transformations are easily doable. If so, you are going to find a new version here soon. Easter may be a good time to check again.

Darkhour
Mar 09, 2008, 06:03 AM
cheers big ears ;)

Xenomorph
Mar 10, 2008, 02:41 PM
Any chance of reuploading?

Jean Elcard
Mar 10, 2008, 03:12 PM
Easter comes early this year! A version compatible to BtS 3.13 is up. Check the first post.

Notice that there is no need to fiddle around with your CivilizationIV.ini anymore in order to make this mod work. This is due to acitvating modular XML loading by mod means became possible with BtS 3.13.

Darkhour
Mar 10, 2008, 09:15 PM
cheers Jean.. will check it out ;)

Ploeperpengel
Apr 30, 2008, 07:36 PM
I tried to merge this to my mod and now get:
Traceback (most recent call last):

File "CvScreensInterface", line 207, in pediaMain

File "CvPediaMain", line 960, in pediaJump

File "CvPediaMain", line 259, in showScreen

File "CvPediaMain", line 392, in placeBuildings

RuntimeError: unidentifiable C++ exception
ERR: Python function pediaMain failed, module CvScreensInterface
this is giving me hard crashes. Any idea what part of your code could be that sensitive here? CvPediaMain is unmodified but I'm trying to merge on top of FFH code in the SDK(compiled fine and no obvious conflicts).

Ploeperpengel
May 01, 2008, 05:25 AM
Ok forget about the bug above that was a missing artdefine but the game keeps crashing as soon I want to enter the cityscreen. I compiled a debug.dll and it gives me an assert on:

CvBuildingInfo& CvGlobals::getBuildingInfo(BuildingTypes eBuildingNum)
{
FAssert(eBuildingNum > -1);
FAssert(eBuildingNum < GC.getNumBuildingInfos());
return *(m_paBuildingInfo[eBuildingNum]);
}

Then crashes. Any idea?

Edit: I know this is probably not much of a hint I can give here, but it be sad to have to remove this again as it works nicely as standalone modcomp. As I'm a noob I don't really know what even this assert means...

Edit2: debugging Call stack - any sense to get from this?
> CvGameCoreDLL.dll!CvGlobals::getBuildingInfo(Build ingTypes eBuildingNum=NO_BUILDING) Line 1944 + 0x3a C++
CvGameCoreDLL.dll!CvGameTextMgr::fillObsoleteWithB uildingArray(bool * pabBuilding=0x34b9f9e8, int iItem=7, BuildingTypes eBuilding=69) Line 10890 + 0x28 C++
CvGameCoreDLL.dll!CvGameTextMgr::setBuildingHelp(C vWStringBuffer & szBuffer={...}, BuildingTypes eBuilding=69, bool bCivilopediaText=false, bool bStrategyText=false, bool bTechChooserText=false, CvCity * pCity=0x3493a838) Line 8673 C++
CvGameCoreDLL.dll!CvDLLWidgetData::parseConstructH elp(CvWidgetDataStruct & widgetDataStruct={...}, CvWStringBuffer & szBuffer={...}) Line 1754 C++
CvGameCoreDLL.dll!CvDLLWidgetData::parseHelp(CvWSt ringBuffer & szBuffer={...}, CvWidgetDataStruct & widgetDataStruct={...}) Line 80 C++
Civ4BeyondSword.exe!004e0505()
msvcr71.dll!7c3416f8()
msvcp71.dll!7c3a1ce3()
msvcp71.dll!7c3a1268()
ntdll.dll!7c92003d()
msvcr71.dll!7c34218a()
msvcr71.dll!7c34218f()
Civ4BeyondSword.exe!007938c4()
Civ4BeyondSword.exe!00493df0()
Civ4BeyondSword.exe!005943ef()
msvcp71.dll!7c3a1e88()
Civ4BeyondSword.exe!004e0488()
Civ4BeyondSword.exe!00580b28()
python24.dll!1e019b15()
Civ4BeyondSword.exe!004fe06f()
Civ4BeyondSword.exe!0073998b()
Civ4BeyondSword.exe!00739876()
boost_python-vc71-mt-1_32.dll!1000ea8d()
boost_python-vc71-mt-1_32.dll!1000eb45()
boost_python-vc71-mt-1_32.dll!100136c1()
CvGameCoreDLL.dll!boost::python::objects::pointer_ holder<CvBuildingInfo *,CvBuildingInfo>::`scalar deleting destructor'() + 0x14 C++
boost_python-vc71-mt-1_32.dll!1000ebd0()
python24.dll!1e0193cc()
python24.dll!1e026702()
python24.dll!1e02767e()
python24.dll!1e0293b7()
python24.dll!1e02645b()
python24.dll!1e02766c()
python24.dll!1e0293b7()
python24.dll!1e05e359()
python24.dll!1e02645b()
python24.dll!1e02766c()
python24.dll!1e0293b7()
python24.dll!1e029d49()
python24.dll!1e02a3bc()
python24.dll!1e05f62f()
python24.dll!1e0193cc()
python24.dll!1e0262a6()
python24.dll!1e0193a1()
Civ4BeyondSword.exe!00910386()
Civ4BeyondSword.exe!009103f4()
Civ4BeyondSword.exe!00910594()
Civ4BeyondSword.exe!004e5258()
msvcr71.dll!7c3416f8()
Civ4BeyondSword.exe!004093a9()
Civ4BeyondSword.exe!00522b48()
Civ4BeyondSword.exe!0051dd6f()
Civ4BeyondSword.exe!0041789e()
user32.dll!7e36940c()
kernel32.dll!7c83611f()
msvcr71.dll!7c34218f()
Civ4BeyondSword.exe!006b7c77()
Civ4BeyondSword.exe!0041372d()
msvcp71.dll!7c3a1e88()
Civ4BeyondSword.exe!006ba4a8()
Civ4BeyondSword.exe!004e9ac6()
Civ4BeyondSword.exe!0092bcdf()
kernel32.dll!7c817067()


Edit3: and while in debugging mode I get also the following exception:
Traceback (most recent call last):

File "CvScreensInterface", line 709, in forceScreenRedraw

File "CvMainInterface", line 719, in redraw

File "CvMainInterface", line 1438, in updateSelectionButtons

RuntimeError: unidentifiable C++ exception
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
Line 1438:
screen.appendMultiListButton( "BottomButtonContainer", gc.getBuildingInfo(eLoopBuilding).getButton(), iRow, WidgetTypes.WIDGET_CONSTRUCT, i, -1, False )

Jean Elcard
May 01, 2008, 08:33 AM
I would really like to help you, but I don't know exactly what's causing these crashes either. I can tell you the meaning of the Assert, though: For some reason, "getBuildingInfo" becomes called with the "eBuildingNum"-parameter < 0, which usually stands for NO_BUILDING. Civ4 returns NO_BUILDING if it can't find a match for a building name in the XML. You might try to find the function calling "getBuildingInfo" with this invalid parameter and take a look why this is happening. According to the debug log, the function in question might be "fillObsoleteWithBuildingArray". This could suggest that there is a typo in your XML somewhere in a tag like this under "BuildingClassType":

<ObsoleteBuildingClasses>
<ObsoleteBuildingClass>
<BuildingClassType>BUILDINGCLASS_A1</BuildingClassType>
<bObsolete>1</bObsolete>
</ObsoleteBuildingClass>
</ObsoleteBuildingClasses>

Edit: Just tried to change the BuildingClassType to something invalid and got an XML error while loading civ4. That's too early for being the same crash like yours. Hast to be something else then. I'll tell you, if I get an idea.

Edit2: Would you mind sending me your CIV4BuildingInfos.xml and CIV4BuildingClassInfos.xml? The debug log tells me the problem has maybe something to do with building 69 and building class 7.

Ploeperpengel
May 01, 2008, 11:34 AM
I would really like to help you, but I don't know exactly what's causing these crashes either. I can tell you the meaning of the Assert, though: For some reason, "getBuildingInfo" becomes called with the "eBuildingNum"-parameter < 0, which usually stands for NO_BUILDING. Civ4 returns NO_BUILDING if it can't find a match for a building name in the XML. You might try to find the function calling "getBuildingInfo" with this invalid parameter and take a look why this is happening. According to the debug log, the function in question might be "fillObsoleteWithBuildingArray". This could suggest that there is a typo in your XML somewhere in a tag like this under "BuildingClassType":

<ObsoleteBuildingClasses>
<ObsoleteBuildingClass>
<BuildingClassType>BUILDINGCLASS_A1</BuildingClassType>
<bObsolete>1</bObsolete>
</ObsoleteBuildingClass>

Edit: Just tried to change the BuildingClassType to something invalid and got an XML error while loading civ4. That's too early for being the same crash like yours. Hast to be something else then. I'll tell you, if I get an idea.

Edit2: Would you mind sending me your CIV4BuildingInfos.xml and CIV4BuildingClassInfos.xml? The debug log tells me the problem has maybe something to do with building 69 and building class 7.

I appreciate any help I can get, thx.

Jean Elcard
May 01, 2008, 03:03 PM
No solution yet. The problem is, I can't reproduce the crash. I made a version of Obsolete Buildings (see attachment), which is using the following buildings: Walls, City Walls, High Walls, Castle and Citadel. I took them almost exactly as you are using them in your BuildingInfos and BuldingClassInfos files. Only removed the tech requirements and reduced the costs to "1" each. If I run the OB mod this way, everything works as intended. No crash.

Building 69 is the National Epic and BuildingClass 7 the Academy. Very strange, that the mod is crashing after calling fillObsoleteWithBuildingArray with these two type numbers as its parameters, as your debug call stack seems to indicate.

I'm running a bit out of ideas here. Seems this problem needs some more debugging before there is chance of getting it solved. Sorry.

By the way, to tell High Walls explicitly to obsolete Walls is not really necessary. The mod is deducing this information from the obsolete City Walls tag group by recursively looking which building class becomes obsolete through this building.

Edit: Forgot to mention, that I had to change the Art Defines of the buildings above too, to get the WH Debug version of OB to work properly. Primarily, because the art is not available for me anyway, but maybe the crash has something to do with a faulty button definition or so. Your edit3 made me think this and after all the crash is happening only, if you open the city screen. Did you try, what happens if you hover over the buildings in the civilopedia? Do you get the correct information then or is it crashing too?

Ploeperpengel
May 01, 2008, 03:31 PM
Thx for looking into it. Maybe it's a conflict between your code and the Fall From Heaven codebase I'm using that just doesn't produce an assert. I will make a merge with your mod and a version of FFH that doesn't rely on my owm xml mess to see if it's there or something in my other changes. If that doesn't crash it's probably my fault. If it crashes I'll just have to wait for someone with better skills than mine to make it work with FFH.;)

Jean Elcard
May 01, 2008, 04:00 PM
Ok, then keep me informed about your results, please.

Ploeperpengel
May 01, 2008, 04:06 PM
Ok, then keep me informed about your results, please.

Yes will do.

Ploeperpengel
May 01, 2008, 05:00 PM
Ok it seems to be some incompatibility with FFH then. You get errors when trying to view the pedia for buildings and for wonders and you crash as soon you try to build a building or enter a city.

Steps to reproduce:
Download FFH and install:
http://forums.civfanatics.com/downloads.php?do=file&id=1&act=down
download and install patch e:
http://kael.civfanatics.net/files/FfH2031e.exe

Get the sourcecode:
http://kael.civfanatics.net/files/CvGameCoreDLL031e.zip

and here the changed files to replace where needed:

xienwolf
May 22, 2008, 02:31 PM
Quick question while I am compiling this (trying to help Ploe out by importing it to FfH myself), what happens with Building Requirements?

As I was skimming your code in the DLL, it seemed that it removes the obsolete buildings from the city. So if I have a unit that requires Archery Range, and I make the Bowyer cause Archery Range to go Obsolete... will I be able to build that unit still? Seems to me like the answer will be no.

Can you think of an elegant and easy way to solve this if that is the case? I suppose I could add a loop to check for buildings which make the requirement obsolete when the CanTrain/Upgrade function looks for a valid building.

First inclination was just to set it up so you could have multiple buildings required for a unit, but I'm kinda loathe to write that one myself, and the closest MODCOMP I can find right now is TheLopez's mod from back in Warlords (http://forums.civfanatics.com/showthread.php?t=187624) :(

EDIT: For now I have commented out all your changes in Game Text Manager, as they are causing an issue. But I am not sure if the mechanics are working. An obsolete Building should no longer display as being in the city, correct? If so, then none of it is working just yet for me (have both Archery Range and Bowyers showing in my city with the new DLL)

EDIT 2: Realized I can answer my own questions by just loading your example :p It should make the building quit showing, so that means I have some work to do on making it actually work at all. I'll have to peek at how much Kael has shifted Building Requirements around, I suspect it is in there. Also realized that it wouldn't work to have the building recurse all the buildings which it made obsolete and allow the same units, as blocking off units is one of the main reasons behind making buildings go obsolete!

Jean Elcard
May 22, 2008, 03:08 PM
Quick question while I am compiling this (trying to help Ploe out by importing it to FfH myself), what happens with Building Requirements?

As I was skimming your code in the DLL, it seemed that it removes the obsolete buildings from the city. So if I have a unit that requires Archery Range, and I make the Bowyer cause Archery Range to go Obsolete... will I be able to build that unit still? Seems to me like the answer will be no.

You are absolutely right, the Archery Range would be replaced by its successor. Means: No Archery Range in Town anymore if you finish building the Bowyer. If you want to keep the bonuses provided by a building going obsolete you will have to add theses bonuses to it's successor too - manually in XML. In your case to the Bowyer. I've implemented it this way to prevent a successor from getting all the bonuses of all its possible predecessors. This is working fine for walls and stuff, but I see that this going to be a problem in this special case.

Can you think of an elegant and easy way to solve this if that is the case? I suppose I could add a loop to check for buildings which make the requirement obsolete when the CanTrain/Upgrade function looks for a valid building.

You are right here too. You could possibly add a special loop to check for predecessor buildings allowing to build Archers, but this wouldn't be very elegant way of doing it. Too specific for my taste, but possible. Furthermore you would have to change the CvGameTextMgr files too, so all the abilities show up correctly in all the tool tips and the Civilopedia.

First inclination was just to set it up so you could have multiple buildings required for a unit, but I'm kinda loathe to write that one myself, and the closest MODCOMP I can find right now is TheLopez's mod from back in Warlords (http://forums.civfanatics.com/showthread.php?t=187624) :(

The solution you came up with first, seems the way to go for me. Can't think of a better way right now. The changes necessary to allow more than one building as a building requirement for units shouldn't be too difficult to implement after all. Could be useful as a general game mechanics too.

xienwolf
May 22, 2008, 03:17 PM
ARGH! Most annoying thing ever! I just loaded your module into my FfH test folder, and ran the exact same game which wouldn't work with the Archery Range and Bowyers. Your module worked fine! But the Bowyer continues to NOT remove the Archery Range....

I feel some fun coming up with thsi debugging session :)

Jean Elcard
May 22, 2008, 03:49 PM
Yes, it seems there is a conflict (or more than one, if you are especially lucky) between my code and FfH. I hope you are able to solve it. I would really like to help you out, but I'm a bit short of time at the moment and don't have a clue, what is causing all this trouble Ploeperbengel and you are stumbling over without trying to compile the code myself. Don't even have a compiler installed these days.

Good night and good luck.

xienwolf
May 22, 2008, 04:00 PM
Found my first problem: I am trying to make the field optional. That's what causes my Civilopedia to be blanked out. If I place a Null field in each entry then that part works fine.

And no worries about not knowing what the issue is. I'm just posting to keep Ploe up to date and help future merges mostly.

EDIT: Well, done playing with it for today I think. I moved all your sample buildings from Module to main mod, and they still worked. Then I placed all the Obsolete tags on Building B onto Bowyers, and suddenly Bowyers worked like Building B + Archery Range. Worked properly and everything. Went back to doing nothing when I returned to just obsoleting the Archery Range.

Oh, and during all this I found that while it failed to load things (blank Civilopedia for Buildings/Wonders) most of the time, on every 2nd or 3rd load it would actually bring up everything properly. Overall... NFC for today. Hopefully some inspiration on the drive home tonight.

xienwolf
May 22, 2008, 07:13 PM
Turns out that the reason Bowyer wasn't working on the Archery Range was the same as the complication I had with another MODCOMP. I placed a comment in the XML.

Anyway, it all works nicely now, except that 2 out of every 3 times you load the game there is a glitch with the Civilopedia causing it to blank the buildings (which will crash you as soon as you settle your first city).

Hopefully have that isolated sometime soonish.

Ploeperpengel
May 22, 2008, 08:27 PM
That's great news, xienwolf!:) wished I could help but that just exceeds my pitiful skills by far.

xienwolf
May 22, 2008, 10:57 PM
Problem solved. Now I just have to discover precisely how to fix it.

The problem is solved by Commenting out:

/************************************************** ***********************************************/
/** Obsolete Buildings 05/08/07 Written: Elgor Imported: Xienwolf **/
/** **/
/** Finds all Buildings which cause Obsolescence and Displays Information **/
/************************************************** ***********************************************
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
fillObsoleteWithBuildingArray(pabObsoleteWith, iI, eBuilding);
}

for (iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{
if (pabObsoleteWith[iI])
{
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_OBSOLETE_WITH", GC.getBuildingInfo((BuildingTypes)iI).getTextKeyWi de()));
}
}
/************************************************** ***********************************************/
/** Obsolete Buildings END **/
/************************************************** ***********************************************/


and

void CvGameTextMgr::fillObsoleteWithBuildingArray(bool* pabBuilding, int iItem, BuildingTypes eBuilding)
{
int iI;
BuildingTypes eLoopBuilding;

if (GC.getGameINLINE().getActivePlayer() != NO_PLAYER)
{
eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(GC.getGameIN LINE().getActiveCivilizationType()).getCivilizatio nBuildings(iItem);
}
else
{
eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingCl assTypes)iItem).getDefaultBuildingIndex();
}

if (GC.getBuildingInfo(eLoopBuilding).isObsoletesBuil dingClass(GC.getBuildingInfo(eBuilding).getBuildin gClassType()))
{
if (!pabBuilding[eLoopBuilding])
{
pabBuilding[eLoopBuilding] = true;
/**
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
fillObsoleteWithBuildingArray(pabBuilding, iI, eLoopBuilding);
}
**/ }
}
}


Remove those comment tags and 2 in 3 loads of the game result in a blank Building Page in the Civilopedia, and a crash when you build the first City. But that third time when the Civilopedia DOES load, the displays and everything else work perfectly.



With this portion commented out, everything is flawless, you just don't have a display on each building stating what precisely makes it become obsolete.

Jean Elcard
May 23, 2008, 02:53 AM
Good to see, you could figure out most of the glitches. The one reamining is only a minor problem. A nice to have functionality, but not really necessary for the game mechanics to work.

Especially strange is the fact, that it only happens 2 out of 3 times. Can't remember anything like this happening with the BtS version of this mod component. Maybe it depends on the civilization you are playing? Did you check if the Civilopedia is blanked out sometimes too, when you are still in the main menue screen or only if you already started a game and civ4 knows which civ you are playing?

EDIT: If the case is the latter the solution might be as easy as to add a check for "eLoopBuilding != NO_BUILDING": in the "fillObsoleteWithBuildingArray" function like this:

if (eLoopBuilding != NO_BUILDING)
{
if (GC.getBuildingInfo(eLoopBuilding).isObsoletesBuil dingClass(...))
{
...
}
}


In BtS all civs can at least build the default building of each building class, but in FfH that's not always the case. Hence this check is probably necessary to make it work.

xienwolf
May 23, 2008, 12:41 PM
I was only checking the Civilopedia from the main screen, without starting up an actual game, specifically to avoid the "which Leader are you?" issues. Had the same thought about maybe the != NO_PLAYER causing issues.

Since it occasionally DOES work, I figured the issue might be an array somewhere not getting deleted or initialized. Thus the times it works are when it happens to grab a clean chunk of memory to work with. Haven't found anything yet on those lines.

EDIT: Wrong reason, but good solution. So far I have had it load successfully 4 times out of 4 using the NO_BUILDING check. I love when easy answers are the right ones.

Jean Elcard
May 23, 2008, 02:21 PM
Everything alright then. I should probably add this check to the current main modcomp version as well, to prevent other people from running into the same issue. It's always better to do one check more than necessary.

Jean Elcard
Jun 20, 2008, 01:22 PM
New Version 0.1.1 for Beyond the Sword 3.17 released.

changelog for version 0.1.1

compatibility update to BtS version 3.17
fixed a bug, which could cause the pedia to blank out and would crash the game after founding a city if used in conjunction with certain mods
no need for activating modular loading manually anymore

MagisterCultuum
Jul 27, 2008, 05:36 PM
Transitivity: If Building B obsoletes A and C obsoletes B, then C also obsoletes A automatically.

What is the point of this?

Imho, it would be far better to do away with the automatic obsolescence, since you can easily handle it manually in the xml. Allowing Circular obsolescence paths would make this modcomp far more useful. I understand that it could cause problems if the AI keeps replacing one building with another, but that can be overcome manually or with different prereqs, like State Religion Requirements.

Jean Elcard
Jul 27, 2008, 06:20 PM
The point was, that I had a problem with this scenario concerning three buildings: "B should obsolete C and A should obsoelte B and C". If A wouldn't have been told to obsolete C explicitly in XML, besides the fact that it obsoletes B, than after you build A you would be able to build C again because B became obsolete by building A. In many cases you wouldn't want this to happen. Imagine a wall becoming better over time for example: Palisade, Stone Wall, High Stone Wall. Why sould you be able to build a Palisade again after updating you Wall to an High Wall?

I know you could have just told A to obsolete both (B and C) in XML. Doing it automatically just saves you time. You don't need to declare everything explicitly. In complex scenarios with more than three buildings this becomes a very tedious task and is more prone to produce unintended behaviour because you missed an entrance or stuff like this.

Nevertheless, I have to admit, it would be nice to have something like mutual exclusiveness (circles). I will think about, how to make this possible, but without removing the currently implemented automatically generated obsoleteness.

Jennar
Dec 23, 2008, 09:26 PM
Based upon your last entry I am safe to assume that your mod will not allow us to make 'Doctrines" (like those form Company of Heroes)?

I was really looking forward to that type of functionality.

-J