[MOD 0.15] Hacked Splitters - bring balance to the belts

Topics and discussion about specific mods
Post Reply
doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

[MOD 0.15] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Hacked Splitters
Mod Version: 1.1.0
Factorio Version: 0.15
Tested w/ Version: 0.15.5
Dependencies: Base, Bob's Logistics (optional)
Download: Mod Portal
Homepage: https://bitbucket.org/doktorstick/hacked-splitters
License: MIT

You've used your ingenuity as an engineer to hack your original splitter design, creating new splitters that perfectly balance transport belt inputs. These hacked splitters require extra circuitry and are best used with single-item belts as they no longer perform the function of their baser models. They unlock when their respective counterparts become available.

Vanilla splitters are still in the game; the hacked variants are new entities. You have two behavior options for your splitter needs.

I welcome localization additions (I'm mono-lingual) or graphics changes (I'm artistically challenged).

You can see the hacked splitters in action:
https://gfycat.com/ImperfectHiddenGrayfox
https://gfycat.com/GrizzledQuarrelsomeHoverfly
The Motiviation
Releases
Last edited by doktorstick on Mon May 01, 2017 3:25 pm, edited 18 times in total.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.13] Hacked Splitters - bring balance to the belts

Post by Klonan »

It looks like your mod would desync in a multiplayer game, specifically this line:

Code: Select all

-- Tracks the first tick seen.
local session_tick = nil
Anytime the game loads for a client, this line would run, but not for the other players, meaning that a function will run for some players but not others

I reccomend initialising everything into a global.table, which means it is saved between save and load, and is safer from desyncs

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.13] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Thanks. I loaded up a LAN multiplayer to test and it didn't fail. Bad luck on my part I guess. I would have rather it failed fast.

My guess is that because the first person joins, it does as you say, and their first tick fires. This initializes in `global` my lookup table. By time the MP joins, the lookup is inside of `global`.

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Updated to 1.0.6. Let me know if you encounter problems, particularly performance issues in mega-factories. My moderately large factory performs well, but I don't (haven't) build mega-factories

User avatar
Philip017
Filter Inserter
Filter Inserter
Posts: 356
Joined: Thu Sep 01, 2016 11:21 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by Philip017 »

i want to leave a thank you for this mod, extremely helpful, i hope it gets added to vanilla

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Philip017 wrote:i want to leave a thank you for this mod, extremely helpful, i hope it gets added to vanilla
Thanks! I appreciate the kind words.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by mknejp »

Very useful indeed but I find the choice of SHIFT+S as hotkey rather unfortunate. With it it's impossible to spam the "paste entity setting" action when running downwards while holding shift. Took me a while to figure out why I suddenly couldn't do that anymore.

Mokmo
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 15, 2016 6:44 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by Mokmo »

I'm trying to understand the numbers in the debug console, because show_time_used_percent has "Mod-hacked-splitters" at a number between 15 and 19 and that looks weird if it's a percentage...

mknejp wrote:Very useful indeed but I find the choice of SHIFT+S as hotkey rather unfortunate. With it it's impossible to spam the "paste entity setting" action when running downwards while holding shift. Took me a while to figure out why I suddenly couldn't do that anymore.
I see no mention of Shift S anywhere, what does it do ? My games still lets me put down stuff...

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Mokmo wrote:I'm trying to understand the numbers in the debug console, because show_time_used_percent has "Mod-hacked-splitters" at a number between 15 and 19 and that looks weird if it's a percentage...
It's in milliseconds. I'm releasing a version that improves performance today. Eventually you will hit a limit of how many hacked splitters you can have. This is somewhat dependent on your other mods, and on how active they are. For my setup, I have around 1400 and am A-OK.
mknejp wrote:Very useful indeed but I find the choice of SHIFT+S as hotkey rather unfortunate. With it it's impossible to spam the "paste entity setting" action when running downwards while holding shift. Took me a while to figure out why I suddenly couldn't do that anymore.
I see no mention of Shift S anywhere, what does it do ? My games still lets me put down stuff...
It was part of a version that's no longer available. :)

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by iceman_1212 »

great mod! what are your thoughts on having the recipe mirror the vanilla splitters in that red hacked splitters would require a yellow hacked splitter (instead of a red hacked splitter requiring a red regular splitter)?

atm, unless we're playing with a recycling mod, hacked splitters of the current tier will be outdated with no option to upgrade

a second, more minor comment: one thing that would be incredibly helpful would be some kind of visual mark that makes it easy to distinguish hacked splitters from regular splitters - although i primarily use hacked splitters in my base, there are certain assemblies where i use split belts (which would ofc require the regular ones)

