dkfans / keeperfx

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

Computer player refuses to mine gold #604

Open mefistotelis opened 9 years ago

mefistotelis commented 9 years ago

Originally reported on Google Code with ID 604

Start the attached testmap in r1813. Notice blue refuses to mine gold at all and will
go broke even though his base is surrounded by gold.

Behavior is related somehow to map layout. This map behaves the same in 0.4.5.

Reported by Loobinex on 2015-05-04 17:52:21


mefistotelis commented 9 years ago
Additional note: The CP doesn't seem to mind not having gold at all, he will not assign
creatures to the workshop either.

I've tried putting a portal on the map to see if this would make a difference, but
it did not. Blue would dig for the portal but not go after gold.
Looking at compuchat the CP did continue to try and pick up gold from the floor after
all the gold on the floor was gone.

Reported by Loobinex on 2015-05-04 22:26:21

mefistotelis commented 9 years ago
The problem seems to be caused somehow by the fact that the dungeon is built directly
against the gold. If some dirt is placed between the gold and blue dungeon the gold
will be mined.

Reported by Loobinex on 2015-05-04 23:40:13

mefistotelis commented 9 years ago
Have observed behavior like "not digging for gold" in campaign. Will investigate when
I have time as a goal of mine is to make AI be a decent challenge - bugs like this
completely destroys reason for me to play campaign since there's no opposition. :(

Reported by eatpajdittsvin on 2015-05-11 21:17:17

mefistotelis commented 9 years ago
Getting a more challenging CP would be very nice. Having the CP not mine gold goes beyond
‘not challenging’, it is simply broken. Either you win straight away without a fight,
but it is also possible that a map becomes unwinnable. For example for issue #612 I
received a message from somebody who was replaying the NG+ campaign and found out that
in level 5 the CP walled himself in. So fixing bugs with the CP is very important,
but I say a different matter entirely.

For actually making the CP more challenging it needs to adopt some simple human like
behaviors. Also note that there quite a few limitations a mapmaker can work around
by giving the CP a pre-build dungeon, a different creature pool, fewer spells to research
or even starting creatures, but also limitations that currently have no workaround.
So keep in mind when making improvements to the CP if you are going for challenging
custom maps, or if you want a challenging opponent in -1player mode.
I think currently the biggest gameplay improvements to the CP would be:
-   Better focus on training.
-   Research only with creatures that are good at it (if available), and further reduced(near
zero) focus on research when all rooms are researched.
-   Getting a strong creature composition by getting rid of weak creatures.
-   Building treasure rooms close to gold.
-   Building libraries with a single entrance or out of the way.
-   (Re)build and defend bridges to attack, mine, collect prisoners etc. (Right now capturing
and selling his bridge makes you safe from an attacking keeper.)
-   Capture and converting heroes/creatures (you’ve made a great start here).
-   Stop destroying his own walls/rooms to dig out other rooms.
-   Use empty but claimed spaces to build new rooms. (Right now if you give the CP some
5x5 empty spaces to start out with he will not use those effectively.)
-   Using doors to get rooms to max efficiency.
-   Using level specials.

Reported by Loobinex on 2015-05-12 00:28:34

mefistotelis commented 9 years ago
By the way, the original campaign has some maps where the CP does not dig for gold because
he starts out with more gold than he would ever need.

Reported by Loobinex on 2015-05-12 00:30:18

mefistotelis commented 9 years ago
Risk getting off-topic, but: I've got a long google doc covering what I'd like to do
with AI, just got to get the time. :P I'm also somewhat careful to spend too much time
discussing this as it's possible to talk forever about hobby projects (rather than
do).

To answer the biggest of your points, nonetheless:
- Gold/digging/room build behavior is among the most extensive and difficult to change
and make intelligent. I might be able to special code new build treasury room behavior
to optimize for gold/gem mining. But there's so much more to take consideration of
in reality; in particular locations of enemies and neutrals. DK AI back when originally
written had much less CPU time to do with so it's not surprising it's not using any
whole map analyses.
- Training is a big deal and it's way too easy to just out-train AI atm, agreed. All
the same, I'd prefer to fix economy to the extent possible first, because without "fuel"
there's no way to do training.
- Getting rid of crap creatures is on my TODO list, just need to be careful to work
well with map designer constraints (don't want to drop beetles if they're only available
creature on map, as obvious example).
- Thanks for reminding about bridge capture exploit, that should indeed not be so easy.
As a side note, I'd have liked better if game didn't allow you to drop creatures on
bridges as it's too easy to zero-effort pass water/lava, but I don't think game rule
changes are very realistic (they would be debated).

I don't think there's any opposition in working towards both a better -1player opponent
and better opponent for designed maps; for the latter one just needs to ensure behavior
can be customized.

Reported by eatpajdittsvin on 2015-05-13 21:37:22

mefistotelis commented 9 years ago
There's no opposition in working towards making both better, but having a clear goal
helps prioritizing and focus.
I'd love to see the doc of course.

I have no objection if you want to prioritize economy over training, but realize two
things:
1) Mefisto has recently made quite a few improvements in the economy department. Issue
#204 is still a very important one that is still open, but otherwise the CP has some
prety good gold management.
2) Even if you give the CP limitless gold the training is still sub-par. I recently
did a test on DD-map Morkardar, and in Keeper95 on an unchanged map the creatures were
better trained than in KeeperFX when I gave the CP limitless gold.

Reported by Loobinex on 2015-05-13 22:44:56

mefistotelis commented 9 years ago
Doc is random notes in Swedish unfortunately. I'll write you a mail before I think of
implementing/improving something so it can be discussed.

Good point regarding CP doing poorly even with limitless gold. That raises priority
of improving training itself. I have 4 free days in a row now so hopefully I can do
something about either the no mining bug or that, will see what's possible in this
time span.

Reported by eatpajdittsvin on 2015-05-14 10:30:24

mefistotelis commented 9 years ago
From this topic: https://keeperklan.com/threads/4949-Ids-Habbening/page2?p=49714&viewfull=1#post49714

Another map where for some unexplicable reason the CP won't mine gold. Looks like the
same bug.

Reported by Loobinex on 2015-05-16 15:20:54


mefistotelis commented 9 years ago
On r1850 with the -newdig option it works well on both the original map and woudo's
map.

Reported by Loobinex on 2015-05-18 00:02:21

mefistotelis commented 9 years ago
you've tested these with 0.4.5 and 0.4.6, right?

Could you try a very old version, to determine whether it's a regression or bug which
was always there?

Reported by mefistotelis on 2015-05-18 09:47:24

mefistotelis commented 9 years ago

Reported by mefistotelis on 2015-05-18 09:47:51

mefistotelis commented 9 years ago
Bug is already there in 0.4.4.976. It is as far back as I have.

Reported by Loobinex on 2015-05-18 12:59:32

mefistotelis commented 9 years ago
The bug is also there in Keeper95.exe

Reported by Loobinex on 2015-05-18 23:33:09