[DLL] (9-NS) Limit how many barbs each camp can have out at once

Status
Not open for further replies.

L. Vern

Warlord
Joined
Sep 5, 2022
Messages
181
Location
Ontario, Canada
Proposal
The maximum number of barbarian units on the map (simultaneously) spawned by each camp is now limited by 1 + ⌊Era / 3⌋ + :c5food: Of Plot Camp is On (⌊x⌋ being floor operator)

Ex.
  • Camp on tundra (1 :c5food:) in Classical (1) : 1 + ⌊1 / 3⌋ + 1 = 2 units
  • Camp on grassland jungle (3 :c5food:) in Medieval (3): 1 + ⌊3 / 3⌋ + 3 = 5 units
  • Camp on Snow (0 :c5food:) in Atomic (7) : 1 + ⌊7 / 3⌋ + 0 = 3 units

Motivation
  • We've all seen the ridiculous swarms of barbarians, especially in polar regions where no civ is nearby to clear them. Looks kind of silly and unrealistic to have literal hoardes surviving on nothing but ice, and has gameplay implications that (I think) are quite unfun
  • The formula and numbers were chosen to be intuitive and easy to understand and scaled such that it allows for fairly challenging spawns based on where it spawns but puts realistic limits on how many fighters low resource regions can support
  • Will decrease memory requirements (hopefully reducing lategame ctds) and speed up turn processing times
  • Works in tandem with other proposals recently proposed about increasing the early game supply limit: with slightly fewer barbs to worry about, less units will be needed
 
Last edited:
I think the only problem with this proposal is that if, and only if you know about camps having a spawn limit... There isn't really a good reason to clear the camp afterwards? If you're not authority, it's better to leave the 50 gold and just not have to deal with barb spawns from a certain location if you know it's not gonna spawn anymore.

Unless I'm misunderstanding this proposal. Is the limit like "How many absolute units can this camp spawn" or is it "How many units associated with this camp can be on the map at the same time."
 
I think the only problem with this proposal is that if, and only if you know about camps having a spawn limit... There isn't really a good reason to clear the camp afterwards? If you're not authority, it's better to leave the 50 gold and just not have to deal with barb spawns from a certain location if you know it's not gonna spawn anymore.

Unless I'm misunderstanding this proposal. Is the limit like "How many absolute units can this camp spawn" or is it "How many units associated with this camp can be on the map at the same time."
yea to be clear this is just for the max potential out at once, if you kill the units they will keep spawning as before. I've updated the title and wording of the proposal to be a bit more unambiguous
 
Just as a note for reference, there is already a preexisting spawn limit: excluding the unit defending the encampment, the game counts the number of Barbarian combat units within 4 tiles of the encampment, and if two or more are already present, it won't spawn another one. This only applies to the area around the encampment, however, so if the units keep moving away it can still produce enough to swarm an undefended region.

This limit is 4 (still within 4 tiles) for the free units spawned from Barbarian cities (but not trained units).

How will your proposal interact with this?

edit: I also think you should exclude the unit defending the camp from this, otherwise encampments on Snow/Desert/Hills will never pose any threat to the area in the early game.
 
Last edited:
this might be better addressed by reworking the way barbarian camps spawn? and/or giving them some kind of lifecycle?

eg. a barb unit gets a timed promo on creation -- if this timer promo wears off, they despawn -- any combat or pillaging, or maybe even just moving through owned territory, re-applies a fresh timer promo.

on the camp side, i've always imagined a camp should be built somehow, and proliferate in a more natural way, not just appear randomly -- built by barb civilian of some kind etc.
 
on the camp side, i've always imagined a camp should be built somehow, and proliferate in a more natural way, not just appear randomly -- built by barb civilian of some kind etc.
That's essentially equal to having barb camps not spawn in sight range. No reason why one wouldn't just rush down the barb civilian or a partially completed camp when spotted.
 
Is this worth the hit to memory consumption?
Assuming this results in fewer Barbarians, having less active units in memory will outweigh the cost of adding camp coordinates to all units (probably about 4 bytes per unit plus overhead if we do it by plot ID).
 
On a realated note: is there a cap of only 1 "Clear Barbarian camp" quest allowed to be given at a time by City-States? Wouldn't mind that increased, because sometimes a far-away CS gives this quest for a far-away camp, and no one is clearing it for all eternity, while camps spawn non-stop in my backyard.
 
On a realated note: is there a cap of only 1 "Clear Barbarian camp" quest allowed to be given at a time by City-States? Wouldn't mind that increased, because sometimes a far-away CS gives this quest for a far-away camp, and no one is clearing it for all eternity, while camps spawn non-stop in my backyard.
Code:
        // Only one map-specific quest per minor for now. Keeps the tap icons clear.
        // Global quests ignore the limit, but still block new personal quests.
        if (IsPersonalQuest(eQuest) && PlayerHasTarget(ePlayer, eQuest))
        {
            return false;
        }
There's a limit of one "tap to go to this part of the map" personal quest per City-State per player.
 
Status
Not open for further replies.
Back
Top Bottom