Hey, for no in particular reason, I just thought about 1 of the many things I have no idea how to do in MMF, and that is... path finding. The kind you find in various RTS games. Well I decided to give a crack at it, and just as I suspected, I cant do it without making the NCP's first run into the wall, then walk around it. Thus I decided I would come out and ask this simple question. How can you do advanced path finding, where as soon as you tell the NCP a spot to reach, he will then calculate a path that will allow him to take the shortest route, without running into anything? A threw around a few idea's, such as the method that most games tend to use, and that’s path nodes (I got this idea from working with UnrealEd), where the bot has a map of the entire level, through path nodes that link to one another, but then I figured... in a game such as a RTS, your going to want your bots to go to places that are far less restricting, and lets face it... it would take way to long to make sure that there were hundreds of nodes in every crack of the level, just so the bot could be as close as he can to where the player told him to go. So that’s where I'm left wondering, is there a way to set it up so that when you select a spot for a bot to go, MMF will then have a path formed between this spot & the bot, for the bot to fallow, while avoiding all obstacles?
Example:
You might want to look into Radix's article about random dungeons, perhaps you could adapt something from that to get what you want. Or you can try and ask Tigs.
Yes, the pathfinding object is the key here (Grid object / Advanced pathmovement may also work)...
1. Setup a map by defining size (in squares) and what weight every square should have.
2. Find path
3. Move along path! (If you're using multiple objects which follow different paths, save the found path in an array instead of using multiple Pathfinding objects)
I'm trying to get the Path Finding object to work, I'm going to look around for example examples, but in the mean time, could you guys throw me some links to examples? Thanks.
After checking out all the sources I could find, I found that all of them are based off of grid movement. Is there any way in MMF to do this without grid movement?
What about this: sensors, a target, and always look at target when sensors don´t overlap an obstacle. When sensors overlap obstacle --> rotate. No path calculated. Just walking around obstacles that are between the target and the sprite.
Needs tow sensor objects and direction calculator. Four lines for that:
left sensor is overlapping obstacle
+right sensor is not overlapping obstacle
---> rotate towards itself -1
right sensor is overlapping obstacle
+left sensor is not overlapping obstacle
---> rotate towards itself +1
left sensor is overlapping obstacle
+right sensor is overlapping obstacle
---> rotate towards itself -16
left sensor is not overlapping obstacle
+right sensor is not overlapping obstacle
---> rotate towards 0/0 of target
I found this example in the file archive eons ago. But i can´t remember the name of the thread ...