Giter Club home page Giter Club logo

giles's Introduction

giles

A Runtime Level Editor for Unity3D

giles

What is it?

GILES is a runtime level editor for Unity games. It is designed to be completely functional on it's own, but open to extensibility at every opportunity.

Out of the box here's what GILES provides:

  • Selection manager
  • Grid snapping
  • Translate, rotate, and scale handles
  • Scene save / load
    • Levels written to human-readable JSON.
    • Saves all objects in scene via reflection, no additional code required.
    • Writes only state deltas if prefabs are used.
    • Serialization process is customizable with both simple attributes or complete overloading.
  • Undo/redo.

Quick Start

  • Install Unity 2017.1 or greater.
  • In Player Settings, set "API Compatibility Level" to ".NET 2.0"
  • Open GILES project.
  • Open GILES/Example/Level Editor

Contributing

Bug reports should be submitted to the Issues queue on Github. Feature requests should be either posted on the forums or contributed via pull request.

giles's People

Contributors

cedricfarinazzo avatar eitanelbaz avatar gabrielw-us avatar karl- avatar kushagra10025 avatar neoxeno78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

giles's Issues

Non-uniform scale should be the exception rather than the rule

In nearly all common cases it's not what the user wants.

It only makes sense for the simplest shapes. Most shapes becomes distorted. Naive users will use it without thinking and create ugly things. More thoughtful users will be constantly fighting the defaults.

I suggest the scale tool should have a non-uniform mode but the example scenes and default behaviour should be to only allow uniform scaling. Primitives where it makes sense to use non-uniform scaling (spheres, cubes and other simple shapes) should probably have a separate parameter to control their aspect ratio. (although this opens a can of worms in other areas - non-uniform cuboids have stretched textures whereas the user probably intended them to tile)

[Suggestion] Option for only allowing to select root prefab object

Hello once again

I think there are many use cases where the developer would only ever want their users to be able to select the root level editor prefab.

For example, you've created a door level prefab object which contains several child gameobjects which represents the mesh of door. In this case I wouldn't want people using the level editor to be able to move the door handle (for example). There are probably better examples out there :-P

OutOfMemory error while saving

I got this error in the console while trying to save a scene from GILES.
I have a (single) kinda complex prefab, but all submeshes should be fine to serialize.
Is there a way I could work around this error?
I tried to build a 64bits version, but the same error appears.

OutOfMemoryException: Out of memory
System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/StringBuilder.cs:725)
System.Text.StringBuilder.Append (System.Char[] value, Int32 startIndex, Int32 charCount) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/StringBuilder.cs:480)
System.IO.StringWriter.Write (System.Char[] buffer, Int32 index, Int32 count) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StringWriter.cs:142)
Newtonsoft.Json.JsonTextWriter.WriteIndent ()
Newtonsoft.Json.JsonWriter.AutoComplete (JsonToken tokenBeingWritten)
Newtonsoft.Json.JsonWriter.InternalWritePropertyName (System.String name)
Newtonsoft.Json.JsonTextWriter.WritePropertyName (System.String name)
Newtonsoft.Json.Linq.JProperty.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JObject.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JArray.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JProperty.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JObject.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
GILES.Serialization.pb_MeshConverter.WriteObjectJson (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.JsonSerializer serializer) (at Assets/GILES/Code/Classes/Serialization/Converters/pb_MeshConverter.cs:47)
GILES.Serialization.pb_UnityTypeConverter`1[T].WriteJson (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.JsonSerializer serializer) (at Assets/GILES/Code/Classes/Serialization/Converters/pb_UnityTypeConverter.cs:29)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter converter, System.Object value, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary (Newtonsoft.Json.JsonWriter writer, IDictionary values, Newtonsoft.Json.Serialization.JsonDictionaryContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
UnityEngine.EventSystems.EventSystem:Update()

preview prefabs in the Resource Browser window

Hi,

How should I control the preview prefabs in the Resource Browser window?

1/ I add my own prefabs and I see only text in the preview
2/ I copied the stuff from the scene with the Editor to my scene - all prefab previews disappeared in the Resource browser showing different images.

how to control it?

Use Giles in my project

Can I use / modify Giles in my project I am developing in unity? Thanks - of course for commercial purpose.

Suggestion: Make component label name configurable

Hello once again

I just want to say GILES has been an absolute pleasure to use so far.

Anyway... I think developers would prefer not to display class names in the inspector. The screenshot below is an example of what would happen if I attached the 'ExampleCustomScript' component to my game object.

no_attr_example

I don't know if the following suggestion is the best way of doing it, but I've achieved the screenshot below by defining a custom attribute.

with_attr_example

It may also be useful to enable a similar attribute for properties and/or fields. (If you think attributes are the right way of doing it)

How I implemented the example above:

https://github.com/EitanElbaz/giles/commit/941b78df925cfd2be91ae801268e2863e7128c8d

[Features]What I wont to add until the end of 2020.

  1. A new enum inspector
  2. constraints
  3. "Button inspector "
    4.Runtime Terrain editor part 1: Paint, Smooth, Flatten
  4. Runtime Terrain editor part 2: Textures
  5. Runtime Terrain editor part 3: grass, trees, details
  6. Hierarchy Windows
  7. Runtime Prefab creation
  8. Disable child selection
  9. More object inspectors
    Fell free to post your ideas here.

Touch input

Is GILES likely to work with touch input from devices like iPads?

[Feature] allow overriding engine class names in the inspector

Loosely related to #8

Having "UnityEngine.Transform" displayed in the level editor inspector isn't massively pretty.

  1. Do you think we should be able provide overrides for class names we have no control over?
  2. If so, what would be the best way of doing this?

Unsupported code

GILES seems to use some sort of GUI thing that prevents it from working with Unity 2020.1.4f1. :I

Textures missing

Hi
When i exported scene with textures, only meshes are exported, and when i omported that .json, only meshes imported and not the textures of those meshes. suggest me how to export textures also. Or is it not possible?

Thanks.
Saravanan.M

Huge File Sizes

Hello once again

GILES has been awesome to work with so far.

I have however been noticing that the sheer amount of data being generated when saving a level is absolutely enormous.

A level with 10 or so objects will often exceed 10MB of pure JSON data.

Parsing a large amount of JSON and instantiating all of the objects at once also causes quite a lag spike as you might imagine :P

UnassignedReferenceException when Child objects have components with unassigned Transform

To recreate this open up Giles and make a .cs script like this:

public class DummyInspector : MonoBehaviour { public Transform DummyTransform; }

Create a prefab that is an empty parent object with a child object. The child object must have the DummyInspector.cs component.

Drag the parent object into Resources/LevelEditorPrefabs to create a prefab. If you try to save a Giles level with this object instantiated it'll throw a UnassignedReferenceException. Full stack trace would be something like this:

UnityEngine.UnassignedReferenceException: The variable theTransform of DummyTransform has not been assigned. You probably need to assign the theTransform variable of the DummyTransform script in the inspector. at (wrapper managed-to-native) UnityEngine.Transform:get_childCount () at UnityEngine.Transform+Enumerator.MoveNext () [0x00007] in C:\buildslave\unity\build\artifacts\generated\common\runtime\TransformBindings.gen.cs:448 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter writer, IEnumerable values, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00108] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:684 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x000fe] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:179 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary (Newtonsoft.Json.JsonWriter writer, IDictionary values, Newtonsoft.Json.Serialization.JsonDictionaryContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00176] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:1091 UnityEngine.Debug:LogError(Object) GILES.pb_Scene:SaveLevel() (at Assets/Lib Assets/GILES/Code/Scripts/pb_Scene.cs:151) GILES.pb_SaveSceneButton:Save(String) (at Assets/Lib Assets/GILES/Code/Scripts/GUI/Toolbar/pb_SaveSceneButton.cs:61) GILES.pb_SaveSceneButton:OnSave(String) (at Assets/Lib Assets/GILES/Code/Scripts/GUI/Toolbar/pb_SaveSceneButton.cs:35) GILES.Interface.pb_FileDialog:Save() (at Assets/Lib Assets/GILES/Code/Scripts/GUI/pb_FileDialog.cs:266) UnityEngine.EventSystems.EventSystem:Update()

When json is trying to serialize all the components it tries to serialize Transform/GameObject references that might be public in the inspector. Even though the values are null JSON evaluates them as not null.

Also, if you make the Child object a prefab then create a new Parent/Child prefab with the first prefab you won't get this error.

ObjectRaycast distance algorithm does not scale back

pb_HandleUtility.ObjectRaycast returns normally the closest object hit by the ray. However, when using MeshRaycast, it transfers the ray to local coordinates, and then return the "local computed distance". When using scaling, this can end up to wrong object selection. The distance must be scaled back to a common base (global coordinates, or percentage) before being compared to other distance.

Here the code to scale back to global

public static bool MeshRaycast(Mesh mesh, Ray ray, out pb_RaycastHit hit, Transform transform)
{
...
if(pb_Geometry.RayIntersectsTriangle(ray, a, b, c, Culling.Front, out dist, out point))
				{
					hit = new pb_RaycastHit();
					hit.point = point;
					hit.distance = Vector3.Distance(transform.TransformPoint(hit.point), transform.TransformPoint(ray.origin));
					hit.normal = Vector3.Cross(b-a, c-a);
					hit.triangle = new int[] { triangles[i], triangles[i+1], triangles[i+2] };
					return true;
...
}

I think you could return distance as a percentage too, so you wouldn't need to pass the transform to the function. However it means that your ray have a certain defined length, which is usually not the case.

No resource preview for embeded game objects

I don't know if you're aware of the following issue or not, so I thought I'd mention it.

Imagine the following hierachy:

GameObject (empty game object)
Cube (3D Object -> Cube)

The Resource Browser will not show a preview of the prefab, it will only show the name of the prefab instead.

Would it be technically possible to provide a preview of the Prefab and all of its child game objects?

InvalidOperationException: Current error context error is different to requested error.

I've been using Giles and the "Play Custom Map" will seemingly randomly spit out this error when loading a particular level. This level would load fine just 5 minutes ago.

InvalidOperationException: Current error context error is different to requested error. Newtonsoft.Json.Serialization.JsonSerializerInternalBase.GetErrorContext (System.Object currentObject, System.Object member, System.String path, System.Exception error) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:93) Newtonsoft.Json.Serialization.JsonSerializerInternalBase.IsErrorHandled (System.Object currentObject, Newtonsoft.Json.Serialization.JsonContract contract, System.Object keyValue, IJsonLineInfo lineInfo, System.String path, System.Exception ex) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:111) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:182) Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:823) Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:802) Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:865) Newtonsoft.Json.JsonConvert.DeserializeObject[pb_SceneNode] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:822) GILES.pb_Scene.LoadLevel (System.String levelJson) (at Assets/Lib Assets/GILES/Code/Scripts/pb_Scene.cs:157) GILES.Example.pb_SceneLoader.OnLevelWasLoaded (Int32 i) (at Assets/Lib Assets/GILES/Code/Scripts/pb_SceneLoader.cs:47)

I've loaded levels and they usually work fine. Minutes later some levels start spitting out this error. I've tried making duplicates of the .json files to see if the .json file is corrupted somehow but the json file is identical. Remaking the file from scratch always fixes the problem temporarily.

I've pulled the Unity Json project from https://github.com/SaladLab/Json.Net.Unity3D and built my own .dll and .pdb files so I can look deeper into what's going on. Inside json it throws the exception basically at this line https://github.com/SaladLab/Json.Net.Unity3D/blob/master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs#L182. The exception has a stacktrace of this:
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0012c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x0000e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77 at Newtonsoft.Json.Utilities.LateBoundReflectionDelegateFactory+<>c__DisplayClass3_0.<CreateParameterizedConstructor>b__0 (System.Object[] a) [0x00003] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Utilities\\LateBoundReflectionDelegateFactory.cs:59 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonISerializableContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00197] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:1746 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00410] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:587 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0007c] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:293 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x000a6] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:167

So now I'm not sure if it's because I'm using procore meshes as prefabs, prefabs with children, or json is invoking a method that doesn't exist.

Improving the resource browser

Hello

I don't know if you have anything in mind for doing this, but I have a very rough (and unrefined) idea of how this may be done.

Firstly, I think it would be extremely handy and desirable to many users of GILES to be able to split level editor prefabs into different categories.

The basic models (catchier names required :-|):

Resource Browser:

Category[] categories;

Category:

string name;
LevelEditorPrefab[] prefabs;

Level Editor Prefab:
string name;
GameObject prefab;

I'm not much of a GUI designer, but to accommodate for categories and their editor prefabs, the current resource browser could contain a list of the collapsible/expandable GUI elements.

Common use case:

Let's take the original GILES preview video as an example.

Someone is making an FPS game which allows people to create their own maps. They want the following example categories to make it easier for their players to find level editor prefabs:

  • Walls
  • Decoration
  • Weapon Spawns
  • Buffs
  • Player Spawn locations

This categorization of level editor objects is something I'll be looking at doing for my own game, so I'd be happy to write it in a non specific way and contribute it to this project if that's something you're interested in. You'd probably want to tidy the code up if it's not up to your standards thoug

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.