Crazy Spatz's Alpha Centauri Mod

Okay, before the thread hits 10k views, here's the next version! It's not a large update.

v.0.15, dated 2/7
BALANCE:
> The Hospital’s “HealRateChange” was set to +100 previously, because I thought it was a modifier (+100%), but it’s an absolute amount (+100 HP per turn). This was decreased to +2.
> The boost to City Ruins yields was moved from the Content mod to the Balance mod. This includes the +1 gold, +1 culture, and the +1 research at Archaeology.
> City Ruins get +25% defense modifier (fighting in ruins gives good cover). To balance this, I removed the +1 production that I’d previously given.
> The Great Person buildings receive an additional +2 upgrade in the late Medieval/early Renaissance, at the following techs:
- Landmark: +2 science at Printing Press
- Academy: +2 science at Physics
- Customs House: +2 gold at Banking
- Manufactory: +2 production at Steel
- Citadel: +2 gold at Gunpowder
(This means that in a game with ONLY the Balance mod, these improvements will just get +2, going from +4ish to +6ish. When combined with the Content mod, though, these get THREE +2s, so at the endgame you’ll have these improvements giving +10ish.)
> Fixed the Civilopedia entries for the Aqueduct, Sewer System, and Recycling Center to use the Strategy field instead of the unused Quote one.

CONTENT:
> I successfully deleted the four unused techs (the old Future Era) and the Giant Death Robot from the database.
> The Gravtank and its Secondhand counterpart now get the same –33% penalty to city attacks that the Tank and Modern Armor get.
> The Vertol, Secondhand Vertol, and Gunship now also get the –33% penalty vs. cities. This is mainly needed because the “cannot capture cities” promotion just doesn’t work.
> The Ranger, through its custom promotion, now can see invisible (almost never going to matter), and gets +1 visibility.
> Trolls can move across mountains (like a hovering unit) and are immune to nuclear attacks.
> Carriers and Leviathans have the Medic promotion. This’ll help them heal nearby naval units, and onboard fighters.
> Labor Mechs can now move through impassable terrain. (This is the first step to lake-based Dilithium.)
> The Monolith consists of two parts: the improvement (+food) and the Feature (+happy, -food). Previously the +food was +1, this was boosted to +4 so that the AI wouldn’t want to replace the improvement with something else and the –1 was changed to –2. This difference compensates for the +2 boost I just added to the Balance mod. So a Monolith tile will now give +2 food when worked and 3 happiness if it’s within your borders.
> The Nanohospital’s HealRateChange was also decreased, to +10. It’ll still fully heal a unit either way, but this won’t result in huge numbers popping up.
> Removed the Blitz promotion from the Former, since it wasn’t doing what I wanted (allow you to improve a tile and then continue moving if you could complete the improvement in one turn).
> Because the new Gunpowder improvement to the Citadel was +gold, and the later one at Nanominiaturization is +production, I changed the one at Electronics to +science.
> Because the new Printing Press improvement to the Landmark was +science, and the second increase is +gold, I changed the third (at Biomachinery) to +food.
(The result of the above is that the “pure” improvements (Academy, Manufactory, Customs House) get three +2s in their specialty, while the Citadel, Landmark, and Monolith each give three different small boosts.)
> Building any of the new Wonders with custom Lua effects triggered the logic designed for the Dream Twister, which among other things would create a custom notification that would say that your empire’s happiness has been permanently reduced by 0. This has been fixed.
> The custom notification for the Dream Twister has been removed in general, because it was triggering every turn instead of just the turn it was built; the game will already tell you when someone else builds it (because it’s a Wonder), it just won’t explicitly tell you what it does any more.
> Added custom icons for the new worker build actions (Plant Forest, Terraform, etc.) as well as a couple improvements that never had them before (City Ruins, Monolith). These are not finalized; the small icons used for the Workers need to have a blue background. But it’s at least legible, both in the Actions UI and the tech tree.
> The Plant Jungle placeholder improvement is now +1 food, -1 production, +1 gold to represent what the tile would have with a trading post on the jungle. This should make the AI decide to plant jungles a little more often.
> Added a bunch of Civilopedia entries.
 
Sigh. Just after I uploaded the version, I started a new game, and the TXT_KEY bug is back. I'll try rebuilding it again, but I probably won't have a revised version up tonight. Obviously it's still playable, just ugly.

EDIT: It's fixed, go ahead and download. Thankfully, I managed to fix the problem before anyone downloaded v15.
 
Hello Spatzimaus,

When I replied to your suggestion:
8> The balance between the Great Person buildings (Academy, Customs House, Manufactory, Landmark, Citadel, and Monolith) and those units' other abilities.
I gave each of these buildings +2 at the late Industrial/Early Nuclear, and then again in the early Nanotech. I've been looking at a third (or first, depending on perspective) increase in the early Renaissance, because many of those techs just don't DO enough and I like the idea of the Academy and such becoming steadily more valuable as time goes on. But I think a third +2 is too much, especially in light of my recent changes to the Farm/Mine/Post bonuses, so should I just change it to +1s for the increases?

I meant, give a increasing bonus at the early eras, +2 or +3, then later on decrease it to +1 both times if you don't want it to be too much, at the early stages GP are more valuable so building one of their building should give +2 early on, you suggested +1.

It's good to get your new version but a pity it''s not saved game compatible, but I'll more then happy to start a new game, I've learned a lot about your mod in the first go, pity I never reached the futuristic eras, I hope I'll get to them this round.
 
I meant, give a increasing bonus at the early eras, +2 or +3, then later on decrease it to +1 both times if you don't want it to be too much, at the early stages GP are more valuable so building one of their building should give +2 early on, you suggested +1.

That's a possibility, although if I was going to do that then I think I'd just make all three increases be +1, and possibly increase the base values by +1. The thing is, I want the increase to be tied to the rarity of an improvement type, because I don't ever want what you have in the vanilla game, where it's often better to put a trading post on a resource than to put its intended improvement. The same goes for the GP improvements; the Customs House adds a ton of gold, but nothing else, and I don't want there to ever be a point where the player looks at this and wonders if he'd rather have a Farm on that tile. (Or more specifically, I don't want the AI's screwy weighting system to decide that.)

It's good to get your new version but a pity it''s not saved game compatible, but I'll more then happy to start a new game

I'd say keep playing the version you're on, as long as you're not in that boring "mopping up" stage, unless you're crashing constantly. (Just don't unzip the mod until you're ready.) I'd rather have a complete set of feedback, even if it's a version or two old, since not that much changes from version to version.

The fact that saved games aren't compatible between versions is extremely annoying, I know. I had a really good game going last night before I found that TXT_KEY bug and had to rebuild the mod, and now I'll have to start over again. But if I don't flag it this way then it does much worse things.

pity I never reached the futuristic eras, I hope I'll get to them this round.

That crash bug has been extremely annoying, and I've yet to figure out what's causing it. (Obviously.) Until it's fixed, I'd suggest starting in the Industrial Era if you want to see the new content. (Ancient start is best for testing the Balance mod, so I go back and forth.)
An Industrial start plays a bit differently than in the core game:
> You start with three Settlers, three Workers, and five Riflemen.
> Every city starts at size 4, and has buildings boosting culture by +5 from the start (easy border expansions) and happiness by +4 (so the unhappiness for founding the city is about the same as for a size 1 in vanilla), although these buildings are expensive, so it's a lot harder to break even if you expand quickly without making roads a high priority.
> You start with enough culture for four Policies, and every tree is unlocked so you can skip the Tradition tree if you want.
> Coal is already revealed, and you're only one tech away from Factories. Railroads and Oil aren't far away either.
> The early game is basically all in preparation for the space race; you're trying to get the techs needed and get your cities ready to produce parts. It's almost guaranteed that at least three civs will be racing for the spaceship and finish within a few turns of each other.

And I've yet to see that crash bug show up in an Industrial start, so that's a plus.
 
There are actually two different timers in the GlobalDefines, one 20 and one 30, and I don't know how they differ.

One of the defines is for the original Research Agreement which gave both civs 15% research boosts for 20 turns. When that got scrapped, they left in the code.
 
One of the defines is for the original Research Agreement which gave both civs 15% research boosts for 20 turns. When that got scrapped, they left in the code.

Okay, that makes sense. And it's too bad, really; that +15% boost is a bit more abuseable (since there's less downside to breaking it, while the current setup REALLY encourages you not to declare war until after it ends), but it'd make things go much more smoothly.
Although, if that +15% was additive with the University, Research Lab, etc. then it's not much of a bonus.

Also, this thread is now over 10,000 views. Granted, most of them are probably me, but still...

The next version will, most likely, include custom icons for the various units. Some (Needlejet, the psionic lifeforms) I can scavenge SMAC assets for pictures of, but the others are going to include a lot of outside artwork. I can think of quite a few workable pictures for some of the units (those taken directly from works of fiction), but within the next couple days I'll try to post a list of ones I can't find something good for, at which point I'd take suggestions.

But at this point, it's basically done other than the artwork. So here are a few questions for people to think about, beyond the ones I posted earlier:

> Right now, the satellite buildings (like the Sky Hydroponics Lab) add +2% to food/gold/production in every city, instead of SMAC's flat +1. Note that that +2% is off the city's base value (before Universities, Markets, etc. are applied).
I know of a couple ways to fix this, mechanically, although the UI won't handle it too well. The question is, should I? Is the current setup worth the cost? Would it be too abuseable to add the flat amount, to where a new city would have a massive food surplus and such?

> I've often used the Tech Diffusion mod, which helps civs that are a few techs behind the leader by increasing their research output. (On King or higher it really helps the player, on Prince or lower it really helps the AIs, especially ones that have lost a few cities in early wars.) After the December patch that mod broke, but I've fixed it in my own version.
Is this something that I should integrate into the Balance mod, or should it remain a separate mod?

> The Jump Gate.
I've gone back and forth on this one. It's a T23 building at Matter Transmission, non-Wonder, based on SMAC's "Psi Gate". Right now, all it does is act like a Harbor, allowing for trade route connections; it's the only building that isn't functionally "done" at this point, although I'm still tweaking several others for balance.

In one original idea it gave something like an Airlift that didn't end the turn of the moving unit. But that seemed a bit too weak on most maps, especially once you got the railroad boost at Monopole Magnets. A related idea was to have it allow you to move from this city to anywhere on the map, but that's basically the Space Elevator's effect.
In one idea it boosted the trade route income for this one city, but that just seemed too close to what the Market/Bank/etc. do. An alternative was just to have road/railroad tiles within that city's culture cost less maintenance, which'd have the same basic effect.

The idea I really want is to have it allow a city to work tiles 4 away from its center instead of the usual 3. But no matter how hard I try, I can't seem to find any workable Lua way to do this. So, I'm putting this out there. Does anyone have a good suggestion that you KNOW is possible within Lua/XML?

Some ideas that I KNOW would work:
1> A unit starting in a city with a Jump Gate would gain a temporary promotion until the end of turn (like how the Space Elevator works), that'd give a unit +2 movement and allow it to use enemy roads until the end of the turn. I dislike adding yet another combat promotion building. I'd prefer something more "civilian", but this at least works.
2> At the start of each turn, your empire gains a flat number of gold depending on the total number of Jump Gates within your empire and the total number in the world. (Sort of like trade routes, but allowing for foreign connections and not interruptible.)
3> Sort of like the Mint, it'd give a boost to any local luxury resource deposits. (The Nanoreplicator, at the same tier, already does this and more, so I'd have to play around with the balance of the two.)

So, any others?
 
> I've often used the Tech Diffusion mod, which helps civs that are a few techs behind the leader by increasing their research output. (On King or higher it really helps the player, on Prince or lower it really helps the AIs, especially ones that have lost a few cities in early wars.) After the December patch that mod broke, but I've fixed it in my own version.
Is this something that I should integrate into the Balance mod, or should it remain a separate mod?

3> Sort of like the Mint, it'd give a boost to any local luxury resource deposits. (The Nanoreplicator, at the same tier, already does this and more, so I'd have to play around with the balance of the two.)

So, any others?

It's obvious that you're a fan of late start (well you suggested it yourself earlier), so you're easy on balancing methods that aren't in favor of 'play from the ancient beginning om marathon' RA are much too easy (cheating) in the early game, techs are way too cheap, on prince level the AI gallops ahead with RA, they pop a lot of cities sometimes 8~9 with only two of the same luxury resource, so their trading must be limited, most of the cities are of size 1, how does the AI manage it?

No need in my opinion for tech diffusion, mint shouldn't be crippled in favor of late era techs, on the contrary, you should add some more buildings like the mint but for other resources, like toolsmith or weaponsmith to turn Iron into gold.

Well these are just some thoughts of mine, you should play a bit more from 4000bc on marathon or epic to get my drift.
 
It's obvious that you're a fan of late start

Actually, I'm not. I designed this mod, from the beginning, to be an extension of the standard game where you start in the Ancient Era. It's just that this makes it effectively impossible to test out the new content on a regular basis; not just because of the crash issue, but because I have a tendency to tweak the mod files as I find new things or have a new idea. Since this screws up any save games, I end up being extremely limited in how long I can play one game. This is also why I stick to Standard speed all the time, even though I'd prefer Epic (although Marathon is still just too much for me). If you're only updating your mod files once a week or so then it's not a big deal, but for me, the files don't stay constant from day to day. The pace of large-scale updating has slowed down in recent weeks as all of the essential stuff is now in place, so I can do this sort of testing more often now, but I still tweak a lot of numbers as I test.

