Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values from 'Build a Room' processes in keepcompp.cfg shifted, AI can't build dungeon correctly #785

Open
Loobinex opened this Issue Feb 5, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Loobinex
Copy link

Loobinex commented Feb 5, 2018

How a Computer Player builds his dungeon is defined by the AI's defined in KeepCompp.cfg. Mainly the processes that define which rooms to build. Like this one:

[process5]
Name = BUILD A SCAVENGER ROOM
Mnemonic = RoomScavn
Values = 0 3 3 9 4
Functions = check_any_room setup_any_room process_task completed_task paused_task 
Params = 0 0 0 0 0 0

See the 5 values of this process, the first one is the priority, the room is build 3x3, the room number is 9 (scavenger room) and the computer will prefer to build it attached to room 4(Prison)
This is the list of rooms:

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,

However, the last variable is shifted one down. When a room is supposed to attach to a prison(4) it is instead build attached to a Library(3). This is true for all rooms in the list, when a room is supposed to attach to a Lair(14) it will attach to the Garden(13) instead.
There's one exception here though, and that's the ComputerAssistant, which uses the same processes from the same file but correctly. So simply changing the values from the file is not a valid workaround.

Originated from the forum here, which also includes an easy path to reproduce.

  1. Download the following file: room placement test.zip
  2. After making a backup, place the included custom keepcompp.cfg in keeperfx/fxdata
  3. Install and run the included level
  4. Show the full map and enable the default Computer Assistant.
  5. Observe both Red and Blue keepers building rooms. Red will build his Treasury, Research, Hatchery all correctly connected Graveyard(11) and his Lair, Training Room both correctly connected to his Scavenger Room(9) as defined in the keepcompp.cfg.
    Blue will connect his Treasury, Research, Hatchery to the Temple(10) and his Lair, Training Room both connected to the Workshop(8).

This is a major cause why all computer players on all maps build inefficiently designed dungeons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.