Author Topic: AI / NPC to follow a spline - how?  (Read 1095 times)

0 Members and 1 Guest are viewing this topic.

motorsep

  • Hero Member
  • *****
  • Posts: 1,008
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
AI / NPC to follow a spline - how?
« on: April 22, 2015, 09:11:45 AM »
I don't think AI / NPC can follow a spline out of the box, but I recall someone (when d3w was alive) made a minimod where bot-friendly was following a spline.

Any ideas how that can be achieved ? (having path_corners as nodes, but having AI/NPC following a spline instead of moving from path_corner to path_corner directly)

solarsplace

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +8/-0
  • Mainly a programmer...
    • View Profile
Re: AI / NPC to follow a spline - how?
« Reply #1 on: April 22, 2015, 09:47:52 AM »
Hi

I have never heard of this before, and I can't see how it would be possible right now without some serious code changes.

I am not sure how you want to use this, but I just thought of an uber-hack / bodge that might work!

Create and position your spline. Add a path corner on the start node of the spline.

Trigger the AI to walk to a path_corner when the AI reaches the path corner set him in a walking / running animation.

Bind the path_corner and AI to a func_mover and set the func_mover off following the spline? you might need to add a path_wait or something like that as the target for the corner and sit it on top of the path and have the wait for the duration of the spline move.

Its a major bodge / hack, but it might just work depending on what you are trying to achieve of course! and experimentation would be required.

Cheers
« Last Edit: April 22, 2015, 09:49:36 AM by solarsplace »

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: AI / NPC to follow a spline - how?
« Reply #2 on: April 22, 2015, 06:06:04 PM »
great idea :D

motorsep

  • Hero Member
  • *****
  • Posts: 1,008
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: AI / NPC to follow a spline - how?
« Reply #3 on: April 23, 2015, 12:45:17 PM »
I suppose it could work, but proper solution might lie in extending AAS to steer properly :(

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: AI / NPC to follow a spline - how?
« Reply #4 on: April 23, 2015, 07:10:19 PM »
the AAS? but steering is the AI not the path finding isn't it? I've been working on this adding more threads to the AI system, and one of them was meant for steering, but I've not finished my work.

motorsep

  • Hero Member
  • *****
  • Posts: 1,008
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: AI / NPC to follow a spline - how?
« Reply #5 on: April 23, 2015, 07:18:47 PM »
Steering is already in Doom 3 - used in dynamic obstacles avoidance code (probably basic steering). When I asked ex-ID about AI reaching path_corner and sharp turning on it, I was told it's a fundamental issue with AAS - all id Tech 4/5 games have issue, even RAGE. I don't know what Wolf TNO and Evil Within have, but Doom 4's id Tech 5 was using  NavPower middleware.