Home    LBP Showcase / Reviews / Recommendations    Object Showcase
#1

Patrol bot that can't see through walls

Archive: 13 posts


This is probably the way you usually try to have your guards & sentry bots "see" and detect your player or player bot... with two player sensors, with a skinny radius and tilted on a 180 degree split, to make it act like Left and Right.

http://i1.lbp.me/img/ft/b21d61c8d364f88f078ef42b4465c4c06d561359.jpg

...problem is, they can see you coming before you even get in the same room, and you can't hide from them. You want stealth, and you want to be able to run away and hide on all 3 layers as you approach or flee, so your sackbot enemies need to know they're looking at a wall.

http://i1.lbp.me/img/ft/a91df78f6043b94e8b4d5b0eed8970038a5d37bb.jpg

This won't work. He won't be able to see anything if a wall is in his line of sight and field of vision. I also tried 'sackboy touching a wall = detect off" but that has too much room for fail, unless you're making a wall-hug feature

This worked for me:

http://i2.lbp.me/img/ft/d32cd7c5f8626204f61eac339f3b9757c1a1c9c1.jpg

http://i0.lbp.me/img/ft/c50847d48fc99a557d96ce0e344e8e60acb29ad3.jpg


The middle chip is just your standard AI patrol left and right between two points, this will tell him he's looking left or right, and will be the same timer used to active either side of that holo block up there, which will be his left and right side line of sight.

The holo blocks are the same, and just reiterated, glued together, then reiterated as a set on all 3 planes

They're about 1-small grid shorter than the standard material-block size so that the impact switches aren't triggered by touching the floor, so they cover from his face to to his toes as a line of sight. The impact switches will tell the block that it's touching a wall, and a string of blocks glued together will act as his line of sight, by allowing him to "see" no further than what any block is touching.

From the center out, the impact switch on the preceeding block, allows the next block's microchip to function, so if the first block is impacted, the next 3 blocks won't be capable of activating, along with the plane-specific player sensor switch which radius shares the same space. The first block from center out on either side will need to have wired input from the same output that dictates it's patrol behavior, to tell the left side to be one when walking left and vice versa for right.

When you're not hidden and within range/plane of any sensor that isn't being impacted, the player sensor sensor radius activates a tag that will trigger a tag sensor on the sackbot and tell it to go into alert phase and begin pursuit. You can use standard logic from there to handle your alert phase.

Since it's duplicated into 3 planes with plane-specific player sensors, you can still be detected if you're not on the same layer as the object that's impeding the patrol bot's "vision" - the last thing needed, of course, is for the holo blocks to follow the sackbot's tag, stay centered, and be wide enough from each other so that the sackbot isn't touching any of the impact sensors. That piece should hold the two sight blocks together, and be on a thin layer so the bot won't impact with it (if problems with thin-layer collision problems are encountered, have the two sight blocks follow left and right tags mounted on a center block that follows the sackbot tag)

You could scale this down into skinnier pieces of holo for more precise sight spacing, but you might not have anything that skinny in your builds (I usually to build basic architecture and layouts following a big grid anyway) and it will eventually cost alot of therm. The shape of the holo, and how long the stretch is, can change the breadth of your line of sight for any bot, but the sensor radius for each piece will need to be adjusted accordingly.

Hopefully I explained this ok.
2011-03-10 23:19:00

Author:
Unknown User


Sweet man! So, when are ya makin that metal gear level?2011-03-11 00:24:00

Author:
smasher
Posts: 641


Soon, I hope. I probably wouldda made it already, but I still have that bug where if I capture my Solid Snake bot and try to place it down, the whole mover system for the shoulder-button menus just stops working :/ Celteen's set pieces he showed me for Shadow Moses were so awesome, that I know it'll translate well into sidescrolling.2011-03-11 01:38:00

Author:
Unknown User


Great job on working this technical stuff out. I still want to help out if you're up for it. We should talk at any rate, since I've got some ideas for ya.2011-03-11 02:01:00

Author:
Thegide
Posts: 1465


Of course I am. Even if Celteen isn't up for it, we can still pull it off, at least for a level or so I'll try and sit down and rebuild the menu. I have octocamo worked out in my head already... all you have to do is stand still somewhere for a minute and impact-tag on for different surfaces, timer up, L stick resets it, but no touch/move = timer fills and sackbot replaces itself), I just have to get a memory system worked out for when he'll be crawling and whatnot, if i work stuff like that in. I'm sure that can be done with two selector sets, and the menu can just tell each bot that appears what item it has on.2011-03-11 02:12:00

Author:
Unknown User


So you're going with the side-scrolling Metal Gear, eh? Probably a good move. Sounds like you have some cool ideas up your sleeve, I look forward to playing this.

Pretty solid (no pun intended) tech, I'd say. I can only see two holes in it. One, the player drops into a sensor block that is already sensing an impact from a wall, then the sackbot won't see him. Two, if the player is in the back layer, hiding behind an object in the middle layer, a sackbot in the front layer will still see him.

And just an idea, something I experimented with in the beta: In stead of a right and left viewing area you could have only one and use a rocket rotator to make it look in the right direction. Also makes him view up or down slopes automatically. You'll need to tweak it a bit so it doesn't get too jittery.
2011-03-11 16:29:00

Author:
Rogar
Posts: 2284


Yeah it's designed really only for hiding on a left & right basis on each plane, but could be applied to vertical and 360. If you're hiding behind on the side of a layer in the middle, and the guard is on the opposite side looking your way, he'll only see you if you step to the back or step the front...if you stay there, he wouldn't see you unless his patrol has him pass by you, but I tweaked it today for smaller sight panels, so sackboy's width is accounted for, and added this to the first chip of each line:

http://i4.lbp.me/img/ft/8244aee28545c662e49c4072b154c88d01fcd0bc.jpg


The 2.0 second timer gives you a chance to pounce, and if you drop straight into his face for a MGS3 style CQC 'catch em by surprise' pounce you can do the sleeper attack he's wired for. So and if you're in the middle, front, or back, but hidden, he won't see you as he passes you by, not until he turns around

I had initially used a single side that rotated from left to right, but there was always fraction of a second inbetween heading the other direction where the guards line of sight would be in the 180 upper region, and if you were hanging over the guard ready to drop, you'd be spotted. Maybe I can get it to rotate the other way in the lower 180 instead of the upper every time without fail, that way the floor will cancel any 'i can see you down there' issues, by buffering it with a gyroscope in a sequencer.

This was the sightline design for that:

http://i2.lbp.me/img/ft/b82fa3abd4262156045a6fe4b887716787fbb3ca.jpg

...it was matched to an exact sensor radius, a pie slice from the eye, but it made his up-close vision proximity almost non existent, and would have needed odd combinations of holo shapes to deactivate contextually for objects smaller than the max radius of the end, but I did keep some of the same style for the horizontal radius as a visual display:

http://if.lbp.me/img/ft/aff8b01ce84f1eae4aaab175eabe1c16dbc34d55.jpg

When the guard has pursued you to a different location, he reverts to a 3rd patrol chip that tells him to head back to his zone without switching from left tag to right tag patrol directions... otherwise he'll 'see you' when he's facing his destination and walking, which was lame. I only spent an hour on it yesterday (before today's stuff) to finally sit down and make a sentry and I have alot of features I need to add (so far I have tranquilizer/sleeper hold knock out with z's etc, and dialogue for all-clear and wake up cycles). Need to add some stuff like body lightening for dragging away bodies and seeing how that works... whether i even want to allow kills etc

Thanks for the input... glad you like the principle at least. I know alot of good stuff has been hampered by 'seeing through walls' and pursuit issues.
2011-03-11 19:18:00

Author:
Unknown User


Looks cool
Can't wait for this, looks like its gonna be really in-depth.
2011-03-12 09:29:00

Author:
Symin
Posts: 133


I was trying to tackle the same problem, and worked out a similar solution, but I actually used something closer to your second pic in the OP. So I tag the walls as 'cover'. And then I compare the analog values of the 'cover' tag sensor to the player sensor, and only if the player sensor reading is greater do I consider that a spotting. (I do that comparison with a little reusable logic unit I call a signal comparer, which I'd be happy to share if there's any interest.) So I end up with just one chip-on-a-holo, but I'd still need one per layer to provide layered cover detection with single layer sensors. But then I took that chip and added a set of three in/out movers, one set explicitly to each layer, and I cycle between them with a selector driven by a self-connected NOT gate. This causes the holo to complete a tour of the 3 layers every 0.1 seconds, which was rapid enough for my needs, and I figured it was maybe a little less clutter/thermo than having three chip-on-a-holo units following the guard. I like that my solution makes it easy to let my guards have as long a range of view as I want just by tweaking the sensor ranges, and I can use this same logic set up to tag shadow areas that provide cover without physical presence, or to have windows which don't provide cover even though they do have physical presence. But it does mean tagging all the cover objects, which is a fair amount of work, and may on the whole end up being more thermo costly. So your solution might well be better, especially if I didn't need the other types of cover.

