Managing huge amount of text in Rich Text Label

Godot Version

4.4

Question

Nowaday, we could store a massive amount of text without any issue, but this massive amount is still finite depending on the system.

I would like to use a Rich Text Label to store in-game announcement or any kind of text. The user will see last several lines of text, but can scroll this Rich Text Label to see its history.

I can keep on appending strings ending with newline to this Rich Text Label, however my concern is:

  1. Is there a limit?

  2. If the game has been played for many many hours, this Rich Text Label could get very long so perhaps keeping things under limit would be a good idea. While I could split the string using the newline as a delimiter, this still means reconstructing the whole long string which could impact the framerate if it is really long. What would be a preferable way to manage this?

A ScollContainer as the rich text parent would allow for scrolling. The limit is as system memory permits, a very high number of characters, though rendering all of this text will become more and more expensive even if clipped by the scroll container. You can use substr to reduce the number of characters quickly.

All in all just give it a try, see if your needs are met then come back if any issue arises.