perchance

joined 1 year ago
MODERATOR OF
[–] [email protected] 1 points 2 hours ago (1 children)

If you refresh the page, does it fix the issue? I think it might have been a temporary problem related to caching. Let me know if it's still a problem for you.

[–] [email protected] 2 points 2 hours ago* (last edited 2 hours ago)

VPNs are not blocked on Perchance - you should be able to access the site and create/edit/view/use generators (including AI-based ones) regardless of whether or not you're using a VPN.

Are you perhaps talking specifically about the comments plugin? If so, yeah it's unfortunate. I had to disallow VPNs from posting comments because they allow you to switch IPs instantly, which removes any ability for moderation, user-blocking and spam prevention.

I have ideas about how to remove this constraint (at least partially), but for now my todo list is too long to get to it any time soon.

Note: If you want to allow comments from VPNs on your own generators, then "one weird trick" (which I should formalize into an actual feature) is to put "feedback" in the channel names. Another trick is to embed Disqus, or some other comments system (or of course create your own comments plugin if you know how to code).

[–] [email protected] 2 points 2 hours ago (1 children)

Thank you!! I did a bit of refactoring on the engine recently and introduced a bug. Fixed.

[–] [email protected] 2 points 2 days ago (1 children)

Thank you pestering me on this, this was a bug with how customCode was being handled on /ai-character-chat

It's all fixed now, and I've updated the rentry doc with the Python example, and also created an example character for you to test here:

https://perchance.org/ai-character-chat?data=Python_Helper%7E986c80bf8a26a3b156a5be6c34805540.gz

Thanks! Also ty @[email protected] for looking into this, and for the ping 🙏

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago)

Thanks! I've just fixed a bug in the be-plugin which was the cause of this. But it looks like there's a bug in the have-plugin, and that's not mine. Whoever owns it needs to change this:

let thisNode = document.querySelector(`.${elementId}`);

to this:

let thisNode = document.querySelector(`.${elementId}`);
if(!thisNode) return;

I.e. just add if(!thisNode) return; below it.

[–] [email protected] 3 points 5 days ago* (last edited 2 days ago) (2 children)

The issue is this line in your lists editor:

s = [mob.selectOne]

This means that every time you use s it'll select a new random item from mob. The reason for that is because you've made s equal to [mob.selectOne] instead of mob.selectOne. The square brackets around it effectively make it "dynamically fetched" each time you access s.

(Aside: Also note that the lists editor isn't "executed" each time you click your generate button. It's not a list of instructions which get executed line-by-line. The square blocks in the HTML editor on the other hand do get executed line-by-line each time you click the generate button. Think of the code in your list editor as a "static" structure which can be used by the square blocks in your HTML editor.)

So you need to add [s = mob.selectOne, ""] in a place where it'll get "executed" with every generate button click, so a new s is generated with each click, but it stays the same when executing all of the other square blocks that come after it.

So you could add this line before [output] in your HTML editor:

[s = mob.selectOne, ""]

Each time your "Generate" button is clicked, the update() function is called, and that causes all the square blocks in the HTML code to be executed from top to bottom. So it ensures that we've randomly selected a mob item and put it in the s variable before the output list is executed (which uses the s variable).

Here's a fixed example: https://perchance.org/ylx7fmwpql#edit

(This issue has unfortunately been the source of a lot of problems for newbies learning Perchance, so you're not alone in being confused by this!)

10
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]
 

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 @codemirror/lang-html 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 here 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, @codemirror/lang-javascript manages to do it with template strings. I.e. ${ 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 @codemirror/lang-javascript 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.

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.

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago) (2 children)

It seems like there might be an ISP in the Philippines that is blocking Perchance. I'm not sure why. If you are in the Philippines, then you could try getting a free VPN chrome extension, or install https://one.one.one.one/ (which is a reputable free VPN by Cloudflare) and let me know if that fixes it for you.

[–] [email protected] 3 points 1 week ago

I'd need more info, since I can't reproduce it. If you can send a share/save link (or save file via google drive or whatever), then I would probably be able to fix it instantly. Or you can give me exact steps to reproduce it. E.g. "start a new rpg, go continue until summary happens, ..." Please make sure you test the reproduction instructions to confirm that you can reproduce the issue (i.e. don't just guess that it'll happen again, please actually start from scratch and test it). Again though, easiest way is if you have an existing game that you can share, and just generate a share link using the button at the bottom. You can DM me or share it in this thread.

[–] [email protected] 2 points 1 week ago

Thanks! That should be fixed now

[–] [email protected] 3 points 1 week ago (4 children)

Hi, sorry about this, seems like quite a few users are having the same problem, but I'm not sure what the cause is yet. The more info you can give here, the faster I'll be able to solve it. Some questions that should allow me to narrow down the cause:

  • Can you please screenshot what's shown when the page won't load, and share it here?
  • Do you remember the last time it worked (approximate day+time), and the first time you noticed that it wasn't working (again, approx day+time)?
  • Can you test on multiple browsers, and ideally multiple devices (e.g. phone + laptop), and ideally multiple internet connections (e.g. phone data + wifi)? This will help narrow down whether it's a browser issue, device issue, or network connection issue.
  • If it works in one browser, but not the other, please also test in "incognito" / "private browsing" mode, or "guest mode" of the non-working browser.
  • Are you using normal wifi at home? Or is there anything unusual about the internet you're using (e.g. school network, or special "firewall", etc.)
  • Can you try visiting these two links and letting me know if they work? This will let me know if there's a specific "part" of the server that's causing the error.
[–] [email protected] 3 points 2 weeks ago* (last edited 1 week ago) (2 children)

The Perchance site itself doesn't block people¹, so it's likely some sort of network issue. It could be something to do with the network you're using, or with Cloudflare, or with a network-level firewall, or some combination. Questions:

  1. What error message does it show? Can you screenshot it?
  2. Are you using an unusual/uncommon web browser? The fact that you've tested ipad and pc makes me think no.
  3. Do you have another network/connection that you can test with? E.g. hotspot on phone? To see if your computer/ipad loads it fine on a different connection.
  4. This shouldn't be relevant anyway, but out of curiosity, if you visit https://ip-api.com/ and scroll down to the mobile and proxy and hosting values, do they say true or false?
  5. Is the network a school/workplace/university/etc.? Some schools have block-lists for game/entertainment related websites, and it's possible perchance has been blocked by that.

¹ Note: You can get blocked from e.g. participating in comments sections (and VPNs are blocked from commenting by default due to spam and block-evasion), but you can never be blocked from simply viewing/using a generator.

 

By "hide" I mean it shows a button in the top-right, which when clicked, shows the full header bar.

Examples:

Please let me know if you run into any issues or have feedback 🙏

Edit: Also, for people who know some JavaScript, you can use the public generator list API to get generators with specific tags like this:

let data = await fetch(`https://perchance.org/api/getGeneratorList?tags=foo`).then(r => r.json()); // returns generators tagged 'foo'
let data = await fetch(`https://perchance.org/api/getGeneratorList?tags=foo,bar`).then(r => r.json()); // foo AND bar
 

I think I got to the root of what was causing this. If anyone is still having issues signing up, please comment here.

 

See plugin page for details and examples:

https://perchance.org/favicon-plugin

 

As was noted on the plugin page, this was on the roadmap, but not yet supported. I've added support now thanks to a prod from @wthit56 so you can treat it just like you would a normal 'static' import.

One nice use case that this properly/robustly unlocks is the situation where you e.g. have a plugin that you've made, and you want to import the comments plugin so people can chat about your plugin and ask questions, but you don't want to cause all importers of your plugin to automatically get the comments plugin as a dependency.

If you just dynamically import the plugin in your HTML panel, then importers of your plugin won't get the comments plugin as a dependency. Example:

https://perchance.org/import-only-in-html-panel-no-dependency-example#edit

(Reminder that, as mentioned on the dynamic import plugin page, you should only use the dynamic import plugin in very particular scenarios, like this one, or e.g. when you have hundreds of imports but only a subset of those imports tend to get used by any particular user of your generator. Regular imports will generally allow for much faster generator loading, since all the data is preloaded.)

 

As usual, the Chrome team is leading the charge on some exciting new web platform tech. The goal is to release some prototypes and eventually write up the feature as a browser standard that would make its way into all browsers (i.e. not just Chrome).

The point is, it'd run completely on-device (no cloud access, works offline), so it'd be a very small model, but would likely still be smart enough for a lot of tasks - e.g. summarizing text, converting a list of words into a grammatically correct sentence/description, guessing an appropriate emotion based on some character dialogue, etc.

Article: https://developer.chrome.com/docs/ai/built-in

The key problem with these text generation models is how massive they are. They're so big that they could literally fill your entire device (for smart phones and cheap laptops, at least), and would bloat the initial browser download time from a few minutes to a few days for a lot of people.

Still, smaller models are getting surprisingly smart, and while they're still several times the size of the actual browser download itself, this download can be done in the background.

Either way, I'm excited about this new direction, because there are lots of tasks that don't require an extremely smart model, and so it's overkill to use /ai-text-plugin, especially since it means ads will be shown for non-logged-in users.

One problem that I do anticipate, is that the models will be extremely "safety-oriented", meaning refusal to even generate stuff like violence in a DnD fantasy adventure, and stuff like that. I know from experience that Google's Gemini models have false-positive-refusal rates that almost make them unusable even for many sfw tasks. There is a mention of LoRA fine-tuning in the article, which is very exciting and might help with that. If you're a web dev, you can use the links on the page to test their prototypes and give constructive+professional feedback on them. It'd be good for the health of the web platform to have some of the feedback be for use-cases like Perchance, and not just e.g. business applications.

Tangentially, builders here may also be interested in Transformers.js which allows you to run AI models in your browser. Ad-free AI plugins could already be created using this project, although for a lot of models the download times are a bit too long, and processing times also a bit too long (for mobile devices especially). Still, the situation is improving quite rapidly. /ai-character-chat already uses Transformers.js for text embedding.

 

For example, if you've made a world building religion generator, and you title it "The Arch Bible" or something like that (i.e. something that's more of a "brand" than a "description"), then people won't be able to use a web search engine to find it unless they already know its name. In other words, people don't search for "The Arch Bible" when they want to find a religion generator - they of course search something like "fantasy religion generator" or whatever - so make sure you put keywords like that in your $meta.title/$meta.description if you want to make it easy for others to find it.

Search engines heavily weight the page title in their search, so it definitely pays to have a $meta.title which appropriately summarizes what your generator does in a few words. It's fine to have something like "Fantasy Religion Generator - The Arch Bible" as your title - i.e. a description, plus a "brand". Just don't leave out the key descriptive terms.

I'm writing this post because I don't think people realize how the "popular" generators on Perchance actually tend to get popular - it's one of two things:

  1. (rare & temporary) The generator happened to go viral on social media somehow.
  2. (common & long-term) The generator's title and/or description was descriptive, and so random people around the world each day hit their page via a Google search, which can add up to thousands of visitors in just a few months if it's a popular "topic" that people search for.

Popular generators almost always get popular via #2, and #2 often eventually leads to #1 - i.e. people find it via a search engine, and then share it with their friends on social media, and then at some point (for whatever reason) it goes viral. I think people tend to incorrectly assume that #1 is the main factor in a generator's popularity (it can be, but it's rare).

TL;DR: Use appropriate descriptive terms in your title and description if you'd like your generator to become well known. Think about the sorts of keywords that people would type into a search engine to find your generator.

view more: next ›