Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Ferr2D Terrain Tool

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

  1. SecretItemGames

    SecretItemGames

    Joined:
    Apr 13, 2012
    Posts:
    32
    Thanks, that fixed it. Btw what is the difference between snap relative and snap global? I think it behaves the same.

    Also a little feature request. Make it so that you can set a default Tag and Layer for new created Terrains in your Ferr2D preferences. That way you don´t have to select every Terrain and change the Tags/Layers manually. It is not a urgent feature so take your time if you decide to do it at all.
     
    Last edited: Dec 7, 2014
  2. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    Just wanted to say thank you for this awesome plugin. Just released my app to the Windows Store. It turned out much better and a great deal sooner than it would have without this plugin.

    On topic: Unity has plenty of quirks when editing polygon colliders, so I imagine
    zorrar's issues stem from that. I've reported the bugs I've found, so hopefully they'll get them fixed soon. Sometimes changing the z position or your camera (double click the item you are editing) help.
     
  3. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I'm having a problem in Unity 4.6.1 (it started in 4.6 rc3) and prior to that I didn't have any problems. For some reason if I click on a terrain to change the fill in the editor, Unity either freezes or just poofs and goes away. I've done the rebuilding of the cache, completely uninstalled Ferr2D and re-installed and nothing seems to matter. I'll be going along fine, then I'll start getting messages about leaking components, then crash. It doesn't happen all the time. But once it begins, nothing short of beginning a new project solves it. And, I really don't want to start another project. Also, it doesn't matter if I only have 1-2 terrains or 4-5 in the scene.
     
  4. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @meom, Does this happen in a blank project with just Ferr2D? What are the errors you're receiving specifically? I haven't been able to recreate this problem yet myself, just tried it out in 4.6.1.

    @shopguy, got a link? I'm a Windows phone/WIndows 8 person myself =D I'd love to see it!

    Also, if you guys haven't seen, @Kelde just published SkyJumper on Android today! (I'm really excited about this, and I hope he doesn't mind me sharing~) SkyJumper was the first game to use Ferr2D Terrain, and most of the art included with Ferr2D are actually painted by Kai too! Go check out his awesome game and art, and Ferr2D and stuff, and then go rate it! =D
    SkyJumper.png
    https://play.google.com/store/apps/details?id=com.nordicpixel.skyjumper
     
  5. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    Here's the Warning:

    Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    Mesh New Terrain-343880-Mesh has been leaked 1 times.
    Mesh New Terrain-368634-Mesh has been leaked 1 times.


    After I get that, if I then click on a terrain in the inspector, Unity freezes, or in this last case, it was just a poof and disappear. No error messages other than the leaking. I haven't tried to replicate with just Ferr 2d, but I will now. Also, when the warnings popup, the terrain names had already been changes to things like MainTerrain1, etc.

    Edited to add: I can replicate the leaking objects in a clean Ferr2D project, however, I couldn't make it crash yet. One thing of note: I was only able make the leaking objects message appear when I went to save the scene with only terrains in it. I created another scene, created a couple of terrains and got the message. However, once I added another game object (in this case the gooplayer) then save the scene, I didn't get the message.
     
    Last edited: Dec 10, 2014
  6. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Leaking objects is to be expected with the way I handle mesh generation, and fortunately, it's not actually a problem! This only happens in the editor, and not enough to impact performance in any way. If I can figure out how to handle it, I will, but it can be tricky dealing with Unity's content system. For now, just ignore those. I've made some advances in how I handle mesh generation with some of my other projects, so it's possible I may be able to fix this when I get around to the next update? We'll see.

    If it's not happening in an empty setup, then chances are good it's due to another system in your project! Do you have any other plugins that work with meshes, or that might be interacting with Ferr2D in some way? If I can get a small project from you where the bug happens, I'd be glad to take a look at it and see if I can figure it out~!
     
  7. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I knew that the leaked objects were a housecleaning Unity function. That part wasn't my biggest concern. It's the locking up that just started which seem to coincide with the leaked objects messages. I already thought about the other plugins I'm running and I'm testing out to see where the problem is. I'll keep you posted.
     
  8. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I started a new project and just used the default materials from Ferr to create some terrains. Then I added the plugin for my player, which, since it is a 3D player, has a mesh. I used the default player that came with the package and I was able to crash the system. I can send you the little project, should I send it to the support email from the Asset Store?
     
  9. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Yeah, that works for me, thanks! I'll try and poke through that ASAP!
     
  10. ncd

    ncd

    Joined:
    Nov 26, 2013
    Posts:
    8
    Hello, thank you for your work first of all … ferr2d is a great tool.

    I don't know how to make deferent Physics materials for different sides.
    (I am using the latest version of Ferr2d and Unity 4.6).
    Exactly I need to make:
    "top" - with one Physics material
    "left", "right", "bottom" - with another Physics material

    Could you advise me the best solution? 1.jpg
     
  11. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @ncd, Ferr2D unfortunately doesn't do this on its own yet! It's something I'd like to add, but haven't found a good way to do just yet.

    However, I have seen people use multiple terrain segments to do this! You could use a mix of edge only and fill only terrain objects to assemble the entire environment. It'll be more work, but you can sill do it. Alternatively, you could turn off the built-in colliders, and add your own polygon colliders or somesuch on invisible objects.
     
  12. ncd

    ncd

    Joined:
    Nov 26, 2013
    Posts:
    8
    Ok, thanks.
    I hope you will find a good way to do this.
     
  13. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    129
    I have some weird Sort Order issue. When I try to place a Sprite under a Ferr2D Terrain, the fill does not obey the sort order and I get something like this:
    Screen Shot 2014-12-13 at 12.29.02 PM.png

    Any idea how to fix this? If I change the shader of the fill from "Textured Vertex Color" to "Textured Vertex Color Transparent" it works, but do you think this will have any performance issues?

    Update: Setting the Vertex Color shader in the "Transparent" Queue, fixes the issue, but do you think that will mess something up?

    Tags {"IgnoreProjector"="True""RenderType"="Opaque""Queue" = "Transparent"}



    Kamen
     
  14. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    Just an update: the issue was with my pc and not Ferr2D. I just want to thank Nick for taking the time to check out my project.
     
  15. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @dimitroff, using the transparent shader (or queue) is probably the correct solution in this case, but yeah, there is a bit of a performance cost to it. Opaque geometry gets rendered very early on, allowing it to occlude stuff in the scene and reduce overdraw. Without the opaque queue, you do lose that benefit.

    The drawback to the opaque queue is that yes, the order in layer won't work well with it, since they're in entirely separate draw queues, so you have to rely on z-buffer order to do the sorting for you. I personally don't use the sorting layers much, and just use small offsets on the z axis instead, but the choice is yours. Ferr2D is generally quite fast, and I haven't looked too hard at how much benefit reducing overdraw actually has.

    @meom, Glad you found it! Hope it wasn't too big of a problem~
     
  16. sstrikerr

    sstrikerr

    Joined:
    Dec 31, 2013
    Posts:
    11
    Hey Koujaku!

    I tried the first part of what you said and I've been getting an error. I'm not sure if I'm doing it right. I've tried using the Unity cut-out/transparent shaders, but it was still giving me a problem. I went to "visualize" in the image effects blur to see how it was effecting the scene and got something odd (top image). i seem to "fix" the prob once i put on deferred lighting/unityshaders but i miss out on all the cool ferr tools.

    if its possible, i would like to stick with ferr. Could you show how to disable the ZWrite Off properly? I've attached a screenshot. The top one is what i have with ferr and the image effects and the bottom one is with the unity shaders and deferred lighting. Hope im not asking for to much,

    Thanks for any help!

     
  17. sstrikerr

    sstrikerr

    Joined:
    Dec 31, 2013
    Posts:
    11
    Nvm fixed it!

    just left the deferred lighting on and switched back to the ferr shaders :)
     
  18. Brumby

    Brumby

    Joined:
    Sep 8, 2014
    Posts:
    16
    Hi! I've got one quick question. How to enlarge point icons?
    I use bigger scale in my project and the is problem with visibility of them.
     
  19. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Hey @Brumby ! You can go to Edit->Preferences->Ferr->Path Vertex Scale, and boost that up as far as you need =D
     
  20. Brumby

    Brumby

    Joined:
    Sep 8, 2014
    Posts:
    16
    Thanks a lot sir! :)
     
  21. Terrabite

    Terrabite

    Joined:
    Dec 4, 2013
    Posts:
    77
    Hey, this tool is awesome! :D I'm trying to figure out a little problem with lights and my textures.

    I've added a point light into the scene and changed the shader to Ferr > Lit Textured Vertex Color (4 lights/lightmap + 1 light) but my textures go pink. I've also tested this out in your lighting scene and get the same error. Might you know how to fix it? Thanks for any help!

     
  22. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Hi, thanks! That pink color usually means that the shader isn't compiling correctly. I'm not sure why that shader wouldn't be compiling, but it should have some error messages, could you share those? They should be viewable when you select the shader, or if you re-import it. Also, what platform are you currently compiling for?
     
  23. Terrabite

    Terrabite

    Joined:
    Dec 4, 2013
    Posts:
    77
    Thanks for the quick reply! :) I just re-imported everything and got the same result, but there's no error message in the console. And PC, if that's what you mean by platform.
     
  24. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Ok, cool! And on the shader itself? Shaders will list any errors or warnings that it has additionally in the inspector window when the shader is selected.
     
  25. Terrabite

    Terrabite

    Joined:
    Dec 4, 2013
    Posts:
    77
    Oh, yes! It says "Can't find include file LitCommon.cginc"
     
  26. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Ok, that should be pretty easy to track down then~ LitCommon.cginc and LitColored.shader should both be in "Assets/Ferr/2DTerrain/Shaders/". If they aren't, then it's possible it didn't install correctly, you might want to delete it and re-install! They at the very least should be in the same folders as eachother.
     
  27. Terrabite

    Terrabite

    Joined:
    Dec 4, 2013
    Posts:
    77
    Awesome! It's working now, thank you! :D
     
    koujaku likes this.
  28. Duckling

    Duckling

    Joined:
    May 22, 2013
    Posts:
    5
    Hey I'm having some problems with the fill texture. I've created 2 terrains from the first one I made works fine. Now the new one in the other hand has a weird problem that the fill keeps overlapping the top texture, really weird o_O

    Am I doing something wrong here?
     
  29. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    This is usually a z-order issue! Ferr2D does use different z offset values for each edge on the material and the fill, so please do make sure you review them, and ensure they've got values in the correct order! If that isn't it, let me know, and we'll see what else it might be =D
     
  30. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Hello koujaku, thanks for this awesome asset! Unfortunately I am having a small issue with it. It isn't a huge deal, but it slows down development speed a little bit.

    My project is fairly large. Whenever I apply changes to a prefab, the editor hangs for 20-30 seconds almost every time. It also hangs for the same amount of time after editing a script before it starts to even compile the scripts.

    Whenever I press Play it would hang for a little while too, so I have commented out the playmodeStateChanged line in Ferr2DT_Builder.cs and that fixed that issue.

    I noticed Ferr2D has a cache file, and it has a list of (seemingly) all prefabs in the project twice with a total length of 3127 lines for my project. Maybe that's related to the issue?

    I apologize if something like this has been answered already, I did not look through this entire thread.

    EDIT: Forgot to mention that if I remove Ferr2D from my project, applying changes to my prefabs is almost instant, so I do believe it is Ferr2D causing the issue.
     
    Last edited: Dec 28, 2014
  31. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    Hey @Ninjaxim! Ferr2D does do some weird stuff to try and work well with Unity's prefab system, and unfortunately, it sounds like you've run into a bug with that system!

    My first suggestion is to Assets->Rebuild Ferr2D Component Cache. The list of prefabs you're seeing should only be TerrainMaterials and PathTerrain prefabs, but it sounds like it may be a little overzealous at the moment! Rebuilding that cache might provide some temporary relief.

    Also, if you have that line in the Builder file commented out, and you are using prefab terrain objects, just remember if any of them don't update properly, to Assets->Prebuild Ferr2D Terrain! That'll force the meshes on all the PathTerrain prefabs to update.

    I'll see if I can't hunt that bug down too, hopefully I can find some time for that! I've also got a new system I've been working on for some of this stuff that I'm hoping to integrate with the next version, whenever that may be! Hope that helps some!
     
  32. Duckling

    Duckling

    Joined:
    May 22, 2013
    Posts:
    5
    Hey Koujaku I triple checked the Ferr 2DT_Terrain Material and it still doesn't work. Here are my numbers:

    Z Offset
    Top: 0
    Left: 0.1
    Right: 0.1

    They are the same values as I used in the the other terrain that works in the picture. Any other suggestions?

    *edit*

    Also I should point out that as soon as I edit the terrain in play mode the fill pops behind the edges (Making changes fixes it?)

    *edit2*

    The bug doesnt occur on android, it's on PC side only, dafuq
     
    Last edited: Dec 28, 2014
  33. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ah, rebuilding the cache through the menu did the trick! It now only shows the terrain materials and no longer hangs.

    I'm not saving any terrain objects as prefabs yet so that's the reason I had that line commented out. I can now un-comment it without any issues, the huge cache list was the issue for the play mode hang as well.

    As for the bug, looks like it's caching any newly imported prefabs to the project as well as any prefabs that have changes applied to both the TerrainMaterial and PathTerrain lists. I will be sure to rebuild the cache every now and then to avoid the issue until you are able to fix it. I would try searching for it myself if I had time as well, but I'm sure you'd be able to do it a lot faster anyway.

    Thanks for the help!
     
  34. sstrikerr

    sstrikerr

    Joined:
    Dec 31, 2013
    Posts:
    11
    Hey Koujaku! Unfortunately im running into the image effects problem again :/ soon as i got the ferr lighting to work, the image effects seem to be nonexistent. Could it be the z-buffer?
     
  35. DreamAlp

    DreamAlp

    Joined:
    Dec 4, 2013
    Posts:
    7
    Well that isn't true that it is the first game. We released ours "Light in the Dark" as a soft launch on iOS back in May and full release on Android and iOS in Sept. I would have to say that Ferr2D saved us months of development time. We went into development in January 2014 and soft launched in May with 60 levels. Ferr2D, NGUI and 2DVLS were the major plugins we used that let us focus on game play rather than technology.

    https://itunes.apple.com/us/app/light-in-the-dark/id857454465?mt=8
    https://play.google.com/store/apps/details?id=com.dreamgatestudios.lightinthedark

     
    gOzaru84, koujaku and k3pp like this.
  36. k3pp

    k3pp

    Joined:
    May 2, 2013
    Posts:
    23
    Wow... nice game! I've played some levels of the free version, and the progression rithm is awesome! nice game! nice effects, feedbacks, etc...
     
    DreamAlp likes this.
  37. kmadej

    kmadej

    Joined:
    Jan 8, 2015
    Posts:
    2
    Hey,
    I'm trying to use the wavy shader , everything is ok until I start rotate the object, then the speed of the wave itself increase.
     
  38. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @DreamAlp I only meant that SkyJumper was the first game to use it during development =D I gave him a copy of Ferr2D before it was ever released on the asset store, so he was working on that game for quite a while!

    Also, your game is absolutely fantastic! I've been having a fair bit of fun with it as well =D I'm glad Ferr2D worked out for you~!

    @kmadej The way the wavy shader is currently set up, the waving is based on world position of the vertex. So it's actually traveling through the wave function, making it appear to wave faster. You could switch it to local coordinates, which would certainly eliminate this effect, but the wave direction will rotate with the object. Try it and see if it works any better for you!

    In Ferr/2DTerrain/Shaders/UnlitWavyTransparent.shader, on line 46, change
    Code (csharp):
    1. float4 world      = mul(_Object2World, input.vertex);
    to

    Code (csharp):
    1. float4 world      = input.vertex;
     
    DreamAlp likes this.
  39. kmadej

    kmadej

    Joined:
    Jan 8, 2015
    Posts:
    2
    " float4 world = input.vertex; " - don't work for me :( , nothing has changed

    Grass (green) is parent to Terrein (dark blue) , I'm rotate the terrein using a arrow at the bottom.
    when I press the arrow grass wavy speed go up. ScreenShot001.png


    --Resolved--

    Hi,
    "Position Scale" work OK for me , thank YOu for quick reply.
     
    Last edited: Jan 13, 2015
  40. koujaku

    koujaku

    Joined:
    Aug 28, 2013
    Posts:
    321
    @kmadej, Did the shader compile properly? Could you elaborate a little more exactly what you're trying to do, and what you're seeing? What are you using to rotate the terrain? Is it a consistent rotation, or does it rotate at discreet intervals? Does slowing down the wave speed on the material help any?
     
  41. DreamAlp

    DreamAlp

    Joined:
    Dec 4, 2013
    Posts:
    7
    Ah makes sense. I have a few personal projects that are approaching a Duke Nukem Forever timescale of development :D

    Thanks for playing it. Making the game was the easy part I think. Getting it noticed in the sea of other mobile games is the hardest part I think.

    Alistair
     
  42. claudiusfinnar

    claudiusfinnar

    Joined:
    Jul 2, 2012
    Posts:
    2
    Greetings Nick,

    I have been enjoying Ferr2d and it is making level design much easier and more enjoyable. However, I am attempting to script my character interactions with the terrain and I am unable to have it differentiate between the various colliders, Top, Left, Right and Bottom. Such as grounded while on the Top collider, or climbing while touching the Left or Right colliders.

    At this time is it possible to script my interactions depending on which collider I hit? If so, what is the recommended syntax, if not I'll use another object and tag it differently. However, do you think this capability could be implemented in the future.

    Thank you,

    Nathaniel
     
  43. ncd

    ncd

    Joined:
    Nov 26, 2013
    Posts:
    8
    1.jpg Hello. I am using Unity 4.6.1f1 and I have problems with lightmapping.
    I put some point lights on scene. Set them up like I want and made lightmapping.
    Here is screenshots BEFORE lightmapping and AFTER lightmapping.
    As you can see it is the big different between them. I also get a error after baking lightmap.
    "Unsupported texture format - needs to be ARGB32, RGBA32, BGRA32, RGB24, Alpha8 or DXT"
    Maybe that is why I get different picture before and after lightmapping.

    I wanted to change format or texture and there is just 3 options:
    - Compressed
    - 16 bits
    - Truecolor
    I tried all of them and still get that error.

    How I can change texture to one of needed formats?
    Why I have so big different before and after lightmapping?

    Thank you very much.
     
  44. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Hi,
    you must use in Inspector : Texture Type / Advanced.
     
  45. ncd

    ncd

    Joined:
    Nov 26, 2013
    Posts:
    8
    Thank you, I don't have this error any more. But it didn't fixed a problem. It bakes lightmapping different from what I set up in "Scene".
     
  46. sstrikerr

    sstrikerr

    Joined:
    Dec 31, 2013
    Posts:
    11
    Hey koujaku,

    How can I get the alphas to properly show up when using image effects with any of the ferr lighting shaders? I commented out the "ZWrite Off" like you said before but I'm still getting a problem. I switched to unity's unlit/transparent cutout shader and it comes out the way I want them, is their a way for ferr to do this as well?

    Top is unity unlit, bottom is ferr.

    Thanks

     
  47. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    @koujaku sorry the question i'm a noob about shaders i want put more light on it.. but i don't know how.. i already edit the max_light on shader but don't work everthing goes pink! and another thing.. only the top, side, and bottom parts of the terrain appears on front of the my particles.... but the fill appears behind.... soon i will post a screen to explain!
     
    Last edited: Jan 28, 2015
  48. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Hi @koujaku, quick question here. I am thinking about buying this asset for a game I am currently making but I have a few requirements that I'm not 100% sure are fulfilled by this asset.

    I wasn't sure what type of 2D colliders are generated from this asset. Are they all Edge Colliders or can it also build Polygon Colliders? I need Polygon Colliders in my particular game.

    I was also wondering about Bezier curves. I see that the asset can do curves somewhat but I wasn't sure how flexible it is and what not. Is there a particular video that demonstrates this? I'm also wondering if the curves are reflected in the Colliders (hopefully Polygon Colliders) or if it's just visual. I will need the curves to be reflected in a Polygon Collider.

    I was thinking of sending you an email but I posted it here since I thought others may like to know the answer to these questions. Thanks.
     
  49. iEpic

    iEpic

    Joined:
    Sep 29, 2013
    Posts:
    119
    Hey!
    I've been using your awesome package for about 8 months now and recently I've been getting errors every time I play my scene. I'm not sure what the problem is or why it is doing it.
    I'm like 2 days away from releasing my game so hopefully you will know what the problem is by looking at the errors below. Thanks!

    NullReferenceException: Object reference not set to an instance of an object
    Ferr2DT_PathTerrain.AddFill (Boolean aSkirt) (at Assets/Ferr/2DTerrain/Scripts/Ferr2DT_PathTerrain.cs:820)
    Ferr2DT_PathTerrain.RecreatePath (Boolean aFullUpdate) (at Assets/Ferr/2DTerrain/Scripts/Ferr2DT_PathTerrain.cs:338)
    Ferr2DT_Builder.SaveTerrains () (at Assets/Ferr/2DTerrain/Editor/Ferr2DT_Builder.cs:28)
    Ferr2DT_Builder.StateChanged () (at Assets/Ferr/2DTerrain/Editor/Ferr2DT_Builder.cs:17)
    UnityEditor.EditorApplication.Internal_PlaymodeStateChanged ()
    UnityEditor.Toolbar:OnGUI()
     
  50. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    @Leuthil i can answer you about the collider.. it's generate a polygon collider and you have the option to create your own or not.. with the button "edit collider" so don't worry it's all polygon colider. and about the bezier curves they don't affect only on the images of the terrain but also on the poligon colliders that your are able to edit latter. but if you not shure about it i can show you via skype or maybe on some video showing that.


    i hope this help you.