#multiplayer
1 messages · Page 581 of 1
@soft girder images too low res
Question on roles and replication: All my clients are getting local role Authority (and remote role SimulatedProxy which seems right), as well as the client on the listen-server. Shouldn't the local role for clients be be AutonomousProxy, and Authority only for the client running the server?
@wind onyx Not sure if i understand your question, but clients only see remote. Dedicated server and listen-server only see Authority.
@soft girder I wouldn't use multicast to fire a weapon, I would only use multicast for particles.
once you fire in your pc and send to server that's good enough
in the child only the particles get ran on the multicast
we have a bunch of childs that worked up until yesterday
@viscid escarp All my clients are getting LocalRole as Authority on a listen server, I'm wondering if this is correct or something is off. I am spawning the characters on the server and then letting the client controller posses it.
It's normal
can anybody explain whats wrong with this
@soft girder Does not make sense the (Switch Has Autority)->Remote. If you want server to call "Weapon fired" just delete "Fire Client" and server will still call the "Weapon fired". Inputs are always readed by the caller and server.
i had it like that originally
ive changed different combos just trying to get it to work. the weapons are fake client instances
they are replicated
they are only for visual
wait
if i delete fire client it will only fire on server side
yeah, in both cases "server" is firing, why are you checking for Autority?
Anyone know why I could potentially be crashing when calling SessionInterface->CreateSession(..)? From the OnlineSubsystem ?
its really the same as this is it not?
if i remove the client to server ones the clients never fire at all
yeah, now you are telling server to fire and then server tell everyone to fire.
if you are only try to show particles, just multicast the particles, no need to call server
but if you are tracing and causing damage, run on your pc + send it to server
check
the particles are fired from a multicast event so everyone sees stuff coming out of the same instance child
i have went in made new multicast events and no matter what they dont fire
the particles
the event itself only happens on server even tho its marked multicast reliable
not sure what has caused it.
its very frustrating to build a new parent and make the same thing
when i take an empty actor and wire it up the same it works
i took an earlier version of my build without animations and it works
i cant figure out why a parent bp would break like this
@viscid escarp All my clients are getting LocalRole as Authority on a listen server, I'm wondering if this is correct or something is off. I am spawning the characters on the server and then letting the client controller posses it.
@wind onyx basic events(inputs, begin play, tick, etc) are always fired by server and owning client, so Authority will always be fired. Recommend you to read multiplayer compendium by eXi: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
@soft girder okay, try not calling fire from server or multicast, just directly connect the fire event to is valid
same
lol
i thought for sure that would work
passing the client straight to the instance of the weapon
that was a good idea tho
Anyone know why I could potentially be crashing when calling SessionInterface->CreateSession(..)? From the OnlineSubsystem ?
@twin juniper invalid player state or unique ned id probably(just a shot)
a one to one copy works but its not a child of anything and cant be referenced by the held weapon pointer
this is nuts
@twin juniper invalid player state probably
@viscid escarp I'm not following. What do you mean an invalid player state?
I have a GameInstance class in which I'm calling CreateSession like so.
IOnlineSubsystem* Subsystem = IOnlineSubsystem::Get();
if(Subsystem){
Session = Subsystem->GetSessionInterface();
if(Session.IsValid()){
//bind delegates here
Session->OnCreateSessionCompleteDelegates.AddUObject(this,&ULobbySessionGameInstance::OnCreateSessionComplete);
}
}
}
void ULobbySessionGameInstance::OnCreateSessionComplete(FName ServerName,bool Succeeded){
UE_LOG(LogTemp, Warning, TEXT("Succeeded %d"),Succeeded);
}
void ULobbySessionGameInstance::CreateServer(){
UE_LOG(LogTemp, Warning, TEXT("Creating Server"));
FOnlineSessionSettings SessionSettings;
SessionSettings.bAllowJoinInProgress = false;
SessionSettings.bIsDedicated = false;
SessionSettings.bIsLANMatch = true;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
SessionSettings.NumPublicConnections = 5;
if(Session.IsValid()){
UE_LOG(LogTemp, Warning, TEXT("Session was valid"));
Session->CreateSession(0,TEXT("My Session"),SessionSettings);
}else{
UE_LOG(LogTemp, Warning, TEXT("Session not valid"));
}
}```
Then I have a Level with a UI and a button which calls GetInstance()->CreateServer
The debuglog prints out "Session was valid"
oh wait, @soft girder who's owning the "Weapon Fired"?
the player
But OnCreateSessionComplete is never called and it crashes
i tried looking into that
player or gun?
player
@viscid escarp This is the error it gives https://media.discordapp.net/attachments/221799385611239424/768986687136727060/Screenshot_2020-10-22_at_7.58.30_PM.png
you see, If i'm not mistaken you can't call the server to do something if your actor don't own it.
so if player is the parent
can't call the server and execute something in the child
you have to ask the child to run it on the server
it works on last build tho
ill change it tho
thank you very much @vivid prawn
❤️ from all of us
but we moved it to execute on all tho
hang on ill show you
this is odd
prob bad setup
the only thing that bothers me is that we had it set up exactly like this this morning
the only difference was that the held weapon events were run on server
those events in each child split up. the particles come from a multicast and the server call goes on to tick damage and nonsense
wow, nice, guess you figured it out.
@soft girder Just a note. You shouldn't need to switch for input stuff. It works the same on a listenserver if you just call a server event on the server. So you can simplify those functions by just saying InputEvent->ServerRPC->Functionality. And it'll run just fine on both Clients and Listenservers.
thank you but we were just trying anything to get it back working. we are comparing right now to the old and cant find a difference
we deleted every function and then moved crap around
but when we moved it over it started working again. im not sure if i accidently borked the bp when adding new events and then made it worse by not knowing what went wrong
kinda scares me
ok... I make the change to ini, package, upload to steam, do a check again, check my playerstate begin play debug log again if occurs on client when bug occur, and then come back to you ...
And of coruse i search the log for...
log: LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet
UActorChannel::ReceivedBunch: Received a MustBeMappedGUID that is not registered.
@chrome bay @rich ridge :
I am done, I have prepared also some screenshots to show you the outcome.
https://www.dropbox.com/s/zs3t6qypt38av9l/LogsUE4PlayerStateInvalid.zip?dl=0
- I made sure PlayerState is not created on client side again, but sadly it is. I search for "UActorChannel::ReceivedBunch: Received a MustBeMappedGUID that is not registered." and "LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet" and of course also for parts of the strings. Its not happen.
- I added the VeryVerbose log as described, but I do not find a Prorblem. I see some warnings of course, but nothing related to playerstate or replication problems.
Screenshots with text, Blueprnts parts and some logscreenshots in this package: https://www.dropbox.com/s/zs3t6qypt38av9l/LogsUE4PlayerStateInvalid.zip?dl=0
Any idea aboout it?
Any one else here who can jump into and have a idea why a player state after server travel is not created/replicated for a client?
With log LogNetPackageMap VeryVerbose I can see the creation of playerstate in the logs. But as assumed, for server everything is correct but on client the creation of playerstate after server travel is missing. Just as confirmation, same result as in the screenshots in the zip file.
@sleek elk as far as I remember PlayerState is persisted after server travel by default?
You get a new actor, but some properties may be copied to it
It's a misconception but none of the actor instances from the previous level come across, just that some properties are copied to new ones
I'm not sure why it's not replicating in this case
Sounds like a nasty error
Or maybe the connection is just so over-saturated after travel that it's stopping open packets from coming through
Though i feel like that should disconnect the client if that happens
Yes, I had this conversation before. Documention seems to be missleading here. It's like Jambax said, actors are not copies, just values.
I also see no connection to my problem. Even then the player state could not be invalid.
It's a misconception but none of the actor instances from the previous level come across, just that some properties are copied to new ones
@chrome bay I know that, my point was engine makes deep copy of the PlayerState and thus gives the same effect as that it is actually persisted.
I a forum thread I found the advise to use different player states, one for lobby, other for game play. I tried both, makes no difference. As you can also use different player states on seamless travel, it should be created new. But as I said, I tried both already, using same player states Lobby GM and Gameplay GM and using different. I also tried using same GM at all in both or different.
Even I do serverl travel , but I didn't experience this issue...
Now I will cross check my game , @sleek elk I m scared now because of you.
🙂
You have to bring it to steam and run under real steam envirment
locally I get the "bug" (or what it is) very, very seldom
I think you better debug both and sever and client in visual studio
This will tell you exactly what is happening wrong.
I think I now much of party of Unreal. But I came not across real debugging with VS. 😦
Can I even use VS debugging in a packacged and run steam game? Or only on games started from editoir?
Would be important to run/debug it in my real steam game.
You can attach to any process .. and need to do necessary lib and DLL setup.
And when I do the debug... how could I see what happens on "player state" replication? I think I can not step through every executed line. So how do I know where to player even some breakpoints?
At the moment I package my game new, and shut seamless travel off. Just want to know this is seamless travel related.
ok, thanks
In this video, I first setup some simple game logic for a coin collecting game in C++. Then, I go over various parts of the Visual Studio debugger including breakpoints, variable watches, stepping into/over/out of code, and more while tracing C++ code for a Unreal Engine proje...
thanks for pointing my to gut ressources, very kind of you. Thanks a lot
Perhaps you have also good idea "where" to place breakpoints? A method name I can search for or something like this?
On server put breakpoints in following functions in GameMode
- WelcomePlayer
- PreLogin
- Login
- InitPlayer
- PostLogin..
On client inside PlayerController
- onPossess
2.OnRep_PlayerState
Since you are sure that everything is fine on server
Then you can easli debug of clients..
Launch your dedicated server
Then open visual studio
Put breakpoints
And press F5
It will launch UE4 in debuggable mode
Thanks, I will look into it. And really appreciate your help!
ah ok no worries
ive got it set up and ran into an issue where only the server has replicated firing and can deal damage
clients can't do it to the server, nor to eachother
was it working before?
no i just started setting it up
it has a couple events that i guess are supposed to automatically send the firing to the server but doesn't seem like it's happening
lets see the RPC blueprint
yeah I think you still have to replicate the projectile
or rather the firing server/client RPC call and include the projectile in that
so this is my input event for shooting
you saying make that a multicast or something along those lines?
input -> multi fire event -> shoot
yeah, EB will replicate the projectile but you have to set it up.
more like input > switch authority > 1 - Server RPC 2- Multicast RPC
one sec
this video is the most succinct ive found https://www.youtube.com/watch?v=hDRoglljXjo&t=607s
A quick tutorial to get you started on understanding the very basics of event replication within Unreal Engine 4's blueprint scripting system.
Please note that this is not intended to be a comprehensive explanation of how replication works, but rather a simple example to get ...
oh awesome ok
Hey All, is there some trick im missing to attach the pawn I unpossessed to this vehicle? Ive tried everything, disabling collision, physics, attach to actor/component etc. How do MP shooters handle this? I want the ability for the player to shoot and be shot from inside the vehicle
do I need to replicate a characters tags in any other blueprints for it to read? I changed the tags everywhere I could on my character but it still fails when overlapping
No you shoudnt have to if the character is replicating
no luck
oh well out of town for the weekend
will try to fix on tuesday haha
impact registers on server and apply damage is called
but AnyDamage event doesn't get called 😦
unless the server is the one shooting
When I had attempted to create a session in my project on MacOS it would crash, I couldn't figure out why it was crashing. And I assumed it might have been a bug in the engine/editor. So I moved my project over to Windows, and it executed fine was able to create the session.
Can I report this anywhere?
As far as I"m aware this has existed for a while now.
@twin juniper Things crashing don't have to be a bug, really
But the fact that it's happening on Mac and not on Windows is really weird..
Debug it and find out why
I did.
And the error it gives is strange.
Something to do with arrays index out of bounds, but no where in my code or blueprints,
And I using any form of containers/iterations
That's your own code here, right ?
Yes
Sounds like Session is invalid
It's not though
Because I check
Session.valid()
And that check succeeds
The debug prints that session was valid
What's Session here exactly ?
It's a pointer to SessionInterfac
One second I will show you my GameInstance code
IOnlineSubsystem* Subsystem = IOnlineSubsystem::Get();
if(Subsystem){
Session = Subsystem->GetSessionInterface();
if(Session.IsValid()){
//bind delegates here
Session->OnCreateSessionCompleteDelegates.AddUObject(this,&ULobbySessionGameInstance::OnCreateSessionComplete);
}
}
}
void ULobbySessionGameInstance::OnCreateSessionComplete(FName ServerName,bool Succeeded){
UE_LOG(LogTemp, Warning, TEXT("Succeeded %d"),Succeeded);
}
void ULobbySessionGameInstance::CreateServer(){
UE_LOG(LogTemp, Warning, TEXT("Creating Server"));
FOnlineSessionSettings SessionSettings;
SessionSettings.bAllowJoinInProgress = false;
SessionSettings.bIsDedicated = false;
SessionSettings.bIsLANMatch = true;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
SessionSettings.NumPublicConnections = 5;
if(Session.IsValid()){
UE_LOG(LogTemp, Warning, TEXT("Session was valid"));
Session->CreateSession(0,TEXT("My Session"),SessionSettings);
}else{
UE_LOG(LogTemp, Warning, TEXT("Session not valid"));
}
}```
class LOBBYSESSION_API ULobbySessionGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
ULobbySessionGameInstance();
protected:
IOnlineSessionPtr Session ;
TSharedPtr<FOnlineSessionSearch> SessionSearch;
virtual void Init() override;
virtual void OnCreateSessionComplete(FName ServerName,bool Succeeded);
UFUNCTION(BlueprintCallable)
void CreateServer();
UFUNCTION(BlueprintCallable)
void JoinServer();
So when I click the button in my UI to call CreateSession, this line gets printed UE_LOG(LogTemp, Warning, TEXT("Session was valid")); but then it crashes on Session->CreateSession
I remember this same error and crash happening a long time ago as well when I was creating a session in blue prints.
Thing is, checking that the pointer itself is valid doesn't ensure that the object is
Is it, though ?
It should be because, it's not ->Isvalid() it's .IsValid which means SessionInterface is a container for the pointer itself.
Giving you access to the pointer.
IOnlineSessionPtr is literally an alias to TSharedPtr
TSharedPtr::IsValid() does not check "the object"
Hmmm..
It's type-agnostic and doesn't know shit about what it's storing
So how would I go about checking if the object itself is valid?
You can't
In C++, checking that an object is still valid, is very literally impossible
But also
If the object wasn't valid
Then this line would produce the crash
Session->OnCreateSessionCompleteDelegates.AddUObject(this,&ULobbySessionGameInstance::OnCreateSessionComplete);
But that line doesn't crash.
Maybe
And beyond that, the code executes and runs fine on Windows with Visual Studio.
But the crash is occuring on MacOS
It could potentially be undefined behavior.
But I'm skeptical and leaning towards a bug.
Or it's an error in your code where the session is being destroyed at a bad time and causes the crash.
Hmmm..
That could be it, but then why wouldn't it destroy on Windows?
Compiler optimisation?
Because the timing would be slightly different, I don't know
So there might be something in between the creationg and the call
Which you speculate is destroying the internal object.
Maybe it actually is a bug, but usually, when writing C++ in UE4, it's much more likely than it is your code, not the engine
Yes, but
Usually bugs in code are not this ambigious, like giving an error to do with arrays out of bounds.
Code errors in C++ are very much way weirder than this
Yes C++ compiler errors are disgusting.
No, compiler errors are extremely clear
Memory errors can take weeks to an entire team to track down
But the reason,
I speculate it's not my code.
Is because I had attempted a while back
To do a blue prints project.
Which also called CreateSession.
And at the moment CreateSession was called, the editor would crash.
And produce the exact same error.
If you reproduce the issue in Blueprint you can safely assume it is an engine bug
Yes I can.
But this also throws me off as to why I'd be the only one experiencing this bug.
Well it's on Mac...
That's true, I can't imagine the userbase for Macs with Unreal Engine.
Is very large.
I paste in the mac section and no one ever responds to me regarding C++/Multiplayer code.
So I don't know..
If you can write a simple sample project that reproduces the crash, you can report it and get it fixed
I have my CPP project already which prduces the error, and it's a bareboned skeleton of just CreateSession being called.
I can produce one in BP too
And then report it.
guys, i want to do an outline effect which is easy as pie but i am not exactly sure of the best way to do it with replication, to turn on the effect all u gotta do is set 1 variable to true but my question is since i have to do it for every player where would it be the best place to do it?
basicly im gonna make a red outline in all the enemy players
at it has to be done localy
i think
@novel bison I m very curious and it looks really nice.. how come your bp wires are straight?
but doing it in a tick wouldnt be right because of performance
@rich ridge theres a plugin for that
Ohh can you point to me to that plugin
i dont use it but if u search for something like "ue4 straight bp connections" it will probably show up
@limber gyro what triggers the outline?
Also dropping this in here: https://answers.unrealengine.com/questions/991625/view.html 4 days of investigation and getting nowhere - incase anyone has any ideas!
@empty axle setting Render custom depth to true
I mean when you actually should enable and disable the effect? Because that would affect how it could be replicated
Also dropping this in here: https://answers.unrealengine.com/questions/991625/view.html 4 days of investigation and getting nowhere - incase anyone has any ideas!
@barren warren I have not knowldge of that, but feeling with you. Sitting at least 3 days on a "random" problem I do not understand. And still no one has a solution. But got some tipps about debugging here, perhaps someone have also four you
@barren warren Always helps to provide the actual crash error and a log :)
Does the Steam Online Subsystem require a steam account to use/test? And if so, wehre does the user sign in to test?
I am getting a big step further, by compare both logs of a case "with problem" and without "I see at client" log that its not about playerstate only which was not replicated. It's more. Just the not replicted playerstate is the first thing which crumble my game. It simply stop replicating more actors in failur case. In the meantime I investigate more. My thread is also approved by moderatir now.
https://answers.unrealengine.com/questions/991441/player-state-not-valid-after-servertravel.html
I now do more compates to server log... but some questuin, is there a actor limit known fpr UE4 on start of a map which chrashes/stop replicate them to clients? I have 3 PCs, one very strong and when he is the server problems also do not occure. 2 PCs are slower/less RAM, when their are server problem occur to 50%. It's very, very clear looks for me I hit a limit.
Can be because of bad map design, I use some physical assets. But still wondering why this stops replicating such important things as player state to clients
oh man, I think I got it
Still wired, and still (as I understand this) its a bug and not planned behaivor. But I think I know what to do. Do somthing about my replicating actors and set priority of player state higher. That should make it better. But I still have not Idea why Server is stopping replicating to client. I will compare server logs now
If someone is interested or think I talk shit I can share some log screens 🙂
Does the Steam Online Subsystem require a steam account to use/test? And if so, wehre does the user sign in to test?
@twin juniper You can test with APID 480 without steamworks Developer Account. But your gamer steam account has to run on the same machine, so you also need a active account. But you need not a steamworks account directly. Just make a normal steam account as a normal gamer, start your steam and configure your UE4 with appid 480
you can google for appid 480 related to you ui4 and will find tutorials and the code you have to copy into your config files
you also find subsystem configurator in market place if you want to make it by and plugin
If an actor owned by the server has a replicated_using variable, that variable would be replicated to clients right? and the callback would be called as soon as the player is in Network Range of the actor?
Also, if I change the owner of something owned by the server to the PlayerController of the player do I need to change the owner on the client too? I'm getting a null owner on the client, but valid owner on the server
AllowPeerConnections=False
AllowPeerVoice=False
ConnectionTimeout=60.0
InitialConnectTimeout=60.0
RecentlyDisconnectedTrackingTime=120
TimeoutMultiplierForUnoptimizedBuilds=1
KeepAliveTime=0.2
MaxClientRate=15000
MaxInternetClientRate=10000
RelevantTimeout=5.0
SpawnPrioritySeconds=1.0
ServerTravelPause=4.0
NetServerMaxTickRate=30
MaxNetTickRate=120
NetConnectionClassName="/Script/OnlineSubsystemUtils.IpConnection"
MaxPortCountToTry=512
ResolutionConnectionTimeout=20.0```
How should I configure these settings for an overwatch style game to achieve best performance?
@twin juniper You can test with APID 480 without steamworks Developer Account. But your gamer steam account has to run on the same machine, so you also need a active account. But you need not a steamworks account directly. Just make a normal steam account as a normal gamer, start your steam and configure your UE4 with appid 480
@sleek elk Yes I used Appid 480 which is something like spacewars, but I wasn't able to locate my session across seperate machine/network. Do you know of any good resources for getting steam's online subsystem working in c++? When I test my onine subsystem locally using LAN and setting subsystem to Null, it works. But when I set it to steam and set lan off, then sessions can no longer be found.
@bitter oriole are you around?
this may be a noob question; but how can you salvage "really bad" netcode for an entire game?
It is all in BP until we can make the move to C++ for Ded Servers
Really depends on what your definition of really bad is. If it's actually legitimately bad and not just unoptimized, then all you can really do is pick a system and redo it. Rinse and repeat until you're satisfied. You might break other systems by redoing some systems, if they're badly interconnected and not well OOP oriented. Can't really help that sometimes though. Maybe start with your more core systems. Redo those first and then focus on the outliers so that you don't end up needing to redo outlying classes twice if you decide to change stuff around in a core system from it's rework.
I'm interested in the performance differences between RPCs and replicated properties, I know that RPCs are supposed to be more costly, but by how much? Is there any performance profiling that has been done on this that I can take a look at?
Does anybody know which server is the best to go for in terms of pricing? Gamelift, Azure or DigitalOcean. Which server would be the best in terms of scalability? What is the alternatives to Gamelift in Azure?
How do you get the player state from a replicated character?
basicly i am getting all actors of type character and doing a for in the returned array and i want to know which team what player is in
Get Player State from the pawn?
but you are doing something crazy if you are doing get all actors of class
just to get playerstates
i am doing get all actors because i need to hide UI elements acording to a raycast
and i just want to use that to get the teams in the player state
ye i just need to get it from the character itself, i was jsut confused because i forgot to cast hahaha
Does any 1 know where and the name of the function that gets the player name?
the one that you can pass as an argument when you connect to the server
PlayerState->PlayerName ?
hey guys, I have been following this tutorial on how to make all the player movement authorative
and it worked like a charm until I tried the dodge thingy
I didnt implement it exactly in the same way he did, Im trying to add a wallrun (which works fine), but then I want the player to be able to jump off the wall
So I need him to not only Jump, but jump away from that wall, so I need to add a velocity change but in a authorative way, can someone help me?
Does anyone here have experience with Steam's online subsystem? I'm unable to join a Session when I set DefaultPlatformService=Steam instead of DefaultPlatformService=Null. When it's Null, I'm able to connect locally, but from Steam I'm unable to connect from a remote network (I've portforwarded)
anyone able to help me?
server can run TurnOnLight and gets message server recieved and updates clients, when client runs it gets response sending req to server but server doesnt get the response of server recieved and nothing is updated, i dont understand why any help will be great 😄
https://gyazo.com/b34a707018d798a1e14d081cb466e5e3
@twin juniper i dont think u are suposed to connect to remote servers when u have steam on
u gotta do stuff steams way
You sure? ISn't the whole point of steam's online subsystem to allow remote servers?
which is hostting them the way steam intends and registering the server in their back end
Or do I have to pay for that?
you can connect, you just can connect like u usualy do, say u run ur server.exe in any local machine and connect
u wont be able to do that UNLESS
u do what i did
and override some fuctions
I did all that though.
I overrode those functions.
Like
OnSessionFindComplete
OnSessionJoinComplete
thats not what i mean
Oh?
i made a post about that on playfab's forums
can you link it?
gimme a sec
so are you implying I' m able to play and connect locally, but if I want to do it remotely I need to register my app with Steam.
And use the correct steam app id?
i am not sure how steam does things since ive never used steam for server hosting
oh so ur trying to just connect to a listen server, does it show in the server browser?
I guess something like that? Essentially, I have a game with a host and join option.
The join option just attempts to join the first index [0] server
iT finds
in the OnFindSessionComplete callback
Should I instead
Search for the server in the server list?
sorry friend i am not very familiar with how steam does things
i was under the impression u wanted a dedicated server
with a listen server you are probably better off following a tutorial
Just not any good tutorials avilable in C++
And the ones there are,
I already followed them and did whatever they put
just use BP's
I'd just rather not take that route and instead try to figure out what I'm actually doing wrong.
well try and see what you ge browser
get in a server browser
to see if steam is actualy recognizing the servers
I'm not very familiar with steam, where is the server browser?
u need to implement one
Oh
I thought you meant,
Steam's client's
server browser
But yes I'm assuming the issue is, I'm attempting to join index 0.
well that is probably a possibility but you need an app id i think
Yes so what happens is,
I'm able to find servers,
And my OnFindSesionsCOmplete callback gets called 3 times.
And then,
I attempt to grab the player controller,
From the gameworld.
But at that point,
Nothing happens.
It just goesn't go any farther..
Like it doesn't fail to grab the player controller
Nor does it succeed
pste that part here
One sec
UE_LOG(LogTemp, Warning, TEXT("Session Joined"));
FText Message = FText::FromString(TEXT("Join Session Complete callback"));
FMessageDialog::Open(EAppMsgType::Type::Ok, Message, nullptr);
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
if (PlayerController) {
FText Messageo = FText::FromString(TEXT("Player Controller Valid"));
FMessageDialog::Open(EAppMsgType::Type::Ok, Message, nullptr);
FString JoinAddress = "";
Session->GetResolvedConnectString(SessionName, JoinAddress);
if (JoinAddress != "") {
FText Messaget = FText::FromString(TEXT("Host Address Resolved....joining"));
FMessageDialog::Open(EAppMsgType::Type::Ok, Message, nullptr);
PlayerController->ClientTravel(JoinAddress, ETravelType::TRAVEL_Absolute);
}
else {
FText Messagefr = FText::FromString(TEXT("Failed to resolve host"));
FMessageDialog::Open(EAppMsgType::Type::Ok, Message, nullptr);
}
}
else {
FText Messagefpc = FText::FromString(TEXT("Invalid Player Controller Valid"));
FMessageDialog::Open(EAppMsgType::Type::Ok, Message, nullptr);
}
}```
So you see where it says FText Message = FText::FromString(TEXT("Join Session Complete callback"));
That dialogue gets called several times.
Then I attempt to grab the player controller APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
And if that succeeds I print, player controller valid, otherwise, invalid player controller.
thats no the log thats the function
in ur saved folder
inside ur project folder
theres going to be a logs folder
check what those logs say
AH
There's several logs, I can produce new ones.
And show them to you.
Give me a moment.
Okay
@limber gyro I p[ersonally can't understand these logs very much.
Can I send them to you to see if you find anything useful?
no worries!
what is the best way to deal with this?
make UComponents inside UComponents or AActors in AActors or something entirely different?
Gonna need more context.
USTRUCT()
struct FCardName
{
GENERATED_BODY()
UPROPERTY(Replicated)
ESuit Suit = ESuit::None;
UPROPERTY(Replicated)
ECard Num = ECard::None;
FCardName();
FCardName(ESuit iSuit, ECard iNum);
FCardName(const FCardName& Other);
void operator=(const FCardName& Other);
};
I need a list of those in a UComponent that gets attached to APlayerState
but this struct can't be replicated
That's not how you replicate structs
I know, I got the error
Just mark the properties to replicate as UPROPERTY() alone
And replicate the struct
I'm using Event tick to facilitate my movement, should i mark functions I call as reliable? Or is that bad cuz event tick + reliable.
Reliable functions on tick is definitely not a thing you want to be doing.
@bitter oriole Have you worked with steam's online subsystem?
Ask your question, directly, to everyone, without tagging in random people
People who know will answer
Ah apologise.
Well I'm having an issue connecting to a listen server using steam's online subsystem
Explain the issue, what you tried, what happens
The issue is, when I set my
[OnlineSubsystem]
DefaultPlatformService=Steam in defaultengine.ini
The client is no longer able to connect.
But when it's Null, the client can connect.
If it's Nul, the client can connect from the local machine.
But because Steam's subsystem requires a steam account.
I'm testing the server on my machine nad the client on a remote machine.
But the remote machine is unable to connect.
And I've port forwarded as well.
For some reason,
The client is able to find sessions.
There is no need to forward ports at all with Steam
Are you using two Steam accounts
Yes.
Two seperate machines across two seperate networks,
With two seperate steam accounts.
Check the server logs for traces of a connection
I tried looking through the server logs but couldn't find naything useful, except this.
And wondering if it means anything.
LogOnlineSession: Warning: STEAM: No game present to join for session (GameSession)
But that's when I'm hosting, so I don't know if that's a relevant warning
If you would like I can show you the join/host code.
If that would help.
When I said "Explain the issue, what you tried, what happens" I really meant show the code, the logs, video, screenshots, detailed explanations
Ah okay.
Not that I know about the issue
I know nothing about it
People might if you share information
Well I'll show you what's interesting that happens in the code.
So this function is where the player connects to the server, and it's a callback from when a server is found/joined.
UE_LOG(LogTemp, Warning, TEXT("Session Joined"));
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
if (PlayerController) {
UE_LOG(LogTemp, Warning, TEXT("Player Controller Valid"));
FString JoinAddress = "";
Session->GetResolvedConnectString(SessionName, JoinAddress);
if (JoinAddress != "") {
UE_LOG(LogTemp, Warning, TEXT("Address resolved"));
PlayerController->ClientTravel(JoinAddress, ETravelType::TRAVEL_Absolute);
}
else {
UE_LOG(LogTemp, Warning, TEXT("Failed to resolve host"));
}
}
else {
UE_LOG(LogTemp, Warning, TEXT("Failed to grab player controller"));
}
}```
The strange thing about this is,
"Sesson joined" gets printed to the log.
But then nothing else gets printed.
No log of failing to grab the player controller/succeeding.
No long of failing to grab the address/succeeding
It's like the code doesn't want to go beyond that.
hmm actually, I should check EOnJoinSessionCompleteResult...
is using
UFUNCTION(Server, Reliable)
redundant / not-needed
for anything in the game-mode?
got it, thanks
Hey, guys for some reason,In blueprints Rep_function does not gets called for clients which are joining later, how should i debug this
it happened for upto 3 clients, but not after that
My game can't find sessions on the LAN using onlinesubsystem NULL. Do I need to add something to the Build.cs file?
And does it need to be private or dynamic added stuff?
In a casino game, where should the player's chips go?
In the player-state? or the game-mode?
If it is in the player-state (which would sound logical), could a player hack it sense it is client-side and give themselves more chips?
I decided to put the player chips in the player state and then use "withValidation" to check it against the game-mode
The game-mode will have the player-state ideas mapped to their correct stack size and if the two are off, I'll return false.
You can put it in the player state and as long as everything is handled server side the client can't do anything (cheat)
So did Unreal Engine lose the ability to do LAN on Android starting at version 4.23 or is something else causing it?
I think it is not the ue version because mine stopped working without changing versions. Same project, same wifi router, same devices. I can't figure out why it would suddenly lose the ability.
Does Android support LAN on unreal engine? Afaik it has problems since years about that
Well like I said i had it working consistently up until I was ready to release it
I just downloaded the multiplayer shooter example (western gunslinger game with orange mannequin with the cowboy hat) and found that it could not find LAN sessions either.
Even though both the pc and the android were in LAN mode and I Play on PC amd Find Sessions on Android. Firewall settings allow both private and public networks.
I had this working for 3 years and now it quits for no apparent reason
So after messing with everything multiplayer, I found that it is not worth it to make a multiplayer game and host it on any of these services.To any others that are wanting to make a multiplayer game for profit, take a look at the cost for hosting your game design on different services. Every game is different, and will occur different costs. The better route is rent a location connected to a main hub. Then set up your own servers that scale based on the demand of all the multiplayer game you create. It would be best to do this after you have completed a few multiplayer titles and tested them with your server back end thoroughly. That way when you go to rent the location, set the serves up and launch your multiplayer titles, you will have saved more money than using cloud based services in the long run.
how much you can save from that way? @vale ermine
if you go the amazon route and you have high user count instance count the math is on their website and can exceed 30k a month with very low user count. There is the VPS route and your paying about 1000 dollars per year per vps and depending how demanding your game is translates into how many instance you can run on a single vps. That all said now you have you own back end. 2000 for rent, 5k per server you build, electricity, server admin 100k+ a year. The point is that you can use your own servers and scale them to your needs for the multiplayer games you create. Now you have one system that can do all your games and you are not paying separate cost for cloud hosting of each game. This could reach millions a year depending on your game or games.
afaik they have a system to optimize instace issue
I need dedicated though for my games so it does depend on game types.
Games that have instance that are short lived can be fairly cheap.
games that not have instance arent MMOs?
well you can have an mmo that is instanced based but I am looking more for the run 24/7
why not use both?
to 24/7 operations use your own, for others use cloud-based
i believe the 24/7 thing only needed for .... data usage and small operations? right?
No the way my maps are designed they are up for 1 week then down for maintenance
that is a lot of dedicated servers but each blade can handle a few maps
@swift kelp In short, your players shouldn't be able to 'hack' their chips if you program it correctly. They could change their own local memory values which would update their own UI maybe, but as long as you don't do any form of client to server data and leave it all server to client, they cannot directly affect their chip count. Do bear in mind that if you have a server, and then a single client, there are actually two playerstates for that client. It does exist on clients yes, but those are just information hubs. The real processing and updates should always be done on the server and that change replicated to clients. Which means that the server is always working with it's own data and clients can try to change their own values all they like, it'll just mess up their own UI until the server overwrites it again.
The answer is put everything in the player controller. If you use the action rpg inventory system from the unreal market place, you will have everything you need you build player viewing and server communication you need for your game.
You only put things in the player controller that you do not want other players to see. If he wants other players to be able to see how many chips another player has, it cannot go in the player controller.
ugh ok example. You have a container(These containers are set up for you in action rpg inventory system). This container is a widget that has an array of players that are viewing the container. You can make the container look however you want but it would be the middle man between you and the other players. You could even set slots on the container that are locked to player viewers of that container and they could add their chips to the container and the other player will see it.
You can even set the inventory so that is the players hand that others can not see and the container where you drag the cards from your inventory into the container to play your hand.
Btw the container is the middle man. It is an actor that has an interface that both players can interact with at the same time while viewing the container ui.
First of all, you don't use UI for any form of networking. If you're talking about an actor that a widget can work through, that's fine, but a widget alone should not be used for any sort of gameplay or networking. So presuming that you want a hack free way of letting other people view your stuff that you don't want all players to see besides some, yes, you would need to use a single client actor like a player controller to route through and do checks on the server to let the server send specific data to specific clients based on their server side values. IE, don't let client1 try to tell you that it's client2, just rpc, get which client it is based on server data and use that to rpc back the data through a client RPC. But the original question was simply a matter of where to place a variable like a player's currency so that clients couldn't hack it. He chose playerstate, which means he probably wants more than just one player to see it which isn't unreasonable if you're sitting at a poker table. You kind of want to know where the money went.
Yea I just went through of of this. You will want to use rest commands to authenticate users and retrieve and set values to the database through a gateway. It is to bad there is no out of the box secure way to make a multiplayer game.
There can be no such thing
People doing MMOs face unique constraints and have large budgets
It's unrealistic to expect a cheap service that does everything for you
Well I mean more of a stream line setup. That way developers have a clear system to follow.
Instead we have to ask questions here and read through the lines if you know what i mean because face it nobody wants to give their system out.
You can't streamline the setup for this because it depends on your hosting provider, your databse technology, your game's constraints
Your problem isn't that people "don't want to give their system out", your problem is that each such game has extremely unique systems
And yes, it's years of work for teams of 10+ engineers
So you can't explain it, you have to hire the team and work some years
yea i got you and with a new system for example spacial os it is always changing and improving so you have to keep up.
Not to mention the cost of SpatialOS is too high
but i mean as far as the keys and everything that needs to be hidden that was a very difficult leaning curve for me.
Maybe I just didn't look for the right documentation to help me learn
"me" is your problem - this kind of games is for very large teams
Read >100 devs , >10 backend devs
You can't learn all of that stuff because your brain is not 100 times larger than average
But you're trying to learn 100x what you can learn and then complain that it's difficult
but here is my point I like to know something that way when the admin exposes my keys I can be pissed and fire them
not wait till all my user information is hacked
Anyway, my advice is to make simple games, preferably single player games first
Learn step by step
if they give authorization to the wrong group i want to know
im trying
but to that last comment yea I'm focusing on unreal market now
i have something big coming in this week for paper2D
It just rely sucks you think I am complaining about how difficult making a multiplayer game is. Just remember, I am experiencing this for the first time and it is advice from people like you that prevent me from wasting valuable time on something that will never happen in the near future but I can not say that I do no put my all into learning everything I needed to draw my own conclusion.
But you are complaining about how difficult it is
I guess I was but didn't realize it. I am sorry that bothers you. I am gone forever(poof).
You're not bothering, you just need to accept that there is no tutorial, or built-in plugin, or marketplace asset, to walk on the moon
Or build a successful MMORPG, which has been done less often than walking on the moon
Totally out of the blue question here, but has anyone ever built their server for linux and had windows clients?
i.e. does it work?
@kindred widget thanks for the clarification!
@twin juniper Fortnite does it
I suspect every UE4 game with dedicated server does it
@bitter oriole That is so good to know XD
it's so much cheaper to run
@vale ermine Have you seen Ashes of Creation? It's built in UE and I saw an interview where the designer was talking about his issues transforming UE to make it work with an MMO style game.
Made by a team of about 60 people, of course
Oh I have no issues with UE4. It is open source and I can do anything I want. Don't list to people that tell you that you need 60 people to do it either.
Sigh
I remember there was a rush about making an MMORPG as a solo dev years ago with Unreal Egnine because one company did it.
But you really need that amount of people if you want to make a big scale multiplayer game.
I mean AoC is literally made by 60 people
Intrepid Studios Inc. is a San Diego based game studio working on the MMORPG Ashes of Creation.
Intrepid Studios was founded by Steven Sharif and John Moore, passionate gamers and successful entrepreneurs, who took their knowledge of business and passion for games and set out ...
And it got millions in funding to pay them
The funny thing is that he thinks that was what I was trying to do but I was just trying to learn 😛
"I just want to learn how to build an MMO !"
Yes over 3m in kickstarter funding as well as publishing. I think he talked about how he had to rewrite state replication or something.
you know there is more to it than just what you think I know haha
I don't think he cares what you know, I think he cares what is humanly possible.
exactly goonix
But learning how to make an MMO can be actually a quite big of a waste of time if you got no future with it...
that is what im talking about
I mean curiosity doesn't kill the cat but it might hurt for no reason 😛
Learning how to make an MMO is like learning how to make an orbital rocket that lands itself
I feel like there is a way to build an MMO as a solo guy but you would have to give up a huge amount from the typical vision.
There isn't
haha
hmm, what about
a world a spheres that delete eachother on contact that only updates once a minute
How do you get a million sales for your game as a solo guy ?
no he is right there isn't but i just learned that recently by going through all the steps
all hosted on one t2 nano
The "M" in "MMO" is for "At least a few thousand people are playing my game at any time"
A few thousand might also not be enough depending on the costs. Let alone even making those people STAY is the actual problem.
95% of MMORPGS died because of this.
But most games never even have that many players playing the game at all, let alone at the same time
hi guys, where do i handle team scores? gamemode or gamestate?
You would need to write your net code specific for you game that is not to hard with source
Start with "how many MMOs actually exist"
@shrewd tinsel Gamestate, you'd want clients to see it, clients can't see GameMode.
thanks
I want to build a system like spacial os
In a funny kind of way I think the thrill of the idea of an MMO is kind of dying anyway
cross server is the best thing ever
Only proftable MMORPG is WoW. But then WoW had an actual playerbase ready to play the game. Warcraft series etc.
Unreal Leon, who did MMORPG alone?
surely FF mmos are profitable
😮
you know who else does it rely good? planetside 2
Oh and Final Fantasy too I think
i second @vale ermine
someone in my country made MMO in 5 years with 12 person
planetside is a great example
and what about Guild Wars by ArenaNet?
and wasted 250k$
The thing is, those games FF and WoW has MASSIVE amount of playerbase READY to play it already. One guy going for a journey of this may not be good.
One guy, or a small team, will never have the funding to get the players playing
The game doesn't even matter
Sad but true perhaps
Exactly. If the player will just say "meh" and only pay for one month, you ain't living.
mmorpg is such a gargantuan project
it's not a good genre for the little guy
The average Steam game will do 2 concurrent players
That's just the truth
In a year it will be 1
nf says "you look in the mirror and tell yourself you'll never be great" "You'll never be great"
It's just that when there was WoW, SWtoR and FF MMOs were popular, people wanted to make their own solo MMORPG projects because they all thought "their idea is billion dollars worth!!!111oneoneeleven".
Ah those silly times of Unreal Community. ❤️
No one said that @vale ermine
Eh... It's not about telling yourself that lol. Not at allç
There's a difference between telling yourself you suck, and being a realist.
Being great, today, is making a nice solo game and making 2000 copies
Or making a cool game as a team and making 20,000
You are trying to learn how to teleport before learning how to walk.
haha or make assets and let the other devs fail?
That ain't about saying "you will never teleport". You might one day.
Reminder that the massive company behind Fall Guys shipped like 120 games before Fall Guys
Vlambeer made something like 70 games
wow, I didn't know that
Even then Fall Guys is a massive flop. No really. You just flop around in that game. 😛
I only have 2 and they are bad haha
can someone tell me who did mmorpg alone before? lol
Supergiant is on their 4th game in a decade and they got their first truly mainstream hit
really curious
Its about bring back those old school games
The point has never been "you can't succeed", the point is "succeeding today is making a game you love that has 13 players playing it every week"
I would say that's a big achievement too for a first game 😛
It is
just have to look through the Atari stuff those are easy games to remake
Remaking is really overrated. Make your own games tbh.
Adam left 6 years ago and new albums sucks. Anyway lol 😄
Go make new albums
Two Days Grace now huh.
well yea with twists of cource
everyone is inspired by some game
mine is Ragnarok online
Remaking has the massive chance of failing too. You really need to not only have the old times essence, but also have new times improvements. Not all can do that.
Inspiration is different, remaking is different so.
No one considering the fact UE4 is actually requires heavy background operations to make an MMORPG run on it lol
yea guess bad wording
You should totally edit source code to make MMO work
doc. also mentions that
actually mentions by "requires plugin"
The problem with a RO remake is that the game only works mechanically when you have tens of thousands of active players to get about 100 online 🤷
we know that be everyone you see here if they know how to do it they will tell you you need 60 people to do it
Because that's the truth
i like making jabs its just for fun
love you
I am on this channel for almost 8 months and this is the 5th time I saw Stranger explaning making MMOs is not a good idea... 😄
Haha
You are pretty young then.
Years ago there was a FLOOD of people asking about how to make MMORPGs in Unreal forums.
It took a lot of blood and sweat to tell those people.
well no it is me no the explaining that matters .
I've been talking with MMO wannabees since maybe 2008
Mattxor dont be taken on I am actually changing the subject
for a mmorpg half of the work would be the server backend isnt it?
Sometimes we really need a big BONK on our head to get told our idea while sounds awesome, is not a good one.
@shrewd tinsel I don't know, you need to build a colossal amount of content too
players don't stay unless they have something to do
you can't just have a convenient game loop like CS
but leon there are ways to go about it
Listen ya all. EVEN if you had a good idea or implementation of MMORPG, you NEED to have at least 5+ years of story and gameplay mechanics to have something working.
Even if there is a MMORPG 500 GB Template to use.
You guys ain't considering the future. 😛
some times the best thing is to say nothing at all 😛
It's not really that difficult of a concept. Making the game itself is easy. You can implement the gameplay systems and whatnot fairly simply. It's the server connectivity and backend systems that will destroy you. Then we'll bring in the community management, tack on the necessity for business management, office space for these people to work in. In the end, making an MMO is about 5% game design, 95% business and server development.
@earnest comet And you need a $100M ad campaign and a great anticheat and flawless IT, but you can't explain that to people who never shipped a game before
best shot is getting a job a as lead designer at some big game company
People will not play your MMORPG if;
Connection is meh.
Story is meh.
Gameplay is meh.
Balance is meh.
Downtimes are meh.
Your face is meh.
Your community management is meh.
Half Life 3 dream is meh.
etc.
And these eventually snowball HARD.
Thats why even MASSIVE Companies have failed making an MMORPG:
As far as I understand from Stranger's 5 floods and other researches what people trying to explain is persistent-levels and other back-end stuffs like anti-cheat, community and custom server management etc. if you make a session based but stay still on "Multi-Massive Online" with session-based games if you can afford the servers and anti-cheat stuff.
I've never dreamt of MMOs but wanted to type this lol
Ah yes. Cheating is a MASSIVE meh too.
It's mostly the player count that kill 99% of projects
Cheating is unfortunately is something "even your grandmom can do" now.
People don't play indie games, for the most part
But yeah as Stranger said, your game(MMO) means NOTHING if NOONE is playing it.
Your MMO*
For a solo game, if one person is playing it, that's already great
Someone's having fun
Yeah fixed it.
how do i manage team scores if the scoring depends on different gamemodes (ctf, point capture, deatmatch etc.) do i manage scores in gamemode and then update variables in gamestate for others to see?
People don't have to play your solo game, ever. They just have to buy it.
Marvel Avengers MUH AWESOME LIVE SERVICE game is in brink of destruction because there is no crossplay and people already playing in so low numbers.
do i use different gamestates?
The online looter genre was killed by Destiny the same way WoW killed the MMO genre
The cure is souls-like or Death Stranding type connection so no one complain about it lol
if no one connected create custom assets and spawn them...
Well the problem is Stranger, the game is boring as heck. Also robots are the safest option of having enemies.
So there isn't much of a story to bring in.
People keep saying Destiny is boring too, but they keep going back into it
Mean robot, destroy robot.
using different gamestates for different gamemodes is a viable option?
@shrewd tinsel You can likely use the same Gamestate, just have your game mode change an enum or something in your gamestates, and use your values differently based on what the game type is. Less need for five different gamestate classes.
alright
This might also have your answer.
Stranger, Destiny has at least some action and story to go by. You could at least go through the story once and say "yeah okay imma leave now".
Avangers have literally nothing but "hopes of years of content and aweomsenezz."
I have a question, if a bunch of stuff was batched and serialised into an RPC on tick, would it be as efficient as a bunch of replicated variables?
and I mean efficient in terms of network usage
RPC on tick should only ever be used for client-to-player input
As unreliable
Replicated variables are serve-rto-client only
So the choice should be simple
client to player?
to server, sorry
right so if a value changes on client, setting it to replicate doesn't change the value on the server?
Nope.
I see, so you would need an RPC to change the value anyway
Correct.
Why should RPC ticks only be unreliable?
Because reliable RPC on tick will kill the network
Reliable RPCs are re-tried if lost
Ah so it floods it
So if there is a one second cut of connectivity, at 60fps you then have 60 packets to re send
It doesn't work
Tick RPC must be unreliable, and it only makes sense for input
Server-to-client downlink should be mostly replicated variables
With some RPCs for reliable events
Can you send batched variables on a timer? Say my server is 40fps or something and I want to send them at that rate regardless of the client FPS can that work?
in an RPC i mean
You could, but why? What's the use case? Why not just only replicate these variables when they're changed?
You can't decide of a rate to send stuff at
The network decides for you for the most part
Just use replication, it's a really well optimized system
I couldn't hold variables in a buffer and send at a time of my choosing?
Send them, sure
Yeah, I mean you could call an unreliable RPC 40 times a second, but it's not going to end up as well as a simple replication.
what would make it worse than simple replication?
You would be using 10x as much bandwidth, to start with
oh.
Are you actually changing these variables 40 times a second?
And you would be getting as much useful data, if not less
actually, probably not no
The important part is that sendign stuff at 40fps does not mean you receive at 40fps
You will have half-second holes in the data
Grouped receptions of half a frame
Lost packets
Etc
Networks are hell
I imagine if I devised the system this way, occasionally an RPC would be sent in one of the 40fps intervals, but most would be empty
You could also just use conditional replication. If you're using C++
why the hell cant i replicate maps?
Because you're reinveinting replication
Replication copies the server state to the clients, efficiently, with variable speed depending on the network
On a per-client basis
If you feel like manually calling a function every time you change a variable, and rebuild all of these mechanisms yourself, feel free to
Just telling you there is a built-in mechanism that's proven with Fortnite, Valorant, PUBG, etc - and you're unlikely to do better 😉
From the server side I could use a TArray with my datatype in, but how do structs get replicated? Do they get serialised whole?
Structs get replicated efficiently
What do you mean by client logic though?
A structure with variable A and B will only replicate A if A is only changed
like, an input event happens, perhaps some other effects occur, these are batched, wait for RPC tick, if stuff in buffer, send
@bitter oriole Really!?
hmm, that is very interesting
If you have an input event, just send it on tick as an unreliable RPC. If there is too much traffic it will get dropped and that's okay.
and it's all serialised and whatnot?
Yes
well, now you're convincing me
I think I have thought of how I could do it using replicated variables. But what about very large TArrays? Is it still efficient to have a large array replicate to a client, in the sense that it only replicates changed members of structs within the array?
TArrays will also replicate efficiently
Though replicating a "large" array is always dubious, generally speaking - if you are changing a 1MB array every frame, well, it's a problem no matter the tech
On the client I could have a RepNotify for logic once this array is changed on the client side
I thought any replicated arrays needed to use the one thing and then mark the array index as dirty?
Not any replicated arrays, but to only replicate a single array value instead of the whole array each time.
I expect it will be a batch of tens of structs probably 20 times a second at worst
some with only a single member changed
maybe 20 times a second is too many now that I think of it
I need to test of course
the server array will constantly be cleaned up so items are deleted, does this cause network overhead?
I could just have the same logic on client and not bother sending any deletion keys or however it works
Maybe it would be nice to be able to choose which array members to replicate, but I'm sure that's automatic
By the way thank you @bitter oriole & @kindred widget , I feel much wiser now
Does putting a player's inventory on their PlayerState makes sense?
Like on death I want to destroy the character so I want the Inventory to persist, should I do it on the player state or the player controller.
Considering none of the two are destroyed what's the better option? From what I understand player controller isn't replicated to all clients but the player state is 🤔
Depends on whether you want other clients to see it or not. If you don't want other clients to see each other's inventory, or you want to save bandwidth to clients by only sending it to one client, do it on the controller. If you want it readily available to all clients for some reason, do it on the playerstate.
Thank you mate, I was wondering why I was thinking about putting it on player state too because I don't want players to have their inventories available to each other, dropping items to ground is fine.
Okay so another question this is a weird one, I don't understand what's up here but I have an interaction setup and when the interaction happens, I want the item that interact with to have it's scale reduced to 0.01 and collision set to no collision, and then set hidden in game this happens fine on the server but not on the client. On the client, it's set hidden but the other two things don't happen. Any idea why? One of the thoughts I had was that it's probably because the items are placed in the world and therefore owned by the server. This is puzzling a little.
cause only bHidden is replicated
collision size and scale are not replicated by default
Scale I am able to replicate but collision I can not D_D
How can I replicate collision? Do you have any pointers you could give? D_D
u can replicate a boolean to preform the action u want on OnRep_
Hmm yeah 🤔
u dont need to waste bandwidth by sending collision size and ...
So I basically do OnRep_Bool{SetActorCollisionEnabled(NoCollision)} kinda thing? D_d
could even use a enum to determine the state of something
and have onrep handle that state change
its a uint8
super cheap to rep
Wow yeah, that's a cool one too @_@
so like you change State to StateB, then clients do everything locally
adjust scale, adjust collisions, etc
if you only have two states, just use a bool
more than 2 states, a enum or some kinda bitmask flag
i have this for example
#define MRF_HIDDENMESH (1 << (1)) //Hide Monsters Mesh
#define MRF_COLLISIONS_DISABLED (1 << (2)) //Disable Monsters Collisions
#define MRF_RENDER_PASS_DISABLED (1 << (3)) //Hunters render pass is disabled
#define MRF_IDLE_OPTIMIZED (1 << (4)) //Monster is idle optimized
#define MRF_TICKS_DISABLED (1 << (5)) //Monster has ticks disabled
#define MRF_SENSES_DISABLED (1 << (6)) //Monster has senses disabled
#define MRF_DEAD (1 << (7)) //Monster is dead```
//Replicated flags for the monster
UPROPERTY(ReplicatedUsing = OnRep_ReplicatedFlags)
uint8 ReplicatedFlags;
UFUNCTION()
void OnRep_ReplicatedFlags(uint8 OldFlags);```
I am building an inventory system by storing object references, if I store them as class ones, any changes I make to the spawned object would be lost if I "stow it" back so getting to learn a lot while I do it D_D
i can check flags like FORCEINLINE bool AreAnyReplicatedFlagsSet(uint8 Flags) const { return (ReplicatedFlags & Flags) != 0; }
😄 for example bool IsIdleOptimized() const { return AreAnyReplicatedFlagsSet(MRF_IDLE_OPTIMIZED); } I love flags like this 😄
i only have 2 states tbh, 1 where the item has it's collision on for interaction purposes and one where it's set hidden and "stowed" but technically just attached to character mesh and collision disabled.
That's insane @_@
@meager spade I am writing something like that as well to get rid of UE4 network and replication for ever lol
I still need to learn more and more D_D
push model and per property relevancy , thats what I need
ye
tho per prop relevancy sounds weird
i mean instead of the rep system checking every prop to see if its changed
with push model it has a list which is far more cheaper to iterate through
Dis is like a plane flying over me head, I go do the fixes.
imagine I have 3 properties (blood, shield, mana) that should be replicated only to teammate and those who are spectators
I am currently using a sperate actor (ATeamData)
you do have conditions
but those are very limited
if there was a way to make custom conditions
then that could be achieved
they actually made AttachmentReplication in AActor push based now
and ReplicatedMovement
wait
they did it to all props in there
niiiice
SharedParams.bIsPushBased = true;
DOREPLIFETIME_WITH_PARAMS_FAST(AActor, bReplicateMovement, SharedParams);
DOREPLIFETIME_WITH_PARAMS_FAST(AActor, Role, SharedParams);
DOREPLIFETIME_WITH_PARAMS_FAST(AActor, RemoteRole, SharedParams);```
only thing with Push based, is everytime you mod that prop, you need to mark it dirty
MARK_PROPERTY_DIRTY_FROM_NAME(AMonsterCharacterBase, ReplicatedFlags, this);
@meager spade so it is like dormancy, but for properties?
kinda yea
the net system doesn't know if a property is dirty
so everytime it reps an actor, it checks every prop to see if its dirty, with Push Based you tell the rep system that its dirty, and does less CPU work per actor
Will the PlayerID in the Playerstate populate the same for a player connecting through steam? So for example, if the server is left open, and a client with.. say PlayerID 123456 disconnects and then reconnects using the same steam account, that PlayerID in the new playerstate created for their new connection would be 123456 again?
I’m thinking of starting a BR game and I have some questions, hope someone can help me! So I was thinking the option of having official dedicated server to prevent (as much as possible) the cheating, for this options, do I need for every single match a dedicated server to it or can one dedicated server handle n amount of matches? If I need a dedicated for a match, how do can I handle the matchmaking system to launch dedicated servers and when the match is over, shut them down? The other options is peer to peer which is way cheaper but this option players can cheat (I think) and probably if someone doesn’t have a good connection, the game will lag. And the last question is how does fortnite handles all of this?
(Please tag me @inner cove if you are going to answer me 🙂 )
@inner cove dedi game instances typically use 2 CPU cores
so one machine can handle multiple instances
@winged badger okay so a machine with 12 cores can run 6 dedicated servers?
NewPlayer->Player->PlayerId
Why is PlayerId empty when calling it this way in PostLogin()
@inner cove you will need to profile your game and run test to see how many dedicated servers you need for all user. Just by profiling you should get an idea of the cpu load and memory footprint. This will give you a good idea of how much ram you will need and how many instances you ca possibly run on one server.
Multiplayer with blueprints on unreal market teaches you how to do match making base on user ping. The server is started when there is a need for it. So it could be any user that it starts the server up for and others will see the instance because it is available.
I never played fortnight but I would think it is a lobby/map system. Players ready up in lobby. Once ready server spins up but this is in no way a dedicated setup. Dedicated the server is always running and is always available to connect to that instance.
hey peeps, i have a multicast BP function that is also executing in the server making 2 particle effects show up instead of 1
i need to make it run only on the clients (i assume) what is the best way to do this?
@limber gyro did you try putting has authority before the particle spawn?
That is most likely not the correct way to tackle the problem but it's good for testing
as long as it works im happy
@vale ermine if it’s not a dedicated server, what is it?
It's just server that spins up then spins down when needed. A dedicated server is an instance that never goes down but for maintenance then when you start server back up it's a new dedicated instance
@limber gyro Are you ever planning on allowing listenservers on your game?
Ah, was just going to make the point that instead of SwitchHasAuthority, you could use the IsDedicatedServer instead. Since you'd want particles to spawn on a listenserver too.
@vale ermine that is not what dedicated server means
Dedicated server in gaming means a "Server dedicated to that gaming session"
doesn't matter how its launched, its the fact that its dedicated (not running on client machines)
@meager spade that’s also what I think
An instance that goes up and down is not dedicated
@vale ermine maybe u are confused with a persistent server ?
^
Yea I get wording wrong a lot
a persistent server is a server that is always running, Fortnite, use dedicated server, but they spool up instances when needed and close when not needed (infact they always keep X amount spooled up at all times), and spool more to make sure players are not waiting to long for a server to boot and be ready. But this is all controlled by internal scripts i suppose epic side, not part of UE4.
I see your point it is dedicated for the time it is in use
So I guess I will have to write my own script to be a master server to start up dedicated servers? But what if I rent 10 different machines, how could I start a server on a different machine than where the master server is? Hope it makes sense
That is the fun part. By the time I'm done I will have everything managed through autoit. That is the scripting language i use
Automation is my specialty haha
The master server will keep track of the sessions and ips using a database. So when another machine spins up it writes its ip and ports to the database. Then master server will use that to direct users to each machine.
Yes I have figured it out myself what you just said, what I haven’t figured out is that if i have two machines x and y and the master server is on machine x, then it can execute locally a shell command to start a server . If it wants to start a server on machine y how can it execute that command remotely?
Well that depends on the system you design doesn't it. Example you have lambda functions and invoke those functions through an api gateway. These lambda functions is were you would put your script code to handle eveything.
I have decided to move away from those services and want to build everything up in house. That way I have full control of everything and how my system works.
The funny thing to is. If you have the team to set all that up on a third party system your throwing your money away when you could use that team to be developing those same systems but in house.
@inner cove you should first probably research who will be your server provider based on your budget. A lot of them are providing tools for servers orchestration, matchmaking etc.
@empty axle I have no budget, I will launch a kickstart if the project goes well. What do u personally recommend?
Actually let me rephrase that, do you have any recommendations based on what you read that I want to do?
(Except AWS)
@inner cove We were using zeuz.io, but I wouldn't recommend them. Generally it was pretty okay, but after some time the quality of support decreased a lot.
Azure for now seems to be really good, but they have their price.
Apart from that I don't have anymore life experience recommendations.
I am thinking about the best way tackle an issue. Currently, game type is cell based. I would like to use A* for movement along these cells client side. Each cell would be an actor on the server. These actors would control movement of other actors(Players or npcs). In theory passing information to each other as players and npcs move through the server world. Now the point of all this is to have these actors spawned back and forth between servers. Example you have a map with 1000 players on it. That is 1000 cells that have information that need to be split between servers depending on load. These cell actors need to be able to dynamically change on the servers to handle large numbers of players packed together with each player or npc on their own cell. No cell can be occupied by two players or npcs if the server can redirect players to nearby cells. So during high demand times cell blocks will be allocated to predetermined servers. When demand is low these cells can be pooled on another server. Best example I can come up with is player moves on their their client and movement is applied to their client via A*. The request to move is sent to the sever. The server moves the player through each cell making sure that it is not blocked or another player or npc is on that cell. Once the server is finished moving it will update it to the client. The client should already be where the server is if not it will update. This would also avoid replication of movement and allow for these 1000( based on map design and view range in this game design to see that many players in one location. It would be a system where each session could hold 100 players. A player would receive information for every cell they are viewing. I would use a view count on each cell to manage the server load for each cell. If I have something off here, please let me know because I am looking for best design possible. This is a 2.5D game so 3d world with 2D characters.
If information on a cell changes that a player is viewing the players client will react accordingly and display the visuals needed for that cell. If a player clicks on a cell. Their session will pass that information along to other sessions that have players viewing the same cell.
what's the best way to handle rotating a character towards mouse positon. Right now i get direction from mouse position and player and use SetActorRotation. Do i need to call SetActorRotation on server and call a RPC to server to set actor rotation? This seems like it clashes with using character movement.
call a RPC from client to server
Can RPC's be called before the match starts?
Can I call RPC's when a player is connected to a server, but AGameMode::StartMatch() hasn't been called?
I want to give players 30 seconds to setup before the game starts.
why couldn't you?
when i check my blueprint, and check the valu e being passed here, it's correct
but when i try to set the text on my widget, it never sets
even t he text here is correct
but nothing happens on screen when i call set text
why is "Timeleft" still 123456
when in the photo before this
u can see it should be 27
is this broken?
._.
im dumb
i figured it out lmao
anyone know why GAS gameplay cues trigger twice on the same client?
I made several stress tests for my listen-server based project, I get maximum 60 ping from USA to Russia
But sometimes, even basic movement gets jittering, I believe 60 ping is not that bad, where should I focus to improve the connection?
I also used PktLag to simulate lag, its fine on my computer
But somehow on the other side something goes wrong...
Quick Question, is it difficult no have npcs in a multiplayer match? They speak and react to players with physics?
AttachChildren is an replicated array in SceneComponent. How is it possible that in some cases I have nullptr components there on client side?
Basically they are null right after travel in IntializeComponent phase
@rocky night difficulty is subjective
@shut loom Just two notes, first you have the multicast node taking a pointer, and you're asking if it's valid on the other side before doing anything, but not giving it anything from the server. Also, it'd be much easier to do this all with a simple onrep function and a death bool. Set that bool to true on the server, and let all clients and the server set the death state the same. You'd eliminate a lot of those nodes, and better yet not be reliant on whether that multicast gets dropped or not.
Hi!
Anyone here have used the Variant Set Manager in a networked environment? Back in the day I have created a material/mesh switcher that uses datatables to hold the necessary data. Back then Variant Manager wasn't available. Now that it has finally reached a state that I deemed as usable in our project, I have changed the code from the custom one to Variant Manager switches. While the original code worked perfectly fine on network, the variant manager only switches variants on the server, and not on the clients.
How can I send a client back to the Menu map after a session is destroyed?
There is a delegate FIOnlineSession->OnDestroySessionCompleteDelegates
I'm pretty sure I implement that.
But not sure what steps to actually take?
Do i get world and do a server travel?
Back to the map?
The server travel is for the server to travel all the clients to a new map so you will probably need to open the map from the player controller @twin juniper
What @chrome bay said is also correct so u maybe don’t have to implement it yourself
Usually client just takes themselves back to the menu
@chrome bay I don't think server can do for client..
If server kicks out player, then it might be possible, never tried though
Server can just call a client RPC that tells them to go to the main menu
That's how we do it
Obviously if you disconnect or something, you want to handle the network error by going to the menu anyway
But I'm saying this as if this is a "server wants all the players to quit" sort of situation
Is it good idea to equip the AiCharacters with PlayerState(either default or custom PS for Ai) for multiplayer game??
I don't think any problem with it.
Any advice.
What do you want to store there? @rich ridge
In my current implementation my ASC(Ability System Component) is tightly coupled with PS.
And have started working in AI enemy..
The reason why I put my ASC in PlayerState because I want to retain some state like kills, xp even after player has died and PS is good place to persist these
Guess it depends.. I do since there are a handful of them and they sit in place of human players
@rich ridge player state has a variable called bIsABot so I don’t think you will have any problem using a player state for AI.
Cool thanks brothers
You'll need to set AIController::bWantsPlayerState to true btw to get one
then the gameplay framework handles it like any regular player
Yeah I did that and I use AI specific player state , not default one which is for real players
rgr
virtual void InitPlayerState() override;
I override this function to set my own PS for AI powered characters/
The code is same from super function, I just changed the default PS class to my own
how do we stop a variable from replicating?
@rich ridge what you are doing is actually dangerous when changing used engine version
@empty axle as per my understanding it's not dangerous..
The engine uses the value set in our GameMode
Only for Ai powered character I want other player State
@quick flint
void AActor::PreReplication( IRepChangedPropertyTracker & ChangedPropertyTracker )
{
DOREPLIFETIME_ACTIVE_OVERRIDE( AActor, YourVar, bShouldReplicate);
}
@empty axle if it was really dangerous then why epic will make that function protected and virtual???
I would say to allow override to do custom stuff after the player state is initialized.
I generally avoid overriding and not calling super as in this case if they change the inside of the method you will remain with the old version. That could lead to bugs that no one is experiencing except you
@empty axle that variable tho
if its set to true on the server but not on the client
But I'm saying this as if this is a "server wants all the players to quit" sort of situation
@chrome bay Doesn't OnDestroySessionDelegate get called when the host disconnects?
@empty axle whatever code is written in that function is actually from Super function, I only changed the PlayerState class.
And it do spawns PS for minions and it works
@quick flint you need to set it on server as it is the one that drives the replication
@rich ridge I am just saying that you could have problems happening to you after you change used engine version, because the implementation of InitPlayerState might change and you will remain with the one from the previous version.
I override this function on the MiniondPlayerController
My other PlayerController don't override it
I understood your point , I guess I need to keep on checking the super implementation in every release of engine.. I don't think there is more graceful way to do..😅
So. I don't have a project set up to test this for myself yet, but I've been wondering at what point in the start up that the PlayerState's PlayerID gets populated. And if the ID is consistent across sessions? So if A player logs in and I do stuff based on that ID that lets say gets populated to 23415, if they disconnect and come back in with say the same Steam account or same EpicGames account, does that number get set back to the very same 23415?
@kindred widget this is function where player state is created.. so I don't think playerid will cause issues for me overriding this function to pass my custom minion player state