klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Link count inaccurate in Editor->Story->Details #1465

Open rafaelfajardo opened 11 months ago

rafaelfajardo commented 11 months ago

Describe the bug.

The link count report in the Details window of the Story menu in the Twine Story Editor returns inaccurate numbers. It appears to not count two-way links. It appears to undercount total links. I have encountered this in v2.7.1, both on the MacOS Desktop and the web-browser version. I have duplicated this undercounting in a classroom setting with a variety of Windows and MacOS laptops. The link count is a useful analytical tool of lexical complexity.

Steps to reproduce:

We have seen this in a variety of different stories. My test story was formed by creating a succession of passages with numerals for titles and linking them as I typed. For example passage "1" contains [[2]] [[3]]; passage "2" contains [[3]] [[4]]; and so on. I built a story with 16 passages and 32 links, two from each passage, one way. The link count returned 16 when there were 32 links.

Expected behavior:

The link count would optimally return the number of links accurately. I would welcome defining a link that is visually represented with a line with arrows on each end as two links, one in each direction. I would expect a link visually represented with a single arrowhead as one link.

Additional context on this problem.

The link count is a useful analytical tool of lexical complexity.

Twine version number

2.7.1

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

macOS

If this problem is occurring with the web version of Twine, what browser does it occur on?

Safari

Presubmission checklist

klembot commented 11 months ago

The algorithm is here. I think the inaccuracy you're seeing is that it counts unique links; e.g. if you create a passage with text [[1]] [[1]] [[1]], it reports 1 link, not 3, and if you have a second passage that contains [[1]], it still reports 1, not 2. In my testing today, it does count two-way links as 2 distinct links.

I think there's an argument that the link count should reflect how many link arrows there are in the map, but I'm not sure if you'd agree based on your description. e.g. how many links do you feel the example below has?

Screenshot 2023-11-12 at 2 37 23 PM

hituro commented 9 months ago

I can see arguments for that being either 2 or 4 links, but definitely not 1.

The argument against it being 4, is that it's not possible to distinguish the following two cases (using Sugarcube, but any story format presents the same issue)

* [[Go left|1]
* [[Go right|1]]
* [[Go up|1]]
<<if $metBoss>>
   [[Say hi to Greg|1]]
<</else>>
   [[Greet your new boss|1]]
<</if>>

The first example presents 3 links to the reader, which all happen to go to the same passage. The second example only ever presents 1 link to the reader. As a measure of complexity, these two are quite different.

Perhaps the count should show "all links" (which would be 4 here) and "unique links" (which would be 2)