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

Help with Sackbots! They wont chase me up stairs

Archive: 10 posts


Hello, I am currently working on a Zombie survival level using sackbots but for the life of me I can not make them run up stairs (I Meant to say Ramp) after the player on their own. I have experimented with way points and the follow command but the bots just chill on the lower level below the player.

Any ideas?

Thank you guys in advance,

http://lbp.me/u/TheGecKOo/levels
2011-03-16 21:33:00

Author:
Thegeckoo
Posts: 24


Stairs really have no place in a physics based platformer at all: it's a pain to hop up them. The easiest solution would be to build a ramp and add a stairs facade. If you're dead set on actual stairs, there are a couple of potential solutions.

The simpler but weaker solution. First, put a tag on the stairs and an impact switch on the sackbots keyed to that tag and set to "include touching"=yes. Then wire that impact switch to the X button on a controllinator and it should automatically hop every time it hits the stairs. You may need to add in a timer to hold down the X button for longer jumps, and you might need a mover to make the bot actually mover laterally after jumping instead of just hopping up and down in place.

The more advanced and better solution--this one uses a couple of glitches, but it makes the best stairs possible. First make your stairs like normal, glue any pieces together so that it's one solid stairs object, but don't glue it to the rest of the environment. Place it where you want it to go and then glue a square of dark matter to it. Use the corner editor to move one corner of the dark matter into the opposing (not adjacent) corner: for example, move the top left corner down to the bottom right corner. If you did it right, the dark matter will disappear and your stairs will have no physical presence: sackboy will walk right through them like they're not even there and other materials will go right through them too.

Now that you've got visible but non-solid stairs, you can embed a ramp into them so that the player and bots can walk right up them without needing to jump. A visible ramp may work in your design, but more likely you'll want the ramp invisible. Check out this tutorial (https://lbpcentral.lbp-hub.com/index.php?t=t=17759) to learn how to make solid invisible material. It'll be easier if you make a ramp visible first and then use it to make a stencil to cut out the invis material. Make your ramp, then make a block of any material that's bigger than your ramp. Click L3 on the ramp to copy it, move it over the other material and click triangle to cut into it. Then repeat the process with the stencil in the invis material to get your invisible ramp. Glue it inside the stairs and you've got a set of stairs that a bot can walk right up.

To see this in action, check out my lightsaber level (http://lbp.me/v/xzbrgn) (shameless plug) and marvel at the Darth Vader bot's ability to follow you right up the stairs on either side of the boss fight room:
http://i1.lbp.me/img/ft/6b15d19172a29d5fdcfff627dee22c766385ccb2.jpg
2011-03-16 21:53:00

Author:
Sehven
Posts: 2188


Make sure in the sackbot/zombie tweak the 'Allow Jumping' setting has a nice big tick. Also maybe they are on too slow a running speed or, as you follow them, you leave their radius and they stop following you.

2011-03-16 21:53:00

Author:
mutant_red_peas
Posts: 516


I am sorry I didn't actually mean stairs I meant to say ramp because I agree stairs are a bloody pain. But even with the ramp the sackbot tends to stay at the bottom.2011-03-16 22:08:00

Author:
Thegeckoo
Posts: 24


Ok..... So they won't go up ramps?

And you're sure the radius covers the player when running at full speed?

Hmmm...... Maybe there's a player sensor which toggles another sackbot behaviour chip with a level-sized radius.
2011-03-16 22:13:00

Author:
mutant_red_peas
Posts: 516


The player is essentially in a building, and when the Sackbot runs into the building he stops right under the player if the player is on the 2nd floor and will not go up the ramps.
I was thinking of putting a way point that would get destroyed when the sackbots reached it and see if I could "guide" him up the ramp.
2011-03-16 22:18:00

Author:
Thegeckoo
Posts: 24


Wait, are you saying that your sackboy is directly above the bots but they need to navigate a ramp or two to get up to the same level? If so, that's a whole 'nother ball game and you're going to need to use waypoints and such to explain to the bot how to get to the player.2011-03-16 23:10:00

Author:
Sehven
Posts: 2188


Actually, that is exactly what I am trying to do, I did not think it would be that difficult to do but I guess I was wrong.
Btw Sehven, I have played your Light-saber Duel in the past and loved it! It was a great idea!
2011-03-17 06:33:00

Author:
Thegeckoo
Posts: 24


I'd say that your best bet here is to program some pathfinding logic for your sackbot zombies to effectively move around obstacles (such as the aforementioned stairs). I believe that a selector would help in this case, as one state of the selector could have the zombies move to the left, another could have the zombies move to the right, a third state could have the zombies change layers, etc. You may need to add a controlinator on your zombies (set to not be remote-controlled) so that your logic can be used to essentially tell the sackbots to perform one action or another (such as jumping, moving left/right, or changing layers).2011-03-17 07:09:00

Author:
Shadow Wolf TJC
Posts: 72


Pathfinding isn't the easiest thing to program, but unless your level design is super complicated, it shouldn't be too tough to pull off. I'm a big fan of wiring inputs into controllinators like Shadow Wolf said, but you actually might be able to use sackbot behavior chips effectively and more easily to achieve your goal.

The simplest example would be something like a bounce pad. Say the player is directly above the bot and there are bounce pads to the bot's left and right. If the bot detects the player more than a certain distance above him (enough distance that he's obviously on the next level and not simply jumping), his behavior chip with the follower would turn off and another behavior chip with a follow waypoint would turn on. The waypoint would be a tag on the bounce pad: the bot will track whichever one happens to be closer. Once he hits the pad and gets launched, the player will no longer be too high and he'll switch back to the player tracking behavior chip.

With a ramp, it's a little more complicated. You'll want a waypoint at the bottom of the ramp (to make sure the bot approaches from the right side and layer if there are multiple layers that can be occupied), and another at the top. Once the bot has detected that the player is above him, he'll switch to tracking the bottom-of-the-ramp tag, and once he's reached it, he'll switch to the top-of-the-ramp tag. Having reached that, he'll switch back to player tracking, though, depending on the layout and layers used, you might need an extra step to force him onto the right layer.

Continuing that example, let's say your top level is only one layer thick, and the bot is above the player on the top level. In this situation, you'd want an in/out mover to trigger (or down+X on a controllinator), to force the bot into the next layer forward so he can drop down--the bot would do this on his own, but only if the player were actually in the layer in front of him, but since that can't always be guaranteed, we would want logic to instruct the bot to make the down-jump.

Layers present even more problems: if the player is in the front layer and there is a gap between the player and bot in that layer, but not in the back layer, the bot won't be smart enough to switch to the back layer to move in toward the player. In this case, my approach is to add invisible hologram covering the area and stick a tag labeled something like "back layer", and stick an impact switch on the bot set to include touching and keyed to that switch and plug it into an in/out mover set to "move to back." You don't notice it in my lightsaber level, but there are a LOT of places with holo/tags that tell the A.I. bots which layer to hang out in so they don't get stuck.

One final note: you may want to specifically plan the level's layout around the bots' tracking abilities/weaknesses. That's how Mm did it in the story levels where the bots follow you: everything was set up so that the bots would logically move to the layer they needed to be in to follow you: no gaps or ledges for them to get stuck on.
2011-03-17 11:10:00

Author:
Sehven
Posts: 2188


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.