Sid Meier's Civilization: Beyond Earth

Sid Meier's Civilization: Beyond Earth

Experience Worlds Beyond Earth
Game modifications, scenarios, interface, and so much more. Explore the modding world of Beyond Earth, and when you're ready, download the SDK to create and upload your own.
Strrog 30 Jul, 2018 @ 6:22pm
modding alien agression and numbers
Hey gyus which file i can play with where i can edit number of nests, spaw and respawn rate, also alien spawn rate and numbers, larger horders and more agressive.


ok found aliens.lua file and game info, but canot find line where i can buff alien spawn chanse from defaul to like 4-5 times any ideas where its at if at all?
Last edited by Strrog; 30 Jul, 2018 @ 6:31pm
< >
Showing 1-10 of 10 comments
Ryika 42 30 Jul, 2018 @ 6:46pm 
-- Spawn chance base is 10%, 20% if the ratio is greater than 2 local spawnChance : number = 10; local ratioRatio : number = ZeroSafeRatio(currentRatio, idealRatio); if (ratioRatio > 2) then spawnChance = 20; end local chance : number = Game.Rand(100, "TryGetNormalUnitToSpawn: spawn chance"); if (chance <= spawnChance) then local roll : number = Game.Rand(100, "TryGetNormalUnitToSpawn: selection roll"); for i : number, pair : table in ipairs(spawnTable) do if (roll <= pair.PercentChance) then return pair.Unit.ID; else roll = roll - pair.PercentChance; end end else
Last edited by Ryika; 30 Jul, 2018 @ 6:47pm
Strrog 30 Jul, 2018 @ 7:36pm 
Originally posted by Ryika:
-- Spawn chance base is 10%, 20% if the ratio is greater than 2 local spawnChance : number = 10; local ratioRatio : number = ZeroSafeRatio(currentRatio, idealRatio); if (ratioRatio > 2) then spawnChance = 20; end local chance : number = Game.Rand(100, "TryGetNormalUnitToSpawn: spawn chance"); if (chance <= spawnChance) then local roll : number = Game.Rand(100, "TryGetNormalUnitToSpawn: selection roll"); for i : number, pair : table in ipairs(spawnTable) do if (roll <= pair.PercentChance) then return pair.Unit.ID; else roll = roll - pair.PercentChance; end end else

which file this is in? and which line to change?
Last edited by Strrog; 30 Jul, 2018 @ 7:41pm
Ryika 42 30 Jul, 2018 @ 7:46pm 
aliens.lua - the one for Rising Tide which can be found here:

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.
Strrog 30 Jul, 2018 @ 7:48pm 
i am not sure i see spawn chanse line at all with number in it...
Strrog 30 Jul, 2018 @ 7:49pm 
include( "MathHelpers" );

----------------------------------------------------
-- 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
Strrog 30 Jul, 2018 @ 7:49pm 
PS i have standard beyond earth i did not like the expac
Ryika 42 30 Jul, 2018 @ 7:58pm 
Looks like the spawning trigger for Land Aliens was managed by the game core before Rising Tide, which isn't available for modding.

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.
Last edited by Ryika; 30 Jul, 2018 @ 7:58pm
Strrog 30 Jul, 2018 @ 8:05pm 
ye will play with that line , also you know what alien energy is? after destroit or something else?
Ryika 42 30 Jul, 2018 @ 8:08pm 
You mean AlienNestEnergy? That's the amount of Energy you get when you destroy a nest.
Strrog 30 Jul, 2018 @ 8:40pm 
oki ty
< >
Showing 1-10 of 10 comments
Per page: 1530 50