GameMaker: Studio

GameMaker: Studio

查看统计:
zeRqs 2014 年 11 月 2 日 下午 5:27
basic grid or mp_potential_step based ai, keep enemy from hugging wall
Im fiddeling with a ai script and its more or less finnished i just need to make the enemy keep a minimum distance from the walls. it looks noobish when mobs walk and hug walls all the time..
tryed with place_free() ,works but not quite as i intended.
anny ideas?
< >
正在显示第 1 - 4 条,共 4 条留言
Daynar 2014 年 11 月 2 日 下午 5:31 
if your using grids to do the movement you could have two grids one with the walls and the blocks all around the walls blocked off and one with just the walls blocked. Then have enemies use the first one if they can and if they cant use the second. If you don't want them to stay THAT far away from the walls you could make the grid with the 'wall outlines' based on a smaller tile size (16x16 when normal is 32x32) and do it that way.
zeRqs 2014 年 11 月 2 日 下午 5:45 
i tryed useing grid based ai but ,mp_grid_add_instances(path,obj_wall,false); seems to not respond , they just walk straight through the walls, else i realy liked grid based ai.

my grid based "ai"

grid = mp_grid_create(0,0,room_width/32,room_height/32,32,32);
path = path_add();
mp_grid_add_instances(path,obj_wall,false);
mp_grid_path(grid,path,x,y,obj_Player.x,obj_Player.y,true);


path_start(path,1,2,1);
Daynar 2014 年 11 月 2 日 下午 6:11 
Well for one you're doing
mp_grid_add_instances(path,obj_wall,false);
I'm fairly certain you should be using 'grid' not 'path' as the first argument.
zeRqs 2014 年 11 月 2 日 下午 6:38 
aww, damn , why do i keep doing them silly mistakes -_-, ty again Daynar! xD
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50

发帖日期: 2014 年 11 月 2 日 下午 5:27
回复数: 4