#multiplayer

1 messages · Page 1 of 1 (latest)

sonic dock
#

Earlier I read in forums online so asked but now I myself checked it

blazing spruce
#

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

twilit radish
#

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.

blazing spruce
twilit radish
#

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.

blazing spruce
# twilit radish If so then this simply doesn't work as like I've said before the game instance i...

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?

twilit radish
#

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 🙂

dark edge
#

it already is. sorta

#

check out getbaseaimrotation

graceful flame
#

Yea, also have you watched the couch talk where some Epic staff explain all sorts of multiplayer concepts? They go over that.

#

It’s a slightly older video but the core concepts and optimization techniques are the same.

left raptor
#

can someone please help me

#

my animation montages on the left arm dont work

#

i tried everything

latent heart
left raptor
#

thanks

sonic dock
sonic dock
blazing spruce
twilit radish
#

Nice! 😄

fathom aspen
pallid mesa
#

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

graceful falcon
#

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.

thin stratus
#

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

graceful falcon
#

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...

thin stratus
#

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

graceful falcon
#

alr

#

Thx, but I still got the big delay.

graceful falcon
#

@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.

slow wing
#

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?

thin stratus
#

The actor can report a list of replicated properties

#

Which in C++ you even manually supply

slow wing
#

I guess you mean in GetLifetimeReplicatedProps

#

Hmmm, what if it's a struct that we are talking about then?

thin stratus
#

Think that works with NetSerialization, but I don't know atm

slow wing
#

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)

warped sentinel
#

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?

normal quartz
#

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

sinful tree
warped sentinel
#

But I'm not the rpc is for a blueprint component not a widget

warped sentinel
dark edge
#

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

sinful tree
silver loom
#

Anyone know why my clients arent being possessed in my packaged game but work fine in the editor?

warped sentinel
sinful tree
normal quartz
# dark edge YOu using Character?

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

sinful tree
warped sentinel
warped sentinel
dark edge
warped sentinel
normal quartz
# dark edge Have you tested with network lag and jitter at all?

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

dark edge
dark edge
# normal quartz yeah, I've got South African friends so I especially wanted to make it feel good...

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/...

▶ Play video
normal quartz
# dark edge Ignore the command in my name https://www.youtube.com/watch?v=DoZyH86n_gs

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

warped sentinel
sinful tree
# warped sentinel I'm calling it on the player character and it is owned by the player

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.

  1. 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.
  2. 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.
  3. 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)
  4. 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.
warped sentinel
#

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

sinful tree
#

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.

warped sentinel
sinful tree
#

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.

silver loom
#

Why doesnt onpostLogin work for clients when the game is packaged? is there something im doing wrong?

warped sentinel
sinful tree
#

In these details

sinful tree
#

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.

warped sentinel
#

Would rpc from client to server to change other variables in the component will work?

sinful tree
#

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.

warped sentinel
sinful tree
#

So if you put a print string on the RPC, you're seeing nothing?

warped sentinel
sinful tree
#

I mean, you put a print string here or breakpoint?

warped sentinel
sinful tree
#

Put it in the rpc. If it reaches it, then you know the RPC worked.

radiant jolt
#

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.

warped sentinel
sinful tree
#

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.

warped sentinel
#

The event is called

sinful tree
#

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

granite wind
#

I have a doubt , what happens to client when its player controller gets destroyed on the server?

sinful tree
# warped sentinel 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.

warped sentinel
sinful tree
#

What variable?

#

Is it marked as replicated?

warped sentinel
#

Yes it's ability variable

#

It's replicated

sinful tree
#

What is the type of variable "ability"? Is that object a replicatable object as well?

warped sentinel
#

Yes it's an spell ability class that class also is replicated

#

And I also have map of keys and abilites that also null

sinful tree
#

Is it just a class reference (a purple variable) or an object of the class (blue)?
Maps do not replicate.

warped sentinel
#

I change the values when I call event on the component from the pc

silver loom
#

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

sinful tree
# warped sentinel Class

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.

warped sentinel
#

Ok thank it getting pretty late here could I contact u if tommoraw If the problem continue?

sinful tree
#

Best to post any more questions here, anyone should be able to help.

fluid summit
#

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).

dark edge
#

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.

fluid summit
fluid summit
elder sage
#

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

fathom aspen
#

UI component? If you mean the widget component and it's pawn related then nah, keep it on pawn

elder sage
winged badger
#

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

elder sage
#

I've always heard that Epic is kinda abandoning support for the Hud object, so I've generally avoided it

winged badger
#

there is nothing to maintain there

#

it does its job, and does it fairly well

fathom aspen
#

It excels at managing widgets for example

#

That's probably something you haven't been told @elder sage

winged badger
#

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

fathom aspen
#

Which can come at an extra risk. Making the component server sided for example

elder sage
#

I'll look into a Hud some more

winged badger
#

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

elder sage
#

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

winged badger
#

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

elder sage
#

That's something to consider, I guess

winged badger
#

if you want some kind of a stateful UI, i strongly suggest using GameplayTags instead of enums

#

they are easily extendable, and also hierarchical

elder sage
#

Like GAS tags or the engine ones?

winged badger
#

you don't need to use GAS to use GameplayTags

#

but yes, GAS tags

elder sage
#

I'm already using it, actually, but I didn't consider tags for that kind of thing

winged badger
#

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

elder sage
#

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

winged badger
#

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

elder sage
#

I just kinda don't get the art side of UI, and I unfortunately find myself almost just copying other games without realizing

winged badger
#

HUD can run hierarchical stateful UI just fine

#

and UI always ends up being hierarchical to some degree

fathom aspen
winged badger
#

CommonUI required some fixes to work there

elder sage
fathom aspen
winged badger
#

but the thing is, hierarchical approach reduces the number of transitions you need to handle

winged badger
fathom aspen
elder sage
winged badger
#

i don't know, there were like 5 different fixes in CommonUIActionRouter alone

elder sage
#

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

fathom aspen
#

The last livestream they had was an introductory on CommonUI. I have faith in Epic they will make it better soon™️

elder sage
#

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

fathom aspen
#

Yeah right. Though last game I remember did that ended up dying. RIP Paragon 🪦 : #multiplayer message

bitter swift
#

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.

bitter swift
elder sage
# fathom aspen Yeah right. Though last game I remember did that ended up dying. RIP Paragon 🪦 ...

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

dark edge
boreal wadi
#

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.

dark edge
#

But you need to keep it serverside somewhere and do all transactions on server. Never trust anything from the client

boreal wadi
#

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.

dark edge
boreal wadi
#

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

reef lantern
#

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

violet sentinel
warped sentinel
#

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)

heady python
elder sage
#

This video is really interesting, if anyone hasn't seen it already
https://youtu.be/Iryq1WA3bzw

GDC

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...

▶ Play video
loud steeple
#

after a seamless travel i got that problem

grave lynx
#

Hey, usually linetraces (for a weapon for example), are made by the owning client or server, or both?

bitter oriole
#

Client

#

Sometimes both if you're good enough to implement server side rollback and checking

grave lynx
#

so server always trust client start/end vector?

bitter oriole
#

It's the ground truth for the honest player

#

So if they're not cheating, yes, you need to use that

daring current
#

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?

torpid girder
#

hi, do i still need to compile my own UE5 to cross compile for linux?

bitter oriole
#

Assuming compiling for Linux on a Windows machine

#

It's been a launcher build feature for at least 7 years

sinful pilot
#

how do I make it so that a level loads for every client in blueprint?

torpid girder
#

sorry i meant for a dedicated linux server

subtle patrol
#

Hello I am new to multiplayer, I need your help how can I profile network

#

Like unreal insights

twilit radish
sinful pilot
twilit radish
#

What about it doesn't work?

kindred widget
#

OpenLevel is local. If you want all players to open a new level together, you need to ServerTravel called on server.

sinful pilot
twilit radish
subtle patrol
#

Ty

kindred widget
sinful pilot
#

how do I enable it?

kindred widget
#

Actually I'm not sure that's a requirement. I have a memory that you can hardload servertravels too.

twilit radish
#

You can yes.

twilit radish
#

So the fun part about this seems to be that C++ doesn't expose "ServerTravel" in the UWorld to BP :/

kindred widget
#

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.

tacit bough
#

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?

kindred widget
#

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

sinful pilot
tacit bough
#

@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.

kindred widget
#

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.

tacit bough
#

This is the part that's responsible for spawning players (executed from within the GameMode blueprint)

fluid summit
tacit bough
#

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?

kindred widget
#

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.

tacit bough
kindred widget
#

Where is your connection logic for the client joining the host?

fluid summit
sinful pilot
alpine flower
daring current
#

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

tacit bough
alpine flower
#

It’s not hard to figure out

fluid summit
#

it's 20 mins max, it's really easy.

daring current
#

oh ok thanks for the advice

tacit bough
fluid summit
#

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...

▶ Play video
daring current
#

thanks I thought it was extremely complex, ill definitely check that out

alpine flower
tacit bough
#

@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: 

fluid summit
# tacit bough You might be talking about dynamic vs. static IP addresses?

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

tacit bough
alpine flower
#

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

tacit bough
fluid summit
tacit bough
alpine flower
latent heart
#

Is it a bp gamemode?

fluid summit
#

i think you also need to check for the server

#

is this a dedi setup or listen?

tacit bough
#

listen.

tacit bough
fluid summit
latent heart
#

There's a chance it isn't being packaged. (are oyu running a packaged game?)

fluid summit
#

are you using steam advanced?

alpine flower
tacit bough
latent heart
tacit bough
tacit bough
latent heart
#

But I mean, is your current game mode problem in a packaged game?

kindred widget
#

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.

tacit bough
tacit bough
fluid summit
#

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.

tacit bough
tacit bough
#

@kindred widget this is how the player moves from the main menu map to the session hosted by the other player

tacit bough
fluid summit
kindred widget
# tacit bough

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.

dark edge
#

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

alpine flower
#

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

dark edge
#

Do you mean that the client pawn class is a subclass of the host pawn class?

alpine flower
#

yup

dark edge
#

why

alpine flower
#

client has different mesh

dark edge
#

or rather, why do you have separate pawns

#

so it's data only? just mesh swap?

alpine flower
#

it is

#

is this a problem?

dark edge
#

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

alpine flower
#

yes that how it works

dark edge
#

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

alpine flower
#

one object one option

dark edge
#

K you need an interface my dude

alpine flower
#

I have it

#

give me a sec

dark edge
#

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

alpine flower
#

oh

dark edge
#

So to start with, do you want to use a component or an interface?

#

I like component better

alpine flower
#

comp

dark edge
#

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

alpine flower
#

done

dark edge
#

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

alpine flower
#

okay but it still wont solve my main problem i guess

dark edge
#

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

alpine flower
#

now i get what you mean

dark edge
#

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

alpine flower
#

okay i'm getting to work

#

Thank you for explaining ;D

dark edge
#

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.

tacit bough
sinful imp
#

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

latent heart
#

I'm pretty sure you never had the dedicated server code if you think decryption keys will do anything?

sinful imp
#

@latent heart I had its just that im a total noob at ue4

latent heart
#

What I see is, you want to reverse engineer a dedicated server so you can hack/fuck with it.

sinful imp
#

no

latent heart
#

This is not that place for that.

sinful imp
#

i just need to change windows to linux support

latent heart
#

And nobody is going to decompile an exe for you.

#

Run it on a virtual machine if you wanna do that.

sinful imp
#

vms arent good for performance

#

especially at production scale

#

also i love docker

latent heart
#

If you want to run something "at production scale" then you definitely can't be decompiling an exe and running your own servers

shell forum
#

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?

crystal crag
#

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.

tacit bough
#

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.

shell forum
#

But 6 seconds isn't that long. Having a loading screen is recommended anyways.

thin stratus
#

You might also want to utilize SeamlessTravel

#

(can't be used in PIE atm iirc)

shell forum
pallid mesa
thin stratus
#

There were some commits lately I think

#

I heard something about that

pseudo schooner
#

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

pallid mesa
# thin stratus I heard something about that

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?

thin stratus
#

No guide afaik

#

There isn't too much to it

pallid mesa
#

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

thin stratus
#
  • 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

pallid mesa
#

hehahehahhd XD

thin stratus
#

it should be in the compendium but i have no time

pallid mesa
#

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

thin stratus
#

Yeah I guess you are right

crystal crag
#

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

thin stratus
#

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?

crystal crag
#

I could try to use the test beacons that come with the unreal engine I suppose

#

and see if those work

thin stratus
#

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

tacit bough
thin stratus
#

I wanted to turn it into an interactive website with dynamic pdf printing and dark/light mode

#

But man... The time that takes

crystal crag
#

hm... I just had an idea. I'm creating the beacons inside of a subsystem

tacit bough
#

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?

thin stratus
#

I mean the UE community stuff totally allows for seamless travel tutorials

crystal crag
#

I bet you it has to do with not being in a replicated actor

thin stratus
#

Should probably be the preferred place to post thay

crystal crag
#

or maybe I need to set the owner when spawning the host and set the owner to be the game state or something

thin stratus
tacit bough
tacit bough
#

?

thin stratus
fluid summit
#

i think that would help a lot of people.

thin stratus
#

I think that exists already

#

Sort of

thin stratus
#

Simplest is with SubsystemNULL

#

An direct IP connection

#

Actual online multiplayer requires a cross platform Subsystem like EOS or custom

thin stratus
# fluid summit We maybe can take the compendium and make it into short 10-15 minutes explaining...

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...

▶ Play video
fathom aspen
#

17mins and counting... @pallid mesa

tacit bough
#

^ that youtube channel is so golden

thin stratus
#

He has another video for the whole init phase of the engine

#

Pure gold

pallid mesa
#

🧑‍🦲

#

bruh 17 minutes read, cuut cuuuuut

#

XD

fathom aspen
#

Haha gotta make sure the info is all there ^^

pallid mesa
#

remember to include the gotchas

fathom aspen
#

Huge thanks to this tool though:

#

It would not have been possible without it lol

fathom aspen
pallid mesa
#

you know the OverrideWith missleading nonsense @fathom aspen

twilit radish
fathom aspen
pallid mesa
#

++++ 👏

fathom aspen
#

Cedric and James were literally ranting at it xD

pallid mesa
#

ofc.

twilit radish
#

Also when is someone making the City Sample multiplayer? 😛

fathom aspen
#

That's @pallid mesa ofc

pallid mesa
#

eh? yes

dark edge
crystal crag
#

Weird... so I can send RPCs from the host beacon object to the client

#

but not the other way around...

pallid mesa
dark edge
latent heart
tacit bough
#

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)

crystal crag
#

@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"

latent heart
#

That's for a regular rpc. It's entirely possible the beacons do something else.

#

I don't know much about them!

crystal crag
#

Well I appreciate the attempt anyways 🙂

#

Sorry if I came across as a jerk, I wrote my response in a hurrt

#

*hurry

latent heart
#

I was assuming too much myself.

#

Just a generic rpc response!

rancid monolith
#

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

shy gyro
#

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))
{
    //...
}
real ridge
#

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 😦 )

twin juniper
#

hi
I want to make pvp session that create on dedicated server

#

any idea

rancid marten
#

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?

rancid marten
#

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.

elder sage
#

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

empty axle
rancid marten
#

Yeah, but not finding mych info which logs should I be looking into?

rancid marten
#

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:

spark fractal
#

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?

fathom aspen
#

If the travel is seamless look into APlayerState::CopyProperties

#

If not you probably want to use the GameInstance

fathom aspen
uneven chasm
#

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?

kindred widget
uneven chasm
kindred widget
#

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.

proper cedar
#

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

dark edge
#

What's the console command to visualize corrections etc?

#

Specifically for physics. I've used it before but can't find it now.

latent basin
#

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

faint parcel
#

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

worn wagon
#

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

latent basin
#

How would that look?

#

Im a bit confused sorry

worn wagon
#

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

latent basin
#

Thank you

#

is client run on client?

#

Run on owning client *

worn wagon
#

So yes

#

Like I said, refer to the chart, it tells you everything you need to know about where the code gets run 🙂

shell forum
shell forum
#

Or you could connect directly to the database from a dedicated server for extra speed.

young shuttle
#

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

fathom aspen
#

Both will result in the client disconnecting from the server he's connected to though

young shuttle
fathom aspen
#

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

twilit radish
#

Are we talking about a for example Minecraft like system with multiple worlds?

fathom aspen
#

I wonder what the Minecraft worlds are in Unreal terms?

twilit radish
#

UWorlds.

#

But multiple at the same time.

fathom aspen
#

Ah I meant the servers then which you can join at the start xD

#

Probably dedicated?

twilit radish
#

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

fathom aspen
#

Yeah I can tell ^^

young shuttle
#

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

twilit radish
#

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.

young shuttle
#

thank you @twilit radish really helped

twilit radish
#

👍

uneven chasm
#

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

fathom aspen
#

They are spawned on server and replicated to clients

uneven chasm
#

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🔍

fathom aspen
#

BeginPlay gets called on both server and client. Use a SwitchHasAuthoirty macro if you want it to be done only on server

#

Authority pin

uneven chasm
#

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

fathom aspen
#

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)

uneven chasm
#

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

fathom aspen
#

The warning has nothing to do with that

uneven chasm
#

ah crap I see what is happening

#

the server doesnt know what the controlled pawn is

fathom aspen
#

You are assuming too much there

#

If the pawn hasn't been possessed yet then yes that's normal

uneven chasm
#

that makes sense that code is on the beginplay of the controller

fathom aspen
#

I have no clue what your end goal is here

#

In words what are you trying to do

uneven chasm
#

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

fathom aspen
#

If you think Interfaces are RPCs then you're wrong

uneven chasm
#

no just thought it would execute the same

fathom aspen
#

Interfaces execute locally

#

Called on client, execute on client

uneven chasm
fathom aspen
#

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

uneven chasm
rotund onyx
#

Is there a way to join a lobby with additional data, like a selected color or selected cosmetics or whatever?

elder sage
#

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

rotund onyx
#

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.

elder sage
#

perform action -> write to save -> load in -> read from save -> apply to client then replicate

rotund onyx
#

how would I pass the information from client to server?

elder sage
#

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

rotund onyx
#

how do I call the client to send its data?

elder sage
#

remote procedure call to the server in a replicated object

#

are you familiar with how to rpc data?

rotund onyx
#

I mean like what function should I tack the rpc onto

#

I need the data as soon as a player joins

elder sage
#

beginplay would be fine

rotund onyx
#

I am sort of familiar with rpc but still bad at them

elder sage
#

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

rotund onyx
#

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

elder sage
#

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

sinful tree
#

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.

elder sage
#

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

sinful tree
#

There's only ever one game instance.

#

Moving between multiplayer or between levels doesn't change the game instance.

elder sage
#

I guess I'm not totally sure what happens with it when you move to multiplayer

#

doesn't it replicate though?

sinful tree
#

Doesn't replicate.

elder sage
#

maybe I'm thinking of game state

sinful tree
#

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.

uneven chasm
#

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 ?

elder sage
sinful tree
#

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.

sinful tree
# uneven chasm should i put all my hud stuff on the controller behind a authority switch for cl...

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.

uneven chasm
topaz knot
#

Question: How to I detect when a player has joined a session so I can spawn their character.

elder sage
fathom aspen
topaz knot
#

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.

topaz knot
fathom aspen
topaz knot
fathom aspen
#

Inside your GameMode class

topaz knot
#

What if the remote player has 2-4 local players? do I make an array and loop it or does it fire for each?

fathom aspen
#

It fires for each

topaz knot
#

oh shoot, does that mean my already setup logic wont work

fathom aspen
#

Probably. I have no experience with local multiplayer but it shouldn't be any different in this regard

#

Literally test it

topaz knot
#

I have been, it's been spitting out way too many characters thats why I asked

lean surge
#

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

twin juniper
tawny parcel
#

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

blazing spruce
#

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

elder sage
# blazing spruce Hi, Im trying to set it up so that when players are in the Pre Lobby their view ...

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

blazing spruce
# elder sage Something about your setup sounds off, definitely some kind of scaling issue. Wh...

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

elder sage
# blazing spruce I tried putting the set view target into the level BP but the same thing happens...

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

blazing spruce
# elder sage That probably would be happening, actually. The level begins play before the con...

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

elder sage
#

That's kind of the standard for menus in 3D-only engines

lime echo
#

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?

elder sage
# lime echo At the beginning of my game, I spawn many actors at once on the network. Some of...

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

twilit radish
#

Why do you need to “network” the player controller? It already is networked and replicated to the owning client 😄

lime echo
#

@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?

blazing spruce
twilit radish
#

@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.

elder sage
lime echo
twilit radish
#

Oh wait I think I misread your problem. You're spawning just regular actors, not necessarily pawns?

elder sage
#

don't you need to rpc to set the owner of an actor? that might be your problem

lime echo
twilit radish
#

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.

blazing spruce
elder sage
lime echo
twilit radish
#

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.

lime echo
#

But setting timers between spawns is really unscalable IMO.

elder sage
#

usually if you need a timer to get something working there's a better way

twilit radish
#

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.

lime echo
#

Alright. So that's what I'll do. Thank you for your time!

twilit radish
#

👍

lime echo
twilit radish
#

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.

twilit radish
elder sage
#

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

twilit radish
#

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.

elder sage
#

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

twilit radish
#

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

shell forum
stable wren
#

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?

upbeat basin
stable wren
pliant moss
stable wren
pliant moss
#

did you virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

#

and DOREPLIFETIME

#

on the actor that holds the mesh

pliant moss
# stable wren 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

fathom aspen
stable wren
pliant moss
#

Darn, should keep my mouth shut untill i have more experience 😄

stable wren
pliant moss
coral wing
#

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

twilit radish
#

@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.

coral wing
#

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

twilit radish
#

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.

coral wing
#

Oh I can? Awesome I'll have to do that

#

Can you send me the article?

twilit radish
#

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.

coral wing
#

Awesome! thank you so much. I'll have to do a rebuild if I can't find anything in my server logs

twilit radish
#

👍

uneven chasm
#

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?

twilit radish
#

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.

uneven chasm
#

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

twilit radish
#

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.

dark edge
#

I would do it with anim notifies

sinful tree
harsh lintel
#

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

fallen sentinel
#

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 =/

elder quartz
#

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?

shell forum
#

Is SeamlessTravel supposed to execute ChoosePlayerStart? It's not doing it for me...

empty axle
wintry shadow
#

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".

harsh lintel
fathom aspen
shell forum
obtuse field
#

What is this warning? And how to counter it?

dark edge
obtuse field
grave lynx
#

Is that usefull to check is local controller on a client rpc?

dark edge
#

what are you checking for here

grave lynx
#

oh sorry, here we are in the PC

dark edge
#

That will only be definition run on the local one

grave lynx
#

the objective here is to display an HUD

dark edge
#

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

grave lynx
#

got it

obtuse field
#

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?

dark edge
dark edge
#

You sure MovementSpeed is synced?

obtuse field
dark edge
#

So how big is the speed difference?

obtuse field
#

lemme compile

obtuse field
#

Even up to 15 times as fast

graceful flame
#

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.

fathom aspen
#

COND_SkipOwner for the projectile

graceful flame
#

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.

fathom aspen
#

Ah that should work too

#

Though I think the projectile is still replicated in that case

fathom aspen
graceful flame
#

yea now its just a matter of hiding all the double visual stuff lol

dark edge
#

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)

obtuse field
dark edge
#

like how do you know its moving 15x faster on server

obtuse field
#

Its delta time. The velocity from this: Direction * MovementSpeed * Delta was 15x bigger

dark edge
#

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

obtuse field
dark edge
#

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.

obtuse field
dark edge
#

Sure it does

obtuse field
dark edge
#

delta time is used in the actual update

obtuse field
#

oh, ok

pallid mesa
boreal wadi
#

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.

shell forum
#

If that’s the case, you can try doing that.

boreal wadi
#

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

marble gazelle
# boreal wadi No thats not what I mean. The developer of the EOS Online Subsystem plugin (paid...

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.

boreal wadi
#

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.

marble gazelle
#

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.

odd iron
#

Goodday guys..
Is it possible to create multiple session on one dedicated server ?

fathom aspen
pallid mesa
#

isnetrelevantfor default implementation accounts for netcull distance

#

and for hidden things afaik

fathom aspen
#

But it does check for bHidden I guess

#

The way OwnerNoSee works I guess is different

lime echo
#

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.

fathom aspen
#

That's what I remember from last time at least @pallid mesa 😅

fathom aspen
lime echo
fathom aspen
#

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

pallid mesa
#

The only way is doing ping pong client to server, cause lag exists x'D

pallid mesa
#

😃

#

so what our beloved wiz said with the exception that the condition for that onrep is only owner

pallid mesa
lime echo
#

The problem is that I need good order also for remote controlled actors.

fathom aspen
fathom aspen
pallid mesa
fathom aspen
#

Dreadlocks hmmm, what's that?

pallid mesa
#

expecting a spawn that never happens due to a connection drop and the server just idles

fathom aspen
#

I see. The term reminds of a deadlock xD

lime echo
pallid mesa
#

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

fathom aspen
chrome bay
#

Then you join in progress and it's ruined

pallid mesa
#

yes

chrome bay
#

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

pallid mesa
#

like the net event manager ™️

#

🤣

chrome bay
#

precisely!

pallid mesa
#

oh dear so many questions answered with the little toy

lime echo
chrome bay
#

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.

pallid mesa
#

mhm, although he wants to spawn things in a specified order

lime echo
#

Alright, I look into it. Thanks! So what super class is the manager derived from?

pallid mesa
#

so say you have 5 characters

chrome bay
#

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

pallid mesa
#

he'd like to spawn them in order

chrome bay
#

I can't see how that's gonna work. How you gonna account for relevancy etc?

pallid mesa
#

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

chrome bay
#

yeah I thought initialization order was the issue here

pallid mesa
#

its always an issue xD so its good you pointed it out, nw

lime echo
#

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.

bitter oriole
#

It's really not a requirement

chrome bay
#

It also goes against the concepts of relevancy etc, replication is inherently lossy by design

lime echo
chrome bay
#

But it's fairly easy to workaround like the above

#

That's the general solution if you have an initialization order requirement

bitter oriole
chrome bay
#

And subsystems make this a lot easier thanks to their lifetime

lime echo
pale hazel
#

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

chrome bay
#

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

pale hazel
#

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

winged badger
#

only weird thing is it sends it using the controller class from the previous map, as the PC hasn't been changed yet

pale hazel
#

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

waxen pivot
#

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

grave lynx
#

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?

grave lynx
#

yeah sure

waxen pivot
#

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

grave lynx
#

the multicast is not on begin play, its run on a server rpc at a specific moment (when the player pressed a key)

chrome bay
#

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

hoary nova
#

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

chrome bay
#

Different games handle it in different ways, but there isn't an easy solution that can be explained away quickly

pure lynx
#

Do you guys know about the Ue4 network compendium? is that still reliable for Ue5?

twilit radish
#

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.

real ridge
#

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 😦 )

twilit radish
#

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.

spark fractal
#

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?

dark edge
#

I just use replicated physics.

#

Works great, if you dont have lag compensation.

fervent gorge
#

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

real ridge
#

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

clear copper
#

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

shrewd dawn
#

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

summer hemlock
#

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?

fervent gorge
shrewd dawn
#

and I'm creating the static meshes in the blueprint

fervent gorge
#

then what the problem?

#

just turn off it on contructor/after creation/spawn

shrewd dawn
#

the clients are jumping up and down and the collision doesn't turn off for them

fervent gorge
#

because u do it withing authority?

shrewd dawn
#

and how do I turn the collision off only for all clients?

#

wait I should explain my issue a bit more

fervent gorge
#

u saying u need to turn off it on both client and server

shrewd dawn
#

I have items which get dropped by players, and upon being dropped as many staticmeshes as the amount is in the stack get spawned

fervent gorge
#

but next - only for clients

shrewd dawn
#

that's what I need

fervent gorge
#

do u spawn it on server side?

#

or clients to

summer hemlock
#

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

fervent gorge
#

move SetCollision before HasAuthority

shrewd dawn
summer hemlock
#

Here is an example

shrewd dawn
#

yeah so a custom event that is multicast, ok

quiet rapids
summer hemlock
#

And just call it from the server one

#

That way all replicated pawns will get instructions to turn off collision

shrewd dawn
shrewd dawn
quiet rapids
summer hemlock
shrewd dawn
quiet rapids
fervent gorge
shrewd dawn
#

did I get it right?

quiet rapids
shrewd dawn
quiet rapids
#

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

shrewd dawn
#

Alright so OnRep is an override function?

#

the code I just posted doesn't work

shrewd dawn
quiet rapids
shrewd dawn
#

alright but technically the code I posted should work, right?

shrewd dawn
#

the add static mesh component part is a part of custom event only executed on server

quiet rapids
#

You are doing a multicast without setting it replicated first, it doesn't exist on client so it will be null for clients