07th-mod / umineko-question

93 stars 9 forks source link

Text lines do not reflow/wrap correctly #75

Closed drojf closed 6 years ago

drojf commented 6 years ago

(Reported by Lucasilvz on discord)

In this patch the number of text lines displayed was increased from 25 lines to 31 lines. This can cause some issues with text wrapping.

I don't know if the original game had these issues as well. The developers could have gone through and fixed it as they went along, ensuring that no lines would overflow.

Therefore changing back to the original resolution may or may not fix it.

I'm just leaving this issue here for now so there is a record of it/other people can comment on it.

I have a feeling this was mentioned before but I can't remember

Example of cutoff line in patched game: honeyview_image

Original game honeyview_unknown

drojf commented 6 years ago

There is a function in Ponscripter which determines which characters are allowed to be 'split' to insert a new line: pbreakstr

pbreakstr ^ ,-.…^ (see here)

I'll try adding the above line to the script , but will leave this open because there may be other cases this doesn't fix.

Some more examples of the problem: example1 example2

edit: just realized that doing this may cause the 'full-stop' of a sentence to be put on the next line. What we could do is replace all the long fullstop sequences (like.......) with the unicode elipses character '…' like the japanese versions, and then use regular dots only when there is one dot - see https://www.compart.com/en/unicode/based/U+002E

drojf commented 6 years ago

It appears the engine only has problems with word wrap if the text line is split across multiple ^^ commands. For example:

langen:^1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 continuiiiity....^\

will render OK but

langen:^1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 continu^^iiiity....^\

will split the word continuity... as soon as it reaches the end of line limit. I'm guessing there's some internal state that gets reset when you enter or exit the ^


Update 2

I think most of the issues in the script can be fixed by detecting the following:

langen:delay 1200^......despite all of that, ^/ langen:delay 1800^....ia onee-chan...^/ langen:delay 1200^...summoned a world of happiness.^@

This allows the engine to treat the lines as 'separate' and linebreak them.

I haven't actually done this yet but I suspect this will handle the majority of cases.

For example examples:

...^\n^... -> ...^ ^ ... (alternatively, the dots could be redistributed so it looks better: ......^ ^)

drojf commented 6 years ago

Probably fixed in https://github.com/07th-mod/umineko-answer/blob/fix_word_wrap/0.utf , but to be tested and applied to the question arcs.