Skills system: practice-grown abilities with passion (animals now, humans later)

Generic data-driven skills (SkillDef + skills.json: Foraging, Hunting, Evasion),
mirroring the needs registry. Skills component (per-skill level [0..1] + passion)
on every animal, built by AnimalFactory; passion is rolled deterministically from
the genome (no RNG param threaded). Levels grow from PRACTICE (XP on the matching
action, scaled by passion''s learn-rate) and slowly decay toward a floor when
unused (AnimalSkillSystem), so animals specialize.

Effects wired now: Foraging -> satiety from grazing, Hunting -> attack damage,
Evasion -> flee speed. A missing skill def -> factor 1 (no effect), so it is safe
to mod the set. Inspector gains a Skills tab (level% + passion stars); `skills`
console command shows live mean levels; skills are saved/loaded (levels+passions).
Same model will carry to future humans. Build + --check-content clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-14 22:15:11 +03:00
co-authored by Claude Opus 4.8
parent cf2bc77882
commit 58380adc31
12 changed files with 437 additions and 14 deletions
+14
View File
@@ -0,0 +1,14 @@
{
"type": "Skill",
// Навыки как данные: уровень особи [0..1] растёт от практики (XP при соответствующем действии,
// ускоряется страстью) и медленно угасает к floorLevel. Эффект навыка — код по его id (добыча→выпас,
// охота→урон, уклонение→бегство). Сейчас навыки у животных; те же дефы пригодятся будущему человеку.
"defs": [
{ "defName": "Foraging", "label": "skill.foraging", "category": "survival",
"learnRate": 0.6, "decayPerDay": 0.015, "floorLevel": 0.0 },
{ "defName": "Hunting", "label": "skill.hunting", "category": "survival",
"learnRate": 0.5, "decayPerDay": 0.02, "floorLevel": 0.0 },
{ "defName": "Evasion", "label": "skill.evasion", "category": "survival",
"learnRate": 0.7, "decayPerDay": 0.02, "floorLevel": 0.0 }
]
}