How to improve my stealth AI?

Im making a stealth based AI for a project im working on, ive already got it mostly finished but i still would like some feedback/ideas for it.

So far, my AI simply wanders through areas ive provided it with, and each time it reaches a different waypoint (what the pathfinding service uses for paths) it checks 2 things: Can i see a player and are they close to me? and Can i see suspicious things like equipment for breaking in or dead bodies?

If theres a player next to it, it will add 1 more point to the detection value, if the value is above a set amount, it will instantly panic, run off to a random control room and call on its phone, which causes the players presence to be known, the “suspicious thing” stuff works the same way, but its way easier to alert the ai with it. How this works is by simply leaving markers such as “dead body” or “equipment”

Known issues / compromises:

  • How fast the ai detects something depends on how fast it walks to each waypoint
  • Roblox might not be ok with you having to kill harmless NPC’s to avoid detection
  • You can only equip a knife that only alerts NPC’s when you use it while hidden

Criticism, feedback, help and ideas are greatly appreciated!

Reminds me a ton of hitman AI behavior, and it seems like you’ve thought through a good deal of the logic, as well as a performant way to implement it.

One area which I do feel is a bit lacking though is what it does when it flees - I think it would be more compelling if it continued to run until it found certain things like a security guard, a phone booth, or just a crowded area which they could warn and start a chain reaction of NPCs fleeing. I think there’s frankly a lot of room for cool behaviors there, as opposed to just running into a closet and whipping out a cell phone.

Also in terms of NPC detection, if you’re feeling up to it you could have the item’s detection range be inversely proportional to it’s size. This should help with player detection, as you’ll notice a person in a room way before you notice them holding a knife.

As to the killing harmless NPCs, one of the largest games on the platform is about hunting and killing people who are likely children for sport - since it’s not super gory though it’s fine. With Roblox’s audience aging up you might be able to release a more brutal version at a later point.

I’m not entirely sure what you mean by this, however I think the best mechanics are both intuitive and make in-universe sense. For example you should be able to pull your knife out at any time, but if you do so in a crowded room and stab someone, everyone should freak out and run away. This way the player gets more control over their fate while at the same time making the world feel a bit more immersive and dynamic.

Best of luck! Sounds like a promising concept!

I feel like the first issue/compromise isnt really an issue. if youre game is about stealth there should be periods where the AI is clueless to the player’s location or wtvr. However if you think that your AI is too easy to get around i would say give a weight/percent chance that the AI walks toward the player. this makes it so the AI will be more inclined to walk in the direction of the player increasing chances of getting caught. Con of this is that making the weight too high will make the AI always walk toward the waypoint closest to the player.

The second issue isnt something you should worry about. You can kill NPCs in a few games.
As long as the NPC

  1. isnt a kid because no games can do that (i think)
  2. Isnt gory upon death (im sure a few blood splats is fine just no organs flying)
    A good example is the game ZO. You can cut off limbs and heads of players in that game with blood splurting out. Its one of the big games and has yet to be taken down or changed.

Not sure what your concern is with the knife thing but maybe make it so that they can only detect you using the knife if they are near you.

You should check out Notoriety which has alot of the features youre asking about here.

Thank you for the feedback! I really needed ideas on what npc’s do after they detect you, btw what i meant is that you cannot use guns, grenades or medkits only the knife if you havent been detected yet

1 Like

So the FE gun kit gore effects (the old ones that dont look like flesh puppets) are out?

Seems like roblox is ok with it then i guess. What exactly does the gore look like?