Page 1 of 1

Dialogue System getting abnormal/laggy after long time play test

Posted: Wed Sep 07, 2022 1:00 pm
by golden1yaki
Hi!

I'm working on a text-based game and it's quite content heavy. And it has a message app-like design so basically player talks to NPCs like using a message app.

Recently some of my testers reported that after running a nonstop play test on mobile devices (both iOS & Android) for like an hour or so, it's getting laggy for response button menu to show while switching between conversations. Also some response nodes with conditions don't show up even the conditions match. They said that everything gets back in normal after reopening the game app. But the issues would come back after another long time play.

Some information may be useful:
1. I have a coroutine that checks the database frequently to see if there's any new dialogue to speak from each NPC.
2. In database, there're around 100 conversations. And there're some conversations have around 250-300 nodes.
3. I use lua codes with Lua.Run and Lua.IsTrue a lot in other game system to check quest states and variables.
4. I use [f] tag in every player's response.
5. Allow Simultaneous Conversation is checked.

Is there any way to reboot/refresh the dialogue system in runtime or any tips to optimize it?

Thanks!

Re: Dialogue System getting abnormal/laggy after long time play test

Posted: Wed Sep 07, 2022 2:08 pm
by Tony Li
Hi,
golden1yaki wrote: Wed Sep 07, 2022 1:00 pmIs there any way to reboot/refresh the dialogue system in runtime or any tips to optimize it?
We'll need to figure out what's going on first.

Are you accumulating messages in your message app UI? Maybe it's just accumulating too much, and you need to release older messages. For example, the SMS Dialogue UI prefab has an option to keep only the most recent n messages instead of accumulating an infinite number of messages in memory.

Or maybe your coroutine is getting laggy, or maybe you're accidentally kicking off multiple copies of the coroutine.

I recommend first checking if there are any errors or warnings in the Console window.

Then, if you're comfortable with some scripting, you may be able to write a script that simulates the player clicking through lots of responses, so you don't actually have to play yourself for an hour. If you can reproduce the issue in the Unity editor's play mode, it will be easier to track down. Once you can reproduce the issue, use the Profiler window to identify the cause of the lag.

Re: Dialogue System getting abnormal/laggy after long time play test

Posted: Wed Sep 07, 2022 9:11 pm
by golden1yaki
Hi Tony,

Thanks for your rapid reply.

Yes, I'm accumulating messages and maybe that the issue. I have a release-older-messages mechanism but maybe there's a bug in it. I will look it up.

And I will do a simulation. Never thought of this way to reproduce the issue. Thanks!

Again, thanks for your tips. They're very helpful!

Re: Dialogue System getting abnormal/laggy after long time play test

Posted: Wed Sep 07, 2022 9:38 pm
by Tony Li
Glad to help! Good luck identifying the issue. Remember to use the Profiler once you can reliably reproduce the issue. :-)