Game Source Files Not Reading Properly on Linux

Hi, I’m getting pretty seriously back into Dialog, both to create games, but also with the hope of understanding the language and the codebase well enough to help contribute to the project in future.
However, i’m having issues compiling dialog projects. I’m using Arch Linux (kernel 6.12.2, GCC 14, glibc 2.4).
The problem is happening with compiling projects contained in more than one source file. dialogc seems to have trouble reading all but the last source file passed to it. I thought something must have gone wrong with my build of 1a02 (lots of truncation warnings, although the tests came back fine), so I tried building 0m03, but same problem. Even the prebuilt 0m03 does it.

Dialog compiler 1a/02
dialogc -v -t z8 story.dg stdlib.dg -o story.z8
Info: Word count for "story.dg": 0
Info: Word count for "stdlib.dg": 1510
Info: Total word count: 1510

Huh? 0 words… are you sure?

story.dg: 61 B, 9 words,  ASCII text
(current player #player)
(#player is #in #room)
(room #room)

What about something very slightly longer? I’ll add the code from Chapter 2 of the library documentation:

story.dg: 289 B, 43 words,  ASCII text
(name #table)           wooden table
(descr #table)          It's a sturdy wooden table.
(supporter #table)
(#table is #in #room)

(name #chair)           chair
(descr #chair)          It's a plastic chair, painted white.
(on-seat #chair)
(#chair is #in #room)

(current player #player)
(#player is #in #room)
(room #room)

Compiles with 14 words this time.

Dialog compiler 1a/02
Info: Word count for "story.dg": 14
Info: Word count for "stdlib.dg": 1510
Info: Total word count: 1524

I’d love to know which 14 words, and why, but while I’m all right with C, I don’t understand this code well enough to throw together a debugging build to find out. Anyone else seen this? I had a check through here but I didn’t find anything on first look.
I’ve checked:

  • File permissions and ownership
  • What happens if the story is split into multiple source files (still only reads the last)
  • The Makefiles for the game and the compiler
  • That the compiler works (using the Cloak test and Zarf’s regtest on Miss Gosling)
  • Compiling dialogc with older GCC (13, 12)
  • Compiling in a Debian 11 VM (works)
  • If someone else on the forum has had this problem

It could be something wrong on my system, although currently I can’t think what. I could do IF dev in a VM, or on my Windows machine, but I’d really rather not. Any suggestions of what I could start looking at? I don’t mind touching the Dialog code with some pointers, although if there’s an easier fix, I’d love to know!

“Words” here means “words that will be printed”—that is, words appearing outside of predicates and comments.

2 Likes

Ah, thanks for clarifying that, I got ahead of myself. I misinterpreted the word count, ran a game with a room called Location and no visible objects automatically listed in the room description, and assumed something broke. Turns out (according to the manual I stopped reading) this is all expected behavior for Dialog, and is exactly what the code above should produce.

oops

1 Like