One really cool thing it seems you could do with your physical set up is make it so if the sentry is on the front layer, and the player is on the back layer, and there is only a cover object on the back layer, then if the player isn't close enough to it, he could still be spotted. In other words, it would approximate the idea that if you drew a line from the sentry to the player it wouldn't really go through the cover in a proper 3D world.
2011-03-12 11:45:00

Author:
LittleBigDave
Posts: 324


One really cool thing it seems you could do with your physical set up is make it so if the sentry is on the front layer, and the player is on the back layer, and there is only a cover object on the back layer, then if the player isn't close enough to it, he could still be spotted. In other words, it would approximate the idea that if you drew a line from the sentry to the player it wouldn't really go through the cover in a proper 3D world.

Actually, yeah that would be great. If a player is directly on the side of any cover, from front to back, the surface detection with tagged player impact and/or player sensor presence could emit holo to the next layer in a perspective scale, to eliminate 'angle' view, and the block set up could be one layer that shifts with the sentry via it's follower. The collision with that holo would effectively turn one layer into 2 or 3 layers of cover depending on your proximity to it.... but yeah, the direction I'm ultimately going with this bot, is that I can place one in any environment, set his patrol, and not limit the environment design in anyway, because he'll hopefully work in any architecture he's placed in... so I didn't want tagged environments, or holo lining for everything. By doing that, I hope to be able to make more stealth playgrounds, with multiple routes and no 'wrong' way.

I thought after reading your method, that I could have the player dictate his own cover, via two two pieces of holo on either side of him. If the right side holo is impacting, then it could turn off his right side stealth tag, and all tilted tag-radius for 'looking left' on bots would be rendered useless because there's no "right tag" to detect. Only a bot approach from the left side would be able to spot him. If the player were between two pieces of cover, then both tags would be off, and no detection would be possible. That might be the best solution for single player (since I can only really dictate 1 follower for sackboy) but could easily be adapted for 4 tag colors on sackbots.

EDIT: scratch that, as soon as I turned on LBP to try it, I realized the fatal flaw. I could be on the other side of a wall, and unless I'm right up against it, I can be 'seen' through it. I'd have to do strength comparison like what you came up with. 100 v 100, and anything higher than 50 = trigger or whatever. I'm gonna try that though, and see how much object tagging it will need.
2011-03-12 19:57:00

Author:
Unknown User


I got to fiddling more on this after my last post, and actually ended up with pretty much a completely new system. Now I emit a holo with a player follower on it from the sentry to simulate the sentry's eye sight. (Well more like an invisible version of Cyclops's eye beam). So this pulse has both player collision detection and general collision detection and range from sentry detection, and it only lives for 0.1 sec or so. If it hits anything it's gone, if it reaches the player, it emits a 'spotted!' tag signal, because that means the player was in the line of sight. I emit this thing over and over rapid fire, as long as there's a player on the same side as the sentry is looking. If I only care about one player, then I just have the emitter for these eye beam pulses on a block that layer shifts to be on the player's layer, but the emitter piece of course follows the sentry. And in fact, because my sentries are big, I have a rectangular sentry follower with the follower gadget at pelvis height but eye beam emitter at eye height, so the eye sight comes from the eye level. I also played around with having the emitter piece stay on the sentry's layer, and just letting the pulse layer shift when it is equal distance between the sentry and the player. This can simulate the z-axis look around corners we were talking about, hopefully.

So I don't have to tag the whole environment now thankfully, though I have some other stuff in there to still simulate shadow cover using environmental tags. It seems to be working beautifully, and my guards are becoming eerily self-cognizant. What is especially cool now is I also can sense if the player is on a ledge above the sentry but still where he could be seen. Or if a player is behind a low wall, and then jumps up on top of it, he gets properly spotted and engaged. The one downside I just thought of and will have to go test/readdress is for multiplayer - if a near player is hidden and a further player is in plain sight, I think my system will end up ignoring the far player, unless player followers can be limited to only look at a single layer (not just only move on a single layer). But I guess that limitation hampered my previous system too.

I may work up a show and tell level for this later.
2011-03-12 22:15:00

Author:
LittleBigDave
Posts: 324


You could have the follower follow layers based on tags activated by the players presence in the layer. Each layer of following holo could have an impact switch on it to activate the tag, so that the other follower is only ever acknowledging the layer the player is in. A problem there might be which player that holo block decides to follow, for regular sackboys.2011-03-12 23:46:00

Author:
Unknown User


Sweet, This is very useful for my level!2014-02-18 01:30:00

Author:
Tikaki-MooMoo
Posts: 524


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.