Parser freezes? [I7]

I’m working on a game and, as one often does when working on games, I run the game to test it. It gives me the first prompt. I enter my gender and…

Nothing happens. Nothing. I can’t delete my command, I can’t type more, and it doesn’t print any output or another prompt.

I check Activity Monitor. There is no CPU usage by glulx.

I export it to a blorb and run it in Zoom. It works fine, but I want my inform testing commands and AFAIK there’s no way to release a blorb with I7’s built in testing commands… right? And that’s ignoring the skein, test me, et al.

I then begin commenting out things I have changed recently, and I find the one line that is causing the problem:

Kitchen contains two small green snakes.

What! How does this even affect the parser if the game starts in an entirely different room and is at this point just scanning the command for a gender?!

In fact, I have an old backed up copy of my game on a flash drive and it works perfectly, including that line. I have not touched that line of code since then.

What is odd is that elsewhere in my game I have the line:

The forest-items-box contains three small green snakes, two medium green snakes, a large green snake, two red potions...

So it can’t be that nameless object assigning (or whatever the real jargon is) is broken. Then I try rephrasing the offending line.

Kitchen contains one small green snake. Kitchen contains three small green snakes. Kitchen contains a small green snake (called bob)
These compile and work as intended. However, I specifically balanced the power of the small green snakes around the first battle including two. Now I try to rephrase it again, this time to definitely include two of them.

Kitchen contains 2 small green snakes. Kitchen contains a small green snake and a small green snake. Kitchen contains two small green snakes (called bob and susan)
These all compiled, but still gave me the weird parser freeze. It also breaks on other types of monsters substituted. Eventually I hit upon what should have been obvious before:

[code]Kitchen contains a small green snake.

There is a green snake.

When play begins:
now kitchen contains a random small green snake held by nothing.[/code]
Which I guess solves my problem… maybe… but it’s awkward. I’ll have to do this for every location that exactly two of the same enemy appear in the same room. I don’t like this solution very much, it’s ugly, it’s longer than should be necessary and it circumvents the problem meaning the devs are less likely to fix whatever is causing it. Anyone have a clue as to why this issue is occurring?

EDIT: And looky here. The above code contains a mistake. Upon fixing it… it crashes again. With further experimentation I have deduced that it’s only deciding to die on me if there are a total of five green snakes in the world (2 in the kitchen and 3 in the forest-items-box). The question is… why?

This is on a Mac? Which OS version?

There was another recent report of the Mac IDE freezing up in that way. It seems extremely idiosyncratic – it’s never happened to me, with the current version of I7 – and probably not directly related to anything in your game.

OSX 10.6.8

I don’t think it’s related, as I’ve been using glulx on this project since day one. Plus, clearing the screen is at the very least part of the normal behavior of restarting, while mine just sits there and refuses to process anything.

When I said "idiosyncratic ", I meant it. It may be related even though it’s a different VM.

However, if you post a complete game demonstrating the problem, we can test it. I tried:

The Kitchen is a room.

Kitchen contains two small green snakes.

But that works fine. (Well, it creates a single item called “two small green snakes”, but you weren’t asking about that.)

As it does for me. The game was running perfectly fine before. This didn’t occur until I added a pile of new code, unrelated to green snakes. It was to create a new type of enemy, and I had changed the enemies in the kitchen to test their behavior. At this point the freezing began, no matter what monster I put there (but if I comment out the line or change the number, the problem vanishes.)

Well, it’s possible that you added some code that overwrites an internal (I6) array and breaks the parser. (This is rare in Inform 7 programming, but possible.) And it’s possible that there’s a memory bug in the IDE’s display layer that causes sporadic problems, and you’re running into it for hard-to-predict reasons.

Without a test case that demonstrates the problem, there’s not much we can say.

What exactly could overwrite an I6 array? There’s a tiny bit of relations and dynamic tabling in the added code, which are just about the only things that bring arrays to mind.

I’m not sure. If you had some I6 inclusions in the code, you’d look there first, but it sounds like you don’t.