Hi!,
I've been experimenting with integrating the LevelEditor code with an existing engine. So far it's gone very well! I'm hoping to fork the code and build some customised object and manipulator types to suit our needs.
In particular, I'd like to support more top-level "Document" types. It's convenient for us to have many specialised document types, wherein each document contains a separate dom node hierarchy. One document might contain static object placements. Another document might contain nodes with AI data. Another might contain FX data, etc.
So, rather than having a single giant dom hierarchy containing all object types, we would have many smaller dom hierarchies with specialised object types.
I've done some experiments, and the best solution I've found is to implement the IGameDocument interface for each document.
So, eg:
public class PlacementsDocument : DomDocument, IGamePlacement {}
public class AIMarkupDocument : DomDocument, IGamePlacement {}
This allows us to place all documents in the GameDocumentRegistry
. And I've found that is necessary to get the history context working (and some other things, including bounding box rendering in NativeDesignControl
)
But this requires that we also implement IGameObjectFolder
for each document type. And it also means that every object type within must implement IGameObject
(for clients of the GameObjects
property in IGameObjectFolder
-- where otherwise just IListable
, IVisible
& ILockable
were enough).
There are some other problems as well:
- some places assume that objects that implement
IGameDocument
also implement IGame
(eg, NativeDesignControl.TargetGame
and RenderingInterop.m_gameDocumentRegistry_DocumentAdded
).
- when creating a new object, sometimes the code must choose which document to add it to. For example,
NativeDesignControl.OnDragEnter
makes this decision. But it might be helpful to be able to customise how this decision is made -- so objects can be assigned to documents based on type or locality
- some UI controls might work better if they were bound to a specific document. For example, the layer window seems like it should be bound to a specific document. The history window could be bound either way -- either globally, or bound to a single document -- I'm not sure what is best in that case.
I was wondering what your thoughts on this were? Is there an easy path to go about supporting many smaller documents like this?
Is there a roadmap for future work on this LevelEditor? Or any intentions to work on document support for future versions?
Thanks so much