Forum

Make the enemy follow a point

Discuss Artificial Intelligence and Bot programming.

Moderator: InsideQC Admins

Make the enemy follow a point

Postby JasonX » Sat Sep 07, 2013 12:14 am

I'm working on a small Tower Defense mod for Q1 and i'm trying to make dogs and enforcers to follow a specific entity in the map and attack it. I could not find any examples of this, other than following the player. Is there a way to attack something else, other than the player?
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm

Re: Make the enemy follow a point

Postby ceriux » Sat Sep 07, 2013 12:44 am

i assume it would be the same way but enemy wouldnt be the player.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Make the enemy follow a point

Postby JasonX » Sat Sep 07, 2013 1:23 pm

Can i set any entity as the enemy? And how do i make the AI find the best path to the enemy? Is there an AI tutorial for path finding, without path helpers?
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm

Re: Make the enemy follow a point

Postby ceriux » Sat Sep 07, 2013 4:27 pm

i havent really messed with ai. so i dont really know. i know if you use quakes basic AI it may or may not get caught on corners and what not.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Make the enemy follow a point

Postby frag.machine » Sat Sep 07, 2013 4:52 pm

Yes, a monster can attack other entities (even in vanilla Quake - see monsters infight). All you need is to set the .enemy field.
Navigation without path_corners is more complicated.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2063
Joined: Sat Nov 25, 2006 1:49 pm

Re: Make the enemy follow a point

Postby r00k » Sat Sep 07, 2013 5:15 pm

i was doing something like this on a test zombie mod.
in just an open field i was using tracelines to find a player and stepping forward and turning at a set rate based in the health of the entity. but once u add bsp objects thing get tricky
r00k
 
Posts: 1108
Joined: Sat Nov 13, 2004 10:39 pm

Re: Make the enemy follow a point

Postby frag.machine » Sun Sep 08, 2013 12:18 am

Well the very concept of navigation is to find a way thru obstacles... :D
The obvious way in Quake is to use path_corners, specially if the target is fixed.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2063
Joined: Sat Nov 25, 2006 1:49 pm

Re: Make the enemy follow a point

Postby JasonX » Sun Sep 08, 2013 10:52 pm

frag.machine wrote:Well the very concept of navigation is to find a way thru obstacles... :D
The obvious way in Quake is to use path_corners, specially if the target is fixed.


Is there a sample AI that uses path_corners? Also, what happens if the path gets obstructed in realtime (with a huge obstacle, for instance?) ?
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm

Re: Make the enemy follow a point

Postby frag.machine » Mon Sep 09, 2013 1:06 am

JasonX wrote:
frag.machine wrote:Well the very concept of navigation is to find a way thru obstacles... :D
The obvious way in Quake is to use path_corners, specially if the target is fixed.


Is there a sample AI that uses path_corners? Also, what happens if the path gets obstructed in realtime (with a huge obstacle, for instance?) ?


The default QC uses it. Check monsters.qc for walkmonster_start_go (IIRC). If the monster has a .target defined then walks torwards any entity with the same value in the .targetname field, otherwise just sits idle awaiting for a player.

Quake monster walking/running AI struggles to navigate through even relatively small obstacles, let alone something like a large wall.
Unfortunately besides hacks using breadcrumbs or similar clever tricks, better navigation would require some engine support and a new map format to store navigation data.

EDIT: grammar
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2063
Joined: Sat Nov 25, 2006 1:49 pm


Return to Artificial Intelligence

Who is online

Users browsing this forum: No registered users and 1 guest