Observer Utility #846
Replies: 6 comments 1 reply
-
Can you give me an example of the uses of such a feature please, thanks! |
Beta Was this translation helpful? Give feedback.
-
Calculation of visibility is expensive if thousand/ ten thousand of object in one scene. So i want to implement a algorithm and run it. The algorithm purpose is for calculate all visibility of all object to others. So i want to run algorithm only right before the fishnet's observe system tick the visibility check that run ObserveCondition which i will implement lookup result in it. How can i achieve this?? |
Beta Was this translation helpful? Give feedback.
-
FishNet automatically load balances observer rebuilds so unless you're
noticing a performance loss it could be best to not do anything.
But...
we do have a grid condition which is less accurate than the distance
condition but considerably faster.
You can also make your own observer condition and run calculations on it
whenever you want, ultimately controlling how often expensive logic is run.
You can set priority on conditions as well so others can be checked first,
and if failing block others from being checked.
…On Wed, Feb 26, 2025, 8:44 AM LeThaiThinh18021228 ***@***.***> wrote:
Calculation of visibility is expensive if thousand/ ten thousand of object
in one scene. So i want to implement a algorithm and run it. The algorithm
purpose is for calculate all visibility of all object to others. So i want
to run algorithm only right before the fishnet's observe system tick the
visibility check that run ObserveCondition which i will implement lookup
result in it. How can i achieve this??
—
Reply to this email directly, view it on GitHub
<#846 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGPJC3T5MGS2NVNGREHDITT2RXANTAVCNFSM6AAAAABXLFQBTGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZSGYYTAOA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
How do you consider a object is interested to (need to transmit data to) other object? Did you iterate through each object m*n? (m is participant count, n is object count) |
Beta Was this translation helpful? Give feedback.
-
Objects only send data to connections in their Observers collection (NetworkObject.Observers). The observer system is what rebuilds observers. The observer system is designed to fail checks quick as possible. Timed checks, such as distances, iterate over-time; how fast they iterate is dependent on the number of objects, clients, so on. Non-timed checks only iterate when there is relevant change. For example, a distance check is timed because an objects distance will change regularly. A scene condition is only updated when the client changes scenes. Let's say you have multiple game scenes and you want clients to only see other clients in the same scene, as well within 100m. This means you would be using a scene condition, and some distance condition be it 'distance condition' or 'grid condition'. As mentioned when there are timed conditions the server will iterate over objects gradually to see if they can become visible for a client. When an object iterates the fastest failing condition is checked first, in this case the scene condition. Since scene conditions only update as needed this fail point is a very quick true/false check, and if false the distance calculation is skipped. The observer manager allows for customizing iteration timings. You can also modify the 'add order' on our conditions or your own should you make some. When conditions have a lower add order value they are checked first. If you write a custom condition that is super fast for example, unique to your project, you can set it's add order to be checked first and it will be the first point of failure. See your created conditions to modify add order. PS: timed conditions are always sorted after non-timed regardless of add order. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I have researched "Hierarchical sort-based parallel algorithm for dynamic interest matching", a state of the art interest matching algorithm theoretically. I just wonder is there any way to integrate with least overhead to your system as possible instead return result true/false to your exposed method. But nevermind, this topic can be closed now. Btw, you guy can consider apply the algorithm that i introduce as default observer condition, I will be glad to help you. Mine is 13.5ms for 2000 object(1000 AOI and 1000 AOE, corei7, 16 ram, 8 thread), is that good or bad result, do you guy have any measure for other algorithm(Bruteforce, grid, etc...)? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to implement a algorithm for calculate visibility for object observer right before observer manager check periodically. Is there any event/delegate i can add to? Can you add this feature if dont have yet
Beta Was this translation helpful? Give feedback.
All reactions