Python: steps for distributing a work?

I had a Python project that developed into … well, something I’d like to share. But I know Spring Thing and IFComp entries have been tricky to access. The topic Why on earth would anyone enter raw Python code into the Spring Thing? got me thinking about things programmers/creators could do to make sure their work is accessible to as many people as possible.

So I wanted to throw out a technical checklist of things to include in any deliverable.

  1. build a Windows executable on Windows with pyinstaller
  2. build a Linux executable on a virtual box (again with pyinstaller)
  3. check Python 2 compatibility so that Mac users who don’t want to install Python can run the program. (in my case, Python 2 doesn’t easily check column width, so I have the user input that, if they want. Also, I equate input = raw_input with try/except.)
  4. maybe bug a Mac-owning friend to build a Mac executable if the project is stable enough

Looking at what I have, I suppose it could be done in/ported to Inform or Twine, but the coding might be painful and hardly bug-free and take longer that way. Plus the initial goal of the project was to use Python classes more intensively than I previously had.

What would other people add to this list or modify? Thanks!

2 Likes

Python 2 is entirely out of support at this point. And MacOS comes with /usr/bin/python3, it looks like. So I really wouldn’t spend any time worrying about Py2 compatibility.

EDIT: I think MacOS doesn’t come with python3, but it prompts you to install the (free) developer tools, which include python3? I don’t have a Mac without the developer tools set up – obviously – so I don’t know for sure.

1 Like

Having to download an executable will turn off a lot of players. Your best bet might be to try something like brython to make your game playable in a web browser.

1 Like

On the other hand, if you have Python 2-compatible code, you have a code that can be put into the current version of Ren’Py, enabling a fairly easy method of making the distributions of the game compatible with most computers that don’t have Python 3. (This is because Ren’Py can run Python 2 code. I understand it’s converting to Python 3 in the upcoming version 8, but that’s not available yet).

1 Like

Having to install a Python setup will turn off a lot more players. This is where the discussion started.

There is no good solution here. I say this as someone who starts nearly every project with a Python prototype.

I agree that if you can possibly get your project into a web browser, you should. That gives the highest approachability factor by a long shot. If that isn’t possible, a downloadable Mac and Windows app is at least moderately familiar. More so if you put them up on itch.io.

(Linux adds several additional kettles of worms.)

2 Likes

How about having a program/app that downloads IF works as DLC? I don’t think having a “launcher” program is going to be that difficult? Of course, I haven’t seen one, but if you can just set up Frotz, for example, to just download things directly from IFDB, for example, that should be convenient enough to use?

Edit: I’m thinking like ebook / comic book reader, in that you can just download new titles to the app, but it’s IF specific.

Yeah, it’s kind of nice Py2 is out of support. But I noticed that MacOS came with Python 2.7, so I wanted to account for if people had an older version and decided not to update. Even though it looks like MacOS offers the easy opportunity to upgrade to Python 3, so people should.

In my case, backwards compatibility with Python 2 was trivial to fix, but it might not be for others.

Brython looks really promising and well-documented. Thanks for directing me to it. It also might ultimately make user input easier.

Python is to me, such a beautiful and powerful language, I really would like to see it become a more credible option for IF.

Famously now, my Spring Thing entry did not succeed in convincing many people this time. I thought maybe the fact that it was in the Back Garden, might have signalled that it could be viewed as an experiment, and treated as such. But those expecting a traditional IF experience were justifiably disappointed.

Rather than try to win over the whole world all at once, maybe it would be better to focus on a more technical crowd[1].

Raspberry Pi is a platform welcoming to retro gamers. They might be a community more tolerant of occasional packaging issues. In fact, they curate Python games for that platform.

I’m not suggesting leaving intfiction.org for another community, only maybe some friendly cross-pollenation.

[1]: I know there are IF fans with serious technical chops, but this is not a reasonable characterisation of every prospective player.

3 Likes

If you are trying to reach students, consider:

Make Your Own Python Text Adventure by Phillip Johnson.

The Raspberry Pi is a rich development platform for just about any language. The RPi Foundation has always targeted Python.

It supports Inform 6, PunyInform, and Dialog with very little setup.

1 Like

Has the author contributed to IFComp or SpringThing, etc?

Not that I am aware of. The text is mostly a method to teach programming.

I have a commercial copy and it is available as a sample or for purchase on the Kindle. I have also seen pdf versions on the internet. I am not sure if they are open sourced or not.

1 Like

I’m pretty sure it’s not open source, but I may be wrong. After all, why bother teaching computer programming from scratch, and then refuse to let you modify the source code?

IMO, any copyright for such text should be limited to just the description/explanation of the code, as opposed to the actual code. I haven’t seen any confirmation for such cases, however, and usually “all rights reserved” means both text and code.

I bought this book in Kindle format and was less than impressed.

The formatting on some devices made it hard to read and it was poorly edited. The game it described was also more like an RPG than a text adventure, and based on a grid.

It reminded me a little of a game from the 1980s called Wizards Castle.

I think the author made the source code available on GitHub, but the book itself is unlikely to be legally available for free.

1 Like

You’re right about the code available on Github, although that doesn’t necessarily mean the code is “free”. I maybe wrong about this, so feel free to correct me.

I never downloaded the actual book. I only saw the free tutorials on the web site. Judging by the amount of questions the posters have on it, I deduce that the text explanation is sub par. I looked at the sample codes, and was less than impressed, as well.

That said, having RPG as base of IF isn’t a bad thing. There are many situations where you want individual objects to have attributes, instead of limited to flags, and RPG systems can easily deal with that.

1 Like

Just as a clerical exercise and to echo @ramstrong’s post, this is Philip Johnson’s site, and the most recent blog discusses the text adventure, which still seems to be in progress.

This is the GitHub repository. Whether or not the book is good value, I love being able to look at the changes people make in Git repos. So many “Aha, so that’s how they did it” moments if I’m paying attention … it can be more interactive than a book, and if it’s publicly available on the web, so much the better!

3 Likes

@ramstrong : I mentioned the code being on GitHub because details of which license applies is usually stated there. It seems that it is covered by the MIT License in this case.

Using RPG elements in IF can be useful, but it probably isn’t what most people would expect in a text adventure.

Personally, I would expect a book on creating text adventures to tell you how to create something like Colossal Cave Adventure and then possibly give examples on how to expand upon that.

I don’t remember this book even suggesting how to expand on the four compass directions it uses (possibly because the grid system makes that more difficult than it needs to be).

1 Like

Yet to be exploited, as far as I know, but think of the possibilities!
All that ancient scholarship on comparing folios. Now you can just calculate the change in cyclic complexity on every git commit.

It is under MIT license. However, I’m unsure what it means by “preservation of copyright and license notices.” Especially as it pertains to “distributed under different terms”. Who owns the copyright when the code has been significantly modified? Perhaps someone more familiar with it can explain it to me?

A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

Did you read the actual license? That’s just GitHub’s description in general terms of the license: right below that it says “This is not legal advice.” The MIT license is only a few paragraphs and I would have said it’s pretty clear: “The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.”

https://raw.githubusercontent.com/phillipjohnson/text-adventure-tut/master/LICENSE.txt

Now I’m really confused. You mean no attribution to the original authors is necessary?