[1.2] Better Workbench Management (QoL mod)

Started by falconne, May 30, 2017, 06:16:40 AM

Previous topic - Next topic

aleido58


I'm giving this a try, an awesome proyect overall btw.
Maybe I'm doing something wrong but the -1/+1 buttons to "fine bill resume level", only appears on bills that uses the "counted items filters"?
For example if I set up a bill for some meals I don't have those buttons, but if I set up a bill for a T-Shit I have them.
The "Restrict to" button appear always. And the configs seem to work ok.
So far is the only thing I've noticed.
Btw it would be great if the bills could be copied/exported to other benches.
With JTExport you can export/import the bills but not your mods configs... I don't know which mod should handle that, I imagine JTExport since that mod is which saves the bills.

Sorry for my crappy english...

falconne

Quote from: aleido58 on June 11, 2017, 02:18:18 PM
the -1/+1 buttons to "fine bill resume level", only appears on bills that uses the "counted items filters"?
Oh yeah, thanks, I'll fix that.

I'll look into JTExport and see what can be done about exporting.

Fluffy (l2032)

While I like the idea ( I was, in fact, going to do something very similar, to replace the functionality I removed from Colony Manager ), I have to say I really don't care for your implementation.

Subclassing Bill_Production and replacing vanilla instances with your subclass is destructive. It's basically a big f-you to other mods, as there's only one mod that can do that trick at the same time, case-in-point being your incompatibility with Enhanced Crafting. In my opinion, a much better approach would be to implement an 'external' tracking component that keeps a dictionary of bills together with the additional data you need for each bill. That would leave the bills themselves intact, and as an added bonus - allow the save game to be used after removing your mod, as the extra stored data is not intertwined with the bills themselves, but stored as a map/gamecomponent.

falconne

#18
I made this mod by basing it on Enhanced Crafting as this is my first mod and I needed a framework to start with. This is how that mod does it. In fact, that mod overrides everything so it won't be compatible with any other mod that wants to work with bills. Mine at least uses the new Harmony library so it goes someway towards coexistence (most functionality is added through prefix and postfix patches rather than subclassing... but this knowledge didn't exist when Enhanced Crafting was created). The only mods this is incompatible with are others that also subclass Bill_Production and that's not a "big f-you" to anything as they are all in the same bucket.

The save games are not dependent on either of the mods though, as the load functionality is just going to ignore data in the save file that it isn't told to load, so you can safely load them without the mods.

I have thought about future compatibility and I also decided a separate dictionary to track extra bill data is the best way. I also think this and the Enhanced Crafting mod should be combined into one (because no matter what I do I can't make this compatible with that mod, as it overrides all the vanilla classes that I need to hook into). A dictionary has to be done carefully though, as it could easily go out of sync if there is any bug in the mod, so it's along term goal.

Fluffy (l2032)

I may have come across harsher than intended. I didn't mean to single out your mod, I'm equally annoyed with Enhanced Crafting - but since that has been without its original author for a while, I didn't really have a place to complain. I do still think this is an 'f-you' to other mods, the fact that Enhanced Crafting creates the same problem doesn't make it any less of a problem.

As for the save games, have you tested that? I'm not convinced it would work quite so simply, also because they would be saved with an additional class="MySubClass" attribute?

I'm glad you're moving towards an external tracker, it'll be much better for everyone in the end.

aleido58

First of all, I'm not programmer/modder or anything to take my word into account.
My testing is only "playing" with the options save-loading, etc...
Is not very save friendly if you left a bill in any workbench, meaning that the save will load but bills will be messed up.
If you get rid of ALL the bills, save the game, remove the mod, and load that save everything seems to work just fine.
Sorry for intruding in your posts...

DariusWolfe

As requested, I tried to play around with this a bit yesterday, regarding the newer features; I didn't have any installed art on my newest colony, but otherwise the new features seemed to be working fine; I wasn't able to play very long due to family commitments, but I'll probably get a chance tonight to do some more in-depth;

For the most part I haven't really needed to mess with assigning specific colonists to craft; I've always used skill-filters, and that works for me, as I don't really care who does it so long as they have the requisite skill level. (Not saying I think this feature is useless, just haven't had a lot of reason to use it myself).

The material-filter feature is excellent, and while I don't have a use for it yet, I definitely will once I'm past the point of just getting any sort of non-crappy clothing on my damned pawns. It will be nice to ensure that there's always a stock of sufficient quality clothing with the right materials for best results, when my colony gets a bit more mature.

SpaceDorf

Quote from: DariusWolfe on June 12, 2017, 01:34:33 PM
For the most part I haven't really needed to mess with assigning specific colonists to craft; I've always used skill-filters, and that works for me, as I don't really care who does it so long as they have the requisite skill level. (Not saying I think this feature is useless, just haven't had a lot of reason to use it myself).

The material-filter feature is excellent, and while I don't have a use for it yet, I definitely will once I'm past the point of just getting any sort of non-crappy clothing on my damned pawns. It will be nice to ensure that there's always a stock of sufficient quality clothing with the right materials for best results, when my colony gets a bit more mature.

