Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Networked game collision detection (overlap events) and hit sounds

Hey guys!

I am currently working on a networked game with swords. Since the server is authoritative it makes sense that collision detection of any sort should be done on the server. I was wondering if my solution for playing sounds when being hit (or hitting somebody) make sense.

I check for an overlap between the weapon (a sword) and the mesh of a character. OnBeginOverlap I apply damage (if HasAuthority()) and play the right sounds. The problem is that I reset to server state once I receive it (and do client side prediction) which constantly moves a simulated proxy, even if the position doesn't change. This triggers the Begin and EndOverlap events each time the character gets an update, causing the sounds to be played very fast and a lot too.

Right now I have solved this by just completely moving the collision to the server and checking the server state if damage was received and then playing the right sounds. This works as intended, but when lag is turned on you can literally hear the lag.

Is there a way to circumvent the problem with overlap events so that I can simulate the collision on the client side ? Should I even try to do so or is my setup right now acceptable? I was thinking of games like CS:GO but those are a little different, you don't constantly hear when you hit someone, and when you are being hit it is fine anyway since that is in sync with the lag.

Product Version: UE 4.17
more ▼

asked Mar 13 '18 at 11:16 PM in C++ Programming

avatar image

19 4 5 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question