x


How do I add bots in android?

Im making a racing game for android, and im trying to add more cars that will be your opponents. If anyone could give me the script for it, or explain to me how it is done, I would be willing to pay a $40 reward, if i can get it to work.

Thanks!

more ▼

asked Mar 30 '11 at 03:03 PM

garrett 4 gravatar image

garrett 4
1 3 3 3

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

2 answers: sort newest

Lol, money might make some people post =P.

For racing...

Have nodes on the map... These nodes are just path ways. And each set have their own tag... so like, set 1 set 2, 3, 4, etc...

So, you have the racer start at 0, (Start...), then you have a script....

If the time is 0 (Go time... going to assume it'll be like, 3-2-1 GO), if time is 0, find new target, each racer finds next tag... so the tag would be followed as... "i", so, you i++, get the next tag, it adds all those tags (Use a for:each), so, it adds those in to the array (You can use a List), so now, it random number's, and grabs that number of the array/List, and it goes to that one... And so on until it's done... And when target is reached, it goes for the next one... if that makes sense...

=) Hope this sparks an idea in the least... And don't worry about the money... Go and buy your girlfriend/wife dinner and tip the waiter/waitress the rest for me =).

more ▼

answered Mar 30 '11 at 03:16 PM

Justin Warner gravatar image

Justin Warner
6.3k 19 27 65

lol maybe yeah :p

Mar 30 '11 at 03:18 PM Meltdown

Lol, I don't like giving people all the code for their problems, always thought they should work for it at the least... But meh, whatever =P. Your way works too =P, lol.

Mar 30 '11 at 03:42 PM Justin Warner

1+ for the generosity(I think that is the right word) :)

Mar 30 '11 at 03:45 PM OrangeLightning
(comments are locked)
10|3000 characters needed characters left

I'd suggest taking a look at this tutorial

Paying special attention to Step 5 where AI is explained. Although for your benefit I'd suggest doing the tutorial from scratch.

Within the downloadable project is the complete AI script which uses waypoints to make the AI cars go around the tracks.

With regard to offering money for work/solutions, the correct place to post that is in the Unity Forums under the Commerce section.

http://forum.unity3d.com/forums/31-Commercial-Work

more ▼

answered Mar 30 '11 at 03:13 PM

Meltdown gravatar image

Meltdown
5.6k 18 25 49

(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:

x3418
x2609
x823
x423
x1

asked: Mar 30 '11 at 03:03 PM

Seen: 1313 times

Last Updated: Mar 30 '11 at 03:03 PM