[0.18.26] Forces are not friendly with themselves

Bugs that are actually features.
Post Reply
User avatar
undermark5
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu May 21, 2020 10:55 pm
Contact:

[0.18.26] Forces are not friendly with themselves

Post by undermark5 »

I'm working on updating the mod Nice Try, Train to be a bit more robust and configurable. In trying add an option to allow the trains of non-friendly forces to kill the player I was trying to use the get_friend method from the player's force with the train's force as a parameter. In my testing it appears that even though both have a force ID of 1, they are not "friends". Obviously, it would be simple enough to check the IDs are the same (if I'm understanding force IDs correctly) and if they are not then to check for friendly forces, but in my head it makes more sense that a force is friendly with itself.

User avatar
undermark5
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu May 21, 2020 10:55 pm
Contact:

Re: [0.18.26] Forces are not friendly with themselves

Post by undermark5 »

Also, it would appear that friendliness is not symmetric either (case stated above is reflexive). In other words, Force B is friend of Force A, but Force A is not necessarily friend of Force B, is there a reason for this specific behavior?

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

Re: [0.18.26] Forces are not friendly with themselves

Post by Rseding91 »

Thanks for the report. All of the behavior you're seeing is correct and intended.

A friend force is purely only "a force that is in the friends list for me." It does not need to have the other force also have it in its friends list. Additionally a force does not need to have itself in its friends list.
If you want to get ahold of me I'm almost always on Discord.

User avatar
undermark5
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu May 21, 2020 10:55 pm
Contact:

Re: [0.18.26] Forces are not friendly with themselves

Post by undermark5 »

So, in theory a force could grant all other forces access to their buildings and resources but none of the other forces are required to do so? To me, that is not friends... In all other situations that I'm familiar with, friends are symmetric, that is, someone cannot be your friend unless you are their friend. You can certainly be friendly to someone that is not friendly back, but to me (and maybe I'm an outlier on this) friend describes a relationship that is symmetric. Perhaps either greater documentation for what defines friends is in order, or a different name for those methods should be considered. Perhaps has_access and give_access would make more sense, then the cease_fire idea should be separated. Also, thinking of it from a file access structure in linux, you have 3 different levels, owner, group, and world. all members of the group have the same access on any given resource as any other member, however, individual resources can be set to allow different levels of group access. An owner can also change these levels at any time as well as changing the group(s) that has access.

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

Re: [0.18.26] Forces are not friendly with themselves

Post by Rseding91 »

undermark5 wrote:
Fri May 22, 2020 12:23 am
So, in theory a force could grant all other forces access to their buildings and resources but none of the other forces are required to do so?
Yes. As I said it's purely "is the other force in my list of friends" that's all it is: a "force is in this list". It's not going to be changing.
If you want to get ahold of me I'm almost always on Discord.

User avatar
undermark5
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu May 21, 2020 10:55 pm
Contact:

Re: [0.18.26] Forces are not friendly with themselves

Post by undermark5 »

Right, the functionality might not need to change, but the documentation or the method name should definitely be changed to make things more clear.

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: [0.18.26] Forces are not friendly with themselves

Post by Ranger_Aurelien »

I have this memory it could be abused by Player A declaring "Friends" with force B (both become symmetrical friends) to sneak past ForceB, then unfriending and attacking. If each faction needs to declare it, then it is intentional...
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

User avatar
undermark5
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu May 21, 2020 10:55 pm
Contact:

Re: [0.18.26] Forces are not friendly with themselves

Post by undermark5 »

Right, it could be abused if it automatically created a symmetric relationship, however, given Rseding's very definitive response, symmetric friend is not something that will be implemented. I'm fine with that, what I'm not fine with is the notion of friend conveys an idea of a mutual reciprocating symmetric relationship and the documentation severely lacking what exactly a "friend" is.

Also, if it were to be implemented I'm sure it would be done with a request that allows the other force to accept or decline the alliance which prevents the system from being abused in the way you suggested.

Post Reply

Return to “Not a bug”