K-Mod: Far Beyond the Sword

Ive gotten about 4 hard crashes with 1.17. At first I thought it was a fluke, maybe its related to that lag about units set to explore? Tho Im still getting them with none of my units on explore.
 
@Charles555nc I haven't seen any crashes myself, but I just skipped over the changes between v1.16 and v1.17 to see if I could spot anything which might cause I crash. I suspect I may have found the problem. It might happen when the AI considers whipping something when all of its citizens are angry. (It could cause a divide by zero error when calculating the value of whipping.) - So I figure that's probably what you're seeing.

But if that actually is what's causing the crash, I'd expect it to happen again if you load autosave and do the same thing as last time. Does it? (and if so, do you have a save game that shows it?)


@MilesBeyond I often get cultural victories. So I can assure you that it is still possible! :) Also, before I release each new version, I let the AI play a few games on its own to make sure there are no obvious problems - and in those games it is pretty common for someone to win with a cultural victory.

Cultural victories in K-Mod usually do come later than they would in the unmodded game. But that's deliberate balance thing. One of my goals when I was balancing the culture stuff was to make it so that there was more than one viable options for getting a cultural victory. In the unmodded game, cultural victories were all about religions and wonders. In K-Mod I've tried to shift the balance a little bit – cathedrals give a lower multiplier, and many of the wonders give less culture than before – but on the other hand, colosseums give a decent culture multiplier (to make up for the reduction on the cathedrals); the cultural corporations come much earlier; and the fact that cultural victories take a bit longer than before means that broadcasting towers and the happy-resource wonders get to come into play as well. -- The aim was to make cultural victories are a bit more difficult, but more importantly I wanted to make them more diverse in where the main sources of culture come from.
[edit]
One more thing about culture that I think is worth mentioning: in the unmodded game, using your culture slider basically means you get a bit of happiness and not much else. But in K-Mod, because of the changes in how culture works, using your culture slider basically means that your neighbours are going to need to use theirs as well - otherwise they'll be culture-crushed. So that makes the culture slider a bit more viable - which might help you get a cultural victory later.
 
Its doesnt happen the same time every time, when i go to reload it from the last autosave...but I also have random seed on reload and the auto save has never been the same turn as the crash (I know the ai does some stuff randomly which could account for a non crash, as I catch up to where I was).

Im trying to save alot more manually, would that reduce crashes somehow?


Ran into another problem just a sec ago.

Persians took my vassals city with 12 riflemen
I had 2 infantry on a hill next to the city, that were at about 16-17health (20 is max for infantry)
Persians suicided 7 or 8 heavily wounded rifles against those 2 infantry and killed 0 of them.

I know I got pretty lucky in the combats, but seems like a bad move by the ai. I dont think the ai accounted that its troops were wounded. But its still much better than what they used to do, hitting with artillery and then failing to follow up.

First time Ive seen that in 3 games though, and I got a bit lucky in combat Im sure

Lastly, I was invading the enemy's vassal, Washington, took a city, the americans decide to send their main stack after my cities, instead of defending, and then the persian (their master) main army also marches past my stack on its way for my cities, while I just moved on to the next American city with only 4 or 5 units defending. Can the ai decide to defend rather than to send it stacks after my cities? Is there any way the ai can "see" a target of opportunity, like the persian main army seeing my stack seiging their vassal's city, because the persians could have totally saved their vassal there.

Cultural victory advice for Miss beyond,

Great artist super specialists
Wonders if you can
colosseums
Hermitage
free speech +50% culture
Religious buildings, especially things like cathedrals (40% culture bonus). Get as many religions in there as possible.
You can produce culture in a city after drama, I believe
You can finance even more culture on the empire level (but takes away from gold and research).
 
I don't think saving more often will reduce crashes -- and you're right that if the RND seed is not preserved in your saves, then you can't be sure that doing the same thing will have the same result.

One thing I recommend regardless of what mod you are playing is to set autosave to be every turn rather than every 4 turns or whatever the default is. The setting is stored in CivilizationIV.ini. I've got mine set to AutoSaveInterval = 1 and MaxAutoSaves = 30. ie. it saves every turn, and keeps up to 30 turns worth of saves.

In my view, it's much better like that, and I think it's a shame that only people who know about the ini file can change it. I've been wondering if it's possible to put the option into the BUG options screen (and save it to the ini file at the end of the game) - but I haven't looked into it yet.


Anyway, I'm pretty sure that if the crash is new in version v1.17 then it is probably caused by the thing I mentioned already. I'll upload a new version soon (v1.18) and hopefully that'll fix the problem. (maybe later today, or maybe in a couple of days time.)

Regarding the suiciding infantry thing - that's a difficult problem to fix. The root of the problem is that it's difficult for the AI to decide if it's worth suiciding some of their forces in order to get rid of your forces. Their decision making about this is not very sophisticated. Most of the time it's ok, but sometimes they'll make a mistake like you just described, and sometime they'll make the opposite mistake. (eg. when you had a single warrior on the forested hill, they decided that it wasn't worth suiciding an archer or two to get it out of the way...) -- I've been making adjustments, but I currently don't have any major ideas for improving it. (Mostly because I don't want to make the calculations too computationally expensive. I don't want it to be slow.)
 
I just saw a russian worker (belonging to russia) building a mine in an American city plot, I thought you could make roads for someone, but you couldnt change their plots (washington currently has a windmill and the russian worker is making a mine). They arent even vassal or master to each other.

As far as slowing down, and this might be my computer but the entire time of all the ais turns are probably only between 3-6 seconds total (longer if you have show ai moves on ofc) at least up until the last 75 turns of the game. But I realize other people may have older machines...
 
@MilesBeyond I often get cultural victories. So I can assure you that it is still possible! :) Also, before I release each new version, I let the AI play a few games on its own to make sure there are no obvious problems - and in those games it is pretty common for someone to win with a cultural victory.

Cultural victories in K-Mod usually do come later than they would in the unmodded game. But that's deliberate balance thing. One of my goals when I was balancing the culture stuff was to make it so that there was more than one viable options for getting a cultural victory. In the unmodded game, cultural victories were all about religions and wonders. In K-Mod I've tried to shift the balance a little bit – cathedrals give a lower multiplier, and many of the wonders give less culture than before – but on the other hand, colosseums give a decent culture multiplier (to make up for the reduction on the cathedrals); the cultural corporations come much earlier; and the fact that cultural victories take a bit longer than before means that broadcasting towers and the happy-resource wonders get to come into play as well. -- The aim was to make cultural victories are a bit more difficult, but more importantly I wanted to make them more diverse in where the main sources of culture come from.
[edit]
One more thing about culture that I think is worth mentioning: in the unmodded game, using your culture slider basically means you get a bit of happiness and not much else. But in K-Mod, because of the changes in how culture works, using your culture slider basically means that your neighbours are going to need to use theirs as well - otherwise they'll be culture-crushed. So that makes the culture slider a bit more viable - which might help you get a cultural victory later.

Thanks for the answer. That actually sounds like a lot of fun! The whole spam cathedrals, run FS and crank Culture was getting a bit repetitive. I think I may end up preferring things your way.
 
Thats one thing thats always impressed me about civ4 is the number of short keys for different features. Sometimes I will accidently press something on my keyboard and bring some new screen or option up in civ4.

I definitely turned on the auto save every turn with 30 back ups lol. Never knew I could do that.

Thanks again Karadoc!

Stats: 1919 and Ive killed 98 rifles, 93 cavalry, and 87 trebs, and Im pushing an 100 unit stack against the persians! Lost 30 infantry to take the Persian Capital, which had lots of machine gunners.

Gotta love when the world is full of rifles by 1776 when it should be just muskets :D
 
So when I was way ahead and drafted alot of Redcoats...I declared war on the top 2 points leaders who werent even close to me on the map, and destroyed their stacks as they arrived in my territory. Basically killing their chances of expanding their own empires, and the stacks they sent became smaller and smaller, and easier and easier to deal with.

Perhaps a change should be made in the ai behavior where even if they are at war with a long distance power house, they wont send a stack unless they have a real chance of taking a city.

Feels a little bit like cheating where I make them waste their armies like that, while gaining exp and great generals at the cost of a couple cannons.

Now Im fighting and destroying 2 civs at once because of the advantage Ive gotten. I also have a back up potential cultural victory just in case.
 
Version 1.18 has been uploaded.

One thing I like about this version is that the choose production popup box now doesn't come up until the city is actually ready to build something. For example, if you capture a city in a war, previous the choose production popup would appear right away, and it would say that pretty much everything would take a bazillion turns to build because the city is in revolt. Now, the popup appears when the city comes out of revolt, when it is ready to start building. I think it's much better this way.

The "actual building effect" BUG option is implemented. For people who have used K-mod already, the option will be on by default - because the default was set to "on" in previous versions, before the features was implemented. The default is now "off", but since you already have the settings saved, it will be on.

The new version also has some AI improvements and bugfixes.

The AI should be a bit better at defending their territory -- but there's something that concerns me about this. Here's the problem: Making the AI smarter at defending might actually end up making the game easier to win. Because if I improve the AI's defence tactics, that will make it harder for AIs to conquer each other, which will mean it is less likely that one AI becomes very powerful, and if no AI player rises above the others, it will probably be easier for the human player to win. -- Anyway, that probably isn't going to be a problem, but I think it's something worth keeping in mind.


@gabrielbyrnei. Did the WINE people have any insight as to what might be causing this? I don't think it's actually a python problem, but then again, I don't really have any idea what kind of problem it might be. I'm not really sure what preparation are being made by the game in the single-player menu. So I don't know what might be failing.
 
I think the issue of whether or not to improve ai defense- for the sake of helping along the the inevitable "alpha ai"- that runs through the other ais and directly challenges the player is more an issue of improving ai decisions towards winning.

Military Win Ai,

-possibly needs more aggressive drafting through nationalism, more modern military priority in research (I think all ais rush rock n roll and hollywood, more than infantry, tanks, and paratroopers). They particularly get artillery late.

-More and better use of military academies (I get maybe 2 or 3 great general instructors in my cap, and then save the rest of my Great Generals for military academies). Possibly add a small bonus chance for great generals for the ai.

-More aggressive slaving in cities with high food production, or across the nation when happiness sources are high

Cultural AI

-seems to do well getting 2 cities to focus on culture, but the 3rd city is almost always way behind the others. Part of this is because of older buildings making more culture. Great artist specialists and other culture bonuses could be used earlier, for a more even spread of culture amonst the 3 culture cities needed to win. Setting "culture" in the city production, after maxing cultural buildings,for an even greater bonus/chance at winning etc etc.

-Economy AI
Have a huge number of cottages but protect them with aggressive drafting and periodic unit slaving. Perhaps add code that would let the ai amass a large outdated army and then upgrade at a certain tech. Like amassing pikemen, and upgrading them to rifles later like I do (pikemen can then upgrade to rifles with the "City attack" bonuses).

-In General AI
Stacks often pass each other and both ais lose a city...perhaps the ai should "think" more about whether it should attack or defend or do nothing (Like if I declare war across the map and am far ahead in military, to send nothing). Right now the ai sends a huge stack or 2 to attack, defends very little with stacks, and after you kill their main stack they will continue to send smaller and smaller stacks against you, and not wait for a larger unit count before sending them at you, burning themselves out.

Get more units with collateral damage reduction (starting at double first strike upgrade) or machine guns to accompany invading stacks (dont see it much, although I do see them defend cities well).

I almost never switch to free religion....10% research seems low to me and the apostatlic palace bonuses are awesome and maybe I suck-but perhaps the ai should use it less as well. Organized religion and theocracy just seem so much more awesome, particularly in closer games. Pacifism maybe should get a buff at some point? I dont use it, ai doesnt use it. Seems like its designed for one city challenge maps only.

-High Espionage Ai
Steal more technology, more often from other ais and the player, using the spy discount method.


Civ4 is the only game I play nowadays, so god bless you for the frequent awesome updates Karadoc :D
 
o I ran into small problem in 1.17

