Non-threaded

Forums » The Lounge » Read Thread

A place to sit back, hang out, and make monkey noises about anything you'd like.

CYSBOT: CYS Backup Or Transpile

6 years ago

So, I've decided I do want to be a programmer when I grow up, after all. As such, I need some portfolio projects. And I'd very much like to enable CYS users to get their games off this site.. and into a different format, if they so choose.

And thus, the CYSBOT project is born. My goal is to create a bot that you can add as a coauthor to a story, then PM it a command that has it make a backup, recreate a storygame from a backup, or transpile a storygame to ChoiceScript or Twine.

This is assuming that A) anyone is interested, and B) the mods don't nix it.

So! Anyone interested? And if you are, are you more interested in backup/recreate, ChoiceScript, or Twine?

@BerkaZerka @EndMaster ...hiii mods. It'll be a very well-behaved bot, I promise. Still, I figured I should ask permission rather than forgiveness. I'd hate to spend a lot of time on this and then have my bot banned.

CYSBOT: CYS Backup Or Transpile

6 years ago

Morgan, this clearly goes against the Site Policy. Bots can't consent to Co-Authorship unless coerced by programming/MIND CONTROL.

CYSBOT: CYS Backup Or Transpile

6 years ago

Hi Sent! How ya been?

There's nothing in site policy against mind control. There is this:

While using the Web site you may not:
• ( I ) post or transmit any message under a false name;

Soooo, pretty much everyone here is violating the ToS every time they post. Myself excepted, since my name actually is Morgan. XD

CYSBOT: CYS Backup Or Transpile

6 years ago

I've been positively excellent, as far as I know.

Well, yeah, but it's also against the De-Facto rules to co-author someone without their consent, and those are ten times as important as the Terms of Service. Also, I'm pretty sure everyone commits murder fairly regularly even though it's technically illegal. Does that mean we should be allowed to rob banks!? Of course not, that would be madness!

CYSBOT: CYS Backup Or Transpile

6 years ago

I'm very glad to hear it. ^_^

I will definitely take measures to ensure that my bot doesn't rob any banks. But if someone co-authors it without its consent, well... who is breaking the rules? Not the bot, surely!

CYSBOT: CYS Backup Or Transpile

6 years ago

This must have been your plan all along! Forcing everyone into alternative game engines by creating a bot that gets everyone banned for co-authoring it without its permission! IT'S A TRAP! AND IT DOESN'T EVEN HAVE ANIME EYES OR A PENIS!

CYSBOT: CYS Backup Or Transpile

6 years ago

...are you sure?

I mean, if you are, that raises certain questions... XD

CYSBOT: CYS Backup Or Transpile

6 years ago

I mean, not really, but I hope I'm right. Like, if the French are allowed to assume that a guillotine has a vagina without checking to make sure, I'm allowed to assume you didn't attach sex parts and anime eyes to a Secret Death Robot.

CYSBOT: CYS Backup Or Transpile

6 years ago

...okay, you got me. My bot is entirely lacking in sex parts. And eyes, anime or otherwise. But, also lacking in nefarious plans and/or murderous intentions!

CYSBOT: CYS Backup Or Transpile

6 years ago
>ChoiceScript or Twine

*laughtrack*

Joking aside, what language, protocols, etc? It basically would have to be open source because it has to follow CYS ToS and not store others' creative work itself. What will you run it from? What kind of security do the servers you have in mind have, or will it run from a personal computer? I never thought of you as much of a developer. What kind of experience do you have? (genuinely just curious on that part)

Choicescript and twine are useless formats you should learn to be really good at something else like playing with yo-yo's or weaving baskets in sub-unique aquatic settings.

CYSBOT: CYS Backup Or Transpile

6 years ago

Python + Scrapy so far. Not sure exactly what else I'll need, but the Python ecosystem seems to be pretty damn expansive at this point. And yes, it will be open source, since "portfolio" in this case means "projects accessible on GitHub." I'll run it from my own computer during development, and eventually deploy to PythonAnywhere. (Probably. I liked them when I tried them out a couple years back, and from what I've read people still like them, so that's the tentative plan.)

As for my background... I started programming when I was in my early teens. Made some little games in Visual Basic, and later on a bot for a game called Furcadia. I thought I wanted to be a programmer when I grew up. I got about halfway through  CompSci degree before switching focus to computer animation. My eventual work in that field was still fairly technical, and included software development. I wrote a domain-specific scripting language for one of our products... which was complete overkill, in retrospect, but it was a learning experience.

So, yes, this is a reasonably ambitious project, but I'm not starting from "Hello World."

CYSBOT: CYS Backup Or Transpile

6 years ago
So, I've written bots in python for a few years now and your idea is absolutely doable. I absolutely don't think it's worth the time and effort that will be required. However, that being said, in hopes that you make it anyways just because it's satisfying to make things - import requests, bs4, urllib, subprocess, and if you want to go easy on yourself I'd say use selenium. actionchains, keys, and alert are going to be absolute musts if you go with selenium though and it may work slower. The bulk of your program is not going to be the functions which gather data, but formatting that data. You'll have to come up with an efficient and decent way of formatting all the information that the bot will parse because it's not been done before so there's no stackoverflow for this. Disclaimer: I'm not familiar enough with scrapy to vouch for it in any way. I tried it once and it didn't work and so I moved on to using other things to parse and scrape.

I recommend joining the CYS discord [https://discord.gg/7e5sDWy] and going into the dev channel. Presuming you don't appreciate any other channels, the dev channel is the only channel with any merit towards this goal of yours because me and BD are the only ones who talk in it (generally) and we pretty much know the site down to the last runtime error (like the back of our hands) by now. Pibot is my discord bot written in python that already parses the site correctly - I don't mind sharing code and tips there. Larimar is BD's bot written in JS and also parses the site and does some other mysterious things so he can definitely help too. Chanbot is going to be my project CYS-site bot and I'm currently moving his old python bones to C# (and unfortunately Lisp for other functions as he's not intended for just CYS).

We're there if you need a jump-start. We're there if you don't. Good luck with link scripts.

CYSBOT: CYS Backup Or Transpile

6 years ago

Awesome. And yeah, given the small userbase here, and the even smaller percentage that would have any interest, it's definitely not worth the time/effort from that angle. But: it's educational, and I need projects, aaaand I wanna see if I can do it. I do think it's possible that there's some 'gotcha' in the differences in functionality between CYS and ChoiceScript and/or Twine, such that I won't be able to get a transpiler working. But it'll certainly be interesting to find out.

I'll definitely join you on Discord, thanks for the invite! Hopefully I won't end up badgering you too much. XD

What are you doing with Lisp? I took a class in Scheme back in college, and one of the "real" devs from my former workplace told me I should look into Clojure. Which I've started to, but... yeah. Easily distracted, especially when I'm not yet clear on why something is cool.

CYSBOT: CYS Backup Or Transpile

6 years ago
As a programmer (ok, former), I'll say, "Good luck." No, I really mean it. But at the same time, I can't see a practical way for this to work.

I guess the idea of a back up nice, but I'm not sure what purpose it would have other than I could write a story, then back it up, then write a bunch of other stuff and change my mind and restore. Then again, maybe others have good ideas for that.

As for the export to other formats, this is where I don't see a reality. The main reason is variables and scripts. There might be a way to export scripts, but oh my, that is really going to be difficult. You're going to have to write a parser that figures out what the script commands here do and then convert them into the commands that the other languages use. It can be done, but it will be difficult, and it will be hard to get to 100% accuracy on that one. I'm not saying I wouldn't super-love to have a way to import and export from something like Twine, I just know how incredibly complex that will be. And you've got to realize that you've got page scripts AND global scripts AND link scripts. I have no idea how you'll access all that information.

On the other hand, it might be much, much simpler and more possible to write something that does the opposite -- converts from Twine into CYS. That's because you wouldn't have to worry about the script conversions (as I understand it). I suppose if you had a story here that had zero scripts, that might be possible to convert into something else, but I haven't really looked at that. And that's without even considering how items are implemented on this site.

I don't want to discourage you, I'd really like to see some projects like this succeed. At the same time, I'm aware of how this site works and how incredibly customized this site is as compared to things like HTML and other open source projects. It will take a substantial amount of work to create any sort of automation to make these stories move to anything else, I think.

CYSBOT: CYS Backup Or Transpile

6 years ago
BD made that for page scripts already.

You're right in that scripts would be the worst part. I've already thought extensively on this and in particular link scripts are going to be the main hurdle. Transferring writing is child's play - a simple html parser with a list of links set to go to link@storygame_title and just store all the data is easy as fuck and absolutely doable. The formatting will be the most tedious part. Incorporating working link scripts will be hell unless you go cheapo on it and just have the bot paste scripts below page text - but then you have globl link scripts and global page scripts to parse as well.

In summary: 7/10 difficulty. My solution would be to just spend a weekend with a C language and make a program that people can install and it backs up storygames in an acceptable way locally - then there's no need for a bot and it's more consistent across the board for people who want backup capability. Halogen Studio servers are really great though - they have, like all servers ever, excessive storage capable of many many more years of site content given that 90% of the site is plaintext and HTML it takes up essentially negligible space compared to several TB of disk space that servers have.

The next problem to be faced is real-time backup and the bandwidth problems that come with that. I want to get into it here but I don't think anyone is interested in "reading about a retro-encabulator" so-to-speak.

CYSBOT: CYS Backup Or Transpile

6 years ago

bradin.pw/cysfiddle for the... er, curious.

CYSBOT: CYS Backup Or Transpile

6 years ago

This is really neat! What does CYSugar looks like? And do you have on-page variables working yet? (I may be using the wrong terminology here, it's been awhile.... I mean something like %%VAR%% in the HTML. I tried it and it's displaying 0, even though the variables dropdown shows the value I set in the script.)

CYSBOT: CYS Backup Or Transpile

6 years ago

It looks a lot like plain CYS Script, but CYSugar is made slightly more brief with a few additional features. Stuff like compound operators (e.g. "+="), increment and decrement operators (e.g. "%FOO++"), headless dice notation (e.g. "D20" instead of "1D20"), and non-conditional on-page coding in strings (e.g. "Your score is %%SCORE%%").

By default, on-page coding is done before the page script, since that's how it works on CYS. I'm assuming that's why you're getting a zero instead of the intended value, but fortunately you can shift that processing to the end by enabling the "on-page post-processing" option.

CYSBOT: CYS Backup Or Transpile

6 years ago

Nice!

And yeah, that makes sense... I grabbed the display code from a random page from an old project, and then backtracked to get code to set it. It's been long enough that I don't remember the syntax myself... or details like evaluation order, apparently. XD

 

CYSBOT: CYS Backup Or Transpile

6 years ago

Err... what? How would switching to a C language help? How would making it local help? It would still need to scrape the site, what difference does it make if it's scraping from a server or from someone's machine? I can't imagine bandwidth being a problem... we're talking about text. What am I missing?
 

CYSBOT: CYS Backup Or Transpile

6 years ago

Parsing the scripts, and turning them into different scripts, is what makes it a transpiler. Since more than half the point of this project is to have something cool to put on my resume/GitHub, that functionality is definitely something I want to try to get working. But yeah, it's definitely not a simple task.

Twine > CYS or ChoiceScript > CYS is... less viable. Consider that both of those let you set a variable to a string. And Twine lets you put links anywhere in the text.

CYSBOT: CYS Backup Or Transpile

6 years ago
Well hey, if this gets off the ground and you want someone to test it, I'm pretty good at breaking things and explaining how I broke them! :)

CYSBOT: CYS Backup Or Transpile

6 years ago

Thanks for the offer! I may well take you up on that.

Currently eying the stuff Zikara's done with embedded JavaScript... it's going to make my life harder, but it might actually allow for Twine-style inline links. And I feel like it might be possible to hack together a solution for string variables, minus actual user input. Still, CYS > backup is definitely the first step.

 

CYSBOT: CYS Backup Or Transpile

6 years ago

Ooooo. A thingamabob. Coding. Programming and such. Choicescript and Twine also.

Yes.

I know these things.

CYSBOT: CYS Backup Or Transpile

6 years ago

Hello! ^_^

I'm glad you approve of thingamabobs! Which kind is your favorite?

CYSBOT: CYS Backup Or Transpile

6 years ago

... Uh... The red one.

CYSBOT: CYS Backup Or Transpile

6 years ago

And how deep does the rabbit hole go? XD

CYSBOT: CYS Backup Or Transpile

6 years ago

... I'm actually really happy you got what I was trying to do there.

Okay, so maybe I don't know these things, but apparently Twine is better than Choicescript, so I choose that one.

CYSBOT: CYS Backup Or Transpile

6 years ago

^_^

Cool. Looks like people are preferring Twine so far. I do intend to do both, but since I'll have to pick one to do first, it'll be helpful if there's a consensus.

CYSBOT: CYS Backup Or Transpile

6 years ago

Although I don't have much knowledge in things pertaining to programming and code, it is good to see you back online and (hopefully) fully operational, Morgan! :^)

CYSBOT: CYS Backup Or Transpile

6 years ago

Thanks! My brain is braining okay right now. Having some insomnia, which is a definite red flag for the start of an upward spiral... buuuuut it's intermittent, when it happens I still do get some sleep, and I do actually feel tired. It's when I don't sleep and feel awesome that things really go off the rails. >_<

CYSBOT: CYS Backup Or Transpile

6 years ago

Twine. Choice script is for the birds

CYSBOT: CYS Backup Or Transpile

6 years ago

Hey Malk! How goes?

I actually do prefer ChoiceScript, so... you're right! XD

But thanks for voting. I do think Twine is very cool, and I'd be happy to start with it, if that's the general consensus.

CYSBOT: CYS Backup Or Transpile

6 years ago

I've always disliked ChoiceScript, mainly because the layout reminds me uncomfortably of those proficiency questionnaires that companies give you on job interviews. Given a choice, I would certainly prefer Twine.

CYSBOT: CYS Backup Or Transpile

6 years ago

Visual appeal is definitely not their strong suit! Thanks for voting. ^_^

CYSBOT: CYS Backup Or Transpile

6 years ago
I possibly misread the topic as Transphile and...that's a much better title for your project. You should change it. You're welcome.

CYSBOT: CYS Backup Or Transpile

6 years ago

...gonna go with nope to the nope, thanks anyway. :P

CYSBOT: CYS Backup Or Transpile

6 years ago

As far as I know as long as it isn’t spamming ads/posts, harming the site or something similar I don’t think there’s a problem with this though I imagine JJJ or Alex would probably be the people to directly ask if this is allowable, but who knows when they’ll be around again.

CYSBOT: CYS Backup Or Transpile

6 years ago

Awesome, thanks.

CYSBOT: CYS Backup Or Transpile

6 years ago

I'm pleased to report that CYSBOT can now crawl a Classic Editor based storygame, and generate a playable Twine HTML file. Now, this is not actually that useful on either end, since A) most storygames here are made in the Advanced Editor, and B) the generated Twine files don't have positional data for the nodes. Still, it's a start!

CYSBOT: CYS Backup Or Transpile

6 years ago

Oooooh.

Progress.

CYSBOT: CYS Backup Or Transpile

6 years ago

Hi Morgan! Just curious to see if you've made more progress on this.

I'm looking to develop my CYOA on this site ("Cabata's Quest") into an app, and the first question developers are asking me is can I "export" the file so they can play with it... ;-) 

CYSBOT: CYS Backup Or Transpile

6 years ago
>Just curious to see if you've made more progress on this.

Ask Ford how his stories are coming along while you're at it.

CYSBOT: CYS Backup Or Transpile

6 years ago
lol

CYSBOT: CYS Backup Or Transpile

6 years ago
Every so often I see you online and have a look at how much progress you've made with that story.

CYSBOT: CYS Backup Or Transpile

6 years ago

Are you using the Classic or Advanced Editor?

 

CYSBOT: CYS Backup Or Transpile

6 years ago

I'm using the advanced editor and the project is coming along! Will probably be ready to publish it (after preparing myself for immense ridicule) around the end of March. Just in time for April Fool's. LOL ;-)

CYSBOT: CYS Backup Or Transpile

6 years ago

Can’t help you then, unfortunately. I only got as far as Classic editor support, and I don’t think I’ll be moving forward with the project. Sorry to have raised false hopes. 

CYSBOT: CYS Backup Or Transpile

6 years ago

Thanks anyway (and for the prompt reply)! :-)

Anybody know a smart place to export the game to once I'm done re-writing it (which I'm sure will take another year or two)? I know I'll have to export it by hand, but if my ultimate intention is to make an android and iphone app... should I move it by hand to Inkle? Quest? A plain word or notepad document?

Hope everyone's weekend is going well. :-D

CYSBOT: CYS Backup Or Transpile

6 years ago

You should probably repost the question as a new post so more people see it. I know CoG releases apps, but you’d need to either work with them or pay them some sort of licensing fee, as I recall.

CYSBOT: CYS Backup Or Transpile

6 years ago

I know this has been brought up for some stupid reason, but how old is Morgan? Isn't she "grown up" yet? I assumed she was.

CYSBOT: CYS Backup Or Transpile

6 years ago

The crazy old owl is probably older than two of you put together.

CYSBOT: CYS Backup Or Transpile

6 years ago

Probably, I recall you looking pretty old. Care to specify?

CYSBOT: CYS Backup Or Transpile

6 years ago

37.

It’s honestly hard to believe sometimes. Time goes quickly... especially, I think, when one is depressed.

CYSBOT: CYS Backup Or Transpile

6 years ago

Ah, horrifying. Good to know.

CYSBOT: CYS Backup Or Transpile

6 years ago

Yup. Carpe diem, kids! Because one day you too will be thirty-somethings, ancient of days.

CYSBOT: CYS Backup Or Transpile

6 years ago

Fuck that, I'll die before I reach your age. Presumably doing something sick, like having a last stand against Nazis, or punching a shark, or ODing.

CYSBOT: CYS Backup Or Transpile

6 years ago

Steve to die by punching a Nazi shark while ODing, got it.