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
    Militia Unit Systems:

    Cradle has a system which uses SLIC code to create "militia" units in newly founded cities. The code is extensive and complex, because the units upgrade over time (from Spearman to Hoplite to Legion, etc) AND they are immobile (and forced to remain so). The code is complex primarily because these are unbuildable units which have statistics that are different from their "Standard" unit equivalents. For example, the Militia Spearman has much better defense than the regular Spearman, and the same is true for the other six Militia types. That kind of functionality comes at a price, however, as the files which control it contain over 1500 lines of slic code dedicated purely to this purpose, and it runs in the background, every turn.

    By contrast, AE has a new feature which places a cheap unit in every newly constructed city, and it does not use ANY slic code. It becomes active simply by changing "AIMilitiaUnit=No" to "Yes" in userprofile.txt. Implementing this in Cradle 5 resulted in two immediate improvements: First, the number of city captures by the AI increased noticeably (albeit primarily in the early game) and secondly it reduced turn-processing time by a full third. Unfortunately, this new Militia code was apparently never tested thoroughly, because it makes no distinction between "cheap" land & naval units. So pretty soon, Coracles and Biremes started to show up as garrison units for inland cities!

    There was no obvious way to fix that (other than by inflating naval unit prices to an excessive degree), so instead I replaced the AE Militia system with a simple 9-line slic script which gives a standard Spearman unit to every newly founded city (human and AI) for the first 300 turns (until 1 AD). That was tested and works perfectly (although the units can move, the AI does not leave cities without garrison units), and personally I like the reduced complexity. That said, the release version of Cradle 5 will still feature the Cradle 3/4 Militia unit system. However, I will include the simpler 9-line system as an alternate which the player can opt to utilize instead.

    To do so, simply open the "Script.slc" file (in the Cradle5/gamedata folder) and remove the "// " in front of "Updater4.slc" and ADD "// " in front of the "Updater3.slc" and "Homeguard.slc" lines (see attachment, which shows the "as-delivered" lines)

    ​ Click image for larger version  Name:	Militia Script files.jpg Views:	1 Size:	17.7 KB ID:	9469304

    Leave a comment:


  • Kull
    replied
    The various "problem solving" changes reported back at the end of February (see post #241 above) all involved "Barbarian-Human" playtesting. The primary goal of that activity is for turns to fly by as quickly as possible while searching for CTDs and evaluating AI performance. Once it was clear that all the dangerous CTDs had been eliminated (i.e. those which can't be resolved by restarting from the last auto-save, typically the sort of "system resource" problems that afflict older games), and that the AI was at least moderately competent at defending itself, it was time for a "Normal Civ Human" playtest. That takes a LOT longer, but is absolutely essential in order to identify the multitude of things which can make a game "un-fun". Things like the working of the "Domestication" Advance as reported above. Anyway, there is a LOT of stuff that's been done in that vein, and it's the sort of thing you'll see in the next series of reports. Some of it REALLY simple, others.....well....complicated. For example here's one annoyance that was really easy to alter, but has a surprisingly nice effect in-game:

    Elephant Walk sound:

    When the "War Elephant" unit moves across the map, it made a "footstep" sound that didn't fit with an animal of this size. Turns out that it was sharing the same movement sound file as the Infantryman. Accordingly I borrowed the elephant_footstep_02.wav file from my previous mod work in support of Europa Barbarorum 2, modified the number of "footfalls per second" to make it work better in CtP2, renamed it to "Ele_walk.wav", then added a new entry in sounds.txt which references that file (SOUND_MOVE_ELEPHANT) and then assigned it to both Hannibal and the War Elephant. The result is a sound which is exactly what you would expect to hear when seeing an elephant walking across your screen in Cradle 5. Files changed: sounds.txt & units.txt​

    Leave a comment:


  • Kull
    replied
    As the season turns from Winter to Spring, my "modding time" has been greatly reduced as outdoor requirements multiply at the Ranch. That doesn't mean we're at a standstill - rather a lot has been done, just not written up. Anyway, excuses aside there are quite a few interesting developments to report and I'll begin with one that in hindsight seems pretty obvious:

    Advances - Move "Domestication" to Level 1:

    Historically, the Domestication of plants and animals occurred long before the development of Agriculture, yet in Cradle we find that Agriculture is actually a pre-requisite for Domestication! That doesn't make sense, so in Cradle 5 the Domestication Advance is moved from Level 2 to Level 1 (see attachment), the Agriculture pre-req has been removed, and the research cost reduced from 320 to 180 (same as "Exploration"). Files changed: Advance.txt, GL.txt, Tech Tree​

    Click image for larger version

Name:	Domestication to L1.jpg
Views:	126
Size:	9.2 KB
ID:	9469290

    Leave a comment:


  • Kull
    replied
    Playtesting - Issues & Findings:

    After resolving the "too many Wonders & Buildings" issue, Cradle 5 is now approaching a "final state", so it was time for a new series of extended playtests. This identified a number of problems, and I'll briefly review them, roughly in the order in which they presented and were resolved:

    1) Full Civ Revolt CTD: Initially, all games failed to progress beyond 1200 BC before an unrecoverable CTD brought them to an end. Eventually I traced that back to instances of "full civ revolts" in which EVERY city switches over to a new civ, and apparently that is not something the code can handle. Digging deeper, the unhappiness levels causing these revolts were directly tied to a pair of issues:
    - First, there were improperly high "War Discontent" values in "govern.txt" (see post # 198 for a discussion on this mechanism). In particular I foolishly set the threshold to "zero" for Anarchy, which meant that every time a civ switched governments - especially if there were a lot of units in the field - the unhappiness levels spiked beyond the civ's ability to offset it with sliders.
    - The second factor involved the original (as yet unmodified) Cradle 3 settings in DiffDB.txt, specifically those which reduced the cost of everything for the AI - in particular at the higher difficulty settings. The in-game effect was something like MAD (mutually assured destruction) since AI civs could see that their opponents were fielding huge armies, so all sides kept building more and more units until eventually the "War Discontent" values caused a civ-wide revolt and brought everything crashing to the ground.
    - The solution involved fixes to the War Discontent values in govern.txt and replacing the Cradle 3 entries with most of the AE cost, research, and production values in DiffDB. With those two changes, games can now play through to 2025 AD (see attached) and beyond.

    2) Single-City Civ Revolt CTD: Even after the fixes noted above, it is quite common for single cities to revolt and become a new civ. This is fine, and the game has no problem with it. However, if one of these single-city-civs revolts into a new civ (f/e Nubia revolts and becomes the Inca), that can result in a CTD as well. I couldn't find a fix for that, but you can simply reload the game from the last auto-save and it will continue without a problem. Disconcerting, but not an issue.

    3) Dynastic House Issue & Great King improvement: As described way back in Post # 3, the Dynasty Advance allows all players to construct the Dynastic House building and receive the "Great King" unit. However, if a civ loses their capital, they can build a new Dynastic House and receive another Great King. Not really a problem in the early game, but potentially this could happen long after the era of Great Kings was over. So now this structure has been given the "ObsoleteAdvance ADVANCE_CITY_STATE" attribute, so it can longer be constructed after the discovery of City State. In a related change, the Great King now has the same movement (from 2 to 3) and vision (1 to 2) attributes as Sargon, and building the Dynastic House also grants the player a free chariot unit.

    4) Quinquireme Sprite: Unlike every other unit, the rebuilt Quinquireme sprite had the shield in the center of the ship as it moved around. Not sure how I missed that, but the sprite has now been fixed.

    5) Wonder Unit Upgrades: As each civ gained the "Age of Reason" Advance, their Wonder Units upgraded to the Field Marshall/Brigadier replacements, so the new system is working properly.

    6) Emancipation Proclamation: Although this Wonder eliminated all Slavers and freed all slaves in all cities, it did not stop civs from building new Slavers. Fortunately the SC team added a new Wonder attribute (ProhibitSlavers) and once that was applied to the Emancipation Proclamation Wonder, no further slaver-type units (or abolitionists) could be constructed.

    7) Pollution: Several of the test games used unmodded AE, primarily to gauge differences with Cradle in terms of speed and AI aggressiveness. One notable finding is that pollution was a serious problem in all AE games, including numerous Dead Tiles appearing in the Middle Ages and even a Global Warming event prior to 2000 AD. By contrast, in Cradle the effect of pollution is gradual and even by 2000 AD there were no dead tiles (although the "pollution meter" was rising steadily - see attached). That's good, because it means no changes are needed to the Cradle pollution settings and buildings.

    8) "CanBeExpelled" Attribute: The AI does not understand the true use for Plunder units (disbanding them in cities to gain shields or population), so it uses them to explore. At least that's something, but it's annoying to have them clogging up space inside your territory. A similar but more dangerous problem is when otherwise peaceful civs send Hired Thugs or Assassins to perform their nefarious acts against you, and they too aren't easily removed. All six units now have the "CanBeExpelled" Attribute", which allows them to be evicted at low diplomatic cost.

    9) War Elephant size: Elephants are the only "Large" land unit (besides the late-game "Leviathon"), and that means they can't be loaded onto ANY troop carrying vessels. Even tanks are "Medium"! War Elephants now changed to Medium.

    10) Wonder TIMP fixes: Several issues cropped up during these playtests.
    - The Wonder TIMP code only allowed them to be built on Grassland, Plains or Desert, but frequently those are not available or have been used by other Wonder TIMPs. When that happens, the new Wonder destroys the old by being built on top of it. The solution was to expand the number of acceptable terrain types to Forest, Jungle and Hills.
    - Once the AI is able to Terraform, it does not factor in whether a Wonder TIMP is sitting on a terrain type that it wants to transform, destroying the Wonder TIMP in the process. The solution was to add code from the Natural Wonders slic file, so the AI can't do ANYTHING to a tile which contains a Wonder TIMP.
    - A few times, one AI civ would gain technological ascendancy over the others, and start building all the Wonders before any other civ could get them, and would usually do so in the best production city. So a single city would begin to acquire ALL the visible wonders, and usually wouldn't have enough room to place them, so all the older wonders would be wiped off the map. The solution was to add a limit of 5 Wonders per city (in Const.txt, MAX_CITY_WONDERS setting changed from 1000 to 5), so it keeps the AI (and the human) from building up a powerful production city and assigning all the Wonders to that one location.​

    Click image for larger version  Name:	2025AD Game.jpg Views:	1 Size:	503.3 KB ID:	9468220

    Leave a comment:


  • Kull
    replied
    Wonders - Related Changes:

    But before we do that, a few follow-ons to the Wonder-related changes:

    1) Using a major religious figure as a Wonder Unit always struck me as something of a disconnect, since all the others are primarily secular in character. Accordingly, the Muhammad unit has been replaced by the major Islamic General of that early period, Khalid ibn al-Walid (see attached). He appears with the building of Mecca.

    2) The Great House of Alexander originally was linked to the discovery of Republic, but historically that is too late (among other things, it meant that Hannibal was arriving before Alexander). That has changed, and Alexander's House is now available with the discovery of City State.

    Click image for larger version

