Vendetta/overview: Difference between revisions

From Quasar-RCE
Jump to navigationJump to search
Luxen (talk | contribs)
Imported overview page from wiki.js instance. needs to be edited, as some details have significantly changed since this was first written.
 
Updated overview page to better match Neoloader v6.11.0
Line 1: Line 1:
Neoloader provides a number of benefits to the Vendetta Online modding environment. These include:
== '''Why modders should use Neoloader''' ==
The goals of Neoloader are twofold: make complex mods easier to develop, and make mods safer to run and manage for the user.


a system that introduces dependency-based load ordering
* Neoloader provides a stable and managed way to load plugins based on their dependencies, and introduces safety measures for the plugin loading process
in-game toolset for enabling and disabling mods loaded through Neoloader
* Neoloader provides an in-game toolset for managing a mod's state and settings directly
an API that promotes inter-mod communication and expandability, including with Neoloader itself
* Neoloader provides an API that promotes inter-mod communication and expandability, including with Neoloader itself
Currently, no alternative exists for Vendetta Online. Plugins could be (and historically have been) designed for the ASCII-betical plugin loader. Neoloader doesn't replace this, but runs before it using built-in game mechanics to provide its extended functionality without need for exploits.


LME and NPLME (Neoloader):
Currently, no alternative exists for Vendetta Online. Plugins could be (and historically have been) designed in a monolithic style for the ASCII-betical plugin loader. Due to this, mods rarely communicate with each other, and a lot of duplicated code exists between projects.


It is important for plugin developers to note that Neoloader itself is an implementation of a "Library Management Engine". The public-facing API could be seen as LME, where how that API is implemented is Neoloader. This distinction is important in the event that a new tool supercedes Neoloader in the future while providing the same features. For a game like Vendetta Online, which is undergoing active development to this day, this distinction helps future-proof plugins as the game changes. Indeed, as long as the API itself remains untouched, how that API is implemented should not matter.
Neoloader doesn't replace the default plugin loader embedded in the game, but runs before it using built-in game mechanics to provide its extended functionality without need for exploits.


Startup Process:
== Regarding the LME terminology ==


Neoloader loads itself as Vendetta Online's interface, using the if= option in config.ini. As such, it will always be the first plugin to be loaded. Neoloader first sets up basic functionality and builds the API in the public "lib" table, before entering "Init", or loader phase. This is the phase that handles loading and executing existing compatible mods. This Init process is described in the image below.
It is important for plugin developers to note that Neoloader itself is an implementation of a "Library Management Engine". The public-facing API could be seen as LME, where how that API is implemented is Neoloader. This distinction is important in the event that a new tool supercedes Neoloader in the future while providing the same features. For a game like Vendetta Online, which is undergoing active development to this day, this distinction helps future-proof plugins as the game changes. Indeed, as long as the API itself remains untouched, how that API is implemented should not matter.
 
 
A flowchart representing Neoloader's initialization procedures, designed before version 6.x.x; it mostly holds accurate.
When sorting mods into their dependent orders, it is important to note a few exceptions to this rule due to how the process works. When a plugin is registered in Neoloader, it is given a "Load State" which determines whether the plugin should be allowed to load or not, and under what circumstances.
 
Possible Load States for plugins:
NO
This plugin will not load
YES
This plugin will load using normal rules
FORCE
This plugin will load even if its dependencies are not met
AUTH
This plugin will be given Neoloader's auth key when it loads
Normally, the YES/NO load states will be the only ones available; the FORCE and AUTH load states are intended for plugin developers to use.
 
Once the Init phase is complete, it assigns a few events and commands, before completing. At this point, the standard client takes back over and begins the normal mod loading procedure.


Checking for Neoloader's existence:
== '''How Neoloader works''' ==
Neoloader loads itself as Vendetta Online's interface, using the <nowiki>if=</nowiki> option in config.ini. As such, it will always be the first plugin to be loaded. Neoloader first sets up basic functionality and builds the API in the public "lib" table, before entering "Init", or the loader phase, where it handles loading and executing all mods that have been registered to the loading system. Once the Init phase is complete, it assigns a few events and commands, before completing. At this point, the game client takes back over and begins the normal mod loading procedure.


Before executing any LME functions, mods should check for the existence of Neoloader. This can be done with two various bits of code.
Due to the highly limited file access abilities of the Vendetta Online sandbox, Neoloader cannot see plugins when installed. Instead, plugins must manually 'register' themselves to Neoloader during the normal mod loader's execution. Neoloader saves the path of the INI registration file to the game's config.ini; this is what is iterated over during the Init period.


The first option is to check for the public boolean "NEO_EXISTS". When Neoloader starts, it assigns this boolean value. However, this is not the preferred method for checking for Neoloader's existence; your plugin would become reliant on Neoloader specifically. The API is designed to be 'generic' - that is, an alternative resource could provide the same API. As such, the preferred method is to check for both 'lib' and 'lib[0]', as defined below:
To register a mod or execute any LME functions at the time of the game's normal plugin loading process, mods should check for the existence of Neoloader. To do this, plugins should wrap all LME calls within a check for the correct environment, as described here:


<syntaxhighlight lang="lua" line>
if (type(lib) == "table") and (lib[0] == "LME")) then
if (type(lib) == "table") and (lib[0] == "LME")) then
     --LME API functions here
     --LME API functions here
end
end
</syntaxhighlight>


You can explore how this used in some of the plugins located in the examples folder provided with this documentation (todo). The Design page also describes how to set up specific files to make your plugin ready for management through Neoloader.
You can explore how this used in some of the plugins located in the development examples package provided here (todo). The Design page also describes how to set up specific files to make your plugin ready for management through Neoloader.

Revision as of 02:53, 3 March 2025

Why modders should use Neoloader

The goals of Neoloader are twofold: make complex mods easier to develop, and make mods safer to run and manage for the user.

  • Neoloader provides a stable and managed way to load plugins based on their dependencies, and introduces safety measures for the plugin loading process
  • Neoloader provides an in-game toolset for managing a mod's state and settings directly
  • Neoloader provides an API that promotes inter-mod communication and expandability, including with Neoloader itself

Currently, no alternative exists for Vendetta Online. Plugins could be (and historically have been) designed in a monolithic style for the ASCII-betical plugin loader. Due to this, mods rarely communicate with each other, and a lot of duplicated code exists between projects.

Neoloader doesn't replace the default plugin loader embedded in the game, but runs before it using built-in game mechanics to provide its extended functionality without need for exploits.

Regarding the LME terminology

It is important for plugin developers to note that Neoloader itself is an implementation of a "Library Management Engine". The public-facing API could be seen as LME, where how that API is implemented is Neoloader. This distinction is important in the event that a new tool supercedes Neoloader in the future while providing the same features. For a game like Vendetta Online, which is undergoing active development to this day, this distinction helps future-proof plugins as the game changes. Indeed, as long as the API itself remains untouched, how that API is implemented should not matter.

How Neoloader works

Neoloader loads itself as Vendetta Online's interface, using the if= option in config.ini. As such, it will always be the first plugin to be loaded. Neoloader first sets up basic functionality and builds the API in the public "lib" table, before entering "Init", or the loader phase, where it handles loading and executing all mods that have been registered to the loading system. Once the Init phase is complete, it assigns a few events and commands, before completing. At this point, the game client takes back over and begins the normal mod loading procedure.

Due to the highly limited file access abilities of the Vendetta Online sandbox, Neoloader cannot see plugins when installed. Instead, plugins must manually 'register' themselves to Neoloader during the normal mod loader's execution. Neoloader saves the path of the INI registration file to the game's config.ini; this is what is iterated over during the Init period.

To register a mod or execute any LME functions at the time of the game's normal plugin loading process, mods should check for the existence of Neoloader. To do this, plugins should wrap all LME calls within a check for the correct environment, as described here:

if (type(lib) == "table") and (lib[0] == "LME")) then
    --LME API functions here
end

You can explore how this used in some of the plugins located in the development examples package provided here (todo). The Design page also describes how to set up specific files to make your plugin ready for management through Neoloader.