Announcement

Collapse
No announcement yet.

Making Cradle 3+ fully compatible with the Apolyton Edition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kull
    replied
    AI Gameplay & Frenzy:

    Eliminating CTDs is obviously important, but that couldn't be the "end state" for the AI. I spent a lot of time tweaking the unit build lists, AI personalities (more on this later), and AI priorities so the end result is that all civs are NOT carbon copies of one another. Inevitably there's a lot of visible commonality since all civs must choose from the same pool of unit sprites, but now some civs are more focused on religious units, others on diplomats, some more willing to explore than others, etc.

    The one area where I couldn't move the needle involved AI conquest. AI civs certainly go to war with each other (more often than not) and are fully capable of invading enemy territory and waging stack-on-stack combat and pillaging. But cities rarely changed hands and there didn't seem to be much I could do to change that.

    So, reluctantly, I took a look at the frenzy.slc file. Again I'll spare you the details, but eventually I settled on a modified version of "APOL_frenzy.slc" since the base file was presumably created to be at least somewhat compatible with the AE version of CtP2. But regardless of which file I chose, ALL frenzy files generate an enormous number of circular errors, and the only way to stop them is to disable the Debugslic setting in userprofile.txt. That is completely sub-optimal for mod development, but there was literally no alternative. Worth noting that Frenzy has the exact same errors in a "standard" AE game, so it's not something unique to Cradle - the frenzy code just doesn't play well with AE.

    That said, eventually I was able to develop a working version of Frenzy (still requires "Debugslic=No") and played a number of campaigns. Enough to be quite confident in saying that while "Frenzy" does appear to make the AI more aggressive (some cities do change hands, albeit no more than two per playtest), that comes with FOUR downsides:

    1) The biggest issue is that game turns start to take MUCH longer to complete. Having two minute "end turns" starting around 1800 BC is really awful, and it only gets worse. Admittedly it might not seem so bad during a normal game, but it makes playtesting EXTREMELY time consuming.

    2) The Frenzy code inserts FAR more civilian units into military stacks than you would see otherwise, and that reduces the number of special attacks one might otherwise see per turn. You also don't see many Diplomats, Slavers, or Prophets traveling far from the homeland. They go after neighboring civs, but that's about it.

    3) AI Map Exploration seems to be hindered. Ships continue to explore, but not as many or as far, and most are unoccupied. Meanwhile, Land Units rarely move too far from the homeland & border areas. Probably because the frenzy code is grabbing them and pulling them into stacks.

    4) The AI is extremely aggressive with ALL civs, so embassies with other civs are rare, and they go to war with all their neighbors. It makes for a much less interesting game.

    It's possible these results are driven at least in part because the "human" player is the Barbarians, and frenzy is primarily intended to go after a normal Human civ. Even so, I don't like a lot of what I'm seeing, especially since Martin Guhmann put a lot of effort into fixing the AI and explicitly said that Frenzy isn't needed with the SC fixes. In addition, it wouldn't be surprising if Frenzy and the SC AI are fighting each other, and thus making both of them less effective.

    Another factor is that most of my games involve large continent size islands, and historically the CtP2 AI works better when cross-water algorithms are minimized. Potentially therefore, "more land" would help Martin's improved AI to function better. In the attached example, we see that Babylon controls most of the northern continent, and while Egypt was able to colonize the southern shore, they have already lost Amarna and would probably lose more cities if the playtest had continued.

    *** FINDING: At this point, I'm pretty sure the modified "Frenzy" code is not going to cause CTDs, so I'll keep it as a deliverable with Cradle 3+, but will NOT activate it in the default game settings. However, players that want Frenzy can easily activate it themselves by editing a single line in "script.slc".
    Click image for larger version

Name:	Babylon captures Amarna.JPG
Views:	147
Size:	255.6 KB
ID:	9447644

    Leave a comment:


  • Kull
    replied
    CTDs - Final Resolution:

    As first reported in Post #88 sometime around the middle of August I began to encounter CTDs, and as reported a few posts later, was able to trace them back to the AI control files in the aidata folder. The problem was temporarily resolved by restoring most of those files to the Cradle defaults, but that was just a temporary fix since the Source Code team made a number of improvements to the AI, much of it reflected in the AE versions of those files.

    Since then I've been engaged in the now-completed "Special Attacks" project, but several weeks ago I returned the focus to the CTD problem. I'll spare you the tedious details, but this time I went through every file and didn't make any changes without confirming linkages to the other AI files. And the result was good. Cradle 3+ now has a full set of altered aidata files which make use of the new SC team changes and....the game does not CTD. Three test games ran down to 500 BC, another went to 1 AD (see attached), and not a hint of an issue.

    Equally important, the AI is now making full use of ALL the Ancient Era Special Attacks:
    * AI Diplomats establish embassies, hold receptions, investigate cities AND Hear Gossip.
    * All the AI civs build Slavers and use them to Raid cities and capture free roaming Nomads.
    * AI Religious units Convert cities, Sell Indulgences and Soothsay
    * AI Assassins use both Sabotage AND Assassinate Ruler
    * AI Spies investigate cities, steal technology, and instigate successful revolts
    * And yes - ignoring the problematic aspects - even Wonder Units will deploy the Siege attack
    Click image for larger version

Name:	AI Playtest (1 AD).JPG
Views:	156
Size:	89.9 KB
ID:	9447640

    Leave a comment:


  • Kull
    replied
    Special Attacks - "Era Dependency" Fix:

    ISSUE: I've talked about this throughout the individual Special Attack reviews (and more specifically in Post #111), but let's go through it once more. In Cradle, many of the special attacks were repurposed so they could apply in the Ancient Era. The idea being that - for example - a Modern Era legal attack (Injunction) which stops production for one turn could also be used in the Ancient Era as a form of sabotage. The effects of the attack are IDENTICAL, but the graphics, sounds, and messages were all changed to reflect the Ancient Era version. The problem of course is that eventually the Modern Era arrives and Lawyer units appear, but instead of filing Injunctions or issuing Lawsuits, they are setting fires and assassinating civilians.

    SOLUTION: I'll go into more detail below, but the solution involves saving the game at a specific point and then copying in a "Swap Folder" which contains a revised set of files. Specifically, when the player gains the "Age of Reason" Advance, that is considered the beginning of the "Modern Era" for file swap purposes. These new files contain everything necessary in order to change all the graphics, sounds, and text from the Ancient to the Modern Era. I've tested this and it turns out that you can swap almost any file and see the changes immediately simply by loading your Save game. No other actions are necessary. The exceptions to that are slic programming files (anything with an .slc suffix) and severl of the "string" files, "info_str.txt" in particular (the file which holds the message text). The former requires the player to use the /reloadslic command, but I wanted to avoid even that, so there are ZERO slic files included in the Swap folder. As for info_str.txt, the problem is that even a ONE WORD change to a SINGLE MESSAGE results in the corruption of EVERY MESSAGE! Accordingly, that file is also not included. Fortunately there were only 4 messages which had a strong Ancient-Modern dichotomy, but even with those I was able to craft generic alternatives which work in any era.

    PRELIMINARY FIXES: To reduce the number of File Swap changes, I was able to create alternative Great Library entries, so that BOTH "Sabotage" and "Injoin" AND "Assassinate Civilian" and "Sue" appear in the GL at the same time, regardless of era. In similar fashion, all required sound files and almost all graphics are already present in the appropriate game directory. Which means all that's necessary is to swap the text files which link to them. Apologies if that sounds a bit esoteric, but trust me - it reduced the number of required file swaps by a factor of ten!

    ERA-DEPENDENT SPECIAL ATTACKS: Not all special attacks have this problem, but here are those which do:
    * Sabotage/Injoin: Almost everything associated with this attack has to change. To include the sound and ALL the graphics (button, cursor, messageicon, sprite & city status bar icon)
    * Assasinate Civilian/Sue: Same with this attack. Have to change the sound and all the graphics (button, cursor, messageicon & sprite)
    * Soothsay/Advertise: The change affects only the sound and the sprite
    * Indulgences/FaithHeal: A relatively limited change which affects the sound, button & cursor
    * Siege/Plague: Actually these are completely different attacks, but they share the same sound and sprite. Since the first is primarily Ancient while the second is Modern, we need a sound & sprite swap.
    * Assasinate Ruler/Bomb Cabinet: The name of the attack stays the same, but the graphics & sound will take advantage of the File Swap process to shift from "knife" to "bomb" at the start of the modern Era.

    UNIT CHANGES: A small number of units are able to deploy ancient era special attacks and yet still exist in the time period after the "Age of Reason". However, there is a solution which prevents them from deploying inappropriate special attacks from that point forward
    * Cleric: A revised "units.txt" file removes his ability to Sell Indulgences (which otherwise will feature "FaithHeal graphics and sounds). There remains a small disconnect since this unit will retain the "Soothsay" attack, but the only difference is that you'll now see and hear the Advertise Sprite and Sound. That's not optimal, but the problem eventually goes away when "Cleric" upgrades to Televangelist (who does not have Soothsay).
    * Patriarch: A revised "units.txt" file removes his ability to Sell Indulgences (which otherwise will feature "FaithHeal graphics and sounds). Does not have the Soothsay attack, so that's not an issue.
    * Poisoner: A revised "units.txt" file removes her ability to Sabotage and Assasinate Civilians since those become purely legal special attacks. She still retains the ability to Assasinate Ruler (now with a bomb) and is the only unit with that capability. It's also possible that the AI will use this unit more if that's the only thing she can do.
    * Wonder Units: Actually NONE of their abilities will change, however just be aware that the sound and sprite for the "Siege" attack will shift over to "Plague". All other graphics remain the same.

    FILE SWAP MESSAGING: This does not refer to the special attack messages themselves (as noted above, they cannot be altered), but rather the messages and visual cues which tell the player which File Set is active and when it's time to make the change.
    1) The Main Menu will have a graphical indicator telling the player that files from either the Ancient or Modern Era are active (see attachment - 1st pic)
    2) There is a message which pops up on T2 and tells the player that yes, you have the correct Ancient Era files or no, you are using the Modern Era ones and need to swap back. Since the "as-delivered" mod will start with the Ancient Era files already active, the latter issue would only occur when a previous game had moved into the Modern era and files were swapped, after which the player decides to start a new Ancient Era campaign. This message includes a messageicon which also tells you which swap file is active (see attachment - 2nd pic)
    3) There is a second pop-up message which plays after "Age Of Reason" is discovered, telling the player that it's time to do a file swap.
    4) A new GL Concept entry describes the Swap File process, and each of the new messages has a "Library" button which pops open a window containing this entry (see attachment - 3rd pic)

    FILE SWAP PROCESS: As the above section clearly indicates, although we've been talking about File Swaps which shift certain sounds and graphics from the Ancient to the Modern Era, the player ALSO needs to be able to transition from Modern to Ancient (for example, when starting a new campaign). Performing this task is extremely easy. The Cradle 3+ directory contains two self extracting archives that will automatically copy the swap files into the correct directories. For the Ancient Era, just doubleclick the file called "Ancient.exe" (see attachment - 4th pic) and click the "Extract" button. And that's it. The Modern Era file swap works exactly the same, except instead you will doubleclick the file called "Modern.exe"

    In closing, this process is ENTIRELY OPTIONAL. It is typically performed only once per campaign, can be done in any year, and - most importantly - is not necessary in order to play Cradle 3+. Your game will not crash or fail in some fashion, but the "immersion factor" will be reduced if you are using the wrong set of files for your era.
    Click image for larger version

