I wish to do a simple thing…
Players have a missile launcher similar to a TOW. It works as follows… player fires missile and then can control it and manually guide it to the target. Sounds simple until you try something like this:
Set player cull distance to 200m. Place player1 190m from one side of the target. Place player2 30m on the other side of the target. Now you want player1 to fire missile at target. You want player2 to see incomming missile hit target.
This works if you set the missile to replicate but… If player1 has a poor ping then firing the missile will be lagy.
This does not work if you use multicast. With multicast player2 will see the missile launch briefly because player1 becomes relevent when he fires it. Then player2 loses the reference to player1 and the missile just flies off in some random direction.
The solution would be if Epic allowed blueprint replication to have an option to NOT replicate on the player1 who fired the missile. Then I could create a local launch for player1 so that he does not see the lag.
I have spent hours trying to resolve this. Does anyone have an idea how to do this.
@Epic please add “ignore owner” as a replication option
Autonomous input on the player who “fly” the missile. (So the player get instant control of the missile)
Simulated movement on the other clients who see the missile flying. (So the missile moves between server ticks)
Handle the impact result on the server while also simulating it on the owning client. (So the impact is instant for the player but calculated on the server to avoid exploits)
The movement component has the movement network part built-in so perhaps you should experiment with making the missile a character and possess it when you fire. On impact you then need to repossess the character who fired it.
Because I also have a ‘Homing’ version of the missile which works fine, I used the projectile component. The problem is that when you do a multicast the observer does not get information regarding which direction the shooter is pointing. This causes the misslile on the observers pc to have nothing controlling it. I even tried the following…
When shooting missile pass a reference to server which saves it in a gamestate BP. The observer can then maske a request to the server which send the reference out via multicast. This does not work. It only sends the info to the shooter. So yes it is very good at saving network bandwidth but makes life hard.
The simple way is just set ‘replicates’ to on in the missile bp. It all works as desired except for if the shooter has a bad ping he will get lag at launch. If only Epic would have an option to exclude the owning player from replication. They already have this option in multicast.