As a result, when I want to test game mechanics, pacing, or the Balance mod in general, I'll start the game in the ancient era, but when I want to test anything directly related to new content I'll start in the Industrial. I just can't play a game that takes more than one evening unless I deliberately hold myself back from improving the mod. (I did that a couple weeks ago, actually, playing a huge map starting in the ancient era, albeit on Standard speed, to see about that crash bug, and that's why it took so long between versions.) Also, I wanted an Industrial or Nuclear start to at least be POSSIBLE to play, because people wanting a more SMAC-like experience would start at that point. But it was never intended to be the primary way to play the mod.

I definitely want this to be balanced for an Ancient Era start. And after a bit more testing, I think that means I'm probably going to have to bump up the RA costs again; I'm now looking at a 200/300/400/500/600/700/800 sort of thing. (For most eras, this'd effectively cost double the vanilla value.) So let me ask; when you say that "techs are way too cheap", are you only referring to the number of turns needed to research techs the normal way, or are you talking about the overall pace (which'd include RAs) being too fast? If you're just talking about number of turns for normal research, then I'm not sure I agree; this mod is already considerably slower than a vanilla game, especially in the later eras. It might be that there's some other difference to playing on Marathon, though, so I'll look into that later tonight.

As for tech diffusion, the idea there is just to prevent a runaway tech leader, which happens often in Ancient-era starts if you begin on Prince or lower. Once you're 10+ techs above the pack you'll pick up every Wonder, and unlock +research or +production buildings that much sooner, and the game is basically over at that point since it's just a matter of time and micromanagement to roll over everyone else with your military. I had one point in an earlier test game (Ancient start) where, in the late Fusion Era, I was 31 techs above the closest AI; I had Gravtanks, and the AIs didn't even have Modern Armor. A few turns later I unlocked Bolos, and I could literally destroy most empires with a single unit.
A few things in the Balance mod were designed to prevent a runaway military leader (like the Home Field Advantage), but there's not as much for the tech disparity you'll see in many games. This is why I bring that particular mod up.

Diffusion is also how it worked in earlier Civ games; you had a hidden discount if you researched a tech that everyone else already had. So there's a bit of nostalgia to using it. The problem is that it's a purely positive change, speeding up the tech pace a bit, so I'd have to slow everything down in some other way to compensate. And this means that I can't use it if I want to evaluate the game's pacing, because it gets you to later eras sooner than you would just through my own mods. So if I were to add a mechanism like this to the Balance mod, I'd make some other negative change to compensate, like making all techs cost 20% more across the board.

on prince level the AI gallops ahead with RA, they pop a lot of cities sometimes 8~9 with only two of the same luxury resource, so their trading must be limited, most of the cities are of size 1, how does the AI manage it?

Part of the reason the AI can do this is that he'll have more money than you do. Some of this is from the reduced maintenance and upkeep costs the AI pays, and I'm looking at fixing that in the next version (having the AI pay 75% of upgrade costs instead of 50%, that sort of thing). But part is also that the AI is in a Golden Age more often than you are, which happens because the AI is almost always running at an insanely high Happiness surplus. You can see this in the Diplomacy Overview; watch how often the AIs' incomes jump up to +100gpt or higher. (When you get the "happiest people" info, it's more obvious. So if you're using one of the UI mods that adds an indicator on that, it's easy to see.)
That gold surplus can be used to buy RAs, but it's also used to rush-build a Colosseum in a lot of small cities. A couple versions ago I tried having the Colosseum require a Monument, just to make it harder to rush, but this screwed up a couple other parts of the game and had to be reverted. So I'm now looking at increasing the Hurry modifier for the happiness buildings, to make it harder to do this.

From what I can tell the AI probably doesn't cheat on Happiness, but it definitely does something sneaky. Ever notice how the AI will call you up to offer a Research Agreement the moment you have enough money? Basically the AI is watching the availability of these agreements at every moment, whereas a player won't check that every turn. Now, since RAs are limited by both parties having enough cash, you'll get offered about as many as the other players will.
But think about luxuries. During the AI turns, an AI player hooks up an extra copy of one of his luxuries, and what does he do? Immediately check to see if anyone will trade for it, and chances are he'll trade it to another AI. And realize that the AI isn't as insistent on an even luxury-for-luxury trade as a human would be, so it's a lot easier for the AIs to come to an agreement with obsolete strategics or lopsided trades. How many times have you asked an AI what he wanted for your spare luxury, and he comes back with 5 Iron, 4 Horses, and a handful of gold? An AI would accept that offer.
The end result is that the AIs almost always trade their spare luxuries among each other before offering it to you, which just drastically increases their empire Happinesses.
 
So let me ask; when you say that "techs are way too cheap", are you only referring to the number of turns needed to research techs the normal way, or are you talking about the overall pace (which'd include RAs) being too fast?.

Both, on marathon speed, which is meant for IMHO, to allow the players to meddle longer, much longer in each era and work with the current units enough time to let them level up a bit and wage a war or two before they get obsolete.
This implies a slower pace of research, less easy to accomplish RA, and much harder to expand like mad in the ancient era.

Obviously your combined mods are much more vast in scale and are not meant to be custom tailored to each of us players. I used to play with DonMaryMod a bit, it tackles the problem (my problem) from a different angle , the techs are much more expansive, and till a certain tech is researched, settlers can be produced in the capital only, Large Scale mod tackled the problem from a different angle, making expansion very difficult at the beginning and actually giving Huge worlds their true meaning, huge and empty for a lot longer time. Both of these mods are long dead, but I got hooked.

So while I'm adopting to your mod I let my self now and then to give you a small nudge in my preferred direction, your mod without any question has scaled up the game by a factor of a lot, it's now much more playable as a CIV game in which I need to think before expanding and building and less then a stupid game probably meant for a much younger and different style of players from the one who used to play Civ I,II,III,& IV.

Thanks again for your elaborated replies which are filled of tips for better playing.

A small tip of mine, I'm playing my current game with your mods and with a scripted map Terra Incognita which is a pleasure to play with, recommended to anyone who is tired of the vanilla maps.


Edit: My mistake, Large Scale is not the mod I meant, Large Scale is definitely not for slow expansion on large maps, it's for fast expansion and growth.
 
This implies a slower pace of research, less easy to accomplish RA, and much harder to expand like mad in the ancient era.

Playing on Marathon multiplies the amount of time needed to research a tech by 3, but it also multiplies the amount of time needed to make a unit or building by 3 as well, along with pretty much everything else you can think of (culture costs, growth food requirements, etc.). So if you want to have, say, the ability to build more units/buildings at each tech level before they get obsolete, then you need to make a custom game speed that multiplies that one modifier but not the others. I've seen quite a few mods do this. This is actually one of my complaints about Epic and Marathon speeds: they're not actually DIFFERENT in how they play, just longer; most of the balance complaints I have about the timing of the vanilla game (techs speeding up as you go) aren't fixed by a change in game speed. I like Epic for the increased ability to micromanage your battles, but to me it doesn't make enough of a difference in how the game plays to really be worth the extra time it'd take.

In my current test version I drastically increased RA costs, and that's definitely cut down on the AIs' abuse of it. Not just because they need to spend more, but because once the AI has, say, 500 gold in his pocket, he'll be more likely to use that cash to rush a unit or building, or bribe a city-state, than to save up for a few more turns to get an RA. When RAs cost less than a good bribe, the AI would spend on them before doing anything else. (I also bumped the AI upgrade cost from 50% to 75%, so they've got a lot less cash to spare in general.)
As for the tech pace in general, I've already slowed it down significantly compared to the vanilla game. There are a few points in the game where it still feels a little rushed, but I can't slow it down much more without some serious changes to the balance and timing. I could adjust the base costs of some of the existing techs, but I was trying not to do that; I wanted to do as little editing of existing techs as I could. (Adding new stuff to them, fine, but not Updates.)

Obviously your combined mods are much more vast in scale and are not meant to be custom tailored to each of us players.

No, but I do try to make it self-contained enough that it wouldn't conflict with another balance mod that does what you're describing. If you can't find one that works post-patch then you shouldn't have a problem just making one of your own that multiplies tech costs.
SQL can do that really easily, adjusting each tech's cost based on its era or something, and wouldn't conflict with any parts of my mod. Or, if you're only ever going to play on Marathon and want an across-the-board increase, just make a mod that does this:
Code:
<GameSpeeds>
    <Update>
        <Set ResearchPercent="500"/>
        <Where Type="GAMESPEED_MARATHON"/>
    </Update>
</GameSpeeds>
(The default is 300, so this'd make all techs cost 67% more than what you're seeing now.)

A small tip of mine, I'm playing my current game with your mods and with a scripted map Terra Incognita which is a pleasure to play with, recommended to anyone who is tired of the vanilla maps.

As long as that map script doesn't override any parts of AssignStartingPlots (other than the part that places city-states), then everything should work nicely. But if it overrides the routine that assigns the sizes for Major or Small resource deposits, then it won't work. (Unfortunately you won't see an explicit error when this happens, unless you're in FireTuner.) I generally stick to the official map scripts simply for testing purposes, to avoid this sort of thing.
 
Hello Spatzimaus,

I've searched through out the Terra Incognita lua file, I'm not a programmer or modder but I've searched for the function AssignStartingPlots in the script and besides city state and wonders of nature I've found the following instance regarding resources:

function AssignStartingPlots:GetWorldLuxuryTargetNumbers()
-- Because Terra has extra land over normal worlds, increasing the world target
-- to provide more random resources and populate the New World with more resources.
--
-- The first number is the target for total luxuries in the world, NOT
-- counting the one-per-civ "second type" added at start locations.
--
-- The second number affects minimum number of random luxuries placed.
-- I say "affects" because it is only one part of the formula.
local worldsizes = {
[GameInfo.Worlds.WORLDSIZE_DUEL.ID] = {21, 3},
[GameInfo.Worlds.WORLDSIZE_TINY.ID] = {36, 4},
[GameInfo.Worlds.WORLDSIZE_SMALL.ID] = {52, 4},
[GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = {70, 5},
[GameInfo.Worlds.WORLDSIZE_LARGE.ID] = {90, 5},
[GameInfo.Worlds.WORLDSIZE_HUGE.ID] = {110, 6}
}
local world_size_data = worldsizes[Map.GetWorldSize()];
return world_size_data
end

If you can approve or or disapprove this map to be played with your mod I'll be gratefully.

Thanks
 
That should be fine; I didn't add any luxuries, other than Neutronium, and that's handled as part of the strategic distribution instead of the luxury distribution. So as long as the map script doesn't edit the Major/Small strategic resource allocation, there won't be an incompatibility.
 
I've reached turn 893 without any crash or freeze but end of turns takes forever, around 120 sec on huge map.

Anyone playing both mods, Content and Balance, on huge map, please note the time it takes for end of turn to complete and post it here if possible, it's quite impossible to play with such a long delay for each turn.

I suspect it might be the Terra Incognita map I play on, but the map gets to be generated only at game start, then it suppose to be like any huge map.
 
I've reached turn 893 without any crash or freeze but end of turns takes forever, around 120 sec on huge map.

My latest game has also been remarkably crash-free, now in the mid-Nuclear Era. (Standard map, Standard speed, Pangaea.) If it starts crashing soon, then the culprit might be the logic the AI uses to assign technologies to city-states and barbarians (since they don't gain techs in the normal way). I've come up with a few other possible explanations, involving the change to the spaceship victory or the tech-locked policies, so I won't be tracking this down any time soon.

The timing hasn't been a problem for me; the interturn takes at most 10 seconds, and a lot of that is just showing unit movements. Nothing like what you've reported.

So here's the question. Open up FireTuner as you play. Between turns, there should be a series of messages pop up in FireTuner, things like "Start SpatzWonders", "End SpatzWonders", etc.; a Start and End message for each of the three main Lua scripts (SpatzWonders, SpatzStartTurn, SpatzEndTurn). I put these in there to try to track down the crashes; if you see the Start without the corresponding End then the crash would have come from within one of my scripts. (I've yet to see one where this happened; it's crashing somewhere else.) But I didn't remove them from the posted version, IIRC; they should still be there in the version you have.

So answer this: once the game starts bogging down, how much time does it take between the Start and End messages for each of those three? If they come quickly in pairs, then the 120s isn't my fault and is probably just a consequence of the big map. But if there's a big gap between the Start and End of, say, SpatzWonders, then it's my fault and I'll have to see what I can do.

The fact is, SpatzWonders isn't written nearly as efficiently as it could be. Each wonder uses a series of loops or IF checks before getting to its logic (loop over players, check if the civ exists and is alive and is not a barbarian, loop over cities, check to see if the city has that building) and a lot of those are duplicates of each other and so should be merged into a single larger loop. This has been discussed in a few threads in the SDK forum, because so many mods have loops like this, so I was holding off on optimizing my code. This was also a consequence of how I assembled it piece-by-piece, but I wasn't expecting it to slow things down THAT much. I'll try to clean it up tonight and release a new version tomorrow or Wednesday, once I finish testing the other bits I've been changing.

-------------
On an unrelated note, something I thought of that I'd like some feedback on.
As you've seen, I'm trying to encourage players to use their early Great People to create the custom terrain improvements (Landmark, Customs House, etc.) instead of always being spent on Golden Ages, tech bubbling, and so on. The problem has been, what happens if you place the improvement on a tile that later shows a resource? In my last game I placed two Landmarks from the Louvre; one ended up being the square with the only coal deposit in my entire empire, the other ended up being one of only two Uranium. I NEEDED those resources, especially the Coal, so I had to destroy the landmarks.

So a thought came to me. There's an OnImprovementDestroyed event in Lua (not to be confused with Pillaging) for when you use one of your workers or GPs to replace one improvement with another. This made me think: if the improvement destroyed is one created by a GP, then it'd be easy to just refund the GP. In the cases above, I'd have been given back two Great Artists, which'd allow me to make new Landmarks on a clear tile.

Is this abuseable? Can you come up with scenarios by which this'd be too strong?

For instance, if your first GP is a scientist, let's say there are no expensive techs available and so you create an academy. Then you research a few techs to prepare for a slingshot. A few turns before it's ready you build a trading post on the tile. Great Scientist pops back up, and you use him to grab Civil Service 30 turns early. It's like sticking the scientist in a city until you need him, except that you get extra science and don't pay unit upkeep on him.
Any other abuses you can think of? One that I thought of: you get all the way to the end eras, you're 20 techs ahead of the competition, and you just don't need techs that much any more. So you destroy your Academies, get a bunch of Great Scientists, and turn them all into Golden Ages.

The alternative is to try and code it so that GP buildings also can be used to extract any resource they're placed on. But that has a whole slew of technical issues.
 
It is actually really really easy to make it so all GP buildings can hook up any resources under them. Thal and alpaca both have versions of this in their respective mods. It doesn't always look pretty (there will be no visual cue that the resource is there except the floating pointer), but works well.
 
Could you create a weaker version of GP that can only build their improvements and have that unit created with an OnImprovementDestroyed event? So you wouldn't have to worry about Golden Ages or their other abilities.
 
Could you create a weaker version of GP that can only build their improvements and have that unit created with an OnImprovementDestroyed event?

Actually, that's a good idea. It's trivial to add a new unit type; if you set cost=-1 and ShowInPedia=false, then it's transparent to the user (which is how I did the Wild psi units and Secondhand city-state units). The only headache I can think of is that GPs get unique names from a table, which'd have to be duplicated.
On a related note: city-states' Secondhand Fighter units. Man, those things are ANNOYING, especially if you don't want to conquer a hostile city-state. (Say, if you're going for a diplo win and have the Patronage tree, to where ending a war would take you right back to +20.) Part of it is that I changed the Weak Ranged promotion of fighters from -75% to -50%, so they now actually pack a decent punch; I had three of them take down a wounded Destroyer on the turn war was declared.

But to keep it all simple, I probably should just copy the logic Thal/alpaca use in their mods, or at least ensure that my mod is compatible with Thal's balance series. After all, I've put so much emphasis on making these improvements viable, that it'd be a shame not to deal with this.
I'm not so worried about it looking pretty, and it's actually not a huge difference between my mod and the vanilla game; I add three strategic resources, but one is purely aquatic and another is 50% aquatic, so those would have no chance of conflict with the GP improvements. Only land-based Omnicytes (which have a big +food bonus) and Neutronium (which as a luxury and a strategic would be a no-brainer to harvest) would be problems.
 
Actually, that's a good idea. It's trivial to add a new unit type; if you set cost=-1 and ShowInPedia=false, then it's transparent to the user (which is how I did the Wild psi units and Secondhand city-state units). The only headache I can think of is that GPs get unique names from a table, which'd have to be duplicated.

Can't you just name the new unit: Academy Constrictor for an academy destroyed by an improvement, and so on?
 
Can't you just name the new unit: Academy Constrictor for an academy destroyed by an improvement, and so on?

Sure, but where's the fun in that?

Also, I've been trying to fix the Empath to actually give the +1 Happiness I'd always intended. There are just two (and a half) issues:
1> There's no way the AI would recognize the happiness boost. You can set Flavors for specialists, but the default specialists have no flavors, which implies the AI evaluates the yields (same as with Improvements). So, to make the AI still want to use them, I think I'll have to leave them as +1 food as well. Is this too strong, especially in light of things like the Statue of Liberty? (Food isn't very valuable in the endgame, since it takes so long for cities to grow, so I'm not worried about that too much.)
2> It'd only be a start-of-turn type of thing; changing slots around during a turn wouldn't change the displayed Happiness. Once you're past the first turn, then it's not so big of a deal if you're the type who leaves the allocations on the default settings, since it'd just carry over the happiness from the previous turn. I could probably hack the Happiness UI to fix this, but it'd be a bit more work.
2a> I know the game has the ability to put happiness faces on the text readout for specialist yields, because a bug has it currently doing that with the Statue of Liberty. But I'm still learning how to do that, exactly. Very low priority, but it's there.

The Empath probably won't be in this next version, but soon. The question, then, is this:
At what point in the game does Happiness stop being an issue?

In my experience, it's hard to stay above zero for most of the game, but once you reach the Theater you'll move up to reasonable levels (+20ish). Note, though, that I usually go Piety over Rationalism. But once you get Stadiums you're basically set regardless of which path you chose; add in the Hologram Theaters and you're done. So if Empaths aren't available until the Digital Era, then is there even a need for the Happiness boost to begin with?
Now, part of the reason the Happiness goes out of control is how much I've reduced city growth. If cities grew faster, especially at the exponential end, then unhappiness would go up quickly and you'd have a much harder time staying above zero. But then you'd also have more research, production, and gold, and there goes the balance.
One idea I've been toying with is to make them NOT just start in the future eras. Add an Empath slot to the Palace, switch the Garden to use them, and so on. I could get around the obvious thematic issues by calling them a Diplomat, Entertainer, or Judge or something. This'd give you a small amount of control on Happiness in the earlier eras.

Anecdote from my last game: Standard (8 civ), Pangaea. The world was one large S-shaped continent, and I was at one end, with a mountain range separating me from my neighbor (one hilly, easily defensible pass) and plenty of room to expand behind me. So my first war was fought with Infantry and Artillery, when I invaded India. The thing is, I had a huge military advantage; India was barely to Riflemen and had just finished a massive war with China and so had a depleted military (and his cities were not very improved). It was no effort at all to overrun four of his cities and capture the capital; he still had a dozen small cities but not much worth worrying about. So what happened then?
India offered peace... offering me every city he had except his new capital. Sounds okay, right? Yeah, it was kinda sneaky; if I'd conquered the cities the normal way then I'd have had time to wait for cities to come out of resistance, build a courthouse, and move on, and the fact that each city would have lost half its population would have really hurt. But instead, I went from +40 happiness to -30 in one shot, and that was puppeting all of the new cities. I had to make a couple emergency luxury trades and rush three Theaters just to keep above the revolt threshold. (Side note: Courthouses are way too cheap to rush-build. 450 gold for the massive amount of happiness they give?)

Of course, once I managed to Courthouse every new city, I had a HUGE advantage over everyone else. New techs in 5 turns, +100 gpt outside of GAs (+400 in GAs)...
 
Sure, but where's the fun in that?

Well, the unit that will pop out from the city will actually be some kind of a mover, the city needs that specific real estate with the GP improvement built on it for a different improvement like a mine, so lets move that academy somewhere else. (cities always do it, to hell with the historic building, we need the land for a new mall)

I did the check you suggested with FireTuner:

Code:
1  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Starting Terraform check; improvement type: 	IMPROVEMENT_PLANTATION
 
2  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Finishing Terraform check 	IMPROVEMENT_PLANTATION
 
3  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Starting Terraform check; improvement type: 	IMPROVEMENT_TRADING_POST
 
4  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Finishing Terraform check 	IMPROVEMENT_TRADING_POST
 
5  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Starting Terraform check; improvement type: 	IMPROVEMENT_TRADING_POST
 
6  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Finishing Terraform check 	IMPROVEMENT_TRADING_POST
 
7  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Starting Terraform check; improvement type: 	IMPROVEMENT_FARM
 
8  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Finishing Terraform check 	IMPROVEMENT_FARM
 
9  \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Starting Terraform check; improvement type: 	IMPROVEMENT_FARM
 
10 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\Terraform\Terraform: Finishing Terraform check 	IMPROVEMENT_FARM
 
11 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzEndTurn: Beginning SpatzEndTurn
 
12 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzEndTurn: End of SpatzEndTurn
 

13 NotificationPanel: Unknown Notification, Adding generic 1288
 

14 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzWonders: Beginning SpatzWonders
 
15 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzWonders: End of SpatzWonders
 
16 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzStartTurn: Beginning SpatzStartTurn
 
17 \My Documents\My Games\Sid Meier's Civilization 5\MODS\Spatz's Mod of Alpha Centauri (v 1)\Lua\SpatzStartTurn: End of SpatzStartTurn

The line numbers are just for reference, lines 1-10 differ from turn to turn, lines 11-12 with all the lines before them are almost immediate,

Usually after line 12, lines 14-15 pop out after a delay of 120 seconds, only one time I got line 13 which popped after 60 seconds and lines 14-15 after another 60 seconds. the rest of the lines follow lines 14-15 immediately.


At what point in the game does Happiness stop being an issue?

Well, as you mentioned, around theater, but only if gold is not a problem, because much of the pre theater buildings that contribute to happiness are necessary too.
 
Back
Top Bottom