Author Topic: AI Teams/Relationships  (Read 2002 times)

0 Members and 1 Guest are viewing this topic.

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
AI Teams/Relationships
« on: August 22, 2015, 01:02:51 AM »
I'm not sure if this amounts to a scripting question or a C++ issue but I'm wondering if anyone could help point me in the right direction in terms of assigning AI default like/hate/neutral relationships towards other AI?

I did play around with Teams/Ranks key/val but so far have only managed to get AI that either does or doesn't just attack the player but seems to ignore other AI, unless I've misunderstood what Teams and Ranks are (probably).

Hopefully that makes sense, thanks in advance.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 858
  • Karma: +42/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: AI Teams/Relationships
« Reply #1 on: August 22, 2015, 12:14:13 PM »
The way I made turrets attack AI was by setting their team opposite the other AI, then having them triggered.   I couldn't get it to, by default, attack another monster.

I always thought team/ranks was supposed to make it like doom 1/2 where you could get zombies vs imps & the like, but never got it to do what I expected.   I found the trigger an easy workaround.

aphexjh

  • Full Member
  • ***
  • Posts: 120
  • Karma: +7/-0
    • View Profile
    • hallowed mod
Re: AI Teams/Relationships
« Reply #2 on: August 22, 2015, 12:15:26 PM »
there is a path>attack node that you can target them at, to make them hate (so to speak). You can also set the "enemy" key to the name of a character/monster in your map.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 754
  • Karma: +17/-69
    • View Profile
Re: AI Teams/Relationships
« Reply #3 on: August 22, 2015, 12:40:42 PM »
It would have been much smarter to make this stuff capable through simple script variables for those of us who do not map at all or need to create a friendly entity by way of a weapon or an item. Gladly the pet mod smoothed things out quite a bit for me. It took a lot of editing but it works.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
Re: AI Teams/Relationships
« Reply #4 on: August 22, 2015, 04:30:20 PM »
I see, thanks for the info everyone seems like triggers/path_attack is a good place to start and I'll check out that pet mod too.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 754
  • Karma: +17/-69
    • View Profile
Re: AI Teams/Relationships
« Reply #5 on: August 22, 2015, 04:32:49 PM »
In the pet mod look for the code that has to do with the minion stuff. That's the key.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: AI Teams/Relationships
« Reply #6 on: August 22, 2015, 07:08:48 PM »
with unmodified game you can't script team or group interactions, there is c++ work to be done,

this is due the lack of lists in the code, so all interactions are always the npc to another entity, never to a group of entities.

