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. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Anguis,
    Are you using an Orthographic setup in your game? If so, how are you able to light up your scene? With a perspective camera I am able to use spot lights and then the terrain lights up like it should, but won't work with a Orthographic camera. I've read that only "directional lights" can work in orthographic mode, but that type of light just lights up my entire scene no matter how minimal I make the "intensity" of the light.

    Note: I haven't tried using Koujaku's shaders yet, at school at the moment. (If that makes a difference to my situation)
     
  2. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    You can use any kinds of lights, even in ortographic view. Just make sure the Z values of your lights are correctly setup.
     
  3. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Hey koujaku,

    Since i'm just getting started I deleted that project and started again. If/when it happens again I'll email it over to you to have a look.

    Thanks :)
     
  4. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    Yeah, I'm using orthographic camera, like fidelsoto said adjust the z value of lights and add a little rotation to spotlights. Another thing may be causing problems for you is the "rendering path" needs to be "forward" other types don't work with orthographic, to change it go to "Edit -> Project Settings -> Player" and in your cameras mark to use player settings.
     
  5. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Anguis,
    I am using a point light, and in the editor mode it lights up my terrain like it should, and when I change to Game its just not lighting up. I checked the settings you suggested, and my light is at a good Z value. The one thing that I'm doing that could be an issue is that I am using the 2DTK camera, though I found under its settings "Rendering Path", and it is set to "Use Player Settings"... Any other ideas?
     
  6. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    if you are using the tk2d camera the problem probably is a high camera size, open the Camera itself above Tk 2d Camera (Script), and change the size to a low value I'm using 11, this will not change the real size of tk2d camera but will make the lights shows off
     
  7. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    That was the problem!! Thank you for your help. What affect does that "Size" property on the Camera have? Mine was set to 480 before, I changed it to 11 as you suggested.
     
  8. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    I just ran into another issue that wasn't happening before the last update.
    $issue.png
    The yellow line generates a collider...
    Although this could be circumvented by closing the terrain, I wonder if this is intended?
     
  9. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Last edited: Apr 4, 2014
  10. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Anguis,
    So while setting my camera size to 11 does work in general, now I've found that I have issues as my camera zoom in and out. My game is a 4 player arena game so the camera is zooming in and out a lot as needed (Using ZoomFactor on the 2dTK camera). I've noticed that when the camera zooms in close, then the lights begin to get cut off or something (Like a square mask over the lights). Maybe I will need to adjust the "Camera" size as I am changing the "ZoomFactor" on the 2DTK camera?
     
  11. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    In my case its actually generating a collider along the line.
    $collider.png
    I don't have a problem since everything is perfect when I close the terrain, I'm just informing you because I don't know if this was intended.
     
    Last edited: Apr 4, 2014
  12. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    For me even a great zoom factor keeps the lights ok, the only thing creating the light square is the camera size. try a lower number, put 1 on there, it only needs to be great than 0.

    EDIT: The size "white line box" of the camera always need to be smaller than it real size "green line box" preferably the same size ;)
     
    Last edited: Apr 4, 2014
  13. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Anguis,
    I just found this thread you created: http://2dtoolkit.com/forum/index.ph...SID=41ca9bbf1bc5fbea5a57fe32337a2ad2#msg15433

    Does that mean that you fixed that issue? The problem I'm experiencing seems to be exactly what you described in that thread, to which the support guy there said its a bug in Unity 4.3. Setting my size at 1, when the camera zooms in the lighting looks good but when zoomed pretty far out, like .35 zoom factor, the lights dissapear.
     
  14. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    Yeah, I was having the same problem, my game doesn't have extreme zoom in and zoom out like yours so it stays fine. What you need is a script that increases the camera size as zoom factor decreases.
    For me with 0.46 zoom factor the optimal size is 11.73 but with 0.35 zoom the optimal size is 15.43. Try keep the green line box(zoom) with the white line box (camera size) the same.
     
  15. Bitawu

    Bitawu

    Joined:
    May 11, 2013
    Posts:
    14
    Thanks for the shaders, been wanting this feature for awhile. I've been able to get the lights to work no problem on the fill texture, but none of the posted shaders show lights on the edge textures. I must be making some simple mistake somewhere, but can't seem to figure it out. Any guesses as to why just the edge texture won't react to lights?
     
  16. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I think one of the shaders is for the filler material, and the other shader is for the edge material. I used one for each. (I don't remember which at the moment) Worked good for me, though as Koujaku said, the corners still have issues at the moment.
     
  17. Bitawu

    Bitawu

    Joined:
    May 11, 2013
    Posts:
    14
    I appreciate the reply. Yeah I got that far with it - using the transparent lit shader on the edges. I think I discovered the problem - it doesn't seem to work on the top and bottom edges of a terrain object. The sides of the material I was testing were very dark so I was just looking for light reaction on the tops and bottoms of my material, which doesn't seem to be working.

    So I can get the lights to work on the edges, but not the top and bottom edges.

    koujaku: Any word yet on your lighting system or when a proper lighting solution might be available for this?
     
    Last edited: Apr 7, 2014
  18. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I've done a very tiny bit of work for the lighting system. It's still a ways off, but I am pretty excited about it too~ I've missed a lot of the more complicated rendering challenges, so it'll be nice to get back into some of that =D

    Again though, lots of work on my plate right now. My schedule should clear up a bit when my current project is done (just a week! =D) and I'll be able to actually sit down and give stuff some proper thought and planning. Rendering stuff gets hard, and I'm not real familiar with the small details in Unity. (I've done plenty with graphics though, wrote a game engine or two from scratch in the past)

    $BasicLighting.png
    That's a really basic implementation of some of the stuff I intend to do with it, but there's like, a hundred other things that will go with that and make it look really awesome!

    Also! If anyone's going to ECGC (East Coast Game Conference), Simbryo will have a booth there! You should totally stop by and say hi =D We'll be right next to Microsoft and Unity's booths~
     
  19. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57
    A rayman like lighting system!! I would definitely buy that!
    I also have a question (again).
    I'm trying to implement run-time terrain manipulation, but I am having some issues (more than some). I checked out the demo scene but that is not quite what I need and I have wreck my mind trying to figure it out. Basically I need to be able to move the verts around like in the editor window. For this I need to find the verts (the closest vert to the mouse cursor with OnMouseButtonDown) and then copy the vert's position to where the mouse cursor is so that when I finally release the button, the vert is in that new place. My problems are two: I can't figure out how to find the closest vert to input (if I understand correctly they are not Game Objects, and even if they were, they don't have individual colliders so something like a SphereCast will not detect them) and the second problem (which is linked to the first one), if the verts are not Game Objects, how can I change their position?
    I am sorry if this is obvious and easy but I can't figure it out. If anyone have an idea please let me know (I don't need the code, just some guidance)

    EDIT: this is what I have came up with:
    -Find the closest terrain to the mouse click (easy).
    -Go trough the Path Vertices array (don't know how to access this) and check which of them are present an arbitrary distance away from the click.
    -Save in a new array only with the points (vertices) that fall under that arbitrary distance (radius).
    -Find the closest point to the click in the new list.
    -Set this point (a vector 2) to copy the position of the mouse
    -Finally use OnMouseButtonUp to release the point in the new position.

    I'm not sure if this is very efficient, but it should work, however I don't know how to access the individual vertices of a Ferr2D_Path.
    I looked int the code at GetVerts(...) but I can't figure out how it works, and if I understand correctly, it will only pass a copy of the array, so I wont be able to modify it.

    Sorry for this, I'm clearly out of my very swallow depths here, but I would really like to know how to do this.
     
    Last edited: Apr 8, 2014
  20. k3pp

    k3pp

    Joined:
    May 2, 2013
    Posts:
    23
    Nice! that´s some kind of 2d mask that fakes a volumetric light or it really illuminates 2d and 3d objects?
     
  21. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57
    OK I finally did it! Add this script to the terrain you want to be able to modify on runtime and follow it's instructions! I hope this helps someone.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. /// <summary>
    6. /// Vert runtime manipulator. At the moment it only works fine if the terrain is at 0,0,0
    7. /// and a quad or plane is need to be created at 0,0,0 (it can be parented to the camera if you need to)
    8. ///The quad needs to be scaled to fill the screen and it needs a mesh collider
    9. /// (the mesh renderer of the quad should be turned of)
    10. /// </summary>
    11. public class VertManipulator : MonoBehaviour {
    12.    
    13.     public float radius;
    14.     /// <summary>
    15.     /// The max movement radius of the target vert.
    16.     /// </summary>
    17.     public float maxMovementRadius = 0;
    18.     public bool recreateCollidersInstantly = false;
    19.     /// <summary>
    20.     /// Lock target vert x position.
    21.     /// </summary>
    22.     public bool lockVertX = false;
    23.     /// <summary>
    24.     /// Lock target vert y position.
    25.     /// </summary>
    26.     public bool lockVertY = false;
    27.  
    28.     private Ferr2DT_PathTerrain terrain ;
    29.     private Ferr2D_Path path;
    30.     /// <summary>
    31.     /// The closest vert to the mouse click (target vert)
    32.     /// </summary>
    33.     private Vector2 closestVert = new Vector2(0f,0f);
    34.     /// <summary>
    35.     /// The index in path.pathVertices of the target vert.
    36.     /// </summary>
    37.     private int closestVertIndex;
    38.  
    39.     void Awake(){
    40.        
    41.         terrain = gameObject.GetComponent<Ferr2DT_PathTerrain>();
    42.         path = gameObject.GetComponent<Ferr2D_Path>();
    43.  
    44.     }
    45.  
    46.     void Update () {
    47.        
    48.         closestVertIndex = 0;      
    49.  
    50.         //Get the closest vertex when mouse button 0 is pressed
    51.         if(Input.GetMouseButtonDown(0)){
    52.  
    53.             closestVertIndex = GetClosestVertIndexToInput();
    54.  
    55.         }
    56.  
    57.         // Do not move the 0 index becouse it will generate problems.
    58.         // Also, if closestVertIndex is not zero, it means that in fact a vertex has been found
    59.         if (closestVertIndex != 0){
    60.  
    61.             StartCoroutine(UpdateVertPosition(closestVertIndex));
    62.         }
    63.     }
    64.     /// <summary>
    65.     /// Gets the closest vert-index to the mouse click.
    66.     /// </summary>
    67.     /// <returns>The closest vert index to input.</returns>
    68.     int GetClosestVertIndexToInput(){
    69.        
    70.         int closestVertIn = 0;
    71.         Ray ray  = Camera.main.ScreenPointToRay(Input.mousePosition);          
    72.         RaycastHit hit;
    73.  
    74.        
    75.         if(Physics.Raycast(ray,out hit, 100)){
    76.            
    77.             Vector2 pointXY;
    78.             pointXY.x = hit.point.x;
    79.             pointXY.y = hit.point.y;
    80.             Vector2 vert;
    81.                    
    82.             float closestVertDist = radius;
    83.            
    84.             for(int i = 0; i < path.pathVerts.Count; i++ ){
    85.                
    86.                 vert = path.pathVerts[i];
    87.                
    88.                 if(Vector2.Distance(pointXY, vert) < radius){
    89.                     print("Vert " + i + " is in radious");
    90.                     //After the iteration, the closest vert will be in closestVertIn
    91.                     if(Vector2.Distance(pointXY,vert)< closestVertDist){
    92.                         closestVertDist = Vector2.Distance(pointXY,vert);
    93.                         closestVert = vert;
    94.                         closestVertIn = i;
    95.                     }                          
    96.                 }                          
    97.             }
    98.             Debug.Log("Closest vert coord: " + closestVert);                   
    99.         }  
    100.     return closestVertIn;  
    101.     }
    102.     /// <summary>
    103.     /// Updates the vert position to that of the mouse wile the mouse button is pressed.
    104.     /// </summary>
    105.     /// <returns>The vert position.</returns>
    106.     /// <param name="anIndex">An index.</param>
    107.     IEnumerator UpdateVertPosition(int anIndex){
    108.    
    109.     Vector2 mouseXY = new Vector2(0f,0f);
    110.    
    111.         while (Input.GetMouseButton(0)){
    112.            
    113.             float distance = -Camera.main.transform.position.z;
    114.             Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition);
    115.             Vector3 mouseXYZ = ray2.origin + (ray2.direction * distance);; 
    116.             // Check if the movemnt should be lock in the x or y direction
    117.             mouseXY.x = lockVertX ? closestVert.x : mouseXYZ.x;        
    118.             mouseXY.y = lockVertY ? closestVert.y : mouseXYZ.y;
    119.  
    120.             if (maxMovementRadius == 0){
    121.  
    122.                 path.pathVerts[anIndex] = mouseXY;             
    123.                 terrain.RecreatePath();
    124.  
    125.             }
    126.             else if(Vector2.Distance(closestVert,mouseXY)< maxMovementRadius){
    127.  
    128.                 path.pathVerts[anIndex] = mouseXY;             
    129.                 terrain.RecreatePath();
    130.  
    131.             }
    132.             if(recreateCollidersInstantly){
    133.  
    134.                 terrain.RecreateCollider();
    135.  
    136.             }
    137.             yield return null;                     
    138.        
    139.         }
    140.         if(!recreateCollidersInstantly)terrain.RecreateCollider();
    141.         Debug.Log ("Mouse coord: " + mouseXY);
    142.     }
    143.    
    144. }
    145.  
    146.  
    147.  
    148.  
    This works, but there are some issues that I need help with. For some reason it will only work right if the terrain is placed at (0,0,0) and I just can't figure out why! Also does any one knows a good way to show little circles around the verts on runtime when this script is enable (like the editor´s gizmos).
    Also if anyone thinks a better way for this, please let me know, I'm kind of new to unity and programming so this may not be very efficient (I tested on a Galaxy SIII and it work without a big hit in FPS).

    There is another thing I need to know: is there a way to find out the angle between the segments that form a vert? I would really like to check for angles smaller than 90º degrees.

    Thanks
     
  22. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    That's incredible!! Looking forward to it!! ;)
     
  23. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57
    Ok I figured out how to get the angle of the vert. Just add this code to Ferr2D_Path class and call the method using myPath.GetAngle(index of the target vert)
    Code (csharp):
    1.  
    2. /// <summary>
    3.     /// Gets the angle of th two segments that meet in the path.vertPath[anIndex]
    4.     /// Jose Agregated method
    5.     /// </summary>
    6.     /// <returns>The angle.</returns>
    7.     /// <param name="anIndex">An index.</param>
    8.     public float GetAngle(int anIndex)
    9.     {
    10.        
    11.         Vector2 previousVert;
    12.         Vector2 currentVert;
    13.         Vector2 nextVert;
    14.  
    15.        
    16.         if(anIndex == 0){
    17.             Debug.Log("ERROR: cannot compare angle for index = 0");
    18.             return 0;
    19.         }else {
    20.             previousVert = pathVerts[anIndex - 1];
    21.             currentVert = pathVerts[anIndex];
    22.             nextVert = pathVerts[anIndex + 1];
    23.            
    24.             Vector2 currNext;
    25.             currNext = nextVert - currentVert;
    26.             Vector2 prevCurr;
    27.             prevCurr = previousVert - currentVert;
    28.            
    29.             float Alpha = Vector2.Angle(currNext,prevCurr);
    30.  
    31.            
    32.             return Alpha;
    33.         }
    34.     }
    35.  
    I'll stop bothering everyone now.
     
  24. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    You aren't bothering anyone! I'm very interested in what you are trying to do. Keep it up!
     
  25. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    I am having issues getting the colliders to work. I noticed in the code (AutoBoxCollider.cs) it only goes up to UNITY_4_2. I am using Unity 4.3. Should I be adding UNITY_4_3 to that if statement?

    #if !(UNITY_4_2 || UNITY_4_1 || UNITY_4_1 || UNITY_4_0 || UNITY_3_5 || UNITY_3_4 || UNITY_3_3 || UNITY_3_1 || UNITY_3_0)



    I have the following code on my object that I want to detect if it collides with the terrain... but it doesn't ever trigger :(

    #if !(UNITY_4_3 || UNITY_4_2 || UNITY_4_1 || UNITY_4_1 || UNITY_4_0 || UNITY_3_5 || UNITY_3_4 || UNITY_3_3 || UNITY_3_1 || UNITY_3_0)
    void OnCollisionEnter2D(Collision2D collision)
    #else
    void OnCollisionEnter(Collision collision)
    #endif
    {
    print ("Collision Happened!");
    }
     
  26. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    The AutoBoxCollider script is only there for compatibility with different versions of Unity, specifically, if it's a version that supports 2D colliders or not. It swaps out the rigidbody and collider based on that, to match with the terrain. So, adding UNITY_4_3 would switch it back to using 3D collider events in that case, causing it to not collide with the terrain.

    My recommendation to you though, would be to avoid that script entirely! Unless you swap between new and old versions of Unity regularly, or are making a tool for a wide audience, conditional compiling of that type is a little silly, and only complicates things.
     
  27. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    I found the performance problem when trying to play the game from the editor.
    The prefab-saving feature iterates through every directory in the project, this is highly expensive if your project is big.
    I temporarily solved it by changing this part in line 88 in Ferr_EditorTools.cs from
    System.IO.SearchOption.AllDirectories
    to
    System.IO.SearchOption.TopDirectoryOnly
    This of course means that I'll have to place the prefabs in the top directory (\Assets), or perhaps you could figure out a way to give it a different default directory of your own (maybe something like "Ferr2D Prefabs"). Cheers everyone~ :)
     
    Last edited: Apr 14, 2014
  28. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Just curious, how large is your project, and how long does it take? I suspected the pre-build feature might take a bit on larger projects, that's most of the reason why I time it and print the duration, but I didn't have really large project to test with.

    I'll be sure to add an option for specifying a folder to look in. If anyone else knows a faster way to find a list of all prefabs containing a certain component, I'd be glad to hear it!
     
  29. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    I have about 35 folders in the \assets directory :|, several plugins...
    It takes so much that I'm not willing to run it again just to check. xD
     
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    How does it runs on simple PC in terms of frame rate ? it is optimized for bigger level than web demos ?
    It is fully compatible with Unity 4.3 and above ?
     
    Last edited: Apr 16, 2014
  31. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    It is designed to be as fast as possible! I designed it with mobile in mind, so it's great on desktop. It's not limited by size of the level, or count of terrain objects, meshes batch quite well, and they have no Update methods. You have to be a little wary of fill rate on mobile though, if you have more than 5 or 4 layers of terrain visible at any one point on a phone or tablet, things start to slow down. But overall, very fast!

    And yes, 4.3 compatible =D You can switch between 3D and 2D colliders with just a checkbox.
     
  32. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    I've been running it on mobile and it runs pretty good. Performance is not an issue on this asset.
     
  33. bfowle

    bfowle

    Joined:
    Oct 1, 2012
    Posts:
    23
    Up until now I have used the Transform.position Z to order overlapping terrain elements created with Ferr (using an Orthographic camera). However, I'd like to use Perspective to keep a "ground" layer with the various collision and gameplay elements. How would you suggest handling a draw order of these terrain elements? Would there be a possible enhancement in Ferr such as user-defined "draw order" layers (similar to Unity's 2D) in the future?

    Thanks,
    Cheers~
     
  34. Andrige_

    Andrige_

    Joined:
    Oct 6, 2013
    Posts:
    12
    Hey!

    I love the plugin and have some ideas on features you could perhaps implement. Sorry if they might have been mentioned already, the 'search thread' thing on this website doesn't work.

    1. Convex terrain. This gives a subtle 3D-effect as seen in Rayman Legends (11m20s), and should technically speaking not be too difficult to implement.
    Here's an example I made to show off the effect in motion.

    2. Ability to automatically add prefabs on ledges. I am creating a platforming game where I set out ledge grab triggers for the player to grab on to. One nifty feature would be to in the ferr2d material be able to add prefabs to automatically appear on ledges of a certain angle (and with sugg. #3 it could be tied to the surface rather than the whole material).

    3. Ability to add more than 4 sets of sides. It's so cool that you can manually switch what material an edge is supposed to have, but I want more! It would be great to be able to have maybe two or three types of 'top' terrain so you can have more variation. For example a forest could have leaves on the ground, water, moss, pebbles, paved road, sharp rock etc. I'm making a PC title so 1024/2048 textures should not be an issue, and to have one pretty large texture that covers a lot of ground (pun intended) would be easier in the long run than creating a new Ferr2D object every time I want another type of material.
     
    Last edited: Apr 17, 2014
  35. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57

    Yes! that convex terrain would be great!
     
  36. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
  37. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I've been thinking about this one a bit lately. If I can tie it into their 2D layering system, that would be ideal! I'll be looking into this more seriously in the near future, but I agree, some of the z-offset stuff can get wonky with a perspective camera if you don't manage it really carefully!

    I've looked at their stuff pretty carefully, and I don't think they apply any depth to the terrain objects themselves. When I first saw the level you link to there, I thought the same thing initially, but if you look -really- close, it's actually 2 layers of terrain lined up -just- right! They do 3D stuff with their background objects and environment art, but I'm not sure if that's another internal plane modification tool, or an actual model. (This is a really good example! http://youtu.be/XoLpPw864eA?t=7m18s) Now, I've thought about implementing something like that anyway, but I'm still struggling with finding a generic solution that isn't super-complicated to use. That's always the hard part anyhow =D

    I love this idea! I'll add it to my list~

    What I have been thinking about, is just adding a few more edges that are accessible through the overrides. Nothing it would pick automatically from surface direction, but something you'd be able to flip through when you needed it. My original thought had been for making holes in the collider a little easier, but would definitely work for general deco stuff too~ I'll also add this one to my list =D

    I've been working on this one for a little while, and I've -almost- got it fixed! The next update is mostly a patch thing, and the corner bit is giving me quite some trouble. Hopefully soon! Depends a little on how busy prepping for ECGC keeps me.

    Thanks for the suggestions guys =D I always love hearing suggestions~
     
  38. Andrige_

    Andrige_

    Joined:
    Oct 6, 2013
    Posts:
    12
    I doubt its two layers interacting with each other as there is definitely some distortion going on. What I'm not sure of though is if it's a distortion based on rendering a convex 3D model, or something else. It does in fact distort on both X and Y axis. Compare the two and you'll see the detail on the texture is shifted on X and Y.

    View attachment 96155
    src

    I'm not good enough to figure out what's actually going on here (graphic artist trying to code his own prototype, cannot begin to fathom some of the cooler stuff) but maybe you can. It's very possible that this specific method they use in Rayman is not applicable for you and this plugin however, so please bear that in mind you forum-goers who read this. Possibly just fun speculation.


    Awesome! Let me just clarify on this a bit further - make it so that the ledge-feature is per type of edge. I.e. temple-stone edge places this automatically between angle 75 and 95, whereas the mossy edge type does not (for gamedesign purposes it would be slippery and wouldn't let you grab).

    That sounds great. Just bear in mind that you should make a UI-interface that scales up with quite a few edge-types. Right now you click to cycle between 5 states (up/right/down/left/default). With additional ones you could maybe have to click 9 or so times if the theme has many edges defined. This is especially true since I believe you cannot multi-select several vertices to configure the edge-type on in one go. Imagine if I wanted to set a long stretch of land to be mossy, multiplied by the amount of total edges. A lot of clicking would most likely ensue.

    $140417 - Free2D - Edge widget.gif

    So for sake of usability try to consider a way that can reduce the amount of clicks required as it might be a tedium if it's implemented with the current UI-widget. (sorry if it's a bit aggresive wish-listing going on here, but I figured it would be helpful to get a bit more feedback).

    Big thanks for your work. :)
     
    Last edited: Apr 17, 2014
  39. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    hi infinite terrain demo somewhere ? please
     
  40. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
  41. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    look good nice and any other change log i love read change log :)
     
  42. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
  43. RabbitB

    RabbitB

    Joined:
    Mar 30, 2014
    Posts:
    5
    I just purchased Ferr2D, and after playing around with it for most of the day, I can see that it would be a fabulous tool for rapidly generating 2d terrain, if only the editor functionality (especially the terrain material window) wasn't so broken.

    The first problem I encountered is that Ferr2D doesn't properly work with Substances; if you hook-up a substance to a terrain material and then open the terrain material editor window, it bugs out and draws all the editor GUI elements in the upper-left portion of the window. So I baked the textures and used those, and that fixed that problem, but it led me to the next major issue.

    The material editor window is flaky and often causes Unity to hang-up when editing values through the text-boxes, requiring me to restart Unity. This happens about 1 in 5 times I hand-edit a value. I've also found that the window doesn't dock properly--when docked in the main Unity window, there is no way to scroll through the material editor interface, and trying to resize the tab area causes corruption of the GUI elements, necessitating a restart of Unity to fix. Keeping it as a separate window works better, but I've found that as a separate window, you sometimes permanently lose focus on the window, making it impossible to interact with it again; not even trying to close it works. Restarting Unity doesn't fix this problem, only resetting to a previous interface layout will fix the problem.

    I don't know if these problems have been encountered before, and I just want to post about them and my information, just in-case they have been and there is a known fix or just what the cause of the issue is. This really does seem like an excellent tool from what I've been able to do with it (using the included sample terrain materials), but as it is right now, it's not functional enough on my system to be used in any project. I'm just trying to see if there's any hope of getting it working before I have to ask for a refund (especially since there doesn't seem to be any other equivalent asset available in the store).

    Edit: Just so we're clear, I'm not asking for you to add Substance support or anything like that. I just want to find out why the material editor hangs Unity up so often, and if there's anything I can do to alleviate the issue so I can make full use of Ferr2D?

    Relevant info:
    * Using Unity 4.3.4 Free
    * Multiple monitor development environment (considering everything is GUI related bugs, this may or may not be a factor).
    * I've already tried removing it from my project and reimporting Ferr2D, just in case anything went wrong on that front.
     
    Last edited: Apr 23, 2014
  44. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    I haven't heard of anyone experiencing this until just now! I know people have had issues with the material editor window before, but nothing that severe. I do plan on extensively re-working the material editor in the near future, there's definitely a lot of room for improvement there.

    I've seen a little bit of the substance integration with Unity, but I've never used it before. Does Ferr2DT still misbehave in an empty project with no substance materials in it? I'm not too sure why that would mess anything up, but I'll look into it regardless!

    I'm currently at the East Coast Game Conference, but I'll look deeper into this as soon as I get back!
     
  45. RabbitB

    RabbitB

    Joined:
    Mar 30, 2014
    Posts:
    5
    I started a new project and played around for a couple of minutes, and while I didn't encounter the freezing I experienced earlier (possibly because I didn't play around with it all that much), this did happen after editing some of the values for the forest sample material.

     

    Attached Files:

    Last edited: Apr 24, 2014
  46. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Yep, this happens to me a lot, too. The Material Editor is sometimes a pain in the ass to work with :p
     
  47. pixlweaver

    pixlweaver

    Joined:
    Dec 21, 2012
    Posts:
    92
    This is probably a dumb question, but is it possible to lightmap a Ferr2D mesh? I tried creating a lightmap on one of the example scenes, but the lightmapper tool says there's no static objects in the scene (the Ferr2D objects are set to static though). Also has a console warning:

    Primary UV set on Ferr2DT_PathMesh_New Terrain13682 is incorrect and the secondary UV set is missing. Lightmapper needs UVs inside the [0,1]x[0,1] range.

    I'm currently just experimenting - using the shaders Koujako posted a couple weeks ago. Would like to see if I can light a Ferr2D mesh and use lightmaps for better performance on mobile.
     
  48. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57
    Hi koujaku I have two quick questions.

    -First: Is there a simple way to create a terrain with just one material (the fill material). I have found some works around (by making the edge material the same as the fill but selecting a very tiny piece of the texture or by removing the edge material element from the inspector, but if I reshape the terrain, the edge material creeps back in) but maybe there is a cleaner way. (I'm using the tool for some strange stuff so I would understand if this is not implemented)

    -Second: Is there a way to animate the textures? Kind of like you would animate a sprite. I guess one could change textures like rendeder.material.mainTexture , and I will look more into this, but maybe there is an easier way.
     
  49. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Josessito, There's actually a Fill Type for "Fill Only Closed" which should do exactly what you're looking for! And I don't have any built-in support for animation, but you should be able to do it with Unity's built in stuff. You -might- even be able to trick their animation system into swapping out textures/materials for you! (definitely not 100% sure on that, so don't quote me)

    Pxlweaver, I haven't tried this, but if all it's missing is a second set of texture coordinates, it might not be too hard to add. I'll look into this! Lightmapping might get a little messy with the way the layers are offset though, so we'll see.

    RabbitB, I'll see if I can get my hands on some substance stuff sometime, and test it out in the near future. And for the material editor re-do, I'll try my hardest to bump that up more in my priority list =/
     
  50. josessito

    josessito

    Joined:
    Feb 14, 2014
    Posts:
    57
    Hi Koujaku Thanks for the reply!
    Right! I knew there was something like that somewhere( the only problem with this approach is that the "Fill Only Close" mode still gives you 2 draw calls, instead of one. but you can use the same material in both parts and then put "Fill Only Close" and it would work fine).

    I'm looking into the animation options because I can think of a million cool thinks to do with that! If I uncover something useful I will post it here.

    PS: For the material editor, I think that if in the "non simple" editing mode there was a way of locking the square "Y" and "X" position and then just mess around freely with the handles, things would get much simpler.