gnembon / fabric-carpet

Fabric Carpet
MIT License
1.65k stars 261 forks source link

Tick fake players in network updating phase #1847

Open zly2006 opened 6 months ago

zly2006 commented 6 months ago

In this PR, I moved fake player logic from EN to NU, so they can be ticked like real players.

There is also a new rule called fakePlayerTicksInEU for players who want the old fake player mechanics, it is false by default.

Fallen-Breath commented 6 months ago

See this discussion on scicraft discord in 2020, for gnembon's opinion on the player action pack timing: https://discord.com/channels/211786369951989762/573613501164159016/771405054632394782

for that to work properly would require a lot of chances and code - essentially attaching client code to the server part. Right now fake players don't differ that much from pigs. Is it bad that they behave like other server side entities?

Fallen-Breath commented 6 months ago

Also, "EN" and "NU" are not commonly used terms in the non-Chinese community. I would suggest using more precise words to describe them

zly2006 commented 6 months ago

Also, "EN" and "NU" are not commonly used terms in the non-Chinese community. I would suggest using more precise words to describe them

Could you provide more suggestions? what word should i use for tick phases?

for that to work properly would require a lot of chances and code - essentially attaching client code to the server part. Right now fake players don't differ that much from pigs. Is it bad that they behave like other server side entities?

In fact, in most situations we just expect fake players to be ticked and interact with other things in the game (actions) like real players, so that most farms can work both for real and fake players such as raid farms.

Btw, there is an option to configure--if you want pig-like fake players you can just turn it on.

Fallen-Breath commented 6 months ago

Could you provide more suggestions? what word should i use for tick phases?

In fact, in most situations we just expect fake players to be ticked and interact with other things in the game (actions) like real players, so that most farms can work both for real and fake players such as raid farms.

that's gnembon's opinion, I'll suggest to ask him directly

Btw, there is an option to configure--if you want pig-like fake players you can just turn it on.

See https://github.com/gnembon/fabric-carpet/pull/1847#discussion_r1412217146

altrisi commented 5 months ago

Is there any downside to only ticking them in the right/more correct phase? If there isn't I'd remove the old behaviour completely.

zly2006 commented 5 months ago

Is there any downside to only ticking them in the right/more correct phase? If there isn't I'd remove the old behaviour completely.

Some contraptions may be breoken after we changed this, so I think it is a right choice not to cchange the existing behavior and add an option to tick them in the correct phases.

altrisi commented 5 months ago

How many contraptions depend on fake players working differently than real ones? (outside of ones built specifically to detect them). I'd expect fake players would be used to test things where real players would be the actual target, so having them work for real-like players would be the idea (that's been the idea of fake players from the start, just wasn't completely accurate).

Having two code paths seems redundant when one is clearly "better" (more accurate). We'd also release this on a snapshot/major (mojang versioning wise) version anyway and we don't usually backport, so the chances of breaking being unnoticed are lower.

zly2006 commented 5 months ago

How many contraptions depend on fake players working differently than real ones? (outside of ones built specifically to detect them).

afaik, some raid farms are specially designed for fake players for the tick phase order, this makes them 1gt faster then real players

Having two code paths seems redundant when one is clearly "better" (more accurate). We'd also release this on a snapshot/major (mojang versioning wise) version anyway and we don't usually backport, so the chances of breaking being unnoticed are lower.

Yes, it is a breaking change so I just suggest we shoulld be more careful, I totally agree that a contraption that real players cannot use it not "useful".