#Second Shift

114 messages · Page 1 of 1 (latest)

pale latch
#

This mod allows you to convert any workplace into a two-shift operation, enabling beavers to work in two 12-hour shifts per day.

  • Adds a Two Shifts toggle to the workplace panel. (Note: this mod replaces the entire panel, so it may not be compatible with other mods that modify workplace UI)
  • Both shifts last 12 hours, with the second shift covering the night.
  • Second shift workers sleep during the day before their shift starts. This may interfere with Folktails breeding, although the mod attempts to minimize this by optimizing housing assignments.

https://mod.io/g/timberborn/m/second-shift
https://steamcommunity.com/sharedfiles/filedetails/?id=3614598709

copper heart
#

Small bug at first glance .

#

😮 Is working HappyIT Maybe , water pumps should have double shift enabled by default, but, anyway, let's grab water like a hell during temperate season.

pale latch
copper heart
pale latch
#

ok, when he will be around I will ask what should I change for the name to be shown properly

copper heart
#

OK, no rush. Yet, you are in a strange situation. As a dev, it's not a bug since it's not in Timberborn. As a modder, it's a bug, even it is caused by another mod 🤔

pale latch
#

yeah, my modder alter ego takes precedence here, I will just need to figure it out with theapologist

copper heart
#

Now, with double shifts on pumps during temperate seasons, it's time for Apocalyptic mode 🤣

fast anvil
#

This mod adds a really interesting population and industry management layer, it's a great idea! Compatibility with the most popular UI/UX mods will go a long way to make it more interesting/accessible to those of us who rely on those for our gameplay.

exotic matrix
zenith sigil
#

Woah this is such a cool idea. Great use for spare beavers. Is this being developed for update 7 or 1.0?

copper heart
#

Update 1.0, and it's not a game feature, it's a mod.

copper heart
#

Was hopping this, and I'm glad for this. eMka, you are the best 👏 😍

foggy wyvern
#

@pale latch , @exotic matrix I had to deactivate the mod, It's crashing for me, it's seems to be an issue with TImprove4UX, I think i found the line where the stuff is interesting in the bug report, the line 59198 "The given key Name_TwoShiftsWorkplaceFragment was not present in the dictionary.
"

exotic matrix
exotic matrix
foggy wyvern
#

Yes it crashed when I clicked the building, It was the science building with the FT

exotic matrix
#

this stack trace is more helpful (there are instruction addresses):

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at SecondShift.CoreUI.TwoShiftsWorkplaceFragment.UpdateViews () [0x00109] in <802c708ae7d34c2cab433401942d8334>:0 
  at SecondShift.CoreUI.TwoShiftsWorkplaceFragment.UpdateFragment () [0x00029] in <802c708ae7d34c2cab433401942d8334>:0 
  at Timberborn.EntityPanelSystem.EntityPanel.UpdateFragments () [0x00015] in <f51f5de94b5c45cd984eb0c612a8d229>:0 
pale latch
#

I'm currently working on fix for this. Can you send me a crash report @foggy wyvern? It's the most recent zip file in Documents/Timberborn/Error reports

#

also did you perhaps use duplication tool to build that building?

foggy wyvern
pale latch
#

error report contains save file that I wanted to check, but if you already confirmed using duplication tool it's a known issue then (and I'm testing the fix now)

foggy wyvern
pale latch
#

thx!

south grotto
#

Question. Will this technically work on v1.0.3.0 (EG) if i remove the min game requirements?

pale latch
#

Hmm, probably. The difference between 1.0.3 and 1.0.4 are only achievements and Unity version, so it shouldn't be a problem

south grotto
#

Alright, removing requirements it is.

pale latch
foggy wyvern
#

I used the pippet duplication tools

wild iris
#

Hey Emka, I'm getting some weird exhaustion issues with this mod enabled. First run with your mod enabled, I hadn't even turned on second shift for any building, and noticed that farmers and other beavers that shouldn't be working past the end of the regular work shift were getting exhausted.

I reloaded the game, disabled the mod, then loaded up from the same save point. Nobody go exhausted in several days, except a couple haulers I would expect it from.

Reloaded again from the same save point with the mod enabled again, and on the second day after reloading, I've got observatory beavers, lumbermill workers, and other beavers who don't walk long distances on tasks that are getting exhausted.

