Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Is it possible to 're-prioritize' creatures?

  
  1. #1

    Default Is it possible to 're-prioritize' creatures?

    I've been having a lot of fun messing around with the files in KeeperFX. I like creating my own 'balance' (i.e. buffing Spiders, but making them require Prison to enter the dungeon) to match the levels I create.

    Both in the original game and KeeperFX, there seems to be a 'tier' for creatures, such that 'lower-tier' creatures (i.e. Flies and Beetles) will have a significantly lower chance of entering your dungeon over a Dragon or Bile Demon provided you have the required rooms for these 'higher-tier' creatures. While in story mode it creates an enjoyable and progressive experience, I don't really find it fun to play with the same 'higher-tier' creatures (while benching lower-tier creatures) in every single multiplayer game.

    I know there are ways to artificially circumvent this problem via scripting, though none feel natural (timed spawnings or small pools for example), and due to the limit of 42 'IF' statements in code, it highly restricts what else you can add to your level.

    Does anybody know how to 're-prioritize' creatures, or if it is at all possible?

  2. #2
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Is it possible to 're-prioritize' creatures?

    Here's the function which selects a next creature to be generated:
    http://code.google.com/p/keeperfx/so...e.c?r=1133#193

  3. #3

    Default Re: Is it possible to 're-prioritize' creatures?

    Seems like it picks a random available creature to me,...

    In the campaign there are simply fewer and fewer weak creatures available in the pool.
    It does sound like a nice level script addition though, in a level to be able to give every creature a spawn-chance multiplier.

  4. #4
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Is it possible to 're-prioritize' creatures?

    Quote Originally Posted by YourMaster View Post
    Seems like it picks a random available creature to me,...
    Random, that's true.
    But there is different chance of attraction for every creature kind.

  5. #5

    Default Re: Is it possible to 're-prioritize' creatures?

    Ok, I couldn't deduce that from the code,...

    Could you explain what gives a creature kind a higher or lower attraction chance, or show where this is specified?

    And what is 'EntranceForce' by the way?

  6. #6
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Is it possible to 're-prioritize' creatures?

    Quote Originally Posted by YourMaster View Post
    Could you explain what gives a creature kind a higher or lower attraction chance, or show where this is specified?
    The function sums up "attracion scores" of all creatures which can be attracted, and then generates a random number lower than the sum.
    So, the probability_of_attraction = creature_attraction_score / sum_of_all_creature_attraction_scores * 100 %

    And the score for every creature is computed as:
    Code:
                score = (long)attract_score[i]
                    + calculate_excess_attraction_for_creature(i, dungeon->owner);
    So - it has static part from attract_score[] array, and a dynamic part computed by calculate_excess_attraction_for_creature().

    Quote Originally Posted by YourMaster View Post
    And what is 'EntranceForce' by the way?
    Can't remember now.

  7. #7

    Default Re: Is it possible to 're-prioritize' creatures?

    Thanks,.. so I did understand correctly,... no creature type has an inherent larger change to be attracted then any other.

    EntranceForce is present in every [creature].cfg file, and is 0 for all creatures, except for vampire, which has 1.

  8. #8
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Is it possible to 're-prioritize' creatures?

    Quote Originally Posted by YourMaster View Post
    Thanks,.. so I did understand correctly,... no creature type has an inherent larger change to be attracted then any other.
    Every creature has different base score, I will export these to config files sooner or later.

    The score is either increased or decreased by the size of rooms required to attract:
    - For most rooms, the additional score is amount of room slabs / 3 decreased by amount of creatures of this kind the player already has
    - For Treasury, additional score is the amount of gold pots / 3
    - For Lair, it's the amount of free space in that room / 2

  9. #9

    Default Re: Is it possible to 're-prioritize' creatures?

    Ok, interesting. Are the base scores listed somewhere?

    Is this it?

    WIZARD 12
    BARBARIAN 11
    ARCHER 6
    MONK 7
    DWARFA 7
    KNIGHT 14
    AVATAR 16
    TUNNELLER 6
    WITCH 6
    GIANT 12
    FAIRY 5
    THIEF 6
    SAMURAI 13
    HORNY 14
    SKELETON 10
    TROLL 11
    DRAGON 13
    DEMONSPAWN 10
    FLY 3
    DARK_MISTRESS 14
    SORCEROR 12
    BILE_DEMON 13
    IMP 2
    BUG 6
    VAMPIRE 14
    SPIDER 8
    HELL_HOUND 10
    GHOST 5
    TENTACLE 10
    ORC 10
    FLOATING_SPIRIT 0

    Also funny to see the list of rooms that give an attraction point per 9 slabs,.... It would make much more sense to me for many of these rooms to give an additional point not per 9 slabs, but per slab ignoring all the borders. So for a temple give an attraction point per tile of water and for torture chamber give an attraction point per torture device. This rewards better dungeons and also makes a lot more sense.
    Last edited by YourMaster; May 23rd, 2014 at 20:59.

  10. #10
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Is it possible to 're-prioritize' creatures?

    Quote Originally Posted by YourMaster View Post
    Ok, interesting. Are the base scores listed somewhere?

    Is this it?
    Yes.

    Quote Originally Posted by YourMaster View Post
    Also funny to see the list of rooms that give an attraction point per 9 slabs,.... It would make much more sense to me for many of these rooms to give an additional point not per 9 slabs, but per slab ignoring all the borders. So for a temple give an attraction point per tile of water and for torture chamber give an attraction point per torture device. This rewards better dungeons and also makes a lot more sense.
    I don't think that would be good. Overcomplicating simple things is never a good idea.
    Also, attraction score is little reward to the player.
    I don't think it would make any sense for players to make strange shape lairs on purpose, only to decrease chance of attracting bugs and giving bigger chance for other creatures.

Similar Threads

  1. Creatures scared of other creatures
    By Gwame in forum Dungeon Keeper 1
    Replies: 3
    Last Post: April 25th, 2014, 23:18
  2. Max creatures: a possible bug?
    By friscmanseby in forum KeeperFX
    Replies: 3
    Last Post: December 29th, 2012, 20:54
  3. new creatures
    By dk2player in forum DK2 Mapmaking
    Replies: 29
    Last Post: December 4th, 2009, 22:44

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
  •