Search Unity

E2D - free 2D terrain editor and generator

Discussion in 'Assets and Asset Store' started by hardwire, Aug 2, 2011.

  1. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12


    E2D is a tool for editing and generating 2D terrain inside Unity. The terrain is created by clicking the shape with mouse, by using brushes or by using the generator. I created it as part of my thesis, so it's FREE. I was also forced to create a user manual :)

    Download v1.0.0:

    Features:
    • terrain creation node by node using your mouse
    • brushes to move many nodes at once and apply textures
    • waving grass
    • possible to create caves
    • shape generator
    • texture and grass generator (very basic, though :))
    • plastic surface of the terrain (works nice with lights)

    Examples:
    • 2D platformer demo with the "lerpz" character from "2D Platformer Tutorial". It's using dynamic lights. Play.
    • Car on a bumpy terrain with quite large terrain (1500m). Play.


    I probably won't have time to work on this more in the near future, but would like to continue improving this as I'll use it myself. If anyone wants to do any changes feel free to do so :) However, I'd like to know, so that I could update the tool as well. Here's what's missing:
    • mobile support: I got some troubles with the shaders... will have to figure out how to make them work for mobiles or how to simplify them.
    • terrain splitting: right now the terrain surface must be continuous, but I want to make floating islands of dirt.
    • objects painting: it would be great to "paint" predefined objects like stones or trees and they would attach to the terrain and stay even if the surface is changed.
    • more filling textures: right now there is only one. More textures would randomly (noise) blend together.

    Well, let me know what you think and if you would like some particular thing added to the tool.
     
    Last edited: Aug 3, 2011
  2. schipman

    schipman

    Joined:
    Jan 22, 2010
    Posts:
    45
    This is really cool! Thanks for sharing this with the community- I bet many people will find this very useful!
     
  3. junkyardog

    junkyardog

    Joined:
    Feb 20, 2009
    Posts:
    92
    I was looking forward to reading your thesis but it is not available at the link on the doxygen page link.
     
  4. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Oh... well, I'm still fixing the text - the deadline is on Thursday :) I'm not particularly proud of it, but I'll post it here, of course.
     
  5. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Really fantastic man..great work!!!! Love the floating island idea!!
     
    Last edited: Aug 2, 2011
  6. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Awesome, thanks!
     
  7. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    looks cool and has potential to grow into a really nice tool
     
  8. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    I wanted to do something like this back then for my sidescrolling game. Really appreciate it that its free, thanks!
     
  9. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    I added my thesis to the download links.
     
    Last edited: Aug 16, 2011
  10. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Guys is somewhere written what limitations shaders have to make them work on mobile platforms? Do surface shaders work there at all? I couldn't find much about this in the docs.
     
  11. 95KillerZ95

    95KillerZ95

    Joined:
    May 27, 2011
    Posts:
    253
    Woow! Awesome! Thanks for sharing :)
     
  12. rickgude

    rickgude

    Joined:
    Mar 29, 2011
    Posts:
    3
    Wow, this makes my life much easier! Awesome stuff!
     
  13. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    I've had some time to experiment with E2D, and it's awesome! Thank you so much!
     
  14. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Cool, glad to hear that! I definitely want to give it more time in the future; after I'm done with the exams :)
     
  15. Zharzeu

    Zharzeu

    Joined:
    Aug 21, 2011
    Posts:
    4
    This really is awesome! I would love to take advantage of it, if you can get it working on mobiles. :)

    Great work!
     
  16. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Last edited: Aug 26, 2011
  17. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    @hardwire: I just had an idea, do you think its possible to extend your tool so that end users (players) will have access to the terrain editor, so they can make their own levels? Meaning have the e2d editor working during run-time?
     
  18. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Well, the editor uses the Handles and EditorGUI classes which are not available in runtime, so there would have to be a wrapper (which partly is already). Apart from the the terrain data can be modified in runtime without problems (but you probably need to call RebuildAllMeshes and RebuildAllMaterials after that).
     
  19. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    I'll see what I can do when I have the time. I'll make my modifications freely available. You can inspect them and see if you want to integrate them to your official version or not.
     
  20. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Cheers for that! Let me know then.
     
  21. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    166
    We talking FREE as in beer or FREE as in speech?

    We used this at this years GGJ 12 and I'd like to know the terms. If anything, I'd like to make sure my team provides the proper attribution.

    oh and thanks! :)
     
  22. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Free as "do what you want with it" :)
     
  23. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
    Hi hardwire,

    e2D looks fantastic, thanks for sharing it with us. It has such features I need for my own project. However, I would need some guidance:

    I have a prebuild background terrain graphic art done by our artist. We use ex2D to create our 2D world, so this terrain is in atlases. What I would like toachive is to use your node tool to create such curve whic follows the line of our artwork, and then to create the collider, so our caracters cannot cross that line. Can this node tool used for this? I don't need the filling, I need only the nodes and the generated collider. I hope it is feasible.

    Also, when I opened the scene the e2Dterrain prefab does not show you pre-made user interface, it show only the script's variables. What did I wrong?



    Thanks for any advice you may have.
     
  24. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Glad you like it :)

    To disable the rendering part few changes in the code will be needed. I'll take a look at it tomorrow and tell you what to change.

    Regarding the user interface make sure you import the whole e2d.unitypackage file. You should several files under e2d/Editor/ in your project.
     
  25. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    To leave only the collider mesh there editr e2dTerrain.cs. Inside RebuildAllMeshes() comment out everything except
    Code (csharp):
    1. mColliderMesh.RebuildMesh();
    And in RebuildAllMaterials() comment out everything.
    If you don't see any change after you switch back to unity select the Nodes tool and click Rebuild Data.
     
  26. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
    OK, thanks, I will try it as soon as I get back to my Mac.
    Btw, I have imported the full demo package. Then I opened my own scene with my background and then grab the e2Terrain prefab to the scene.

    Another question: what do you think, can I use to colliders? One for the caracters and one for my camera, so the camera would be guided/limited by another set of collider.

    FYI here is my background:


    I want to avoid the case that my camera fall below my background, but I want to let it go a little bit more below than the actual base level of the artwork. I hope it is clear :)
     
  27. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Hm that should work. What version of Unity do you use? I have "3.4 free" now. Can you make me a screenshot of your directory structure? Do you see any error after you drag the prefab there and select the terrain object?

    Regarding the second question maybe the better solution is to access the nodes directly and write a script to control your camera using the nodes. They are stored in e2dTerrain.TerrainCurve.
     
  28. hardwire

    hardwire

    Joined:
    Apr 21, 2010
    Posts:
    12
    Can you link me the game you've created BTW? :)
     
  29. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
    I can send you screenshots later no problem. There was one message earlier: the scripts has not compiled yet, or similar. It was said when I created a new gameboject and tried to add those two scripts manually. I use Unity Pro and the project is opened in Unity iOS Pro.3.4.2 Thanks for the tip regarding the camera. Since this is an underwater 2D scene I want to restrict the camera only at the bottom and at the sides, but it should be freely move upwards until a certain coordinates (sea-surface). My plan is to drag the camera rather than drag the background -- I was told it gives better performance on iDevices.
     
    Last edited: Feb 2, 2012
  30. cram

    cram

    Joined:
    Jan 8, 2012
    Posts:
    21
    this is awesome! thanks!
     
  31. Konrad9

    Konrad9

    Joined:
    Feb 1, 2010
    Posts:
    2
    Getting

    Assets/e2d/Editor/e2dEditorUtils.cs(22,45): error CS0234: The type or namespace name `Tool' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?



    Thoughts?

    Edit: Apparently had forgotten to update to 3.4!
     
    Last edited: Feb 3, 2012
  32. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Thank you so much for this! And thank you for making it opensource. I'm going to learn from this and hopefully I can improve it when I use it with my game :)
     
  33. manavkataria

    manavkataria

    Joined:
    Feb 28, 2012
    Posts:
    4
    Is it possible to destruct the terrain during runtime? Or is this just a static terrain?

    I read your discussion about providing the Terrain Editor API during runtime and I think it would be possible through that. However I still wanted to ask this as there might be other ways which I am not aware of.

    Mighty thanks for making e2d and providing it for free :)
     
  34. teamwhitesnow

    teamwhitesnow

    Joined:
    Nov 12, 2010
    Posts:
    85
    This is a amazing tool! I know it's free but is there any possibility we can donate to help this project keep getting updates and new features?
     
  35. BrendanKZN

    BrendanKZN

    Joined:
    Jun 22, 2011
    Posts:
    157
    Hi, awesome tool, thanks so much for this!
    Having a problem now since I updated my Unity to the latest version.



    Could you possibly assist? Thanks.
     
  36. Jickelsen

    Jickelsen

    Joined:
    May 4, 2012
    Posts:
    2
    Thank you very much for a very useful plugin!
    However we are having problems with the terrain generated by the plugin. Sometimes when our player avatar colliders hit vertices in the level geometry those colliders get stuck. I have attached an image of our poor protagonist's foot stuck to the terrain, and if you have an Xbox 360 USB controller or a PS3 controller with USB cable you can try it yourself at our pre-alpha demo: Pre-alpha build. Use the twin sticks to directly control the legs, and sometimes while hitting surface vertices they will get stuck. Additionally, we can't seem to adjust the _collider object manually as the editor won't let us select it, bouncing back to the parent E2D object instead.

    Has anyone else experienced these issues? Any help would be greatly appreciated as this is a showstopper for us.



    Love from Sweden
    Jacob and the rest of the Jolly Gyro Jaunt team

    Edit: Seems we made a bit of a blunder. There is nothing wrong with E2D, we just didn't have short enough timesteps to handle the collision meshes properly. 0.001 fixed timestep and 0.02 maximum allowed timestep is working fine so far, though it's probably overkill.
     
    Last edited: May 4, 2012
  37. Edebarudo

    Edebarudo

    Joined:
    May 12, 2012
    Posts:
    1
    Hi there!

    Thank you for an excellent plugin, it has been very useful in our project so far.
    I am getting the same error message as Brendan over here, and it started after we implemented E2D.

    Do you know why we get this error?

    Cheers from Sweden,
    Edvard
     
  38. Peterw301

    Peterw301

    Joined:
    Oct 10, 2012
    Posts:
    1
    I think in his script it was ment to delete the _coliders , The _curves , fill and grass that where not attached to the e2d terrain because they where no longer needed in your scene and the errors saying "i failed to delete them Sorry " So delete them manually :) The error is harmless though and does not effect how the e2d works. Hope this helps
     
    Last edited: Feb 21, 2013
  39. sameer-mirza

    sameer-mirza

    Joined:
    Nov 14, 2011
    Posts:
    36
    Hi there, thanks for the amazing tool. I have a question about the car example you've put in the demos. This might not be the right place to ask this question but I'm going ahead anyway :).

    How can I add a springy feel to the wheels ? I've been trying to play with spring joints and such but everything goes haywire :confused:

    Also, you mentioned that the terrain has to be continuous, so does that mean the adding a rope bridge or something like that isn't possible yet?

    Thanks again.
     
  40. DoctorSauce

    DoctorSauce

    Joined:
    Nov 4, 2012
    Posts:
    4
    I could kiss you, but I won't. Thanks a ton for this, this is exactly what I've been looking for!
     
  41. HuskyPanda213

    HuskyPanda213

    Joined:
    Mar 24, 2013
    Posts:
    37
    Dude Thanks!!! Can I use it in my paid for game??
    So useful and its free.
     
  42. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    Hi,
    Have you had a chance to do this yet?...
     
  43. junglejapes

    junglejapes

    Joined:
    Aug 14, 2013
    Posts:
    52
    Hey there, this doesn't work with 2D physics in unity 4.3 I'm not sure why.
     
    Last edited: Nov 29, 2013
  44. onculy

    onculy

    Joined:
    Dec 19, 2013
    Posts:
    2
    Hi,
    I couldn't figure out how to make the terraing a physics2D body? It just renders.
    Can anybody help me?

    Im using latest version 4.3.2
     
  45. DotDream

    DotDream

    Joined:
    Dec 20, 2013
    Posts:
    12
    Well, I do not think that this editor can work with 2D physics. It uses Mesh Colliders to match the shape of the physics body exactly to the shape of the slope, and according to unity's docs: http://docs.unity3d.com/Documentation/Manual/Physics.html it is not possible to use Mesh Colliders with 2D Physics (there is something else called Polygon Collider 2D, with which you can outline a sprite). This is because the two physics engines are different. So, I think the best way would be just to convert any objects that are interacting with the slopes to have 3D colliders (spheres and stuff) and a normal rigid body and use this new body to collide with terrain. All collisions well happen with 2D, just ignore the Z axis. This is a little annoying and less efficient (I would assume) but it allows for accurate movement.

    You could also change the e2DTerrain code to use Polygons instead of a mesh collider to outline the slopes but I dont know how to do that. If someone can do this and post it though, I would love them for life.
     
  46. Tialis

    Tialis

    Joined:
    Nov 9, 2013
    Posts:
    4
    But adding 3D physics for every colliding game object is horribly un-efficient... Is there no other way? Maybe exporting it as an image and importing as a Sprite? Or maybe exporting node position and creating a 2D poligon collider with them? That should be easy, am I right?

    I would do it myself... but I'm not experience enough yet... sorry!
     
  47. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
  48. Tialis

    Tialis

    Joined:
    Nov 9, 2013
    Posts:
    4
    Thank you Kurius, but I am a big friend of the word "free". :)
     
  49. DotDream

    DotDream

    Joined:
    Dec 20, 2013
    Posts:
    12
    Its not terribly inefficient. Unity handles a lot of efficiency and a 2D game shouldnt really take up so much texture memory that the 3D physics will serve as a problem. However, all physics you have already may have to be reprogrammed which might suck. But heyy thats the compromise for free.
     
    Last edited: Jan 13, 2014
  50. Duusty

    Duusty

    Joined:
    May 14, 2013
    Posts:
    56
    Last edited: Jan 13, 2014
    MD_Reptile likes this.