English 中文(简体)
Making an AI - How to make path finding?
原标题:
  • 时间:2010-11-30 23:26:21
  •  标签:
  • lua
  • roblox

Hey, I am making an AI on ROBLOX and I can t seem to figure out where to start for path finding, the most common AI feature. Can anyone help?

P.S. I don t know any raycasting, so I can t use that as my option.

最佳回答

As already suggested, you ll want to take a look at the A* algorithm. It s the workhouse of pathfinding. If you don t think you can do that, try something simpler. There are many techniques out there, including breadcrumb trails for pursuing AI characters, for example. You could even apply a barebones (1,0,0) vector for moving right, (-1,0,0) vector for moving left, and so on at specific intervals while your game is running. Just get something working first. In any case, you ll probably encounter graphs at one point or another while adding pathfinding, so read up on the subject.

问题回答

Roblox have released a PathfindingService which makes pathfinding quite easy :)





相关问题
Wrapping a Lua object for use in C++ with SWIG

Currently I know how to have C++ objects instantiated and passed around in Lua using SWIG bindings, what I need is the reverse. I am using Lua & C++ & SWIG. I have interfaces in C++ and ...

Can t lua_resume after async_wait?

I have some lua script that have some long running task like getting a web page so I make it yield then the C code handle get page job async, so the thread free to do other job and after a specify ...

How to remove a lua table entry by its key?

I have a lua table that I use as a hashmap, ie with string keys : local map = { foo = 1, bar = 2 } I would like to "pop" an element of this table identified by its key. There is a table.remove() ...

Lua plain string.gsub

I ve hit s small block with string parsing. I have a string like: footage/down/temp/cars_[100]_upper/cars_[100]_upper.exr and I m having difficulty using gsub to delete a portion of the string. ...

why do i get "attempt to call global require (a nil value)"?

I have 3 lua files, Init.lua, FreeCamera.lua and Camera.lua , init.lua calls require "Core.Camera.FreeCamera" Free Camera: module(...) require "Core.Camera.Camera" local M = {} FreeCamera = M M ...

热门标签