← Ülevaadedocs\ai_context\COMBAT_STATS_DESIGN_20261127.md

Combat balance, mob skills, limited group aggro, achievements — BUILT 27.11.2026

Owner: Janari. First a proposal (same day), then built after his answers:

Rollback copies: D:/WieldHavenBackups/archive/combat_balance_20261127/original/ (PlayerStats, Player, SkeletonEnemy, OverworldSkeleton, MobLevelRules, NativeAttributeRules, EnemyArrow, PlayerStatsMenu). New files can simply be removed.

Files

FileWhat
Scripts/Services/CombatRules.gd (new)growth curve, K, DR, level factor, crit, HP table 51-80, mob scaling factors
Scripts/Services/AchievementRules.gd (new)26 achievements, counters, rewards, caps, seeding from old kills
Scripts/Enemies/MobEngagement.gd (new)per-player fight registry: 3 main group / 1 other group
Scripts/Enemies/MobSkillRules.gd (new)10 mob skills + which mob uses which
Scripts/UI/AchievementsMenu.gd (new)window (J key, Tab ring entry "Achievements"), unlock toast
SkeletonEnemy.gdnew hit formula, family profile, gated set_aggro, capped ally call, replacement on death, skills
OverworldSkeleton.gdsight-aggro gate, wall check for calls
Player.gdreceived damage via CombatRules, achievement damage %, dodge counter
PlayerStats.gdattacks start 10, levels 51-80, migration, achievement + percent bonuses
NativeAttributeRules.gd+0.25 % per attribute point (percent part)
MobLevelRules.gdMAX_MOB_LEVEL 80, scaling via CombatRules, FAMILY_PROFILES
RewardService.gd, EnemyArrow.gd, SelectMenu.gd, QuickMenuRegistry.gdsmall hooks

Formulas

Growth curve: G(L) = e^(0.07584 x (L-1)) -> 1 at level 1, 400 at level 80. Gear design target (for future gear tiers): armor piece 3 x G(L) (L30 ~27, L60 ~290, L80 ~1200), weapon 8 x G(L).

Player stat (Attack, RangedAttack, MagicAttack, Melee/Ranged/MagicDefense; all start 10):


flat  = 10 + gear x quality + set + souls + attribute flat (+1/pt) + achievement flat
total = flat x (1 + attribute % (0.25 %/pt above 10) + achievement % (cap 15 % each))

Old attribute flats unchanged (Endurance +1 melee/ranged def per 2 pts, +2 HP/pt). Endurance % also raises MaxHealth.

Hit (both directions):


raw x level_factor   level_factor = clamp(1 + 0.05 x (attacker_lvl - defender_lvl), 0.6, 1.5)
DR = DEF / (DEF + K(attacker_lvl)),  K = 16 + 26 x G(L)  (42 at L1, ~10 400 at L80),  cap 75 %
dmg = max(1, round(raw x (1 - DR)))

then (player side) armor proficiency, guard boosts, achievement reduction (cap 8 %); (player attacking) weapon proficiency + achievement damage (cap 8 %). Crit 12 % + 0.2 %/Luck above 10, max 30 %, x1.6.

Player HP per level: 1-50 as before; 51-59 +250, 60-69 +400, 70-79 +550 -> L60 4 900, L80 14 400 (+ Endurance). Stat points 51-80: +1 per level, +5 at 60 and 70 (was 0 and +1 HP).

Mob scaling (authored scene numbers = level 1):

Family profile (from authored melee defense): Undead ranged x1.4 / magic x2.5, no magic attack; Goblin 1.0 / 0.85; Orc 0.85 / 0.45 (weak to magic); Demon 1.0 / 1.8 and magic attack 0.8 x damage.

Test table (same-level, gear on the curve; VerifyCombatBalance):

LvAttackDefenseHPDRMob HPHits to killHits to die
1182210034 %145109.5
3012818389142 %1 0519.213
601 1702 1265 32848 %8 4107.415
806 06911 29817 06052 %39 0496.618

Group aggro (MobEngagement)

Mob skills (MobSkillRules)

Used at the heavy wind-up (red pulse; area skills also show a red ground circle, >= 0.8 s): Volley (3 arrows), Twin Shot, Cleave, Whirl, Ground Slam, War Cry, Fire Bolt, Hellfire Arrow, Flame Slash, Infernal Nova. Mapping by authored name, fallback by family + archetype.

Achievements

26 (kills total/family/elite/leader, bosses, levels 10/30/60, rebirths, perfect dodges, backstabs, close call, weapon/armor proficiency, full 7-piece set). Stored Stats.Achievements, Stats.AchievementCounters. Older characters: counters seeded once from EnemyKills by name. Window: J key or Tab ring entry "Achievements" (add it in Options > Quick Menu; the default ring is full).

Save migration (CombatBalanceVersion 1)

Attacks -15/-20/-25 (min 10); characters above level 51 get the new HP and points for their levels. Owner saves are migrated on first load (backup of the scripts above; saves themselves untouched until then).

Evidence