Topic: Long black pause prior to match - loading issue?

I have been trying to fix this issue for a couple days now with no success.
The issue is, when the screen goes black before a match, sometimes (rarely) it stays black for several seconds.
The issue becomes much worse on iOS devices, sometimes lasting as long as 30 seconds.
Is this an issue with asset loading?  Am i expected to dive into the source code and write resource loading myself?
The issue does seem to be getting worse as we are adding more complex assets to the project.

I noticed most of the delay comes during initialization of the controlsScript component.  I first attempted to throw up a loading screen at the beginning of the UFE.StartGame() function, then remove it in UFE.FireGameBegins() function (called at the end of ControlScript.Start()), but it seems whenever i change anything in UFE.StartGame(), very strange things happen.  Sometimes I get a null reference exception in ControlSript.Update() and, even once removing adding checks to fix the errors, the game camera is now in the wrong place!  I am very confused as to why this is happening.  Any help is appreciated!

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

This is a fairly hard one to answer without seeing the project for myself.  But let's try and see what we can find smile.

  • Is this delay only on your custom project and not on vanilla UFE?

  • Is the delay also present when using Start Game Immediately option in Global Config? If no, then this would mean it's not the characters/stage that's causing the issue, could be one of the select screens.

  • Have you made any modifications to default scripts?  I see you've done something to ControlsScript, which is probably the most likely offender here as you've noticed.  Any other changes to it?

  • Do your characters have large move sets?  This is probably the only thing I can think of, outside of modding, that could cause such a delay.

  • Have you done any isolation tests?  i.e.: load with your stage, but use default UFE characters; load with default UFE stage and your characters; both with/without start immediately option…

Essentially, I'm trying to figure out what could be causing the delay.  I'm hoping it's not something specific to your machine (running out to hdd wink), since I've never noticed any lag issues on my projects.

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

1- Both myself and my boss have noticed this issue since we first started using UFE, before any changes were made.
however, the issue has gotten worse as we have continued to add assets.

2- I have been very careful to make no changes to controlsScript.  The only exception is I throw some information to an AI blackboard I created (such as player health) at the top of the update function.  (My AI works as a separate controller because I knew changing controlsScript would be bad news)

3- My boss has added a LOT of animations to the project.  This is my best guess as to what's causing it to worsen.  But still, It wouldn't be a problem if I could just get a loading screen to work correctly before each match.

4- It is very hard to preform such tests because this issue happens rarely.  I've been trying to find consistencies... unsuccessfully.  Is there a way I can do a clean build in unity?  If I could at least get this issue to occur consistently I would have an easier time figuring out what causes it...

Why does UFE not have some sort of loading screen?  It seems like only a matter of time before some project on some device will need one.  What is bothering me the most is this: why is the camera messing up??  It makes no sense to me, I only change the one line of code in UFE.StartGame (instead of the fade i just call _startGame() immediately) and the camera gets messed up.
If I could solve that camera issue then my loading screen hack would work fine.

I understand that this type of issue is a hard one to diagnose without seeing my project, which is why I held off coming to the forums for as long as possible.  So I really appreciate the help.  Also its worth noting that once the match begins I never have any lag issues, so this really seems to be an initial loading problem

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

Since it does look like it stuffs the camera, I would revert your UFE.StartGame back to default, and wherever it's called send a fadeTime of 0.  You'll get the same effect and shouldn't have any issues.

As for the other stuff, it's strange both you and your boss have had these delay issues since the start.  I would say your UFE is messed up at a guess, since that's not how it's supposed to behave.

Lets test a new clean vanilla build.  Start a new Unity project, go to Asset Store and re-download UFE and import the package.  If you still get the delays with this vanilla version, then the problem must be your computer.

What is the specs of your machine, btw?  And what version of Unity are you running?

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

Changing the fade time to 0 does work, but I cannot understand how this code can be so... fragile.
Runnning Unity 4.5.2.  The issue is most noticeable on the 4s device, not on my development machine.
I will try downloading a vanilla version tomorrow and let you know how it goes, I am burnt out for today.


How is UFE loading assets? I cannot figure it out.   If no effort is put into loading assets properly, this issue seems inevitable.
I need some sort of loading screen.  Perhaps this is in the newest update of UFE - I don't have that either (the one with AI)

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

Oh, you're building to mobile.  That makes a big difference.

Let me try building to iOS.  It's been on my to do list for a few days now, so it's about time I tackled it wink.  I'm in +11 GMT, so hopefully you'll see something by the time you get up (I'm assuming you're in a US timezone).

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

although changing the fade time to 0 did fix the immediate issue, my load screen hack is not working out sad
It seems like I am going to have to dive in and create a real loading screen...

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

I've done a few tests with vanilla UFE on iOS (iPhone 4, running iOS5.1.1).

The very first time it built to the device, the load time was 20 seconds or so.  But every other time since, it's been between 3-7 seconds.  I thought I saw an improvement when I turned stripping level to full, but my results aren't consistent (I can get 3 second load times without any stripping).

Now, keep in mind my testing is with default project and no touch screen controls.  So I can't actually play the game once it's loaded, just tap on character select and menu options.

If your results are similar to this (for your game, not a vanilla build), then I would say this is just how UFE performs on mobiles for now. 

The long load time on first build is something I've seen in my non-UFE mobile projects too.  It usually only happens early on in development (and only just on the first install of a clean build), before I had any real optimisation to the scenes (just a loading scene, which is highly recommended for all mobile titles).

Another thing you'll want to look into, if you're not already doing it, is draw call reduction.  This will definitely help keep fps smooth during gameplay, but I'm not sure how much it will help your black screen load problem (I suspect maybe just a little).  The base game with Mike and Kyle fighting is about 220 draw calls.

To test this, I also added a mobile friendly character (copied Kyle's character file), and changed the stage's shader to be mobile friendly.  I saw a dramatic improvement in draw calls just from that alone, but it was still around 30 average.  The biggest contributor to draw calls (aside from having many texture's per character) is OnGUI().  In the editor, just disabling all UI items you will see nearly all other draw calls drop suddenly.  But of course, you'll have no life bars or text notifications.  So you'll need to come up with your own solution (or use convert them to NGUI).

Share

Thumbs up +1 Thumbs down

Re: Long black pause prior to match - loading issue?

Our models are optimized for mobile and the game runs smoothly at 60 fps,
the lack of loading screen is the only issue.

Other than this, so far UFE has worked out great... but I must say disappointed with UFE in this respect. 

You cannot say that your engine is ready for mobile when something so important as intelligent asset loading has been overlooked.  I hope the creator takes this criticism to heart.

In the mean time I will just have to write a loading screen myself.  It is a good thing I have the source code... or I would be out of luck.  Anyone who plans to purchase UFE for a mobile title, keep this in mind!

Thanks again (YumChaGames), It's always nice to know the game development community is so willing to aid fellow developers, I really appreciate it!

Share

Thumbs up Thumbs down

Re: Long black pause prior to match - loading issue?

Yeah, I thought you might have already considered mobile friendly assets.  I was posting more to cover all bases and help others that might be having issues. wink

There's a story mode with a new loading screen, that's scheduled for released once Unity 4.6 is released.  So it might be worth holding out for that if your project isn't due anytime soon (we're all waiting on the Unity 4.6 GUI update, basically).

Share

Thumbs up Thumbs down