Search Unity

Ferr2D Terrain Tool

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

  1. tomph

    tomph

    Joined:
    Nov 6, 2013
    Posts:
    33
    I'm also running into issues with nested prefabs and invisible terrain. The colliders are there (and working), but the terrain will only become visible when I click on the root object inside the editor...

    Have tried to toggle SetActive and renderer, but that doesn't work. Any ideas? :S

    Also tried:

    1. if (go != null) {
    2. T[] source = go.GetComponentsInChildren<T>(true);
    3. if (source.Length > 0) result.AddRange(source);
    4. }
     
  2. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @serpin, thanks for the list! Some of these things I've gotten to already in my current build, and a few of them I'm still working on. And there's a few bits in there I hadn't heard yet, but I'll be sure to try and fix too =D

    This one, I haven't been working on at all yet, so I'll see what I can do here. I might need a little extra clarification on parts of this section, but I'll see when I start fixing it.

    I haven't added the ability to turn off direction specific colliders to pipe-like materials yet, but colliders in general behave a lot nicer in my current build. I've been doing a lot of work there. I'll make sure it's on my list though =D

    I've done a bit of work on the editor window too! I've got scroll bars for large images, and I -think- I got that weird bug from the image there. I never could repro it, so I'm not entirely sure there.

    Clamping, I'm likely to stick with, I don't quite see the benefit of allowing people to go outside the boundaries there, perhaps that's part of what I was unclear about earlier? If you can elaborate on a good solid example of why, I would certainly reconsider.

    This one is surprisingly tricky, but I've got most of a solution for it already! This will also be in the next release~!

    Check out the "Fill Split" slider, it reduces verts on the fill mesh as well as the collider mesh. I suppose that could be clearer.

    I've definitely been trying to focus on bugs lately, I've was getting lots of feature requests from people, and not as many bug fix requests, so a lot have been slipping through the cracks! I've also really delayed this current build to give myself more room for bug-hunting, so I'm on it! Please, if you've got any more, toss 'em my way =D

    At the end of RecreatePath in Ferr2DT_PathTerrain.cs, I used something similar to this for creating lightmaps. It can be a little slow when done every frame, so just consider that. In 1.0.8, I've got a little system for making this a lot faster, but it's a bit much for just a forum post =D
    Code (csharp):
    1. #if UNITY_EDITOR
    2. UnityEditor.Unwrapping.GenerateSecondaryUVSet(m);
    3. #endif
     
  3. Opde

    Opde

    Joined:
    Apr 4, 2014
    Posts:
    7
    Thanks, point lights is currently more than enough. Sadly those shaders don't work on mobile android devices (e.g. Moto G). All Ferr2D meshes are just invisible. Also, too many real time light eats up a lot of performance anyway. Lightmaps will be the way to go for mobile devices IMHO.
     
  4. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Just wanted to throw in my 2 cents about desired features. The following would be awesome...

    - multi-node selection
    - some kind of node snapping for more grid-like levels
    - multiple fill textures with configurable randomization

    EDIT: Never mind snapping already exists
     
    Last edited: Jul 10, 2014
  5. iEpic

    iEpic

    Joined:
    Sep 29, 2013
    Posts:
    119
    How is it that when I open up your ForestEdges.psd it has a green background, but in unity it's showing a transparent background? I tried to do this with my own image and failed.
    Is there a reason to make the psd background a similar color and how do you do it where it doesn't show in Unity?
     
  6. Collider_nyc

    Collider_nyc

    Joined:
    Jan 13, 2014
    Posts:
    14
    ForestEdges has an alpha channel. Open it in Photoshop, open the Channels tab and you should see RGB, Red, Green Blue and Alpha 1. Alpha 1 is what is cutting the green background out in your transparent shader. You could make the background hot pink if you really felt the need, but it's nice to have a color that is somewhat close to your foreground colors in case there is any bleed or anti ailiasing.
     
  7. vapgames

    vapgames

    Joined:
    Aug 25, 2012
    Posts:
    9
    Hi, just started integrating this tool into my engine, really neat thing!
    i'd like to share some things i've modified.

    1. Ferr2DT_Builder attached a callback to EditorApplication.playmodeStateChanged. I guess that was done to rebuild meshes in prefabs. But it the slowed the compilation a lot, sometimes up to 1 minute. Had to remove it, i'd put this function into a menu to call it manually.

    2. Ferr2DT_Triangulator uses some heavy duty triangulation library with a lot of subclasses. Simple triangulation function seems to be enough (http://wiki.unity3d.com/index.php?title=Triangulator).

    Code (CSharp):
    1. public  static List<int> GetIndices(ref List<Vector2> aPoints, bool aTreatAsPath, bool aInvert, Ferr2DT_FillMode fill)
    2.     {
    3.         //REMOVE DUPLICATE VERTICES
    4.         List<Vector2> points = new List<Vector2>();
    5.         int n_points = aPoints.Count;
    6.         if(fill != Ferr2DT_FillMode.Skirt) n_points -= 1;
    7.         for(int i = 0;i < n_points;++i)
    8.         {
    9.             if(i == 0 || aPoints[i] != aPoints[i - 1]) points.Add(aPoints[i]);
    10.         }
    11.  
    12.         //INVERSION
    13.         int bounds_ins = 0;
    14.         Vector2 old_point1 = Vector2.zero, old_point2 = Vector2.zero;
    15.         if (aInvert)
    16.         {
    17.             //BOUNDARIES
    18.             Vector4 bounds = GetBounds(aPoints);
    19.             Vector2 bound1 = new Vector2(bounds.x - (bounds.z - bounds.x) * 1, bounds.w - (bounds.y - bounds.w) * 1);
    20.             Vector2 bound2 = new Vector2(bounds.z + (bounds.z - bounds.x) * 1, bounds.w - (bounds.y - bounds.w) * 1);
    21.             Vector2 bound3 = new Vector2(bounds.z + (bounds.z - bounds.x) * 1, bounds.y + (bounds.y - bounds.w) * 1);
    22.             Vector2 bound4 = new Vector2(bounds.x - (bounds.z - bounds.x) * 1, bounds.y + (bounds.y - bounds.w) * 1);
    23.  
    24.             //FIND INSERTION POINT, CLOSEST TO BOUNDARIES START POINT
    25.             float min_dist = float.MaxValue;
    26.             for (int i = 0; i < points.Count; ++i)
    27.             {
    28.                 float dist = (points[i] - bound1).sqrMagnitude;
    29.                 if(dist < min_dist)
    30.                 {
    31.                     min_dist = dist;
    32.                     bounds_ins = i;
    33.                 }
    34.             }
    35.  
    36.             //SAVE OLD VERTICES TO CLOSE THE POLYGON LATER
    37.             old_point1 = bound1;
    38.             old_point2 = points[bounds_ins];
    39.  
    40.             //GOTTA MOVE THOSE EXTRA POINTS TO CREATE A GAP FOR TRIANGULATOR TO WORK PROPERLY
    41.             points.Insert(bounds_ins + 1, points[bounds_ins] + new Vector2(-0.1f, 0f));
    42.             points.Insert(bounds_ins + 1, bound1 + new Vector2(-0.1f, 0f));
    43.  
    44.             points.Insert(bounds_ins + 1, bound4);
    45.             points.Insert(bounds_ins + 1, bound3);
    46.             points.Insert(bounds_ins + 1, bound2);
    47.             points.Insert(bounds_ins + 1, bound1);
    48.  
    49.             //ADD BOUNDARIES TO SOURCE VERTICES
    50.             aPoints.Add(bound4);
    51.             aPoints.Add(bound3);
    52.             aPoints.Add(bound2);
    53.             aPoints.Add(bound1);
    54.         }
    55.  
    56.  
    57.         //TRIANGULATE
    58.         Triangulator2D triangulator = new Triangulator2D(points.ToArray());
    59.         List<int> indices = triangulator.TriangulateToList();
    60.  
    61.         //MOVE EXTRA POINTS BACK, TO CLOSE THE CREATED GAP
    62.         if (aInvert)
    63.         {
    64.             points[bounds_ins + 5] = old_point1;
    65.             points[bounds_ins + 6] = old_point2;
    66.         }
    67.  
    68.         //ALIGN INDICES
    69.         List<int> result = new List<int>();
    70.         for (int i = 0; i < indices.Count; ++i)
    71.         {
    72.             int last_ind = i;
    73.             for (int v = 0; v < aPoints.Count; v++)
    74.             {
    75.                 if(points[indices[i]] == aPoints[v])
    76.                 {
    77.                     last_ind = v;
    78.                 }
    79.             }
    80.             result.Add(last_ind);
    81.         }
    82.         return result;
    83.     }
    Here's Triangulator2D class:
    Code (CSharp):
    1. public class Triangulator2D
    2. {
    3.     private Vector2[] m_points;
    4.     public Triangulator2D (Vector2[] points)
    5.     {
    6.         m_points = points;
    7.     }
    8.    
    9.     public int[] Triangulate()
    10.     {
    11.         return TriangulateToList().ToArray();
    12.     }
    13.    
    14.     public List<int> TriangulateToList()
    15.     {
    16.         List<int> indices = new List<int>();
    17.        
    18.         int n = m_points.Length;
    19.         if (n < 3) return indices;
    20.        
    21.         int[] V = new int[n];
    22.         if (Area() > 0)
    23.         {
    24.             for (int v = 0; v < n; v++) V[v] = v;
    25.         }
    26.         else
    27.         {
    28.             for (int v = 0; v < n; v++) V[v] = (n - 1) - v;
    29.         }
    30.        
    31.         int nv = n;
    32.         int count = 2 * nv;
    33.         for (int m = 0, v = nv - 1; nv > 2; )
    34.         {
    35.             if ((count--) <= 0) return indices;
    36.            
    37.             int u = v;
    38.             if (nv <= u)
    39.                 u = 0;
    40.             v = u + 1;
    41.             if (nv <= v)
    42.                 v = 0;
    43.             int w = v + 1;
    44.             if (nv <= w)
    45.                 w = 0;
    46.            
    47.             if (Snip(u, v, w, nv, V))
    48.             {
    49.                 int a, b, c, s, t;
    50.                 a = V[u];
    51.                 b = V[v];
    52.                 c = V[w];
    53.                 indices.Add(a);
    54.                 indices.Add(c);
    55.                 indices.Add(b);
    56.                 m++;
    57.                 for (s = v, t = v + 1; t < nv; s++, t++) V[s] = V[t];
    58.                 nv--;
    59.                 count = 2 * nv;
    60.             }
    61.         }
    62.        
    63.         //indices.Reverse();
    64.         return indices;
    65.     }
    66.    
    67.     private float Area ()
    68.     {
    69.         int n = m_points.Length;
    70.         float A = 0.0f;
    71.         for (int p = n - 1, q = 0; q < n; p = q++)
    72.         {
    73.             Vector2 pval = m_points[p];
    74.             Vector2 qval = m_points[q];
    75.             A += pval.x * qval.y - qval.x * pval.y;
    76.         }
    77.         return (A * 0.5f);
    78.     }
    79.    
    80.     private bool Snip (int u, int v, int w, int n, int[] V)
    81.     {
    82.         int p;
    83.         Vector2 A = m_points[V[u]];
    84.         Vector2 B = m_points[V[v]];
    85.         Vector2 C = m_points[V[w]];
    86.         if (Mathf.Epsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x)))) return false;
    87.         for (p = 0; p < n; p++)
    88.         {
    89.             if ((p == u) || (p == v) || (p == w))continue;
    90.             Vector2 P = m_points[V[p]];
    91.             if (InsideTriangle(A, B, C, P)) return false;
    92.         }
    93.         return true;
    94.     }
    95.    
    96.     private bool InsideTriangle (Vector2 A, Vector2 B, Vector2 C, Vector2 P)
    97.     {
    98.         float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
    99.         float cCROSSap, bCROSScp, aCROSSbp;
    100.        
    101.         ax = C.x - B.x; ay = C.y - B.y;
    102.         bx = A.x - C.x; by = A.y - C.y;
    103.         cx = B.x - A.x; cy = B.y - A.y;
    104.         apx = P.x - A.x; apy = P.y - A.y;
    105.         bpx = P.x - B.x; bpy = P.y - B.y;
    106.         cpx = P.x - C.x; cpy = P.y - C.y;
    107.        
    108.         aCROSSbp = ax * bpy - ay * bpx;
    109.         cCROSSap = cx * apy - cy * apx;
    110.         bCROSScp = bx * cpy - by * cpx;
    111.        
    112.         return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f));
    113.     }
    114. }
    Not a big deal, just didn't want to have 2 triangulators in one engine.

    3. Ferr2DT_PathTerrain.RecreatePath always creates 2 submeshes that sometimes cause extra drawcalls, even if there's no fill on the path. So i just added this:
    Code (CSharp):
    1. if(fill == Ferr2DT_FillMode.None)
    2.         {
    3.             //SET SINGLE MESH AND MATERIAL
    4.             // set up submeshes and submaterials
    5.             m.subMeshCount = 1;
    6.             if (renderer.sharedMaterials.Length > 1)
    7.             {
    8.                 Material[] old = renderer.sharedMaterials;
    9.                 renderer.sharedMaterials = new Material[0];
    10.                 renderer.sharedMaterial = old[1];
    11.             }
    12.             m.SetTriangles(submesh1, 0);
    13.         }
    14.         else
    15.         {
    16.             // set up submeshes and submaterials
    17.             m.subMeshCount = 2;
    18.             if (renderer.sharedMaterials.Length < 2) {
    19.                 Material[] old = renderer.sharedMaterials;
    20.                 renderer.sharedMaterials = new Material[2];
    21.                 if (old.Length > 0) renderer.sharedMaterials[0] = old[0];
    22.             }
    23.             m.SetTriangles(submesh1,1);
    24.             m.SetTriangles(submesh2,0);
    25.         }
    Once again not a big deal, just my OCD about drawcalls XD

    I'll be further modifying the tool to work with Toolkit2D sprites.
    Btw, neat idea with using mesh name and instance id to keep meshes unique when copying.
     
    Brumby and Toonsylvania like this.
  8. dayus

    dayus

    Joined:
    May 14, 2013
    Posts:
    5
    Hi,

    First, thanks for this awesomer editor!

    I would like to know if you could add the option to specify a sorting layer for the mesh. SpriteRenderer always appears above all mesh renderer but this can be fixed easily by setting a sorting layer to the mesh renderer. The option is just not there for mesh on the UI and it's unity's fault not yours ;)

    Thanks again!
     
  9. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I agree this is something Unity needs to get on. In the meantime you can put this behavior on any 3D object you want to be sorted. I suppose you could also add this code to the Ferr2d terrain script if you wanted it to be more integrated.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class SetSortingLayer : MonoBehaviour {
    5.    
    6.     public string sortingLayerName;
    7.     public int orderInLayer;
    8.    
    9.         void Start () {
    10.         renderer.sortingLayerName = sortingLayerName;
    11.         renderer.sortingOrder = orderInLayer;
    12.     }
    13. }
    14.  
     
  10. dayus

    dayus

    Joined:
    May 14, 2013
    Posts:
    5
    Yeah, i've seen this code, this is what I do at the moment but it would be a nice addition to Ferr2D :D
    Thanks tho!
     
  11. Bivrost

    Bivrost

    Joined:
    Mar 26, 2014
    Posts:
    80
    Also have a look at this nice solution. Works like a charm :D
     
  12. Elzean

    Elzean

    Joined:
    Nov 25, 2011
    Posts:
    584
    Hey really like the tool, i was wondering how your 1.0.8 update was going on. Seems like you were in testing phase a while ago, i'm interesting in creating lightmap and you vertex scaling thing :)
     
  13. gdeglin

    gdeglin

    Joined:
    Mar 7, 2013
    Posts:
    78
    We recently released our game in a few countries. It makes use of Ferr2D a lot (91 custom built levels).


    It will be available worldwide on Android, iOS, and Kindle Fire this wednesday.

    Thanks for providing this great tool! Wouldn't have been possible to get the levels to look nearly as good without it.
     
  14. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Is there a simple way to combine two separate pieces of Ferr terrain into one piece along any intersecting edges they have?
     
  15. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    Is the Infinite/procedural terrain example not in the current version? I'm looking for it, but can't seem to find it.
     
  16. a0100101

    a0100101

    Joined:
    Feb 9, 2014
    Posts:
    15
    how did you draw the rocks? They look really nice :)
     
  17. Dan_Tsukasa

    Dan_Tsukasa

    Joined:
    Jan 26, 2013
    Posts:
    155
    I'd like to suggest a small feature, not to the terrains itself, just to the terrain editor window, it can't be resized or anything and its large for no real reason, nobody has a terrain that goes all the way to the bottom.

    For example here:

    If I can resize it in the X axis to a minimum of that size (which is fine), but I can't shrink it in the Y axis eventhough it comes off the bottom of my screen, I have 2 monitors and one is dramatically larger than the other, so when it takes up this much space on this one, if I move the window to the other monitor it takes up the whole monitor (since the screens so small).
     
  18. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    I was just wondering a few things about this Asset before I buy it in terms of real-time changes. I'm assuming from the fact that you have a procedurally generated terrain demo that you can change terrain during run-time, but just to be sure, would it be possible? For example actually having a player modify the terrain path dynamically in-game? I'm also curious about how this would affect the 2D polygon colliders. Do these automatically update each time the terrain paths are changed or is there a way to update them? Let me know, thanks! The tool looks terrific!
     
  19. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @Leuthil, if the terrain is small, there's no problem at all changing up the terrain during runtime! I might get a little worried with the settings turned all the way up, because it can indeed be expensive when lots of path points are involved. Colliders are also quite easy to update, it's a separate function call, but it's really simple =D

    @Dan_Tsukasa, in my current build, I've actually got scroll-bars on the material window, so it should be much nicer for stuff like that in the next version~

    I'm still working on 1.0.8, just slowly is all. I've got another 2 assets I'm trying to get ready right now too. I was hoping to have at least one of them ready by Unite, but we'll see.

    Speaking of Unite, is anyone else going to be there? I'm traveling up to Seattle for 2 weeks, so I'll be around if anyone is interested in meeting up n_n
     
  20. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    What are your other assets?
     
  21. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    @koujaku, that's great. When you mean settings turned all the way up, what exactly are you referring to? Things such as the 'smooth path' option?

    And great also about the colliders :).

    I had one more question now that I'm thinking about it. How is your Ferr2D Terrain paths stored internally? If I always use the Closed fill type would I be able to retrieve the path points in Vector2's in order (say, clockwise order or something)?
     
  22. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    =D Well, since you asked~
    One is a vertex material blending tool~ (Ferr Blend/Paint) I've seen one or two on the asset store, but they're all big pains to use. It already kicks some serious ass, and it's been field tested on the Breach & Clear games, past and present. I've got a really cool shader setup for it, and it does some pretty spiffy stuff.

    FerrBlendPaintScreen1.jpg

    The other one is a highlighting system (Ferr Highlight). Again, there's one or two out there still, but there's a couple effects I needed that it doesn't do. Like only highlighting when occluded, rim glow, etc.

    BlurGlow.jpg

    And I mentioned Ferr3D a while earlier, I'm still working on that! It's kinda integrated with Ferr Blend/Paint for painting the terrain, and it shares a number of similarities with Ferr2D. I've definitely picked up some tricks from here that will come back and make Ferr2D a more pleasant experience as well. This one is a little further from being ready than the others are, but we're actually using it in a game right now, so it is usable.

    Ferr3DTest.jpg
    Ferr3DTestWire.jpg

    Yes, Smooth Path adds a lot of extra path points, and would make things expensive very fast! Oh, and another thing to keep in mind is that terrain won't split itself automatically if your modifications create two different pieces. It's very much path based, and it can be tricky working with path data like that.

    The path is stored as a list of Vector2s, and another list of overrides and (later, 1.0.8) scale points. Paths need to be defined clockwise, or they won't generate the mesh properly. Given the opportunity, I would like to overhaul how these are exposed publicly, (not my finest choices, but I've added some public interfaces to 'em that are much better) but I'm not planning on making breaking changes until I can introduce features that justify it.
     
  23. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Plugins are looking cool! Will Ferr highlight be pro only? Also, for Ferr3D, how did you achieve that cool grid like triangulation? Sorry if I am derailing this thread.
     
  24. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Yeah, Ferr Highlight will be Pro only... I might toss in a few things for non-pro highlights, but probably not a ton. Pro is pretty important to get those sort of effects.

    That grid thing, MAN was that tough. It involved flood fills to determine regions, edge tracing to get the outer ring of verts, some weird grid splitting stuff to get the right vertex density, and a bunch of triangulation tricks to get everything connected. I don't know if I could properly explain it, but it was truly brutal. I probably spent an entire week or two -just- doing that, and it still conks out every now and again. Results are worth it though =D
     
  25. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Ah I see. Thanks.

    Gotcha. Sounds good man. Cheers.
     
  26. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I figured that was the case for the highlights.

    The mesh definitely looks nice. Congrats on getting it working!
     
  27. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    945
    Is there any chance to release a build before 1.0.8 that just fixes the collider generation? It seems you're adding many cool features to 1.0.8 but, for me, the only really annoyance with the current version (1.0.7) is the wrong collider generation.
     
  28. SecretItemGames

    SecretItemGames

    Joined:
    Apr 13, 2012
    Posts:
    32
    Found some strange bug where you fall throuth the ground on one edge when you jump. Strangely it´s only on that one edge. Also it only happens when offset top is not zero.
    bug.jpg
     
    Last edited: Aug 17, 2014
  29. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Alright, I put together 1.0.8 beta #2! If you're interested in trying it out, just email or PM me your invoice number, and I'll send it your way =D

    @zorrar not entirely sure what's going on there, could you send me an email with some more context screenshots? (support@simbryocorp.com) Maybe something more zoomed out and settings?
     
  30. Deleted User

    Deleted User

    Guest

    Could you please comment as to what the public fields in your InfiniteTerrain Script do?

    Center Around
    Vert Count
    Vert Spacing
    Min Height
    Max Height
    Height Variance
    Cliff Chance

    and your InfiniteTerrainCamera Script, please?

    Follow Object
    MaxXOffset

    Thanks!!
     
  31. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I definitely recommend writing your own camera script. Camera scripts are always very specific to each game.

    For the Infinite Terrain script:
    Center Around: This is the GameObject it will use to determine if more points need to be generated.
    Vert Count: The number of points that are used to make up the terrain.
    Vert Spacing: The distance between points.
    Min Height: The lowest height for the randomly generated points.
    Max Height: The highest height for the randomly generated points.
    Height Variance: The largest amount of change for adjacent points.
    Cliff Chance: The [0-1] chance for a cliff to be generated at a point.

    For the Infinite Terrain Camera script:
    Follow Object: The object the camera follows, generally the player.
    MaxXOffset: How far to the right can the Follow Object go before the camera snaps to it.
     
  32. ashwinFEC

    ashwinFEC

    Joined:
    May 19, 2013
    Posts:
    49
    Is there a way to switch off the left/right cap for certain segments? My game generates a dungeon based on pre-made rooms. But where the rooms connect the cap creates an ugly seam. I know I can achieve this by using different sets of materials, but that is not a very elegant solution. It would be great to have an option to switch a specific cap on/off.
     
  33. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I do not have any functionality for that in right now, but I can see where that might be a problem! I'll add that to my future feature list, but you may not see it until 1.0.9 or w/e, sadly.
     
  34. dyarbrough93

    dyarbrough93

    Joined:
    Jan 11, 2014
    Posts:
    1
    I'm having an issue with lighting diffuse materials using point lights; works fine when using only two point lights but as soon as I add a third I get strange behavior. Check out this video to see what I'm talking about.

    This error only seems to occur when the three lights are within a certain distance of each other; as soon as I move one of them far enough away the lighting returns to normal. Any ideas?
     
  35. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    It looks like Unity is switching to vertex-lit shaders, probably due to too many lights on the same object. There is a cap on the number of pixel lights you can have on an object at any given point in time, which can be found in the quality settings. 1.0.8 will support light mapping, as well as some custom 2D lighting shaders that should be faster than the default diffuse shaders. You can PM/Email me your invoice number if you want to try out the beta for 1.0.8!
     
    Last edited: Sep 3, 2014
  36. SpaharGR

    SpaharGR

    Joined:
    Dec 5, 2012
    Posts:
    11
    Hello is there an estimated release day for the 1.0.8 version? Thanks
     
  37. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    It should be pretty soon now. The beta has been quite helpful so far, so at this point all I'm doing is polish, some platform testing, and documentation. I don't really want to give a solid estimate, because I have a -lot- of projects going on right now, but it is definitely just around the corner!
     
    Opde and TheValar like this.
  38. rubs_eguan

    rubs_eguan

    Joined:
    Mar 22, 2014
    Posts:
    2
    Hi, I just purchased your tool and was playing with it a little, but I'm having some strange results and I wonder if there's something I missed in your videos or docs, or it's just that I don't understand how this works.

    I also had this message when importing the tool from the asset store:
    importer.GetNPOTScale() == TextureImporter::kNPOTKeep

    Something related with non power of two scale... I don't know really, btw I could create a terrain by following your videos but as I told, it's drawing kinda weird:



    Thanks in advance!.
     
  39. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    You're using the terrain in the skirt mode, which always has an edge at a specific y value! It's great for simple ground terrain, where you don't see the bottom, but the way you're treating it, you might be more interested in the "Closed" terrain type! Also, using the shift-add feature, it's not so much a drawing tool as it is a point inserting tool~ You just need to adjust the way you approach it slightly, keep a sharp eye on the lines it's drawing =D

    For the NPOT error, I'm not sure what that is, but I don't think it's really affected people yet! I'll look into it, see if I can figure out what it is. If it -does- start trouble though, please let me know right away!
     
  40. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Hey! I just want to know, is anyone still using Ferr2DTerrain with a version earlier than 4.3? So far, I've been supporting 4.0, but I'm not entirely sure if it's necessary anymore. I develop in 4.3, and it can be a pain going all the way back to 4.0, since shaders always throw up, and the prefabs tend to need a lot of love.

    So, what version are you using?

    And yeah, that does mean I'm trying to package up 1.0.8 =D
     
  41. tomph

    tomph

    Joined:
    Nov 6, 2013
    Posts:
    33
    I'm running 4.4. I would definitely throw away backwards compatibility if it means we get updates faster :)
     
  42. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Wooh, I got a reply on that from David Helgason on Twitter: "Just a few percent and declining… so I wouldn't worry about it." That's about as definitive an answer as one can get, so it looks like I'm going to bump up to 4.3 =D (4.3 is definitely important, 'cause the Xbox builds of Unity are currently still in the 4.3.x area.)
     
    TheValar likes this.
  43. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Is there a special procedural for creating prefabs with Ferr2d objects? Reason is that I tried making prefabs but it's not working.
     
  44. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Prefabs can be a bit of a tricky situation with 1.0.7, if you email or PM me your invoice, I can get you on the beta, which behaves far better there! It's still not perfect, it can be very tricky getting Unity to play nice with procedural data and prefabs, and I still haven't knocked it out completely. That's actually been the big hang-up with 1.0.8 taking so long.
     
  45. Brumby

    Brumby

    Joined:
    Sep 8, 2014
    Posts:
    16
    Hi,
    Does anybody know if it's possible to change color of the edge material and filling material separately?
    It seems that changes of the Vertex Color affect everything.
    Any solutions?
     
  46. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    The easiest way to do this is to use a tinted shader, since the fill and the edges use separate materials, you can just tint them using the material instead of the vertex color.

    These are some tinted shaders that I've written specifically for Ferr2D, but technically any shader with a color property could do something similar.
    https://dl.dropboxusercontent.com/u/2985443/Code/Unity/UnlitColoredTint.shader
    https://dl.dropboxusercontent.com/u/2985443/Code/Unity/UnlitColoredTintTransparent.shader
     
  47. Brumby

    Brumby

    Joined:
    Sep 8, 2014
    Posts:
    16
    Thanks! works like charm :)
     
  48. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Yep, would appreciate if you'd stay around with 4.3.x, since we work with PS Vita and since that certain Unity Build uses version 4.3.1f we have to stick with that :)
     
  49. aRainyDay

    aRainyDay

    Joined:
    May 24, 2013
    Posts:
    24
    Hi,

    When using smooth path I sometimes get a small gap between the top caps and the top body. I also noticed the same behavior when turning on smooth path for an object in the example scene "4 - ExampleLayering2".

    Is there something I can do to get rid of this or at least reduce it to a minimum?

    Best Regards
    /John
     

    Attached Files:

  50. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422