What is the best way to structure a game with menu and levels plus a level select?


As the title asks, how best to create a program flow for a full game, and so on, coverting how best to set unity up for this.

I'd say it depends on the game.

I have just written a puzzle game- each level features a new arrangement of the same puzzle pieces on the board. So the assets for each level change very little. So I have only one scene, and it instantiates and destroys puzzle pieces from level to level.

In a game with distinct levels and a large variety of assets, like an adventure game or FPS, multiple scenes is often the way to go. Switching scenes unloads one set of assets and loads the new ones.

An interesting question is whether the menus (main menu, options, jump-to-level, etc.) should be a separate scene or not.

Generally the main menu is a separate scene so that it can load more quickly. This is more important on a mobile platform, and if the gameplay scene(s) take a while to load.

In my game I also made the child menus (options, credits, pick-a-level) each it's own scene as well. This was the simplest solution, as I was originally working with GUIText and GUITexture objects (Unity 1.x!). But you may want to let the player adjust game options like graphics and sound while the game is paused. So a better design would be a portable menu that can run in any scene, not require its own separate scene. UnityGUI makes that structure fairly easy, though it has its own drawbacks. Or you can use one of the third-party alternatives like EZGUI.

For the pick-a-level menu, you may want to display an image of each level as the player scrolls down the list. You'll have to decide if that's a static screenshot, or (like my puzzle game) if you actually want to build the level and show it. If you dynamically build each level, then the pick-a-level menu should probably be in the same scene as the gameplay itself.

If you are doing a browser-based game or have a very large game world, you might want to look at streaming asset bundles and/or LoadLevelAsync and LoadLevelAdditive. Those are a whole other topic, one that I don't have first-hand experience with. (Also, they require Unity Pro.)