bscotch / stitch Goto Github PK
View Code? Open in Web Editor NEWTools and apps for GameMaker development: a CLI for pipeline development, a VSCode extension for coding, and more.
License: Other
Tools and apps for GameMaker development: a CLI for pipeline development, a VSCode extension for coding, and more.
License: Other
This is needed to make Stitch more user-friendly.
stitch/src/lib/components/Gms2IncludedFile.ts
Line 121 in 59c195b
When there is no subdirectory
, directoryRelative
is set to datafiles/NEW
, but there might be a file at datafiles
. This will trigger the error because matchingFile.directoryRelative != directoryRelative
, which effectively causes any file at the root level of the project's included files to always trigger conflicts.
I think we should just stop checking the subdirectory mismatch and overwrite the destination file. The change will show up in the git history anyways so the end-user can discern whether this is a mistake that requires renaming or that it is fine.
Icons are named appropriate in the included zip.
The original version of this project was more generically named "gms2", and the README didn't get that updated to "stitch" in a few places.
While the Stitch CLI provides lots of options to fine-tune exactly what gets imported from a project, this always has to be done at the CLI level. Even the simplest imports require a pretty verbose command, so it is not easy to use. Also, project authors have no way of indicating which subset of the project should be imported.
Some sort of config file could be used on both the imported and importing projects to control the parameters in a stable, simpler way. That way an import command without options could default to the config file.
The first step of this would be a config file that a project author can specify to make it easier for that project to be imported into other projects.
Something like:
# @file stitch-import.yml
project:
name: My Rad Project
path: relative/path/to/project/folder
options:
# The non-default CLI options that would allow for proper import of this project...
Then the Stitch importer would be updated to allow for CLI args to be absent if such a file exists.
I'm currently trying to use addObject to add an object. I'm not sure exactly how to format said object, though. Sprites, sounds etc are fairly self-explanatory, but objects are trickier. The current documentation just uses "your/object/name".
Important Facts
Current code:
import { StitchProject } from '@bscotch/stitch';
const projectPath = '../';
const myProject = await StitchProject.load({projectPath});
await myProject.addObject('oThree')
In VSCode, Ctrl+Shift+Space is supposed to provide parameter hints within a function parameter list, but this isn't happening with Stitch.
Error: Files does not exists: c:/ProgramData/GameMakerStudio2/runtime_feeds.json
after clicking on "Open in GameMaker"
This may have something to do with the case where a user has never installed a stable GameMaker version, so that the assumption that that file exists is no longer true. It could be due to something else though, so this will require some investigation.
The current GML parser used by the VSCode extension can only handle globals. It isn't smart enough to fully parse a project, and can't do any advanced things like scope analysis.
For full Intellisense support we really need scope analysis, so we also need a new parser.
The MVP needs to include at least the functionality we currently have.
Stitch Desktop should have an easy mechanism to go from the app to GitHub Issues, in a way that collects environment info (app version in particular).
It's more likely that someone will want to list a set of folders, than that they'd want to provide a regex, when filtering on merge.
For example, if a user wanted to import two modules, "TestSuite" and "MyRadModule", they'd currently have to use:
stitch merge --if-folder-matches "(TestSuite|MyRadModule)"
Since most people are not very familiar with regex, it would make more sense to have it not behave has a regex pattern by default, and to also allow comma-separated values. For example:
stitch merge --if-folder-matches TestSuite,MyRadModule
If the user wants to use a regex, we can either:
[]()$^*+
appear in the filter string).Removing a project puts the app into a state where it is unable to set any remaining project as the current one.
No errors are shown, and rebooting the app doesn't help.
Temporary workaround:
configuration file
link at the topnull
to an existing id
from one of the projectsThe tree view currently displays shader assets as single entries, linking to their YY files.
As a developer that's mostly interested in "stable" GameMaker releases during active development, I would like my previous selection of release types to be saved.
When going to the GameMaker Releases page, lts
, stable
, and beta
are all selected every time.
The Stitch extension can currently run a project via VSCode "tasks", but this is a pretty janky and cumbersome process. It should be overhauled to work really well.
This would allow users to make arbitrary groupings of assets for batch manipulation.
This would allow for the programmer to filter resources by that tag to quickly identify those that have been changed by pipeline tooling.
The shader-editing experience in the GameMaker IDE is... MEDIUM.
GameMaker recommends using GLSL ES for shaders, since that has the broadest support (particularly on mobile). Unfortunately, GLSL does not seem to have a lot of options for decently-featured editors.
The best VSCode extension I could find is one for WebGL, but it of course doesn't know about the GameMaker built-ins.
Given the relative simplicity of the GLSL language, and the fact that GLSL shaders can only consist of two files (the vertex and fragment shaders), it wouldn't be too large of a project to write a GLSL ES language server and use that in Stitch for VSCode.
Notes and refs:
As far as I can tell, the sample code in the documentation is all for the pre-async versions, but in the latest releases (>10.0), everything has been changed to be async, so the sample code no longer works. Any chance of getting an update?
There is still too much load when using Stitch for VSCode due to limited color differentiation. This is a context problem -- we can't use the grammar file to e.g. highlight sprite identifiers because we can't use a regex to unambiguously identify them.
The current GML parser is very limited, but it does locate most global identifiers. We can therefore use it for semantic syntax highlighting via the extension logic to improve things significantly.
Initially we can (and should) have semantic highlighting of the following:
In VSCode we lose too much information about objects due to only thinking of things as code.
One solution to this that is consistent with the GameMaker IDE is to add an "Inspector" widget to the sidebar. The first draft of this could simply be a TreeView listing:
To minimize switching between VSCode and the GameMaker IDE, we need an easy way to clean the GameMaker Runner cache from the Stitch extension.
MVP:
Now that the GameMaker Releases summary and the Stitch Desktop builds are both created as "GitHub Releases" in this same repo, the download URLs that use "latest" for them no longer work consistently.
The obvious thing to do is to post the GameMaker Releases artifact to some other location. Maybe using GitHub Pages?
Sprites are currently shown as individual resources, linking to their yy files. They should instead drop-down to the list of subimages. Showing them by index number instead of by ID would be a preferable UX.
It was running fine before, but then it broke
Stitch ERROR 07:50:39 "git" �� ���� ����७��� ��� ���譥�
��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
>
StitchError: "git" �� ���� ����७��� ��� ���譥�
at Gms2Storage.get workingDirIsClean [as workingDirIsClean] (C:\Users\evolu\Documents\Projects\Actual projects\GMS 2.3 Projects\UnnamedPlatformer\ImportingPipeline\node_modules\@bscotch\stitch\src\lib\Gms2Storage.ts:37:13) src\lib\Gms2Storage.ts:37:13)
at new Gms2Storage (C:\Users\evolu\Documents\Projects\Actual projects\GMS 2.3 Projects\UnnamedPlatformer\ImportingPipeline\node_modules\@bscotch\stitch\src\lib\Gms2Storage.ts:17:13)
at new Gms2Project (C:\Users\evolu\Documents\Projects\Actual projects\GMS 2.3 Projects\UnnamedPlatformer\ImportingPipeline\node_modules\@bscotch\stitch\src\lib\Gms2Project.ts:159:22)
at Object.<anonymous> (C:\Users\evolu\Documents\Projects\Actual projects\GMS 2.3 Projects\UnnamedPlatformer\ImportingPipeline\load.js:5:19)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at run (C:\Users\evolu\Documents\Projects\Actual projects\GMS 2.3 Projects\UnnamedPlatformer\ImportingPipeline\index.js:5:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
If the Stitch Desktop updater is already running and then the user manually requests an update check, a horrifying error is plastered onto the screen despite there not being a problem:
Unhandled error. ('AutoUpdater process with arguments --checkForUpdate,https://github.com/bscotch/stitch/releases/latest/download is already running')
So... that should stop happening!
It's a Gamemaker project from around 2020, not sure which version (yyp doesn't seem to contain the ide or runtime versions)
https://drive.google.com/file/d/1wzjDCJrwBRYU93WNzgiU3bCSVC3lZZsH/view?usp=sharing
While Stitch's merge capabilities remove the need for manual creation of yymps
files (generated by GameMaker for bundling up assets), you would still have to know what you're supposed to be importing in order to craft the correct Stitch CLI command. If Stitch becomes widely used that won't be a problem, but it is currently not widely used and so many of the open-source libraries out there use yymps format.
It looks like yymps is just a zip file, so in principle this would be easy to do. However, yymps files do not necessarily contain YYP files, and so Stitch cannot load them without the addition of new features.
When the extension boots up and searches for yyp files, it is apparently included node_modules
, resulting in the template shipped with Stitch Core being discovered when that's installed locally.
stitch/src/lib/Gms2ProjectConfig.ts
Lines 73 to 76 in ebad310
GMS2 handles root-level folder designations completely differently from all others, making them frustrating to deal with. There is no strict need for being able to assign texture/audio groups at the root level, since this is what default groups do.
Using Ctrl+P
to find GameMaker stuff is a little unpleasant, since we usually don't care about YY files but also filenames in general aren't very useful (e.g. we often want to find a function defined in a script, but don't really care about the script).
The VSCode extension implements a token provider for globals (via Ctrl+T
), but this doesn't include assets since they aren't defined in code. This makes it really annoying to quickly open up an object, for example.
To resolve this, we need to add assets to the token provider:
There's no way to fix the GameMaker side of this, but we can dramatically reduce the number of file writes. Currently a merge simply replaces the resource folder in the target with that on the source, without comparing file contents and only replacing things that have changed. It's more costly to check for changes first, and requires more code, so things might slow down on large merges. But the benefit is that GameMaker may get to keep running.
It regularly happens that when rigging a new skin, my rigger creates a new temporary skeleton, that's not supposed to be used by the game and so will have no atlases, and be considered an invalid file by stitch. This will cause the whole import batch to fail even though the other spine files are perfectly fine.
For me the expected behaviour would be to have a warning printed, the file skipped and carry on to the next file.
when gamemaker creates a new project from an old project (ie from the pre 2.3 days.) It will save that project as a project_name.yyp
That .ypp causes stitch add to not be able to find the .git file and gives a "StitchError: fatal: not a git repository"
I don't know if this is a real issue or not, but I got stuck on it for a bit till I worked it out.
When trying to open a GameMaker project via the GameMaker IDE, from the VSCode extension context menu, and error message pops up instead.
Maybe a permissions issue?
The parameter hint helper seems to be using all commas in your function arguments, including commas in strings. This causes the hint helper to get offset. Example:
function do_stuff(a, b, c) {}
do_stuff("What, me?", "No!", 2);
If you click into the second argument slot, it will show that you're in the third (because there is a comma in the first argument).
It's important to make it clear that this is an independent project.
Stitch Desktop: v0.11.10
VS Code: v1.78.0
Nothing happens when clicking on the Open in VS Code
button. I'm expecting Visual Studio Code to open a new window with the workspace as my project's folder.
stitch/src/lib/components/resources/Gms2ResourceBase.ts
Lines 57 to 73 in ebad310
The resource folder setter does not take into account root-level resources, which use a totally different system for naming parents. For now we should throw an error when there is an attempt to use root-level folders, since they'll make everything more complicated and aren't strictly required.
In the absence of full IntelliSense in the GMS2 IDE, I've added some VERY rudimentary static analysis features to Stitch. These are in draft form. In particular, I have a feature for finding global functions and their references, to allow discovery of references to non-existent functions with some helpful features for versioning functions by name. However, the current draft parser does not seem to catch everything. Stitch will need more test cases and some additional rework to make this feature more useful.
The latest GameMaker versions include a new "Particle" resource type, which is currently not implemented in Stitch.
Two options for resolving this issue:
Reported in IDE v2023.2.1.75 Runtime v2023.2.1.90
stitch add sprites --source=\sprite_root --flatten --debug
Running in debug mode
loading project with options
projectPath: g:/GameMakerStudio2/Shredders_2/Shredders_2.yyp
file:///{...path}/node_modules/@bscotch/stitch/dist/lib/components/Gms2ResourceArray.js:240
throw new StitchError(`No constructor for resource ${resourceType} exists.`);
^
StitchError: No constructor for resource particles exists.
at Function.hydrateResource (file:///{...path}/node_modules/@bscotch/stitch/dist/lib/components/Gms2ResourceArray.js:240:19)
at file:///{...path}/node_modules/@bscotch/stitch/dist/lib/components/Gms2ResourceArray.js:31:59
at Array.map (<anonymous>)
at new Gms2ResourceArray (file:///{...path}/node_modules/@bscotch/stitch/dist/lib/components/Gms2ResourceArray.js:31:27)
at StitchProject.reload (file:///{...path}/node_modules/@bscotch/stitch/dist/lib/StitchProject.js:539:24)
at async Function.load (file:///{...path}/node_modules/@bscotch/stitch/dist/lib/StitchProject.js:66:9)
at async default (file:///{...path}/node_modules/@bscotch/stitch/dist/cli/lib/add-sprites.js:7:27)
Currently an alert pops up and must be manually dismissed, which isn't great.
See https://github.com/microsoft/vscode-extension-samples/blob/main/progress-sample/src/extension.ts
Currently the Stitch extension does not provide an asset browser, so users are left with the regular file browser. This isn't great, since the file structure has no relationship to how assets are organized in the project. Potentially worse, .yy
files are mixed in and object event files are hard to pull up.
We need an actual asset browser to resolve all of this.
Minimum requirements:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.