AI Stealth Issue: "I Guess It Was Nothing"

Post » Sun May 13, 2012 2:06 am

The people that are saying that it's difficult to program that AI are taling pure rubbish. Sorry but they are. I'm a game programmer and I've very easily made AI that doesn't actively stop looking for you.

Honestly your basic algorithym goes as such:

1. Am I actively searching?

No = carry on basic patrol pattern

Yes = set to actively searching and then just loop run search code

Put simply to NOT set them back to basic patrol all you do is NOT break them out of their active search code. I mean the fact that the guards do try to find you in certain instances means that the AI for searching is already there. So it;s just a case of setting a variable that says whether you have been attacked or not to true when you have been attacked. Then when you'd normally go back to patrol mode you just bypass that if 'attacked' equals true. It's about as easy as coding gets


Haha, I love all the experts here talking about this revolutionary technology and then very quickly disappearing when somebody with a brain shows up.
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Sun May 13, 2012 12:05 am


Edit:

Oh and I am simplifying a little with the AI as far as realistic is concered but to make it more realistic all you would have to do is used what is called 'Line of Sight' to determine if the player can be seen. If they can you just use the pathfinding to move toward them. If they can't you take the last point they were seen or heard and then get the guard to move to random points around that point to have them 'actively search' the area. After a short period they could either return to that point and continue patrolling as usual or if they see or hear the player again they can being the chasing code again. Again it's really not hard


Is this not what the Skyrim AI does? I don't recall ever being detected in stealth mode unless the NPC is directly facing me and I'm within their LoS. Also when I shoot an arrow from stealth mode the NPCs will run to the point from where I shot the arrow and commence look around that general area until I become fully undetected again and they return to their original guard placements.
User avatar
Charles Mckinna
 
Posts: 3511
Joined: Mon Nov 12, 2007 6:51 am

Post » Sun May 13, 2012 3:35 am

Totally valid point. Yes the guards did have a habit of forgetting things but at the same time they would call for help and trip alarms when attacked. At that point that would not stop searching for you or at the very least you'd have more guards and all of them on high alert. So why is that not in this game?

Also, you've pretty much summed up why the stealth in Skyrim is terrible. If the same guy worked on this why are there no ways of putting out candles or turning off lights? It wouldn't effect performance one jot as the places are already dynamically lit so removing a light source would actually boost performance if anything. Their line of sight code is fundamentally broken as well. I've had times when I've been behind a guy or in a corner where noone can see even a single pixel of me but still somehow I'm 'detected'. Stealth mechanics need to be at the very least consistant. Even if they're broken they should be consitantly broken. In Skyrim you have no idea when you are hidden or not. Why not just rip the hidden mechanic direct from Thief? It worked brilliantly

Edit:

Just reread your post. I haven't delved into stealth that much but my understanding is that you can't snuff any light source out. I mean I've tried a few times but it just doesn't seem possible. Can you snuff out light sources?

Even if you can the detection mechanic just doesn't work and guards just don't react even close to how they should do
Yes, you can snuff out light sources in Skyrim, but not all of them. The way the engine works you can only snuff out dynamic lights. Not all lights are dynamic (this would slaughter frame rate).

As to why you are sometimes still detected while being totally behind cover, Skyrim enemies can HEAR sound. So they have detected someone is there not by SIGHT, but by SOUND. You can even distract enemies or lure them away from their posts by shooting arrows against a wall or throwing things and they will go investigate the sound.

It sounds like you just need to explore the stealth mechanics more thoroughly and then see if you still have any complaints.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Sat May 12, 2012 9:11 pm

The people that are saying that it's difficult to program that AI are taling pure rubbish. Sorry but they are. I'm a game programmer and I've very easily made AI that doesn't actively stop looking for you.

Honestly your basic algorithym goes as such:

1. Am I actively searching?

No = carry on basic patrol pattern

Yes = set to actively searching and then just loop run search code

Put simply to NOT set them back to basic patrol all you do is NOT break them out of their active search code. I mean the fact that the guards do try to find you in certain instances means that the AI for searching is already there. So it;s just a case of setting a variable that says whether you have been attacked or not to true when you have been attacked. Then when you'd normally go back to patrol mode you just bypass that if 'attacked' equals true. It's about as easy as coding gets

You're making it sound easier than it really is. On paper its logically sound, trying to write the code so it works correctly is another story. And no its not as easy as programming gets, I should know since I am a programmer too.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Sat May 12, 2012 5:44 pm

Is this not what the Skyrim AI does? I don't recall ever being detected in stealth mode unless the NPC is directly facing me and I'm within their LoS. Also when I shoot an arrow from stealth mode the NPCs will run to the point from where I shot the arrow and commence look around that general area until I become fully undetected again and they return to their original guard placements.

Being serious we must be playing different games lol. I'm constantly being detected when I shouldn't be. I haven't used a bow so I really can't comment on that but tbh that seems like an oversight. I mean they look around the are where it hit and then after a while go back to normal? That is never going to find anyone who's shooting from range. If someone has fired an arrow they should at least stay on a higher alert ,and really to encourage the player to act, rather than stand still (I mean you're supposed to be stealthy right, not invisible?) they should use your actual position and get a couple of guards to randomly move around that for a brief period. It's cheating yes, but it'd make the guards more realistic (oh they're guessing the trajectory that the arrow followed and working back to me?) and it would enrich the stealth aspect as well as you'd actually have to use your brain rather than just stand far away and shoot them with arrows
User avatar
carly mcdonough
 
Posts: 3402
Joined: Fri Jul 28, 2006 3:23 am

Post » Sat May 12, 2012 3:52 pm

I was really hoping they would fix this in Skyrim, good thing I had low expectations in the first place.

Before skyrim was released I was envisioning a better stealth system where you shot someone and they were on alert for at least a day, even after checking the surrounding area. Sneaking was more based on line of sight than anything, so even if they know someone is out there they don't know exactly where. They can check the spot that they got shot from, but they don't know where you are instantly. Introduction of noise making devices, misdirection magic/devices, and better lighting impacts of stealth would have improved it as well.

Eh, sneak appears to be a polished version of what it was in oblivion. Get your sneak high enough to shoot people without them retaliating.

Sneak attacking single opponents with a dagger is still cool, though.
User avatar
Veronica Flores
 
Posts: 3308
Joined: Mon Sep 11, 2006 5:26 pm

Post » Sat May 12, 2012 4:03 pm

Being serious we must be playing different games lol. I'm constantly being detected when I shouldn't be. I haven't used a bow so I really can't comment on that but tbh that seems like an oversight. I mean they look around the are where it hit and then after a while go back to normal? That is never going to find anyone who's shooting from range. If someone has fired an arrow they should at least stay on a higher alert ,and really to encourage the player to act, rather than stand still (I mean you're supposed to be stealthy right, not invisible?) they should use your actual position and get a couple of guards to randomly move around that for a brief period. It's cheating yes, but it'd make the guards more realistic (oh they're guessing the trajectory that the arrow followed and working back to me?) and it would enrich the stealth aspect as well as you'd actually have to use your brain rather than just stand far away and shoot them with arrows
Remember that you start out not being good at Sneaking, since it is a skill. Unlike in games like Thief or Splinter Cell your stealth techniques don't start off 100% effective, even if you do everything right. Only by maximizing your Sneak skill and getting all its perks are you going to always remain reliably hidden. It's still a RPG. Sometimes you just "fail your roll" on being undetected.
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Sun May 13, 2012 3:45 am

the game has speeded up days.

If I shot someone and sneaked away, they would be on alert for a long time. and hey, in real life ninja/commando world, you just wait and wait and wait. for hours. does that sound fun? nope. since time is speeded up, consider that you may not be wating a long time but your character experiences it in a different time reality. that is not perfect anology, but i think it has some merits.
User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Sun May 13, 2012 2:30 am

You're making it sound easier than it really is. On paper its logically sound, trying to write the code so it works correctly is another story. And no its not as easy as programming gets, I should know since I am a programmer too.

Putting together a fast enough pathfinding system isn't easy. It's mind breaking :P But being as they've built a ton of games that use insane pathfinding I'm presuming they've already got something that works and is fast. So if you've got that and you've got working line of sight (Within reason. I mean you're not gonna line of sight around the edges of items but more use base height and width) then really I don't see the problem. You plug it together with some conditional checks to create a more realistic response and you're done

Oh I don't wanna spam this thread so I'll answer Rabbit as well.

Yeh I should really look at it more closely before declaring it dead but the basic mechanics just seem flawed to me so I don't want to go deeper into the rabbit hole. Cough :P Dynamic lighting on certain items obviously was something that had to be done and it is tricky in bigger city like areas but really the answer would be to have light sources that are out of reach but that leave areas of dark around that can be supplemented with dynamic interactable lighting. This would preserve the overall lightness of bigger areas but still allow a thief to be a thief in a lot more instances. I mean from a realism POV it works. If a light is out of reach and it's lighting a doorway then I just don't pick that door

Edit: I've been detected when not moving and out of sight BTW. So something is maybe just broken there. Thinking about it it might be constant dice rolls that's bringing in a random element. I'll admit I forgot about that. For that reason though I'd have to say stealth should have absolute rules. You are either seen or not seen. Dice rolls on attacks and picking etc... are fine but just be hard with the rules for actual stealth or you end up with this inevitable mess
User avatar
naome duncan
 
Posts: 3459
Joined: Tue Feb 06, 2007 12:36 am

Post » Sun May 13, 2012 1:21 am

Solution:

Charge them after the first arrow, keeps the game interesting.
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am

Post » Sat May 12, 2012 7:53 pm

Solution:

Charge them after the first arrow, keeps the game interesting.

Haha! This is a great solution!
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am

Post » Sat May 12, 2012 6:20 pm

Can see your point in system being unrealistic. But it's probably the best way to keep stealthy characters viable.
User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Sun May 13, 2012 5:04 am

Simple solution, assassinate them before they speak.
User avatar
Charlie Sarson
 
Posts: 3445
Joined: Thu May 17, 2007 12:38 pm

Post » Sat May 12, 2012 2:18 pm

Thieves guild spoiler.

Spoiler
The thieves guild questline is one of the only that tells you to raise your skills before doing it, if someone claim to have done the questline with 20-30 skills i know they are full of it, many of the locks are expert/master wich can be picked if you burn like 10 lp on each door, but the real challenge is sneaking past the guards with only 20-30 sneak ? all the guards are sound sensitive and there are parts where you have to sneak next to them, im guessing you need atleast 50-100 sneak before you have chance of completing this questline.Its the first questline for me where i couldnt just steamroll over it like i did with the dragons.

There has been tossed alot of effort into this questline and its my favorite so far, i loved the nocturnal part.

from a scale to 1-10 i have to give it 10.
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm

Post » Sat May 12, 2012 4:47 pm

Being serious we must be playing different games lol. I'm constantly being detected when I shouldn't be. I haven't used a bow so I really can't comment on that but tbh that seems like an oversight. I mean they look around the are where it hit and then after a while go back to normal? That is never going to find anyone who's shooting from range. If someone has fired an arrow they should at least stay on a higher alert ,and really to encourage the player to act, rather than stand still (I mean you're supposed to be stealthy right, not invisible?) they should use your actual position and get a couple of guards to randomly move around that for a brief period. It's cheating yes, but it'd make the guards more realistic (oh they're guessing the trajectory that the arrow followed and working back to me?) and it would enrich the stealth aspect as well as you'd actually have to use your brain rather than just stand far away and shoot them with arrows


No, I said the NPC come towards me from where I shot the arrow, and in order to avoid them I have to move to another hiding location.


How easily your detected is determined by the lighting around you, if you're moving, and how many perks you pump up stealth with. If you don't put anythin into stealth then you can be discovered fairly easily, but once you level up your sneak a good bit then it becomes a lot easier to stay hidden.
User avatar
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm

Post » Sat May 12, 2012 8:50 pm

Metal Gear solid games have done a great job of this and they are much older games.
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Post » Sat May 12, 2012 4:25 pm

Putting together a fast enough pathfinding system isn't easy. It's mind breaking :P But being as they've built a ton of games that use insane pathfinding I'm presuming they've already got something that works and is fast. So if you've got that and you've got working line of sight (Within reason. I mean you're not gonna line of sight around the edges of items but more use base height and width) then really I don't see the problem. You plug it together with some conditional checks to create a more realistic response and you're done

When you put it that way it does sound like the basics, but programming basics, not common knowledge. Either way you proved your point. You are clearly a more experienced programmer than me lol.
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Sat May 12, 2012 8:24 pm

The pathfinding in this game isn't perfect so that might be part of the problem also. What I don't like is when two npcs are sitting next to each other and you put an arrow into one buddies head while the other guy just derps out and acts like nothing even happened. I swear this exact scenario was shown in one of the main videos released before going gold. I may be mistaken, but I swear in that one video the npc is taken out while the other just sits idoly by.

The pathfinding I'm finding is causing some issues where the AI isn't programmed to handle jumping up small rocks as well...or at least this has been my experience so far in some encounters.
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Sun May 13, 2012 4:26 am

I was thinking about "What would be a truly realistic reaction?" and here is what I came up with. It wouldn't work in other types of games but fits perfectly with the scope of Skyrim, in my opinion.

So you're infiltrating a dungeon/prison/mine/whatever. You come upon a few bad guys and get to work, sneaking through either violently or not. Eventually you fail a Sneak check.

Sneak failure w/o hard evidence (e.g. the player knocks something over, makes a noise, or is seen as a rustling shadow): what we have now. "What was that?", searching around a bit, going back to whatever they were doing. "Must be mice." Fine.

Substantiated sneak failure (e.g. an arrow in a guy, a dead body is found, the player is directly spotted): decisive reactions as follows.

Phase I: thorough area search (though still possible to evade by highly skilled players/characters).

