Search Unity

OpenEd: Open source runtime editor for Unity

Discussion in 'Works In Progress - Archive' started by mrzapp, May 24, 2014.

  1. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137

    What?
    This is a plugin for building level editors for Unity games. It lends a few design choices from the Unity editor itself, but has some more tricks up its sleeve. I am developing this in tandem with my Deus Ex-based game project The Vongott Chronicles. Its backbone is made up of other plugins (OpenFile OpenGUI), so they will be required to use OpenEd.

    Participate
    • Any help, including feature requests and error reports, is much appreciated.
    • I happily add collaborators on GitHub, so don't be shy.

    Video demo

    coming soon

    Screenshots
    Faded, "infinite" grid


    Full nested object serialization


    Prefab browser


    File browser


    Custom inspectors
     
    Last edited: May 24, 2014
  2. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    That's looking real neat, will download and investigate further. Haven't gotten far on my level editor yet, so I might just adopt this.
     
  3. taichiu727magnus

    taichiu727magnus

    Joined:
    Sep 16, 2013
    Posts:
    144
    it says The name 'OGPage' does not denote a valid type ('not found').
     
  4. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Please download the example project for a working scenario. OGPage is from OpenGUI, one of its dependencies.

    I have yet to write tutorials for this, as the system is rather involved, but let me know if you have any more problems.
     
  5. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    amazing work you've done!


    when i go to npc prefabs im getting

    ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame.
    UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32)
    OEPreviewCamera:TakeScreenshot() (at Assets/Plugins/OpenEd/Scripts/OEPreviewCamera.js:102)
    OEPreviewCamera:Update() (at Assets/Plugins/OpenEd/Scripts/OEPreviewCamera.js:115)


    also how do i add my own prefabs so that they show up?


    thanks in advance and have a good one!
     
    Last edited: May 25, 2014
  6. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Thanks!

    The ReadPixels error I am not getting myself, but that error should come from the code being executed before the frame has ended. That shouldn't happen, I'll look into that. Although it shouldn't change the visible outcome in any case.

    To create more prefabs, place them in the Resources/Prefabs/NPCs folder, and make sure they are serializable by attaching an OFSerializedObject component to them. The directory structure is defined in an OEPrefabsDrawer object. You can create your own and attach it in the UI (in the hierarchy under UI/Home/Toolbar > "Drawer Types"). Look at the /Plugins/OpenEd/Drawers/OEPrefabsDrawer object for an example.

    Sounds like I should really get started on those tutorials :)
     
  7. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    no hurry, i wrote my own level editor for the game i've been working on and was just playing around...

    the reason that i went to all the effort is that i was hoping to add steam workshop support to my game so anyone who gets my game and wanted to could make their own maps and share them with others.

    too bad i wasn't aware about your project cause its taken a good bit of time and effort to get it done that i could have focused on my game, but i dont think that it would not be easy at this point for me to abandon the one i did and switch to yours, however tempting...

    $levelbuilder.png

    as you can see i still have to go back and polish the ui, but all the functionality is there.

    i was thinking of removing as much of the ui as possible. so basically all the panels you see would be gone except for maybe the menu bar, toolbar and prefab selection panel. so that all the the users could really do is select a prefab from a predefined list of prefabs that ive setup, place the selected prefab on the map, move it around, rotate it, scale it and delete it. that way the user interface is very minimal. that way the users would not need to understand much more than they already do from playing a first person shooter. so they would not need to know the name, location, rotation, scale values for all the objects in the map. and it all gets stored in an xml files that they could share on steam workshop.

    cheers and best of luck!
     
    Last edited: May 26, 2014
  8. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Yeah, it's a bit of work, definitely. I started building an ad hoc level editor for my game about a year ago, and tried to make it as simple as possible as well, but it just couldn't really be too simple when I wanted actors, conversation trees, triggers, audio sources and all kinds of other magic in there.

    OpenEd is written from scratch, but based on the experience I accumulated making the other editor. So this code written in a few weeks essentially replaced several months of work. Software development is weird sometimes :)

    It's meant to be very general purpose and customisable, so if there is anything I can do to meet more of your needs, I'd be happy to look into it. Your editor looks interesting too, I'd be cool to merge your ideas with this project.

    Another note: If you end up sticking with your own, I recommed using JSON instead of XML, it parses faster.
     
    Last edited: May 26, 2014
  9. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    i also started about a year ago licensing and building.


    re: using opened

    that may take a bit of work since i already have the one i did and sort of using it for my game.

    plus i have all my stuff in c# and a very long list of components and inspectors ive done like u see would be pain to redo and would set me back...


    re: xml

    i'm using xml right now cause i can easily verify that its correct and quickly catch and fix problems and upgrade existing maps in a text editor by hand as i add things and make changes, but eventually i'll use whatever works best with steam workshop

    so im not so concerned about format other than what steam would use ive tested it with large number of objects and the file size and time it takes to save and load is very fast so its nothing i was too concerned about.

    plus i save very little since i really dont fully serialize the prefabs. so its like id, position, rotation, scale and prefab specific settings which are very small like for ambient light there is like color which is like 4 ubytes.

    and anyways i was thinking of switching the reader/writers to use binary format and then it would be bunch of ints and floats since nobody will be directly editing the maps they people would probably not even be storing them locally but on steam workshop


    re: ui

    right now its using unity right now since its easy and lets me focus on functionality, you can see i put little effort into the ui check the giant big "X" buttons used to close the panels ;)

    i have ngui and others which eventually i was thinking of using one of them
     
    Last edited: May 26, 2014
  10. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Seems cool, but I'm wondering what advantages this has to just doing this stuff within regular old unity... Are there tiling or grid snapping tools that help with level prototyping? Does the file browser access only the project assets folder or the entire machine? Does it use regular unity prefabs? Can it make my game for me?
     
  11. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    basically im using one to allow people who play my game to create their own maps without me having to give them direct access to the assets that my game uses...
     
  12. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Oh I got ya, so these are in-game level editors. Very cool then. I will check this out later. Seems obvious now lol, no more late night posts for me.
     
  13. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Example project now includes C# examples for serialization code and custom inspectors! I know most of you use C#, so I thought this was in order.

    Fair enough, although you can totally use C# with this, as mentioned above :) You can take a look at the example, custom inspectors are much easier to write with this framework than the native Unity one. It has a few limitations by comparison, but they can be worked out.

    I find NGUI extremely bloated and buggy, the demonic "depth" parameter being a prime example, which is why i did OpenGUI in the first place. The problem with NGUI, I think, is that because it's such an expensive asset, the developer couldn't revise his code beyond something that was at least 90% backwards compatible, which means that really early design decisions are biting him in the ass now. A complete rewrite of NGUI with all of his accumulated knowledge is really what's needed, IMO.

    Haha, no problem, mate :) Let me know if you run into any trouble, I'll be glad to help out or add features.
     
  14. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    UPDATE!

    Via OpenFile, it is now possible to serialise project assets, for instance if you want to link an AudioClip to an AudioSource. The clip can either be a pre-compiled resource or part of a zipped folder that I call a "bundle". Download the exmaple project for a demonstration.
     
  15. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey,

    Just a question / suggestion - Do you intend to add a terrain to OpenEd?

    Just curious :)
     
  16. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Hmm, well I don't have a need for it in my own project, so it hasn't been on the roadmap. The philosophy is generally that you'd import a map from an external editor (you can do that as an end-user as well), and then place interactive objects in the scene with the editor. I am quite familiar with mesh weaving in Unity, and I've experimented with boolean operations for this editor too, but it would be a long-term goal at best.
     
  17. JamesPro

    JamesPro

    Joined:
    Mar 5, 2012
    Posts:
    509
    Is the whole Editor coded in JavaScript? How hard would it be to copy it over to C# so it could be networked and used as a In Client World Editor for a MMO Engine?
     
  18. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    It would take a lot of time and be completely pointless :D UnityScript and C# interface just fine, as long as you take into account the Unity compile order. In other words, it will work with your C# code as long as your script files are in a subfolder of your root, e.g. /Scripts

    I'll update the documentation to demonstrate this when I get the time.
     
  19. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Would this be hard to update for Unity 5?

    I've tried opening this in Unity 5, and I've fixed a few of the "Non-serialized" errors, but I'm still receiving a huge amount of "missing OG" errors. I don't know what OG is a prefix for, but it seems like you're missing an entire "OG" system in your latest package, or a few "OGXXX" scripts perhaps.

    Here is one error example:
    "Assets/Plugins/OpenEd/Drawers/OEHierarchyDrawer.js(8,60): BCE0018: The name 'OGListItem' does not denote a valid type ('not found'). "

    Any chance you could either update it to work with Unity 5, or let me know if you might be missing a folder or two in your latest commit?

    Maybe it works but I'm just missing where all of this OG stuff is at?

    Thanks for any help.
     
  20. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    Hey,

    OG stands for OpenGUI, another one of my plugins. Unfortunately, I have moved to the Unreal Engine entirely, and my work on these plugins has come to a complete halt. If you find this useful, you are very welcome to further maintain the project, I can make you a contributor on GitHub or you can fork the repo.
     
  21. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hi, thanks for the reply. So, if I download and import your OpenGUI plugin, it should technically get rid of most of the errors then in OpenEd?

    If it's an error related purely to upgrading to Unity 5 (such as syntax), I could probably fix it. But now that I know your OpenEd looks for OpenGUI files as well, I can try to make them work. Does OpenEd try to use any of your other plugins as well?

    Thank you.


    *** Nevermind I just read the opening paragraph on your first post where you state it uses other plugins lol. I see it uses OpenFile as well :rolleyes: Sorry for your trouble. Thank you.

    I do have one other question though. Lets say I give this to one of my artists on the dev team, and they make a map with OpenEd. Could they save the map they created, and then I could open that map in the Unity editor itself?
     
    Last edited: Apr 21, 2015
  22. mrzapp

    mrzapp

    Joined:
    May 26, 2013
    Posts:
    137
    I tried to reverse engineer the YAML format of the Unity maps, but I couldn't make it happen. The format this utility uses is a standard JSON structure. The upside to that is that your developers can expand on it any way they like, giving capabilities to the editor as they see fit.

    This editor is however one of the reasons I left Unity, it's a huge effort just to make your game moddable. I assume that's why you want to use OpenEd. If you are only doing in-house map editing anyway, I'd actually recommend against using it and just write custom inspectors for your designers.
     
  23. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I see. Okay thank you very much. I was actually looking at it for "in-house" map editing essentially, in order to allow an artist to build a map/level for me, but to NOT have to allow that artist access to my code. Then once the artist builds/creates the map, he could send it to me, and I could open it in the Unity editor.

    Sounds like this is very hard to do. So, like you said, I will probably have to teach the artist how to use Unity to a certain extent, and provide them with tools in the editor.

    Thank you!
     
  24. RoboTiberius

    RoboTiberius

    Joined:
    Mar 9, 2019
    Posts:
    1
    What is the Ofplugin