I made peace and gained a city in the peace talks,
I waited 10 turns and redeclared war,
The ai doesnt retake the city, even tho its 3 squares away and they have railroad and its completely undefended.
 

Attachments

Right.. I've looked into that, and it turns out to be a systematic problem which affects several different parts of the AI.

If you like, you can try this custom dll that I've made to fix the problem. It changes a heap of stuff, but it probably isn't very notable except that the AI will take the city in your save-game. :p -- but there may be some undesirable side effects. (I don't know what. I'm just saying that I might have messed something up.)

[edit]
Actually, I've decided to just go ahead and upload v1.18b. It includes the fix that I had for the test DLL (which I've now removed from this post), and it also includes a couple of efficiency improvements that came to light while I was working on the fix.

I've only tested it a little bit, but I think it'll be good.
 
Just to share:

We finally finished our immortal team game with 1.11 and it was a lot of fun. the AI made some interesting moves. And several tactics we were used to do from the last years were rendered ineffective. (for example granting cities during war to take out lots of defenders with good city attackers near the city)
Especially one team that threw heaps of galley/galleons/transports on our continent for the whole game showed a significantly improved sea warfaring.
We won around 1750ad when the first wave of 20 tanks were produced. Tanks are still really a problem for the AI, because they do not react with a beeline to artillery for anit-tanks.
Now we started with 1.18 on huge highlands with 17 AIs and got crushed two times because of barbarians :( . Did you make them more aggressive or changed their unit composition? We were overrolled by barbarian stacks of 2-3swordsman, + axeman + spearman. (ok, highlands, huge is great for barbarians because of big areas with fog of war).

And I played a bit with your 1.17 48-civ version. Compared to BetterAI Mod end of turn in the middle ages (Giant earth map) now takes around 45 seconds, while BetterAI takes 90 seconds. So there was some improvement ;)
 
I raged too hard when I was molested by huge groups of barbs, who often had better weapons then I did, so I turned them off ages ago. I play on emperor.

Karadoc is the only reason I still play this game. +1 Karadoc
 
I just noticed that there is missing game text for one of the BULL options I added in v1.18. :( I didn't want to copy the entire BULL text because it had parts which replaced the default text in ways that I didn't want. So I only copied what I thought I needed. Apparently, I missed something.

It probably isn't a bit enough problem to warrant making a v1.18c; but it's pretty annoying. Sorry.


Regarding the barbarians. I have not made any direct changes to them at all. There might be a couple of minor side effects from my other changes, but I'd say that the barbs in K-Mod are still the same as they've always been.

In my experience, the barbarians often get axemen before I do, but they usually don't cause me any serious problems because they don't start actively hunting cities until much later.

Their existence means that I have to get archery if I don't have copper, and that I have to use my early units to spawn-bust rather than just exploring the whole map. But apart from that, they haven't been a problem for me - and I think they serve a good purpose in forcing a bit of early defence like that. Otherwise, the zero-defence gambit would be the dominant early-game strategy.

The barbarians could probably afford to be weakened a bit and still serve their purpose; but I'm not really in a hurry to do that because as I said, they seem ok to me.

By the way, @Charles555nc, the AI already has special strategies which it sometimes uses to focus on espionage, or to focus on building their economy, or to focus on military. -- And the cultural victory AI knows its more important to put culture in the 3rd highest culture city, compared to the 1st or 2nd. -- So most of the things you suggested are already in the game, to some extent; it's just a matter of adjusting them to be more effective. :)

You're right that the AI currently doesn't use machine-guns to escort its attack stacks; and it probably should; but the reason I've been a bit reluctant to change it that I'm worried the AI might get a bit confused by the fact that the machine-guns can't attack. Machine-guns are good, and I'm worried that the AI will think they are so good that they'll build a whole heap of them and then not actually have enough dudes to attack with. :( ... anyway, that'll probably be fixed one day, but that's why it hasn't been fixed yet.
 
haha I never thought about the machine gun issue from the ai stand point...100 machine guns seems pretty awesome until it comes to attacking cities.

Awhile ago I tried playing with barbs and random events and they always focused on doing evil to me in ridiculous ways....axemen when i dont have metal etc etc and random events like a forced peace treaty between me and a guy im trying to conquer....and then the next turn someone big vassals the person I wanted to conquer...
 
The time, when barbarians start to enter your culture area depends on the difficulty level. On immortal it is something like 2000BC? I think I remember correctly, that some AI changes in BBAI enabled barbs to form 'city-attack' stacks and go directly for cities (Jdog mentioned that in his thread). On continent-like maps where many undiscovered tiles are filled with water this is no problem, because you can fight with some barb killers and fog busting. On huge land maps you will see barbarian stacks composed of swordsmen, axemen and spearmen directly attacking your cities and circumventing defense units on strategic positions. In vanilla they would suicide on some fortified archer instead.

I'm not complaining ;) It is only that the early game shifted to really high unit counts on these maps or a race to the great wall. When I played on huge, highlands with 18 civs three (!) civs were erradicated by barbs before 1000BC. Nice, but perhaps not what you had in mind ;)
 
I see. So by the sounds of things, the barbarians are alright for the maps I tend to play on but they get a bit too strong if there's a lot of spare land.

You're right that BBAI let the barbarians be a little bit more organised in their attack groups, and I haven't changed that because I think it's actually pretty good. They currently behave in a simple way to 'civilized' attack stacks except that the barbarians are far more reckless and less picky. ie. they don't care which city they target, and they will attack with very low chance of success.

I'll see what I can do about making the barbarians a bit more balanced. I haven't looked much at the code yet, so I'm not sure what limitations they already have, but here's what I have in mind:
  • limit the stack size to 3 units.
  • prefer to target a different city with each stack, so that one city doesn't have to face all the barbarians.
  • Have a random chance of a suicide attack even when their stack strength is below the attack threshold.
Do you think those things would fix the problem?

[edit]
Actually, rather than trying to do all that stuff, I'm just going to make a couple of more basic changes. I think the barbarians should be reckless and unpredictable. Randomness and suicide attacks should solve the problem... maybe.
[/edit]


In other news, I've just made a few changes to the 'normalizer' on the map generator. Recently it's be really bugging me that I very frequently start next to a lake which is 1 step away from a river. It seems to happen all the time, and I was sure it must be caused be a bug of some kind. Today, I finally got around to looking into it, and now I think I've fixed it. Here's the story:

As you may know, after the map is generated and player starting positions are chosen, the map is edited to ensure that each starting position has certain things. For example, if there isn't enough food - then extra food is added; and if there is no fresh water at the city site, a river is added; and if the river still doesn't provide fresh water (or if no river can be created) then a lake is added...

The reason the starting positions were very frequently next a lake, one step from a river is that the locations of the bonus rivers and lakes added by the normalizer were not randomised. So whenever a starting position was selected without fresh water, the game would add a river which would almost always miss the city, because it always starts the river on the south-east corner of the starting plot; and then the game would add a lake, which was almost always 1-step north of the city.

I've fixed it by randomising those things. So that the river starts at a random corner, and the lake checks the possible plots in random order rather than in a fixed order.

One of the side effects is that the river will succeed far more often than it use to, because previously it would always fail if you were on the south coast, or the east coast. (I'm thinking of reducing the probability of having a river at all.) But the main point is that the river-lake gap is no longer so common.

There's one more thing (and I suspect more people are going to appreciate this than my river change). Plains-cow is no longer counted as a high food tile for starting positions. It is now treated as having value similar to seafood; which means that plains-cow can no longer be your sole source of food for the starting position. There will always be another source of food. A second plains-cow would count as being ok.
 
limit the stack size to 3 units.
Would this affect random event when a horde of something appears? As far as i remember its 5-6 units in those events. Will that split it or not? If it would those random events would be useless.
I havent played for a while, but barbs had some kind of a tradition to raise my big cities if they would catch them (like 8+ in size). Isnt that a bit odd? I mean i find it odd to destroy big city as that even by normal civs in one turn, but at least u could make barbs make it 1/3 of original size if they decide to raise it (if programmable ofc).
 
Back
Top Bottom