Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So in this video, we're going to once again use the profiler and we're going to take a look at our
scripts.
So if you click on CPU usage and we're now just going to press play.
I'm going to leave this going for a while until we get enough characters on the screen that we can analyze.
OK, might even do a little bit shooting in order to kill off some of these characters.
We also get some kind of change in of positions and that kind of thing.
And then suddenly I'm going to click let's click about here where we've got this tiny little spike once
again, does the 1000 frames per second line.
It's definitely nothing to worry about.
But then if you click all those, you can see it change.
And that's where we get our 60 frames per second.
As I say, this this part, the others, is mostly influenced by the editor.
OK, so where we have this timeline drop down the change to hierarchy.
OK, the hierarchy shows you all the different loops going on, all the different processes.
And some of these like from the camera.
Some of them are internal functions and all the way down here.
Ed Loop is basically what's going on inside of our editor at the moment that's taking up 10 percent
CPU time, flush and collect edit stats.
OK, that's taking up this much.
Our main player loop, which is what's going on inside the game, is taking up 80 percent of the process
of time.
Time update.
Wait for last presentation.
Basically, that 60 frames per second cap that we put in there is currently taking up seventy to seventy
six point two percent of our processing time.
All right.
Because we're simply waiting for frames per second.
So if I switch that off, go back in once again in the script, in the main script, switch off the
application target frame, right click save.
Let's just wait for that to finish and then we'll compare the difference.
OK, once again, just let it get going a little bit.
Just do a bit of interaction here and then click say about here.
OK, let's take a look.
So now Play a Loop is taking up just eighteen point five percent, and Ed Loop is now taking up seventy
eight point two percent.
That's that's jumped up to the top.
Update Scriptorium.
Behavior update.
Behavior update.
There's not even a cap now.
It's not even telling me that.
It's waiting for a frame update.
Willis is here taking up 0% percent, OK, because there simply isn't one.
All right.
So that's that's the other issue.
All right.
So we know exactly what's causing that now.
And so a good idea if you find like an issue is taking a huge amount of processing time and it's near
to the top of the stack.
You need to find out what's causing it and understand whether that is necessary for the game, which
in this case, it is so that you can run the optimal speed on the mobile device.
OK.
So once again, we're just going to press play and take a look at what else is causing any kind of issues.
OK, maybe get one of these some particles.
There we go.
All right, so just click on here.
So our time wait for update.
Don't worry about that.
Player loops come back up to the top now and it's only taking 555 point nine percent now.
So notice you will get very different results.
And each time you play, depending on how long you been playing, the longer you play, the more the
play loop is going to take up processing time.
This is the reason why if you've been playing the game for a while on the mobile, you'll notice it
starts to kind of slow down a bit.
And that's because the whole thing is eating up, but it's also using more elements.
And the longer you place the play, a loop is getting bigger and bigger in terms of processing time.
A camera render is then the next one that's obviously rendering all of the items drawing COLLING date
in any lights, even though there aren't any.
So zero.
And if you have any post-processing that would show up there and the camera image effects, but there's
no post-processing.
Then we get our update script Wrong Behavior, which is currently taking up just one point four percent
of the processing time.
So that's really, really small.
She's great.
It's only in terms of millisecond zero point three, two milliseconds.
So our behavior update is made up of our event systems, and then we move script, which is attached
to all of our enemies.
Our main update, which is attached to the ground, and then this frames per second count.
OK.
And any updates, as you can see, is running on 12 enemies.
It's being called 12 times.
Let's take a look at these.
Notice, in terms of times in milliseconds, it's only taken up zero point zero two milliseconds.
It's extremely small.
All right.
So that's really good.
Definitely no problems there.
And yeah, everything is looking good there.
OK.
This first one, this event system update.
Let's take a look at this, because this is taking zero point to seven milliseconds.
So let's try and find out exactly where that's coming from, from the standalone input module and.
It's mostly on this one, this first one standalone import module, so it's basically the mouse states,
the imports.
It's it's this effectively it's the joystick control and the shooting and the buttons.
That's what's taking up the majority of the time.
But it's such a minuscule amount.
It's definitely nothing to worry about.
It's just simply one point two percent of the processing time and frames per second counter update.
For some reason, switch that off.
Let me take a look on the canvas.
No, we've got it going.
Interesting, but it's not using anything.
OK, I'll come back to that shortly.
It does have one caller with us.
Zero.
And main update.
Let's take a look.
It's being called twice.
This is what's moving our parent object and our main camera.
And so it's twice and.
Yeah, extremely small.
I mean, in terms of milliseconds, we're looking at zero.
It's that fast is running really, really good.
OK, our fixed update physics is basically going to be moving.
Our zombie characters using A.I. and everything else is less than zero percent.
OK, so in terms of optimization, that is extremely optimized.
The Ed Loop is obviously only going to be running while you're in unity, Ed..
Forty three percent of processor time will completely disappear when you're on mobile.
OK.
Excellent.
Now, there should be some kind of garbage collection.
And on the canvas, when we got our frames per second counter running, the frames per second count
should be creating some garbage collection.
And I actually want to see that running.
And so what I'm going to do, going to leave this plane for a while and see if it shows up on the garbage
collection.
Got this big spike here.
This is the this is the start when the game started again.
Really?
Test everything, basically.
Oh, I've got zombie on the floor is not getting destroyed, that was weird.
Well, he's seen reload.
Let's wait for that level of achieved.
We go reloaded again.
We look at our small local.
And few things showing up on the screen here.
OK, good.
We've got a pretty big spike here with ice falling below 30 frames per second.
And now let's take a look at our.
Oh, OK.
Say no garbage collection.
Normally the frames per second count does create a lot of garbage in garbage is effectively where it's
creating new variables that are getting stored temporarily that need to be cleared out of memory.
OK, and where we've put something like, wait four seconds and we've initialize them here at the beginning
and start is much more effective than trying to create them.
And down here whereby we say yield return equals.
And then we create a new wait for seconds that will create garbage in, garbage in to.
But until it gets cleared.
When garbage gets cleared, that can cause a big spike in performance that can limit your frames per
second.
And but, yeah, overall, it's been playing for a while, it's even loaded to scene a couple of times
and our update Scriptorium behavior is only taken up zero point five percent of processing time play
a loop is only at twenty seven point one percent.
So I think everything is really, really good.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.