Slight Lag on Startup

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Slight Lag on Startup

Post by Rocco »

So our game is just about complete! We are going through some final optimization steps and we realized that there is a slight lag at the very begin when a scene is first loaded for the first time. Currently the beginning of the game is our character appears and speaks a couple of lines of dialogue. However there is a slight lag at the beginning, presumably the entire DSDB loading up. Is it possible to access this loading process or know when it is complete and THEN begin the game?

I will keep digging in the mean time! Thanks ahead of time.
User avatar
Tony Li
Posts: 21053
Joined: Thu Jul 18, 2013 1:27 pm

Re: Slight Lag on Startup

Post by Tony Li »

Hi Rocco,

Congrats on getting close to completion! As you wrote, the lag is either due to loading the database or loading the dialogue UI. You can preload both with these commands (or their PlayMaker/plyGame/etc. equivalents if you use visual scripting):
Often the dialogue UI is what takes the longest, since a single large texture can sometimes be bigger than your whole dialogue database.

These are both blocking operations, meaning they don't run asynchronously, so Unity pauses while they run. (It's a limitation of Unity's ScriptableObject system.)

You may want to throw up a loading screen to distract the player just before you call these methods.

By preloading them, you can control when the lag occurs instead of hitting the lag the first time a conversation starts.
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Slight Lag on Startup

Post by Rocco »

Thanks a lot for all the help Tony with Dialogue System! The project has nearly come to a close with our web release on YTV.com. You can check out the web version of the game at the following link!

http://www.ytv.com/game/the-stanley-adventure

Note: It currently only works in every browser but Chrome due to WebPlayer plugin problem with Unity and Chrome. We also have received some reports of things not working in Firefox on Windows Based Systems. Hope you enjoy it! Keep in mind the age group range is most likely younger then yourself. ;)
User avatar
Tony Li
Posts: 21053
Joined: Thu Jul 18, 2013 1:27 pm

Re: Slight Lag on Startup

Post by Tony Li »

The Stanley Adventure looks great!

May I add some screenshots to the Dialogue System's Games Showcase page?

I didn't play too far into it, but it seems to work fine in Firefox and IE 11 on Windows 7 x64 over here.
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Slight Lag on Startup

Post by Rocco »

Hey Tony. I will need to clear permission for that request through management. I will make sure to get back to you shortly!
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Slight Lag on Startup

Post by Rocco »

Hey Tony,

So I just cleared permission. You are indeed allowed to post some screenshots of the game on your gallery. Once again, thanks a lot for all the help you having provided throughout the development of the project! All the best in your future endeavors with Dialogue System!
User avatar
Tony Li
Posts: 21053
Joined: Thu Jul 18, 2013 1:27 pm

Re: Slight Lag on Startup

Post by Tony Li »

Thanks! And all the best for The Stanley Adventure!
Post Reply