Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: eri0o on Tue 04/02/2020 01:44:36

Title: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: eri0o on Tue 04/02/2020 01:44:36
AgsGet  version 0.1.0

For information on how to install, see the AGS Manual on how to install plug-ins (https://adventuregamestudio.github.io/ags-manual/Plugins.html#plugins).

(https://dev.azure.com/ericoporto/agsget/_apis/build/status/ericoporto.agsModuleList?branchName=master) (https://dev.azure.com/ericoporto/agsget/_build)

(https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png) Warning: Dangerously Experimental! Read below before using! (https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png)

Get Latest Release AGS.Plugin.AgsGet.dll (https://github.com/ericoporto/agsModuleList/releases/download/0.1.0/AGS.Plugin.AgsGet.dll) | GitHub Repository (https://github.com/ericoporto/agsModuleList)

AgsGet is an Editor Plugin for Managing Script Modules. Click the gif below to see it on video.

(https://user-images.githubusercontent.com/2244442/73703045-7695f300-46cd-11ea-871b-f44adedf0fa4.gif) (https://streamable.com/bmi9k)


(https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png) Warning: Dangerously Experimental! Read below before using! (https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png)

This Editor Plug-in has the following limitations:


Available features

Supports installing packages from my AGS Module List (https://ericoporto.github.io/agsModuleList/). You can also uninstall packages installed through AgsGet interface. If a package depends on other packages, the dependencies will be installed too, on the correct order in the scripts list.

A simplified search is provided too, an empty parameter will return all modules available.

For now, it doesn't care for versions, so if you install a package and a newer version of the package is made available on the package index the module you are using may get overwritten by a new version if the package is updated in your package cache.

This plugin should not save anything on itself on your Game.agf, so you should be able to just load a game you used it in an AGS Editor that doesn't have it.

How it works

AgsGet may create the following files in your game directory.


â"œâ"€â"€ ags_packages_cache/
â",   â"œâ"€â"€ package_index
â",   â"œâ"€â"€ pkg1/
â",   â",   â""â"€â"€ pkg1.scm
â",   â""â"€â"€ pkg2/
â",       â""â"€â"€ pkg2.scm
â",   ...
â",
â"œâ"€â"€ agsget-lock.json
â"œâ"€â"€ agsget-lock.json.removal
â""â"€â"€ agsget-manifest.json


Let's see the steps involved in installing a package:


Removing a package will remove the package from agsget-manifest.json, and the agsget-lock.json will be recreated, with the previous lock saved as agsget-lock.json.removal. Packages that are listed on agsget-lock.json.removal, but not on agsget-lock.json get removed.

Where do we go from here

This package manager implementation is created more as a proof of concept that it can be done. It appears that two things are actually the most iminent needs:

- A place to list all Script Modules including their metadata (specially to allow creating modules that depends from other modules).
- A place to store these Script Module that everyone can trust (this is a much harder problem to figure out).

Once the above is properly structured, creating the package manager to work with above is a much minor problem.

I created this Editor plug-in cutting a lot of corners to make it live in the shortest amount of time, the main idea was that people could experiment with it and talk about what they think of this idea, assessing if there's need from the community for a package manager or a central database... It's important to note that this tool is supposed to work along with the forum since packages don't work without communities. Mostly of the ideas in making this package manager were taken from this article from Sam Boyer (https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527), which has a presented design inspired by the package manager npm (https://en.wikipedia.org/wiki/Npm_(software)). Additionally, the general design of the package repository is based on early iterations of the vcpkg (https://github.com/microsoft/vcpkg), see it's ports directory.


Troubleshooting

If you downloaded this plugin from the internet and AGS complained something about policies when loading, the file is locked. You need to right click it, click on properties and then click Unblock, see image below.
(https://user-images.githubusercontent.com/2244442/73697349-3be48880-46d6-11ea-8a54-f934ba4629d5.png)

Edit: I've since include more modules in the website and index accessible through the plugin, if someone is missing a particular module, just comment on it and I will add it.
Title: Re: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: Monsieur OUXX on Tue 04/02/2020 14:08:46
This, with the right set of modules, would make AGS very, very powerful.
Title: Re: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: Crimson Wizard on Tue 04/02/2020 14:31:09
Quote from: Monsieur OUXX on Tue 04/02/2020 14:08:46
This, with the right set of modules, would make AGS very, very powerful.

This needs a properly maintained database where authors could register and update their modules. Right now the list, links and information is kept by hand, in a personal repository.
Title: Re: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: Monsieur OUXX on Tue 04/02/2020 15:55:56
Quote from: Crimson Wizard on Tue 04/02/2020 14:31:09
Quote from: Monsieur OUXX on Tue 04/02/2020 14:08:46
This, with the right set of modules, would make AGS very, very powerful.

This needs a properly maintained database where authors could register and update their modules. Right now the list, links and information is kept by hand, in a personal repository.

Yes, the author told me that it was a pain for him, but how about just storing the modules into github, maybe with an info file coming with each module, acting as a manifest?
Title: Re: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: eri0o on Tue 11/02/2020 19:06:46
Python PyPi has a simple specification for a package repository: https://www.python.org/dev/peps/pep-0503/

It still needs some autoindex generator if you are using a static host for packages like GitHub Pages. Also, tar.gz is a great format for packaging but can be alien to people that are only Windows users.

If this repository is updated through Pull Request from module authors it can still be updated and rely on authors pushing their updates.

Quote from: Monsieur OUXX on Tue 04/02/2020 15:55:56
maybe with an info file coming with each module, acting as a manifest?

I already do this, see rellax (https://github.com/ericoporto/rellax/blob/master/package.json):

Code (json) Select
{
  "id": "rellax",
  "name": "rellax",
  "text": "Rellax while the Camera tracks with cool parallax.",
  "forum": "https://www.adventuregamestudio.co.uk/forums/index.php?topic=57489.0",
  "version": "0.1.3",
  "author": "eri0o"
}


It could have an additional field where it would point to the url on the authors original download on the GitHub Release page. The problem is you need at least maintain an index to point to manifests or something. Deciding what should be in the manifest can be part of this discussion, I had to write one for all modules hosted.

Quote from: Crimson Wizard on Tue 04/02/2020 14:31:09
This needs a properly maintained database where authors could register and update their modules. Right now the list, links and information is kept by hand, in a personal repository.

I could not find any reasonable way to do this, maintaining a database is hard work, as is allowing people to write files in your server. Also there's the price to rent/own such infrastructure. I believe there's a way, I just personally don't know. A important note here is I have very little experience with public facing websites and how to build them.

For public generic binary distribution platforms, I found both NuGET (if people agree to write nuspec files) and bintray (if people agree to write pom files).

I could not quite decipher  Sonatype's Nexus and JFrog's Artifactory, but I believe both allow to host a public repository where people could log in and manage their own packages, just found their docs a bit hard to understand, so not sure if this could be done.

Other idea I had is being able to merge indexes, so people could maintain and share their own index and a developer could just grab one.
Title: Re: EDITOR PLUGIN: AgsGet - Version 0.1.0
Post by: eri0o on Sat 15/02/2020 16:16:50
I just found out that apparently this has already been done in an old thread:

https://www.adventuregamestudio.co.uk/forums/index.php?topic=51283.0
https://bitbucket.org/monkey0506/ags.plugin.libraries/src/master/

Has someone ever used this?