Allow units to request non-colliding simple path

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:

Allow units to request non-colliding simple path

Post by kyranzor »

I have flying units that when requesting a path (using move_to or other forms of unit commands) cannot path over walls or water, yet they can actually move over them due to no collision box (like all flying robots in the game).

I request that a flag be available during the set_command either at a unit level, or at a unit_group level to request a simple path that a non-colliding unit can follow. There would be some very small overhead in checking the flag, and then more overhead after that to confirm that all members of the unit_group have a nil or 0.0 collision box, before returning/giving the simple path command to the unit_group. Should fail if one or more members of the unit_group would not be able to do the path (due to having a collision box).

The pathing would be point-to-point, ultra simple and very fast compared to worrying about pathable terrain or obstructions.

- specifically I think this is fine being at a unit_group level only, but I suppose if the logic is quick enough then applying the same flags to a single unit entity set_command request then that would be awesome too
- I think this would be awesome to add anyway, so that modders (like bobingabout) can make crazy evil flying biters/spitters that can properly path over player's walls or over oceans and attack deep in the player's bases. This sort of API/engine change would be handy for many mods.

folk
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Fri Mar 03, 2017 5:00 pm
Contact:

Re: Allow units to request non-colliding simple path

Post by folk »

[12:09 PM] kyranzor: Hey any modders who deal with units or unit_groups or want to support my mod API request, please post on this API request: viewtopic.php?f=28&t=47033
[12:10 PM] kyranzor: i mean how else are we going to get mutalisks and other flying enemies into the game? lol
[12:10 PM] folk: I certainly disagree with this "Should fail if one or more members of the unit_group would not be able to do the path (due to having a collision box)."
[12:11 PM] folk: surely a unit group can be a mix, and it should still apply the command to units that can execute it?
[12:20 PM] kyranzor: then you'd have the unitgroup splinter off and be useless which causes many more problems later on
[12:21 PM] kyranzor: for example the position of a unitgroup is the average of the members. A lot of calculations and logic is based on the unit_group's position - if half the squad is flying, and not ALL of the members can do the path, then it should fail, or revert to a path for ALL members being able to follow
[12:21 PM] folk: you mentioned mutalisks, and certainly every RTS I can think of behaves the way I described
[12:21 PM] kyranzor: RTS games don't use unit_group style logic
[12:22 PM] kyranzor: if the logic changes were available on a per-unit basis, and commands are issued individually to each unit (which is what a classic RTS does) then yes, it would be okay.
[12:22 PM] kyranzor: the flying units would path there, and the others would ignore it (if they can't get there) or go there by land route around obstacles in their own time
[12:22 PM] folk: I'm just going to copy-paste the past 10 lines into that thread

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Allow units to request non-colliding simple path

Post by bobingabout »

I'd consider using it. enemies that can fly would definitely add to my mod.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: Allow units to request non-colliding simple path

Post by dauphin »

+1

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Allow units to request non-colliding simple path

Post by TheSAguy »

+1
Sounds like a great idea!
Bio diversity is always a nice thing to have.


Advanced request:

If they are going to do it, it might be worth doing it on the terrain level also.

Have Desert creatures, cant go outside of a set of desert tiles. (Same with other tiles)
Amphibious creatures, can only wonder x-tiles outside of bodies of water.
Jumping units, can jump over obstructions like walls small bodies of water.

Thanks.

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

Re: Allow units to request non-colliding simple path

Post by kyranzor »

So basically, "biome" tags for units? Interesting thought! Adds a lot more logic to the pathfinder though, and the jumper one would be hard. I'd love to see that implemented eventually too :)

Post Reply

Return to “Modding interface requests”