Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Everything Else LittleBigPlanet 2
#1

A.I. PathFinding

Archive: 15 posts


I heard PathFinding is impossible.
I dont understand why... I did a little PoC (Proof of Concept) and it is very possible assuming you lay out possible paths to your destination.
So how is it impossible?
2011-08-06 03:22:00

Author:
Unknown User


emmm who said it's impossible? ;p2011-08-06 04:03:00

Author:
Shadowriver
Posts: 3991


I heard PathFinding is impossible.
I dont understand why... I did a little PoC (Proof of Concept) and it is very possible assuming you lay out possible paths to your destination.
So how is it impossible?
Pathfinding....eg: Unit finding its own path. Laying out a path for it is easy. Making that path dynamic, avoiding units/obstacles/terrain/structures.... MUCH more difficult.

It's entirely possible, and I've seen it done (myself and 3 others), it's just that it ends up taking up too much thermo.

It's not actually terribly hard to do at first, but to make it simple AND effective... that's where the challenge is, especially when you start to have more than 20 units using it.
2011-08-06 04:14:00

Author:
SSTAGG1
Posts: 1136


Oh, well that clears a lot up.
Can you tell me how you did it?
2011-08-06 04:50:00

Author:
Unknown User


I'm pretty sure the main thing you use is a selector.2011-08-06 18:04:00

Author:
zzmorg82
Posts: 948


Its really the same process as "Rewinding Time" (except, in that, you have to mark where to player goes, then play backwards).

Tags that become disabled after passing through.
2011-08-06 18:16:00

Author:
Nurolight
Posts: 918


Oh, well that clears a lot up.
Can you tell me how you did it?

There many ways how you can do it, it depends on how you want your unit to behave
2011-08-06 21:24:00

Author:
Shadowriver
Posts: 3991


Its really the same process as "Rewinding Time" (except, in that, you have to mark where to player goes, then play backwards).

Tags that become disabled after passing through.

That was how I was doing it
2011-08-06 22:22:00

Author:
Unknown User


I've done it a bit and it wasn't complicated at all. I mostly let the bot's A.I. handle following and such and then I place tags wherever an obstacle might stop the bot. When the bot encounters the tag, it'll override their normal behavior and tell them to change layers or jump or whatever.

Besides tagging where to jump and such, you can also take steps to make your level easier for bots to navigate. They have a lot of trouble with stairs, for example, so I use ramps instead (actually invisible ramps embedded into walk-thru material stairs) and when it comes time to place bounce pads, if I can move it to a slightly different location and help the bot overcome a tricky obstacle without compromising the design of the area, I'll do that.

Beyond that, you can get elaborate and still not have too much difficulty. You can place player sensors throughout the level that will tell the bots which route to take. When I did the boss A.I. in my level, I set it so that if no players are detected on the floor, and a player is detected up on one of the catwalks, the boss would stop chasing and throw a ranged attack to destroy the catwalk, but the same principle could be used to tell a bot to switch from following the player to following a waypoint such as the bottom of a ramp or an elevator that will take him to the player, or, if the player is below, simply to layer shift forward and drop down. Depending on how complicated your scenery is, you may end up with a lot of waypoints and following sub-routines, but it's not too difficult to do.

One thing I am a bit reluctant to try, though, is teammate A.I. It can be done with the same principles, but trying to anticipate everything a player might do in a level and programming a bot that knows how to get from any point in the level to any other point would be a headache. It's not impossible by any means, but I don't think I'm willing to put in the work for a feature like that unless it adds significantly to the level experience.
2011-08-06 22:55:00

Author:
Sehven
Posts: 2188


I really wanted my zombies to actually FOLLOW you,lol.
I hate it when you are on a higher platform and the zombies are just standing on the platform below you.
2011-08-07 02:20:00

Author:
SackBoy98
Posts: 588


Something I'm highly interested in is figuring out to make an object navigate through an irregular environment towards a goal destination on its own without the use of tag breadcrumbs and the like.

I'm thinking of something along the lines of recording all movements it makes along a timeline, though its speed would need to be constant, in order to generate a map of an area and be able to effectively backtrack to different points and attempt different approaches depending on the areas it can "see" are open areas or paths from its sensor array.
2011-08-07 02:44:00

Author:
Ayneh
Posts: 2454


How about Hologram pads that surround the object and travels toward the pads that are not activated by a touch sensor from the wall.
A lot of things can go wrong but it is an idea.
^^ For a top down view btw
2011-08-07 03:02:00

Author:
Unknown User


How about Hologram pads that surround the object and travels toward the pads that are not activated by a touch sensor from the wall.
That's quite elegant.
2011-08-07 06:28:00

Author:
Ayneh
Posts: 2454


Oh, that would've been me.
I was talking more about top-down pathfinding, just for clarity. Sidescrolling, yeah, I can definitely picture that working. But the idea of having a bot navigate a top-down maze efficiently, is something I currently believe to be impossible. (Prove me wrong, gimme a link queue a level, and I'll take that back and worship you.)

I've been thinking over how I could do it for months now, and the best I've come up with thus far was dotting various waypoints around, and having certain Movers toggle on/off as the bot approaches them. So, for instance, from Waypoint1, it's possible to head to Waypoints 2, 3 and 4, and then randomly picking one to head to, and no other. This could ensure that my bot never hits any solid obstacles, but he would effectively just be wandering, without a predetermined destination waypoint.

By all means, I'd love to get pathfinding working for myself, but I simply don't think it's possible without the use of a specialised Mover that can arrive at one Tag, while avoiding and navigating around other Tags.
2011-08-07 16:10:00

Author:
Ostler5000
Posts: 1017


I was talking more about top-down pathfinding, just for clarity. Sidescrolling, yeah, I can definitely picture that working. But the idea of having a bot navigate a top-down maze efficiently, is something I currently believe to be impossible.

Depends what your maze is really....

The primary issue surrounding pathfinding is really definition of the problem. Building a deliberative system that is capable of planning out it's own route when simply faced with any geometry will of course be very difficult. On the other hand, define your maze parameters as:
a grid of squares
Each square may either be wall or floor
The maze may be any configuration of wall or floor pieces

And you're probably onto a winner. You can still make complex mazes and have your creation solve them, but definition of the environment makes life a lot easier. A hell of a lot easier. For practical LBP use, you don't need to make an AI system that can handle anything you throw at it. Instead, you can develop a few basic, generic principles, tailor those to your specific application and then add in some special case / failsafes for edge conditions.

This is even more true when you consider who will be making the terrain to be traversed... Negotiation between AI design and level design is a more than acceptable approach to developing an AI system for gameplay... If certain features of the terrain are giving your units a hard time, work them out of the level, or develop a particular special rules for them.

Then there is the matter of what is acceptable behaviour. If your units can get stuck in a corner of the map sometimes then that could be acceptable. Players will just need to micromanage a little. Or you could work the particularly nasty corners out of the game, or mark them up as dead ends... etc.
2011-08-07 19:24:00

Author:
rtm223
Posts: 6497


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.