Add pathfinding API

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Add pathfinding API

by aldobr » Wed Dec 12, 2012 16:07

Pls add pathfinding api to Lua API.

We can do pathfinding using Lua already, but i believe this should be done in C++ (for speed).

Something like :

minetest.env:find_path(from, to)
-- Returns a list of tuples containing X, Y, Z step coordinates.
 

thetoon
Member
 
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Wed Dec 12, 2012 16:15

If such a thing comes to life, we'd need to keep it adaptable. We should be able to pass parameters about whether or not the pass could cross water, or jump one block high, or....
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Thu Dec 13, 2012 12:53

I suggested this awhile ago
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Thu Dec 13, 2012 13:46

What is pathfinding api?
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

thetoon
Member
 
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Thu Dec 13, 2012 14:41

jojoa1997 wrote:What is pathfinding api?


A pathfinder is a programming routine that gives the shorter path between two points (given a number of obstacles and associated rules). And as soon as we'll want to have "smart" mobs/NPCs, we'll want them to "move around trees" instead of getting stucked.

Depending on how it's done, it could be rather resource-hungry, and thus would greatly benefit from a native implementation. In the meantime, it should be perfectly doable in Lua.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Thu Dec 13, 2012 15:01

So it is like a shortcut to an app.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

thetoon
Member
 
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Thu Dec 13, 2012 15:16

jojoa1997 wrote:So it is like a shortcut to an app.


Err... not at all. Here we're not talking "path" in the common computer sense, but rather in the "geographic" sense. See http://en.wikipedia.org/wiki/Pathfinding for more information.
 

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Thu Dec 13, 2012 15:38

minetoons can only jump one block at a time

so the heuristic function should return impassable if the path needs a two block jump.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Thu Dec 13, 2012 16:10

Thanks for the link. I understand it now. All ways wondered what it was.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 4 guests

cron