#Question to the devs: Would irregular bounding boxes ever happen?

1 messages · Page 1 of 1 (latest)

woeful bridge
#

How many people would I need to sacrifice to get support for hollow or L shaped or cross shaped or whatever bounding boxes for entities? It'd allow for way weirder and more interesting modded entities and would be very cool

dim hinge
#

I don't think that would ever happen even rails aren't anything but rectangles

heavy granite
#

aren't elevated rail supports shaped like a plus sign?

#

or a square with 1 tile cut from the corners?

dim hinge
#

Technically a circle
But yea

I'm fairly sure it's done with 2 rectangles

#

Everything is a box

heavy granite
#

i guess the collision boxes for entities can be as wacky as you like, since you can just add extra collision boxes to get the desired shape. but if inserters need to interact with an entity, i believe the code which governs that is not really designed for anything other than rectangles

wispy zephyr
#

From what i heard, its the opposite, they are trying to remove multiple collision boxes per entity as that makes some things more complicated. And old rails are the only thing thst has them right now

golden mauve
#

The diagonal ones just have a diagonal hitbox, but it's still a rectangle

#

Which means that if you place stuff around the base, you get a plus sign

vagrant holly
#

concave boxes are annoying to deal with

formal patrol
#

Whatever the bounding boxes are, they must support convertion into axis aligned bounding box and must support collide check with other bounding box

#

Legacy curved rails are the only entities with two boxes as we want to get rid of this logic

#

Personally i predict this will never happen because of performance consideration of collide checks of moving trains, but also because this requires deep verification if all extra cases are correctly detected, for example assemblers reject rotating by 90deg if box is not a sqare because 90deg rotated would not overlap with itself from before rotation and doing it could rotate into a collision

dim hinge
#

Could a diagonal hitbox be made for an assembler?

void sandal
#

The way I parse this, any rectangle is fine.

#

Not sure what a diagonal hitbox is. Do you mean diamond shaped? That's also a rectangle.

dim hinge
#

Yes

void sandal
#

We have those already. Non-cardinally aligned rail supports have such hitboxes.

golden mauve
#

+api type BoundingBox

foggy thunderBOT
#

BoundingBoxes are typically centered around the position of an entity.

BoundingBoxes are usually specified with the short-hand notation of passing an array of exactly 2 or 3 items.

The first tuple item is left_top, the second tuple item is right_bottom. The third tuple item is a float that represents the orientation.

Positive x goes towards east, positive y goes towards south. This means that the upper-left point is the least dimension in x and y, and lower-right is the greatest.