Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ferr2D Terrain Tool

Discussion in 'Assets and Asset Store' started by koujaku, Oct 9, 2013.

  1. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    $Promo2Med.jpg

    It can be found on the Asset Store here!
    And check out the website here!

    Ferr2D Terrain Tool allows you to quickly create a 2D level. No tile-sets, no placing tons of objects, no manually tweaking piles of collider objects. Just pick or create a terrain material, and set up a path! Edges switch texture automatically, and colliders create themselves!

    $CreateTerrain1.0.5.gif

    Check out a demo of it in action! It's included with the package~ Actually, make that 2 demos. Everything that's not the player is a terrain object, even the pipes!

    $GrassDemoSmall.png
    Grass Demo

    Pipes Demo

    We've done some testing with people, and so far, everyone has loved it! We've made sure the development process is fast and streamlined, so it's definitely intuitive and quick to work with. I've seen people using it for infinite runners, basic platformers, and even fighter games, so it's also quite a diverse tool!

    $Ferr2DTScreenshot7Small.jpg

    We're actively working with this tool on a project (or two ;D) with Simbryo, so this tool is being maintained and upgraded all the time. We're always looking for suggestions and feedback to make it better, and already have a few cool features heading down the pipeline! Feel free to reach out to me anytime for questions, bug reports, feature requests, whatever! We'll do our best to accommodate =D

    $Ferr2DTScreenshot6Small.jpg

    Many thanks to the people that helped me test it, and work out the early kinks! And a big thanks to Kelde, who contributed some of the awesome materials that come with it! (@KaiElde, http://artbyelde.wordpress.com/)

    Check it out on the asset store!
    Here's some tutorial videos for the tool.
    Or check out the rest of the documentation~!
     
    Last edited: Oct 18, 2014
    Gozdek likes this.
  2. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    This is so awesome!
    Thank you for this nice plugin and keep up the good work.

    I will definitely buy this in the future.

    Cheers
     
  3. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Absolutely fantastic !!!
    6R
     
  4. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Bought it right now, can't wait to test it :)
     
  5. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Man that turned out great, looks fantastic Nick! Congratulations and glad u liked the textures, let me know if u wanna make more screenshots with new enviromentsts, ill make em on the day for this:)
     
  6. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Alright, there are some things I can't manage to work out. I don't know if these are bugs or just my stupidity :D

    1. So if I use an existent terrain I want to create more Path-Points. I can achieve this by clicking the green points next to the white ones, I figured that out. But the problem is this:



    As soon a white one is selected I can't click the green circle. I have to move the white one far away in order to select the green one. Is there a better way to accomplish that?

    2. If i create my own material I can't select it in the Selector, also I get this error:

    That being said, is it possible to create the Materials IN the Project-Folders with a rightclick and not by clicking at GameObject -> Create Terrain Material? This way the created material wouldn't always be created in your PluginFolder. Would be better to work.


    Also it would be nice if you would have a little tutorial for making Sprites in order to use them. What sould one bear in mind while creating a sprite?


    Edit: And another thing.

    When I try to make slopes like this:




    In the Game View it looks like this:



    There are some weird artifacts (?) there, when I zoom out the get more spiky and bigger.
     

    Attached Files:

    Last edited: Oct 10, 2013
  7. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    I think there is a smooth option that gets rid of those, pretty sure i did that while i was testingit. Havent tried the new version so the white abd green selection u dont know.
     
  8. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Keep in mind this tool is designed for top, left and bottom platforms, not just a fill. If u add seamless textures ontop of that fill, jagged lines will be hidden. It seems u only use a fill material?
     
  9. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    I tried that already, didn't work.

    Hm, you're suggesting seamless textures. I thought a fill-texture is already a seamless texture?
     
  10. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Yes the fill is the ground under the other parts like top, side etc. U are using just a fill here, but u can add platforms ontop and on the sides and bottoms that goes ontop to make a better looking enviroment. I use seamless top textures like the grass u see in the images, they are a separate texture from the fill. This lets u wrap in the rocks i painted like u see. Shoot me a pm if something is unclear:)
     
  11. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Looks very interesting will definitely check it out!
     
  12. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Hi !


    Look very interesing !

    What about optimisation ?
     
  13. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    BTStone, all of those look to be pretty excellent points.

    First thing I want to mention is that right now, the tool doesn't do well with lots of points very close to eachother! Each point will have to be spaced out at least proportionally to the texture that's on that edge, or you'll see textures squishing. There is a "Smooth path" option that sets points at the optimal spacing for you automatically, but the general rule for the moment is "less is more". You won't notice the smoothing unless you have your points spaced out far enough. I'm am currently working on some code that will fix this, which should make the smoothing feature -way- better, it's at the top of my list right now!

    I actually meant to put in a solution for that! Oops. For now, this one isn't generally much of a problem with your points spaced out more, but yeah, there are definitely plenty of valid cases where that is an issue. I'll have a fix for that soon, for sure.

    I love that idea! If I can find the right bit of code for it, that'll be an excellent addition =D

    The sprite that I've got in there is -super- basic. There's no atlasing, so you'll need a material for each different sprite image you use (although you can sorta manually do atlasing by playing with the UV variable), and the "Ferr/Unlit Transparent Vertex Color" shader should be perfect for most cases. Tweak any of the variables to get it to refresh the mesh.

    It's really not the best, but you should see some major improvements to it in an update or two. I'm working on some transparency optimizations and a few other things that'll make it way faster to draw, so I'll be using it a lot in the upcoming weeks.

    For this, go to the Terrain Material Top, and set Width and Height to 0. I'm probably going to add in some new fill modes for the terrain, "Fill Only", which would make what you're doing trivial, and "Collider Only", just in case.

    *whew* Did I answer everything well enough? Thanks for the feedback, that's some good stuff =D
     
    Last edited: Oct 10, 2013
    DrOcto likes this.
  14. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Thanks for the reply!

    I really like the tool. It is a great addition and will be a great time-saver in the future, when we understand every aspect of the tool :D
    Besides some minor flaws the tool itself is great, well done!
     
  15. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Ferr2D Terrain Tool is actually pretty fast right now! All the expensive calculations are done in the editor; there are absolutely zero calls to Update from the code, so any cost is on the GPU. Just make sure your fill material is not set to be transparent, and you should be doing quite well ;D Keeping your transparent edges narrow would also be a great help, reducing the number of transparent pixels on the screen is always a plus.

    Now, with stuff like this, if you're adding excessive layers and large transparent edges, that can be an issue, especially on mobile. Pixel fill can kill a mobile GPU pretty fast. I probably wouldn't recommend using lots of layers on mobile, but 2 or 3 should probably be just fine.

    Now, I also have a few extra optimizations in the pipeline, separating edge meshes into transparent and opaque materials, and reducing the screen space they take up by tracing their edges into polygons, rather than just quads. It's not entirely necessary, but it will allow you to squeeze more out of it.
     
  16. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I'm glad you like it, despite the quirks ;D I'm really in love with this project, so you probably won't be waiting too long for fixes, especially the smaller ones!
     
  17. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    I just wanted to know how did you create the Alpha-Channel on your Edge-PSD Files?
     
  18. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I used this link as a base for what I do. I don't extend the color like he's doing with Dilate though, I simply add or paint a background color behind them that's close enough.

    It blew my mind when I saw what he was doing there =D I haven't used anything but PSDs since then! PNGs just don't hold a candle to it.

    ...I may try and do a video tutorial on that soon, could be quite helpful.
     
  19. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Thanls for the reply.

    How meshes are generated ? Separate object or one big object ? (1rst option allowing more optimisations, as batching)
    How drall calls are managed ? One per layer or material ?
     
  20. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    A few quick changes based on the feedback! I'll submit these to the store after the weekend, give myself some time to try and put some additional fun stuff in. If you need 'em now, just message me, and we'll figure that out =D

    $ContextMaterialCreation.png
    Creating terrain materials through the context menu, or create dropdown.

    $FillOnly.png
    Two fill modes, for fill only, with no edges involved!

    $BetterButtons.png
    Better buttons, sized appropriately, even when zoomed in really close!

    If you guys spot more things, let me know!
     
  21. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Each terrain object creates one mesh that uses two materials. They do batch perfectly in most cases, exceptions being pretty standard Z-order issues with sandwiching transparent objects of different materials.

    If you're only using one terrain material in the scene, it takes 2 draw calls, regardless of how many terrain objects (so long as they're static). An additional terrain material will increase draw calls by 2 at least, but in complex scenes with weird z-order, it's sometimes a little more than that.
     
  22. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Really liking this thread and tool. Congrats.
    Can you explain the math for how you breakdown your image sizes to then input as numerical values. HW etc.
    Is there an optimal system for breaking it down?

    The tool looks fast once set up.
     
  23. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    $PipesGrid.png

    I usually lay out a grid or guides when I'm drawing my material, that way I can get my segments to line up properly. Once I'm done drawing, I'll usually copy/paste a section, line it up with another section, and modify it until it lines up well, and then I repeat with all the other segments. Another thing you could do, is draw the intersections first, and paste those around, so you know all the intersections are the same.

    $PipesGridIntersections.png

    In this case, I decided on a texture size of 512x128, something pipe-like with enough room for me to have a couple of middle segments. I wanted body segments to be square, 128x128, so I had enough for 3 body pieces, and then I split the rest of it into two for the caps, 64x128 each.

    Creating it is the tricky part! The numbers are usually way easier. If you haven't seen the terrain material creation video tutorials, you might want to take a look at those too.
    http://youtu.be/_V9v2RXkUog
    http://youtu.be/TYQSuhsyCDE

    There's no real optimal system for it, just try not to waste too much texture space, and exclude as many transparent pixels as possible!

    I'm also working on a better tool for creating the materials, but that won't be for a bit yet. I may work on that this weekend, try and get something for the next update? That might be a little ambitious, we'll see.
     
    Last edited: Oct 10, 2013
  24. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Wow, impressively fast response. Thanks for the math.
    I just went through all of the videos for Ferr2D.
    And played the demos.

    I also own Uni2D, so I think the combination of those two assets could be really powerful.
     
  25. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Haha, I've been meaning to pick up Uni2D, it look AMAZING! I've been trying very hard to restrain myself from writing Uni2D features from scratch, it's at the very least an inspiration to me ;D
     
  26. dmagnusson

    dmagnusson

    Joined:
    Oct 11, 2013
    Posts:
    3
    Hey man, great tool. We've been loving using it so far.

    Something I'm curious about is the ability to turn collision on / off for different edges of a particular terrain, so we could have a section like this that our character can walk past but jump up onto without having to create our own collider objects:

    $OptionalSideCollision.png

    The red lines indicate places you'd collide with. Please excuse my horrible MS-Paint programmer-art.

    Is there a way to do this currently that I missed or will we need to be creating our own colliders for sections like this?

    Thanks for the awesome tool, looking forward to using it more! :D
     
  27. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Just place Boxes with MeshRenderer disabled, it's the way I'm doing it. Works perfectly fine.
     
  28. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    There's not a way to do that currently, but that sounds like an excellent idea! I'll add it to my list of features~
     
  29. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Just thought I'd give an update. I've been working on improving the Terrain Material editor, and I've got a bit to show for that! It's not 1000% better, but it's a good incremental improvement.

    Here's what it does:
    • Has its own window
    • Quick alignment preview
    • Segments are now draggable and resizeable
    • Added a simple mode for common cases

    $EditorPreview1.jpg

    An example of simple mode. Way fewer variables to deal with, and a single draggable box! This one will only work if your segments are ordered properly (Left cap, body segments, right cap all on the same row) but I figured that would probably be a common enough case to take it into consideration.

    $EditorPreview2.jpg

    The regular mode, where regions aren't locked together. You can drag each region around and get a preview of how everything will line up in the top left. The preview displays body segments in reverse order, so you get a better idea of how they'll loop.

    Longer term, I'm also thinking about adding an auto-atlas option, where you can have each segment as a separate image, and it'll assemble the texture and segment definitions for you automatically. However, the stuff you see here should be in the update I'm planning on submitting Monday!
     
  30. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    This is just awesome, I'm so looking forward to this update! :D

    And I can't wait for this one, too. Mate, the 5-Star-Review is on the way!
     
  31. idTaken

    idTaken

    Joined:
    Sep 14, 2013
    Posts:
    22
    I have had fun this evening messing around with this tool.

    Is there any way we can get randomized end caps using the same system as the body in a future update? This would be a nice addition.

    Building on that... the optional ability for the terrain Path to detect ~90deg (variable as well maybe) concave sections, and apply a specific alternate cap would be nice as well. I haven't had the chance to grok your scripts yet, so I am not sure how big of a pain this would be at this time. Manually adding a masking sprite as a child of the terrain object works in a crutch though, so this is more of a convenience thing.

    Good job on this. It is very well done, and already has that "polished" feel.
     
  32. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Randomized end caps, I can definitely do!

    The other bit, I think I'm having a little trouble conceptualizing, are you talking about having a different corner image for a Right->Bottom edge transition, and a Bottom->Right edge transition? I do have an idea for a different edge/corner model that would cover that, but it's different enough to require a different type terrain material, so I need to plan out how I do it.

    Either way, I'm glad you're enjoying it! Thanks for the feedback~
     
  33. idTaken

    idTaken

    Joined:
    Sep 14, 2013
    Posts:
    22
    Glad to hear about the randomized caps.

    I think it is possible that we are talking about the same thing on the second.
     
  34. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I just submitted an update to the Asset Store! It's not up yet, but I'll let you know as soon as it is. You've seen most of these already, but here's the full change list:

    Terrain Materials
    -Added context menu to the project window for creating new Terrain Materials!
    -Moved the Terrain Material editor into its own window, various and sundry improvements there.
    -Added a 'simple' mode to the TerrainMaterial editor, should be easier to create common case materials
    Path Terrain
    -Added physics material slot, since MeshColliders are generated at runtime
    -Added new fill types, Fill Only Closed, and Fill Only Skirt
    -Added option for disabling collider meshes along specific directions
    -Collider mesh no longer includes faces that point down +Z and -Z, as they're not important to 2D collisions, and it's much faster without.
    Path
    -Path GUI now scales properly with GameObject
    -Fixed an issue with button hotspots being too large when zoomed in

    I actually did manage to fit this in for the update =D I was chatting with hea, and he pointed me to some excellent resources that made it super trivial to do~! (Thanks hea!)

    $ColliderOptions.png

    Next small update will definitely have random caps! Sorry I didn't get that in this time around =/ If anyone spots bugs, or can think of other features they want, lemme know, and I'll get cracking!

    The next major update will probably be a little further off, as the features I'm planning on adding in will be a little larger in scope than these small tidbits. Off the top of my head, some ideas I'm tossing around are: major transparency optimizations (should include auto-atlasing materials and a better sprite system as a byproduct), drag-select path editing, and a better corner material system. I'm sure I have more ideas written down somewhere, but that's plenty enough as is =D

    And I'll try and spend some time doing more tutorials this week! I meant to do some of that over the weekend, but I hope you won't argue with these features as a consolation prize ;D
     
  35. anthonyk2

    anthonyk2

    Joined:
    Sep 18, 2012
    Posts:
    47
    Hi koujaku!
    I Just purchased the tool and I was wondering if you could add a drag and drop thing to adjust material parts. So glad to see that you've just did it ! xD.
    Can't wait for the update !
    I saw the asset store taking so much days before publishing an update so I hope it will not take too long ;)
     
  36. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    When I was going through the initial submit for it, the fastest they got back was about 3 day, and longest was a whole week. Definitely better than Apple, that's for sure! I've got my fingers crossed too ;D
     
  37. idTaken

    idTaken

    Joined:
    Sep 14, 2013
    Posts:
    22
    I don't know how much of the layout will change with the new updates, but can the "Use Top" check boxes be moved a little further from the collapsible arrow in the material inspection window?

    I don't know how many times now I have went to collapse/expand a section only to click this instead, and loose all the information within.
     
  38. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Oh ouch, I haven't had that happen to myself yet, but I could definitely see that happening. It'll keep that in mind, and do something to catch that in the next update!
     
  39. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    ok just to show what this tool can do with some pre-design. Have to give credit to idTaken for showing me how to do the corners properly. this is a level from my own game, and this worked wonders so we are using this tool now to build all levels main grounds, then adding 2dtk decor ontop and wherever we need it.

    $ferr2dtutorialtest1.png

    as u can see, its pretty flawless if u spent enough time on laying out the atlas and defining. i painted these to fit eachother ofcourse and they are seamless.
     
  40. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Looks fantastic! Incredible 180 degree action.
    I love this dev.
    Will make it easy 2d.

    Queries about photographic art as input.
     
  41. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I've been meaning to try out some photography based materials! Since I do a lot of photography too, it would only be natural to give it a go, but I haven't had the time to sit down and try it. If I was doing that, I'd want to go the whole way, maybe sculpt my environments and make a consistent lighting setup to shoot them in.

    If I ever get around to it, I'll definitely post about it! But I'd imagine it'd work alright, if you set it up well and can get the materials to loop right.
     
  42. idTaken

    idTaken

    Joined:
    Sep 14, 2013
    Posts:
    22
    Yeah, I tend to do all of my personal development work in hours 16 to 20 of my day, and it catches up to me.

    Looking good, and I am glad it worked out. I'm hopping that I will have something presentable in a few months myself.
     
  43. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    First, this tool looks awesome.

    How hard would it be to allow the option of using vertex coloring instead of a texture for some parts of the landscape? I like to do a silhouette style landscapes and it'd be nice to not require a black texture.

    Here is an example of my game Krashlander. This is using RageSpline. I only use a texture for the snow.

    $o4.png
     
  44. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Right now, vertex color is set to a single solid color every time the mesh is re-built. Great for tinting the whole object while still maintaining batchability! But probably not very useful in regards to what you're trying to do.

    I slapped together a quick material to give the style a try (I did use a black 16x16 texture for the fill, but theoretically you might be able to use a solid color shader) The only thing I don't have in right now, is the ability to force materials on specific segments, so those loops and any steep snowy slopes wouldn't work with the current setup. That's a feature I do plan on adding in soon though, so keep your eyes peeled for that!

    $SnowSilhouette.PNG

    And here's the texture atlas for that material (lol, transparent white on white background, you may want to open that in photoshop or something if you really want to see it)

    $Snow.png

    Oh! And I played the heck out of your game a while back, I love it!
     
    Last edited: Oct 17, 2013
  45. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    I for some reason really like those black silhouette games like Limbo, hated it for a while but now i think they hard to master in order to get athmosphere, and i like the simple clean look u got going on.

    Figured i'd show some textures again, last time, just to show what this tool can do. These are all made with it so.

    $all texturestest.png

    Really happy we ditched all our old levels and remade them using this tool, the workflow just improved so much because of it!
     
  46. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Thanks for taking the time to create a landscape similar to mine. Looks very good. I will definitely keep an eye on the updates.

    Glad you enjoyed my game. :)

    Keep up the great work!


    -Jeff
     
  47. anthonyk2

    anthonyk2

    Joined:
    Sep 18, 2012
    Posts:
    47
    the update is live, yeah !
     
  48. anthonyk2

    anthonyk2

    Joined:
    Sep 18, 2012
    Posts:
    47
    Okay, I think I found some bugs:

    - I've created my Ferr2D material, using the material editor window. Unchecked the simple mode, and dragged the areas. Then I closed the editor, all was rendering ok on the mesh. Finally I reopened the material editor and all my presets were reset. Hope you can fix than soon ;)

    - Docking the material editor window, is actually resizing the texture to fit the tab space. So all zones are no longer in the right place. You should warn to not dock the window or just disable the texture resizing ;)

    Anyway thx for this update, this is really awesome!!!
     
    Last edited: Oct 19, 2013
  49. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    I can confrim this, when i click to set caps, close it and build segments, open it again it has reset itself. Seems theres no way to save it either, so has to be a bug.
     
  50. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I had no idea 1.0.4 went live already! Looks like they never sent me an email about it. Ah well, guess that works!

    When you open it up, does it switch back into simple mode? I haven't been able to reproduce it yet myself, but if anything's wrong, I could imagine it being in the new simplified stuff. And does it happen all the time, or just on specific materials? I'd love to see the materials and/or screenshots of those, (support@simbryocorp.com) might help me figure out what's going on with it!

    I must admit, I never tried the docking it at all! It just never came to mind~ I'll tweak that around, see what I can come up with. I had set a minimum window size, but it looks like when you first dock the window, it ignores minimum size until you try to resize it again.

    And since the new version is out, I'll try and post something soon showing some of the stuff I've been working on~ Mostly small stuff so far, but nice things =D