A quick question..

i am currently looking for an efficient AI script, and have had little success through many-a google searches, and i hope to have a bit more success here. if anyone could possibly share a bit of Scripting for an AI to get me started, or perhaps walk me through it, you would be appreciated. i have little to no idea of where to start.

They are difficult to find because AI scripts are tailored specifically for individual games. Every game has different requirements as to what they need their AI agents to do, so it would be impossible to make a universal “efficient” AI script.

I could give you a 2d sidecroller AI script, but if you’re making a real time strategy game, what good would it be?

Try Angry Ant’s Behave system.

i am making a game involving a large number of zombies a large map and a player running and killing them. (in other words i need a ray-cast script, but so that it affects any other AIs in the area, like if you used a basic AI ray-cast your proximity triggers THAT AI’s ray-cast, but i also want to do this to all other ones with the same script around it.) so that you cant pull one zombie, and you HAVE to level up and get better weapons.

I’m confused now. Could you maybe supply us with a GDD or a better description of what you are trying to achieve?

Ray-cast that activates with proximity making zombie follow and attack player, until dead or immobilized. which also activates the surrounding zombies, if there are any in range, and makes them follow attack the player.

You’ll definitely want to use a trigger, then. google it, ma friend!

Trick…

Give each zombie a site trigger. Whenever anything enters/stays the trigger have it ask if it is a zombie or human. If it is a human, first: Have your zombie do a audio check. (i.e. if the human is walking, or running they make more noise, but if he is crouching or creeping, he makes less) Second: Have it do a dot product check. If the human’s location is behind the zombie, then we couldnt see him. Third: Have it do a los “Raycast” check and see if the zombie can see him. Fourth: we do a visibility check. If we are concealed and wearing concealing clothing or wearing a cloaking suit, zombies can’t really see us…

do all those checks and you have the start of your ai. Next, it would be just select where the player is, and go after him. (this gets more complicated as we may not be able to see the human so you will end up doing some pathing to get around objects.

A cute trick I did was to use a dummy target and mark the human when I saw him. As the human moved, I made the target stick to him. When he ran away and tucked behind something, I stopped moving the target. This allowed my AI guy to continue moving towards his target and got around AI pathing. AI pathing is totally necessary though.