really hope this makes it into vanilla alongside existing splitters :D

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by doktorstick »

iceman_1212 wrote:great mod! what are your thoughts on having the recipe mirror the vanilla splitters in that red hacked splitters would require a yellow hacked splitter (instead of a red hacked splitter requiring a red regular splitter)?

atm, unless we're playing with a recycling mod, hacked splitters of the current tier will be outdated with no option to upgrade
Thanks for the compliment and feedback. You'll be happy to know It's on the list of things to do.
a second, more minor comment: one thing that would be incredibly helpful would be some kind of visual mark that makes it easy to distinguish hacked splitters from regular splitters - although i primarily use hacked splitters in my base, there are certain assemblies where i use split belts (which would ofc require the regular ones)
There is, albeit it is subtle. If you look at the front-right of the bezel, you'll see three white hatch marks.
really hope this makes it into vanilla alongside existing splitters :D
Me too!

Mokmo
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 15, 2016 6:44 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by Mokmo »

The update definetly worked, the milliseconds thing went from 15-19 to around 2.
Nice work.
(and my huge-ish map gained 20 UPS just by updating.)

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by iceman_1212 »

doktorstick wrote:
iceman_1212 wrote:a second, more minor comment: one thing that would be incredibly helpful would be some kind of visual mark that makes it easy to distinguish hacked splitters from regular splitters - although i primarily use hacked splitters in my base, there are certain assemblies where i use split belts (which would ofc require the regular ones)
There is, albeit it is subtle. If you look at the front-right of the bezel, you'll see three white hatch marks.
derp, i clearly did not pick up on this - thanks!

IG2
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Mar 30, 2016 11:53 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by IG2 »

It´s nice to see you adding support for Bobs Mod.
I still have a request: would it be very hard to support 5dims Mod? Ich use 5 dim mainly in my Multiplayer Sessions and we would love to use your Splitters on the higher tiers.

Greeting!

MainTango
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Tue Oct 27, 2015 12:22 am
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by MainTango »

So far, this gem is working fine for me in 0.15. Only had to edit the info.json to adjust for the latest game version.

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] Hacked Splitters - bring balance to the belts

Post by doktorstick »

Good deal. This weekend (Sunday planned) I'm going to publish the updated version. The community tools I use to test belt compression have been updated, so I should be able to validate its functionality.

myricaulus
Long Handed Inserter
Long Handed Inserter
Posts: 84
Joined: Mon May 08, 2017 3:33 pm
Contact:

Re: [MOD 0.15] Hacked Splitters - bring balance to the belts

Post by myricaulus »

Hi there,

Kudos
i really like the idea of your mod, good work, so usefull!
Neat state maschine, took me some hours to get the head around it, but its clean and easy to alter if you know how it works.
Cool overlay function and integration into existing assets.Too bad with those high res sprites :-(
Backgroundstory
I modified your state maschine to prefer one output belt to fill up one belt and overflow to the other. To maximize the output of a single belt i even added a deque for the incoming belts, although i now loose the contents if i pick up the splitter until i find out how to drop things :-D
Most important part
While i was doing it i also fixed your compression problem to 99.9% while retaining most of the cpu saving mechanisms of your back off logic. Your calculations are correct there and it should work, but it didnt so i got intrigued :-D As far as i remember i only changed this line in the control.lua splitter consturctor:

Code: Select all

tpu=math.floor(UNIT_SIZE / speed),
Possible Reason
The root of the issue is maybe due to rounding errors of floating point operations and then comparing to an integer might become a wrong result. like

Code: Select all

0.00000000000001 != 0 
Conclusion
It still is not perfect if you watch closely for some time, but its definetely better.
If you are interested i can send you an pull request via github, or however i can share there on github a 1.0.8 branch of your code.

I added a video of my modded mod :-D https://youtu.be/4HEi2TyTpt4

Have a nice day

[EDIT] 19.06.2017
I was asked to publish my code, as i ve seen it, its MIT Licence so uploaded my changes to github @ https://github.com/Myricaulus/prio-splitter. Have Fun

Parapre
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Aug 24, 2017 5:26 am
Contact:

Re: [MOD 0.15] Hacked Splitters - bring balance to the belts

Post by Parapre »

Great mod, very subtle idea that improves factories in a ton of spots. I see that there is support for Bob's and I was wondering if you might consider supporting Nathgamer's FactorioExtended-Transport belts? viewtopic.php?f=93&t=19836 Although it would be understandable to not want to support too many different things.

Post Reply

Return to “Mods”