K-Mod: Far Beyond the Sword

I've noticed that AI doesn't care much about spreading his Corps to his permanent ally's cities especially when they're not on the same landmass. I've seen AI spread Corp (Creative Constructions) to all of his cities, to all other cities sharing continent with his cities, but not to any of his permanent ally's cities although almost all of them are on a continent 2 tiles away.
 
At the start of CvSelectionGroupAI::AI_sumStrength (line 566) I see a piece of code that confuses me:

PHP:
	int iBaseCollateral = bCountCollateral
		? iBaseCollateral = estimateCollateralWeight(pAttackedPlot, pAttackedPlot->getTeam() == getTeam() ? NO_TEAM : pAttackedPlot->getTeam())
		: 0;

If I am reading the code correctly if bCountCollateral is true then iBaseCollateral would end up as the return value of the estimateCollateralWeight() function as it all resolves out to:

PHP:
int iBaseCollateral = iBaseCollateral = estimateCollateralWeight(pAttackedPlot, pAttackedPlot->getTeam() == getTeam() ? NO_TEAM : pAttackedPlot->getTeam())

which, given that assignment usually returns a reference to the source object, allowing assignment chaining, is the same as

PHP:
iBaseCollateral = estimateCollateralWeight(pAttackedPlot, pAttackedPlot->getTeam() == getTeam() ? NO_TEAM : pAttackedPlot->getTeam())

If my interpretation of this statement correct wouldn't it be clearer to have the original ternary as

PHP:
	int iBaseCollateral = bCountCollateral
		? estimateCollateralWeight(pAttackedPlot, pAttackedPlot->getTeam() == getTeam() ? NO_TEAM : pAttackedPlot->getTeam())
		: 0;

The only reason I ask is that I want to check that there isn't some subtle difference between the existing code and my 'simplified' version that I am not grasping...which is entirely likely.

I understand that if I am correct the compiler would produce the same output from both statements, so all my simplified version would be is a personal styling change.
 
@Archid, you're right about that code. The extra "iBaseCollateral = " is essentially just a typo. Thankfully it's a typo with no actual effect. :)

