intfiction.org

The Interactive Fiction Community Forum
It is currently Mon May 29, 2017 1:56 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Apr 26, 2017 2:42 pm 
Offline

Joined: Wed Aug 18, 2010 1:15 pm
Posts: 71
As part of the lurch toward a new release of Gargoyle, I realized it would be useful to have MIME types defined for as many of the game types as is feasible, so Gargoyle can easily be associated with all its supported types. But there are other users than just Gargoyle which could make use of such MIME types, so I'd really like to see if a consensus of sorts can be reached on MIME types. For systems conforming to freedesktop.org, this would consist of an XML file for use in /usr/share/mime. I'll distribute one with Gargoyle but if possible, I'd like it to just be a copy of an accepted, canonical version.

From what I've found, there has been some work toward MIME types. The IF Archive's .htaccess file has:

  • application/x-zmachine
  • application/x-tads
  • application/x-t3vm-image
  • application/x-glulx
  • application/x-blorb

QTads includes its own XML mime definition with the same MIME types for TADS.

The “file” implementation included with most modern Unix-like operating systems defines, in addition to the above, application/x-adrift.

I've created a proof-of-concept which includes these plus others, which I'm attaching here. I'm looking for feedback/additions/changes, in hopes a common accepted MIME collection can be created.


Attachments:
if.xml [2.54 KiB]
Downloaded 11 times
Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 3:10 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5332
.gblorb/.glb and .zblorb/.zlb should be these MIME types:

application/x-blorb;profile="zcode"
application/x-blorb;profile="glulx"

...if the profile qualifier makes sense. If not, application/x-blorb is most correct -- you're representing the format, not the contents.

The file signature for Blorb (including gblorb, zblorb) is FORM in bytes 0-3 and IFRS in bytes 8-11. Not sure if your XML file can represent that.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 3:30 pm 
Offline

Joined: Sun Apr 18, 2010 3:58 pm
Posts: 701
I've never seen a "profile" in the wild and would just as soon use application/x-gblorb (is that what "x-glulx" is supposed to represent?) as a separate type from x-blorb. I think it's an implementation detail that gblorb has anything to do with ".blorb" zblorbs, and it seems important for interpreters to be able to say "I support zblorbs and not gblorbs" (or vice versa) in a way that every MIME handler will understand.

_________________
At Choice of Games, we sell long-form choice-based interactive fiction games. We're looking for writers, paid in advance.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 3:47 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5332
I'd rather not introduce "application/x-gblorb", which is currently not used by anyone.

In practice, we're talking about Gargoyle which *does* support both Z-code and Glulx. So my plan is not going to cause a problem. There are interpreters which only support one or the other, but I don't know of any which try to distinguish based solely on MIME type.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 3:52 pm 
Offline

Joined: Sun Apr 18, 2010 3:58 pm
Posts: 701
Is x-glulx used for gblorbs?

_________________
At Choice of Games, we sell long-form choice-based interactive fiction games. We're looking for writers, paid in advance.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 4:12 pm 
Offline

Joined: Wed Aug 18, 2010 1:15 pm
Posts: 71
zarf wrote:
.gblorb/.glb and .zblorb/.zlb should be these MIME types:

application/x-blorb;profile="zcode"
application/x-blorb;profile="glulx"

...if the profile qualifier makes sense. If not, application/x-blorb is most correct -- you're representing the format, not the contents.

The file signature for Blorb (including gblorb, zblorb) is FORM in bytes 0-3 and IFRS in bytes 8-11. Not sure if your XML file can represent that.

The Blorb entries were the biggest sticking point I saw from a more global perspective: I can see a Z-machine interpreter not wanting to say it supports application/x-blorb so that (for example) Glulx files aren't associated with it. As far as I can tell, the freedesktop MIME XML spec doesn't allow anything like the profile setting, although finding good documentation on it is difficult. From Gargoyle's perspective a global Blorb is fine since it least supports both Z-machine and Glulx files in Blorbs.

And it looks like multiple matches from disparate parts of the file are allowed for magic checking, so I'll be able to identify Blorb files by looking for FORM and IFRS as well.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 6:04 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 932
Location: Greece
The TADS MIME types are here:

http://www.tads.org/t3doc/doc/techman/mediatypes.htm


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 7:51 pm 
Offline

Joined: Thu Nov 05, 2015 7:15 pm
Posts: 7
cas wrote:
The Blorb entries were the biggest sticking point I saw from a more global perspective: I can see a Z-machine interpreter not wanting to say it supports application/x-blorb so that (for example) Glulx files aren't associated with it. As far as I can tell, the freedesktop MIME XML spec doesn't allow anything like the profile setting, although finding good documentation on it is difficult. From Gargoyle's perspective a global Blorb is fine since it least supports both Z-machine and Glulx files in Blorbs.

And it looks like multiple matches from disparate parts of the file are allowed for magic checking, so I'll be able to identify Blorb files by looking for FORM and IFRS as well.
According to the Blorb standard by Andrew Plotkin (version 2.0.4) the executable resource chunk can have any of these types:
'ZCOD': Z-code
'GLUL': Glulx
'TAD2': TADS 2
'TAD3': TADS 3
'HUGO': Hugo
'ALAN': Alan
'ADRI': ADRIFT
'LEVE': Level 9
'AGT ': AGT
'MAGS': Magnetic Scrolls
'ADVS': AdvSys
'EXEC': Native executable
Many of these have never been implemented, but ADRIFT Blorbs are quite common and have the extension *.blorb
In the ADRIFT section of the standard it says that ADRIFT Blorb files should use MIME type application/x-blorb;profile="adrift".


Last edited by saabie on Wed Apr 26, 2017 8:24 pm, edited 2 times in total.

Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 7:59 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5332
That was ambitious planning. Only ZCOD and GLUL have been used in real life.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 26, 2017 11:14 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5332
Quote:
I can see a Z-machine interpreter not wanting to say it supports application/x-blorb so that (for example) Glulx files aren't associated with it.


I can imagine it, but it's Good Enough(TM) if it *does* accept application/x-blorb and then displays an error message "Sorry, only Z-code Blorb files."

(I can equally well imagine a Blorb-editing app which looks for application/x-blorb because that covers all Blorb files. Admittedly, this is imaginary.)


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group