Changing pivot point of inserter arm?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Changing pivot point of inserter arm?

Post by Deadlock989 »

I'm experimenting with steam-powered inserters on an inline (input-output) pipe. Before I go to the trouble of making sprites, I want to be sure it can work.

The "pivot point" of inserter movement seems to be hardcoded to the exact centre of the tile. All the inserter bases are designed so that the centre of the platform's circular base is aligned with the tile centre, regardless of direction. This doesn't work well with the weird perspective of pipes. Those are aligned such that from the isometric viewpoint, they are always visually centred on the tile. But the eye is still translating everything as 3D and pipes are much taller than the inserter platform. When you combine them you get this (test just by jamming different sprites together):

pipeserters.png
pipeserters.png (342.08 KiB) Viewed 2125 times
The pivot point of the arm appears to be down one side in the horizontal (east-west pipe, north-south inserter) version. It doesn't look too bad when the inserter is reaching south but it's awkward when it rotates north. In the north-south pipe where the inserter is picking east-west, the pivot point is too far south and it would be impossible to fit a "platform" in there. Ideally the pivot point should be where the centre of the windows is on the regular pipes shown, about a quarter of a tile higher up.

Things I have tried:

- adding a shift to the various arm parts (chaos ensues as different parts of the arm fly apart and reform wildly in space, depending on inserter direction)

- moving the inserter's collision box off-centre (nothing happens)

Is there anything I'm missing or should this be a feature request?
Image

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Changing pivot point of inserter arm?

Post by eradicator »

Is "placeable-off-grid" an option for your usecase?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing pivot point of inserter arm?

Post by Deadlock989 »

eradicator wrote:
Tue Oct 20, 2020 11:45 pm
Is "placeable-off-grid" an option for your usecase?
I don't believe so. The use case is literally a steam powered inserter. The steam powered part works (as well as any fluid-powered entity works). So it needs to be aligned to the grid because it needs to connect to the pipe grid. Unless you're suggesting shenanigans with proxy items and something that is visually not where it really is. I guess that might be gotten to work eventually ... Seems like a song and dance just to shift something 12 pixels.

Plan B is to have it only connect to undergrounds, which makes all of these problems vanish. The floor position where undergrounds go under is almost out of the tile but we accept it and it's low enough to have a tile-centered inserter platform above it. The only drawback is that it's not a very intuitive mechanic, there is no vanilla entity that only connects to undergrounds except other undergrounds.

pipeserters.png
pipeserters.png (595.26 KiB) Viewed 2071 times
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing pivot point of inserter arm?

Post by Deadlock989 »

Yeah, it just works better as a two-way underground pipe. Except for the fluid box filter icon being double-overdrawn in alt-mode and the blue pipe connections being visible always in alt-mode, but those are minor things.

pipeserters.jpg
pipeserters.jpg (151.69 KiB) Viewed 2052 times
Image

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

Re: Changing pivot point of inserter arm?

Post by Klonan »

Deadlock989 wrote:
Tue Oct 20, 2020 10:28 pm
Is there anything I'm missing or should this be a feature request?
Looks like its hardcoded to the entity position, but from a brief look, it looks like it wouldn't be too hard to make it a prototype configurable value,
Feel free to make a modding interface request

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing pivot point of inserter arm?

Post by Deadlock989 »

Failed attempt 2,834:

Untitled5.jpg
Untitled5.jpg (124.75 KiB) Viewed 1912 times

There just isn't enough space. Pipe perspective is already seriously weird, when you combine that with the need to have the centre of the inserter platform in the centre of the tile ... you have literally pixels left to work with.
Image

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Changing pivot point of inserter arm?

Post by darkfrei »

Deadlock989 wrote:
Mon Nov 02, 2020 8:04 pm
Failed attempt 2,834
Very nice pipe graphics!

pleegwat
Filter Inserter
Filter Inserter
Posts: 258
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Changing pivot point of inserter arm?

Post by pleegwat »

And if you lower the pipes themselves as well?

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing pivot point of inserter arm?

Post by Deadlock989 »

pleegwat wrote:
Mon Nov 02, 2020 10:07 pm
And if you lower the pipes themselves as well?
They'd be clipping the ground and/or wouldn't connect properly.

This is irresistible force / immovable object territory. Pipes have to look they line up with the centre of each tile edge - there is zero freedom around that unless you are reskinning the entire game because every vanilla sprite with a pipe connection makes that assumption and any fluid box can connect to any other fluid box (there is no way in the game engine of stopping different kinds of pipe and entity fluidbox from connecting and any scripted attempt to stop it is likely going to break in some situation or other). So I can't move those brass rings at the tile edges - that is where they have to be.

On top of that, because of the 45 degree isometric perspective, what looks like a square tile on the screen represents a 1m x 1.414m (square root of 2) rectangle in 3D space, so everything has to be longer along the Y axis if it's going to fill tiles. So where pipes are involved your north-south design has to be different to your east-west design. This is why chemical plants look like M.C. Escher just discovered ketamine.

Meanwhile inserters are even more restricted - the arm connects to the on-screen tile centre no matter which direction the inserter is facing. From a pipe's perspective the only place those two points coincide on the 2D projection of the screen is deep inside the pipe. If any one of these limitations could be relaxed then you could have an inserter arm that looked like it was sitting on top of the pipe. Otherwise there is no getting around this collision of perspectives:

Untitled3.jpg
Untitled3.jpg (377.73 KiB) Viewed 1843 times
So you either connect your steam inserters with undergrounds, which looks OK but isn't actually very nice to play (no vanilla entity connects to undergrounds except other undergrounds), or you have weird inserters-in-a-half-pipe:

Untitled4.jpg
Untitled4.jpg (615.58 KiB) Viewed 1843 times
Image

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2241
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Changing pivot point of inserter arm?

Post by boskid »

Hm... simply moving center position 0.5 tile up and moving hand vector 0.5 tile down seems to be not enough because now shadows do not match the increased height. This would require some more changes to inserter drawing code.
90575-attempt-1.gif
90575-attempt-1.gif (1.18 MiB) Viewed 1831 times

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing pivot point of inserter arm?

Post by Deadlock989 »

boskid wrote:
Mon Nov 02, 2020 11:17 pm
Hm... simply moving center position 0.5 tile up and moving hand vector 0.5 tile down seems to be not enough because now shadows do not match the increased height. This would require some more changes to inserter drawing code.
I'm starting to think that even if it could be moved up that high (and the shadow were in the right place) it would still look weird, like the Hunchbacked Inserter of Notre Dame. The only reason it would work at all is that inserters are made of elastic and stretching down from that "height" would probably push that illusion too far.

This is my last iteration and I think it's as good as I can get it given the limitations. Actually I quite like it. It makes no sense, but chemical plants make no sense.

Untitled6.jpg
Untitled6.jpg (106.93 KiB) Viewed 1720 times
Image

Post Reply

Return to “Modding help”