Search Unity

Ferr2D Terrain Tool

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

  1. anthonyk2

    anthonyk2

    Joined:
    Sep 18, 2012
    Posts:
    47
    Yes it switch back to simple mode.

    The reset happens only when I close the material editor window and reopen it afterward. The solution I found is just to never close it and dock/undock it when necessary. So when I will click the "open material editor" button it will just update the tab without reseting the parameters of the material.
    If you can't reproduce it, I can maybe record a video ;)

    Another bug I have is that sometimes transparency glitches are appearing with textures. I have to modify some variables a little and with luck, it's rendering ok.

    Any idea ? =)

    Thx !

    Edit : Actually just clicking the "Play" button many times will make the glitches or not.

    $GDLDL.jpeg
     
    Last edited: Oct 20, 2013
  2. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    A quick fix for the simple mode glitch;

    In Ferr/2DTerrain/Editor/Ferr2DT_TerrainMaterialWindow.cs
    On line 273

    Replace this:
    bool simpleUVs = true;
    with this:
    bool simpleUVs = false;

    That should work for now, I'll have a better solution for that later!

    For the transparency issue, I -think- I solved this with Kai earlier this week, I'll send a build with that to you later tonight when I get a better fix for the simple mode glitch, see if it fixes that for you~!
     
  3. anthonyk2

    anthonyk2

    Joined:
    Sep 18, 2012
    Posts:
    47
    Thank you, this fix seems to be working ! ;)
     
  4. dmagnusson

    dmagnusson

    Joined:
    Oct 11, 2013
    Posts:
    3
    Awesome work dude! I just pulled the update off the store and it works like a charm. We'll definitely keep using this tool moving forward. If I run into anything else I'll make sure to drop a line in here asking about it! :D
     
  5. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Alright, quick update! As soon as I've done some slightly more rigorous testing, I'll be pushing this update out~ A bunch of small things that you may or may not notice, plus one bigger feature! Edge overrides, so instead of it auto-detecting what edge direction to use, you can tell it exactly which one you want!

    $UIUpdates.PNG

    New icons will help with visibility against same colored backgrounds, plus they look nicer! Edge overrides use a simple interface, just click on the direction icon until you get the one you want! Icons lean in the direction of the edge they influence.

    $Preferences.PNG

    Also, some workflow features! I find the mesh lines on the terrain distracting, so they are now hidden by default, you can toggle them back on again if you want though! Also, you can now manually influence icon size as well! If you work really far out, or really close in, this could be particularly useful for you!

    Here's the complete list!
    +Path Terrain
    -Added edge material overrides
    -Tweaked stretch algorithm, instead of stretching between a scale of 1 and 2, it now stretches between 0.5 and 1.5
    -Changed draw order of materials for better compatability with transparent fill materials
    -Added preference menu for showing or hiding terrain mesh lines
    -Fixed a collider glitch with Inverted fill modes
    -Fixed the Split Corners toggle, should now work
    +Path
    -Updated icons for better visibility against same color backgrounds
    -Added preference menu for icon scaling
    +Terrain Materials
    -Fixed bug with an overzealous simple mode
    +Assets
    -Updated Ferr/Unlit Textured Vertex Color shader to properly use Unity's UV settings

    As always, feel free to PM me for earlier access to it, but you can probably expect to see this up on the store sometime next week? And also, many thanks to anthonyk2 for helping me hunt down a couple of issues =D
     
  6. hea

    hea

    Joined:
    Jan 14, 2013
    Posts:
    8
    Great work! Can't wait to check this out. :)
     
  7. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Uh, really excited for the new release.

    One request: is it possible that you make a Roadmap of your tasks with the Plugin? What are you working on future updates? :)
     
  8. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Wooh! Me too! =D

    Haha, yeah, I'll see about setting down a roadmap. I've got a list of things I'd like to put in, and I think I mentioned some them a little back here, but I hadn't thought too much about order just yet! Better corners, auto-atlasing for materials, transparency optimizations, aaand my sticky notes are at home, I'll think about 'em and let ya know!

    Also, I made a .GIF with the recent build, 'cause .GIFs are cool~

    $CreateTerrain1.0.5.gif
     
  9. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Do I see that right? Is it possible now to smooth not only the whole path but also some parts of it? Would be great!
     
  10. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    That's the edge material overrides that you're seeing there! I just forced the left facing edge to use the top edge material, and added an extra point to round it out a little more. Haha, better smoothing is on the roadmap somewhere too though =D
     
  11. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Amazing stuff koujaku, just had to say it. :)
     
  12. deantzy01

    deantzy01

    Joined:
    Oct 23, 2013
    Posts:
    11
    i could use this for a small project lol
     
  13. msbranin

    msbranin

    Joined:
    Jan 19, 2009
    Posts:
    104
    Installed Ferr2D Terrain Tool 1.0.4 on Unity 4.2.2 get several warnings and most of the demos are busted with the terriaon out of place in the window and the collisions for the player no working and him just falling through the terran and of screen.

    Code (csharp):
    1. There are inconsistent line endings in the 'Assets/Ferr/2DTerrain/Editor/Ferr2DT_TerrainMaterialWindow.cs' script. Some are Mac OS X (UNIX) and some are Windows.
    2. This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
    3.  
    4. Assets/Ferr/2D/Editor/Ferr2D_PathEditor.cs(233,64): warning CS0618: `UnityEngine.Camera.GetScreenWidth()' is obsolete: `use Screen.width instead.'
    5.  
    6. Assets/Ferr/2D/Editor/Ferr2D_PathEditor.cs(233,120): warning CS0618: `UnityEngine.Camera.GetScreenHeight()' is obsolete: `use Screen.height instead.'
    7.  
    8. Assets/Ferr/2DTerrain/Editor/Ferr2DT_TerrainMaterialEditor.cs(23,56): warning CS0618: `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
    9.  
    10. Assets/Ferr/2DTerrain/Editor/Ferr2DT_TerrainMaterialWindow.cs(358,56): warning CS0618: `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
     
    Last edited: Oct 23, 2013
  14. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @msbrain, check your PMs! I just sent you a build that should fix most of those issues. It has everything from the new update I'm still testing except for the edge overrides.

    And those inconsistent endings are a darned pain, I work on 3 different computers with source control, and each one decides to stick something new at the end of each line!

    Kai was telling me he made 10 levels with it the other day, I was thoroughly impressed! Guess you can do more than just small projects too ;D

    Thank you muchly! It's quite a pile of fun =D
     
  15. msbranin

    msbranin

    Joined:
    Jan 19, 2009
    Posts:
    104
    The 1.05 preview package you sent me still has a few warnings but, the examples work flawlessly in 4.2.2 now. thank you.
     
  16. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I'm wondering...

    is it possible to generate terrain from code using this plugin? If so has anyone expiremented with randomized levels using Ferr2D?

    p.s. I have not purchased this plugin but probably will eventually when I start a project that would benefit from it. It looks like a really amazing tool!
     
  17. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I'll try and get all of 'em out in the final update!

    Made a quick little test to see if it is easily viable. Looks like it does just fine! I just added a method to 1.0.5 make it slightly easier to do, Ferr2DT_PathTerrain.AddPoint, so that'll be in the update in a few days! I'm really quite interested in doing some procedural stuff with it, I just haven't had the time yet.

    Here's the code for 1.0.4, this WILL NOT play properly with edge overrides in 1.0.5!
    Code (csharp):
    1.  
    2. public class ProcGen : MonoBehaviour {
    3.     public Ferr2DT_TerrainMaterial material;
    4.  
    5.     void Start () {
    6.         Ferr2D_Path         path    = gameObject.AddComponent<Ferr2D_Path        >();
    7.         Ferr2DT_PathTerrain terrain = gameObject.AddComponent<Ferr2DT_PathTerrain>();
    8.         path.Add(new Vector2(-1,-1) * 5);
    9.         path.Add(new Vector2(-1, 1) * 5);
    10.         path.Add(new Vector2( 1, 1) * 5);
    11.         path.Add(new Vector2( 1,-1) * 5);
    12.         terrain.ForceMaterial(material, false);
    13.         terrain.fill   = Ferr2DT_FillMode.Closed;
    14.         path   .closed = true;
    15.         terrain.RecreatePath    ();
    16.         terrain.RecreateCollider();
    17.     }
    18. }
    19.  
    Pretty much exactly the same thing with 1.0.5, just use the AddPoint method instead, since that'll properly add in the matching default edge override data.
    Code (csharp):
    1.  
    2. public class ProcGen : MonoBehaviour {
    3.     public Ferr2DT_TerrainMaterial material;
    4.  
    5.     void Start () {
    6.         Ferr2D_Path         path    = gameObject.AddComponent<Ferr2D_Path        >();
    7.         Ferr2DT_PathTerrain terrain = gameObject.AddComponent<Ferr2DT_PathTerrain>();
    8.         terrain.AddPoint(new Vector2(-1,-1) * 5);
    9.         terrain.AddPoint(new Vector2(-1, 1) * 5);
    10.         terrain.AddPoint(new Vector2( 1, 1) * 5);
    11.         terrain.AddPoint(new Vector2( 1,-1) * 5);
    12.         terrain.ForceMaterial(material, false);
    13.         terrain.fill   = Ferr2DT_FillMode.Closed;
    14.         path   .closed = true;
    15.         terrain.RecreatePath    ();
    16.         terrain.RecreateCollider();
    17.     }
    18. }
    19.  
    And here's the result of that code, with a terrain material properly assigned, of course.

    $Procedural.PNG
     
    Stevepunk likes this.
  18. sleepingwalrus

    sleepingwalrus

    Joined:
    Jan 6, 2013
    Posts:
    9
    I'm nearly ready to buy. I would like to know if Ferr2D can create hidden areas. I'm thinking I could create separate terrain object to be the overlay of the hidden area then use a trigger to hide it but I imagine it would be a bit of a pain to line up the overlay terrain by hand/eye. Any alternatives?
     
  19. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    That's actually exactly the approach I was intending to make for secret rooms. So long as the terrain and overlay terrain have the same world position, lining up the fill texture is done. (This might be easier if fill material texture coordinates were generated based on world position in the vertex shader, and I may look into that too) With the Fill Only Closed mode, and some creative use of props, it should blend right in! That seems to be roughly how it's done in the Rayman games.

    $Secret.gif

    Since colliders are generated at start, a little bit of maneuvering is required to set it as a trigger. I'll add in an easier way to do this with the next update, but in the meantime, here's a proof of concept script I just tested, works fine.

    Code (csharp):
    1.  
    2. public class ShowSecret : MonoBehaviour {
    3.     void Start () {
    4.         if (gameObject.GetComponent<MeshCollider>() == null)
    5.             gameObject.AddComponent<MeshCollider>();
    6.         collider.isTrigger = true;
    7.     }
    8.     void OnTriggerEnter() {
    9.         Destroy(gameObject);
    10.     }
    11. }
    12.  
     
    nickeron likes this.
  20. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Cool that seems pretty straightforward and easy! This could be very useful for creating endless levels and randomized levels!

    A couple more ideas for possible applications of this plugin...
    - Level editors in games (this would probably be complex but seems totally doable
    - "Theming Levels" think Legend of Zelda Link to the Past where you go into the dark world and everything is in the same spot but looks different. Is it possible to swap out which textures you are using for the terrain at runtime?
     
    Last edited: Oct 24, 2013
  21. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I've been thinking about creating a standalone mobile app that you could use to create and export Ferr2DT levels. If I did end up doing that, I'll be sure to include some of those tools with it! I think that'd be awesome. Similarly, I might also create some procedural generation utilities, but I'm slightly less certain about that.

    Swapping out materials during runtime should be a breeze! Just use Ferr2DT_PathTerrain.ForceMaterial(material, true). Just keep in mind that it rebuilds the mesh when you do this, which for large terrain paths can be a little slow (less than seconds, but not far enough to fit comfortably in a 30ms frame)

    Also, everyone, I'm gonna be away from internet until Tuesday, but I'll be sure to get back to you as soon as I get back! Keep the feedback rollin', and keep your eye out for 1.0.5!
     
  22. sleepingwalrus

    sleepingwalrus

    Joined:
    Jan 6, 2013
    Posts:
    9
    Cool. Bought.
     
  23. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    dude just...wow, this is updating so fast we have to check everyday for new changes:D Great job Nick!

    using this for trees, ground, and a ton of decor textures now, its perfect:D
     
  24. serpin

    serpin

    Joined:
    Nov 13, 2011
    Posts:
    54
    Just imagine how easy it would be to store levels as, say, XMLs, instead of separate scene files and just loading/replacing dynamic level meshes when needed by reading those files, or when the time comes to either load another part of the level or a whole new level, while not having to worry about destroying/keeping this and that in memory...

    Gotta say, this asset is one of the smartest ones of all I've seen in the Asset Store.
    Please, do keep working on it and adding new features!
     
  25. UCyber

    UCyber

    Joined:
    Dec 5, 2012
    Posts:
    1
    i purchased Ferr2D Terrain Tool and I've got this Weird problem :
    $error.jpg
     
  26. Duusty

    Duusty

    Joined:
    May 14, 2013
    Posts:
    56
  27. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I've been in love with JSON of late, so I may actually do something like that!

    The warnings are because I actually haven't tested in 4.2 (*whistles awkwardly*), I'm on 4.15 for my day job. But! Ferr2DT v1.0.5 should remove those whenever that gets approved! (...aaaany day now)

    The undo thing, I'm aware of, haven't found a good solution to it, but it doesn't -seem- to cause any major problems yet.

    The pink stuff is a material issue! It's possible you haven't set the edge or fill materials on the TerrainMaterial you've created.

    I'm actually planning on building a 2D lighting system at some point or another that might circumvent and surpass the need for manual vertex colors, but yeah, I could still see a few occasions where they might be nice. I'll think about that one!

    I actually have a demo I'm hoping to make that you might find interesting, it uses the edge overrides instead of grass! We'll see if it's a good enough approach, but it could be pretty cool~

    I am -totally- ok with that! I just wish their asset store approval process could keep up with me =D
     
  28. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Just Bought !



    Severals bugs in demo scenes, due to colliders, don't know how to fiw it ... however, nice tool !
     
  29. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Great tool !
    I just have installed Unity4 to be able to buy it and I can't be more impressed !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Bugs :
    * With "Inverted closed" parameter colliders don't work !?!
    Like the bugs in the Demos : The Gooplayer falls through some platforms (I think through Inverted Closed platforms !?!).

    * When we select "Closed" we can go back to "Skirt" for example : The general "shape" is now always closed !

    6R
     
    Last edited: Oct 29, 2013
  30. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    These should be fixed in the 1.0.5 version that's still going through approval! Samsson, p6r, check your inbox, I just sent it to you~
     
  31. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    You have do uncheck the "Closed"-Checkbox in the Inspector at the Path-Settings!
     
  32. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Thanks a lot koujaku... Great support !!!
    This package corrects the bug with the Gooplayer falling down and the "Inverted Closed" issue but we always have the bug with the impossiblity to go back from Closed to Skirt !?!
    Is it right for you too ???

    It is so easy to use...
    Your new material creation tool is wonderful compared to the old one on the video !
    Congratulations again for this plugin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    6R
     
  33. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Ooopppsss !
    I just have seen your reply BTStone (was typing mine when you typed yours !!!) and you're right : it works !!!
    Thanks a lot...
    So, now... CREATION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I'm working a lot on (Cartoon) seamless Textures and I think I will have a lot of pleasure to use your plugin with them... For example I just have tested this fence and it works fine :

    $CartoonFence2.png

    $Ferr2DFence.png

    A question : I have a ladder like this fence ! Could it be possible to add a vertical option to your system !?! Or is it already possible to create a kind of crazy ladder ???

    6R
     
    Last edited: Oct 29, 2013
  34. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Here is an example with one of my 2D Outlines Cartoon Texture :
    With the Vertex color the same Material can be used. And with the "Pixels per Unit" we easily can modify the scale of the texture for front or back texture.

    $Ferr2DCartoonOutlines.png

    6R
     
  35. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    The Pixels Per Unit feature ended up being -way- more useful for me than I thought it would be when I put it in, it's really such a useful unit! =D I was a little worried people might not catch on to it~

    You're stuff's definitely lookin' good! Thanks for sharing with us!

    Doing a ladder should be the same as a fence, you'll just need to have the ladder texture horizontal on the material!
     
  36. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Thanks for reply and nice comments, koujaku.

    YES : The Pixels per Unit is very important. On this picture I have used 50 for the front Terrain and 60 for the Back Terrain ! So, don't worry ! This option is great !!! ;-)

    I will try with the ladder...

    I have tested other seamless textures on your system : Snow and Rocks !
    It can't be faster to add a new material and to create another Terrain. I really like your plugin. The most boring thing in game creation is the making of backgrounds. But, with your extension, it's not only fast but funny with the Terrain Type parameter and all other options !!!

    $Ferr2DSnow.png

    6R
     
  37. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    A performance consideration for us is draw calls. Do you have an atlas per terrain type? so assuming one kind of terrain, will it be one draw call? :)
     
  38. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Two DrawCalls per Terrain, if I'm not mistaken.
     
  39. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    As BTStone mentioned, yeah, 2 draw calls per terrain =D I use an atlas for the edges, and then a separate texture for the fill material. I really wanted to make sure I could separate the bulk of the pixels into opaque and transparent, since the performance difference on mobile for transparency is generally far more significant! I do have more plans for pixel separation, but that may take a little while yet.

    One thing to note, I do default terrain objects to 'static', just to make sure they get batched by Unity! This usually turns up good results, but transparency and z-order can sometimes mess with it to reduce how many get batched. It's generally quite fast, the improvements to speed I plan on making are honestly pretty small things, it's already pretty much there!
     
  40. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    288
    I haven't seen this utility; amazing!.
     
  41. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Dude this art is absolutley awesome!!! I don't suppose you have any tutorials on photoshop techniques lying around the web anywhere?

    Picture didn't come through but I'm referring the the art examples done by Kelde
     
    Last edited: Oct 31, 2013
  42. vastar

    vastar

    Joined:
    Apr 6, 2013
    Posts:
    25
    simply amazing!
     
  43. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    OK ! Now I have seen much better how the great Ferr2D editor works. I will try to create textures relative to this editor...
    I have made this for cartoon walls.

    $Ferr2DWalls.png

    6R
     
  44. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well, I must say this is very nice indeed. 2 draw calls is well within any margin :) I guess we could find a reason to use this, so bookmarked for the future.

    Btw, out of curiosity are changes possible at runtime? I'm not planning it - merely curious!
     
  45. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Looks like 1.0.5 is officially live now! If I haven't given it to you yet, it's now on the Asset Store~

    You can indeed! It's not something I'd want to do every frame, but you can definitely do it during runtime. It's not -slow-, it's just not fast, especially on larger terrain objects.

    Kelde is badass =D I know he's talked about doing livestream stuff, but I don't think he's gotten around to it yet. I've been dying to see him in action too!

    Thanks so much guys~
     
  46. Dan_Tsukasa

    Dan_Tsukasa

    Joined:
    Jan 26, 2013
    Posts:
    155
    Is it possible to change the size of the indicators, the little dots we use to move the terrain about, as my scene has a large everything else, so I'm making the ground proportionate to that, however the scale of the little UI dots (really need to remember what these things are called) is tiny still.
     
  47. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Yeah! In v1.0.5, you can go to Edit->Preferences->Ferr->Path Vertex Scale, and tweak the size there =D I like to call 'em handles, but I don't think I'm terribly consistent with that as a name~
     
  48. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    * Great to be able to change the size of the handles ! Much much better to use !!!

    * Here I use the "natural surface textures" from the asset store and Genetica to create the Grass platform (light from above, shadow at the bottom and shadow effect on the fill texture !). Then I modify the shader to change colors for a more toony effect ! To finish, I create another Fill material with a darker color to assign into the skybox for the background; so I don't need to add a Ferr2D Terrain for example and the back always is shown by the camera !!!

    $Ferr2DNatural.png

    6R
     
  49. underdog3dee

    underdog3dee

    Joined:
    Aug 17, 2012
    Posts:
    4
    Any chance that this will work with Unity 3.5.7?
     
  50. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    This is something I've been meaning to do, I've had a few issues with it when I tried to do it last, but I didn't try terribly hard. You're actually the first person to ask! Next update I do, I'll try and make sure that it does =D