Page 1 of 1

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

Posted: Sat Aug 13, 2016 8:18 pm
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

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

Posted: Sat Aug 13, 2016 9:44 pm
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

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

Posted: Sat Aug 13, 2016 10:26 pm
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`.

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

Posted: Sun Sep 11, 2016 12:59 am
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

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

Posted: Wed Sep 14, 2016 9:07 pm
by Philip017
i want to leave a thank you for this mod, extremely helpful, i hope it gets added to vanilla

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

Posted: Sun Sep 18, 2016 3:52 am
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.

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

Posted: Wed Sep 21, 2016 10:42 pm
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.

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

Posted: Fri Sep 23, 2016 10:21 am
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...

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

Posted: Fri Sep 23, 2016 4:29 pm
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. :)

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

Posted: Fri Sep 23, 2016 6:00 pm
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

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

Posted: Fri Sep 23, 2016 6:06 pm
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!

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

Posted: Fri Sep 23, 2016 6:16 pm
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.)

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

Posted: Fri Sep 23, 2016 9:29 pm
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!

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

Posted: Sat Oct 29, 2016 11:54 am
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!

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

Posted: Wed Apr 26, 2017 7:09 pm
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.

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

Posted: Sat Apr 29, 2017 4:11 pm
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.

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

Posted: Mon May 08, 2017 4:27 pm
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

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

Posted: Sat Aug 26, 2017 12:38 am
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.