Name:	Swap File Process.jpg
Views:	158
Size:	673.0 KB
ID:	9447543

    Leave a comment:


  • Kull
    replied
    Unfortunately I'm not particularly good at scripting. In a few cases I've been able to spot problems and make fixes, and even create some new ones - but only when I can copy existing scripts which do almost exactly the same thing. I wouldn't even know where to begin when it comes to replicating a faulty game mechanism like this.

    On the plus side - and I'll get into this a bit more at some point - I've been carefully tweaking the AI and it currently uses EVERY ancient era special attack in it's arsenal, which is light years ahead of the situation when I started on this project.

    Leave a comment:


  • sevenfm
    replied
    I wonder if it's possible to use script to intercept this action and apply some effects, I think AoM4 had siege implemented in that way, so that under siege units in city cannot be healed.

    Leave a comment:


  • Kull
    replied
    Siege Attack Redux (continued): Well...yes and no. In playtesting, the AI used the attack several times against AI opponents, which was a good indicator that the attack was working as intended. Not much use spending time and effort to make this thing look good if the AI won't use it, amirite? Unfortunately, that highlighted a problem. A big problem.

    In the example below, a Carthaginian Wonder Unit deployed a Siege Attack against the Assyrian city of Arbela. You know the attack is successful, because the red "Siege Symbol" can be seen on the Arbela City Status Bar (failed attacks do not display this icon). However, the "Happiness" window does NOT show any effect from this attack, and the Happiness level itself is still quite high (78). At the time of the attack, Arbela was building a Slinger (top picture) and - even though all production is supposed to halt for 5 turns - we can see (bottom picture) that the city has completed the unit and started work on a Shrine. Meanwhile the happiness level remains solid at 78.

    Unfortunately this is NOT an outlier. I tested it again and again and again, altering settings every time, and got the same result every time. Siege attacks deployed against AI civs, whether by the human player or another AI, have NO EFFECT. Really disappointing. That said, I will keep the attack in Cradle 3+, because it is one of those rare instances where the AI has an in-game advantage over the human player. In other words, given half a chance, the AI WILL deploy this attack against you, so....player beware!
    Click image for larger version

Name:	AI Siege Effects.jpg
Views:	159
Size:	526.1 KB
ID:	9447517

    Leave a comment:


  • Kull
    replied
    Siege Attack Redux: Originally the far future "Bio-Terror" attack, this was reconfigured into an Ancient Era special attack and was extensively reviewed in Post #127. First the good news. As playtesting has shown, the AI can and WILL deploy this attack against the human player. In the attached example I altered the effect to -10 unhappiness (and also noticed the name of the attack needed to be changed in the "exp_str.txt" file), and you can see the result. Huge levels of unhappiness that can't be managed at the city level and require an Empire-level happiness boost to offset. And the building of the Nomad was locked at 14 for the next five turns. Sooooo, it works right?
    Click image for larger version

Name:	Bio-Infect does work.JPG
Views:	164
Size:	140.7 KB
ID:	9447514

    Leave a comment:


  • Cyberguy
    replied
    Originally posted by Kull View Post
    Well, the easiest way to deal with that is to toggle "Pollution Off" from the Rules screen when starting a new campaign (see attached). If you still want to play with "Pollution On" and have a situation where pollution can increase for some period after which something will drive it down to zero, that is something you would have to mod into a game. Fortunately the mechanics aren't that difficult to understand. They use the same mechanism which reduces population pollution - an attribute assigned to one or more buildings in the "buildings.txt" file. As an example, let's look at the "Aqueduct" in Cradle:

    Code:
    IMPROVE_AQUEDUCT {
    DefaultIcon ICON_IMPROVE_AQUEDUCT
    Description DESCRIPTION_IMPROVE_AQUEDUCT
    EnableAdvance ADVANCE_AQUEDUCTS
    
    PrerequisiteBuilding IMPROVE_GRANARY
    
    ProductionCost 1200
    Upkeep 3
    FoodPercent 0.15
    StarvationProtection 5
    PopulationPollutionPercent -0.1
    ProductionPollutionPercent -0.4
    }
    In reality the Aqueduct doesn't affect production pollution, but I added that to this example so you know it exists. Anyway, you can add those attributes to ANY building, and in ANY percentage. Also, the AI will construct EVERY building, so eventually these will appear in every AI city, and do their reduction "thing". So you'll get the "across the board" result you are looking for. The AI won't "know" it is doing good things to abate pollution, it will just happen.

    The design part would be if you assign these attributes in different values to structures which become available at different times, so you can have the effect of "pollution grows and then at some point begins to decrease". For example, if 7 structures each reduced population pollution by 20%, eventually they would all be built and the net effect would be a city-by-city process in which the they produce zero population pollution and THEN provide a 40% decrease (into the environment).

    Best of all - if you have an ongoing campaign and fear that pollution is about to destroy it, you can make these adjustments in "buildings,txt" and the next time you load a save game, they will take effect immediately! For example, I changed the PopulationPollutionPercent in Aqueduct to -1.1 and it took effect right away.
    Click image for larger version

