Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Migrate to AvaloniaUI #1629

Open
Tracked by #1922
ParadiseFallen opened this issue Mar 12, 2023 · 22 comments
Open
Tracked by #1922

[RFC] Migrate to AvaloniaUI #1629

ParadiseFallen opened this issue Mar 12, 2023 · 22 comments
Labels
enhancement New feature or request

Comments

@ParadiseFallen
Copy link

Is your feature request related to a problem? Please describe.
Right now we have editor only for win platform.
For going crossplat we need to migrate to avalonia or maui
MAUI dosen't fits bc support for linux provide community and not MS devs.

Describe the solution you'd like
MVVM Crossplat RxUI Stride.Editor.

Describe alternatives you've considered
There is also MVU approach but in MVU we CAN'T easily replace views if we need and it will make editor plugins & customization harder to develop.
On the other side MVU MUCH simplier then MVVM.
However, even with all the pros and cons, I tend to favor slightly more development time and flexibility than ease and complexity of extensibility.

Additional context
dunno

Here are some questions that can aid in the description of the feature request:

  • What are the usecases?
    Stride.Editor on MacOS and Linux

  • What kind of options/settings are expected/wanted?
    All what we have in editor RN. we need to made few platform specific services also

  • What would the (pseudo) code look like?
    Well...

  • Is the feature affecting behaviour in the editor?
    50/50. It adds crossplat support. But common behaviour must be same as now

  • Is there a component or datastructure?
    MVVM or MVU. We need to choose solution that will suite for us. Also if we pick MVVM we can write plugins in MVVM/MVU approach

  • what kind of documentation is needed or needs to be updated?
    dunno

  • Should there be an example project?
    no

@ParadiseFallen ParadiseFallen added the enhancement New feature or request label Mar 12, 2023
@Doprez
Copy link
Contributor

Doprez commented Mar 13, 2023

Adding these links here in case they are still relevant to this topic.

Readme created by Eideren that discusses similar points here:
https://gist.github.com/Eideren/6424455fd25f3820bbce6594d67e307b

Useful design doc about the stride Repo that could help clear some things up:
https://gist.github.com/manio143/b6666eedb1403deb5525961697d0c25d

A brief example of how to start from Manio using Avalonia:
https://github.com/manio143/StrideComponentsEditorAvalonia

@manio143
Copy link
Member

manio143 commented Mar 23, 2023

There was a short conversation recently on discord about using Avalonia for the editor - it seems it's doable but currently complicated to get the GPU rendering of the scene embedded directly in the Window as it's currently done with WPF.
One company (closed source) made it work and it looks great: https://blog.jetbrains.com/dotnet/2021/05/10/case-study-how-gritworld-uses-rider-and-avalonia-to-build-a-powerful-3d-engine/
Here's an issue talking some details about it: AvaloniaUI/Avalonia#8199
More discussions with little to no results: AvaloniaUI/Avalonia#5432, AvaloniaUI/Avalonia#7137
And there's a lot of success regarding making a video player with Avalonia: AvaloniaUI/Avalonia#10683

But as I was going through the issues I stumbled over this one: AvaloniaUI/Avalonia#9925
Even with some samples https://github.com/AvaloniaUI/Avalonia/tree/master/samples/GpuInterop

Didn't have too much time to dig deeper and try any of this myself but is seems promising.

@yangguosdxl
Copy link
Contributor

any new progress??

@Doprez
Copy link
Contributor

Doprez commented Mar 25, 2023

Im not sure if anyone actually has a branch but I am looking into it just to see what is possible.

Unfortunately Im a serial multitasker so it is very slow.

Doprez@1048eb4
I did merge the above branch into my fork to see if I can learn from it but no real progress yet, at least for me.

@Doprez
Copy link
Contributor

Doprez commented Mar 27, 2023

Adding some more resources here for embedding stride into alternate frameworks.

https://github.com/Doprez/Awesome-Stride/blob/main/README.md#embeded-stride

@ParadiseFallen
Copy link
Author

@Doprez need to mention it on main page

@Doprez
Copy link
Contributor

Doprez commented Mar 27, 2023

Which is the main page?

@ParadiseFallen
Copy link
Author

@Doprez https://github.com/stride3d/stride/blob/master/README.md

@Eideren
Copy link
Collaborator

Eideren commented Mar 27, 2023

I think it makes far more sense as a page on the wiki

@ParadiseFallen
Copy link
Author

@Eideren just a link in primary readme. not all peoples checks wiki pages

@VaclavElias
Copy link
Contributor

Don't forget we have got also this https://github.com/stride3d/stride/wiki/Community-Projects

@ParadiseFallen
Copy link
Author

