Word processors as the IDE

So I was talking quite awhile with Dan Fabulich of ChoiceOfGames.com at the I-F freeplay room at PAX two days ago. In trying to pull in Real Writers™ to write games for him, he teaches them ChoiceScript, a minimal programming language for writing CYOA. ChoiceScript looks like an outline that gets indented insanely far if you try a dialogue tree of any length. (Dan recommends a “stack of bushes” shape for his style of games as a result.) Anyhoo, Dan told me that many writers were asking him the same question while he was training them on his tool: why can’t I just use MS Word?

ChoiceScript, like most every programming language including Inform and TADS, requires an ASCII text editor, like Notepad or (on Mac) TextEdit. ChoiceScript doesn’t have an integrated one with an IDE like Inform et al, so perhaps it is less of an issue here – you want to write int fic, you use the int fic tools, not a word processor. Dan said that many of his writers didn’t know the difference between ASCII editors and word processors: it’s all just text, right?

Of course it chilled me to the bone to hear writers not knowing the difference between .txt and .doc, but once I got over myself, it made perfect sense. Why isn’t int fic creation done by a word processor plug-in?

I had, just a few moments ago, been reading up on Scintilla, the text-editor component that the Inform 7 IDE uses (as of 6E59). Scintilla.org says, “The biggest problem with Richedit and other similar controls is that they treat styling changes as important persistent changes to the document so they are saved into the undo stack and set the document’s dirty flag. For source code, styling should not be persisted as it can be mechanically recreated.”

OK, so, styling changes are “input” in the word processing world, but “output” in the coding world. Still, is it hard for a compiler to ignore such stuff when compiling the words in a .doc file?

Anyone know of any sort of compiler being a plug-in for a modern (GUI-native) word processor? (Emacs and vi don’t count!) Has such a thing been conceived of in the I-F world? Any writers have opinions on this sort of thing?

Why writers would want to use word is probably beyond my understanding, but it should be possible to make some extension which would link between the word processor and an IF compiler. Open Office would be quite easy I’m sure, MS Word maybe not…

I think the main advantages of a Word Processor - formatting text nicely, in a way that’s representative of the printed page - typically won’t actually amount to anything in the final IF game that you get out at the end.

While the kind of things you want in an IDE - compiler options, the ability to include files, intellisense, automatic formatting of reserved words and quoted strings, the ability to set breakpoints and step through code - seem like they’d be a huge pain to work into any existing Word Processor.

I certainly think there is something to be said for making an IDE that takes the look and feel of a word processor, but I also think the Inform 7 IDE has already largely done this.

I guess I just don’t see what the benefits would be to a Word Processor plugin besides placating a fear of different technology - and if they’re hoping to write interactive prose, they’ll have to get over that sooner or later.

Embarrassing admission: for a little while when I first started with Inform 6, I knew so little about text editors that wrote my source code in my then-word processor (not MS Word, but something Mac-specific… MacWrite Pro? something like that. It’s been a while) and then saved as text, which added a fun extra step to each compilation. I’d done other programming before, but always within an integrated editor, and didn’t know what to do when required to produce my own text files.

This said, I think I agree with Pacian. If someone is frightened off by “we use this other tool because it handles the special requirements of this work better”, what are they going to do when they hear about variables and loops?

This is an unproven theory that may or may not hold true.

Textfyre has been able to design games in MS Word entirely using a template highly similar to a screenplay. Whenever there’s detailed logic associated with an action or response, we’ve been able to get by with statements like “one of six random responses” or “these responses in order, repeated” and similar types of codeless descriptions.

The primary flaw in our experiences to date are that all of our designers are experienced IF Authors. They’re aware of how IF works and so they know how to communicate logic without code (although Mike Gentry admits to cheating and doing proof of concepts in code before nailing down a scene in Word).

I still hold out hope that non IF writers can be brought into the IF world through the design in a Word Processor process and be successful.

I’ve considered making a document template for Word to follow the process we’ve used within Textfyre, but at this point I don’t think anyone would use it.

Without actually using a word processor, an IDE could allow WYSIWYG styling inside strings:

dragon_question = “What, with your bare hands?”

(Assuming IDEs aren’t already doing this - I haven’t looked at any for a while.)

The styles would be displayed, and could also be applied as in a word-processor - select the text and hit ctrl-b or whatever.

The IDE couldn’t always determine what style a string would end up being printed in, but if you did simple substrings like the above, plus a special case for room names, that would cover most of the styling in most games.

Actually this is often problematic – at least, I commonly use styling to

– italicize or change the shading of certain prompts or information I want the player to read as outside the game (parser errors, conversation hints)
– make bold the printing of object names as a way to highlight for newbies what they can interact with
– automatically italicize the titles of all Book-class objects in a game

…and other things like this, where the styling is happening procedurally and often in some rule far away from the text string to which it applies.

After I posted I was thinking you don’t need to restrict styling to constant strings - you could allow it in any expression that’s generating a string:

“This is a [severity of the hint] hint: why not try [description of the hint]?”

msg = “The book is called” + book.title

It still isn’t WYSIWYG everywhere - where the literal book titles appear they aren’t italic. It’s the same principle as capitalization in I7, when you have [The object] or [the object] and the capitalization of the expression in the source is applied to its result.

Ideally you’d like the IDE to have enough type information to prevent you from styling bits of the source outside string expressions.

Anyway. I don’t really know if this idea is sensible but it would clearly be super neat.

I think it’s more a question of time and comfort than fear. I’ve used the wrong programming language for a task because I just didn’t want to learn the right language. I’m not afraid of language B, I just didn’t want to invest my time.

I’m not simply suggesting we use the word processor as a glorified text editor. I’m assuming we have a programming language specifically designed with that in mind. Rather than placing prose “in” the code (usually corralled between double quote marks), do it the other way around: the code is “in” the prose (like Inform 7’s say phrases – all code is corralled between square brackets). I can easily imagine creating I-F through say-phrases like [interaction beat] or [press any key] or [wait for reader to type “refuse/no/disagree”]. (If I could reference the prose via excerpts like …question of time… and allow properties on prose like “read”, “chosen”, “offered”, then say phrases like [if …question of time… was read before …disagree because IDEs… was chosen] are feasible.)

Granted, I did that scene-centric tutorial, which is a unusual way to conceive a game.