18-11-2022, 03:05 AM
I am developing a server auth multiplayer game and I need to send rope data to clients to render the rope locally, is this possible?
Can you read and set rope data? for multiplayer purposes.
|
18-11-2022, 03:05 AM
I am developing a server auth multiplayer game and I need to send rope data to clients to render the rope locally, is this possible?
18-11-2022, 08:31 AM
(18-11-2022, 03:05 AM)Milionario Wrote: I am developing a server auth multiplayer game and I need to send rope data to clients to render the rope locally, is this possible? Hi there, Yes it's possible, you can read and write all per-particle properties at runtime. See the scripting section of the manual: http://obi.virtualmethodstudio.com/manua...icles.html Your server should send "snapshots" of the rope as an array of particle positions and velocities. Each time the clients receive the snapshot, write these into their solver data arrays to sync the simulation. kind regards,
18-11-2022, 01:51 PM
(18-11-2022, 08:31 AM)josemendez Wrote: Hi there, Thanks How many particles are there per meter of rope?
18-11-2022, 01:53 PM
(This post was last modified: 18-11-2022, 01:54 PM by josemendez.)
(18-11-2022, 01:51 PM)Milionario Wrote: Thanks That's completely up to you. It's determined by the blueprint's "resolution" and "thickness" parameters. Thinner, higher resolution particles have more particles per length unit. See: http://obi.virtualmethodstudio.com/manua...setup.html kind regards,
22-11-2022, 04:17 PM
(22-11-2022, 04:12 PM)Milionario Wrote: How do i turn off the simulation on the client? I am setting the positions for the rope but it looks like its trying to simulate at the same time Hi! You can disable the solver component. Note that for networking purposes, you typically wouldn't want to disable simulation, as that will result in choppy behavior when network snapshots do not arrive in a timely manner. You'd want to use dead reckoning, a simple way of doing this is set particle positions and velocities, and allow the client to simulate until a new snapshot arrives.
22-11-2022, 04:24 PM
(22-11-2022, 04:17 PM)josemendez Wrote: Hi!I deleted the post because the problem was that i was setting the positions somewhere else instead of fixed update
22-11-2022, 07:24 PM
Disabling either the rope or solver makes the rope stop working.
I just want to be able to render the rope on the client side as it was sent from the server, steps to do this? Currently I am applying the rope data on FixedUpdate Code: private void FixedUpdate() receivedList is a list of rope positions sent by the server, it syncs fine until i deactivate the solver
22-11-2022, 07:49 PM
(22-11-2022, 07:24 PM)Milionario Wrote: Disabling either the rope or solver makes the rope stop working. Oh ok, in that case you can set the particles’ inverse mass to zero, by writing into the solver.invMasses array. This gives them infinite mass and they won’t have any dynamics applied to them.
23-11-2022, 03:02 AM
(This post was last modified: 23-11-2022, 03:04 AM by Milionario.)
(22-11-2022, 07:49 PM)josemendez Wrote: Oh ok, in that case you can set the particles’ inverse mass to zero, by writing into the solver.invMasses array. This gives them infinite mass and they won’t have any dynamics applied to them. I probably wasn't clear enough, I am saying that if I disable the solver on the client side, the rope doesn't change despite setting its positions like this Code: ropeActor.solver.positions[ropeActor.GetParticleRuntimeIndex(i)] = receivedList[i]; I suspect I need to call some solver's update method manually after setting particles positions?
23-11-2022, 07:57 AM
(23-11-2022, 03:02 AM)Milionario Wrote: I probably wasn't clear enough, I am saying that if I disable the solver on the client side, the rope doesn't change despite setting its positions like this My apologies, I was the one not being clear enough. If you want particles to get updated and rendered, but don't want the simulation to affect them, you must keep the solver enabled, but set particle inverse masses to zero (see "Inverse mass" in the list of exposed particle properties: http://obi.virtualmethodstudio.com/manua...icles.html) Altenatively, you can extend ObiUpdater to create your own updating component, and skip calling BeginStep/Substep/EndStep in it (search the API docs for "ObiUpdater": http://obi.virtualmethodstudio.com/api.html) let me know if you need further help with this, and I'll write an example for you. kind regards, |
« Next Oldest | Next Newest »
|