Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

Barbarians #220

Closed stackpoint closed 10 years ago

stackpoint commented 10 years ago

Topic: Barbarians spawn a little too frequently and pirates a little too early

Relevant Links: http://forums.civfanatics.com/showthread.php?p=10913667#post10913667 and http://forums.civfanatics.com/showthread.php?t=516185

I'll field any questions about the variables.

stackpoint commented 10 years ago

Barbarian Camp Density:

CEB_Data.xml:

stackpoint commented 10 years ago

Here's the source code for BARBARIAN_CAMP_COASTAL_SPAWN_ROLL:

bool bWantsCoastal = kGame.getJonRandNum(/*6*/ GC.getBARBARIAN_CAMP_COASTAL_SPAWN_ROLL(), "Barb Camp Plot-Finding Roll - Coastal Bias 1") == 0 ? true : false;
//other code
if(pLoopPlot->isCoastalLand() || !bWantsCoastal){
//sets barb camp

This basically states that if the tile is coastal then it will be chosen as the camp location and if it's an inland tile instead then it has a 1 - 1 / N chance of being chosen. Basically to skew the chances towards coastal camps by a slight percentage.

GrantSP commented 10 years ago

Now that you mention it, I do sort of recall a discussion about the BARBARIAN_CAMP_ODDS_OF_NEW_CAMP_SPAWNING and how to read the values used in these variables.

I started looking at the Barbarians again because, it may be just a coincidence, but since the pre-release the rate at which they appear seems to have shot through the roof again.

My first testing game the other day I came upon a coastal barb camp with 2 'brutes' & 3 'pirates' and it was only on turn 4!!! Every game so far the number of naval barbarian units seems to far too excessive. Even civs with starting naval units will have to fight long and hard to wrest control of the seas back from them.

GrantSP commented 10 years ago

The land unit rate can more easily be handled, though it too could be toned back a bit. I'm not actually sure there is a problem with barbarians on land, the naval units though a tricky to deal with. Add to that they get 'Galleass' class units and the mid-game can be a struggle.

GrantSP commented 10 years ago

One of the commenters in those posts made, what I think is a good point, that if Barbarian naval units are ONLY melee then that may ease the struggle.

stackpoint commented 10 years ago

What variable handles unit spawning? I don't remember seeing anything regarding land units.

stackpoint commented 10 years ago

Naval units shouldn't be appearing on turn 4.

GrantSP commented 10 years ago

Don't know what the code is for that. BARBARIAN_EXTRA_RAGING_UNIT_SPAWN_CHANCE looks most likely but we haven't adjusted it from vanilla. Agreed about the naval units, I think they aren't supposed to appear until turn 15?

Admittedly this was a once off, I haven't since seen this in the handful of tests since. Possibly an error due to uncleared cache or maybe I had a small mod loaded that I didn't remember. But! subsequent games do look to have more barbs about.

On a related note, the settings AI_TACTICALBARBARIAN* in defines look to handle how the AI deals with barbarians and this one: AI_TACTICAL_BARBARIAN_PRIORITY_ESCORT_CIVILIAN is set at 30 in vanilla and only 10 in CEP. Perhaps that is why so many AI settlers and workers get captured?

GrantSP commented 10 years ago

I'm wondering, if I use FireTuner and give myself all the Techs for a certain era would that then trigger the increase of barbarian activity? That is what I was doing. Testing something that needed an advanced tech to get. So even though it is early based on the number of turns, the game checks the tech of the player and assigns them that way also.

stackpoint commented 10 years ago

I believe BARBARIAN_EXTRA_RAGING_UNIT_SPAWN_CHANCE would affect raging barbarian spawn rate.

The type of units that barbarians get depend on BARBARIAN_TECH_PERCENT and how many civs have that the tech.

GrantSP commented 10 years ago

So BARBARIAN_TECH_PERCENT would only affect the type of unit, not the number of them?! Could be just a rare experience I saw. Not too many, if any, on the forum are mentioning this. You haven't seen it?

stackpoint commented 10 years ago

Yes, class not number of units. I haven't had a chance to the new-feature due to time constraints. It's likely that due my recent fix to the Worlds table that FogTilesPerBarbarianCamp was affected. It wouldn't affect why you were getting naval units early.

GrantSP commented 10 years ago

Ahh having a look at that table and comparing it to vanilla shows a marked difference.

Vanilla scales from 13 to 35 for Tiny to Huge worlds and CEP scales from 3 to 9

stackpoint commented 10 years ago

The code in CEB_End.sql:

UPDATE Worlds SET FogTilesPerBarbarianCamp = ROUND(FogTilesPerBarbarianCamp * 0.25, 0);
stackpoint commented 10 years ago

See my suggestions above: https://github.com/Thalassicus/cep-bnw/issues/220#issuecomment-37814258

Thalassicus commented 10 years ago

These values were very carefully tuned over several years of discussions to solve several problems:

Most importantly, as camps are cleared from civilized land, they eventually all reappear in remote inaccessible regions. This absence of camps near players makes barbarian-associated policies and leader abilities useless very quickly, even when there's still lots of open undeveloped land. I'm not sure exactly what value solves the problem, but I found anything below 25% seems to work, and the exact number below that doesn't seem to matter. This is a problem I absolutely don't want to re-introduce.

I'm more flexible about balancing the preferences of two groups of people. One group likes a tough early game, while the other group prefers safety. I found a compromise years ago by blocking barbarians from friendly territory until turn 80 (on prince difficulty), while increasing the strength of barbarians in uncivilized territory (with movement bonuses, arches shooting outside camps, and slow healing within camps).

In other words, our land is invulnerable from barb pillaging for the first 80 turns of a Prince game. Even if we don't clear camps, we only need about 1-2 more military units to escort our settler through neutral territory than in the unmodded game.

Some feedback I read on this topic describes barbs one-shotting their units and overruning their territory right away. I suspect this is exaggeration. Barbs can't enter territory in the early game, and I don't think a barbarian warrior can kill a human warrior in 1 attack (except in very extreme and unusual circumstances). These players might be playing on higher difficulty levels. I always recommend everyone start playing the project 1 level lower than they're used to. In particular, Deity in this project is much more challenging than unmodded Deity, but it can be a shock for newcomers used to an easy max difficulty.

Higher barbarian ship spawn rates make our land territory safer. You increased the number of land barbs that spawn from coastal camps, which makes it tougher to defend our territory. I think your goal was to make barbs easier, not harder? The lower land spawn rate helps balance land and sea trade routes too, by making seas more dangerous and land safer. This and other changes lessen the problem where most people used to build only 0-3 land trade routes.

If we change the hazard-vs-safety balance, one group of people or the other will get upset. It might lead to restarting the barbarian balance discussion all over again. I already spent hundreds of time going around and around with this over the years. I concluded there's no perfect solution that will satisfy everyone, and I figure I finally balanced it last cycle when I saw an equal amount of feedback from both the safety and hazard groups.

I'm very reluctant to change this and start the whole discussion over again. I feel there's more important priorities. However... if we think it's really necessary, we can shift things in favor of safety by further expanding the land-invulnerability time on low difficulty levels.

This is the EarliestBarbarianReleaseTurn value in the HandicapInfos table. It ranges from 100 turns (pre-prince) to 20 turns (deity). We should probably keep the deity side of things challenging, so we can increase the early levels.

One thing I'd be very open to is adding a modifier for the invulnerability time in CEG_Options. This might help satisfy both groups. I'll do that now. :thumbsup: