Skip to content

Document compatibility guarantee precisely #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

appgurueu
Copy link
Contributor

Probably needs @luanti-org/engine input to be safe.

I tried to structure this around the content creator and player perspective.
Originally I also wanted to have the server host perspective, but that turned out too sparse to be worthwhile.

Should be squashed.

@appgurueu appgurueu added Content: Creators Content directed at creators Content: Players Content directed at players labels Mar 31, 2025
@appgurueu appgurueu requested review from Copilot and removed request for Copilot March 31, 2025 23:36
Copilot

This comment was marked as spam.

Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. 👍


You could also mention:

  • texture packs
  • settings

(Both have pretty much no compatibility guarantees by the engine, AFAIK.)

there could be collisions in the future. [^maintenance]
If you are forced to share a namespace with the engine (e.g. in entity definitions or item definitions),
the current convention is to prefix your fields with an underscore (`_`);
if multiple mods share the same namespace, using the mod name for namespacing is recommended.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example might be good.
I.e. do we suggest _modname_foo or modname_foo (or modname.foo)? Some common mods use the latter (pipeworks, mesecons), but we might want to recommend the former.

Hence you may have a working configuration, add a new mod enabling/using one of these new features,
and by this cause issues with existing old mods.

For example Luanti 5.9 allowed omitting punchers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... in on_punch callbacks"?

Copy link
Contributor Author

@appgurueu appgurueu Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally, both in obj:punch(...) and consequently also in the callbacks including e.g. on punchplayer (which is what breaks these mods), but i don't want to get into details too much

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need more details, but context. "Omit punchers" without any context just sounds confusing.

which is inevitable: The older mod needs to decide what to do in case of a missing puncher.

Backwards compatibility is not absolute.
Sometimes old mods or games will break because a bug has been fixed,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also be in the for-creators file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is here deliberately - it explains to players that sometimes the engine will break content, and the solution may be to upgrade that content. like with the bone override bugfix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be here. But also in for-creators, because this info is part of the API backwards compatibility doc. Creators need to know that it is possible that bugs in (non-side) effects can be fixed.

that world need no longer be compatible with older Luanti versions,
e.g. because compression has been upgraded or legacy serialization formats
have been upgraded to more modern ones.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably mention the --migrate* and --recompress CLI features.

Also, while serialization formats are usually not deprecated, db backends are.
(((And btw., for advanced db backends, like postgres, that you only get if you (as an advanced user) explicitly enable it, you (as an advanced user) can be more easily expected to migrate, imo.)))

(Some features however can be implemented purely on the server or on the client,
making them automatically compatible with older client and server versions respectively.)

Older clients should be able to connect to and be able to play on newer servers,
Copy link
Contributor

@sfan5 sfan5 Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: this whole file is written in a specification style ("should" over "is/are" or "will") which isn't very reassuring to readers

Copy link
Member

@SmallJoker SmallJoker Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just shorten the entire section to this:

Within the same major Luanti version, the server and client (i.e. the instance that you
are using) agree to communicate on the lower feature set of the two. Whereas some features
can be purely client-side or server-side, others do depend on the counterpart. Hence, using
an equally new or more recent client version tends to result in a better experience.

so long as they do not use any newer features they do not support.

This means that, so long as the game remains the same,
it is possible to safely upgrade client and server independently.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curiously this sentence is assertive while in practice it's more of a "mostly"

Comment on lines +40 to +43
For example Luanti 5.9 allowed omitting punchers.
Mods that were written against older versions may expect there to always be a puncher.
If a new mod now omits the puncher (as it may), this may cause a crash in an older mod,
which is inevitable: The older mod needs to decide what to do in case of a missing puncher.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples are good but this may be too technical

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just wonder if the point is clear without the example. if not, maybe we can find a better example?

Comment on lines +92 to +98
can and will be extended by adding new constants, functions or methods.
Generally, as a rule of thumb, "tables may have more fields in the future".

Maybe there is no `core.frobnicate` today, but there might be tomorrow.
This is why you should use your own namespaces and wrappers
and not try to "extend" engine namespaces or classes yourself -
there could be collisions in the future. [^maintenance]
Copy link
Member

@SmallJoker SmallJoker Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we compress this this?

Suggested change
can and will be extended by adding new constants, functions or methods.
Generally, as a rule of thumb, "tables may have more fields in the future".
Maybe there is no `core.frobnicate` today, but there might be tomorrow.
This is why you should use your own namespaces and wrappers
and not try to "extend" engine namespaces or classes yourself -
there could be collisions in the future. [^maintenance]
may include additional fields, return values or function arguments in the future.
To avoid potentially sabotaging the engine API in the future,
mods should only use and extend their own namespace where possible.

and not try to "extend" engine namespaces or classes yourself -
there could be collisions in the future. [^maintenance]
If you are forced to share a namespace with the engine (e.g. in entity definitions or item definitions),
the current convention is to prefix your fields with an underscore (`_`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant documentation. Please refer to lua_api.md -> Entity definition -> _custom_field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: Creators Content directed at creators Content: Players Content directed at players
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants