BrogueCE icon indicating copy to clipboard operation
BrogueCE copied to clipboard

Allied kraken can't learn abilities

Open tmewett opened this issue 2 years ago • 1 comments

There is a bug in CE1.11 where an empowered Kraken will not feed and learn abilities. I have save file where the empowered Kraken can be fed a vampire bat but will not eat the corpse. Back in 1.7.5 days I tried to run a contest with a save file like this, but the save file was busted for most who tried. Any love for making the contest a reality in CE1.11?

https://cdn.discordapp.com/attachments/647802299783184384/1053655416686518403/Saved_79108619867_vb.broguesave

tmewett avatar Jan 24 '23 16:01 tmewett

I looked into this issue - I was able to get the Kraken to feed repeatedly and was about to declare this no-bug. But then it failed once and took awhile to figure out what was happening.

The function Combat.c :: anyoneWantABite() performs checks to see which allies are close enough to the target, ready to learn, and can pathfind to it.

The root cause is that only one kind of pathfinding is performed, the call to calculateDistances() has blockingTerrainFlags set to T_PATHING_BLOCKER, which includes deep water, lava, chasm, etc.

Thus, if the ally is a Kraken in deep water, or a Dragon over lava, or a pixie over a chasm when the check is made, then they fail to feed, even though they are able to cross the terrain to the target. If they are over normal walkable terrain, then the check succeeds and feeding takes place as expected.

Fixing this requires separating the allies into mobility groups (walk, swim, fly, fire), then perform the pathfinding for each group with the appropriate terrain flags.

brturn avatar Feb 24 '23 02:02 brturn