Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Imps pick up incorrect tasks (even when assigned) #777
On Keeperklan and the GOG forums many users have been complaining they can no longer keep their treasure rooms filled. Looking into it, the problem seems to be caused by imps going rogue. I'm aware that by design the imp priorities have changed and that imps won't mine gems indefinitely, but they also don't behave according to the new design.
Compare this map in the latest or any recent (0.4.6) build, to the original game or the 0.4.4 release. Start the map, and select the gems. Notice that in 0.4.4 the imps will mine the gems and keep mining. In 0.4.6 they will start to fortify walls and pick up many tasks. I would say this is still acceptable, and could be by design.
Important to note is that the faulty behavior seems to be more closely related to fortifying walls than mining gems. Without manually assigning imps the walls are fortified before even the unclaimed path is claimed.
The desired behavior should be that:
I found the bug in the code here.
In spdigger_stack.c, look at this:
digger.task_repeats is always 0 here, therefore this condition is always true, so imps will always pick up a new task each time they bring gems to the treasure room. What is supposed to happen is that imps mine gems 10 times in a row before looking for a new job.
An added improvement on top of this bugfix would be to allow imps to continue mining gems for longer if there are only low-priority tasks like fortify remaining, but just the fix already makes a big difference in how much gems are mined.