[I7] Simulating two games at once?

I’m trying to make a game where you have to win two IF mini-games at the same time, using the same commands. Is this even possible in Inform 7? I’ve tried a lot of things, and short of asking the player to please type the same input into these two different .z8 files, nothing works.

Ideally, I’d like to have the following extra features:
– Let the two minigames interact with each other (so, not two different .z8 files, probably)
– Test if a command is invalid in one game, and if so, and some STRICT_COMMANDS variable is true, then don’t execute it in the other game
– Make the whole thing look nice on the screen

Do I even have hope for doing this in Inform 7? If not, is there some other tool I can use, short of programming an entire parser myself?

You might split the screen into two text buffer windows, then build your two games in the same I7 project with a different player character in each. Then each time the player enters a command, switch to Window 1 and Person 1, execute it, switch to Window 2 and Person 2, then execute it again. Look at the source code to the Art of the Fugue for one way to go about this.

JB Ferrant did something like that in “Works of Fiction”, a few years ago. (You’re lucky, it’s his only game in English!)
He had a kind of “schizophrenic” character who thought he was in Star Wars when he was actually in a comic expo’s closet (details are fuzzy), and you had to refer to the “parallel world” to make things progress in the “real world” and vice-versa, with the whole thing in “split screen”. Then, madness ensues, since there’s 4 different windows at the end!

Anyway, I think he did it kind of in a hackish way, synchronizing events that happened in the main window with text being displayed in other windows. Not sure, I haven’t looked at his code much. His code is Inform 6, but you might get some interesting ideas out of it. (It’s a bit buggy and it crashes sometimes, though.)
It’s there: ginko968.free.fr/jeux/wof.htm

I could swear Zarf did something like this, also in Inform 6 and also with a split screen. One of the settings was a sort of caveman thing with rocks and sticks and dirt, and the other was a future setting with curved white plastic chairs. I’m too busy to go poking around at the moment, but maybe that will help?

Drat. I sort of remember writing that too, but where I left it…

It’s twocol, a demo on the glulx home page :wink:

eblong.com/zarf/glulx/quixe/quix … Play+it%21

If that’s still being updated (which I doubt), there’s a bug: X FUTON then N puts the command “n the stump” into the other window. It does the same thing with the rock/chip.

That’s why I don’t remember, it was 2005… heh.

Like the comment says, lots of stuff doesn’t work.

Thanks, everyone. After reading through the Art of the Fugue source text, I came up with a horrible kludge that works for now:

After reading a command: let X be the player's command; change the text of the player's command to "[X]. T2P2. [X]. T2P1."
T2P2 and T2P1 are verbs that execute “now the player is Player2” and “now the player is Player1” respectively.

The Art of the Fugue source code has sections that let me disable disambiguation questions, “it” and “all”, et cetera. And of course I have to make sure that the player never actually types T2P2 or T2P1. Other than that, I think this should work.

You could catch them with an “After reading a command” rule that runs before the one from your last post. Like this:

First after reading a command when the player's command includes "T2P2" or "T2P1": say "Hey, are you trying to get at the game's internal commands? Knock it off!"; reject the player's command.

and make sure this rule is listed first.

A lot of that code is not very clear and beautiful, I’m afraid; but I’m glad to hear it was nevertheless useful!