Name:	Khalid.jpg
Views:	66
Size:	98.8 KB
ID:	9468037 ​

    Leave a comment:


  • Kull
    replied
    Buildings and Wonders - Current Status: With the changes discussed above, we now have 67 Wonders and 65 Buildings. Looking first at the Wonders, a number of changes were implemented to reach this final total:

    1) Although it would have been easy enough to restore Central Matter Decompiler and National Shield, I chose not to do so. Wonders which exist only to grant free Buildings tend to be overpowered. Especially in the late game period, the most advanced civ will build these two, and that's usually a civ with an already substantial lead.

    2) Resurrection has likewise been omitted. It really was a "two-fer" Wonder for Christianity (along with Holy Scriptures), plus - as I noted earlier - it was backward looking in assigning great importance to an event which historically wasn't recognized as significant until long after the occurrence.

    3) Internet remains an Advance, not a Wonder.

    4) Space Station and Dinosaur Park have replaced the Space Lab and VR Amusement Park Buildings.

    5) The last three on the list (i.e. the non-City Inventory Wonders numbered 65-67) are the Great Houses of Sargon, Alexander, and Hannibal. Those were selected entirely because they are the first to appear, and thus were the easiest to test. Once each is completed, that civ is given the appropriate obsoleting Advance (Z_SARGON, Z_ALEXANDER, or Z_HANNIBAL) and thus no more can be built. Extensive playtesting has shown that this works exactly as intended - the civ which first builds each Wonder is granted the correct Wonder unit (and his retinue), while all other civs shift production to something else. Worth noting that the playtesting also confirmed that the AI civs are happy to steal (or perhaps trade) those Advances, but that is not a problem since they don't do anything other than inhibit construction of something that no civ should be building anyway!

    As to the Buildings:

    1) Space Lab and VR Amusement Park have been replaced by the Space Station and Dinosaur Park Wonders.

    2) The earlier restoration of Micro Defense and Matter Decompiler has not been rolled back, especially in light of the removal of the Central Matter Decompiler Wonder. In addition, both buildings provide the sort of building-specific attributes which cannot be duplicated by Wonders or Feats, unlike those granted by the Space Lab (Science) and VR Amusement Park (Happiness).

    3) The last Building on the list (i.e. the non-City Inventory Building at number 65) is the Religious Victory structure. This was tougher to test realistically since the Religious Victory option is a mid-game event, only available after enough culture points have been accumulated AND it's only available to the builder of the Hagia Sophia Wonder. Nevertheless, I was able to extend two playtests into the 1700 AD and beyond time frame, and in each case the AI civ which built the Wonder is the only civ which can construct this building and win the game. So it's been tested and it works (see attached), albeit that identified a grammar problem, lol.

    That concludes the extensive effort invested in researching and identifying workarounds for the 64 Wonder and Building Hard Code limit. Time for something else!

    Click image for larger version

