Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lag spike the first time I start a timeline with a portrait. #2354

Open
phantomdesvin opened this issue Jul 30, 2024 · 2 comments
Open

Lag spike the first time I start a timeline with a portrait. #2354

phantomdesvin opened this issue Jul 30, 2024 · 2 comments
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good

Comments

@phantomdesvin
Copy link

phantomdesvin commented Jul 30, 2024

I'm having this problem using everything default, with both the premade speaker style and the VN style. Latest dialogic with latest commit. Godot 4.3.

I had this exact same problem a year ago, with the dialogic of that time and Godot 4.0. And I worked arround it starting an empty text timeline on_ready and keeping the layout nodes loaded. This time that was not working so I digged deeper and found some information that may be useful to someone to fix this longstanding issue.

This is what I've tried: I have the "on timeline end: hide layout node" setting activated, and I have tried both starting an empty timeline and starting an empty text. I see the dialogic layout nodes stay on the scene after the empty timeline or timeline with an empty text is started on_ready, but it still produces a lag spike the first time I start a timeline with a portrait.

I see the problem is specifically produced by the portrait, not by the text, not by the character and not by the specific image, because:

  1. If no character joins in the timeline, there is no lag spike.
  2. If a character joins but the character doesn't have any portrait created, there is no lag spike.
  3. If a character joins and the character have a portrait created, but the portrait doesn't have any image, the lag spike is still produced so the problem is not the stylebox, not the character, it's specifically the portrait even regardless of the image.

Knowing this, I have tried replacing the empty timeline I start on_ready for a timeline with an empty text with a character (using the speaker style). But that didn't work, the lag spike is still produced. I think the empty text makes the timeline not start.

@Jowan-Spooner Jowan-Spooner added Bug 🐞 Something isn't working Needs testing More feedback/testing would be good labels Jul 30, 2024
@CakeVR
Copy link
Collaborator

CakeVR commented Aug 1, 2024

I always recommend to read the FAQ on our Docs, they provide some common suggestions on the lag spike issue.
Please provide information about the texture/image size your portrait is using.

@phantomdesvin
Copy link
Author

phantomdesvin commented Aug 5, 2024

I already tried the empty timeline and the empty text workarrounds but they didn't work, even if I could see the stylebox and everything correctly pre loaded in the remote scene.
The only thing in the FAQ I didn't know was about the prepare() method, however I just tried it and didn't make a difference.

The image is not relevant, like I said I made multiple test and discovered this still happens with a new empty character that has one empty portrait with no images. It only needs to have a portrait created to produce the lag spike the first time it is shown, but that portrait doesn't even need to have any image.

My workarround is, instead of starting an empty timeline or with an empty text, I start a timeline with the join character event and choose the leftmost position, which screen position I modified in the portraits layer to be out of the view. This way the next time I start a timeline there is no lag.

I'm not an experienced programmer but I think the info I provided shows there is something wrong with the portrait system that could be fixed. The problem is not loading the style, is not the image, the lag spike is produced loading any new empty portrait for the first time in the scene.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good
Projects
None yet
Development

No branches or pull requests

3 participants