#Performance issues
1 messages · Page 1 of 1 (latest)
Yeah thanks
Can you show your general physics settings?
The project settings?
yes
Oh and the settings under "Time"
Any reason you changed the max allowed timestep?
I was trying to see if that would improve but it didn't do anything
Should I change it back?
unless you want to achieve something specific i would stay on default settings
Okay
Thank you
are you triggering the FixedUpdate manually somewhere?
No, its just running the movement trough fixed update
cause this is how its supposed to look, 1 update on fixed step per frame maximum
and then one run per active entity (enemy or player)
is this just a small prototype project or something bigger?
Well its gonna be an actual game, so bigger and its really scaling up
Bot the player and enmies just have their movement in fixedupdate including collider checking things like seperation
can you send the players code for that?
One sec il upload to pastebin
also does every frame show these 1000 calls to fixed update or was it just the one you picked?
Well I just clicked on the spike which happened when enemies spawned, but it showed that many times before too while I was debuging myself
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
so a regular frame doesnt do that?
also you shouldnt lag that heavy if you are just spawning 16 enemies
I actually havent checked
Yeah I don't even spawn its pooled, only happens after they start moving
But my fps drops by 20 even when I start moving
are you using some kind of pathfinding?
No just following the player
Heres the enemy movement as well, its big tho
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
oh you are manually doing local avoidance?
Yes
can you disable that as a test and see how your performance is?
just comment it out and see if your performance improves
we can look deeper afterwards
Very slight improvement the first 6 enemies drop it to 20, and when other spawn it goes to 2
Didn't do much
Mhh at this point two things for you to try:
- Find out why you have 1000 iterations on the physics step
- Simplify the enemy further and further to see if anything triggers a big improvement
We could cut out the animation from the code and see if that improves it
The enemy bodyTilt
i would just do a very simple follow script and see if its different, if it is you atleast know the problem is in the enemy movement code
Okay il try that
Without the animating stuff, i had 20 more
I guess that affects it too but its still dies after many more spawn so
if there is something you cant find via profiling you always reduce the code until you find whats going on, you can always reset via git (I hope you can!)
Yes I can using github so all good
Ok using the simple movment fixes it for like first 2 waves but as more and more appear it drops back to 2, so after around 15/20 enemies its back to 2
do inactive (pooled) enemies maybe keep trying to do this aswell?
Like moving? I dont see their position change while inactive (pooled)
Mhh
Yeah then last is to check if a normal frame also calls the FixedUpdate 1000 times per frame, then that might be the culprit
heres with the first wave spike and normal
deep profile
also i just realised i forgot to turn on the simple movement il see if it improves stuff now
@spiral gorge So I got some big news, it only drops fps when i load from main menu if i play the scene it directly it stays around 100 fps
so you can load the gameplay scene directly?
Yes and then it does not drop
But if i load from the main menu scene it drops after they spawn
oh good point, now to find out whats causing that 😄 maybe you load more and more gameplay scenes
hmm how can i check that?
you should see that in hierarchy
the problem is too specific to just tell you what might be the solution, you will have to experiment and find out, I have no clue what it could be
right, i dont see anything unusal in the hierachy
private static IEnumerator LoadSceneAsyncRoutine(string sceneName)
{
var op = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Single);
op.allowSceneActivation = true;
while (!op.isDone)
yield return null;
}
This is how I load it
I think i got the issue
something is changing the Time.fixedDeltaTime value
when loading from the menu scene
still dont know what
@spiral gorge I have fixed it
What was it in the end?
Something is changing it but idk what still, i just forced the value to be the default every frame, i suspect its my slowmo script but idk how to find the bug in it that makes it change the value when the new scene loads
can you disable your slowmo script and the thing where you set the value each frame and then check if it still changes?
Yep no lags
then show me your slowmo script
it still has the fix in it applied but the only things i changed is i made it stop spawning you can see i commented out and added the test.SlowmoActive
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i dont think that script should edit Time.fixedDeltaTime at all
only timeScale
I should avoid doing it?
Yeah