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

I need some top down help please

Archive: 8 posts


Hi Everyone,
I Need a bit of a hand with some logic. Normally I'm ok at it, but the latest idea has me scratching my brain.
Basically, its a top down game where your being pursued by enemies (sackbots in controllinators), however, I'm having a problem with walls. When the player ducks down a corridor, the following sackbot enemy gets stuck running into a wall, especially at corners. He's trying to follow the player, but the wall gets in his way.
Any advice on how to make him follow a player smoothly around a corner would be appreciated.
My latest attempt at a solution, is to have it where as the enemy approaches a corner (say left/down) he encounters a tag on that corner (LeftDown tag) this fires a mover on him that makes him go up/right to clear the corner, it works but looks very messy.
Any better solutions would be a god send. Thanks for your replies my friends.
2014-03-09 13:47:00

Author:
Sean88
Posts: 662


Have the player emitt a trail of breadcrumb Tags that are destroyed as the Sackbot approaches it.

You might need to play around with the spacing between each Tag.
I would ensure that the breadcrumbs are emitted every X distance by using an Inverted Tag Sensor wired into an Emitter. So that whenever the player doesn't have a breadcumb nearby, it emitts another one.

To ensure breadcrumbs don't get embeded in the environment, you might want to build them out of 5 shapes in a cross shape. The Tag that the Sackbot is following goes in the middle, and Impact Sensors wired into an Advanced Mover moves the breadcrumb up/down left/right to keep it away from any obstacles players might have run into.
The size of those impact shapes, and what environment/obstacles cause the breadcrumbs to move themselves will probably vary on the particulars of your level.

The issue with this idea, is that I do not know of a reliable way to ensure that the breadcrumbs automaticly destroy themselves if the player turns around and goes back the way they came. If players do that, they can unwittingly create branching or looping breadcrumb trails.
2014-03-09 17:50:00

Author:
Ostler5000
Posts: 1017


Here's what I'd do. Have 2 "states" using a selector. The first state is a player follower, the second state is a tag follower. Have the sackbot follow the player until it impacts a wall. Then activate the second state, the tag follower. Put a tag at a "valid" area, like a hole in the wall and have the sackbot travel there. When the sackbot impacts the tag, switch back to the first state. You could activate the tags based on how close they are to the player.2014-03-09 18:19:00

Author:
AmazingKittyCat
Posts: 204


Ostler is right, that's one of the best methods for getting it to work. You should make a pretty simple logic system utilizing the breadcrumbs. You could even make it to where you can get away from the enemies if you so decided to make it that way.

Alright, so make your character emit tags that the enemy will follow. - Follower Tags.
Put some invisible material extending from the monster, and set it to impact. - Tells if it is going to hit things, and you can program what it will do to combat that.
Make the monster search for the character, if there is no obstruction, allow it to follow. If there is, use the breadcrumb system. That's pretty simple to wire in. But you could also make it to where the breadcrumbs disappear over time, thus giving the ability to potentially lose the enemy. If you're needing any help just add me, I'm almost always making Top-Down levels, and should be of some help.
2014-03-09 19:44:00

Author:
Archon453
Posts: 142


its a top down game where your being pursued by enemies (sackbots in controllinators), however, I'm having a problem with walls. When the player ducks down a corridor, the following sackbot enemy gets stuck running into a wall, especially at corners. He's trying to follow the player, but the wall gets in his way.
Any advice on how to make him follow a player smoothly around a corner would be appreciated.
Basically repeating what I wrote here (https://lbpcentral.lbp-hub.com/index.php?t=81359#post1123170) with a pretty picture.

http://i.imgur.com/JVUISiO.jpg

The enemy pursues the player until one or more of the arms impacts a wall, at which point it moves perpendicular along it, hugging the wall, until the obstacle is cleared. It's the oldest trick in the book (https://en.wikipedia.org/wiki/Maze_solving_algorithm#Wall_follower) for solving a maze, as you probably already know.

It'll still get stuck, but I'm sure you already have ideas to improve it.
2014-03-09 20:43:00

Author:
Ayneh
Posts: 2454


Thankyou everyone for your help, I will try th various ideas. Lot of thanks gang 2014-03-09 21:16:00

Author:
Sean88
Posts: 662


I've made a complete top down AI for one of my games. It involves the top down enemy to navigate around an entire map to get to you. What I easily did to avoid them crashing into walls was to basically make two strips out of invisible sticker panel (or hologram), parallel, glued to the front of the enemy. Put an impact sensor on each and make it so when the left strip impacts, it turns the enemy right, when the right strip impacts, it turns the enemy to the left. You can use an advanced rotator for this and connect each sensor to a directional combiner. So basically when one of these are impacted it can move the opposite direction. You can add much more to this system to make it more advanced, but that's a basic way. Hope that helps2014-03-09 22:19:00

Author:
airide101
Posts: 141


This was a great read, have limited top down experience, but a trail of bread crumbs does sound best or a navigate around walls trail preset of the bot/sprite itself2014-03-10 16:03:00

Author:
L-I-M-I
Posts: 611


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.