#multiplayer
1 messages · Page 339 of 1
I see, so the architecture that I have is not the best (client has a simple pawn, server has a character)
(I follwed and example from you tube guy making top-down multiplayer)
You want your player to have a character that he controls, right?
y
Yeah, give him his character, possess it with the clients controller
Or set it as default on the gamemode
And add movement on the client
so, character will move on the client, replicate to the server and server will replicate to other servers, right?
Theoretically you are right with setting it server side. But ue4 does that for some things already for you
Other clients
There is only one server
OwningClient - >Server - > other clients
- also back to the original client
Have you read my compendium?
yes, I did
Okay (:
it is the best source of info available! Btw, thanks so much for it!
No biggie (:
ok, will make new BPs to get the idea going
This was working once upon a time, but now it's not
I'm running this function on server
The inventory slot has a thumbnail that is bound to the item thumbnail of the item data structure
Are you passing the data back to the client?
@thin stratus No, do you have to do anything widget related on the client instance of an actor though?
Well widgets are client side. It you set the data on the server and don't replicated it or send it back, then the client will never receive the update
So how would you send it back?
Would I call an event on the owning client that gets variables passed thru from this function?
For example, yes
Usually you use a smaller version of the Inventory. Only the information that is needed for the ui
Like itemID and stacksize or what ever you have there
Icon, description etc should be stored in a data table which has the itemid as row name
So everything that is static and doesn't change.
Is that for optimization?
Also yeah
Wrote a few inventory systems by now
So for me it's default
If yours send and saves more data, maybe even static data, then this would be optimization for you
I really appreciate the feedback, I don't understand the data table part yet, but I really have a grasp on structures now thanks to creating the inventory system
Datatables is like an excel table
First column has a unique name
They are based on a struct
So you create a struct and then create a datatable and selecr that struct
Rowname is given and must be unique, other columns are defined by the struct
In code you can pass the table your rowname and get the row from it
E.g. Pass itemid as rowname and get name, icon, description etc
What ever static information you have about your item
So the rowname is basically the itemID
Yeah in general it's a name
What's the plus side of this vs how I did it
But most people tend to give items numbered ids
If you pass all the data back and forth it costs bandwidth
There is no reason to pass data from client to server etc if it's never changing
Clients can just use the replicated id and get the data from the datatable
You only need to replicate data that changes
then they access everything else locally
Like stacksize. Durability
Okay
Yeah name, icon etc would be locally
I'm gonna mess around with it for a little bit and see if I can change my system to that
I see how beneficial it is now
That reduces your actual inventory structure to mayve the itemid and stacksize
Sure (:
So I created a data based off of ItemData
datatable*
Now I create a row and that is basically the information for that object
?
and basically the physical actor of the weapon or whatever only has 1 variable which is a name
ah i see and now i can make my inventory just a structure of names
Yeah if you have no other changing data
Datatables are not for storing runtime changes :P, it's readonly at runtime
(:
I can't replication "Set Skeletal Mesh" for some reason...
fixed it
Good day. It kind of feels bad that I'll jump right into asking a question given I've just joined haha, but here it goes:
Can a dedicated server perform CreateSession calls? I don't know what player ID to put as 1st param (C++)
There should be tutorials that you csn Google that show how to do that
You call the usual createsession stuff on RegisterServer
Idk that out of my head. Haven't worked with session + dedi in a while
Many thanks. I saw articles saying that a player ID / param 1 of '0' would work for CreateSession. Think I'll work around that for now.
Anyone know how big actor references are when replicating em?
Detailed information about how object reference properties are replicated.
so the size of a FNetworkGUID I guess. Which is mostly just a uint32 (4 bytes)
That's much smaller than I thought it would be
Hello is anyone around?
maybe
@night jay you really shouldn't need to replicate references
(I don't even know if it works)
I wonder how does it convert it tho 🤔
What techniques do you guys use to minimize how noticable small position corrections are?
Do I have to replicate everything manually or is there a technique to replicate things automatically and choose the ones you do not want to replicate?
If you set a variable to be replicated, then any time you change it on the server side it will be replicated to the clients
You can also set it to rep-notify, where a function is automatically called after a new value is replicated for it
This is pretty handy
However, you do have to set it on the server, so you will need to make a server replicated setter function
An example would be a function replicated to server that sets the bool FlashlightOn to true
Then in the rep notify for FlashlightOn you could put the code for toggling the light on and off
replicating everything goes against the whole client/server simulation model unreal uses. theres no reason to replicate that footstep sound, because you can just throw it into something the client is already simulating locally (walking animation). theres no reason to replicate that explosion entity, just tell the clients to spawn their own explosion at these cord's. even better you can just spawn explosions based off an event thats already being simulated, like this impact here means spawn explosion, but without the server needing to tell the clients anything.
you should strive for super accurate simulation of gamestate, but leave critically important things like a players health, or what weapon they are holding up to replication.
replication does indeed start somewhere, but allot of things can run off stuff the client is already simulating locally
When a pawn is possessed it calls PossessedBy(AController* ...), but only on the server. How does the client know when it's possessing a new pawn?
I have a weird situation where when a pawn is possessed it needs to offset by clientside-only data. We're already trusting the client (It's VR) so..
I can send the data to the server (it's head position) but when they first connect to a server and it tries to spawn them, it won't be available
I guess I can override OnRep_Controller which should be called when it's set to a new PC
But then I don't know how much to offset them. Maybe I should just start everyone as a spectator and once they've sent data to the server about their position, then we spawn them, and offset their pawn when they possess it.
you can just call a client function inside PossessedBy cant you?
@hoary python My fear with Possess->Call RPC is that they will spawn and then flicker to their new location
Possess puts them at the actual Pawn's location, and then they offset to their actual location.
could try lerp positions from their current to the new one, maybe
ah i see, vr hmd position, might not want to lerp that? havent touched much VR. if not then yeah i would probably think the on_rep override on the variable would work for you
Yeah and I'm doing non-conventional stuff too. Technically the VR player's head is relative to their origin, and their origin is the pawn
But I represent the player by a sphere where their actual head is, so to make your sphere line up with where you're supposed to spawn you have to offset the pawn by the offset of the head effectively
are the other clients meant to see each others head spheres? might be a case of letting the server know where the clients head is, making sure the clients got the authority on the update so they dont have any stuttering based on ping of course, but interpolating it with the server. that would let you start with it with the server in mind
Yeah - effectively you're just represented by where your head actually is and your distance from your origin is irrelevant
I just don't want people to have to stand in the center of their room to line up correctly :p
Yeah the problem with letting the server know where the client's head is is that it doesn't get sent immediately, so on first spawn it's still zero. The solution for this is start everyone in spectator mode and then in OnRep the first time it comes in queue it up for being okay to spawn.
could do, or if you are coming from a menu and are seamlessly travelling player controllers, you can use copy properties to bring that location over and have it from the start, as the persons head will still be there before that level starts 😃
Can't seamlessly travel when connecting to a server
Has to be a hard-travel so I don't think you can copy any properties over.
dedicated server? rip that idea then. 😦
Nah even just connecting to another person's server can't be seamless, seamless only works when changing maps
ok right, yeah sorry I meant if you were coming from a menu with the host. for our game you hard travel to a Lobby then seamless to the match. i guess youll have a hard travel at some point anyway, so you're right that wont fix it
I'll try the OnRep_Controller thing (since your client doesn't move views until that happens) and hope that works, I realized I can probably just do AddActorLocalOffset(GetTransform().TransformPosition(HMDPosition));
Gotta sit through a 5 minute compile to find out though 😕
Well, OnRep_Controller doesn't get fired
Okay. OnRep_Controller only gets fired on the client, which means it doesn't get fired in singleplayer (since that's a server)
So, this idea is out 😦
Going to just go with sending a RPC after possession and worry about the possible flicker later.
Hello 😃 Question with regards to Unreal dedicated servers
Assuming that a dedicated server calls CreateSession, what would be the difference between the Session Settings being set to bIsDedicated = true or bIsDedicated = false?
For the bigger picture, I am trying to integrate Unreal networking with AWS GameLift and Steam. I was thinking that Unreal dedicated servers would sit in AWS serverspaces, and they would manage Steam sessions and clients connecting to them
So far though I've discovered that trying to host a dedicated Steam session using an Unreal dedicated server requires you that you use the Steam master server setup
er.. Native NetSerialize StructProperty /Script/Engine.Actor:ReplicatedMovement (ScriptStruct /Script/Engine.RepMovement) failed.
What does that mean?
side question - do default values created by the client have to be replicated in order for the server to use em?
default values for what?
only server should be allowed to set values for gameplay critical components
is it possible to replicate a widget
@jagged goblet, nope
but from your widget you can easily get Player Controller or Character or Player State
and call RPC
Widget are only client-side
thanks jack, that explains a lot lol
How do I go from client to everyone, without using multicast?
Or is there no choice?
ATM, i'm using server->multicast
Problem is, I'm spawning an actor (weapon) from the character pawn (called via server function, and I've set the ownership to that pawn).
When I call the "event fire" function within the weapon (spawned actor), it only works via client.
I'm not quite following your flow, what are you trying to do? Are you first trying to call up to the server and then multicast?
Or are you trying to multicast directly from the client?
Okay, flow is this.
- Pickup weapon (server spawns an item from the base character).
- Fire weapon calls a server function within the base character.
- Weapon event fire has an client function, that does the vfx/sfx.
^Spawning weapon (when picked up)
Okay, so could you describe the issue a little more? I'm not quite sure what you mean by "it only works via client", that could mean a lot of things at this point
jesus that switch
I tend to attach process like that too more defined tyhpes
hitscan, melee, item
ie, most gun fire can all run on the same thing
all guns functionality tend to run the same
from pistols to shotguns
Not in my game.
Sfx?
so, i usually tend to put all common in there
anyways, thats not what i need atm
i need to figure out why the line trace only works on the sole client
u can carry spread types and amounts & sound effects, etc in some sort of weapon container
when on dedicated servers
ohh
That trace doesn't quite look right—a forward vector is a direction. Once you multiply it by a distance you can use that as an ending point if you take into account their location (adding it)
@sweet spire i have a master weapon
cus ur using get player controller 0
Yes
and that is?
Bool, IsFiring, Rep notify
If target is firing start firing function
If target IsFiring False, stop fire function
and do line trace, but not from player controller 0
That makes sense actually, I'll give that a try.
From where then?
the gun
?
But I want the players camera.
It starts from the barrel to where the crosshair is.
like typical shooter
barrel to crosshair what
First time iv heard of anyone doing that
Really?
Well i guess thats kinda even easier
Well heres the thing
If u line trace from a barrel to cross hair
its like what
Your line tracing on a funky angle
instead of from player perspective
If i understand what u said right
i might misunderstand what you said
Heres an example from me
When my players weapon fires
The Vfx Fires from the Barrel too the center point on client only
and for Server it fires from camera to center
I'm shooting from the barrel of the gun, to where their crosshair is aiming at.
It's that simple.
Thats some really weird aiming
ops let me recorrect that i said
I fire from client camera pos too cross hair, and spawn muzzle flash on barrel*
Im not too sure how to advice you on that linetrace setup
firing from playercontroller 0 only works on a owning client really, it wont work for any other pawns
Is that weapon the master bp?
that bp that does firing
I wouldn't use OnRep for firing a weapon
Why not?
wouldn't you use the same bool for vfx as you use for firing?
logic and timing is identical anyway
you are simulating clients firing
vfx
If other players start firing have the bool replicate
well yea, rpc it to server but don't run the projectile spawn/damage on clients
It way cheaper to replicate a visual bool than multi cast
Im just saying you have to transfer that bool to server anyway, might aswell drive sfx from it
not if you set on client first and set replication to skip owner
most of the time u dont need to replicate things like linetrace impact and stuff
thus you would save bandwidth
no I didn't
Instead of having to multi cast stuff, alot of things like this you can on rep bool, and have replicated clients simulate there firing
so any vfx impact or flashes etc
can be simulated
There is no need for accurate bullet holes and stuff most of the time.
just set the bool on client end, no delays and no need to replicate it to owner, server does the damage logic/recoil/etc once the bool actually reaches it
it's not like you can drive the vfx based on server output anyway
man your not listening
the bool has nothing to do
with dmg
recoil
etc
The bool is only there to make clients simulate there cosmetics
aight fine, do multicasts
dont multicast it jesus
just saying you dont need to
major waste
You are 100% missing the point
From 1 bool, you can simulate Muzzle flash, impact damage and sound in two locations for example.
@lament kettle had issue with 3rd person aim?
no
lol
ill just use the server -> multicast work flow
no one here appears to know an alternative
(a proper one that is)
on...?
somehow on the past 6 months, i have managed to avoid the need to multi cast at all on this project
multiplayer project as well, 70 player max
dont forget
if u dont replicate there weapon information
it cant do the firing
and player controller 0 on replicated pawns to your client, will try and linetace from the controller of the client
Think of it like this
so here's what I use: Set weapon bTrigger to true on client -> send to Server to set the same bTrigger to true with replication but skip owner -> drive logic from tick
therefor, you dont need to multicast because the bTrigger is sent to everyone anyway
and they drive the logic from it using tick
u dont need to do that anyway because rep notify
repnotify triggers once, you can initiate it using RepNotify but again but if you need Tick for say, automatic weapon then it's redundant
u dont need to use tick for this,
automatic weapons dont need tick 😂
well using onTick
FOR EXAMPLE
There is otherways to handle things
ÄUTOMATIC WEAPON¨
calm down m8
Fixed it.
sweet
i wish i had examples from when i use too use it
but now i use actors too replicated costmetic info too clients
Top one is from base character.
Bottom image is from the weapon hitscan.
Rotation works too.
fuck thats alot of data haha
No need to "replicate" via tick, the rotation of the follow camera.
A lot of data?
to me anyway
Bro, its just the base character.
whole character ref is way too much
You think so?
two vectors & char ref bp haha
if player can manipulate it, they can kill from spawn
or literally anywhere on the map
if they find the memory address for it
with cheat engines
easily
the linetrace should be done solely on server
Yes, I understand that.
I'll put is cosmetic
The line trace will be the damage aspect.
man theres no need to even make an example
idk how to make it any simple haha
IsFiring, rep notify on all base char, when its true enable VFX weapon fire loop, when its false disable it
when anyone starts firing, there replicated pawn on another client will do the same visually
thats the jist of it anyway
u dont need too
There pawns will know about them selfs
every single replicated pawn
Has its own Bool IsFiring
So if player A starts firing, Player B,C,D verison of player A, start doing cosmetic
Are u replicating weapon
i assume you are
yes
then there u go
they should know about the pawns own weapon
so u should be able to call it
the visual client side of it that is
we've spent 30 minutes on this bisfiring rep
its hard to wrap your head around i know
and i still have 0 clue how to implement it
Yeah thats fine
where?
forget about the blueprint right
for the weapon
You need to understand this
The IsFiring Rep bool
Is to let that replicated pawn know, it can fire
u dont need to worry about the firing logic
You get me right?
its as simple as IsFiring then do the firing
then ever replicated pawn knows about its own bool, & weapon blueprint
IsFiring = True, Do CastToWeaponBlueprint, Do Cosmetic Visual
Make sense?
and ofc IsFIring = False, tell weapon blueprint too stop doing cosmetic visual
That functionality would be inside the rep
here is an example
obviously this applies for game param not cosmetic
But its the same
yes
Okay, my question is this.
on mouse up its false
How do you pass a character reference.
With an RPC
and if we dont need to pass it, how do we obtain it?
why are u need to rpc
u can rpc too server with char ref like usual
but sending important data like vectors for hit traces is not a good idea
oh if ur talking about the bool
u just have the owner of it rpc for the server too set it
like so
Okay..
having an issue
This is on the base character:
This is the weapon:
line trace only happens on client and server
yeah uv nearly got it just a little mis understanding
Your weapon bp has a OnTick right?
yes?
so the weapon blueprint would really be checking If we are firing cosmetically
okay?
my assumption was your weapon blueprint
fires constantly
while ur holding the fire button
first, let us get it working...
No its not?
U mis understand again
The IsFiring bool
is just a condition
U wouldnt have your full firing logic in there
It be like
Okay
we've talked about this for 2 hours
2 hours? lol
:/
it feels like im at the dmv
Anyway, what was your original question?
Is using the server to multicast workflow, a good idea? Why or why not? (Origional question)
For some reason, I feel like I wouldn't be
well dont man, thats what im saying
already had someone jump in half way
Thats the basis of the rep notify functionality
Its too tell your weapon blueprint if it should be doing cosmetic stuff
Then its flipped on, any replicated pawn will do its firing stuff
when its fliped off
they would stop
also i dont have any sample blueprints because there is better ways to do this for alot of things, but it gets WAY more complex
This is just a super simple & cheap effective way to replicate visuals
also your issue is your lack of understanding of replicate and data control
There u go
the example u wanted
U have both pages not
DO U SEE THE LIGHT FAM
YES FAM
it doesnt make sense to keep sending vfx on server shit
to put a HasAuthority
just a bool
in front of the visual stuff
YES MAN
THEL IGHT
if ur client knows about it, like gun start point, socket, etc
then u can do like gun line trace and impact point
if that visual is not CRITICAL
u can have the client simulate it
through cheap af cheesy methods like this
Lets not forget this
a, all required data for it the pawn needs to have with it
b, this is only for cosmetic stuff thts not critical
c, full client side only(except for bool set)
then u can go 1 step further and do like
Ignore owner on rep notify settings
and have your pawn set it on there side, then tell server to change it
but not recieve a copy from server
so there is no delay for the firing client
for the visual that is
anyone used ipv6 ?
is ipv6 even in mass use yet?
to some degree
my ISP lets you use both
however, they dont have translation layer so some sites don't work
as for the context of UE4, Im not sure. afaik it's not that different so it should work
do you have to click "component replicates" for the character movement component and the capsule collision of a character for it to replicate smoothly?
@twin juniper no
@wary willow ty
Great repnotify vfx examples @sweet spire I think I finally get it 😄
Will have a shot at replacing all multicast cosmetic events this weekend
Also regarding the muzzle to center of screen that was mentioned earlier- I think that's pretty much how most 3rd person shooters work, no? Otherwise your bullets wouldn't be accurate (going where the crosshair is pointing), or else the crosshair would need to be off center or dynamic in 3D space
Also @slim holly , regarding your comment "if player can manipulate it, they can kill from spawn".
If you have the server shoot a trace from its version of the player and verify the start and end positions relative to what the client sent, and disallow anything that had changed drastically, it'd stop false messages like this from going through, right?
If u input a vector from client
Abd take that in for line trace
Client can spoof it
Of course, but if the server also runs the same line trace logic and the spoofed trace doesn't match up within a possible distance, it can simply be disallowed surely?
@sweet spire Your character should be replicating his view angles to the server
And then you trace from the server (but also on the client for prediction)
Which lets them aimbot but not cheat translations
@trail dragon Glad to hear it's fine to do it like that. I currently have it set up so that the client can request a server trace if it thinks he hit another player to verify if it was possible/deal damage, but spoofed hits wouldn't make it through as the server would find a big mismatch between the angles like you said.
@inner iris It's... complicated to do this right. At least what Source engine does is that when you click, you run the trace on your local machine and do blood splatter/bullet impacts/visual tracer lines, etc. At the same time, you send the message to the server that you click. The server gets the message, and -here's the complicated part- the server rolls back time by your ping to see where the guy you were shooting at was on your local machine. Then the server does the raytrace to see if you did actually hit him, and then the server calculates damage, removes health, checks to see if he gets killed, etc, etc.
If you think about it, A's position is calculated on the server. This is sent to your client (so it's now a one-way time behind his actual position), so when you shoot your message is now a full round trip behind your latest info
So the server rewinds time to see where the guy was when he last sent him to you (effectively...) so it's still server authoritive but it checks against what the client should have been seeing and not what the person is currently at
Yeah it's pretty complex stuff- have been researching loads of articles and videos relating to this topic. COD, CSGO and a bunch of other top shooters do it like this with the rewinding and use of snapshots. This is definitely way more accurate than my method but a lot more tricky to pull off as you have to store synced server and client locations and rotations etc.
My extremely hacky way of doing it is this:
I want the client's view to be favored as long as he has reasonable ping. So what he sees on his screen as being a hit, should in most cases result in a hit. However with running traces purely on server with no compensation, for any moving targets, he is likely to miss a lot of his shots and be frustrated "where are my bullets going!!!"
So since I want the shooter to be favored, I run the trace locally for him, and only if he detects a player hit, do I then call a server RPC that fires a trace off from the server version of his pawn. Since it'll be a bit off, and the client, server and person being shot at all have different ideas of where they actually are, there has to be some kind of error tolerance. Right now, I have it so that the server will trace, the start and end points of that trace will then run into a final trace that runs on a trace channel looking for a specific "tolerance" collision capsule that is roughly double that of the standard movement capsule. If the server hits this, the shot is allowed and damage is dealt.
I know it's by no means correct but I'm planning on refining it and adding multiple safeguards and case by case conditions to prevent being shot around walls etc.
I'm pretty sure what Source/etc do is favor the shooter
Yeah they do favor the shooter, but their fancy rewind system allows them to favour and be accurate
Yours is just "allow cheating" ;p
😄
If the server has to verify the trace (as if firing on server), I though a lot of cheating methods would be eliminated?
As in, the client doesn't send the server the info it generated, it just tells it to fire normally
Then the info is compared, and if it matches up within a reasonable tolerance, it's allowed
How are you going to handle "reasonable tolerance" when the client says he hit a person, but the server says "no you hit the wall 6in infront of you"
Then the server is right
And it won't allow it
Only if the client says he hit and the server said he hit or was like 10 cm off where the client said he hit
Will it be allowed
So every time I poke around the corner and see someone, I can't shoot and have it count until a round trip latency
Plus if he pokes out of a wall briefly, I can't shoot.
No! you shoot insantly on the client
Yes and then the server rejects them all.
The server rejects if the hits are greater than a certain distance or the angles of fire don't match up. Being shot around things is fairly common in all shooters
@trail dragon no need i use prediction keys :p
"I can't shoot and have it count until a round trip latency" even with snapshots / rewinding, wouldn't you still have to wait for the round trip?
You have to wait for the round trip yes, but if they were outside the wall on your screen and you had a clear LOS, it would count
Your method will fail when they are visible on your screen, but have moved behind cover on the server
Well it'll be favored to allowing the shot, provided the person behind the wall hasn't moved greater than the allowed tolerance distance. Like I said, ping will have to be considered before allowing anything on both ends. Assuming players had reasonable ping (<100ms), then being shot around a corner wouldn't happen very often.
Higher pings it is very obvious, but still happens on almost all games when playing in high ping scenarios
I'll probably have to scrap my terrible system and try to figure out a proper rewinding one at some point in the future
if i was u, id actually get the game running smooth and all multiplayer gameplay func working before u try and mess with this stuff
At the first playtest it was working great but no one could hit anything moving fast due to server RPCs so I went for this system and it works as expected, but you are 100% correct- no point on getting hung up on these kind of details before the game is actually fleshed out.
Like seriously prediction and comp is a huge fucking can of worms
One last question for the road @trail dragon then I promise I won't think about lag comp again for a while 😄
"here's the complicated part- the server rolls back time by your ping to see where the guy you were shooting at was on your local machine. Then the server does the raytrace to see if you did actually hit him, and then the server calculates damage" Wouldn't this also cause the same problem as with my method as you mentioned: "Your method will fail when they are visible on your screen, but have moved behind cover on the server"
In the snapshot, they could be visible to the client, and the hit is allowed, but on server they could be behind a wall and still die. Wouldn't it work similarly?
by ping what
stop right there
Id go for gametime not ping
that fluxs so much its unreal
Yeah I need to figure out accurate ping etc.
My values from the default ping UE4 gives you are way off
Server can check where they where, where he was, where he current is
and work it out
with tolerance
It'd still essentially kill people who were behind walls on the server but not on the client though right? It'd just be able to 100% guarantee that the client was sending the correct info
And be more accurate of course (like you said, if you shot to one side of the player, you might have more or less tolerance with my method)
@sweet spire The point still stands, you go back in time so that your server's environment matches up with what the client was seeing.
@inner iris no - the whole point is that the server rolls back it's internal state to match what the client saw when the client clicked (which should have his view angles + button)
Prediction and Compensation can only take you so far, you will never get an perfect system. The case where an player ducks behind cover but still dies is nearly impossible to eliminate.
lets thank jesus for FPredictionKeys
Its about compromise
So the server now "sees" what the client is seeing and runs his traces against the server's version of that timestamp, so still server authoritative, just matches what the client was seeing at the time he clicked
@fossil spoke Yeah exactly, there's tradeoffs everywhere and even AAA titles have a plethora of bugs. I just want to know if it's worth trying to figure out a big rewind system, or if my iffy method will get by fine.
Ah I get it properly now @trail dragon
Play test it
The server's trace will be exactly what the client's was, not ahead or behind
Aw, can't read up on FPredictionKey, docs are down 😦
If your focus groups cant find any huge issues with it that isnt going to be solved by an better system then wahts the point.
@fossil spoke Playtesting on an EC2 instance from EU to NA, it works like a charm after tweaking the tolerance hitbox
But haven't tested on a large scale yet
Good point though
If it works it works
whatsu r tol hitbox increase
I basically tested against players running left and right at different ping ranges
Right now it's increased so that a hit under 200ms ping always goes through with fast motion
And higher than that it only goes through if they aren't moving very fast or still (or the angle they are running at is more toward the player than to the left/right sides)
I didn't increase it scientifically, just until it felt like the shots were hitting when they should
Cheers
Thank you @trail dragon @sweet spire @fossil spoke - the penny dropped regarding the benefit of rewind vs. other forms of compensation, will stick with my method until an issue comes up, then if needed build a better solution.
Really helpful talk, much appreciated!
No worries, there is always pros and cons its just an matter of working out the benefits of one system vs another.
to confirm that I'm not doing a mistake, if I replicate an array of UObject ptr, all are constructed
not nullptr but zero initialized
it's a normal behavior ?
Is there a way to replicate a variable manually?
The variable changes per tick and I think it would be better to simulate the variable on clients and sync them periodically
well yea, you RPC it to/from server
Hm, I see 😃
@Raildex#6923, also be careful standard replication is less expansive than an RPC
(steam specific), But I'm just curious, are you forced to use quotes with steam achievements, as in Achievement_0_Id="ACH_WIN_ONE_GAME" seems to be used in examples, but would Achievement_0_Id=ACH_WIN_ONE_GAME be valid too? 
@loud sage looks like it works without ""
Awesome, thanks for confirming that, steam wasn't liking me today (wouldn't open....at all)
How do I get up and port from within dedicated server ?
what?
ip should be the same as your local/public ip of your host
As in, the ue4 server shouldn't set up it's own virtual server to my knowledge. You should be able to get a computer's ip on windows by opening up cmd and using ipconfig and it's ifconfig (or ip link? Not sure about the new stuff) on Linux 😃
Not completely sure about your port though 🤔 I believe it's 7777 by default
@iniside#8930 are you using Amazon EC2 dedicated servers?
i swear im the only person thats like fuck paying for servers build my own 😂
Well, in the past few years virtualization/containerization has taken off
A lot of the time it's just much easier to have things hosted on virtual systems, makes load balancing and scaling a lot easier
For my NAS and stuff like that yeah, I'm going to host it locally, but spinning up new instances of a DO droplet is just so easy
true true, however i tend up looking at speed provided and pricing and stuff and im just like
"no, cheaper to cluster my self and rent a line"
then again this depends massively where u live
what line u can get
Uptime,
maint etc
You become responsible for everything
@loud sage I don';t know IP of my host
im hosting server in Kubernetes on Azure
(;
I can host several servers on single node
and if port 7777 by server
it increments
so I need to post ip:port to database to be able to match against particular instance
I'm also evaluating Service Fabric
as it have better integration with Azure
Ah, kubernetes is pretty awesome, I just haven't used it a heck of a lot 🤔
Doesn't it automatically create a subnet for the cluster and then an IP for each docker host?
you can't really expose publicly hosts
Pods
I mean you can but you create loadbalancer for each and you need public IP for each
In which case creating a container with permissions that scales accross all hosts should work if they executes something like a docker ps (or whatever kurbernetes offers) <wait no>
nvm, my docker knowledge is $hit, and my kurbernetes knowledge is even worse 😛
the only reliable way I found is to create several groups of agent nodes put each behind load balancer
and then forward ports trough NAT
that is untill we get ipv6 working properly (;
you'll still need ipv4 nodes though 😉 Not everyone has ipv6 yet
True, true
steam?
I writing my own backed (;
backend
ok I see it is showed in log
and getting it is not that easy -;-
hopefully
thing I found is directly in sockets implementation -;
is there a special trick to get weapon muzzle effect to replicate on other clients
I'm multicasting but still doesn't seem to work
runs fine on client who is shooting but others cant see the effect
is passing an actor class to the server, dangerous?
@lament kettle In what regard
@jagged goblet Multicast has to be called on the server and then replicates to all clients
it is, its running off server then calling a multicast event
Well they can probably pass a class you don't want him to pass
Why not keeping class on the server?
so why even allow the option to pass things via server rpc?
@jagged goblet and where does it stop? Debugged a bit?
@lament kettle Because there are things less dangerous to pass
like?
runs all the way to the end of the multicast
A username
hmm
vectors
the thing is... when a player selects the inventory slot, i call a function within the player
so that they can spawn the actor
The server should have the inventory too
it does
Pass the server the inventory slot number
And let him het the item and class himself
@thin stratus Oh, does your crafting system on the MP has something like this?
ah
that makes sense
it's not dangerous to pass an inventory slot number
but it is dangerous to pass a class
@wary willow no, the inventory is very basic a it's just for making the crafting work
Ah
@lament kettle Sure, the server has the authority. He can check if the item is really in the Inventory
@wary willow it has stacking and drag drop
And item types
No 3D representations
Ah, could be a nice update
or new product
Something plug and play for people
But there may already be a few out there
It is plug and play. It's component based with interfaces
@jagged goblet and what exactly does not work then
You printed in the multicast and it's calling everywhere?
Mind sharing the code?
yes its not calling everyone its just executing locally it seems
set to execute on all tho
bit of a mess since im trying things but let me screenshot
this is on the weapon bp itself
before muzzle event its a custom event that runs on server
its the muzzle flash effect, i tried from nothing to set to replicated to rep notify
hm well the effect is being played on the client just no one else can see it
and thats the only thing telling it to play the effect
Hmpf
Just to confirm, are you sure the multicast itself isn't being executed?
Not that it's not producing the full intended effect, not that the emitter isn't being spawned, but that the multicast itself isn't being executed.
Confirming the result of that, either way, will help to find the issue
how can i check if the multicast itself is being executed
Dunno, print on it I guess?
Breakpoints in BP don't seem super reliable, at least to me
What do you mean by that? 😄
i mean the muzzlevent is running and its set to multicast
so im not sure
and its running off server
Okay, if you're sure the multicast isn't running that's good, I just wasn't sure what you meant with the 'I mean hrm' after that :p
Well, yes, but that's irrelevant here.
You're running it on multicast, so 'does not replicate' is really what you do want.
I see
Is the event reliable?
Okay. And you're sure this weapon is replicated to all clients at the time of the RPC call?
Hmmm, I just did it
If the weapon isn't replicated and each client spawns its own version locally, an RPC won't work
And it works for me
Blank FPS Project
Called FireWeapon on Server, Multi on the Particle
yes its attached to the character
cant quite see the code are you running it off playerbp or weapon bp?
im running it off weapon blueprint
That's fine though
The one thing here is that i still don't know if it actually calls
Put a print string into the multicast
so i have inputaction that when pressed executes fire weapon from the weapon bp
So you perfoem a server rpc inside of the weapon?
yes
Ownership
Well, to go off of that, have you confirmed the Server RPC is working to begin with?
I assumed so since you said that it works locally, but are you doing the emitter spawning anywhere else?
But, I mean, you can just call the funcions in the weapon rfom the character
(not sure what kind of weapon system you have, component based or what have you)
hrm victor could you share your code from your test earlier?
screenshot? gif is hard to read
hmm, oh I deleted it, but I can remake it, but the issue is still your weapon bp
How does the player access is?
(as in, how does the player get the weapon)
has a reference to it
so when i do input action shoot, get reference to weapon and run the fire weapon function
(is your weapon part of your character BP) ?
i use attach to component
since i want different weapons
and be able tos witch from them
Hey are there any good youtube tutorials you guys would reccomend for setting up ue4.17 for steam multiplayer? Side note, do I need to pay the $100 steam fee to get it to work?
Question:
Why is it that when I attempt to grab a variable within player state, I get null (from the server). But I get a valid variable result from (owning client).
Inventory is null when server
inventory has something when client
@willow finch No to fee.
And there's a million YT videos
Including Epic's official "BP Multiplayer" (more like lobby)
@wary willow When you say "No" are you saying "yes you need to pay" or "no you can test it without paying"?
@willow finch No to paying
So I only need to pay when I am ready to publish?
TY for saving me $100
PUBG killer here i come
gl
ty
TBH
I am like 99% sure you can create your own profile now for free
It's only when you want to publish that game you have to pay
Since I still have mine, and I didn't pay anything
(so you can use your game's app id, vice spacewars)
But not 100% since I haven't really had a need to actually submit a game up just yet 😉
@jagged goblet are you spawning it and attaching it?
Did you specify the client as owner when spawning?
Is the server rpc going through? You are kinda dodging to answer the print string question
@wary willow @willow finch For testing you can use 480 as app id. Once you want to properly setup everything, you'll want to have your own appid and pay the 100 fee
And there are differences in setting up steam and implementing it
Allar has a blog post on setting it up aka adding it to the project
Implementation is not documented well
My own
@willow finch To implement more functionality you need cpp or buy plugins
And use the Subsystem interface
Aka friends invites etc
@lament kettle is it always null?
Or just at start?
im spawning and attacking it from the player bp cedric
@thin stratus can you explain futher what you mean about "more functionality"
Everything that's not exposed to blueprint
Additonal SessionSettings like server name
Party system
Achievements might be exposed
Cards, friend list, friend invite
@thin stratus it's for some reason not getting the master inventory within the playerstate.
It's null whenever ran on the server.
GameplayPS == Playerstate
And grabbing the inventory there is null..
BUT if i do is from owning client, it works.
Is that an actor?
Because I want the...
oh.
Umm... so that there's a reference?
to who owns the inventory
Yeah but shouldn't that be the player
Who's inventory it is
- you could use the Owner parameter for that
the server created the inventory, but its attached to the player.
Get owner
It's a node
Instead of GetPlayerController
Each playerstate has the players playercontroller as owner
That's not what i wrote :D
Swap GetPlayerController0 with get owner
In your other screenshot
Technically you can just pass the owner of the playerstate
ah i see
To owner of the spawn node
That's the playercontroller then
You can getowner inside the inventory and cast it to playercontroller etc if you need any refs
This will also allow the client to call server rpcs inside his own inventory actors
thanks @thin stratus you da bomb :]
@thin stratus hey
do you know if i could use an AI Controller to make my turrets fire projectiles?>
because i know u cant call an RPC on an actor without an owner
and thest turrets wouldnt have owners
so im just thinking...
how would i make them spawn these projectiles?
lol
and also the rotation, and replicating this rotation
just wondering if u know anything about this off the top of your head?
if you dont its cool 😃
You need more detail than that
Char rpc to server to tell server to tell turrets to do a thing
@sweet spire ok, so lets say i have a forge, i want players to be able to put items into it, and have a timer where something is createed after 5 seconds
but in order to spawn th e new item in and remove the old ones
i need to call a server rpc
Yeah
no u dont rpc
then how?
how do i set it up to detect:
- Is there a flamable?
- Did the player attempt to ignite the flame
- how long has it been since ignition
- Remove flamable item
- Add crafted item
there's a lot to check.
Bool
Rpc to server asking server to try an ignite
Server tracks it, replicates float
Same as 2
Server updates forge inventory array
Yup its rep notify
On notift if true then enable vfx if false turn off
What sets it is server when player turns it on
Yeah thats the point
When its call on clients
The client will set there vfx visual of i5
It
hm
Its just a state the visual
On and off
When the var is updated it rep notifies to every client who has that replicated forge actor
Then there clients toggle vfx on or off
Make sense?
Constructor
Sets vfx
Based on bool
Or wait
Rep notify might fire
When they first recieve actor maybe
is there a way to set everything to be replicated?
no that be retarded
yes
Anim bp dont get replicated i think so
but i only set the variable to be replicated or have to create a Run on server event followed by a multicast event?
The var must be inside the pawn and reped
Var rep should be fine
Depends when ur rep tho
Whats the var type and what drives it
Ie, float jump height etc
its a bool
Bool driving blend space
Thats prob why its not working
As far as i know u cant drive blend space with a bool
Defeats the purpose of blend space
haha