What do you use to program your IF?

Then I suppose that single-file monstrosity isn’t exactly a fair example.

My difficulty in reading this source text is mostly down to the penchant Michael Martin has for giving things inscrutable code names rather than using words in English, and the I6 code that he’s added for a feature specific to that particular game. I can understand why he did it, but you don’t really want to be trawling back and forth looking up that ‘s_unknown’ is ‘status unknown’ or ‘sao_outmaneuvered’ is something about a slack attack rating, and so on. Naming your variables stuff that makes sense in English is helpful for making readable code.

As for the code source size: you could break down the game into different files and then load them all up as extensions into the final game if you really wanted, but I don’t see the point. Inform’s IDE is such that you don’t have to view the source code as one huge block of text, but rather you focus on different subsections of it separately.

I’ve personally never really encountered a language that lets you express complex world simulation concepts like that so elegantly.

That is so very true.
Although, to be honest, the same sentence can be phrased in any other way and Inform wouldn’t understand it. In the end it’s just another programming language, with rules and bounds.
BUT: the integration between what you think of doing and how I7 handles it is so seamless it is astonishing. I think the best parts of I7 were done by the “narrative” minds of Nelson, Short and the rest, not the “coding” ones. This IS a work of genius, no matter how people react to it.

I started coding my first game with less than 20 hrs of teasing at the documentation.
I found myself in front of a puzzle which just self-generated by how the story was going on. I had this piece of soap the player had to push on (er… push ACROSS) something to copy its surface. And then a machine able to replicate that surface on yet another thing.
I started coding it absolutely unaware of how to do it.
And it was done. In, like, 30 minutes, on the first try. I seriously doubt I would have succeeded in I6 or TADS where I got stuck in much simpler problems.

If there is a problem with I7, imo, it’s in how the language-directed code sometimes gets along with the real descriptions ingame. I mean, there is no much difference between “Instead of taking the steel bar, say” and the part after the quotes in the same line of code. That drives a non native speaker like me to forget this is a PROGRAM and not my other average friend. Coding starts being too much like a conversation, and this can generate errors.

This is what i mean:

[code]Metal_ladder is in the Campus. “There is a metal ladder here.” The printed name is “metal ladder”. Understand “ladder/metal” as the Metal_ladder.

Instead of going up when in the Campus, try climbing the ladder.[/code]
This compiles, but doesn’t work, of course. And it takes a lot of time to know what’s wrong if you just don’t turn on your brains. (Ok, in this case it is NOT that hard, but imagine you’ve already written the word LADDER ten times in ten different descriptions. To you, the Metal_ladder IS the ladder, no matter what).
And this is a common mistake I do when coding in I7.

That said, I wouldn’t recommend anything else than I7 to a beginner. Unless he has the mind of Andrew Plotkin, I mean :slight_smile:

When I come to the blank page, writing a novel or a short tale, I want the computer, the software (I actually use InDesign to write: Word is just tooooooooo unstable… and I need the eye candy as well as the page size), or the damn typewriter to disappear as soon as I start writing “It was a dark and stormy night…”. Inform quite succeeds in this, although not so much as one would hope. And this is what I most like in it.

And so the language wars begin … again …

But they are surely a bit of a distraction in this case. Whatever one thinks about particular IF-specific languages, the main point is that if one’s aim is to write interactive fiction (and not, e.g., to write a parser, or stretch programming muscles in a particular language) any of the established languages will probably end up producing a better result (and certainly a quicker one) than starting from scratch, because there are all sorts of dark corners and common problems and pitfalls that the established languages have fretted over – and even where the “core” language may not end up with a satisfactory solution, the likelihood is that there are extensions or published code that does. If you “roll your own” you will certainly have to reinvent quite a large number of wheels (and probably find yourself having to look in some detail about how those who have gone before have made theirs), and very likely find that your first efforts are as one expects of first efforts.

Beyond that it’s surely a matter of choice. If you like the Inform 7 IDE and its way of organizing things, then that’s great. If you prefer I6 or TADS, that’s fine too. If you find Inform 7 elegant, wonderful; if you think TADS is more rigorous, that’s wonderful too. Sooner or later you are going to hit something that you don’t terribly love, something which another language does “better”, something that you find annoyingly difficult to achieve.

If you are writing IF for fun, there are two people you have to please: yourself (in writing) and the audience (in playing). Any of the mainstream languages is capable of doing the latter; that has been proved by experience. Non-IF-specific languages are much less likely to do so (that has been proved by experience as well), certainly without quite disproportionate investment of time. When it comes to pleasing yourself – well, please yourself! If you want to write interactive fiction in Haskell (notoriously, to its cognoscenti, the nec plus ultra of elegance), feel free.

It bothers me a little that there hasn’t been a serious attempt at a new general-purpose IF system in the last five years (and I’m not even sure you really can include I7 here). Of course here is where I hand wave away Curveship, ChoiceScript, Undum, Quest, Adrift 5 I guess…man, these arguments get into trouble quickly don’t they. :confused:

How I would write that-

'Note that I would replace item_hostile with every hostile item, as I don’t have grouping of items programmed.
'0 = not owned, 1 = owned, 2 = equipped
If (item_hostile = 2) And hostility_check = True Then
'This makes the relationship of all dogs be hostile to the player if the player is holding the item, which triggers this check.
'The temporary just stores the current amount until needed again.
'0 is neutral, -20 is mean, -50 is hostile, -100 is offensive (they attack)
dog_relation_temp = dog_relation
dog_relation = -99
Else If hostility_check = True Then
dog_relation = dog_relation_temp
hostility_check = False
End If

It’s a lot dirtier, but that is how it would be written. And it does this PERFECTLY.
EDIT: If I don’t screw up.

Fair enough, except you left out the part about this being a rule that applies only when the player is attacking something, the part about that being a specific thing (Tom), the part about it taking place after checking that this action is possible but before beginning to carry it out (the “instead” rulebook), the part about looping through the dogs in the game, the part about only applying the loop to dogs who are currently visible to the player, and the part about only applying the loop to dogs who have a certain relationship to Tom (ownership). Not really a fair comparison, I would think.

Touchè.

Well, that’s how I understood the code that was given.

Hi, I’m new.

Interesting. Having a bit of free time on my hands I’ve decided to learn an IF language. My only previous experience was the Professional Adventure Writer on the Sinclair ZX Spectrum, which is great but unfortunately the Windows port, WinPaw, is terribly unstable. Eventually narrowed it down to Inform 7 and TADS 3 & downloaded both. I don’t know but I suspect perhaps TADS is more ‘rigorous’ but I’ll be honest I found it waaaaaay too daunting, like trying to program in C++ when you’re used to Visual Basic. So I’m going to give I7 a go and see how I get on with that.

If you know Visual Basic, how can C++ be “waaaaaay” too daunting rather that “somewhat” daunting"?

It’s just the way my 900 page learn C++ tome has been sitting on my bookshelf glaring at me for the past couple of years. Plus I’ve always struggled with Object Oriented programming - Just don’t find it intuititive and natural, even if it is the ‘in’ thing. Having grown up with old-fashioned procedural programming it just leaves me cold.

I7 is object oriented. “is a” declares object instances.

I7: “The Kitchen is a room”
T3: “kitchen: Room”

In both cases, Kitchen is an object of class Room. “is” sets object properties.

I7: “The donut is edible”
T3: “donut.isEdible = true”

It’s really not that different. If you don’t like OOP, then I don’t think any of the IF languages will look appealing to you.

Fair point, but I find the whole ‘natural language’ approach interesting & perhaps more intuitive. Could soften the blow of being OO (then again could not, don’t know yet). I’ve read some of the criticism of I7 (some if it quite barbed I must say :open_mouth:) but hey, you’re never gonna please all of the people all of the time.

Basically, I want to spend my time writing adventures, not coding, if you get my drift. At the moment it’s a toss-up between I7 & ADRIFT. I have no idea how it’ll end up but it’ll be lots fun finding out. I’ll keep you posted.

Visual BASIC is as fully object-oriented as C++ starting with the .NET edition – at least, that’s what I heard.

Paul.

The only way to do that is to be a writer and get someone else to do the coding; I7 is a programming language. Adrift might help in avoiding some programming. Quest too. So you might want to look into those.

One of the easiest IF programming languages out there should be Hugo. I don’t know how similar to Basic is it though, as I don’t know Basic at all.

For the moment I’m sticking with VB6. partly because I’m used to it and don’t like the principal of the .NET framework, but mostly because I don’t think my prehistoric PC could cope with it :frowning: It can wait until I buy a new laptop :mrgreen:

Perhaps I misworded my comments. I enjoy coding and it is obviously an integral part of writing IF, but for me it mustn’t dominate, ie be too ‘heavy’ and an uphill struggle, otherwise you’re spending all your time concentrating on trying to fathom the code and not enough time on the creative process.

Never heard of Quest. I’ll check that out.

Programming is not creative? :wink:

Now you’re misunderstanding xyzzy on purpose :wink: Of course, programming can be a very creative enterprise. But I guess it is very clear that the mindset of the programmer and of the author of a story are quite different. What xyzzy might have been trying to say (at least as far as I understand it) is that he prefers the latter to dominate the process of writing IF.

And I guess he wants his IF authoring tool of choice to reflect that; hence, TADS 3 might not be an ideal choice for him.

I am sure you got that; I feel that you’re simply objecting to his use of “creative” as describing the non-programming part of writing IF. Words can have more than one meaning, though; it is quite common to distinguish between the creative roles in film-making, for example (director, actors, writer) versus the non-creative (producer, agents, casting director), notwithstanding the fact that producing/casting a movie can be a very creative task a well.

Matt