Name:	AI Religious Victory.jpg
Views:	90
Size:	63.1 KB
ID:	9467941 ​

    Leave a comment:


  • Kull
    replied
    Removing Excess Buildings (Part 3):

    3) VR Amusement Park: A late-game building, but current technology trends indicate this to be an unlikely version of the future. Virtual Reality is happening at home, not in a large facility you have to physically visit. By contrast, something that is within the realm of "far future" possibility would be the CtP1 Dinosaur Park Wonder. For which there is also a TIMP (so it will be a Visible Wonder!) As with the Space Lab, we'll substitute an interesting Wonder in place of an unlikely "building". The movie already exists, but for Cradle 5 it's been edited to remove the CtP1 "bonus description text" appended at the end. The 2D art is a straight copy (see attached).

    The existing structure provides +3 Happiness in every city which builds it, but that's a bit too much for a Wonder. So we'll drop the bonus to +1 and will also add 2 Scientists to the Specialists in its home city. Since this will be a "normal" Wonder, it can use existing "built-in" Wonder attributes.

    To make up for some of the Happiness Loss, we'll add +1 Happiness to the "Incubation Center" which is a nearby structure on the Tech Tree that currently provides only a single benefit - raising the overcrowding level.

    In addition, although the VR Amusement Park is enabled by "Neural Interface", the new Wonder will instead be associated with "Genetic Tailoring". Transforming this Building into a Wonder resolves the final "problem" slot in the buildings.txt file. Game Impact? Improvement.

    With this, the "excess building" problem has been completely resolved.

    Click image for larger version

