dkfans / keeperfx

Open source remake and Fan Expansion of Dungeon Keeper.
https://keeperfx.net/
GNU General Public License v2.0
748 stars 77 forks source link

AK Lvl 13 Sloth - Orcs are too weak to progress the level. #3466

Open elemanzer opened 5 days ago

elemanzer commented 5 days ago

According to the lubiki AK walkthrough, the orcs in this level should have no trouble taking out the samurai. Instead, they get absolutely reamed on keeperfx.

Youtube videos for this level (on kfx) also have comments advising against playing the level on later versions of kfx.

See kfx versus vanilla under the same conditions.

On kfx: https://github.com/user-attachments/assets/4d99b831-2d44-44e3-8d29-89a04e808836

On vanilla: https://github.com/user-attachments/assets/adf61af5-5271-4677-8530-9c21df3f36a5

Loobinex commented 5 days ago

The level can still be completed, and people do. You need to split up the Samurai.

That being said, I fully agree that it is not as it was originally even though AK uses the legacy ruleset to emulate the original bugged stats. I would have no problems with further updates to the ruleset to improve this.

It would need somebody who would be willing to compare the legacy balance of all creatures and heroes against each other in low, medium and high levels and see what needs to be tweaked.

elemanzer commented 5 days ago

@Loobinex

The level can still be completed, and people do. You need to split up the Samurai.

I doubt this is realistic on current keeperfx versions. At the very least it'll take 20-30 tries to get the RNG and micro just right to survive 2 waves of samurai.

AK uses the legacy ruleset to emulate the original bugged stats.

Actually AK seems to be using /levels/legacy_crtr where orcs are set as str = 48 and dex = 45. This is different from the settings in both /config/creatrs and vanilla, both of which set orcs at str = 65 and dex = 60. Restoring just these two attributes makes things run a lot more as expected although a modicum of micro and RNG are still required to keep all 12 orcs alive. See video below:

https://github.com/user-attachments/assets/84f5bc74-2587-4dd6-ad33-44aa11084a34

It would need somebody who would be willing to compare the legacy balance of all creatures and heroes against each other in low, medium and high levels and see what needs to be tweaked.

How would you go about this? Even if you time hundreds of simulations of creature vs. creature battles on vanilla, the speed spell being persistent on kfx changes the game drastically. An orc vs. samurai could be balanced like legacy since both have speed, but orc vs. wizard? I don't think it's possible to completely mimic legacy balance unless you give each creature dynamic stats based on which creature they are fighting.

elemanzer commented 5 days ago

@Loobinex

It would need somebody who would be willing to compare the legacy balance of all creatures and heroes against each other in low, medium and high levels and see what needs to be tweaked.

Giving this more thought, is there a way to give creatures perma speed in old DK? Doesn't have to be a permanent bug fix as the goal here is just to meaningfully time battles between permanently sped up creatures on old DK for later transplanting into keeperfx legacy cfgs. From there it would just be a matter of tweaking the attributes in legacy keeperfx until both line up.

Loobinex commented 4 days ago

@elemanzer yes, people have been defeating this level in keeperfx, and I think it is far too hard too. It is actually easier in current versions of keeperfx compared to very early versions which had no special rule set.

Orcs received lower strength to compensate for the fixing of the strength bug. In the original game they would cap at 255. But you could set speed spell power to a really low value in the legacy configs I think. Also I am not sure if the strength value was set before the OVERFLOW_8BIT classic bug was introduced.

All in all, yes, it would be quite a time consuming job to balance around all things. Personally I have not been that interested there and would just avoid Ancient Keeper, but I would be more than happy for others to look into this. One approach would be to restore all creature stats to original, and try to see where that still goes wrong with classic bug mode, and see if that mode could be improved.

elemanzer commented 3 days ago

@Loobinex

Damn, forgot about the overflow bug...

In any case, regarding the current issue, it looks like legacy config is used only by ancient keeper and post AK. Orcs don't play much of a role in the campaign's levels (at least up to lvl 15, dragonia which is where I'm at in the playthrough) so setting them back to str = 65 and dex = 60 either globally for all ak/pak levels or restricting the change to this specific level seems like it would work well and is the simplest solution. There's room to make the stats a tad lower even, in which case they wouldn't get as much of an advantage over the no-speed creatures in the level (wizards & knights).

As for completely overhauling legacy balance, I'm looking to take this on myself but I'm late to this game and there's a lot I don't know. I'll start a separate issue once I give it some more thought and figure out a possible way forward. A quick question in this vein if you would be so kind, though:

Where do lvl 9 and 10 creatures get their speed spell duration from on keeperfx? In old DK, lvl 9 creatures got it from MAGIC_SPEED power 8 and lvl 10 from MAGIC_PROTECT cost 0. In keeperfx I see only 9 values under /config/fxdata/magic.cfg/POWER_SPEED.

Loobinex commented 3 days ago

O shit, that is a problem yes. Both level 9 and level 10 creatures get it from the level 9 power, so it's not possible to 'configure' the value.

There's also maps on the workshop that get configured to use 'legacy' if it is found they need classic bugs to work. And people are free to put all custom maps in legacy if they are purists.

elemanzer commented 3 days ago

@Loobinex

There's also maps on the workshop that get configured to use 'legacy' if it is found they need classic bugs to work. And people are free to put all custom maps in legacy if they are purists.

So in testing the overflow bug was mostly a non-issue in old DK. Despite what the wiki says, lvl 10 Hornys consistently wipe the floor with lvl 6-9 Hornys and lvl 10 Samurai consistently beat lvl 9 Samurai. There are a few cases where lvl 9 creatures consistently beat lvl 10 (mistress9 vs mistress10, troll9 vs. troll10) but these come so close, it could be fixed by simply fixing the speed bug. But for the most part 10 > 9 in old DK. That leaves some imbalance in more obscure cases which is mostly where the overflow bug rears its head (e.g. Horny2 > Horny3, Horny 8 > Horny 9).

Since the legacy config caters to purists, the cleanest solution would be to reintroduce the bugged stats and speed bug that levels have already been designed around. If it's just AK/PAK we're talking about, there's little harm to game balance if you wanted to keep the speed bug fix which would address the few 9>10 cases.

If you agree, I can start an issue outlining the change for more feedback and begin calculating bugged attribute values and testing them on kfx. Lvl 10 creatures would still need a separate column to define the lowered spell power though.

Edit: Would also need a way to define specific attribute values per lvl instead of using a % modifier.

Loobinex commented 2 days ago

Funny you mention that, I believe a horny already suffers from the overflow bug at level 6, if not 6 then 7. Also, when you tested, did you make sure you gave them enough time to charge up their speed spell at the start of the level?

elemanzer commented 2 days ago

Yeah my script uses 600 game turns + 60 before spawning to give things like speed and freeze time to recharge.

With reapers, overflow begins at lvl 3 with a huge drop in dex while strength bug caps to 255 at lvl 4. My best guess for what's happening in lvl 6 v 10 (from looking at the stats) is that both have 255 str, small dex gap of 30 points, and the huge skill/defence disparity is more than made up for with the 3000 additional hitpoints at lvl 10. You can see it in all its glory below.

The problem is that Level modifier provides a uniform increase in stats and therefore can't make a lvl 2 reaper stronger than lvl 3 as it was in old DK and if that's the kind of thing a legacy level was designed around. There's also no way to go from 255 str cap to 622 without expecting major balance issues on levels designed for 255.

The most I can think of is fixing the speed bug and additionally trying to increase the gap between select cases where the OF bug is most apparent - like lvl 2 v 3 or 7 v 8 reaper. Changing stats at both levels something like 5-10% in both directions until the higher level consistently beats the lower level creature again. For this there would need to be a way to explicitly define stats per level instead of using the modifier. Purists who want pure legacy won't be happy though.

https://github.com/user-attachments/assets/d4495eb0-b9a2-4955-88fc-aed6d010e487

elemanzer commented 2 days ago

@Loobinex

Here's a draft of the bugged stat values.

dk-original-bugged-stats.zip

Loobinex commented 2 days ago

I guess a good start would be to add a 10th power level on powers.

Loobinex commented 2 days ago

@Loobinex

Here's a draft of the bugged stat values.

dk-original-bugged-stats.zip

Your math seems to check out to me. It is weird though, because 150 is very decent dexterity still, but even in your video you notice the reaper misses almost all his attacks. What gives?

Also, see PR #3472 , would you be interested in finding the values for the bugged spells in dk1?

elemanzer commented 2 days ago

@Loobinex

A 255 DEX stat against a creature with 1 DEF/SKILL stat yielded a hit chance that looked to be (eyeballing it) about 90%. If we assume hit chance from DEX and dodge chance from DEF are evenly split (big assumption), that lvl 6 HR has a 32% hit chance which is further weighed against the LVL 10 HR's 6% dodge chance. There are likely finer details to the mechanics but this is my best guess without running a study.

3472

Sweet! Well there are only something like 5 creature spells (including speed) that may be borrowing stats in a buggy way from MAGIC_SPELL with the rest coming from SHOT_SPELL. I'll verify where creatures are getting things like lightning spell power from and update you.

elemanzer commented 1 day ago

Tested and apart from SHOT_LIGHTNING, everything else comes from MAGIC_SPELL. Here are the bugged values.

spells-bugged.zip

Loobinex commented 1 day ago

Tested and apart from SHOT_LIGHTNING, everything else comes from MAGIC_SPELL. Here are the bugged values.

spells-bugged.zip

Thanks. I entered the legacy values on the PR. Are we saying that if we use that PR and restore all the creature stats as they were in the original game, we get the exact original balance? Since we have OVERFLOW_8BIT classic bug enabled.

If you want to try, you can download that prototype here.

elemanzer commented 19 hours ago

@Loobinex

Are we saying that if we use that PR and restore all the creature stats as they were in the original game, we get the exact original balance?

Hard to say with all the development and changes in kfx. The only thing I can do is test and report. I take it this means you're opting for the purist approach for legacy with overflow, strength and speed bugs all reintroduced?

Since we have OVERFLOW_8BIT classic bug enabled.

Did not realize this was a thing. Why on earth were the stats changed in the first place? I guess I'll find out while testing...

Loobinex commented 18 hours ago

@Loobinex

Are we saying that if we use that PR and restore all the creature stats as they were in the original game, we get the exact original balance?

Hard to say with all the development and changes in kfx. The only thing I can do is test and report. I take it this means you're opting for the purist approach for legacy with overflow, strength and speed bugs all reintroduced?

Legacy has always been the mode for purists. And the OVERFLOW_8BIT is already enabled in legacy mode anyway.

Since we have OVERFLOW_8BIT classic bug enabled.

Did not realize this was a thing. Why on earth were the stats changed in the first place? I guess I'll find out while testing...

I do not know, it was ancient history, before I got involved. Perhaps they changed the stats before they classic bugs were introduced and then never changed back. I do know that in early versions of KeeperFX ancient keeper was truly impossible, that's why campaign specific configs were introduced.

elemanzer commented 16 hours ago

@Loobinex

Happy to help get things squared off again then. Did some initial testing on the 1460 prototype to that end:

All the bugged lvl 10 spells work as desired except POWER_SIGHT. Warlocks appear to get their sight spell power from POWER_VISION instead and changing that value worked as intended.

It looks like STR values overflow instead of getting capped at 255 and I don't see a separate entry in rules.cfg for applying a strength bug. On old DK the logic for strength is basically: If (STR >= 256) STR = 255

This may be the actual source of a lot of the imbalance I saw throughout the AK campaign.

Still have to test dex, def, armour and luck but this will take some back and forth between old dk and kfx.

Loobinex commented 10 hours ago

I can quite easily set the max strength to 255 with this classic bug enabled, but it looks to me strength currently is simple left alone to grow in classic bug mode. Agreed?

I updated the PR with a strength limit of 255 and POWER_SIGHT restored on sight spell: https://github.com/dkfans/keeperfx/actions/runs/10967814336