x


How To Make Basic AI?

Okay, so I have a first person shooter set up, with a map and a character, with animations, grenades, multiple guns, etc. I am NOT using the MachineGun.js script unity includes in there FPS tutorial. I wrote the whole script from scratch myself. I am using a lot of the assets from the bootcamp demo, and I want the enemies to be the soldier you play. I have the model setup, and I have all the animations. All I want to do now is have him stand there (or possibly patrol a path), and when you get within a certain distance from him, he will maybe run and hide, then a few seconds pop out and start shooting, or something. The games pretty much finished except for enemies. you can pick up ammo, and there are plane crashes and stuff like that, so I want it to look good. Possibly, could someone explain how to use Behave (and exactly how it works), because I can't find any good tutorials. (Also, I already have it installed and ready to go. Its version 1.12 I think)

more ▼

asked Feb 09, 2011 at 06:22 PM

Kazaskater gravatar image

Kazaskater
106 45 33 42

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

As far as I know, Behave is just a drag and drop solution to easily create finite state machine structures, but you still have to code by hand the actual behaviors that are supposed to occur in each state.

I would dissect the AI scripts from the various tutorials from the resources section of Unity3d.com, both the 3rd person platformer and the FPS tutorials have basic AI behaviors that can get you started with a basic patrol/chase/attack bot.

more ▼

answered Feb 09, 2011 at 07:09 PM

PrimeDerektive gravatar image

PrimeDerektive
3.4k 166 135 170

(comments are locked)
10|3000 characters needed characters left

As mentioned above, you can use the scripts from the Unity FPS tutorial. I have created a FPS game and used the scripts on my AI and it's great.

The scripts are "AI (which automatically assigned a character controller), AIanimation (which allows the AI to animate) and you can also assign a damage receiver or something. It's all there in the tutorial, all you have to do is drag and drop.

It also has a waypoint finder, you only move the waypoints around and the AI will follow automatically.

more ▼

answered Feb 10, 2011 at 11:37 AM

Zeyad Tuffaha gravatar image

Zeyad Tuffaha
37 16 12 21

The problem is, is that the scripts are just much too different. It would require me to basically break down their entire script and pretty much redo it. I guess I will just look at theirs and make a new script from scratch, using some of their code.

Feb 10, 2011 at 07:05 PM Kazaskater
(comments are locked)
10|3000 characters needed characters left

If you want to learn how to make a great game AI, read Programming Game AI by Example. The book is geared toward creating First Person Shooter behavior.

more ▼

answered Feb 09, 2011 at 08:49 PM

Stib gravatar image

Stib
16 4 4 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1403
x1071
x205
x87
x70

asked: Feb 09, 2011 at 06:22 PM

Seen: 3639 times

Last Updated: Feb 09, 2011 at 06:22 PM