Name:	Pollution.JPG
Views:	191
Size:	116.1 KB
ID:	9447146
    Thanks for the info, I am aware I can turn pollution of at the start of a game but i like that's its there, just not that it becomes the overarching dynamic to play too because of the impeding doom scenario and I don't like seeing my lands inundated.

    Leave a comment:


  • Kull
    replied
    It was a design difference between the two games. The CtP2 AI looks at them primarily as trade goods, whereas Civ3 added coding for the AI to see strategic value. That doesn't exist in CtP2, so while you can create strategic resources now (thanks to the Source Code project), the AI doesn't recognize them as such. In the case of Horses, they are fairly common, and - most importantly - they exist on the terrain-types the AI likes to settle on. So the odds are good that most civs will have horses or will trade for them. By contrast Copper and Iron exist in mountains, and - especially in the early game - the AI isn't likely to have those resources sitting within the active work zones of the smaller early cities.

    Could the availability percentages and source terrains be redesigned so as to widen the availability of additional strategic-type Goods? Probably so, but it's not something I'm looking at.

    Leave a comment:


  • sevenfm
    replied
    I really like the idea of strategic resources, and in CTP2 regular resources don't look really important, I'm also concerned of how AI may use them, for example in Civ3 AI is really obsessed with gaining resources and will build cities on them (even before they are known) and fight for them, probably not anything like that in Ctp2 even with AE.

    Leave a comment:


  • Kull
    replied
    Originally posted by sevenfm View Post
    I think I've read somewhere that AE supports kind of civ3-like strategic resources, when you can only build certain units/building if you have that resource. Do you plan to implement something like this in this mod?
    There will be at least two. The "Horse" good is a requirement for building most cavalry units, and you cannot build "Nukes" without the "Uranium" good. I'm reluctant to go much beyond that, since it remains to be seen how well the AI can handle this. For example, requiring "Copper" or "Iron" as a requirement for the various infantry units would probably just strangle the AI.

    I'm still looking at the possibility of "chaining" TIMPS, specifically farm-type improvements. For example you could build them on Rivers, while going inland from there requires a neighboring farm (replicates the need for irrigation canals to extend out from water sources). The problem is there aren't enough rivers in CtP2, and the AI is simply clueless about the mechanics involved. Possibly it could work if Hills could be sources (simulating run-off) or some sort of very common "Well Good" was made available. Probably won't happen, though.

    Leave a comment:


  • sevenfm
    replied
    I think I've read somewhere that AE supports kind of civ3-like strategic resources, when you can only build certain units/building if you have that resource. Do you plan to implement something like this in this mod?

    Leave a comment:


  • Kull
    replied
    Well, the easiest way to deal with that is to toggle "Pollution Off" from the Rules screen when starting a new campaign (see attached). If you still want to play with "Pollution On" and have a situation where pollution can increase for some period after which something will drive it down to zero, that is something you would have to mod into a game. Fortunately the mechanics aren't that difficult to understand. They use the same mechanism which reduces population pollution - an attribute assigned to one or more buildings in the "buildings.txt" file. As an example, let's look at the "Aqueduct" in Cradle:

    Code:
    IMPROVE_AQUEDUCT {
    DefaultIcon ICON_IMPROVE_AQUEDUCT
    Description DESCRIPTION_IMPROVE_AQUEDUCT
    EnableAdvance ADVANCE_AQUEDUCTS
    
    PrerequisiteBuilding IMPROVE_GRANARY
    
    ProductionCost 1200
    Upkeep 3
    FoodPercent 0.15
    StarvationProtection 5
    PopulationPollutionPercent -0.1
    ProductionPollutionPercent -0.4
    }
    In reality the Aqueduct doesn't affect production pollution, but I added that to this example so you know it exists. Anyway, you can add those attributes to ANY building, and in ANY percentage. Also, the AI will construct EVERY building, so eventually these will appear in every AI city, and do their reduction "thing". So you'll get the "across the board" result you are looking for. The AI won't "know" it is doing good things to abate pollution, it will just happen.

    The design part would be if you assign these attributes in different values to structures which become available at different times, so you can have the effect of "pollution grows and then at some point begins to decrease". For example, if 7 structures each reduced population pollution by 20%, eventually they would all be built and the net effect would be a city-by-city process in which the they produce zero population pollution and THEN provide a 40% decrease (into the environment).

    Best of all - if you have an ongoing campaign and fear that pollution is about to destroy it, you can make these adjustments in "buildings,txt" and the next time you load a save game, they will take effect immediately! For example, I changed the PopulationPollutionPercent in Aqueduct to -1.1 and it took effect right away.
    Click image for larger version

