View Full Version : AI
01DT!m3r
19-03-2008, 04:22 PM
I am working on some very BASIC! AI for a stealth game i am making and i am a serious GM noob !So i need as much help as I can get to refine the code for this AI!thanks
here is the new link http://gamedev.openhazel.co.za/filecloset/download.php?id=411
|-|1Pp13
19-03-2008, 05:14 PM
I am working on some very BASIC! AI for a stealth game i am making and i am a serious GM noob !So i need as much help as I can get to refine the code for this AI!thanks
there is a GM7 extension which deals with AI but i dont know how good it is
I took a look, and a suggestion I have is to put modify the AI_combat script and put all your current code in between the brackets using a collision_line function to see if there is a box in the way:
if not (collision_line(x+16,y+16,obj_man.x+16,obj_man.y+1 6,obj_box,true,true))
{
//Your current code
}
The reason for the "+16" is that you have the origin of the sprite as the top right corner, and you would want to check from the center, and you might also want to create the bullet from there too :)
//will add more here as I look at it more
Something you might want to consider, is making it so that when it loses sight of you, it doesnt keep moving toward you, but it will move in a general direction (up down left right) and "search" for you and then when it finds you goes back to its chasing/shooting
01DT!m3r
19-03-2008, 06:06 PM
Thanks edge ,i will do that and post the new version soon , and i will definetly take a look at that hippie.
01DT!m3r
25-03-2008, 07:36 AM
I am sorry for DP;but the new version is up.look at first post for details . I am concerned with a problem I have , the game freezes and I dont know what is freezing it ,I think my AI is having an unwanted collision and cant generate a path am I correct?
I played around with some ideas, and here is the file:
AI_edg3.gmk (http://realdev.co.za/egfiles/AI_edg3.gmk)
Its a modified version of your original file, now Im going to look at and play around with the new one :)
Fengol
25-03-2008, 08:19 AM
I have one note (unrelated to the freezing problem) you're not destroying your bullets once they are outside the field of play. Because bullets are only destroyed if it hits the player or a box when the AI shoots towards the edge of the screen the bullet keep travelling forever!
On the bullet object add the event Other > Outside Room and put a Destroy the instance in it.
01DT!m3r
25-03-2008, 09:39 AM
oops!:p knew I forgot som ething thanks fengol!:)
Powered by vBulletin® Version 4.2.4 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.