Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Self_Only and Self_Allowed Interactions: Assistance and Advice requested  (Read 1292 times)

Tao_Matte_No

  • Escaped Lunatic
    • View Profile

Dear Dwarves,

    I hope all is well in the Mountainhome. The past Winter has been a dry one, and although the crops have done well as a result, the Summer looks to be hot and dry, and hard on the plants and the dwarves here.

    We have encountered a certain difficulty, which has prompted me to write this to you; We have been experimenting with modified Interactions, and although the results have been promising, there is still an issue we have yet to overcome. We have been attempting to to create a set of interactions that target friendly and allied dwarves only, and provide them with bolstering and beneficial effects, such as healing, increased stamina, and resistance to harm. Now, the Interactions we have constructed, I have overseen the testing of, and they work perfectly satisfactorily: the dwarves affected demonstrate greatly bolstered combat ability.
    The problem is this: in Arena mode, and in Adventure mode, when I can issue orders directly, these abilities are used flawlessly; however, when overseeing a Fortress, or in the hands of my allies in the Arena, or on an Adventure, all units consistently and utterly fail to utilize the least of the abilities given to them. They do not even make any attempt to target themselves or any of their allies with these interactions.

    In constructing these Interactions, I have tried every set and combination of the Self_Only, Self_Allowed, Greeting, Clean_Self, Clean_Friend, and even Attack and Fleeing targeting tags to absolutely no result of any kind.

    I have devised a theoretical method around the problem: I think it might be possible to code an Attack Interaction that targets an enemy, triggering a Syndrome that grants the enemy the ability to use the beneficial interaction, with tokens set to cause the enemy to then target my troops with the beneficial effects.

    I have a couple of questions:
1. Is it possible to do what I have proposed? Will an enemy target reliably target my own troops, and only my own troops, with the beneficial effect?
  A. Is there any chance that there may be issues in this process? Ideally, I want the effects to be applied as reliably and as smoothly as possible, under all circumstances.

2. Is there anything I may have overlooked in the original version of the interaction? Is there any way to get a dwarf, under combat conditions, to reliably target an allied troop with an interaction, without resorting to a (relatively) convoluted mirroring process, to apply an effect to themselves or an ally?

I appreciate any expertise or advice you may have for me towards solving this problem as quickly and as elegantly as possible.

May your tankards ever be full,
Urist
Logged
This is not my signature.

Klisz

  • Bay Watcher
  • Dabbling Modder
    • View Profile

Aside from SELF_ONLY and SELF_ALLOWED, those aren't targeting tags, but usage hints. Put them in the CAN_DO_INTERACTION as [CDI:USAGE_HINT:GREETING], etc., not within the interaction itself as an independent tag.
Logged

Tao_Matte_No

  • Escaped Lunatic
    • View Profile

    Progress at last! Well, that may be me being overly optimistic. I had another look through the wiki, which is, with the best will in the world, a bit vague. I also took another run through a couple other, slightly better put together mods (or at least, better distributed!), and altered some of the layout of my interactions to match. I did have a few tags misplaced, but some of that may just have been a bit of desperate improvisation.
    After cleaning everything back up to spec, I ran a few more simulations. The units will use their abilities, randomly, only when completely at peace. In my largest arena test, it took six days for one of the group of twenty to use a single ability. It was three months before any of them used any power other the first one, and at the end of the test (read: when I finally got bored ~ten minutes later) two of the group still hadn't used a single ability. At no point did any of them use any powers on each other, despite my best efforts to coerce them to do so. This is an improvement, however - at no previous point have I gotten any AI usage, but see again the bit about improvisation.
    A couple similar, shorter lived groups, placed in combat situations, used exactly none of their abilities. I tried to manually activate a couple of them, to see if that would jump-start the process by some arcane luck, but that too had no effect. (That is to say, it had no effect on the further usage of their abilities; it did have an effect on the battle, as it should)

For reference, I will put up some select portions of the RAWs of that the abilities in question rely on.
The Interaction itself:

Spoiler (click to show/hide)

The CDI data for the syndrome I have set up to give them the ability in the first place:

Spoiler (click to show/hide)

    Please note that the interaction, when accessed and used manually from the ability menu, both in the Arena, and in Adventure mode, works as expected. I just can't get the AI to use it properly.
    A few notes on some of the other trials I ran:

Spoiler (click to show/hide)

    I still don't understand what, real-time, 'on the ground' events actually trigger the use of any of these tags; I couldn't see anything different about the one fight the [:FLEEING] tag was used, other than the fact that the guy hadn't yet passed out, and I haven't been able to replicate the result, despite replicating the circumstances. Left to their own devices, something in either [:CLEAN_SELF] or [:GREETING] will trigger the activation of random abilities over time, but I can't tell when or how or why.
    My initial thought was, from what I could glean from the wiki, that [:CLEAN_SELF] and/or _FRIEND] might trigger based on the presence of coating of say, blood or vomit, which would trigger them a short time, but hopefully not too long a time, into a battle. I have never seen this to occur, and in fact, cannot definitively say that those tags have ever triggered any interaction usage, or if they did, what precipitated it.

    I am, in short, at an utter loss for understanding how this system works. How does the AI make decisions? Do the tags used have any appreciable effect at all? [BRINK_OF_MADNESS]Is there any form of logic left in this cruel world!?[/BRINK_OF_MADNESS]

May the God of Random Numbers be kinder to you than it has to me,
Urist
Logged
This is not my signature.

Nathail

  • Bay Watcher
  • Dabbling Modder
    • View Profile

The [CLEAN_SELF] and [CLEAN_FRIEND] tokens are only used randomly in peacetime since they're low-profile ambient behaviors. They give cats a little more flavor, basically. I don't think you could actually have them use it as an actual medical behavior, in fact. [GREETING] ones are used during social interactions; A friendly creature walks up to another friendly creature, one of them should use it. [FLEEING] probably isn't going to be used much in the arena, since it's triggered when a creature decides it has been routed and things in the arena tend to go to the death. [ATTACK] tags are naturally not going to be used on one's self, because DF does not directly simulate self-harm.

You could try experimenting with different levels of combat. The c and C keys change that.
Logged

vjmdhzgr

  • Bay Watcher
  • Hehehe
    • View Profile

The [CLEAN_SELF] and [CLEAN_FRIEND] tokens are only used randomly in peacetime since they're low-profile ambient behaviors. They give cats a little more flavor, basically. I don't think you could actually have them use it as an actual medical behavior, in fact. [GREETING] ones are used during social interactions; A friendly creature walks up to another friendly creature, one of them should use it. [FLEEING] probably isn't going to be used much in the arena, since it's triggered when a creature decides it has been routed and things in the arena tend to go to the death. [ATTACK] tags are naturally not going to be used on one's self, because DF does not directly simulate self-harm.

You could try experimenting with different levels of combat. The c and C keys change that.
You can turn standard morale back on in the arena by pressing m. This will allow creatures to run away should they deicde to, and from my recent testing they will use proper fleeing interactions.
Logged
Its a feature. Impregnating booze is a planned tech tree for dwarves and this is a sneak peek at it.
Unless you're past reproductive age. Then you're pretty much an extension of your kids' genitalia

Tao_Matte_No

  • Escaped Lunatic
    • View Profile

    First, I would like to thank you for your help and advice; I'm sure I will be needing it again, many times, in the future. I think we have gotten this problem resolved for now. For reference:
  After turning moral back on, and fiddling with the combat options, I was able to get :FLEEING interactions to work semi-reliably in the Arena. For my purposes though, this was both too late, and still far too sporadic.

  Removing all USAGE_HINT tags caused the ability to be used as soon as possible, as frequently as possible. This was subject to some odd restrictions, though. When not in combat, with no HINTs, it still took ~5 days for every member of a group of ten to use the ability. This is a massive improvement over the previous ~3 months with a still incomplete group.
  However, under combat conditions, the ability in question was used immediately, in the first round, without failure or hesitation, in more than a dozen trials. I am still unsure exactly what causes that change; perhaps simply that the AI, not knowing what it was "for", was firing off everything available.

  This still didn't work for everything however; that is to say, I have several interactions that only need be used under combat conditions. After a bit of digging (Well, I say "a bit.") I found the answer buried somewhere around page ~40 or so of this thread, although I don't feel like digging out the exact post again.
  Someone, who will now have my eternal, non-specific gratitude, wrote up a short guide about "tennis" interactions, which I was able to use in the remainder of my combat abilities. In case anyone is interested, here is the basic layout of the interactions I settled on:
Spoiler (click to show/hide)

    Thank you for your assistance.
May all your problems come to swift and happy resolutions,
Urist
Logged
This is not my signature.