Name:	Dinosaur Park.jpg
Views:	117
Size:	114.0 KB
ID:	9467790

    Leave a comment:


  • Kull
    replied
    Removing Excess Buildings (Part 2):

    2) Orbital Lab: This is a really strange implementation for a building. You can build one in every city - and see it in the Inventory - yet it represents an orbiting space lab. Even if this were a "Far Future Era" structure (which it isn't), it's hard to visualize a scenario where every city on the planet would maintain their own private space laboratories.

    In fact, this works MUCH better as a "Wonder" - a single orbiting Space Station. The associated Advance is "Space Flight", and as such the very first Space Station would (and historically did) qualify as an amazing technological spectacle, the very personification of a "World Wonder".

    The current building gives a 30% Science increase in each city that builds it, but as a Wonder we'll reduce that to 10%, since it immediately benefits the entire Empire. In addition - since this will be a "normal" Wonder using the "built-in" attributes - the host city will gain a Science Specialist. And we'll toss in a free "Space Plane" unit, just for fun! The CtP2 "Solarius" Wonder movie plays when it's built (previously unused in Cradle), and we'll use a screenshot from that for the 2D art (see attached)

    Transforming this Building into a Wonder resolves the 2nd of 3 "problem" slots in the buildings.txt file. Game Impact? Improvement.

    Click image for larger version

Name:	Space Station.jpg
Views:	124
Size:	111.0 KB
ID:	9467717 ​

    Leave a comment:


  • Kull
    replied
    Removing Excess Buildings (Part 1):

    1) Religious Victory: As you may recall the "Religious Victory" building was added as the final structure necessary to achieve the Religion Victory option, following completion of the Hagia Sophia Wonder. As I noted at the time, the building itself can only be constructed once and it never appears in the City Inventory since the game ends the instant it is completed.

    When the modified Religious Victory test was successfully performed, this building was located at the # 67 position in buildings.txt, so inadvertently we already ran the test which proves the "too many buildings" limit is not a problem for this particular structure, and thus it will remain in the game exactly as-is. Game Impact? None.​

    Leave a comment:


  • Kull
    replied
    Originally posted by Cyberguy00 View Post

    Did you edit or delete a post as post #196 does not look like a reply to my Civ4 BtS Democracy Game post? Not that its an issue however.

    Also, can new units be added, i was thinking possibly a 'Drone Swarm' - short range that can take out most anything but can be countered by an 'Advanced EW' unit or a 'Laser Anti-aircraft' unit as examples?
    Yes, I changed it because the whole idea was flat-out wrong and I didn't want to mislead anybody. Technically speaking that idea would still work so long as the total number of buildings remained at 64 or less. So yes, you could use that mechanism to set up a system of "churches" or "mosques", or perhaps "commerce" or "production".

    As for Units, they are unlimited in number. Sprites are capped at 200, however. Other limits: City sprites: 255; Tiles: 1024; Advances: Unlimited; Feats: Not sure, but I suspect unlimited.

    Leave a comment:


  • Cyberguy00
    replied
    Originally posted by Kull View Post

    First of all, my apologies for the incorrect response to your original question back in Post # 196. That needs to be edited so others don't follow the wrong path. As to the current situation...
    Did you edit or delete a post as post #196 does not look like a reply to my Civ4 BtS Democracy Game post? Not that its an issue however.

    Also, can new units be added, i was thinking possibly a 'Drone Swarm' - short range that can take out most anything but can be countered by an 'Advanced EW' unit or a 'Laser Anti-aircraft' unit as examples?

    Leave a comment:


  • Kull
    replied
    Too many Buildings (revisited):

    On the other hand, what about "Too many Buildings"? Can the same discovery help in that area as well? Ummm, no. By design, buildings can be constructed in multiple cities for multiple civs. So the same solution - give an obsoleting Advance to the first Civ which builds one - would NOT work here, unless you greatly altered the code to give that same Advance to ALL civs. But even then, "why bother"? A building of this sort could only exist in one city of one civ, and it still wouldn't be found in City Inventory, and thus would have IDENTICAL properties to all the "beyond 64" Wonders. And since those are unlimited in number anyway.....and far, far easier to code? Well, you get the idea. All of which means that Cradle5 still has an excess of 3 structures in Buildings.txt, but fortunately there are some good solutions available for those.​

    Leave a comment:


  • Kull
    replied
    Originally posted by Cyberguy00 View Post
    Can the same approach be taken to increase the number of buildings?
    First of all, my apologies for the incorrect response to your original question back in Post # 196. That needs to be edited so others don't follow the wrong path. As to the current situation...

    Leave a comment:


  • Cyberguy00
    replied
    Can the same approach be taken to increase the number of buildings?

    Leave a comment:


  • Kull
    replied
    Unlimited Wonders (what's next?):

    Definitely a very exciting discovery, but what does it really mean? We'll start by dampening expectations - an "unlimited number of Wonders" does NOT mean "Wonders with a full set of Wonder attributes". The traditional CtP2 Wonders were noteworthy because they provided a variety of built-in attributes that were easy to activate without any need for coding - increases to science, food, commerce, regard, hitpoints, etc. But all those require the Wonder to be physically located in a City Inventory, which is NOT the case with the "beyond 64" structures.

    That said, they can still do a lot of things:
    - Trigger a number of existing SLIC events such as Feats and Unit & TIMP creation
    - Trigger a nearly unlimited number of other SLIC events
    - Have Great Library entries
    - Other stuff we haven't even thought about

    That may seem rather generic, but let's consider those abilities in the context of the existing Wonders already present in Cradle5:

    1) As noted earlier, there are 8 "Great House" Wonders, and all of them deliver units (check), provide Historical background in the GL (check), and provide 1 Gold every turn (check)

    2) In addition there are 6 "Religion" Wonders, and all of them deliver units (check), provide Historical background in the GL (check), and deliver a 5% increase in Science every turn (check)

    That's a total of 14 Wonders in those two categories alone, ALL of which could be shifted into a "beyond 64" position in the file, without any reduction in their ability to provide EXISTING functionality. So instead of "5 too many" it's more like "9 too few", lol.

    That doesn't mean it's time to make wholesale changes to the existing Wonders, but certainly some of those which were eliminated can now return. In addition, this entire exercise required that I take a long hard look at the existing Wonder system, so a number of changes will be made regardless, simply because they make more sense (such as shifting "Internet" from a Wonder to an Advance).

    Bottom line, there's a lot to do here, but at least it's going to be fun. Adding is much more pleasant than subtracting!​

    Leave a comment:

Working...
X