Hierechial Instanced Static Mesh Components not displaying properly in packagd project

So I am using hierarchical instanced static mesh components (HISMC) in my game to replace a bunch of objects in the city because there are a lot of street lamps, fence pieces, ect and lots of long street views where I need to show them. In editor, they work fantastically and just as I would expect.

However once I package out a build, I get incredibly weird behavior. I will walk down one street one direction and all the streetlamps are invisible, but banners on another HISMC setup are visible, then I walk back the other direction and all of them are visible. I go to a view where all of the pieces should be in view for 1 HISMC (A fence around a park), and none of them are rendered, but walk alongside in a particular direction and all of it is visible, turn back and none are. I walk down the street at one part that is lined with trees, I can see them in the distance, but as I get close they fade out of view.

I have 3 food carts that I loaded up all the different food items each in it’s own HISMC. 2 of the carts it all behaves buggy, 1 works perfectly fine.

I would have thought at first that this is all just because I am trying to use HISMC for all the items in the city (well right now it is only like a block so at most like 200 items in the biggest HISMC) and that I was in the middle so it was having issues calculating where to populate things (is it in view or not) but my park fence behaves odd even though the entirety is in view other than a few pieces blocked by trees which are not rendering.

It works perfect in the editor, but when I log into a multiplayer packaged build it behaves weirdly. The off occlusion is consistent thought, I can close it, open it again and get consistent results, even across multiple packaging attempts.

As a note, normal Instanced Static Meshes seem to work perfectly fine when I packaged them out, the only problem is none of it occludes out.

Hey NoahPsoih,

I created a small sample project that had hierarchical instanced static mesh components included. I did not notice any of them missing from the scene. Are you able to reproduce this in a new project? Can you reproduce this in 4.10? Did you create your project in another version of the engine and move it to 4.9 by any ?

Looking forward to hearing back from you, thanks!

Hello . We started the project in older versions of the engine and have been upgrading as our plugins have become compatible with the latest versions. Though we did recently migrate all of our project to a new source code built 4.9.2 engine version. Many of our plugins are not compatible with 4.10 yet so I cannot test my project in that.

Just to be clear I am not seeing the problem in editor or when launching as a standalone project from the editor. The graphical glitches seem to appear only in a Development WindowsNoEditor build for the client.

I checked to see if it was world composition, but that did not change anything turning it off. I have tried using my HIMC blueprints in the main level, sublevels and spread across them at the same time.

I did notice that when I launch both the server and client from Visual Studio I get a line [2015.11.16-23.24.20:861][ 0]LogStaticMesh:Warning: Rebuilding foliage, please resave map HierarchicalInstancedStaticMeshComponent /Game/Maps/MasterLevel.MasterLevel:PersistentLevel.InstanceStaticMeshPlacer_BP_302.HierarchicalInstancedStaticMesh.
for each of my HISM blueprints. Though I see no other references to the blueprints in the log.

Since I see this only in a build my Build settings are as follows:

Build:
Do you wish to build? yes
Build Configuration: Development
BuildUAT: no

Cook:
WindowsNoEditor
WindowsServer

Cooked Maps:
Main world composition level and all the sublevels that are relevant.
Server entry map
Client entry map

Release/DLC/Patching Settings:
Nothing filled out or checked
Advanced Settings:
Only cook modified content: checked
Compress content: checked
The rest unchecked

Package: Package & Store Locally
none of the other info filled out or checked

Deploy: Do Not Deploy

As a side note, I noticed that normal Instanced Static Mesh Components will only show up in world composition if they are in the main level and not in sublevels. Not sure if that has anything to do with this issue or not.

Ok, So I have done a little bit more testing. It seems that if the very first instance (0) is not in the camera frustum of being potentially view able, none of the instances will render at all. If it is, things still seem to occlude randomly, but at least im starting to make some sense of what is going on. Though is this intended behavior? I would imagine deciding to randomly occlude everything out just because 1 particular instance is not view able out of hundreds was not intended.

So, update. I managed to force it display the meshes without occlusion freaking out. I had to regenerate them on a .2s delay after begin play. The problem now, though, is that they are rendering with exceptionally weird lighting artifacts, both when they are dynamic and static objects it appears as though they have 1 lightmap that is being repeated across all of the meshes and that one is incredibly splotchy and makes no sense even on the main one.

Hey Noah,

Thank you for providing me with these updates. Could you please upload some additional information about what you’re seeing with your project, or provide me a sample project to test on?

Hey . Sorry it took so long to respond, was not able to get into office to grab some screenshots due to holidays.

So here are 2 photos, the first one is straight from the editor just looking at some of the pieces.

The second image is from when I hit play. They are now rebuilt on begin play (same results if I add a delay or not). You can see in it the weird shadows and how they replicate.

The fence is actually 2 parts repeated over and over. The post and the middle section. On the bad one you can see the weird lighting is being replicated across each piece as on all the others.

I would have expected it to either treat them as no lighting built so cast dynamic shadows, use the 1st pieces lightmap and repeat it, or to use the old lightmaps since locations are not actually changing. It also does not add the objects to the unbuilt lighting list.

It seems lighting them dynamically dosnt show the artifacts, I guess when I built I might have forgotten to save the changes. However I cannot light my scene with all of these objects as dynamic, it will be way too expensive.

Here is an image of my blueprint, though im not sure of any setting that would be causing this.

I hope this can help. Let me know if you need any shots of anything in particular.

Hi Noah -

asked me to take a look at this as I am more familiar with HISM components. First there is a limitation with HISM components that they cannot be lit with Static Lights. They were primarily developed for large open world landscapes and are meant to be used with Stationary and Movable lights. This is why you are getting the shading errors when you build lighting.

I need to know how you have your cullling and material setup for your HISM to help with your original question. It sounds like there is an issue with either bounds being too small for the meshes themselves or culling happening at incorrect distances.

If you can let me know about those settings.

Thank You

Ketchum

Hi Ketchum, Good to know about the static lighting limitation, I guess that makes sense. Did I miss that in the documentation? Might I suggest a tool tip pointing that out since it seems to be able to build lighting fine the first time?

My project culling settings are set to defaults.

I have a CullDistanceVolume in my level that is disabled, here are the settings anyways in case for whatever reason it got turned on (Size,Cull Distance): Element 1 (100,500) Element 2 (200,1000) Element 3 (500,0)

on the actual HISM blueprint I have tried a variety of Start and End Cull Distance values ranging from all zeros to a start of zero and an end of 10000, the reverse of that and both at 10000 all yielding the same results.

The odd thing is that regenerating them all at runtime seems to make it work, but having them built in the construction script does not. Though building in the construction script seems to allow static lighting to build no problem and looks beautiful. It also is only a problem once it is built out and packaged, well the lighting breaks on a rebuild in editor.

Let me know if I can give any more information to help, and thanks for looking into this for me.

So I am recreating your blueprint and have got the Construct function enabled, but can you share what the Event Graph and Construction Script are doing in the Blueprint you mention above. Also is this BP duplicated in your level for each type of World object you want to lay down?

Thank You

Ketchum

The construction script and begin play event just immediately call the construct function. And yes, I am duplicating the blueprint to handle all different objects to fences, park benches, trashcans, ect.

Thank you for that quick reply. I was able to get the project working as you intended but I still think I might be missing a piece of your setup. I put together a test project attached below, can you take a look at it and see if it is functioning for your as intended after packaging.

Ketchum

[Test Project 4.9.2][1]

69071-hism_test.zip (360 KB)

It looks like mine and seems to be working properly just making a packaged version in standard 4.9.2.

I am guessing something odd is happening in our custom code, though I honestly have no clue what would cause the issue to begin with, much less why rebuilding it on begin play suddenly makes it work.

At any rate, Running the construction script on Begin play makes it work and knowing it is not setup for static lighting helps a lot. I’ll just look into converting our scene into a dynamic one and hopefully I can do it without too much of a performance/appearance hit.

Thanks for the assistance.