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

Thread: Annoying imp priority

  
  1. #1
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    368

    Default Annoying imp priority

    Imps are sometimes annoying with their priority.

    1. If i drop an imp in an owned slab just close to enemy slabs to claim them, they start reinforce my walls before!
    2. If i drop an imp to take an enemy spell book and also all the surrounding slabs are all claimed by me, he will start reinforcing walls instead of taking fast the spell book.

    Mefisto, can you change this?

    I attach a savegame with the second case. Try to drop the imp to get the spell book...
    Attached Files Attached Files

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

    Default Re: Annoying imp priority

    To change order in which imps selects jobs on a drop site, we'd have to make a wider discussion.

  3. #3

    Default Re: Annoying imp priority

    The order doesn't seem to be like it was in original DK, it changed in FX a little while ago, and it was an issue already reported: https://code.google.com/p/keeperfx/issues/detail?id=289
    I also mentioned it in this issue: https://code.google.com/p/keeperfx/issues/detail?id=229

    In earlier KeeperFX builds I also don't remember this issue, and it is very noticable, as imps now always seem to prioritize enforcing walls when being dropped, over all other tasks.

  4. #4
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    368

    Default Re: Annoying imp priority

    Quote Originally Posted by mefistotelis View Post
    To change order in which imps selects jobs on a drop site, we'd have to make a wider discussion.
    I agree, but imps never reinforced walls before claiming enemy slabs before. That's something new i don't know in which KeeperFX it changed (i spent some months without playing).
    Can you change this at least to have the usual behaviour?
    This is very important because when you enter in a enemy terrain, you cannot start claiming slabs fastly because they start to reinforce walls, it is very frustating.

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

    Default Re: Annoying imp priority

    The function which selects imp job on drop is here:
    https://code.google.com/p/keeperfx/s...es_spdig.c#478

    What is the order you'd like to propose?

  6. #6
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    368

    Default Re: Annoying imp priority

    Quote Originally Posted by mefistotelis View Post
    The function which selects imp job on drop is here:
    https://code.google.com/p/keeperfx/s...es_spdig.c#478

    What is the order you'd like to propose?
    Sorry mefistotelis but i don't know how that function works (existent structures, states, etc).

    What SDLstJob_ConvImprDungeon mean?

    I see it is a value from an enum:

    Code:
    enum SpecialLastJobKinds {
        SDLstJob_None = 0,
        SDLstJob_DigOrMine,
        SDLstJob_ConvImprDungeon,
        SDLstJob_ReinforceWall3,
        SDLstJob_UseTraining4,
        SDLstJob_Unkn5,
        SDLstJob_Unkn6,
        SDLstJob_Unkn7,
        SDLstJob_Unkn8,
        SDLstJob_ReinforceWall9,
    };
    - Wich is the state that make the imp to claim slabs?
    - What's the difference between SDLstJob_ReinforceWall9 and SDLstJob_ReinforceWall3?
    - In the function you told me:

    Code:
    long check_out_available_spdigger_drop_tasks(struct Thing *spdigtng)
    {
        struct CreatureControl *cctrl;
        cctrl = creature_control_get_from_thing(spdigtng);
    
        if ( check_out_unclaimed_unconscious_bodies(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_unclaimed_dead_bodies(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_unclaimed_spells(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_unclaimed_traps(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_empty_traps(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_undug_drop_place(spdigtng) )
        {
            cctrl->digger.last_did_job = SDLstJob_DigOrMine;
            return 1;
        }
        if ( check_out_unconverted_drop_place(spdigtng) )
        {
            cctrl->digger.last_did_job = SDLstJob_ConvImprDungeon;
            return 1;
        }
        if ( check_out_unprettied_drop_place(spdigtng) )
        {
            cctrl->digger.last_did_job = SDLstJob_ConvImprDungeon;
            return 1;
        }
        if ( check_out_unclaimed_gold(spdigtng, 768) )
        {
            return 1;
        }
        if ( check_out_unreinforced_drop_place(spdigtng) )
        {
            cctrl->digger.last_did_job = SDLstJob_ReinforceWall9;
            return 1;
        }
        if ( check_out_crates_to_arm_trap_in_room(spdigtng) )
        {
            return 1;
        }
        cctrl->digger.last_did_job = SDLstJob_None;
        return 0;
    }
    why the first IFs doesn't make changes over the CreatureControl structure and they only return 1?

    Sorry, many questions but i haven't programmed KeeperFX by myself...
    Last edited by jomalin; June 24th, 2014 at 19:07.

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

    Default Re: Annoying imp priority

    Quote Originally Posted by jomalin View Post
    Sorry mefistotelis but i don't know how that function works (existent structures, states, etc).
    Ok, I think you're trying to get too deep. Just look at function names inside "if ()" commands.

    They are making the order:
    Code:
         ( check_out_unclaimed_unconscious_bodies(spdigtng, 768) )
         ( check_out_unclaimed_dead_bodies(spdigtng, 768) )
         ( check_out_unclaimed_spells(spdigtng, 768) )
         ( check_out_unclaimed_traps(spdigtng, 768) )
         ( check_out_empty_traps(spdigtng, 768) )
         ( check_out_undug_drop_place(spdigtng) )
         ( check_out_unconverted_drop_place(spdigtng) )
         ( check_out_unprettied_drop_place(spdigtng) )
         ( check_out_unclaimed_gold(spdigtng, 768) )
         ( check_out_unreinforced_drop_place(spdigtng) )
         ( check_out_crates_to_arm_trap_in_room(spdigtng) )
    Quote Originally Posted by jomalin View Post
    why the first IFs doesn't make changes over the CreatureControl structure and they only return 1?
    This isn't important for the order; anyway "return 1" means "Job has been assigned" and it ends the function in that point - further "check_*" functions are not executed. Changes to CreatureControl are only made for jobs which a digger "assigns to itself" (so after it finishes one work, it will try to do something similar - ie. find another dead body, or claim another tile).

    Tha value "768" is a range of checking - it is equal to one slab range (3 subtiles * 256).
    Last edited by mefistotelis; June 24th, 2014 at 19:23.

  8. #8
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    368

    Default Re: Annoying imp priority

    Thanks for your explanation.
    So, why imps are reinforcing walls before claiming enemy slabs? Because I see that "if" in the 10th position:

    Code:
        if ( check_out_unreinforced_drop_place(spdigtng) )
        {
            cctrl->digger.last_did_job = SDLstJob_ReinforceWall9;
            return 1;
        }

  9. #9

    Default Re: Annoying imp priority

    I agree, the order listed there is fine, but when dropped this is not the order they follow. They always take the job nearest it seems, where in the past they also took a close job, but seemed to understand that if you drop them in an hallway right next to fallen prisoners, they had to get the prisoners if a few tiles away, not fortify the wall right next to them.
    Last edited by YourMaster; June 25th, 2014 at 00:49.

  10. #10
    Beetle Ecarus's Avatar
    Join Date
    Dec 2013
    Location
    Venezuela
    Posts
    108
    Gamer IDs

    Steam ID: ecarus333

    Default Re: Annoying imp priority

    As i dont understand nothing of this, i can only say my opinion, when you drop a imp, the priority would be:

    1.- Dig
    2.- Claim
    3.- Reinforce

    And the other, i dont understand, what it is? Jobs that imps does when they are working as usually?

Similar Threads

  1. Imps priority
    By jomalin in forum KeeperFX
    Replies: 19
    Last Post: January 26th, 2013, 13:56
  2. A really annoying situation
    By Angry Reaper in forum Off Topic
    Replies: 0
    Last Post: August 26th, 2010, 14:51

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
  •