1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-01 13:08:05 +02:00

Balancing

Changes:
- Disabled ever increasing productivity bonus from labs.
- Reduced base damage of flamethrowers by 10%.
- Slightly increased amount of ore in late game.
- Significantly reduced ore amount in radioactive island, but now the amount scales with leagues.
- Increased the minimum amount of ore gained from mining rocks in Mysterious Caves island. In addition minimum amount of ore gained there now scales with leagues.
- Increased requirements for Mysterious Caves island quests.
- Amount of resources gained from mining trees/rocks now scales with leagues.
- Biter boat spawner health now scales with leagues.
- Decreased kraken health scaling from player count.
This commit is contained in:
Piratux 2023-01-29 23:01:48 +02:00
parent 17014c0f3a
commit d8b2fd982b
12 changed files with 81 additions and 75 deletions

View File

@ -797,7 +797,7 @@ local function event_on_player_mined_entity(event)
local baseamount = 4
--minimum 1 wood
local amount = Math.clamp(1, Math.max(1, Math.ceil(available)), Math.ceil(baseamount * available/starting))
local amount = Math.clamp(1, Math.max(1, Math.ceil(available)), Math.ceil(baseamount * Balance.island_richness_avg_multiplier() * available/starting))
destination.dynamic_data.wood_remaining = destination.dynamic_data.wood_remaining - amount
@ -970,9 +970,9 @@ local function event_on_player_mined_entity(event)
for k, v in pairs(c) do
if k == 'coal' and #c2 <= 1 then --if oil, then no coal
c2[#c2 + 1] = {name = k, count = v, color = CoreData.colors.coal}
c2[#c2 + 1] = {name = k, count = Math.ceil(v * Balance.island_richness_avg_multiplier()), color = CoreData.colors.coal}
elseif k == 'stone' then
c2[#c2 + 1] = {name = k, count = v, color = CoreData.colors.stone}
c2[#c2 + 1] = {name = k, count = Math.ceil(v * Balance.island_richness_avg_multiplier()), color = CoreData.colors.stone}
end
end
Common.give(player, c2, entity.position)
@ -1287,7 +1287,7 @@ local function event_on_research_finished(event)
end
Public.apply_flamer_nerfs()
Public.research_apply_buffs(event) -- this is broken right now
-- Public.research_apply_buffs(event) -- this is broken right now
for _, e in ipairs(research.effects) do
local t = e.type

View File

@ -308,7 +308,7 @@ function Public.periodic_free_resources(tickinterval)
local boat = memory.boat
if not (destination and destination.type == Surfaces.enum.ISLAND and boat and boat.surface_name == destination.surface_name) then return end
Common.give_items_to_crew(Balance.periodic_free_resources_per_destination_5_seconds())
-- Common.give_items_to_crew(Balance.periodic_free_resources_per_destination_5_seconds())
if game.tick % (300*30) == 0 and (destination and destination.subtype == IslandEnum.enum.RADIOACTIVE) then -- every 150 seconds
local count = 2

View File

@ -49,16 +49,12 @@ Public.iron_leg_damage_taken_multiplier = 0.24
Public.iron_leg_iron_ore_required = 3000
Public.deckhand_extra_speed = 1.25
Public.deckhand_ore_grant_multiplier = 5
Public.deckhand_ore_scaling_enabled = false
Public.boatswain_extra_speed = 1.25
Public.boatswain_ore_grant_multiplier = 8
Public.boatswain_ore_scaling_enabled = false
Public.shoresman_extra_speed = 1.1
Public.shoresman_ore_grant_multiplier = 5
Public.shoresman_ore_scaling_enabled = false
Public.quartermaster_range = 19
Public.quartermaster_bonus_physical_damage = 1.3
Public.quartermaster_ore_scaling_enabled = false
Public.scout_extra_speed = 1.3
Public.scout_damage_taken_multiplier = 1.25
Public.scout_damage_dealt_multiplier = 0.6
@ -113,6 +109,7 @@ function Public.cost_to_leave_multiplier()
return Math.sloped(Common.difficulty_scale(), 0.5)
end
-- Avoid using e >= 1/4 in calculations "crew_scale()^(e)" to strictly avoid situations where people want to have less people in the crew
function Public.crew_scale()
local ret = Common.activecrewcount()/10
if ret == 0 then ret = 1/10 end --if all players are afk
@ -274,7 +271,7 @@ function Public.boat_passive_pollution_per_minute(time)
end
return boost * (
2.60 * (Common.difficulty_scale()^(0.8)) * (Common.overworldx()/40)^(1.8) * (Public.crew_scale())^(52/100)-- There is no _explicit_ T dependence, but it depends almost the same way on the crew_scale as T does.
2 * (Common.difficulty_scale()^(0.8)) * (Common.overworldx()/40)^(1.8) * (Public.crew_scale())^(1/5)-- There is no _explicit_ T dependence, but it depends almost the same way on the crew_scale as T does.
)
end
@ -383,27 +380,23 @@ function Public.biter_timeofday_bonus_damage(darkness) -- a surface having min_b
end
function Public.periodic_free_resources_per_x()
return {
}
-- return {
-- {name = 'iron-plate', count = Math.ceil(5 * (Common.overworldx()/40)^(2/3))},
-- {name = 'copper-plate', count = Math.ceil(1 * (Common.overworldx()/40)^(2/3))},
-- }
end
-- function Public.periodic_free_resources_per_x()
-- return {
-- }
-- -- return {
-- -- {name = 'iron-plate', count = Math.ceil(5 * (Common.overworldx()/40)^(2/3))},
-- -- {name = 'copper-plate', count = Math.ceil(1 * (Common.overworldx()/40)^(2/3))},
-- -- }
-- end
function Public.periodic_free_resources_per_destination_5_seconds()
return {
}
-- return {
-- {name = 'iron-ore', count = Math.ceil(7 * (Common.overworldx()/40)^(0.6))},
-- {name = 'copper-ore', count = Math.ceil(3 * (Common.overworldx()/40)^(0.6))},
-- }
end
function Public.class_resource_scale()
return 1 / (Public.crew_scale()^(2/5)) --already helped by longer timescales
end
-- function Public.periodic_free_resources_per_destination_5_seconds()
-- return {
-- }
-- -- return {
-- -- {name = 'iron-ore', count = Math.ceil(7 * (Common.overworldx()/40)^(0.6))},
-- -- {name = 'copper-ore', count = Math.ceil(3 * (Common.overworldx()/40)^(0.6))},
-- -- }
-- end
function Public.biter_base_density_scale()
local p = Public.crew_scale()
@ -426,7 +419,7 @@ end
function Public.island_richness_avg_multiplier()
local base = 0.73
local additional = 0.120 * Math.clamp(0, 7, (Common.overworldx()/40)^(65/100) * Math.sloped(Public.crew_scale(), 1/40)) --tuned tbh
local additional = 0.120 * Math.clamp(0, 10, (Common.overworldx()/40)^(65/100) * Math.sloped(Public.crew_scale(), 1/40)) --tuned tbh
-- now clamped, because it takes way too long to mine that many more resources
@ -452,7 +445,10 @@ function Public.quest_market_entry_price_scale()
-- x = 200 (5th island): 0.582
-- x = 600 (15th island): 0.992
-- x = 1000 (25th island): 1.401
return (1 + 0.05 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
-- return (1 + 0.05 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
return (1 + 0.05 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/4)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
end
function Public.quest_furnace_entry_price_scale()
@ -468,12 +464,14 @@ function Public.quest_furnace_entry_price_scale()
-- x = 200 (5th island): 0.517
-- x = 600 (15th island): 0.762
-- x = 1000 (25th island): 1.008
return (1 + 0.03 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
-- return (1 + 0.03 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/3)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
return (1 + 0.03 * (Common.overworldx()/40 - 1)) * ((1 + Public.crew_scale())^(1/4)) * Math.sloped(Common.difficulty_scale(), 1/2) - 0.4
end
function Public.apply_crew_buffs_per_league(force, leagues_travelled)
force.laboratory_productivity_bonus = force.laboratory_productivity_bonus + Math.max(0, 7/100 * leagues_travelled/40)
end
-- function Public.apply_crew_buffs_per_league(force, leagues_travelled)
-- force.laboratory_productivity_bonus = force.laboratory_productivity_bonus + Math.max(0, 7/100 * leagues_travelled/40)
-- end
function Public.class_cost(at_dock)
if at_dock then
@ -523,8 +521,10 @@ function Public.kraken_kill_reward_fuel()
end
function Public.kraken_health()
return Math.ceil(3500 * Math.max(1, 1 + 0.075 * (Common.overworldx()/40)^(13/10)) * (Public.crew_scale()^(4/8)) * Math.sloped(Common.difficulty_scale(), 3/4))
-- return Math.ceil(3500 * Math.max(1, 1 + 0.075 * (Common.overworldx()/40)^(13/10)) * (Public.crew_scale()^(4/8)) * Math.sloped(Common.difficulty_scale(), 3/4))
-- return Math.ceil(3500 * Math.max(1, 1 + 0.08 * ((Common.overworldx()/40)^(13/10)-6)) * (Public.crew_scale()^(5/8)) * Math.sloped(Common.difficulty_scale(), 3/4))
return Math.ceil(2000 * Math.max(1, 1 + 0.075 * (Common.overworldx()/40)^(13/10)) * (Public.crew_scale()^(1/5)) * Math.sloped(Common.difficulty_scale(), 3/4))
end
Public.kraken_regen_scale = 0.1 --starting off low
@ -557,6 +557,9 @@ function Public.krakens_per_free_slot(overworldx)
end
end
function Public.biter_boat_health()
return Math.ceil(800 * Math.max(1, 1 + 0.075 * (Common.overworldx()/40)^(13/10)) * (Public.crew_scale()^(1/5)) * Math.sloped(Common.difficulty_scale(), 3/4))
end
function Public.main_shop_cost_multiplier()
return 1
@ -593,7 +596,7 @@ function Public.flamers_tech_multipliers()
end
function Public.flamers_base_nerf()
return -0.2
return -0.3
end

View File

@ -1,6 +1,6 @@
-- This file is part of thesixthroc's Pirate Ship softmod, licensed under GPLv3 and stored at https://github.com/danielmartin0/ComfyFactorio-Pirates.
-- local Balance = require 'maps.pirates.balance'
local Balance = require 'maps.pirates.balance'
-- local Memory = require 'maps.pirates.memory'
local Math = require 'maps.pirates.math'
local Raffle = require 'maps.pirates.raffle'
@ -55,7 +55,7 @@ function Public.try_give_ore(player, realp, source_name)
coin_amount = coin_amount * 2
end
given_amount = Math.max(2, given_amount)
given_amount = Math.max(4 * Balance.island_richness_avg_multiplier(), given_amount)
local to_give = {}
to_give[#to_give+1] = {name = choice, count = Math.ceil(given_amount)}

View File

@ -332,7 +332,8 @@ function Public.generate_overworld_destination(p)
local rng = 0.5 + 1 * Math.random()
static_params.starting_treasure_maps = Math.ceil((static_params.base_starting_treasure_maps or 0) * rng)
static_params.starting_wood = Math.ceil(static_params.base_starting_wood or 1000)
static_params.starting_wood = static_params.base_starting_wood or 1000
static_params.starting_wood = Math.ceil(static_params.starting_wood * Balance.island_richness_avg_multiplier())
static_params.starting_rock_material = Math.ceil(static_params.base_starting_rock_material or 300) * Balance.island_richness_avg_multiplier()
rng = 0.5 + 1 * Math.random()
@ -673,11 +674,12 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves
-- end
-- other freebies:
for i=1,vector.x do
Common.give_items_to_crew(Balance.periodic_free_resources_per_x())
end
-- for i=1,vector.x do
-- Common.give_items_to_crew(Balance.periodic_free_resources_per_x())
-- end
Balance.apply_crew_buffs_per_league(memory.force, vector.x)
-- Makes game hard to balance around this when productivity bonus is not constant.
-- Balance.apply_crew_buffs_per_league(memory.force, vector.x)
-- add some evo: (this will get reset upon arriving at a destination anyway, so this is just relevant for sea monsters and the like:)
local extra_evo = Balance.base_evolution_leagues(memory.overworldx) - Balance.base_evolution_leagues(memory.overworldx - vector.x)

View File

@ -250,7 +250,7 @@ function Public.initialise_fish_quest()
destination.dynamic_data.quest_type = enum.FISH
destination.dynamic_data.quest_reward = Public.quest_reward()
destination.dynamic_data.quest_progress = 0
destination.dynamic_data.quest_progressneeded = Math.random(300, 450) -- assuming that base caught fish amount is 3
destination.dynamic_data.quest_progressneeded = Math.random(350, 500) -- assuming that base caught fish amount is 3
return true
end
@ -264,7 +264,7 @@ function Public.initialise_compilatron_quest()
destination.dynamic_data.quest_type = enum.COMPILATRON
destination.dynamic_data.quest_reward = Public.quest_reward()
destination.dynamic_data.quest_progress = 0
destination.dynamic_data.quest_progressneeded = Math.random(30, 40) -- assuming that chance to find compilatron is 1/20
destination.dynamic_data.quest_progressneeded = Math.random(50, 80) -- assuming that chance to find compilatron is 1/20
return true
end

View File

@ -85,17 +85,17 @@ function Public.explanation(class, add_is_class_obtainable)
if class == enum.DECKHAND then
local extra_speed = Public.percentage_points_difference_from_100_percent(Balance.deckhand_extra_speed)
local ore_amount = Public.ore_grant_amount(Balance.deckhand_ore_grant_multiplier, Balance.deckhand_ore_scaling_enabled)
local ore_amount = Public.ore_grant_amount(Balance.deckhand_ore_grant_multiplier)
local tick_rate = Balance.class_reward_tick_rate_in_seconds
full_explanation = {'', {explanation, extra_speed, ore_amount, tick_rate}}
elseif class == enum.BOATSWAIN then
local extra_speed = Public.percentage_points_difference_from_100_percent(Balance.boatswain_extra_speed)
local ore_amount = Public.ore_grant_amount(Balance.boatswain_ore_grant_multiplier, Balance.boatswain_ore_scaling_enabled)
local ore_amount = Public.ore_grant_amount(Balance.boatswain_ore_grant_multiplier)
local tick_rate = Balance.class_reward_tick_rate_in_seconds
full_explanation = {'', {explanation, extra_speed, ore_amount, tick_rate}}
elseif class == enum.SHORESMAN then
local extra_speed = Public.percentage_points_difference_from_100_percent(Balance.shoresman_extra_speed)
local ore_amount = Public.ore_grant_amount(Balance.shoresman_ore_grant_multiplier, Balance.shoresman_ore_scaling_enabled)
local ore_amount = Public.ore_grant_amount(Balance.shoresman_ore_grant_multiplier)
local tick_rate = Balance.class_reward_tick_rate_in_seconds
full_explanation = {'', {explanation, extra_speed, ore_amount, tick_rate}}
elseif class == enum.QUARTERMASTER then
@ -311,8 +311,8 @@ end
function Public.class_ore_grant(player, how_much, enable_scaling)
local count = Public.ore_grant_amount(how_much, enable_scaling)
function Public.class_ore_grant(player, how_much)
local count = Public.ore_grant_amount(how_much)
if Math.random(4) == 1 then
Common.flying_text_small(player.surface, player.position, '[color=0.85,0.58,0.37]+' .. count .. '[/color]')
@ -323,12 +323,8 @@ function Public.class_ore_grant(player, how_much, enable_scaling)
end
end
function Public.ore_grant_amount(how_much, enable_scaling)
if enable_scaling then
return Math.ceil(how_much * Balance.class_resource_scale())
else
return Math.ceil(how_much)
end
function Public.ore_grant_amount(how_much)
return Math.ceil(how_much)
end
local function class_on_player_used_capsule(event)
@ -390,7 +386,7 @@ local function class_on_player_used_capsule(event)
-- multiplier = multiplier * 5
-- memory.gourmet_recency_tick = game.tick - timescale*10 + timescale
-- end
-- Public.class_ore_grant(player, 15 * multiplier, Balance.gourmet_ore_scaling_enabled)
-- Public.class_ore_grant(player, 15 * multiplier)
-- end
if class == Public.enum.ROCK_EATER then
local required_count = Balance.rock_eater_required_stone_furnace_to_heal_count

View File

@ -275,16 +275,16 @@ function Public.class_rewards_tick(tickinterval)
local hold_bool = (type == Surfaces.enum.HOLD)
if class == Classes.enum.DECKHAND and on_ship_bool and (not hold_bool) then
Classes.class_ore_grant(player, Balance.deckhand_ore_grant_multiplier, Balance.deckhand_ore_scaling_enabled)
Classes.class_ore_grant(player, Balance.deckhand_ore_grant_multiplier)
elseif class == Classes.enum.BOATSWAIN and hold_bool then
Classes.class_ore_grant(player, Balance.boatswain_ore_grant_multiplier, Balance.boatswain_ore_scaling_enabled)
Classes.class_ore_grant(player, Balance.boatswain_ore_grant_multiplier)
elseif class == Classes.enum.SHORESMAN and (not on_ship_bool) then
Classes.class_ore_grant(player, Balance.shoresman_ore_grant_multiplier, Balance.shoresman_ore_scaling_enabled)
Classes.class_ore_grant(player, Balance.shoresman_ore_grant_multiplier)
elseif class == Classes.enum.QUARTERMASTER then
local nearby_players = #player.surface.find_entities_filtered{position = player.position, radius = Balance.quartermaster_range, name = 'character'}
if nearby_players > 1 then
Classes.class_ore_grant(player, nearby_players - 1, Balance.quartermaster_ore_scaling_enabled)
Classes.class_ore_grant(player, nearby_players - 1)
end
end
end

View File

@ -88,7 +88,7 @@ function Public.create_step2_entities()
-- quest_structure_data.market.add_market_item{price={{'burner-mining-drill', 1}}, offer={type = 'give-item', item = 'iron-plate', count = 9}}
local how_many_coin_offers = 5
if Balance.crew_scale() >= 1.2 then how_many_coin_offers = 6 end
if Balance.crew_scale() >= 1 then how_many_coin_offers = 6 end
-- Thinking of not having these offers available always (if it's bad design decision can always change it back)
if Math.random(4) == 1 then
@ -302,7 +302,7 @@ Public.entry_price_data_raw = {-- choose things which make interesting minifacto
},
['car'] = {
overallWeight = 1,
minLambda = 0.3,
minLambda = 0.4,
maxLambda = 1.5,
shape = 'density',
enabled = true,
@ -322,7 +322,7 @@ Public.entry_price_data_raw = {-- choose things which make interesting minifacto
},
['express-transport-belt'] = {
overallWeight = 1,
minLambda = 0.4,
minLambda = 0.6,
maxLambda = 1.5,
shape = 'density',
enabled = true,

View File

@ -78,7 +78,7 @@ function Public.create_step2_entities()
-- quest_structure_data.market.add_market_item{price={{'burner-mining-drill', 1}}, offer={type = 'give-item', item = 'iron-plate', count = 9}}
local how_many_coin_offers = 5
if Balance.crew_scale() >= 1.2 then how_many_coin_offers = 6 end
if Balance.crew_scale() >= 1 then how_many_coin_offers = 6 end
-- Thinking of not having these offers available always (if it's bad design decision can always change it back)
if Math.random(4) == 1 then
@ -271,7 +271,7 @@ Public.entry_price_data_raw = {
},
['plastic-bar'] = {
overallWeight = 1,
minLambda = 0.2,
minLambda = 0.3,
maxLambda = 1,
shape = false,
base_amount = 400,
@ -279,7 +279,7 @@ Public.entry_price_data_raw = {
},
['sulfur'] = {
overallWeight = 1,
minLambda = 0.2,
minLambda = 0.3,
maxLambda = 1,
shape = false,
base_amount = 400,

View File

@ -374,7 +374,8 @@ function Public.spawn_enemy_boat(type)
-- e.destructible = false
boat.spawner = e
Common.new_healthbar(true, e, 900, nil, 900, 0.5)
local max_health = Balance.biter_boat_health()
Common.new_healthbar(true, e, max_health, nil, 900, 0.5)
end
return enemyboats[#enemyboats]

View File

@ -100,18 +100,22 @@ function Public.terrain(args)
if noises.forest_abs_suppressed(p) < 0.8 and noises.height(p) > 0.35 then
if noises.ore(p) > 1 then
args.entities[#args.entities + 1] = {name = 'uranium-ore', position = args.p, amount = 2000}
local amount = Math.ceil(300 * noises.height(p) * Balance.island_richness_avg_multiplier())
args.entities[#args.entities + 1] = {name = 'uranium-ore', position = args.p, amount = amount}
end
end
if noises.forest_abs_suppressed(p) < 0.8 and noises.height(p) < 0.35 and noises.height(p) > 0.05 then
if noises.ore(p) < -1.5 then
args.entities[#args.entities + 1] = {name = 'stone', position = args.p, amount = 1000}
local amount = Math.ceil(500 * noises.height(p) * Balance.island_richness_avg_multiplier())
args.entities[#args.entities + 1] = {name = 'stone', position = args.p, amount = amount}
elseif noises.ore(p) < 0.005 and noises.ore(p) > -0.005 then
if noises.ore(p) > 0 then
args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = 20}
local amount = Math.ceil(100 * noises.height(p) * Balance.island_richness_avg_multiplier())
args.entities[#args.entities + 1] = {name = 'coal', position = args.p, amount = amount}
else
args.entities[#args.entities + 1] = {name = 'copper-ore', position = args.p, amount = 100}
local amount = Math.ceil(200 * noises.height(p) * Balance.island_richness_avg_multiplier())
args.entities[#args.entities + 1] = {name = 'copper-ore', position = args.p, amount = amount}
end
end
end
@ -285,7 +289,7 @@ local function radioactive_tick()
local pollution = 0
local timer = destination.dynamic_data.timer
if timer and timer > 15 then
pollution = 10.0 * (Common.difficulty_scale()^(1.1) * (memory.overworldx/40)^(18/10) * (Balance.crew_scale())^(0.55)) / 3600 * tickinterval * (1 + (Common.difficulty_scale()-1)*0.2 + 0.001 * timer)
pollution = 6 * (Common.difficulty_scale()^(1.1) * (memory.overworldx/40)^(18/10) * (Balance.crew_scale())^(1/5)) / 3600 * tickinterval * (1 + (Common.difficulty_scale()-1)*0.2 + 0.001 * timer)
end
if pollution > 0 then