How exactly do you make the perfect AI?

Talk about making games.

How exactly do you make the perfect AI?

Postby The achievement » Mon Jul 31, 2006 12:09 am

Just a question, my way doesent really seem to work. what do you guys think?
I am the only Zombie Genocider.
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby DilloDude » Mon Jul 31, 2006 12:46 am

The AI script is different depending on what you are making. A simple enemy might just move back and forth, a slightly more complex one might chase you, and a really complex one might decide when to move away, when to folow you, when to shoot etc. To make AI you really need to decide what you want it to do in which circumstances.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby The achievement » Mon Jul 31, 2006 2:13 am

Yeah what i wanna do is when i open the door, the enemy heres the door opening and then he starts chasing you. ive done it before, but i forget now. and by the way, dillodude your game looks really good.
I am the only Zombie Genocider.
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby relaxis » Mon Jul 31, 2006 1:08 pm

lol,
you would need to work out the x,y, coordinates of the enemy on the screen and then create some kind of a conditional on the door.
____________________________
| ........................|.......................|
|.........................|.......................|
|.........................|...................... |
|.........................|.......................|
|.........................|.......................|
|.........................|.......................|
|...E....................|...............D......|

E= Enemy D= Door

So work out the coordinates of E and then divide the screen in half. If the door is opened when E is on the left handside then he doesn't hear. If the door is opened on the right hand side then he does hear.

pseudo code
(for simplicity let us say that x and y go from 0 to 10)
Code: Select all
 
getcoordinate x = x
getcoordinate y = y
//define
opendoor()
if x,y > 5,5
then make enemy chase actor

else
do nothing.


I hope this helps. It's ok by the way to be a newbie and not know any programming code but if you lie and say that you know how to do it then people will just tell you to go away and do it yourself until you can remember. You don't just "forget" code.
User avatar
relaxis
 
Posts: 82
Joined: Mon Jul 17, 2006 2:06 pm
Location: Luxembourg
Score: 1 Give a positive score

Postby The achievement » Mon Jul 31, 2006 5:49 pm

i did this once with the help of one of the people on the forums. i just forget where he posted it. i tried searching everywhere. thanks anyway.
I am the only Zombie Genocider.
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron