0ptera / Loader-Redux

Factorio Mod adding Loaders to the game.
MIT License
11 stars 11 forks source link

Fixes loaders not interacting with non-vanilla-sized cargo wagons #19

Closed ReikaKalseki closed 6 years ago

ReikaKalseki commented 6 years ago

For more info, see my issue.

I have tested this code ingame, with both oddly-sized and vanilla wagons, and it works without issue.

0ptera commented 6 years ago

Looks good to me. Which mods add wagons that differ from vanilla width?

ReikaKalseki commented 6 years ago

I am working on one right now. The wagon is only one internally, not used as part of a train, and is supposed to look like any normal chest to the player. Yes, it is a hack, but it is necessary so that I can have slot filters on it (chests do not support such filters).

0ptera commented 6 years ago

I strongly suggest against using this "chest" with loader redux. The way I have to put items on belt lanes through script will utterly destroy performance. For train interaction MiniLoader (disguised inserters) is a much better choice. I'm arguing if i shouldn't remove train interaction altogether.

ReikaKalseki commented 6 years ago

The way I have to put items on belt lanes through script will utterly destroy performance.

Can you elaborate?

For train interaction MiniLoader (disguised inserters) is a much better choice.

Hidden inserters - with a common example being Hacked Splitters - are very often claimed to cause extreme lag, so I doubt this.

I'm arguing if i shouldn't remove train interaction altogether.

Considering that trains are the primary use case of loaders, that would be an extremely unhelpful action.

0ptera commented 6 years ago

Can you elaborate?

The internal code loaders use only connects to chests and crafting machines and seems to be really fast. Perhaps it has even less ups impact than super fast inserter. Cargo wagons however are done through a lua script extension in local function wagon_transfer(wagon_data). Putting items on both belt lanes every n ticks in lua is magnitudes less efficient than hidden inserters.

To maximize performance I use loaders exclusively for chests and crafting machines. Train loading is done by normal filter inserter. I cringe every time I see someone stack 2 (mini)loader back to back to get a train-chest connection. That is by far the worst possible way to use them.

Train stops on my LTN testmap look mostly like this: 2018-01-13-10-26-26-4368406 Using only loader and wide chest, this seems to be quite performance friendly.

Considering that trains are the primary use case of loaders, that would be an extremely unhelpful action.

The main use of loaders is chest-belt connector. They make excellent belt/lane balancers with way lower footprint and performance impact than count perfect splitter builds. Another great use of loaders is to handle these annoyingly fast 0.5s recipes by either directly connecting assembler-loader-belt (be wary of #1 ) or using assembler-inserter-chest-loader-belt as seen above.

ReikaKalseki commented 6 years ago

Putting items on both belt lanes every n ticks in lua is magnitudes less efficient than hidden inserters.

Sure, but removing the code to handle it has no performance benefit to anyone; there is no impact if you do not use loaders on trains, and if you do, its removal now outright destroys a feature you desire.

The main use of loaders is chest-belt connector.

For you, maybe. But most people - myself included - use them most when throughput needs to be at a maximum and inserters cannot realistically keep up, and while it is rare for assemblers to be at those sort of speeds (you need like 8 stacked beacons full of speed modules, which most builds do NOT use to that degree), trains always end up needing to dump thousands of items as fast as possible.

0ptera commented 6 years ago

For you, maybe. But most people - myself included - use them most when throughput needs to be at a maximum

You should look at ups optimized builds for megabases instead of beginner bases.

inserters cannot realistically keep up, and while it is rare for assemblers to be at those sort of speeds (you need like 8 stacked beacons full of speed modules, which most builds do NOT use to that degree), trains always end up needing to dump thousands of items as fast as possible.

Even on the slowest possible 180° vanilla rotation 6 stack inserters shuffle slightly more than 4 blue loaders worth of items between train and chest, 2018-01-13-12-16-18-7641647

Using mods changing inserter angles like bob inserters turns this heavily in favor of inserter. 2 Inserter can be made to shuffle 6 blue belts of items between chest and wagon.

ReikaKalseki commented 6 years ago

You should look at ups optimized builds for megabases instead of beginner bases.

Few people make megabases, probably less than 1% of the playerbase. Megabase use cases are simply irrelevant to most people, and restricting functionality to only those use cases is akin to redesigning Firefox to load GitHub and StackOverflow faster and more cleanly while outright breaking its ability to visit most of the rest of the internet.

Even on the slowest possible 180° vanilla rotation 6 stack inserters shuffle slightly more than 4 blue loaders worth of items between train and chest,

In other words, even the best stack inserter - without changing the angle with mods - cannot compete with a loader. And the only solution to this is to use 90-degree inserters, which make the current bots-vs-belts debate look like nothing in comparison.

0ptera commented 6 years ago

Few people make megabases, probably less than 1% of the playerbase.

I'd love to see the statistic basis for this statement.

Anyway I belong to the megabase group and all my mods are tailored to support this play style. If they are useful to other play styles that's great, but it will never be my focus.

In other words, even the best stack inserter - without changing the angle with mods - cannot compete with a loader. And the only solution to this is to use 90-degree inserters, which make the current bots-vs-belts debate look like nothing in comparison.

You are comparing apples and oranges. For moving items between cargo wagon and chest Loaders only have downsides compared to vanilla stack inserters:

Without buffer chests all your points are moot as your belts will run dry while trains move meaning you never needed fully compressed belts to begin with.

ReikaKalseki commented 6 years ago

I'd love to see the statistic basis for this statement.

I anticipated that and am currently getting it now (for more reasons than this, but it works here too). Give me a day or two for results to be acquired and aggregated. It is a reddit post, not the most scientific of formats, but it is within my means, unlike ingame analytics.

That said, it should be fairly self-evident; a megabase is one hell of an achievement with a massive time requirement; most people do not have that kind of time, and it is rare in games - any game - for players to have that kind of accomplishment. Less than 5% of players complete puzzle games like Infinifactory or SpaceChem; Like 3% of the E:D playerbase has been to Saggitarius A-star (and yes, the devs of those games have openly released that info); Few people build massive automated defence systems in Space Engineers or massive flying crafts in Beseige. Less than 100 people out of 200k or so users have ever made it to the end of ChromatiCraft. And all of those are still several orders of magnitude less demanding than a megabase is.

Anyway I belong to the megabase group and all my mods are tailored to support this play style. If they are useful to other play styles that's great, but it will never be my focus.

Sure, but as I said above - having loader-train code in, if you never use loaders with trains, costs you nothing, but benefits a great many people. Removing it gives you nothing, and hurts many people. Why remove it?

cpu hungry script

To a degree where it only matters in megabase setups - this disadvantage is nonexistent to most players. And again, see the immediate above.

require 2.7 times more space (4x4 vs 6x1)

Inline space, maybe, but that is generally more expendable than "width space". This is of course build style dependent, but nonetheless real.

can't be circuit controlled

Yes, they can, via their feed belts, which can be connected.

Without buffer chests all your points are moot as your belts will run dry while trains move meaning you never needed fully compressed belts to begin with.

Where was the lack of buffer chests specified?