I've got Bob's Housing Optimize installed, I don't know if that's creating a conflict, so I'll try disabling that to see if the problem persists, but I wanted to put this out there first before I do even more tests.

#

Same thing without Housing Optimize. It appears that these beavers are just staying up too late to do well being activities.

I'll try again and see if changing the work hours gets them to obey curfew.

#

Nope. I've still got beavers swimming and hanging around the campfires, etc. up right till dawn.

pale latch
#

So they are completely ignoring regular sleeping hours? 🤔 Thanks for that insights, I will investigate it

#

Could you send me the save file?

wild iris
#

I can, but I am running more mods. I'll giv eyou the modlist, of course.

Do you want the save I've been reloading from the entire time, or do you want one after the rebellious beavers ahve stayed up all night?

pale latch
#

Mods list is embedded into the save so I will see what am I missing.

#

The one before them not going to sleep will be better

wild iris
#

Modlist:

  • Harmony
  • More Mod Logs
  • Mod Manager
  • MultiYieldersPlzNoCrashes
  • Bobingabout's Housing Optimize
  • TimberUi
  • Second Shift
  • Moddable Timberborn
  • Daisugi Foestry
  • zxuiji -m- Greedy Builders

Sorry, I had already written more than half the list. =P Give me a moment and let me see if discord will allow me to directly upload the save. If not, I'll have to drop you a proton drive link after I upload it there.

#

...why does discord hate me so? Un momento please.

pale latch
#

Thx!

wild iris
#

Of course. Please ping me if you would like any specific tests or if you have a new version for me to try. I'm going to disable the mod for now though.

No rush, of course.

foggy wyvern
#

@pale latch Hi!
Second Shift v1.0.4.1 crashes the game when opening the info panel of any building that has only 1 worker slot (most commonly the Dirt Excavator with the HydroForma upgrade that reduces workers to 1).

Log error:
ArgumentOutOfRangeException in TwoShiftsWorkplaceFragment.UpdateViews() – it tries to access worker views that don’t exist when MaxWorkers = 1.

This is 100% reproducible on any save that has a 1-worker Dirt Excavator.
A simple check like “if (workplace.MaxWorkers < 2) return;” in UpdateViews() fixes it.

Many people could run into this with HydroForma Projects or other mods that reduce worker counts.
Would be awesome to get a small hotfix for this case! 😊

Thanks for the mod and keep up the great work!

#

ArgumentOutOfRangeException: Index was out of range. [...]
at SecondShift.CoreUI.TwoShiftsWorkplaceFragment.UpdateViews ()
at SecondShift.CoreUI.TwoShiftsWorkplaceFragment.UpdateFragment ()

pale latch
#

I'm afraid that if another mod is changing MaxWorkers property then they won't be compatible. But I will try to fix that crash anyway.

exotic matrix
#

it's modified before the game logic btw, right after the Template was loaded, so for most intent and purpose, that building is just like any other building with 1 MaxWorkers

pale latch
#

so it's changing the spec value?

#

I was talking about Workplace.MaxWorkers computed property, that SecondShift is patching and relays on that patch

exotic matrix
pale latch
foggy wyvern
#

To be honest, Grok posted the first message since I'm not an expert in this area. So it's entirely possible that what he said isn't entirely accurate.

#

I tried one more time to see if the language of the game could play a role, but it crash also in english

exotic matrix
#

@jolly latch you need to cut down the warning somehow 😅 maybe only print the first 3?

#

btw I saw this:
TwoShiftsWorkplaceFragment: Not enough views to show all workers. Desired: 4, Current: 1, Workplace: DirtExcavator.Folktails(Clone), MaxWorkers: 2, TwoShiftsEnabled: True

#

hmm I guess the Desired number is not updated when I change the Worker number? I changed both MaxWorkers and DefaultWorkers correctly:

    EditableBlueprint ModifyDirtExcavator(EditableBlueprint template)
    {
        var workplaceIndex = template.Specs.FindIndex(q => q is WorkplaceSpec);
        var workplace = (WorkplaceSpec)template.Specs[workplaceIndex];
        var modifier = 1f / workplace.MaxWorkers;

        template.Specs[workplaceIndex] = workplace with
        {
            MaxWorkers = 1,
            DefaultWorkers = 1,
        };

        template.Specs.Add(new RecipeTimeMultiplierSpec()
        {
            Id = "HFDirtExcavatorUpgrade",
            Multiplier = modifier,
        });

        return template;
    }
#

nope, the game code looks correct, so maybe it's from your patch? 👀

    public void Load(IEntityLoader entityLoader)
    {
        if (entityLoader.TryGetComponent(WorkplaceKey, out var objectLoader))
        {
            DesiredWorkers = Math.Min(objectLoader.Get(DesiredWorkersKey), _workplaceSpec.MaxWorkers);
        }
    }
jolly latch
#

I was hoping that mod authors would fix the unused fields relatively quickly, but that hasn't happened.

#

Maybe I could drop the JSON contents, and just rely on the BlueprintBundle's Path and the BlueprintAsset Sources

jolly latch
#

also it's odd that each file is printed twice, I wonder if it's being loaded twice for some reason

proven flame
#

The daytime observatory operation has always bothered me, looking forward to being able to fix that.

pale latch
#
v1.0.5.1
- Fixed a bug that caused some workers not going to sleep at night.
- Fixed a crash caused by workplace max workers property being decreased on load.

@wild iris fixed
@foggy wyvern most certainly, probably, maybe fixed
thanks for reporting these problems

random hazel
#

OMG this mod will be a boon for white paws where we just end up having tooo many beavers compare to jobs! Looks super interesting 🤯

wild iris
#

If I remember correctly, Whitepaws sleep in their workplaces, so if that's still a thing, consider how that would conflict.

random hazel
wild iris
#

No, Housing Optimization doesn't let beavers sleep in their workplaces. That was a Whitepaw feature.

Housing Optimization shuffles beavers around so they live closer to their workplace, not in it.

random hazel
#

ooh like that.. that buildings act both as workplaces as well as houses

wild iris
#

Alrighty Emka, just reporting in that I finally had a chance to load back into the game, and your fix appears to have worked. Three days in and no beavers exhausting themselves by ignoring their bedtime.

#

Quick question though, now that I've activiated the second shift for my first building. How's using the mod affecting the Productivity score? It seems super low right now when it shouldn't be.

pale latch
#

Not tested it much, so it may be buggy. I should look closer into it

wild iris
#

I am really enjoying the mod. It's a great way to get more out of a single building, without taking away leisure time from the beavers, or risking messing with the sleep cycle.

It require more beavers to use, but that's not a big deal. You just need to be more careful of how you use it early game.

Not tested it much, so it may be buggy. I should look closer into it
From my very brief atetntion given to it, it seems to cut the number in half. So 50% is the new 100%. That's just my perception right now though.

wild iris
#

Hey Emka, I don't know what happened, but Second Shift appears to be causing a crash. I didn't think there was an update between now and when I last played...

#

The exception file:

Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <1eb9db207454431c84a47bcd81e79c37>:0)
UnityEngine.UIElements.VisualElement+Hierarchy.get_Item (System.Int32 key) (at <935a754319e2482f8f3e8a019d69f685>:0)
UnityEngine.UIElements.VisualElement.get_Item (System.Int32 key) (at <935a754319e2482f8f3e8a019d69f685>:0)
UnityEngine.UIElements.VisualElement.ElementAt (System.Int32 index) (at <935a754319e2482f8f3e8a019d69f685>:0)
Timberborn.CoreUI.VisualElementLoader.LoadVisualElement (UnityEngine.UIElements.VisualTreeAsset visualTreeAsset) (at <ed384fff032347d18d1ab76fba49c740>:0)
Timberborn.CoreUI.VisualElementLoader.LoadVisualElement (System.String elementName) (at <ed384fff032347d18d1ab76fba49c740>:0)
SecondShift.CoreUI.TwoShiftsWorkplaceFragment.InitializeFragment () (at <d97ce958b51540b4a1d6bcc9684fbdc1>:0)
Timberborn.EntityPanelSystem.EntityPanel.AddFragments (System.Collections.Generic.IEnumerable`1[T] fragments, UnityEngine.UIElements.VisualElement parent) (at <71def80ce32d4f8ba15a686b8c86537c>:0)
Timberborn.EntityPanelSystem.EntityPanel.InitializeModules () (at <71def80ce32d4f8ba15a686b8c86537c>:0)
Timberborn.EntityPanelSystem.EntityPanel.Load () (at <71def80ce32d4f8ba15a686b8c86537c>:0)
Mods.MoreModLogs.SingletonSystemPatch.ErrorReporter (System.Action fn) (at C:/Users/***/Documents/src/Timberborn-MoreModLogs/SingletonSystemPatch.cs:61)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Timberborn.SingletonSystem.SingletonLifecycleService.LoadSingletons_Patch1(Timberborn.SingletonSystem.SingletonLifecycleService)
Timberborn.SingletonSystem.SingletonLifecycleService.LoadAll () (at <d501a03a21274f15b3a7267ca55fc8cb>:0)
Timberborn.SingletonSystem.SingletonLifecycleUnityAdapter.Start () (at <d501a03a21274f15b3a7267ca55fc8cb>:0)

#

(since discord refuses to let me upload zips or txt files...)

pale latch
#

That's really weird, does it occur every time now? Did you try to reinstall the mod?

wild iris
#

I did not try to reinstall the mod, no. It's happened all four times I tried to load in with this mod. Two different maps, atleast one of which has previously loaded with this mod.

I can try reinstalling if you'd like. Un momento por favour.

#

I have to do it manually now. Mod Manager is broken. SadIT

#

Oh maybe that's why. You've updated the mod but I don't have that version. I'm on 1.0.5.1, but you've got 1.0.6.0. Loading into timberborn now.

pale latch
#

Yep, that looked like 1.0.6 bug with obsolete mods.

wild iris
#

We're back! Sorry for the false alarm. I guess I'm going to ahve to get used to checking mods on my own now.

pale latch
#

Yep, it's not your fault. I believe that the lack of modio support makes it painful to stay up to date with mods

wild iris
#

It's unfortunate, but oh well. It's nothing I haven't dealt with before. While I play with less mods on this game than other games where I've manually handled mods, this game updates more often, so I suppose it balances out in a way.

royal silo
#

Finally tried it, it's very elegantly integrated! What I love the most? Observatory night shift HappyFT

zenith sigil
#

I love doubling the effeciency of our water pumps

wild iris
#

Well...it's not exactly doubling the efficiency unless you already had work days twelve hours or less. It's still a good mod, of course.

royal silo
#

It's also very nice for builders if you have projects a little bit too far away. 2 x 12 h shifts make them get some sleep and wellbeing, even if they spend most of their time walking.

gray sequoia
#

I looked at Second Shift. Tried to import it into my Unity Project so I could use Rider to see the code and... I can't see the code.

Is there a GitHub for this?

gray sequoia
#

I ask because people are asking me about Housing Optimise and my new Commute Balancer, if it's compatible with this, Second Shift.

and I'm just like... probably not.

gray sequoia
#

I'm guessing eMka doesn't check this very often.

I hope you don't mind me sending you a ping @pale latch

pale latch
#

@gray sequoia

#

Let me know if I should tweak something to make the mods compatible

gray sequoia
#

Probably going to take me a while to read through this and figure out what's going on

gray sequoia
#

so from what I understand...

Workplace maximum workers is just *2, so you do actually assign 4 workers to a workplace that would normally have 2 workers.

So from the perspective of Worker, they'd all still be Employed, and assigned to a workplace, that can be obtained via the Worker._workplace variable?

pale latch
#

yep, exactly

#

withouth that, there could be some problems with Folktails reproduction

gray sequoia
#

Yeah, there could be a little conflict with you moving a beaver, then me moving it somewhere else afterwards.

copper heart
#

May I dare to suggest an improvement to the mod ? Sure, if it not a big headache to make-it. When enable second shift for a workplace, will be nice to have a checkbox "use only second shift". Will be useful mainly for Folktails , when scare energy they have can be use, as example, for observatory at night ...

fallow briar
#

id like a motion sensor that can read from above or the side?

#

itd work great with monitoring the rafts as they move downstream

pale latch
copper heart
#

Not really, since cannot make a workplace working during non working hours. Will imply to make 24 working hours and set another chronometer to disable all other buildings during rest time. May work, but, not sure how will impact the wellbeing having a lot of unemployed beavers (during rest time) 🤔

pale latch
#

You can set the chronometer to work from noon to midnight, connect it to the observatory set to two shifts and that's all?