(I still haven't looked at some of the other things people have mentioned recently.)
 
Something little I noticed while fooling around with the xml. Even after I allowed CR 2 and 3 to mounted units (so if a unit class started with CR 1, they could take the following ones, unless they upgraded first to some other class). I also made Immortal have city attacking ai, among the normal ones (not the default one, granted). I just wanted to see what would happen.

In game, the AI opponent playing persia seemed to never give his Immortals further raider promotions. +50% vs archery units and withdrawal is a nice boon, so I wonder why: Is it because the AI does not consider promotions that the combattype can't normally access, even if a single class has access to them, does default AI (ATTACK) always trump AI city attack (unlikely), or is there another reason for this behaviour?

PS: I know, that at least one of his enemies could not have anything better than archers, so immortals with CR promotions would have obliterated him.
 
Try setting the default unit AI to City Attack and see if they take the CR line of upgrades then: the units may not switch to their aggressive unit AIs unless at war (from the default of Reserve or whatever).
 
Try setting the default unit AI to City Attack and see if they take the CR line of upgrades then: the units may not switch to their aggressive unit AIs unless at war (from the default of Reserve or whatever).

That might be the case, will make an update on this matter when I have the chance to test it.
 
Just started playing Civ5. The AI is so passive and just sits there twiddling its thumbs while I slowly win the game. I was shocked and dismayed when I saw this...but then I remembered that Civ4 wasn't really any different before I switched to Kmod, it's just that I switched to Kmod in like 2011 and so I forgot what the base game was like. Even after hundreds of hours I still can't reliably win immortal Kmod games, even still lose quite a few emperor kmod games. If only we had someone like Karadoc designing the Civ5 AI...
 
One issue I have with Civ 5 is how much more troublesome it is to set up the modding environment: on top of having to deal with Microsoft Visual Studio's crap & BS (that gets multiplied when you have to have at least 2 versions of it installed in some shape or form), Modbuddy is also stingy about how you do things.

Barrier of entry aside, the civ 5 AI is just as vast (if not more complex.... note that complexity clearly, clearly does not equate to a better production in the end), if not more so than Civ 4's AI. They re-wrote much of the tactical AI to conform to the 1UPT system (and as such, will not perform anywhere near accurately if you modify the maximum number of units per tile from 1 → (2 to ???).

I will argue that the AI is not merely sitting there and twiddling its thumbs however: I will contend that most of the game it is trying to decide how to best screw up while looking like an idiot :D
 
What I want to know is, do the people who make these games even play them? Why did they allow 1 UPT to be implemented? I don't understand how that decision was made, unless the people designing Civ 5 never played any Civ games before it.
 
The number of people who want deep strategy is shrinking compared to the casual player market that hates to think and buys alot of games and forgets them quickly.

Total war series, paradox interactive, civilization series, blizzard games- every game series I used to love is dumbed down, less ways to win, and feature an almost non functional AI.

You go to the forums of these games and ask for a decent AI, and tons of casual players insult you for wanting "skynet".

I find books and movies following the same trend...there is a huge lack of quality entertainment.

Waiting painfully for the next game of thrones book...
 
What I want to know is, do the people who make these games even play them? Why did they allow 1 UPT to be implemented? I don't understand how that decision was made, unless the people designing Civ 5 never played any Civ games before it.

1 UPT is not a bad concept, strictly speaking. The implementation of doing so is just inefficient (although from the Civ4 source code, this appears to be a recurring trend of the quote-on-quote "ENGINEERS" that writes the code for the games), and the AI is not taught well on how to play with it. Add that to what is called "diplomacy" (some the concepts were good, some not-so-good; implementation was horrid) present, and you find yourself working bit by bit porting some of the Civ-4 concepts over again.
 
I don't think 1 UPT is good at all. I've played several different strategy games, the best combat in my opinion was that of Galactic Civ 2. I'll admit that Civ 4's combat annoyed me, because the unit counters made no sense when you had stacks, and then collateral damage just defeats everything. But 1 UPT makes no sense at all.

To be perfectly honest, the stack of doom more accurately represents what happens in warfare in real life. When the Nazis invaded the USSR they did so on 3 fronts, you could say with 3 stacks, they didn't spread out and all march across the entire border in one big carpet of doom.

In Risk you roll dice to determine the outcome of battles, and I'm okay with that and think the game is fun. I don't need to directly manage every single battle in a strategy game. Anyway, Sulla explained it well in his articles. It's a strategy game, you shouldn't be winning battles that you don't deserve to win. Things like the battle of Thermopylae are cool events in history, but representing them in a strategy game would break the game. Imagine if you were playing as Persia in a game of Civ4 and had an army of 200 immortals and 200 archers attack a fortified Greek phalanx on a hill, that's just 1 unit, and lose like half your army. It would break the game, it wouldn't be fun.
 
I never had the problem with stacks of doom that people did with civ IV. The biggest issue is that the entire stack doesn't fight, it's 1v1 battles, which would be super rigged for the defender, except for collateral damage.
That said 1 UPT is a cluster****. The vast majority of people who "prefer" it feel like they're tactical geniuses for putting a melee unit in front of a range unit, and don't care or are oblivious to how it ruins the economy/production/tech/tile yield/improvements balance of the game.
Also I never, ever got how people think stack battles are unrealistic. Pretty much until the 19th century (and really the 20th century) ALL wars were "stack of dooms". It's not as if alexander the great invaded asia on 6 different fronts. You got your army together and you conquered, city by city. Sure there were army formations, but it's not as if these were spread out over more than the area 1 tile represents in the game....
 
Firaxis is just catering more and more to the "Casual" gamer, not much we can do about it (except mod the game heavily :lol:)
 
@drewisfat: You're exactly right, and your point carries on to modern warfare. The Nazis invaded the USSR on 3 fronts, you could say with 3 stacks, and that was an army with millions of soldiers, thousands of tanks, etc. It's not as if they all spread out and marched across the entire border in a "carpet" of doom.

I didn't have a problem with the stacks either. Someone at Firaxis did, though, and it was almost pathological. In Civ 2 the combat was a joke, and you couldn't really stack. In Civ 3 they allowed stacks of doom to exist, and Civ 3 combat was alright, nothing special, but alright. So then in Civ 4, someone designing the game literally had a stroke every time he thought about combat involving stacks of doom, so they invented the concept of collateral damage, which was supposed to bring the end to the stack of doom... but it didn't.

Now, I want you to think about that for a minute: They released Civ 4 with a combat system revolving around powerful siege weaponry doing collateral damage, thinking that it would stop players from using a stack of doom... of course anyone who's played Civ4 knows that the best way to fight is with large stacks. So it makes me wonder, do the game designers actually play the game...like, you know, at least 2 times?? If they had bothered to play the game they would have forseen this.

So then they decided to go with 1 UPT because... you know, stacks of doom give you a stroke, or some crap. I don't understand it. I just started playing Civ 5 now and I'm going to try to appreciate it. I hope to Jeebus that the AI isn't completely useless and knows how to fight reasonably well (I doubt it), but I'm going to try to enjoy the game nonetheless. But seriously... why is it that they just can't stand stacking? Like imagine trying to play Risk without being able to put more than 1 army down per region...
 
Hi. I'm sorry to bother you with this, but at general modding forum we came to the conclusion that my trouble is caused by something with k-mod:

I tried to create a new feature (a Storm), which would spread and disappear among snow and ocean tiles. I was kindly given graphics, and I then followed the normal steps for feature creation:

featureinfos:
Spoiler :
<FeatureInfo>
<Type>FEATURE_STORM</Type>
<Description>Storm</Description>
<Civilopedia>Storm</Civilopedia>
<ArtDefineTag>ART_DEF_FEATURE_STORM</ArtDefineTag>
<YieldChanges/>
<RiverYieldChange/>
<HillsYieldChange/>
<iMovement>2</iMovement>
<iSeeThrough>0</iSeeThrough>
<iHealthPercent>0</iHealthPercent>
<iDefense>0</iDefense>
<iAppearance>2000</iAppearance>
<iDisappearance>1000</iDisappearance>
<iGrowth>1000</iGrowth>
<iTurnDamage>5</iTurnDamage>
<iWarmingDefense>0</iWarmingDefense>
<bNoCoast>0</bNoCoast>
<bNoRiver>0</bNoRiver>
<bNoAdjacent>0</bNoAdjacent>
<bRequiresFlatlands>0</bRequiresFlatlands>
<bRequiresRiver>0</bRequiresRiver>
<bAddsFreshWater>0</bAddsFreshWater>
<bImpassable>0</bImpassable>
<bNoCity>0</bNoCity>
<bNoImprovement>0</bNoImprovement>
<bVisibleAlways>0</bVisibleAlways>
<bNukeImmune>0</bNukeImmune>
<OnUnitChangeTo/>
<TerrainBooleans>
<TerrainBoolean>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrain>1</bTerrain>
</TerrainBoolean>
<TerrainBoolean>
<TerrainType>TERRAIN_SNOW</TerrainType>
<bTerrain>1</bTerrain>
</TerrainBoolean>
</TerrainBooleans>
<FootstepSounds>
<FootstepSound>
<FootstepAudioType>FOOTSTEP_AUDIO_HUMAN</FootstepAudioType>
<FootstepAudioScript>AS3D_UN_FOOT_UNIT_SNOW</FootstepAudioScript>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>FOOTSTEP_AUDIO_HUMAN_LOW</FootstepAudioType>
<FootstepAudioScript>AS3D_UN_FOOT_UNIT_LOW_SNOW</FootstepAudioScript>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>FOOTSTEP_AUDIO_ANIMAL</FootstepAudioType>
<FootstepAudioScript>AS3D_UN_ANIMAL_FOOT_LARGE_SNOW</FootstepAudioScript>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>FOOTSTEP_AUDIO_ANIMAL_LOW</FootstepAudioType>
<FootstepAudioScript>AS3D_UN_ANIMAL_FOOT_LARGE_LOW_SNOW</FootstepAudioScript>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>FOOTSTEP_AUDIO_HORSE</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_WHEELS</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_WHEELS</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_WHEELS_2</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_WHEELS_2</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_TANK</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_TANK</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_MOD_ARMOUR</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_MOD_ARMOUR</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_ARTILLERY</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_ARTILLERY</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>LOOPSTEP_WHEELS_3</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
<FootstepSound>
<FootstepAudioType>ENDSTEP_WHEELS_3</FootstepAudioType>
<FootstepAudioScript/>
</FootstepSound>
</FootstepSounds>
<EffectType>NONE</EffectType>
<iEffectProbability>0</iEffectProbability>
<iAdvancedStartRemoveCost>0</iAdvancedStartRemoveCost>
</FeatureInfo>

and artdefines_feature:
Spoiler :
<FeatureArtInfo>
<Type>ART_DEF_FEATURE_STORM</Type>
<bAnimated>0</bAnimated>
<bRiverArt>0</bRiverArt>
<TileArtType>TILE_ART_TYPE_NONE</TileArtType>
<LightType>LIGHT_TYPE_SUN</LightType>
<fScale>0.01</fScale>
<fInterfaceScale>0.01</fInterfaceScale>
<Button>,Art/Interface/Buttons/TerrainFeatures/Fallout.dds,Art/Interface/Buttons/BaseTerrain_TerrainFeatures_Atlas.dds,1,3</Button>
<FeatureVariety>
<FeatureArtPieces>
<FeatureArtPiece>
<ModelFile>Art/Terrain/Features/rain.nif</ModelFile>
<Connections></Connections>
</FeatureArtPiece>
</FeatureArtPieces>
<FeatureDummyNodes/>
<bGenerateRotations>0</bGenerateRotations>
<VarietyButton>Art/Interface/Buttons/TerrainFeatures/Fallout.dds</VarietyButton>
</FeatureVariety>
</FeatureArtInfo>

The feature appears ingame and civilopedia, BUT if I try to access Worldbuilder, the game freezes permanently, never actually getting there. Others claim they were capable of using the feature, so I must ask: Is there some code in k-mod that reacts poorly to attempts to add Terrain Features (warmingdefence mayhaps)? Or am I a complete buffoon not seeing the obvious fault in there somewhere?
The feature art is is quick modding questions thread, unfortunately the site dislikes repeated attaching apparently.
 
@Blitzconfusion

I just added that xml to test it. I changed rain.nif and the feature atlas to something else, because I don't have those file (you could have added a link to them in your post). With just that xml, I was able to see the feature in the civiliopedia, and I was able to add the feature with the world builder. I tested the damage-per-turn, and that worked too. There were no freezes, and no other problems.

You've said that others claim they can use the feature, and so you think your problems might be due to K-Mod. But you did you try it without K-Mod?

I tested this as soon as I saw your post because it's entirely possible for K-Mod to have that kind of problem, and the stability of K-Mod is paramount. But I can't think of any reason why K-Mod would break that kind of thing, and from my brief testing it seems to work anyway.

As it currently stands, I don't think this is a K-Mod problem. If you still think think it is a K-Mod issue, please create a test that definitely works as just a simple mod without K-Mod, and definitely does not work with K-mod.
 
You've said that others claim they can use the feature, and so you think your problems might be due to K-Mod. But you did you try it without K-Mod?

@Karadoc
I had a look at this when it was posted in the Quick Modding Questions thread. The art files are provided there and I did a test in an empty mod against the OOB BTS code and it worked fine. I was able to play multiple rounds and go into the WB and add the feature successfully to the map. Given that the FeatureInfo had the <iWarmingDefense>0</iWarmingDefense> tags I knew that there was a custom DLL involved and suggested that Blitzconfusion looked there next as a possible issue.

Given that I inadvertently pointed this in your direction I thought I had better do a check myself and I can also confirm that I have no issues adding the original files into a K-Mod dll based mod.

@Blitzconfusion
I have another thing you can check which I will add back in the original thread, given that it looks like this is not K-Mod related after all ... we are all assuming that you have not customised / recompiled the K-Mod dll of course
 
@Blitzconfusion
I have another thing you can check which I will add back in the original thread, given that it looks like this is not K-Mod related after all ... we are all assuming that you have not customised / recompiled the K-Mod dll of course

I do not even have the tools for recompiling. It appears I have located the problem. Worldbuilder works on smaller mapsizes (yes, I know, should have tried that one before), so it appears that the rain particles just take too much recourses on bigger map sizes. I guess I'm off to beg the kind artist to scale the rain back, so that the amount of Storm particles on the map does not kill the computer. Sorry for wasting your time, everybody. Should have tried hardware limits before. Especially: sorry karadoc, false alarm.
 
Back
Top Bottom