-
Notifications
You must be signed in to change notification settings - Fork 1
/
AGSGET_README.bbcode
82 lines (54 loc) · 6.68 KB
/
AGSGET_README.bbcode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[b][size=14pt]AgsGet[/size][/b] [color=gray][b] version 0.1.0 [/b][/color]
[url=https://dev.azure.com/ericoporto/agsget/_build][img]https://dev.azure.com/ericoporto/agsget/_apis/build/status/ericoporto.agsModuleList?branchName=master[/img][/url]
[img width=16 height=16]https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png[/img] [b][color=brown]Warning: Dangerously Experimental! Read below before using![/color][/b] [img width=16 height=16]https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png[/img]
[url=https://github.com/ericoporto/agsModuleList/releases/download/0.1.0/AGS.Plugin.AgsGet.dll]Get Latest Release [b]AGS.Plugin.AgsGet.dll[/b][/url] | [url=https://github.com/ericoporto/agsModuleList]GitHub Repository[/url]
AgsGet is an Editor Plugin for Managing Script Modules. Click the gif below to see it on video.
[url=https://streamable.com/bmi9k][img]https://user-images.githubusercontent.com/2244442/73703045-7695f300-46cd-11ea-871b-f44adedf0fa4.gif[/img][/url]
[img width=16 height=16]https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png[/img] [b][color=brown]Warning: Dangerously Experimental! Read below before using![/color][/b] [img width=16 height=16]https://user-images.githubusercontent.com/2244442/73706331-faa0a880-46d6-11ea-8f18-56495ad5ff67.png[/img]
This Editor Plug-in has the following limitations:
[list]
[li]It won't work in your game if you are using Script Folders;[/li]
[li][b]There may be a case where it crashes and leaves your game in broken state, requiring manual edit of [tt]Game.agf[/tt][/b];[/li]
[li]If you install or remove a script module that has the same name of a script in your game it will delete your script and replace it for the module;[/li]
[li]If you ever install or uninstall a package, any script module listed in the lockfile will replace any changes you do to them for the ones in the Package Cache.[/li]
[/list]
[b][size=12pt]Available features[/size][/b]
Supports installing packages from [url=https://ericoporto.github.io/agsModuleList/]my AGS Module List[/url]. 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.
[b][size=12pt]How it works[/size][/b]
AgsGet may create the following files in your game directory.
[code]
├── ags_packages_cache/
│ ├── package_index
│ ├── pkg1/
│ │ └── pkg1.scm
│ └── pkg2/
│ └── pkg2.scm
│ ...
│
├── agsget-lock.json
├── agsget-lock.json.removal
└── agsget-manifest.json
[/code]
Let's see the steps involved in installing a package:
[list type=decimal]
[li]At first, when loading AgsGet, if no package_index is found, it will create the [tt]ags_packages_cache[/tt] directory, and place it inside the [tt]package_index[/tt] file, which is obtained directly from here: https://ericoporto.github.io/agsModuleList/index/package_index.json .[/li]
[li]Whenever you install a package, AgsGet reads the [tt]agsget-manifest.json[/tt] to figure out which packages are already installed and recreates it including the new package.[/li]
[li]If there's any [tt]agsget-lock.json.removal[/tt], it's deleted, and if there's any [tt]agsget-lock.json[/tt], it's renamed to [tt]agsget-lock.json.removal[/tt].[/li]
[li]Then, it reads this generated [tt]agsget-manifest.json[/tt] and the [tt]package_index[/tt] to figure out if the packages have any dependencies, and order them correctly, using topological sorting, writing the resulting list in [tt]agsget-lock.json[/tt].[/li]
[li]It then removes and deletes any script and headers in the project with the same name as a package in the [tt]agsget-lock.json[/tt]. [/li]
[li]It then will download from https://ericoporto.github.io/agsModuleList any package not on cache that it's listed in the [tt]agsget-lock.json[/tt]. [/li]
[li]Finally, all packages listed in [tt]agsget-lock.json[/tt] gets imported in the Game.agf project and shows in the editor. [/li]
[/list]
Removing a package will remove the package from [tt]agsget-manifest.json[/tt], and the [tt]agsget-lock.json[/tt] will be recreated, with the previous lock saved as [tt]agsget-lock.json.removal[/tt]. Packages that are listed on [tt]agsget-lock.json.removal[/tt], but not on [tt]agsget-lock.json[/tt] get removed.
[b][size=12pt]Where do we go from here[/size][/b]
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 [url=https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527]from this article from Sam Boyer[/url], which has a presented design inspired by the package manager [url=https://en.wikipedia.org/wiki/Npm_(software)]npm[/url]. Additionally, the general design of the package repository is based on early iterations of the [url=https://github.com/microsoft/vcpkg]vcpkg[/url], see it's [tt]ports[/tt] directory.
[b][size=12pt]Troubleshooting[/size][/b]
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.
[img]https://user-images.githubusercontent.com/2244442/73697349-3be48880-46d6-11ea-8a54-f934ba4629d5.png[/img]