logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Online replication problem with projectiles and repulser-item (Read 5383 times)
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Online replication problem with projectiles and repulser-item
Reply #15 - Aug 3rd, 2015 at 4:56pm
Print Post  
Interesting way to do it! So all I really had to do, was go through a separate, reliable actor that does the reflection effect predictably so both server & client can see it? Maybe because in this case the pusher is also "bAlwaysRelevant" as well. Or its just the way you handle it and call it again in ProjectilePusher, particularily.

Well, its working perfectly now. Thank you!

And thanks gopostal, for all the effort. Maybe there are some silly mistakes in my code that made this harder, I'm very amateurish at all this.

But it works now, and I'm happy, and hopefully I learned something.
  
Back to top
 
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1332
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Online replication problem with projectiles and repulser-item
Reply #16 - Aug 3rd, 2015 at 6:31pm
Print Post  
SFJake wrote on Aug 3rd, 2015 at 4:56pm:
So all I really had to do, was go through a separate, reliable actor that does the reflection effect predictably so both server & client can see it?

The only purpose of the auxiliary actor is to execute PushProjectiles on client. The same thing can be done by means of replicated function calls, but it would require giving some inventory item to every PlayerPawn in the game and calling replicated function for such item of every player. I think, the solution with actor is more simple (although replicated function calls could eat less network bandwidth).

Quote:
Maybe because in this case the pusher is also "bAlwaysRelevant" as well.

Once projectiles are pushed on server, the corresponding client-side call should take place as soon as possible, therefore, the newly spawned actor should become visible to client immediately; otherwise, client-side execution of its PostBeginPlay function could be postponed or not happen at all. The simplest way to make the actor immediately relevant to all clients that might observe the pushing effect is to set its bAlwaysRelevant to True.

Quote:
Well, its working perfectly now.

Not perfectly. As I said, this is just a rough approximation. You can expect that trajectories of pushed projectiles differ between server and client. But they may differ without any mods anyway.

For example, Eightball grenades after bouncing almost always have different actual (server-side) and predicted (client-side) move directions (and even explosion time differs between server and client). For another example, you can try to shoot over the bridge near to the end of Dig (Rrajigar Mine), where there is a powerful fan that is supposed to be able to deflect projectiles (technically their direction is changed when they enter some zone with special ZoneVelocity). In multiplayer game entering that zone often changes only server-side projectile's direction while client-side prediction does not take into account ZoneVelocity at all.
  
Back to top
 
IP Logged
 
gopostal
Betatester
Offline


Hack coder

Posts: 940
Joined: Jul 31st, 2008
Gender: Male
Re: Online replication problem with projectiles and repulser-item
Reply #17 - Aug 3rd, 2015 at 11:08pm
Print Post  
You'll always have silly mistakes in your code. Literally every single time I post code part of me winces because I know that way smarter people than me are going to see it and if I missed something or made some stupid error then it's there for everyone to see. Learning to code is humbling and I've found that you just have to open up to the process and set aside ego. MK's posts are a perfect example of this. His code is a great workaround and I wish I had known of it when I did my Frying Pan. Like you I don't mind if it's 100% accurate across all clients, it's the effect I wanted.

I'm proud you didn't give up and you kept after things until you got it. That's impressive and bodes well for the quality of your work.
  

I don't want to give the end away
but we're all going to die one day
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo