dkfans / keeperfx

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

Computer player must use doors to make rooms more efficient #481

Open mefistotelis opened 9 years ago

mefistotelis commented 9 years ago

Originally reported on Google Code with ID 481

When the computer player has enough gold and a workshop, he does place some doors, but
he does so seemingly random.
The computer player would become better if he would place the rooms in such a way to
make his rooms more efficient.

Reported by Loobinex on 2015-01-01 22:30:10

mefistotelis commented 9 years ago

Reported by Loobinex on 2015-01-03 02:15:18

mefistotelis commented 9 years ago
I don't think I understand the issue. Do you have any demonstration of that?

Reported by mefistotelis on 2015-01-04 12:07:32

mefistotelis commented 9 years ago
The way it builds rooms should be changed then too. 

It often makes rooms with 2 tile corridors between them. You would think it does that
so it can make the room bigger later on (Like in DK2) but it never does that. so it's
a bit useless to do that then.

To be more on topic,

I do think it would make sense that the AI only places the strongest doors available.
(or upgrade them a long the way) At least the most toughest AI should do that. 
Now it would just place doors that are available and mostly those are wooden and braced
doors when they all are available. 

Reported by Krizzie88 on 2015-01-04 12:55:22

mefistotelis commented 9 years ago
Quite simple really. See attached screenshot I just made. I gave blue enough gold to
never sell traps/doors and waited a lot of paydays.

Notice he build quite a few doors, but raised not a single room to maximum efficiency.
Door placement seems random to me, a human player would never place them like this.

If you have a reinforced room, placing a door on all exits boosts efficiency. That's
what he should do. Look at the biggest room with fewest open exits and place a door
on one of those exits, repeat. This way room efficiency is accomplished the quickest
with least amount of doors.

Reported by Loobinex on 2015-01-04 13:06:29


mefistotelis commented 9 years ago
Are you sure the places where not door was placed are just empty? didn't he had any
traps as well?

Reported by mefistotelis on 2015-01-06 21:34:16

mefistotelis commented 9 years ago
Modified the level to only have braced doors available, no other doors, no traps. See
new screenshot.

Are you saying the CP should not be placing the doors at random?

Reported by Loobinex on 2015-01-06 22:38:37


mefistotelis commented 9 years ago
There are specific rules of where computer player places doors. The order of placing
is random, but the amount of places being checked it limited and definitely not random.

Simplified rules:
- Place doors at four sides of rooms
- Do not place two doors just next to each other

Reported by mefistotelis on 2015-01-07 06:21:01

mefistotelis commented 9 years ago
OK.

Being fully random is not efficient,... you need all exits doored-up to get to maximum
efficiency, when you have many rooms it could take a long time before you randomly
fill all exits.

The rule to not place two doors next to each other conflicts with the fact that the
CP often makes hallways of 2 tiles between two rooms, causing at least one of the rooms
to never reach maximum efficiency. Given that rooms can have up to 4 neighboring rooms
in combination with the random placement; this could significantly affect the amount
of rooms that reach maximum efficiency. In fact, it is rare to see it at all.

Reported by Loobinex on 2015-01-07 10:17:24

mefistotelis commented 9 years ago
And not forgetting that it will place traps on door "spots" as well. 

Reported by Krizzie88 on 2015-01-07 18:50:47

mefistotelis commented 9 years ago

Reported by eatpajdittsvin on 2015-04-30 17:32:49