#multiplayer
1 messages · Page 123 of 1
I think the server needs to show rip2 once because when it gets it from the client it isn't local for the server
Dunno how many of you are using PredictedMovement plugin, but if you are make sure to check the changelog, there have been a few bug fixes that might be worth pulling
now the actual problem i was having is this:
It is showing accessed none in event tick although in receive restart it worked perfectly fine and displayed the names
I have checked this now and it still displays the name although it gives the error
@ruby lodge You would cache that variable on BeginPlay as it comes from a Component that is directly owned by the Pawn
you mean on receive repeat?
Huh? Where in that sentence did I say anything about "receive repeat"?
i don't have a begin play
Then add it.
you literally just told me 5 min ago to delete it
and put a receive repeat instead
here?
do you mean to have receive repeat and beginPlay and to put this into beginPlay?
Put JUST the red circled nodes in BeginPlay!
or switch the receive repeat for a beginPlay again
Read what I am saying to you
you are saying multiple things that are contradicting
first i had a beginPlay
then you told me to delete it and put a receive repeat instead
now you tell me to add it again
🤦♂️
and i am just asking if i should replace the receive repeat with it or have both
No
That was a separate issue
You have a new issue now
Stop combining them
They are different issues
I am giving you the solution to your new issue
what do you mean stop combining them. It's still the same node tree, if this destroys the solution for the first problem then i wouldn't have gained anything
so
add beginplay and put the nodes in them
keep the receive repeat as it is
besides these nodes
gotcha
okay now it's working
I will show you the final node tree so that you could re-check if you want
Hey all i have a simple lean system, the custom event svr lean runs on server and sets lean value. Right now it is working perfectly and when simulating laggy network it still works well.
I was just wondering when i remove setting lean again in the blue highlighted box, when playing with simulated lag it has a big delay to start leaning, why is this and why do we set the lean variable once again affter calling svr lean
Why does it make it run better in laggy simulation
Because you're setting it locally on the client which will happen before the server receives the instruction and replicates the replicated variable back.
It's a matter of:
Press Button > Sending to Server > Changing the value locally > Visually appears instantly on the client activating it > Server eventually replicates value > Activating Client is already visually seeing it as it should be
vs.
Press Button > Sending to Server > Server eventually replicates value > Visually appears delayed on the activating client
it's called client prediction. You apply something locally instead sending data to server and wait for server to send the data back to you.
If sending data takes 20 ms to reach the server, it will take another 20 ms to reach you and other client. So it takes 40 ms just to set the lean value should prediction doesn't exist. this is why you should always emulate lag when developing multiplayer game because the lag free world doesn't exist
is there a context outside of the character bp where i can receive input events?
context:
i want to swap pawns but i don't want to write the code in each of the pawns if possible
it would be helpful if i can get the input event directly in the game mode bp
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = PendingConnectionFailure, ErrorString = Your connection to the host has been lost., Driver = PendingNetDriver IpNetDriver_0
im getting this while trying to join session..voice chat is working though
but not able to load the map
ok i wrote the functionality anyway so i can move it if needed but i want to know where do i do the swapping of the pawns
the pawns will mix and match depending on the level
so each level blueprint will have an array of the pawn characters to cycle for each player
@frozen moat PlayerController
is that a bp i can access?
Well you should really know what the PlayerController is if you do Multiplayer
If you don't, then please read the first pinned Message in this channel
cause apparently i don't own the game mode and i can't run server events in there
That's correct. The GameMode doesn't even exist on Clients
Please read the pinned compendium
oldest or latest?
The top most one. The compendium
All of this is basic and fundamental information
In terms of multiplayer.
The compendium exists to not have to repeat this every day :D
ok a question apart from this is how do i get the level blueprint reference so that i can call functions in it or get the arrays from it in the bp character
Yet here we are 😄
hmm
You generally dont want ro rely on levelbp
C++ there would be, but almost always the LevelBlueprint might be the wrong choice. It has its usages but if you need to access it there is a high chance you are using it for the wrong reasons.
the functionality is level specific though so i think there's no better place other than level bp
That's fair. But without c++ you might not be able to get the reference
You can bind inside of it to other actors Delegates/EventDispatchers but that's about it
i guess i will avoid the level bp cause it's just what characters i want player 1 and player 2 to own for different levels(i'll just have a table or something)
If you are locked to BP only you might have an easier time simply dropping an empty data actor into your scene. And then once at the start of the game either get it with GetActorOfClass or use its own BeginPlay to get any of the statically accessible actors and "register" it there (by setting some reference variable with it)
Somewhat similar to how SpawnPoints work (in terms of the idea behind them)
Extended gamemode
is using GetActorOfClass fine?
It's fine if it's the only way to achieve something
To avoid it you can do the BeginPlay version
But you might have a case where BeginPlay is too late
Or too soon
https://wizardcell.com/unreal/spectating-system/#1-clients-cant-spectate
hi i followed this tutorial to create spectate player
spectating works in server but client not able to spectate any idea how to solve
there's a "finally i can spectate?" subsection might wanna read through that
yeah i read it
and tried the cant spectate bug fix
still no luck
Hi eXi- you got some time to contineu helping me with the player display thingi:) ?
just a simple question
should i unpossess the pawn when possessing the next? and if so, can i do it inside the character bp itself which is going to get unpossessed?
just realised i can't even get context to the possess node in character bp

ok i figured out the missing link.
the default player controller that unreal provides in third person template is a cpp header file. i realized i can create a custom player controller blueprint file.
How to port multiplayer code to singleplayer? E,g, I have a code:
UFUNCTION(Client, Reliable, WithValidation)
void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
void ShowDamageNumber_Implementation(float DamageAmount, AGDCharacterBase* TargetCharacter);
bool ShowDamageNumber_Validate(float DamageAmount, AGDCharacterBase* TargetCharacter);
Should I replace it with
UFUNCTION()
void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
in case Im not planning to make a multiplayer game? Or does it have to deal with local 'server' when playing singeplayer?
specatating?
no i'm cycling characters based on players
oh ok
@dark edge hey i think eXi- bussy maybe you could help me finnish it 🙂 ?
Anybody? Please
i think just remove the implementation and validate function
And move the implementation logic to ur Showdamagenumber func
Is that because in singleplayer server and client have a shared memory so we access the data directly?
in single player local instance of the game will be running on your machine, so u can directly access data, no need to replicate
You don't need the implementation and validation functions in a singleplayer game because you're not dealing with client-server communication or remote procedure calls.
i am just noob, better if someone else replies
with better knowledge
anyone has idea about multiplayer spectating?
does anyone know how to solve it..for engine version 5.2 i remeber getting it to work with 5.0
then issue is definetly port forwarding
in default engine.ini
change this
[/Script/SocketSubsystemEOS.NetDriverEOS]
bIsUsingP2PSockets=true
to
[/Script/SocketSubsystemEOS.NetDriverEOSBase]
bIsUsingP2PSockets=true
this fixed for me
yes
check dm
One simple question: If I want to create session as online mode, do I have to use steam online service or EOS or other such service?
u can use them or create ur own, using onlinesubsystemnull for customized backend service
My game now can only create LAN mode session. Once I created session as Online mode, logs output "TickWorldTravel failed to Handle server travel to URL:"
OK, then I guess something goes wrong in my game.
guys anyone have idea why my client spawns spectator class and even if character is possed i am not able to control character, but spectator class controls are working
Hi. No need any changes, single game will work just like server. But usually the declarations _Implementation and _Validate are not written; they are already in the engine.
What if some functions are written in ReplicatedUsing?
But is there any difference between those 2 ways in singleplayer?
Another question is that in listen server, the host's GetNetMode() is just listen_server, so how to distinguish between client's if_locality on listen_server and host's if_locality on itself (if I want to add some UI only in client)?
Above I meant the listen-server. If the server was made as a listen-server, then the ReplicatedUsing functions can be removed. They are executed only on the client.
If the server is dedicated, then a lot will need to be redone.
What ways? In single game you can remove "Client, Reliable, WithValidation" from UFUNCTION, or not, it will work.
What is if_locality? If you need local player, you can use "Is Local Controller"
yes, you are right.
I mean lets say I'm not planning to add multiplayer for now, So I leave only UFUNCTION() void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter); because its easier to write, read and support. But lets say eventually I decide to make a multiplayer game and take these classes for using in it. So I just move the logic into the _Implementation method, other is just a transport boilerplate. Will it work? Are these 2 ways of writing logic interchangable? Or does every single UE human being using multiplayer-friendly way of writing code right from the start? So they add replication, validation support even into the singleplayer games just because unreal engine can do it? Or is it bad to write UFUNCTION() void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter); instead of a proper client-server method because it doesn't something or breaks in some cases or isnt memory-safe?
Maybe these questions sound strange but I came from another enterprise engine with different architecture and ways of implementing stuff so I just wanna understand how is UE actually meant to be used. For now I can't get neither why including replication code in singleplayer game if its supposed to be running locally, neither why removing replication code from singleplayer game if its supposed to be written this way
Listen server is not a server and client, it is only one programm with client interface
It need be determined whether the game will be single-player or multiplayer. There are many nuances in a multiplayer game. Converting a single-player game into a multiplayer game is fraught with errors. But if you only have a single player game, there is no need for multiplayer code. If you're making a multiplayer game, it's better to do support at the very beginning.
The multiplayer code is memory safe, as far as I know. It will not break if you understand when which RPC is executed.
Thats why Im asking about these very nuances, I havent found an article in the official docs which would say 'do this for SP, do this for MP'. Official doc doesnt make a difference at all
Each game is individual, and the nuances depend on its content.
On what content does using
UFUNCTION(Client, Reliable, WithValidation)
void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
void ShowDamageNumber_Implementation(float DamageAmount, AGDCharacterBase* TargetCharacter);
bool ShowDamageNumber_Validate(float DamageAmount, AGDCharacterBase* TargetCharacter);
instead of
UFUNCTION()
void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
depends?
Its like general UE API, nothing game-specific
Just as everything else Ive asked so far
The first should be used if you are planning a multiplayer game. Second - if only singleplayer game.
But there you said we could use 1st option for singleplayer, so both are valid - whats the best practice then?
No multiplayer code is required for singleplayer game. Writing it is a waste of time. But if you already have it, you can just leave it as is.
If this is a listen-server.
Thanks now it makes sense
Hi guys do we need steam app id to test multiplayer sessions?
Context:
Locally, two machines with wo different steam accounts work.
Over the network, (the region is the same) I can't seem to find sessions.
Hi. You can just use id 480. But you need two different Steam accounts to test multiplayer.
Thank you. I think the problem is somewhere in my code then 😅
Most likely. Last time I checked it was working for me.
How to make the DrawDebug* gets rendered on not only servers but also clients?
hello, so im not very knowledgable in this topic so please corret me if im wrong.
So im in the process of making my ai and my game designed to have tons of AI's.. for player controlled pawn, if you want a replicated custom movement, you have to use character movement component but i remember i read that is not the case for AI.. do i have to built AI equivalent of CMC from the ground up? I dont mind trying to attempt to build one. i know it will take months and i have to see of CMC do it..
I dont want to go this route but if i have to, anyone have attempt to do this? if so, can you advice me on things i need to do / donts? any pointers?
any technology built in unreal you can suggest me look into?
You can use the character system just fine with AI, it's not built 'just' for real players 😛
i thought having ai replicated to players will be expensive too? lets say if a coop mode?
for example having ai like >10
i remember seeing someone tgalking cmc is expensive even for large amount of ai
This is a local thing. Use the Сlient/Multicast RPC in which call DrawDebug.
Ahhhh that makes alot of sense
Thanks alot for the clear explanation
Thanks alot that makes sense, and yeah i figured the same so i tried simulating a bad connection and am just sorting out things that are slow
10 AI is not much AI at all.
not technically aim for 10 but for like more than that.. just an example
Don't give an example. What is your target?
Because the difference between 10 and 100 and 1000 is massive
And each would warrant a different response.
lets say more than 100
if that the target
🤔
Yes, you will want to optimize things. Because you also asked this kind of question in #gameplay-ai, there are answers in there more relevant.
Which is exactly why crossposting is against the server rules.
i just thought since both channel technically relevant to the question, it would be appropriate to crossposting in this case
sorry
Really weird bug.
When the client left the session, the material on the server turn black. Like the material just went off.
What's happening?
I'm using Runtime Virutal Texture by the way
Need way more info to tell
Having a serious problem here:https://forums.unrealengine.com/t/commonsessionsubsystem-in-commonuser-plugin/1331509. Anyone can help me?
Hello I got a question about bandwith. I'm adding passively 1 gold coin per 0.5s. Everything is working perfectly as intended but... is it okay to do so ? I have another alternative where I never add passively golds but evaluate the gold coins amount based on server world time and client-side; i set a timer that fakes incrementation of the gold coins. What do you advice me to do ?
That's literally nothing
unless you intend to play the game through https://en.wikipedia.org/wiki/IP_over_Avian_Carriers then don't worry about it.
the second method is overkill ? (to save bandwidth) ?
the bandwidth of changing a number every half second is approximately zero
don't worry about it
Ok thank you !
1 moving character is like 200x the bandwidth of that
Omg I see
Just by the way : I'm updating the value server-side (no bandwidth consummed) and server replicates the changes that calls OnRep to broadcast the client delegate which updates every 0.5s (I set it in a timer) the gold coins amount
its still nothing with more context ?
basically zero
Well, I have a landscape with a material that using Runtime Virtual Texture.
Honstly that's it. The client leaves the session of the server and the material turn black.
I did had some bugs with UE that sometimes it turns black when you paint maybe it's an engine bug.
That's make no sense that the client leaving would cause the landscape material such a thing.
There's no camera movement or anything also.
It's only happens when I'm using the RVT, while it's off everything works fine.
So I've started to come across issues where only certain things work with PIE and other things work with SA, is there any work around for this or just stick to SA as that will be the closest thing for a release multiplayer game? E.g. Gamemode - PostLogin will fire in PIE and not SA but OnSwapPlayerControllers will activate in SA and not PIE
Hi i am having a problem with my code is there anyone can help me?
i am looking for a solition for hours and couldn't find anything i would be too help if you could help
Just ask your question. Don't ask to ask.
Shoot your issue in here and someone will help if they're able to
This is in my grave BP
When i delete should destroy grave and branch it works fine
when i add that it doesnt work at all
This is in Character MP
How would I display a player count from a dedicated server?
The gamestate has a variable named PlayerArray which has a reference to all player states in the game, if you grab the count from it you have your number 🙂
Works on both the client and server too.
I'm assuming there's no way to do this from blueprints?
how do you replicate metasounds?
i have added an audio component to the bp mesh but only the server can hear his metasounds. He can't hear the rest but the rest can't even hear themselve
multi cast rpc maybe
Working on a little prototype game i've been thinking of, but I cannot figure out the flying mechanic and how to replicate it
Here's the entire code for the seagull character, it's a bit messy, mostly because i've torn it apart trying to figure out what i'm doing wrong here
Any help or advice would be greatly appreciated
(also the recording cuts out a lot, filming on an old quest 2 so if it does that i can't really stop it0
Little update, making the flying events multicast actually helps it, but now it just skips upward and isn't smooth
I only have the problem when set the input mode to "game only" after editing the text input
But I'd like to keep it like that, since otherwise I always have to click once after setting the text with enter in order to get keyboard inputs again
Hi guys, In terms of setting the dedicated server... I have an Issue and I'm not sure what I'm doing wrong.
I set forward PORT into my local router setting to 55000 for example, into dedicated server properties (right click) I put -log -port=55000, into my firewall I also set up inbounds outbounds to that tcp port 55000 and is not connecting from other laptop with the build to the laptop which is running the server. I have an entry map which got on begin play a open level node with my public ip following :55000
quick help, add movement input called on the client isn't replicating to the server and the client isn't moving, but server to client movement is fine. Do I have to instead call add movement input via RPC?
you need UDP, not just TCP
You also can't really connect to your own external IP address when internal to it - your other laptop would need to be on an external network to connect to your external IP address.
Why the hell are you multicasting the destruction of an actor?
It should be a replicated actor
just destroy it serverside
funny thing, I did not see that but in fact that is one of the very problems I am trying to figure out, why actors aren't being destroyed client side
Yes I used mobile hotspot for the other laptop
Do I need to made some changes into some .ini files?
Hi guys, whats the correct place to modify the velocity in a CMC? I ask this because I am trying to implement a slide mechanic and while it 'works' can see some desync time to time.
Quick question: What is the path supposed to point to when using websockets? Is that to a folder on my system or...?
So im trying to spawn a npc on client, So if the host calls this function. it spawns npc. & client sees npc, host sees npc, & everthing functions correct, but if client side calls this function, nothing spawns. Any tips?
Are you trying to do this with a "Run On Client" event on this BP AI actor?
executing on server only
But it is on this BP AI actor blueprint?
yeah
And is this BP AI actor owned by a client?
i dont think so, how would i configure that?
Essentially what im trying to do, is In BP_AI when dead, spawns a new npc class (BP_AIhumanranged), but in multiplayer
works fine on server (host) even works fine if the clients come around the npc will still interact with client
You don't necessarily want it to be owned by a client as you shouldn't need to change ownership just to call an RPC. Ownership of an actor is usually automatically handled when you possess it if it is a pawn (usually the "character" the player is playing as) or when you're spawning the actor. If it's something that can be accessible by multiple clients then you don't want to set the owner.
The "Run On Server" and "Run On Owning Client" events will only trigger correctly on clients if the actor they are being called on is owned by a client, therefore, you need to send the Run On Server event on an actor that is owned by the client.
In this case, since you're wanting to handle when the AI is dead, it shouldn't involve the client at all. The server should know when the AI is dying already as damage/death should be getting handled by the server, and the server should be able to determine what/when to spawn the next actor.
If you don't, then you're just opening up an RPC that will allow a client to spawn actors all they want.
You'd call set owner while runnin on the server.
huh
Hey, is there a way to change/reset a rep notify variable without notifiyng everyone?
Hi guys, does camera camera transform exist on server?
Cause, when i shot line trace (I use camera world location for start vector and (forward vector * some value + start) for end vector) on server, there is no camera rotation
linetrace on client, then send transform on server and do you stuff
yes, i do it like this
but i want to do it on server and when multicast to all clients some action
so i won't trust client
i saw some examples, where people do server only line trace and it worked
If I have a UObject that I replicate by passing it to an actor's 'AddReplicatedSubObject' can I then later remove the UObject and add it to another actor if e.g. an inventory item UObject switches inventory?
hey, I'm new to this - is it possible to call RPC from Actor class (client side)? or it works only if Player Controller possess this actor?
Actor has to be "owned" by the Client, or another actor which is owned by the client in a chain.
Top of the chain is usually the controller
If anyone here has a good advice for that topic I would be glad to hear.
https://forums.unrealengine.com/t/spawn-player-for-multiplayer-top-down/1332538?u=scoly1
Hey guys, I searching all over the web for a good answer. How to propertly spawn a player character while possessing him with an AI controller, AND keep the corrent ownership of each player character. I’m asking because I’m having some problem with my implementation. I’m spawning a junky pawn as the default pawn, then in the player controlle...
I tries do something like this from PC on server side(tried on client side also), but RPC from this Character class not sent to server - am I doing something wrong?
Hi guys, I am following some character mechanics tutorials (C++), in particular a sprint, and while it works fine, when I introduce some lag (network emulation) I get some corrections (p.NetShowCorrections 1) from time to time. Is this normal or does it definitely mean an error in the implementation?
Why my GetAuthGameMode() function running in server always return Null? UGameplayStatics::GetGameMode(GetWorld()) is also Null.
Does the tutorial do anything with a custom CharacterMovementComponent and compressed flags?
Subsystems don't support RPC and replication? I called a RPC function running on server. Guess that's the problem?
no subsystems dont replicate by default, since they are just uobjects. it is usually pretty simple to make uobjects replicate but ive never tried with a subsystem
I found it in this article: https://forums.unrealengine.com/t/programming-subsystems-and-replication/506005.
" it is not possible to replicate properties or call RPCs through a subsystem."
You cannot replicate a subsystem with that.
why not? no actor owner?
Correct.
Replication is tied to actor channels. Subsystems are not owned by actors.
Or at least the default type of subsystems aren't.
even with using the subobject list on some random actor?
I highly doubt it'll replicate correctly due to not actually being owned by the actor. There are numerous problems with that.
If you want to replicate something via a subsystem you usually have the subsystem spawn an actor on the server and use that as your method of replication.
ive used the subobject list for objects not directly owned by the actor before
it does work, sometimes
Yes, but was that actor part of the outer chain?
Direct ownership isn't required, some ownership is.
And I'd imagine that even if it did work somewhat there'd be random things breaking due to assumptions that an object's outer chain eventually leads to the actor it's replicating through.
It also requires the subsystem on both ends to have a stable name (not something easy to guarantee without engine modifications)
And regardless, this still requires you to spawn an actor. So why bother with hacking the engine up when you can just use the actor you need to spawn anyway.
Learned a lot. Thanks. UE programming has so many traps.
@hollow eagle it does work. i put together a quick test of a WorldSubsystem that registers itself onto the gamestate. i got a variable to replicate to clients at least
yes, but you can't access it except through that actor
it's not replicated as a subsystem, and you have no clue what else might break
what do you mean?
UWorld::GetSubsystem will not give you the "replicated" instance of the subsystem, it will give you a local instance of it.
Which means writing a bunch of extra code to grab the replicated one if it even exists
Not to mention, again, that there are likely assumptions around the engine about the actor being in the outer chain.
the widget on the client is using the normal accessor tho
I have no clue what those values are or where they come from
as far as I know you're checking the wrong thing and assuming a value is being set by the server when it's not
"Rep Subsystem Test" is the regular node autogenerated by unreal
I'm aware of that
I'm talking about what the replicated variable is and how it was set.
I would assume something wonky is going on here. Subsystems are created before replication even begins so that subsystem on the client should have been created separately from replication. At best maybe the existing object is being replaced by the replicated one or the actor is grabbing the originally created one and overwriting properties, but I'd imagine that also results in a ton of wonkyness where the object existed before the actor did. I'd be afraid of what this might do to anything that isn't a world subsystem too.
There are multiple UDN posts about using separate objects for replication when dealing with subsystems, I would assume that even if what you think is going on here is actually happening that this is dangerous without understanding why it works and what other systems could possibly break as a result.
And once again: there's little to nothing you gain by doing this, you still need a separate actor.
as far as I can tell, since the server and client generate the subsystems with the same name, unreal is able to link the two together since I did this:
Yes, that is indeed how that'd happen.
Assuming this isn't some PIE-specific weirdness happening since they're in the same process.
good point
lemme try standalone real quick
yep works in standalone. Multicasts ,and OnReps seem to work too.
Oh, this will also break in weird ways because the name isn't stable
subsystem collections don't guarantee anything about the name
if by some chance another world existed first and a full GC hasn't happened your subsystem won't be matched up because it won't have the "default" name
Actually, that situation might be fine because the worlds would have a different name. Still dangerous because subsystem names aren't guaranteed in any way and if anything else created an object with the same name as what the server's subsystem had then you'll end up breaking something.
Anyway, yeah, not something I'd ever do except out of curiosity.
yea i was just curious if i could make it do it
oddly enough USubsystem overrides GetFunctionCallspace which is a network thing. So at some point someone was thinking about replicated subsystems but never actually did anything with it.
isnt that also for static functions? BlueprintFunctionLibrary also overrides that doesnt it
Actually, I misunderstood what it's for. It's network related but not because the object is replicated
It's about ignoring blueprint calls to authority-only functions on clients
and ignoring calls to cosmetic functions on dedicated servers
both of which are relevant to non-replicated objects
I spawned actor in subsystem. In the actor the RPC function is```UFUNCTION(Server,Reliable, BlueprintCallable)
void CallOnServerToTravel(const FString& inTravelURL);
void ACSSReplicateActor::CallOnServerToTravel_Implementation(const FString& inTravelURL)
{
UWorld* testWorld = GetWorld();
ENetMode testMode = testWorld->GetNetMode();
AGameModeBase* GameMode = GetWorld()->GetAuthGameMode();
AGameModeBase* testGameMode = UGameplayStatics::GetGameMode(testWorld);
if(testMode){};
if(testGameMode){};
testWorld->ServerTravel(inTravelURL);
}
``` FActorSpawnParameters pram;
pram.Owner = UGameplayStatics::GetPlayerController(GetWorld(),0);
ReplicatedActor = GetWorld()->SpawnActor<ACSSReplicateActor>(ACSSReplicateActor::StaticClass(),FVector(),FRotator(),pram);
ReplicatedActor->CallOnServerToTravel(inPendingTravelURL);
```But why it crashed here(in the gen.cpp file):```void ACSSReplicateActor::CallOnServerToTravel(const FString& inTravelURL)
{
CSSReplicateActor_eventCallOnServerToTravel_Parms Parms;
Parms.inTravelURL=inTravelURL;
ProcessEvent(FindFunctionChecked(NAME_ACSSReplicateActor_CallOnServerToTravel),&Parms); // Here it crashed.
}```
Anyone kindly enlighten me? Struggling for a long time.
hello, i am trying to connect to my websocket server but i keep getting LogWebSockets: Warning: Lws(Warning): lws_client_handshake: got bad HTTP response '400' in the logs
i am guessing the module has some predefined settings i need to replicate on my server
can you post the error you got?
@dusk orchid Actually Not very much info rider gives me. Is this enough? I looked up in the chat history of this channel, I don't think it's like the error they mentioned, because it's not repeating, it just happened.
FActorSpawnParameters pram;
pram.Owner = UGameplayStatics::GetPlayerController(GetWorld(),0);
ReplicatedActor = GetWorld()->SpawnActor<ACSSReplicateActor>(ACSSReplicateActor::StaticClass(),FVector(),FRotator(),pram);
ReplicatedActor->CallOnServerToTravel(inPendingTravelURL);
Is this on the server or client?
yeah im thinking this is the issue I would instead have the server call spawn the actor itself and since its replicated itll spawn it on the clietns
the reason you're getting access violation is the server never spawned that actor
So, Everything about Replication only transfer from server to client?
And I don't know why this time rider gives me actor is None yet the last time it gives me strange information
Replication != rpc
rpc are functions that are called locally but then executed on a remote machine
client -> server
server -> client
server -> clients
replication are properties that are set in the server and are then updated to the clients
But what about the bReplicates in Actor? How are these actors replicated between server and clients
if an actor is bIsReplicated = true then properties that you set as replicated will be updated when they are changed in the server
it will also be spawned on the client
so if i have
AReplicatedActor
UPROPERTY(Replicated)
int32 Health = 100;
if i spawn this on the server it will spawn it on the server and client
if i then in the server say
Health -= 50;
in both the client and server the health variable will become 50
I kinda get it. I used to believe bReplicates would make them same in server and clients, which is the problem I got.
yeah just remember you want the server to be the one in control (usually maybe you don't for things that should only happen in the client)
Thank you very much, my friend.
hello, does anyone know why the websocket client might be giving me a Error: WebSocket Connection Error: HS: ws upgrade response not 101 message ? i assume my server needs something configured on it
whats your websocket code look like
TMap<FString, FString> Headers;
Headers.Add(TEXT("worldkey"), TEXT("secretkeys"));
Socket = FWebSocketsModule::Get().CreateWebSocket(ServerURL, ServerProtocol, Headers);
Socket->OnConnected().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketConnected);
Socket->OnConnectionError().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketConnectionError);
Socket->OnClosed().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketClosed);
Socket->OnMessage().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketMessageReceived);
and then i call connect
there is little code in the methods right now other than to log
void UAvalonTelemetrySubsystem::Connect()
{
if (Socket)
{
Socket->Connect();
}
}
not exactly anything unusual from what i can tell
i can connect in with postman and send json objects
i can only assume i have configured something i don't need
for values, ws://localhost:8765/ protocolis ws
i checked with the debugger and they values look fine
WebSocket = FWebSocketsModule::Get().CreateWebSocket(CHAT_WSS);
WebSocket->OnConnected().AddUObject(this, &UXYZChatManager::HandleWebSocketConnected);
WebSocket->OnConnectionError().AddUObject(this, &UXYZChatManager::HandleWebSocketConnectionError);
WebSocket->OnClosed().AddUObject(this, &UXYZChatManager::HandleWebSocketClosed);
WebSocket->OnMessage().AddUObject(this, &UXYZChatManager::HandleWebSocketMessageReceived);
if (WebSocket.IsValid())
{
WebSocket->Connect();
}
yeah looks very similar to what i have for my chat system, so it must be some config issue
did you try to make your wesocket url
wss://localhost:port
?
also what are you using to set up your websocket server
Hey all, whats the difference between just multicasting vs multicast the running on server? I have a simple system that applies a material to a mesh and i run it on multicast and it works fine, but for different examples some people first multicast and then run on server, for instance like playing montages. What happens if you run it on server after multicasting?
really
Thats weird i have a system where i have a skin material stored in my player controller and on beginplay i call a multi cast custom event which set material of actor mesh using the material stored frm player controller
and it works fine
Beginplay fires on server aswell
Where do you get such wrong example
Not sure but I have seen on multiple tutorials you need to multicast then run a montage on server
Only server can do multicast rpc
It will get dropped if called by client
So server rpc , then multicast
hey guys i need help, anyone got time to assist me with some widgets displaying friends on screen?
)
sure so, eXi- helped me start the system but we never got to continue and im guessing hes super bussy so ill just send what we got
so first thing is that this is suppose to Add/Remove the Widget "player frames" based on players joining / leaving
but obviously its not working
need help im tottaly lost :/
I got a Fatal Error in my packaged game, which makes it hard for me to find a workaround since I don't see the same error when I try again. It's like a 1 in a thousand chance.
But I also need to resolve the error. Any suggestions?
How can I find the cause of the Fatal Error in a packaged game?
I am finding a way to spawn an Actor from the server, but only have it replicate to certain clients. What would be the best practice to do so?
I'm doing client side prediction for an ability that spawns a projectile for fx. If I predictively spawn the projectile on the client, when the server spawns the projectile, it should replicate for everyone but that client.
I have some ideas for how to do this, but I suspect this might be a common issue and there may be a best practice.
Edit:
I am going for this solution, it seems like a good one
https://github.com/tranek/GASDocumentation#concepts-p-spawn
bool APAReplicatedActorExceptOwner::IsNetRelevantFor(const AActor * RealViewer, const AActor * ViewTarget, const FVector & SrcLocation) const
{
return !IsOwnedBy(ViewTarget);
}
Makes sense, so is it fine to just call a multicast then from beginplay since its called by server, or should i just call a multicast to run on server and then call that on beginplay?
Just add a "Authority" switch first
So you can separate the code ran on server vs clients
Ok thanks that way it will only be run on server and not client?
If it's a replicated actor, begin play will fire on both the server and clients, and it can actually run multiple times on clients as the actor can go in and out of network relevancy which can cause the actor to be spawned and destroyed on specific clients.
This means that Begin Play is usually not the best place to run RPCs, with maybe exception being the player controller on account that it's not replicated to all clients, and it will always be relevant to the client owning the player controller. It also makes little sense to send a multicast from Begin Play on the server as the actor may not exist on any clients by the time you're calling that multicast, and the multicast would not be received by any clients.
The Has Authority node suggested by Squize will allow you to separate what is running on the server or on a client, so if you connect it on Begin Play, that'll allow you to use the "Authority" path to have things run on the server, and the "Remote" path to have things run on clients. This means you can have different functions happen based on where Begin Play is being called. It also means you don't need an RPC from the server to tell a client that an actor started its Begin Play as a client knows when that actor has Begin Play on its own.
I'm new to mulitplayer and encountered an interesting problem. I have some debug code which draws some debug things in a character's tick.
I noticed really bad ghosting when the net mode was set to a dedicated server, and fixed it with this:
void ASurvCharacter::DrawDebugMovementInfo()
{
if (GetNetMode() == NM_DedicatedServer && HasAuthority())
return;
// Draw debug things
}
This doesn't happen in any of the other net modes, where they all work as expected without the quick return statement. Does a dedicated server netmode do something weird like draw debug strings to all clients, or run duplicate ticks?
Has anyone had this problem? The server called reliable RPC function ClientTravelInternal() which is the ue engine code and runs on client. But APlayerController::ClientTravelInternal_Implementation() actually never happens.
why the scope is scaled to 0.02 on all clients?
if(ScopeType == EScopeType::4x)
{
if(LocallyControlled && bOwnerisAimingLocally)
{
4xScopeActor_ptr->GetStaticMesh->SetScale3D(1, 0.02, 1);
}
}
Hey guys, I'm having an issue when trying to join sessions. I'm able to find a session, get the name and id, and call JoinSession. It puts both players (myself and a dev friend) in the Lobby level. But we can't see each other?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Because the Scale is a replicated property.
If you are calling that on the Host, it will be scaled for all Clients?
I'm doing it only on owning client, locally controlled
The Host is LocallyControlled
it is a dedicated
🤷
the player controller spawns and we can move around, but we just cant see each other. spawning and possessing pawns is replicated to the server and multicasted to clients
im not sure why we cant see each other on a session
i will check it using breakpoints, maybe somewhere it is called twice for all clients
player are just the actors as any other actor in the level, they should be spawned by the server, game mode
yea we just tested that :/
Controller call RPC function on server and in this RPC funtion, can it call this controller's another RPC function back to client?
this is spawnplayer
no clue why we can't see each other in the lobby on the same session
we seem to be joining it correctly from JoinSession EOS method with no errors
🧑🏻🚀Support us on our 💲Patreon for awesome benefits: https://www.patreon.com/kekdot
In this video we take a look at how we can spawn characters in multiplayer in Unreal Engine. We take a look at installing a function in the Game Mode that will locate player starts for us, which we then use in a Game Mode function that will spawn our players. Th...
Is there any time value that is synchronized between client server ?
nvm i cn prob live with a little uncertainty
hey guys i have a problem i have a "particle effect" on my character as a component and i trigger it by setting visability to server then rpc set visible but its only working like 10% of the time
the other times its not vissible
ideas :/ ?
components are replicated also
Hey, I have a question about multiplayer fps. Games like overwatch use first person and third person animations. That Means there is 2 gun for a player (tp and fp model).
I have 2 question, which view id doing the line trace? And do they launch a bullet for both view?
Usually the camera
Since UObject doesn't support replication and RPC. Then how is GameplayAbility replicating?
And Can I execute RPC in GameplayAbility?
Network support can be added to UObjects but they must leverage an existing actor.
The GAS component provides that
Instanced abilities can replicate and call RPCs
Oh, I see.
if a struct property is marked NotReplicated, will local changes stick around after the struct itself is replicated?
components are replicated the same way as UObjects are replicated
if you replicate them
yeah
So Im starting replication, And was starting to build a player controller. Currently all Input is done on the Character, But as My player is A vr character and its the only option for the player to control, Do I even need a Player controller for this?
Awesome !
Hi. I have a small question.
Material parameter values are not replicating or what I'm doing wrong here?
If I have more characters with the same skin, the emissive is changing on all characters. What I want is to change the emissive only on the character who receives damage and others to see this.
You can mark timelines for replication
The timeline is not the problem. I'm adding a fixed value and still the same. It's not changing the parameter only on the client who requested it but on all who have the same skin
I'm confused about your logic, i'll admit that
You've got a hard set instance reference?
or is it a material parameter collection ?
When, you hit an enemy, that enemy is playing an montage and everyone sees it. I'm also adding an emissive using a material parameter collection which changes the emissive on the enemy who got the hit. Now, if all enemies are having the exact same skin, the parameter is changing all the skin's emissive
Yes
Well if they're all reading from the same collection, they're all gonna change
Youd need to set the param on the material instance of that specific pawn
Should I use the SK and change the material instance?
Usually that also involves Create Dynamic Material Instance
Id also have the value as an OnRep but i guess this isnt super important
Thank you! I'll try it now
Wroked! Thanks 
Question about replicating instanced structs. If the struct has NotReplicated properties, will they be overwritten when the struct is updated by the server?
I know it's not the case with regular structs, just making sure instanced structs don't have some weird behavior
Just asked this
Suspect the answer is no there aswell
Yeah that's regular struct replication
I suppose it's the same for instanced structs but i wanted to be sure hah
Id be surprised if it was different 😅
Hlo guys
anybody know to make client spectate server or other player
https://wizardcell.com/unreal/spectating-system/#1-clients-cant-spectate
https://unrealcommunity.wiki/revisions/61e4ba838805f02ef3f6c996
i referred these two resource, i was able to** make it work for server** but client spectating is not working
can anybody help
Can someone assist me with this, either I'm not thinking straight or I just can't find the answer. Trying to spawn an actor on Client only but when the server runs it for Client only it also spawns on other clients. It works perfectly fine for Clients but not the ServerClient. (Tried it with Client , Server & No Replication)
If you spawn an actor on a client, it will only be visible on that client. The server and the other clients won't see it or be able to interact with it. So if you see it everywhere, that means you are running that spawn logic on the server.
I know that, the issue is when the Client that is hosting the game spawns it for Client only, it also spawns it on the other Clients.
I don't want it spawning for the other Clients as it's just a "ghost" building for the Client to decide where they want to place it.
Ahh got it. Then you must have **bReplicates **flag set to true on that actor. It has to be false.
When I turn bReplicates off, it then doesn't spawn the actor when it is called from the server to the Clients . So if this is the issue, I'll assume I need to make two different BP_Actors - One with Replicates on and the other with it off.
NVM
I'm a fool, I can change bReplicates when spawning the actor.
Client that is hosting the game spawns it for Client
This is a weird. That client IS the server in this case
Unless you've modified the engine or doing custom networking
He wants it to work for both Dedicated and Listen servers. That's why you have to handle 2 scenarios.
I don't see anywhere where they mention they are supporting both setups. That said - it is trivial to do.
I haven't modified it. I know one of the Clients becomes the server (the host of the game). It's just when the player for the Server spawns it for themselves, it also spawned it for the other Clients and with every reeplication I tried it didn't work - I didn't know that I could call the Set Replicates after spawning the actor
So you're doing host migration?
Client has a pretty specific definition in the context of UE networking. It can easily be confused with the way you're using it imo.
Not a clue 😂 Can't answer that.
Client implies that you are not the server
Still learning the whole MP side of things. This was just a bump in the road for myself.
So "client becomes the server" would be host migration pretty much
Obviously client also means the player. But for most speak, client is non-server
Yea i know that but when hosting a game with Advanced Sessions, the one hosting it is technically the Server (I believe)?
Yes.
Most of the stuff I've done so far work perfectly fine, this was the only issue I've come across.
But when asking for help or talking about it, you don't say "the client that is the host". You just say "the server" because that's all that matters.
Ok
Client that is hosting the game spawns it for Client
So with that in mind - this reads very weird if you're only in the context of Unreal.
(Again, I know client has a dual meaning here!)
Yea I get you, I'm trying to figure out how I would phrase it now. Would you just the Server Player? The Player that is running the Server?
Just server - because that's all that matters
"Server spawns it for the client, I don't want it to. I only want to spawn on the server"
Ok, so the issue was the server was spawning the actor for all the clients when I wanted it just on the server
Right. In which case, you just disable bReplicates (which you already know now)
listen server?
Yea, I didn't know I could call bReplicates after spawning the actor
Yup
I wonder if doing a deferred spawn would be better, that way you don't set up the actor channel 🤔
@chrome bay Do you know when the actor channel actually gets set up during the actor lifecycle? (not at my IDE)
i think its created when the actor is initialized and bReplicates is set to true, that is why you need to disable it if you don't need it to replicate
Mhmm, I didn't know of Deferred Spawn. Thanks for that, I'll have to see if it's possible in BP if not I can do it that way if/when I change stuff over to C++
I'm just setting the default to false for now and then change it to true once it's finished setting up.
you need to set it in the constructor if you want the actor to replicate, maybe if you can show your code
Can confirm, it works that way for now.
I'm using BP's for now since it's technically a prototype game.
My literal cheap cut easy way to make it work for the time being. By default I changed it to bReplicates = false and I change it to True when spawned.
Why you don't set it to true in the base class defaults (the actor class you trying to spawn)
also check replicate movement if needed
I had it as True but the initial setup of it still spawns it for the Clients
thats the expected behaviour
I know that. The question is at what lifecycle event is it created.
Actors have like 14 lifecycle events or something crazy like that
Hang on sorry. So I changed it to bReplicated = False after the Actor spawns as I didn't want it to Spawn for the Clients when the Server called it, that very initial setup would Spawn it for the Clients. Just setting it to False for the time being just lets me quickly test it.
Clearly my logic was flawed with the whole "Setting to False after it Spawns" because it still spawned :/
I'm just going to add a variable in after where bGhost = True > Replicate = False else True
Hmm if its a ghost to display where the actor should be placed, just spawn locally on the client without any rpc's just call spawn actor directly and make another ghost actor that is not replicated
I tried that but when the Server called to do it without any RPC it still replicated.
I tried Replicates = Client/Server/No Replication and they all caused that issue for me, spawning it for the Client as well as the Server
Believe me, I thought it was going to be a simple thing but I must have done something somewhere that made it not so simple.
it is simple, you should use 2 different actors, one for ghost not replicated (bReplicates = false in class defaults) and the second actor for a building that replicates (bReplicates = true in class defaults) then you don't need to call SetReplicates function
I'm only using the single actor for now, would it be bad to use a single one in this case?
I mentioned here that I would make Two Actors but then I found out I could just do Set Replicates after it spawns.
maybe thats what caused the problem in the first place, try to make a child actor of your current actor and use one of them as ghost that is not replicated and make the other one replicated without calling SetReplicates function
I would have probably thought of the child actor further down the track when I go over everything again and ask myself "Why did I do it this way and not the other"
I was honestly just going to use the single actor and change out the material & replicates once spawned into the world.
can anyone help?
Has anyone had replication graph suddenly die on them recently with the GameplayDebuggerCategoryReplicator becoming None in the always relevant node?
🤔
feelin cute, so ill ask for advice, whats the right way to specify the level when executing server travel command? i have seamless travel enabled and a BS level for a lobby..
the map is /Content/Maps/LevelTwo =/
Ive got servertravel /Game/Maps/MAPNAME
Is it possible for cheating to occur with client authoritative movement via 'add movement input' and 'add controller yaw'?
I have 2 types of pawn, 1 is visible and is move server authoritatively, the other type of pawn is less important and is invisible. Problem is this has different parameters and I am having trouble getting it to move smoothly using server authoritative movement. Since it's invisible I don't care about slight conflicts between its position on different clients (it's also not relevant to anything fast-paced). But could a player cheat by getting it to move very fast?
Clients should be authoritative over their own inputs (i.e. key presses) but if you want to prevent certain types of cheating, the client needs to send these inputs to the server and the server processes these into movement updates. To get smooth movement in this model, the Client needs to also do the same processing and predict the movement updates the server will calculate. The default CharacterMovementComponent works in this way so as long as you're calling AddMovementInput and AddControllerYaw on the client things should be Server Authoritative and smooth
how to replicate UObjects in blueprint?
i checked replication flag but it doesnt seem to work
Afaik you can't do this for your own arbitrary UObjects in blueprint. If you want to replicate a UObject, you'll need to use some c++, or make your UObjects ActorComponents and attach them to a replicating Actor (as well as set replicates=true on the actor component)
i am making an inventory system
is there any class other than actor i could use to replicate it instead?
All replication in Unreal requires a replicated Actor to start with. That Actor can optionally replicate UObjects on it's channel using a c++ method ReplicateSubObjects. By default, Actor will replicate it's ActorComponents on this channel. If you want to replicate your own UObjects on that channel as well, you need to do some c++ (or just use Actor Components)
Alternatively, you can send all of your updates via RPC's which could maybe work depending on your data model but you'll need to handle all kinds of edge cases to ensure reliable sends of data
ahhhh, looking at the log, it showed cant have a space between MapName and ?listen
removed that and servertravel kicked
ok thanks, i will look into using actor components
but can i use components inside a component?
because my uobjects are already in an actor component
You can, when you create them make sure to set the Actor as their Outer object though.
ohh so i have to set it to the component? im currently setting it to the player character
You want the Outer of the Actor Components you create to be the same as whichever Actor you will be replicating them on
alright then that would be the player in this case i guess
how would i instance a new actor component though? using construct node gives some error
Does Add Component By Class do what you want?
ahh yes thats what i was looking for, thx
how would i set the outer though?
or is that done automatically in BP?
guess the outer for components is always its attached actor 🤷♂️
ohh no, its the target input
Does anyone know what nonOwnedActors mean when doing seamless travel? It's pulling in random actors like the controlled pawn even though the docs specifically say only the controller, player-state get pulled in by default
Yea this is the case, Actor Components expect to have its Outer as the Actor is a component of
i wonder if stacking this many components on my player would have any detrimental effects though
since they are actually attached to the player now and not the inventory component
cant use self reference for target
There shouldn't be that much of a detrimental effect as long as your not iterating through all of your Actor's components very often
well i do use components quite a lot
kinda everything is nested in some component lol
but in worst case i can use a separate actor as container i guess
mass spamming components is no bueno 😂
with uobjects i could add 100k in 1 loop no problem xD
now it freezes for a minute and then dies when i try to add 10k lol
Ah, yea 100k objects is quite a lot...
im still hoping i can get the uobjects to work, maybe im just being retarded lol
@potent coral Is each item in the inventory a new component?
well currently each stack is an object
sounds a bit strange I'll admit
its pretty efficient, it can handle millions of items quickly
But why not just have an array holding all the items?
well thats what i do, just the items are uobjects lol
but how to replicate it? `,...,´
replicateSubObject
how to do that in blueprint?
can't
cancer
because i cant subclass structs lol
InstancedStructs exist
blueprint structs are useless
why cant i just replicate uobjects and their properties lol
no
but i also have some subclasses like consumables etc with more stuff
relationalDB setup would work
whats that?
Instead of a superDT that holds All variables known to man
you split it in several DT's,
and let one DT point to another DT
and thus 'construct' the complete item definition on the fly
thats kinda what i was trying to avoid with this system xD
sounds like you're not doing yourself a favor
I do too, and it's awesome
All i replicate is some row pointers
(or in my case, just gameplaytags, as those are my rows)
I have a weird problem with variables. My array has 10 items, i add 2 more with some code. After adding, code goes to client side to update some widget. But when i print length of array in widget, it prints 10. But if i use Delay Until Next Tick or Delay node, it prints 12. I couldnt understand this. I am already adding array at server side first, then print it in client. Why do i need to use delay node. I know delay is not right solution and dont know what is it about.
First screenshot is when i dont use delay node. You can see it prints ADD firstly. But client doesnt print 12.
Second screenshot is when i use delay. Again, server adds firstly, and client prints 12.
replication isnt instant
And if you are, is this object pointers ?
OnRep is post replication
but yeah as @hoary spear suggested, just use OnRep to print your variable
yepp
for clients
you set the array (or add to it) on the server
Then the clients will get the "OnRep" event when the item is replicated
you can use it for the server aswell
It looks good, can clients set a variable which is RepNotify?
Or is it same with Replicated
only server
in bp yes
i love how consistent it is
bp vs c++
😄
lol
Thanks for help :)
I will change my codes to RepNotify but it looks better
Yes, they can. All RepNotify means is when the variable is received via replication, call the backing function. In BP - the backing function is always called. In C++, you have to call it manually when on the server.
But is it safe? Clients cant set any Replicated variable(i mean it will stay same at server). Isn't RepNotify same?
talking about cheating
This is how basic prediction works. The client updates their side and then the server may or may not correct the client when the client gets the server's value.
guess i will just not use shitty unreal replication and use ye ole networking instead
Hi guys! I have a question, I'm using online subsystem steam, and I'm using the dev app id 480, my project create the session successfully, but when I try to join to the session from another steam account, the project doesn't find my currently session created, it's weird
void UNSM_MultiplayerManagerSubSystem::OnFindSessionComplete(bool bWasSucessful)
{
if(!SessionInterface.IsValid())
{
FNSMOnFindSessionCompleteDelegate.Broadcast(TArray<FOnlineSessionSearchResult>(), false);
return;
}
if(LastSessionSearch->SearchResults.Num() <= 0)
{
FNSMOnFindSessionCompleteDelegate.Broadcast(TArray<FOnlineSessionSearchResult>(), false);
CreateSession(3, FString("FreeForAll"));
return;
}
SessionInterface->ClearOnFindSessionsCompleteDelegate_Handle(FindSessionCompleteDelegateHandle);
FNSMOnFindSessionCompleteDelegate.Broadcast(LastSessionSearch->SearchResults, bWasSucessful);
}This always create a new session because the searchresult it's 0
Personally i had trouble with that myself and just jumped over to advanced steam sessions 😅
Can we not post memes in programming channels, they're distracting
Anyone knows how install als replicated plugin?
well its not like the inventory will be used that often
and in worst case i can switch to a system that isnt object oriented
yeah thats on my radar rn too
wdym?
If you're not even willing to go to C++ to create a simple replicating UObject then I don't understand how you're intending to roll your own networking solution
well im making a blueprint only project, so doing it the unreal way is kinda my only option xD
You're going to have a bad time if you're trying to do networking as BP only.
Is there even such a thing as a blueprint only project when the entire engine is built on C++
Adding C++ to your project is no different
Not saying you can't mind you. But so many things are simply not exposed to BP
I don't understand the purpose of BP only
And depending on your goals - it might actually simply not even be possible.
well i already have a working blueprint inventory system for multiplayer, im just trying to make it in a new/better way
Anyone making a multiplayer inventory instead of using ArcInventory is either doing it for the sake of learning or insane imo
but i wasnt aware how cancerous networking uobjects in blueprint was when i started making it xD
You pretty much aren't going to make something better
Its not cancerous, its just not supported
There's no reason you can't just do it in C++ and expose your replicated UObject to BP
Guess most people who are doing networking are insane.
well this new system has no problems adding 100k new objects in a single for loop
I don't know what that means 😄
I haven't heard of this plugin and it doesn't look too enticing to me. Especially considering I don't use GAS at all. Definitely don't want a plugin that has that as a dependency.
for comparison, when using actor component in the same system, it cries already when adding just 100 objects
thats literally 1000x worse performance lol
Its net predicted inventory that works for almost anything you can think of
You don't need to be particularly familiar with GAS to use it, only GameplayTags
It's not a matter of being familiar with GAS for me. It's a matter of not wanting that dependency.
Why's that?
Because I don't use it and it's just extra crap
u dont need GAS to have gameplay tags
Not to mention - this is a code plugin, so that is potentially $150 per seat. However the rep at Epic wants to define it that day.
What? Its not per seat
Cool. The topic is about a plugin that specifically says it requires that GAS is enabled.
Licensing terms are clear, you can share with people working on your project
Not according to the last rep I got with from Epic themselves.
I will continue to go by the licensing terms
If you have 5 people are working inside of the plugin (IE the code part), you need 5 copies of it, per Unreal's own terms
There was a big talk about this in #programmer-hangout
Along with screenshots of discussions with Epic
But if your level designer is using it (for w/e reason), just using it, you don't need the additional "seat"
What does this even mean?
You mean if they're modifying the plugin itself directly?
Good question. Maybe you'll have better luck getting Epic to clarify.
Anyway sorry for getting off-topic
Didn't mean for it to turn into a thing 😄
Guys move to a different channel please, this is offtopic now
We stopped
👍
Hi, i thought about it again but i guess i shouldnt use RepNotify. Because i dont want to execute these codes on every change of variable, mine is very specific. I dont think that i can explain my system here but isnt there another way to sync variable between server and client? Thanks again
you can add a condition / branch at start of your rep notify aswell 🙂
or change replication conditions
or could also use a RPC to print your message on client with value from server
I thought about it but i don't know, it looked like it would make the codes spaghetti
I will check replication conditions, thank you
well yeah thats spaghet for sure so i recommend OnRep instead^^
What if you didn't want to use GAS?
💔
I hadn't considered that people might have a reason to avoid it, that's all
Hey, double checking something here.
If I get the game instance and cast it inside a widget class, and right after I load a save object, does that mean that 100% I'm getting the save object of the local machine and not any other server and/or client?
Or, in other words, what is the best method to retrieve a save file within a widget?
GameInstance is local only
Widgets are local only
So if you're getting a save game that way, it is the save game on the local machine.
Hi all,
I'm having a bit of an issue hosting a dedicated server via a batch file, I followed Epic Games' EOS session tutorial, but at the very end myself and another dev (on a separate machine) can't seem to see each other when joining the session. We're using UE 5.2. and the latest EOS. Here's the general flow:
- We both open the game application
- I run StartServer.bat with this command:
"C:\Program Files\Epic Games\UE_5.2\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Users\MyName\Documents\Unreal Projects\ProtoPlaneFootball\missile-ball\ProtoPlaneFootball.uproject" Lobby -server -log -epicapp="Server" -options pause - We both login correctly on the game application, through EOS Login. We confirm this by being able to see the overlay and our username in-game.
- We click Play Game to bring up a sessions list
- In the sessions list, we both see the same session id and session container (just a join and delete button)
When we both join the session, we can't see each other.
I confirm the session is being created via the StartServer batch file by checking the dev portal, so I'm not sure if it's due to the join session logic or if I'm missing something crucial. Below is my JoinSession logic in my EOSGameInstance.cpp
https://pastebin.com/DnjfUKtC
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
we've been trying to see each other in-game for a while, not really getting anywhere
I see, thanks! So if I'm not wrong, I don't even need to use the game instance, any save game that I cast within a widget will be the save game of that local machine. Correct?
If the widget is what is loading locally, then yeah.
Because you could also send a save game through the network, as an FYI.
So assuming you're not doing that
Yeah, not the case, trying to retrieve all saved settings without getting wrong save objects
useful, needed to double check for peace of mind, thanks!
Any clue why we might not be able to see each other?
Hi everyone, just wondering if Advanced Sessions is updated for use with 5.2? If It is, it is recommended to use if I'm trying to do multiplayer hosted servers through Steam?
What does you Logs say?
The Logs will tell you if it managed to join successfully.
It says Created Session, then nothing afterwards
For both players?
yeah
Why are you both calling Create Session???
Oh my bad thought you were asking something else
the command prompt logs shows it created the session
but nothing afterwards about joining, despite using JoinSession on the same name
So one player calls Create Session?
no player does, it's ran via a batch file
Which would be the host.
it's a dedicated server
Ok then Im talking about the Players Logs
What does their Logs tell you about connecting to the session?
Well I see the connection info before and after the client travels, it changes but that's about it for logs
then it puts them into the staging area
but there's nothing on the dedicated server, hosting the session, command prompt that shows they join
Question, with sub stepping used for simulation of anything on the client side (Movement, Physics), if the client simulation is fixed and anything is substepped below the upper limit does this data need to be also replicated to the server or can the client just send the final result of the simulation to the server and then the server just interpolates that data as is (meaning the server doesn't need to substep also).
@fluid prawn the CMC at least performs substepping on both ends.
But of course only once RPC
Not one per substep
At least the current cmc
5.4 should come with a new system iirc
At least they said so at UnrealFest
Thanks, I was talking with a dev and he was doing substepping on the client but wasn't simulating it on teh server side so I was wondering if Unreal was doing it like you described
he had issues with desyncing also
after adding client side substepping and was just sending the movement to the server as is
Substepping is meant to have a more precise result. Since server compares their result against the clients one, it must to the steps too
yea
well I didn't know but logically in my head I was thinking like, well if say I substep all clients at 60 hz or w.e ideally I'd like to sync the server at the same rate
I assume CS works this way too I think
128 60 tick etc
Well client does not send the substeps
no ofcourse
I mean like the server does the calculation also
ie it substeps based on client data sent
Yeah but the server uses a calculated delta time for clients iirc
Basically time since last move I guess
yeah
I'm eager to know how Movement 2.0 will be
I really hope it will allow more than just characters
I had someone ask epic about it and give me some little details
And more systems to use prediction
was something along the lines of modularity and roll back
but he said that it wasn't something you couldnt sit down and implement given time
Pretty sure since 5.3 shipped, one can scout main branch for this
but for new people its def a time saver
I think right now the engine has a huge problem with only the CMC being properly predicted
And every other system running its own prediction code, not in sync with another and often only half assed for the given problem
Time will tell
yeah, it's needed a rework since I first came into unreal. I am glad they are working on it. I remember there was a prediction plugin I was seeing pushed on the github
that also kinda died, rumors the person working on it left or something
Thanks @thin stratus for the wonderful response
The person did leave yes
The plugin is also still there. They update some small stuff on it. Could be that it's the core of the new movement. Who knows
It should. According to their roadmap.
It pretty specifically says a goal is to allow it to be on any actor
can anyone help me with this
Hey eXi- You got time to help me 🙂 ?
You shouldn't randomly ping people
If he's here, got time to help, and want to help, he'll answer
if not, bugging him with pings is not a good way to go
y i know you right
its just he started helping me 1 week ago with the thingi :/
but yeah your right
Pose your question, and somebody else might be able to answer
Gotta expect to do a little work yourself as well, understanding it as best you can
yeah ofc ive tried trust to
me*
i guess i can ask again it quite much thats why ppl wont answer cuz its not just "a wrong" its not working at all really
You should try and reduce your problem to as few things as possible
and be precise when describing it
showing code helps alot
yeah ok so firstyl what im after is a UI lineup of the friendly players
yeah so its quite alot really messy but this system is suppose to add/remove widgets in the slots based on ppl joining / leaving
problem rn is that nothings happening
And what have you found out from debugging?
yeah so the first bugg we had was that it got a null reff from the playerhud widget from wich eXi told me to relloacte it to the player controller instead of the player wich i then did (was alot of work) but that the first thing now that works
But whats debugging it now telling you?
What code is not fired or which variable is not valid etc
well
thats like the hard part
the "character from the friendly hero is NOT VALID*
and that being set up like this
from this part calling it
You shouldnt use GetPlayerController for one
Whats calling SetCharacter ?
Is it valid when its set?
Is that server side or client side ?
And... are you checking a replicated variable in a widget?
Or do you have a replicated variable in a widget?
The reason i ask is because widgets dont replicate
So having a replicated variable inside a widget doesnt make sense
Not sure what Exi suggested, but wouldnt it be reasonable tonread out the player array from the gamestate and use that to chevk affinity/team and add the widgets based on that list?
im not sure tbh he made this example the wholeness but we never "finnished" thats the part
im not sure of any of that i just did what he suggested
maybe this is a to hard way to do it i maybe should find a easier solution :/?
If theres so much insecurity at this stage i kinda wanna suggest dropping multiplayer if thats an option 😅 it adds a ton of complexitiy
Steep leaening curve, many gotchas
Being able to debug, understanding the framework, server authority etc etc etc
im to deep into the proeject to drop it 😛 everything else works fine its just this part im struggeling with with mp
yeah im trying to get it but it messy
i mean
in my head this logic should work ?? im getting all gamestates and getting each playerstate from that and getting info from each ones individuall state ?
right ?
You're cutting so much, it's hard to see the full picture
But im theory it should work if their replication is complete
im just testing
right ?
so now it only gives the local players info on all frames
Does this work?
its only displaying its own name
its own states*
oh right could the problem be
in the player state this is how im setting player character
by get player character
thats could be the issue right
or why is it not working :/&
u basically want a player list ryt?
i recommend u check this video
https://www.youtube.com/watch?v=yP9mdOUHKkE&t=3s&ab_channel=Kekdot
👨🏫 My Patreon link:
https://www.patreon.com/kekdot
Download Project Files | Premium Tutorials | Courses
In this tutorial video I show you how you can make a replicated Player List that displays the players that are connected to your session. The Host/Server of the session will also be able to kick the players from the session, and will not...
will do ty!
why in the player state?
just testing stuff
ok so i remade the whole thing
based on the tutorial
@coarse patrol
since the tutorial is not exactly what im after obviously im trying to adjust it but it was basicly what i already did before but missed a few things, tho now im stuck at the same problem
so now it works by when pll joining / leaving the game the Widgets gets updates removes/added correctly
however the update information dose not
this is the problem
theyre all displaying player 1´´s info
@hoary spear
What is player char bp parent anyways?
thats the "player character"
Again, these random tags...
aye it begann as something else but that was months ago and renaming stuff in unreal ive noticed is a big nono X)
No need to cast to playerstate. Get pawn from generic playerstate
I ment random pings
oh'*
aye sry xd though u would be interessted since u started to help 😛
so this one ?
😮
Yepp
its working
noooicee
i think
altho
one small thing
now its adding the ammount of players in game
i dont want it to add "self" only friendly players
Check the owning controller of the playerstate
And if its equal to the owning controller of the widget, block it
You also dont need to cast to your game instance fyi
im not casting to my game instance :/ ?
In the start you are
thats the game state
oh, well its a custom one so then i have to ?
No
i just did as the tutorial said
oh ok
😈
so i just get the game state really ?
Which part
Its the same gamestate
oh yeah my bad
Casting doesnt fix invalud gamestate
thats noit the problem
Exactly
Thats the point right?
erhmm so this is weird
server shows all 4 client 1,2 shows only 1 and client 3 shows all 4
wtf
Ok pc is not replicated
My bad
Check if the playerstate is == owning players playerstate
Or rather !=
If its equal its the owning players playerstate
Otherwise its another clients playerstate
Your checking playerstate against playercontroller
oh right
You gotta keep track of the object types you're comparing
Yepp
Assuming you plugged in the owning player
yy
When you made the widget
did
Is it still updated on tick?
no
so basicly its updating in the game mode with the login / logout
Try it on tick just to verify
Gamemode is server only
Also swap for retriggerable delay
ah smart
And change it to 1 sec
aye thats smarter % better ofc but same issuue
Same still?
Check if the widget is updated multiple times