#Hybrid interop
1 messages ยท Page 1 of 1 (latest)
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.
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)
Can u tell me more about it? Do u mean u put game object guid into subscene then use tat guid to instantiate game object at runtime?
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
then instantiate it at runtime
and I have another system users can implement to automatically bind new components to the entity from the prefab if they aren't in my default list of bindings
I see. Seems like this solution can't solve my content delivery use case. Actually what I want is split art asset out of player runtime build. That's why I'm using addressables.
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
i hope (well expect) at some point we'll be able to deliver content via subscenes which would be pretty nice - they seem to be doing a lot of work in this area
@slim smelt would you be willing to share this whole solution as a zip (not sure if anything is missing)?
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
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
oops forgot you'll also need the baking script
i have a day off tomorrow and this is on my todo list to investigate as I update this library
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!
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)
thank you! ๐
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 ๐ ?
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
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 ๐ )