#multiplayer

1 messages Β· Page 205 of 1

silk nexus
#

Also, thanks for your help!

teal frost
#

Yes it is possible but there are hardships.
My game is 100% in blueprints.

gray sparrow
#

your game works multiplayer?

#

someone told me if you make 3vs3 multiplayer in blueprints

#

it will not work... cause when someone leave the game the game the server gets destroyed

#

idk what he mean...

teal frost
#

That is correct.
There probably is a better way but I haven't found it.
I have the spaghetti too.

The start/spawning of players each round in my game Strings together like this
Ui selection>player controller>gamemode.

My case sounds different though as I reload everything at the start of every round.

However, soon I will have to tackle the issue of the host leaving a game which means I will need to do what you're doing in a sense.

Unfortunately BPs have no direct solution to this, so as soon as the host (listen server) leaves the game ends.

Have to save the entire state of the game, select a new host, have the new host create a new session, then migrate all player into that new session. To resume

teal frost
gray sparrow
#

i m a noob...

#

so if the hsot leave the game the game is over?

teal frost
#

Yes

lost inlet
#

Multiplayer is barely a noob's topic

gray sparrow
#

and i cant fix this with bleurprints?

teal frost
gray sparrow
#

so it will not work multiplayer in blueprints?

teal frost
#

But naturally no, there is no "easy" solution through BP

gray sparrow
#

this is the only problem? for this i need c++ and the rest will work?

#

rest will work in blueprints?

teal frost
#

C++ would be the most efficient way to work around it.

#

But it is possible through BP I believe

gray sparrow
#

hm so its possible to amke whole game in lbueprints

#

3vs3 and it will work all?

#

on steam for example

teal frost
#

That's what I'm doing.
My game is 4v4, 2v2, and 1v1v1v1v1v1v1v1

gray sparrow
#

what is you game?

#

shooter?

teal frost
#

No

#

it's a casualish moba like

gray sparrow
#

nice

teal frost
#

learning project

gray sparrow
#

i send you a freind question

#

maybe you can accept^^

#

how long you code your game?

#

and is it rdy?

teal frost
#

It's not. It's mostly a learning project for me. I've been working on it on and off for almost a year but no it isn't ready yet.

It's playable, but not ready.

gray sparrow
#

can you accept my friend request? ^^

#

do you have minimap rdy?

teal frost
#

In a bit perhaps.
My project doesnt use mini maps as the arena's are rather small.

lost inlet
#

godspeed answering these DMs

gray sparrow
#

can you show me a pciture or video of your game? or gameplay?

opal pulsar
gray sparrow
neon summit
#

For getting it to work for client would probably have to check authority on inputaction and have remote call server event

#

for client its probably not replicating in time. Try using bp debugger and see if its valid for clients

brazen anvil
#

If I have a struct with a member variable marked NotReplicated, does UE do something to it before sending the struct across the network?

olive lance
silk nexus
#

Hey man just wanted to follow up and say thanks. I just ran a test on game instance, and a test integer I incremented prior to seamless travel persisted after seamless travel. I think I'm on the right track. I'll try keeping the map of players and pawns in there to have a seamless lobby experience.

#

Silly test I should have done before building out all this non-functioning infrastructure πŸ₯Ή

teal frost
silk nexus
#

Hahaha

#

Yeah same.

#

Same to you, too!

teal frost
teal frost
silk nexus
#

Also, in case anyone ever runs into this issue as I did, player state appears to get re-instanced as well

#

I incremented a test integer variable prior to travel, then traveled. After travel, it reset to the default value, 10. Unlike the game instance

#

I suuuure wish the official documentation on this explained this.

silk nexus
woven bramble
#

Thanks. I tried it now, but even when I lag with Clumsy and slow down the internet, the game doesn't drop like they do, so I can't test the game by trial and error.
Summary of PCs experiencing the problem:
TCP Plugin on, UDP off: 1 drop every 5 seconds on average.
TCP Off, UDP on: Average. 1 drop in 10 seconds.
Both Plugins off, Avg. 1 drop every 10 seconds.
0 drop when the internet is off.

gritty warren
#

--

I'm making a simple co-op shooter game, don't care about cheating or any such thing.

I'm going to be doing client prediction for shooting (or not even prediction really - client is just going to declare where the line trace is originating from and RPC that to the server).

Is there anything else I need to do / account for to ensure that things are smoothly linked up?

modest crater
# gritty warren -- I'm making a simple co-op shooter game, don't care about cheating or any suc...

Ideally if you dont care you would also let the client just tell who they shot and on the server you apply the damage and have some way to let other clients know to shoot for your simulated actor so you get the visual stuff, otherwise you are sending a lot more info then needed (assuming you are still in the idc about cheating phase) then let the clients do more locally and just tell the server

gritty warren
#

it doesn't really matter if it's not synced anyway, but it'd still be nice if the vfx lined up appropriately

modest crater
#

You're going to have desync either way, just how networking is, even if unreal wasnt server auth based you still would need to wait for all clients to sync state no matter what condition

#

Oh you mean the linetrace accuracy

trim onyx
#

Hi!
I'm not sure if this is the right channel for this question, but I'll do it anyway.
In SpaceWar, a sample project for Steam's SDK, there is a menu option called β€˜Find internet servers’. What kind of servers does it refer to? Dedicated servers?

kindred widget
#

With the line trace direction, and that extra info, you should have everything you need to make hit particles or whatever show relatively correctly.

upbeat basin
#

Is there any delegate to bind that notifies player state is updated or do I need to create my own?

hoary spear
#

'updated'?

#

there's this

#

or these

#

@upbeat basin

dark parcel
#

@kindred widget for slow moving projectile, I don't know how to correct the projectile location without snapping it.

Depending on latency, the projectile may hit in one screen but not on the other.

How can I reconcile these differences? Do I just explode the projectile regardless it hit something or not in other machine if on the server the fireball hit something?

hoary spear
#

Can't wait to dive into these kind of issues ^

#

probably gonna become the bane of my existence, as it can never really be perfect

dark parcel
#

πŸ˜”

hoary spear
#

everything is a trade off

dark parcel
#

I actually not on the stage to test yet. Haven't got a.i setup or test with other player, but I'm already having nightmare about all of the possibilities

hoary spear
#

giving to much lee-way to high ping clients ruin the experience for the low ping clients ( to some degree)
not giving enough to the masses in the middle (mediocre ping) could mean they rarely hit the target, ruining their experience

kindred widget
#

IMO, client should just be relatively correct visually. You play the explosion from something like a cue/multicast. At <50 ms it should be fine in most cases. You can't do much about >100ms.

dark parcel
#

True, I will just stop worrying about players above 150 ms

hoary spear
#

150ms should cover most

dark parcel
#

If they complained, just tell them to get better internet

hoary spear
#

or spin up a server closer to their region

kindred widget
#

EG client just locally predicts in between frames, gets updates from server to fix if too far off. Client does NOT play their own explosions. You wait for server to tell client to play the explosion at the correct location, etc.

dark parcel
#

Atm I'm spawning them and let the projectile move it self.

So each client kinda simulate the projectile independently. No correction what so ever

#

With network clock I can pass time stamp and correct location but that will result in some sort of rubber band or projectile skipping forward

hoary spear
#

that can be worked with tho

#

you can interpolate those

dark parcel
#

No perfect solution no matter that I can think of

#

Yeah, been interpolating stuff

hoary spear
#

locally speed up the projectile to catch up to the server

dark parcel
#

But if I want to spawn hundreds of projectile , I might have to look for another way

hoary spear
#

I'd focus on the scenarios you have atm, and not theoreticals

#

otherwise you're kinda stuck in a forever theoretical problem πŸ˜›

dark parcel
#

Yeah your right

hoary spear
#

"I solved 100!, now i wanna do 1000"

kindred widget
#

It shouldn't matter if it's 1 or 100,000,000,000. Code will all work the same since it should be in the projectile itself.

hoary spear
#

it should, but at some point you probably wanna bulk them transform updates

kindred widget
#

Performance issues asside, yeah. πŸ˜„

dark parcel
#

Need to pick my next problem, setup A.I, learn fast array for item system or configure steam socket to get pings for session.

#

Multiplayer is hard

hoary spear
#

ignore fast array unless you have thousands πŸ˜„

dark parcel
#

πŸ‘€

kindred widget
#

AI is easy. Works identical to singleplayer.

hoary spear
#

sure, it's neat with per slot delegates, but the performance of an inventory is usually not the most important thing

#

it's not like its changing every second

dark parcel
#

I suppose everything is on server side. The brain and command. My issue would probably determining if a player blocked the attack or not.

Since the a.i attack will actually already happend before the player even see it

dark parcel
#

That may be feasible I guess

kindred widget
#

If you're using a struct based inventory, FastArrays are kinda necessary. Struct based inventories make me queasy though. Super stupid to handle from a UI perspective.

dark parcel
#

I see

dark parcel
#

Do you use objects then? And replicate them?

hoary spear
#

im using struct inventory

#

replicate what... 3 variables?

#

rest is local

#

if i could start over, I'd probably do objects tho

#

or instanced structs

kindred widget
#

Make 2000 items. Show them in a widget. Do so without having 3+ms slate prepass and draw time.

hoary spear
#

and that's structs fault ?

#

for copying and all ?

kindred widget
#

Not directly.

#

Using structs, you have to create a widget for each struct. So you're at 2k widgets at just the userwidget. Add an icon, cooldown, couple textblocks. We're over 10k widgets already probably for a super basic inventory. Even if you collapse half of it. You have thousands of widgets prepassing and drawing.

#

You avoid this by doing one of two things. Making a specialized widget which is just ugh. Or you use TileView/Listview widgets.

#

The later requires a UObject to pass to the View widget which you use to wrap the struct.

#

At which point you're creating UObjects anyhow now. So you may as well just make a UObject inventory in the first place.

hoary spear
#

I'd probably just do the Ugh part at that point xD

#

but yeah thats fair

#

generally weird that they dont optimize their regular containers this way

#

but i guess they are to generic

dark parcel
#

And how do you serialise the properties in the object if I don't save the uobject? Store them in an array of structs and recreate them when the game loads again?

kindred widget
#

Pretty much. But I'd also recommend just saving the entire inventory component and it's subobjects too.

dark parcel
#

So we can save component πŸ€”

#

Soo much to learn

kindred widget
#

I wrote a bit about it here, and on the Saving Games Smartly linked post
https://brandtborges.wixsite.com/authaer/post/uobject-serialize

Authaer

The Serialize function from the UObject class is a key feature in the engine that surprisingly few people know about. It isn't talked about much despite how powerful it is for game design. More specifically saving a game smartly.Serialize is a very simple function that performs two basic tasks.It takes properties from a UObject and writes them i...

hoary spear
#

Sure thing

#

thats neat post πŸ™‚

#

I'll save that for when I'm gonna attack it πŸ˜›

kindred widget
#

The general TLDR about it is that it writes what you need from the object to a byte array of PropertyName=PropertyValueAsText.

So if you had like
int32 SomeProp1 = 43;
FString SomeProp2 = "Steve"

You serialize it and you get something like
SomeProp1=43/SomeProp2=Steve

hoary spear
#

This doesnt use the "SaveGame" property tho, right?

kindred widget
#

It does or doesn't. That's your choice. You can save the entire thing, or just the SaveGame marked properties.

hoary spear
#

yeppyepp

kindred widget
#

IMO, I love it simply because it allows you to save anything generically, and not have mass amounts of upkeep. Literally the worst thing you have to do with this system is that if you rename a property on a class, you have to fix up the loaded data to reflect that in your post load functions.

hoary spear
#

that makes a whole lot of sense

#

just makes me wonder why this isnt a default engine function

#

so much more practical than the BP options

tardy fossil
#

Just be careful, you can easily corrupt blueprints and assets by changing how it’s serialized after it’s already made

kindred widget
storm zealot
#

Character movement "Crouch" will change character capsule height, but capsule is still a center of character, so legs will go under floor

Thats the problem

thin stratus
#
void ACharacter::OnStartCrouch( float HeightAdjust, float ScaledHeightAdjust )
{
    RecalculateBaseEyeHeight();

    const ACharacter* DefaultChar = GetDefault<ACharacter>(GetClass());
    if (Mesh && DefaultChar->Mesh)
    {
        FVector& MeshRelativeLocation = Mesh->GetRelativeLocation_DirectMutable();
        MeshRelativeLocation.Z = DefaultChar->Mesh->GetRelativeLocation().Z + HeightAdjust;
        BaseTranslationOffset.Z = MeshRelativeLocation.Z;
    }
    else
    {
        BaseTranslationOffset.Z = DefaultChar->BaseTranslationOffset.Z + HeightAdjust;
    }

    K2_OnStartCrouch(HeightAdjust, ScaledHeightAdjust);
}
storm zealot
#

yep, thats why I switched to manual

#

but thats clunky, only solution I found - separated Timeline for capsule height and mesh relative pos

thin stratus
#

Relatively sure you end up running into corrections with that approach.

storm zealot
#

thats reliable muticast)0

thin stratus
#

Doesn't matter. You are modifying the Capsule outside the CMC Sim Scope

storm zealot
#

also I use smooth sync instead of Movement Replicate, so I need to muticast "crouch" function too?

thin stratus
#

Crouching in the CMC also does a bit more than just changing the Capsule

#

Idk, I would never touch SmoothSync. No clue.

storm zealot
#

Any idea what can break vanila crouch in CMC?

thin stratus
#

No, I would start by checking if the Z value of the Mesh changes in the Outliner or by printing it.

storm zealot
#

Good idea, I will try

#

thats weird, but if server crouch - client see it correct

but if client crouch, server will see it wrong

thin stratus
#

Hm

storm zealot
#

Also Z is the same on client and server

tardy fossil
#

are you setting bWantsToCrouch to true on the character movement component on the client? thats the one that replicates

storm zealot
thin stratus
#

They meen if you call Crouch/Uncrouch

#

Which are Character functions.

tardy fossil
#

yeah i'm pretty sure the client just needs to call Crouch() on the player.. no RPC's are needed

storm zealot
#

but if server host crouch - clients see him okay

thin stratus
#

Could be a bug with ListenServers. Hm

wary ermine
#

Hey πŸ™‚
I have a splitscreen game and I create a local player. I have generic usb controllers and have set up two sets of inputs for p1 and p2. How can assign the inputs to a specific player?
I have set up the input logic in the thirdperson character that i use to spawn the players. ^^

thin stratus
covert tiger
#

Am I being stupid here or is this just wrong? I'm looking at FillMembersFromLobbyData in OnlineSessionAsyncLobbySteam.cpp.
This part of the code will always SetLobbyJoinable to false if bAllowJoinInProgress is set to false for the session totally ignoring the actual SessionState of the ongoing session, IE if it's in progress or not. Is this a Steam thing? I'm having an issue with the lobby being closed whenever the first person joins when I'm using Steam due to this.

wary ermine
#

First question is because I cant find either the OnPossessed Event nor the EnhancedInputSubsystem

#

Again thanks for the help ^^

thin stratus
upbeat basin
# hoary spear there's this

Well I was asking for a delegate for other classes to bind. Creating and calling a custom delegate inside that function was already what I meant by creating my own. But I guess there is no other choice

hoary spear
#

You'd bind your other classes to the one that already exist

upbeat basin
#

Isn't that a function?

hoary spear
#

Maybe i was to quick about this

#

you might be right

#

pretty sure i bound to it tho

#

and cant recall making my own delegate for it

upbeat basin
#

There is a delegate for the character in the controller, but I couldn't find a delegate for PlayerState anywhere

#

Those are both Character functions, OnRep being called on all non server clients (because why would epic ever call an OnRep function inside the server?) and OnPlayerStateChanged being called on the server and owning client only

hoary spear
#

Thats probably the one im thinking about tbh

#

the pawn

#

Yepp. Custom it is then!

torn basin
#

hi im trying to get a checkpoint system working, it works for player 1 (when player 1 enters checkpoint, and goes into out of bounds he respawns) but doesn't work on player two (when player 2 activates checkpoint, and goes into out of bounds, player 1 is respawned and not player 2). any advice?

wary ermine
#

and how do i get the new input events? is it just the same as before and i search for the name in the context search? ^^

#

ah ye, found them, but they seem not have the pressed or released functionallity

#

i guess completed is released?

thin stratus
#

The stuff in the ProjectSettings is deprecated

#

You should also see a message about that.

silk nexus
#

That's my first suspicion based on your description, that you have the logic only working on the local client or server

torn basin
#

uhhh yes? if you mean that player one is the host of the server then yes

wary ermine
thin stratus
#

You are probably using GetPlayerXYZ0 @torn basin

torn basin
#

wdym

torn basin
storm zealot
thin stratus
#

I mean, the answer to that is nothing that is related to SmoothSync.

#

You change the Capsule via the Crouch functions through the CMC, so it's properly predicted.

#

I don't use SmoothSync.

thin stratus
#

If you fall back to the Server in your code, then it's usually due to that.

grave notch
#

Where should i "start/init" my game, after all players connected? I'm doing that currently in InitNewPlayer (i check Number of players), but i can't really do everything i want, because character for last new player doesn't exist yet, only his player controller, how should i wait for a character or where else should i init my game?

wary ermine
#

@thin stratus one last question again πŸ˜„
Am i going in the right direction? How do I set it up to be the right player controller?

#

sorry for the noob questions xd

thin stratus
#

There should be a version of that big Subsystme node that takes an input

#

You gotta connect that to the NewController input of the PossessedEvent

#

You don't need the GetPlayerController node.

#

The Character spawns once for each player and the Possessed Events calls individually inside of each other them for their respective controller.

torn basin
#

honestly im not entirely sure

#

i feel like my code is just jank and im stupid

thin stratus
#

Cause that will often happen.

#

Read the error and tell me what you think you gotta do.

wary ermine
#

a mismatch of the object reference let me see if i can figure it out and i will report back 🫑

thin stratus
wary ermine
#

controller and the enhanced input wants a player controller

thin stratus
wary ermine
#

unfortunately no but im googling πŸ˜„

#

i suppose the controller is input and the player controller is the pawn?

thin stratus
#

In this case, the naming could give it away

#

Nope

#

They are both Controllers. None of them is Input or Pawn.

#

APlayerController is a Child Class of AController. A more specialized version for Players. (There is also AAIController, which is the AI version of a AController).

#

Do you know how to get from a Parent Class to any of its more specialized Child Classes?

#

Also this is all just the Type. The Data that the "NewController" pin points to is the same. The Engine/Code just doesn't know that it's a APlayerController (this could also call for an AAIController after all).

wary ermine
#

no unfortunately not, so the player controller is the child of the controller parent that comes out as "new controller"?

thin stratus
#

NewController

#

