I7: Making object names appear in the z-story file

When I create a story file and export it to Z-Code, all the object’s descriptions seem to vanish from the story file. The game is still playable, but using tools like infodump or rezrovs “omap” function (which is basically the SHOWME command) just prints empty strings for my rooms.

I am currently experimenting with writing an AI able to “play” IF using the rezrov-Interpreter and tried to implement some kind of minimum working example with a few rooms and some movable objects. Instead of parsing a room’s description, it’ll just ask the interpreter for all objects in the room and try to manipulate the objects with given action sets.

rezrov and infodump both deduce the objects “short name” from the property table header described here.

Why does inform not set these names accordingly? Any way to make it do so?

[code]$infodump -t example.z8
**** Object tree ****

[ 1] “Class”
. [ 10] “VPH_Class”
. [ 13] “K0_kind”
. [ 14] “K1_room”
. [ 15] “K2_thing”
. [ 16] “K6_supporter”
. [ 17] “K8_person”
. [ 18] “K10_man”
. [ 19] “K11_woman”
. [ 20] “K12_animal”
. [ 21] “K4_door”
. [ 22] “K5_container”
. [ 23] “K14_vehicle”
. [ 24] “K15_player_s_holdall”
. [ 25] “K7_backdrop”
. [ 26] “K13_device”
. [ 27] “K9_region”
. [ 28] “K3_direction”
[ 2] “Object”
[ 3] “Routine”
[ 4] “String”
[ 5] “compass”
. [ 29] “”
. [ 30] “”
. [ 31] “”
. [ 32] “”
. [ 33] “”
. [ 34] “”
. [ 35] “”
. [ 36] “”
. [ 37] “”
. [ 38] “”
. [ 39] “”
. [ 40] “”
[ 6] “(darkness object)”
[ 7] “(Inform Parser)”
[ 8] “(Inform Library)”
[ 9] “(property_numberspace_forcer)”
[ 11] “(ValuePropertyHolder_43)”
[ 12] “(ValuePropertyHolder_47)”
[ 41] “”
[ 42] “”
[ 43] “”
[ 44] “”
[ 45] “”
. . . (A long list of objects without a name continues)
[/code]

(Here is a partial example of Zork, where infodump works correctly (And so does it on other games I’ve tested))

You are correct that I7 does not use the “hardware name” (property table name) field. Rather, it relies on the short_name property defined in I6 code. This may then be customized by the printing-the-name activity in I7 code.

This being the case, it doesn’t fill in the property table name simply because that would be a waste of space. (This is particularly important in Z-code, where the property table lives in RAM, which is precious.) (In contrast, the values of short_name property live in ROM.)

If the hardware name were defined, it wouldn’t always match the name that the player sees, anyhow.

If you want to do this experimentally, you can parse the gameinfo.dbg file (generated during compilation). This gives you values for all the properties and object addresses. You can then dig in to extract short_name strings – although it isn’t fun, and some of them will be functions rather than strings.

But that doesn’t help when you’re trying to play an existing compiled game, where you don’t have access to gameinfo.dbg.

Moving beyond your minimum example, not every object that’s in scope for a command will be present in the player’s location. So, your approach may miss critical actions that are necessary to advance the game.

I think that the best approach is to interact with the game via an interpreter and to act on its output. In the limit, an analysis of the story file is equivalent to writing your own interpreter and running it.

Ahhh that makes so much sense! Thanks for clearing that up. So I guess there is no way to force I7 to generate these names? Or could I do this by writing I6 code instead?

Of course there are certain limitations to this approach. One could easily create situations, in which the AI would not be able to progress further (Think about dialog menus for conversation etc.).

This is the best approach, but it comes with the huge drawback (at least for me) of having to interpret natural language (and supply a fair amount of common knowledge about the objects of the world). So for the first step, I decided to use the interpreters internal functions to access objects.

There’s no way to make I7 generate them.

If you wrote the whole game in I6, it would be easy.

Okay, I just did it by using the intermediate compilation result (auto.inf from the Build folder), adding the names to the objects accordingly (some dirty search and replace) and running that through the inform compiler again to generate the z8-file. A quick test with infodump then showed the names :slight_smile:

That’s not ideal, but I finally have a story file to modify and test against. Thanks for your input zarf, it has been very helpful and is much appreciated.