openrpg / OpenRpg.Editor

A simple editor to create content for games using openrpg, can be forked and customised further
MIT License
3 stars 1 forks source link

rzc failed to compile #1

Closed SthanDust closed 3 years ago

SthanDust commented 3 years ago

Hi there! I love this project! I just started using it for my own web based game.

I want to use the editor to do some quick testing, but I cannot get it to compile, no matter what I do on either VS Code or Visual Studio 2019 Enterprise. No big deal, or rush.

grofit commented 3 years ago

I did post a response earlier but I think github lost the plot and it didnt post.

I need to update a lot of this and I think this could be a good candidate to be thrown into MAUI once that comes out as I think thats the direction MS is taking browser front ends in desktop apps, but given the changes to OpenRpg over last few months this will need a large amount of refactoring.

Will see how far I get on it, as I would also like to run it as a web app but then it becomes tricky on how to handle the data loading/saving.

grofit commented 3 years ago

Just to keep you in the loop, I've managed to migrate a large portion of the editor over to the new version of the lib and also moved to use persistity for pipelines to load/save data vs the old approach with loads of data stores and stuff.

This new version will also drop electron and potentially go for maui when the time comes, but for now I'm wrapping the site in a webview, potentially would like to release a Web version too where you just upload/download your data and it stays in local storage or something.

Not sure ETA but hopefully it shouldn't be too long to get it back up and running.

SthanDust commented 3 years ago

I was looking at your libs, and I was wondering if you had thought of using the new C# Record, rather than classes? I was going to try and convert some over as a test.

I mention it because the record will allow you to code the JSON representation right within the record. It can also do quicker compares to see if a record changed. It could also be ideal to store on a blockchain at some point.

I am not going to mess with your libs right now. I am trying to figure the best way to implement the concept of "scriptable objects" like unity, which are basically objects other objects can subscribe to easily to see if something has changed.

Also, your library works very well with Blazor. The game I am working on will be completely a blazor wasm. I want to incorporate items and even characters as NFTs. So I actually wasted the last few days looking at the different token networks.

I'll create a branch on the repository so you can see the record conversions. Its a great addition to C#.

grofit commented 3 years ago

I would need to look into it more, as I am aware they have added records I have not really been coding much since Covid kicked off so am not up to speed on them (or some other C# changes), one thing that I do remember reading about them was that they were meant to be some sort of cross over from functional programming to express immutable data in an easier way than structs. So some bits of data could be seen as immutable like Effects, most of the larger composite objects need to contain references so we only have one instance in memory, i.e a character contains race/class/item templates but only one of them lives in memory and is just shared, if we went to more of a value based approach everything ends up having its own copy of it (which may not be bad at runtime but at editor/design time can cause issues as you cannot ripple changes out and need more updates).

In terms of reactivity INotifyPropertyChanged could be implemented as thats now pretty standard inside C#, there was originally going to be a lot of ReactiveProperty<T> as do a lot of Rx in another library, but the overhead for them is quite costly, especially in most cases the consumer can fire off events to indicate high level changes rather than granular changes, but this being said feel free to submit a proposal with some use cases and it can be considered.

I have an ongoing stream I do where I am using this in Blazor with some other tech (once the core functionality is in place it would go into Unity), this being said I try to avoid logic in monobehaviours and scriptable objects as much as possible as really the only benefit you get from using them is pseudo generation of editors, but in most cases you want more custom editors to do more than just show rough data, and it also makes everything more heavy weight as you are dependent on the view layer (unity) and its no longer just a load of small objects in memory, its larger view bits etc.

grofit commented 3 years ago

This will compile etc now, it is still very much a prototype but it runs ok for managing item/class/race information, as always raise an issue if anything goes wrong, but hopefully will add more to it in the future around changing genres, enemies, loot tables, AI and other things.