@VaclavElias lets merge em then

@Doprez
Copy link
Contributor

Doprez commented Mar 27, 2023

I know for me the only reason I made a personal list was due to a lack of validation. I still need to check that some of the projects on my list work at all (They could either be someones idea that wasnt completed or just an old version that may not work with current stride).

I do want to start adding some of the links from my list into the wiki as I validate but it will be slow.

Another thing I could do is add my list to the main readme under the Community section labelled as "Unofficial list of Stride resources" if that makes sense.

@Eideren @VaclavElias

@VaclavElias
Copy link
Contributor

@Eideren just a link in primary readme. not all peoples checks wiki pages

Generally primary readmy needs to be better interlinked with our wiki. I would like to look into it in the future once I finish web and docs. I guess @Doprez would have seen the existing link and elaborated on that existing wiki page in the first place if he discovered it 🤔🤣.

@Doprez
Copy link
Contributor

Doprez commented Mar 27, 2023

Another benefit of having a repo dedicated or the "awesome-list" is that it can show up on the awesome lists https://github.com/search?q=awesome as a common search.

Eitherway I think its unrelated to this topic for further discussion. Ill create 2 seperate PR's one for the Wiki and one for the main readme and it can be decided then if we want both or just the one.

@Doprez
Copy link
Contributor

Doprez commented Aug 5, 2023

been looking at this again and just wanted to add some interesting findings.
Ryujinx currently has an example of using Opengl AND Vulkan with Avalonia inside of a NativeControlHost. this is the project running Avalonia the default is still using SDL in the main branch.

They have a list of some issues but it seems like some might be specific to Ryuijinx Avalonia Ryujinx issues.

Thats it for now I am taking a peak at how we do the rendering in Stride and it may not be the worst thing to implement as a test for Opengl. I will be tracking it here as I learn wish me luck!

@damian-666
Copy link

the stride editor has docking/ scripting , but all that tabbed is even harder than just sharing a buffer.. which is really hard
combined. Tabbed dialogs deactivate, disposed, nauced etc.
Wtih Avalonia there are 3 OSS choices and this one is in flux..

If we really wanted this Avalonia to replace the WPF of strides IDE ( that has docking and tabs and drag and drop) we would should consider to to pump money towards the gurus to do this.. like that studio did. I I spend 2 weeks + a freelancers 15 hours, on a getting Avalonia.Inside to show a monogame view in a single tab on the Dock git below, using a writable bitmap copy, we failed, I sponsored teh wieslawsoltes/Dock for 20 $ that took him 30 min.: but its really still buggy and difficult.

I do not know React either and there are two wasy of doign Avalonia and he prefers React. once you know it..it's ok

all around.. macs are great but unless they add touch i have to stay with a surface anyway. to do android touch UI dev. Is docking that important.. scripting? i think it is, else you have 2 IDEs. mabye as well just use the VScode .

This seems like a huge undertaking but i would like it..jsut to freshen the look of my WPF netcore 7 IDE at least.. im looking at just putting some in-game , UI for now.. Also im starting to use voice, NLS and AI more , and generative design so im going to wait this out. I do need scripting...

I basically make my own UI on the game itself its so simple. But for editging i would want Avalonia + Dock wiht shared graphcis buffers, tabs, and multiple views maybe.

https://github.com/wieslawsoltes/Dock

https://github.com/AvaloniaUI/Avalonia/tree/master/samples/GpuInterop

@breadnone
Copy link

Chipping in while the cake still hot, considering exposing some the bits and bobs of editors APIs, the goal here is to have a freedom easy to access editor apis to extend OR make our own custom editor native to the engine.

Coming from Unity, I can't stop scratching my head in terms of custom editor in Stride. Just my 2 cents.

@sandsalamand
Copy link

Would it be possible to do this piecemeal? I.e., render Avalonia views on top of WPF, with some barebones interop for a docking system so that they don't overlap?

If this was possible, I think it would offer some massive gains. People could write plugins in Avalonia, and the rest of the engine could be slowly converted, one docked window at a time.

@ParadiseFallen
Copy link
Author

@sandsalamand not sure about partial translation. its diffrent FRAMEWORKS not LIBS. so they have diff init and usage at some places. we need to find a corner cases of usage. ie game scene renderer and others.

@JochnGst
Copy link

Avalonia offers with XPF a Framework to port WPF Applications directly or with minimal adjustments. It would be worth a try to ask them if they would sponsor a licence for the Stide project.

@Kryptos-FR
Copy link
Member

@JochnGst we have started the effort to migrate to Avalonia. XPF would only be a short term solution, while rewriting using Avalonia lets use rethink the architecture to, for instance, designing a better plugin architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests