Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
which file this is in? and which line to change?
Sid Meier's Civilization Beyond Earth\assets\DLC\Expansion1\Gameplay\Lua
This line governs the spawn chance when Aliens are somewhat near the ideal ratio:
local spawnChance : number = 10;
And that lines governs the spawn rate when Aliens are far below the ideal ratio:
spawnChance = 20;
Both are X out of 100.
----------------------------------------------------
-- Data
----------------------------------------------------
local UNIT_WOLF_BEETLE = GameInfo.Units["UNIT_ALIEN_WOLF_BEETLE"];
local UNIT_RAPTOR = GameInfo.Units["UNIT_ALIEN_RAPTOR_BUG"];
local UNIT_MANTICORE = GameInfo.Units["UNIT_ALIEN_MANTICORE"];
local UNIT_FLYER = GameInfo.Units["UNIT_ALIEN_FLYER"];
local UNIT_SIEGE_WORM = GameInfo.Units["UNIT_ALIEN_SIEGE_WORM"];
local UNIT_SEA_DRAGON = GameInfo.Units["UNIT_ALIEN_SEA_DRAGON"];
local UNIT_KRAKEN = GameInfo.Units["UNIT_ALIEN_KRAKEN"];
local COLOSSAL_START_TURN = GameDefines["ALIEN_SPAWN_COLOSSAL_START_TURN_MIN"];
-- NOTE: These are normalized tables! Any changes must adjust all weights to add up to 100
local UNIT_SPAWN_TABLE = {
-- NOTE: This must be a table of tables in order for Lua to index them by integer and ensure deterministic iteration (necessary for multiplayer)
[AlienOpinions.ALIEN_OPINION_NEUTRAL] =
{
{ Unit = UNIT_WOLF_BEETLE, PercentChance = 70 },
{ Unit = UNIT_RAPTOR, PercentChance = 5 },
{ Unit = UNIT_FLYER, PercentChance = 10 },
{ Unit = UNIT_MANTICORE, PercentChance = 15 },
},
[AlienOpinions.ALIEN_OPINION_HOSTILE] =
{
{ Unit = UNIT_WOLF_BEETLE, PercentChance = 30 },
{ Unit = UNIT_RAPTOR, PercentChance = 30 },
{ Unit = UNIT_FLYER, PercentChance = 25 },
{ Unit = UNIT_MANTICORE, PercentChance = 15 },
},
[AlienOpinions.ALIEN_OPINION_VERY_HOSTILE] =
{
{ Unit = UNIT_WOLF_BEETLE, PercentChance = 5 },
{ Unit = UNIT_RAPTOR, PercentChance = 45 },
{ Unit = UNIT_FLYER, PercentChance = 35 },
{ Unit = UNIT_MANTICORE, PercentChance = 15 },
},
};
-- Governs how many colossal units are maintained per quantity of normal units alive
local COLOSSAL_LAND_UNIT_RATIOS = {
[AlienOpinions.ALIEN_OPINION_NEUTRAL] = 24,
[AlienOpinions.ALIEN_OPINION_HOSTILE] = 18,
[AlienOpinions.ALIEN_OPINION_VERY_HOSTILE] = 10,
};
-- ===========================================================================
-- Basic Methods
-- ===========================================================================
function OnPlayerOpinionChanged(playerType)
end
-- ===========================================================================
-- NORMAL Unit Methods
-- ===========================================================================
-- Get a land unit to spawn at the given location from the weighted opinion tables
function GetWeightedUnitTypeToSpawn(plotX, plotY)
local nestSite = Map.GetPlot(plotX, plotY);
local globalOpinion = ALIENS.GetGlobalOpinion();
local spawnTable = UNIT_SPAWN_TABLE[globalOpinion];
local chosenUnit = nil;
local roll = Game.Rand(100, "Alien Spawn Unit selection roll");
for i,pair in ipairs(spawnTable) do
--print("SpawnTableEntry: AlienType: " .. pair.Unit.ID .. " PercentChance: " .. pair.PercentChance);
if (roll <= pair.PercentChance) then
--print("Found alien type to spawn. Type: " .. pair.Unit.ID .. " globalOpinion: " .. globalOpinion .. " SpawnTable: " .. tostring(spawnTable));
return pair.Unit.ID;
else
roll = roll - pair.PercentChance;
end
end
-- Something went wrong if there were no units returned
return -1;
end
-- Determine what (if any) normal sea unit to spawn this turn
function TryGetNormalSeaUnitToSpawn()
-- Rules:
-- Normal Sea units are maintained as a ratio of
-- num units to total ocean plots on the map.
local idealRatio = GameDefines.ALIEN_NORMAL_SEA_UNIT_PLOT_RATIO;
local numSeaUnits = ALIENS.GetNumNormalUnits(DomainTypes.DOMAIN_SEA);
local numWaterPlots = Map.GetWaterPlots();
local numLakePlots = Map.GetLakePlots();
local numOceanPlots = numWaterPlots - numLakePlots;
local currentRatio : number = ZeroSafeRatio(numOceanPlots, numSeaUnits);
if (currentRatio > idealRatio) then
-- Reduce chance to spawn (immediately) based on how many sea units have been killed so far
local reduction : number = 100 - Aliens.GetTotalSeaUnitsLost();
local spawnChance : number = math.max(reduction, GameDefines.ALIEN_SEA_UNIT_MIN_SPAWN_CHANCE);
local roll = Game.Rand(100, "Normal Sea Unit spawn chance");
if (roll <= spawnChance) then
-- TODO: account for more than one colossal unit type
return UNIT_SEA_DRAGON.ID;
end
end
return -1;
end
-- ===========================================================================
-- COLOSSAL Unit Methods
-- ===========================================================================
-- AI routine to determine what, if any, colossal unit type to spawn at this time (may return none)
function TryGetColossalUnitToSpawn(eDomain)
local domainInfo = GameInfo.Domains[eDomain];
if eDomain == DomainTypes.DOMAIN_LAND then
return GetColossalLandUnitToSpawn();
elseif eDomain == DomainTypes.DOMAIN_SEA then
return GetColossalSeaUnitToSpawn();
else
error("TryGetColossalUnitToSpawn [Lua]: Unhandled domain type");
end
return -1;
end
-- Determine what (if any) LAND colossal unit to spawn this turn
function GetColossalLandUnitToSpawn()
-- Rules:
-- Colossal Land units are maintained as a sliding ratio of
-- num units to total normal land units active.
-- Gate against colossal units start turn for land units
if (Game.GetGameTurn() < COLOSSAL_START_TURN) then
return -1;
end
local globalOpinion = ALIENS.GetGlobalOpinion();
local idealRatio = COLOSSAL_LAND_UNIT_RATIOS[globalOpinion];
local numNormalUnits = ALIENS.GetNumNormalUnits(DomainTypes.DOMAIN_LAND);
local numColossalUnits = ALIENS.GetNumColossalUnits(DomainTypes.DOMAIN_LAND);
local currentRatio = ZeroSafeRatio(numNormalUnits, numColossalUnits);
if (currentRatio > idealRatio) then
-- TODO: account for more than one colossal unit type
return UNIT_SIEGE_WORM.ID;
end
return -1;
end
-- Determine what (if any) SEA colossal unit to spawn this turn
function GetColossalSeaUnitToSpawn()
-- Rules:
-- Colossal Sea units are maintained as a ratio of
-- num units to total ocean plots on the map.
local idealRatio = GameDefines.ALIEN_COLOSSAL_SEA_UNIT_PLOT_RATIO;
local numColossalUnits = ALIENS.GetNumColossalUnits(DomainTypes.DOMAIN_SEA);
local numWaterPlots = Map.GetWaterPlots();
local numLakePlots = Map.GetLakePlots();
local numOceanPlots = numWaterPlots - numLakePlots;
local currentRatio : number = ZeroSafeRatio(numOceanPlots, numColossalUnits);
if (currentRatio > idealRatio) then
-- Reduce chance to spawn (immediately) based on how many sea units have been killed so far
local reduction : number = 100 - Aliens.GetTotalSeaUnitsLost();
local spawnChance : number = math.max(reduction, GameDefines.ALIEN_SEA_UNIT_MIN_SPAWN_CHANCE);
local roll = Game.Rand(100, "Colossal Sea Unit spawn chance");
if (roll <= spawnChance) then
-- TODO: account for more than one colossal unit type
return UNIT_KRAKEN.ID;
end
end
return -1;
end
Easiest way to increase alien spawn anyway that I can think of is to go to CivBEHandicapInfos.xml and edit the AlienSpawnMod-Line in the table of whatever difficulty you're using. 100% is normal spawn rate, the lower you go, the MORE aliens spawn.