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

[ENGINE] Plugin overhaul (packaging, conflicts, cache) #264

Open
3 tasks
Promises opened this issue Mar 11, 2021 · 9 comments
Open
3 tasks

[ENGINE] Plugin overhaul (packaging, conflicts, cache) #264

Promises opened this issue Mar 11, 2021 · 9 comments
Labels
enhancement Enhancement to an existing feature needs workshopping new feature A new feature or request

Comments

@Promises
Copy link
Collaborator

Promises commented Mar 11, 2021

Game Engine Feature Description

Example: As a plugin developer, I expect to be able to be able to hook into the player init event. is to rebuild them as "packages", where each plugin is a folder, the folder has a manifest, and folders for: action hooks, configuration (npc/spawns/items configurations), and a folder for cache files. in the cache files folder you would have one folder for each index and the data inside them, when the server loads the plugin it should add these files to the fileserver for the clients to update.

The manifest: the manifest will have a small description of the plugin, booleans for what it includes (cache, hooks, configs), collisions ("collides: "skill_1" if it cannot exist with other plugins that override skill_1), it can depend on other plugins ("depends_on": "item_pack_osrs_180").

Acceptance Criteria

  • Plugins as self contained packages
  • Loading configs from plugins
  • Loading cache data from plugins

Additional Information

Please do discuss these suggested changes, as they are not small

@Promises Promises added new feature A new feature or request needs workshopping enhancement Enhancement to an existing feature labels Mar 11, 2021
@Promises
Copy link
Collaborator Author

This could be used to completely replace a skill, for example firemaking is quite useless, but a skill to create magic equipment (like smithing for melee and crafting/fletch for ranged) could be quite useful, but in that case you would not want there to be any other plugin that adds the skill firemaking.
this feature would make it possible to create custom items for use in the plugin, custom npcs as tutors/masters, custom areas for quests related to the skill(even as separate plugins that depend on the main skill plugin), action hooks for the skill itself, and configurations for all the added data.

@Promises
Copy link
Collaborator Author

Additional suggestion based on this issue:
Packet definitions based on a plugin, ("collides":"base_packets"), which could enable users to just drop a plugin in to connect a new client revision.

@SchauweM
Copy link
Collaborator

SchauweM commented Mar 11, 2021

I'm not too sure about creating our own manifest file for this. Shouldn't we use package.json for all this metadata? that way plugins can be published on NPM & dependencies can be managed by NPM. In the package.json file we could then add the rest of what you're purposing.

I love the rest of the suggestions

TLDR: dependencies should be managed by NPM, all other stuff can be written in the package.json file IMO

@SchauweM
Copy link
Collaborator

Is #226 now a blocking dependency or is it the other way around?

@Promises
Copy link
Collaborator Author

#226 will allow disabling plugins without removing them, in that way we can ship some creative stuff, but keep it disabled

@Tynarus
Copy link
Member

Tynarus commented Mar 11, 2021

Going to request "Loading cache data from plugins" be stricken from the list, as we need to further our filestore system to make something like this possible. We can split it out into a spike, what says you @SchauweM ?

@Promises
Copy link
Collaborator Author

@Tynarus Id say this whole pr is focused on loading cache data from plugins, and without that part, the way plugins work now is fine.

@Promises
Copy link
Collaborator Author

Promises commented Mar 26, 2021

Id like to add an example layout of a plugin:

└── wintertodt.plugin
    ├── config
    │   ├── items.json
    │   ├── npcs.json
    │   └── npc-spawns.json
    ├── data
    │   ├── maps
    │   │   ├── 1.dat
    │   │   └── 2.dat
    │   ├── models
    │   │   └── burner.dat
    │   ├── npcs
    │   │   └── wintertodt_beast.dat
    │   └── widgets
    │       └── burner.dat
    ├── hooks
    │   └── wintertodt-minigame.hook.ts
    └── wintertodt.manifest.ts

@Jameskmonger
Copy link
Collaborator

One clear distinction I see between an example like above and our current state is that, in the example above, the configuration data is a distinct child of the plugin. Currently our config lives at the root level

I can see a risk with a setup like above where data becomes duplicated throughout the project (with everyone defining their own rs:.... for the same pieces of information)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature needs workshopping new feature A new feature or request
Projects
None yet
Development

No branches or pull requests

4 participants