Just from reading I agree with you.

Though I don't use the specific Pawn assignment very often it is damn useful to convince Pawn McLazyCrafter to finish the damn coat he started in '02 while the 10 other coats where done by someone else.
Since do_until enables several workbenches

The Material Filter is great to finally seperate Trade Goods from Colony Goods .. if this feature only was available for stockpiles and outfits ..


And I never noticed this silent incompabily .. this actually explains some things :-D
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

falconne

Quote from: aleido58 on June 12, 2017, 01:21:04 PM
First of all, I'm not programmer/modder or anything to take my word into account.
My testing is only "playing" with the options save-loading, etc...
Is not very save friendly if you left a bill in any workbench, meaning that the save will load but bills will be messed up.
If you get rid of ALL the bills, save the game, remove the mod, and load that save everything seems to work just fine.
Sorry for intruding in your posts...

Hmm... when you say "messed up" what behaviour were you seeing? If you're loading a save with this mod enabled for the first time, then what you should see is existing bills, just as they are, without any of the filters this mod adds. The mod's filters will only take effect on new bills you add after loading it (at least until I do some refactoring of how it stores data), but existing bills shouldn't be broken. If you are loading a save containing the original version of my mod and trying it with the newest version, everything should just work.

Let me know if you noticed any specific behaviour that doesn't match the above.

Quote from: Fluffy (l2032) on June 12, 2017, 08:08:26 AM
As for the save games, have you tested that? I'm not convinced it would work quite so simply, also because they would be saved with an additional class="MySubClass" attribute?

Good point, I hadn't thought of that. Presumably that would also throw an error if I made a separate dictionary with my own persistent objects (though the error will be inconsequential then). I expect the solution to that is to use HugsLib's "World Data Storage" functionality.


aleido58


I think I have explain myself badly.

You can add your mod to any save without issues. The issue is if you want to remove your mod from an existing save and you left bills in the worbenches.

At least for me, if I have a bill set-up (butchers table for example) remove your mod and load that save when I try to add new bills the options to butcher creature, etc didn't show up (or sometimes showed up in a wrong place of the window)... and the help if you have it enabled (right top corner) greys out.
I made those test, in one save with only core and hugslib, and with another save with +30 mods.

If you remove all those bills from all worbenches you can remove your mod (not that i want to works as intented for me, I did those test because you asked us to try the mod before you put it on steam) without issues.

Maybe if that is a thing and if it's not only me, you should put that in the "notes" section of your mod to "show" people how to safely remove the mod.


falconne

Ah yeah, that's expected, as Fluffy pointed out above. I need to refactor the mod to be able to safely remove it and still load the save without extra work. I'll make a note of that in the description, for people who want to remove the mod from a save. Thanks for the extensive testing.

For now I am only concerned about not breaking save compatibility for people using the first version of my mod. That's why I didn't want to update the version on the Steam Workshop right away; I wanted to get confirmation from a few people that they could upgrade without problems, which appears to be the case. I'll update Steam shortly.

DariusWolfe

Quote from: falconne on June 13, 2017, 07:10:04 AM
For now I am only concerned about not breaking save compatibility for people using the first version of my mod. That's why I didn't want to update the version on the Steam Workshop right away; I wanted to get confirmation from a few people that they could upgrade without problems, which appears to be the case. I'll update Steam shortly.

Oh yeah, zero problems there.

wwWraith

Voting up for the ability to rename the bills. It would be very useful when trying to manage some situations in queues, for example, preferring vegetarian/meat food sources, and smelting weapons or reclaiming fabrics in several various groups.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

falconne

#28


I have a new update with some new features that I'd appreciate some play testing and feedback on before I update on the Steam Workshop, if you guys have time.

As before, it's save compatible both on fresh saves and ones with a previous version of the mod. The new version uses a new data storage format to be more independent from the base game's code; the mod will automatically port the old format data from your saves.

It would be good if you could have dev mode turned on so if you do get an error in the log it will tell you. Please keep a copy of your save from before applying the update.

Thanks for everyone who tested

Updates:



  • Bills can now be copied and pasted within and between compatible workbenches. This can be done one at a time or you can copy all the bills in a workbench and paste them all at once. New buttons will appear in the Bills tab UI for this.


  • When pasting bills you can "Paste Link", which links the bills back to their originals. Any changes made to a linked bill will be mirrored to all bills in the chain. Links can be made across workbenches and can be broken manually later.


  • When a workbench is selected, its Bills tab will automatically open. This can be disabled in the Mod Settings menu.


  • Bills can now be renamed from the Details pane, like in Enhanced Crafting.


Note about copy/paste: when a bill is copied only a reference to the copied bill is made at the time. No data copy is done until you paste, so if you change the original bill before pasting, the pasted bill will have the modified data. If you delete a copied bill, it will be removed from the "clipboard" too.



XeoNovaDan

This mod definitely looks like a must-have, thank you!