I am generating a map with small tile-like prefabs, and therefore, in some cases I place hundreds, and in some tens of thousands of GameObjects...
Assuming I compress all my prefabs into a single GameObject each(with something like ProBuilder), it would still be too much, is there a way to turn all my Realtime placed Prefabs into one single big GameObject?
#Condense multiple realtime placed prefabs into a single one
1 messages · Page 1 of 1 (latest)
After merging all the GameObjects in each prefab into a single object + removing the floor from each tile to place a big floor under the whole thing(only works in prototype because in a real map you'd prob have variations in the floor but we'll see), redueced batches by half
However if I can somehow merge all 200 tiles (and therefore gameobjects) on screen into a single one I imagine it'd save much more??
(and again 200 is a tiny example, usually there'd be much more)
This is a bigger map, Idk if I'd even make maps as big as that(tho I've made much bigger for the funny) but the stats aren't promising
(Last one was 20x10, this one is 60x30)
@tacit garden how are you measuring performance?
Oh- I'm not
I haven't checked performance or lag, I just noticed there's a crazy amount of batches
and I'm pretty sure it's best to decrease them
Well the larest map I tried to make was a 400x30
oh wait no that was without placing GameObjects
the laregest game object one was the funny one, 200x100
that's 20k Tiles, which (before merging), was approx 80k game objects in a scene
it doesn't sound ideal at all lol
I need to measure how much time was Unity starting the game and how much was the generation and how much was instantiation for a better idea I suppose
don't assume
I just opened the profiler
but there's so much going on I can't even find my script in there nor a search function
Imma go look at how they work lol
turn on deep profile
and use hierarchy mode or something like that
but I would continue working on features rather than optimizing
this would just be for your own interest
Fair I suppose, it's prob not even a me issue but like a RAM issue from me (ig it is a me issue) having lots of shit open, but pressing start took like a solid 30 seconds to load
now it takes way less(it was last night)
but it made me wake up with the desire to fix that lol
prob better moving on
tho good stuff to know
so for future reference, where do I turn that on?
it's a button kind of at the top
can you explain more?
this impacts dev
You'd press start, and it'd load the scene for like 30 seconds lol
way more than earlier that day or today
What changes were made
Well... now I reduced the game objects in each prefab to one each, but I imagine just my PC getting some rest llol
You mean there's a cost for generating the scene? And you suspect that this is due to the number of game objects?
maybe something I had on was memory leaking and caught a lot of RAM
I wasn't sure, and always good to reduce those I suppose
messing with the prefabs was easy enough to not mind doing anyways