- Home /
structuring large games / scenes / prefabs
like many, we have a game with lots of levels and various menu screens. we are targeting mainly mobile, so load times and stutters are more obvious.
we also have 15 person dev team in different locations.
I'm interested in what experience people have with how to split the game into chunks, balancing performance needs with a smooth modular workflow.
options seems to be:
1) separate Unity scenes for each logical game screen
good: this allows creation and reuse of prefabs easy for different devs to tackle different sections
bad: memory management across scenes - things like dynamic atlases become harder to use stutters on loading other scenes (maybe can be covered with loadAsync?)
2) one huge scene for the whole game, prefabs for each scene
using prefabs and "clones" of the main scene, allows individual devs to work on each prefab and commit separately, even though they are technically working on the same "scene" at the same time. this approach simplifies memory management, and avoids any stuttering as scenes load. we are also using dynamic atlases to load content in and out as needed
we went with this approach, but have hit quite a few problems. for example the unity editor doesnt support "nested prefabs" so this means its hard to create reusable components. the one level of "prefab" is being used to separate scenes so different devs can work on the same scene but not git conflict.
another issue is properties on prefabs that need to link to their parent, cannot be applied in anything other than the master copy of the whole scene.
3) code based buildup
where you create various prefabs and then have code that pulls together each screen. this allows reusable prefabs, but you are not using wysiwg to build your screens - things have to be placed by code. you also lose the ability to "wireup" to variables in unityIDE. a lot harder to work with.
are there any other approaches to modular way to develop a high-performance but large game?
thanks!
Answer by TonyLi · May 23, 2013 at 03:04 PM
The guys at Schell Games gave an excellent presentation on this very topic. It's well worth watching:
http://video.unity3d.com/video/3708530/unite-11-scaleable-game
As a bonus, they also covered a good way of handling multiple resolutions for varying mobile platforms.
Also, this article has some good tips on prefabs, as well as team work:
http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/
My biggest recommendation is setting up a version control system and establishing rules to ensure consistency.
Your answer
Follow this Question
Related Questions
Add gameobject dynamically to scene in Unity3d 1 Answer
Texture render performance - one 1024px, vs two 512px - for modular models? 1 Answer
How to keep my Prefab from Restiing 0 Answers
Rendering a level in a gallery style view? 0 Answers
RenderSettings not overwritten when using LoadLevelAdditive 0 Answers