1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-03 22:52:20 +02:00
Rampant/libs/Constants.lua

390 lines
12 KiB
Lua
Raw Normal View History

local constants = {}
2016-08-25 02:05:20 +02:00
-- versions
constants.VERSION_5 = 5
2016-09-14 20:16:00 +02:00
constants.VERSION_10 = 10
2016-10-15 02:00:18 +02:00
constants.VERSION_11 = 11
2016-11-04 01:51:35 +02:00
constants.VERSION_12 = 12
2017-04-22 01:14:04 +02:00
constants.VERSION_16 = 16
2017-05-06 11:03:28 +02:00
constants.VERSION_18 = 18
constants.VERSION_20 = 20
constants.VERSION_22 = 22
2017-05-28 06:50:37 +02:00
constants.VERSION_23 = 23
2017-06-10 10:47:15 +02:00
constants.VERSION_25 = 25
constants.VERSION_26 = 26
constants.VERSION_27 = 27
2017-07-15 21:48:11 +02:00
constants.VERSION_28 = 28
2017-11-21 09:27:03 +02:00
constants.VERSION_33 = 33
2018-01-24 08:02:06 +02:00
constants.VERSION_38 = 38
constants.VERSION_41 = 41
2017-11-27 00:21:48 +02:00
-- misc
2017-12-21 05:50:36 +02:00
constants.WATER_TILE_NAMES = { "water", "deepwater", "water-green", "deepwater-green" }
2016-08-21 23:48:55 +02:00
constants.MAGIC_MAXIMUM_NUMBER = 1e99 -- used in loops trying to find the lowest/highest score
2017-05-19 09:47:24 +02:00
constants.MAGIC_MAXIMUM_BASE_NUMBER = 100000000
2016-10-15 02:00:18 +02:00
constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL = 10000
2017-08-08 10:19:51 +02:00
constants.PROCESS_QUEUE_SIZE = 400
constants.SCAN_QUEUE_SIZE = 5
2017-06-01 03:46:53 +02:00
constants.BASE_QUEUE_SIZE = 1
2017-08-11 08:37:23 +02:00
constants.SQUAD_QUEUE_SIZE = 2
2017-11-21 09:27:03 +02:00
constants.PROCESS_PLAYER_BOUND = 128
2016-10-15 02:00:18 +02:00
constants.TICKS_A_SECOND = 60
constants.TICKS_A_MINUTE = constants.TICKS_A_SECOND * 60
constants.INTERVAL_PROCESS = 19
constants.INTERVAL_SCAN = 21
constants.INTERVAL_CHUNK = 17
constants.INTERVAL_LOGIC = 61
constants.INTERVAL_SQUAD = 41
constants.RESOURCE_GENERATOR_INCREMENT = 0.001
2017-06-11 02:59:06 +02:00
constants.PLAYER_PHEROMONE_MULTIPLER = 100
2017-07-05 00:52:20 +02:00
constants.DEV_CUSTOM_AI = false
2017-06-11 02:59:06 +02:00
2017-05-19 09:47:24 +02:00
-- chunk properties
constants.CHUNK_SIZE = 32
2017-06-01 03:46:53 +02:00
constants.DOUBLE_CHUNK_SIZE = constants.CHUNK_SIZE * 2
constants.TRIPLE_CHUNK_SIZE = constants.CHUNK_SIZE * 3
2017-05-19 09:47:24 +02:00
constants.HALF_CHUNK_SIZE = constants.CHUNK_SIZE / 2
constants.QUARTER_CHUNK_SIZE = constants.HALF_CHUNK_SIZE / 2
2017-06-01 03:46:53 +02:00
constants.CHUNK_SIZE_DIVIDER = 1 / constants.CHUNK_SIZE
2017-06-10 10:38:20 +02:00
constants.CHUNK_IMPASSABLE = 0
constants.CHUNK_NORTH_SOUTH = 1
constants.CHUNK_EAST_WEST = 2
constants.CHUNK_ALL_DIRECTIONS = 3
-- constants.CHUNK_PLAYER_BORDER = 4
-- constants.CHUNK_PLAYER_INTERIOR = 5
2017-05-19 09:47:24 +02:00
constants.BASE_SEARCH_RADIUS = 4 * constants.CHUNK_SIZE
constants.EVOLUTION_INCREMENTS = 0.05
2016-08-19 04:02:13 +02:00
-- ai
constants.AI_POINT_GENERATOR_AMOUNT = 6
2016-08-19 04:02:13 +02:00
constants.AI_SCOUT_COST = 45
2016-10-15 02:00:18 +02:00
constants.AI_SQUAD_COST = 175
2017-05-19 09:47:24 +02:00
constants.AI_NEST_COST = 10
constants.AI_WORM_COST = 2
2017-01-20 07:58:36 +02:00
constants.AI_VENGENCE_SQUAD_COST = 45
2016-08-19 04:02:13 +02:00
constants.AI_SETTLER_COST = 75
constants.AI_BASE_BUILDING_COST = 500
2016-08-20 21:04:04 +02:00
constants.AI_TUNNEL_COST = 100
2016-10-15 02:00:18 +02:00
constants.AI_MAX_POINTS = 10000
2017-06-01 03:46:53 +02:00
constants.AI_MAX_OVERFLOW_POINTS = constants.AI_MAX_POINTS * 3
2017-05-06 11:03:28 +02:00
constants.AI_UNIT_REFUND = 3
2017-04-22 01:14:04 +02:00
2018-01-14 07:48:21 +02:00
-- constants.AI_MAX_SQUAD_COUNT = 30
2017-04-22 01:14:04 +02:00
constants.AI_MAX_BITER_GROUP_SIZE = 450
2016-08-19 04:02:13 +02:00
2017-06-01 09:03:07 +02:00
constants.AI_SQUAD_MERGE_THRESHOLD = constants.AI_MAX_BITER_GROUP_SIZE * 0.75
2016-10-15 02:00:18 +02:00
constants.AI_STATE_PEACEFUL = 1
constants.AI_STATE_AGGRESSIVE = 2
2017-05-14 00:32:16 +02:00
constants.AI_STATE_NOCTURNAL = 3
2016-10-15 02:00:18 +02:00
constants.AI_MIN_STATE_DURATION = 1
constants.AI_MAX_STATE_DURATION = 4
constants.AI_MIN_TEMPERAMENT_DURATION = 5
constants.AI_MAX_TEMPERAMENT_DURATION = 15
2017-05-08 08:56:11 +02:00
-- ai base
constants.BASE_DEADZONE_TTL = constants.TICKS_A_MINUTE * 20
2018-01-26 07:48:12 +02:00
constants.BASE_COLLECTION_THRESHOLD = constants.TICKS_A_MINUTE * 2
constants.BASE_DISTANCE_TO_EVO_INDEX = 1 / 5480
constants.BASE_SPAWNER_UPGRADE = 300
constants.BASE_WORM_UPGRADE = 250
constants.BASE_UPGRADE = 1500
constants.BASE_DISTANCE_THRESHOLD = 30 * constants.CHUNK_SIZE
constants.BASE_DISTANCE_LEVEL_BONUS = 15
2017-05-08 08:56:11 +02:00
constants.BASE_ALIGNMENT_NEUTRAL = 1
constants.BASE_ALIGNMENT_FIRE = 2
constants.BASE_ALIGNMENT_NUCLEAR = 3
2017-05-08 08:56:11 +02:00
constants.BASE_ALIGNMENT_SUICIDE = 4
constants.BASE_ALIGNMENT_INFEST = 5
constants.BASE_ALIGNMENT_ACID = 6
constants.BASE_ALIGNMENT_FIRE = 7
constants.BASE_ALIGNMENT_PHYSICAL = 8
constants.BASE_ALIGNMENT_LASER = 9
constants.BASE_ALIGNMENT_INFERNO = 10
constants.BASE_ALIGNMENT_POSION = 11
constants.BASE_ALIGNMENT_TROLL = 12
constants.BASE_ALIGNMENT_FAST = 13
constants.BASE_ALIGNMENT_WEB = 14
constants.BASE_ALIGNMENT_DECAYING = 15
constants.BASE_ALIGNMENT_UNDYING = 16
constants.BASE_ALIGNMENT_ENERGY_THIEF = 17
constants.BASE_ALIGNMENT_ELECTRIC = 18
constants.BASE_ALIGNMENT_WASP = 19
constants.BASE_ALIGNMENT_DEADZONE = 20
-- constants.BASE_ALIGNMENT_BURROW = 3
constants.BASE_PROCESS_INTERVAL = constants.TICKS_A_SECOND * 5
local neutralPath = {}
neutralPath[constants.BASE_ALIGNMENT_ACID] = true
neutralPath[constants.BASE_ALIGNMENT_FIRE] = true
neutralPath[constants.BASE_ALIGNMENT_PHYSICAL] = true
neutralPath[constants.BASE_ALIGNMENT_ELECTRIC] = true
-- neutralPath[constants.BASE_ALIGNMENT_DECAYING] = true
neutralPath[constants.BASE_ALIGNMENT_SUICIDE] = true
-- neutralPath[constants.BASE_ALIGNMENT_WEB] = true
neutralPath[constants.BASE_ALIGNMENT_TROLL] = true
neutralPath[constants.BASE_ALIGNMENT_FAST] = true
-- neutralPath[constants.BASE_ALIGNMENT_WASP] = true
local suicidePath = {}
suicidePath[constants.BASE_ALIGNMENT_NUCLEAR] = true
local firePath = {}
firePath[constants.BASE_ALIGNMENT_INFERNO] = true
-- local acidPath = {}
-- acidPath[constants.BASE_ALIGNMENT_POSION] = true
-- acidPath[constants.BASE_ALIGNMENT_INFEST] = true
-- local decayingPath = {}
-- decayingPath[constants.BASE_ALIGNMENT_UNDYING] = true
-- local electricPath = {}
-- electricPath[constants.BASE_ALIGNMENT_ENERGY_THIEF] = true
-- electricPath[constants.BASE_ALIGNMENT_LASER] = true
constants.BASE_ALIGNMENT_PATHS = {}
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_NEUTRAL] = neutralPath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_FIRE] = firePath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_SUICIDE] = suicidePath
-- constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_ACID] = acidPath
-- constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_DECAYING] = decayingPath
-- constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_ELECTRIC] = electricPath
constants.BASE_ALIGNMENT_EVOLUTION_BASELINE = {
[constants.BASE_ALIGNMENT_NEUTRAL] = 0,
[constants.BASE_ALIGNMENT_ACID] = 0.1,
[constants.BASE_ALIGNMENT_ELECTRIC] = 0.2,
[constants.BASE_ALIGNMENT_SUICIDE] = 0.3,
[constants.BASE_ALIGNMENT_PHYSICAL] = 0.4,
[constants.BASE_ALIGNMENT_LASER] = 0.4,
[constants.BASE_ALIGNMENT_FIRE] = 0.4,
[constants.BASE_ALIGNMENT_FAST] = 0.5,
[constants.BASE_ALIGNMENT_TROLL] = 0.5,
[constants.BASE_ALIGNMENT_INFERNO] = 0.6,
[constants.BASE_ALIGNMENT_NUCLEAR] = 0.7
}
2017-05-08 08:56:11 +02:00
2016-10-15 02:00:18 +02:00
-- ai retreat
constants.NO_RETREAT_BASE_PERCENT = 0.10
constants.NO_RETREAT_EVOLUTION_BONUS_MAX = 0.25
constants.NO_RETREAT_SQUAD_SIZE_BONUS_MAX = 0.40
-- pheromone amounts
2016-08-19 04:02:13 +02:00
constants.MOVEMENT_PHEROMONE_GENERATOR_AMOUNT = 500
2017-04-22 01:14:04 +02:00
constants.DEATH_PHEROMONE_GENERATOR_AMOUNT = 500
constants.PLAYER_PHEROMONE_GENERATOR_AMOUNT = 150
2017-06-10 10:38:20 +02:00
constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT = -0.1
2017-04-22 01:14:04 +02:00
-- pheromone diffusion amounts
2016-08-21 23:48:55 +02:00
2017-06-10 10:38:20 +02:00
constants.MOVEMENT_PHEROMONE_PERSISTANCE = 0.9
2017-04-22 01:14:04 +02:00
constants.BASE_PHEROMONE_PERSISTANCE = 0.99
constants.PLAYER_PHEROMONE_PERSISTANCE = 0.98
2017-07-02 07:40:25 +02:00
constants.RESOURCE_PHEROMONE_PERSISTANCE = 0.9
-- chunk attributes
2016-10-15 02:00:18 +02:00
constants.MOVEMENT_PHEROMONE = 1
constants.BASE_PHEROMONE = 2
constants.PLAYER_PHEROMONE = 3
2017-05-08 08:56:11 +02:00
constants.RESOURCE_PHEROMONE = 4
2017-11-21 09:27:03 +02:00
constants.PASSABLE = 5
2017-06-08 02:57:24 +02:00
2017-11-21 09:27:03 +02:00
constants.CHUNK_TICK = 6
2017-06-08 02:57:24 +02:00
2017-11-21 09:27:03 +02:00
constants.PATH_RATING = 7
-- Squad status
constants.SQUAD_RETREATING = 1 -- used during squad retreat
constants.SQUAD_GUARDING = 2 -- used when squad is idle
2016-11-04 01:51:35 +02:00
constants.SQUAD_BURROWING = 3
constants.SQUAD_RAIDING = 4 -- used when player stuff is close
2017-01-20 07:58:36 +02:00
-- Squad Related
constants.RETREAT_GRAB_RADIUS = 24
constants.RETREAT_SPAWNER_GRAB_RADIUS = 75
2017-01-20 07:58:36 +02:00
2017-05-28 06:50:37 +02:00
constants.BASE_RALLY_CHANCE = 0.02
constants.BONUS_RALLY_CHANCE = 0.06
2017-01-20 07:58:36 +02:00
2017-11-21 09:27:03 +02:00
constants.RALLY_CRY_DISTANCE = 96
2017-01-20 07:58:36 +02:00
constants.GROUP_MERGE_DISTANCE = 28
2017-05-06 11:03:28 +02:00
constants.MAX_PENALTY_BEFORE_PURGE = 10000
2017-06-10 10:38:20 +02:00
-- player building pheromones
constants.BUILDING_PHEROMONES = {}
2017-04-22 01:14:04 +02:00
constants.BUILDING_PHEROMONES["generator"] = 8
constants.BUILDING_PHEROMONES["pump"] = 2
2017-05-06 11:03:28 +02:00
constants.BUILDING_PHEROMONES["reactor"] = 16
2017-04-22 01:14:04 +02:00
constants.BUILDING_PHEROMONES["offshore-pump"] = 2
constants.BUILDING_PHEROMONES["transport-belt"] = 1
constants.BUILDING_PHEROMONES["accumulator"] = 10
constants.BUILDING_PHEROMONES["solar-panel"] = 8
constants.BUILDING_PHEROMONES["boiler"] = 12
constants.BUILDING_PHEROMONES["assembling-machine"] = 10
constants.BUILDING_PHEROMONES["roboport"] = 10
constants.BUILDING_PHEROMONES["beacon"] = 10
constants.BUILDING_PHEROMONES["furnace"] = 12
2017-05-06 11:03:28 +02:00
constants.BUILDING_PHEROMONES["programmable-speaker"] = 8
2017-06-10 10:38:20 +02:00
constants.BUILDING_PHEROMONES["mining-drill"] = 35
constants.BUILDING_PHEROMONES["rocket-silo"] = 120
2017-05-06 11:03:28 +02:00
constants.BUILDING_PHEROMONES["lamp"] = 4
2017-06-10 10:38:20 +02:00
constants.BUILDING_PHEROMONES["radar"] = 20
2017-06-24 20:41:57 +02:00
constants.BUILDING_PHEROMONES["lab"] = 15
-- player defense pheromones
2017-06-10 10:38:20 +02:00
constants.BUILDING_PHEROMONES["ammo-turret"] = 10
constants.BUILDING_PHEROMONES["wall"] = 0.5
constants.BUILDING_PHEROMONES["electric-turret"] = 20
constants.BUILDING_PHEROMONES["fluid-turret"] = 28
constants.BUILDING_PHEROMONES["turret"] = 10
constants.BUILDING_PHEROMONES["artillery-turret"] = 100
2018-01-14 07:48:21 +02:00
constants.RETREAT_FILTER = {}
constants.RETREAT_FILTER[constants.SQUAD_RETREATING] = true
2017-05-27 02:58:33 +02:00
-- map settings tweaks
constants.PATH_FINDER_SHORT_REQUEST_RATIO = 0.8
constants.PATH_FINDER_SHORT_CACHE_SIZE = 25
constants.PATH_FINDER_LONG_REQUEST_RATIO = 5
2017-08-11 08:37:23 +02:00
constants.PATH_FINDER_MIN_STEPS_TO_CHECK_PATH = 1000
2017-05-27 02:58:33 +02:00
constants.MAX_FAILED_BEHAVIORS = 10
2017-05-27 02:58:33 +02:00
2017-06-02 03:59:32 +02:00
constants.UNIT_GROUP_DISOWN_DISTANCE = 10
constants.UNIT_GROUP_TICK_TOLERANCE = 360
2017-05-27 02:58:33 +02:00
2017-06-10 10:38:20 +02:00
constants.UNIT_GROUP_MAX_RADIUS = 20
2017-05-27 02:58:33 +02:00
constants.UNIT_GROUP_MAX_SPEED_UP = 1.1
constants.UNIT_GROUP_MAX_SLOWDOWN = 1.0
constants.UNIT_GROUP_SLOWDOWN_FACTOR = 0.9
2017-11-21 09:27:03 +02:00
-- sentinels
constants.SENTINEL_IMPASSABLE_CHUNK = {}
constants.SENTINEL_IMPASSABLE_CHUNK.name = "ImpassableChunk"
2017-11-21 09:27:03 +02:00
constants.SENTINEL_IMPASSABLE_CHUNK[constants.MOVEMENT_PHEROMONE] = constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT
constants.SENTINEL_IMPASSABLE_CHUNK[constants.BASE_PHEROMONE] = constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT
constants.SENTINEL_IMPASSABLE_CHUNK[constants.PLAYER_PHEROMONE] = constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT
constants.SENTINEL_IMPASSABLE_CHUNK[constants.RESOURCE_PHEROMONE] = constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT
constants.SENTINEL_IMPASSABLE_CHUNK[constants.PASSABLE] = constants.CHUNK_IMPASSABLE
constants.SENTINEL_IMPASSABLE_CHUNK[constants.CHUNK_TICK] = 0
constants.SENTINEL_IMPASSABLE_CHUNK[constants.PATH_RATING] = 0
2018-01-14 07:48:21 +02:00
constants.SENTINEL_IMPASSABLE_CHUNK.x = -1
constants.SENTINEL_IMPASSABLE_CHUNK.y = -1
2017-11-21 09:27:03 +02:00
2018-01-15 01:10:56 +02:00
-- unit spawners
constants.NEUTRAL_NEST_TIERS = 10
constants.NEUTRAL_NEST_VARIATIONS = 20
constants.NEUTRAL_WORM_TIERS = 10
constants.NEUTRAL_WORM_VARIATIONS = 20
constants.ACID_NEST_TIERS = 10
constants.ACID_NEST_VARIATIONS = 20
constants.ACID_WORM_TIERS = 10
constants.ACID_WORM_VARIATIONS = 20
constants.FIRE_NEST_TIERS = 10
constants.FIRE_NEST_VARIATIONS = 20
constants.FIRE_WORM_TIERS = 10
constants.FIRE_WORM_VARIATIONS = 20
constants.PHYSICAL_NEST_TIERS = 10
constants.PHYSICAL_NEST_VARIATIONS = 20
constants.PHYSICAL_WORM_TIERS = 10
constants.PHYSICAL_WORM_VARIATIONS = 20
constants.TROLL_NEST_TIERS = 10
constants.TROLL_NEST_VARIATIONS = 20
constants.TROLL_WORM_TIERS = 10
constants.TROLL_WORM_VARIATIONS = 20
constants.FAST_NEST_TIERS = 10
constants.FAST_NEST_VARIATIONS = 20
constants.FAST_WORM_TIERS = 10
constants.FAST_WORM_VARIATIONS = 20
constants.SUICIDE_NEST_TIERS = 10
constants.SUICIDE_NEST_VARIATIONS = 20
constants.SUICIDE_WORM_TIERS = 10
constants.SUICIDE_WORM_VARIATIONS = 20
constants.WASP_NEST_TIERS = 10
constants.WASP_NEST_VARIATIONS = 20
constants.WASP_WORM_TIERS = 10
constants.WASP_WORM_VARIATIONS = 20
constants.POISON_NEST_TIERS = 10
constants.POISON_NEST_VARIATIONS = 20
constants.POISON_WORM_TIERS = 10
constants.POISON_WORM_VARIATIONS = 20
constants.DECAYING_NEST_TIERS = 10
constants.DECAYING_NEST_VARIATIONS = 20
constants.DECAYING_WORM_TIERS = 10
constants.DECAYING_WORM_VARIATIONS = 20
constants.UNDYING_NEST_TIERS = 10
constants.UNDYING_NEST_VARIATIONS = 20
constants.UNDYING_WORM_TIERS = 10
constants.UNDYING_WORM_VARIATIONS = 20
constants.ELECTRIC_NEST_TIERS = 10
constants.ELECTRIC_NEST_VARIATIONS = 20
constants.ELECTRIC_WORM_TIERS = 10
constants.ELECTRIC_WORM_VARIATIONS = 20
constants.LASER_NEST_TIERS = 10
constants.LASER_NEST_VARIATIONS = 20
constants.LASER_WORM_TIERS = 10
constants.LASER_WORM_VARIATIONS = 20
constants.INFERNO_NEST_TIERS = 10
constants.INFERNO_NEST_VARIATIONS = 20
constants.INFERNO_WORM_TIERS = 10
constants.INFERNO_WORM_VARIATIONS = 20
constants.NUCLEAR_NEST_TIERS = 10
constants.NUCLEAR_NEST_VARIATIONS = 20
constants.NUCLEAR_WORM_TIERS = 10
constants.NUCLEAR_WORM_VARIATIONS = 20
2018-01-15 01:10:56 +02:00
return constants