you can use spawnarg as improvised lists (once the monster has been spawned, their spawnargs become the monster's "memory" because the spawnarg no longer have any use (unless the monster is respawned)

with a while an a consistent name, you can do a list

but forget about it, the list is bound to linear checks so, yes you have a list but it can only be accessed linearly, you can't get "the best of the list", or "the most ... of the list" so it becomes useless.

so this needs c++ work (this is how idtech4 AI looks for "the closest node to the enemy" from the targeted nodes in the enemy (in the spawnarg) )
« Last Edit: August 22, 2015, 07:15:46 PM by BielBdeLuna »

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
Re: AI Teams/Relationships
« Reply #7 on: August 22, 2015, 10:21:08 PM »
with unmodified game you can't script team or group interactions, there is c++ work to be done,

this is due the lack of lists in the code, so all interactions are always the npc to another entity, never to a group of entities.

you can use spawnarg as improvised lists (once the monster has been spawned, their spawnargs become the monster's "memory" because the spawnarg no longer have any use (unless the monster is respawned)

with a while an a consistent name, you can do a list

but forget about it, the list is bound to linear checks so, yes you have a list but it can only be accessed linearly, you can't get "the best of the list", or "the most ... of the list" so it becomes useless.

so this needs c++ work (this is how idtech4 AI looks for "the closest node to the enemy" from the targeted nodes in the enemy (in the spawnarg) )

Good to know, thanks for the information. I think doing any of that in C++ would be well beyond my current skill level but I do understand it would open the door to something like how HL2 does it (https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/shared/hl2/hl2_gamerules.cpp#L357) which would be ideal and what I was hoping there might be a way of doing in script. I did get a working result for my needs using the path_attack entity in conjunction with team/rank though.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 858
  • Karma: +42/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: AI Teams/Relationships
« Reply #8 on: August 23, 2015, 04:49:15 PM »
Curious as to what you see HL2 do vs D3 AI.  I've never found HL2 AI any more impressive then D3.

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: AI Teams/Relationships
« Reply #9 on: August 23, 2015, 06:04:23 PM »
in doom3 the monsters only move forward, in HL2 no, that's a big game changer in the AI

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
Re: AI Teams/Relationships
« Reply #10 on: August 23, 2015, 08:26:06 PM »
Curious as to what you see HL2 do vs D3 AI.  I've never found HL2 AI any more impressive then D3.

Well both games have different goals in terms of AI and both do a fine job in accomplishing those goals. The AI in HL1 for example was more about creating a living world, an ecosystem / food chain that drew you in and made you feel like you were just a small part in a much bigger world. The headcrabs usually fell prey to the bullsquid or whatever it was called, but this all hinged on being able to set up how each NPC viewed the world and what it considered a friend or a foe.

As for D3, well the AI seemed very similar to much of ID's previous games, simple but effective for a shooting gallery. In terms of see player, attack player both games are similar, unless you count squad behavior, situation (am I low on health, does my enemy have a bigger gun, am I outnumbered?), or environmental awareness (screw taking the door, I can toss a grenade through the window and flush him out, oh no, fire, I don't want to burn, better move away, I must survive). The base AI in D3 does what it needs to it just plays out a little differently, like there's the player, can I reach the player? I'm taking damage, oh well, ouch, ouch, and I'm dead.

Now from what I've read over at iddevnet, much of the above mentioned behavior can probably be replicated so don't get me wrong, I'm not saying D3 AI is incapable of doing much more I'm just saying it was probably a design decision and it turned out pretty well.

The only thing I was pointing out was how HL2 sets up a relationship table and was hoping to replicate that somehow in script so you could for example by default just have all demons and zombies hate each other AND the player instead of just one or the other as it currently seems to be.

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: AI Teams/Relationships
« Reply #11 on: August 23, 2015, 08:36:52 PM »
sorry but it's not exactly like this, most of what you describe doesn't have to do with AI.

the living world in half life isn't living at all. it was all marketing there is no food chain nor ecosystem, most of it was scripted behaviour and FSM.

the biggest advance in half life 1 is that it tried to implement a navigation mesh via mapper placing the vertices of the mesh, and the computer trying to do a somewhat intelligent mesh between those vertices

the AI was reactive like any FSM ( Finite State Machine, uses states to dictate the changes in the mesh and it's movement in the world )

Doom3 AI doesn't take into account any group behaviour, it's a simple FSM with a very restrictive set of movements (they only move forward, and this has nothing to do with their aniamtion but the code is done so they only move forward, they can turn but they either move forward or remain static), a simple cover system (the nodes) and a automatized static pathing system ( quake 3 bots AAS applied to npcs )

doom3 has a "relationship table" which is static, and hard-coded in the code, it's not user modifiable unless someone adds some code to read an external table (this is c++ work)

the most visible change in AI between doom3 and Half Life 2 is the more extensive set of movements the characters of half life 2 can do (now this allows for more different strategies, because the characters got a freer mobility ), Half life 2 also uses a FSM as all games from that era.
« Last Edit: August 23, 2015, 08:44:36 PM by BielBdeLuna »

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
Re: AI Teams/Relationships
« Reply #12 on: August 23, 2015, 08:48:08 PM »
...and jigglebones!

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 858
  • Karma: +42/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: AI Teams/Relationships
« Reply #13 on: August 23, 2015, 09:42:08 PM »
HL1 AI was Quake AI with more options.  Everything was scripted.  Couldn't even break the scripts!  (I actually DID kill that soldier that tosses the bomb ~.5 seconds before he tossed it).

Not sure why the AI in D3 can't walk backwards.  There's currently no animation to do it so they can't, but the flyers can go backwards.

But either way, there's 4 kinds of monsters in D3: flyers, zombies, demons & bosses.  Each is controlled by a master script and since the walking turret sees monsters as targets I don't see a reason you couldn't get other monsters to see other monsters as turrets.

The biggest issue I've seen with D3 AI is that they're singly focused.  IE when they get a target (player) they ignore everything else until it's (player) is dead.

MrC

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +8/-24
  • Doom Newbie
    • View Profile
Re: AI Teams/Relationships
« Reply #14 on: August 23, 2015, 10:20:03 PM »
HL1 AI was Quake AI with more options.  Everything was scripted.  Couldn't even break the scripts!  (I actually DID kill that soldier that tosses the bomb ~.5 seconds before he tossed it).

..wait are you talking about that map where they toss the bomb down and you're in the water a bit, in and around the surface tension chapter? Yea that was scripted, a lot of things in that game were, like when that scientist is hanging onto that ladder in the elevator shaft https://youtu.be/HiBh99OANs4?list=PL6PNZBb6b9LvDWpI-5CPYUxG1Rnm-vr9V&t=115.

Anyway I should probably clarify that I wasn't talking about scripted sequences but rather some of the differences b/w the two, like the decision making process (tasks and schedules in making better decisions during combat) and in terms of the whole default relationship table / disposition which helped give the illusion of a living world by having some creatures target others over the player instead of just seeing the player as you pointed out. The table made it really easy to add a new NPC that behaved accordingly toward another NPC. Again, all possible with the current set of entities and triggers mentioned in earlier posts here.

I was merely speaking about the end result, the atmosphere I found interesting as a player and why I thought I'd try to gather some information about where to replicate that sort of thing in D3 and apologize if there was any misunderstanding.