#multiplayer
1 messages · Page 361 of 1
hi.. has anyone use ONlineBeacon before.. i'm wondering if port forwarding is neccesary for those?
So I'm still having strange MP issues with Role vs RemoteRole. Here are they, printed (role top, remote bottom)
The right pawn is weird. remoterole doesn't match role on the other one...
Still works, but isn't that strange ?
First pic is server btw
Is there no example of replicated vehicles ?
I for the life of me cannot remember who the developer was, but they were offhand talking about rewriting the character and moverment component in ue4. I dunno if they were going to release it but it did spark me to wonder how much effort would it actually take to rewrite the movement component and character to be both more generic
can anyone help pls? Client cant control a pawn that he got possessed into
Kudos to everyone!
Would it make sense for a card game, to create a session to each player and try to connect whichever is successful first and destroy the other session not used? Or could it cause problems? My goal is to connect 2 players as soon as possible, do not want them to wait or even worse, they both try to join but there is no session.
does the server call OnRep_Asdf() locally, if Asdf is changed by server?
C++ wiki says it doesn't, but in BP it does. Do they really behave differently?
In C++ I'm confident it doesn't
yea me too, plus last time I tried in BP it didn't either. It's weirdly inconsistant
It makes little sense to have it calle,d tbh
@twin juniper @stark dome A long while ago several of us posted on the forums to bring attention to issues with CMC (CharacterMovementComponent) and epic dev agreed with us but never responded with any sort of conclusion or timeframe. As for how much effort it would take, I know it inside out and can confidently say it will take an overwhelming amount of effort and time and skill/expertise. @chrome bay made the thread (@ in case you have any info I don't know about and maybe because you're the guy Ra.h was referring to?) https://forums.unrealengine.com/unreal-engine/feedback-for-epic/101132-suggestions-for-a-refactor-of-character-movement-s-netcode-for-better-diversity
Honestly if I had the time I'd love to do it myself, but Epic would need to $ me for me to even consider it (and I'd have to decline even if they did offer, which they wouldn't as they don't know me)
The "rewrite" for CMC they intend is initially just splitting it into several files/classes
Without actually changing the behavior or fixing bugs
(that's as far as I'm aware)
FWIW I got my multiplayer movement to work @chrome bay - going with authoritative server, custom physics.
Tried the auth client approach with real physics, but it was just as complex
I already have fake physics on many parts of the movement to make it more playable than real simulation, so it only makes sense
The Udemy course was hugely helpful - great value at the $15 price, even though I hate the fake pricing system udemy has
OnRep is calling when variable was changed in BP, whenever it is server or client, function called on both sides. If I change variable on client it calls function on this client. So it calls everytime var is changed.
But hat about C++? When OnRep function gets called?
@wary wyvern Pretty sure it's only called on client, in C++.
Mine is not calling on client either
But I guess the reason is that change this var on client before replication goes to me..
Client > Server > Others but owner client;
So I should manually call OnRep_MyFunc();
Replication is only server to client, so it will also fire on the owning client
The usual process is; call server method from client to set the data -> server sets the data and replicates -> clients get the new data + onrep event
Yeah, but I need client to react first, then call server event, then others but client.
So I chane variable on client and call OnRep, then call server event and change variable (Alse calling On_Rep), then other clients get var and OnRep fires on their side
That's not going to work, because OnRep will be called twice on your ownling client
No, it wont. Because OnRep is called on change. If I change it before replication recieved, so var will not be changed and OnRep won't be called
I highly doubt it's called on change
Called on replication recieved. But I tried, it is not called on owning client as his variable is already changed.
Anyway I set COND_SkipOwner, so Owner won't get replication
IMHO you need a method to process the new variable, like "ProcessVar". When the client changes Var, call ProcessVar(), and ServerSetVar(). Then in OnRep, test if the object is locally controlled - if not, call ProcessVar() again
Skip owner works too
What i'm skeptical of is that OnRep wouldn't fire if the variable didn't change.
@grand kestrel I meant to respond earlier - I have done a lot more investigation since then and it's definitely possible to split things off into more reuseable components and functionality, I've had some luck with it myself for my own movement comps. If Epic were to do it, it would almost certainly mess with a lot of games though.
whats the server taget for ue4.19?
@chrome bay Yeah that's why I always suggest leaving CMC/Character alone and doing a new one and doing it properly, it'd more or less be a replicated pawn and then a more-character like thing subclassed from that
@here whats the server taget for ue4.19?
@burnt meteor you’ve tried the 4.18 one and it fails?
Yeh I agree
Am I crazy, or was it previously the case that calling TearOff() on the server would cause TornOff() to be called on the client actor?
Because that's not happening, and looking at the code in DataChannel.cpp it looks like it only ever calls TornOff() if bTornOff isn't set.
Which is the opposite of how I remember it working.
I remember overriding TornOff being a typical way of handling client-side death animations and such.
Ha, nevermind, this is something strange with actors that are placed in the map vs. spawned by the server.
Hey guys, I want to spawn an Actor with replicated property. Is it possible to replicate this actor with this variable at begin?It need to make some actions on client at BeginPlay.
Only works if the properties are set before the actor is spawned
So, using BeginSpawningActor and Finish Spawning Actor. Between there, you need to set the property
then it'll be set to that value for the initial replication
@chrome bay I use SpawnActorDeffered(); Init properties and then finish spawning, so reference variables replicate with actor. But variable replicates later
Anyone familiar with how NetUpdateFrequency might break prediction, if it changes ?
Does it make sense to store a struct of gamemode variables such as round time / max players in the game instance temporarily when transitioning from the main menu to a game map? Trying to allow the user to customize the rules of the match from the main menu.
The gameinstance could then set the gamemode vars on begin play before the match gets initialized as it persists between maps. Not sure if I'm missing some other way of doing it
Well it worked great, so will use that method! 😃
@inner iris Hey, did you use the Udemy MP course as a learning base ?
I've been trying to prototype something, but even the reference project from the course has huge issues
I removed the NetUpdateFrequency override and added some simulated lag - it just breaks down entirely
@bitter oriole nah this is an older BP only project- will be rewriting in C++ later when it all works. I watched that course mainly out of interest but didn’t bother following step by step for the vehicle section as it’s not something needed for my game (but will def be referencing it for shooter lag compensation in the future).
Have you contacted the author of the course? That section is still in progress so maybe there is more he needs to iron out
Seemed really smooth from his tests at 1 update a second with 1000ms lag
Not sure if he changed those settings during the videos though
That’s pretty odd
Definitely something to bring up with him
Hopefully he finishes the section covering this as the last course they did ended pretty hastily
Yeah
Oh, well
The code obviously can't handle variable frequency
Which UE4 does
Can't handle != 1 really
@wary wyvern The short answer is that you can't guarantee that an actor's properties replicate in the same bunch as its initial spawn.
In most cases they will, but it's not behavior you can rely on. Sometimes they'll come in a subsequent bundle.
Specifically any actor references that the spawned actor has (so AActor* properties) won't always be valid when it first replicates.
Well, I've asked on udemy about NetUpdateFrequency.
How can I start with replication/multiplayer in C++ without blueprints? Anyone can give me tips, tutorials or blogs?
Has anyone got host migration working with listen servers?
@indigo hawk - can you be more specific with "host migration" ?
When a player is hosting a listen server session, if there are other players connected and the host loses connection, host migration would make another player the new host
understood there
hit me up PM
i'll be back soon - i have to run out hte house for a short while
Could be good if you could just post here since others could be interested in the solution if you guys have something
Yes, post your ideas here
For a fps do you guys prefer instantaneous client-side predicted impact effects or server authorative lagged impact effects?
I'm talking about blood effects for the player
It looks like neither UT or ShooterGame use client-side prediction for hit effects
The accurate one
@jolly siren For impacts I have it set up so that any non important (damage causing) impacts are client side but any important ones come through the server
If you show the player you hit an enemy but they didn’t actually, it’s more annoying
ahh okay
Don't show blood unless the server says it was an actual hit
Yeah plus other impacts are basically not important enough to replicate and waste bandwidth on, most people won’t even notice them
Right, but then they will all be reliant on latency
Always a trade off
Provide accurate info with a delay
Or provide instant inaccurate info
I can see both working fine
It is strange when a blood impact appears behind a player moving fast at higher latencies
But I’d still prefer that to being sent false messages about damage
And there’s always ways to get around it like not spawning it exactly where it was hit, but attached to the current enemy position etc
Yeah I spawn my blood particle system attached to the player.
Right now I'm using server authorative for damage hits. And clientside prediction for status effects like slow, stuns, bleeds, etc. And I'm running into obvious desync issues with the status effects. For example player running around with a frozen material applied because it didn't hit on server and did on client. Or a player with bleeding out particles but isn't actually taking damage server side.
If I use server reconciliation for those cases the player will still see the particles/material for a brief moment. Players are pretty unforgiving nowadays, so just trying to design it well.
You applying actual damage serverside only too?
And yeah I can see how that stuff can get inconsistent
yes
How’s that working out when firing at moving targets?
You notice you have to lead different amounts depending on the latency?
Talking with @bitter oriole today we've recognized that AGameMode does not appropriately handle APlayerController::Possess(InPawn) correctly for remote clients.... where as AGameModeBase works just fine. This is a huge problem - as AGameMode is required for anything utilizing MATCH STATES - which is not found in AGameModeBase.
Does anyone have any working solutions with 4.15+ projects using a LOBBY SYSTEM (Delayed Start specifically) and MatchStates from AGameMode -> and being able to handle pawn spawning from teh gamemode?
@jolly siren in those cases I’d probably do everything on server since they seem to affect the character / gameplay
Like stuns etc- it’s more important to communicate the accurate state rather than a more responsive client prediction
I'm not doing server side rewind, so yeah latency affects accuracy with moving targets
Ah yeah I found that to be a problem and had to start testing some client side / server validation stuff
Got frustrating for anyone playing it
Yeah stuns need to be accurate for sure, so I agree there. I'm not sure how forgiving the average gamer is when it comes to server reconciliation. I would assume not very; by the little overwatch stuff I've read on their forums.
If it leads to “bullshit” where they think they have done something but they haven’t really, then they won’t be forgiving. If it doesn’t really matter either way like a healing animation or something more minor, I think they don’t care or won’t even realize it’s off
Yeah that makes sense
Has anyone really even worked out a good way to do server side hit detection?
What do they do in UT/Fortnite?
Yeah, like do they do hitbox rewinding or anything like that?
Or do you just have to lead your shots proportionate to the amount of latency?
so - while you ARE GOING to have some replication lag with this setup.....
heres how i handle htis in my own projects
1: Run client side linetrace for hits - to do all client side things like particle effects, sounds etc.
IF HIT:
2: run server RPC with a line trace in it.... PASS THE START/END POINTS as args
now
when you setup the SERVER LINE TRACE
dont use the END POINT passed arg solely.....
calculate a direciton from start -> end
add a good 500 pixels
if you stop the line trace AT THE END POINT you pass.....
9/10 times you WONT HIT THE OBJECT on server
which is what you want to do
now
when server has hit the object
use your final code to apply damage
as its now VERIFIED HIT from server
and not a client hacked hit
The adding pixels part confuses me
That makes no sense in the context of vector math, lol
Ah, so trace slightly longer than the client?
no....
when you run the SERVER RPC
you have to pass an arg
for start & end points
to setup the line trace
so.....
i TYPICALLY calculate the end point in client
and send that to the server RPC
but i pad it some - +500 in the direciton its going
and not the actual HitResult.Location()
Direction of the line trace, or direction of hit actor?
direciton of line trace
by all means - you can just pass in the CALCULATED end point of your trace
By padding, do you mean that you are doing a swept sphere trace?
which - should be FollowCamera->ForwardVector * Distance
but
server doesnt have access to FollowCamera->ForwardVector()
Right, plus even if it did, the server's version of the camera direction could be wildly different from the client's
yah i've printed tha toff before
it could be like 30 degrees + out of sync
so thats why i pass the arg
so that its acurate to what the client is seeing
I'm still not following how you are adding "padding"
Are you doing a sphere trace or something?
ok here one second
so....
this is my client
StartTrace = FollowCamera->GetComponentLocation(); EndTrace = StartTrace + (FollowCamera->GetForwardVector() * InWeaponReach);
now....
you can SIMPLY PASS these variables
as args to your server RPC
this will work fine....
if you want to PAD endtrace at all
Right, with you so far
you neeed to calculate direction of this vector
and add some distance to it IN THAT DIRECTION
which would be:
CalcEndLoc.Normalize();
CalcEndLoc = CalcEndLoc * 1000.f + InHitLoc;
InHitLoc & InStartLoc are hte passed args in the server RPC
now....
this would be only needed if you passed in maybe say the HitResult.ImpactLocation()
if you were to simply pass in the EndTrace fromt eh client code....
why dont you pass only start and direction?
you'll be fine and DONT NEED to pad it at all
hey, so i have kind of a beginner question, i want to implement a standalone server, testable serverside is done and i wanted to ask where to beginn implementing the clientside part of it. Should i implement it into the projects code or do you recommend implementing it into the engine itself?
For your RPC, the InHitLoc is the hit location from your hit results struct, and the InStartLoc is your StartTrace vector from the client?
@tidal jungle - here's my DedicatedServer video instruction
Detailed steps on how to create a Dedicated Server with UE4. Very minor code involved - simple copy & paste from the below link. Very extensible... future re...
@native crow yes exactly
why i did it like that - i dont know
you can simply pass the ENDLoc from the client
will be fine
Hmm, and you've thoroughly tested this to make sure it's reliable?
100% reliable yes
traced with DebugSpheres & DebugLines drawn
100% accurate between client to server
now your going to have replication lag - especially if something is moving
if your even a frame or 2 behind from replication lag.....
your server wont HIT the object
but the client will see it as a hit
now hold on a sec i have a web page to talk about this
Good, cause if I'm understanding you correctly, then a moving object would not be hit on the server if there was any significant amount of latency.
From your description, it sounds like the trace on the client and the trace on the server follow the exact same line within 3d space.
@worthy wasp thanks for the video but not quite what i meant, the standalone server i want to integrate does not use the pre made server by unreal engine, its an own piece of software
perhaps your meaning an actual BACKEND server
which is completelly different from the OSS models UE4 networking modules have setup for authentication
a backend server would be more tailored towards a database
web server + php
perhaps a service you build for chat/login purposes
well, this server should handle players connecting, maintain their data (where they are in the game world, stats and stuff), the problem i have, i read a bit into the stuff and got told the server unreal engine offers is more for FPS (low player count high data rate) than (MMO)RPGs (high player count), and thats the way i want to go
or is that information outdated?
it is not outdated
to be more specific - you can only have a total of 70 players i think per map with UE4's OSS networking model
and if you get anywhere near that amount.....
your going to be reallybogging things down
what you probably should look at....
is something like GameSparks or another Backend As A Service model
there are a few - Photon Cloud, Amazon web Services
CloudForge
arent those just hosters for that stuff?
i mean the server still needs to be written codewise
and my bigger problem right now is the client integration, not the server itself 😄
so with these services.....
you would not use a dedicated server as much as you would their backend
which is typically JSON based
and you pass all your infomation via JSON requests/responses to their service
you simply program th FRONT END of the user experience (the client playside)
now therE IS another type o fservice
that you can use
its called SpatialOS
VERY new
very hard to get used to
not even fully encompassing UE4's architecture
theyre idea is FANTASTIC
yet
they dont have the API anywhere near workable
i dont like the idea of having just a "stupid" json based service and developing it all on the client side, for RPGs that might be well, but when we talk about MMORPGs thats way to much controll for the client
no
apparently you have MUCH TO LEARN bud
you understood that wrong 😄
json is stupid, it only text
and JSON is soft-compatible to almost nearly any developed backend
its a syntax for text how could it not be compatible?
i mean stupid in the way of, the service will save data it gets and output data that gets ordered to be outputted, but it cant actually do logical things like, how do you verify if the user really just dropped 20million gold? if the server just gets the information without even checking it (like a pure json service would do i guess) you loose all controll
lovely thing about JSON is the easibility of its requests/responses to encode & decode
bro JSON is a means of sending data yes
the SERVER AUTHENTICATION is what handles this stuff your talkin about
you dont build server authentication OUTSIDE of UE4....
you use logic checks with json, json is only a means of transfer
unless your going to program your own backend logic to do that.....
which would be pointless
thats what i was asking the whole time
as UE4 alreayd natively supports that
the server is its own piece of software, I decided against the native support from UE4 because of the player limit
so if you're going to bypass the authentication standards of UE4 - you would need to build your own au thentication model
which means the client therefore becomes a dummy terminal
what exactly do you mean with the word "authentication" like checking if the user provided information is right or actual user authentication?
i can see the loosely adapted wording of Authentication
so you have UserAuthentication - logging into a system
but in game development.....
you have Authentication - which is the SERVER having control over a variables replicated state that other users (or just the local client) can see
its the AUTHORITATIVE variable state
only if a variable is set to Replicate
ok good, got what you mean with it
I am fully aware i need to develop that system on my own, but aslong as unreals server supports low playercounts it is the way i choose to go
for a prototype to a MMORPG framework - your on the right track
i hav to go for a few minutes - here's a good read:
I know, I know, this is far from the first "How do I make the next WoW in UE4" discussion. Even so, new entrants into gamedev often come from the...
particularly the 2nd post here
its rather current as well
Ark is developed solely on UE4 architecture
they just recently merged to more than 70 players per map capacity
it IS doable - how .... i'm not there yet in my Kung-Fu
I have to say, I am new to the engine on its own, this is for me a POC and testing for future evaluation, I tried to get into the engine itself some time ago but start of university blocked my time shortly after. I developed rather small ingame systems for a really old game that had running code for server and client (so old it does not even have a real engine it runs on, just a bunch of frameworks [3d, sound, UI] thrown together) I might have some bad habits from reading through that code.
My position now is:
I have a running console client and console server that are communicating via the library RakNet, just simple packets for now, my question is where to begin integrating the players side networkclient?, in the project itself, or the engine source?
Anyone mess around with host migration? I'm trying to figure out how to best serialize the game state from the host when he quits and get the state info to another player in the match who then automatically creates the session for the rest of the players to join and resume playing
Hello, how to make the multi-platform client-hosting multiplayer ?
Can you clarify ?
I want make a 2D game like Move or Die and i wantt create online multiplayer with client host the party (for less server cost) and if possible create cross platform surport (PC players can play with Xbox players (for examples)) like Rocket League
I supose i need implement OSS of plateforms (steam, XboxLive, etc) or i need create a custom OSS and implement steam, xbox live, etc friends system
Cross-platform peer-to-peer is probably not possible, no. Depending on the platform.
At least I know of some console platforms that wouldn't allow it
Client-hosted PC is also a big problem because it enables cheating
You also can't have cross-platform friends, really, so if you're doing friend-based multiplayer, that's only on separate platforms
Yes i know in first i have idea to player only with friends but with that if you not have friens you can't play 😦
Finally, it's worth mentioning that updates on console are not up to you alone
If you do an update, it might be a week late on PS4
So generally speaking, cross-play between platforms doesn't really work. There is just a host of issues.
Not to mention you don't get on the XBox just by asking nicely 😃
Start on PC, do your game, make sure it works well, etc - and then see if you want to expand
yes i now, the cross platform on XBox and PS4 is for future (Switch allow indie games)
I can use OSS of steam and custom sessions implementation (on dedicated server ?) ? and Hosting sessions by the dedicated server are you big cost (performance) ?
I want this beacause i don't have money for pay steam licence
The $100 Steam fee ?
Getting on any console will cost at least an order fo magnitude more
And i'm confident you don't get on the Switch just by asking nicely, either.
The choice of dedicated server VS peer-to-peer is about cost, number of players, possibility of cheating. If you are doing PVP on PC, you need dedicated servers, if only because of cheating.
Yes i know (the console support is for the future (eg: next year (2019) if my game work))
if money is a concern, like most devs, your default choice is Steam ($100 isn't much) + client-hosted networking (can't do player vs player or > 4/6 players)
As an indie you should define your game by what you can do
The concept of my game is very inspired by Move Or Die
Is it true, that client RPCs only work in actors that are directly owned by PlayerController?
yes, I know that, my question was more about if the ownership has to be be direct, or if an acor may be owned by character, which in turn is owned by Playercontroller?
"To determine if an actor in general is owned by a connection, you query for the actors most outer owner, and if the owner is a PlayerController, then that actor is also owned by the same connection that owns the PlayerController."
From that I understand that the ownership does not have to be direct.
In fact I had an Actor, that had a character as owner, which in turn was owned by PlayerController in which the client RPC never got called. When I changed ownership of the actor to the PlayerController the calls came as expected.
I would then assume that something is broken in my character class.
Was the Actor replicated?
yes
also checked owners and roles in debugger, seemed to be all fine
also no warning about dropped calls in the log.
yeah, I have it running now with the direct ownership. I can live with that for now. I just wanted to make sure if I had a missunderstanding there with the owner requirements.
Anyone know why I'd run into the issue of my HUD being null on my server?
Works fine on the client
HUD is client only
each player controller makes one locally
so the listenserver should have one
he wont be able to access other pc's huds though
that's fine
I just need the local one
reports as null on BeginPlay
I might need to throttle a frame or two
in beginplay of what
My pawn
does the pawn exist before playercontroller?
It shouldn't.
The controllers are created in my lobby map, no?
I do servertravel from there
controllers are made in gamemode's login i think
youre getting the hud through controller though right
Yea, I'm adding some intermediary debug prints to see where it fails
maybe its controller thats failing with null?
seems weird you'd get non-null on controller but null on hud
Yeah checking it out now
hud is spawned is postinitializecomponents
hmm, that seems to be the case, the playercontroller exists, but the HUD returns null
alright, let me shuffle around some of the code
wait, look at this
if ( GetNetMode() == NM_Client )
{
SpawnDefaultHUD();
}
so it really doesn't exist at all on the listen server?
yes and no
it appears the controller creates its own hud based on default AHud class
but then later, gamemode overwrites it with the selected hud in gamemode
I think the safest thing to do here is to abandon my "Use the HUD as a sort of widget manager" design approach and move stuff over to the controller.
yeah, your client could actually be getting the wrong hud class
while your listenserver fails because it doesnt have a 'fakehud'
did you check to see if client's hud pointer was of the correct class?
just as a last test, I moved my code to PossessedBy() from BeginPlay()
yes, it's correct
eh weird
pawn prolly shouldnt know about hud in the first place though
let hud poll pawn, or listen for pawn events
I wish I could step through the code but I can only do listen server when not running the editor...
Ok so the HUD object is null for 3 frames following the creation of my pawn...
weird
That'd make sense if I wasn't testing on my own PC with two instances running.
i've grown accustomed to polling for pointers to set static references for them
picked that up from Mike Allars Generic Shooter project
but in either case, I've just set up a timer to check for the HUD every .5 seconds so it's no big deal
right now I'm struggling with my component not wanting to replicate values
anyone had any luck replicating collision settings?
@calm plaza - can you be more specific?
maybe as to what your NOT seeing that you expect to see?
@worthy wasp Well, when host player picks up an object (not with physics handle but by disabling sim phys and collision, then attaching to player) collision is disabled on host but is not replicated to client. client players sees host player stuttering due to collision of held object. tried many different ways to disable collison on client (multicast, run on client, etc) nothing seems to work.
when you pick it up - are you doing it in this order:
Pickup Locally
Pickup Server
Pickup MCast
?
your SERVER should disable the collision, as well the Local
MCast should just be picking up the object
running the set sim physics and attach on the server seems to work well but the collision does not.
again - what point are you doing that in?
client - server ?
you FOR SURE need to do it as server - but also client for local viewpoints
i think i understand but every attempt i have made to replicate "Set Collision" has failed.
i have run the pickup sequence on both client and server and server alone. tried everything i could think of.
so out of curiosity
@calm plaza
is the item youre picking up set to bReplicates = true; ?
not the component - but the whole AActor
It is.
forgive me - was posting an answerhub question
ok what about the StaticMeshComponent - is it set to COmponentReplicates = true; ?
@calm plaza
and can you post your code for the pickup methods?
Im working in blueprints but yes one moment
Process starts with a server run line trace. if the hit actor has tag "item", this code runs. thoughts?
this is just my latest effort based on this: https://answers.unrealengine.com/questions/257396/set-actor-enable-collision-not-replicated.html
and again, i've tried to do this without the collsion variable route but it didnt work either.
By the way, thanks for your help, @worthy wasp
noat making heads or tails or your top line here....
what level is it at? Local/Server?
the funciton ServerNoCOllision() you're not passing in any arg
you need to pass HelpObject
otherewise your not utilizing RPC correctly
hold on let me chicken scratch on them....
on esec
the top line is located in the player character blueprint. happens if the line trace hits actor with tag "item". runs on server
for starters
setup your SERVER RPC Like this: http://puu.sh/yLw4v/c626d3d812.jpg
take away that var for HeldCollision
i have tried it without the variable. its just my latest effort.
same result with this straight forward approach (no variable). sorry for the spaghetti. working quick
ok this SHOULD get you through
but i've not tested it - i'll let you try to replicate it and see if you hae good results or not
the MCAST MAYBE not needed
and i'm sorry - i forgot to set it to NETMULTICAST
if this shows up on OTHER CLIENTS - then the MC isnt needed
if it doesnt - try to hook up the MC
I'll give it a try! Thanks, friend. By the way, if this game if ever complete, you absolutely will get a copy. (hopefully thats a good thing haha)
one issue i see with your suggestion is that collision isnt altered in this method. being that collsion isnt auto replicated by the engine, i'll have no luck.
bah forgive me
right before SImulatePhysics node - set the NoCollision
form the StaticMeshComponent
@here best way to create a dedicated server without errors?
Detailed steps on how to create a Dedicated Server with UE4. Very minor code involved - simple copy & paste from the below link. Very extensible... future re...
watch the video - i've had nothing but excellent reviews on that
then you did it wrong 50x
yes lol
this is tested & proven to work 4.18
i got ue4.19
i'm headed out the door real quick to get some food - i'll be back in about 20 minutes
hit me up a PM
i'll msg you back here shortly
@worthy wasp IT WORKED!!!!!!~!!!!!! I'm am willing to have your babies! How can I repay you? I've been working on this for soooooo long!!!!! Thnank you!!!!
sorry different issue. i was working on collision replication.
ok
great to hear @calm plaza 😃 Replication takes some getting used to! I feel like some days i got it... other days i fall flat on my face lmfao
Does blueprints offer a way to "use" multiple subsystems? For example: combine the amazon login thingy with the default online subsystem so my servers/etc. work, however, my users can log in using amazon (or whatever, if I'm not mistaken the amazon thingy is an auth provider). I'm pretty sure you can "select" a subsystem in c++ when calling functions, but was unable to find such functionality in the blueprint version. Is there some way to do this, or will I be required to use c++ for this? 😃
@loud sage Uh... Online subsystems isn't your server, it's the online platform for stuff like login, matchmaking, friends
Not sure you can concurrently use two subsystems in C++ either
u cant i am pretty sure in both
Yeah that only makes sense
Dunno how you could login with Amazin and then do matchmaking with Steam
Hm, I misunderstood then I suppose 🤔 Thanks for clearing it up!
IOnlineSubsystem::Get(FName("Steam"));
``` in c++ got me confused ^^
xD
u can make a dedicated server or ur own subsystem to slove ur problem @loud sage
i dont have much knowledge(as i just started dedicated servers & port forwarding)
I mean, you're always going to need your own servers no matter what (unless you go with client-hosted)
I'm considering building my own, however, I would still need to rely on another subsystem (meaning I'd essentially need a 2 system setup). I could probably merge them though 🤔
Online subsystem is just the login, friend, achievements, matchmaking etc - just metadata around the game, it doesn't do any server stuff
You need the online subsystem for the platform you ship on , game servers are an entirely different thing
And yeah - you'll always need servers, but doesn't the subsystem also handle how things are replicated? 🤔
Oh really? Cool 👍
Online subsystem basically doesn't touch the game
yes @loud sage
The onlinesub is about player identity, basically
yea
Yeah - now I recall, sorry, I was messing a few thigns up ^^
No worries
hm...
To clarify, online subsystem is also optional. You could just do it the old way and tell someone your ip
Anyway, if I'd want let's say steam's approach for matchmaking, but for some strange reason wanted to create my own leaderboard, my best way to do this would be to not create a subsystem at all (as I can't use both steam and this custom thingy)
Then have your game do "open <ip>"
Yep
@loud sage You can just use Steam for everything and have your own ladder service, whether it's a custom online subsystem or not
dedicated server's are best for security and cusomisation
Yeah - that's true. I think I know how to implement this now 😃 Thanks a lot for clearing a few things up 😃
but it comes at great risk
A ladder can just be two PHP pages - one that you call from the game with a simple POST request, and one for display
Simple as it gets
steam is a bit tricky at times
Yeah - servers are the reason I haven't ever done a ton of MP 😛 You need a game to attract users, but then you also need users to keep the servers ^^
@burnt meteor Dedicated servers are cool, but that's entirely unrelated to Online Subsystem, to be clear
yes i never said they were lol 😛
Yeah, just being clear here since that topic can be confusing 😃
@bitter oriole but u can make a steam dedicated server 😃
Well, what's a Steam dedicated server ?
Steam doesn't do hosting AFAIK
Steam does matchmaking
The server is yours to provide
Once you have a server up, Steam does have a service to connect that server to players looking for a game
no i mean u can host it on steam
I've never heard of Steam offering that service
To the extent of my knowledge, Steam provides the cheap and centralized part of multiplayer - matchmaking.
Servers are your own problem
Well yeah
"You can't host dedicate server on Steam"
"you or user of your game will need to host it somewhere"
Like I said
Has anyone written lag compensation that works with a characters physics asset?
@jolly siren I haven't, and from what I gather, physics with network in UE4 are pretty hard
@jolly siren what about vehicle collision bodies?
It would be similar, but yeah I'm specifically talking about character lag compensation
no, i couldnt figure out how to get animation and times etc.
i ended up adding custom hitboxes to sockets and recording position/rotation on those
when you add in blending, recording and playing back animations for lag compensation seems to get quite difficult with the UE4 implementation
damn alright
its sad, since it would certainly be much cheaper to just store char location and animation type and time
more elegant too
animation system doesnt appear to be designed to be precisely controlled from code though
It seems like I could at least use the physics volumes instead of creating another set of hitboxes
yeah, but i tried getting positions from the physics asset colliders
didnt find out where they were stored though
probably some convoluted and poorly documented place
feel free to give me a heads up if you do find it, since i hate dealing with this second set of colliders myself
Looks like this stores the shape https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/PhysicsEngine/UPhysicsAsset/SkeletalBodySetups/index.html
Array of SkeletalBodySetup objects.
But it says the body positions is taken from the mesh hmm
yeah i remember digging through those classes
but it didnt seem as straight forward as an array of colliders anywhere
@rough iron Have you written lag compensation that uses the characters physics asset volumes?
Dang that really sucks. I found this gem http://blog.bluecurse.com/2017/09/18/lag_compensation_part_1/ but it would require keeping a separate list of hit boxes. I'm already using the physics asset volumes for ability collisions. It seems like I should be able to get the location/rotation of those volumes somehow.
Okay, I wonder how Fortnite handles it
No idea
I would just modify the engine
And saving the colliders positions within the phyasset
And use that data instead of the asset when tracing
But is engine code, no idea if use a source build
Yeah I use the source build for dedicated server stuff. It's ootb right now tho
Ok
and adding a new component that just records the array of colliders?
Like a proxy
Then you just have to use the proxy instead
Yeah, that makes sense. This comment had me hoping that the volume positions were already easily accessible.
UT really just uses capsulecomponent for hitscans?
Would have to check
I would much rather keep using the physics volumes for hitscans
I'm actually pretty surprised that there is zero info out there for physics asset lag compensation in ue
Yep, I'm about to write a component that just does that, record and rewrite
That is awesome. Let me know if you end up being able to share any of that because it would be immensely helpful.
i think most commercial games use far less detailed hitboxes than physics asssets
hello there. in BP i have a eventdispatcher in my playercontroller which I bind to in my hud. i call this event in my controller when i respawn the pawn. how do i get this call to happen on the client only (it should update the hud)? my respawn function in controller is set to "run on server". i tried a call to a new event "run on client" and trying with different "is locally controlled" and "has authority" but i dont get it.
any hints? I'm struggeling with ownership and authoritiy on the controller all the time. it is so hard do distinguis between server and client
and when i call event foo with no rpc settings from an event bar which is runonserver - whats happening to foo? run also on server? runs on server and simulated on client? so how do i come from "run on server" to the normal flow
there is no 'normal flow' per se
tick is the closest you'll get
but that's not necessarily active
you'll have to keep track on who would initiate a certain chain of functions
i can't use tick. i want to react in my hud on the client only to an event triggered from my controller on the serverside.
is there no node you can rely on to get if you re the server or the client? i thought "is locally controlled" would be the closesed but it is still true for a client controller on the server (which is technically locally controlling)
when i set an event to "execute on owning client" i would thinkt it is ONLY called there! - but it is not - it is called on the server AND client
i think this is what you mean
on listenserver yes, since listenserver is also client
shouldnt be called on dedicated though
it is player-v-player - so i will not have a dedi
right, but presumably you want it called for the server player too yes?
the server player has a hub that needs updating right?
hud*
no. every player has a hud on his screen. the server should call his update hud only when "his" pawn is respawned, and the other clients should call it if they respan.
sorry I'm not a native english speaker 😉
yes, thats what i mean too
when you run a client rpc on a specific player's controller, it'll run only on that client
not if it is called from an event which is set to "run on server"
where my respawn player is set to
a server rpc calling a client rpc will still only execute that client rpc on the client
no
wait i'll take a screenshot
the clientRespawnedPlayerDel is called both - on server and client
right after the printstring it is calling an eventdispatcher which my client huds are subscribed to
hmm it shouldnt be... I take it you know by print string running on both client and listenserver?
how's respawn called
yep. it is telling me twice the print string - once with server and once with client1 prefix.
i call it from my pawn in the event destroyed.
don't mind - i've worked around it ... but it is something i'd love to understand 😄
Anyone elese than myself & @bitter oriole getting these issues with AGameMode not possessing remote client pawns properly? Exact same code works FLAWLESS for AGameModeBase.
https://answers.unrealengine.com/questions/738978/agamemode-spawnactor.html
@worthy wasp yes i have similar issues! can't correctly possess a pawn when running a dedicated server, but it does work with a listen server
I am calling Super::PostLogin() on my inherited GameMode though
im inheriting from gamemode and doing this
APawn* NewCharacter = SpawnDefaultPawnForPlayer(KilledPlayer, PlayerStart);
if (NewCharacter)
{
KilledPlayer->Possess(NewCharacter);
}
works fine
could it be the VM?
huh?
@manic pine just commented Super::PostLogin and put your snippet, it's the same behavior. i have the viewport of the clients' pawn but no input to the pawn, it's like a halfway initialized controller?
the unrealscript virtual machine ere... im just throwing something out there though ^____^
weird thing is, PIE client does have input, other clients dont. (starting 3 clients (one PIE, 2 separate threads) with a dedicater server)
one client with input and two without? and on a dedicated server
yeah. I click play on PIE, with 3 players and a dedicated server, all on different processes. PIE has input, others dont
if I build and launch server and clients (so no PIEs at all) none have input. In all cases, I have the correct pawn viewport.
Hey guys, I need help for making a game mode for my multiplayer game. The game mode is called infection, its like, 2 player spawn as a zombie and needs to kill the survivor and when every survivor become infected, the round is over and more round can be added.
If anyone can help me please : D I would be so happy! Thanks!
None of the example profiler screenshots I've seen have "BP" on them. And I definitely don't have "BP" class. Hmm I'm going to profile something else and see if it has this
Hi folks
Question about listen servers
How can I differentiate from the host's player controller and other clients' controllers?
Will the host always have a controller index of 0
Where can I find that
Ah I see
It's a part of the World
Brilliant
Using controller index of 0 to get host's controller would give me issues if I run a dedicated server instead of a listen, but this solves that
Cheers @pallid mesa
my port's are forwarded (7777), and i have a static ip, firewalls rules are fine, and i can connect to my local ip : 127.0.0.1
@here
DM me for more info
Detailed steps on how to create a Dedicated Server with UE4. Very minor code involved - simple copy & paste from the below link. Very extensible... future re...
tested to work as far as 4.18
he doesnt show how to connect with ur friends
sorry - that is simple functions of FindSession & JoinSession nodes
havea read - all you'll need to know:
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/OnlineNodes/
Describes the different kinds of Online and Error Related Blueprint Nodes.
i should note - as its not INHERENTLY stated.....
i am running a dedicated server
all users need to be connected to the server for this to work
sorry man
i can connect with this ip 127.0.0.1
i assumed a session joining thing....
you need to use a ConsoleCommand -
i'm pretty sure its in that video of mine
i can connect with this ip 127.0.0.1
not my external ip
which is beyondfantasy.ddns.net
Please help
pings timeout - is your IP: 45.251.34.69 ?
what is your CONNECTION code that you use to connect to server?
it should be a CONSOLE COMMAND
with the following:
open 45.251.34.69
not working
when you say your SERVER isnt connecting....
you do understand that a dedicated server setup....
the server IS THE DEIDCATED SERVER?
it never connects to anything - as its constantly running
watch my video and understand how a dedicated server is both programmed and launched
i'm VERY Detailed in that video
its bulletproof
then where are you failing at?
my port 25565 is open cause i use it for minecraft
25565 is open
ok so yah
but 7777 is closed
you didnt watch my video that well
fine 1sec
or read up any of the documents on dedicated server
7777 is the default port for servers WAN connections for UE4
make sure its open
and make sure your firewall/antivirus have exceptions for it to run
i dont have anti virus and its also disabled
alot of AV's block the server portion of UE4
no thanks man - take no offense
what am i doing wrong?
this the server problem for sure.
an dforward port 7777 to the IP address (internal) of the computer running the server
ok so
as my video shows....
run hte SERVER ont his machine
then
from anothe rmachine
try to connect to it
same is fine - if you have your IP of 45.251.34.69 set in the console command.....
it will route out of hte internet
and back in
which is a good test anyways
my text box handles that
tells you your port forwarding will work
i have no information to tell you why its not working. my video is VERY explicit - as its a very detailed setup to get it to work. There are settings you need to do in the project.h file, as well how to run the dedicated server in the first place.
Is your server LOG showing up when you rn the server on your machine that should be hosting the server?
yes
in your remote client - can you hit th ~ key and manually type in: open 45.251.34.69:7777
when you do this - check the LOG on the server - does it show a connection attempt?
i dont know man - i didnt program your project.
u know whats ar eally good question for you.....
how are you testing your connections?
are you using PIE to try to connect?
is this a packaged .exe that your testing from?
are you testing Standalone in editor?
all i have tested
all have VERY different settings to setup
i urge you to follow that video i have to the T
ur video i followed excatly
i think i have found the problem
there's a invaid gameinstance
how can i get a reference to a remote character in a client multiplayer game
depends on how you retrieve that character @twin juniper
theres several ways - raycasting -> HitResult.GetActor()
wait
if i get a playerarray woner, it won't work for remote clients
*owner
because you can't reference a remote controller, right?
PlayerArray = array of PlayerStates ........... PlayerState->GetOwner() returns the playercontroller yes
so this would ONLY be useable inside of gamemode
yes, but it dosn't work for remote clients
as teh server has reference to ALL/ANY controllers - but clients do not
can you be a bit more specific to what you're trying to pull off?
theres several methods you can use to get remote clients references
i have a replicated list with "playerids",
scratch that
i want to be able to loop through all character references
on a client
simple as that
i know i can use get all sctors of class
but i'd like some more elegant solution
player array won't work, because of a controller issue
so i'm not sure what else do i have
well to be honest - unless you RPC chain up to GameMode and back down to your Character class.... thast the only othe roption
and dont mistake what you just said.....
PlayerARray = an array of PlayerStates
its great utility!
if you setup replicated variables in Playerstate - all your remote clients will have access to whatever you replicate in here
so should i replicate character reference in playerstate? will that work?
then @burnt meteor you are not following that video. its bulletproof i assure you.
no no zrmanja
and i can connect like u
i'm just giving out some examples
to be honest - GetAllActorsOfClass will be the best utility to get all the players connected in the game
its listening on port 7777
from the CHARACTER class (remote player) that is
no u can do a event portlogin in the gm and add it to an array and u can call that
walldiv someone told me that's not too efficent, can you confirm?
yes it not
can you please tell me what efficiency you're looking for?
see epicgame's tutorial
your polling the entire world for 1 class type
don't know 😄 will it slow down my game
eg. updating chat box -> get all players and> update
do you have 1 billion characters logged into the game?
nope
1client>joins>add's to the server's list>in an array
again - its what you need/want to do with the GetAllActorsOfClass<ACharacter>
@burnt meteor - again.... GameMode is only accessible from the server - not remote client
allright, i'll go with GetAllActorsOfClass, as its the simplest solution.... thanks mate
Carrying a list of players in GameMode is pointless - as you already have that list in GameState via PlayerArray - however this is a different list.
I would also save the PlayerController in the game mode in an array and iterate over that instead of using GetAllActors.
Specially since UI shouldn't be sitting in the character and a simple client rpc on the pc array would allow the specific ui uodate.
PostLogin and Logout is enough to keep track of the PlayerController / Players who are in the game.
@worthy wasp i finally solved it
it was a silly mistake but for anyone else who's stuck
the problem was i dint add a service for udp in my router
so remember to add tcp and udp
=============
but for some reason my port is not open
Some time ago there was a discussion in this channel about when Replication-Notifies (UPROPERTY(ReplicatedUsing=x)) are being called. If they are only called, when the property actually changed its value on client, or if they are alwasy called on each replication.
Well, I stumbled across this in UnrealNetwork.h:
/** Allows gamecode to specify RepNotify condition: REPNOTIFY_OnChanged (default) or REPNOTIFY_Always for when repnotify function is called */
#define DOREPLIFETIME_CONDITION_NOTIFY(c,v,cond, rncond)
ONLINESUBSYSTEMUTILS_API void ApplyVoiceSettings(UVoipListenerSynthComponent* InSynthComponent, const FVoiceSettings& InSettings)
How can I apply settings to VoIP?
@thin stratus Is there a way to run Server RPCs on a Client?
Or a Listen server
But the listen server is just the client (single player sort of mode)
@twin juniper - isnt that the inherent nature to pull off SERVER AUTHENTICATION on remote clients - via Server RPCs ?
@twin juniper if you use the rpc just as a proxy which calls the real method on each end you can just call that one.
What do you mean?
@twin juniper you know that you m entioned couple thousand people rn?
@everyone can someone replicate some animations for me please? i'll pay him/her!
@everyone if interested message me
dat mention spam
What do you mean...
@void bluff i mean replicate (so all clients can see the animations for multiplayer)
Is there any reason why the rotation of my Mesh on ACharacter would only be rotated properly on dedi server mode?
The mesh literally gets changed from -90 on Z to 0,0,0
dedicated server mode works fine
and im never calling something like SetWorldRotation()
im just passing it directly into the blueprint skeletal mesh component
in details panel
probably because you are doing it client side and the server (as the player) needs to know, do you have it like server rotates properly and client 1 sees it, but not the opposite, right?
@twin juniper
It's so weird...
If I open a listen server... The server rotation is all jacked up
But if I connect another player
that second player has EVERYTHING WORKING
just like how i have it on my dedi server
is there a way to create a listen server, but not have the bullshit that im having?
lol
Are you doing something like if(!HasAuthority()) or if(role < ROLE_Authority)? The listenserver has the authority, so code in such if-blocks would only be executed in real clients.
Oh
Yeah
I use that EVERYWHERE
because its necessary lol
Is there a way though to just make my listen server act more like a client?
I do follow this scheme
If i have authority i execute the function, if not i execute it on the server
The function inside will check if isServer and it has authority (yes again)
If yes i multicast only to remotes skipping owner
If not i just continue the execution of the function
@twin juniper
You could also use GetNetMode() != NM_DedicatedServer instead of querying the authority.. Wonder if thats a common pattern for implementing deticated servers? I only did listen server so far, so I have no experience in dedis..
This works on both listen and DC
If you read the blueprints slowly you'll understand why this makes sense
If you have any question about any of the nodes just ask
Why does no one has ever replied to my messages any time?! So I joined this discord for nothing, every time I comment here and ask for help no one help me nor reply to me. ITS DEPRESSING!
As I said multiple times, 1 time:
How do I make my mp game hosting site so I can join people online and play with people like, which site should I pick up and can it be possible with blueprint only? I don't do c++.
Second:
How do I make a game mode called Infection, like, some people play as infected and some as survivor and infected needs to kill every survivor and the last man is the winner.
Please someone help me! I've been stuck trying to make these thing and no one has ever helped me! PLEASE 😄
Now please, someone need to at least reply to me! please 😃
I even messages UE4 on their twitter and they read my messages but don't reply. Which is more and more depressing
Those are very general questions, provide us with code or concrete doubts. What is not working on your gamemode? Did you try to follow tutorials about listen server programming and testing?
Also if you are looking for a dedicated server solution you'll have to go through C++
I tried making a infected game mode but I cannot make it, like, how do I check people and do like, if 2 more people are online 1 more people play as infected, so like, when there's 12 people, there is 4 or 5 infected, and when is 8, there is 2 or 3 something like that.
Buttt
I won't be able to host with my pc all the time!
Is there a way to get a hosting site that work with UE4 where it can host my game mp + host the server browser?
Welp, no one is replying I guess no one can find a solution..
@agile crane
You are basically asking us about how to implement your game idea, which we cannot answer at all, because there are thousands of ways doing it.
I would suggest either to talk to a software developer friend of yours, if any, or hiring someone doing the implementation, or even going the hard way of learning all you need to know by your own, but that may take you several months or even years.
A good starting point is watching the UE4 tutorials on UE4s youtube channel.
I know nothing about game hosting solutions.
@agile crane you are asking for a dedicated server
I've searched for tutorial and there's none good tutorial especially the UE4 yt channel, its the most empty UE4 tutorial channel.
Yeah but how would I host it?
You will need to hire a server first and compile the engine for dedicated server
In your server computer you'll execute a bat with some commands probably relying on "advanced session plugin"
I suck at c++ and all the time I try to do stuff with visual studio it cannot work.
And you'll have your dc server up ready for players to join
But my pc will host the server? And will it auto detect the blueprint inside the game? Like, I've made a lot of stuff that work lan, and I even can join myself with two computer at my house and it works lan.
If you are hosting and playing you are doing a listen server
If you want players to host like you do
You dont need a dedicated server
Will be good if you could read a bit about networking because all i see here is a conversation with no end
I'm so confused, I tried joining my game with other people around the world and we cannot find each other!
I'm so confused a looot, Idk what to do
okay
but where?
Internet in general lol
I tried searching for make a dedicated server or server and stuff nothing is useful
Maybe wrong google searchs t
There are pretty useful youtube tutorials for beginners
not for me let's just say that
Even EpicGames has a networking guide zero to hero
Anyways dead end conversation
okay
I'll just cancel my game and stop making game, nothing is useful in my shitty life.
Hey, we all started learning at some point
Dont pretend to do everything the first day you start researching, also it is clear you didnt research enough
I did searched a lot. Since like 5 month I've been searching for making a hosting site and I tried getting a hosting site but it cannot seem to work with UE4 or its overpriced and I'm a poor kid without money.
Sup
Follow some tutorial to get multiplayer shooter running than add some infection mechanic and you are done
Before I work into infection thingy I need to make my game playable and being able to join online first of all.
I've been invoked here. Tell me your wishes
Muit 👀
Thats my name, not a wish
But can it be possible to get a hosting site where I buy it and put my game on it and it works? And about dedicated server.. Will it detect the lan system and will it work online?
I also did a UE4 post for help multiple times and No one has ever replied to me, its why I am depressed, everyone ignore me.
Hold on glitch let me break it in parts
I also tried gamesparks but it doesn't seem to work I cannot join online even with matchmaking.
1 - if you want to hire a server to put your dedicated server there you need first to know how to do a dedicated server
2 - Your programming should be compatible with dedicated server
Making a mp game is not only "putting the game on it and it works"
Also muit is right
I found some useful tutorial for dedicated server so how do I after made it and put it online and hosting all the time?
and yeah
Before I waste 10 hours making everything I want to know if it works, I already got these kind of problem where I follow a tutorial and at the end it doesn't work and UUUUUUU its so annoying.
You will need to follow allar's tutorial about dedicated server ue4 compiling, doing a dedicated server for your first mp project is... Well, not recommended
uhh cool but how do I do that? Lemme search what you said
If you want to do what muit said you depend on your players
Because you have no computer hosting but people
It wpuld be the classic "play with muit" screen from a player perspective
I'm kinda confused...
I did that it works lan
I can join myself with two pc on my house
Well, ue4 uses an specified port to connect
You need to open that port to be accessed fro m outside, and specify an ip
And allow all the entry connections
Ohhh I get what you mean
but where inside the game do I edit the port to search the game?
Ue4 provides certain functions to connect to another game
If youwant to connect from outside, you first need the IP
You can join using your console aswell
Yep
Yeah but it cannot work with other internet connection
open ip:port
where?