Alter dialogue length based on screen size

An issue I’ve recently encountered with this dialogue system is that in different resolutions it can result in certain versions having a text box that can’t fit all the dialogue from that node. Has anyone found or thought of a way to have the system cut dialogue off and add it to the next node in these circumstances? The best way I can describe it is the text box only being able to fit 100 words in one resolution and 300 in another, what I’m looking for is a way to have this system recognise that and break up the 300 into multiple chunks that will display in order for 100-word max.

I’ve just read back over this and I’m clearly having difficulty describing it, so if more details are needed I’ll do what I can to clarify.

Sorry about the delay on this one. It slipped between the cracks…

So it sounds like you’re looking for a way to automagically split large dialogues when the screen size is too small for long dialogue… To be honest, that may well conflict with the way the dialogue handles existing nodes (let alone detecting when the text has overflowed the box!)

As a rule of thumb, I’ve found 300 word dialogue nodes have two problems: One is fitting into a node, the other is user interaction. 300 words is a little over 1/2 page typed, or a little over a page double spaced, with an average reading time of a little over a minute (at high school reading proficiency). You’re going to find that most readers skip at anything over 50 words (not exaggerating).

I think you’ll find yourself in a better position if you keep the word count lower (50-100 per node is probably just about right, though the system was literally designed with 15-30 words per node).

That being said, I will research what can be done. I can’t promise a solution today, too many other irons in the fire, but it’s now on my list.

Thanks Brian.

300 words was a little over the top, but I was just using it to give a solid scale to the question. With more sleep I can put it more accurately, I’m basically just looking to have the system divide one node into two if there is too much text to display on the screen. I noticed this becoming an issue when testing my game on another computer, it would display fine on the monitor and resolution that I work at, but on this other computer the text filled the box more and that’s when I’d hit issues.

I appreciate you looking into it as I hit a bit of a brick wall with how on earth I would implement it.

Cheers

While I haven’t had as much time to work on this as I’d like, the closest thing I can find will be a workaround on the bounds property in TextMeshPro

This is a bit complicated. You should be able to set the text, at which point the text.mesh.bounds will be calculated. Compare the y value of the bounds to the target height and split the text until the y of the bounds is less or equal to the y of the target. I would probably approach this by splitting the string into sentences, and then using a string builder to add sentences until the Y hits max or you run out of sentences. Then save the remainder of the strings for the next panel.

Privacy & Terms