Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[closed] Why is there no generic mod config GUI?


Recommended Posts

Posted (edited)

Heyo, I'm currently in the process of making a GUI for my mod's configuration options, accessible from "Mods > My Mod > Config" (The whole business of registering an extension point etc). Given the shear number of times poor Diesieben has had to answer the same question of how to achieve this I'd say it's a pretty common query (and why wouldn't it be config is pretty standard stuff).

 

Why is this config GUI not built into Forge? Is there some secret reason I should know about or has simply noone gotten round to it? Maybe just a decision to let modders implement it themselves? But then surely you could still have a generic GUI and provide a hook for modders to edit or replace it if they choose?

 

If my implementation is successful enough and testable I may just put in a pull request on the Forge GitHub to implement this. But it does perplex me why this isn't a thing...

 

All the best to whomever reads this!

 

P.s. Apologies if I have missed something important: it is very late.

Edited by GenElectrovise
Closed.

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

8 hours ago, GenElectrovise said:

Why is this config GUI not built into Forge?

Because it is surprisingly complex to write and maintain a fully generic config GUI code. Nobody has stepped up to provide a stable and maintainable implementation.

Link to comment
Share on other sites

Fair enough seems like a pretty good reason.

 

11 minutes ago, diesieben07 said:

Nobody has stepped up to provide a stable and maintainable implementation.

In this case sounds like it could be more complex than I thought, but if I achieve anything worth sharing I'll put in a pull request.

Thanks!

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

More specifically, we used to have one, but then our rendering guy got stolen by Mojang. And thee cost of updating it everytime they changed something upstream got too  much.

There are mods out there that add generic screens. The main reason there isn't one in Forge is manpower to maintain them in the future.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

 

13 minutes ago, LexManos said:

And thee cost of updating it everytime they changed something upstream got too  much.

If I may ask, what was the bottleneck in updating it? I suppose changes to screen rendering, given you mentioned the rendering guy?

If I'm going to try to implement my own version, I may as well try to target the problem!! 

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

13 hours ago, LexManos said:

The main reason there isn't one in Forge is manpower to maintain them in the future.

What would this mean in this context exactly? (Trying to consider whether this project would be a valuable addition to Forge)

To clarify, does this mean: "any system is too much to maintain, so it's better to just leave it to mod authors"

Or does it mean: "If we had a more maintainable system, it would be a useful addition"

I'm basically asking because if it's the former, then I'll only make a screen for my own mods; if it's the latter, then I'll at least have a shot at implementing it in Forge itself :)

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

Most  likely its the later. But the cost is quite a lot with mojang liking to re-write the rendering system.
Again, there are already a few 'generic config gui' mods  out there that work.
We provide a  fairly simple data layer for defining config objects, so a few  people have taken it  upon themselves to make them into mods.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

Posted (edited)
3 hours ago, LexManos said:

But the cost is quite a lot with mojang liking to re-write the rendering system.

It seems to me that anything that you'd need in order to make the GUI could be accomplished with #drawString or with Widgets. Is maintaining these the cost of which you speak?

After all, a config GUI is just rendering a list of keys and a way to edit each value (either toggles or text widgets), no?

I suppose if you wanted to cut down on maintenance then the first port of call would be to minimise independent calls to volatile 3rd party code (i.e. Minecraft itself).

Perhaps it is not so simple though... If it was I'd think that someone would have gotten there before me?

Edited by GenElectrovise

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

Again people HAVE done this. It's not just draw strings and widgets. Because configs can have a lot of config value types that dont exist in vanilla.
All I can say is just go do it and see what happens.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

35 minutes ago, LexManos said:

Because configs can have a lot of config value types that dont exist in vanilla.

Case in point, my work project. Which is Unity/C#, but the idea is the same.

The Unity inspector is pretty good at finding public/serializable values and showing them in a list in the Inspector gui, but it's layout or labels aren't always the best, and there's only so much you can do with annotations (of which there are several). So for more flexibility, Unity offers both a CustomInspector feature and a CustomPropertyDrawer feature (the former is for Unity-objects that appear in the inspector, the latter for miscellaneous objects that are contained within the former).

However even this is limited to only the things Unity knows how to serialize. Generics? Lists of Interface objects? Abstracts? Not supported.

But my project needed support for generic objects because of how our interaction system (ECS components encapsulating simple finite state objects) and our grading system (did the user perform the following steps in the prescribed order?) had to integrate with each other.

I had a hard requirement to be able to display any object Foo in the inspector, regardless of what Foo's type was. So I had to dig into Unity's inspector code and extract out how it handled all of the types it did handle and rewrite it to accept arbitrary values, that if it didn't match the available types, would use reflection to find all of the object's public/serializable fields and then try to draw all of those, recursing down again and again until a primative type was able to be drawn.

And even with caching to avoid duplicate reflection lookups, it still isn't fast. There's a soft limit of about 20-50 of these inspector drawers that Unity can draw at one time before the lag becomes disruptive. And when you're dealing with complex custom types, the layout isn't pretty. Thus I had to go reimplement Unity's custom editor and custom property drawer system as well.

Which is to say...if it's more than a handful of very simple objects (ints, strings, booleans...) you're going to have to do the work yourself.

  • Thanks 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

7 hours ago, LexManos said:

All I can say is just go do it and see what happens.

Wise advice for many circumstances. Interesting commit also.

 

6 hours ago, Draco18s said:

Case in point, my work project. Which is Unity/C#, but the idea is the same.

The Unity inspector is pretty good at finding public/serializable values and showing them in a list in the Inspector gui, but it's layout or labels aren't always the best, and there's only so much you can do with annotations (of which there are several). So for more flexibility, Unity offers both a CustomInspector feature and a CustomPropertyDrawer feature (the former is for Unity-objects that appear in the inspector, the latter for miscellaneous objects that are contained within the former).

However even this is limited to only the things Unity knows how to serialize. Generics? Lists of Interface objects? Abstracts? Not supported.

But my project needed support for generic objects because of how our interaction system (ECS components encapsulating simple finite state objects) and our grading system (did the user perform the following steps in the prescribed order?) had to integrate with each other.

I had a hard requirement to be able to display any object Foo in the inspector, regardless of what Foo's type was. So I had to dig into Unity's inspector code and extract out how it handled all of the types it did handle and rewrite it to accept arbitrary values, that if it didn't match the available types, would use reflection to find all of the object's public/serializable fields and then try to draw all of those, recursing down again and again until a primative type was able to be drawn.

And even with caching to avoid duplicate reflection lookups, it still isn't fast. There's a soft limit of about 20-50 of these inspector drawers that Unity can draw at one time before the lag becomes disruptive. And when you're dealing with complex custom types, the layout isn't pretty. Thus I had to go reimplement Unity's custom editor and custom property drawer system as well.

Which is to say...if it's more than a handful of very simple objects (ints, strings, booleans...) you're going to have to do the work yourself.

Thank you - this is very comprehensive and I understand the point that LexManos is trying to make now. This is the explanation I've been looking for.

I will now close this thread.

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

  • GenElectrovise changed the title to [closed] Why is there no generic mod config GUI?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.