Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barbarians #220

Closed
stackpoint opened this issue Mar 17, 2014 · 16 comments
Closed

Barbarians #220

stackpoint opened this issue Mar 17, 2014 · 16 comments
Labels
Milestone

Comments

@stackpoint
Copy link
Contributor

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
Copy link
Contributor Author

Barbarian Camp Density:

  • Worlds.FogTilesPerBarbarianCamp
    • CEP sets this at 0.25 of their vanilla values, we can try 0.75 instead
  • Defines.BARBARIAN_CAMP_MINIMUM_DISTANCE_ANOTHER_CAMP
    • CEP sets this at 6 vs 7 vanilla, I think this is alright

CEB_Data.xml:

  • BARBARIAN_CAMP_ODDS_OF_NEW_CAMP_SPAWNING
    • CEP sets this at 100 (99%) vs 2 (50%), we can try 4 (75%) instead
  • BARBARIAN_TECH_PERCENT
    • CEP leaves this unchanged at 75(%), we can try 40(%) instead (same as city-states)
  • BARBARIAN_CAMP_COASTAL_SPAWN_ROLL
    • See below.
  • BARBARIAN_NAVAL_UNIT_START_TURN_SPAWN
    • CEP sets this at (turn) 15 vs 30 vanilla, not sure what this should be set at. Even the vanilla 30 turns seems a little short.

@stackpoint
Copy link
Contributor Author

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
Copy link
Collaborator

GrantSP commented Mar 17, 2014

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
Copy link
Collaborator

GrantSP commented Mar 17, 2014

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
Copy link
Collaborator

GrantSP commented Mar 17, 2014

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
Copy link
Contributor Author

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

@stackpoint
Copy link
Contributor Author

Naval units shouldn't be appearing on turn 4.

@GrantSP
Copy link
Collaborator

GrantSP commented Mar 17, 2014

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_TACTICAL_BARBARIAN_* 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
Copy link
Collaborator

GrantSP commented Mar 17, 2014

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
Copy link
Contributor Author

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
Copy link
Collaborator

GrantSP commented Mar 18, 2014

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
Copy link
Contributor Author

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
Copy link
Collaborator

GrantSP commented Mar 18, 2014

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
Copy link
Contributor Author

The code in CEB_End.sql:

UPDATE Worlds SET FogTilesPerBarbarianCamp = ROUND(FogTilesPerBarbarianCamp * 0.25, 0);

@stackpoint
Copy link
Contributor Author

See my suggestions above: #220 (comment)

stackpoint added a commit that referenced this issue Mar 19, 2014
@stackpoint stackpoint assigned stackpoint and unassigned GrantSP Mar 21, 2014
@Thalassicus Thalassicus added this to the v3.15 milestone Mar 29, 2014
@stackpoint stackpoint removed their assignment Apr 1, 2014
@Thalassicus
Copy link
Owner

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

  • Barbarian-related abilities and policies should be useful.
  • Balance the desires of people who like safety or danger.
  • Encourage more land trade.

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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants