I’ve received a few messages from experienced developers asking how they might be able to help improve Perchance. I typed out a decently long (but somewhat rambling and incomplete) response to a message just now and figured I might as well post it publicly for the benefit of others who are interested.
The TL;DR is probably: The most impactful thing that devs can do for the perchance community is to just have fun building things (generators/plugins/etc) that are interesting/useful to you, and then share your creations with friends or communities that might enjoy them. This is very helpful!
Message response below:
The Perchance site itself is really just a code editor with a sandboxed iframe (that the code is thrown into), and a mongodb server for accounts/generators, so not a lot of my dev time goes into that level of the platform. And the DSL/engine doesn’t change much at this point (though an overhaul will likely come at some point), so most of my time is spent on creating plugins, examples/applications, and stuff like that.
I could add a bunch more features to the site, but I prefer to keep the foundation very simple, which is why I create plugins like perchance.org/upload-plugin and perchance.org/comments-plugin and so on. I.e. instead of adding comments as a “native” feature, I just add it as a plugin, which allows me to be more nimble and experimental.
There are limits to this, of course. One native feature that is sorely needed imo is collaborative editing - akin to Google Docs, so you can just share a link to start working on stuff with others. Another is optional AI-assisted code auto-completion. For both of those I need to upgrade to CodeMirror 6, but the Lezer stuff is kinda gnarly. If someone managed to get the Perchance DSL highlighted with CodeMirror 6 that would be very handy, but this is definitely not a “good first issue”. I did spend one day on it, thinking that’s all it’d take, but I now realize that it’s something which I’ll need to set aside several days for, and I’ve been putting it off.
Here’s the basic setup for CodeMirror 6: https://perchance.org/codemirror6-basic-html#edit
And I originally thought I’d use the same mixed parsing approach that uses, except instead of the HTML script tags triggering the transition from non-JS text to JS-highlighted text, it’d be square brackets (and function headers), but I think the problem with that is that the HTML parser has the advantage that the closing script tag in HTML code always means “end of JS” (even if it’s e.g. in the middle of a JS string! this can be somewhat surprising to many web devs), whereas closing square brackets can ‘validly’ occur in JS code without necessarily indicating the end of a square block. Someone /lang-htmlhere seems to have come to the conclusion that Lezer might not be a good fit for this sort of thing, and so a stream parser might be the way to go, but I’m not so sure, because IIUC,
manages to do it with template strings. I.e. /lang-javascript
${
to indicate start of JS, and }
to indicate end. That’s almost identical to what is needed for the Perchance DSL, so it seems like Lezer can do this. But maybe is doing some non-Lezer stuff, since IIRC there are some proprocessing/tokenization things you can do before it gets passed to Lezer. Either way, using the official JavaScript (or html/markdown/etc - which includes it as a sub-module) parser, with some minimal modifications, is probably the way to go, since I don’t want to have to maintain a from-scratch lib of that level of complexity. /lang-javascript
So that’s one thing that comes to mind right now, but that said, probably the most helpful thing that community members can to do to help Perchance is to create generators/plugins/games/etc. An interesting one that I noticed a few days ago, as an example: https://perchance.org/ai-roguelike and another: https://perchance.org/infinitecraft-but-its-a-trading-card-game
The advantage of helping in this way is: 1) it’s fun and you can just build stuff that’s interesting to you, and 2) it doesn’t require any coordination with me or anyone else. The latter point is pretty important because I’m a pretty solitary/hermit type of person, so it may be hard to get in contact with me for several weeks at a time.
I’ve spent quite a bit of time recently building generators to try and provide examples of games/experiences/tools that can be created with the AI plugins. The more people there are doing this, the more I can move down to the lower levels of Perchance. My bottleneck is currently at the higher “application” level, rather than the platform level, if that makes sense.
started generating images 3 weeks ago, found perchance and fell in love with it!
i am trying to find a guide that would explain what syntax to use to create scenes with 2 different characters or complex scenes
willing to write a better guide if i have enough material :")
For me though, Perchance is really just a foundation for me to actually create things I like and engage with other creations since I discovered it back in 2022 when it’s just plain simple (there was no hub, very simple welcome page, fewer plugins, simpler comments plugin UI, etc.) and there wasn’t any AI image stuff or t2i generators yet. And that’s the reason why the Generator Manager (my generator hub page) is here. I started to like it so much that I published my first own creation even published here on this platform. Love to see how it evolves, though, and glad this was explained in this Lemmy community!
Tho all the stickied things on the generator page are cool, I personally believe a single t2i generator blows them all out of the water because anyone can open up a t2i generator, see how it is written, think “i can do this”, and start their coding journey, from wherever they are, in a fun way. Glad you are making things ‘on our level’ with the same plugins we have access to and as feedback for you and all the experienced devs you would like building things, it’s to get creations in to a t2ilike format so further growth, from and for other people, can happen. Otherwise they are just unrepeatable curiosities. Just my unstoppably honest opinion :) sorry :)
This is a good point. I should be creating more “high-level config” layered on top of the examples that I create, so people can change a line here and there, and see how easy it is to create something new, and then maybe dive deeper from there. The ai chat/rpg/etc. generators that I’ve made aren’t very “configurable” in the same sense as the t2i framework thing.
What does
t2i
even stands for?It’s text2image since the framework was originally used to create customizable text-to-image generators I think.