Coder Social home page Coder Social logo

Comments (9)

huwb avatar huwb commented on May 20, 2024 1

There is some evidence from only THIRTEEN YEARS ago that just doing a FindObjectsWithTag may not be as bad as it sounds, in practice (which would remove the state that needs to be maintained). It seems to be efficient provided you don't use tags for too many GOs, which he suggests people typically dont. Do you use tags much in your projects?

https://forum.unity.com/threads/findgameobjectswithtag-efficiency.3612/

from crest.

huwb avatar huwb commented on May 20, 2024 1

Ok i'm being much more sensitive to the layer situation now on latest/master. It only throws errors if the layer is missing and actually required in the scene.

I also removed the Terrain layer which renders the sea floor height - I know of at least one team that is just rendering Default layer geometry into this, and this works for the example scene, so I'm going with this too.

That means that the main scene in the example content only requires 2 layers - for the animated waves and for the foam (the ocean uses the Water layer but this is built-in and the right layer for the job).

While I think it would be possible to explore some stuff we discussed above (switching to tags for instance), I don't currently have plans to do so and don't see a very clear/easy path to doing so, and will therefore close this issue for now. If you have thoughts, let me know.

( @holdingjason @dizzy2003 )

from crest.

gamemachine avatar gamemachine commented on May 20, 2024

Saw the ocean needs a layer also. That's 5 layers now.

from crest.

huwb avatar huwb commented on May 20, 2024

Yeah, this comes up now and then, theres another team in a similar situation and I'm becoming increasingly aware of the squeeze. It's a shame that the number of layers is so small, and that physics and rendering share layers. But thats the constraints we have i guess!

It's there for flexibility so you can assign the layer to whatever objects you want to render into the various data like water shape, foam, dynamic sim, etc. If you're not using any of these you can probably remove the relevant layer (i've not done a huge amount testing in this direction so it might need one or two things unpicked but it should be easy to make it work with only the layers you want/need).

However I get the point and this kind of functionality could perhaps be achieved using tags. Scriptable render pipelines may change this up as well, which is something i plan to do research into soon. I'll leave this open and post back when i have any thoughts or progress, or perhaps someone else looks at it in the meantime.

from crest.

gamemachine avatar gamemachine commented on May 20, 2024

Ya layer design sucks but I don't see it changing anytime soon.

Off the top of my head I'm thinking something like the Unity navmesh system does. Have the systems in question take a list of source objects. Be it bounds, meshes, whatever it is they actually need to know about. Then you can build whatever higher level abstractions you want. Tags seem like a good default choice there. Teams like mine would prefer to just build the collections from existing logic that we have.

from crest.

huwb avatar huwb commented on May 20, 2024

Yeah im thinking along the same lines.. In my past experience I haven't loved doing this kind of thing because theres the state to manage/update when new objects get created, and when stuff gets destroyed you dont want to hang on to references and prevent stuff getting GC'd. Or maybe im making a mountain out of a mole hill. I'll put it on my list to experiment with this stuff soon and find a nice pattern.

from crest.

gamemachine avatar gamemachine commented on May 20, 2024

I think it would involve more work then appears at first glance. It also looks like it wouldn't be too much work to just add work arounds where needed per project until a better overall solution hits. Big picture I don't see this as a show stopper for real teams.

from crest.

gamemachine avatar gamemachine commented on May 20, 2024

I mostly see tags used by third party assets. They do seem like an ok integration point assuming that in context they won't be a performance issue. And they aren't a limited resource which is a big plus.

One potential downside I guess is stuff created at runtime. And I say potential just because I have no idea of the possible issues there not having used tags in a long time.

from crest.

huwb avatar huwb commented on May 20, 2024

In preparation for a new release i've just gone through the initial setup thing with the layers and its clearly demanding layers that are not necessarily needed (like the dynamic wave sim layer even when the sim is disabled), so i'll look at addressing this.

from crest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.