dugasz1

Collision shapes

Recommended Posts

Hello!
So, i would like to use a lot of collision shape for interactions (i don't like click on things). And my question is will it cause fps drops or low fps for the clients? I never used that much collision shapes. Any suggestion or experience?

I don't know now how many col shape will be exactly. Let's say 5000 or 10000

Edited by dugasz1

Share this post


Link to post

Best way to check; make them see if it lags. If it does there's ways to preventing that such as removing the col shapes that are to far away and creating / removing them on the fly.

Share this post


Link to post

Well, i looped throught 10 000:


for i=1,2500 do
    createColSphere(2496 + i,-1670,13, 2)
end
for i=1,2500 do
    createColSphere(2496 - i,-1670,13, 2)
end
for i=1,2500 do
    createColSphere(2496,-1670 + i,13, 2)
end
for i=1,2500 do
    createColSphere(2496,-1670 - i,13, 2)
end

And it's looks fine, uses ~0,25% CPU and 125kB memory (according to performancebrowser resource)
So, i guess it's will be oky?

Share this post


Link to post

For what purpose so many colshapes?

Is it serverside? Because for every time you enter/exit an colshape, you will be sending this information to the server.

Also, colshapes are elements, your players might load less objects of custom maps, because of the streaming engine.

 

It will be ok because of the streaming engine(if colshapes can be streamed out???), but there is an 'impact' in your server. You will have to test it with multiple clients.

 

  • Like 1

Share this post


Link to post

I will use them to everything. Interacting with the 3d world for example if there is an atm, you don't need to click to the atm.

If the col shape created on server side the client will send infromation to the server when he/she hit/leave it? 
So if i don't want this unnecessary data transfer i should create them on client?

Share this post


Link to post

1.Im pretty sure even 100000 collision shapes would not make your server/client lag.

2.If my logic serves me right. Collision shapes created on a client will trigger handler (callback) only on client side. And collisions created on server side only handler on a server. Since player has to send his information like position every few milliseconds to server server, server can perform its own check on server side so i dont think there would be additional data transfer.

Also sending information from client to server about triggering something does not make server eat all the network speed. Problems are syncing things like position, animation, speed, camera...Things that are sent each few milliseconds. Calling a simple trigger can not impact on any server with a decent network speed, specially since its download and not upload.

  • Like 1

Share this post


Link to post

Ohh i missunderstood something about the concept of col shapes.
It makes more sense then what i tought.

Thanks for the answers.

Share this post


Link to post

You can't delete serverside-colshapes clientside. (but you can do that with objects/markers and some other elements)  Try it yourself.

Which means that serverside is most likely relying partly on clientside detection too.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.