Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building [RELEASED] CScape - advanced building generator

Discussion in 'Tools In Progress' started by olix4242, Mar 11, 2017.

  1. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Open Gl Core I'm pretty sure , Thank you for you help , I tried your suggestions but no progress yet.
     
  2. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Those problems were corrected in later versions of CScape. Now it should work without problems as I've made a workaround for this.
    But here your intuition is fine. From a screenshot I can see that it uses OGL 3.3, while a smaller shader language version suppprted is 3.5. or Metal. I don't know why Unity runs in OGL 3.3.. reasons could be many:
    -unity manually set by user to OGL 3.3 (but I doubt that this is a case)
    -old version of OSX that doesn't support OGL4.1 (this should be a default GL version)
    -old graphics hardware that isn't able to run newer versions of OpenGL.
     
    Last edited: Mar 7, 2018
  3. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    Anything??? It is always stuck at clustering, no matter which mode in a really small scene.
     
  4. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Could you please post a screenshot of Lighting Settings that you use?
    Are you familiar with Lightmapping in Unity?
     
    Last edited: Mar 8, 2018
  5. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It is normal that Unity stalls, works slowly (or even crashes) when generating lightmaps (or realtime lighting) for such a large world (using default settings for a lightmapping would require a lots of textures, and a lots of vram and ram).
    If you are using 40 texels for a meter, that equals to 40x40 (1600) pixels for every square meter of a city. A singe most simple building that has a size of 25 floors, and has a depth and width of 10 CS Units will require 25 * 3 * 40 * 10 * 3 * 40 * 4 that is more or less 15 megapixels (14.400.000 pixels), and it would require a texture atlas of 3.800 x 3.800 pixels. Just for a most simple single building. Multiply this for a number of buildings, and add to this also streets. To lightmap a scene of 100 buildings, you would end with hundred 4k textures just for lightmapping. This means that a scene of this size would require atleast 2.5 giga of vram (if compressed). But a real amount of pixels to process has to be counted for uncompressed size of approx 6.5 giga (one uncompressed 4k texture is 64 megabytes). Count that Unity has to use much more RAM to do this baking, so with 100 buildings you are already hitting a 8 giga of ram (if not much more).

    Keeping this in mind, what should be a solution?
    Solution 1:
    -Set a Lightmap size to 4k. (this is probably a must for such a big world)
    -Reduce significantly a lightmap resolution (you most probably don't need a 40 textels for meter, and you can go even as low as 1 texel per unit, and still get a good result).
    -Reduce a lightmap padding to 1.
    Hybrid solution:
    -use only Realtime lighting, and set indirect Resolution to something small like 0.2 texels per unit. And adjust it as you go. It should help you get some GI contribution, while maintaining performance and Mem usage.

    Solution 3
    -Don't use lightmaps with a CScape. Cscape was made so that it doesn't require any lightmapping and can instead use it's re-lighting feature, that doesn't impact performance, don't occupy any ram or VRAM. This feature is there to to be used to avoid limits of light baking for large worlds.
     
  6. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
  7. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Sorry, I've missed a thumbnail.
    As my later description explains, your Indirect resolution value is too high. Turn off Realtime lighting, or set indirect resolution to something much smaller. (you are using a value of 2). Start with somthing smaller like 0.2 -or 0. 02 (this should be mostly fine for indirect). it also depends on how much do you want to wait. But proably starting from 0.02 is a ok value.
     
  8. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    Ok, will try that. The problem is when I turn off RTL and dont use Baked GI it looks very crappy. My performance isnt very well anyway, I hope it works somehow for my VR project because performance is what its all about. Right now it doenst look very good and is laggy. :-( I'll report how it turned out.
     
  9. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    What is your reference desktop configuration? Are you testing in editor or outside of it? Are you using single pass stereo? What is a rarget platform (oculus, Vive or else?)
    Any screenshots are welcome - I simply can't cover all possible cases (probably hundreds of them) of usage, but some screenshots can easily help into undersanding what do you mean by crappy.
    But it looks impossible that it lags with a 3x3 city ( even a 10x10 city works fine on a mobile platform in VR)
     
  10. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Hi @olix4242,

    I had the same issue with bridges -- the height is too low for buses, trucks, and should probably be at least 1m higher to accommodate.


    Also, I was unable to remove bridges using the method you described. It doesn't seem to be possible to drag the neighboring section without increasing the width of that section's bridge. I will eventually need to use a modeler to remove them entirely. For now, I have them minimally configured as pedestrian only bridges, which opens up access to the riverside street.


    I have been trying to diversify my cities more to make them less grid-like and have had some success, but I am curious if there is an automated workflow that might help me to replace existing buildings with CScape buildings. Here is a quick clip that may give some idea.


    Right now, I am exporting the city & streets model from another tool and then for the final render in Unity I will need to replace most of the the model's buildings with CScape-generated buildings of similar shape/size.

    I am experimenting with the "slated streets" option in CScape, which is great because it breaks up the grid nicely. I am hoping at some point you will also add some ability to work on more uneven terrain, and doing terrain deformation to keep things within reason and even more organic sprawl outward from the city into the suburbs! Ok, enough dreaming...back to work.

    Best regards,
    Tony
     
    d1favero and olix4242 like this.
  11. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    At start of a video you are moving a wrong side of street, go to the 0:57 and here you are almost ok. You should drag modifier handle to fill area - and then, look at street patch.. there is another handle that controlls street handle. move that one untill it shinks a street.

    This could be possible, but mostly depends on how original buildings are structured. If they are more or less boxes that have info on their orientation, and aren't merged into blocks (but unfortunately, many city solutions merge their buildings into one) and doesn't use and adittional objects, you could be able to replace them automatically with CScape buildings.
    I could look into creating a simple script that could do this.
    I'm posting here a template that is higher, you can download it and replace original Rivers.FBX file with this one (replace it externaly (by using Windows Explorer), and not in Unity Project explorer.
     

    Attached Files:

    sharkapps likes this.
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Ok, I've made a simple script that could meet your needs (of your buildings are separate meshes and use common box shapes, axis orientation and arent merged into groups or have some hierarchy. You have to put all your original buildings in a hierarchy under an empty game object. Then assign that empty game object to a RootHolder variable in Building Replacer script (Building Replacer script has to be added to a CScape City object. Then just click Execute and pray that it works ;)

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEditor;
    5. using System.Linq;
    6.  
    7. namespace CScape
    8. {
    9.     [ExecuteInEditMode]
    10.     public class BuildingReplacer : MonoBehaviour
    11.     {
    12.  
    13.         public GameObject rootHolder;
    14.         public bool execute = false;
    15.  
    16.  
    17.         void Update()
    18.         {
    19.             CityRandomizer cityRandomizer = gameObject.GetComponent<CityRandomizer>();
    20.  
    21.             if (execute)
    22.             {
    23.                 foreach (Transform go in rootHolder.transform.Cast<Transform>().Reverse())
    24.                 {
    25.                     // we have to reset reference object rotation to be able to calculate real bounding box, here we are storing a real rotation
    26.                     Quaternion oldTransform = go.rotation;
    27.  
    28.                     //reseting rotation
    29.                     go.eulerAngles = new Vector3(go.eulerAngles.x, 0, go.eulerAngles.z);
    30.  
    31.                     //calculate bounding box and apporximate building size in CScape building units
    32.                     Vector3 center = go.gameObject.GetComponent<Renderer>().bounds.center;
    33.                     Vector3 bounds = go.gameObject.GetComponent<Renderer>().bounds.extents;
    34.                     Vector3 CScapeCoordinates = new Vector3(center.x - bounds.x, center.y - bounds.y, center.z - bounds.z);
    35.                     int depth = Mathf.FloorToInt((bounds.z * 2f) / 3f);
    36.                     int width = Mathf.FloorToInt((bounds.x * 2f) / 3f);
    37.                     int height = Mathf.FloorToInt((bounds.y * 2f) / 3f);
    38.  
    39.  
    40.  
    41.  
    42.                     //take random building objects from a CityRandomizer array of buildings ad choose only those that can fit reference buildings
    43.                     GameObject prefabToInstantiate = null;
    44.                     int iterations = cityRandomizer.prefabs.Length;
    45.                     bool validate = false;
    46.                     int prefabChoice = Random.Range(0, cityRandomizer.prefabs.Length);
    47.  
    48.                     while (validate == false)
    49.                     {
    50.                         prefabToInstantiate = cityRandomizer.prefabs[prefabChoice];
    51.                         BuildingModifier buildingToInstantiate = prefabToInstantiate.GetComponent<BuildingModifier>();
    52.                         if (prefabToInstantiate.GetComponent<BuildingModifier>().prefabDepth <= depth && prefabToInstantiate.GetComponent<BuildingModifier>().prefabDepth <= depth)
    53.                         {
    54.                             validate = true;
    55.                         }
    56.                         else prefabChoice++;
    57.  
    58.                         if (iterations > cityRandomizer.prefabs.Length)
    59.                         {
    60.                             prefabToInstantiate = cityRandomizer.prefabs[0];
    61.                             validate = true;
    62.                         }
    63.  
    64.                         iterations++;
    65.                     }
    66.  
    67.                     //Generate building
    68.                     GameObject cloneH = Instantiate(prefabToInstantiate, CScapeCoordinates, transform.rotation) as GameObject;
    69.                     //parent to reference building
    70.                     cloneH.transform.parent = go.transform;
    71.                     //restore original object rotation
    72.                     go.rotation = oldTransform;
    73.                     //unparent from reference building, and parent to Cscape city
    74.                     cloneH.transform.parent = cityRandomizer.buildings.transform;
    75.                     BuildingModifier buildingModifier = cloneH.GetComponent(typeof(BuildingModifier)) as BuildingModifier;
    76.                     buildingModifier.buildingDepth = depth;
    77.                     buildingModifier.buildingWidth = width;
    78.                     buildingModifier.floorNumber = height;
    79.  
    80.                     buildingModifier.AwakeCity();
    81.                     buildingModifier.UpdateCity();
    82.  
    83.                 }
    84.  
    85.  
    86.                 execute = false;
    87.             }
    88.         }
    89.     }
    90. }
    91.  
     

    Attached Files:

    sharkapps and hopeful like this.
  13. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Wow! I was not expecting you to do the work for me but I am really grateful you did! :) I will take a look at this during the weekend and let you know how it goes.
     
  14. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    This new template is even better than I hoped. Thank you so much.
     
    magique, olix4242 and hopeful like this.
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Just curious ... some of the bridges would disappear as you drove past. Was that intended behavior?
     
  16. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, this shouldn't happen.
    Did you bake occlusion culling before replacing bridges? If yes, then you should re-bake occlusion culling, otherwise Unity will use old bake solution, with an old mesh reference, that will make bridges disappear when they are still in field of view.
     
  17. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Did you try a new script for replacing old buildings with CScape versions? Does it work in your case?
     
  18. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    No, sorry, I did not. I was pressed for time when I made that clip, so I just replaced & built (which took a while on its own). See the updated clip below.



    I have not actually gotten to the point of executing the script yet. Over the weekend, I played with different generation options for the city building models, but I don't yet have a simple building -> 1 Renderer yet. Most of the buildings are constructed of 3 polygonal meshes, plus the lot/ground at the bottom of the building, so I need to do a bit more work still to get just the sum of the building-only meshes.

    I have attached a couple of sample building models to give a better idea.
     

    Attached Files:

    Last edited: Mar 13, 2018
  19. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have tried to use your models with my new version of script (that tries to guess building shapes), but unfortunately, those models have really lousy structures and hierarchies without any naming or logic (hierarchy) conventions. And this makes imposible any scripting and/or automation. Atleast, it is impossible without a manual work of organising meshes. I can understand that there are some objects that are placed in an empty hierarchy, like roofs, or low floors, but they are place without any convention or logic. For example, CScape uses a logic of placing main building forms into a single parent, for a reasons that can help further optimization, culling, batching. Here you have a bunch of elements (and atleast, they are separated by materials: so hereI can give a thumbs up - atleast, a developer didn't made a rookie error of creating a multi-mesh object with multiple materials).
    Tha said (after my lament): you can use my script by dragging objects that are important (the ones that cover a building) into a hierarchy of empty object (as described before). But you can't escape a manual work in this case as, even if I would, I can't find a way to automate this.
     
  20. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Thanks for looking at them. The models are generated by the tool and can be generated in different ways, but you almost always end up with lousy names and hierarchies. I spent most of the day working on a presentation so I did not get time to try to modify the script myself yet.
     
  21. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    I don't quite have it right yet, but it is getting close...



    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. namespace CScape
    4. {
    5.     [ExecuteInEditMode]
    6.     public class BuildingReplacer : MonoBehaviour
    7.     {
    8.  
    9.         public GameObject rootHolder;
    10.         public string buildingRootName;
    11.         public bool execute = false;
    12.  
    13.         private CityRandomizer cityRandomizer;
    14.  
    15.         private void OnEnable()
    16.         {
    17.             cityRandomizer = gameObject.GetComponent<CityRandomizer>();
    18.         }
    19.  
    20.         void Update()
    21.         {
    22.  
    23.             if (execute)
    24.             {
    25.                 int buildingsReplaced = 0;
    26.                 foreach (Transform go in rootHolder.transform.GetComponentsInChildren<Transform>())
    27.                 {
    28.                     if (go.name == buildingRootName)
    29.                     {
    30.                         ReplaceBuilding(go);
    31.                         buildingsReplaced++;
    32.                     }
    33.                 }
    34.  
    35.  
    36.                 execute = false;
    37.             }
    38.         }
    39.  
    40.  
    41.         void ReplaceBuilding(Transform building)
    42.         {
    43.             Bounds buildingBounds = new Bounds();
    44.  
    45.             foreach (Transform go in building.transform.GetComponentsInChildren<Transform>())
    46.             {
    47.                 Renderer rend = go.gameObject.GetComponent<Renderer>();
    48.  
    49.                 if (rend != null)
    50.                 {
    51.                     // we have to reset reference object rotation to be able to calculate real bounding box, here we are storing a real rotation
    52.                     Quaternion originalRotation = go.rotation;
    53.  
    54.                     //reseting rotation
    55.                     go.eulerAngles = new Vector3(go.eulerAngles.x, 0, go.eulerAngles.z);
    56.  
    57.                     if (buildingBounds.center == Vector3.zero)
    58.                     {
    59.                         buildingBounds.center = rend.bounds.center;
    60.                         buildingBounds.extents = rend.bounds.extents;
    61.                     } else
    62.                     {
    63.                         buildingBounds.Encapsulate(rend.bounds);
    64.                     }
    65.  
    66.                     go.rotation = originalRotation;
    67.                 }
    68.             }
    69.  
    70.             //calculate bounding box and apporximate building size in CScape building units
    71.             Vector3 center = buildingBounds.center;
    72.             Vector3 extents = buildingBounds.extents;
    73.             Vector3 CScapeCoordinates = new Vector3(center.x - extents.x, center.y - extents.y, center.z - extents.z);
    74.             int depth = Mathf.FloorToInt(extents.z * 2f / 3f);
    75.             int width = Mathf.FloorToInt(extents.x * 2f / 3f);
    76.             int height = Mathf.FloorToInt(extents.y * 2f / 3f);
    77.  
    78.  
    79.             //take random building objects from a CityRandomizer array of buildings ad choose only those that can fit reference buildings
    80.             GameObject prefabToInstantiate = null;
    81.             int iterations = cityRandomizer.prefabs.Length;
    82.             bool validate = false;
    83.             int prefabChoice = Random.Range(0, cityRandomizer.prefabs.Length - 1);
    84.  
    85.             while (validate == false)
    86.             {
    87.                 prefabToInstantiate = cityRandomizer.prefabs[prefabChoice];
    88.                 BuildingModifier buildingToInstantiate = prefabToInstantiate.GetComponent<BuildingModifier>();
    89.                 if (prefabToInstantiate.GetComponent<BuildingModifier>().prefabDepth <= depth && prefabToInstantiate.GetComponent<BuildingModifier>().prefabDepth <= depth)
    90.                 {
    91.                     validate = true;
    92.                 }
    93.                 else prefabChoice++;
    94.  
    95.                 if (iterations > cityRandomizer.prefabs.Length)
    96.                 {
    97.                     prefabToInstantiate = cityRandomizer.prefabs[0];
    98.                     validate = true;
    99.                 }
    100.  
    101.                 iterations++;
    102.             }
    103.  
    104.             //Generate building
    105.             GameObject cloneH = Instantiate(prefabToInstantiate, CScapeCoordinates, transform.rotation) as GameObject;
    106.             //parent to reference building
    107.             cloneH.transform.parent = building;
    108.  
    109.             //unparent from reference building, and parent to Cscape city
    110.             cloneH.transform.parent = cityRandomizer.buildings.transform;
    111.             BuildingModifier buildingModifier = cloneH.GetComponent(typeof(BuildingModifier)) as BuildingModifier;
    112.             buildingModifier.buildingDepth = depth;
    113.             buildingModifier.buildingWidth = width;
    114.             buildingModifier.floorNumber = height;
    115.  
    116.             buildingModifier.AwakeCity();
    117.             buildingModifier.UpdateCity();
    118.         }
    119.  
    120.  
    121.     }
    122. }
    123.  
     
    d1favero and olix4242 like this.
  22. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    @olix4242
    Hi, so I havent looked more into this with the version that can do slanted streets but is there an api to get streets/sidewalks/... when they are created? (I made a small tool for the version that does grid streets to place items along the curbs, or on the roads, but this was based just on the positions of the streets and widths/lengths of the streets) Ideally it would be nice to have some way to plug into the city builder to get the exact start of a street/sidewalk length, angle, etc and be able to add somethingw when the street is generated. Would you be able to add something like this?

    ps. also in the slated streets scene some bus stops are in the middle of the streets
     
  23. Deleted User

    Deleted User

    Guest

    Hi,

    I bought this plugin because it looks very good and also, its working on mobile platform. But unfortunately, on my mobile (Redmi Note 3 PRO 3GB/32GB) it gives me only 10fps!! :/ which is very sad. I have 5x5 town without trees, advs, roof things, lamps and with simple car i have maybe 15fps - material im using is with cscapemobileshader without interiors, some kind of decals, walls arrays etc (im using only NormalTextureArray, NoiseTexture - because of windows, SurfaceNormalArray, RoofTopTex, MaskTextArray). In editor it gives me boost from 150fps to almost 450fps, which is very good, but on mobile i have only 15fps. I tried using standard shader on buildings and test it and it gives me almost stable 60fps (drops are from particle system). Also your street shader is also hw hungry, so I need basic shader too.

    So, it looks like I need very basic mobile shader without those nice looking features, because mobile platform cant stand it.

    Its possible? Because I want to make android game with this plugin. It costs me 42e but it doesnt work at all. So if there will be no way how to fix it, can I refund it?
     
  24. Orbytel

    Orbytel

    Joined:
    Sep 1, 2012
    Posts:
    6
    performance.PNG Capture.PNG puddles.PNG Hi,
    I purchased the asset today after watching the videos and examples of use in VR- and it seemed suitable for a project I've been working on- given that it is advertised as being optimised for VR etc. I had previously built a small city environment environment with a different asset- and was unhappy with the performance of my city (which averaged 40-60fps).

    I made the decision to buy Cityscape today, and have run into a couple of issues:
    • The CScape_City gameobject is missing a script component. I've tried re-downloading the asset, reimporting, creating a new project from scratch and importing only the asset and I'm still having the same issue.
    • In VR, using VRTK and an Oculus Rift, I'm averaging 25-35fps and averaging roughly 230 calls... This performance isn't great- and is near unplayable once I start adding in gameplay mechanics etc. as it drops down to 15-18fps.
    • The puddles in the scene appear black with red (like a puddle of blood).
    At first I built a scene from scratch and generated a new city, and ran into many of the above issues. I then tested teh demo scene included- and encountered the same issues.

    The documentation for the asset is extremely minimal- and it would be great to get some guidance on this. What kind of settings should I expect to use for a VR setup? What is the missing script component on the CScape_City gameobject? Are the water puddles supposed to be red?

    Cheers,

    Luke

    Capture.PNG puddles.PNG
     
    Last edited: Mar 19, 2018
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Cscape works well on modern hardware - and you can't expect from a 150$ device to give you a good performance. From a screenshots that you've sent me, there are plenty of thingss that might slow down your performance and you would typically woant to optimize your scene for a mobile (as CScape can give you various quality and performance options and many ways to finetune performance).
    -From screenshots I can see that you are using some trees. Speedtrees are pretty hard to render on mobile devices - you shouldn't use any trees for your scene (or use some other simple trees), as they by itself can slow down rendering.
    -Don't generate Street Lights as they are realtime lights and can't work fine on mobile.
    -You are using realtime shadows, and I guess that you are using a high resolution shadows. They also can be pretty heavy.

    General tips for mobile:
    -In project "quality settings" reduce shadow resolution, or turn off realtime shadows if you hardware can't deal with them.
    -In project quality settings set Anisotropic textures to Disabled. this will boost your performance a lot with hardware that can't perform well.
    -Turn off Use Parallax in City Randomizer script (this will switch a shader to a version that is more suitable for mobile).
    -Play with Cscape LOD Manager and reduce LOD details.
    -You can even optimize a scene further by rebuilding Textures (with CSMaterial tools) by setting smaller resolution textures.
    -If you get any artefacts due to a loss of precision on older devices, be sure to turn off any Vertex Compression (in Player Settings)
    -Always be sure to bake Occlusion Culling.
     
  26. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This was a test script that is missing. But this error is completely harmless and will show only once (fix is coming in a new release)
    This quite depends on a size of your city, and LOD settings. At default settings, draw calls should be much smaller. But you can always optimize your scene further by using some of the tips mentioned in post above.
    This can depend on lightting. You can adjust this by changing value of Metallic variable in MegaCityStreet material - start from 0 nad adjust to your liking.
     
  27. Deleted User

    Deleted User

    Guest

    it can handle asphalt 8 which is very nice and it require powerfull mobile.

    Anyway, I disabled trees, even lamps, reduce shadows, using verylowquality shadows, occlusion culling doesnt work, it can boost max 5fps, disable realtime reflections, using 1/8 quality of texture, disable AA, parallax is off, LOD is set as very aggresive.

    So I tried to optimize it as much as I can and my fps are 20-25, which is terrible. As I said, when I use standard shader (which is not good for mobile) it gives me stable 60fps, so no, shader is too much complicated for mobile devices and I want to create some games for android and not everybody has s8/note 8/ s7 etc.
     
  28. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    "-In project quality settings set Anisotropic textures to Disabled (or PerTexture). this will boost your performance a lot with hardware that can't perform well. "
    Try this one and you will see a great boost. Most low end mobile devices can't deal well anisotropic texturing.
     
  29. Deleted User

    Deleted User

    Guest

    Its disabled, thats the problem, also I change resolution of all textures to 256x256, it reduces size from 150mb to 64mb, but still performance is bad

    I tried it on 5.5.1 version of unity and didnt help (im using 2017.3.1), also I tried it on more powerfull android phone and still performance was very bad (Huawei P9).

    So I think that refund would be best for both of us, sorry
     
  30. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Sorry, seen this post only now :(
    I will implement this as soon as slated streets feature exits experimental stage. This is why some features of Cscape aren't supported when using Slated streets option.
    Mostly, any generation should take info from StreetModifier component. Angles are available by using Skew rotation variables (skewRotationFront..ecc). also, you have available calculation of street lenghts by using Leght variables (lenghtFront.. ecc). But this can be tricky as you have to take into account also on what axis it does skewing (bool values). I will have to find a best way to make this thing work as easy as possible. But I'm still quite confused about what is a best approach.
     
    Last edited: Mar 22, 2018
  31. Orbytel

    Orbytel

    Joined:
    Sep 1, 2012
    Posts:
    6
    Apart from stripping the cs scripts before a build- is there anything else that needs to be done? I'm getting a number of errors in a dev build:
    (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 1510)

    The referenced script on this Behaviour (Game Object 'CScape City') is missing!
    (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 1753)

    A script behaviour (probably DetailMaterialTools?) has a different serialization layout when loading. (Read 32 bytes but expected 80 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 1894)

    The referenced script on this Behaviour (Game Object 'CScape City') is missing!
    (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 1753)

    A script behaviour (probably CScape.TextureArrayTools?) has a different serialization layout when loading. (Read 32 bytes but expected 144 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 1894)

    The referenced script on this Behaviour (Game Object 'CScape City') is missing!
    (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 1753)

    A script behaviour (probably CSMaterialTools?) has a different serialization layout when loading. (Read 32 bytes but expected 216 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 1894)

    The referenced script on this Behaviour (Game Object 'CScape City') is missing!
    (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 1753)

    A script behaviour (probably CScape.CScapeLODManager?) has a different serialization layout when loading. (Read 32 bytes but expected 76 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 1894)
     
  32. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Still working on those themes? Apocalyptic, sci-fi?
    Haven't seen an update in a while XD
     
  33. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Are you able to build, or your build process exits building? If it doesn't exit, those warnings are harmless - and it states that a a script has different lenght in editor than in build. But it is normal and desired behaviour (because some editor only functions doesn't get included into a build).
     
  34. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Will work on them as soon as CScape hits version 1.0.
     
  35. Lamzor_

    Lamzor_

    Joined:
    Aug 9, 2017
    Posts:
    1
    Hello Oli, im testing out unity2018. Is it supposed to be incompatible with cscape?

    @Orbytel: im using CScape for smaller VR game/demo with a lot of stuff added (high poly, not optimized) and i can run it 90fps (built) without any problem. Testing in unity is problematic for me, it gets me sick due to lower fps in editor. Its also not so nice in VR up close (looks nicer in videos). And due to low vive/oculus resolution the distant details are not very clear. But still, its the best city builder out there by far. I am really impressed. I havent found anything else that even comes close. It can be also changed to scifi quite easily (proved by Space Elevator City, which looks cool btw). I was able to get nice bladerunner-ish theme out of it.


    edit: updated CSBuildingShader.shader row 152 to
    #define ASE_SAMPLE_TEX2DARRAY_GRAD(tex,coord,dx,dy) UNITY_SAMPLE_TEX2DARRAY (tex,coord)

    and it seems to be working. Could this cause some problems down the line?
     
    Last edited: Apr 1, 2018
  36. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    What's coming in 1.0?
     
  37. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, I don't think it should make any problems. 2018 is supported (atleast from my tests - it is working fine). There is no any support for SRP's, but it should come sooner or later (this depends quite on Unity and when they will make SRP standard and documentation final). But right now, I'm experimenting with SRP implementation, that could eventually lead to some new solutions and features. But, this also slows down somewhat work on other features that I wanted to implement.
     
  38. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    -Full support for slated streets (angled and T-shaped streets).
    -API for placing objects on streets.
    -New type of buildings
    -probably but not sure: ambient occlusion baking (it is still experimental)
    -Standardized template workflow.
    -building generation on street level instead of City level
    -few more customizations for buildings and building details
    Most of the things are under the hood, and they serve to make a system that is more flexible.
     
  39. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    thinking of buying this plugin...

    a few questions b4 i buy
    will it generate a street/alley level rather than a city level?
    will it generate scifi assets i provide?
    how modular is needed for my assets to work with your plugin?
     
    Neviah likes this.
  40. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    im having trouble generating buildings now. i even did a fresh install of cscape.

    ArgumentException: The Object you want to instantiate is null.
    UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:239)
    UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:200)
    CScape.CSAdvertising.UpdateElements () (at Assets/CScape/Scripts/CSAdvertising.cs:180)
    CScape.BuildingModifier.ModifyBuilding () (at Assets/CScape/Scripts/BuildingModifier.cs:524)
    CScape.BuildingModifier.AwakeCity () (at Assets/CScape/Scripts/BuildingModifier.cs:164)
    CScape.CityRandomizer.Generate () (at Assets/CScape/Scripts/CityRandomizer.cs:429)
    CScape.CityRandomizerEditor.OnInspectorGUI () (at Assets/CScape/Editor/CityRandomizerEditor.cs:428)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1253)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Neviah likes this.
  41. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    im using unity 2017.4.1f1
     
  42. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    2017.4?
    Latest release should be 2017.3.1.
    Do you have any other version to test? Or have any other info that might help. I really can't replicate this problem in any way.
     
  43. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
  44. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Sorry, but no, I can't test all beta releases (apart 2018 that I'm testing). Latest stable release works perfectly (on my side). From your errors, I assume that there is some kind of asset serializer/importer issue with prefabs. I suggest you to submit this bug directly to Unity. ;)
     
  45. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515

    lts isn't beta. its new to unity as Long term support. the link i provided above explains it.
     
  46. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    and if you install the unity hub it shows up as the newest official release
     
  47. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    directly from the page i linked above:

    The LTS stream is for users who wish to continue to develop and ship their games/content and stay on a stable version for an extended period.

    The LTS version will not have any new features, API changes or improvements. It will address crashes, regressions, and issues that affect the wider community, such as Enterprise Support customer issues, console SDK/XDK, or any major changes that would prevent a large section of users from shipping their game. Each LTS stream will be supported for a period of two years.
     
  48. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    btw im pretty certain the f in 2017.4.1f1 stands for "final"

    where the b in beta releases stand for "beta" and the p in patch releases stand for "patch"
     
  49. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I see. but it looks like a LTS is a cumulative patch and not a real f release.
    Nevertheless, I have tested it with latest 2017.4 version and I can say that it works on my side (importing itno a fresh project).
    Are youn importing into a fresh project or an existing one?
    In a past I had some problems importing various assets into existing projects - there were some serialization errors with prefabs, and this seems a same problem (this happens when unity looses references on prefab scripts).
    I usually solved this issue by importing that asset into an empty project, and then copying folders manually from that project into existing one. This issue used to happen only with certain projects and certain version of unity (mostly those projects that were updated from previous versions). It is a bug that keeps fixed by Unity,but somehow also keeps coming back.
    Do you have an error when importing CScape asset that says:
    Binary to YAML conversion: type UInt16 is unsupported
     
  50. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962