Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Unity Tiny C# Freezes some times, hard to reproduce. Connected to lagg/memory?

Discussion in 'Project Tiny' started by PatrikCC, Dec 20, 2019.

  1. PatrikCC

    PatrikCC

    Joined:
    Oct 22, 2015
    Posts:
    4
    Hello I have a problem with Unity Tiny C#
    I have built a game and it works.

    I have my levels in scenes that I load in from GameConfig and store it as a loaded scene in GameConfig:
    GameConfig gc = World.TinyEnvironment().GetConfigData<GameConfig>();
    gc.CurrentLoadedScene = SceneService.LoadSceneAsync(gc.Level6);

    Before I load a new scene I unload all other scenes like this:
    if (gc.CurrentLoadedScene != Entity.Null)
    EntityManager.DestroyEntity(gc.CurrentLoadedScene);

    SceneService.UnloadAllSceneInstances(gc.Bootstrap);
    SceneService.UnloadAllSceneInstances(gc.MainScene);
    SceneService.UnloadAllSceneInstances(gc.Level1);
    SceneService.UnloadAllSceneInstances(gc.Level2);
    SceneService.UnloadAllSceneInstances(gc.Level3);
    SceneService.UnloadAllSceneInstances(gc.Level4);
    SceneService.UnloadAllSceneInstances(gc.Level5);
    SceneService.UnloadAllSceneInstances(gc.Level6);

    All this work perfectly and I can play the game on macOS and Web.

    The problem is that my game Randomly freezes on WEB on some computers and is super hard to reproduce. I think it has to do with memory. I managed to reproduce it a few time on my iPhone 7 but mainly it happens on a older Mac running FireFox. It feels random but I think it's connected to loading/unloading.

    Checked for log and memory usage but nothing out of the ordinary.
    When it freezes the canvas is locked and dose not rescale.
     
  2. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    123
    Hello,
    can you confirm which version on Project Tiny/Unity Editor you are working with?

    Be sure to check the guide
    https://docs.google.com/document/d/1A8hen2hLFY5FLkC5gd3JP2Z-IpHfnAX-CpYLK3aOdwA/edit#

    JC
     
  3. PatrikCC

    PatrikCC

    Joined:
    Oct 22, 2015
    Posts:
    4
    Thank you I am doing a 2d game so I use:
    Unity 2019.3.0a5 : Project Tiny 0.161.1

    It works fine on many devices and platforms just sometimes it freezes and the only connected factor I can see is when the device is running slow because of memory.
     
  4. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    123
    Sorry about your issues, but we cannot assist at the moment.

    You are using an old version of Project Tiny, that is no longer maintained and not compatible with the latest (preview.3 - 020.0 found here. Since you are working on 2D you'll have to wait for when we bring 2D back to Tiny (Q1 2020).
    Keep in mind that as we said on previous forum post updates, that since you have been working with preview-0.16.1, content you’ve authored will have to be reworked and C# code will also need to be manually migrated. There is no automated upgrade from older previews.

    JC
     
  5. PatrikCC

    PatrikCC

    Joined:
    Oct 22, 2015
    Posts:
    4
    Hey, Thanks for the info.
    I guess I will need to find a work around in the current version.

    As upgrading is not an option as there is no 2d support yet. You know when you will have 2d support in the new version?

    Cheers,
    Patrik