#Hybrid interop

1 messages ยท Page 1 of 1 (latest)

ornate wraith
#

For hybrid interop, I afraid it will become another mess if official didn't solve it properly earlier about content delivery use case for production dots project i.e. the setup for dots addressable for entity, subscene and addressables for classic game object, classic scene. From a official reply, dots addressable will not support instantiate game object. Does it means I really need to maintain 2 of them meaning 2 settings for both dots addressable and addressables? I dun think it's really good idea to maintain 2 systems for content delivery.

slim smelt
#

From a official reply, dots addressable will not support instantiate game object.
gameobjects can still be referenced inside a subscene

#

and this is how I handle it for now

#

i like the idea that from a users perspective is there is no difference between a hybrid gameobject and entity

#

so i even hide hybrid gameobjects in the inspector (though random note, dots hierarchy does not seem to respect those flags)

#

(that all said I definitely agree with you on official solution would be nice so don't have to do all the work on my own solution just to replace it eventually)

ornate wraith
slim smelt
#

my implementation is actually very simple

#
    /// <remarks>
    /// This component only exists for one frame and is removed after the prefab has been instantiated and replaced with <see cref="HybridCleanup"/>.
    /// </remarks>
    public class HybridComponent : IComponentData
    {
        public GameObject Prefab;
        public CopyModes CopyMode;
    }

    /// <summary>
    /// State component with the game object instance that might need cleaning up.
    /// </summary>
    /// <remarks>
    /// Ideally we would not need this component and would use <see cref="HybridComponent"/> only but SystemState components can't be saved in sub scenes.
    /// </remarks>
    public class HybridCleanup : ICleanupComponentData
    {
        public GameObject Value;
    }```
#

i simply store the gameobject on a class component

ornate wraith
slim smelt
#

yeah if you want content delivery i would change the prefab into an addressable key

#

and do a similar thing personally

#

but i haven't explored this that much as it's not a requirement for me atm

slim smelt
timber veldt
#

@slim smelt would you be willing to share this whole solution as a zip (not sure if anything is missing)?

slim smelt
#

looking at the usings i dont think anything is missing

#

that said, while updated to 1.0 i haven't tested this yet

#

still in progress of updating this specific library

#

oh wait it's probably missing the copyentitytotransform stuff now

#

as that was removed from entities

#

and i had to add it back (i haven't decided if it'll stick around or i'll find an alternative solution, again i'm still mid updating this library and redoing my entire game library with netcode changes)

#

from a very quick look
HybridDecoratorSystemGroup
seems to have a bad reference to netcode that'll need to be removed if you don't use it

#

also it seems to be incorrectly added to thin client world

timber veldt
#

Thanks so much man, I really appreciate it ๐Ÿ˜„
This hybrid stuff is messin with me in 1.0, hoping your solution will get me on the right track

slim smelt
#

i have a day off tomorrow and this is on my todo list to investigate as I update this library

worthy siren
#

hey, what is this part for?

    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation,
        WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation)]

I have trouble finding more info on that and it causes the system not to run for me (so I commented it out for now)
btw, thanks for posting all this @slim smelt!

slim smelt
#

I only need this on clients in netcode so this stops it being added to the server

#

If you're not using netcode then you can just remove it or you probably want to include local simulation group or maybe presentation instead

#

I think I've update it locally since I posted this (also removed thin clients)

worthy siren
#

thank you! ๐Ÿ™

low saffron
# slim smelt ``` /// <summary> A game object with life cycle managed for you automatically...

Thank you so much for sharing your solution, as it seems unity will not provide any default way to handle hybrid components in the near term, it would be great if yours would be in a git repo (either on gitlab or github).

As it is a real timesaver and would help so many others to bridge that gap (for particle systems, audio, animation etc. etc.).

Any chance that would be possible, maybe for ๐ŸŽ„ ?

slim smelt
#

What's interesting is unity netcode implemented a very similar solution

#

So if you use netcode you no longer need this

#

They even have animation support via playables

#

Anyway as for your question, it's currently part of a like, full framework library that is not ready for public use unfortunately as its still going under heavy refactors

low saffron
#

Maybe also sharing it on the official forums would be useful?

Its easily gets lots here on discord, and I think many would benefit from it (especially because it is done in a very high quality way, and most other solutions online do it, lets say less performant ๐Ÿ˜‰ )