From 9d9a6771633712d674c1efe17b0080a80dacf7f3 Mon Sep 17 00:00:00 2001 From: erwan-joly Date: Sun, 23 Aug 2026 17:54:16 +1200 Subject: [PATCH] fix: correct the family experience table and extend it to level 30 Every row was wrong. Level 1 asked 100 000 against 80 000, level 7 asked 1 900 000 against 512 000, and the curve stopped at 19 where the game goes to 30. A family would have needed roughly triple the experience it should at the top of the old table and then been unable to level at all. From level 20 the requirement is the previous one plus a tenth, compounded unrounded and floored, which is why those rows are not round. Version bumped to 2.1.0. Co-Authored-By: Claude Opus 5 (1M context) --- ....FamilyExperienceDocumentation.approved.md | 49 ++++++++++++------- src/NosCore.Algorithm/Constants.cs | 1 + .../FamilyExperienceService.cs | 15 +++--- .../NosCore.Algorithm.csproj | 2 +- .../DocumentationTest.cs | 2 +- 5 files changed, 41 insertions(+), 28 deletions(-) diff --git a/documentation/DocumentationTest.FamilyExperienceDocumentation.approved.md b/documentation/DocumentationTest.FamilyExperienceDocumentation.approved.md index 148e21f..34211e6 100644 --- a/documentation/DocumentationTest.FamilyExperienceDocumentation.approved.md +++ b/documentation/DocumentationTest.FamilyExperienceDocumentation.approved.md @@ -1,20 +1,31 @@ # Family Experience Table -- Level 1 - XP: 100000 -- Level 2 - XP: 250000 -- Level 3 - XP: 370000 -- Level 4 - XP: 560000 -- Level 5 - XP: 840000 -- Level 6 - XP: 1260000 -- Level 7 - XP: 1900000 -- Level 8 - XP: 2850000 -- Level 9 - XP: 3570000 -- Level 10 - XP: 3830000 -- Level 11 - XP: 4150000 -- Level 12 - XP: 4750000 -- Level 13 - XP: 5500000 -- Level 14 - XP: 6500000 -- Level 15 - XP: 7000000 -- Level 16 - XP: 8500000 -- Level 17 - XP: 9500000 -- Level 18 - XP: 10000000 -- Level 19 - XP: 17000000 +- Level 1 - XP: 80000 +- Level 2 - XP: 96000 +- Level 3 - XP: 120000 +- Level 4 - XP: 152000 +- Level 5 - XP: 224000 +- Level 6 - XP: 336000 +- Level 7 - XP: 512000 +- Level 8 - XP: 760000 +- Level 9 - XP: 1136000 +- Level 10 - XP: 1472000 +- Level 11 - XP: 1800000 +- Level 12 - XP: 2240000 +- Level 13 - XP: 2968000 +- Level 14 - XP: 3848000 +- Level 15 - XP: 5000000 +- Level 16 - XP: 6816000 +- Level 17 - XP: 9672000 +- Level 18 - XP: 14192000 +- Level 19 - XP: 20000000 +- Level 20 - XP: 22000000 +- Level 21 - XP: 24200000 +- Level 22 - XP: 26620000 +- Level 23 - XP: 29282000 +- Level 24 - XP: 32210200 +- Level 25 - XP: 35431220 +- Level 26 - XP: 38974342 +- Level 27 - XP: 42871776 +- Level 28 - XP: 47158953 +- Level 29 - XP: 51874849 +- Level 30 - XP: 57062334 diff --git a/src/NosCore.Algorithm/Constants.cs b/src/NosCore.Algorithm/Constants.cs index 10bec9c..a1abcd4 100644 --- a/src/NosCore.Algorithm/Constants.cs +++ b/src/NosCore.Algorithm/Constants.cs @@ -10,6 +10,7 @@ internal class Constants internal const byte MaxJobLevel = 80; internal const byte MaxHeroLevel = 60; internal const byte MaxMateLevel = 99; + internal const byte MaxFamilyLevel = 30; internal static readonly int ClassCount = Enum.GetNames(typeof(CharacterClassType)).Length; } } diff --git a/src/NosCore.Algorithm/FamilyExperienceService/FamilyExperienceService.cs b/src/NosCore.Algorithm/FamilyExperienceService/FamilyExperienceService.cs index 88c1f60..3597cf0 100644 --- a/src/NosCore.Algorithm/FamilyExperienceService/FamilyExperienceService.cs +++ b/src/NosCore.Algorithm/FamilyExperienceService/FamilyExperienceService.cs @@ -10,18 +10,19 @@ namespace NosCore.Algorithm.FamilyExperienceService /// Provides family experience requirement calculations for different levels /// /// - /// A ginfo line puts a level 7 family's bar at 640 000 against the 1 900 000 here, so at - /// least that row is suspect. One observation is not enough to rebuild the curve, so the - /// table stands until more levels can be checked. + /// From level 20 the curve is the previous requirement plus a tenth, compounded on the + /// unrounded value and floored, which is why the last rows are not round numbers. /// public class FamilyExperienceService : IFamilyExperienceService { private static readonly uint[] FamilyXpData = [ - 100_000, 250_000, 370_000, 560_000, 840_000, - 1_260_000, 1_900_000, 2_850_000, 3_570_000, 3_830_000, - 4_150_000, 4_750_000, 5_500_000, 6_500_000, 7_000_000, - 8_500_000, 9_500_000, 10_000_000, 17_000_000 + 80_000, 96_000, 120_000, 152_000, 224_000, + 336_000, 512_000, 760_000, 1_136_000, 1_472_000, + 1_800_000, 2_240_000, 2_968_000, 3_848_000, 5_000_000, + 6_816_000, 9_672_000, 14_192_000, 20_000_000, 22_000_000, + 24_200_000, 26_620_000, 29_282_000, 32_210_200, 35_431_220, + 38_974_342, 42_871_776, 47_158_953, 51_874_849, 57_062_334 ]; /// diff --git a/src/NosCore.Algorithm/NosCore.Algorithm.csproj b/src/NosCore.Algorithm/NosCore.Algorithm.csproj index c5b09f9..388feff 100644 --- a/src/NosCore.Algorithm/NosCore.Algorithm.csproj +++ b/src/NosCore.Algorithm/NosCore.Algorithm.csproj @@ -13,7 +13,7 @@ https://github.com/NosCoreIO/NosCore.Algorithm.git nostale, noscore, nostale private server source, nostale emulator - 2.0.0 + 2.1.0 false NosCore's Algorithm GPL-3.0-only diff --git a/test/NosCore.Algorithm.Tests/DocumentationTest.cs b/test/NosCore.Algorithm.Tests/DocumentationTest.cs index 625f2d6..33431ed 100644 --- a/test/NosCore.Algorithm.Tests/DocumentationTest.cs +++ b/test/NosCore.Algorithm.Tests/DocumentationTest.cs @@ -431,7 +431,7 @@ public void FamilyExperienceDocumentation() var resultBuilder = new StringBuilder("# Family Experience Table"); resultBuilder.AppendLine(); - for (byte level = 1; level < 20; level++) + for (byte level = 1; level <= 30; level++) { resultBuilder.AppendLine( $"- Level {level,2} - XP: {familyExperienceService.GetFamilyExperience(level)}");