Make the enemy follow a point
Make the enemy follow a point
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?
Re: Make the enemy follow a point
i assume it would be the same way but enemy wouldnt be the player.
Re: Make the enemy follow a point
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?
Re: Make the enemy follow a point
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.
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Make the enemy follow a point
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.
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)
Re: Make the enemy follow a point
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
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
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Make the enemy follow a point
Well the very concept of navigation is to find a way thru obstacles...
The obvious way in Quake is to use path_corners, specially if the target is fixed.
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)
Re: Make the enemy follow a point
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?) ?frag.machine wrote:Well the very concept of navigation is to find a way thru obstacles...
The obvious way in Quake is to use path_corners, specially if the target is fixed.
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Make the enemy follow a point
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.JasonX wrote: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?) ?frag.machine wrote:Well the very concept of navigation is to find a way thru obstacles...
The obvious way in Quake is to use path_corners, specially if the target is fixed.
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)