Versioning: Feature request (Extension Request?)

I had an idea I don’t know how to carry it out.

In Inform 7, the author can write “The release number is 0.”

I would like the “Compile” button to automatically increment this number when included in the source text.

Currently a point.number release is not accepted because the decimal point is a period. Nor is something like “The release number is 1-6.”

It would be helpful to me if there was a second digit stored which becomes the number after the decimal point.

On first release if I write “The release number is 0.”, Inform releases version 0 and then changes it in the source text to 0.1. If I hit the release button again, it becomes 0.2.

The post decimal digit could potentially get very high during beta testing, but that would be great information. “You got eaten by the plant even though you had the pitchfork? Oh, you have 0.152. Here’s 0.157.”

The author can manually change the release number. If I hit a significant milestone in beta testing, I can write “The release number is 0.500.” and Inform will go with that. I could write “The release number is 752.0101010101888899999955555.” if I wanted the number to be useless or somehow significant to the story (within reason, I’m sure Inform has standards about how stupidly large a number can be).

The whole number before the decimal does not increment automatically, and is only set by the author. When the game is released, they can write “The release number is 1.” Inform releases version 1 and changes the source text “The release number is 1.1.” If the release button is hit again, it becomes 1.2. the author can at any time reset this by writing “The release number is 1.” again.

Is this possible with any kind of programming within Inform? I know Conversation Builder has a neat feature that writes code for the author to copy and paste, but is it possible for a source text to actually update itself upon release? I’m figuring this would almost need to be a feature request.

Perhaps within Preferences, there could be a tick box to turn it off for anyone who prefers to set the version manually.

1 Like

The serial number fulfils a lot of the need for automatically updating version numbers. Even when distributing to beta testers it would be rare for an Inform author to need to publish more than one release per day.

That said, full semver compatible version numbers could be handy, along with auto incrementing patch numbers. A suggestion like that should be made at though.

It is heavily against the tide for the IDE to ever update the source code, outside of a specific user editing action. (No, “compile” is not a user editing action. It wouldn’t be an edit at the current cursor location, for a start.)

You could have a macro-ish Inform variable that is taken from the IDE environment and updated per build. (The UUID is taken from the IDE environment and kept constant, so it could work like that, only incrementing.) I agree that it doesn’t feel that different from the serial number, though.

I’m not sure what semantic versioning means in the context of an IF game. Forward-compatibility == “the winning transcript still works”? It doesn’t sound very useful in real life, since play-testers (and regular players) will not be going through the game along an ideal winning transcript.

(Semantic versioning makes sense for an IF interpreter, where you want a strong guarantee that old games still run.)

If you want to write a perl script or something to update it, that should not be much of a problem. I think it’s more useful to have a date, anyway, or at worst, a latest version of source control.

If you want fractional versions, this sample code should work for glulxe. You’d need to edit the same functinon in zmachine.i6t similarly (e.g. add print (string)(+ point-release +):wink:

[code]“pointrelease” by Andrew

the release number is 2.

point-release is text that varies. point-release is “.5”. [you could also make this a number and say print “.” in the i6 code]

room 1 is a room.

Include (-

[ VM_Describe_Release i;
print "Release ";
@aloads ROM_GAMERELEASE 0 i;
print i;
print (string)(+ point-release +);
print " / Serial number ";
for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i;

-) instead of “Release Number” in “Glulx.i6t”