Files
aevolution/include/evo/biology/cellular_revamp_tuning.hpp
T
dingo ff121c3ed1
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m27s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 4m16s
Foundation / image (push) Successful in 4m54s
feat(cellular): seed dev wildlife and tune budding playtests
2026-10-26 12:01:57 -04:00

74 lines
4.1 KiB
C++

#pragma once
#include "evo/biology/cellular_catalog.hpp"
#include "evo/biology/cellular_tuning.hpp"
#include <array>
#include <compare>
#include <cstddef>
#include <cstdint>
#include <expected>
#include <string>
#include <string_view>
// Git-managed trial values for the cellular revamp (rules 13, ADR-0179), in their own file
// beside the rules-12 tuning file so older images never meet keys they do not know. Same
// format: plain `key = value` integer lines, range-checked; core keys required once,
// per-mutation overrides and the zero-default DEV opening count optional.
namespace evo::biology {
inline constexpr std::int64_t cellular_revamp_tuning_version = 1;
inline constexpr std::size_t max_cellular_revamp_tuning_bytes = std::size_t{256} * 1'024;
struct CellularRevampTuning {
std::int64_t version{};
// Optional DEV opening fixture; zero preserves unseeded, player-origin worlds.
std::int64_t playtest_starting_wildlife_cells{};
// Body: the share of upkeep no upkeep-efficiency trait reduces.
std::int64_t body_essential_upkeep_per_mille{};
// Body: share of reserve matter carried as load on handling and thrust costs.
std::int64_t body_reserve_load_per_mille{};
// Body: growth per tick at growth speed 100, in hundredths of a per mille.
std::int64_t body_growth_per_tick_centi_mille{};
// Energy: picojoules 1,000 fg of each matter channel stand in for (burn efficiency 100).
std::int64_t energy_burn_carbon_pj_per_kfg{}, energy_burn_nitrogen_pj_per_kfg{},
energy_burn_phosphorus_pj_per_kfg{}, energy_burn_other_pj_per_kfg{};
// Feeding: per mille of collection lost per membrane point above the founder's 100.
std::int64_t feeding_membrane_collection_per_mille_per_point{};
// Predation.
std::int64_t predation_engulf_ratio_milli{}, predation_engulf_reserve_percent{},
predation_kill_bubble_per_mille{};
// The spent pool's drip back into the region.
std::int64_t spent_drip_interval_ticks{}, spent_drip_bubble_pj{}, spent_drip_bubble_fg{};
// Mutation offers (Cellular_mutation_plan.md section 3).
std::int64_t mutation_options{}, mutation_floor_ppm{}, mutation_cap_ppm{};
std::int64_t mutation_score_min{}, mutation_score_max{};
std::int64_t mutation_max_multiplier_per_mille{}, mutation_min_multiplier_per_mille{};
std::int64_t mutation_offer_interval_ticks{};
std::int64_t mutation_min_points{}, mutation_max_points{}, mutation_recipe_min_share{};
std::int64_t mutation_max_offspring{}, mutation_carbon_for_light_fg{},
mutation_buds_for_adhesion{};
// Reproduction (Cellular_reproduction_plan.md).
std::int64_t reproduction_split_share_per_mille{}, reproduction_split_min_growth_per_mille{};
std::int64_t reproduction_bud_fee_e_pj{}, reproduction_bud_fee_c_fg{},
reproduction_bud_fee_n_fg{}, reproduction_bud_fee_p_fg{}, reproduction_bud_fee_o_fg{};
std::int64_t reproduction_bud_fee_scale_percent{}, reproduction_organism_cap{};
// Multicellular organisms.
std::int64_t organism_load_per_mille{}, organism_emerge_members{}, organism_emerge_mass_fg{},
organism_emerge_reserve_pj{};
// Each catalog mutation's tunables, in catalog order. Optional keys
// `mutation.<key>.<field>` override the defaults from its spec.
std::array<CellularMutationTuning, cellular_catalog_size> mutations{};
auto operator<=>(const CellularRevampTuning&) const = default;
};
// A mutation's tunables as the file names them.
inline constexpr std::array<std::string_view, 15> cellular_mutation_tuning_fields{
"enabled", "base_weight", "increase_points", "decrease_points", "primary_step",
"paired_step", "spread_step", "increase_ticks", "decrease_ticks", "cost_e_pj",
"cost_c_fg", "cost_n_fg", "cost_p_fg", "cost_o_fg", "cost_scale_percent"};
[[nodiscard]] std::expected<CellularRevampTuning, CellularTuningError>
parse_cellular_revamp_tuning(std::string_view text);
// Canonical text: every key once, in schema order.
[[nodiscard]] std::string encode_cellular_revamp_tuning(const CellularRevampTuning& tuning);
} // namespace evo::biology