x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Bug] Instanced Static Mesh Component is broken in 4.17.1

At least RemoveInstance function is buggy, but it looks like an internal problem with indices, so other functionality may be affected as well.

Problem: when you RemoveInstance at some index, other mesh instances disappear as well. If you continue deleting mesh instances one at a time, mesh instances will (seemingly) chaotically reappear and disappear again.

Repro steps:

1) Download attached test project;

2) Open, start the game and press F (should delete mesh instance at 0 index);

3) Both 0th and 4th mesh instances disappear;

4) Keep pressing F to observe chaos.

Notes: mesh instances are added in object's constructions script. F key is bound in level blueprint.

Product Version: UE 4.17
Tags:
test.zip (190.7 kB)
more ▼

asked Sep 08 '17 at 10:42 PM in Blueprint Scripting

avatar image

Flashback
91 2 6 9

avatar image Jamendxman3 Sep 10 '17 at 05:19 AM

Same here. I have a project where my level is made up of square tiles, and depending on the type of tile, it uses a different component. I setup a test where it removes the 5th instance when I press the space bar. What happens the first time I press space bar is it removes the 5th instance, as well as the last instance. Any subsequent space bar presses just removes the last instance over and over again. Oddly enough, the 'Get Instance Count' function will go down by 1 with each press, despite the first press removing 2.

avatar image Akyton Dec 08 '17 at 10:02 PM

Hey, just so everyone in this thread knows, this bug persists from 4.17 to 4.18.2 and is now properly classified as an issue in the bug tracker here: https://issues.unrealengine.com/issue/UE-53053

avatar image OverRated_AU Dec 27 '17 at 04:54 PM

The funny thing is it was fixed in 4.18 now it looks like the issue is back again in 4.18.2.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi Michel,

I'm also facing big issues with ISM since 4.17, very similar to what Flashback describes. I'm now working on UE 4.17.2, and trying potential new fixes when I see one popping. So today I integrated your commit 3664690 related to the issue UE-49757 hoping it will solve my problems, but it didn't. Before it was chaos, like Flashback explained, but now it's still chaos, plus it asserts here: - Function: void FStaticMeshInstanceBuffer::UpdateInstanceData(UInstancedStaticMeshComponent* InComponent, const TArray >& InHitProxies, int32 UpdateInstanceStartingIndex, int32 UpdateInstanceIndexCount) - Assert: check(DestInstanceIndex != INDEX_NONE);

To the others who have issues with ISM: Could you try integrating this commit to see if it fixes your issues?

I'm using ISM components created at runtime like this (btw, see comment at the last line):

 ISMComponent = NewObject<UInstancedStaticMeshComponent>(this);
 ISMComponent->SetupAttachment(Center);
 ISMComponent->RegisterComponent();
 ISMComponent->SetStaticMesh(ISMStaticMesh);
 ISMComponent->InitPerInstanceRenderData();       // Had to add this here otherwise it crashed later

And then, in the Tick of my actor, I'm calling a lot of AddInstance and RemoveInstance on them within the same frame (order and number of times of these calls vary). Apparently, everything is fine when only AddInstance are called, But when both RemoveInstance and AddInstance are called, it asserts.

The repro is simple:

  1. Create an Actor class in C++ 2)

  2. In BeginPlay, create an UInstancedStaticMeshComponent (see code above)

  3. In Tick, randomly call both RemoveInstance and AddInstance several times in various orders

  4. Observe the assertion

Please give it a try.

Thanks

more ▼

answered Oct 08 '17 at 10:15 AM

avatar image

Steeve Kilhoffer
79 2 6 13

avatar image Michel.Dupuis STAFF Oct 11 '17 at 11:19 AM

HI Steeve, can you try with 4.18 Preview 3 with no code changes on your part touching this engine code, and let me know if you still have issues?

Thanks.

avatar image Steeve Kilhoffer Nov 17 '17 at 11:02 AM

Hi Michel, sorry for not replying earlier. I finally upgraded to 4.18.1. No more crash. So that's a relief. I also fixed my bug causing instances to be at wrong positions. I was previously using the Instance Indexes to update only the instances that I had to move (by saving the index when I added the instance and removing this instance by its save index), but apparently these indexes are not reliable when you start removing some of the instances (I remember I read other threads about this). In the end I decided to clear all instances and re-add them every time I need to move them.

avatar image Michel.Dupuis STAFF Nov 17 '17 at 12:46 PM

HI Steeve,

Glad it's finally working for you. As for instance index, the value should be usable for the duration of the game, as for saving the value to restore a state, you should also be able to use the index, unless there is something i'm not thinking (it's been a few weeks i haven't look at this code ;) ) As for updating only changed/moved index, keep in mind part of the refactor that i did was exactly for this, as before it was always recreating everything from scratch when updating.

Let me know if you have some questions.

avatar image Steeve Kilhoffer Nov 17 '17 at 12:50 PM

Thanks for the details. It's all good on my side. Clearing and re-adding instances doesn't seem to be too heavy. Thanks again for the follow up :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Flashback,

Thanks for your sample to repro the bug, i'll see what i can do to have a fix for 4.18, as the delay for 4.17.2 is expired.

more ▼

answered Sep 11 '17 at 07:51 PM

avatar image

Michel.Dupuis STAFF
140 2 4 4

avatar image Flashback Sep 12 '17 at 01:02 AM

Great, thanks! This functionality is already in use in our project, would be great to have it back soon.

avatar image BPANDREW Sep 14 '17 at 11:29 AM

I think there is an out of bounds error in there somewhere too, in 4.16.x I'd get it now and then working with static instances a lot

avatar image Michel.Dupuis STAFF Sep 14 '17 at 11:42 AM

Can you provide a callstack of the issue you're describing?

Thanks

avatar image zEh- Sep 14 '17 at 11:35 AM

Updates on this? I'm relying on ISMs in my project aswell. This is a blocking bug for us.

avatar image Michel.Dupuis STAFF Sep 14 '17 at 11:43 AM

As i said in the initial answer, it will be included in 4.18.

avatar image poke1103 Sep 14 '17 at 07:49 PM

Is there an intended release date for 4.18?

avatar image poke1103 Sep 17 '17 at 11:29 PM

I know you don't read your messages but I just tried 4.18 and it does not have this fixed in your 4.18 staging build. Hopefully the developer preview will be different.

avatar image Jamendxman3 Sep 17 '17 at 11:46 PM

As I'm understanding it, Instanced Static Meshes will be pretty much unusable for all of 4.17? That is unfortunate.

avatar image zEh- Sep 18 '17 at 08:39 AM

When you're relying on removing instances... yeah. There is also this in HISM: https://issues.unrealengine.com/issue/UE-40693

avatar image superdreamgen Jan 01 '18 at 03:22 AM

I don't believe that one is actually a bug, zEh-, please see my answer here: https://answers.unrealengine.com/questions/549119/hierarchical-instanced-static-mesh-component-bugg.html?childToView=741880#answer-741880

The bug outlined in this thread here though is absolutely killing my project. -_-

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question