Home Unity

Sidescroller woes

polycounter lvl 13
Offline / Send Message
ScribbleHead polycounter lvl 13
Hey all,

I've just begun work on my next university project, a sidescrolling 2.5D game.
The reason for posting here is because i've run into a few problems, a few of which aren't actually connected to Unity but more broadly to setting up a workflow.

I've never had to work with sidescrolling games before so essentially i'm looking to get some ideas and help setting up a workflow.

I need to deliver a working prototype (so i can get away with rudimentary assets i.e no textures - but functionality, animations and models need to be in place), and due to the time constraints i will be purchasing a few packages from the unity asset store to help me out...it's a solo project so i'm all alone on this one too :S.

Alright, enough with the talking - to the answers!

Q1. Achieving Camera Clipping (Lost Winds & Dead Light)
This is an area i'm hardpressed to figure out, it seems some sidescroller games utilize some kind of depth mask shader or camera clip shader, you can see in the Lost Winds screens - black parts of the geometry hint at either the kind of shaders i mentioned.
Or...its done as vertex painting.

Dead Light its seems does use some form of camera clipping, and they have another neat feature of fading off insides of buildings when the character moves inside, i'm wondering if this is done in the clipping...or if there's another way to go about it - gameplay video shows it in motion.
[ame="http://www.youtube.com/watch?v=nJwbKX4JulU"]http://www.youtube.com/watch?v=nJwbKX4JulU[/ame]

Lost Winds (wiiware)
lwindspuzzle.jpg
lostwinds-ipad-03.jpg
pict-128.jpg

Dead Light
deadlight-607-009.jpg
deadlight-solitary-man-climbing.jpg
deadlight-607-013.jpg


Q2. Modular Assets (Analyzing Double fine's "The Cave")
The last question i have is regarding assets found in "the cave", i've found a few screenshots which merit some investigation.

In this screen you can identify that right underneath the character there's 2 assets intersecting, but i'm having a hard time figuring how they did the underlying layer, seems like a separate asset all together.
26716Cave06.jpg

Same as here
New%20High-Res%20Images%20from%20Double%20Fine%E2%80%99s%20adventure%20title%20The%20Cave%20(5).jpg

But in this image i'm having a really hard time figuring out if its all custom models (the boulder and assets i can see are just placed in there, but the floor seems like it'd be one big unique model then, and that would mean each level had only unique models for the level design :S...baffled
26715Cave05.jpg

Could be i'm putting far too much thought into this and maybe its easier than i realize.
Just hoping someone can pop by here and put some of my thoughts to rest...kinda dont know where i should start.

Oh and i'm wondering, if the cave is using some kind of in-engine modelling, like using splines or what-have-you maybe getting http://www.west-racing.com/mf/?page_id=2360 (megafiers) would solve some of my hurdles.

Thanks in advance!

Replies

  • LoTekK
    Offline / Send Message
    LoTekK polycounter lvl 17
    Could be i'm putting far too much thought into this and maybe its easier than i realize

    Yes. :p
    utilize some kind of depth mask shader or camera clip shader, you can see in the Lost Winds screens - black parts of the geometry hint at either the kind of shaders
    Honestly, it looks like vertex color to me. Whether that was done manually after building the level and placing assets, or automatically as part of a preprocessor I can't be sure. It could potentially be done in the vertex shader, assuming there's some depth to the bevel at the caps (eg. past a certain Z/Y threshold, vertex color = 0), sure, but nothing more complex than that. Physically, the level geometry ends where you see it ending.

    As for Dead Light, that could be achieved any number of ways. Simplest method I can think of offhand would be to just have a big plane matching the geometry you need blackened, in the frontmost layer, then just fade in and out as needed.

    For The Cave, I couldn't say for sure how they're building their levels, but it could be that they build a unique greybox in either an external modelling package, or in the editor itself (think BSP in unreal/source), and then decorate with textures and props. Alternately they have lots of tileable bits that they snap together in the editor, with props and other unique geometry covering up any seams.
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Figured as much, this helps a ton - thanks LoTekK :)

    Think my brain can take a rest now :P
  • Snader
    Offline / Send Message
    Snader polycounter lvl 15
    I took a look at the trailer of The Cave, and I noticed this:
    thecave_blocks.jpg

    The three blocks are very similar, but not exactly the same. It looks as though they placed a lot of modular blocks in place, with a slight offset along the depth/z-axis, and then sliced the blocks at a certain distance. Whether this slicing is done through shader magic or beforehand I do not know.

    (the light red and green lines with the question mark might be the same modular block rotated 180 degrees, but I'm not sure)
  • Lamont
    Offline / Send Message
    Lamont polycounter lvl 15
    You can use depth along with camera clipping to get that effect (anything beyond a certain white point is clipped, traced and calls a fill material). Very clean if done right and you can use your modular bits in a lot of ways.

    Easy way with no programmer support/skill = build it that way.
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Great! :D think i'm finally getting my head wrapped around the concept of this thing.
  • Farfarer
    It looks to me like the same block 4 times, just scaled differently and one of 'em is rotated 180 on Y.

    I don't think the slicing is anything magic, I think they've just textured both ends of the block...
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Talon wrote: »
    It looks to me like the same block 4 times, just scaled differently and one of 'em is rotated 180 on Y.

    I don't think the slicing is anything magic, I think they've just textured both ends of the block...

    Yep thats what i'm getting from most of my other sources too - i just assumed that it was a way more complex process involving depth based clipping or some sort of magic...

    Now i'm thankfully that much more informed :D
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    I'm beginning to get a good grasp on my game prototype now - though i'm curious about how lost souls did their water...in the game i'm building, the player won't be able to traverse water volumes as its planned at the moment (maybe later on).

    (p.s I really appreciate all the help here, you guys are awesome!)

    As you can see there's fog and general visual effects going on underneath the surface, plus the water moves, but not according to the player dropping in (i'm fairly certain this just means that its an animated mesh with a shader.
    I must admit i've been looking high and low on answers.unity for something that explains how i'd go about creating (faking) water volumes like this, so i'm hoping someone here maybe has the key to the problem.

    [ame="http://www.youtube.com/watch?v=dL6fC-0n1Y8"]http://www.youtube.com/watch?v=dL6fC-0n1Y8[/ame]
    pict-128.jpg
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Here's a quick example of what i mean, i've managed to add a plane with a wave modifier that can increase/decrease the amount of...well waviness :)

    So i'll revise my question;

    1. How do i limit any effects or screen effects to the area (marked in red) under the wave surface? Is it just a matter or placing any effects right underneath the lowest going wave and then "hiding" any intersections with a particle effect?
  • Farfarer
    Honestly it could just be a big box with some vertex animation and a material that's got a lot of fog applied (or a depth shader).

    The simplest solutions are generally the best ;)
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Farfarer wrote: »
    Honestly it could just be a big box with some vertex animation and a material that's got a lot of fog applied (or a depth shader).

    The simplest solutions are generally the best ;)

    Hey farfarer, thanks for the reply - i can follow what you're saying right up untill the point with "a material thats got a lot of fog applied"...could you maybe elaborate on how you'd handle this in unity then, i'm not quite sure if there's any shader that features fog (closest thing i could think of was something equivalent of UE3's fog volumes).
    Alas there's a package for that on the store, but i'm wondering if there isn't other ways of approaching this before putting cash on the line.

    Also depth based is kinda broad, i've been looking into shaders that offer depth based transparency according to the camera clipping distance (shaderlab on the unity community). But i've only been able to find older versions for 1.x.x and 2.x.x, where neither work anymore.

    I'll try trotting on, but it would help a great deal if you could explain your own method of dealing with this problem.
    I tend to think its a more complex problem than whats really the case...apologies :P
  • Farfarer
    Well, fog is set up either per scene or per shader. See the fog shader documentation here; http://docs.unity3d.com/Documentation/Components/SL-Fog.html . See the fog render settings documentation here; http://docs.unity3d.com/Documentation/Components/class-RenderSettings.html .

    As for depth shader, it's a shader that will read the depth (distance from camera to geometry) for a given pixel on screen and you can then use that to apply a fog effect. It'll require Unity Pro features, however, as to read the scene depth from a shader requires RenderTextures. For what it's worth, this one would be my guess as to how it's done.
  • ScribbleHead
    Offline / Send Message
    ScribbleHead polycounter lvl 13
    Thanks farfarer, appreciate you taking the time to write this down - i posted the question on answers.unity as well and got this reply from Robert (unity dev).
    http://answers.unity3d.com/questions/324098/water-volume-for-sidescroller.html
    1) Just a simple transparent shader with a blend mode that looks best, not necessarily SrcAlpha OneMinusSrcAlpha. You can experiment with different options to see what effects you can achieve.

    2) A shader with a grab pass, that allows you to read the framebuffer behind whatever you have drawn and do anything with it. This approach will not only allow you to do any processing on the color, but also do any wavy distortions you like.
Sign In or Register to comment.