Skip to content
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

Handling of MML/Lua resources in network games and save files #24

Open
aaronfreed opened this issue Jul 17, 2024 · 1 comment
Open

Handling of MML/Lua resources in network games and save files #24

aaronfreed opened this issue Jul 17, 2024 · 1 comment
Labels
difficulty: normal Will require careful planning and testing. type: enhancement New feature or request

Comments

@aaronfreed
Copy link
Contributor

aaronfreed commented Jul 17, 2024

Aleph One/Bet does not save the contents of the original OS’ resource fork in saved games, nor does it bother transmitting them over network games. This poses problems in certain cases, especially but not exclusively for embedded TEXT resources. This is a problem for several reasons, and I would like Aleph Bet to handle it less clumsily.

Currently, there is only one way to reuse the same script file within multiple levels that works on all three major operating systems, other than literally copying it to the directory of each map that uses it (and repeating this every single time it’s changed): embed it as a TEXT resource. (Aside 1: This is a major flaw with Atque that we should take a look at fixing. AFAIK, it can use hard links on MacOS and Linux, but not Windows, and cannot use symlinks on any OS.)

The problems here should be obvious, chief among them:

  1. All scripts that are embedded in a map as TEXT resources will be lost if their parent map is not accessible to Aleph One/Bet when a player loads a saved game from that map. Thus:
    • If someone wants to transfer their saves from Eternal 1.3 preview 5 to 1.3 preview 6, the Lua scripts on the level they load won’t run, so they’ll lose all their secret collection info, etc., unless they know how to edit the save file header. (Aside 2: It might be worth creating a utility to associate a particular saved game or film file with a specific map.) For the final release, I won’t be embedding TEXT resources, but they’re vastly more convenient while we’re still in the development stage.
    • For similar reasons, we had to edit the map headers for the hellpak patches so that players would be able to transfer their saves between versions. This is generally a Bad Idea™, but in this case all the alternatives seemed worse.
  2. Network games on maps that depend on MML/Lua scripts embedded as TEXT resources will quickly go out of sync unless all players have the map.

My solution is very simple: I’d like Aleph Bet to save all TEXT resources (or at the very least, all TEXT resources called as either MML or Lua scripts) in saved games and to transmit them over the network. The former of these, at least, should be a relatively easy fix; the latter may be worth holding off until Netzspieldämmerung, depending on how complicated it would be to implement it independently. (It may be as simple as “only transmit TEXT resources if all players are using Aleph Bet.”)

(I can see a potential case for adding a setting for how to handle other parts of the resource fork (snd, CLUT, PICT, etc.), but I strongly support treating embedded MML/Lua scripts as a special case and always saving or transmitting them.)

@aaronfreed aaronfreed changed the title Handling of resources in network games and save files Handling of MML/Lua resources in network games and save files Jul 17, 2024
@SolraBizna
Copy link
Member

SolraBizna commented Jul 22, 2024

This is a worthy goal. It's a little more challenging than it might appear at first glance:

  • Network protocol needs to be extended to send all Lua scripts, not just the netscript
  • Saved game format needs to be extended to store the active Lua scripts for the current level
  • Network join + save load need to be modified to not load TEXT resources for the level if and only if they got them from the network/save.

Edit: not to mention the rabbit hole of sending MML over the network.

@SolraBizna SolraBizna added type: enhancement New feature or request difficulty: normal Will require careful planning and testing. labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: normal Will require careful planning and testing. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants