Jump to content
The Dark Mod Forums

Path Nodes


Springheel

Recommended Posts

Wow, the node system is so counter-intuitive. Why didn't they just make path_corners able to take a "wait" property?

It makes sense to do it this way from a programmer's point of view. :ph34r: You have a list of nodes, and each node corresponds to an action (walk, wait, turn, etc.) The AI traces through the links between nodes, and whenever it encounters a node it performs that action - and only that action. So a path_corner is the only node that causes walking, a path_wait is the only node that causes waiting, a path_turn is the only node that causes turning, etc.

 

I agree it makes less sense if you're used to thinking in spatial terms, since they are called path nodes (which would seem to always imply walking but doesn't) and yet for some nodes it doesn't matter where you place them. If you can try to think like a programmer (step by step; this happens then that happens then the other thing happens because that's the order the instructions arrive in) then maybe it'll be easier to work with?

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

It's just awkward to see the path_wait entity in the editor, knowing that its location doesn't mean anything, and the lines to and from it are not the actual path the AI will take. It's also a lot slower to create a new entity and add a target property rather than just adding a "wait" property to an already existing entity. But maybe there are some benefits to this that I'm overlooking. :)

 

Anyway, I've started a wiki page to explain what the various nodes do and how to use them. I'll add more as I learn more.

 

http://wiki.thedarkmod.com/index.php/Path_Nodes

Link to comment
Share on other sites

It makes sense to do it this way from a programmer's point of view. :ph34r: You have a list of nodes, and each node corresponds to an action (walk, wait, turn, etc.) The AI traces through the links between nodes, and whenever it encounters a node it performs that action - and only that action. So a path_corner is the only node that causes walking, a path_wait is the only node that causes waiting, a path_turn is the only node that causes turning, etc.

 

I agree it makes less sense if you're used to thinking in spatial terms, since they are called path nodes (which would seem to always imply walking but doesn't) and yet for some nodes it doesn't matter where you place them. If you can try to think like a programmer (step by step; this happens then that happens then the other thing happens because that's the order the instructions arrive in) then maybe it'll be easier to work with?

 

Only if you are the programmer at ID. :) Justkidding.

 

One could have probably added a list of actions to each path node, so you place the node where the AI will walk to, then it will perform each action in turn.

 

However, that would also mean that you couldn't add random chances to the actions, for instance the list of action couldn't branch between "look to the left" and "walk to the next node". (You could, if you added a "probability_skip_to_next" to each item in the list, but it would only allow to skip actions, not deciding between three or more).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Has anyone tried targetting two or more path_anim nodes from the same entity? I'm wondering if it will create the same random selection if targetting path_corner nodes. That would be pretty cool if so.

Link to comment
Share on other sites

@Spring: According to the code, that should work. In the SDK all the path nodes share the same class (confusingly called idPathCorner, which is a derived class path_corner in the entityDefs but is a base class in the SDK). The function to choose a random one, idPathCorner::RandomPath, should therefore apply to all types of path nodes.

Link to comment
Share on other sites

So we could have a guard turning randomly in different directions. path_wait already has random spawnargs so we might have:

 

X > turn1 > wait min/max > X

X > turn2 > wait min/max > X

X > turn3 > wait min/max > X

 

Or if only two will work then:

 

X > turn1 > wait min/max > Y

X > turn2 > wait min/max > Y

Y > turn3 > wait min/max > X

Y > turn4 > wait min/max > X

 

...where X and Y are two path_corners at the same position.

 

The guard should keep randomly turning in different directions and face that way for a random time. I think the same can be done with a conversation even without another AI?

Link to comment
Share on other sites

I'm going to try an experiment tonight and see what kinds of things these path_anims can do. Specifically, I'd like to try:

 

path_anim (sit) ----> path_cycleanim (sit_idle) ----> path_anim (get up)

 

edit: Hmm, I found my first snag...it seems like the animation only applies to the torso channel, not the legs (when I tried "sit_down" the AI moved his arms but did not move his legs).

 

I can confirm that targetting two path_anims makes the AI choose randomly between them (yay!)

Link to comment
Share on other sites

Hmm, I think I've found a significant bug with path_anim nodes. It seems that the AI's random idle animations can interrupt the path_anim. Not only will this cut off the desired animation, but more significantly, the AI will not proceed to the next target and will just stay where they are indefinitely. With a long animation, like the warm hands one, this happens almost 50% of the time.

 

I'll add both these issues to the tracker.

Link to comment
Share on other sites

Wow Angua, you rock! :) I can't wait to try out sitting with the new pk4.

Link to comment
Share on other sites

I can confirm that animations are now affecting the legs, and the path_cycleanim is working. I tried having the AI walk to a spot and sit down, using path_anim to play the "sit down" and cycleanim to play the "sit idle" animations. It almost works, but it seems like there is a bit of a gap in between the two, where the AI starts to go back to standing idle for half a second. So he sits, but then starts to stand for half a second before sitting again.

 

I'm not sure what causes this, but I think sitting is probably going to need to be handled by code, rather than animations--if sitting requires a cycleanim path, then AI could never play any other animations (like warm_hands) while sitting.

Link to comment
Share on other sites

Cool! :) Can that then be modified to work dynamically? Ie., a path_sit node basically sets that property to "1" for a specified duration (playing the sit_down and stand_up animations as necessary)? Not sure how that would work if the mapper wanted the AI to play a specific animation while sitting (like warm_hands) however.

Link to comment
Share on other sites

The code already supports sitting, but at the moment only when the AI is already sitting at map start. I'll have to write a path_sit task for this.
mmm... the merc in test/animation sits down succesfully and he isn't sitting at start - or is that an obsolete animation.

 

Yes, if a few animations could be used while sitting it would help, even just fidget. In T2 the AI would sit frozen and the only other motion that worked while sitting was shiver.

 

I want a guard to go off duty and sit down so when I get to that I'll be interested to see how accurately he can be led to a chair. There was a thread long ago about sitting at table and swing the legs round under the table too.

Link to comment
Share on other sites

mmm... the merc in test/animation sits down succesfully and he isn't sitting at start - or is that an obsolete animation.

 

AI can play the sit_down or sit_idle already using path_anims.

 

Yes, if a few animations could be used while sitting it would help, even just fidget. In T2 the AI would sit frozen and the only other motion that worked while sitting was shiver.

 

If you use a path_anim they'll still turn their head in that state, but that's it (currently).

 

I believe if the AI is sitting down at map start they then play all the *idle animations that they would when walking (ie, ones that affect torso only).

Link to comment
Share on other sites

  • 3 months later...

So the node has a problem even by itself? My first guess is a naming problem, or possibly the node is unreachable because it is off the ground? What kind of node is it?

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...