Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Dumb AI  (Read 5087 times)

0 Members and 1 Guest are viewing this topic.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Dumb AI
« on: February 26, 2013, 08:51:51 PM »
I've been trying to spice up the AI in, specificly huge maps with (theoretically) infinite view range for both the player and the NPCs.

So far, I have tried spawnflags 1024 and 256, but that just makes the AI spray violently from infinite ranges and strafe like a 15 year old COD player on caffëine.

Ofcourse, I used spawnflag 1 to make sure it only reacts as soon as the player is aware of the enemies, needless to say this doesn't improve the situation.

And even then, when the enemies get shot, they very rarely react or retaliate untill they specifically turn to see the player, let alone when their allies die, they hardly respond.

I've been reading up on the developer wiki to understand keyvalues and values, but the information there is so cryptic it hardly means anything to me, making it nearly impossible to use triggers as ondamaged etc.

Anyone have any sample scripts or general ideas on how to improve mapadd AI?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #1 on: February 26, 2013, 09:21:38 PM »
Some questions:

-Do you setted up nodes?
-You made the Soldiers into one Squad?
-u tried to use the npc_weapon_adjustspread command?

I also want to state here that the AI isnt dumb, sure it isnt very up-to-date, but its still good. You just need to know how to use it/deal with it.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #2 on: February 26, 2013, 09:34:12 PM »
-Do you setted up nodes?
-You made the Soldiers into one Squad?
-u tried to use the npc_weapon_adjustspread command?

-Yes

-Yes

-Yes

Unless I want to adjust the weapon_adjustspread for every specific single map, that's completely out of the question.
Plus if I added custom weapons that act like sniper rifles, the AI wouldn't be as accurate with one as they should because it's not possible to add that to the weapon scripts.

The AI just circle-strafes like hell and continues spraying at me from miles off, or just standing in the middle of nowhere waiting for a bullet.

Like I said, these particular maps are HUGE. I need the AI to not be able to see me from miles away, but also not miss me when I'm within 300 meters.

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #3 on: February 26, 2013, 09:39:25 PM »
-Do you setted up nodes?
-You made the Soldiers into one Squad?
-u tried to use the npc_weapon_adjustspread command?

-Yes

-Yes

-Yes

Unless I want to adjust the weapon_adjustspread for every specific single map, that's completely out of the question.
Plus if I added custom weapons that act like sniper rifles, the AI wouldn't be as accurate with one as they should because it's not possible to add that to the weapon scripts.

The AI just circle-strafes like hell and continues spraying at me from miles off, or just standing in the middle of nowhere waiting for a bullet.

Like I said, these particular maps are HUGE. I need the AI to not be able to see me from miles away, but also not miss me when I'm within 300 meters.

Well, the Combine AI wasnt designed for maps like this, but u could set up a point_clientcommand wich enables the console command npc_weapon_adjustspread to 0.1 or 0.01 and wich returns to the previous setting when the player dies or something. I dont have any other idea for that.

Also make sure the Combines wake theire squad on enemie contact, but I guess u already enabled that.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #4 on: February 26, 2013, 11:18:31 PM »
Nope, haven't, no idea how to implement that.
Is that in the mapadd?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #5 on: February 27, 2013, 07:55:24 AM »
Nope, haven't, no idea how to implement that.
Is that in the mapadd?

it is possible to do that via mapadd.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #6 on: February 27, 2013, 11:12:24 AM »
Nope, haven't, no idea how to implement that.
Is that in the mapadd?

it is possible to do that via mapadd.

Yes, but how?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #7 on: February 27, 2013, 01:08:52 PM »
Nope, haven't, no idea how to implement that.
Is that in the mapadd?

it is possible to do that via mapadd.

Yes, but how?

Place a point_clientcommand, instant_trigger wich commands npc_weapon_adjustspread to the value that u want, on player islived it fires the command again with the previous value.

guess it would look similar to this:

Code: [Select]
"entities" {

"instant_trig" {
"origin" "xxx xxx xxx"   //(At players spawn)
"keyvalues" {
"radius" "x"
"label" "commands"
}
}

"instant_trig" {
"keyvalues" {
"islived" "!player"  //(would this work?)
"label" "commandstonormal"
}
}

"point_servercommand" {
                 "origin" "xxx xxx xxx"
"keyvalues" {
"targetname" "spreadcommander"
}
}
}

"entities:commands" {
"logic_relay" {
                "origin" "xxx xxx xxx"
"keyvalues" {
"targetname" "relay1"
                        "OnRelay" "spreadcommander, command, npc_weapon_adjustspread 0.1" //(dont ask me if its really called OnRelay, look up in Hammer without Smartedit)
}
}
}

"entities:commandstonormal" {
"logic_relay" {
                "origin" "xxx xxx xxx"
"keyvalues" {
"targetname" "relay2"
                        "OnRelay" "spreadcommander, command, npc_weapon_adjustspread 1(write ur previous value here)"
}
}
}


This is just a fast code I wrote now, maybe needs some improvements. I know here are much more skilled mapadders here so u might could help, guys?
« Last Edit: February 27, 2013, 01:13:52 PM by Counter-Life™ »

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #8 on: February 27, 2013, 04:34:22 PM »
I meant 'Also make sure the Combines wake theire squad on enemie contact, but I guess u already enabled that.'


also, if I cut down the flags to not make them see all that far, is there a way to at least make them break out of patrolling when they get shot? It just seems silly that they don't respond at all when getting hurt, and just continue wandering.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #9 on: March 06, 2013, 03:11:18 PM »
Bump

So are you going to tell me how to make the squads react to enemy contact?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #10 on: March 06, 2013, 06:46:05 PM »
Bump

So are you going to tell me how to make the squads react to enemy contact?

Thats really easy, first make sure the NPCs have the same Squad name, then set WakeSquad to 1 and ur finished.

Offline Davidos667

  • *
  • +1% chance to make useful post
  • Davidos667 has no influence.
Re: Dumb AI
« Reply #11 on: March 07, 2013, 12:01:16 AM »
Bump

So are you going to tell me how to make the squads react to enemy contact?

Thats really easy, first make sure the NPCs have the same Squad name, then set WakeSquad to 1 and ur finished.

Is there a way to limit how close other allies have to be to be awakened? I don't want to pull a group from the other side of the map because they fall under the same squadname (Random spawns)

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Dumb AI
« Reply #12 on: March 07, 2013, 07:28:56 AM »
Bump

So are you going to tell me how to make the squads react to enemy contact?

Thats really easy, first make sure the NPCs have the same Squad name, then set WakeSquad to 1 and ur finished.

Is there a way to limit how close other allies have to be to be awakened? I don't want to pull a group from the other side of the map because they fall under the same squadname (Random spawns)

Sadlyout of my knowlege, but I dont think so.