Search Unity

Ferr2D Terrain Tool

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

  1. oik976

    oik976

    Joined:
    Jul 2, 2012
    Posts:
    13
    Okay, so here's what I've got so far. First we need to resolve some errors and update our references to the prefab utility.

    First task, open Ferr\2D\Editor\Ferr2D_PathEditor.cs
    Update line 175 to the following:
    Code (CSharp):
    1.             if (PrefabUtility.GetCorrespondingObjectFromSource(target) != null) {
    2.  
    Update lines 212-214 to the following:
    Code (CSharp):
    1.         if (EditorGUI.EndChangeCheck() && PrefabUtility.GetCorrespondingObjectFromSource(target) != null) {
    2.             NudgeArray(pathVerts);
    3.         }
    Next, open ferr\2DTerrain\Editor\Ferr2DT_Builder.cs
    Replace lines 23-30 with
    Code (CSharp):
    1.                     if (Selection.activeGameObject != null)
    2.                     {
    3.                         if (PrefabUtility.GetCorrespondingObjectFromSource(Selection.activeGameObject) == o)
    4.                             sceneTerrains = Selection.activeGameObject.GetComponentsInChildren<Ferr2DT_PathTerrain>();
    5.  
    6.                         if (sceneTerrains != null)
    7.                         {
    8.                             for (int t = 0; t < sceneTerrains.Length; t++)
    9.                             {
    10.                                 PrefabUtility.GetCorrespondingObjectFromSource(sceneTerrains[t].GetComponent<MeshFilter>());
    11.                             }
    12.                         }
    13.                     }
    Next, open Ferr\2DTerrain\Scripts\Ferr2DT_PathTerrain.cs
    Replace lines 391-394 with:
    Code (CSharp):
    1.         UnityEditor.PrefabInstanceStatus status = UnityEditor.PrefabUtility.GetPrefabInstanceStatus(gameObject);
    2.         isPrefab = status != UnityEditor.PrefabInstanceStatus.NotAPrefab &&
    3.                    status != UnityEditor.PrefabInstanceStatus.Disconnected &&
    4.                    status != UnityEditor.PrefabInstanceStatus.Connected;
    The last change is in Ferr\Common\Scripts\EditInIsolation.cs
    Replace lines 65-66 with:
    Code (CSharp):
    1.             PrefabInstanceStatus t = PrefabUtility.GetPrefabInstanceStatus(objs[i]);
    2.             if (t == PrefabInstanceStatus.NotAPrefab|| t  == PrefabInstanceStatus.Disconnected || t == PrefabInstanceStatus.MissingAsset)
    That should get the nested prefabs working for you.

    There are many warnings being thrown by WebMessager.cs. I found that nothing in the actual Terrain tool seemed to be calling it, so I removed file completely. Warnings went away, no errors. That being said, since I'm not sure what uses it I don't know if its worth the effort, but my OCD gets set off by a bunch of stuff in the console.
     
    Voodoo_ZA likes this.
  2. Voodoo_ZA

    Voodoo_ZA

    Joined:
    Mar 18, 2013
    Posts:
    132
    Thank you oik976!!
     
  3. Voodoo_ZA

    Voodoo_ZA

    Joined:
    Mar 18, 2013
    Posts:
    132
    Update!!! v2.0.3 2019-2 +Bug fixes -Updated for 2018.3, 2019.1, and 2019.2 -Removed a number of default value warnings -Numerous fixes for prefab related bugs.

    Thank you koujaku!!
     
  4. Npicouet

    Npicouet

    Joined:
    May 17, 2018
    Posts:
    4
    Hello!
    Is there a way to get just a specific edge spline of a terrain?

    I wanted to use the spline to make some "paths" for a character, just curious if I can re-use what the terrain is building already somehow.

    EDIT: I was able to get what I need by duplicating the terrain and setting everything to Null. That allows me to make just a spline path to use as a guide for my character.
     
    Last edited: Apr 18, 2019
  5. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    27
    If i wanted to adjust each collider's side what is the best approach to do so? I understand you can offset an entire collider by prebuilding the collider and subsequently offsetting the entire collider in the x and y positions and also we can fine-tune each "Points"in the polygon collider (but it's pretty hard and messy trying to find the correct "line") but was wondering is there an easy way to adjust each individual side of a terrain's collider?
     
  6. Mirgan

    Mirgan

    Joined:
    Feb 2, 2016
    Posts:
    24
    Hello!

    I waited a long time for the new version of Ferr2D to work with prefabs without crutches.
    And so she came out and now even that which worked before (
    What am I doing:
    1. I need to create a prefab variant of an existing prefab.
    2. After I create it, I change the Ferr2DT_PathTerrain in it.
    3. Before version 2.0.3, in order for Mesh to be preserved in the MeshFilter you need
    It was after I changed terrain to change any field in Terrain Data,
    for example, set Use Skirt, and then remove again, then save the prefab, and then save the scene (it will not work without it).

    With the release of the new version, it stopped working and now when I enter the newly created Prefab Variant everything is empty until I go through all the objects in the hierarchy.
    When will this hell end?
     
  7. shindig82

    shindig82

    Joined:
    Dec 30, 2015
    Posts:
    4
    I cant seem to see the Edge Override buttons in the scene view, i think they are behind the add segment button. anyone ever hear of this?
    Edit: It was a scaling issue, make sure everything in the terrain is scaled to 1 if you run into this issue
     
    Last edited: Apr 30, 2019
  8. tripplejaz

    tripplejaz

    Joined:
    May 11, 2019
    Posts:
    1
    Is there a way to fix this scaling issue I frequently run into with edges?
    https://gyazo.com/f0f630f129cbe6760d9cf1979da9854d

    Also, a feature request would be to add a drop shadow shader to edges, similar to other fill options. Wonder how doable this would be?
     
  9. PedroSchabib

    PedroSchabib

    Joined:
    Oct 2, 2015
    Posts:
    5
    Hi, @maltakereuz
    Change the value of Render Queue in the material to stop the Z-fighting. I changed the Fill material value to 2500 and relsolve the problem.

    ------------
    3) Z-fighting/edge cropping in editor and game mode:

    As you can see fill is drawn over the edges. The legacy Z-Offset is now converted to drawOrder in material editor and multiplied by 1000. Setting it to another value does not seems to resolve flickering and cropping.
     
  10. Broghain

    Broghain

    Joined:
    Aug 31, 2013
    Posts:
    3
    After updating my project from 5.5 to 2018 I've been having the same z-fighting issue with FERR. Changing the fill material's render queue doesn't really seem like a satisfactory solution for me, however.

    ferr_jitter_1.JPG
    This is how it should look (minus the obvious z-fighting between fill and edge on the upper platform).

    ferr_jitter_2.JPG
    This is how it looks after changing the render queue. Notice the fill disappearing behind the background assets.

    Does anyone have a suggestion on how I might solve this (either with an alternative to render queue, or in a way that does not cause the fill's render order to change in relation to every other object in the scene)?
     
  11. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    The only solution we've found is to ensure that each separate terrain has a different sorting order. Not necessarily every terrain, but certainly ones that are on screen at the same time.

    I know that the problem is on the individual terrain, so this solution is counter intuitive, but it works for us.
     
  12. profcwalker

    profcwalker

    Joined:
    May 3, 2009
    Posts:
    240
    Quick question (hopefully). :) What's the best approach (code) for swapping the textures for the fill and edge at runtime on a terrain? Thank you!
     
  13. Vildas

    Vildas

    Joined:
    Dec 18, 2016
    Posts:
    1

    https://imgur.com/a/zrrHkgY

    Have anyone encountered this issue and fixed it? Basically I have several bodies on the top and bottom of my material. These bodies are matching perfectly in Photoshop and has the same dimensions and are made using the jungle demo material as reference. When making a terrain material and applying it - the sequential segments seems to have some kind of different y-offset and/or different scales as the height seems to differ from one segment to another when inspecting it. When I attempt to move the rectangle on the body in question the issue is fixed but then the opposite side of the bodies are having the same issue (it's always one side and fixing one side creates issues with the opposite side).

    I have tried using only one body but that issue also appears when the body are tiled to each other in the segments. And once again, the body are matching perfectly in Photoshop. If I replace the material of the object to the jungle demo material there is no issues so there isn't any problem with the object. I don't know if there is any hidden requirements of the edges and bodies that I'm not aware of or if it doesn't handle high resolutions or details well.
     
  14. camtronius

    camtronius

    Joined:
    Apr 22, 2014
    Posts:
    7
    Hey guys,
    Was wondering if anyone could help me find more textures like the ones the Ferr2D asset comes with? I am trying to match the style for my next game. Let me know if you can help. Thanks,
     
  15. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    58
    Hello! Just had a quick question.
    Is there a particular size my textures should be at that works best with this asset?

    Edit: I should reiterate. I've been told to make all my sprites double my target resolution (in this case I'm aiming for a 1080p resolution) so I've been doing all my art at least 2160x2160, expanding that as needed and then scaling it down in the engine.
    The problem I'm having is that, when I make the terrain, it comes in HUGE, and I'm not sure how to scale it.



    Edit 2: Nevermind. I more or less figured it out, but now I have another problem.
    One of my edge textures was made with some transparency, but that's not showing on the terrain. Instead, it seems to be repeating itself to give a filled rectangle.
    Does what I just said make sense and how do I fix that?
     
    Last edited: Aug 29, 2019
  16. instruct9r

    instruct9r

    Joined:
    Aug 1, 2012
    Posts:
    121
    Heya devs.

    Is there a way to make a point of the terrain to follow an object, but without calling Build() every frame, as this rebuilds the terrain and adjusts the tiling. I want it to simply stretch, when the point is pulled away...
     
    Last edited: Nov 21, 2019
  17. Spiderwork

    Spiderwork

    Joined:
    Feb 1, 2018
    Posts:
    30
    Voodoo_ZA and FrozenBotsStudio like this.
  18. FrozenBotsStudio

    FrozenBotsStudio

    Joined:
    Jun 27, 2016
    Posts:
    10
    I'd like to know about this as well...
     
    Voodoo_ZA likes this.
  19. instruct9r

    instruct9r

    Joined:
    Aug 1, 2012
    Posts:
    121
    I think this tool is not supported anymore. Wrote few times to the developer, but he is not responding...
     
  20. Spiderwork

    Spiderwork

    Joined:
    Feb 1, 2018
    Posts:
    30
    Yes , I made the same experience… Very sad.
     
  21. VektaCo

    VektaCo

    Joined:
    Sep 30, 2019
    Posts:
    5
    I used Ferr2d for my game Stomped! Last year



    I'm switching over to the new Unity Spriteshape tool because it is better integrated into the Editor and URP pipeline, but it lacks a bunch of the cool features of Ferr2d.

    Hoping @koujaku gets employed by Unity to help improve it and bring it to the level of Ferr2D
     
    Voodoo_ZA and CrowbarSka like this.
  22. nixtwiz

    nixtwiz

    Joined:
    Jul 2, 2012
    Posts:
    23
    Is there a way to have overrides for the end caps? I'd like to change the end cap as needed for different perspectives.
     
unityunity