snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.63k stars 291 forks source link

Limit Characters Shown In NarrativeLog to Avoid 65000 Vertices Limit #989

Closed breadnone closed 3 years ago

breadnone commented 3 years ago

Description

Fixes 65000 vertices limit by limiting character shown in NarrativeLog

What is the current behavior?

It will throw ArgumentException: Mesh can not have more than 65000 vertices if NarrativeLog texts over 65000 vertices

What is the new behavior?

The text will get truncated to default 10000 characters (users can change the characters limit) and a tripple-dots prefix will be added as indicator that it was truncated

BEFORE

https://user-images.githubusercontent.com/64100867/121877827-3faa0580-cd35-11eb-8fba-3f2e83578e8c.mp4

AFTER

https://user-images.githubusercontent.com/64100867/121878023-708a3a80-cd35-11eb-9a30-881bf98f9f23.mp4

Other information

Edit: Description edit

Relates to https://github.com/snozbot/fungus/issues/945

breadnone commented 3 years ago

Stumbled upon this issue https://github.com/snozbot/fungus/issues/945 when debugging my game. I'm not sure if this is the correct implementation @stevehalliwell

Feel free to close it if it's not desired. Thanks!

breadnone commented 3 years ago

Another solution as describe here https://docs.unity3d.com/ScriptReference/Mesh-indexFormat.html

stevehalliwell commented 3 years ago

Haven't double checked but I don't think we can change the internal mesh format used by the text elements.

Using the alternate entry based Narative Log, submitted by CG-Tespy, that was added a while back would also avoid the issue.

stevehalliwell commented 3 years ago

I think this is a good quick fix . Proper pagenation being a better long term goal.

I'm going to manually merge and make some changes though so the implementation is entirely within the narrativelog view code though.