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

Getting Sackbots to follow Player in a top down vehicle

Archive: 9 posts


I'm building a top down car level in which I would like to have AI sackbots drive police cars and chase the player who is driving another vehicle. I could probably make the police car act as a homing missile and keep it simple, but I would rather have a sackbot driving it in order to potentially make the AI more involved. Basically, it would need to follow the player and attempt to avoid obstacles if possible. I haven't found anything in the tutorials that approaches this problem, aside from seeting the sackbot to act out a route, which I would rather not do (I will be doing that for civilian vehicles, however.) Any suggestions? 2011-02-16 06:50:00

Author:
Unknown User


There was a very interesting discussion (https://lbpcentral.lbp-hub.com/index.php?t=48020-Follower-logic-in-a-maze-environment) in the Help forum going on a little while ago after someone asked for enemy A.I. in a Pac Man level. That sounds similar to - yet simpler than what you are asking. This is no easy feat,2011-02-16 07:08:00

Author:
Antikris
Posts: 1340


what if you actually had the player control the sacbkots, but had some sort of lag between when you did an input and when the sackbot responded? That way it would look like they were trying to copy the actual player character's more precise movements.2011-02-16 07:13:00

Author:
Speed Racer
Posts: 156


That is possible, though that will also leas to the problem that they will never really catch up with the player unless the player drives back in his own tracks or slows down his car.2011-02-16 07:20:00

Author:
Antikris
Posts: 1340


That is possible, though that will also leas to the problem that they will never really catch up with the player unless the player drives back in his own tracks or slows down his car.

you could always make the sackbot cars capable of moving slightly faster than the player, even when they receive the same input.
2011-02-16 07:21:00

Author:
Speed Racer
Posts: 156


you could always make the sackbot cars capable of moving slightly faster than the player, even when they receive the same input.

Which will lead to it being almost impossible to avoid them, unless you can leave stuff like barricades in your path.
2011-02-16 07:44:00

Author:
Antikris
Posts: 1340


well, I would think that the lag would allow for things like dodging an obstacle at the last second, and then they wouldn't receive the movement signal until it's too late for them to also avoid it.

Obviously this isn't a perfect solution. It just seems like it might be preferable to the kind of logic nightmare you'd have to go through to get more "proper" AI working.
2011-02-16 07:48:00

Author:
Speed Racer
Posts: 156


what if you actually had the player control the sacbkots, but had some sort of lag between when you did an input and when the sackbot responded? That way it would look like they were trying to copy the actual player character's more precise movements.
I thought about doing something like this. That may help the sackbots make the same turns as the player, so they wont crash into walls. The trick would be to get them to maintain their own speed so that they catch up to the player if the player messes up. I'll experiment with a remote controlinator connected to a timer and see what that comes up with.


That is possible, though that will also leas to the problem that they will never really catch up with the player unless the player drives back in his own tracks or slows down his car.

They only have to get so close. I was going to set the police car max move speed about .2 slower than the player. If the police car gets within range it will fire projectiles at the player. Ithink I'll experiment with it and see what happens.

Thanks for the ideas everyone, I appreciate it.
2011-02-16 14:14:00

Author:
Unknown User


I could have the player vehicle lay down waypoints like in the pac-man thread that correspond to each turn that the player makes. This would allow the police cars to maintain a speed independant of the player and make the turns in the same spots. The one difficult thing would be dealing with curved roads, although setting the sackbot to follow waypoints may solve the issue. I'll try both methods and post back in a couple days how they turn out. If anyone has any more ideas, post em up!2011-02-16 14:29: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.