Quantcast
Channel: Questions in topic: "loadleveladditive"
Viewing all 102 articles
Browse latest View live

How to use Occlusion Culling with LoadLevelAdditive

$
0
0
In my large world, I have a bunch of scenes that I load in real time (LoadLevelAdditiveAsync) when I get close enough. Now, I know that [you can not stream occlusion culling][1]... What I want to do however is put all the scenes together and bake Occlusion Culling data for all of them once. Then, use the scene with the OC data as the 'mother' scene (i.e. always loaded) and Load/Unload the rest as the game progresses. Will this trick keep OC working together with LoadLevelAdditiveAsync ? [1]: http://answers.unity3d.com/questions/133081/occlusion-culling-in-a-web-player.html

How to load a DDOL scene additively on startup ?

$
0
0
Hello, I'm working on a rather large multi-scenes project. There are quite a few objects that we want to exist as singletons throughout the entire project. To do that, we explored two solutions, but both have disadvantages and we're stuck trying to come up with a decent solution to this issue. Here's what we tried so far : 1. Have an "Init" scene with all our DontDestroyOnLoad (DDOL) stuff. The project always starts with this scene, and it was made so the scene can never be loaded again. When it's done instantiating everything, it loads another scene. It works just fine, our global objects are present in every other scene, but it's not very handy : whenever you're working on another scene, you always have to go back to the Init scene to hit play and test your stuff. Also, we also have to change the 1st scene loaded after Initialization all the time so it loads right after Init, instead of just playing the scene we're currently working on. 2. Since we were unhappy about that, we decided to remove the "Init" scene and have an "InitGuard" object in every scene, with top priority in the Script Excecution Order. The InitGuard just checks if the global objets are here, and if not, creates them. It allows us to start the application from any scene, which is great. But since all our DDOL objects are created from code, we can't have them reference each other directly from the editor, which is annoying, and also leads to execution order issues in some cases. We figured that a good solution to this would be to have an Init scene with all the DDOL stuff, and an InitGuard object in every other scene that would load the Init scene additively if it hasn't been done before. This way we'd keep the advantages of both methods. Problem is, we can't get it to work :) Upon loading a scene, the InitGuard checks for the existence of the DDOL stuff in its Awake(). If it's not there, it has to load the Init scene **before** all other objects from the new scene are created (most of them need references to Init stuff in their Awake()). In a word, we need to load Init additively in the Awake() and wait until it's finished. And I can't find a way to do that, all my attempts have failed so far :(. Any suggestions ? Thanks in advance, Hurricanes.

Passing variables to LoadLevelAdditiveAsync

$
0
0
Im currently looking at using LoadLevelAdditiveAsync to improve loading the large tiled city i dynamically generate by streaming the tiles as the player moves around. My idea is to have a single scene with a gameobject/script that instantiates the required prefab and sets the tiles rotation(the same tile can have 4 positions) and position plus, any additional street decoration. I would then call that scene with LoadLevelAdditiveAsync but the problem is how do I pass the prefab/rotation/postion info. Any ideas?

How to load enlighten lightmaps correctly at runtime?

$
0
0
We are attempting to make a game that will consist of an "endless world" of sections that are loaded at runtime. Each section will be contained in a scene with it's own lightmaps. Currently we are using the LoadLevelAdditiveAsync method to test loading the scenes into an empty 'loading' scene. First we load the scenes, then we load the baked lightmaps from each scene into the LightmapData array, then we assign each renderer in the scene to look at it's corresponding lightmapIndex, and we set the lightmapScaleOffset back to it's original value. Here is a video of the one time that I actually managed to get it working... but I haven't been able to get it to work since. http://youtu.be/E5jdWa2ydmA Here is a video using another scene with my own meshes. (to test that UV mapping of unity primitives wasn't the problem). The first part shows the scenes with their lightmaps perfectly applied - no lights in the scene. The next part shows the loading scene with the scenes loaded side by side and lightmaps applied. As you can see, the lightmaps come in at the wrong scale and placement. http://youtu.be/YS9A_WO8-NA There are a couple of things I have noticed that I'd like someone to please explain to me or give me some insight on: 1. No matter what value we set the lightmapScaleOffset value to, it doesn't change how the lightmap is loaded onto the renderers. So then my question is, what does the lightmapScaleOffset actually do? 2. When I place a Lightmap Snapshot from one of the lightmapped scenes into the Lightmaps section of the 'loading" scene, the scene that the snapshot came from loads correctly. 3. I opened the LightmapSnapshot.asset file as text, and I noticed that there are some promising looking attributes in Enlighten System Information: rendererIndex, rendererSize, atlasIndex, atlasOffsetX, atlasOffsetY. Would it be at all possible to use the attributes to set up our loaded lightmaps correctly? Any insight or solutions to this problem would be much appreciated ;)

Problem with LoadLevelAdditive Timing

$
0
0
So I have a little problem which seems to me about the timing of LoadLevelAdditive. I'm instantiating a player object which in its start method instantiates another class that loads some UI from a seperate scene. in the same start method I try to excess that UI, but it is always null. when I output the contents of the UI scene it seems that it is only a valid object in the second update. how can I solve this?

LoadLevelAdditive random array

$
0
0
I'd like to know how to load all my scenes at ones but randomly each time, and everytime it loads i need my character and camera to be created in the 1st scene(which always is different) any ideas?

Light Maps / LoadLevelAdditive / Prefab

$
0
0
My game needs the ability to load rooms from either load level additive or better prefabs. I need to use the light mapping features. Once I attempt to load level additive a disabled level or prefab so I can position and rotate it then enable it the light maps are there but not functioning properly. What is the correct way to do this? They will share light maps correct? I need to be able to position and rotate the rooms at run time to randomly construct a level. I have been wrestling with and fighting this for quite some time and thanks for any help!

Disabling occlusion culling

$
0
0
I'm using LoadLevelAdditiveAsync to transition from one scene to the next with the new scene in the same location as the old one and the old one being deleted. The problem is that the old occlusion data is messing up the new scene. I already know LoadLevelAdditive cant stream occlusion data. But is it possible to disable/clear the current data so I can atleast use it in the first scene?

Split-screen for a large world

$
0
0
As a follow-up to this question: http://answers.unity3d.com/questions/959788/how-do-i-display-two-scenes-at-once.html I now have 8 scenes with the same world and different agents. Now if I use LoadLevelAdditive, since all these scenes have their worlds located around (0,0,0), the objects of both loaded scenes will occupy the same space. I've tried moving each scene far enough away that it's not visible from any other one, but after rebaking the NavMeshes with some of the more distant scenes I started running into problems with my navigation, I'm guessing because of the large world coordinates leading to large rounding errors in float calculations. Is there a better way to load two scenes, ie. move them only once loaded (including their NavMeshes, lighting stuff, occlusion stuff, etc.)? That way I'd have to only move each of them half of the "inter-scene distance" in opposite directions on load, rather than having to move some of them 2-3 "inter-scene distances" in the editor.

Correct use of Application.UnloadLevel ?

$
0
0
I'm trying to use the newly added Application.UnloadLevel to unload an existing scene after loading a new one in additively in Unity 5.2 but keep getting the error: *Unloading the first loaded scene Temp/__EditModeScene (index -1), is currently not supported UnityEngine.Application:UnloadLevel(Int32)* I can't seem to find much on the correct use of this method, not even the docs give an example piece of code so I was wondering if someone could take a look at my code and see if there's anything obvious I am doing wrong. Cheers public class SceneSwitcher : MonoBehaviour { private void Awake() { DontDestroyOnLoad(gameObject); } private void Update() { if (Input.GetKeyDown(KeyCode.L)) { StartCoroutine(SwitchScene()); } } private IEnumerator SwitchScene() { //load new scene AsyncOperation loadNewScene = Application.LoadLevelAdditiveAsync(1); while (!loadNewScene.isDone) { yield return new WaitForEndOfFrame(); } print("Scene Loaded"); //unload current/old scene bool unloaded = Application.UnloadLevel(0); while (!unloaded) { yield return new WaitForEndOfFrame(); } print("Scene Unloaded"); //unload the unused assets/lightmaps AsyncOperation unloadCurrentSceneAssets = Resources.UnloadUnusedAssets(); while (!unloadCurrentSceneAssets.isDone) { yield return new WaitForEndOfFrame(); } print("Unused Assets Removed"); } }

Intermittent crash on LoadLevelAdditive, and LoadLevelAdditiveAsync

$
0
0
I am experiencing an intermittent crash when loading certain levels in my project. It happens during an additive load, and I have reproduced it using both LoadLevelAdditive, and LoadLevelAdditiveAsync. My logs indicate that during at least one of the asynchronous loads, it happened at about 27% of the way through the loading process. In one case, the game crashed during a load where I assigned the LoadLevelAdditiveAsync method call to an AsyncOperation, and set that AsyncOperation's allowSceneActivation variable to false. Because of this, and because of the fact that the crash also happens when using LoadLevelAdditive, I am fairly certain that none of the code in any of the scripts in the scene that I am loading can be causing the crash, since in theory none of it should have been able to execute at the time when the crash happened. Also, I placed debug statements in the Awake() methods of every script that I had written for that scene, and none of them fired before the crash happened. Sometimes the game crashes on the first load of one of these scenes, but sometimes it takes more than 15 attempts to reproduce. Only scenes associated with one particular minigame within a much larger project cause the crash. The game never crashes or even throws an error in editor, only when built to a windows desktop app. [This is the output log from the most recent crash][1] Thanks in advance for any help. [1]: /storage/temp/54464-output-log.txt

Spawn scene object not found

$
0
0
**[General Information]** I've begun upgrading my Unity 4 project to Unity 5.2.1f1 Personal, mainly replacing the old Network Views with the new Network Identity's and the like. The game randomly generates the scene on the server through a main scene, loading areas using **Application.LoadLevelAdditive()**. These *sub scenes* contain objects with **Network Identity** components. When a client connects it is sent strings to identify which *sub scenes* to load in which positions. The objects in these *sub scenes* however do not have any way of syncing their **Network Identity**'s with their equivalent on the server because each was created locally with **Application.LoadLevelAdditive()**. On client connect the game freezes entirely and logs the following errors: HLAPI CRC channel count error local: 10 remote: 15 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() Spawn scene object not found for x UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() The second error is in the log countless times, where x represents a variety of integers. I assume these represent various objects with Network Identity's in said *sub scenes*. **[Question]** How would one go about syncing said components? Is there way way load levels additively consistently across the network? Any function like Network.LoadLevelAdditive? *Also, any tag suggestions would also be helpful as I did not know what to is relevant to this bug.*

How To Load Next Scene in Unity 5.3 Version without Destroying any GameObject?

$
0
0
Hello Everyone in Unity community! Im new to unity. i have used a little bit unity version 4.5 before but now im going to use unity Version 5.3. its changed. well how can i load a scene over another scene in this version.

Help with dynamic loading or occlusion culling in scenes on 2D metroidvania?

$
0
0
Hi everyone, I'm trying to do an adventure game (metroidvania), with fixed camera angles, and the map is reaaaaally huge. I already heard about `Application.LoadLevelAdditive`and `occlusion culling` but I really don't know how to handle with these and if they are optimized for HUGE things like my game map.

Load Level Additive tutorial problem

$
0
0
Basically, in the [Creating a Scene Selection][1] UI tutorial, they show how to add one scene to another without destroying anything in either scene by using Application.LoadLevelAdditive. However, this is now deprecated and the Unity Editor says to use SceneManager.LoadScene instead. My problem, as a Unity newbie, is how do I use SceneManager.LoadScene to do what Application.LoadLevelAdditive did? What I currently have is a menu screen in one scene and I want to make a second scene with just a bubble particle effect and combine the two so that when the player clicks on a hidden button on the menu screen, the bubbles appear on the side of the menu screen. Thanks in advance for any help with this. [1]: https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-scene-menu?playlist=17111

deleting previous scene in transitional room

$
0
0
im using a transitional room set to "dont destroy on load" with one open door and one closed door. when the player enters through the open door, it starts to close and the next scene will be loaded loadlevelAdditive while the first door is closing, when its finished closing, how do i delete the previous scene? (when the next additive scene is finished loading, ill open the next door to the next scene). I know alternatively i could simply loadlevelasync when both doors are closed (and that will delete the previous right?), however the player wont want to wait every time they go back and forth through the room from one scene to another. ive read all the documentation and am just confused about the most efficient method to use. edit: sorry, i guess everything is depreciated other than the new "loadScene" and "loadSceneAsnyc". So I'd use "loadSceneAsync" to load the next scene in the background, however i don't see anywhere in the documentation where it says how to delete the previous scene or how to check when the new scene is finished loading, only the variable "loadSceneMode" that toggles between "Single" mode and "Additive" mode... am i missing something? edit: to anyone not getting google results -- Don't search "loadScene", search the API root "SceneManager" instead and all the functions are there. Maybe it was just me lol.

Can Unity 5.5 load Occlusion Culling additively?

$
0
0
Since the release of 5.5 Unity is supposedly supporting multi-scene occlusion culling. Does it mean it is possible to use LoadLevelAdditiveAsync to load level with baked occlusion data? I tried baking for all scenes that are being streamed additively in my project, but occlusion culling doesn't seem to work that way at all.

What is the standard solution for preserving level data?

$
0
0
I've found different answers to how you might preserve data on gameobjects without resetting it when loading a new scene, such as DontDestroyOnLoad, PlayerPrefs, LoadLevelAdditive or even just using different positions in the same scene, but what is the standard solution commonly used in single player RPG games in the style of Pillars of Eternity, Neverwinter Nights and others, where the player character travels around many different areas (towns, dungeons, woods, houses) and upon returning to any previously visited area will find everything the way it was left - the dead still dead with the bodies in the same place, the living still living, the items picked up no longer there, the items left behind still waiting, things broken still broken, switches flipped the same way and so on? Adding it up to a huge list of manually created variables seems not elegant at all. Is there maybe an asset for this purpose anyone could recommend?

RenderSettings not overwritten when using LoadLevelAdditive

$
0
0
My TPS-game contains several Scenes besides the menu that have different maps. Each scene has its own environment, enemies and Render/LightSettings. For buildsize reasons and faster developing I use a "base-scene" (think of a base class) which contains scene dependent elements like the canvas, player and Camera. Also I have buttons on the canvas which use functions of the player, so making the canvas a prefab would lose all the onClick/eventTrigger references from the player. The player itself is a prefab, so dropping them all together as one prefab (nested prefab) in the map-scenes to avoid the referencing issue is a nogo. Therefore everytime I want to play a specific map, I first load from the menu the Base-Scene with the scene dependent elements and from there I load the actual map additively. But the problem is that the blank RenderSettings from the base-scene are not overwritten from the particular map-scene which should be as it *adds* the scene, assuming including rendersettings to overwrite the current scenes' rendersettings. Instead, only the environment is beeing added. So I think this issue is a bug from Unity ([https://forum.unity3d.com/threads/unity-5-losing-skybox-sun-fog-on-loadleveladditive.312039/][1]) but I dont know how to avoid this since my described scene management relies on additive loading. [1]: https://forum.unity3d.com/threads/unity-5-losing-skybox-sun-fog-on-loadleveladditive.312039/

Geometry not rendering after Application.LoadLevelAdditive

$
0
0
I have a scene (A) that acts as a pre-loader, displaying a title screen while the real scene (B) is loaded using Application.LoadLevelAsync. So A ===(Application.LoadLevelAsync)===> B Then in B, I have another scene (C) that get added in using Application.LoadLevelAdditive. So B ===(Application.LoadLevelAdditive)===> C B loads just fine but when the call to LoadLevelAdditive to get the contents of C runs, some geometry in B disappears. After some digging I was able to confirm that this only seems to affect geometry that is batched. More strangely, it doesn't affect all of the batched geometry, and in some cases only affects some of the mesh filters that are referencing the same combined mesh. I've tried loading B using LoadLevel and LoadLevelAsync and both produce the same result. I've also tried loading an empty scene C and I get the same result, so the problem seems to be in the call to LoadLevelAdditive that resets something. Attached is a screenshot of what I'm seeing, this one wall segment is fine before I trigger the LoadLevelAdditive and will not render afterwards even though its mesh rendere is still enabled and nothing has changed with the material. The post that sits between segments continues to render fine even though they are both referencing the same combined mesh. Before ![alt text][1] After ![alt text][2] [1]: http://s15.postimage.org/t8bt18puj/Before_Load_Level_Additive.png [2]: http://s15.postimage.org/ndrt79cd7/After_Load_Level_Additive.png
Viewing all 102 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>