#multiplayer
1 messages · Page 1 of 1 (latest)
Hi, I'm having an issue with character selection, I've removed everything I've tried so far to start from scratch and basically have it set up so from a character selection widget the SelectedCharacter is set on the game instance because I need it to persist from the pre lobby level over to the actual game level, then on the game mode of the game level is where spawning players happens, so I get the SelectedCharacter from the game instance and feed it into spawn actor, right now all that happens is the client players spawn in with whatever character the server player chose instead of the ones they chose, how can I get this to work so it saves each players character properly and spawns their chosen character?
Character Selection Widget
Spawn Players on Game Mode
and yes im aware there is no replication happening in the images because i removed everything i tried because it didnt work
The gamemode only exists on the server. So if you want clients to have a certain character you need to in some way notify the server which character a client wants to use and then dynamically spawn that character. You seem to currently just always pull from the game instance which will only be valid for the server player because game instances are not shared across the network, hence why you get the issue you described.
You could for example pass it as an argument to the server when joining or you could wait until the Player Controller is setup and then send a RPC to the server so it can spawn the character.
So should i not store it on the game instance? considering i need it to persist as character selection happens in the pre lobby level so the game mode and player controller are different from the ones doing spawning
If your pre lobby level is already on the server then you could individually store all selected characters in the game instance sure. But currently you seem to be storing just one player character in there.
I assume you're just storing the selected character per player in their own game instance?
If so then this simply doesn't work as like I've said before the game instance is local to a player. The server doesn't know about the other game instances from other people.
Yeah i think thats whats happening, in the first image its just setting the selected character on the game instance from a widget that each player gets created so is there any way to get that information from the individual players game instances or a way to get it from the game instance to the player controller because the spawn players event that is happening on the game mode is for looping through all connected players then spawning each of them so i should have access to each players selected character from there?
What I think is a simple solution here is to once someone decides what character they want to send a RPC in the pre-lobby map to the server saying "Hey I want to pick this character", then the server can store that information in for example their game instance in some way that is associated with the connected player and then once you load the actual map all the server has to do is spawn the associated character for that player.
You could also do what you said yes where you store the character in the game instance for each individual player like you currently do but once the player controller is valid on a client send a RPC to the server in the actual game map with the character they selected. The only 'problem' with that is that you need to move your loop until all players have send their character and obviously only then spawn the characters.
I think option 1 is easier because most games that have a character selection I would say wait to start the game until everyone is ready, so by the time everyone is ready you already have all information and can almost directly spawn the characters upon loading the actual map unlike the other solution where you need to once again wait for everyone to send their data. Seems a bit redundant 😛
But those are some options you have, pick whatever you think is good for your game 🙂
Yea, also have you watched the couch talk where some Epic staff explain all sorts of multiplayer concepts? They go over that.
This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.
NEWS
Unlocking Breach’s combat with Unreal Engine
https://www.unrealengine.com/en-US/tech-blog/unlocking-breach-s-combat-with-unreal-engine
...
It’s a slightly older video but the core concepts and optimization techniques are the same.
can someone please help me
my animation montages on the left arm dont work
i tried everything
thanks
Yes I have, though need to have another look. Thanks btw.
Perfect! They mentioned the same things that I was talking about. Its been a while I saw that. haha thanks again!
Thanks for your help, I ended up ServerRPCing the selected character to the player state, using the CopyProperties event to send the selected character over to the new player state that gets created after ServerTravel and then got it directly from there and plugged into SpawnActor and it seems to be working as expected 🙂
Nice! 😄
Well yes that's what PushModel used for. If you have too many replicated actors you can definitely take a look at NetManagers as they come with better results: https://vorixo.github.io/devtricks/network-managers/
uh, from my experience they do. Initial becomes dormant after a net update or a flush dormancy server side
and dormant stays dormant after a net update
ofc they become awake for the time the net update refreshes the actor
tried this on 5.0.3
Hey guys, I got an problem.
So I have an walking animation and made some anim notifies. Then in the animbp the anim notifies will get called. Then a boolean (repnotify) will get set true of false. Then with the repnotify getting called I made it that the character will move or not. Problem is that there is an big delay.
In standalone game there is not a delay.
Why does that need to be replicated?
AnimNotifies run on Animations
Animations run based off of replicated data
E.g. Velocity
So the Notifies already call on everyone
There is theoretically no need to replicate anything from that point on
Additionally the AnimBP should not be replicated or contain replicated stuff like vars or rpcs
The movement of the character needs to be replicated tho.
Right?
With the set movement node to walking and to none
Still, if it isn't replicating there will still be an big delay
I am setting the movement to walking and none for an AI, I tried calling the set movement mode walking/none in the event graph of the AI, same results...
Well for one, AI movement mode doesn't need to be replicated by you
Cause server will replicate anyway
And then the clietn only simulates
@thin stratus The problem is that an anim notify is getting called and it will set the movement mode, but its not in sync it doesn't happen immediately when called.
How exactly does deciding if a UObject should be replicated or not work? Say I have 10 member variables, 6 are marked as UPROPERTY of which 1 is replicated, and then 4 are not marked as UPROPERTY.
When it comes time to check if this object should be replicated, which properties are checked for changes? all 10 member variables? the 6 UPROPERTY variables or the single UPROPERTY variable that is marked as replicating?
The actor can report a list of replicated properties
Which in C++ you even manually supply
I guess you mean in GetLifetimeReplicatedProps
Hmmm, what if it's a struct that we are talking about then?
Think that works with NetSerialization, but I don't know atm
I believe NetSerialize is called when the engine has decided it wants to replicate the struct, but I am curious as to the rules of making that decision in the first place (so what properties are used to figure out if the struct is dirty for the connection and should replicate)
hi I'm back I've tried to fix the blueprint with what you suggested, I moved the entire hot bar into a blueprint component and only use the widget when I need to show something however my RPC still won't run, again the first image is the character blueprint and the second is the player controller. hotbarcomponent is a blueprint component in the character that handels the abilities the player has and functions that handle them, does anyone know why the RPC won't trigger this time?
any tips if my replicated jetpack movement looks quite jagged? I have a timer that launches the character every 0.05 seconds after applying a couple multipliers to their current velocity. the best two ways i have are only launching on the server, which naturally delays starting and stopping; and launching on all, enabling client authoritative position and disabling error correction while it's active, which looks amazing between client-server even on bad connection but doesn't help client-client. tried a bunch of other configurations and tutorials but I don't see what I'm missing. can post screenshots
Widgets aren't replicated. You can't RPC them to the server, or from the server.
But I'm not the rpc is for a blueprint component not a widget
Hotbar component is a blueprint component not a widget
YOu using Character?
You probably want to do a custom movement mode
Unless there's some new hotness with adding force
but launching 20x a second is NOT the approach
Ah I see. Are you sure it's only your RPC that is failing? Like, your cast there could be failing, and it's possible your HasAuthority could be running on Authority.
Save that, if you've spawned the hotbar component on the client, the server wouldn't know about it.
Anyone know why my clients arent being possessed in my packaged game but work fine in the editor?
Both the class and hasAuthority are running correctly it only jump on the rpc , the component is set to replicate and is also inside client player controller
Unless it is spawned by the server, then it won't exist on the server to reference.
default character movement. for a couple reasons the jetpack is a separate actor, but I talk directly to the owner through a reference. the launch isn't replicated; when the owner clicks, the owner starts a timer then sends an RPC to server then multicast telling everyone except islocallycontrolled to start their own timer. I figured that would be less affected by fps than add force, you still recommend that? I'll look into a custom movement mode, thanks
If you put it on your PC by default, then it should be fine.
Then the last question is, what actor are you calling this RPC in? Does the player own it?
The component is spawn when the character spawn on both client and server
But how do I change my code so that it may succeed
I'm calling it on the player character and it is owned by the player
Have you tested with network lag and jitter at all?
I've the component on the character however the client pc have a variable of the component
yeah, I've got South African friends so I especially wanted to make it feel good for them. if I set network emulation to "bad" and set authoritative client position and disable error correction while active (not concerned about hacking), it looks perfect between client and server but not between client and client. even with it set to "normal" it looks crazy jagged
Yeah custom movement mode for sure if you're serious about it being smooth.
Ignore the command in my name
https://www.youtube.com/watch?v=DoZyH86n_gs
Higher playback speed recommended. It makes those moments of dead air where I am figuring out what the hell I wrote more palatable. Also the mumbling.
Table of Contents
2:12 Sprinting
26:14 Jetpacking
55:02 Gliding
1:26:02 Networking
This project: https://github.com/HarryPearce/JetpackTutorial
Advanced Movement Component: https://github.com/...
lol, i get it. I decided that already after a day of getting results that all began with "right click in your blueprint and we're going to use this node called event tick". the thing is I was just watching this and haven't found yet anything they did that I haven't already tried, even down to playing with the replication settings in the movement component... but I'll go through again. thanks again
If I try to do the rpc from client player controller to the server that send the variable of the component in the pc the rpc still won't work
That's not 100% true. If you have a character that is spawned by the server, a copy of that character exists on all clients. So your character would exist on my client as well. Doing a "Get Player Controller 0" indicates you're trying to get the local player controller, but on an actor that may not necessarily be controlled by you. So you could be inadvertently setting values for the local player controller that are not correct.
You're also doing things a bit redundant here.
- You do not need to set "My Pawn" in the player controller. There is already a function called "GetControlledPawn" that you can get from the player controller that will give you a reference to your controlled pawn.
- You don't need to set a reference to "Player Controller" in a character or pawn. There is a function called "GetController" that will return the controller of the pawn.
- You shouldn't need to have a client tell the server about your WidgetComponent as the server should already know about it (again, either being already attached to your PC by default, or having it spawned on server)
- You shouldn't need references all over the place for different components / widgets. If you have a known hierarchy of where things are, you can get the reference to those things when needed. Eg. If you've created your hotbar widget in your playercontroller, your character doesn't need to know about it. The character can just get your player controller to get the widget. Better yet, you just have your widgets themselves bind to event dispatchers so that your character doesn't even have to care at all about widgets, just about sending out event dispatchers when variables change.
Thanks for the clearing but the component isn't a widget component a widget variable may get data from the component to show on hud
But the component itself isn't a widget that why I don't know why the rpc won't excute
All I'm trying to do is to get the data in the component to the server but the rpc never excute
The component data is stored on client pc and character
Regardless, the component, whatever it is, the server should already know about it. The server shouldn't need to be told about it.
If the component is a replicated component, and it was attached to the PC by default, then the server would've spawned it, and it should already know about what data it should contain, save for some player defined values like a name.
But while debugging when I try to active ability that is stored on the component there on the server the the component and the data of the ability is null ( like the server deosnt have the data in the component)
If you added the component on the client, then the server won't know about it, even if you flagged it as replicated.
And you can't replicate a reference to it to the server either. The server must spawn it.
Why doesnt onpostLogin work for clients when the game is packaged? is there something im doing wrong?
Hmmm but the component is and should be in the character how do I spawn it from the server?
Does the component exist on the character? It's something you clicked "Add Component" in the top left and added to your character?
In these details
Yep
Ok, so then it shoudl already exist on the server and the client. You might be having trouble as you're using a variable instead of a reference to the component.
Component vs. Variable of that Component (that is also marked as replicated)
This component if marked as replicated will share any other variables that you mark as replicated from server -> client.
Would rpc from client to server to change other variables in the component will work?
Yes, but ideally the server is the one telling the client what the values should be within the component and not the client necessarily setting them.
Like, a player can say "Slot this ability" but the server then replicates that data back down through the component without the client setting the value themselves necessarily.
Request RPC > Server validates and changes value in repliated variable > Replicated Variable (possibly with onRep) reaches client > OnRep can do its thing.
Well that the rpc I'm trying to do but doesn't excute
So if you put a print string on the RPC, you're seeing nothing?
Yeah and debugging with breakpoint will just skip to the next node
I mean, you put a print string here or breakpoint?
Put print string before the set hot bar component
The breakpoint will be before the rpc so I can debug the code when I reach the event and try to step into it it will just move to the next node
Put it in the rpc. If it reaches it, then you know the RPC worked.
Moving this to this channel bc its a multiplayer issue -> Hi guys, I am trying to set up footsteps in multiplayer through the animation bp, however I am running into an issue when getting the location of the sound. It always references the owning client instead of the one moving, so the sound always gets played at the clients location instead of the location of the moving player.
Didn't reach the breakpoint in the rpc
Create a new custom event, with no input in your controller. Call it from the same place as you're currently calling the RPC. See if that one works.
The event is called
Ok, so then the RPC may be failing as the variable you're inputting isn't valid. Again, it's something you don't need to do anyway. The server should already know which component it should be manipulating based on which player controller is making the call as you can do (from controller): GetPawn>GetComponentByClass(Hotbar Component)>DoTheThing
Sorry, I realized the custom event thing... I meant make it a "Run On Server" event.
See if it fires XD
I have a doubt , what happens to client when its player controller gets destroyed on the server?
The rpc is trigger
Ok, so the RPCs from that player controller are working fine. It's something to do with that particular call you're trying to do. You do not need to tell the server what component you want to manipulate. The server should be able to deduce which component without the client telling it specifically.
But when I try to get value of variable in the component that was changed and print string it will be null
What is the type of variable "ability"? Is that object a replicatable object as well?
Yes it's an spell ability class that class also is replicated
And I also have map of keys and abilites that also null
Is it just a class reference (a purple variable) or an object of the class (blue)?
Maps do not replicate.
Class
I change the values when I call event on the component from the pc
I'm using OnPostLogin with my Gamemode, to create a character & possess them. However when I package the game the only thing that gets possessed is the Server.
It did work, but I changed something and cannot recall what. My code seems perfectly fine
This fires once, only on the server
Ok, so if it's a purple variable, that should replicate without issue, but again, can't use maps to replicate data, it won't work.
Example:
RPC call in player controller (I'm calling to from the player controller just for ease of use)
Component is on character, set to replicate.
MyClass variable is set a replicated variable with OnRep.
Last image is example of output when Page Up is pressed.
Ok thank it getting pretty late here could I contact u if tommoraw If the problem continue?
Best to post any more questions here, anyone should be able to help.
Hi! i have a hexagonal tile map on my game and i did some changes so it behaves similar to the world-partition of unreal.
It spawns the tiles to a certain distance when you get close and destroy them when you get away from them.
Currently when you step on a tile, it checks if all the tiles at X distance are spawned with a LineTrace.
Does anyone recommend a better way to do it? this way is like 20 linetrace everytime you move (which is absolutelly acceptable on my game, but may there's a better way to do it).
Yeah that should be abstract. You should have some map of tile coordinates to tile actors or whatever
Whenever you step on a new tile (or rather, when your position rounded to the tile grid changes)
Generate array of coordinates that should contain a tile.
Find all of those coordinates in your Map of spawned tiles.
For all coordinates that don't exist in that Map, spawn a tile and add it to the map.
Optionally do cleanup behind you (all tiles in Map but not in range)
You can optionally do that with an array or whatever. You'd want a TileActor to store its TileCoordinate
I'd use a map tho. That's the way to go for sparse but unbounded representations like infinite grids.
Not sure why this is in #multiplayer tho
yeah, did pretty much that, when you endoverlap some tile, you check if someone check range is on it and delete it.
I think i can eliminate the LineTrace to check if the tile is already spawned and go straight into the array, maybe that will be faster.
i'm more used to this channel i guess
Would it be a good idea to make a UI component, maybe on the Player Controller to handle the related calls? I realize I'm making a bunch of jumps through my controller to get the pawn, anyway
UI component? If you mean the widget component and it's pawn related then nah, keep it on pawn
I mean more like replacing a Hud object with a component to contain it all above the pawn, likely while introducing the ability to sort through different UI mode/states easier
you're overcomplicating your life
nothing preventing you to replace a HUD with another at runtime
you're just adding a couple of extra steps to it
I've always heard that Epic is kinda abandoning support for the Hud object, so I've generally avoided it
It excels at managing widgets for example
That's probably something you haven't been told @elder sage
and not letting you get them crosswired between clients
something you would need to build into a component on the Pawn yourself
as i said, extra steps, extra complexity = more bugs = more maintanance
Which can come at an extra risk. Making the component server sided for example
What would this mean? I just would run everything on local control if I were to do it that way
I'll look into a Hud some more
HUD is just an actor having a 1:1 relationship with local PC and couple of convenience functions to access Pawn, PC and PS
its as simple as it can be while still getting the job done
which also means its optimal for the work it does
Part of my thing is I want to control the state with enums rather than changing Hud classes or using its built-in visibility function (which I don't remember getting to work anyway)
Although I could probably just override it or make my own function
controlling anything but a simple state machine with enums can come around to bite you
they are not exactly... flexible
and extending them is a nightmare, courtesy of how blueprint serialize data
That's something to consider, I guess
if you want some kind of a stateful UI, i strongly suggest using GameplayTags instead of enums
they are easily extendable, and also hierarchical
Like GAS tags or the engine ones?
I'm already using it, actually, but I didn't consider tags for that kind of thing
you do need to take into account that UI changes easily 10 times during normal development of a game
you really don't want to do anything too specialized early on and lock yourself into an approach
Currently I just kinda need UI to make sure things are working, and I'd rather not have to redo it later
Therefore I'm trying to plan it out before I really have to make it look good
current project im working on has been released a year ago, and now i have half my team overhauling the UI
adding gamepad support
so we have to
I just kinda don't get the art side of UI, and I unfortunately find myself almost just copying other games without realizing
HUD can run hierarchical stateful UI just fine
and UI always ends up being hierarchical to some degree
CommonUI intensifies
CommonUI required some fixes to work there
For symbols, right? At least you're not Bungie, having to create two-tone console icons using pixel-shifted icons that overlap
Was fixing carousels one of them?
but the thing is, hierarchical approach reduces the number of transitions you need to handle
navigation is also... interesting
Literally they were broken when I tested them in the ContentExamples project and haven't fiddled with them since then
Iirc that's also why Destiny uses a circle cursor and a heavy counter-scroll effect for menus
i don't know, there were like 5 different fixes in CommonUIActionRouter alone
I've watched a bunch of stuff on UI design and I can remember the decisions that were made under specific circumstances, but I just don't think I'd be able to notice or solve the UI problems I create
The last livestream they had was an introductory on CommonUI. I have faith in Epic they will make it better soon™️
I'll bookmark CommonUI because it seems cool, but I really can't get into the weeds on a new plugin until I have replays working
Which, by the way, more games really need to handle replays. That's such a cool thing that nobody does any more
Yeah right. Though last game I remember did that ended up dying. RIP Paragon 🪦 : #multiplayer message
How would you check if an AActor is your own local pawn?
I have an un-replicated volume with NetLoadOnClient = true and I need a condition that checks if it's the local player itself running through it.
get owner == self maybe?
GetWorld()->GetFirstPlayerController() == OtherActor->GetInstigatorController()
This seemed to work 👍
I did take a look through that, it's actually what prompted me to get so sidetracked these last couple days. I'd love to see the replay system used in a speed or challenge running application, or possibly for live-streamed spectator events like Overwatch supports. Another idea would be to introduce something like Nvidia's replay feature that can be used to view a moment from any angle or perspective
Cast to pawn and check is locally controlled
I have a system in place for a player to use in game currency earned to purchase weapons for their loadout in a raid. That same currency can be used to buy cosmetic items as well. I’m struggling with how to handle making sure everything is hack free. All my code is server authoritative so that’s no issue. My problem is that the client will be in stand-alone mode until connecting to a match. But in the lobby they will have the option to shop and unlock items(skins, etc).How do games handle this. Will I have to rent a lobby server that will handle this? I need a good reference for how you should set up a good secure shop where players actually have to earn this currency from playing and not just hack the game and say they have 1 gillion of it lol. I’m also trying to keep costs low but maintain security as well as possible.
If you have to ask, you're gonna get hacked.
But you need to keep it serverside somewhere and do all transactions on server. Never trust anything from the client
Thanks 😒 I know this stuff has to be ran server side. My question is how is it set up. Are the players automatically connected to a server or is there a way to keep the lobby client sided but all the shop requests run through a server. Stop acting like this is just easy to access info else I’d be doing it instead of asking my man. Would probably have a whole tutorial series on it if it were that easy.
It's not easy. You'll need your own bespoke backend unless there's some turnkey solutions for it. I couldn't find any for sale in my minute of googling.
Me neither. I’m in a chat with xsolla right now asking the same questions. I figure I could use EOS database to keep information like currency earned and then query that via there api. No response yet
I'm using Steams Online Subsystem and I'm having an issue with GetPlayerName() from the APlayerState. Everything works as expected in terms of getting the names from Steam except for an edge case and a particularly personal one as it's MY username causing the issue.
GetPlayerName() is cutting off my Steam username from "Never Not Always Dank" to "Never Not Always Dan" (21 and 20 characters respectively). This isn't a UI issue as it's returned cut off even when logged. The name isn't cut off in every game I play, so clearly it's possible to receive the whole string. Any help would be greatly appreciated. Thanks
you can start from where player name is set to player state.
set breakpoint and see where it is set
debugger is your friend
thanks i'll try that
hi does anyone know why my RPC won't trigger when stepping on the node and will only execute itself in a delay after the rest of the code will run? ( the first image is the player controller calling the RPC that won't execute when called the second image is the RPC in the player controller that will trigger only after the rest of the code in the character will finish)
it takes time for the server to receive the RPC because its being called from the client, and the client has ping. If you want the nodes to go in the order you show in the first picture, then put all the nodes after the server RPC call into another event. This other event should be replicated to OwningClient and will get called after your server RPC
it worked thanks
This video is really interesting, if anyone hasn't seen it already
https://youtu.be/Iryq1WA3bzw
In this 2015 GDC talk, Bungie's Justin Truman discusses the spatial structure of Destiny's game world and each of the various networked experiences a player may be simultaneously connected to over an online network.
GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, prod...
after a seamless travel i got that problem
Hey, usually linetraces (for a weapon for example), are made by the owning client or server, or both?
Client
Sometimes both if you're good enough to implement server side rollback and checking
so server always trust client start/end vector?
Trust? Maybe not, but for non-cheating clients you always want to honor it
It's the ground truth for the honest player
So if they're not cheating, yes, you need to use that
Hey does anyone know how I can set up some basic multiplayer for just my friends and I? I have this so far which works for hosting and joining on my own pc / on LAN. Someone on the unreal engine subreddit told me to port forward my public IP to my local IP on port 7777 and hard code my public IP and port into the client travel command, I think I understand but does anyone know where I can get a more indepth explanation on what to do?
hi, do i still need to compile my own UE5 to cross compile for linux?
You never needed that
Assuming compiling for Linux on a Windows machine
It's been a launcher build feature for at least 7 years
how do I make it so that a level loads for every client in blueprint?
sorry i meant for a dedicated linux server
Hello I am new to multiplayer, I need your help how can I profile network
Like unreal insights
The open level node I guess: https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Game/OpenLevel/
Open Level
Dedicated servers need a source build yes.
I already tried that, doesn't work
What about it doesn't work?
OpenLevel is local. If you want all players to open a new level together, you need to ServerTravel called on server.
i did it like this but this also doesn't work
You would use Unreal Insights yes. This page explains how to set it up if that's what you are asking for: https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/PerformanceAndProfiling/UnrealInsights/NetworkingInsights/
Ty
Do you have SeamlessTravel enabled?
idk about that
how do I enable it?
Actually I'm not sure that's a requirement. I have a memory that you can hardload servertravels too.
You can yes.
ok thanks, i'll look at it
So the fun part about this seems to be that C++ doesn't expose "ServerTravel" in the UWorld to BP :/
It should be as simple as calling a console command line with "ServerTravel NewMapName?listen". Has to be called on server machine.
Also cannot be tested in PIE I don't believe.
I've packaged my game and sent it over to a friend to test over direct connect via IP (command open XXX.X.X.X...)
When my friend did it as a client it seems as though the client connected (as found in the logs) but the client crashed with this log:
[2022.07.23-15.48.03:106][101]LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp] [Line: 14216]
[2022.07.23-15.48.03:106][101]LogWindows: Error: Couldn't spawn player:
Now I did some digging and it seems to do with default project settings for the Game Mode and default classes. This doesn't seem to be the issue.
Next I tested it out locally by running the packaged exe twice and host a game and connect to 127.0.0.1 on the other instance. This worked perfectly fine. ANY ideas as of why this would not work over the internet?
Cannot offer a lot of help, but it would seem your client failed to spawn a PlayerController for the client when they tried to load the map.
The client locally ran the UEngine::LoadMap function. A little ways into it is this chunk here that errored. Which implies that SpawnPlayActor failed to create a PlayerController for the ULocalPlayer as a client.
// Spawn play actors for all active local players
if (WorldContext.OwningGameInstance != NULL)
{
for(auto It = WorldContext.OwningGameInstance->GetLocalPlayerIterator(); It; ++It)
{
FString Error2;
if(!(*It)->SpawnPlayActor(URL.ToString(1),Error2,WorldContext.World()))
{
UE_LOG(LogEngine, Fatal, TEXT("Couldn't spawn player: %s"), *Error2);
}
}
}
Client side of the SpawnPlayActor function
check(InWorld);
if (!InWorld->IsNetMode(NM_Client))
{
//Not client relevent
}
else
{
// Statically bind to the specified player controller
UClass* PCClass = PendingLevelPlayerControllerClass;
// The PlayerController gets replicated from the client though the engine assumes that every Player always has
// a valid PlayerController so we spawn a dummy one that is going to be replaced later.
//
// Look at APlayerController::OnActorChannelOpen + UNetConnection::HandleClientPlayer for the code the
// replaces this fake player controller with the real replicated one from the server
//
FActorSpawnParameters SpawnInfo;
SpawnInfo.ObjectFlags |= RF_Transient; // We never want to save player controllers into a map
PlayerController = InWorld->SpawnActor<APlayerController>(PCClass, SpawnInfo);
const int32 PlayerIndex = GEngine->GetGamePlayers(InWorld).Find(this);
PlayerController->NetPlayerIndex = PlayerIndex;
PlayerController->Player = this;
}
return PlayerController != NULL;
Kind of odd that it didn't catch on the check(InWorld), or crash on PlayerController->NetPlayerIndex = PlayerIndex; first
that sucks
@kindred widget thanks for digging out the relevant source code for this! I just find it odd that it works when tested locally and not when done over online networking. Perhaps I'm missing some basic configuration files I guess? I was hoping I could just use the NullOnlineSubSystem to literally just allow players to connect via a direct IP connection. Perhaps it might make sense to go with an OnlineSubsystem? I don't know...
Thing is I managed to get basic stuff like this to work in the past in UE4.27, still think it might just be a config error or just bad blueprint design.
NullSubsystem should be fine for directIP connects.
I can't see why this would fail in any situation on that line, except for the single case where your client's UWorld thought it wasn't a client, but still didn't have a GameMode.
Only glancing through this though.
That or if somehow there was no playercontroller class specified for the client in PendingLevelPlayerControllerClass.
This is the part that's responsible for spawning players (executed from within the GameMode blueprint)
The problem with working with your own ip is that you may not have a public ip provided by your internet provider.
Since there's less ips now, the providers get one public ip into a bunch of switches which themself may be the opening to a lot of other switches.
Look up on internet how to check if your ip is fully public.
This might be the piece that's at fault here but I'd have no clue as how to go about fixing this. Perhaps add a delay for a grace period?
Those are just characters. That is way after the crashing part. Login will never be called for your client because they are never getting a controller to call login for.
meaning that my public ip would not just lead to my computer but to others simultaneously?
Where is your connection logic for the client joining the host?
yeah, that may be the case depending on how your provider setup your connection.
you can ask your provider for a fully public ip (i don't know the correct name for it) but with some internet search you should be able to figurate out if that's the problem you are having.
I ran into this same problem when trying to setup a dedi server from my home pc
I did it like this, i packed the game but it doesn't work, i get the "Executing command" log btw
You can just use Steam subsystem and advanced sessions plugin
ive heard about that but im not really sure how to set it up, I guess I should just bite the bullet and read all the documentation, thx
wouldn't I have to submit my game to Steam for that? AFAIK you'd need a unique steam game id for all that to work no?
It’s not hard to figure out
it's 20 mins max, it's really easy.
oh ok thanks for the advice
You might be talking about dynamic vs. static IP addresses?
In this video I show you how you can implement the Steam Advanced Sessions plugin, so that you can make MBLS work with the Steam Online Subsystem.
Steam Advanced Sessions Plugin link:
https://forums.unrealengine.com/t/advanced-sessions-plugin/30020
Unreal Engine Steam Online Subsystem documentation link:
https://docs.unrealengine.com/4.27/en-U...
thanks I thought it was extremely complex, ill definitely check that out
You use a tool that is called spacewar on Steam it’s dev tool but it works like a game in this case
@kindred widget here's a bit more of the error logs from my friends PC (client side)
LogNet: UNetConnection::PendingConnectionLost. [UNetConnection] RemoteAddr: [OBFUSCATED]:7777, Name: None, Driver: PendingNetDriver None, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID bPendingDestroy=0
LogUObjectHash: Compacting FUObjectHashTables data took 0.66ms
LogStreaming: Display: FlushAsyncLoading: 1 QueuedPackages, 0 AsyncPackages
LogWorldPartition: Initial Data Layer Effective States Activated() Loaded()
LogAudio: Display: Audio Device (ID: 1) registered with world 'OfficeNight'.
LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.
LogNetCore: DDoS detection status: detection enabled: 0 analytics enabled: 0
LogInit: WinSock: Socket queue. Rx: 131072 (config 131072) Tx: 131072 (config 131072)
LogNet: Created socket for bind address: 0.0.0.0 on port 7777
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: GameNetDriver IpNetDriver_2147482469 IpNetDriver listening on port 7777
LogWorld: Bringing World /Game/Maps/OfficeNight.OfficeNight up for play (max tick rate 0) at 2022.07.23-17.49.05
LogWorld: Bringing up level for play took: 0.001557
LogSpawn: Warning: Login failed: No game mode set.
LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe
LogWindows: Error: === Critical error: ===
LogWindows: Error:
LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp] [Line: 14216]
LogWindows: Error: Couldn't spawn player:
Not really. it's more like your switch in your home.
You can have your main internet cable connected to a switch and fork the connetion to multiple computers in your home.
The internet providers, because there's lesser ips availables now, started doing that, but for their customers.
So the public ip that you see on the internet may be the door to a switch that gives internet to another bunch of ips (customers) and eventually ends on your home
Reminder that this may not be your problem, but it's highly likelly because most of the providers do it now
I did hear about that years ago. It's a steam game id we get to use for debugging that Epic Games gave us right?
I thought this would clash with all other games that use the same id so my friend couldn't connect to MY game instance. Is that not correct? If not I'll probably get going with that approach as it's a bit more player friendly anyway
But i have to tell you that Steam subsystem is bugging in 4.27. I dont know what version u use, in 4.26 works fine
I'm working with 5.0.1
guess I'll have to try my luck
"No game mode set" Check on your settings if the map has the default game mode set
double checked already. It is. Both in the project and the map.
It’s 480 i guess (game id)
Is it a bp gamemode?
listen.
yup
There's a chance it isn't being packaged. (are oyu running a packaged game?)
are you using steam advanced?
no need to pack, use standalone game in editor or launch game from project files
yeah, I figured this might actually be the case. Good point! I deselected cook everything in content folder but checking it now and re-packaging.
Not saying you need to package, but a missing game mode bp might be a non-packaged bp...
not using steam at all in this project as of now.
since I'd want to give the game out to friends in a packaged state it makes sense to test things when packaged anyway too. so good point.
But I mean, is your current game mode problem in a packaged game?
Do you have a main menu map? Are you joining into a secondary map? I feel like that might be an issue here if you're expecting an instant single map join.
at least not when you host a session. No errors there.
yes that's how it's set up right now.
just in case you just want to try the game with your friend, you can emulate a local network with apps like "Radmin VPN" on a click now, extrelly easily.
does this allow me to reliably test functionality like joining over IP?
@kindred widget this is how the player moves from the main menu map to the session hosted by the other player
^
it would be the same as playing local on your network
Hmm. I found an example online, but they're calling Open with level name before open with ip address. I don't know why they're doing that or if it would have any weight.
Not sure if that's a requirement or just weird coding. Leaning towards the latter, as that just looks weird.
This will need port forwarding
the host's router won't know what local IP address to send the Unreal ports to as the connection originated from the WAN side
Now i'll explain my problem. So I have a function that tells interact action what to do based on what message is displaying on screen (https://blueprintue.com/blueprint/8q6o9eyh/ Visibility - https://blueprintue.com/blueprint/qfhtkm4x/ InteractAction - https://blueprintue.com/blueprint/tgmncw2-/). When host is looking at something to pickup and client for example at something to open then client stops looking at it message in host disappears and host can't pick sth up. When they are looking at same object for example pickup it works fine. Pickup message - https://blueprintue.com/blueprint/m4k-retd/ Is there a way to fix it?
Client pawn is child of Host pawn
what
Do you mean that the client pawn class is a subclass of the host pawn class?
yup
why
client has different mesh
Nah that'd be fine
it's more like your "host pawn" is your base pawn adn the "client pawn" is a data only subclass of it but thats fine
it'll work the exact same if everyone has host pawns
yes that how it works
but anyway, does a single item have multiple interaction options or does Interact just do different things to different objects?
like pick up pickups, open doors, revive players, press buttons
like this
one object one option
K you need an interface my dude
Interact should be an interface call (or a component event), not a chain of branches asking if it's openable, pickupable, kissable, chokable, etc etc
oh
So to start with, do you want to use a component or an interface?
I like component better
comp
ok so make a subclass of SceneComponent and give it the name you want (InteractionComponent) or whatever
give it some variables, like
bool CanInteract
Text ToolTipText
Actor* InteractingActor
and anything else you need
done
One sec, gotta check if we did just normal events or dispatchers, sec
Ye I'd do something like this
And then in any actor you want, you just add the component and implement the OnInteract events like so
okay but it still wont solve my main problem i guess
You need to do all this on the server. I'd go like this
Pawn
Input -> Choose what to try interact with -> Check if you can (check CanInteract or whatever) -> Call ServerBeginInteract on self, passing over the InteractionComponent you want to interact with
Pawn Serverside
ServerBeginInteract -> call Begin Interact on passed over InteractionComponent -> proceed as normal
if you want stuff to popup when you get close to things, just have your "Choose interact target" fire on tick, constantly looking for what you'd interact with if you pressed the button, if any. This is where you'd display the popup
now i get what you mean
You can add events for Highlighting/Hovering etc on the interaction component so it can make it's parent actor glow or pop up a widget or whatever
You could do something like this on highlight. It might make better sense to have the interactioncomponent be a widgetcomponent maybe but not sure. That might get too inheretance driven.
yep, I've got that enabled already on my end. Not an issue as for now.
hi, i lost my c++ dedicated server code can i do something if i have compiled .exe and i have all decryption keys etc.?
i just need to retrieve/restore code
i can pay for any help
I'm pretty sure you never had the dedicated server code if you think decryption keys will do anything?
@latent heart I had its just that im a total noob at ue4
What I see is, you want to reverse engineer a dedicated server so you can hack/fuck with it.
no
This is not that place for that.
i just need to change windows to linux support
And nobody is going to decompile an exe for you.
Run it on a virtual machine if you wanna do that.
If you want to run something "at production scale" then you definitely can't be decompiling an exe and running your own servers
Do you need to register a VOIPTalker for a playercontroller if you want global voice chat or is that only to attach it to a pawn?
I'm trying to use beacons for the first time
it looks like everything works, but when I call a server method, I am getting this warning message:
LogNet: Warning: Client is absorbing remote function ServerAcceptInvite on actor RaevinPartyBeaconClient_0 because RemoteRole is ROLE_None
I also am not seeing the onclientconnected messages in the logs that I wrote
bool ARaevinPartyBeaconClient::ConnectToServer(const FString& Address)
{
FURL Destination = FURL(nullptr, *Address, TRAVEL_Absolute);
Destination.Port = 7787;
return InitClient(Destination);
}
but InitClient is returning true
Am I missing something?
Stepping into the code, I see it reaches the bSuccess = true (which is expected). I'm not sure if it is a problem that it skips over the if(!bSentHandshake) each time
I see that bSentHandshake is set above, I just don't know what else to check
It looks like the beacon is getting connected, but none of the events on the host or client object are showing logs and that warning about RemoteRole == ERole_None is indicating otherwise.
Has anybody got a bit of experience with UServerTravel? (exposed as console command via ServerTravel <mapname>?<options>, e.g. ServerTravel coolMap?listen
Even when testing locally it takes around 6 seconds to travel to the new level. Is there a way to make it faster or is this an inherently slow operation?
The map being loaded is very minimalistic and has almost no assets in it.
Are you testing in Standalone? It always loads pretty fast for me.
But 6 seconds isn't that long. Having a loading screen is recommended anyways.
Hm, not sure if it should be that long. You should drop the ?listen part though, that's not needed for ServerTraveling as you should already have used that to host before ServerTraveling.
You might also want to utilize SeamlessTravel
(can't be used in PIE atm iirc)
Yep, definitely use SeamlessTravel.
afaik there was an experimental toggle to support it in editor
Quick question: Can UObjects not be replicated in Blueprints? I have a UObject set to replicate inside an actor that is also set to replicate. All variables replicate except the UObject, or the variables inside the UObject that are also set to replicate
if it's working like late joining.. its defo a must, I'll take a look!
Btw any of you is aware if there is any guide about seamless travel including copy properties and such?
I'm thinking about writing something in my blog about it, but if there is a great article about that already covers this i might not do it
- CopyProperties in PlayerState
- PostLogin doesn't call here, so either HandleStartingNewPlayer or whatever the name for StartingSeamlessTravel Player was
- OnSwapPlayerControllers in the GameMode
- PlayerController and GameMode (or GameState?) have a GatherSeamlessTravelActorList or so function to persist other actors.
Ah
I should have read that line
Before posting stuff
haha
I don't know about any
hehahehahhd XD
it should be in the compendium but i have no time
d'aw :c
its funny you say that there isn't much to it, but I think its something complicated for starters
and some functions have missleading behaviours
this is something that when you make it once you get a grip, but facing this as a beginner or a first timer solving the problem can be quite overwhelming
Yeah I guess you are right
Ok, so I am now using the command line to launch a dedicated server / game clients
I can see the dedicated server is accepting the beacon client
but when the client calls a server method on the beacon client, I still get that "beacon client absorbed the server call because RemoteRole is set to ERole_None"
in the dedicated servers logs I see:
[2022.07.23-22.31.49:071][878]LogBeacon: OnlineBeaconHost_0[EOSIpNetConnection_1]: Beacon Join RaevinPartyBeaconClient RedpointEOS:09848ufdufhhsw (unauthenticated)
[2022.07.23-22.31.49:129][879]LogBeacon: OnlineBeaconHost_0[EOSIpNetConnection_1]: Handshake complete.
[2022.07.23-22.31.49:129][879]LogTemp: Warning: ARaevinPartyBeaconHostObject::OnClientConnected()
[2022.07.23-22.31.49:131][879]LogTemp: Warning: Connected client valid
and on the client:
[2022.07.23-22.31.40:684][466]LogTemp: Warning: URaevinPartySubsystem::SetupBeaconClient()
[2022.07.23-22.31.46:026][466]LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
[2022.07.23-22.31.46:027][466]LogNet: Created socket for bind address: 0.0.0.0 on port 0
[2022.07.23-22.31.46:029][466]PacketHandlerLog: Loaded PacketHandler component: AESGCMHandlerComponent ()
[2022.07.23-22.31.46:029][466]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2022.07.23-22.31.46:029][466]LogNet: Game client on port 7787, rate 200000
[2022.07.23-22.31.46:032][466]LogTemp: Warning: Successfully connected to the beacon host!
[2022.07.23-22.31.46:033][466]LogNet: Warning: Client is absorbing remote function ServerAcceptInvite on actor RaevinPartyBeaconClient_0 because RemoteRole is ROLE_None
Can anyone please give me some ideas on what to check? I don't know why RemoteRole is ROLE_None when I clearly established a handshake between the host and client beacons
Not a lot of people have beacon experience, so that could take a while to get answered
Does the minimal setup example of beacons work for you?
I could try to use the test beacons that come with the unreal engine I suppose
and see if those work
I don't know how involved your setup is but I would maybe try a clean project with a very simple setup first
Seeing if you can repo it there
I haven't used beacons in a while
maybe we should host a community-curated compendium wiki or something that other can contribute to so not just you have to keep it up haha
I wanted to turn it into an interactive website with dynamic pdf printing and dark/light mode
But man... The time that takes
hm... I just had an idea. I'm creating the beacons inside of a subsystem
super basic question: does UE support cross-platform multiplayer? Just things such as joining and creating sessions.
Background: I don't have a second Windows PC but an Android phone. Does it matter to UE if the client platform differs to the server platform?
I mean the UE community stuff totally allows for seamless travel tutorials
I bet you it has to do with not being in a replicated actor
Should probably be the preferred place to post thay
or maybe I need to set the owner when spawning the host and set the owner to be the game state or something
That's sadly the opposite of simple
oh haha, well I literally do that kind of thing for my day job. Maybe I'll spin up a website like that based on your compendium and let you know about it
meaning answer to the question would be: no, not out-of-the-box.
?
For now I would still prefer if it remains my IP sort of :P at least the document as a whole
We maybe can take the compendium and make it into short 10-15 minutes explaining core concepts and upload it to youtube
i think that would help a lot of people.
UE can do cross platform
Simplest is with SubsystemNULL
An direct IP connection
Actual online multiplayer requires a cross platform Subsystem like EOS or custom
I'm making one ^^
An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.
Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe
00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...
17mins and counting... @pallid mesa
^ that youtube channel is so golden
I prefer writen text always
dale
🧑🦲
bruh 17 minutes read, cuut cuuuuut
XD
Haha gotta make sure the info is all there ^^
remember to include the gotchas
Literally everything
you know the OverrideWith missleading nonsense @fathom aspen
"Your game exploding, crashing and other things can in no way be claimed to be my fault"
Hahahaha it's already there
++++ 👏
Cedric and James were literally ranting at it xD
ofc.
That's the P.S
Also when is someone making the City Sample multiplayer? 😛
That's @pallid mesa ofc
eh? yes
Can we fund this man? It's like waiting for a new episode of Hardcore History
Weird... so I can send RPCs from the host beacon object to the client
but not the other way around...
you might need to change your username if you continue promoting vidS xD
It's not a tutorial tho
You can only send client to server rpcs from "client owned" actors.
weird "bug" I'm running into at the moment.
When running in PIE and "standalone" netmode the client can find the session and join the server. If run in standalone mode and standalone netmode the client does find the session but doesn't join.
Anything obvious I'm missing?
(local testing on one single machine only at the moment)
@latent heartThat can't be right, because for one, the opposite is what is working
and for two, the sample beacon classes go back and forth
with ping / pong
Or I guess I should clarify with "assuming that the beacon client is "client owned"
That's for a regular rpc. It's entirely possible the beacons do something else.
I don't know much about them!
Well I appreciate the attempt anyways 🙂
Sorry if I came across as a jerk, I wrote my response in a hurrt
*hurry
I'm trying to create networked custom character movement... What's the "correct" way to get the player input vector from inside a physcustom function? GetLastInputVector worked when running standalone, but not when running as client because it seems like the source of the vector isn't replicated.
hopefully that question makes sense 🤔
nvm, Just had to use the built-in Acceleration var
Is there any way to implement this for a pawn though?
There's no default movement comp for pawns, my bad.
ACharacterBase::ACharacterBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer.SetDefaultSubobjectClass<UCustomCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))
{
//...
}
Guys I want a tip from u If I wanna make a game with login system and so on and i wanna use eos login and my own login too what is best way to store login data and registration data ? of players registered via my login ? thank u for the tips ( because I did use VaREST and SQL database but its not good solution 😦 )
Kind of a general question I guess. My team and I have something we feel will be pretty popular when it comes out. We want to plan early for network scaling, After a long battle we have Headless server running on TCP and all is good. But we were wondering, is this truly the best route to go? would Epic services or AWS be better? What do you all think?
Ok I have a question. Running headless server and client gets
Error: appError called: Fatal error: [File:C:\Program Files\Epic Games\UE_5.0\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollectionVerification.cpp] [Line: 137]
Encountered 1 object(s) breaking Disregard for GC assumptions. Please check log for details.
when trying to connect, any info would be appreciated.
So if I want to do a material swap, I can just rpc for that, right? I can't remember if I have to worry about the mesh component replicating what material is applied
Did you tried to check the logs for details? You need to figure out which object is causing that.
Yeah, but not finding mych info which logs should I be looking into?
and thanks for the reply!
server seems solid and see the join request.
even seems to join then drop.
hum me thinky this be it?
LogGarbage: Warning: Disregard for GC object CR_Mannequin_BasicFootIK_C /Game/Characters/Mannequins/Rigs/CR_Mannequin_BasicFootIK.Default__CR_Mannequin_BasicFootIK_C referencing RigVM /Game/Characters/Mannequins/Rigs/CR_Mannequin_BasicFootIK.Default__CR_Mannequin_BasicFootIK_C:RigVM_2147482483 which is not part of root set
[2022.07.24-15.48.17:020][419]LogOutputDevice: Warning:
Im Looking to create a lobby menu for when players are joining, i havethe user set their name and when they join the server their names are being reset. I know that its due to the class im storing it in being reconstructed but is there another way to maintain values when traveling to a new server?
If the travel is seamless look into APlayerState::CopyProperties
If not you probably want to use the GameInstance
Mesh doesn't have to be replicated or the even the material. Apply the material inside an OnRep
I have a few blueprints on my playercontroller in a play as client net mode that gets event begin play -> get controlled pawn -> cast to character -> sets a variable for referencing the character later
Client this works
Server the result of get controlled pawn is unknown
I feel like I'm doing something stupid or missing some understanding
Thoughts?
There are already getters in place for that by default. You can get controlled pawn and cast it. But it's exceptionally rare that a controller would need access to it's controlled pawn directly.
Hm I am referencing the controlled character to create inventory and many other components should that just be part of the character
Dunno. I don't really do much of anything related to a game's state in a controller. Controller is meant strictly for Input processing to gameplay objects, and for networking that doesn't make sense on specific actors. Sounds like something I'd just do in the pawn directly. But yeah. Possession overrides run on Server at least and should have a valid pawn there. You should be able to just cast it to your pawn type.
Dear Unreal Slackers members, i've got a special question, me and my friends are very nostalgic about old versions of Fornite so we decided to mod the game to create dedicated servers, however when it comes to launching the client we get a DirectX11 error and this would be annoying to rent a VPS with a graphic card whereas i'm sure there is a way to disable the visual (all the rendering stuff), moreover we can launch a server without any UI interaction but , if someone has an idea we'd be very grateful
Btw: tell me if it violate the rule 5 of the discord, but keep in mind we're talking about making dedicated server not cheats
What's the console command to visualize corrections etc?
Specifically for physics. I've used it before but can't find it now.
Can anyone give me a little guidance, i have setup a hit animations via montages depending on bone hit. Right now, the custom event for it is a multi cast, then i also have made a server RPC
RIght now, it works for client and server, however only the server can trigger the animations
but the animations both play for client and server
however the client cant initiate the PlayHitspecific animation Multicast rpc
I am so stumped i cant figure out why
I can see in debug, it selects the SVR play hit specific animations on the switch on authority
but then it doesnt call MC_play hit specifc animations
On the server, I'm setting the location of a pawn that the client can possess. The location is not replicated to the owning client. It is however replicated to the other, non-owner client.
How come?
The pawn has a movement component of type: class ENGINE_API UFloatingPawnMovement : public UPawnMovementComponent
Only the server can initialize a multicast.
You need to first do a Server RPC from the client, then do the Multicast from the server
Or just do the multicast from the server if you're able
Check the chart I posted, it tells you everything you need to know about RPCs
So for multicast, if you run it on the client it only runs on that client, but if you run the multicast on the server it runs on the server and every client
If you need to initiate a multicast from the client, you first want to do a Server RPC from the client. This will run code on the server. So for example, you have a Server RPC called Server_RequestAnimationMulticast, which when called by the client makes the server run your multicast function.
Server RPC gets called on client -> Server RPC implementation is called on the server, in your case it calls the Multicast function -> Multicast function is run on the server and on every client
So yes
Like I said, refer to the chart, it tells you everything you need to know about where the code gets run 🙂
Playfab/GameLift
Use a normal JWT workflow on a web server and send http requests from the client.
Or you could connect directly to the database from a dedicated server for extra speed.
hi to all users, I need an assistant about an issue which I'm facing about find any solution 😦 I'm trying to create a multiplayer game with BP which has few maps but I can't change player's map without moving all player by server owner's commant line. have any suggession or solution about this? I got the idea of making making the change on server side and same time one client side, FX; in same map i can do any thing about trigering anything but travelling on maps i can't... I've tried build a transection map load and unload level streams(when i load and unload a level on client side it effects all clients and server owner)
note: I've looked up all topics on internet which I've found in last 2 months. I really want to figure this out to move on
I'm not sure I get what you want, but you can travel client-side either by calling the OpenLevel function, or calling ExecuteConsoleCommand function and Command parameter be Travel <MapName>
Both will result in the client disconnecting from the server he's connected to though
that is the problem 🙂 if i open any level it disconnects from server but i don't want that because if another player travels the same map they should interact eachother
You can't by any means do a travel from client and expect it to stay connected to the same server
You can tell the other player to follow that player by specifying that server URL
Are we talking about a for example Minecraft like system with multiple worlds?
I wonder what the Minecraft worlds are in Unreal terms?
If you mean random servers setup by others those are 99% of the time dedicated servers yeah. Although it gets a lot more complex when you have multiple dedicated servers under one IP or “hostname” xD
Yeah I can tell ^^
actually think about like a lobby, you join a lobby with few people but it has portal which opens to another ocassions created as levels, you join with few people and everyone walks around but if two or more joins same portal they should interact and they can also return to main map too.
dedicated server or created lobby by user works same at lots of poins
if i have one map, it's easy to travel in same map i can use transection or location set
but if try to open a map it disconnects or if i try to load stream level it changes for all
Unless you have those ‘portals’ in the same world Unreal does not support what you want, if I understand correctly at least. Unreal has simply one world loaded at the same time for everyone connected to that server.
So you either need to have multiple servers with different worlds or have it all in the same world and just teleport people around in there.
this makes sense, so i should create a server for each level and everytime i travel between maps i should change session also.. make sense really helped to figure out
thank you @twilit radish really helped
👍
double checking, on the dedicated server a player controller and pawn should be created not just on the clients right? I have added debug prints to both controller and pawn and server creates the controller but no pawn and the client creates both
They are spawned on server and replicated to clients
thats what I thought hm
ah ok I added it to beginplay on the character and it is being created but my initialize player is not being called on the server. I am starting to find where this breakdown is happening🔍
BeginPlay gets called on both server and client. Use a SwitchHasAuthoirty macro if you want it to be done only on server
Authority pin
yea this vs having that in my function told me the truth 😄
so if I have a series of variables and components being setup on controller/character this should happen on the server not on the client? Then those variables should be replicated ?
example setting these component variables
If they are created at compile time then no they don't have to be replicated. You need to make sure the actor they are attached to is replicated
Also note that replicating those variables doesn't mean the components themselves replicate(in case of runtime components creation)
hmm tracing this back seems like the server is not executing some of these functions
LogNet: Join request: /Game/Medieval_Village/maps/Medieval_Village_Demo?Name=DESKTOP-LLD44P6-B946B8D3407135784F8B0FA6239391B2?SplitscreenCount=1 **LogBlueprintUserMessages: [BP_PlayerController_C_0] Server: Server Controler Started LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)** LogBlueprintUserMessages: [BP_PlayerCharacter1_Test_C_0] Server: Server character Started LogNet: Join succeeded: comp name LogOnlineSession: Warning: OSS: No game present to join for session (GameSession) LogBlueprintUserMessages: [BP_PlayerController_C_0] Client 1: Client Controller Started LogBlueprintUserMessages: [BP_PlayerController_C_0] Client 1: Client controller variables Started LogBlueprintUserMessages: [BP_PlayerController_C_0] Client 1: Client controller essentials Started
hmm I wonder if these functions are not activating due to the logonlinesession warning oss: no game present to join
The warning has nothing to do with that
ah crap I see what is happening
the server doesnt know what the controlled pawn is
You are assuming too much there
If the pawn hasn't been possessed yet then yes that's normal
that makes sense that code is on the beginplay of the controller
Ignore the crazy noodles going up thats the debug prints but essentially setting up variables on the components
then at the end the initialize player is an interface to the character that sets up variables on the character.
Working on slowly moving the flexible combat system asset to multiplayer
InitializePlayer is called on client seemingly from the provided pics
If you think Interfaces are RPCs then you're wrong
no just thought it would execute the same
Interfaces execute locally
Called on client, execute on client
Have you seen this masterpiece: #multiplayer message ?
This is the right time to read it as you're making your system networking supported
Cedric is having some hard time there
Here you get it
Read it a few times
eye opening, while I watched other videos etc this level of detail made a ton more sense
Is there a way to join a lobby with additional data, like a selected color or selected cosmetics or whatever?
I use a save game object that the controller or player state reads then the game mode picks up that info when necessary
you can even do something in your "Spawn Pawn As (?)" override, like passing in a property to generate the character with
might have the name wrong
I mean when a player joins the game, they would be joining after already selecting things not in the lobby
so like imagine in a game like Age of Empires, when you build a deck ahead of time and join a game using that deck.
well yeah that's why you use a save game
perform action -> write to save -> load in -> read from save -> apply to client then replicate
how would I pass the information from client to server?
the easiest way would be to read your save from the Player State, rpc to set it all there, then the game mode can read it at whatever point
you could read some off of the pawn, or create onreps for things like meshes or materials
it's pretty broad in how it can be applied. Just remember that you'll have to rpc for all of this because it needs to be authoritative
how do I call the client to send its data?
remote procedure call to the server in a replicated object
are you familiar with how to rpc data?
I mean like what function should I tack the rpc onto
I need the data as soon as a player joins
beginplay would be fine
I am sort of familiar with rpc but still bad at them
the player state exists after the game mode does iirc so that's not a race condition to worry about
you would go from beginplay to read your save object for the relevant data, then pass that into a custom event to tell the server to set that for all clients
so beginplay on the player state will work? I guess I'll try it
I need to make up a way to save the files
I learned how to do it for the exact thing I was talking about, and it's really easy
it's basically just checking if a save object exists, then creating it if necessary and then reading or writing data accordingly
it follows the same procedural data principle that replication does, where you want to be able to use data as small as a bool or int to represent major differences when it's applied
You can also store data within the Game Instance that can be read any time, but you have to RPC it through Player Controller.
or some other player owned actor of course.
I think the issue here would be that the client would set this info before joining, and you'd change game instances when loading into multiplayer
There's only ever one game instance.
Moving between multiplayer or between levels doesn't change the game instance.
I guess I'm not totally sure what happens with it when you move to multiplayer
doesn't it replicate though?
Doesn't replicate.
maybe I'm thinking of game state
Probably
That does replicate and can change.
You can create a Game Instance blueprint and you set which one you want to use in the project settings. Can't change it anywhere else.
Most data will be retained if you change levels or join multiplayer. The only thing that doesn't stick around is usually references to actors.
should i put all my hud stuff on the controller behind a authority switch for client only or is ue smart enough to figure that out ?
controller is client and server, aka it doesn't matter, and widgets are client only as well
So if you have an enum, int, string, class reference...All those things can be saved in Game Instance before joining a game, be read and sent to the server via RPC when the player controller starts.
Nothing wrong with using a save game either, especially if you want to save your selected thing for the next time.
It depends. If you're using a listen server, then you can't really use an authority switch if you're not entirely sure you're running on the client (eg. using BeginPlay) otherwise the host can't do the same their own controller (as they can have a controller and have authority over it). To avoid this, you can do a check using IsLocallyControlled, and if it isn't, don't do anything.
On a dedicated server, you can directly use Has Authority or IsServer(False) otherwise you're going to end up getting errors as widgets can't be created on the dedicated server's copy of the player controller.
makes sense, if it saves any calculation then im game to put that in. I am noticing plenty of errors on hud stuff haha.
Question: How to I detect when a player has joined a session so I can spawn their character.
OnPostLogin, I believe it's called. The game mode has default functionality for spawning players on a player start actor, so you have to override that if you need to do something differently
You override HandleStartingNewPlayer. That's what spawns the pawn. It also gets called for both seamless and hard. Though joining sessions is hard
I setup everything for single screen/camera local 4 player. Which works great. But when I connect to Epic my Remote 5th player connects in and everything camera works they just don't have a character. Their controller is there. So I assume I already disabled auto spawning when I set the local single screen setup. I spawn the local players on the event begin of the camera to make it easy. So I need to fire a spawn remote player some how as they join.
Where would I put this in Best pratice? Using Blue prints
Read one line underneath
Yeah sorry, thats what I'm trying to use. Where would I put it?
Inside your GameMode class
What if the remote player has 2-4 local players? do I make an array and loop it or does it fire for each?
It fires for each
oh shoot, does that mean my already setup logic wont work
Probably. I have no experience with local multiplayer but it shouldn't be any different in this regard
Literally test it
I have been, it's been spitting out way too many characters thats why I asked
Pretty sure there’s an OnPostLogin function you can override (or something named similarly) in game modes, though not sure if this is the best choice
One of its parameters is a pointer to the new controller that logged in
Though I’m not sure if there’s some kind of convention to use the built in auto spawn
I am using playfab already
but what i want an online session matchmaking that hosted on server
Do blueprints auto flush dormancy? I have a basic actor that is set to dormant but still replicates when I update a rep notify variable
Hi, Im trying to set it up so that when players are in the Pre Lobby their view target is set to a specific camera, so in the begin play of the player controller I get the camera from Get Actor of Class, then set the view target, it works fine for the server player but all clients for some reason set this camera as the view target for a split second and then they get pinged to 0, 0, 0 world position and are able to float around, how can I stop this from happening and make it so they get set to the camera and stay there like the server? although theres no replication involved in this so im not sure why im even getting different results based on server/client
Something about your setup sounds off, definitely some kind of scaling issue. Why use "Get Actor of Class" if you already know which one you need to reference. That's just going to break if you put a different camera in later. You should use the level BP if you know you always want it to happen in that level. Also, your issue with actually setting the view target probably relates to player controllers not being net replicated. You probably need a locally controlled check before performing that action. That's just what I can guess without testing anything myself
I tried putting the set view target into the level BP but the same thing happens, I think it might be an order of execution issue, if I add a delay node that 'fixes' the problem so that indicates to me that the begin play of the player controller that sets view target is getting called and then something else is running causing it to set the world position to 0, 0, 0, spawn a sphere and give you input to float around... weirdly, in the next level after the pre lobby level I have another camera set up in the exact same way by setting the view target on the player controller and it works for server and client every single time lol
That probably would be happening, actually. The level begins play before the controller does, so an arbitrary delay would fix it, among other things. Not a great solution for now, but there are other options. As for the position being reset, is it spawning a spectator pawn? I don't know if this should always be how this specific level starts, but if so you could instead spawn the pawn where you need it and disable input. Another option would be to sequence the whole thing, because with the small amount of sequencer I used, it just kinda worked with players connecting during its duration, as it seems to automatically sync them in to its global playback position
Yeah i think its spawning a spectator pawn after it sets the view target but im not sure why its doing that i haven't set it up to do that, ideally i just want all players on the camera because its actually a pre lobby menu so i dont want them to have possession of any pawn if they don't need it, although I could try the spawning a pawn and disabling input, i haven't used sequencer really before so ill have to look into that one too
A sequencer may not be ideal if it's just a menu. I'd start by putting an empty pawn where you want it, if I were you
That's kind of the standard for menus in 3D-only engines
At the beginning of my game, I spawn many actors at once on the network. Some of them have their owner null at BeginPlay when spawned, but eventually they all get their owner. I suspect that it's due to the load on the network that happens all at once. Can someone please confirm me that my suspicion is possible? Or will unreal wait with calling BeginPlay until the owner is properly replicated?
Begin Play doesn't wait for anything. If the pawn is being spawned by the server, but should be owned by a controller that isn't loaded, you would get that error, but that's unlikely imo. You can't replicate player controllers, meaning you'd get the same error if trying to network something like that. Iirc there's a function to get the owning player state from a pawn, I'd start with that if I were you
Basically any attempt to network the player controller or pawn owner should be done through the player state instead because that replicates to all
Why do you need to “network” the player controller? It already is networked and replicated to the owning client 😄
@elder sage Thanks! The thing is that the owner is not a player controller (for the actors who have the issue) but other actors who spawned them. Currently, I just set timers between spawns at the beginning to ease the bandwidth, but that seems pretty odd. How would you go about easing the bandwidth otherwise?
So I've added in an empty pawn, set it as the default pawn in GM, placed it in the world, but it still sets it to 0, 0, 0 but now it doesn't have any input to float around, is there something else i need to do with this pawn?
@lime echo Normally you would hook into some kind of OnRep method so you can be sure something has replicated. Not sure if you're using C++ or BP? In C++ you can override OnRep_Controller() in APawn to make sure a controller has actually replicated. Not sure how to solve it in BP though.
The game mode actually looks for a player start actor to spawn the default pawn at, and if there isn't one it will be at the world origin instead. You can override that GM function to return a spawn location, or you can put a player start where you need it
Thank you! I thought about it but IMO it just adds another level of complexity to get the owner, whereas easing the bandwidth to let the spawns occur properly, is just cleaner. What do you think?
Oh wait I think I misread your problem. You're spawning just regular actors, not necessarily pawns?
don't you need to rpc to set the owner of an actor? that might be your problem
yes:)
I spawn with SpawnParameters::Owner = this on the server.
If you want to make sure that the owner has been replicated on an actor to a client you should override OnRep_Owner() in AActor.
Okay so ive done that and it seems to be working, but is there now any point in using a camera and setting the view target?
not really, no. The pawn is the view target
I use C++ only. But as I stated above, the owner is replicated, it's just delayed for some actors such that it's null in their BeginPlay. Which I suspect is due to the big load on the network when spawning so many actors. In fact, I actually checked, and delaying spawns works.
Actors do not have a set order in which they replicate. So it may be that you on the server assign an owner to an actor but that owner has not been replicated yet while the actor it self has been replicated at some point in time.
But setting timers between spawns is really unscalable IMO.
usually if you need a timer to get something working there's a better way
So if you want a proper solution without timers you should really just override the OnRep to make sure the owner is actually valid.
The OnRep it self also has no additional network cost whatsoever.
Alright. So that's what I'll do. Thank you for your time!
👍
The only cost it adds is a null check before every use of the owner, since it's not initialized in beginplay... But I guess that's just how multiplayer works... 🙂
Well that's why I'm saying use the OnRep for your code. Then you don't have to rely on BeginPlay to maybe or maybe not have the owner.
Also about this, I would argue that if you need a timer to solve an issue like this you're always doing it wrong. If it takes a millisecond longer than your timer lasts to replicate something your code will likely break. It also adds an extreme amount of unnecessary delay.
timers are great for testing things like arbitrary gameplay delays, but they're definitely overused aside from that
most people will find a race condition and patch it with a .1 delay, assuming that fixes the core issue
Mean while you're only making the problem worse, a lot worse. Now you have a race condition that you may never find your self while trying to test it while in reality clients with high ping will have issues and yell to you about it in your Discord server or whatever 😅
So yeah. Never use timers to just wait until something has been replicated to a client.
most of those problems can just be solved by doing it backwards anyway
like, if the controller is racing the pawn, just make the pawn call the controller because that guarantees the pawn is valid
The problem you sometimes get with that scenario is that one of both isn't ready yet though. Which is a bit annoying.
Actor A depends on Actor B and Actor B depends on Actor A is kind of an annoying situation at times haha
Felt appropriate for this.
This is typical behavior. Use a loading screen.
Hi !
I have a replication problem when a client joins a session, it is impossible for him to see the mesh that has been chosen by the other client already in the session. How can I update my client when he joins the session?
You can set your mesh component to replicate, which should make all after coming clients to update the mesh as well
This is already the case.. My actor as well as my component are replicated
did you set it up in BP or CPP?
CPP with "SetIsReplicated()"
did you virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
and DOREPLIFETIME
on the actor that holds the mesh
I will check that thanks!
np. here is an example of how to implement the GetLifetimeReplicatedProps, in my case i replicate a playercontroller where the owning actor is the playerCharacter void AImagineAbilityCharacter::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const { Super::GetLifetimeReplicatedProps(OutLifetimeProps); DOREPLIFETIME(AImagineAbilityCharacter, PlayerController ); }
you would replace the PlayerController with your mesh
You shouldn't be repliacting your mesh component. I can tell you're using multicasts. Read pinned message: OnReps vs RPCs
Thanks a lot !! it really helped me to better understand the difference between OnRep and RPCs
Darn, should keep my mouth shut untill i have more experience 😄
Thank you for taking the time to try to resolve my issue. 😉
i have been helped so many times by this community so i just want to give something back. 🙂
My client gets kicked from server with error: "ActorChannelFailure"
This only happens when my client is on a shipping build but they're not kicked with other builds like debug.
This also doesn't happen on PC builds of the client. The build on quest 2 is the one that gets kicked
@coral wing Is there anything else in the logs of the client or server? Difficult to guess what may be wrong by this information. Some documentation seems to indicate this:
... indicating it was unable to initialize an Actor channel, most commonly because the desired Actor's archetype couldn't be serialized
But still doesn't really clear up what exactly would be wrong.
I'll remote into the log on the server and see what else I can try to dig up
Unfortunately I don't have access to client logs due to this only happening on shipping builds
Does Unreal not display log messages in a shipping build on Quest?
I know in Unity it's possible. Would be a bit odd if Unreal couldn't do such an important thing 🤔
You can turn it on apparently but need a source build for it, seems rather silly.
https://forums.unrealengine.com/t/how-to-log-in-shipping-build-win/349171/26
Although says for windows but I don't see why this wouldn't do anything on Quest considering it's a general flag.
There is Conclusion but seems complex to annonymous. Cant Use Launcher Engine, you need to get open source built engine from github When you get source engine, fix the unreal engine source file now switch engine version of your game project and regenerate sln add use logging code to your project target cs file now package a...
Apparently this is also an option which seems a bit easier: https://forums.unrealengine.com/t/how-to-add-buselogginginshipping-to-my-project/125651/3
Awesome! thank you so much. I'll have to do a rebuild if I can't find anything in my server logs
👍
qq: in a dedicated server setup these functions inputaxis move right and inputaxis moveforward should have a authority -> server after and then let the movement replicate via the pawn?
the footstep noise should be behind a client only also right?
If you have a person I would highly recommend using the character class instead of a pawn. That aside if you want to do movement based on the input axis you'll need to locally move the pawn and then on the server do the same and replicate it down to others from the server.
Not entirely sure what you're asking for the footstep noise though.
https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/HowTo/CharacterMovement/ is this what you mean by character movement
A How To Guide for Setting Up a Character with Character Movement in Unreal Engine 4.
footstep noise is the noise made when walking should that have a isserver = false in front or will ue just ignore playing sound on the server
Essentially yes.
And the noise is not something that the server really needs to care about. I think you could do it all locally if your pawn moves far enough from a certain threshold. So for example every 20 centimetres it moves you play the sound. (Unless you really want it based on the foot touching the ground, then unsure).
But even then the server doesn't really need to care about it. You can totally calculate when it should play the sound just on a client to prevent having to network the sound.
Footstep noise should be local. Doesn't have anything to do with networking
I would do it with anim notifies
Input events like these are always local and are not replicated so putting a has authority node is unnecessary as it would always execute the "Remote" path save if you are a listen server host. The "Add Movement Input" nodes have some networking code behind them, but are still executed locally before anything goes to the server.
If a client is spectating another player/client from their View Target, how do I smooth/interpolate the control rotation so it doesn't look snappy for the spectator
Lyrabase
Implemented Steam OOS
However on exec of build while clicking host it just loads me back to the lobby room instead of the Play
In the project tho, it looks like this
Thinking if it has something to do with the game not overriding a gamemode & on build packing the lyrabase?
Tried to solve it for the past days without result =/
Quick replication question: Say I have a Car actor that has a variable A that is replicated and a variable B that is not replicated. The Car actor is always relevant and replicates. When I spawn a Car actor on the server and it replicates to clients will the network packet include a default value for the non-replicated variable B? Or is that variable filled in with the default value on the client side?
Is SeamlessTravel supposed to execute ChoosePlayerStart? It's not doing it for me...
The variable B will not be carried over from server to client. It will be filled client-side from the class default object
Hey, I have a question. When I start my game in the editor and open a map, it works. However, when I start the whole thing in the package, it only opens for half a second and goes back to the previous map. => Before opening the map I start a steam session and set the map to "listen".
the server replicates the control rotation, and I set the View Target (CAmera) rotation for spectators to that with a RInterpTo node but it's not smooth at all :/
It should be as long as the function gets called when spawning a pawn
It's not being called for me with Seamless travel. EventInitStartSpot is returning the player controllers instead of the PlayerStarts past the first map.
thanks a lot
What is this warning? And how to counter it?
Stop sending reliable RPC on tick
Its not on the tick, but on when the player joins. I have to look into what monstrosity I wrote there xD
Is that usefull to check is local controller on a client rpc?
Wouldn't a ClientRPC always only run on the owning client?
what are you checking for here
oh sorry, here we are in the PC
That will only be definition run on the local one
the objective here is to display an HUD
you only ever have the local one
unless your'e server in which case you have them all but the run on owning client will still only run on the one you care about
got it
I have such code:
SafeMoveUpdatedComponent(Direction * MovementSpeed * Delta, UpdatedComponent->GetComponentQuat(), true, MoveHitResult);
And my problem is, why, after I added delta time multiplier, character on the server is faster than one on the client?
You sure the delta time is correct on both sides?
yes
How much faster?
You sure MovementSpeed is synced?
yes
So how big is the speed difference?
lemme compile
Even up to 15 times as fast
I'm spawning a client side projectile that deals zero damage and a server projectile that does damage. How can I hide the visual parts of the server projectile for the player who fired it? Right now when the player shoots they're seeing both projectiles. Other clients are seeing the replicated projectile as they should.
COND_SkipOwner for the projectile
Is that also somewhere on blueprints?
ahhh cool found it. I added "self" as owner for the projectile then went into the projectile blueprint and changed the visual components to "Owner No See" true.
Ah that should work too
Though I think the projectile is still replicated in that case
It's the replication condition for the projectile when spawned
yea now its just a matter of hiding all the double visual stuff lol
That sounds fucky, something is definitly wrong. What delta times are you getting?
Are you sure you're looking at the speed and not how much it's moving per frame?
if deltatime is 15x smaller on server, it'll move 15x further on client in the same amount of time (same speed)
About 0.005399 for the client and about 0.032902 for the server
Are you checking the speed or just how far it's moving per update?
like how do you know its moving 15x faster on server
Its delta time. The velocity from this: Direction * MovementSpeed * Delta was 15x bigger
That's not velocity
that's the movement in the step
it'll be different
because deltatime is different. Direction*MovementSpeed will be the same
But it must use delta time, bcs. if I don't use it, it become FPS dependent
Well yeah you gotta use it. Look at how the CMC does movement. I'm not sure if they pass the client delta time over or just simulate at the servers delta and sync them up.
Either way you'd expect a different delta to end up with different update distances but the SAME speed.
If I look at e.g. UpdateBasedMovement, that is a method in CMC, it doesn't use delta time
Sure it does
It has it as parameter, but if you look into the body, there is no use for it
Because this is only to update the move due to the base moving
delta time is used in the actual update
oh, ok
hidden things aren't relevant
So I was told that the Lyra Starter project is not set up for dedicated servers out of the box. Can anyone attest to this and where in the code should one look first to get it to that state. Weird that they didn't build the code base for dedicated servers but its set up for multiplayer with GAS as the foundation for pretty much everything. So it rattles my brain that this could possibly be true.
If that’s the case, you can try doing that.
No thats not what I mean. The developer of the EOS Online Subsystem plugin (paid) said that the code for lyra is not built for dedicated servers. Heres the convo since the discord is private I think
First of, you won't package a client build for a p2p game, you would just package the game. and game has client and server code.
I don't know the code, but despite from isServer checks, that work on either listen or dedicated, I didn't had to setup anything for using a dedicated server.
What the dev is telling you, is that Lyra might not be setup to have the server registered to the EOS, but the game it self should work with a dedicated server out of the box.
That first part I didn't know lol but it makes sense. Now that third part are you talking about the TrustedServer client policy type in the dev portal? Im not fully understanding what you mean by "to have the server registered to the EOS"
My whole issue is now with this EOS plugin (paid) enabled I cant play a PIE session as a client to see if my replication is working properly, she said thats because lyra is not set up to do that.
Well I don't know \o/ I don't use EOS or any other subsystem. At the moment we use our own backend to do smth similar, but with no subsystem yet.
How ever. the dev mentioned that the Server is not creating a proper session e.g. smth that the EOS knows and can hand you to join.
Goodday guys..
Is it possible to create multiple session on one dedicated server ?
I had doubts, thanks for the confirmation!
isnetrelevantfor default implementation accounts for netcull distance
and for hidden things afaik
But it does check for bHidden I guess
The way OwnerNoSee works I guess is different
Can I somehow control order of replicated spawns? I need that for each connection, actors will be spawned in the order they were spawned on the server.
That's what I remember from last time at least @pallid mesa 😅
Spawn Actor B using a server RPC from the OnRep of Actor A
But I need both replicated.
I think what I said is wrong as OnRep fires several times, once for each connection
So not an option
Unless you have some shared boolean that is set to to true once the first OnRep is fired. But seems like a wacky way
you can make this onrep replicated only for the owner
😃
so what our beloved wiz said with the exception that the condition for that onrep is only owner
this is something then that I'll have to dug onto :D
The problem is that I need good order also for remote controlled actors.
Right... COND_OwnerOnly 
Same here lol
you'll have that order preserved if you ping pong on autonomous proxy spawns, but be aware of locks
Dreadlocks hmmm, what's that?
expecting a spawn that never happens due to a connection drop and the server just idles
I see. The term reminds of a deadlock xD
What is ping pong? (In network 🙂 )
oooh the classical term
is when you do a ping to an ip address
meaning that you send a request to it
and it replies you back
which is called "pong"
so in this case we are reusing the terminology to reffer to the client telling the server
"hey I've spawned, spawn the next buddy"
then the server will spawn it
ping->i've spawned
pong->okay spawning a new fella

Then you join in progress and it's ruined
yes
Should easily be able to workaround it with OnReps
Or an object that listens for all of them to be present, then processes when they are
precisely!
oh dear so many questions answered with the little toy
So you say I should spawn first actor on server, and then wait for all connections to confirm to the server it's spawned, and then spawn the second actor on the server?
That'll never really work IRL
Do something like this:
class AActor_A : public AActor
{
void PostNetInit();
{
GetManager->ActorReceived(this);
}
}
class AActor_B : public AActor
{
void PostNetInit();
{
GetManager->ActorReceived(this);
}
}
// Listener/Manager
void UMyManager::OnInit()
{
TryInitialize();
}
void UMyManager::ActorReceived(Actor*)
{
TryInitialize();
}
UMyManager::TryInitialize()
{
if (ActorA && ActorB are here)
{
// Do stuff
}
}```
That's a generalised pattern for getting around actor-actor race conditions.
mhm, although he wants to spawn things in a specified order
Alright, I look into it. Thanks! So what super class is the manager derived from?
so say you have 5 characters
Just make sure your listener isn't also a replicated actor, it needs to be a world subsystem or something the client can always access
he'd like to spawn them in order
I can't see how that's gonna work. How you gonna account for relevancy etc?
i'm assuming an always relevant setup beginning of the match
hence the ping-pong-ing
very controlled scenario in such case except for net dropouts
this system that you presented is a perfect halt for initialization
but he wants spawning order
yeah I thought initialization order was the issue here
its always an issue xD so its good you pointed it out, nw
Thank you both. I'll take a look on these two approaches and get it to work.
It's weird unreal does not provide ordered network spawning. It seems like a pretty basic requirement for proper initialization.
It's really not a requirement
It also goes against the concepts of relevancy etc, replication is inherently lossy by design
Yeah but just for initialization.
But it's fairly easy to workaround like the above
That's the general solution if you have an initialization order requirement
Relevancy means you could simply never see a given actor on your client, ever.
And subsystems make this a lot easier thanks to their lifetime
You know better than me, I hope I'll get it to work.
Is there a way to wait for all clients to be finished seamless travelling before starting the match?
I use seamless travel to move from the lobby to the map where the match is played, and in HandleMatchHasStarted the connected clients still have their old playercontroller from the lobby, which is problematic. So my idea would be to override ReadyToStartMatch_Implementation and check if any of the players is still seamless-travelling, is there like a bool or something I can check?
I'm using a listenserver if that's relevant
There's a counter called NumTravellingPlayers or something, you can check that routinely until it reaches zero
The most common thing tbh is to send an RPC to the server once you've logged in to force it to check the current state of travelling players
I also just found that PlayerController has a method called 'HasClientLoadedCurrentWorld()', that might help me too, I'm gonna play around with those options, thanks
engine already does that, ServerNotifyLoadedWorld
only weird thing is it sends it using the controller class from the previous map, as the PC hasn't been changed yet
I'm going through the engine code rn, seems like NumTravellingPlayers gets reduced before the travelling player is actually done initializing
The playercontroller has SeamlessTravelCount & LastCompletedseamlessTravelCount, those seem to be updated after everything is done so I'll play around with them and see if I can just check if they're equal, if they're not equal we should still be travelling/initializing the new playercontroller
Yeah that worked, so for anyone looking for a way to wait until all connected players are done seamless-travelling, you can go through the playercontrolleriterator and check if SeamlessTravelCount > LastCompletedSeamlessTravelCount
Hello!
I`m creating a lobby system for my game. I did creating sessions with connected to lobby players but I can't do my lobby connected to another session.
I have a lobby with connected players and the host. Then host chooses the server (another session) he wants to connect with his players in his lobby. How to do this correctly? All my attempts come down to the fact that the rest of the lobby members leave the lobby when connected.
(for now it is only p2p)
thanks in advance for any hint
Hello guys, little issue after changing collision responde of a character., also my character is teleported. The player still have the fallling animation state for other client (not himself), I'm doing a set collision enabled (collision enabled) and a set movement mode (walking) on a multicast rpc, but nothng changed, I also tried reset anim instance dynamics because my character is teleported any idea?
yeah sure
Yes but does it work when host with lobby wants to connect to a specific another session?
I use server travel when the host creates the game with his lobby, but it doesn't work when the lobby with the host want to connect to another session, that is created by another player
the multicast is not on begin play, its run on a server rpc at a specific moment (when the player pressed a key)
You can't solve it
Two players colliding doesn't even work properly with character movement
Not really sure, but collisions between players are always going to be problematic. Pretty much every online racing game has the same problem
Interesting yesterday I was thinking about that and I could not comprehend how such collision could be handled/predicted in racing games. Now I know, its just not
Different games handle it in different ways, but there isn't an easy solution that can be explained away quickly
Do you guys know about the Ue4 network compendium? is that still reliable for Ue5?
I believe there were not really much changes to the networking system in UE5.
Either way most of it's still relevant if not everything.
Guys I want a tip from u If I wanna make a game with login system and so on and i wanna use eos login and my own login too what is best way to store login data and registration data ? of players registered via my login ? thank u for the tips ( because I did use VaREST and SQL database but its not good solution 😦 )
Why do you need two accounts? Seems a bit weird to me. If you're already using EOS why not just go with their system? Either way I would just use a SQL database, MongoDB or whatever database you want honestly. Put some kind of server in between it to make sure requests to it are valid and that's all you really need.
But again, I would very much recommend just using EOS if you already use it as you don't have to bother with the entire setup, maintenance, hosting and security of it all.
hi im making a game where an image url is taken from an api, i then want to go onto turning this link into a texture to then be used on an actor. Is there any way of doing this in c++ similar to the "Download image" node in bp?
Will player controllers GetUniqueNetID return the same value to the same person that was reconnected? Or when the game was shut down and started again
Guys I have question if I am logged with steam or Google or my own logging system in game and I am using Eos and Eos sessions how can I join them? if I am not logged over epic game acc
is it possible to open the current level as a listen server? or do I have to travel to a new one? I wanted to have my lobby be on the same level as the main menu
Hey, does anyone have any idea how to replicate this collision? On the server everything works fine, but on the client, it still acts as if all the static meshes have a collision too. I have no idea how to change the collision on all clients, I've already tried it using custom events but that doesn't work...
I've been trying to fix this for days
Hey hey, any suggestions on what is the smartest way to spawn an actor that is invisible for some players (but it can be visible if other players change state)? I was thinking of getting specific controllers and adding actors to the HiddenActor array but this variable is not replicated. Any suggestions in which direction to dig?
turn off collision on constructor. On the begin play check if HasAuthority - than turn on. That way collision will be only on server side
I need the collision to be turned off on both server and client
and I'm creating the static meshes in the blueprint
the clients are jumping up and down and the collision doesn't turn off for them
because u do it withing authority?
and how do I turn the collision off only for all clients?
wait I should explain my issue a bit more
u saying u need to turn off it on both client and server
I have items which get dropped by players, and upon being dropped as many staticmeshes as the amount is in the stack get spawned
but next - only for clients
I know how to turn it off for server but I don't know how to turn it off for clients
that's what I need
If you call NetMulticast funcion from server it will be executed on all the clients. Set what you need to change in NetMulticast function and then call it from the server
move SetCollision before HasAuthority
Is that an override function or do you mean creating a custom event that is multicast?
yeah so a custom event that is multicast, ok
You should avoid using multicast btw. What are you spawning ? Is it at runtime?
And just call it from the server one
That way all replicated pawns will get instructions to turn off collision
I'm spawning multiple staticmeshes on my static mesh actor depending on the stack amount of the item, which creates an effect of a bundle of those items
Should I have a switch has authority there?
Is this code running only on server or both?
Only on server
Then the has authority switch is useless btw
than why even check authority?
did I get it right?
is the stack variable replicated?
yep
Then use "OnRep"
Don't set the component replicated, just do stuff locally at client when OnRep triggers.
Setting a component replicated has its own cost and you should avoid it.
Whenever possible
on the left is server and on the right is client
You need to get your basics right first https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Properties/
alright but technically the code I posted should work, right?
This code
the add static mesh component part is a part of custom event only executed on server
No it wont work
You are doing a multicast without setting it replicated first, it doesn't exist on client so it will be null for clients