TheEnginesOfCreation / EntityPlus

EntityPlus is a mod that offers a true single player experience in the Quake III Arena videogame.
34 stars 5 forks source link

AI waypoints #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The attached patch introduces the entity type "info_waypoint", representing an 
AI patrol waypoint. They can be linked through target/targetname like triggers. 
A target_botspawn can by linked to any  waypoint of a waypoint chain, the 
bot(s) will walk back and forth along the waypoint chain until they encounter 
an enemy.
The code is untested though, because I suck at mapping.

Original issue reported on code.google.com by andi.chr...@gmx.net on 5 May 2011 at 2:08

Attachments:

GoogleCodeExporter commented 9 years ago
The code appears to work :)

2 things need to be done though.
- I assumed I had to create a circular link between waypoints but that crashes 
the game. Would be nice to have bots either walk back and forth along the path 
if it's open ended or run in circles if it's a circular path.
- Bots continue to walk along the waypoint path if they see you. They do attack 
but continue their back and forth walking, which isn't exactly what we want ;)

I've attached a zip file with an example map (named "test3"). It includes the 
.map file and the compiled bsp and aas files. It's just a simple box map with a 
trigger (on top of a little platform that's slightly raised out of the floor, 
you'll spot it). When hitting the trigger, it'll spawn a bot into the game 
after a delay of 5 seconds, which allows you to get into spectator mode if you 
wish to freely view the bot's movements. There's the botspawn for the bot and 
three waypoints in an L-shaped path. The bot will run back and forth. Quite 
amusing to see.

Original comment by era...@gmail.com on 11 May 2011 at 10:07

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, I fixed the second point. Bots break free of their patrolling behavior when 
they see an enemy to attack. It's a small change in r223.

Original comment by era...@gmail.com on 11 May 2011 at 2:46

GoogleCodeExporter commented 9 years ago
I didn't think of circular linked waypoints, this patch should fix it. Again, 
untested. Your fix for their staying-on-path works fine, but I would consider 
it a hack. The patch includes a different solution: bot are now unafraid, 
willing attack the player regardless of their own condition or task. And 
there's a third change included: jumping and ducking are disabled for bots 
during combat. That was mentioned in the forum discussion, I'm not sure if you 
actually want it.
Could you add a small escape area to the test map so I can check if the bots 
react correctly when their enemy flees?

Original comment by andi.chr...@gmx.net on 11 May 2011 at 11:38

Attachments:

GoogleCodeExporter commented 9 years ago
Here's an updated version of the map.
This time it actually counts down from 5 to 1 to indicate when the bot is 
spawned. The box is expanded with an L-shaped corridor that wraps around it.

Original comment by era...@gmail.com on 12 May 2011 at 7:21

Attachments:

GoogleCodeExporter commented 9 years ago
I've made yet another version of the test map. This time it's a square room 
with a small opening on one side that's completely surrounded by a corridor. 
When hitting the trigger, the bot will spawn at the back side of the center 
room and run in circles around the map. At least, that's how the waypoint 
system is laid out. The bot still is very much interested in grabbing the 
shotgun and megahealth that are inside the center room and then continues along 
the waypoint path.

Original comment by era...@gmail.com on 12 May 2011 at 1:38

Attachments:

GoogleCodeExporter commented 9 years ago
They return to patrolling after combat, all is well. Here's a patch to make 
them ignore items. There's one code path remaining that sends them harvest 
items, but that one is only executed when bots are neither in combat nor 
patrolling, which should not happen.

Original comment by andi.chr...@gmx.net on 12 May 2011 at 5:09

Attachments:

GoogleCodeExporter commented 9 years ago
Ok it's applied.
I've made another change that's committed in r232. It turned out that if a 
target_botspawn was triggered that didn't target an info_waypoint entity, it 
would simply crash the game. I realize this just drops a bot in the game 
that'll go after items but that's fine, bots are physically unable to pick up 
entities anyway (in the single player gametype that is).

Original comment by era...@gmail.com on 12 May 2011 at 7:58

GoogleCodeExporter commented 9 years ago

Original comment by era...@gmail.com on 24 May 2011 at 7:34