Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Apr 12, 2018 22:28:35 GMT
Hello,
I'm having my game in basically two scenes: main menu and the game itself. Early on in development i noticed that "filling" the pool naturally takes a lot of time, so the compilation times were getting longer and longer. And, of course, that transferred on to the game itself, when i press start i need to wait for more than 30 seconds for the game to start.
I suppose i could put the LevelWaveSettings in the main menu and check "persist between scenes", but that will only slow down the loading of the main menu probably?
I could make the pool a bit smaller by adding some of the items on runtime as the game progresses, since not all of the enemies are set to appear at the beginning of the game, but that could help maybe 20%.
I'd appreciate any ideas to help me make this a bit quicker.
|
|
|
Post by DarkTonic Dev on Apr 12, 2018 23:11:07 GMT
Did you try changing the field in Pool Boss so you can spread out that loading into more than 1 frame? It's called "Initialize Time (Frames)".
Anyway, if that doesn't help much, you'll need to wait for the item in the roadmap that is to create temporary Pool Boss collections which get unloaded and loaded when they become active and inactive. Or you'll need to split into more Scenes, which you could do right now.
Correct that persisting between scenes will make main menu take longer to appear. We always show game "tips" during loading so at least the user has something to read if they have to wait.
This must only happen on mobile devices right? Not inside Unity.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Apr 13, 2018 11:29:38 GMT
In Unity, on Windows. Compile time is around 30 seconds. I have 313 pool items, with some average of about 10 objects per item.
Edit: Ok, an hour later and after cutting some fat and it's a lot better (it's around 17 seconds, 10 seconds with LevelWaveSettings disabled), i probably don't have more than 1000 objects in the pool, but i expect it to be at least 1500 at the end of the project.
Temporary Pool Boss collections sound like a great idea, i was just going to propose something like that, adding individual items to the pool on runtime sound tedious. I could put them into array though and load 'em up between levels.
If i spread it out on 100 frames, what do i get, will it load the scene faster but stutter a bit in the forst moments of the scene until all is loaded or..? I don't know how it works.
Btw, i'm amazed how some games of a similar type start almost instantaneously, i wonder what's the trick.
|
|
|
Post by DarkTonic Dev on Apr 13, 2018 15:49:31 GMT
Maybe it will stutter, but it won't completely lock up. Give it a try and let me know.
Pooling plugin is a lazy way of avoiding Instantiation perhaps. Maybe other games have everything in the Scene already and don't need to clone up 1000's of things when the Scene starts. You could write code to activate big groups of prefabs that are in the Scene. Seems like it would get complicated though. I think the best approach is to have smaller Scenes so you don't need 1000's of things pooled.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Apr 20, 2018 9:36:56 GMT
Thanks, i'll try it out.
For now it's manageable to work with, but basically it's a design flaw since i'm a rookie and i'm overusing prefabs. I shouldn't use so many prefabs in the first place, but alter the components on runtime, or dynamically add items to pool in places where i can hide the hickups with transition.
|
|
|
Post by DarkTonic Dev on Apr 20, 2018 15:50:06 GMT
Ok.
|
|