Jump to content
The Dark Mod Forums

Using values other than -1 / +1 in team relations to indicate motivation level


MirceaKitsune

Recommended Posts

I don't consider this an urgent or highly important feature, but found the concept useful enough to ask and may definitely use it on my maps. I actually don't know if it might already be implemented: No FM I'm aware of does this and it's not mentioned on the AI Relations (Editing) page either, however the AI Relations (Scripting) page mentions a gradual sys::OffsetRelation function but doesn't specify if it's also a gradual change in the AI's behavior.

When setting team relations you normally have just 3 options: -1 (enemy) 0 (neutral) 1 (friendly). There is one limitation in this system: They seem to be integers and not floats, meaning you can't also express an amount by which the teams should be allies or enemies. Having this ability could have interesting use cases: You may want teams that still oppose the player but don't care that much and will only attack if you get right in their face or stick around for too long. As such you should be able to use values between 0 and +1 or -1 to indicate an interest level in the relationship, as well as values above +1 or below -1 to boost the AI's friendliness or hatred toward another team beyond its normal levels.

Consider for instance a FM where thugs protect a territory they own: They don't like the player wandering into their turf, but seeing you is more of an annoyance than an emergency... they aren't as motivated to catch you as a citywatch guard who knows the player is a wanted thief and will immediately jump to apprehend you. In this scenario the relationship between thugs and the player could be changed to -0.25: Now you can walk between thugs for a few seconds and they will ignore you at first, but if they see you for too long you're eventually getting attacked.

A super simple implementation would be to merely multiply the AI's alert increase rate from a target with its abs(relationship) toward it: If you set it to -0.5 for instance, AI on that team will take twice longer to be alerted by you until eventually attacking, same for allies who will be slower to notice a friend in trouble... meanwhile if you set it to -2 AI on that team will go alert twice faster than normal. I presume this solution can be done by changing one line somewhere in the alert code, and should have the accurate behavioral effect intended without reducing visual / audio acuity... no existing FM or default behavior should be affected either since I can't think who would be using those values if this feature doesn't already exist.

Link to comment
Share on other sites

Seems like something that could be replicated with a script - player enters AI sight-line / semi-hostile zone, AI. grumbles...a timer starts; if they linger longer than '20 seconds' A.I. Barks with "OUT NOW, TAFFER!" type yell, and the AI alignment configuration changes to hostile. On player exiting sight-line / zone, A.I grumbles again - "and stay out!" (unless they became hostile - does nothing then).

Changing types from INT to FLOAT would probably break all existing maps, and piles of engine-C code; seems unlikely any Dev would do that.

Edited by Melchior
detail
Link to comment
Share on other sites

If someone urgently needs this feature, there's likely a convoluted script you can indeed write to achieve it. I say convoluted since the way I know the scripting API to work in this regard, you'd need to loop through all AI each frame and temporarily make them friendly or lower their alert level, which feels very hacky to me. Thus I think this gradual mode would be best builtin to make it a readily available feature. Especially as it should be easy to implement as a mere offset to alert level increase, and changing it shouldn't break anything since all existing maps use -1 / 0 / +1 for team relations as they're currently integers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...