Prefab Instance Duplication & Tag Overwritting

   2220   5   0
User Avatar
Member
7 posts
Joined: Dec. 2020
Offline
So over the past few days I wanted to improve my level design system in a Unity game project to better handle faster iteration by letting me either design it with a closed curve or generate it from an input PSD file.

While most issues are now dealt with there are two that still persist that are quite annoying and slightly hinder the otherwise fast turnaround of the new system.

The first issue is that all Houdini instantiated prefabs seem to be duplicated, the first one with correct orientation and the second without any orientation applied. I did check the change log prior to this and noticed that on the 13th a fix for something quite similar to my issue has been pushed, but at this time it doesn't seem the Steam Houdini daily beta branch has that implemented. Deleting the duplicates is not too much of a hassle and a script could be written to handle that automatically, but it really becomes an issue when modifying float parameters as each change causes it to return.

If the only solution is to wait for the fix to be properly released, then I guess that's just how it is. However, I am attempting to record and demo the solution somewhat soon and would like to get this dealt with sooner rather than later.

The second issue is more likely not bug related. I noticed that all my Houdini instantiated prefab's and their children's tags are being overwritten and forced to "Untagged" which is often breaking some of the automation in my game's systems. I understand that I can use the "unity_tag" attribute to force houdini instantiated geometry/prefabs to take a tag in Unity, however I need one specific child gameobject to have a tag and setting the tag via attribute would cause the same kind of issue.

I'm mostly hoping there is a solution to this that would not require additional changes in Unity, such as creating a script to force the attached game object to a certain tag, as this is just another thing to keep track of when designing or handing the tool over to another developer.

I've included the hda file for the project to help ease the explanation of what I'm doing.
Thanks a bunch to anyone with some insight on solutions to these issues

Attachments:
unknown.png (419.2 KB)
zd_level_generator.hdalc (148.1 KB)

User Avatar
Member
100 posts
Joined: Dec. 2020
Offline
For the first issue, I believe that it should have been fixed in Houdini 18.5.638. If the Steam build is not updating with the version, let me know.

For the second issue, the generated objects should take the flags of the HDA root. As you said, you can also add in the attributes manually to override it. In Houdini 18.5.610, I added an attribute where you can use the attribute "unity_use_instance_flags", which uses the flags of the unity_instance instead.

Let me know if this answered your questions.
User Avatar
Member
7 posts
Joined: Dec. 2020
Offline
Updating and adding that attribute worked like a charm for allowing tags to remain on the instances, and updating now prevents the duplication of instanced prefabs!

The one issue I'm now running into since updating is all of my instanced prefabs no longer orient correctly to their values in Houdini Engine, which is a tad peculiar. Prior it generated one set that was oriented correctly and then an additional duplicated set that was not.

I'm unsure how to proceed from this, but am happy to at least have taken two steps forwards and only one back.
User Avatar
Member
100 posts
Joined: Dec. 2020
Offline
Can you send your updated HDA that showcases the prefabs not oriented correctly upon instancing? I can take a look.
User Avatar
Member
7 posts
Joined: Dec. 2020
Offline
Can do, I've attached the HDA to this post.

Thank you for taking a look!

My main focus is on the image-generated path, however the issue is in both as of now.

Attachments:
zd_level_generator.hdalc (148.3 KB)

User Avatar
Member
7 posts
Joined: Dec. 2020
Offline
I've attempted just recreating parts of the graph and using alternative approaches to the same things however, I've not have any luck getting things working.

I'm hoping to use this as a portfolio piece, so if anyone has any guesses I could try out to get this working, please do comment them and I'll take a few swings.

EDIT:

Aight, took a bit more stabbing around and found a way to get the instances orienting properly by just exporting the instance points.
However, the issue there is that I need to export the base geometry as well.

What I was doing prior was merging the level geometry and the points that were to instance Unity prefabs together before outputting. However, it seems that breaks everything. I'm going to play around more, but I'm not sure of the most simple workaround.

EDIT 2.0:

I've decided to go for breaking the HDA out into two geometry nodes. I was being too naive with my approach, and knew so from early one. However without much to go on as reference I just figured Houdini sorted out what points were for instancing and separated them from the Geometry, which is a self assumption I really should have taken a little more time to ponder.

So now that the instancing and the level geo are separated all's working perfectly well and dandy. I hope if anyone ever bumps into this thread with a similar issue they can learn from my mistakes
Edited by Zombiedance - Aug. 21, 2021 09:09:39
  • Quick Links