Name:	Pollution.JPG
Views:	191
Size:	116.1 KB
ID:	9447146

    Leave a comment:


  • Cyberguy
    replied
    Hi, thanks for looking at this again and for the extra 5% you will add. I definitely need to get on Cradle.
    One more thing regarding pollution, do you know if it either currently exists or is possible to have some building or wonder that actively reduces pollution.

    So where i am going with this is that its all well and good for my civ to get to 0% pollution in every city i own but if the AI's don't do the same the the global warming catastrophe happens nonetheless.
    From what i have seen the AI's do not go out of their way to reduce the pollution they produce so one way to counter this is to have a city, tile or wonder improvement that actively scrubs pollution out of the system, ie reduces the overall pollution as indicated by the red bar at top right of a game screen causing it to go backwards, thus countering & even slowly reversing the pollution being emitted by AI civs.

    Leave a comment:


  • Kull
    replied
    Originally posted by Cyberguy View Post

    What I'm getting at is that there are city improvements that can reduce a cities population pollution to 35% of its level without the city improvements/ However there is no way, short of reducing the population size to get below 35%.
    I took another look at this, and your statement is incorrect, at least insofar as it applies to Cradle. Take a look at the attachment. The inset has the list of all Cradle Buildings which can reduce population pollution, and they total up to 95%. The majority of the Screenshot shows the City manager screen for the city of Ebla. It has 19 total citizens and is generating 252 points of population pollution. However, it also has 6 buildings which together reduce that pollution by 85% (Green rows in the inset). The combined effect of those six buildings should be to reduce actual Population Pollution to 38, and if you look at the number circled in Red on the City Manager screen, that is EXACTLY what they have done.

    From a game realism perspective, the Ancient Era offers 4 structures which together provide a 40% reduction in population pollution. I think that's a good number for the era, as it will encourage the player to be cautious about building large Super Cities, as otherwise the pollution numbers can quickly spiral out of control. Not until the Modern & Future Eras will additional structures become available, finally taming the problem

    To that point (and for the sake of completeness), I will add a 5% reduction to the "Body Exchange" improvement, thus eventually making it possible to achieve 100%, albeit only near the end of the game.
    Click image for larger version  Name:	Population Pollution.JPG Views:	1 Size:	128.7 KB ID:	9447100
    Last edited by Kull; November 9, 2022, 14:14.

    Leave a comment:

Working...
X