#Unity Physic Seperation Between Group Of Objects

1 messages · Page 1 of 1 (latest)

orchid briar
#

Greetings,

I have a few questions on the Unity phyisc engine.
What I want to do is I have a unity server in which the players will have rooms, I will run a phsic simulation for each match room, but I want to do it in an optimized way.

PHYSIC SCENE ITERATION
First of all, the steps I tried were to create a PhysicScene for each room, but I think it uses one thread for each physic scene, even if the rooms are empty, the server loses a lot of performance when I open 100 physic scenes.

SINGLE SCENE - DISTANCE BASED
I tried to do it separately in a single scene.
Imagine a square spiral, I think to put the objects of the rooms at equal distances from each other, so I aim to get rid of the physic Broadphase phase of Unity.

I think if there is an optimized distance between each room, they will not calculate with each other.

LAYER BASED
I thought about Layer Based Separation where the maximum number of layers limits me.
I thought to turn off the physic between layers for each room, but this is useless when the number of rooms increases.

There is an API like ignoreCollision in Unity for colliders, I guess there is nothing similar to this for physic, just simulate certain objects with certain objects or I could not find a piece of code that I could simulate them manually.

Does anyone have any suggestions, investigating a similar situation?

mellow anvil
orchid briar
#

Each room has 10 physic object limit i am trying to do a online game can have multiple rooms for example each room has 2 player , 10 object limit if 1000 player has playing simultaneously 500 room created and max 5000 object iterating in server same time.

How can I turn off the physic between them without using extra physics scenes? When I set up a server for each room, the CPU usage high even when the server is idle on Windows.

mellow anvil
astral vine
#

Is a "room" like one game/lobby?

fossil urchin
#

you can create multiple physics worlds if you want

#

they will not execute concurrently though.