New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProcGen Interactive Fiction Game - intent to participate #89

Open
mgrider opened this Issue Nov 6, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@mgrider

mgrider commented Nov 6, 2017

This is only loosely a novel, (that doesn't seem to be stopping anybody else!), but I'm going to write some code (probably in python, maybe? to take advantage of pycorpora) that generates a valid Inform7 game. (That is, a text adventure, ala Zork, Hitchhiker's Guide, etc.)

This project includes a few technologies for me that I've only played around a bit with in the past, (inform and python just for starters!) ...so that's fun. I'll definitely post progress here as I make some.

I did create a public repo here: https://github.com/mgrider/inform-gen

@mgrider

This comment has been minimized.

Show comment
Hide comment
@mgrider

mgrider Nov 9, 2017

My original idea was to get randomized corpora categories, and then get randomized values from those categories, but the problem is that corpora categories aren't standardized, and have n depths. So given a randomized category, I don't know how to get its end-result values. And in some cases, ("winners", for example, which contains a woefully inadequate amount of data), it doesn't even really make sense to get a single value from the category. I've ended up just picking and choosing my own pieces of corpora to use. I'll just have to get over the feeling that that's cheating.

mgrider commented Nov 9, 2017

My original idea was to get randomized corpora categories, and then get randomized values from those categories, but the problem is that corpora categories aren't standardized, and have n depths. So given a randomized category, I don't know how to get its end-result values. And in some cases, ("winners", for example, which contains a woefully inadequate amount of data), it doesn't even really make sense to get a single value from the category. I've ended up just picking and choosing my own pieces of corpora to use. I'll just have to get over the feeling that that's cheating.

@hugovk

This comment has been minimized.

Show comment
Hide comment
@hugovk

hugovk Nov 9, 2017

Member

It's definitely not cheating!

Member

hugovk commented Nov 9, 2017

It's definitely not cheating!

@mgrider mgrider changed the title from ProcGen Inform Game - intent to participate to ProcGen Interactive Fiction Game - intent to participate Nov 9, 2017

@mgrider

This comment has been minimized.

Show comment
Hide comment
@mgrider

mgrider Nov 29, 2017

Made some significant progress tonight, and got the thing more or less working to my original first version / initial concept / mvp. Basically there is a grid of rooms (size is configurable at the top of the script), and each room has a piece of fruit, an item, and a container. I won't spoil it, but it is possible to "win". (Although you have very little incentive for doing so.) Some of the room names and descriptions have been pretty funny though. I added some examples of the script output (and a playthrough or two) here: https://github.com/mgrider/inform-gen/tree/master/output

mgrider commented Nov 29, 2017

Made some significant progress tonight, and got the thing more or less working to my original first version / initial concept / mvp. Basically there is a grid of rooms (size is configurable at the top of the script), and each room has a piece of fruit, an item, and a container. I won't spoil it, but it is possible to "win". (Although you have very little incentive for doing so.) Some of the room names and descriptions have been pretty funny though. I added some examples of the script output (and a playthrough or two) here: https://github.com/mgrider/inform-gen/tree/master/output

@greg-kennedy

This comment has been minimized.

Show comment
Hide comment
@greg-kennedy

greg-kennedy Nov 29, 2017

Is that really what Inform looks like? I've never tried to use the language, but it seems extremely readable.

I like where this is going.

greg-kennedy commented Nov 29, 2017

Is that really what Inform looks like? I've never tried to use the language, but it seems extremely readable.

I like where this is going.

@mgrider

This comment has been minimized.

Show comment
Hide comment
@mgrider

mgrider Nov 29, 2017

Yes, definitely extremely readable. It can be really frustrating though when things don't work. The error messages are really verbose, and not always the most helpful. Additionally, there is no syntax highlighting in the editor, and with all the magic keywords, (and the ability to create your own!) it can be really hard to understand what is what in your "story". (Also, although there is a pretty decent seeming community around Inform, and IF in general, development of the tool seems more or less dead.)

mgrider commented Nov 29, 2017

Yes, definitely extremely readable. It can be really frustrating though when things don't work. The error messages are really verbose, and not always the most helpful. Additionally, there is no syntax highlighting in the editor, and with all the magic keywords, (and the ability to create your own!) it can be really hard to understand what is what in your "story". (Also, although there is a pretty decent seeming community around Inform, and IF in general, development of the tool seems more or less dead.)

@mgrider

This comment has been minimized.

Show comment
Hide comment
@mgrider

mgrider Dec 4, 2017

Post-mortem / wrap-up post:

Failures
Mainly, I didn't make a 50k word "story". Although you could maybe argue that the inform "story" isn't the "whole story", that's what my script generates, and I was planning on using that for the word-count metric. My plan for getting to 50k had basically been to increase the number of rooms the script generates until I hit that number, but that isn't possible because some of the items I'm using for randomization don't contain that many items. (And I didn't realize or notice this until just now as I was prepping this post!) Turns out I can only push the script to ~25 rooms, before it tries to randomize from several sources with only that many items. The word count at 25 rooms is only about 4700-4800.

Also worth noting that version with 25 items doesn't always work. I went ahead and pushed an example of this output as output/v0.5-source-broken.txt. Pasting that script into inform gives errors that I'm probably not going to take the time to fix. (Essentially, some of the source for my randomized room text is probably problematic, and should be excluded.)

Additionally, I'm pretty sure the game as-is at the moment of this writing isn't that fun to play. There isn't enough randomization of the puzzles. Essentially, each room has the same fetch quest. (If you'd never played it before, and went into it without my spoiling it for you –which I'm not going to do here– it's possible it would take you a bit to figure out, but once you did, you'd know how to solve every other room, and it would grow tedious pretty quick. I think the version with 4 rooms (in a 2x2 grid) is probably the best way to play. There is some novelty in the randomized room names and descriptions which can sometimes be pretty surprising. It might be fun up to 12 or 16, but again, it would get old pretty fast in its current incarnation.

Another failure, I could argue, was my goal of learning Inform7, but I'll write more about that in a bit.

Because I wasn't really happy enough with the output of this script to post it anywhere, I also didn't submit it to ProcJam. That was/is also definitely a fail.

Successes
I wrote some Python! Python is ridiculously easy to write. It feels a bit like I say this about every new language I learn these days, but learning the syntax (there is almost none!) and the various APIs was a very minor part of this project, and generally quite fun and easy. Debugging errors was quite easy, as error messages were very easy to search for, and often even that step wasn't needed.

I learned quite a bit about writing Inform7! Unfortunately, that's about the best I can say about it. Inform got harder and harder to work with, and was generally the opposite of my experience with python. My take-away from Inform is that you want to write one sentence at a time, compiling after every one. Every new thing you try and do will require searching through the documentation for an example you can copy/paste. There were dozens of times when I would modify even just one word from an example and then scratch my head about why that changed caused it to stop working. And debugging was always a nightmare. The error messages sometimes contain (sometimes hilariously) a bit of randomization themselves. This seems interesting/funny the first few times you see the same error and the text is different, but the 3rd or 4th time, when you are at wit's end, it's no longer funny. Here's an example of an inform error (but not one with randomized text, I don't think):

You wrote 'now the Greyish Blue Book Of Matches is nowhere' , but although 'the Greyish Blue Book Of Matches is nowhere' is a condition which it is legal to test with 'if', 'when', and so forth, it is not something I can arrange to happen on request. Whether it is true or not depends on current circumstances: so to make it true, you will need to adjust those circumstances.

In general, my take-away is that Inform7 syntax is a great big can of worms. It would probably take me a month of working full-time to really understand the entire system and how it all works together, and feeling competent in it would probably take much longer. (This was obviously not that month!)

Wishlist / TODO list
If I wanted to spend more time on this project, these are the things I was planning on doing:

  • Randomized puzzles. Right now there is really only one type of puzzle. I would love to have 4 or 5 types (at least!), and generate different room descriptions based on the type.
  • Additional inform elements: Right now, there are rooms, objects (some edible), containers, and that's about it. I really wanted to get to the point where there was also a randomized person in each room. The amount of things you can do with Inform is staggering really. I've only just scratched the surface, for sure.
  • Finally, making this available to the rest of the world. This boils down to how I wanted to do this initially, and how I think it's feasible. Both would have been published as a webpage. A) I wanted to make a version that was different every time you play it. But the only way I could imagine that happening would be to install the command-line version of inform on a server, and at request time, generate the source, compile it, and redirect the request to that output. I've no idea if that's practical, but it's not something I wanted to attempt. B) The more practical alternative would be to generate a bunch of outputs all at once. So that would be writing another script to run my game.py script X number of times, saving the output off to a tmp directory, then using the command-line version of Inform7 (i7) to compile each output and save off a web-playable version into a subdirectory somewhere. Tentatively I was planning on doing this 365 times and then writing some kind of index.php to swap them out based on day of the year.

TL;DR
I really enjoyed working on this project, and learned a lot about Inform7 and python, but wouldn't really consider this a "successful" project, mostly because I just didn't spend the required time on it. There is always more you can do, of course, but in this case, I didn't take the project far enough where I think it's ready for public consumption. (It is all public, however, and anyone can play with the stuff I created. If you do, I'd love to hear about it!)

mgrider commented Dec 4, 2017

Post-mortem / wrap-up post:

Failures
Mainly, I didn't make a 50k word "story". Although you could maybe argue that the inform "story" isn't the "whole story", that's what my script generates, and I was planning on using that for the word-count metric. My plan for getting to 50k had basically been to increase the number of rooms the script generates until I hit that number, but that isn't possible because some of the items I'm using for randomization don't contain that many items. (And I didn't realize or notice this until just now as I was prepping this post!) Turns out I can only push the script to ~25 rooms, before it tries to randomize from several sources with only that many items. The word count at 25 rooms is only about 4700-4800.

Also worth noting that version with 25 items doesn't always work. I went ahead and pushed an example of this output as output/v0.5-source-broken.txt. Pasting that script into inform gives errors that I'm probably not going to take the time to fix. (Essentially, some of the source for my randomized room text is probably problematic, and should be excluded.)

Additionally, I'm pretty sure the game as-is at the moment of this writing isn't that fun to play. There isn't enough randomization of the puzzles. Essentially, each room has the same fetch quest. (If you'd never played it before, and went into it without my spoiling it for you –which I'm not going to do here– it's possible it would take you a bit to figure out, but once you did, you'd know how to solve every other room, and it would grow tedious pretty quick. I think the version with 4 rooms (in a 2x2 grid) is probably the best way to play. There is some novelty in the randomized room names and descriptions which can sometimes be pretty surprising. It might be fun up to 12 or 16, but again, it would get old pretty fast in its current incarnation.

Another failure, I could argue, was my goal of learning Inform7, but I'll write more about that in a bit.

Because I wasn't really happy enough with the output of this script to post it anywhere, I also didn't submit it to ProcJam. That was/is also definitely a fail.

Successes
I wrote some Python! Python is ridiculously easy to write. It feels a bit like I say this about every new language I learn these days, but learning the syntax (there is almost none!) and the various APIs was a very minor part of this project, and generally quite fun and easy. Debugging errors was quite easy, as error messages were very easy to search for, and often even that step wasn't needed.

I learned quite a bit about writing Inform7! Unfortunately, that's about the best I can say about it. Inform got harder and harder to work with, and was generally the opposite of my experience with python. My take-away from Inform is that you want to write one sentence at a time, compiling after every one. Every new thing you try and do will require searching through the documentation for an example you can copy/paste. There were dozens of times when I would modify even just one word from an example and then scratch my head about why that changed caused it to stop working. And debugging was always a nightmare. The error messages sometimes contain (sometimes hilariously) a bit of randomization themselves. This seems interesting/funny the first few times you see the same error and the text is different, but the 3rd or 4th time, when you are at wit's end, it's no longer funny. Here's an example of an inform error (but not one with randomized text, I don't think):

You wrote 'now the Greyish Blue Book Of Matches is nowhere' , but although 'the Greyish Blue Book Of Matches is nowhere' is a condition which it is legal to test with 'if', 'when', and so forth, it is not something I can arrange to happen on request. Whether it is true or not depends on current circumstances: so to make it true, you will need to adjust those circumstances.

In general, my take-away is that Inform7 syntax is a great big can of worms. It would probably take me a month of working full-time to really understand the entire system and how it all works together, and feeling competent in it would probably take much longer. (This was obviously not that month!)

Wishlist / TODO list
If I wanted to spend more time on this project, these are the things I was planning on doing:

  • Randomized puzzles. Right now there is really only one type of puzzle. I would love to have 4 or 5 types (at least!), and generate different room descriptions based on the type.
  • Additional inform elements: Right now, there are rooms, objects (some edible), containers, and that's about it. I really wanted to get to the point where there was also a randomized person in each room. The amount of things you can do with Inform is staggering really. I've only just scratched the surface, for sure.
  • Finally, making this available to the rest of the world. This boils down to how I wanted to do this initially, and how I think it's feasible. Both would have been published as a webpage. A) I wanted to make a version that was different every time you play it. But the only way I could imagine that happening would be to install the command-line version of inform on a server, and at request time, generate the source, compile it, and redirect the request to that output. I've no idea if that's practical, but it's not something I wanted to attempt. B) The more practical alternative would be to generate a bunch of outputs all at once. So that would be writing another script to run my game.py script X number of times, saving the output off to a tmp directory, then using the command-line version of Inform7 (i7) to compile each output and save off a web-playable version into a subdirectory somewhere. Tentatively I was planning on doing this 365 times and then writing some kind of index.php to swap them out based on day of the year.

TL;DR
I really enjoyed working on this project, and learned a lot about Inform7 and python, but wouldn't really consider this a "successful" project, mostly because I just didn't spend the required time on it. There is always more you can do, of course, but in this case, I didn't take the project far enough where I think it's ready for public consumption. (It is all public, however, and anyone can play with the stuff I created. If you do, I'd love to hear about it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment