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

Sim City performance issue

Discussion in 'Editor & General Support' started by gamenut30111, Jun 11, 2011.

  1. gamenut30111

    gamenut30111

    Joined:
    Nov 7, 2009
    Posts:
    399
    Hey everyone, I am having a major issue with my games development. I am making a sim city style game, and the performance is dropping drastically whenever the city expands to large. The scripts used aren't making a large dent in the performance, so I am stumped. Are there any systems out there that proper use for large rts style games? I am about to implement occulsion culling, and I hope that will help.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You can't implement occlusion culling in a sim city style game cause occlusion culling is generated at editor time and sim city style games build and change the city ...

    chances though are that its drawcall related if you don't use materials wisely and dynamically combine meshes or that you have too many polygons just like that
     
  3. gamenut30111

    gamenut30111

    Joined:
    Nov 7, 2009
    Posts:
    399
    Ah, alright thanks dreamora, it's related to drawcalls, I am getting over 1700 quickly in the scene. With a sim city style game, how would you dynamically combine the meshes? Aren't the buildings dynamically changing, so isn't it the same issue as occulsion culling?
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    You might be over thinking this some, each building is or should be nothing more than a cube (elongated, etc), very few poly's per building even if the building is tiered, take care of this through proper baked materials and shading, although you could go nuts and use a city gen system that makes detailed buildings with high poly count which would put you into a crutch rather fast. I am not sure which direction you took when you designed the game though, this is just shooting in the wind so to speak.
     
  5. gamenut30111

    gamenut30111

    Joined:
    Nov 7, 2009
    Posts:
    399
    Most of my buildings are extremely low poly, I don't think that is the problem.
     
  6. NomadKing

    NomadKing

    Joined:
    Feb 11, 2010
    Posts:
    1,461
    CombineMeshes is the function you want.

    How best to use it depends on your game. For example if your buildings only have a 'BeingBuilt' and 'Finished' look, I would maintain 1 mesh for each material (assuming each building is textured with 1 material) and merge buildings into those meshes when they reach 'Finished'. The more materials and stages/looks to the buildings - the more you'll have to think of the best place to merge down.