Library Editor: Plugin system


For my game I have created my own file type to store the data and meta data of images.


To create, these files I build a tool using C# and AvaloniaUI. Well I first created it in Visual Studio using WinForms, but I primarily develop on macOS so that was a bit of a problem for me. I then wrote a console app to compile folders into libraries but it didn't have the ability to trim images and yeah... thats was a nother problem for me.

So I looked around for what UI system was compatible corss platform with minimal effort from myself. I looked at GTK, QT and the likes, but building the UI their was was a bit of a pain.

I found AvaloniaUI, and actually find it really easy to use, and it even had a live preview which works well!

But the UI is the least interesting thing to speak of here!

While this application currently has simple functions such as creating libraries, reordering images and to trim white spaces around a PNGs, there is potential to build a lot of functionality into this tool.

Removing META data, EXIF data, maybe I want to change a hue, or saturatin of a library? Who knows? Skys the limit I guess.

But I take issue with massive projects. When I build something for myself it is usually just a tool, something to get the job done and be done with it. I don't want a swiss army knife of unmanagable code, so I had an idea.

The library editor should be a tool to open,  add images, save , and view. Any function relating to modifying the contents of a library should be its own entity. Something which exists to take an open library, do something with it, then die.

So I have two options, either keep packing my application with features, or create a plugin system... So I thought i'd take the easy road, I have created a pluging system for a tool similar in the past... I know what im doing....

Well, this plugin system was started 48 hours ago and I have just finally managed to get the plugins loading and working AND ITS HOT SWAPABLE!
If you know me, and you don't because this blog is private so no one is reading it, then you will know how 'energy efficient' (lazy) I can be when it comes to repetition.
I don't want to be restarting my app everytime i build a new plugin! Silliness!
I guess most plugin systems are hot swapable these days, all I did was attach a system watcher to the plugins folder and if it noticed a change, reload the plugins...

But that doesn't matter now, about an hour into the endevour I had an idea, there was soemthing i wanted to try out, I wanted to see if I could render a PolyArt texture programatically, perfect plugin for the library editor, a plugin which generates textures of a given width and height.

I figures, if I could create 2D map of points, I could use math to generate triangles onto a canvas to make the texture, aslong as I could get it working I could then focus on making edges match to it can be tiled...


Well I got something.... Just not what I expected :P
It is also the 3rd image rendered, I can't find the 1st or 2nd picture I rendered, hehe oops '^_^

[Update, 1 sleep later]

So I got the pluin generating the images and inserting them into the loaded library and I can see how bad my initial attempt at creating a texture is. The intended result was to look more like:

But sadly, after generating a few images, they all appear to be the same with the only ransomisation being the colours.



Back to the IDE for me and try and figure this out.

Comments

Log in with itch.io to leave a comment.

Spoiler alert, I didn't go back and figure it out, i just decided to move on.