Page 1 of 1

SINI AI

PostPosted: Sun Nov 12, 2006 7:11 pm
by Troodon
Hi,
I'm trying to make artificial intelligence but I have some problems. Currently SINI (my AI project) can solve basic labyrints but it can be cheated very easily. I tried to make it so that it remembers the wall collisions but that just made the labyrints more difficult for SINI. I will try again some things (for example picking a new way in collision from a specified side). Has anyone good hints? :wink:

Random direction

PostPosted: Mon Nov 13, 2006 3:36 pm
by Troodon
Hey, the SINI has moveto candy in draw actor and I'm using 1.3.3 version of GE. How can I make in timer:
-create timer2
-moveto random direction by forgetting the candy moveto in the draw actor
When the timer2 ends:
-forget the random direction
-keep moving towards the candy

PostPosted: Thu Nov 16, 2006 4:22 pm
by Troodon
No one can help me? :roll:

PostPosted: Thu Nov 23, 2006 2:30 pm
by Troodon
Hi again,
I solved that problem already myself. Currently I'm needing a simple code to make this:

Four actors fly in four directions. After every actor has collided, the main actor goes to the direction where the farest actor collided.
Could somebody help?

PostPosted: Thu Nov 23, 2006 7:07 pm
by Novice
Create an array lets call it "dir" with 4 slots.
On collision each actor stores it's distance from the main actor in one of the slots.
When the main actor begins to move, use a multiple if statement to check which distance is the highest and move the actor accordingly. Like this
Code: Select all
if (dir[0]>dir[1]&&dir[0]>dir[2]&&dir[0]>dir[3])
//move in the desired direction
else if (dir[1]>dir[0]....
//you get the point

This could be done in different ways but i cant think of any now except using the max function and pointers but that would be over complicating.

PostPosted: Fri Nov 24, 2006 7:42 am
by Troodon
Thanks Novice!! You've got new avatar! :D

I will try the system you told but I've never used directories in GE. Only in one tutorial. How do I make dir? In the variables thing? And how can I make slots? :wink: