OpenEd: Open source runtime editor for Unity


Open source runtime editor for Unity

LATEST RELEASE

Documentation, tutorials and useful scripts
Issue tracker
Example project
GitHub repo

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

5 Likes

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.

it says The name ā€˜OGPageā€™ does not denote a valid type (ā€˜not foundā€™).

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.

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!

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 :slight_smile:

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ā€¦

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!

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 :slight_smile:

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.

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 :wink:

i have ngui and others which eventually i was thinking of using one of them

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?

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ā€¦

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.

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 :slight_smile: 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 :slight_smile: Let me know if you run into any trouble, Iā€™ll be glad to help out or add features.

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.

Hey,

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

Just curious :slight_smile:

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.

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?

It would take a lot of time and be completely pointless :smile: 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.

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.

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.