Home LittleBigPlanet 2 - 3 - Vita - Karting LittleBigPlanet 2 [LBP2] Help!
#1
Boundaries for top-down shooter
Archive: 20 posts
I'm making a top-down shooter. The way I have it set up, it gives you the illusion of moving up very fast, when the ship is actually moving in a small enclosed area. However, I'm not sure how to prevent the ship from just moving outside of the screen, while still allowing enemies and objects to go in and out as they please. | 2011-02-03 21:58:00 Author: TooManyToasters Posts: 19 |
one way is using movers to detect when the player is getting out and move them back in, or you could put the enemies a layer above and have them 'drop in'. | 2011-02-03 22:10:00 Author: slidedrum Posts: 189 |
Thanks for your input. I tried the mover idea already. I had a tag on the controlinator's microchip, and a tag sensor turned upside-down with 180 degree trigger angle to make a straight line. (Seriously, why can't I just make rectangular trigger ranges?) I set the tag sensor up to a mover, also on the controlinator's microchip, and when I would test it out by moving into range, the mover would light up, but the ship wouldn't move. The advanced mover hooked up to the left stick works fine, though. As far as making them drop in, that would look pretty odd, but it would work. I'd rather find a solution that would keep objects on the same layer. Also, I might need to make 3-layer objects anyway, and they need to move from the top of the screen to the bottom and disappear. | 2011-02-03 23:32:00 Author: TooManyToasters Posts: 19 |
I'm also looking for an answer to this question, although the object that I need to restrain is a bit trickier, since it's a hologram crosshair. I have some ideas that might do the trick (trying to hook up direction splitters to either D-pad or analog stick up/down and left/right controls and disabling a direction when the controlled object hits a tag sensor's area could work, for example), but I haven't had the time yet to try them out. Hopefully someone has a working solution already, though. | 2011-02-05 20:16:00 Author: sny Posts: 144 |
Why don't you put a solid piece or a firm material (not holo or anything you can walk through) in the very back thin layer (if it's free) and attach it to the vehicle with an invisible piece of holo? |Then draw a boundary in the very back thin layer and the ship will not be able to leave the boundary because the back layer piece of material stops it when it hits the boundary. Do you like that? However you do get that sound when 2 materials clash... | 2011-02-05 20:22:00 Author: mutant_red_peas Posts: 516 |
However you do get that sound when 2 materials clash... Material Tweaker > Physics sounds > Off I think. | 2011-02-05 20:36:00 Author: KlawwTheClown Posts: 1106 |
I have a very smooth hit detection system. No bounce whatsoever! I can send you the logic if you'd like. | 2011-02-05 20:56:00 Author: Yofig Posts: 288 |
Turns out that the idea in my previous post worked well, for my hologram crosshair at least. I simply added 4 tag sensors set up around the boundaries of my playing field and XOR-ed their outputs with the outputs of the direction splitted analog stick. I did this for both directions, then combined the up/down and left/right directions once again and hooked them up to the advanced mover, and hey presto!, my crosshair is finally only going where I wanted it to go. EDIT: One small hint: this works best when you have the advanced mover's acceleration/deceleration set to 100%, otherwise the controlled object might slow down after hitting the boundaries set up by the tag sensors. I hope this helps someone. | 2011-02-05 21:28:00 Author: sny Posts: 144 |
That's the way my system works as well! Nice job. | 2011-02-05 22:22:00 Author: Yofig Posts: 288 |
Turns out that the idea in my previous post worked well, for my hologram crosshair at least. I simply added 4 tag sensors set up around the boundaries of my playing field and XOR-ed their outputs with the outputs of the direction splitted analog stick. I did this for both directions, then combined the up/down and left/right directions once again and hooked them up to the advanced mover, and hey presto!, my crosshair is finally only going where I wanted it to go. EDIT: One small hint: this works best when you have the advanced mover's acceleration/deceleration set to 100%, otherwise the controlled object might slow down after hitting the boundaries set up by the tag sensors. I hope this helps someone. This is just what I'm looking for although I'm not sure how to wire it up just by reading that. is it possible for you to post an image showing it or publish the logic and allow me to copy it? either would be great. I'm bumping this and hoping someone can give me an image showing this 'boundary' logic at work. as I can't figure it out. | 2011-02-07 12:33:00 Author: Stevelbp Posts: 11 |
I'm bumping this and hoping someone can give me an image showing this 'boundary' logic at work. as I can't figure it out. Ask sny. His idea sounds the best and most efficient in this thread. | 2011-02-07 20:45:00 Author: mutant_red_peas Posts: 516 |
epic! Thanks Sny I've been trying to think of a way to do this for a while, i'm pretty much coming up to the point i need to set a boundary for my play area too. Thanks a million for this technique!! | 2011-02-07 21:37:00 Author: Epicurean Dreamer Posts: 224 |
Glad to have been of help Stevelbp: I'll post an image of the circuit board of the controlinator when I get home from work, along with some explanation of the external connections and logic settings. hopefully that should clear things up for you. | 2011-02-08 07:27:00 Author: sny Posts: 144 |
sny, I could use with a bit more of an explanation on the boundaries too. Could you just explain in a little more detail what it is? | 2011-02-08 07:39:00 Author: mutant_red_peas Posts: 516 |
sny, I could use with a bit more of an explanation on the boundaries too. Could you just explain in a little more detail what it is? I'm guessing that by boundaries you're referring to the tag sensors. If the field you want to restrict your controlled object to is only bounded by straight edges, simply place a tag sensor along each edge, facing outward, with the trigger angle set to 180 degrees. This gives you a nice straight line that can be shortened or lengthened by increasing the trigger radius. Then, simply place a tag of the same colour or name as the sensor inside the microchip of the controlinator. This will activate the tag sensor once the object crosses over it (if your object is large, unlike the crosshair in my case, you might want to place multiple tags on the object itself, as opposed to the microchip). If your playfield has curved boundaries as well, this can still be solved using tag sensors, but it gets a bit trickier. If the curved edge in question is curved inward, you need to place tag sensors at the center of the circle of which the given curve forms a part of, then set the trigger angle to a value that causes it to overlap with the curve. If the edge is curved outward, you need to place a tag sensor inside the playfield instead, and set invert output to on. Then, you need to hook up these tag sensors to an XOR gate for each direction you want to turn off when these sensors are activated. So, for example if you have a vertical line that forms the left border of the playing field and you want to constrain the object to, you would connect the tag sensor to one input of an XOR gate where the other input is the "go left" output of a direction splitter. If you have a diagonal line at the lower right side of your playfield, you'll want to wire up the sensor placed along this line to an XOR gate that has a "go right" output as one of its inputs as well as one that has a "go down" output as input. I hope this made sense (it will probably make more once I can take some snaps of the circuitry). | 2011-02-08 09:28:00 Author: sny Posts: 144 |
Then, you need to hook up these tag sensors to an XOR gate for each direction you want to turn off when these sensors are activated. So, for example if you have a vertical line that forms the left border of the playing field and you want to constrain the object to, you would connect the tag sensor to one input of an XOR gate where the other input is the "go left" output of a direction splitter. Right. So if you hold the left stick to the left, you'll move until you activate the tag sensor. Both the tag sensor and the negative output of the direction splitter are active, so the XOR gate does not output a signal. But if you release the left stick, the XOR gate is getting only one output, from the tag sensor, so wouldn't it start moving outside of the boundary? http://i54.tinypic.com/beaphd.jpg Yes, that's the Prius. Don't ask. Because it's a community object, there's some stuff I couldn't move or delete, like that anti-gravity tweaker, NOT gate and tag in the center. Those tag sensors are all set to 180 degree detection angle, and they're rotated so that the straight edges form a rectangle, like sny described. The logic is a bit different though. http://i52.tinypic.com/2z8agxv.jpg Instead of XOR gates, I used AND gates. The tag sensors go through NOT gates, so if you activate the tag sensor, the AND gate will not output to the advanced mover no matter what the left stick is doing, and you can't get past the boundary. | 2011-02-08 20:47:00 Author: TooManyToasters Posts: 19 |
Right. So if you hold the left stick to the left, you'll move until you activate the tag sensor. Both the tag sensor and the negative output of the direction splitter are active, so the XOR gate does not output a signal. But if you release the left stick, the XOR gate is getting only one output, from the tag sensor, so wouldn't it start moving outside of the boundary? Normally you'd think that's what would happen, but for some reason, once you let go of the direction button that's being blocked by the XOR, the object gets bumped back a bit, which also turns the tag sensor off. But you're right of course in that the solution that you use is safer, should this recoil be blocked by some other object (e.g. a car hitting your controlled car). While in my case it has no noticable side effects, since all it "collides" with is made of holo, it might not be worth going for this simple solution in some other implementations. Anyway, for those of you who are wondering, here's the setup I used: http://www.lbpcentral.com/forums/attachment.php?attachmentid=30376 The blue wires are of course the outputs of the tag sensors. The direction splitters have their outputs inverted and the advanced mover has its acceleration and deceleration set to 100%, but other than that, everything has the default settings, IIRC. | 2011-02-08 21:43:00 Author: sny Posts: 144 |
sny and TooManyToasters, whenever I try either of your methods, the controllinator object doesn't move. At all. | 2011-02-13 14:51:00 Author: mutant_red_peas Posts: 516 |
I just read quickly, but why use tag sensors ? Use impact sensors and hologram walls. If the level only gives the illusion of moving, this is easy. Make 4 walls of hologram. Put a magnetic key on each one, each key with a different tag. Place 4 impact sensors on the ship, each with one of the previous tags. If the level is from left to right, the ship can't go pas the right wall. You can put this wall a bit before the end of the screen, making sure the player sees ennemies come without getting hit. If the ship hits this wall, the corresponding tag should move the ship horizontally towards the center of the screen with a follower. Do the same with the left wall. If the ship hits an obstacle and gets pushed over a wall it must be destroyed. Put a boundary around the 4 walls with a magnetic key labled "destroy" or something like that, with an impact sensor on the ship to destroy it. Give some space between this boundary and the walls. Now for the other two walls, just use basic movers to make the player come back. Why use followers for the other ones ? If the middle of the level moves, this method also works ! Or not ? I don't know, I'm writing without testing. | 2011-03-07 02:21:00 Author: Unknown User |
I have gathered some info on how the boundaries are made in Mm's Story levels, and have made a blog about it here (http://http://www.lbpcentral.com/forums/entry.php?3345-LBP2-Logic-Guides-Side-Scrolling-Shooter). Check it out, I'm making a level using that knowledge. Just to say, it's not finished, and I plan on making a few more LBP2 creation and logic tips. | 2011-03-07 20:42:00 Author: mutant_red_peas Posts: 516 |
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.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.