PDA

View Full Version : AI problem


Co&Co
01-14-2003, 11:55 AM
We have a small ai problem.
http://maxpayne.gamigo.de/screens/problem_coco.jpg

The character comes out of the door and is programmed to walk straight ahead to the waypoint, but as you can see on the screenshot he first walks to a different direction. It doesn't make any sense.

Any ideas?

FreDsom
01-14-2003, 01:39 PM
While we are talking about AI, what good does actually calculating the AI do?

mph
01-14-2003, 01:49 PM
The AI movement network is a big grid that tells the enemies where they can move to - it stops them from running into solid things, such as walls, chairs, tables... I'm sure you can think of plenty of solid things. Basically, the grid's presence defines all of the "empty" space in a room.

Each point on the grid is a node and these are points where the npcs can move to - the denser your AI grid, the more nodes there are, meaning they can move to more places. Making the AI grid really dense isn't beneficial though, as it takes longer to calculate and might cause more problems (npcs might get too close to objects and bump into them)

Each room has its own AI grid, so each room can have its own grid density. The default is a node every 1m, which seems to work well most of the time.

If you don't calculate the AI grid, then you will have very stupid enemies who won't move very much (they'll only move via their statemachines)

[ 01-14-2003, 01:54 PM: Message edited by: mph ]

FreDsom
01-14-2003, 02:25 PM
Hmm.. you actually learn things at here images/icons/tongue.gif
Thanks for the help images/icons/wink.gif

william ford
01-14-2003, 09:49 PM
Could try just extending the ai blocks so they come right up to the way point, then they'd have no choice but to follow.

mph
01-15-2003, 12:53 AM
I think I've bumped into this problem a few times (it's really annoying) If there's an exit in the doorway (which I think there must be) then deleting it will probably solve the problem completely.

Deleting exits isn't an ideal solution though... maybe you should try extruding your ai collision meshes and perhaps make them wider. In my Rave level I had enemies walking in zig-zag lines and it seemed to fix itself when I put some ai collision meshes along each side of the characters' paths - to be honest I didn't think the meshes would make any difference, but they did.

You could always try adjusting the ai grid densities of each room, though I doubt it will make any difference.

You could try putting in multiple waypoints, but I doubt that will help either.

That's about all I can think of at the moment.

maxey
01-15-2003, 12:56 AM
hy there.
all you gotta do is make the AI net a little more dense! as you might or might not know all of the enemys are moving along the lines of a net, you can even make it visible ingame (its F7 as far as i can remember in developer mode). now if the net aint dense enough the enemy will have to take a different route to get as close as possible to the waypoint.

now to make it more dense: select the room you wanna do that with in f5 mode, and press enter to get its properties. bring up the "statstics" tab, and then just use the slidebar to change the net density.
the lower the value the denser it is, but also the more time it takes to calculate on startup!
so maybe try 0.5, this should make it already way more accurate.

hope this'll help you


JcDenton999
(i asked maxey for his account when i read that since i dont got one myself)

[ 01-14-2003, 01:03 PM: Message edited by: maxey ]

william ford
01-15-2003, 08:45 PM
Did u make sure u recalculated the ai after ajusting the desity?

Co&Co
01-16-2003, 12:21 AM
Well, we tried to extrude the ai blocks....didn't work. We also tried adjusting the ai density....no succes either images/icons/frown.gif We don't want to delete the exit in the doorway because of the fps.


I think we just have to let him walk his own way. Thx for all the help anyway!

Co&Co
01-16-2003, 10:56 AM
Yes. We did recalculate the ai, but it didn't work out.

william ford
01-16-2003, 08:21 PM
When u figure it out can u tell me cause i have a similer problem. images/icons/grin.gif

StratonAce
01-16-2003, 11:17 PM
Hey Co&Co, I've had the exact same problem before with Evolution, and more recently with my level for the Lightsaber team. Although I don't know for sure what causes it, here are some solutions that I found to work for me to help with this problem somewhat.

Set up a guide-way (walk-way) for this character. I first encountered this problem in my Garage Battle level in Evolution and I had to make "specific" pathways, guide-ways for each of my characters in certain room. In this room, the "wandering" of the AI characters was extremely horrid, they would go wayyy out of their way to get to a waypoint that was damn near right in front of them. So, I first made my guide-ways using the AI blocker texture, and after compiling the ai and running the level, this seemed to work for several of the characters, BUT, not ALL of them. images/icons/frown.gif

So, for the ones it did not work for, I had to go back in and also add guide-ways that used the Character Collision texture along with the AI blocker texture. In other words, I had the "walls" of one of the guide-ways made out of the AI blocker, and also, with a brush that surrounded and overlapped it, I made another "wall" that was made from the Character Collision texture.

This seemed to finally work. Had to guide those bastiches every step of the way it seemed. images/icons/wink.gif NOW, this does create a problem.... If it is an area where you want other characters to cross later, or the player to cross later, obviously the way will be blocked by the character collision wall. The way around this is to make the character collision wall a DO, rather like a door. Made 2 different positions for it. 1 - the "up" and in position frame, which is where it will be when you have these npc's of yours to do their thing. 2 - a "down" frame, which will quickly lower the door through the floor and out of the way. And tada, the player can now walk through the area. images/icons/wink.gif

StratonAce
01-16-2003, 11:23 PM
Oh, and a note on AI density. I find that the default density setting works best for me, at least regarding cut-scenes. If I increase the density, the "wandering" becomes worse as the characters have a lot more options in how to travel to a certain way-point. And them bastiches NEVER seem to pick the shortest route to the way-point. images/icons/mad.gif

william ford
01-17-2003, 08:36 PM
I noticed that too. If u increase it then play it in game and press one of the f buttons(i forgtet which one) the grid actually gets bigger images/icons/shocked.gif .
Try making it smaller?

Co&Co
01-18-2003, 07:01 AM
pffff.......it finally worked!
We just made a character collision wall around his walking path and now he just walks fine. After the cutscene we just raise the character collision wall. (with an animation, it's a DO).

THX everybody!