To go from Parent to a Child Classes (doesn't have to be a direct child), you use "Casting"

#

So here you'd cast NewPlayer from AController to APlayerController.

wary ermine
#

ahh i have casted before to communicate from one bp to another

thin stratus
#

It doesn'T have much to do with communication.

#

It's bascially just a Type Test

#

If whatever you cast to APlayerController is not of that Type (or a Child Class of it), it will fail.

wary ermine
#

I see, so when you say AController or APlayerController is that a specific class that exist that i can find in the search or is that just a name? Sorry for the dumb question, Appreciate your patience and that you actually teach me πŸ˜„

thin stratus
#

They are both native Unreal Engine Classes. They count to the "GameFramework" and are very much the core of Gameplay related code.

#

You can totally find them either in the Source Code, in UE's Documentation and API or even via Google.

wary ermine
#

so when i cast does it also count in the second player controller that gets dynamically created by the Create Local Player or do i have to take care about this?

#

or rather how do i cast to that player controller that will get created on start

thin stratus
#

You don't Cast to a specific Instance

#

Casting only tests for the type.

#

Casting NewController to APlayerController only changes the type (if it is an APlayerController).

#

It doesn't alter the Data/Instance.

#

And no, you don't need to handle the SecondPlayerController, because that one will also call Event Possessed for its own Character.

silk nexus
#

Mine is even worse, most likely

#

You're likely running into an issue with replication, since you have 2 players and are not likely using local Co-op

#

Got any screenshots of the collision logic?

torn basin
#

uhh well i kinda just ripped everything

#

and im figuring it out on my own

#

it got worse

silk nexus
#

Logic?

torn basin
#

none left

#

:(

thin stratus
wary ermine
#

Cedric I am really sorry I havent still figured it out.
I am now casting to the player controller and the inputs work on my first player.
So somethings that I can think of that can be the issue:

  • I create the local player in the level blueprint (spawn player controller checked), its the default player controller that is in the project settings
  • I use the same thirdperson blueprint to spawn the second player (I dont even know how I could set up another one but thats fine because I can swap out the mesh for the second player)
  • I am using two generic usb controllers, I thought maybe the issue could be the setting in the game mode project settings which skipps assigning controllers
#

Actually funny enough the second IMC also works right now on the first player in the splitscreen πŸ˜‚

thin stratus
#

Lemme think for a second. I kinda ignored the fact that you would try to do that.

#

I only had one IMC in mind

#

But if you need different keys for the two players, then that would make sense.

wary ermine
#

I use two sets of dance mattes which are cabled to a board which is a generic usb controller so i get digital buttons πŸ˜„ I am sorry maybe I should have said that before but im also a bit lost ^^

thin stratus
#

But aren't the two IMCs identical in setup?

#

Or do you have different buttons set on the entered IA?

wary ermine
#

yes except for the buttons which are being triggered

thin stratus
#

Oh, so they do use different buttons.

wary ermine
#

yes different IAs for different buttons

thin stratus
#

Can you show me the two IMCs for a second? With like a few entries expanded?

wary ermine
#

sure

#

one sec pls

thin stratus
#

Okay so

#

Just fyi, that setup is 90% fine

#

The 10% that are wrong is that you use two different IA I think.

#

You can use IA_Left for both, and just apply different Keys (like you already do).

#

The different entries can have their own Rebind Settings, where you can split between P1 and P2 again if needed.

#

But I don't think you need to have duplicated IAs.

#

For the IMCs, we need to figure out how to apply them in Possessed based on which player that is. Let me think for a second

#

The quickest and dirtiest version would be:

  • Remove one of the Add IMC nodes.
  • Drag the Mapping Context pin onto the EventGraph and search for "Select".
  • You should get a node with 3 pins, 2 for the two options, and the third being a Wildcard.
  • Add the GetPlayerController(0) node and use an == Node on the casted Controller result.
  • Connect the Bool result of the == Node to the Wildcard of the Select node.
  • Assign the 1P IMC to the True Pin of the Select Node and the 2P IMC to the False Pin.
wary ermine
#

I will try this and report back

thin stratus
#

Ultimately, that's a bit mΓ€h, but I don't have a better solution atm.

#

at least not for BPs

wary ermine
#

Danke!

thin stratus
#

There isn't really a list of PlayerControllers that is properly mapped to an Index (where 0 is the first player). Even the GetPlayerController(0) node does all sorts of tests to find the proper one.

wary ermine
#

i think i got the setup right, i also tried to set imc p2 as true to just check, either way only the first player controller 0 has input

dark parcel
#

That's not gonna work? On possesed called on server

#

you will be calling that node on the controller in the server

#

pretty sure you want a client RPC

wary ermine
#

its a local splitscreen but i dont know im lost πŸ˜„

upbeat basin
#

I'm using a repliacted array of structs where the struct has 2 actor pointers in it. When the array's OnRep function triggers, sometimes the actors inside are null since probably they're just spawned and array's replication received before the spawned actor. Is there a way to ensure or get notified when the actors inside the struct are replicated as well?

dark parcel
#

oh...

chrome bay
wary ermine
#

here is also the level blueprint of how i create the 2nd player

#

funny enough here i get also the player character to swap the mesh and it works

wary ermine
thin stratus
#

No

thin stratus
#

To see if it properly prints the two

wary ermine
#

it did print both imcs

upbeat basin
wary ermine
chrome bay
upbeat basin
#

I see. It's nice to know that it should fire OnRep agaion on that condition, thanks. I'll player around a bit more to see what's the problem

thin stratus
wary ermine
#

but doesnt work unfortunately

thin stratus
#

Yeah I mean that does the same we are doing, just a lot worse xD

wary ermine
#

im a failure 😒 πŸ˜‚

thin stratus
#

You can use showdebug EnhancedInput to check if the IMCs are applied to the right player iirc. And also see if they are being pressed.

#

If the First Player gets IMC2, does the key they need to press change or so?

#

Cause otherwise that's a bit strange. Are you adding the IMC anywhere else too by chance?

wary ermine
thin stratus
#

There is a boolean in the project settings or editor preferences to route input to the first player gamepad instead of keyboard

#

Are you using that?

#

With PAGE UP/DOWN you can select the other one

#

To check if that one has teh IMC2

wary ermine
# thin stratus With PAGE UP/DOWN you can select the other one

just p1 has controlls, but i just turned on the boolean you mentioned, because i had turned it off when i switched over to the enhanced system. funny enough i had control with the keyboard for p1 and the controller that is supposed to control p1 controls p2 xd

thin stratus
wary ermine
#

but its a bit confusing because of player are running on the same tiles aswell and are just visible to their own cameras

thin stratus
#

Eh, EnhancedInput debug doesn't update properly

#

sigh

#

can you try rerunning the command while the other player is selected

#

Yeah annoying, the debug doesn't update to point toe PC 1

#

The EnhancedInput part of it

#
if (HUD->ShouldDisplayDebug(NAME_EnhancedInput))
{
    FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager;
    DisplayDebugManager.SetFont(GEngine->GetSmallFont());
    DisplayDebugManager.SetDrawColor(FColor::Yellow);
    DisplayDebugManager.DrawString(TEXT("ENHANCED INPUT"));
            
    // TODO: Support paging through subsystems one at a time (via console? key press?)

    // Show first player only for now
    TObjectIterator<UEnhancedInputLocalPlayerSubsystem> FirstPlayer;
    if (FirstPlayer)
    {
        FirstPlayer->ShowDebugInfo(Canvas);
    }
}
#

......

#

as if anyone will fix that, Epic..

wary ermine
#

πŸ™ˆ

thin stratus
#

Can you try WorldSubsystemInput instead of EnhancedInput?

#

For the show debug part

wary ermine
#

yes

thin stratus
#

Hm that's stil lthe same somehow

#

In code it shows something else

wary ermine
#

might this issue come from that i am basically having "one" controller?

#

and i am trying to use different buttons of that controller?

#

basically one device

thin stratus
#

Could be?

#

Not sure tbh

#

If you can control the individually when turning off the boolean and using the keyboard and the gamepad, then that could be an issues yeah

wary ermine
#

i could control them individually when i turned on the setting, however it used the wrong imc for player one and they keyboard for the second one πŸ˜„

compact flame
#

This does not seem to be getting the right value the client does not get the character that grabbed print string on client says 0 when the other players like player 1 is grabbing it

pure summit
#

I have a bug where, if I set a JumpMaxHoldTime while JumpMaxCount is greater than 1, the server randomly performs an additional jump.

I can do a single jump, wait to land, and then jump again. The bug triggers once every 10 jumps, but on the Steam Deck as the client, it triggers once every 2 jumps.

I don't know how to fix this, can anyone help?

These are my logs. The last two lines shouldn't have happened.

LogBlueprintUserMessages: [ABP_Hero_C_0] Server: Idle
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: ActivateAbility 
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: ActivateAbility JumpCurrentCount 0
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: ActivateAbility Can Jump
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: Jump
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: CheckJumpInput JumpCurrentCount 1
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: ActivateAbility 
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: ActivateAbility JumpCurrentCount 0
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: ActivateAbility Can Jump
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: Jump
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: CheckJumpInput JumpCurrentCount 1
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: InputReleased Jump released
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: End Ability
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_0] Client 0: StopJumping
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: End Ability
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: StopJumping
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: Jump
LogBlueprintUserMessages: [BP_2DPlayerCharacter_C_1] Server: CheckJumpInput JumpCurrentCount 2```
pure summit
# pure summit I have a bug where, if I set a JumpMaxHoldTime while JumpMaxCount is greater tha...

This is the callstack

     UnrealEditor-Skeleton2D-Win64-DebugGame.dll!AS2D_BaseCharacter::Jump() Line 213    C++
     [Inline Frame] UnrealEditor-Engine.dll!UE::CoreUObject::Private::OnHandleRead(const UObject * Object) Line 118    C++
     [Inline Frame] UnrealEditor-Engine.dll!UE::CoreUObject::Private::ResolveObjectHandle(UE::CoreUObject::Private::FObjectHandlePrivate & Handle) Line 230    C++
     [Inline Frame] UnrealEditor-Engine.dll!FObjectPtr::Get() Line 110    C++
     [Inline Frame] UnrealEditor-Engine.dll!TObjectPtr<ACharacter>::Get() Line 606    C++
     [Inline Frame] UnrealEditor-Engine.dll!TObjectPtr<ACharacter>::operator->() Line 625    C++
     UnrealEditor-Engine.dll!UCharacterMovementComponent::UpdateFromCompressedFlags(unsigned char Flags) Line 12792    C++
     UnrealEditor-Engine.dll!UCharacterMovementComponent::MoveAutonomous(float ClientTimeStamp, float DeltaTime, unsigned char CompressedFlags, const UE::Math::TVector<double> & NewAccel) Line 10226    C++
     UnrealEditor-Engine.dll!UCharacterMovementComponent::ServerMove_PerformMovement(const FCharacterNetworkMoveData & MoveData) Line 9641    C++
     UnrealEditor-Engine.dll!UCharacterMovementComponent::ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer & MoveDataContainer) Line 9541    C++
     UnrealEditor-Engine.dll!UCharacterMovementComponent::ServerMovePacked_ServerReceive(const FCharacterServerMovePackedBits & PackedBits) Line 9514    C++
     [Inline Frame] UnrealEditor-Engine.dll!ACharacter::ServerMovePacked_Implementation(const FCharacterServerMovePackedBits & PackedBits) Line 1762    C++```
mystic estuary
#

Has anyone tried to mix AI character movement with CMC and root motion? I want slow walking movement to be ruled be the root motion, and have running managed by the CMC

gray sparrow
#

i have this wdget on the left side... but when i go over with the mouse another widget blocks it.

#

how can i make that one widget dont block the other widget... on mosue event?

mystic estuary
#

You might want to try #umg

wary ermine
#

@thin stratus hi there, you said before i can use one imc and bind it, any tipps where i do find this binding feature?

thin stratus
#

I said 2 IMC, one IA per Input for Both (shared)

#

And the binding part was rebinding

wary ermine
#

ah

#

im so tired i even read bad

#

thx!

#

i think i figured out the problem @thin stratus

#

i had implemnted this video https://www.youtube.com/watch?v=QSnUqHF6X0M

Tutorial on how to get split screen local coop working in UE5.1 & UE5.2
A UE5.4 UPDATED example is provided to patreon members https://www.patreon.com/posts/108483497?pr=true
Patreon - https://www.patreon.com/WildOxStudios
Blueprint Example - https://blueprintue.com/blueprint/89dbnxix/
UE5.4 Fixed Skip Player 1 Bug - https://www.youtube.com/watc...

β–Ά Play video
#

and as you suggested to my question indeed it needs two controllers to be connected

wary ermine
#

yep, now skipping the gamepad for p1 also allows p2 to use the correct inputs while p1 keeps the keyboard alt settings from input for p1. i think before i had done something wrong or had the wrong buttons maybe. Anyway thank you very very much @thin stratus for all the help and thank you for actually teaching me! Appreciate it a lot!

sinful tree
# compact flame This does not seem to be getting the right value the client does not get the cha...

There shouldn't be any multicasts involved here.
Player Input > Run Trace > Send RPC to Server with Actor they want to interact with > Server Validates if actor can be interacted with (within range, etc) > Server calls Interface > Server performs logic to have client "pick up" the object.

You can't call RPCs from clients on the GameState - those events you have on the GameState shouldn't be marked as Server RPCs.

You should avoid using any kind of "index" for referencing players. Pass along the reference to the player's character, playerstate or playercontroller. On the server with one of these references, you can get the other 2 so anything you may need to use you can get without using the "Get Player Character X" kind of nodes.

lament cloak
#

So I'm building a server authoritative kinematic vehicle from scratch. In other engines I'd do most of the work in the physics tick so that things are computed mostly the same between client & server.

I know there's the Async Physics Tick, but last time I used that I'd get a crash modifying things directly such as the actor's transform, which I will need for this.

What I'm mostly concerned about simply using Tick is FPS drops throwing off the simulation. Is there a way to do this with the Async Physics Tick?

#

Curious if anyone here has done any character/vehicle stuff from scratch without using the built in character movement component or rigid bodies

Edit:
Hmm I guess all I really need to do is be able to do sweep tests in the physics thread and I can manage position, rotations and velocities in a thread safe manner

dark parcel
#

The client have to inform the server of what changes.

The tip here is the only way for client to communicate with server is through server rpc

#

Read the pinned source few more times

#

On tick -> send server rpc with transform as the param and let the server set the transform variable (mark the variable as replicated)

#

On tick for proxy characters, interpolate to the target transform

dark parcel
#

Multiplayer takes a while to understand but reading the pinned material over and over will show you the way imo.

#

You should never guess, just understand the theory then attempt to implement. Fail and repeat until you get it.

sour cradle
#

Have a question. All seems to point to "It wont change" however I want to make double sure. Does the "PlayerID" from Player State Remain persistent in a multiplayer session or will this change over time?

teal frost
#

Nvm found the original comment

#

Might not be much help cause I have 0 experience with VR stuff. But...
Couple of things i can think to check off the top of my head

Are the necessary actors/components themselves set to replicate?

Are they also set to replicate movement?

What are you actually doing to set these relative variables in the code above?

dark parcel
#

You don't need multicast here, simply set the variable on server

#

Mark it as cond skip owner so you don't get old value in client that is sending. That or when updating filter with is locally controlled

#

It's actually just the basic of multiplayer. If you are not advance in blueprint or know cpp, multiplayer might be too early for you.

Replication is the least problem to tackle when it comes to multiplayer.

#

Also 90% of multiplayer tutorial in youtube is either bad or plain wrong.

Tldr not the best place to learn mp. For a start stop using multicast for anything that needs to be in sync

fluid prawn
#

Has anyone have a good explanation for what the packagemap is?

grand kestrel
kindred widget
# fluid prawn Has anyone have a good explanation for what the packagemap is?

Dug this up from a site I can't even seem to preview correctly. So also pasting the contents.

Package map
The package map is a collection of packages that need to be available on all clients in network games or during demo playback. The package map is commonly referred to as "ServerPackages", although the ServerPackages list doesn't contain all packages that are added to the package map.

Adding to the package map
The package map generally contains packages from two sources. One source is the level package currently being played. That package and all packages it requires (mostly textures, sounds and meshes, but also classes) are automatically added to the package map, because the level would otherwise not be playable. The second source in Unreal Engine 1 and 2 is the ServerPackages list in the [Engine.GameEngine] of the main configuration file. All contained packages and the packages they depend on are added to the package map as well.

There's one exception, packages marked as serverside-only will not be added to the package map, because they are not supposed to reach the client. As a result, packages the client requires must never depend on a serverside-only package.

Packages in the package map are usually downloaded to the client's cache folder, if the client doesn't already have the package. If, however, a package is not marked as allowed to download (which all packages are, unless the package flags are explicitly changed), the client will not be able to connect to the server unless the package is already installed.

#

Dynamically adding to the package map
Starting with later Unreal Engine 2, packages no longer need to be added explicitly through the ServerPackages list.

In UT2004, packages can be added at map startup via AddToPackageMap(). This function can only be called while the GameInfo's bScriptInitialized property is False, i.e. before the GameInfo's SetInitialState() function runs. That means, mutators and server actors should call it in their [Pre/Post]BeginPlay() events. Mutators automatically do that if their bAddToServerPackages property is set to True. For some reason AddToPackageMap() does not have any effect on demo recording, so to get proper demo files, the packages still need to be added to the ServerPackages.

In Unreal Engine 3 all loaded packages on the server that are not marked as serverside-only are added to the package map. This even happens at runtime, potentially causing mid-game package downloads when the server calls DynamicLoadObject().

chrome bay
#

I think that's mega-old info to be honest, all it's really used for now is to link up network GUID's I'm pretty sure

thin stratus
#

Yop, more specifically the UPackageMapClient.

#

The Info above could even be considered wrong? Idk. On the Server, each Client has a UPackageMapClient instance, and that thing basically handles the initial replication of a UObject via NetId and Path, and then later just the lookup for the NetId if the UObject is already known.

#

That freaking thing is also the reason I lost days on The Ascent trying to figure out why after multiple ServerTravels the damn Enemies stopped spawning on Clients.

#

Server: "Oh yeah, you should know the NetId of this, so I'm only gonna Serialize and send that."
Client: "The f*ck is this. Can't spawn. Bye!"

kindred widget
#

Always neat to see how the engine has changed over the years. πŸ˜„

storm zealot
#

Greetings, weird solutions is here

I created custom crouch for multiplayer, but want to remove those "jumping" on changing capsule height

And yes, we do it on multicast

(nope, I cant use default unreal crouch because we dont use Movement Replicate, and using Smooth Sync instead)

cobalt notch
#

Is InputComponent only processing input events on the client, so does it do anything on the server too?

dark parcel
#

You can test with print string

cobalt notch
#

Does AI controller send inputs or anything like this on the server? Does the server pawn have inputcomponent?

dark parcel
#

All of A.I is server only

cobalt notch
#

I know those things I'm wondering if Inputcomponent does anything on the server. if it exists then why.

dark parcel
#

I haven't touch A.I but why do you need input on them?

cobalt notch
#

I'm just trying to figure out how the multiplayer works, if the server pawn has inputcomponent what is the reason for this or it dosen't have inputcomponent on the simulated proxy for the player pawn?

prisma osprey
#

Hi! What are things hard to replicate? I'm on my first pj and I heard a lot of people saying better avoid multiplayer for beginners, perhaps there's stuff who are easier to replicate, I'm not going to do a shooter game, I'd like o have friends/people who can interact with stuff on same map, and every player have his own stats + items collected, is that stuff hard to replicate?

dark parcel
cobalt notch
dark parcel
#

Each player need to set their mapping context to w.e pawn they posses

cobalt notch
dark parcel
#

They don't.

#

U simply only care about your own input

#

As the player

cobalt notch
#

Does the camera need to be on the server?

dark parcel
#

@prisma osprey replication is the easy part when it comes to multiplayer. Turn based game is many times easier or any game that doesn't depend on latency.

#

You can start trying to replicate a simple variable across all machine. E.g bool or integer then doing a door in multiplayer.

#

You will hit some limitation when it comes to bp only tho, so just be ware of that.

cobalt notch
#

Pawn Camera isn't doing anything on the server either.

dark parcel
#

You can have camera on server or on client, you can use it, you can not use it. It's all up to your design

#

Do you need to know other people camera? No? Then no need to replicate it

cobalt notch
#

Nah do not need other people's camera. I do not think I need pawn camera on the server. Aside from camera traces maybe will need to be on the client then.

prisma osprey
cobalt notch
#

This will open up to cheaters however. I will have to think about this. And maybe I should use the other players camera would be fun to do. However that can be done by replicating the position and spawning another camera on the client rather than replicating your own camera.

dark parcel
#

Once it click it will be fine, the difficult task ain't even that

cobalt notch
# prisma osprey Yeah I bet it's very hard and frustrating

Well if you figure out the basics its not htat hard just frustrating, Gas is an alterantive which is hard to learn but does those things, if its a simple game turn based is easier, just the inventory will be replicated, if you can code in C++, otherwise blueprint has a few limitations but turn based is easy to do overall. Lagging and things like this are an added layer as @dark parcel pointed out if you're making Streetfighter 7.

cobalt notch
# prisma osprey Yeah I bet it's very hard and frustrating

The way to describe it is its actually easy there's just a few rules but it's mind boggling to visualise all that, like each thing you do you have to replicate something then inform the relevant things etc. etc. and make sure it works in all scenarios for client / server etc. Gas takes care of some of this but is a seperate framework to learn. If you have many abilities then Gas is the easier way or making your own framework that does these actions, otherwise it's also a repetitive task doing this for every thing your player does and it varies based on the scenario. Gas handles most of those like adding cooldowns and rules etc.

prisma osprey
dark parcel
#

As to what you need to do, you just gotta learn what you have to learn

prisma osprey
#

so nothing else aside the landscape, can I make it multiplayer later?

dark parcel
#

You make it multiplayer from the start

#

Cpp class can be added to blueprint project

#

That's not an issue

prisma osprey
#

ok thanks!

cobalt notch
#

I did multiplayer in bp but then I threw it away and called it a learning experience.

prisma osprey
kindred widget
#

It's really not that difficult if you break it down into a couple of basics.

#

Abilities: Do something, spawn things, play cues, apply effects.
Gameplay Effects: Affect things, these are damage applications, and regen effects. Buffs and applications essentially.
Cues: Visuals and sounds. These play particles, sounds, etc.

prisma osprey
prisma osprey
cobalt notch
#

Also a lot of effort that isn't reusable like C++ is very reusable as well and blueprints get corrupted really easily like a huge blueprints project is not very reusable.

prisma osprey
cobalt notch
#

Although for one person doing small games C++ is a bit overkill because usually 6 months+ learning curve. Blueprints does everything if you want to make single player. Just some limitaitions in multiplayer. If you do gas boilerplate in C++, you can do most of the real code in bp which is normal but that's still hard to find those resources because most / all people who do Gas are c++ coders and tutorials assume C++.

#

There's Lyra and those sort of frameworks and sample projects but they also need a lot of knowledge or you're limited in how much you can do with them. So you pretty much need to know how to do it anyways. This is why we haven't seen many Lyra games till today. I'm still waiting on one. Maybe there is somewhere out there on Steam. I've seen coming soon games in it though but not very complete.

prisma osprey
cobalt notch
# prisma osprey When I start a project in C++ I get panic all the time when I open the event gra...

I can recommend some courses if you want to learn C++ then be prepared for 6 months to 1 year journey of learning. Otherwise do single player or something really simple in multiplayer which is turn based but then you still need a server, or if you do listen server turn based that can work but you still need to integrate with steam for that. Gas is kind of obsolete already so I implemented it but I might do my own system for this based on the experimental things if I can make that work. I implemented Gas but didn't make any abilities just in case I need to use this someday.

quasi tide
#

Gas is kind of obsolete already
πŸ€”

cobalt notch
quasi tide
#

Gas is very much not obsolete though

cobalt notch
quasi tide
#

Still, incorrect

#

Mover is hardly close to being ready for the masses

#

It might be fine for you and some others after some more tweaks

#

But for mass adoption? Still has some ways to go.

cobalt notch
#

Yeah its not ready for the public. I'm just attempting this. It's not officially obsolete unless they get their act together on this issue. Then Gas, CMC, Character all become obsolete or a choice.

#

It's actually downright broken from what I've seen so far. I'm gonna see how far I get 'cos some people have done fixes here and there etc. I imagine it can work and I saw someone get far too.

#

I'm really hoping someone at Epic sees this and dedicates resources to fixing NPP. πŸ‘‹

quasi tide
#

Mover can be dropped next week for all we know.

cobalt notch
# quasi tide Mover can be dropped next week for all we know.

True but they do have someone working on it and the guys doing the Motion Matching sample said they want to use it too. The issue is it relies on the broken NPP which isn't complete so you get rubberbanding and things like this. Its kind of okay for single player. I just noticed some slight jittering but taht could be the animations in the examples.

quasi tide
#

All of this is clearly saying that both GAS & Character are far from being "obsolete"

cobalt notch
quasi tide
#

That's a take.

prisma osprey
cobalt notch
# prisma osprey Of course! I want one day to start with C++ , I'm always saving for later... st...

Not realy. I'm building a framework which is what I was doing in BP for 6 months and now I'm doign in C++ and will do the game after this. Basically as my knowlege grows I keep refactoring this same code over and over again, this is the third time but I hope i got it right this time. So my code doesn't work after more than a year and I was here asking about something 'cos I can't check this but I got very far, it does most things and I can make any game on this. I threw away my bp project to use Lyra but started making my own after realising that I would need to know how to make it to be able to make Lyra do those things anyways.

#

Also not using Gas simplifies my framework but I have those things as optional now I can switch to either for a game project with all the background stuff implemented. I'm hoping to make a pretty huge multiplayer world for a pirates game once this works. I'm not doing more in Gas if this new system works it will be simpler overall. If it doesn't or they abandon then I'll have to do Gas again and build those things out, otherwise it's twice as much effort. I have to pick current gen or next gen so I'm seeing if I can do next gen 'cos who knows when I will be done. The experimental features maybe normal and more stable by then.

#

My goal is I have various game types that I want to do built in and I just add the characters and data and it does everything already. Then I can do a bigger game or several games on the same platform. At hte moment i'm just doing the Pirates thing which is gonna be team vs team or open world but eventually I can have various modes for games & maps and mini games etc.

prisma osprey
#

First thing I asked on discord somewhere about the engine was about how to make and reuse stuff? Looks like it's impossible πŸ˜„

cobalt notch
#

No it just requires some knowledge, this is why I'm refactoring for the third time and some of the new features enable this. Right now I'm able to do this already all the data is seperate. I can just create any game on this but I have to build that support in the background if I want to do more variety of game types. I do not intend to sell it so its just to support whatever maps I may need like what if I need the pirate to suddenly be on a zeppelin 'cos he's dreaming of the future fantasy.. then I can just activate that sort of mode or use that in a mini game or a full game. It's also a bit easier to do this with the experimental things rather than the old school things 'cos character movement is depending on Gas and character class and capsule etc. all tied together. All the new things are a bit more modular and a bit easier to extend.

prisma osprey
cobalt notch
cobalt notch
# prisma osprey Looks great, congrats!πŸ’ͺ

In this you can see even the platform has many components. This time I'm getting rid of those components and making another architecture. Before this I had everything in the character which got too complicated. This works but it's also overly complicated, the player has 19 components lol and now I'm simplifying it all, then done.

thin stratus
#

You'd need to run both the Mesh Offset and the Capsule HalfHeight changes on the same Timeline.

#

Also, with your "Multicast" setup, you might want to test if that even properly replicates to Hotjoining people.

#

(or ones that come into relevancy range)

#

@cobalt notch Having used NPP and Mover the past few months for a big title, I can tell you: Characters, CMC and especially GAS (which has nothing to do with Mover?!) will not go away.

#

They did add a new AttributeSystem for Mover, which I didn't have a look at yet, but that's absolutely not relevant to GAS.

#

We have a Project Level version of both NPP and Mover, which is heavily modified to add lots of missing features, fix lots of bugs and crashes and more.
It will take months before this is even remotely ready, given that we already spend months on improving it and them moving a lot slower.

#

They are also heavily looking into Chaos driven Movement iirc, so NPP and Mover might really be dropped at some point.

#

Even for people who are months away from shipping I would not suggest using NPP/Mover.

cobalt notch
thin stratus
#

We replaced the previous CMC setup with it and I don't think there are any plans on going back to it.

#

The only reason we even went that way, iirc, is to have more than one Simulation running alongside the Movement one in FixedTick.

#

Which CMC doesn't offer.

cobalt notch
#

I was told Gas uses the CMC networking so it's not compatible with Mover / NPP. Maybe if your project supports Gas this would add complications and require fixes etc.

thin stratus
#

GAS and CMC don't share any networking.

#

CMC sends an unreliable ServerRPC every frame with Input and final location.
Server receives it, performs the same move and comapres the final location.
Then either acks or rejects the move, sending a correction.

GAS doesn't do that, GAS uses PredictionKeys and single RPCs to communicate.
One usually only sends data when needed, e.g. when activating an Ability.

#

NPP in IndependentTick mode is basically the same as the CMC, minus the correction sending, as the Server just replicates back to the Client and the Client then checks if it has to reconcile locally.

#

Which is why GAS, not being able to tie into CMC, also can't tie into NPP (Mover).

#

Which is why they pushed a MovementModifier commit for Mover.

storm zealot
thin stratus
#

You can probably bridge this somewhere. Which is also what a lot of people do to get CMC and GAS into co-existance.
They send the info to Start and Ability via the CMC. So that it starts on Server and Client in the same CMC frame.

#

But you'll quickly notice that this is not the problem that breaks things.

#

The problem is the rolling back.

storm zealot
thin stratus
#

If CMC gets a correction (or NPP fwiw), it would need to know about the GAS state of each Frame, which doesn't exist.

#

So when rolling back moves, the moves use up to date data.

#

Example would be if you are stunned for 3 Seconds and afterwards get a rollback, the rollback will happen without the stun, cause that laready ran out.

#

And NPP doesn't solve that.

thin stratus
#

Every "frame" that you shrink the capsule by x, you gotta move it x / 2 upwards.

storm zealot
#

Capsule === actor character in this case? (because capsule is a root)

thin stratus
#

Yeah the Character World Z fwiw

#

If you reduce the halfheight by 10 (so the full size by 20), then the character will float 10 units above the floor.

#

So you gotta also move it 10 down again.

#

Which is what the CMC does when crouching while walking.

#

And at the same time you need to also offset the Mesh 10 upwards.

storm zealot
#

But how to do it properly insinde timeline? Thats not relative positions, but world - so Im little bit confused

thin stratus
#

Shouldn't matter

storm zealot
#

I have strong feeling that I doing it wrong)

thin stratus
#

You can't take the current location each frame

#

You gotta save the location as a starting location

#

Or the Z at least

#

Before you start the timeline

#

Otehrwise, second frame, Z will be the updated version

storm zealot
#

Prep a varivale before timelinne node?

thin stratus
#

Yeah, a float for the Z

#

I gotta head out now. Just in case you wonder why I don't answer.

storm zealot
#

Thanks!)

#

Thats strange, but character wont change location(

opal pulsar
#

It’s used for clients when networking and addressing uobjects through their guids

kindred widget
#

Neat, tag the person who originally asked. There were replies after this as well they've probably also already read.

storm zealot
#

also I tried woth World Offset, same result

storm zealot
#

Even immidiate variant withput timeline didnt work(

storm zealot
thin stratus
#

Ah it's 56. Couldn't read it on phone

storm zealot
#

yep, they the same

I use the same Lerm node values

#

But character didnt changes his Z for some reason

thin stratus
#

If the character doesn't change location then maybe something else is overriding it

#

Idk how smooth sync works

storm zealot
#

Smooth Sync can break it somehow?

#

and nobody in the world will know how to deal with smooth sync, Im going to cry in my cave

but anyway thanks for help!

Now I need to create a bad solution to prevent this thing happens

crude coral
#

is there anyone want to test with me my multiplayer mobile game ? ( the game uploaded in googleplay store )

real ridge
#

Hello I have one problem for some reason My overlap event on my bomb is not executing on Server , only on client i have same overlap on my bullet and it is executing on server and client too, problem is that server call for damage is not working for bomb in multiplayer because its not called there

#

there is this function but when i hit target it never does damage , on the other event any damage is never executed

teal frost
real ridge
#

yea mistake hit event

#

apply damage ? i had it but didnt work I show u

#

the problem is even i put debug on event hit

#

its showing execute only on client

#

not server which is weird

#

it should go client then server or flipped

teal frost
# real ridge its only like this on client

Right click, type custom event, create custom event.
Name it
Compile
Click the event, set replication to server.
Connect your code to that event instead of on hit

Drag from on hit, type the name of your custom event.

Now your code is run on the server.

real ridge
#

i know this, tried not working heh πŸ˜„

teal frost
real ridge
teal frost
sinful tree
#

You shouldn't need to send an RPC to the server in order for it to detect a hit or collision

#

This also is bad form as having an RPC open like that for something like this means a client could potentially call that event at any time when really it's probably just the server that needs to detect it.

real ridge
sinful tree
real ridge
#

I am just thinking that maybe bomb is not moving same on client / server, but when I tried play as listen server it was moving.. same so i am lost now πŸ˜„

sinful tree
#

What is "Bomb" anyway? A mesh?

real ridge
sinful tree
real ridge
#

i think I should start whole blueprint from scratch i am just finding mistake in mess πŸ˜„

sinful tree
#

Try just placing this object in the level and walking into it, see if you get the collision

real ridge
#

okay i can fly in it i have planes there i will try

lusty aspen
#

@chrome bay tried using NetSerialize, which should work based on my limited knowledge, but i'm not having luck with that either

chrome bay
#

In almost every concievable case, you're better off just using an array of structs

#

Not 2 arrays, that's dumb IMO

#

Just make the "key" part of the base struct

#

Add an == overload, ez

#

Replicating a TMap is by far the least efficient way to transmit the data.

#

If the array is small, linear search will be faster anyway. If the array is huge, then use Fast Array and build your own TMap of keys->structs locally if you want to perform non-linear searches.

lusty aspen
#
struct myStruct {
    int key;
    FString value;
    bool operator==(const myStruct& Other) const {
        return key == Other.key;
    }
};


UPROPERTY(ReplicatedUsing=OnRep_MyReplicatedMap)
TArray<myStruct> myReplicatedArrayMap

TMap<int, FString> myReplicatedMap;

void OnRep_MyReplicatedMap() {
    for (myStruct myStructElement: myReplicatedArrayMap) {
        myReplicatedMap.Add(myStructElement.key, myStructElement.value);
    }
}
#

is this what you mean?

latent heart
#

I would implement operator==(int OtherKey)

#

So you can just compare keys.

lusty aspen
#

just made an edit. like that?

latent heart
#

Hmm. I don't like the idea of a == not actually fully comparing the parameters πŸ˜›

#

Also you should empty the map and reserve it with hte array size.

lusty aspen
latent heart
#

So you don't have lingering values.

nova wasp
slim jay
#

I have a character and a vehicle. When the character enters the vehicle, they possess it. However, if the player exits the game while in the vehicle, the vehicle gets destroyed, leaving the character floating in the air. I want only the character to be destroyed while the vehicle remains. I tried unposses car and destroy character in player controller end play event but did not work

cobalt notch
slim jay
cobalt notch
cobalt notch
# slim jay this is dedicated server

Still doesn't make sense? Where will the vehicle exist without the game world on the Server?! Why are you ending the game if you want to keep playing?

modest crater
slim jay
#

You can think of it like in PUBGβ€”when you die or exit the game, the vehicle remains in the world for other players to use

modest crater
cobalt notch
#

Oh you need to prevent the vehicle from being destroyed. See what's triggering this.

#

You need to unpossess before this vehicle destruction happens and prevent it. Maybe do a breakpoint in vehicle->ondestroy and see what's triggering this and if you can hijack it to unpossess the character before this. Maybe someone else has a better answer.

#

Or you can just probably do this unpossession check in the GameModeBase? Check if the vehicle has a character for this player and unpossess the vehicle etc.

slim jay
#

I'll try thank you guys

merry wyvern
#

IS there a way to use Old Black Ops 2 server that someone is host

modest crater
#

Yes, a primary asset id is just the name and type combined

slim jay
modest crater
slim jay
nova wasp
#

BP breakpoints can be fickle... Make sure you have an active object selected I guess

#

I'm not sure if they only trigger for the selected objects or if having no object selected has the first breakpoint trigger

slim jay
nova wasp
#

Once you have logged out, you might not have a pawn

plucky pewter
#

Questions: Are any of you all working on multiplayer projects that use a dedicated server?
Is it possible to, not build but, design a game using only blueprints for server logic?
If you are taking this approach what are you or your team doing to separate logic that only the server needs to know versus the client?
What does your development pipeline look like?

real ridge
#

guys why is this event not calling on server? i have problem with executing event in MP because this one is calling just client

dark edge
real ridge
#

enhanced input -> server call --> multicast

dark edge
#

Well, show that part of the code. Because your initial message sounds like you're wondering why input isn't running on the server.

real ridge
#

well its kinda mess but when I call this in red circle from begin play everything is playing perfectly bomb is thrown and it hit target then it make damage

#

but when I connect it to enhanced input bomb will fall explode but damage event is not executed on server

#

and i dont do any damage

#

(that line from right side is from event begin play)

lost inlet
#

input actions are only ever called from client, but what owns this actor?

#

though being unable to call an RPC due to incorrect ownership is usually printed to the output log

real ridge
#

I just spawn that bomb attached to plane and then press mouse i am trying to throw it it is replicated etc but unfortunately its not giving any damage, via enhanced input or mouse button left function, when i tested it via begin play its working, when i debugged i saw it is calling on server and client too via begin play but on input and mouse click only on client

#

when I made RPC call for it from mouse input same result no damage

#

idk what to do

normal valley
#

hiya! i am running into an issue using lyra and 5.3. on my packaged builds, it seems like the client is not spawning / connecting after server travel. can only repro in packaged builds
client log:

LogNet: Verbose: NotifyLoadedWorld Begin
LogNet: VeryVerbose: GetFunctionCallspace RemoteRole Remote ServerNotifyLoadedWorld
LogNetTraffic:       Sent RPC: LyraPlayerController /ShooterMaps/Maps/Map_MockUps/UEDPIE_0_Map_A_Early_Access.Map_A_Early_Access:PersistentLevel.LyraPlayerController_0::ServerNotifyLoadedWorld [62.4 bytes]
LogNetTraffic: VeryVerbose: Sending: FOutBunch: Channel[3] ChSequence: 372 NumBits: 499 PacketId: 0 bOpen: 0 bClose: 0 bIsReplicationPaused: 0 bReliable: 1 bPartial: 0//0//0 bHasPackageMapExports: 0 
LogNetTraffic: Verbose: FNetPacketNotify::WriteHeader - Seq 4505, AckedSeq 2567 bReFresh 0 HistorySizeInWords 1
LogNetTraffic: Verbose: UNetConnection::SendRawBunch. ChIndex: 3. Bits: 499. PacketId: 20889
LogNet: Verbose: NotifyLoadedWorld End
LogWorld: ----SeamlessTravel finished in 10.58 seconds ------
LogNet: UNetDriver::TickDispatch: Very long time between ticks. DeltaTime: 0.02, Realtime: 6.37. IpNetDriver_2
LogNet: UNetDriver::TickDispatch: Very long time between ticks. DeltaTime: 10.19, Realtime: 3.84. IpNetDriver_2
LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
LogHandshake: Beginning restart handshake process.
LogHandshake: Ignoring restart handshake request, while already restarted.
LogHandshake: Ignoring restart handshake request, while already restarted.
LogHandshake: Ignoring restart handshake request, while already restarted.
LogHandshake: Ignoring restart handshake request, while already restarted.
LogHandshake: Ignoring restart handshake request, while already restarted.
LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)```
lost inlet
#

you set an owner when you spawn and you can change it after the fact with SetOwner

real ridge
lost inlet
#

Add a breakpoint, is the BombSpawn RPC call on the client called? Is BombSpawnMP called on the server?

#

is BP_ProximityFuseHarpia replicated?

#

are any warnings or errors printed to the output log?

loud heart
#

Hello.
I am trying to block all inbound packets to my game using clumsy.
Is there a way to find my game application's listening port ?

crisp shard
#

when setting a variable on the server does that variable need to be set to replicated in order for that owning client to be able to know? for example, i set a max mana variable upon level up or something and this function is on server and i set the variable accordingly, would i need to have that variable set to replicated in order for the client to be able to use it when checking client side if they have enough mana to cast a certain spell/attack?

lost inlet
#

yes

#

use the COND_OwnerOnly replication condition if you want to only send it to the owning player

slim jay
#

I want the vehicle to remain on the server when I log out while inside it. For this, I unpossessed the vehicle in the GameMode Logout event, but this event is triggered after the vehicle is destroyed, so this solution is not working. Is there any other solution suggestion?

obtuse trellis
#

how can i check if player is listen server or local player?
i just want to spawn actor only once per player, one for listen server and it's pawn and one for client's player. not for simulated proxies.
is locally controlled works for dedicated server but not for listen 😦

kindred widget
obtuse trellis
#

@kindred widgetlocal only, but for listen server IsLocallyControlled returns false. i spawn this actor in begin play and i've heard it might be the reason

kindred widget
#

Are you spawning it in the Pawn?

obtuse trellis
kindred widget
#

That will be your reason then. Beginplay can run before the pawn has been possessed.

obtuse trellis
#

oh, ok then. where should i do it then?

#

@kindred widgeteverything works now, thanks

hoary spear
#

OnPossess^

royal monolith
#

why aren't my players spawning in different locations? this is the logic I used in my player controller

#

it's from the VRE plugin if anyone is familiar

lost inlet
#

woah. looks pretty barebones right now though

lost inlet
#

Why no asset bundles so you don't have to load the meshes?

#

And it's not really a dedicated server question

#

If you want to keep an asset loaded, you need a hard ref to it

tidal temple
#

Hi! I’ve been reading Kaos messages about the Fake Projectile, thanks a lot for the insights! I’m a bit confused right now. I’ve implemented the "Catchup" tick system like in Unreal Tournament, but I’m not quite sure how this part should work.

FRepMovement FakeReplicatedMovement = LinkedFakeProjectile->GetReplicatedMovement();
    
FakeReplicatedMovement.Location = GetActorLocation();
FakeReplicatedMovement.Rotation = GetActorRotation();
    
LinkedFakeProjectile->SetReplicatedMovement(FakeReplicatedMovement);

I expect that SetReplicatedMovement won’t do anything since the FakeProjectile exists only on the client. It seems like that’s what’s happeningβ€”these lines don’t affect the Fake Projectile. Did I miss something?

P.S. Was missing a manual "PostNetReceiveLocationAndRotation" with removed "CatchupTick", thanks anyways!

vapid gazelle
#

Fair to say that Set Visibility is a local change and doesn't automatically get replicated from server to client? Or is there more nuance here?

lost inlet
#

Yes it's local. Replicated components only replicate replicated properties

vapid gazelle
latent heart
#

If I have a replicated struct and that struct has a struct property, does that inner struct replicate per-property as well?

lost inlet
#

Typically you don't replicate mesh components at all

vapid gazelle
lost inlet
#

Yes, component replication requires you to mark properties as explicitly replicated, the same as actors

vapid gazelle
#

Actually on that note, it seems like bVisible is replicated, but in the code I'm looking at, the author still does manual visibility setting on the client.

I checked and it looks like the mesh component is indeed not set to "Component Replicates". Fair to say that because the component doesn't replicate, even if bVisible is set to replicate, it will not, which will require people manually update visibility?

kindred widget
#

So in this specific case. The Actor the Component is on needs to be replicated. The Component itself needs to be replicated, and then the property needs to be replicated. If any of that is untrue, it will not replicate to clients.

vapid gazelle
#

Something I wish I had better understanding of in the multiplayer context is the relationship between Set Visibility and Set Owner No See. It's very heavily used in the project I'm looking at, where the player can switch between FPP and TPP. E.g. these pieces of functionality.

I'm a little puzzled about why the author bothered with using Set Owner No See given that none of these meshes are replicated as far as I can tell, so they could have gotten away with just using Set Visibility everywhere, unless I'm misreading this.

nova wasp
#

if you are possessing a pawn probably have it as the view target

#

which tells the scene renderer everything attached to that actor should be considered for owner see/no see

#

It's a bit of a bad name for the function, it should be NotVisibleWhenViewTarget or something

karmic trellis
#

Hello, I have problem about movements with Listen Server testing -just on client sides-. clients always see their movements and interacted objects movements laggy but test doesnt shown much ping(just around 16-20ms). 2.image is from project settings and 3.image is from players pawn. I just changed this settings with AI suggestions. -btw on one computer testing doesnt have any visible movement issues.-

#

Can anyone help me about it πŸ€”

crisp shard
#

Ex: owning client has to check locally , a variable set by server to fire attack, that variable set to owner only, so it would fire the server event and thus the remaining logic

rustic sable
#

where would be a good place to route authoritative api calls (get / set player data) between a game instance and PlayFab? Seems like gamestate would be a good candidate for this?

quasi tide
latent heart
#

That was my thought, but yeah.

versed hamlet
#

Hey all! Which would be the best way to handle a UI widget in a multiplayer scenario? πŸ€” I’m currently creating it in the player controller, but not sure why the client would get a null result due to an interface message I’m trying to call. Not sure about which kind of reference I should input there. Adding a screenshot in a second :D

latent heart
#

A HUD class is generally a good place to manager interfaces.

versed hamlet
#

this is the player controller event, and thanks for the swift reply :D

latent heart
#

Don't forget to set the hud class on your game mode.

#

Whether it's related to your problem or not is another question πŸ˜›

versed hamlet
#

oh yes, so you suggest me to remove it from player controller and pass it to hud? as far as I understood, hud would generally handle non-interactable widgets, right?

#

nw for the ""off topic"" haha!

#

i'll have to deal with this anyway now or then so I wanted to ask more: assuming that would be an interactable widget, how would I handle this event in the widget blueprint? I'm trying to access my player's reference to handle stamina and things like that in the widget

#

this is what I'm trying to do in the widget, but I can't understand which kind of reference I should input in the GetBPPlayerMaster interface message :(

#

should I even try to access my player character that way?

somber turtle
#

Hello everyone,

I’m seeking some clarity on handling player character selection in a multiplayer lobby setup. I understand the role of various WorldSettings, their replication, and their existence on the Server/Client.

In my current project, I’ve created a simple multiplayer lobby using a custom Lobby_GM. Once all players are ready, I load the chosen level, which uses a different Gameplay_GM. My main question is: where is the best place to store information about the chosen player characters?

From my research, it seems different documentation and examples take various approaches. Some store this information in the GameInstance on the server and have the GameMode use that data to spawn the correct players. Others use a save object, while some avoid using a different GameMode entirely.

What would be the most correct or recommended approach here?

Bonus question: Assuming the process starts from a client's UI (e.g., selecting a character), would it be better to handle the RPC to the server in the PlayerState or PlayerController?

Thanks in advance! 😊

thin stratus
# karmic trellis Hello, I have problem about movements with Listen Server testing -just on client...

If you are using a normal "Pawn" instead of the "Character" class, then you aren't using the Character Movement Component (CMC), which mean you most likely have 0 proper Prediction for the Player Movement. I don't know if Physics Prediction covers any of that, but your game doesn't look like it needs actual physics.

All of that can be faked with a bit of Vector Math.

If you aren't using the CMC, then you'll need to code Client Prediction etc. yourself.

thin stratus
# somber turtle Hello everyone, I’m seeking some clarity on handling player character selection...

RPCs in PlayerState (PS) or PlayerController (PC) make no difference. If your Data is stored in the PC then use the PC, otherwise the PS. If it's stored in both, I would use the PC, cause that's the Owner of the PS. But even if it's stored in the PS, you can still do it in the PC, it really doesn't matter.

About the "how to handle character selection", if you are already in a Lobby, with connected Players, then it's relatively straight forward.
You do need to ensure that you use "Seamless Travel" on your GameModes that the Server Travels from and to.
After that, you can use either the PlayerState's "OnCopyProperties" to move the Data from Old to New PlayerState, or the GameMode's "OnSwapPlayerControllers", to move the Data from the Old to the New PlayerController.

I would further suggest ensuring that both your GameMode_Lobby and GameMode_Gameplay share a Parent GameMode, e.g. GameMode_Game.
Same goes for your PlayerState and PlayerController. That way you can have the variables in the Parent class, and don't need to implement sending/receiving the data in Lobby and Gameplay versions.

I would also suggest you use the PlayerController option to send the data (GameMode's OnSwapPlayerController), because then you can override some of the GameMode's functions that allow you to return a Pawn Class based on a Controller Input, and the Data is usually already available then, which makes the whole thing very smooth.

somber turtle
thin stratus
#

Having a shared GameMode Parent also allows you to easily send additional Settings via the URL with ?Key=Value pairs, which you can then grab from the OptionsString in the same GameMode on BeginPlay for example (better would be InitGame, but that's a C++ thing).

somber turtle
karmic trellis
glacial moat
#

Does anyone know how to fetch WAN IP with blueprints?

thin stratus
#

I wouldn't know if any node that could do that.

thin stratus
glacial moat
karmic trellis
thin stratus
opaque forge
#

Why does voice chat need to be networked separately instead of using the same channels as the rest of the game?

torpid lantern
#

Q: If a RepNotify variable changes while the player is offline. Shouldn't that RepNotify function fire when the player logs in?

opaque forge
#

I believe so

#

Although if the variable changes back, it won't fire

thin stratus
#

UE has Voice Chat implementation. It has a strange "Session" requirement, that can be tricked by adding a fake NamedSession to the Array, but despite that it should work.

opaque forge
#

Then why to online subsystems need to support VC?

thin stratus
thin stratus
#

Even Direct IP Connections should work, if you fake add the Session

#

Not sure why the person who coded that added that requirement.

opaque forge
#

Maybe legal stuff regarding consoles

#

I'm still really confused how the session system works. Do you have any resources on that?

thin stratus
#

Normal docs I guess.

#

Depends on what confuses you about them

opaque forge
#

I assumed a "session" represented your connection to a multiplayer server

#

Is it not?

thin stratus
#

A Session is something that holds information about the Server and the Game.
It holds information about how to connect to the Server, how many and which Players are on the Server, what Map is being played, and all kinds of other stuff you wish to add to the Session Settings.

Sessions are, when created, added to a MasterServer's Database. Most Subsystems handle that for you. E.g. Steam and EOS both have a MasterServer concept. Finding Sessions is then basically done by asking the MasterServer for a Session. Joining it means the MasterServer will add info about the Player to the Session. That's usally communicate via unique Ids (e.g. your SteamID).

#

You can totally connect to a Server without a Session. E.g. directly via IP.

#

You can also join Sessions without connecting to a Server.

#

The JoinServer node in Blueprints actually does both after one another, joining the Session, extracting the conenction URL from it and then connecting.

#

Hope that clears it a bit up.

opaque forge
#

thx

sonic frigate
#

Hey

I have not seen solution for Join Session problem yet.
I use 5.4 and Steam
There is a Menu and Game map

Advanced Find Session can find the host server finally, but when i try to join I cannot travel to the map. It is reload the Menu map.

  • I added DefaultEngine.ini the lines with my own steamappID ,
  • I set MenuGameMode and MainGameMode "seamless travel" = true
  • There is no any other error.

I cant solve it for days.

Any idea what can cause this Client Join Session problem?

thin stratus
#

fwiw, MainMenu GameMode having SeamlessTravel shouldn#t do anything.

#

Caues that's only for ServerTravels and connecting is always a HardTravel anyway.

#

Does the joining of the session fail or the connecting part? You'd need to check your logs for this stuff.

sonic frigate
vapid gazelle
#

Is calling a Server RPC from the server somewhat of an antipattern? Instead, should I be pretty dogmatic about separating branches by HasAuthority and avoiding letting a server RPC itself?

sinful tree
vapid gazelle
sinful tree
#

It's mostly to prevent clients from being able to make requests they shouldn't be allowed to make. Marking something as an RPC is opening the door to the server allowing clients to request the execution. Someone with a little knowhow can force their client to call those RPCs on the server even if you don't have anything within your own code that would call it normally.

vapid gazelle
# sonic frigate Alright I'l check the logs. By the way, On Joined Success is called but after...

The thing that bit me hard in the past when I was trying to get Steam connections work was:

  1. making sure the server opens the level they want to host the game at with a listen option, without which the process will not be open to receiving client connections. Super easy to miss.
  2. making sure I run the game outside of the editor, in a quick build or a fully packaged build, otherwise Steam doesn't seem to work (Stephen Ulibarri's tutorial seems to be the only one to highlight this, Youtube tutorials skip over this entirely IME)
versed hamlet
#

I tried my best today trying to understand something, but I’m still very confused about how everything works: can you suggest me the most basic way to test out things? I’m both confused because of the complexity of the topic and because when playing in the editor, one instance is both a server and a client and I’m not really sure how I should handle that. Thanks!

sinful tree
#

If you're talking about playing as listen server, then it is not both a server and a client, that instance is the server, the other is a client to that server.
If you put a print string on an input and on the player controller, then you should see "Server: Hello" when you press the input on the server's window, and "Client: Hello" when you press the input on the client's window.

It gets confusing because the player controller itself can exist on the server and the client, but they are technically the "same" object. So if you had that same input call a server RPC and made another print string on the RPC, then you would see "Server: Hello" "Server: Hello" when pressing the input on the server, and "Client: Hello" "Server: Hello" when pressing the input on the client. This doesn't mean you're executing on the server's player controller, just the server's copy of the client's player controller.

sonic frigate
# vapid gazelle The thing that bit me hard in the past when I was trying to get Steam connection...

Thanks for the answer πŸ˜‰
Yes, i have added "listen" and i know steam works only standalone if i use editor.

If I start 2 standalone they can join and open level without problem( if no steam)
The problem when two different PC try to join each other- Join is succesful, but when servertravel would happen just nothing happens. 😦

EDIT:
The log says it is TimedoutConnection problem.

I do not know Can I use Steam SDK for achivements but not using any of network part.

viscid tapir
#

Hey! What's the preferred way to move a character from its position to the targeted location in multiplayer like in a moba (LoL, DotA). The simple MoveToLocation() is not networked afaik. I currently do have the target location, I just need a way to move the character using the Navigation system

opaque forge
#

When should I be seamless server travel vs regular server travel?

fossil spoke
versed hamlet
# sinful tree If you're talking about playing as listen server, then it is not both a server a...

Thanks for explaining it to me πŸ™‡πŸΌ spent the last hour breakpointing wherever to understand flow and yes, I now understand what you mean, I hopeπŸ˜†
In a 2 player ListenServer scenario, there would be 4 controllers: 2 are local players and 2 are server copy of it. Or is it that there will be 3, 1 being the Server (Host?) one, and 2 divided into client and server copy of that client?

versed hamlet
#

Luckily AI is just basic attack for now haha

sinful tree
#

In terms of player controllers, you'll have 1 copy on each client, and all of them on the server.
So with a listen server, you'd expect there to be in total 2 instances of player controllers, but 3 that actually exist, one for each player on the server, and one that exists on the client.

versed hamlet
#

Okayyyyy

#

That’s because in the listen server scenario, one client becomes host and thus server, right?

sinful tree
#

A "client" doesn't become the host. They are just the host and are the server.

versed hamlet
#

Alright. My brain was thinking β€œwe all start as clients and then one becomes server when creating a session”

latent heart
#

There's never a client until a second instance of UE is involved.

versed hamlet
#

Ohhhhhhh

sinful tree
#

Before joining a session or starting a listen server up, the game is considered standalone.

versed hamlet
#

I seeeeeπŸ’‘

#

Thanks πŸ™ˆ it was so confusing up to this moment

sinful tree
#

If you start as "Listen Server" then you're forcing one of the windows to immediately start as the server, and having the other window join it.

versed hamlet
#

is it simulating creating a session? I'm super beginner

#

like as both players were clicking ready? or am I comletely on the wrong route?

latent heart
#

A "session" is something kind of "outside" of regular networking. It's soemthing you join that allows you to join the actual server.

versed hamlet
#

hmhm, I guess I'll understand more as I go!

latent heart
#

Like a meeting place to start a game.

versed hamlet
#

ok so when starting the session as listen server I'm "skipping" that part?

latent heart
#

How are you starting a session? Words are important here. You can start a listen server without a session.

#

Unless you don't mean a "session".

versed hamlet
#

I don't know what i mean with session tbh, so thinking about waiting on that topic haha

latent heart
#

If you just mean "I'm just starting a listen server" (because "session" means something else) then, yes, just starting a listen server involves no sessions.

#

If you want to deal with sessions, you need a session plugin like steam or eos.

sinful tree
#

Sessions are a separate concept in Unreal - they act as a means of broadcasting that a game exists through online subsystems that allows players to find and join the game without having to use IP addresses and the like directly.

versed hamlet
#

hmhm, and is a session something that usually precedes what's happening when I click play on ue?

sinful tree
#

No.

latent heart
#

Yes

#

πŸ˜‚

versed hamlet
#

lol

latent heart
#

If you mean play in editor, yes?

sinful tree
#

A session isn't automatically posted somewhere.

versed hamlet
#

yes i mean play in editor

latent heart
#

Do sessions even work in the editor? Last time I checked they didn't. This was like 8 years ago...

sinful tree
#

When you hit play, unreal is creating a server, and then has the client window connect to it. No session involved.

#

They do.

versed hamlet
#

a session doesn't exist if I don't create one, right?

latent heart
#

Correct

versed hamlet
#

but when I create one, I could do something before spawning the players in the level as I'm doing rn, true?

latent heart
#

The PIE stuff kinda skips the session step because any clients that do join automatically just join your server.

versed hamlet
#

that's what I mean and let's hope Datura agrees haha

#

or will be a good point to discuss if not

sinful tree
#

A session doesn't really have anything to do with the game world itself as the sesssion is normally created external to Unreal, therefore, you can do whatever you want after creating a session - you have to actually enforce that who you want as the host to actually move to the level and set themselves up as a listen server before anyone would be able to successfully join that session.

latent heart
#

I guess you can test the session setup without clients. I'm not sure how you'd test actually joining through sessions via PIE.

sinful tree
#

You can start as standalone and have one instance start the session and have the other find and automatically join - at least with the null subsystem.

versed hamlet
#

i'll dive deeper into it! I can't understand that completetly because I'm missing other basic concepts

latent heart
#

Have you ever played CoD?

versed hamlet
#

yes

latent heart
#

Erm, never mind actually. That would just be confusing.

versed hamlet
#

all good! i appeciate it

#

I have another question related to spawning the client character. WHat could be making the server to properly get a ref to the pawn here but then the client can't? Second pic is player controller

latent heart
#

Where exactly is it failing?

versed hamlet
#

in gamemode, IsValid node

#

wait let me see if it works in player controller in facts hehe

#

but it should

#

fails on the return value

#

ah no lel

#

should be fine on that part

#

it won't spawn the right class tho

#

so Server spawns PlayerMaster but client spawns no class, I was trying to print the display name in the PlayerState begin play

latent heart
#

The player state will replicate before the player sends the spawn rpc.

versed hamlet
#

oh I see

latent heart
#

There's a client acknowledge possession or something event, you could try that.

versed hamlet
#

let me see!

dark parcel
versed hamlet
#

could it be this? it's the closest i could get to yours lol

latent heart
#

You could just use the beginplay of the actual character.

#

Or pawn whatever

versed hamlet
#

yes sure, was trying to understand how playerstate worked

#

and like, goot to discover that it runs before the rpc

#

is it because of order of initialisazion?

dark parcel
#

orders are unreliable, don't rely on it

versed hamlet
#

I'm not aware of the order things get created tbh, beginner again :D
I'm assuming
GameInstance>GameMode>GameState&PlayerState>PlayerController>Other things ?

#

and why do you say that those are unreliable? I'm thinking there will always be an order at which initialisation processes happen

dark parcel
#

not strickly speaking about initialization but you should never rely on orders when it comes to multiplayer

#

say you send multiple RPCs at the same time

#

there is no telling which one will arrive first

versed hamlet
#

ah that's for sure, I agree with you

dark parcel
#

some people also do stuff in begin play on their controller, but during that time, the server may not have create a pawn and let the client possess it yet, hence null on controlled pawn when accessing from client.
(not talking about your case, just example)

versed hamlet
#

got you :D

#

next question is, when does a character gets assigned to the playerstate?

#

Automatically on spawn?

#

hence why trying to print on begin play for both characters would bring to a null result on the client side

dark parcel
#

The player state may not be replicated yet

#

everyone running their own instance of the game, running code independently

#

use On_Rep to check when it's value changed

#

I'm newbie so may get this wrong but I feel like begin play is not a great place for mp stuff in many context

#

there's should be events or on_rep you can use before falling back to begin play

versed hamlet
#

I'm noticing a pre-made event dispatcher in the playerstate called OnPawnSet

#

sounds like smth I want to use maybe for this super basic print string thing

#

just to see if things run properly

versed hamlet
#

hm, what should I replicate?

#

but before that I need to understand why a playerstate is not getting the client side pawn

opaque forge
#

What approach would you use to make an HL2-type level transition where actors within a transition volume get moved to the next level, relative to a waypoint
I'm using seamless travel.

brittle ledge
opaque forge
#

wdym

brittle ledge
# opaque forge wdym

Let's say you have a room with a dragon; players defeat them and they move to level 2.
Which is a dark room with a demon in there.
They don't actually need to travel to another -Level-.
You can just put a loading screen, spawn the next room, get rid of the old one; replace the enemies; heal players if applicable or the such.
And that's it! You can have that be synced by pre-loading the assets for the next level as well; no need for a level transition in this very particular scenario.

opaque forge
#

For technical reasons that's not viable

brittle ledge
#

which technical reasons?

opaque forge
#

Well first of all, I'm already using a procedural dungeon generator

#

This likely won't stack well on top of that

brittle ledge
#

How do you want your players to move to a new level? and what would a new level be for your game?

opaque forge
#

Kind of like lethal company

#

There's a "ship" that moves between levels, but the players should remain in the same place on the ship

#

Also, the location of the transition in the levels isn't guarenteed to line up

#

Like if it was a level like Portal and you want them to travel to the next 'level'; you wouldn't need to actually travel to another "Level"
(That's not how Portal does it FYI)

brittle ledge
opaque forge
#

I'm trying to figure out the implementation

brittle ledge
opaque forge
#

That, but also what the best approach to making sure everything stays in the same place within the transition volume, relative to a waypoint

brittle ledge
opaque forge
#

Because the transition volume may not be in the same place in every level

#

Kind of like what info_landmark does in Source

versed hamlet
#

I keep getting errors on the binding of the client player for his widget references...what's the deal here? πŸ€”

#

actually I might just not be creating that in facts

#

no untrue, it's getting created but like idk how to properly manage that

sour dragon
#

Hello, im looking for advice from someone who already implemented and tested the thing i ask about in a real game. So basically im spawning an actor on the server (Melee Class, the Hit logic is inside the actor and also its properties), the Anim handling etc. is done in the character. I predicted the swing and hit logic, but i can't find a reliable way to client predict the equip, since i can only access the actor as soon as its spawned on the server, which means with latency it will always take a while. Whats the approach to client predict the equip animation when the client first knows about the actor when its spawned on the server?

nova wasp
#

Do you spawn a new melee actor for every attack?

sour dragon
#

No, i spawn the actor on hotbar equip, and destroy it on hotbar dequip

#

so as long as its equipped its active and spawned in

nova wasp
#

I don't think you need a replicated actor for something as simple as "a weapon is in my hand"

you only need to send over which mesh is in the hand, and maybe some ID/class pointer to the bp that describes how it looks and animates

#

so for starters I think you are wasting a lot of bandwidth for this even besides predicting etc

#

but that said: you might have some extremelely fancy setup where there is something unique about each weapon that isn't simple enough to describe that way... I still think you could get away with a BP class pointer though etc

sour dragon
#

One sec, i can show you my setup

nova wasp
#

as for predicting stuff it depends on the kind of game you are making

sour dragon
nova wasp
#

why do sim proxies need to know more than just the last two data assets? I think your setup there looks sensible

sour dragon
nova wasp
#

regardless of setup though: do you actually need to server auth the attack?

sour dragon
#

Yes thats predicted already

nova wasp
#

then why the hell don't you predict equipping the weapon?

sour dragon
#

Because of this :

#

I cant access the datatable before its spawned on the server

nova wasp
#

going to need a bigger monitor here lol

sour dragon
nova wasp
#

of course sim proxies must know about it too, but that's besides the point

sour dragon
#

Damn thats exactly what i wanted to avoid

#

Its a bit too decentralized for me, i wanted to shove all Server/Client logic and meshes into one single actor

nova wasp
#

actors are things (well, unreal things), real life is about data

sour dragon
#

Yeah i need to rewrite i guess

nova wasp
#

you can definitely have all of the functions and things inside of the actor but from passed in to a "local only" actor that either takes in predicted data or replicated data

sour dragon
#

I actually used the same model for fp/tp and attached it depending on client or local, as soon as its attached i access the datatable and replicate it to the client , proxies and the server itself

#

DA*

nova wasp
#

also frankly, if this is a co-op game

#

just keep things that are hard to predict auth only

#

I say this having shipped at least one

sour dragon
#

No it runs on a ded.

crimson ore
#

does push model replication really leads to significant performance improvements ? or is it mostly a gimmick?

nova wasp
#

turns out sometimes running code is faster than always running code

#

Iris also probably reduces overhead significantly in bad cases but I have never profiled it

#

of course you can just profile the netcode polling stuff yourself in your own project, if you don't see it pushing the main thread very far then #whocare

prisma osprey
#

@cobalt notch Hi did you ever tried the GAS Companion plugin? Looks very interesting, whats your take on it? There's a part of me saying "Why r you looking for shortcuts, do the work and you'll learn some C++", while the other one "Are you sure that all that information's are needed to create your game? This will put in standby every project for a while..." something like that πŸ˜…

crimson ore
#

its left to us poor folks to overhaul our code base and test one or the other 🀑

nova wasp
#

Changing to iris is a few cvars

#

also it is experimental anyways

#

Also yes, it is your job to make the video game (I assume)

#

and weigh the pros and cons of technical choices like this

tardy fossil
nova wasp
#

FWIW Iris is not as simple as on/off, it will require remaking your custom netserializers and dealing with some subtle onrep ordering differences

#

but if the point is "this sucks, I thought it would be strictly better in all cases" I can understand the frustration

crimson ore
#

also if there are BP accessible variables do they need their own getter setters to mark things dirty on cpp side

nova wasp
#

I'm pretty sure the BP setter marks it dirty... I don't really know exactly as I don't do many replicated properties set in BP

#

If they were only changed in C++ then I assume you have to mark the property dirty

versed hamlet
# thin stratus You need to share more info

Hey, sure thing. The widget is created in Player Controller, which passes a reference to player character in the CreateWidget node.
Now, server works normally, but client looks like it’s going through something that won’t allow the widget to take in his data for like health, stamina and similars. I’m trying to access variables in the binding, and up to this moment I only have the character replicating. I’ll add some pics in a bit, just woke up πŸ™ˆ

#

It works fine in standalone, and I thought about using the validated get in the bindings to delay until data is accessible, but I kinda understood you can’t use delay in bindings(?) I couldn’t see those nodes

thin stratus
thin stratus
versed hamlet
versed hamlet
#

these are the codes, wondering what's the issue :(

#

and this is the binding. Replicated things are because of me trying out stuff yesterday

cobalt notch
# prisma osprey <@469382266137739273> Hi did you ever tried the GAS Companion plugin? Looks very...

I haven't tried Gas Companion. I try to build everything myself and not depend on third party plugins 'cos it complicates things more. If you're gonna try to avoid learning Gas then try to avoid using it too. This means it's not for you at this time. The C++ involved is easy and mostly copy paste boilerplate to set it up and you can do the rest in blueprints but non C++ people are too scared to even copy paste and the rest is just making abilities. Or like use Lyra or some samples it's already setup just make the abilties in blueprint but in a multiplayer game there's a lot more involved than just Abilities. And if it needs many abiltiies than i'ts probably that much more complicated game overall apart from this.. Gas is already a plugin that makes it easier to do multiplayer, so if Gas is too hard then like other plugins on top of this means using cheating to cheat at multiplayer because even cheating is too hard. By this time you have to consider if you're in the right game 'cos all this would be avoided in a smaller single player game.

cobalt notch
# prisma osprey <@469382266137739273> Hi did you ever tried the GAS Companion plugin? Looks very...

Btw I'm still learning Gas too it's just scary, not too hard if you follow along tutorials or courses. If ya can do any coding and know some basics or ready to learn this is very worthwhile because honestly Blueprints become really easy once you know some C++. If you just want to make small games then sticking to blueprints isn't a bad idea for shorter projects but if you're spending a year or two on this game then learn C++ and count this as part of your development time. Otherwise you can go in circles forever chasing every big project idea like a dog chasing cars on foot. If you want to release a game every 6 months then it maybe better to do a smaller game in blueprints focussing more on gameplay and graphics 'cos in C++ land you may go down rabbit holes and start making a plugin one day or attempt to make fortnite yourself just because you can. This would even put your 2 year game idea in jeopardy. For other things I usually just watch some videos and take a few days to understand a system and then implement it myself which usually works out but Gas is just scary. I have bought every Gas course ever but been too busy doing other aspects to make the actual abilities yet.

cloud crown
#

why character snaps while ground detected
it is the phys function from phys flying

#

was stuck here for a long time

latent heart
#

That code'll never execute if your fps is high...

cloud crown
latent heart
#
    {
        return;
    }``` this
cloud crown
#

this is in phys flying function

cloud crown
latent heart
#

Shrug

cloud crown
latent heart
#

```cpp
code
```

#

Those are backticks, not apostrophes.

cloud crown
#
{
    if (deltaTime < MIN_TICK_TIME)
    {
        return;
    }

    RestorePreAdditiveRootMotionVelocity();

    if (!HasAnimRootMotion() && !CurrentRootMotion.HasOverrideVelocity())
    {
        if (bCheatFlying && Acceleration.IsZero())
        {
            Velocity = FVector::ZeroVector;
        }
        const float Friction = 0.5f * GetPhysicsVolume()->FluidFriction;
        CalcVelocity(deltaTime, Friction, true, GetMaxBrakingDeceleration());
    }

    ApplyRootMotionToVelocity(deltaTime);

    Iterations++;
    bJustTeleported = false;

    FVector OldLocation = UpdatedComponent->GetComponentLocation();
    const FVector Adjusted = Velocity * deltaTime;
    FHitResult Hit(1.f);
    SafeMoveUpdatedComponent(Adjusted, UpdatedComponent->GetComponentQuat(), true, Hit);

    if (Hit.Time < 1.f)
    {
        const FVector GravDir = FVector(0.f, 0.f, -1.f);
        const FVector VelDir = Velocity.GetSafeNormal();
        const float UpDown = GravDir | VelDir;

        bool bSteppedUp = false;
        if ((FMath::Abs(Hit.ImpactNormal.Z) < 0.2f) && (UpDown < 0.5f) && (UpDown > -0.2f) && CanStepUp(Hit))
        {
            float stepZ = UpdatedComponent->GetComponentLocation().Z;
            bSteppedUp = StepUp(GravDir, Adjusted * (1.f - Hit.Time), Hit);
            if (bSteppedUp)
            {
                OldLocation.Z = UpdatedComponent->GetComponentLocation().Z + (OldLocation.Z - stepZ);
            }
        }

        if (!bSteppedUp)
        {
            //adjust and try again
            HandleImpact(Hit, deltaTime, Adjusted);
            SlideAlongSurface(Adjusted, (1.f - Hit.Time), Hit.Normal, Hit, true);
        }
    }

    if (!bJustTeleported && !HasAnimRootMotion() && !CurrentRootMotion.HasOverrideVelocity())
    {
        Velocity = (UpdatedComponent->GetComponentLocation() - OldLocation) / deltaTime;
    }

    
}```
keen adder
#

Heya's, quick question:

I just tried my game as a listen server, and to my surprise all pawns seem to be replicated, even though I'm using Pawns and not Characters

cloud crown
keen adder
#

Is replication built into Pawns as well now? Or is it just offline and I need some other setup for real online tests?

cloud crown
#

why character snaps

steep temple
#

i dont know looks like you halted the movement with air control and facing the opposite direction

cloud crown
#

when in custom movement mode
trying to do similar stuff as phys flying

cloud crown
#

same that of phys flying

#

wanted to make a wall run
but this happens

steep temple
#

Ohhhh i see

#

can you show the debug traces?

#

you must have done something wrong

cloud crown
#

i have not done any traces till now

#

but lemme try something

cloud crown
steep temple
#

Where am i???.... Oh #multiplayer sorry i might not know anyways maybe if this video looks right to you then feel free to ping me

keen adder
cloud crown
keen adder
#

Right but your problem about c++ code, they'll probably be able to help you out better πŸ™‚

leaden bone
#

Is it possible to implement NeSerialize on a struct that already inherits from FFastArraySerializerItem?

noble sentinel
#

My find session node cant find sessions until a few tries, like I am getting the succesfully completed string but no servers until a few tries

#

Is there anything wrong here?

teal frost
noble sentinel
#

Thank you very much, that solved it

crisp shard
#

can you go from a server rpc, to a owning* client rpc, and then from there call a server rpc?

#

nvm, im tar tar

opaque forge
#

What's the deal with voice chat needing explicit integration with online subsystems and sessions? Can't the server and client just send voice data back and forth with the rest of the game?

#

Also, how can I set it up if I'm not using an online subsystem and just using dedicated server connection

thin stratus
#

You have to add that fake Session to the NamedSessions Array. Then it will pass that condition and send the Packages just fine.

opaque forge
#

Then I read somewhere that vc goes through the subsystem separately

#

I'm just overall really confused

vapid gazelle
#

When testing that I got my multiplayer functionality right, at least in the editor, do I need more than 1 client? I imagine that in order to be comprehensive I want both the listen server, and two clients. That way not only do I get to test how differently the client and the server behave, but also I can test how two clients see each other?

leaden bone
#

That would be 3 players for listen server and 2 for dedicated

#

To test everything

nova wasp
#

so yeah of course you need more than one player to see stuff. You can see more options in the editor settings -> level editor -> play settings

#

you can even make them all separate processes to make it even more realistic of a test but YMMV

glacial moat
#

Hello, I have a problem where on the server/client combo, a moveable static mesh is in one location, but on a client that is connected to the server. the same movable static mesh is in a different location. Is there a way to fix this?

vapid gazelle
nova wasp
#

also your project might ONLY consider listen servers or might ONLY consider dedicated servers etc

#

which is fine, just be aware they are different things