deestar12 / keeperfx

Automatically exported from code.google.com/p/keeperfx
0 stars 0 forks source link

newdig: Computer Player builds just one of each room even if more are needed. #620

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In r1850 with the -newdig option the CP will capture heroes. However he will 
not build lair space for the Converted/Ghosts/Skeletons.

To reproduce load the attached map, observe blue and wait until he has too many 
creatures to fill his initial lair.

Original issue reported on code.google.com by Loobinex on 17 May 2015 at 11:58

Attachments:

GoogleCodeExporter commented 8 years ago
This and all other rooms (it's only building 1 of each despite that I copied 
old code for deciding if another room is needed). I will try to solve it during 
weekend as it's a high prio issue in my opinion.

A tangential side note, I haven't seen creatures getting annoying by lack of 
space, food or money in a long time (then again I'm not exactly provoking those 
cases often). Is it too easy to keep creatures content currently in KeeperFX? I 
remember how volatile managing the horned reaper was, and that it was FUN (in a 
Dwarf Fortress sense).

Original comment by eatpajdi...@gmail.com on 18 May 2015 at 5:45

GoogleCodeExporter commented 8 years ago

Original comment by eatpajdi...@gmail.com on 18 May 2015 at 5:49

GoogleCodeExporter commented 8 years ago

Original comment by eatpajdi...@gmail.com on 18 May 2015 at 5:50

GoogleCodeExporter commented 8 years ago
It is quite easy to keep creatures happy yes, but I do not believe this differs 
from Keeper95. Having a lair, food and gold is no rocker science, but if you 
run out they will get annoyed. 

Horny will still get annoyed easily if you provoke him in any way or leave him 
idle(or he needs to rest after a fight). Also Warlocks will get angry if 
creatures keep bugging them in the library, demon spawn if you don't train 
them, etc.

On the more difficult maps creatures will get angry.

Original comment by Loobinex on 18 May 2015 at 9:45

GoogleCodeExporter commented 8 years ago

Original comment by eatpajdi...@gmail.com on 22 May 2015 at 7:20

GoogleCodeExporter commented 8 years ago
Ready for test.

Only room I am unsure about (because of how the old I code I copied interfaces 
with the new code) is hatchery. Might be it will not build more than one 
hatchery atm.

Original comment by eatpajdi...@gmail.com on 23 May 2015 at 11:39

GoogleCodeExporter commented 8 years ago
Right, that's r1853

Original comment by eatpajdi...@gmail.com on 23 May 2015 at 12:20

GoogleCodeExporter commented 8 years ago
Once the nightly is available I'll test.

Attached another map for testing with creatures actually needing more hatchery.
Indeed the 'old dig' also never builds more that 1 hatchery.

Original comment by Loobinex on 23 May 2015 at 4:08

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ran TC629_1 and TC620_2 in r1854 and the behavior was not as expected.

Yes multiple rooms are now build. Two new issues have arrived:
- CP now build multiple large libraries before they are needed
- The added lairs are too small

Original comment by Loobinex on 23 May 2015 at 11:49

Attachments:

GoogleCodeExporter commented 8 years ago
Think lair issue was solved in a later commit
Will look into library issue

Original comment by eatpajdi...@gmail.com on 24 May 2015 at 12:04

GoogleCodeExporter commented 8 years ago
r1854 is the latest build there is right now. So if you have fixed the lair 
issue you have not committed that fix.

Original comment by Loobinex on 24 May 2015 at 12:16

GoogleCodeExporter commented 8 years ago
Whoops. r1855 now has it.

Original comment by eatpajdi...@gmail.com on 24 May 2015 at 12:19

GoogleCodeExporter commented 8 years ago
Ran TC629_1 and the original map on r1857 and the lair issue is now ok.

That leaves just the initial-library-problem. Let me know if you want to 
separate that from this issue.

Original comment by Loobinex on 26 May 2015 at 6:08

GoogleCodeExporter commented 8 years ago
Is there a good test case for library issue? I didn't really observe it myself 
(except when it seemed motivated by many creatures being assigned to research).

Original comment by eatpajdi...@gmail.com on 26 May 2015 at 10:48

GoogleCodeExporter commented 8 years ago
Here a save from TC629_1 from r1857.

On TC629_1 observe blue from the start, he builds the basic 5 rooms and follows 
it up with another big library when he has just a few creatures. (On the save 
he has a bit more already because I had to reduce frameskip, but still not a 
single library full of creatures.) 

Original comment by Loobinex on 27 May 2015 at 1:09

Attachments:

GoogleCodeExporter commented 8 years ago
When I'm loading that save (granted, some revision, not absolutely latest) blue 
almost immediately starts moving creatures to research and quickly fills up the 
libraries to the point they're 100% used. Then he decides to build the third 
library. So it seems to me it's behaving correctly (although one might wish for 
it to estimate capacity better and build a single large room at start, although 
that's a matter up for discussion).

Keep in mind, my understanding of room usage is the green bar that fills up, 
and for libaries is also filled up by spells. One room has a lot of spells and 
consequently is full despite having almost no creature researching.

Original comment by eatpajdi...@gmail.com on 29 May 2015 at 7:15

GoogleCodeExporter commented 8 years ago
Unrelated matter with standard AI, possibly deserving its own ticket. It seems 
the default number of imps for skirmish maps (and any maps made not specifying 
it) is far too low. I'm getting the impression it's 3 imps or so, which 
basically makes more a very weak player.

Is it possible to change this in a data file? Otherwise I need to hard code a 
different default for newdig, just like I already did for case when there are 
gems available.

Original comment by eatpajdi...@gmail.com on 29 May 2015 at 7:17

GoogleCodeExporter commented 8 years ago
I really thought I saw the CP build the second library before the first one was 
in use, but I ran it twice more in r1857 and I saw no such thing. So forget 
about it for now, I'll open up another issue when I'm sure.
I did however notice a lot of focus over training (two libraries full, training 
room empty, see save.) Any change there?

As for the unrelated matter, I don't know how you got that impression. The Imps 
are not generated by the game but are preplaced on the map and not all maps 
start with 3 imps. When skirmish maps are placed though, Complayer0 is used and 
that one should build well over 3 imps.
And yes, how many imps a CP builds is dependent on values in keepcompp.cfg

Original comment by Loobinex on 29 May 2015 at 10:02

Attachments:

GoogleCodeExporter commented 8 years ago
I think I also saw it spamming training rooms at some point - maybe it's a 
shared rare issue where it sometimes builds rooms despite not necessary? We 
should keep issue open.

The original algorithm for imp making looks like this:
If spell is possible:
- If we have below minimum number of imps (configurable value), make one imp 
unless we have very low cash.
- If we have below preferred number of imps (configurable value), make if some 
linear function of number of imps, money - payday exceeds some threshold.
- Else do nothing.

What I'm saying is that I think the default preferred number and the minimum 
number is set to 3, but I could be wrong.

Original comment by eatpajdi...@gmail.com on 30 May 2015 at 1:34

GoogleCodeExporter commented 8 years ago
Computer 0, the default, uses this check:

[check33]
Name = CHECK FOR ENOUGH IMPS
Mnemonic = ImpEngh1
; Flags and game turns interval between checks
Values = 0 203
; Function which uses create imp spell if player has not enough imps
Functions = check_no_imps
; Preferred amount of imps and minimal amount of imps; when player has less 
than minimum,
; or less than maximum and spare money, then he will use imp creation spell
Params = 16 9 0 0

I believe that means he will have between 9 and 16 imps.

Original comment by Loobinex on 30 May 2015 at 3:28

GoogleCodeExporter commented 8 years ago
Well I did print out the values and it was set 3 for whatever reason, but I 
guess it was the map then.

Original comment by eatpajdi...@gmail.com on 30 May 2015 at 5:06

GoogleCodeExporter commented 8 years ago
I have seen issues with the number of imps on maps where the CP could not have 
lost the imps. Never could make sure there was a problem, but there could very 
well be.

Original comment by Loobinex on 30 May 2015 at 5:25

GoogleCodeExporter commented 8 years ago
To recap, is there anything more needing to be done before marking this as 
fixed? I agree there are perhaps room sizing issues remaining but I think those 
should be moved into a lower priority ticket.

Original comment by eatpajdi...@gmail.com on 12 Jul 2015 at 7:51

GoogleCodeExporter commented 8 years ago
This is what you said in post #22:

"I think I also saw it spamming training rooms at some point - maybe it's a 
shared rare issue where it sometimes builds rooms despite not necessary? We 
should keep issue open."

In response to post #21 where I said:

"I really thought I saw the CP build the second library before the first one 
was in use, but I ran it twice more in r1857 and I saw no such thing. So forget 
about it for now, I'll open up another issue when I'm sure.
I did however notice a lot of focus over training (two libraries full, training 
room empty, see save.) Any change there?"

Original comment by Loobinex on 12 Jul 2015 at 10:06

GoogleCodeExporter commented 8 years ago
Right, I am forgetful. Tried to optimistically spring clean among open tickets 
because they sprawl like this it's hard to figure out what the status is..

To me it seems like it sometimes builds a room when not 100% full, and that it 
is some issue with the used capacity versus total calculation. I'm leaning 
towards opening its own issue for it however when there's a clear enough repro, 
so closing.

Original comment by eatpajdi...@gmail.com on 12 Jul 2015 at 11:55