Using replication to achieve black magic?

Discussions about Coding and Scripting
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Using replication to achieve black magic?

Post by PrinceOfFunky »

Last year I was playing a game where these kind of teleports(like the one at 0:14) happen:
g5JrUhTKiIo
And I wondered if something like that could be achieved online by a player without inducing real lag, but I didn't know replication much, I "re-studied" replication these days and got to finally understand it a lot more, and that idea I had last year came back to my mind, I think a player teleportation like that could be achievable using replication.
Imagine there are two workflows you have to take in count when programming replication:
- The usual programming workflow which just lets the code run smoothly without bugs.
- Replication, which, in a visual context, helps clients to know about stuff that is happening into other clients or server, and viceversa.
Now, I think that to achieve that teleportation effect we would need the second workflow to be "bad programmed".
For example, we avoid keeping replicating the player who is willing to move to the other clients, and then start to replicate it again when it finished moving to the other side.
Probably this could be achieved using bNetOwner and the start/stop boolean should be checked in the replication block.

Do you think this is doable? .o.
"Your stuff is known to be buggy and unfinished/not properly tested"
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Using replication to achieve black magic?

Post by nogardilaref »

Unless I am missing something, why not use a simple SetLocation and, at most, a SetRotation on the player?

I mean, the existing UT way of doing "teleportation" matches exactly what you see in that video, it's just that in that video the game adds some pretty dark effects on top of it, and nothing more.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Using replication to achieve black magic?

Post by JackGriffin »

Yes, it's possible but the minute you put it out there someone like me will code a positional check to identify it and ban the person doing it. It would be very hard to get around the checks, you'd basically have to default back to a speed hack by doing it multiple times which could be dealt with by absolute velocity checks.

You could also do a quick check of the teleport spots on the map and ID anyone moving location outside of a very strict zone around them. That's just a couple of things off the top of my head.

Edit: hit reply and Nog had already replied before me. I must have misread the question as "could you cheat this way". If that's not the case then disregard my response.
So long, and thanks for all the fish
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Using replication to achieve black magic?

Post by nogardilaref »

JackGriffin wrote: Edit: hit reply and Nog had already replied before me. I must have misread the question as "could you cheat this way". If that's not the case then disregard my response.
I think I am the one who misread it. :lol2:
Yeah, I am sure now he meant what you described, sorry of the confusion in my head (it's the end of the day here, so I will use the "I am tired" excuse this time :tongue: ).
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Using replication to achieve black magic?

Post by PrinceOfFunky »

Yes It's exactly what JackGriffin is talking about, it's not like a teleportation, teleportation itself doesn't require skills, here you should move while you are not replicated to the other clients and using your skills t do it fast before getting replicated again.
JackGriffin wrote:positional check
Aren't checks server-side against client-side modifications? Cause if so, the player is not rly "cheating" server-side, it moves correctly client-side and server-side, it's the server who will fool the other player without replicating the "cheater".
"Your stuff is known to be buggy and unfinished/not properly tested"
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Using replication to achieve black magic?

Post by Higor »

Been there, done that.
Turbocharge at slomo on client for 30 seconds, then run all at Sonic the Hedgehog speed thru a CTF map.
Too bad XC_Engine servers won't let you do ANY of that.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Using replication to achieve black magic?

Post by JackGriffin »

PrinceOfFunky wrote:Yes It's exactly what JackGriffin is talking about, it's not like a teleportation, teleportation itself doesn't require skills, here you should move while you are not replicated to the other clients and using your skills t do it fast before getting replicated again.
It's already been tried a bunch of ways. Because of the simplicity of the engine it's not really hard to catch. Basically movement in a normal match is 95% of the time either ON or OFF. You pick a direction and once you start moving you are capped to the default running speed. That makes it pretty easy to spot check a player using the velocity formula. They cover more distance than is possible then you need to take a look at them closer. They screw with their client updating? That's a strong warning and sometimes a short ban depending on the admin. Get caught trying to influence the replication speeds and you'll most likely get ostracized from the community.
PrinceOfFunky wrote:Aren't checks server-side against client-side modifications? Cause if so, the player is not rly "cheating" server-side, it moves correctly client-side and server-side, it's the server who will fool the other player without replicating the "cheater".
This is actually a bunch of questions rolled up into one. Could you code this to work yourself on your server? Sure, with little problem. Could you code this to work on my server? Sure, but I'm going to catch you doing it.

Really the minute you post a mod that screws around with replication like you are discussing there will be several people pointing out what it's attempting to do. You won't fool anyone if that's your intention. If that's not your intention then Nog is right and you just blast out a bunch of SetLocation's and cloak your player in a speedshell.
So long, and thanks for all the fish
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Using replication to achieve black magic?

Post by PrinceOfFunky »

JackGriffin wrote:You won't fool anyone if that's your intention.
If I would have been willing to fool, I wouldn't have post a topic.
JackGriffin wrote:Could you code this to work on my server? Sure, but I'm going to catch you doing it.
I'm talking about the server allowing all the players to do it, so that players can do that cool teleportation effect for example.
"Your stuff is known to be buggy and unfinished/not properly tested"
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Using replication to achieve black magic?

Post by JackGriffin »

Then you are going about it in a very obtuse way. Screwing with an actor's replication makes them "rubberband" and the appearance is not at all natural. Case in point is the guided redeemer. Online if you watch it closely it is anything but smooth and becomes less pleasing to the eye the more you examine it. That's what your effect will appear like because the predictive nature of the guided deemer somewhat mimics what you are proposing.

It would be much better to create a Nightcrawler-type effect where the opponent is the center point and SetLocation combined with some smoke effect would let you BAMF around them.
So long, and thanks for all the fish
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Using replication to achieve black magic?

Post by nogardilaref »

Wait, wait... does that mean I actually didn't misread the point of this topic after all back then? I am confused... :???:
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Using replication to achieve black magic?

Post by PrinceOfFunky »

nogardilaref wrote:Wait, wait... does that mean I actually didn't misread the point of this topic after all back then? I am confused... :???:
No, cause I don't want the effect itself, I just want the other clients not to know about one client moving from side to side.
"Your stuff is known to be buggy and unfinished/not properly tested"
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Using replication to achieve black magic?

Post by nogardilaref »

Which goes right back to what I mentioned. What's the issue of simply using SetLocation, and even bHidden or a completely transparent texture change for that matter?
Why is it so important that clients don't get to know the other clients replication-wise, what's the point?

As long as the players themselves do not actually see it gameplay-wise, what happens under the hood is pretty much irrelevant except for maybe some minor optimizations, all of which you are already getting for free from the engine itself in this case in the form of relevancy checks.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Using replication to achieve black magic?

Post by PrinceOfFunky »

nogardilaref wrote:Which goes right back to what I mentioned. What's the issue of simply using SetLocation, and even bHidden or a completely transparent texture change for that matter?
Why is it so important that clients don't get to know the other clients replication-wise, what's the point?

As long as the players themselves do not actually see it gameplay-wise, what happens under the hood is pretty much irrelevant except for maybe some minor optimizations, all of which you are already getting for free from the engine itself in this case in the form of relevancy checks.
It has to be seen by the victim, the cheater must move in the process. Let's suppose I want the victim believe the cheater is still at that location, while the cheater is actually moving away, now what you are saying has sense if this should have happened immediately and if the cheater is actually a bot which knows exactly where to teleport, but it has no sense if the process should take longer like 30 seconds. The problems in a quick teleportation are:
- How do you tell what coordinates you want to teleport to if you cannot move? (Excluding teleportation to aim of course)
- What's the trick in this? The victim would just see you teleporting, it wouldn't see you lagging.
Maybe I shouldn't have linked that exact video.
This explain exactly what I would like to simulate (GO TO 3:21)
5gE-ihY_EG0
"Your stuff is known to be buggy and unfinished/not properly tested"
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Using replication to achieve black magic?

Post by nogardilaref »

The most confusing bit to me is whether you're actually talking about cheating, or talking about a new legit gameplay mechanic since you keep using the term "cheater" but it seems you mean something else.
I know a game which is entirely based on "wall-hacking", essentially everyone's helmet is able to wall-hack for a few seconds and then it has to recharge, but it recharges relatively quickly, and it's a game changer for sure (camping is rather ineffective), and it seems to me that you want a legit gameplay mechanic which kinda acts like a cheat, is that it?

Now, I am not sure if this what you're actually talking about, but it still seems a very simple problem to me with obvious solutions, none of which include any replication manipulation whatsoever, because in the end what you want is a visual effect.
You can perfectly code it as so that a player doing this kind of teleportation, simply gets hidden and an after-image gets spawned in their current position with the same animation, rotation, etc, and then this after-image could disappear after a bit of time at which the "teleporting" player would then reappear at the same rate, doing the effect you seem to being looking after.

This would be something that would work with players and bots alike, and it's very simple to do.
So from here, it's all a question of whether or not I am actually getting your point or not, because I am personally getting more and more confused on what you actually want to do and with which intention.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Using replication to achieve black magic?

Post by PrinceOfFunky »

nogardilaref wrote:The most confusing bit to me is whether you're actually talking about cheating, or talking about a new legit gameplay mechanic since you keep using the term "cheater" but it seems you mean something else.
I see, I thought using "cheater" with quotes was the best way to make you understand I wasn't talking about a real cheater but a simulated legal cheater.
nogardilaref wrote:it seems to me that you want a legit gameplay mechanic which kinda acts like a cheat, is that it?
Exactly this!
nogardilaref wrote:You can perfectly code it as so that a player doing this kind of teleportation, simply gets hidden and an after-image gets spawned in their current position with the same animation, rotation, etc, and then this after-image could disappear after a bit of time at which the "teleporting" player would then reappear at the same rate, doing the effect you seem to being looking after.
And yes I thought about it, but I was just excited to have finally understood replication. Plus, replication would be a bit more scientifically realistic(I mean not just visually). ALSO PLUS, it would actually reduce the bandwith usage for not replicating anything about the "legal cheater" to the other clients, while hiding it would still make the server replicate the "legal cheater" even if not useful, the sounds would still be heard by the other clients etc...
"Your stuff is known to be buggy and unfinished/not properly tested"
Post Reply