flying units tag or collision box check for pathfinder/movement

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

flying units tag or collision box check for pathfinder/movement

Post by kyranzor »

In the Robot Army mod, I have integrated Klonan's Combat Units mod with the vanilla game style flying combat robot units.

The benefit of a flying unit is that the pathfinder doesn't need to worry about pathable areas/obstacles, and things like player's walls, transport belts (more on this later) and bodies of water become a non-issue. I want players who are frustrated with my ground-based combat droids to have a practical and useful alternative with these flying units.

Currently, I can simulate a flying unit 95% by making the collision box = {0,0}

The flying units will sometimes float over the top of walls, and pass through trees well, but the pathfinder still will not make valid paths over/through walls/trees/obstacles/bodies of water. This means that a squad of flying Defender robots will not be able to path to attack an enemy biter if the defender robot squad (aka, unit_group) is inside of an enclosed wall OR the enemy biter is located on an island with no land access.

Can we get a native way (access by a entity tag or dynamically detected when collision box = nil OR {0,0} ) to allow for an entity/unit with pathfinding capabilities to be treated as a simple unit (similar to the logistics/construction bots) for the purpose of movement?

As part of this request, a tag to disable the effects of transport belts on the unit/player would be amazing too. Thanks for your consideration!
Last edited by kyranzor on Mon Oct 17, 2016 9:58 pm, edited 1 time in total.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by aubergine18 »

Wait, collision boxes have a z-index?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by kyranzor »

lol my bad, it's a two-corner table. doesn't have 3 fields. I shall fix my original post.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by kyranzor »

bump - any ideas from devs?

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 712
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by Earendel »

Have you tried

Code: Select all

collision_mask = {}
or

Code: Select all

collision_mask = { "ghost-layer"}
Types/CollisionMask

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by kyranzor »

I tried that just now, thanks for the suggestion. It didn't work. I think the issue is at a unit pathfinder request level of the API, not really an entity mask/option issue. The entire unit_group would need to be made up of the special "flying" type unit before it could make the "no collision checks needed" pathfinder request. Right now, a flying group of units gets stuck on islands, for example.

edit: just to clarify, the units themselves CAN travel over water and walls etc with a nil or zero collision box/mask, but they cannot receive orders from the unit command API to go somewhere from A to B where the path between them is not pathable by land units. The unit API was done hastily and was only meant for land-based biters, so the code just simply isn't there for dealing with this issue. That is why i've put the request in here for Oxyd or whoever gets around to it to implement.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 712
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by Earendel »

Can the units be modified distractor capsules instead? The main advantage of using a 'unit' type is the access to pathfinding but you don't need that for a flier.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: flying units tag or collision box check for pathfinder/movement

Post by kyranzor »

The units work best for me because of their ability to be commanded and for then to form unit groups and be commanded as groups too. The API just can't handle flying groups that's all.

Post Reply

Return to “Modding interface requests”