Home Unreal Engine

Procedural building using construction script frame drops?

Dominic Sewell
polycounter lvl 4
Offline / Send Message
Pinned
Dominic Sewell polycounter lvl 4

Hi guys,

So through strife ive made my first real construction script in ue4 and ive gota building using instanced meshes in order to edit the mesh desired, number of floors and number of segments (both width and depth). However im getting this strange performance drop when viewing the structure from different angles. The front of the building sticks around 8ms whilst the side reaches around 11ms.

Both Sides are using the exact same mesh but ive checked the gpu profiler and the difference seems to be in the "dynamic" section of "Base Pass". This performance hit gets exponentially worse the larger i make the building and at a ppoint completely freezes my pc when i hit play.

Any ideas whats causing this and how to fix it?


Front View

Side View



Thanks Guys!

Replies

  • IacopoAntonelli
    Options
    Offline / Send Message
    IacopoAntonelli polycounter lvl 3
    Sorry, I didn't get of what did you placed in the level.
    What did you placed inside that cube?
    I don't think the drop is in the blueprint logic, since Base Pass is basically a GPU task, and constructor of BP is called just at the beginning and not during the game.
    If you have a lot of stuff in that cube, like floors, walls, and props maybe the drop is caused by the occlusion culling, which can be different based on the view angle.
  • Dominic Sewell
    Options
    Offline / Send Message
    Dominic Sewell polycounter lvl 4
    @IacopoAntonelli unfortunately not the building is entirely empty it consists of the walls only. The only thing in the level is the blueprint and the basic floor that loads with the starter project.

    The bit about construction script only being called at the start of game is whats confusing me, i was under the impression that construction script is not even considered during runtime afte play is started. Even saying that though like i mentioned before the larger a make the building the bigger the performance hit becomes. The performance is being directly affected by the size of the building.

    Just as a side note all the meshes used for the building are simple planes so its not a tri count issue.

    thanks for the reply!
  • IacopoAntonelli
    Options
    Offline / Send Message
    IacopoAntonelli polycounter lvl 3
    @IacopoAntonelli unfortunately not the building is entirely empty it consists of the walls only. The only thing in the level is the blueprint and the basic floor that loads with the starter project.

    The bit about construction script only being called at the start of game is whats confusing me, i was under the impression that construction script is not even considered during runtime afte play is started. Even saying that though like i mentioned before the larger a make the building the bigger the performance hit becomes. The performance is being directly affected by the size of the building.

    Just as a side note all the meshes used for the building are simple planes so its not a tri count issue.

    thanks for the reply!


    That's pretty odd.
    However, just for knowledge, construction script is called every time you load the level of the object, not just at the beginning of the game, so take it in consideration if you setup multiple streamed sub-levels.

    For the drop, I don't really know what the issue is. Try disabling shadows and distance fields on the meshes and see what happens.
    What about the shader? Is it just a flat color?
  • Dominic Sewell
    Options
    Offline / Send Message
    Dominic Sewell polycounter lvl 4
    @IacopoAntonelli Okay i think ive actually found the problem looking in shader complexity view im noticing the larger the building becomes the greater and greater the shader complexity gets.

    Turns out ive done some terrible scripting it seems and the for loops were effectively running on top of each other causing the same mesh to be placed on top of its self and that was increasing exponentially as the building got bigger.

    Ill have to sit down and go over my construction script again. (it is my very first time using it so i give myself a little leeway.)

    Thanks so much for the help.
  • IacopoAntonelli
    Options
    Offline / Send Message
    IacopoAntonelli polycounter lvl 3
    @IacopoAntonelli Okay i think ive actually found the problem looking in shader complexity view im noticing the larger the building becomes the greater and greater the shader complexity gets.

    Turns out ive done some terrible scripting it seems and the for loops were effectively running on top of each other causing the same mesh to be placed on top of its self and that was increasing exponentially as the building got bigger.

    Ill have to sit down and go over my construction script again. (it is my very first time using it so i give myself a little leeway.)

    Thanks so much for the help.
    You are welcome!
Sign In or Register to comment.