I’ve made some editor tools to help with development of my multiplayer RPG [Kingdom Of Galanor]( The Kingdom of Galanor, Playtest Available page-2#post-6944129), and I was wondering if there might be any interest in me releasing them as standalone assets on the Asset Store.
The tools perform a number of functions that help with scene creation, management and performance.
One of the main issues I initially encountered was the lack of a runtime persistent identifier for scene assets, which made creating editors for things that needed references to scenes difficult, due to the fact that simply renaming a scene or changing its folder or build order will break things.
Another big problem was that large scenes containing lots of game objects with components can cause the game to hang for quite a few seconds during scene changes, because all of the Awake and Start methods are invoked when the scene is loaded and the contained game objects are instantiated. LoadSceneAsync doesn’t help with this as the hang occurs after the scene is fully loaded. Even relatively smaller maps in my game caused hangs of 5-10 seconds and larger maps were upwards of 20 seconds.
Not a problem if the scene is only loaded once at program start, but not acceptable for a game that has many scene changes as you move between different areas and in and out of buildings.
To address the second problem I developed a prefab ‘scattering’ system, which at a basic level, works by having each map consist of two scenes, the main part, which contains very little and a ‘geometry’ part which contains all of the detail, but isn’t actually included in the build or loaded at runtime.
Instead, the editor tool records all the required information of the objects in the geometry scene, and at runtime, when the main scene is loaded, it instantiates only the geometry that is within the view of the camera, thereby making scene changes to all intents and purposes, instant.
Furthermore, as the camera moves, the scatter system will show and hide the geometry accordingly, further improving performance.
I’ve also added functions to allow prefab ‘painting’ into the scene and mass placement of prefabs at the click of a button, with numerous options for how they are placed and may be excluded from certain areas.
Alongside this I have developed a scene management system, which organises the main/geometry scenes required for the scatter system to work, and also address the first issue, giving you a simple way to save a persistent identifier to a scene in the editor and be able to use that identifier at runtime to easily get whatever information you might need about the scene, even if you rename, move or reorder the scene.
As well as almost instant scene changes and robust scene reference management, these tools have resulted in framerate gains of upwards of 50%-60% for large scenes with lots of assets.
I’m working on some videos showcasing the tools in action and the difference between using them and not, which I’ll post as soon as I can. In the meantime here are some screenshots.
I’d be interested to hear if you think this is something you’d like to see on the Asset Store.