Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Megacity demo 2019 LTS [community] upgrade thread

Discussion in 'Entity Component System' started by r618, Jun 17, 2020.

  1. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,271
    While trying to make originally released MegaCity GDC2019 demo work on 2019 LTS I took some notes which are posted here

    In general I always tried to bump any dependency only to next immediate/required version where possible and fixing all errors at that stage, including all warnings
    So all packages are more or less left at the version where things worked, this means that e.g. Entities are left at pretty ancient version compared to latest as of now (June 2020)
    It should be possible to upgrade this (Entities & their dependencies) further, but until Megacity Audio Package is updated (which might be never .) this requires modifying it manually since its approach is little bit different from the rest of the system/s.
    HDRP is fairly recent though and should upgrade to latest without problems (haven't tried yet)

    Disclaimer: this is what worked for me, it might, or might not work for you - in which case this thread might help.
    I'm not responsible for any damage occurring during the process. You have been warned )


    Upgrade process:

    - Upon opening the original project I let Unity update to asset database V2
    - afterwards since resolving of the packages fails Unity asks to Retry (which would bring it to this point again), Quit, or Continue. Let it Continue - you'll end up with broken pretty much everything.
    - don't let it fix HDRP yet
    - it's a good idea to (create and) open an empty scene at this point

    - manually resolve (install) Jobs dependency based on PM errors:
    Jobs -> 0.0.7-preview.9

    Next error:
    Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\DefaultWorld.cs(2,32): error CS0234: The type or namespace name 'PlayerLoop' does not exist in the namespace 'UnityEngine.Experimental' (are you missing an assembly reference?)

    - update Entities to preview.33 - 0.0.12
    - so update Jobs -> 0.0.7 preview 13
    At this point there should be only errors from Hybrid Renderer 0.0.1-preview.9
    I updated Megacity Audio System -> preview 13 0.0.1
    Entities -> 0.1.1
    Hybrid Renderer -> 0.1.1
    HybridRenderer -> 0.2.0
    and switched to .netstandard 2.0 (should be done earlier)

    fix namespace errors:
    using UnityEngine.Experimental.Rendering.HDPipeline; -> using UnityEngine.Rendering.HighDefinition;

    It's necessary to update project ECS code to reflect API changes next:
    - read and follow this guide https://forum.unity.com/threads/upcoming-api-changes-in-0-27.656245/
    - it's enough to directly replace:

    IJobProcessComponentData -> IJobForEach
    ComponentGroup -> EntityQuery
    EntityArchetypeQuery -> EntityQueryDesc
    ScheduleGroupSingle -> ScheduleSingle
    ScheduleGroup -> Schedule

    - to fix World references I manually replaced
    World.GetOrCreateManager -> this.World.GetOrCreateManager

    so e.g.
    World.Active.GetOrCreateManager<SamplePlaybackSystem>(); -> this.World.GetOrCreateSystem<SamplePlaybackSystem>();

    when referenced from inside of a system
    - or -
    World.Active.GetOrCreateManager -> World.DefaultGameObjectInjectionWorld.GetOrCreateSystem

    when used outside of system (i.e. MonoBehaviours, which was Audio system and Traffic simulation case)
    I'm not _entirely_ sure this is 100% correct but I couldn't find better way and it seems to be working. Maybe someone more knowledgeable can clarify.

    Don't forget to replace
    OnCreateManager -> OnCreate
    OnDestroyManager -> OnDestroy

    - BoundingVolume.DistanceSq errors:
    sceneData.BoundingVolume.DistanceSq(CameraPosition); -> math.distancesq(sceneData.BoundingVolume.Max, CameraPosition);

    I'm not sure about BoundingVolume.Max used for comparison. Tried to use .Min instead but couldn't see/hear noticeable difference. Don't know which is (more) correct, if any/.

    Replace
    using UnityEngine.Experimental.PlayerLoop; -> using UnityEngine.PlayerLoop;
    to get rid of the last compile error.

    At this point all compile errors should be fixed and Unity should be finished with updating assemblies. In other words should imported the whole project correctly into 2019 LTS.

    It's a good idea to fix any and all warnings at this point, especially if you intend upgrading ECS since those eventually became errors over time.

    ----------------------------------------------------------------------------------------------------------------------------
    At this point I restarted Unity and afterwards fixed HDRP errors using presented wizard
    There are still runtime/reload errors from ECS type checker on `SharedLight` user code component:
    ArgumentException: type Unity.Workflow.Hybrid.SharedLight is a ISharedComponentData and has managed references, you must implement IEquatable<T>

    It's enough to implement IEquatable on SharedLight which I did based on
    https://forum.unity.com/threads/how...-on-isharedcomponentdata.681505/#post-4561582
    ----------------------------------------------------------------------------------------------------------------------------
    To fix actual game I tagged
    020_Player game object with "Player" tag
    and
    VehicleControl game object under it with "VehicleControl" tag (which needed to be created - I'm not sure why tag settings weren't carried over from initial project...)

    Since camera game object ECS conversion didn't work at all (meaning there was no camera active when entering play mode)
    I removed `Convert To Entity` and disabled `Game Object Entity` components on the `PlayerCam` game object
    - I'm not sure if this is the correct way, but it seemed to help

    That should be all !

    Disclaimer: this is what worked for me, it might, or might not work for you - in which case this thread might help. I'm not responsible for any damage occurring during the process. You have been warned )
     
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    863
  3. themisfit_

    themisfit_

    Joined:
    Dec 9, 2016
    Posts:
    1
    The hero we need
     
  4. axvr

    axvr

    Joined:
    Aug 8, 2015
    Posts:
    14
    doesn't work for me. Is there a build somewhere I can play?
     
  5. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,271
    open the original project in version it was released for - 2019.1.0b7 - and build it ?
     
  6. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935

    Thanks for the detailed update workflow.
    Worked out nicely so far.

    I am in Unity 2019.4.17f1

    and get following runtime exeption

    InvalidOperationException:
    The previously scheduled job TrafficSystem:VehicleTransformJob writes to the
    NativeArray VehicleTransformJob.Iterator.
    You are trying to schedule a new job LightPoolSystem:FindClosestLightsJob,
    which reads from the same NativeArray (via FindClosestLightsJob.Iterator).
    To guarantee safety, you must include TrafficSystem:VehicleTransformJob as a dependency
    of the newly scheduled job.



    I am not sure if i did everything right here.

    I implemented implement IEquatable<T> like so....

    Code (CSharp):
    1. using System;
    2. using Unity.Entities;
    3. using UnityEngine;
    4.  
    5. namespace Unity.Workflow.Hybrid
    6. {
    7.     [Serializable]
    8.     public struct SharedLight : ISharedComponentData, IEquatable<SharedLight>
    9.     {
    10.         public const UInt64 LiveLinkEditSceneViewMask = 1UL << 60;
    11.         public const UInt64 LiveLinkEditGameViewMask = 1UL << 59;
    12.  
    13.         public GameObject Value;
    14.  
    15.         public bool Equals(SharedLight other)
    16.         {
    17.             //throw new NotImplementedException();
    18.             return
    19.                 Value == other.Value;
    20.         }
    21.  
    22.         public override int GetHashCode()
    23.         {
    24.             int hash = Value.GetHashCode();
    25.  
    26.             if (!ReferenceEquals(Value, null))
    27.                 hash ^= Value.GetHashCode();
    28.  
    29.             return hash;
    30.         }
    31.     }
    32.  
    33.     class SharedLightComponent : SharedComponentDataProxy<SharedLight>
    34.     {
    35.     }
    36. }
    37.  
    in


    Code (CSharp):
    1. using System;
    2. using Unity.Entities;
    3. using UnityEngine;
    4.  
    5. namespace Unity.Workflow.Hybrid
    6. {
    7.     [Serializable]
    8.     public struct SharedLight : ISharedComponentData
    9.     {
    10.         public GameObject Value;
    11.     }
    12.  
    13.     class SharedLightComponent : SharedComponentDataProxy<SharedLight>
    14.     {
    15.     }
    16. }

    Do you have an idea here?


    MegaCity_2019_4_xL_TS.JPG
     
    Last edited: Jan 6, 2021
  7. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,271
    Sorry, I don't!
    I believe I took the same implementation but I would have to have much better understanding of (current) ECS to be helpful here!
    I believe - maybe - it has to do how the TrafficSystem is used from MB world,.. but again, no idea !
     
  8. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Hi.

    Fyi. I did a little sprint on this.


    I have now a

    Unity 2019.4.17 LTS versio
    n
    (package updates like r618 did)
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.autodesk.fbx": "2.0.0-preview.6",
    4.     "com.unity.2d.sprite": "1.0.0",
    5.     "com.unity.2d.tilemap": "1.0.0",
    6.     "com.unity.audio.dspgraph": "0.1.0-preview.11",
    7.     "com.unity.audio.megacityprototype": "0.0.1-preview.13",
    8.     "com.unity.burst": "1.4.3",
    9.     "com.unity.cinemachine": "2.7.1",
    10.     "com.unity.entities": "0.0.12-preview.33",
    11.     "com.unity.ext.nunit": "1.0.5",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.jobs": "0.0.7-preview.9",
    14.     "com.unity.mathematics": "1.2.1",
    15.     "com.unity.render-pipelines.core": "7.3.1",
    16.     "com.unity.render-pipelines.high-definition": "7.5.2",
    17.     "com.unity.rendering.hybrid": "0.2.0-preview.18",
    18.     "com.unity.shadergraph": "7.3.1",
    19.     "com.unity.test-framework": "1.1.19",
    20.     "com.unity.timeline": "1.2.6",
    21.     "com.unity.ugui": "1.0.0",
    22.     "com.unity.xr.legacyinputhelpers": "2.1.6",
    23.     "com.unity.modules.ai": "1.0.0",
    24.     "com.unity.modules.androidjni": "1.0.0",
    25.     "com.unity.modules.animation": "1.0.0",
    26.     "com.unity.modules.assetbundle": "1.0.0",
    27.     "com.unity.modules.audio": "1.0.0",
    28.     "com.unity.modules.cloth": "1.0.0",
    29.     "com.unity.modules.director": "1.0.0",
    30.     "com.unity.modules.imageconversion": "1.0.0",
    31.     "com.unity.modules.imgui": "1.0.0",
    32.     "com.unity.modules.jsonserialize": "1.0.0",
    33.     "com.unity.modules.particlesystem": "1.0.0",
    34.     "com.unity.modules.physics": "1.0.0",
    35.     "com.unity.modules.physics2d": "1.0.0",
    36.     "com.unity.modules.screencapture": "1.0.0",
    37.     "com.unity.modules.terrain": "1.0.0",
    38.     "com.unity.modules.terrainphysics": "1.0.0",
    39.     "com.unity.modules.tilemap": "1.0.0",
    40.     "com.unity.modules.ui": "1.0.0",
    41.     "com.unity.modules.uielements": "1.0.0",
    42.     "com.unity.modules.umbra": "1.0.0",
    43.     "com.unity.modules.unityanalytics": "1.0.0",
    44.     "com.unity.modules.unitywebrequest": "1.0.0",
    45.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    46.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    47.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    48.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    49.     "com.unity.modules.vehicles": "1.0.0",
    50.     "com.unity.modules.video": "1.0.0",
    51.     "com.unity.modules.vr": "1.0.0",
    52.     "com.unity.modules.wind": "1.0.0",
    53.     "com.unity.modules.xr": "1.0.0"
    54.   }
    55. }
    56.  
    - little streaming issues because camera entity conversion issues you described
    - cannot build because sound package IL2CPP issue


    Unity 2020.1.17 version
    (latest available preview packages, 10/01/2021)
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.autodesk.fbx": "2.0.0-preview.6",
    4.     "com.unity.2d.sprite": "1.0.0",
    5.     "com.unity.2d.tilemap": "1.0.0",
    6.     "com.unity.audio.dspgraph": "0.1.0-preview.16",
    7.     "com.unity.burst": "1.4.4-preview.2",
    8.     "com.unity.cinemachine": "2.7.1",
    9.     "com.unity.entities": "0.16.0-preview.21",
    10.     "com.unity.ext.nunit": "1.0.6",
    11.     "com.unity.ide.visualstudio": "2.0.5",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.jobs": "0.0.7-preview.9",
    14.     "com.unity.mathematics": "1.2.1",
    15.     "com.unity.platforms.windows": "file:C:\\Unity\\Github\\com.unity.platforms.windows",
    16.     "com.unity.render-pipelines.core": "8.3.1",
    17.     "com.unity.render-pipelines.high-definition": "8.3.1",
    18.     "com.unity.rendering.hybrid": "0.10.0-preview.21",
    19.     "com.unity.scriptablebuildpipeline": "1.14.1",
    20.     "com.unity.shadergraph": "8.3.1",
    21.     "com.unity.test-framework": "1.1.20",
    22.     "com.unity.timeline": "1.4.5",
    23.     "com.unity.ugui": "1.0.0",
    24.     "com.unity.xr.legacyinputhelpers": "2.1.7",
    25.     "com.unity.modules.ai": "1.0.0",
    26.     "com.unity.modules.androidjni": "1.0.0",
    27.     "com.unity.modules.animation": "1.0.0",
    28.     "com.unity.modules.assetbundle": "1.0.0",
    29.     "com.unity.modules.audio": "1.0.0",
    30.     "com.unity.modules.cloth": "1.0.0",
    31.     "com.unity.modules.director": "1.0.0",
    32.     "com.unity.modules.imageconversion": "1.0.0",
    33.     "com.unity.modules.imgui": "1.0.0",
    34.     "com.unity.modules.jsonserialize": "1.0.0",
    35.     "com.unity.modules.particlesystem": "1.0.0",
    36.     "com.unity.modules.physics": "1.0.0",
    37.     "com.unity.modules.physics2d": "1.0.0",
    38.     "com.unity.modules.screencapture": "1.0.0",
    39.     "com.unity.modules.terrain": "1.0.0",
    40.     "com.unity.modules.terrainphysics": "1.0.0",
    41.     "com.unity.modules.tilemap": "1.0.0",
    42.     "com.unity.modules.ui": "1.0.0",
    43.     "com.unity.modules.uielements": "1.0.0",
    44.     "com.unity.modules.umbra": "1.0.0",
    45.     "com.unity.modules.unityanalytics": "1.0.0",
    46.     "com.unity.modules.unitywebrequest": "1.0.0",
    47.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    48.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    49.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    50.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    51.     "com.unity.modules.vehicles": "1.0.0",
    52.     "com.unity.modules.video": "1.0.0",
    53.     "com.unity.modules.vr": "1.0.0",
    54.     "com.unity.modules.wind": "1.0.0",
    55.     "com.unity.modules.xr": "1.0.0"
    56.   }
    57. }
    58.  
    + streaming system works again.
    It s was possible with newest packages to convert and inject cam again

    + build possible with ECS examples build configurations

    - Traffic System, could not handle api changes for now

    - Sound System, could not handle api changes for now


    Unity 2020.2.1 version, Hybrid Renderer V2
    (latest available preview packages, 10/01/2021)
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.autodesk.fbx": "2.0.0-preview.6",
    4.     "com.unity.2d.sprite": "1.0.0",
    5.     "com.unity.2d.tilemap": "1.0.0",
    6.     "com.unity.audio.dspgraph": "0.1.0-preview.16",
    7.     "com.unity.burst": "1.4.4-preview.2",
    8.     "com.unity.cinemachine": "2.7.1",
    9.     "com.unity.entities": "0.16.0-preview.21",
    10.     "com.unity.ext.nunit": "1.0.6",
    11.     "com.unity.ide.visualstudio": "2.0.5",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.jobs": "0.0.7-preview.9",
    14.     "com.unity.mathematics": "1.2.1",
    15.     "com.unity.platforms.windows": "file:C:\\Unity\\Github\\com.unity.platforms.windows",
    16.     "com.unity.render-pipelines.core": "10.2.2",
    17.     "com.unity.render-pipelines.high-definition": "10.2.2",
    18.     "com.unity.rendering.hybrid": "0.10.0-preview.21",
    19.     "com.unity.scriptablebuildpipeline": "1.14.1",
    20.     "com.unity.shadergraph": "10.2.2",
    21.     "com.unity.test-framework": "1.1.20",
    22.     "com.unity.timeline": "1.4.5",
    23.     "com.unity.ugui": "1.0.0",
    24.     "com.unity.xr.legacyinputhelpers": "2.1.7",
    25.     "com.unity.modules.ai": "1.0.0",
    26.     "com.unity.modules.androidjni": "1.0.0",
    27.     "com.unity.modules.animation": "1.0.0",
    28.     "com.unity.modules.assetbundle": "1.0.0",
    29.     "com.unity.modules.audio": "1.0.0",
    30.     "com.unity.modules.cloth": "1.0.0",
    31.     "com.unity.modules.director": "1.0.0",
    32.     "com.unity.modules.imageconversion": "1.0.0",
    33.     "com.unity.modules.imgui": "1.0.0",
    34.     "com.unity.modules.jsonserialize": "1.0.0",
    35.     "com.unity.modules.particlesystem": "1.0.0",
    36.     "com.unity.modules.physics": "1.0.0",
    37.     "com.unity.modules.physics2d": "1.0.0",
    38.     "com.unity.modules.screencapture": "1.0.0",
    39.     "com.unity.modules.terrain": "1.0.0",
    40.     "com.unity.modules.terrainphysics": "1.0.0",
    41.     "com.unity.modules.tilemap": "1.0.0",
    42.     "com.unity.modules.ui": "1.0.0",
    43.     "com.unity.modules.uielements": "1.0.0",
    44.     "com.unity.modules.umbra": "1.0.0",
    45.     "com.unity.modules.unityanalytics": "1.0.0",
    46.     "com.unity.modules.unitywebrequest": "1.0.0",
    47.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    48.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    49.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    50.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    51.     "com.unity.modules.vehicles": "1.0.0",
    52.     "com.unity.modules.video": "1.0.0",
    53.     "com.unity.modules.vr": "1.0.0",
    54.     "com.unity.modules.wind": "1.0.0",
    55.     "com.unity.modules.xr": "1.0.0"
    56.   }
    57. }
    58.  

    in progress but looks good

    - Traffic System, could not handle api changes for now

    - Sound System, could not handle api changes for now
    removed "com.unity.audio.megacityprototype": "0.0.1-preview.13

    + switched to Hybrid Renderer V2

    - First V2 Build time was close to 4 hours?

    Buildt.JPG





    common changes i made

    + new HDRP Scene settings Volume to fix Volumetric Fog and use latest HDRP changes
    + TAA
    + new High, Medium, Low HDRP Quality settings
    + fixed Cinemachine player camera to work with latest package
    + added build configurations from ECS samples
    + added Windows Platform package


    However this was a 3 day madness caused by a lockdown blues wasting 500GB+ SSD memory.
    I plan to do a git repository without the /Textures Folder (15GB) .



    ***************************
    FYI and additional note.
    Motivation and background is to get into best practice for Open World Streaming and Unity ECS.

    Codewalker is one of the best learning ressources i found and it is available on github
    https://github.com/dexyfex/CodeWalker

    It streams the complete LA level from disc from the installed original GTA V game.

    All lods, navmeshes, splines, collision meshes.....
    day/night cycle per mousewheel ...
    and allows to retrieve visually the entity names to allow further modifications with OPEN IV for the modding community.

    You can do an Net 4.5 build with Visual Studio.

    It...
    ....streams similar to the Megacity Demo complete LA with all LOD´s

    001_Paths003.JPG

    ...plus paths

    001_Paths001.JPG

    001_Paths002.JPG

    ... plus navmeshes

    001_Paths001_andNavmesh.JPG
     
    Last edited: Jan 10, 2021
    fablemaker, JesOb, Antypodish and 2 others like this.
  9. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,271
    nice job @keeponshading , i've been wanting to try out the new safe mode never got to it so far hah ]

    but I'm not sure if UT would be fine with 3rd party public Megacity repository tbh, even without textures - I suggest you research this first
     
  10. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Sure. I will ask Unity before i do this.
    For me, the Mega City Demo is for DOTS as important like Fontainebleau and the SpaceShip Demo for HDRP and the VFX Graph development.

    Hard to get why is it not updated during DOTS development.
    The ECS sample repository is as boring like Lockdown 3.)


    Here some shots from the
    Unity 2020.2.1 version, Hybrid Renderer V2
    (latest available preview packages, 10/01/2021)

    V2.JPG

    Build.

    additivelightst.JPG

    and the "most" open issues for now described here in the V2 Thread
    https://forum.unity.com/threads/hybrid-renderer-v2-0-4-0.847546/page-11#post-6708547

    I can send it to you. You did the inital work.
    Think the Traffic System needs 4 to 6h of work.
    The Sound System i am not sure. The DSP Graph got only one update in the last 12 months.
     
    Last edited: Jan 10, 2021
    r618 likes this.
  11. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,271
    I'll PM you if/when needed, thanks :)
    I surely - as well as the whole community - hope that UT will bring this further along in more official way ^^
     
    keeponshading likes this.
  12. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    IBL Ambient Light is working now again in latest Hybrid Renderer V2 (0.11.0-preview.42).

    update to:

    Unity 2021.1.0b3

    (latest Packages entities, hybrid renderer V2, 24.01)


    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.autodesk.fbx": "4.0.0-pre.1",
    4.     "com.unity.2d.sprite": "1.0.0",
    5.     "com.unity.2d.tilemap": "1.0.0",
    6.     "com.unity.audio.dspgraph": "0.1.0-preview.11",
    7.     "com.unity.burst": "1.4.1",
    8.     "com.unity.cinemachine": "2.7.1",
    9.     "com.unity.entities": "0.17.0-preview.41",
    10.     "com.unity.ext.nunit": "1.0.6",
    11.     "com.unity.ide.visualstudio": "2.0.5",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.jobs": "0.0.7-preview.9",
    14.     "com.unity.mathematics": "1.2.1",
    15.     "com.unity.platforms.windows": "0.10.0-preview.10",
    16.     "com.unity.render-pipelines.core": "11.0.0",
    17.     "com.unity.render-pipelines.high-definition": "11.0.0",
    18.     "com.unity.rendering.hybrid": "file:../LocalPackages/com.unity.rendering.hybrid@0.11.0-preview.42",
    19.     "com.unity.scriptablebuildpipeline": "1.15.1",
    20.     "com.unity.shadergraph": "11.0.0",
    21.     "com.unity.test-framework": "1.1.20",
    22.     "com.unity.timeline": "1.5.1-pre.3",
    23.     "com.unity.ugui": "1.0.0",
    24.     "com.unity.xr.legacyinputhelpers": "2.1.7",
    25.     "com.unity.modules.ai": "1.0.0",
    26.     "com.unity.modules.androidjni": "1.0.0",
    27.     "com.unity.modules.animation": "1.0.0",
    28.     "com.unity.modules.assetbundle": "1.0.0",
    29.     "com.unity.modules.audio": "1.0.0",
    30.     "com.unity.modules.cloth": "1.0.0",
    31.     "com.unity.modules.director": "1.0.0",
    32.     "com.unity.modules.imageconversion": "1.0.0",
    33.     "com.unity.modules.imgui": "1.0.0",
    34.     "com.unity.modules.jsonserialize": "1.0.0",
    35.     "com.unity.modules.particlesystem": "1.0.0",
    36.     "com.unity.modules.physics": "1.0.0",
    37.     "com.unity.modules.physics2d": "1.0.0",
    38.     "com.unity.modules.screencapture": "1.0.0",
    39.     "com.unity.modules.terrain": "1.0.0",
    40.     "com.unity.modules.terrainphysics": "1.0.0",
    41.     "com.unity.modules.tilemap": "1.0.0",
    42.     "com.unity.modules.ui": "1.0.0",
    43.     "com.unity.modules.uielements": "1.0.0",
    44.     "com.unity.modules.umbra": "1.0.0",
    45.     "com.unity.modules.unityanalytics": "1.0.0",
    46.     "com.unity.modules.unitywebrequest": "1.0.0",
    47.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    48.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    49.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    50.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    51.     "com.unity.modules.vehicles": "1.0.0",
    52.     "com.unity.modules.video": "1.0.0",
    53.     "com.unity.modules.vr": "1.0.0",
    54.     "com.unity.modules.wind": "1.0.0",
    55.     "com.unity.modules.xr": "1.0.0"
    56.   }
    57. }

    Scripting Define Symbols:

    ENABLE_HYBRID_RENDERER_V2
    USE_BATCH_RENDERER_GROUP

    b.JPG

    Build

    3.JPG

    v2_2.JPG



    notable changes:

    deactivate traffic and audio system for now

    delete folder
    C:\Unity\MegaCity_GDC_2019_2_1f1_Release_OC_TS\Assets\Scripts\Gameplay\Traffic
    C:\Unity\MegaCity_GDC_2019_2_1f1_Release_OC_TS\Assets\Scripts\Gameplay\Audio
    zipped to reactivate


    removed package
    "com.unity.audio.megacityprototype": "0.0.1-preview.13",
    because latest update October 04, 2019


    in
    StreamingLogicSystem.cs

    m_EntityCommandBufferSystem = this.World.GetOrCreateSystem<EndPresentationEntityCommandBufferSystem>();
    to
    m_EntityCommandBufferSystem = this.World.GetOrCreateSystem<BeginPresentationEntityCommandBufferSystem>();


    in
    CombineMeshFromLOD.cs

    comment
    //using Traffic.Pathing;
    code

    comment 2x
    //HLOD.InvalidateHLODCache();
    -> Is there a replacement needed? Function is not available anymore?


    Deactivate some (~20) subscenes because memory problems in Hybrid Renderer V2.
    see
    https://forum.unity.com/threads/hybrid-renderer-v2-0-4-0.847546/page-12#post-6716158

    + new HDRP Scene settings Volume to fix Volumetric Fog and use latest HDRP changes
    + TAA High
    + new High, Medium, Low HDRP Quality settings
    + fixed Cinemachine player camera to work with latest package
    + added build configurations from ECS samples
    + added latest Windows Platform package
     
    Last edited: Feb 5, 2021
  13. squeaky-clean

    squeaky-clean

    Joined:
    Jan 19, 2015
    Posts:
    5
    Thanks for these posts, all. Was able to get MegaCity running on an updated version of Unity, except had to remove the audio system. It's pretty embarrassing how Unity releases demos on beta versions of Unity and then simply abandons them.
     
  14. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Fully agree.) It s such an great example.

    I have a version on
    2021.1.0b4 on latest HDRP, Entity and Hybrid Render V2
    packages.
    Traffic is working again now, too.

    I also have zipped and removed the sound folder.

    I found this repo
    https://github.com/ncnagi/MegaCityLite
    did a fork and plan to push my changes there.
    It has reduced texture size to fit the git quota which is nice.
    It would probably be an good idea to work together on this repo instead of wasting time by solving same problems.

    I have some minor HLOD issue.
    The in/out streaming works but the lowest "HLOD" is not permanent displayed like in the original.
    Means it streams in and out according to 600 and 800 value but the lowest HLOD is not visible when streamed out.
    I am just at the begining in understanding how this worked before.

    I only changed in
    StreamingLogicSystem.cs


    Code (CSharp):
    1. m_EntityCommandBufferSystem = this.World.GetOrCreateSystem<EndPresentationEntityCommandBufferSystem>();
    2. to
    3. m_EntityCommandBufferSystem = this.World.GetOrCreateSystem<BeginPresentationEntityCommandBufferSystem>();
    Did you something change in the subscenes according to HLOD setup or in the streaming scripts?
     
    fablemaker likes this.
  15. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    some more visual explanation....


    edit:
    Two Subscenes per building..
    One for the LowLOD who is always loaded.
    One for the HLOD streamed in/out depending on the movement of the player.

    All LowLODs outside the streaming out sphere (red) are not visible anymore.


    e.JPG

    But one these LowLOD´s should be visible anytime to avoid poping in (blue marked)?
    Probably i am completly wrong here.


    2.JPG



    However. Here in the orginal version you see one of the LowLODS outside the streaming area which is permanently rendered..


    32.JPG

    I also checked the HLOD examples out of the ECS Samples and there is only
    one LowLOD
    and
    one HighLOD.

    Megacity has
    one HighLOD
    and
    2 LowLOD´s
    in the subscenes.

    Can anyone point me in the right direction here or has some hint what i have to change in the HLOD.cs which also massivly changed.

    EDIT:
    try this
    https://forum.unity.com/threads/hybrid-renderer-v2-0-4-0.847546/page-10#post-6507822
     
    Last edited: Feb 10, 2021
  16. OneAndOneIsTwo

    OneAndOneIsTwo

    Joined:
    Oct 19, 2014
    Posts:
    7
    Hi i have almost successfully integrated Megacity lite version from github to 2019 DOTS FPS sample using Unity 2019 3.6f1. I am looking to understand any help regarding to why i get an error regarding adding the lightning scene when Unity starts but i get this error *ArgumentException: Scene with name "AdditiveLightPoolScenePlaymode" already exists* the script is from lightpoolsystem.cs . I can tell that in the script it shows AdditiveScene = SceneManager.CreateScene("AdditiveLightPoolScenePlaymode"); but editor says the scene already exist, i dont know ho to go about to fix this any help would be awesome thanks.
     
  17. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Attached are my changes to run it in 2019.4.18f1
    Copy these to
    \LightRef folder

    Try it, but they include changes based on these packages

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.autodesk.fbx": "2.0.0-preview.6",
    4.     "com.unity.2d.sprite": "1.0.0",
    5.     "com.unity.2d.tilemap": "1.0.0",
    6.     "com.unity.audio.dspgraph": "0.1.0-preview.7",
    7.     "com.unity.audio.megacityprototype": "file:../LocalPackages/com.unity.audio.megacityprototype@0.0.1-preview.13",
    8.     "com.unity.burst": "1.3.0-preview.12",
    9.     "com.unity.cinemachine": "2.7.1",
    10.     "com.unity.entities": "0.11.1-preview.4",
    11.     "com.unity.ext.nunit": "1.0.6",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.jobs": "0.0.7-preview.9",
    14.     "com.unity.mathematics": "1.2.1",
    15.     "com.unity.render-pipelines.core": "7.3.1",
    16.     "com.unity.render-pipelines.high-definition": "7.5.2",
    17.     "com.unity.rendering.hybrid": "0.5.2-preview.4",
    18.     "com.unity.shadergraph": "7.3.1",
    19.     "com.unity.test-framework": "1.1.20",
    20.     "com.unity.timeline": "1.2.6",
    21.     "com.unity.ugui": "1.0.0",
    22.     "com.unity.xr.legacyinputhelpers": "2.1.7",
    23.     "com.unity.modules.ai": "1.0.0",
    24.     "com.unity.modules.androidjni": "1.0.0",
    25.     "com.unity.modules.animation": "1.0.0",
    26.     "com.unity.modules.assetbundle": "1.0.0",
    27.     "com.unity.modules.audio": "1.0.0",
    28.     "com.unity.modules.cloth": "1.0.0",
    29.     "com.unity.modules.director": "1.0.0",
    30.     "com.unity.modules.imageconversion": "1.0.0",
    31.     "com.unity.modules.imgui": "1.0.0",
    32.     "com.unity.modules.jsonserialize": "1.0.0",
    33.     "com.unity.modules.particlesystem": "1.0.0",
    34.     "com.unity.modules.physics": "1.0.0",
    35.     "com.unity.modules.physics2d": "1.0.0",
    36.     "com.unity.modules.screencapture": "1.0.0",
    37.     "com.unity.modules.terrain": "1.0.0",
    38.     "com.unity.modules.terrainphysics": "1.0.0",
    39.     "com.unity.modules.tilemap": "1.0.0",
    40.     "com.unity.modules.ui": "1.0.0",
    41.     "com.unity.modules.uielements": "1.0.0",
    42.     "com.unity.modules.umbra": "1.0.0",
    43.     "com.unity.modules.unityanalytics": "1.0.0",
    44.     "com.unity.modules.unitywebrequest": "1.0.0",
    45.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    46.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    47.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    48.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    49.     "com.unity.modules.vehicles": "1.0.0",
    50.     "com.unity.modules.video": "1.0.0",
    51.     "com.unity.modules.vr": "1.0.0",
    52.     "com.unity.modules.wind": "1.0.0",
    53.     "com.unity.modules.xr": "1.0.0"
    54.   }
    55. }
    56.  
     

    Attached Files:

    Last edited: Feb 5, 2021
    irisfreesiri, FilmBird and fablemaker like this.