Collision Box Rotation[?]

Place to get help with not working mods / modding interface.
Post Reply
AenAllAin
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Sat Apr 02, 2016 3:10 am
Contact:

Collision Box Rotation[?]

Post by AenAllAin »

Is the collision box supposed to rotate with the image for mining drills? The in-game perspective is the same. The only thing that rotates is the object. So it should be occupying basically the same amount of space. So why does the collision box rotate as well?

doc
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon Mar 28, 2016 3:52 pm
Contact:

Re: Collision Box Rotation[?]

Post by doc »

Maybe the collision box should be square in the first place so it wouldn't matter if it rotated. For non-square entities, e.g. pipes or combinators, rotation of the collision box is important.

AenAllAin
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Sat Apr 02, 2016 3:10 am
Contact:

Re: Collision Box Rotation[?]

Post by AenAllAin »

This makes me very sad. I can't post my drill mod because of this issue. I don't think the "everything must be a square, because Factorio hates rectangles" answer is a good one. Maybe, I didn't describe the problem well enough...

(a) I have a 3D model of a square drill. (b) When rendered from the game perspective it appears rectangular. (c) When the 3D model is rotated in 3D and re-rendered in game perspective it faces a different direction but is still a square in 3D and still appears to be a rectangle of the same dimensions from the game perspective. (d) Once all four sides/rotations have been rendered into game perspective, I properly attach them to a drill entity with four different directional animations. (e) I define the ONE collision box for the entity which is rectangular according to it's initial orientation. (f) In game, I place the initial oriented drill entity; it's collision box (as well as it's selection box) matches it's graphical orientation. (g) I rotate the drill ...it's f__ed up. The graphic looks correct, the selection box remains the same ...the rectangular collision box rotates and becomes oblong and looks nothing like the graphic.

What am I doing wrong?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Collision Box Rotation[?]

Post by Rseding91 »

Factorio was not built with rotatable non-square building entities in mind and as such it probably just won't work correctly for what you're after.
If you want to get ahold of me I'm almost always on Discord.

AenAllAin
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Sat Apr 02, 2016 3:10 am
Contact:

Re: Collision Box Rotation[?]

Post by AenAllAin »

Rseding91 wrote:Factorio was not built with rotatable non-square building entities in mind and as such it probably just won't work correctly for what you're after.
Aww ...so; it does have to be a square then? Ok; thanks for the answer.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Collision Box Rotation[?]

Post by Arch666Angel »

AenAllAin wrote:
Rseding91 wrote:Factorio was not built with rotatable non-square building entities in mind and as such it probably just won't work correctly for what you're after.
Aww ...so; it does have to be a square then? Ok; thanks for the answer.
From experience: Don't try to make it work for anything other than a square, it will drive you mad. The only thing which can work as a non square is the steam engine type.

You can try to play with the view angle before rendering, or stretching the model so it matches the square, another "hack" is to make your model higher in the mid section so it will cover the parts that wouldn't be covered by it otherwise.

User avatar
bSun0000
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jun 05, 2016 6:13 pm
Contact:

Re: Collision Box Rotation[?]

Post by bSun0000 »

I faced the same problem.. even if this game looks isometric, this collision boxes totally ruins it.
I hope, some day, this behavior will be changed, so we can specify - may this box to be rotated or not. Or define different geometries for different angles, like sprites.

User avatar
bSun0000
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jun 05, 2016 6:13 pm
Contact:

Re: Collision Box Rotation[?]

Post by bSun0000 »

And collision box also affects on sprites.. oh god, why... this is too cruel!

Post Reply

Return to “Modding help”