playMaker

Author Topic: See through walls player power; Any ideas how?  (Read 1449 times)

daniellogin

  • Full Member
  • ***
  • Posts: 215
See through walls player power; Any ideas how?
« on: September 30, 2018, 05:38:19 AM »
I'm toying around with making a stealther game. Something a bit Thief or Deus Ex like. You know, creep around, try to not get caught, ambush enemies to quickly knock them out before they set off an alarm, etc.

This is just a hobby pursuit so it's not really a full game plan yet. I'm sort of making it to see where it goes. So now I'm working on what the actual player mechanics are. I'm thinking pretty much just rip off the powers or take the same vein as Deus Ex, so this may include a see through walls power so the player really works on the not get caught part, or planned ambush, rather than just run and gun blasting enemies with no regard.

So... any ideas on how I could rig up such a thing? I'm thinking ideally you would see the walls like regular but maybe get a kind of heat map look of the enemy figure shining through the walls. It would also ideally limit the range that the enemy would shine through the walls to reduce confusion and also limit the power so you can only get the edge on what's in the next room, not 5 rooms away.

Just to clarify, I'm not asking how to bind it to a control or set it's timer or anything like that. I'm just asking how one may make an object behind another be visible.
« Last Edit: September 30, 2018, 05:40:28 AM by daniellogin »

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: See through walls player power; Any ideas how?
« Reply #1 on: September 30, 2018, 05:48:14 AM »
I already searched with no luck, but after a bit more searching I think I found a way:
Quote
How it works is I have 2 cameras. A main one picking up everything and an alternate camera that only sees one layer. The enemy is on that layer. The depth level is set higher than the main camera so that the alt cam is overlayed. Just needs to be enabled/disabled to show enemies through walls. Any layer visible to that camera will appear on top of everything else

That's in the description for this video:
https://www.youtube.com/watch?v=ZGqQla4ITBU

I haven't tried it yet but that looks exactly like what I want. Filters and stuff can be done to that one camera level to make it look glowing or coloured or what ever.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: See through walls player power; Any ideas how?
« Reply #2 on: September 30, 2018, 04:35:45 PM »
Yeah, that's the usual way, two cameras, other camera sees only one layer and has a fancy overlay effect.
Available for Playmaker work

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: See through walls player power; Any ideas how?
« Reply #3 on: September 30, 2018, 10:16:31 PM »
What about assigning a transparent shader to the objects in front of the player?
Also, there are OUTLINE shaders out there: they don't show you the object but its outline... may be another solution.

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: See through walls player power; Any ideas how?
« Reply #4 on: October 01, 2018, 02:10:19 AM »
What about assigning a transparent shader to the objects in front of the player?
Also, there are OUTLINE shaders out there: they don't show you the object but its outline... may be another solution.
The problem with assigning transparency is that it would need to be assigned to hundreds (or maybe thousands) of game objects in a big build. You would also have the weird visual effect of seeing through a wall to see through a wall to see through a wall. It would all look very jumbled. It would also see forever through walls, unless even more complexity was added to only make walls within a range transparent.

As for outline shaders; I don't know anything about that.  Sounds ok maybe, but again it could have the complexity issue of assigning which gameobjects (enemy) have the shader on and more complexity again when you want to limit the range it works at. That's different than the camera effect where you very easily just set the far range and that says how far it works, and with the enemies in the correct layer easily assigning them to be seen.

The only issue I ran in to is that I assumed you could put a Post Processing effect on each camera and it would only affect that one camera. So I thought since the see through camera only see's the enemy that the effect would only show on that gameobject; That's not the case. The post processing shows on everything.

It's all good for now though. I have he whole view filtered but went for a heavy vignette, blue tint on everything, extreme motion blurr, and tons of grain to make it look like viewing through a rough digital night vision camera.