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"

UpdateInstanceTransform() messes up Per Instance Random

Calls to UInstancedStaticMesh::UpdateInstanceTransform() causes the instance to get assigned a new "per instance random value" inside FStaticMeshInstanceBuffer::UpdateInstanceData(). Was not an issue in 4.16.

Product Version: UE 4.17
Tags:
more ▼

asked Oct 02 '17 at 10:10 PM in Bug Reports

avatar image

HeartMachine
26 3 5

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Can someone please fix this! It is still broken in 4.19. I am trying to sell an asset on the Marketplace which requires this to be fixed.

more ▼

answered Mar 22 '18 at 03:19 AM

avatar image

Davis3D
76 2 8 11

avatar image Michel.Dupuis STAFF Mar 22 '18 at 03:19 PM

Can you provide some context on your issue? How are you using the system, etc..

Thanks

avatar image Davis3D Mar 23 '18 at 06:53 AM

I am using the HISM system. I update each Instances Transform every tick to animate along a spline.

There are two bugs i have run into. If I manually create instances within the HISM system, there appears to be twice the amount of instances when the level starts. If I manually add 10, i play the level and there are now 20. I can solve this by removing the additional instances upon Begin Play.

The other issue is that the PerInstanceRandom value seems to randomly change. I have created a demonstration project for you to check here.

Download Example Project

The project contains a bunch of spheres that move along a spline. Each of the spheres has a color which is set by the PerInstanceRandom node. The sphere's randomly change colors when they should not. There are two possible causes: Either the spheres are switching places, or the PerInstanceRandom node is changing value. I have proven that the spheres do not switch places by providing their locations in Print String.

You can see all of this with documentation inside the project I have provided.

avatar image Michel.Dupuis STAFF Mar 23 '18 at 02:59 PM

Hi i'm currently looking at your sample, and see your using HISMC. You realized that in the case of your sample it's really not an optimal way of achieving what you want do to right? You should really use the ISMC (it wont solve your issues, it's simply really not optimal performance wise what you're doing). Considering also that instance order is not guaranteed using HISMC, if you perform add/remove operation and that EVERY frame right now you rebuild the cluster tree (spatial organization tree 20 times)...

P.S when loading your data you really have 20 instances added and saved.

10 in the BP which got transferred to your instance(normal behavior), AND 10 added into your instance also. Care to explain if you perform this manually or what you did to achieved this?

See the screenshot: alt text

bug.png (340.6 kB)
avatar image Michel.Dupuis STAFF Mar 23 '18 at 03:37 PM

So after more investigating, if you use an ISMC there is no bug, all is working fine, except that in your Update Instance Transform you should set Mark Render State Dirty to true on the last one, to force the refresh of the Render state.

As for the problem when using HISMC, the thing with HISMC is that it will reorder instances for visibility culling/occlusion, which mean changing physically the place of instances in the buffer, which give the visual issue you're seeing, i'll investigate some more if there could not be an issue there, but unless the test project really do not match what your do in your actual project, i see really no reason for you to use an HISMC, it's more costly and do not do the behavior you want to do.

Unless you have +1000-2000 instances HISMC do not make sense to use at all.

avatar image Davis3D Mar 24 '18 at 03:35 PM

Hi Michael, thank you so much for your help on this issue! I did originally plan on using over 1000 instances with the blueprint, as I have created a "Fish School System" which can be used for virtually any swimming sea life, including thousands of jellyfish. It was working perfectly with HISMC's in Unreal 4.16, but the upgrade to 4.17 broke it. Its a bit annoying that I cannot sell it on the marketplace for previous engine versions (as this would include the majority of my sales), but I am glad that can at least publish it for the latest engine version, and include it in the game I am working on. Again, thank you! You've saved my entire week of work from being wasted.

avatar image siditious Jun 24 '18 at 03:11 AM

Hi there, I just ran into this problem myself and I understand why it's happening, but really hope it can be fixed. HISM's are vital for my project and adding an instance makes a complete mess on screen. Thanks for your help!

avatar image Michel.Dupuis STAFF Jun 26 '18 at 11:36 AM

Hi, can you provide some context on your usage? What is your setup?

Thanks

(comments are locked)
10|2000 characters needed characters left

This will be fixed in 4.19. Sorry for the delay but to fix it, it end up changing some interface, which mean it can't go into 4.18.X

more ▼

answered Oct 04 '17 at 04:05 PM

avatar image

Michel.Dupuis STAFF
140 2 4 4

avatar image HeartMachine Oct 11 '17 at 12:08 AM

NOT CONFIRMED: still seeing the problem in 4.17.2

avatar image fsk Nov 01 '17 at 05:14 PM

Same problem here. not fixed in 4.17.2 or 4.18...

avatar image DarthSomebody Nov 04 '17 at 02:22 AM

This is frustrating. I really need this feature, too. This is preventing me from upgrading to 4.17 or 4.18. I had to go back to 4.16.

avatar image gstyczen Nov 27 '17 at 07:32 PM

Also waiting for this. Wish there was a way to manually set per instance random value in CPP or something.

avatar image Jarod.Pranno Dec 02 '18 at 09:15 PM

Is there a CL# for this fix? Our project is going to ship with 4.18 but I could really use this

(comments are locked)
10|2000 characters needed characters left
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