stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.51k stars 942 forks source link

Scope based editor window system #2234

Open MechWarrior99 opened 5 months ago

MechWarrior99 commented 5 months ago

Is your feature request related to a problem? Please describe.

In the editor, editing assets have a couple of workflow and implementation issues.

Describe the solution you'd like

Think of each asset type as a "document scope", when a asset is opened its scope is set as the active scope. All relevant windows change to show the data of the asset when its scope is active.

Windows are designed for specific data types and tasks, instead of for specific assets. Such as Outliner, Viewport, Properties, Preview, Blackboard, and so forth.

Windows can specify which scopes they do or don't listen to, or even specific entities (like a lock/freeze). If a window is focused/selected that was set to a scope that is not the active scope, the active scope changes to that one. Updating all windows listening to that newly activated scope.

ScopeChange This allows for having multiple assets open and active at once and easily switch between editing them.

Describe alternatives you've considered

There is also the 'Unreal engine' way, where we have windows that are nested in 'main asset' windows, and opening a asset for editing opens its own window. But this duplicates a lot of windows and is not very screen real-estate friendly.

Additional context

  1. Blender style Workspaces and being able to save and open groups of windows together (save a Viewport, a Bloackboard, and a Preview window set to the Material scope and save it as a "material editor" which can be opened in a new OS window). I think is a feature set that would work extremely well with this proposed window architecture, but is also something that is not core to it.
  2. This proposed system only applies to windows having to do with editing assets of course, so thngs like the Output window would remain unchanged.

Closing

Beyond the obvious issues this solution addresses, it also has the benefit of overall speeding up development and providing nicer UX by default as a whole because any improvement to one window benefits all assets. Such as improving drag and drop in the Outliner would benefit the Scene, UIPage, Skeleton and any other asset that uses it, without 'any' additional work.

With the editor rewrite underway it seemed like a good time to come back and 'formally' write up this proposal. Please give any thoughts on it or ask questions. Thanks.

Eideren commented 5 months ago

So, if you want to open a scene and a prefab alongside, you would have to lock your viewport, lock your outliner, then open a new viewport and outliner, and then open your asset ?

MechWarrior99 commented 5 months ago

If you mean have them both 'open'/loaded for editing, like how we have 'document tabs' now, then no you wouldn't. All open assets would be show in the UI, so they could be switched between easily.

One option would be to show all open assets in the system window bar with the save/build/buold and play/stop/etc. buttons. Header Another option would be to show them in the Outliner, having it act like an accordion control where when you select one it will be set as the active scope and expand to show its content. This is a screenshot from IO Interactive's Glaciar Engine which has a very similar system. image

If you mean editing having windows side by side for the two different assets. You would have to lock one window, then select a different asset scope. The UX for this shouldn't be bad, we could have a button in each window's title bar or even a shortcut (like alt+click on the window title bar) to lock to the current scope.

manio143 commented 5 months ago

I think I would agree on the UX part that if you have multiple asset windows and a single Properties pane, by selecting a different asset window we should update whose properties are shown. This is similar to how in VS clicking on the Solution Explorer shows properties of the files, clicking on an open App.xaml editor shows properties of the app and clicking on a C# file editor shows no properties.

MechWarrior99 commented 5 months ago

So @Eideren and @manio143 I used Figma to throw together this little mockup example of the sort of behaviour I am talking about. In it, you can see the Outliner window on the left has the open assets for editing. In the bottom is a Viewport window that is locked to showing graphics compositors, since one is open, it is being shown there right now.

Clicking on the GraphicsCompositor in the Outliner makes it the active document and updates the windows. Then selecting the MainScene switch back to that one.

https://github.com/stride3d/stride/assets/8076495/e4dd82b1-4511-455b-8e4f-330de8961d76

This isn't the most compelx senario or UI layout, but I hope it demonstrates the workflow of being able to switch between editing different assets quickly while respecting screenspace usage and keeping window implementation to a minimum.