Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I'm working on a problem involving flee points (AI doesn't flee when you bump into him).

 

I've fixed the problem, but in the process I've learned a few things about flee points that bear discussion.

 

The wiki page says that when an AI wants to flee, he'll follow these steps:

 

1 - If there's a guarded and friendly ('team' spawnarg is friendly to the AI) flee point, run there

 

2 - If not, if there's a friendly flee point, run there.

 

3 - If not, pick a spot that's far away and run there.

 

The code follows these steps.

 

I put a single unguarded flee point in my test map, and didn't set the 'team' spawnarg (let's call this 'indifferent'). When there's only one flee point in a map, this works fine, because the code doesn't check for friendliness or whether it's guarded.

 

When I used two unguarded and indifferent flee points, the AI ignored them both because neither satisfied step 1 or step 2 above. The AI used step 3.

 

I checked the published maps. Here are a few examples of flee point use:

 

Alchemist uses 13 flee points like the ones I tested with, which leads me to believe that none of them would ever be used.

 

Ditto for Betrayal (11 flee points).

 

Business v3 has 3 guarded flee points, but none have a 'team' spawnarg, so they're indifferent. This means AI would fail to use them.

 

Since we don't want to update released missions, and we want these flee points to be used as the authors thought they would be used (even though the wiki page said otherwise), I propose changing the steps to be the following:

 

1 - If there's a guarded and friendly ('team' spawnarg is friendly to the AI) flee point, run there

 

2 - If not, if there's a guarded and indifferent flee point, run there

 

3 - If not, if there's a friendly flee point, run there.

 

4 - If not, if there's an indifferent flee point, run there.

 

5 - If not, pick a spot in a galaxy far far away and run there.

 

This should let the non-working flee points start working w/o updating maps.

 

Does anyone have a problem with this?

 

(Does anyone think the flee points work in the examples I cited? If so, I'll test them explicitly to see what I got wrong.)

 

Thanks.

  • Like 3
Posted

So to get this straight, the way it works right now is as described by the wiki: the description is correct. But (1) it doesn't seem quite right that flee points work only with a matching team spawnarg, and (2) it's clear that the authors of the maps you checked expected a different behaviour: that flee points would work without a team spawnarg.

 

I like your proposed solution. It'll be impossible to completely rule out oddities happening as a result because we can't parse map files to find out who is guarding a flee point, but the one time a mapper would certainly pay attention to the team spawnargs is when they have enemy factions in a map and separate flee points for each faction. So I'd say the risk is minimal.

 

How about switching the order of new rules (2) and (3)? That way, if a mapper has deliberately set team spawnargs, then they'll always take precedence.

Posted

That sounds fine to me, as long as #2 doesn't result in AI running towards a flee point with enemy guards that will proceed to kill him.

 

The only way I can see to prevent this is to have the flee code check the teams of armed AI in the neighborhood of the guarded flee point. If they're on the same team as the fleeing AI, let it happen. If not, skip that flee point.

 

This is probably a good thing to do for all flee points.

 

And for selecting a "far away" point when no flee points will satisfy. No use in throwing the fleeing AI to the wolves.

Posted
If they're on the same team as the fleeing AI, let it happen. If not, skip that flee point.

 

I don't think it has to be that strict...friendly/neutral teams should be fine, just skip if there are enemy teams in the vicinity.

Posted

The only way I can see to prevent this is to have the flee code check the teams of armed AI in the neighborhood of the guarded flee point. If they're on the same team as the fleeing AI, let it happen. If not, skip that flee point.

I don't think it has to be that strict...friendly/neutral teams should be fine, just skip if there are enemy teams in the vicinity.

 

That sounds a very cool extension to current AI behaviour. Would it make the "team" spawnarg redundant? (not necessarily a bad thing of course)

Posted

I don't think it has to be that strict...friendly/neutral teams should be fine, just skip if there are enemy teams in the vicinity.

 

Yes, that's what I meant.

  • Like 1
  • 5 years later...
Posted

@grayman Just trying to understand the "new" flee point rules, before I make some fancy flee handling. Evidently not updated in the wiki; I can do that update as follows, if you can clarify 2 things (see Questions):

Defining some terms:

  • ·         A “guarded” flee point is one with spawn_arg “is_guarded 1”.

  • ·         An “indifferent” flee point is one without spawnarg “team” specified.

  • ·         A “friendly” flee point is one with “team” spawn_arg set to the same team as the fleeing AI.

Here is what the AI tries to do (as of TDM 2.03):

  1 - If there's a guarded and friendly flee point, run there

  2 - If not, if there's a friendly flee point, run there.

  3 - If not, if there's a guarded and indifferent flee point, run there

  4 - If not, if there's an indifferent flee point, run there.

  5 - If not, pick a spot far away and run there.

Questions:

In steps 1-4, if there are multiple candidate flee points for that step, the previous code would reportedly choose the nearest one. Is that still true?

In steps 1-4, once the AI has run to the flee point, if the enemy is still visible, the previous code would reportedly resume the search from step 1, but look for the farthest flee point in each case. Is that still true (assuming it was ever true)?

Posted

Perhaps this is more accurate?

Defining some terms:

  • ·         A “guarded” flee point is one with spawn_arg “is_guarded 1”.
  • ·         An “indifferent” flee point is one without spawnarg “team” specified, or the team specified is "neutral" to the fleeing AI's team (see [[Teams]])
  • ·         A “friendly” flee point is one with “team” spawn_arg set to either the same team as the fleeing AI, or one that is "friendly" (see [[Teams]])

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...