PDA

View Full Version : Looking for info on a bug - Imps will preference the DH to store gold and overload it



Metal Gear Rex
September 8th, 2017, 07:19
There's a bug that seems to exist even in vanilla DK2 where Imps will consistently prioritize dropping Gold off at the Dungeon Heart instead of a Treasury, even if the Treasury is closer. It can be a pretty severe bug as Imps will actually keep depositing Gold at the Dungeon Heart even if it's full, resulting in loose gold on the DH tiles similar to if you dropped Gold on a full DH or Treasury manually.

The problem is that the DH room tiles don't have the same special properties as the Treasury, properties that the Casino also shares. Gold on Treasury / Casino tiles seems to be hardcoded so that it cannot be picked up by anyone but Imps, and this is how the Casino functionality with the Rigged setting works essentially to prevent creatures from just picking the Gold back up. This actually results in another bug where if a creature is knocked unconscious on a Treasury or Casino Tile, they'll drop all their gold. So as a result of the Dungeon Heart not having those special properties, any creature, especially and most problematically a new creature as the portal is usually close by, can pass by and just pick up the gold. This is a pretty big bug that can go unnoticed, resulting in hefty losses of gold.

The bug seems to occur within specific Imps' AI, as I've had both Imps that act 'normal', preferencing the Treasury over the Dungeon Heart, and those that are 'special' or 'retarded' and will consistently drop gold off at the Dungeon Heart even if it's full. In my experience, killing off the bugged Imps seems to actually fix the issue. Additionally, it seems to be the same maps that have the issue. I can't name official maps as it's been so long since I've tried them, but in my remake of Level 11b within my balance patch / mod, the bug does seem to consistently occur. Most official maps also seem to give the player way, way more gold than necessary and vanilla DK2 creatures are cheap, so it's also easy for the bug to go unnoticed there.

So I'm basically looking for any information on this bug so I can figure out a way to work around it. For anyone who catches this bug, does it happen on the same map with a set of Imps or is it all Imps? Does sacking then replacing the bugged Imps make it better? Does it make a difference if sacked / replaced before and after a Treasury is built? Maybe the room they're spawned on? If you're a mapmaker, maybe try removing any starting Imps and see if that does anything. Any consistent pattern across bugged maps, like Dungeon Heart layout? Finally, what version do you use?

These questions also do reveal my current theory on what might cause the bug, but I haven't confirmed it yet so I still want to experiment. Maybe others can experiment as well. I'm not sure if version even matters because I've found a few bugs that exist across all versions, this could just be another thing that went unnoticed.

DBlac
September 8th, 2017, 10:35
Gotta tell you, over a decade of playing that game i've never seen that bug. Maybe it has something to do with a more recent community patch if youre using one?

Metal Gear Rex
September 8th, 2017, 11:25
Gotta tell you, over a decade of playing that game i've never seen that bug. Maybe it has something to do with a more recent community patch if youre using one?

I don't use anything that modifies the game files, only the level files, which is all what my patch does, basically. I did test it again on a map where I confirmed had the problem and reset all configuration changes back to default DK2. I did manage to reproduce it, although it was difficult because I don't really understand much about what causes the bug for sure. But it is there in vanilla DK2 too.

Thing is, I didn't know this glitch existed either and I played this game non-stop when I first got into it and kept playing it until, well I guess I'm still playing it although there were a few hiatuses. I only began to notice due to my patch ramping up the difficulty where decisions and resources actually mattered. That's when I started noticing strange instances where I seemed to have unreasonably low gold. I started paying attention to it more from then on.