Phase II: send for reinforcements and/or leave! Five guys patrolling a room aren't just going to hang around as they get picked off one by one by an invisible assassin. At some point they're going to send for help, or abandon the area. You see it in every single horror movie, and every single war movie. "Let's get out of here!" Reinforcements (if any) can be summoned from deeper in the dungeon. One guy will leave to go get them. This might be a good opportunity for the player to make another kill on the guys who are left, or possibly sneak past them.

Phase III: leave. Once all the bandits (or whoever) are together, and they still can't find the invisible killer, they will abandon the dungeon, after first gathering their valuables (definitely including any quest objectives). Imagine it! This will create a lot of opportunities and dangers for the player. When a bandit goes to empty out a chest, the player might find a chance to stab him. As the bandits leave the dungeon, it might be possible to bushwhack the last one to leave. Or set a trap for the first guy to leave. And of course there will be a lot of moving around as they get ready to go, which may end up revealing the player.

Where do they go? That's the beauty of the TES open world. One guy can say, hey, I know an abandoned mine over near City X, let's go hide there. The game doesn't even have to populate it with other monsters; the bandits can just go there and set up in a new dungeon formation. Depending on the NPC type, they might even go to a city for safety. But travel is a great chance for a player to stalk NPCs, while placing an obvious time limit on such activity. And of course the NPCs might run into monsters or other third parties on the way.
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Sat May 12, 2012 5:40 pm

Wow. That would be epic, Zombra. I would truly be impressed!
User avatar
His Bella
 
Posts: 3428
Joined: Wed Apr 25, 2007 5:57 am

Post » Sat May 12, 2012 11:58 pm

So in real life if you sneak up behind someone and stab them in the back they wouldn't immediately turn and find you? No in that situation I guess the person would be baffled as to where that sudden pain came from and go and take an indigestion tablet.

Surely stealth is about being STEALTHY. You know like using shadows. Sneaking up on someone is half the battle. You have to be able to get out quick when you attack them as well.

Why invent better AI? This is really basic stuff they aren't doing right. I am a game developer and I wouldn't want laughable AI going out in a 50 pound game because that's my baby out there being judged. It shows a distinct lack of integrity, self respect and worse, shows a complete lack of respect for the consumer. It's a 'Oh that'll do' attitude. Don't go putting stealth based gameplay in half baked and proclaim 'we're trying to make the best stealth game experience'. It's just not on. Honestly active searching for guards is the easiest form of AI because you work backwards from perfection.

It works exactly the same way as pathfinding does. Instead of the players position and the mouse click position you just pass in the players position and the guards position. Viola! You know have a guard that will hunt the player down mercilessly. Then it's just a case of dumbing it down with randomization. It really couldn't be simpler. Their stealth mechanics are a joke quite frankly.

Thief was superb. Commandos was superb. Those games came out in the 90s for godsake. I mean Jesus Christ Pacman used the algorithym I just described.

Why ask consumers to program a game when the developer quite clearly has the available tools to do it himself?

Edit:

Oh and I am simplifying a little with the AI as far as realistic is concered but to make it more realistic all you would have to do is used what is called 'Line of Sight' to determine if the player can be seen. If they can you just use the pathfinding to move toward them. If they can't you take the last point they were seen or heard and then get the guard to move to random points around that point to have them 'actively search' the area. After a short period they could either return to that point and continue patrolling as usual or if they see or hear the player again they can being the chasing code again. Again it's really not hard

Thief was also not a game where you were aiming to kill your opponents. You wanted to distract them and avoid them and steal things.

This game, we sneak around and steal and kill. Having everyone automatically know where you are after you shoot someone first defeats the purpose of a stealth combat build. You might as well make the arrows and backstabs a 100% guarantee to kill someone then because if not, we'd have no shot in hell at getting a second attack in.
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Sun May 13, 2012 5:07 am

Couldn't they just make the NPCs use more appropriate lines if they've taken damage recently?

"Someone shot me!"
x time passes
"I guess they must have left?"

I encountered this, I killed a pirate captain and one of her bandits found her body and they were:
"Who could've done this?"
"Search around!"
x amount of time passes
"I don't think they're here anymore"

How has no one else noticed this???
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Sat May 12, 2012 11:02 pm

I encountered this, I killed a pirate captain and one of her bandits found her body and they were:
"Who could've done this?"
"Search around!"
x amount of time passes
"I don't think they're here anymore"

How has no one else noticed this???
Yeah, I was paying attention last night, and substantiated sightings were never dismissed as nothing; it was always "I guess they're gone." Which is still stupid, but better than what's portrayed here. Admittedly my test sample was very small, so inconclusive. Will continue to pay attention.
User avatar
Manny(BAKE)
 
Posts: 3407
Joined: Thu Oct 25, 2007 9:14 am

Previous

Return to V - Skyrim