Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Pathfinding logic

Archive: 13 posts


Is there any tutorials or examples of some sort of pathfinding logic?

One more thing: Is there a limit of tag labels and/or tags in general?

Thanks for your time.
2011-01-28 00:27:00

Author:
Unknown User


Not sure what you mean by pathfindling logic.2011-01-28 00:39:00

Author:
v0rtex
Posts: 1878


when you use all the colors your "out of tags"2011-01-28 02:30:00

Author:
ktmbillyjr
Posts: 177


No, you can have an infinite combination of tag labels with tag colours.2011-01-28 03:26:00

Author:
Yofig
Posts: 288


If you could give us a better explanation of what you mean by pathfinding logic you will surely get some more helpful advice.2011-01-28 03:28:00

Author:
Kitkasumass
Posts: 494


Guess I shouldn't have used that word. What I am looking for is some way for an object to find its way around a path of some sort.
I could use a follower that follows specific tags but that would require placing a lot of tags, for smooth movement.

I was thinking there could be a better way. Maybe not?


No, you can have an infinite combination of tag labels with tag colours.

That is what I wanted to hear
Thanks
2011-01-28 07:01:00

Author:
Unknown User


If you're referring to top down path-finding for units, then this may help.
Just an idea, haven't tried it myself.

You could put keys to represent inaccessible zones, and have a follower set to flee from them. This would push all units trying to travel to a certain location around it if they tried to cross the "no-go" zone, while still maintaining that initial destination.
This would produce the sense of path-finding (avoiding obstacles). Problem is if it heads straight into it, it'll just be pushed back and not around. Also, if there is a dead end, the unit would get stuck (a place between 2 "no-go" zones that doesn't open up on the other end).

Soon I'm going to try to make a unit moving system which uses timers to power the mover, and the timers are powered by set distances.

Set a waypoint key a certain distance away, key activates the switch that detects in the distance bracket , turning on timer, which powers mover until it is done. The key disappears as soon as it's emit, just long enough for sensor to activate. This won't work for avoiding obstacles, as it is time based, not distance based (you won't go as far as was indicated due to delay at obstacles). This does prevent movement order overlap though, so 100 units could be assigned 100 different locations one after another, and each will go their own way.

Can't remember if it's possible to set movers like that (turn to certain direction, then maintain that direction even when not powered (may require another tool, gyroscope maybe? I dunno, haven't used them before).
2011-01-28 08:43:00

Author:
SSTAGG1
Posts: 1136


I have a level where I had to use a path. what I did is lay a flat layer of holo material across the whole play area, and set tags on the holo. then cut the path i wanted out of it. Mine had only 90 degree turns so it made it easy for me.

Now I made a small square a little smaller than my path. the i put a small piece of holo on each edge to bring it up to the width of the path. On each of those four pieces I placed an impact sensor set to require the tags, and detect touch. Then I used four movers.

Whenever a sensor hits I check that it is moving in that direction. If it is, I used a selector to switch it to the perpendicular axis, then chose the direction that has a sensor not currently in contact, and pick the mover to move that way

So say I am going left. when it reaches a the edge of the path in a turn, my left side trigger activates. Then I have two unactivated triggers, up and right. Well i know I was just going left so I eliminate the horizontal axis and know i need to move vertical. That leaves up. So my up logic fires, and activates the selector node going to my up mover.

Now to complete the illusion, you can bolt whatever object you want on top of this platform, and make it turn or adjust anyway you want. You just have to move the microchip from the holo platform onto it since lighter objects have a tough time moving the heavier ones. Just make sure your mover is not set to use local space, and place a gyroscope onto the holo platform.
2011-01-28 17:12:00

Author:
tdarb
Posts: 689


I just tried another way that looks much more natural, and is easier to implement. It requires

a tag labeled "path", a microchip on an object with a gravity tweaker, look at rotator, and a basic mover.

Set your rotator to follow the path tag, and adjust the maximum range to when you want it to detect the tag, and your minimum range to around 7 or 8. Adjust the dtection angle to just over 180 degrees.

Now when you lay out your tags, lay one tag at the point where you want your vehicle to start turning, and another at the place you want it to turn towards. It's ok if both come in range at the same time as the rotator will focus on the same one as long as it is still in range. Once your vehicle gets nearly over it, then it goes out of range and the vehicle turns towards the second one.

Of course this still requires a predefined path, but the movement is more natural looking.
2011-01-28 17:56:00

Author:
tdarb
Posts: 689


I just tried another way that looks much more natural, and is easier to implement. It requires

a tag labeled "path", a microchip on an object with a gravity tweaker, look at rotator, and a basic mover.

Set your rotator to follow the path tag, and adjust the maximum range to when you want it to detect the tag, and your minimum range to around 7 or 8. Adjust the dtection angle to just over 180 degrees.

Now when you lay out your tags, lay one tag at the point where you want your vehicle to start turning, and another at the place you want it to turn towards. It's ok if both come in range at the same time as the rotator will focus on the same one as long as it is still in range. Once your vehicle gets nearly over it, then it goes out of range and the vehicle turns towards the second one.

Of course this still requires a predefined path, but the movement is more natural looking.


This works really well. But instead of using a basic mover, I had to use a follower.
The reason being, it would just move in the predifined direction. Which was down.

You used a basic mover? I couldnt figure out how it was possible. unless I am missing something.
2011-01-28 21:38:00

Author:
Unknown User


Yeah, you have to set the basic mover to use local space. Then use the look at rotator to point the vehicle towards the tags when they come in range. Then just lay your path tags out along the path you want it to follow.

Basically I set mine up moving up. Then once the microchip was made and everything was in place, I pointed the vehicle it in the right direction and placed it on the level. If you have the mover set to use local space, the direction will change with the rotation of the object.

Once you find a speed/rotation combo that you like, you can also place a counter on the microchip, and output it to both the rotator and mover. Then set the inputs on those to speed scale. That way, to edit the speed you can just change how full the counter is, and both the mover and rotator will scale equally.
2011-01-28 22:05:00

Author:
tdarb
Posts: 689


Ah, I never thought about "Local Space"
Thanks again.
2011-01-29 00:42:00

Author:
Unknown User


I found a way to make an object smoothly move through an area. without using any sort of "Tag Path" ( path created using tags) other than a few tags to designate the walls.

However it is very very limited..
the area must have rounded corners, and no straight walls. Basically just "S" curves.
And even then, it may or may not work just based on the starting position of the Sensor object and the following object.

But It was fun making it
2011-01-29 22:52:00

Author:
Unknown User


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.