Ludeon Forums

RimWorld => Mods => Unfinished => Topic started by: XeoNovaDan on September 30, 2018, 01:37:35 PM

Title: [Finished] [1.0] Survival Tools
Post by: XeoNovaDan on September 30, 2018, 01:37:35 PM
This mod has now been completed and can be found on...
Ludeon: https://ludeon.com/forums/index.php?topic=29503.msg445544#msg445544
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1566269698

Thanks to everybody for playtesting and providing feedback and bug reports!




Hey, so this has been a mod I've been working on-and-off with for the past few weeks but found the motivation to put a playable version together. While I've enjoyed the concept of a tool mod, there isn't a single tool mod out there that cuts it for my taste so I've decided to take things into my own hands and get something going. I'm no stranger to the modding scene, but this is my first time actually taking the public test approach, so this is something new for me.

I have somewhat white box tested this so there shouldn't be any major bugs as it stands. That being said, this has only been tested with Pick Up & Haul; the game was otherwise completely vanilla while whiteboxing. There shouldn't be any incompatibilities though. This should work with existing saves, but I'd highly recommend this with a new save.

Links
GitHub Releases Page (https://github.com/XeoNovaDan/SurvivalTools/releases) (downloads)
Source Code (https://github.com/XeoNovaDan/SurvivalTools)


I highly recommend using tammybee's Cut Plants Before Building (Dropbox (https://www.dropbox.com/sh/z3czwl5d7l0cqcd/AADpUgIRopahoG8WgCOY_Pb2a) / Steam (https://steamcommunity.com/sharedfiles/filedetails/?id=1232208162)) because that auto-designates certain plants and trees to be cut by plant cutters, which helps when you have constructors without axes who'd otherwise take a long time to chop down trees that are in the way of their blueprints.

Screenshots (RC1):
(https://i.imgur.com/uAOlPFO.png)
(https://i.imgur.com/7jBxbiL.png)
(https://i.imgur.com/BYh4z29.png)
(https://i.imgur.com/BsfsVf9.png)

Features:
Splits the following vanilla work stats
Adds 5 tools to the game
Tools are acquirable through various different ways
Colonists can use tools from their inventories (added functionality to allow for picking up items anywhere) as well as what they have equipped
Colonists get work speed penalties if they don't have tools for tasks that need them
Different materials affect a tool's effectiveness in different ways
Tools will actually degrade over use

Design purposes of this mod:

To-do:

The oft-mentioned hardcore mode of this mod can be seamlessly toggled via mod settings. As this mod is somewhat of a WIP (though most stuff at this point is concrete), feedback and any suggestions that fit within this mod's design purposes would be much-appreciated.

Credits so far
Brrainz - Harmony
Mehni - Allowing me to directly use code from Pick Up And Haul (namely the 'Pick Up' part)
Why_is_that - SettingsHelper (not actually utilised yet)
Shotgunfrenzy - Artwork
erdelf - erdelf
Title: Re: [B19] Survival Tools Test Release v0.1 (30th September 2018)
Post by: 123nick on September 30, 2018, 08:34:32 PM
will mods that rely on the plant work speed stat, just use the plant sowing speed stat instead, and have (hopefully) minimal compatability issues? same with mining speed?
Title: Re: [B19] Survival Tools Test Release v0.1 (30th September 2018)
Post by: temple_wing on September 30, 2018, 10:18:43 PM
Why limit it as "three tools in the inventory"? It's weird.
A human should be able to carry as many tools as he can, normally.
And, what if a pawn is just needed to carry many tools, eg, many tools founded somewhere or bought from trade.
Title: Re: [B19] Survival Tools Test Release v0.1 (30th September 2018)
Post by: XeoNovaDan on October 01, 2018, 12:30:53 AM
@123nick - Yeah, they will.
@temple_wing - Good catch actually. It's mainly just a balance thing so that colonists can't just use stupid amounts of tools, but I'll add a mod setting to disable the limit altogether.
Title: Re: [B19] Survival Tools Test Release v0.1 (30th September 2018)
Post by: temple_wing on October 01, 2018, 07:02:12 AM
Yes, it's inefficient, but it's less micro management.
If you can program it to choose automatically( pick up necessary tool from stockpile just like doc pick up med before tending ), will be perfect.
Title: Re: [B19] Survival Tools Test Release v0.2 (1st October 2018)
Post by: XeoNovaDan on October 01, 2018, 02:52:30 PM
Alright, pushed v0.2 with a bunch of minor changes:
* Split mining yield into mining yield (digging) and mining yield (other) - affected by pickaxe and multitool
* 3-tool carry limit now only applies to hardcore mode
* Bugfix regarding the tool carry limit when caravanning
* Added new sprite for glitterworld multitool by Shotgunfrenzy

I also tried and failed to add a QoL feature that shows which tools a colonist's actually using in their inventory. The commented-out code is still present in the source code in SurvivalTool.cs and SurvivalToolUtility.cs

@temple_wing - Hmm, tool optimisation will be a tricky one to do, but I may give it a shot. Since there can be specific use-cases and that's something I've never done before, there's no guarantees I'll actually get an auto-optimiser in. However, something like an alert (similar to 'Low food' or 'Hunter lacks ranged weapon') will probably be much more doable and non-intrusive to player optimisation. Liking the feedback by the way!
Title: Re: [B19] Survival Tools Test Release v0.2 (1st October 2018)
Post by: Razzoriel on October 01, 2018, 09:39:49 PM
Do you have a GitHub with the 0.1 version with 3-max tools?
EDIT: Nevermind
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: XeoNovaDan on October 02, 2018, 05:39:11 PM
Alright, pushed v0.3 which mostly improves on the QoL side of things but does tweak a few things too. Copypasted changelog from GitHub:

NOTE: Although this release is for unstable 1.0, it has been quickly tested and shown to work fine with B19

General Changes

Bugfixes

Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: temple_wing on October 03, 2018, 10:41:53 AM
Does not compatible with SimpleSideArm.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: XeoNovaDan on October 03, 2018, 10:58:17 AM
@temple_wing - How bad is the conflict? Any error logs?
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: Lancefighter on October 04, 2018, 02:12:45 AM
Exception filling window for RimWorld.Dialog_Trade: System.NullReferenceException: Object reference not set to an instance of an object
  at SurvivalTools.SurvivalToolUtility.GetBestSurvivalTool (Verse.Pawn pawn, RimWorld.StatDef stat) [0x00000] in <filename unknown>:0
  at SurvivalTools.SurvivalToolUtility+<BestSurvivalToolsFor>d__11.MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.Contains[SurvivalTool] (IEnumerable`1 source, SurvivalTools.SurvivalTool value, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.Contains[SurvivalTool] (IEnumerable`1 source, SurvivalTools.SurvivalTool value) [0x00000] in <filename unknown>:0
  at SurvivalTools.SurvivalTool.get_InUse () [0x00000] in <filename unknown>:0
  at SurvivalTools.SurvivalTool.get_LabelNoCount () [0x00000] in <filename unknown>:0
  at RimWorld.Tradeable.get_Label () [0x00000] in <filename unknown>:0
  at RimWorld.Transferable.get_LabelCap () [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUIUtility.DrawTransferableInfo (RimWorld.Transferable trad, Rect idRect, Color labelColor) [0x00000] in <filename unknown>:0
  at RimWorld.TradeUI.DrawTradeableRow (Rect rect, RimWorld.Tradeable trad, Int32 index) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade.FillMainRect (Rect mainRect) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade.DoWindowContents (Rect inRect) [0x00000] in <filename unknown>:0
  at Verse.Window+<WindowOnGUI>c__AnonStorey0.<>m__0 (Int32 x) [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

b19, possibly related to simple sidearms? Possibly related to a lot of mods I have enabled? It looks like whenever a axe showed up in a trader's inventory, it screws up the entire window. I could create them myself and they worked fine for me, but trader generated ones seem to cause issues. If I look in a caravan's inventory, it shows the axe icon, and then the rest is blank until the info button on the right. The info button brings up a transparent grey box where the info screen should be, but there is no info. This makes trading impossible.


Its unfortunate, I really like the concept. The integration with inventories is nice and otherwise worked fine with simple sidearms? Colonists seemed to swap to melee tools as appropriate for being in melee range with a gun.

I will mention one thing I find super annoying, but its a vanilla issue made worse by this mod - Builders/haulers to build run into an issue where they spend large amounts of time trying to fell trees in the way, since they have both low plants skill and now worse, no axe. I am not sure what an elegant solution to this is, or even if its within the scope of this mod. My only real suggestion is change the axe's bonus be harvest yield instead of speed, such that I dont need to micromanage cutting plants that are in the way of construction.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: XeoNovaDan on October 04, 2018, 05:02:32 AM
@Lancefighter - Thanks for the stacktrace; will look into it now. Looks like it gives enough info to pinpoint the cause.

Also yeah, the axe situation is a bit of a tough one. Harvest yield won't work because the harvest yield stat actually only affects the chance of successfully harvesting resources from plants in general, and it's literally impossible to fail harvesting trees for their wood - it'll only cause more problems. I guess one fix could be to add 'Tree Felling Speed' as a relevant stat for the ConstructFrames and ConstructFloor workGivers, though I will probably need to change the way that the 'Colonist needs tools' alert works.

Edit: Though OTOH, I could also list 'Cut plants before building' as a recommended mod as well, which'll also mostly address the issue of axeless level 0 plantwork constructors spending an eternity cutting down trees that are in the way of blueprints since that autodesignates.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.3 (2nd October 2018)
Post by: XeoNovaDan on October 04, 2018, 05:19:56 AM
Alright, bug has been squashed. Will push v0.4 shortly.

Also, it wasn't an SS issue, just a matter of bad coding on my behalf :P


        public static IEnumerable<SurvivalTool> BestSurvivalToolsFor(IThingHolder holder)
        {
            Pawn pawn = (holder is Pawn_EquipmentTracker eq) ? eq.pawn : ((holder is Pawn_InventoryTracker inv) ? inv.pawn : null);
            // The following was the problematic code snippet:
            // if (pawn == null)
            if (pawn == null || !pawn.RaceProps.Humanlike || pawn.TraderKind != null)
                yield break;

            foreach (StatDef stat in SurvivalToolStats)
            {
                SurvivalTool tool = pawn.GetBestSurvivalTool(stat);
                if (tool != null)
                    yield return tool;
            }
        }
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: XeoNovaDan on October 04, 2018, 11:34:45 AM
Finally pushed v0.4 - I decided to change a couple of other things as well. This update's largely bugfixing, though some tweaking has been done too. No new features have been added. Just to re-iterate: v0.4 of Survival Tools is for 1.0.2045, but should also work fine with 0.19.2009 since there's very little in the way of code difference

Copypasted changelog from GitHub:

General Changes:

Bugfixes:

If all goes well, the next build will likely be the first release candidate since I plan to add AI tool use. Thanks for the testing and bug reports so far!
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: Lancefighter on October 04, 2018, 03:31:52 PM
Ah, good call on the cut plants before building mod, I didnt know that one existed, Ill add that today... and then have to rebuild all my tools since I deleted them so I could trade. No big deal, they craft quickly enough.

If harvest yield wasnt limited by base game limitations (read: if youre modding base game limitations on harvest yield out), would you consider increased harvest yield to be within the scope of the tools?
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: XeoNovaDan on October 04, 2018, 04:41:57 PM
It might be feasible to do something similar to what I did with mining yield where I could split it into 'General' and 'Trees' or something of the sort, where colonists will simply get less wood from barehanding trees or using bad tools. I don't want to replace the speed modifier though, just because people can't punch down trees as quickly as they can with a high-quality plasteel axe for example, which kind of goes against this mod's goal of eliminating that standout MC logic.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: temple_wing on October 05, 2018, 05:03:12 AM
When use this mod together with SimpleSidearm, Pawn can not automatically choose tools to use.

PS: my version is v0.2.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: XeoNovaDan on October 05, 2018, 05:17:35 AM
Ah. Yeah, pawns don't actually equip their tools, but they get passively used instead. This was clarified in v0.3, but I wouldn't recommend using 0.3 since it had quite a few bugs. Probably a good time to check out 0.4 which should still work fine with B19 despite it being a 1.0 mod
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: temple_wing on October 05, 2018, 06:03:52 AM
I suggest make it actually equip it. It's more intuitive.
When working, switch to tools, when fighting, switch back.
Maybe put it to TODO list.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: XeoNovaDan on October 05, 2018, 06:13:25 AM
We'll see. While it is indeed more intuitive, there are some design implications (e.g. pawns that are incapable of violence, or the AI when I get to implementing AI tool use). I'd probably also have to redesign some elements of this mod's code since in its current code state, it probably won't be able to handle auto-equipping in some edge cases.

I'll to-do it anyway, but no guarantees for implementation and it's a low priority thing.
Title: Re: [B19 / 1.0] Survival Tools Test Release v0.4 (4th October 2018)
Post by: rawrfisher on October 05, 2018, 02:20:54 PM
For now I think people can use a mod like weapon storage to do that
Title: Re: [B19 / 1.0] Survival Tools RC1 (13th October 2018)
Post by: XeoNovaDan on October 13, 2018, 02:41:47 PM
It's been a while but Release Candidate 1 has finally been pushed. No significant changes, but many minor changes have been made - mostly bugfixes and rebalances.

Copypasted change log from GitHub:

Note: The idea of having AI use tools has been put on hold again due to design difficulties

* Several minor bugfixes
* Tool degradation has been reworked
* Tweaked tool stat quality scaling
* New alert for when colonists have tools with only 12 hours of use or less
* New option to toggle tool degradation
* Rebalanced several materials' effects on tool stats
* Smelter bills now allow tools by default (except glitterworld multitool)
Title: Re: [1.0] Survival Tools RC1 (13th October 2018)
Post by: XeoNovaDan on October 17, 2018, 02:06:44 PM
I assume that stability and balancing with this mod have both been good considering this hasn't exploded with bug reports or balance complaints, so a release in a couple of weeks is on the horizon - enough time for the dust to settle with 1.0 hopefully. Just need to get a preview, and then a slightly modified RC1 (mainly learning helper entries) will be pushed as initial release.
Title: Re: [WIP][1.0] Survival Tools RC2 (23rd October 2018)
Post by: XeoNovaDan on October 23, 2018, 04:50:15 PM
Release Candidate 2 has now been pushed.

Changelog:

* Split the Using Tools learning helper entry into Equipping Tools and Using Tools
* Added new learning helper entry for Tool Degradation
* Now adds standalone functionality to pick up items (thanks Mehni!)

Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: zmadz on October 26, 2018, 03:19:37 PM
but but i need my Butcher cleaver to cook like a man ! :)
Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: Ruisuki on October 26, 2018, 06:50:35 PM
Ive seen a couple of tools mods around but ive installed a few of your mods already, i like the content so Im choosing this. Ill be waiting for this one to release fully to add it to my game.
Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: ultra4 on October 27, 2018, 07:44:05 PM
tools are neither simple weapon nor complex weapon, and once degraded cannot be mended. Is this bug or intended?
Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: zmadz on October 27, 2018, 08:16:21 PM
there is an option that they don't degrade when in use so why would u want to repair them ?
Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: ultra4 on October 27, 2018, 09:01:37 PM
i personally prefer to have them degrade and then spend a few cloth+steel to repair them (managing), than to have them not degrade. Every weapon or apparel does.
Title: Re: [WIP] [1.0] Survival Tools v0.6/RC2 (23rd October 2018)
Post by: XeoNovaDan on October 28, 2018, 05:27:53 AM
@Ruisuki - Much appreciated!

@ultra4 - Good catch. Will work on compatibility with Mending now.
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: XeoNovaDan on October 28, 2018, 06:28:39 AM
Okay, Release Candidate 3 is now out. More minor bugfixy stuff.

Changes:
* Subdivided the 'Tools' ThingCategory
* Now compatible with mending
* Outlander settlements and exotic goods traders now correctly have a chance of having multitools
* Stockpile zones now allow tools by default
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: Jiro on November 03, 2018, 07:10:09 PM
Hi, I'm new to RimWorld modding. Is the glitterworld multitool readily removable? Although it's rare/elusive it still feels a little implausible.
Will more tools be added in the future? Such as powertools and the like. Maybe a drill for construction that needs a nearby conduit, or a chemfuel-powered chainsaw. Would this ever be possible to implement? Or just too convoluted to be worth the effort?
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: XeoNovaDan on November 03, 2018, 08:12:07 PM
@中村ジロ - Should be quite easily doable just by removing it from Defs/ThingDefs. Regarding future tools, I do have plans but for a separate mod (probably going to be called Extra Survival Tools); I've already somewhat laid out the framework which'd make this very much possible.
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: Jiro on November 03, 2018, 08:54:09 PM
Wow, awesome! Looking forward to it. Keep up the great work! Do you have a Patreon account or something? I'd like to show my support some time in the future.
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: XeoNovaDan on November 04, 2018, 08:46:22 AM
@中村ジロ - I don't. Still, very much-appreciated! :)
Title: Re: [WIP] [1.0] Survival Tools v0.6.1/RC3 (28th October 2018)
Post by: Jiro on November 04, 2018, 07:34:52 PM
Ah, too bad.
Hey, I almost forgot: what about putting out fires? Seems a little awkward for pawns to be able to stamp out blazing vertical walls in vanilla. Maybe extinguishers and fire blankets? Maybe even a water bucket if No Water No Life is in use. Something like that. What do you think? Maybe the other way around too: needing electric lighters, gasoline lighters, matches, or even pieces of flint to start fires.
Oh! What about the tools doubling as weapons if you're in a pinch?
Title: Re: [Finished] [1.0] Survival Tools
Post by: XeoNovaDan on November 16, 2018, 01:40:01 PM
This mod's now officially been released! Thanks to those who have playtested and provided valuable feedback.

Ludeon: https://ludeon.com/forums/index.php?topic=29503.msg445544#msg445544
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1566269698




@中村ジロ - Sorry for the late response, but yeah, totally a possibility! Not for the first release version though, unfortunately. Tools can also be used as weapons, though less effective than clubs.
Title: Re: [Finished] [1.0] Survival Tools
Post by: 5thHorseman on November 16, 2018, 01:56:04 PM
First, super-congrats on the release!

Secondly, I found this amusing:

[Finished] [1.0] Survival Tools New « 1 2 3 » in Unfinished
Title: Re: [Finished] [1.0] Survival Tools
Post by: Jiro on November 16, 2018, 04:41:15 PM
Quote from: XeoNovaDan on November 16, 2018, 01:40:01 PM
This mod's now officially been released! Thanks to those who have playtested and provided valuable feedback.

Ludeon: https://ludeon.com/forums/index.php?topic=29503.msg445544#msg445544
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1566269698




@中村ジロ - Sorry for the late response, but yeah, totally a possibility! Not for the first release version though, unfortunately. Tools can also be used as weapons, though less effective than clubs.
At last! This is so cool. I can't wait to see what's in store for the future of this mod.