x

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"

Issues with proper replication

Hey everyone,

I'll try my best to ask this question properly, but due to my extreme lack of understanding about C++ based networking in UE4, it might seem convoluted.

I'm creating a networked FPS for my final project in college with another student. We're hitting a roadblock at the basic process of shooting an enemy, and decreasing their health, replicating that value throughout whoever needs to know about it.

The problem is, we (and even some other groups also using UE4 for their final project) can't figure out exactly how we're expected to go from a hit event on the players local computer, to properly propagating that information around. Even with the current documentation and examples, we're at a loss.

Hopefully some benevolent individual can come along and explain, as though we're idiots, what we're do do (in C++) to get this type of behaviour, and maybe explain how and why that is as well.

Thanks so much ahead of time,

b1nary

Product Version: Not Selected
Tags:
more ▼

asked Sep 19 '14 at 01:04 AM in C++ Programming

avatar image

b1nary
1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I'd take a look at the shooter game example as it does exactly what you need.

However in short the following steps are needed:

  • client player performs shoot action

  • server is notified of shoot action via a RPC,

  • server validates the shoot action and performs it on the server,

  • If server validates the action it replicates the results of the action to all clients.

  • meanwhile the client can simulate hit effects and wait for the server to perform the action to do the rule based gameplay stuff such as damage and health.

The server should be the entry that applies damage and notifies all clients of the damage via replication.

For more specific on what to look at in the shooter game example check out my answer in this post

more ▼

answered Sep 19 '14 at 01:20 AM

avatar image

dzeligman
708 32 28 52

avatar image b1nary Sep 19 '14 at 02:54 AM

Hey, thanks for the response.

I'm currently on a skype call with a few of my buddies, and we still can't seem to wrap our heads around this concept. Especially since we're testing Role == Role_Authority and both instances of the game are ROLE_Authority. How else can we check if it's the server? We're looking at the Shooter Example but none of it is really documented so we still can't really make sense of it. We've been at this for weeks, and everyone just keeps sending us and everyone else to the shooter example.

Unfortunately, we need a bit more clarification since we can't get it to work at all, let alone a little.

avatar image dzeligman Sep 19 '14 at 05:27 AM

You can run a single client /server instance in editor to test basic replication. Try that locally to test your code. You should clearly be able to see the RPC calls moving between the client and server while debugging. I can't think of anything that would ever cause two instances of a game to both have Role_Authority.

(comments are locked)
10|2000 characters needed characters left
Your answer
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