Did you know about the Workshop Glitch (https://keeperklan.com/threads/2871-Workshop-Glitch?highlight=)? I guess it's more of a manufacture glitch. Basically, the first item you manufacture will set the precedent for all future manufacture items. Everything after it will have its manufacture cost overwritten by the first item manufactured, so you can increase your manufacture rate by building a Wooden Door or Barricade first, but also decrease it by building a Magic Door first. I never knew this glitch existed because in vanilla DK2, manufacture rates of creatures is relatively high, but I lowered it in the patch, so then I started to notice the problem. It exists in every version too, or at least in 1.3 and 1.7, so it's probably safe to assume every version.

Speaking of which, I still have no idea how researching works. Research values don't quite do what you'd think they'd do but they definitely do something, I just don't know exactly what. Found out about that because at one point the patch had Salamanders with a research value of 1, and while Warlocks had a research value of 10, a group of like 5-8 Salamanders researched much, much faster. Funny that.

DBlac
September 8th, 2017, 12:23
Wow. That game sounds like it's been programmed like the avarage present day Bethesda Studios title. In other word with duct tape and prayer. It is highly likely i havent noticed these bugs and theyve been happening to me. Being a developer now myself i cant help but think releasing a game with such glaring faults even at that time, no especially at that time is just shameful. These are things we get during this early stage in development in LoN and look to squash such bugs even now. How could this have ever gotten through?

Metal Gear Rex
September 8th, 2017, 12:50
Wow. That game sounds like it's been programmed like the avarage present day Bethesda Studios title. In other word with duct tape and prayer. It is highly likely i havent noticed these bugs and theyve been happening to me. Being a developer now myself i cant help but think releasing a game with such glaring faults even at that time, no especially at that time is just shameful. These are things we get during this early stage in development in LoN and look to squash such bugs even now. How could this have ever gotten through?

I'm pretty sure DK2 was rushed / generally uncared for. There's a lot of crap like this. Like my favorite example to demonstrate the laziness of the programming is how the Barricade is literally just a door that defaults to locked and projectiles go through it completely (similar to an open door).

DBlac
September 8th, 2017, 13:10
Holy shit hahah this is hilarious. I need you on the Discord channel for LoN as soon as it's up, i think our programmer would lose his shit if you told him everything about this crap :D

Metal Gear Rex
September 8th, 2017, 13:22
Holy shit hahah this is hilarious. I need you on the Discord channel for LoN as soon as it's up, i think our programmer would lose his shit if you told him everything about this crap :D

I only have so much ammunition before you guys kick me off.

DBlac
September 8th, 2017, 13:26
We do not kick people off. We fire them. Out of a cannon. Into the sun.

Hapuga
September 8th, 2017, 19:01
MGR, for what its worth, I noticed that behavior patters are at least somewhat connected to the map layout itself. Similar to how imps will mindlessly dig on a gem deposit even if AI has already maximized treasury. As a result AI stales, and just digs gold, doesnt even build hatchery or layer.

I noticed that sometimes shifting shit around may be beneficial. I noticed that single patches of gold are treated poorly by the engine, but larger patches are recognized more easily. Also gold put on the border of the map is frequently ignored, but gold closer to the mid are is recognized rather well (except of the very center of the map, that is also somehow ignored).

I like the Swiss Cheese map, problably my all time favorite. It presents several issues: Green keeper never develops but runs for portals, and never digs out his gold. yellow develops fairly well, ignores mid, goes for portals. Blue turtles, and joins the portal rush last, and usually rekks both green and yellow. I remember messing around A LOT in SC, and I remember getting it to the state where all 3 AIs acted naturally, and the game was infinitely more fun to play. It was all in proximity: where gold is, how far portals are, etc. I changed layout through trial and error, and the game became much better. I even ended up losing once, which was an amazing surprise, as AI NEVER digs up to you first on that map.

Metal Gear Rex
September 9th, 2017, 02:59
It would explain why I've seen the bug on particular maps but not quite others as much. I've always dreaded having to get this in depth working with the AI, but I guess that's really the next step to mapmaking. I noticed this myself a bit with the remake of Level 9, I had that intro cutscene with the Heroes battling a Keeper but the outcome would become significantly different if I ever did tweaks on the map and I'd have to rebalance the whole thing, it sucked.

Both Skarok and I also noticed differences in Keeper behavior based on who was playing. We'd run test to see what the AI does if the player has no input, and it was always the same thing for one player, but it would still be different for another player.

I'll have to keep a close eye on Imp behavior during tests throughout the production of new maps. It's still possible that there's specific ingame conditions / sequences triggering the bug that I just haven't managed to pin down.

Saeva Veritas
May 11th, 2018, 07:52
While this thread is several months old, I have recently come across it and decided to test this myself. I had set up a map section with a single gold block with a treasury that is 4 tiles away east but with a wall of solid rock resulting in a long walk to it and a treasury 8 tiles to the south but unimpeded; the Dungeon Heart was 11 tiles away to the south-east. From my testing methodology over several tries the imps would consistently attempt to drop off gold at the treasury that is 4 tiles away geographically from their position and completely ignored the treasury 8 unimpeded tiles away; I did not observe them dropping off gold at the DH. The journey to the 4 tile treasury is substantially longer (about 40 tiles walk) than to the 8 tile one. It seems that imps will prioritize gold drop-off points that are the fewest map blocks away from where they were mining regardless of obstructions or the length they would have to walk to reach said drop-off.

There is more testing that can go into this but from my quick testing and analysis this bug did not exist. I was using GOG 1.7 by the way.

Metal Gear Rex
May 11th, 2018, 12:35
There is more testing that can go into this but from my quick testing and analysis this bug does not exist. I was using GOG 1.7 by the way.

Are you calling me a liar?

I use 1.3 and at this point, I'm not sure if it's possible to surprise me with any level of stupidity when it comes to the AI pathfinding, bugs, or really anything in this game. From my experience with this bug, it would occur on certain specific maps consistently, although I don't remember seeing any pattern in the maps of which it did occur, at least no pattern that was theoretically also present in other maps where the bug did occur. I only really started noticing it within my balance patch, so it's possible that either A) I somehow accidentally introduced the problem or B) I didn't notice the problem before because it didn't really matter. There's lots of things in DK2 that I didn't notice until after I started working on the patch, like the Manufacture bug. I don't really have time to test this sort of stuff anymore, as any time I spent on the game I'd rather have it spent doing something more enjoyable.

Saeva Veritas
May 13th, 2018, 05:57
If that is how you want to interpret it then by all means. I am merely am reporting my own findings in regard to this bug and did not experienece. I should have said "did not exist" as opposed to "does not exist" I'll admit though.