我有一个任务,需要制作一个带有AI的Tron游戏。我和我的团队几乎完成了,但我们正在寻找一个好的启发式方法。我们考虑过Voronoi算法,但它有点慢:
for yloop = 0 to height-1for xloop = 0 to width-1// Generate maximal valueclosest_distance = width * heightfor point = 0 to number_of_points-1 // calls function to calc distance point_distance = distance(point, xloop, yloop) if point_distance < closest_distance closest_point = point end ifnext // place result in array of point types points[xloop, yloop] = pointnextnext
我们只有5秒钟的时间来做出移动,这个算法听起来不太理想!我不需要代码……我们只是需要一个想法!谢谢!
后续编辑:我们应该尝试Delaunay三角剖分吗?
回答:
可以看看Google AI挑战赛的总结报告,里面有相关内容。