I’m thinking about building a scene on the fly in a “Lego” kind of a way, from prefabs. Basically like flying through a city where every building is a random stack of several blocks.
I’m thinking big: like 1000 buildings with around 6 prefabs each. They’d be simple: 50 to 500 polys, average 200 polys. Maybe 50 to 100 prefabs in the “library” that gets drawn from, and multiple different textures being randomly selected too. And each prefab would be a mesh collider as well.
So is 6000 instances/colliders, with an assortment of textures just asking for trouble?
Three things that help:
-
The prefabs would never move once they’ve been placed.
-
They would NOT all be VISIBLE at once: I intend to arrange things so that your view is constrained to maybe 5-15 buildings at once. (In other words no long open streets to look down.) About a million polys total, BUT only 10 to 20,000 in view at once.
-
I’m not targeting low-end machines. (This is a playground for something I’d like to do “someday,” nothing I’ll finish soon.)
Along with the prefabs, my script for laying out the “city” and controlling enemies within it would need a large array. I’m thinking maybe a 10x10x10 array, and each element IN the array would be ANOTHER 10x10x10 array. (Can you nest arrays like that in Unity without manually declaring every one?)
That’s a million data points. Anything I should be warned of re arrays of that complexity? (I know there would be a delay as the data is fed INTO the array, but it would only happen once–the data would not change mid-game, it would just be there for the enemies to “look up” tactics in.)
Thanks in advance!