Tron的良好启发式

Mat*_*tei 3 voronoi artificial-intelligence

我有一个与人工智能做tron游戏的分配.我和我的团队几乎成功,但我们正试图找到一个好的启发式.我们教过Voronoi,但它有点慢:

for yloop = 0 to height-1
for xloop = 0 to width-1

// Generate maximal value
closest_distance = width * height

for 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 if
next

 // place result in array of point types
 points[xloop, yloop] = point

next
next
Run Code Online (Sandbox Code Playgroud)

我们有5秒钟的时间来移动,这个算法听起来不太好!我不需要代码......我们只需要一个ideea!谢谢 !

稍后编辑:我们应该尝试Delaunay Triangulations吗?