K-Mod: Far Beyond the Sword

1. I would like Khmer to always be able to use their unique unit, so I gave the baray an ivory resource...except this is making Khmer have like 20 ivory resources (if they have 20 barays). Is there a way for the baray to provide ivory only to the city its built in, or limit it to one ivory resource globally?

2. Which setting in global defines effects the spy units ability to catch other spies (theres like 10)? I may want to slightly lower it.

<DefineName>ESPIONAGE_INTERCEPT_RECENT_MISSION</DefineName>
<iDefineIntVal>15</iDefineIntVal>

This reflects an increased chance to catch spies after a recent mission?

<DefineName>ESPIONAGE_INTERCEPT_COUNTERSPY</DefineName>
<iDefineIntVal>15</iDefineIntVal>

Is this what reflects the chance of spies catching other spies?

<Define>
<DefineName>ESPIONAGE_INTERCEPT_SPENDING_MAX</DefineName>
<iDefineIntVal>25</iDefineIntVal>
</Define>
100% espionage spending against a civ increases the intercept chance by 25%?

Other stuff Im curious about:
<DefineName>ESPIONAGE_SPY_INTERCEPT_MOD</DefineName>
<iDefineIntVal>-50</iDefineIntVal>
</Define>
<Define>
<DefineName>ESPIONAGE_SPY_NO_INTRUDE_INTERCEPT_MOD</DefineName>
<iDefineIntVal>-75</iDefineIntVal>
 
I've installed the latest version of K-Mod and I'm having trouble getting the Sevopedia to appear. I went into the Bug options screen and turned on the Sevopedia, but I'm still getting the vanilla civilopedia. Anyone have any suggestions for me? I do know K-mod is being loaded because I am seeing K-mod specific changes (such as the Serfdom changes, etc.)
 
1. I would like Khmer to always be able to use their unique unit, so I gave the baray an ivory resource...except this is making Khmer have like 20 ivory resources (if they have 20 barays). Is there a way for the baray to provide ivory only to the city its built in, or limit it to one ivory resource globally?

One simple way to ensure the Khmer have Ivory would be to make the palace a UB and have it provide the resource. You only ever have a single palace and you should always have at least one in the capital.
 
1. I would like Khmer to always be able to use their unique unit, so I gave the baray an ivory resource...except this is making Khmer have like 20 ivory resources (if they have 20 barays). Is there a way for the baray to provide ivory only to the city its built in, or limit it to one ivory resource globally?


You could always make their Unique Unit to not require a resource to build...?

That would be much cleaner to code, and will not flood the resource market with free ivory.

Change, in UnitInfos.xml:
Spoiler :
<BonusType>BONUS_IVORY</BonusType>

to

<BonusType>NONE</BonusType>

(located beneath "TechTypes")
 
One thing to watch out for if you enable barbarian caravels is that they'll probably spawn a lot, even into the late game - because there will always be a lot of unseen ocean plots. You might have to adjust the spawn rules to stop that from happening.
I have barbarian ships spawn based on unclaimed coastal waters in my own mod. This also stops them from crowding near remote islands. (Can provide the code fragments on request.)
 
1. I would like Khmer to always be able to use their unique unit
I would love to see the Map generator take this into account - so a resource needed for a UU would always be near a Civ, perhaps with the distance modified by level, i.e.
* Settler / Warlord / Chieftain - UU resource in BFC (if you settle in place)
* Noble / Prince / Monarch - UU resource in range of a second city
* Emperor+ - UU resource in range of a 3rd city
 
Is there a way in the xml to get an ai, to be more likely to refuse to comply with a apostalic vote/UN vote, when they are winning a war?

Every couple games or so Ill see an ai winning a war then get forced to make peace like 2 or 3 times in a row, 2 or 3 votes in a row, instead of refusing the outcome of the vote outright.

I could increase the length between votes, but I only really have that one issue.
 
Defy definitely. In my game, Bismark is up 4 techs and has a massive army over everyone else, they keep trying to destroy Boudica who just votes for peace and 4 times now, Bismark votes no (but not defy) and everyone else says yes, resulting in 4 forced peaces...
 
That kind of stuff has to be done in the SDK.

With XML, you can only modify/tweak pre-existing levers that Failraxis and Karadoc (if built with k-mod) has pre-defined. To my knowledge, the leaderheadinfos has no such ''Vote to continue the war power threshold'' pre-defined.
 
I'd be ok with changing anything as long as it doesnt require a recompile which is way beyond me at this point.
 
Anything that involves the SDK requires a re-compile (which is actually fairly easy to do.... its the set-up and download of different files that's fairly annoying to do)



Another option is to possibly code it with python, but that is far more annoying and tedious to pull off, not to mention you'll probably have to end up messing with the SDK (in order to 'expose', that is to allow python to read and write the values) anyways.

_______________________________________

Also @ Karadoc, would you know where the scoring is calculated (as in, the dynamic score in-game, as opposed to the final score at the victory screen)? In particular, how is the scoring for the wonders calculated?

I tried changing the code in CvGameCoreUtils.cpp

Spoiler :

int getWonderScore(BuildingClassTypes eWonderClass)
{
if (isLimitedWonderClass(eWonderClass))
{
return 1;
//return 5;
}
else
{
return 0;
}
}


But that does not appear to have changed anything on re-compile/re-load (all wonders, regardless of type, still give +16 points each).
 
I've uploaded version 1.43.

I'm pretty busy at the moment, so I don't have a lot of time to talk about it. I'll just say that it's consistent with the usual core aims of K-Mod:
  • Better stability (there are bug fixes).
  • Better performance (it runs slightly faster).
  • Better AI.
  • Better UI.
There are a few minor balance tweaks as well, so I hope that's a bit better too.

Let me know if you notice any problems with it. (Although I might not respond in the near future.)
 
Great! Thanks, karadoc!

Looking over the changelog.txt, I'm especially curious about the effect of "Completely redesigned the automatic assigning of worked plots and specialists in cities."
 
New plot AI sounds interesting and I am looking to check it out to merge it into my mod.

@Karadoc: I tried an update from github and the sources don't seem to have been updated there. Are you maintaining them somewhere else now or planning to upload them at some point in the future?
 
Github is still where the source is hosted but I haven't uploaded it yet. I'm sometimes a bit of a cheat with git, in that sometimes if there's a bug in the most recent thing I've committed I just amend the commit rather than make a new one saying "fixed bug in previous commit". However, I can't do that with stuff that I've already uploaded because that would screw things up for anyone who pulled the code before I fixed it...

The gist is that I tend to wait a day or two before uploading the source just in case someone finds something that's obviously broken. In any case, I'm not currently on the computer with the code anyway. So I can't upload it now. Sorry about that. It'll probably be up in the next few days.

The plot AI is something that I've been trying to improve for a really long time. I've changed it many times in lots of different ways. It's the kind of thing that I'd expect to be pretty easy, but it wasn't. I still don't really understand why it's so hard to solve... however, I'm pretty happy with the new solution. When the code is uploaded, you'll see that there are a bunch of different commits which change bits and pieces of it, and then one commit essentially deletes all of AI_juggleCitizens and replaces it with a new algorithm.
 
Hi Karadoc,
a few days ago (with 1.42b) I had a strange bug near the end of a looooong game on GEM with the 48-civ patched version of your mod.
Suddenly after I got master of the second biggest force in the world (they had 52 cities, I had 142) their former vassals broke free.
When I wanted to vassalize them too, I clicked on the button to let them offer their vassal conditions. Then the GUI updated the list with one of my cities, a huge GpT and a research tech, which was immadiately followed by a message box, that only one civ may offer things for a peace treaty. When I close this box, the negotiation dialog closed too.

When I just click on vassal state offer without asking what they want for that, they simplay ignore the offer. Other civs which were not a former vassal of the 52 city civ would vassalize without any problems.

So...
- Clearly the civs wanted to vassalize to me ( <5 cities compared to 142 cities, and a long war)
- Somehow instead of offering me cities and GpT, the dialog switched and make them demand something from me
- dialog got confused and opened message box which indicates that offers and demands got mixed up.

This might have something to do with
- 48 civs
- world size of GEM
- current city or army size
- vassalizing as an ex-vassal of a civ which vassalized to me
 
I was wondering if the AIs prioritize settling on (and consuming as much of as is reasonably helpful) river tiles highly enough. Even if it's a flood plains that +2 health usually (yeah, I understand if the city has no other reasonable way to hit and sustain even +3 food to grow, assuming it has much growing to do, that is, but this doesn't seem to often at all be the case) makes it better than settling off the river (3 food is worse than 2 food and 2 health in the long run, isn't it?), but the AI seems very unlikely to do such a thing. This is before factoring in levees/dikes, too (this ought to be worth something, and more if they can be built sooner or now, right?). It's painful to see the AI settle one tile off a river, screwing everyone out of its wondrous glory forever, or at least for quite a while (until the offensive city is razed) in many cases. I have similar moments of dismay when I see AIs settle 1-2 tiles off the coast. I also wonder if the AI considers spreading irrigation through the city for the purpose of sometimes even making the city reasonable instead of marginal (I don't really know either way). Irrigation spreads even for hill and other unfarmable tile cities, doesn't it? (Okay, it seems to not, then.) Even if it doesn't this seems worth considering for when the city would spread irrigation. Does the AI consider the tile it consumes and if that tile gives any bonus to the 2/1/1 the city normally gets (plains hills, resources, etc.) in comparison with the tiles it gains and loses for being placed elsewhere? Does the AI consider working fresh water lake tiles for 3 food (with a lighthouse) by placing the city on the coast? Does the AI consider that a town is better than most non-food resource improvements, especially if on a flood plains or grassland?

I'm sure it's hard balancing all these factors, but I really wonder about some choices the AI makes, as they seem rather short term, especially given that the AI is cheating (yeah I know some play on low difficulties but in that case helping them slightly more, depending on the map size, isn't a big deal, while adding challenge to higher difficulties without increasing the level of cheating seems highly desirable) and thus is more likely to beat me to the second, lower priority spot (that tends to be culturally viable for it but not so much for its opponents, including me) it would leave open if it wasn't hogging all the tiles and wasting some river and/or coast and/or other tiles (as cities only work the fat cross but block other cities from being placed even two tiles diagonally from themselves, this means that tiles get wasted even inland, not to mention the huge waste of coast in some situations (ocean is not so great without resources, depending a bit on a few things, of course)).

As for me, I favor consuming pretty much every tile a cottage could go on (this would naturally include hills even if I don't cottage them for a while). I try not to have extreme overlap, but placing another city for the city tile plus 1-3 towns definitely feels better than placing one fewer, "better" city*, especially if corporations can be factored in positively. Of course there's also blocking off opponents (although I'm not sure this factor makes much sense for the AI unless you also make it stingy with open borders) and gaining resources to consider (it seems rather greedy with resources, and that makes some sense on the border, but in many other cases I wonder), as well as how survivable or aggressive the city is culturally. I'm sure it's hard, but I have to at least wonder if the fresh water health and levee/dike values are really high enough right now.

*Perhaps the AI doesn't cottage like crazy, but it should in the long term if it wants to win. Of course SOME specialized cities can be good (if the AI puts the right national wonders in them, etc.), but the basic city type being cottage everything (once towns give mad gold plus one production; of course windmills and farms may be needed besides resource-specific improvements) seems correct to me (I know that <+4 food isn't great, either, but it depends on how far you are from capping out, too). I don't know what the AI does in this respect, of course.
 
Top Bottom