Hi all!
I made BP to replicate this on all client. Made script for taking damage:
Ran game in 2 windows ( first- server, second- client1):
And when i shot, i saw next things:
Why ApplyDamage dont replicate on client?
During the tests sometime on client destructible meshes(after a not certain amount of hits and hits at various points) just fall down and destructed, not blow up like on server.
That’s really weird. Can you check if you’re sending the ApplyDamage packet to the server? If you’re not sending it means that it wouldn’t register on the server.
At gif you can see, all destructions happen on server, and not replicate to client. if you mean event calls, yes, if i add after ApplyDamage PrintString node it called on all machines (server and all clients)
is your weapon trace based? if yes and your Client then send hit results to server and from there Multicast the whole trace again + apply damage. if your already server just multicast the trace. inside the hitresults you have start trace and end trace for that
It’s works exactly how you say. On server all works correctly, but on client ApplyDamage don’t add damage to DesructibleMesh. I checked all input data, all fine. I dont have any ideas what it can be.
in your picture youre just replicating the received damage. what I mean is replicating the “apply point damage”. do a whole new trace on multicast which has start and end point of the first trace. this way if it hits something it applies the damage on every client
MajekPL why do you think that we need to trace on every client? and why not enough to said on every client you got a damage? I try to make it not only worked as well as understand where the root of problem. It’s problem to duplicate trace(may be problem just for me:)).
My “research” given some result: i changed hit direction and got this result
(Left - second client, upper - first client, bottom - server)
After i added 100 hp for DestructibleMesh and set flag Accumulate Damage and got this
(Left- second client, upper - first client, bottom - server)
Rifle deals 25 dmg, health is 100. On client DM is destructed after 4 hits(as expected) but on server only after 2. Now i have 2 questions: Why server is deals double damage? Why on client DestructibleMesh do not blowing up?
“MajekPL why do you think that we need to trace on every client?”
because that’s how I did it on my system and it works fine. this way you have the exact replication of the dm on every client + server. Edit: it may be that I just multicasted the hit location when I try to remember. but what I did is handling the multi cast outside of the “received damage” where you are handling it
“Why server is deals double damage?” - without posting the new code its hard to say
"Why on client DestructibleMesh do not blowing up? " - what do you mean. on the gif they get destroyed
In his last gif, the client destructible meshes do not fracture when shot - they just wake up, then fall to the ground and shatter. I suspect they might have been sleeping, and might need to have Wake called.
If you mean that 2 node it not worked:( Or may be i doing something wrong.
Now about my progress:
I found why server deals double damage) I cant explain this, but here actor get damage if trace from weapon hit them and i thought that damage goes to the actor but not to the destructible component, i was wrong. Without this node server get damage the second time. This issue fixed)Screen capture - d543c882dc89e96d9fb6ebda166aeeb0 - Gyazo
Now i have only one problem: How blow up this mesh at client?