Is it possible to have advanced AI pathing?

This is one of the questions I had. I have a total of four, the first being the above.

In more detail I will ask : Is it possible to make AI wander without a given path? For example : The nav has been set down but I don’t tell an NPC to go walk here, but pick a random path.

The second question : Is it possible to, if an NPC (While wandering) Enters a specific “Zone” (like maybe at a street stall or shop) they will stop there for maybe 10-20 seconds and then continue wandering?

The third question : Is it possible to make an NPC, when SEEING an npc of the same faction get killed, for them to turn on the player and run away or attack the player?

The fourth question : Is it possible to, if the NPC that runs away from the player after witnessing a murder, go and get maybe a metrocop or something and bring them to the scene of the crime? (This is most likely impossible, delving into coding maybe?)

The reason I ask is that I am planning to make a big town-like map with an outlying forest. I wanted it to be Singleplayer (Or Multiplayer if the NPCS will still spawn) and give the player the ability to kill people but maybe have consequences, so there’s more challenge in killing. The town would also have a lot of different ways to murder. This may be sick and twisted, but I kind of like this idea of choice. I got the idea after watching a certain show (For fear of reputation loss, I won’t specify) and each year someone was killed on a specific day. I wanted to recreate this system but give the player a more free-roam capability. I think the first two questions may be possible, but the last two MAY not be possible without the help of lua… If I need Lua to involve this, I could come up with a different thread with the idea of a gamemode, for now though I would like to see if I can independently do this.
-Thanks for your time in reading this.

Maybe with SNPCs if your good at coding.
maybe you’ll have to make your own mod.

That’s what I was afraid of… I can’t code worth my life. I was hoping it was possible with a citizen. The whole purpose of the map like I stated was a sort of stress reliever. If it is put into a gamemode, there’s a very high chance it will become competitive and then it wouldn’t be as fun in my opinion…

All four things are possible. While the third would be a bit more complicated though…
I am absoloutely sure it is possible to place info_nodes and assign them to groups which would then be the paths you want the npc’s to go. And for the randomness of which path they will choose, you can use the logic_case entity, it can be used as a randomizer. Also aiscripted_schedule could be useful.

There’s a wander capability built in somewhere… It’s all possible though.

Excellent… Thanks for the info.

Edit : Additional Question : Is it also possible to make an npc follow you even if they are wandering? If it’s a citizen NPC?

Try using an ai_goal_follow for that.

By what I said, I meant if you used him (Ex : Random Citizen is walking randomly, you press E on him, he stops wandering and he follows you. Imagine original HL2, just without the AUTOMATIC following.)


Maybe some use of func_buttons which are parented to the citizens? When pressed they trigger the ai_goal_follow on and the citizen starts following the player.

Okay, thanks for the help! I’ll start putting the map into a full concept and then start mapping it in the 3d world!

Sweet sounds kinnda cool

Cool idea I would LOVE it and probably play it alot but it would be quite hard but be worth it.

hey, i want this map! send me a dl like when your done.

I unfortunately might have to put this map on the backburner, i’m in the midst of making a strider survival map (Similar to that of the EP2 finale) and school’s going to be starting soon, so when I do get around to it, it might be ready for public release in maybe November.