How is something being within range computed?
Posted: Mon May 11, 2020 6:59 pm
Looking at https://lua-api.factorio.com/latest/LuaControl.html, I see the following values relate to reach.
build_distance :: uint [R] The build distance of this character or max uint when not a character or player connected to a character.
drop_item_distance :: uint [R] The item drop distance of this character or max uint when not a character or player connected to a character.
reach_distance :: uint [R] The reach distance of this character or max uint when not a character or player connected to a character.
item_pickup_distance :: double [R] The item pickup distance of this character or max double when not a character or player connected to a character.
loot_pickup_distance :: double [R] The loot pickup distance of this character or max double when not a character or player connected to a character.
resource_reach_distance :: double [R] The resource reach distance of this character or max double when not a character or player connected to a character.
When are each of these used?
By default these values are 10, 10, 10, 1, 2, 2.7 respectively but how are these values used to compute if something is within range? Also how does the game compute 'can_reach_entity(entity)'?
Edit: After doing some testing by making the player walk in specific directions for specific amount of frames, it seems that build_distance, reach_distance, resource_reach distance find what point in an entity's bounding box is closest to the player and checks if the distance between that and the players position is under the value.
build_distance :: uint [R] The build distance of this character or max uint when not a character or player connected to a character.
drop_item_distance :: uint [R] The item drop distance of this character or max uint when not a character or player connected to a character.
reach_distance :: uint [R] The reach distance of this character or max uint when not a character or player connected to a character.
item_pickup_distance :: double [R] The item pickup distance of this character or max double when not a character or player connected to a character.
loot_pickup_distance :: double [R] The loot pickup distance of this character or max double when not a character or player connected to a character.
resource_reach_distance :: double [R] The resource reach distance of this character or max double when not a character or player connected to a character.
When are each of these used?
By default these values are 10, 10, 10, 1, 2, 2.7 respectively but how are these values used to compute if something is within range? Also how does the game compute 'can_reach_entity(entity)'?
Edit: After doing some testing by making the player walk in specific directions for specific amount of frames, it seems that build_distance, reach_distance, resource_reach distance find what point in an entity's bounding box is closest to the player and checks if the distance between that and the players position is under the value.