Add ability to use map generator bounding box in can_place_entity

Things that we aren't going to implement
Post Reply
orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Add ability to use map generator bounding box in can_place_entity

Post by orzelek »

Today's FFF describes new map generator bounding box added to entities to fix up enemy bases.
Please make sure that there is an option in can_place_entity that will make it use same bounding box so mods can use it when placing enemy bases.

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

Re: Add ability to use map generator bounding box in can_place_entity

Post by Rseding91 »

That's not likely to ever happen.

Map generation has exactly 2 places where it checks if an entity would collide with the world and it completely ignores the rest of the logic in those 2 places.

Making can-place-entity work with different bounding boxes is asking for the entire buildability check system to be re-written and as I said above: that's not likely to ever happen.


An entity is buildable if it's buildablity check passes. It's placeable through the ma generator if the basic map generator bounding box doesn't collide *and* the normal buildability checks pass.
If you want to get ahold of me I'm almost always on Discord.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Add ability to use map generator bounding box in can_place_entity

Post by orzelek »

So maybe a separate method for this?

If there is no access to this then RSO bases will still have bugs while base game ones won't. This is kind od dissapointing.
Basically I need to reimplement this logic on lua side somehow or RSO bases wil be subpar.

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

Re: Add ability to use map generator bounding box in can_place_entity

Post by Rseding91 »

I'm not against adding a simple LuaSurface::collides(boudning box, collision mask, direction) - which is what the map generation logic uses. But I'm never going to re-write the entire can-build-entity collision system to support arbitrary collision boxes.
If you want to get ahold of me I'm almost always on Discord.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Add ability to use map generator bounding box in can_place_entity

Post by orzelek »

That would work as long as new collision box is available from prototype.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add ability to use map generator bounding box in can_place_entity

Post by Bilka »

orzelek wrote:
Sun Feb 24, 2019 10:20 am
That would work as long as new collision box is available from prototype.
It wasn't available so I added LuaEntityPrototype::map_generator_bounding_box. Now nothing should be in the way of adding LuaSurface::collides().
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Add ability to use map generator bounding box in can_place_entity

Post by orzelek »

Since request is in won't implement should I add new one for simple collision?

I actually had an idea for slightly different way.
Add a version of find_non_colliding_position that would accept collision box instead of name of entity prototype.
It could use then either of collision masks depending on how you call it.

Post Reply

Return to “Won't implement”