Author Topic: Can you make pathfinding AI's in BlockLand?  (Read 3833 times)

I just joined the forum thing.. Don't know much about BlockLand.. So is it possible?


Yes

Lol wanna explain it for him(I have no idea either and have been trying to do it for bout a month :P)

Yes. It'd be like that thing in Ratchet and Clank.
« Last Edit: July 29, 2010, 09:46:45 PM by otto-san »

Yes. Not easily though.

A pathfinding AI wouldn't be too hard. I can imagine it working something like this:



Step one - /recordpath || This would record the path you walk in a way I will explain in a moment.

Step two - Walk the path you want || This is self explanatory.

Step three - /stoprecordpath || This would stop recording your path.

Step four - /createpathbot || This would create a bot in the place where you typed /recordpath.

Step five - /startfollowpath || The bot would follow the path we mentioned before.

Step six - Enjoy mindless bot walk back and forth along an invisible path || Ditto.

Step seven - /stopfollowpath || The bot is told to stop following the path.

Step eight - /deletepath || This will delete the path and the pathbot.

Step nine - Think about another path || Ditto.

Step ten - Repeat || Ditto.



Now, the way a path would be recorded is simple. For every movement the player makes after typing /recordpath invisible objects will be placed below where the player walks. These objects will each be added into a group where using a loop it would be easy to make a bot go to each object in the order of their creation.

I really like this idea and may add it to Copymod or another future mod.

(The ideas portrayed here were in no way viable commands that can currently be used.)

I think it means "pathfinding" as in it actually working out a path to use e.g. building a level map of the bricks and calculating possible routes to destinations like "capture flag" or "follow X person through a maze"

I think it means "pathfinding" as in it actually working out a path to use e.g. building a level map of the bricks and calculating possible routes to destinations like "capture flag" or "follow X person through a maze"

As in a bot that thinks for itself?

I make my bots mindless for a reason.


Trader's TD Pathfinding Bots
That's still on a 2d grid with no holes the bots can't fit through. A more varied environment would be extremely hard to code for.

Is it possible to do? Yes.
Is it simple/easy to make? Not at all.

Even big games with actual budgets and teams use premade nodes that the AI is programmed to move to, simplifying pathfinding greatly.

That's still on a 2d grid with no holes the bots can't fit through. A more varied environment would be extremely hard to code for.

Is it possible to do? Yes.
Is it simple/easy to make? Not at all.

Even big games with actual budgets and teams use premade nodes that the AI is programmed to move to, simplifying pathfinding greatly.
So make your own nodegrids. Have nodes which are connected to other nodes, with path instructions - if the bot arrives at this node and wants to go to a specific other node, you might tell the bot to crouch before proceeding, to take the vent. Tell it to jump at this node to jump up onto some crates. Tell it to face a certain direction if this was its final destination, tell it to change its team, tell it to explode.

Then, you make node bricks, which when placed are placed rendering and solid; wrench a node brick, it is highlighted, wrench another to connect or disconnect them or wrench an unrelated brick to cancel. When you stand on a node, it automatically highlights all nodes connected to it, and then using a command (/finalizenodegrid) will index the grid to make searching it more efficient, and also make all the bricks invisible. When loading the save is complete, this command should be called automatically if any node bricks were placed by the loading process. Looking at a highlighted node and using /editpath or some similar command should let you change path instructions. Hell, make it so that when you stand on a node, you look at another node, and type:
/connect to connect them
/disconnect to disconnect them
/edit to edit path instructions/destination instructions for the current node if you're not looking at another node brick directly
/finalize to finalize this brick, cache it in the nodegrid and make it invisible/disable the highlighting behaviour, so that you can easily tell what nodes need to be worked on
/cancel when standing on/in the zone of a finalized brick to 'un-finalize' it, thus re-enabling its properties and the highlighting behaviour ('debug behaviours'?)

Then the bots themselves have a goToNode function, which will find the nearest node to them then expand from this node recursively to find the node you told them to go to. If multiple nodes exist for that name, it chooses the nearest one, so telling them to go to "Machinegun" would tell them to go to the nearest (not beeline-nearest, shortest total distance) node by this name, assumedly the nearest node next to a HMG which would then mount them to the HMG in question when they arrive.
Then you also have a goToPosition function which will find the nearest node to that position with a straight line to it, and call goToNode on it. If it already has a path cached to go to a position, it will check and see if its current destination node has a path to the new position, so it doesn't need to re-run the nodegrid to find its way in this case, and if it does, it will then re-path.

The issue with this is it's a lot of work to make and to use. Not to mention debugging a forgeted nodegrid. Eugh.

The BrickMapper I was working on is suited for this (it simplifies it because you can work with rectanges of open space), but I'm working on something in c++ right now so I haven't gotten around to making the pathfinding yet.

.............
The issue with this is it's a lot of work to make and to use. Not to mention debugging a forgeted nodegrid. Eugh.

the node system only works well when your server landscape doesnt change after the nodes are created.  All it takes is for some n00b to drop a couple 12x5 walls in the middle of your node grid and your bots will all get stuck.

pathfinding with raycasting is really the only way to go for this.  but like  Amade said - it is NOT easy to code, especially in torquescript.

I never thought of making bricks be placed where you walk, and the bot just follows them in order.. Thanks for the idea:D