Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 33

Thread: commenting keepcompp.cfg

  
  1. #11

    Default Re: commenting keepcompp.cfg

    Quote Originally Posted by YourMaster View Post
    So if a heart is attacked or a hatchery is empty
    It looks like you're right, the AttkHrt1 Event occurs instantaneously then has a cooldown during which it cannot be triggered. It's logical that events would work like that and not be a reoccurring interval check.
    However, in the first place I got this assumption from the RomFull Event because strangely enough it does seem to be a reoccurring interval check despite being an Event.
    This has helped me figure out the purpose of RomFLair/RomFTrsr (since RomFull also applies to Treasuries and Lairs). RomFull is the interval type, RomFLair/RomFTrsr are the cooldown type.

    You mentioned Hatchery, from what I can see there's no Hatchery event, the AI does not care about its food amount and will never build a new one.

    Here's the 4th and 5th room values.
    ; <room_kind> - the room kind to be built
    ; <room_link> - the room kind which we'd prefer to build a connection from; if not available then build anywhere

    The effect of room placement is very evident in that silly screenshot I posted, with that string of training rooms connected together.
    Last edited by rainlizard; February 6th, 2018 at 03:53.

  2. #12

    Default Re: commenting keepcompp.cfg

    That's very useful actually. I actually knew that 4th variable, but the 5th one is completely new and has some potential.

    And I'm pretty sure there actually is a hatchery event, because human players and computer players share events. As a human you hear voice messages or get text messages based on the events, like dungeon breached, creatures fighting, and that includes warning you that creatures are going hungry.
    I have no trouble believing you the computer doesn't do anything with this event though,...

    Here's the list of numbers for the rooms by the way:
    RoK_NONE = 0,
    RoK_ENTRANCE = 1,
    RoK_TREASURE = 2,
    RoK_LIBRARY = 3,
    RoK_PRISON = 4,
    RoK_TORTURE = 5,
    RoK_TRAINING = 6,
    RoK_DUNGHEART = 7,
    RoK_WORKSHOP = 8,
    RoK_SCAVENGER = 9,
    RoK_TEMPLE = 10,
    RoK_GRAVEYARD = 11,
    RoK_BARRACKS = 12,
    RoK_GARDEN = 13,
    RoK_LAIR = 14,
    RoK_BRIDGE = 15,
    RoK_GUARDPOST = 16,
    RoK_TYPES_COUNT = 17,
    Last edited by YourMaster; February 4th, 2018 at 01:13.

  3. #13

    Default Re: commenting keepcompp.cfg

    I've been looking more at deciphering the KeeperFX source instead of adjusting values purely via trial and error. Personally I don't know professional programming languages, I'm a hobbyist that knows Game Maker, so it's been challenging.

    Attck1 Process
    ; Requires EnEntrn1 Check, will not execute until after EnEntrn1; will not execute if Attck1 is already currently running.
    ; The process has multiple conditions in order to execute.
    ; <priority> - priority
    ; <percent_creatures> - percentage of AI's available creatures that will now be compared against <creatures_required>; "available" means not knocked out, etc.
    ; <creatures_required> - compare this amount of required creatures against the amount of creatures defined with <percent_creatures>
    ; <percent_attracted_requirement> - AI's attracted creatures percentage must be higher than this percent; attracted creatures percentage is defined by [active creatures out of MAX_CREATURES]
    ; <#> - unused?
    Either the requirements listed by those values are being checked every 100 game turns (how long the fastest possible Attck1 execution takes), or it's taking that many turns to compute a path.

    AttckSafe Process
    ; Same as Attck1 except it has an extra requirement for the second value
    ; <percent_enemy_strength> - only executes attack when [target enemy creature amount increased by <percent_enemy_strength>%] is less than AI's creature amount
    I don't know how exactly this gels with the rest of the values, I'll look at it later.

    EnEntrn1 Check
    ; Returns position of entrance belonging to most hated enemy
    ; Opponent must have an entrance in order to be targeted
    In a 4 player game where each player starts with a claimed entrance and the AI attacks instantly, all of them will just target the human player. Maybe it's because all their hatred values start out the same and the tie breaker ends up being the player numbers starting with player0? just guessing.

    To make the AI attack instantly:
    -Start a level with a claimed entrance or quickly claim one, so you're targetable
    -Set Attck1's priority to a high number and the other values to 0 to disable the requirements
    -Set EnEntrn1's <game_turns_interval> to 1 (EnEntrn1 is not to be confused with DigEntrn)

    Unfortunately it's not looking great for Attck1. Yes it digs towards its enemy, but during that time the AI will reject performing any future build tasks. Even if you put Attck1 on low priority, when it does eventually start there's no stopping it or doing anything else. If it's a particularly long dig through gold and complex terrain then it can take a really long time to reach the enemy to finally attack them using an empty dungeon of no creatures. Or end up getting rekt by heroes along the way. It often doesn't take the shortest dig route.
    Increasing <max_room_build_tasks> is not helping, I guess Attck1's not considered a build task.
    Maybe I can figure it out tomorrow.

  4. #14

    Default Re: commenting keepcompp.cfg

    I've made a map where I just put blue in the center of the map with lots of space in each direction, and completely reconfigured the KeepCompp.cfg with all the 'room placement' values, but I never saw any result on this. Not a single room was connected to the room I specified, and there was plenty of opportunity.

    Quote Originally Posted by burntonion View Post
    I've been looking more at deciphering the KeeperFX source instead of adjusting values purely via trial and error. Personally I don't know professional programming languages, I'm a hobbyist that knows Game Maker, so it's been challenging.

    Attck1 Process
    ; Requires EnEntrn1 Check, will not execute until after EnEntrn1; will not execute if Attck1 is already currently running.
    ; The process has multiple conditions in order to execute.
    ; <priority> - priority
    ; <percent_creatures> - percentage of AI's available creatures that will now be compared against <creatures_required>; "available" means not knocked out, etc.
    ; <creatures_required> - compare this amount of required creatures against the amount of creatures defined with <percent_creatures>
    ; <percent_attracted_requirement> - AI's attracted creatures percentage must be higher than this percent; attracted creatures percentage is defined by [active creatures out of MAX_CREATURES]
    ; <#> - unused?
    Either the requirements listed by those values are being checked every 100 game turns (how long the fastest possible Attck1 execution takes), or it's taking that many turns to compute a path.

    AttckSafe Process
    ; Same as Attck1 except it has an extra requirement for the second value
    ; <percent_enemy_strength> - only executes attack when [target enemy creature amount increased by <percent_enemy_strength>%] is less than AI's creature amount
    I don't know how exactly this gels with the rest of the values, I'll look at it later.

    EnEntrn1 Check
    ; Returns position of entrance belonging to most hated enemy
    ; Opponent must have an entrance in order to be targeted
    .
    Looking into this, I did not immediately get the results I wanted, but unfortunately both the checks and the processes can only be configured 'unconditionally' in the level-script. The main reason you want to tweak these values is to trigger an attack when the player gets to a certain point or reaches a certain objective. When you can't use any IF-statements on these things, you can only make the computer attack the player from the start of the level, which is generally not what you want.
    Last edited by YourMaster; February 6th, 2018 at 15:05.

  5. #15

    Default Re: commenting keepcompp.cfg

    Quote Originally Posted by YourMaster View Post
    I've made a map where I just put blue in the center of the map with lots of space in each direction, and completely reconfigured the KeepCompp.cfg with all the 'room placement' values, but I never saw any result on this. Not a single room was connected to the room I specified, and there was plenty of opportunity.
    I had only tested by enabling Computer Assistant and assumed the enemy keeper would behave exactly the same because so far they have been identical, except for this. Room placement works as I described it when you click to enable Computer Assistant, but for enemies it's jumbled up.

    I've made a test level and keepcompp.cfg with custom values. You will get the same result every time.

    Click to enable the Computer Assistant and he will correctly build:
    Treasury, Research, Hatchery all connected to: Graveyard
    Lair, Training Room both connected to: Scavenger Room

    Click the dungeon special to reveal map and see the enemy keeper build:
    Treasury, Research, Hatchery all connected to: Temple
    Lair, Training Room both connected to: Workshop

    You can see that enemy keeper is almost somewhat doing it correctly but the room kind numbers are jumbled. I assume bug.
    Attached Files Attached Files

  6. #16

    Default Re: commenting keepcompp.cfg

    Yeah, on your map you can clearly see it. But it seems there are two bugs. The shift in numbers for computer players, and that they somehow ignore this setting if they have to break fortified walls.
    I modified my test-map to remove the walls and change blue into red and than I can see what I want to see. Thanks.

    I've listed the bug. It's clearly a bug as you can see that the room it connects to is always exactly 1 number below the one you'd expect.
    Last edited by YourMaster; February 5th, 2018 at 18:54.

  7. #17

    Default Re: commenting keepcompp.cfg

    Quote Originally Posted by YourMaster View Post
    it seems there are two bugs. The shift in numbers for computer players, and that they somehow ignore this setting if they have to break fortified walls.
    I'm unable to recreate your fortified walls issue, in my test levels the AI digs out the fortified walls and gives the usual result. Any ideas how to recreate?

    However I've discovered a very similar issue, the AI prefers not to place a new room on any pre-existing claimed tiles and would rather dig a new room area from earth. Keyword "prefers", that room placing value is only a preference so there is no bug here. (also <room_link> is probably a more accurate descriptor for the value)

    During testing I also tried swapping red and blue due to the "shift in numbers bug" but I was getting consistent results, so that shift in numbers bug is isolated to itself.

    ; Placement space must not be blocked by other rooms, impenetrable rock, gems, lava.
    ; Priority order of what placement looks for, first to last:
    ; 1. next to the <room_link> room, within diggable earth, not on claimed tiles
    ; 2. next to a random room, within diggable earth, not on claimed tiles
    ; 3. next to the <room_link> room, on claimed tiles
    ; 4. next to a random room, on claimed tiles
    ; 5. room is not placed
    ; Keep in mind "random room" includes the Dungeon Heart and Entrance.

    You'll notice I didn't list "water" in the blocking space list. That's because it bugs out the AI! Imps cross the water, dig out the space, refuse to build a bridge, and then the AI's completely stuck on that build process because it's unable to claim the dug space. There's another obscure bug for you.

    - Testing method -
    Click image for larger version. 

Name:	201.png 
Views:	15 
Size:	36.1 KB 
ID:	1791Click image for larger version. 

Name:	202.png 
Views:	14 
Size:	82.0 KB 
ID:	1792Click image for larger version. 

Name:	203.png 
Views:	16 
Size:	29.6 KB 
ID:	1793Click image for larger version. 

Name:	204.png 
Views:	14 
Size:	30.8 KB 
ID:	1794Click image for larger version. 

Name:	205.png 
Views:	14 
Size:	37.2 KB 
ID:	1795Click image for larger version. 

Name:	206.png 
Views:	16 
Size:	35.5 KB 
ID:	1796
    201.png: The level from 'room placement test.zip' I posted above (remember, <room_link> preferences are set for 'S' and 'g'. But blue player builds around 'W' and 'e')
    202.png: AI will dig into fortified walls to place rooms, but will not place rooms on claimed tiles (both test levels give consistent result)
    203.png: AI will follow the <room_link> preferences to build on claimed tiles, when there is no earth available
    204.png: AI will try to build all their rooms within the provided earth around another room, until they no longer fit so they'll build elsewhere on claimed tiles instead
    205.png: AI is unable to build any rooms, because rooms must be placed next to other rooms
    206.png: AI becomes stuck due to water preventing imps from claiming the dug space

    Also tested placing large 9x9 rooms with only 1 claimed tile in the way. One tile was enough to prevent placement.
    Last edited by rainlizard; February 6th, 2018 at 11:26.

  8. #18

    Default Re: commenting keepcompp.cfg

    Yeah, neither can I anymore.
    It's just that the AI is very inefficient in dungeon building with the double walls between the rooms and the path's they make when digging towards gold. They end up with always having too little space for proper dungeons where a human would have enough.
    I looked into reducing those spaces between rooms, and that is possible but it will make the dungeons worse since the reason for those spaces is to hope it happens less frequently that they just build a new room right into an old one. Because that is exactly what happens a lot when I reduce the distance between rooms.

  9. #19

    Default Re: commenting keepcompp.cfg

    Great thread. Hopefully we can make some good improvements to the computer players!

    In my limited exposure, it's my experience that any challenging computer players typically have built-in advantages over the human player. When it's challenging it's not just because they play really well. I think a lot of companies just don't have time to build very sophisticated AI -- it's very difficult. A typical application to DK computer players would be lower costs of rooms/spells, faster imp digging, less time required for creatures to level-up, etc.

    I'm excited to attempt some AI improvements as suggested in this thread like building bridges and treasure rooms more intelligently. And although it would be nice to make the AI just a really smart player and make it a fair skirmish otherwise, I doubt we will ever get there. Not even close. I think if skirmishes vs the computer are ever really going to be challenging at all, the only way to do that is to give the computer player certain advantages, or at least have multiple computer players that are automatically allied with each other to gang up on the human player.

    Do you think at least the latter is a good idea to start with? It's especially no fun if the computer players just kill each other off before you even get to them.

  10. #20

    Default Re: commenting keepcompp.cfg

    Yeah, in many games computers get some advantages, and that is often required, but if it is too obvious it is also something that people dislike. For example think of a situation where you limit a rival computer from getting to the gold - a valid strategy - only to find out that he never ran out of money and still out-trained you. That leaves the player with a bad taste in his mouth.
    An advantage that usually is accepted is that a computer can do much more than a player at the same time, a computer can for example keep all his units well slapped, while building rooms and can use the sight spell to dig to the perfect locations.
    The thing is, the computer AI was a real afterthought. The game had to ship, there was no AI at all yet, so Molyneux personally coded something within those last two months, and it shows. Not only do the room layouts suck, but the AI's can't do basic stuff like using prisons, torture rooms and temples. Nor can they create layouts and use doors to get rooms to 100% efficiency. And they don't mine well.

    So, playing a skirmish you'll end up against a player with not enough gold to train his creatures, which only train at 60-80% efficiency(so are levels below yours in the same amount of time and gold spent), no heroes converted to their cause and none of the increase-level specials used.

    These are all improvements that are possible, so:
    * Treasure rooms close to gems
    * Digging out all the dirt around gems
    * Using prison/torture rooms. (almost finished in keeperfx default branch, see here.)
    * Sacrificing imps (almost finished!)
    * Using Specials
    * Using Temples
    Eatpajdittsvin was also completely starting to rewrite the AI room placement, but he never finished that. But that is certainly something that's possible to do.

    This all to get the computers at least somewhat on par with humans. If you want to give them advantages to actually be a real challenge, than the most logical advantage to give them is a head-start. Giving them a pre-build dungeon makes a world of difference where they'll get stronger creatures sooner and have more time to train them. That's where the Free play levels come in.
    It's very easy to make a map where a player faces one, of multiple (allied) keepers with a bit of an advantage over the player. Right now that doesn't make sense since the computers are so dumb, but with a few improvements that would be possible.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •