#multiplayer

1 messages · Page 696 of 1

kind ember
#

What does it do?

plucky prawn
#

job stuff?

#

the subsystem is fine on the client

#

but the actor proxy is not replicating my array of jobs correctly

#

is there like a pre-replication function i can put a breakpoint in so i can confirm the server has valid information?

plucky prawn
#

so it turns out the answer is yes there is a pre-replication function called AActor::PreReplication. i can confirm that in this function all the jobs are valid, its just not replicating them. i have the correct number of jobs (34) yet its all null

lost inlet
#

Are the actors replicated and have you confirmed the actors are received by the client?

#

You might need to set them to always relevant unless you derived from AInfo

plucky prawn
lost inlet
#

And are you observing this array after you know… for sure.. that the client has the actors

plucky prawn
lost inlet
#

Why do you even need a replicated array? Can’t the AJobs just self-register on the client? Is order important?

plucky prawn
#

the whole point is to have the server issue the jobs to the client in case the server has specific jobs disabled, or added ones that the dont ship with the game

#

i wasnt sure how else to do it

#

plus i dont need the entire job sent to the client, just the title really

#

but i need the job type so i can send it back to the server. its a whole thing

peak sentinel
#

Hi. Yeah it was similar, but recently I deep-dived into source code and debugged some of the functions and I almost solved my own issue. From what I can see my issue looks related with something else

plucky prawn
#

ah big sad

#

good thing i solved my original issue and now i have more issues

peak sentinel
#

Feels like we're cursed 😄

plucky prawn
#

so i think i found out whats wrong with my AJob not replicating correctly but i dont know what its deal is. in my C++ base class, i have bAlwaysRelevant = true; in the constructor, yet in the blueprint it is unchecked??? same with anything regarding tick, which is disabled in C++ yet ticked in the blueprint?

#

this is probably no longer relevant to this channel though

neon ether
#

Okay so im looking for any advice possible. Long story short I have an actor that is acting as a players weapon. This weapon gets spawned in on the server and replicated down to the client so the client gets a proper reference to the weapon actor. The actor also is getting its owner set to the owning players PlayerController. From what I understand these two things being true will allow an actor of Role SimulatedProxy to call a server RPC. Though I'm getting a non fatal exception when I try and call a server RPC from that clients actor. If there is any other information I'm missing or any information that needs elaborated on please let me know.

This image may be helpful as well with the stack and the exception. Whats odd is how far it makes it up the calls after calling the Server RPC which is the "ServerFireProjectile". Previously when i didnt have the actors owner correctly set it wouldnt it into the server RPC function at all.

plucky prawn
lost inlet
#

also what's this here:

#

wait, non fatal, so it's probably asserting then

#

well check()ing

neon ether
#

AModParent is the parent of ADefaultAmmo

neon ether
lost inlet
#

well what line is it erroring on

#

maybe look at that

#

and you didn't answer why you would need to send an FTransform anyway

neon ether
#

Because that server RPC spawns a projectile onto the server and that is the Transform I'm using to give to the Spawn Actor method

#

And this is that line that starts causing the issues. But the actual exception looks to be happening within the machine code at the top of the stack

#

Rebuilding now to recreate the issue to get the actual line

lost inlet
#

yep still not sure why you're sending an FTransform

#

why not just send origin + direction?

neon ether
#

Note: this works perfectly on the server so im not sure if it would be anything wrong with the FTransform. Though i could definitely do it that way and see if that changes anything at all since mabe that Transform data is getting messed up somehow

lost inlet
#

well your call stack was to do with it serialising the FQuat in the transform

#

and it looks like the reason you're sending it is pretty redundant

#

in an RPC you usually just send what you need, nothing more

neon ether
#

Thats definitely a fair point and something to take note of and change. I'll see if doing that changes anything since your right the error is definitely happening in the FQuad which leads back to the FTransform

neon ether
lost inlet
#

look at the log then

#

if it has an error mentioning the RPC then the net owner is actually incorrect

neon ether
#

I'm unable to clrl find the rpc name in the log file. Some other people in my project or print lots of things unneccesarily so the log file is a bit too cluttered to actually scroll around through

thin stratus
#

Should be able to just look at the log while playing and trying to execute the rpc

#

Either in the editor or when starting the game outside with -log

neon ether
#

It isnt resulting in anything getting printed to the log at all after the server rpc is called

plucky prawn
kind ember
plucky prawn
#

ye no idea. its working now so im scared to even look at it. i dont recall ever showing this code so i dont expect anyone would have seen it although i appreciate everyone who helped

plucky prawn
#

whats the reason that TMap and TSet are non-replicated?

twin juniper
#

Hey, nooby here (sorry)! I am a intermediate/beginner programmer coming from Unity. I am trying to learn Unreal because how much better it is for Multiplayer games.

I was told to start off with Blueprints and I found this course on Udemy that actually seems to explain everything. But he is teaching how to set up a Listen Server and from what I understand it's where a player is both a client/server.

I have been told that is is a very bad model for many reasons, but regardless of that would completing this course help me with the fundamentals of networking? Or is it not the best use of my time to learn how to make a Server Authoritative multiplayer system?

The course is called "Unreal Engine 4 - Multiplayer Team Based FPS In Blueprints" by John Galt on Udemy

Thank you for your time!

plucky prawn
#

theres nothing inherently bad about a listen server

latent heart
#

Sort of.

plucky prawn
#

really depends on the game right?

lost inlet
#

What advice is being given if listen servers are a bad model? They can work for low density games

latent heart
#

You can make mistakes because the server is also a client, so replication issues can pop up with other clients but not yourself

lost inlet
#

Yeah but you mostly just sanity check stuff in the editor in dedicated mode anyway

#

Doesn’t mean that using is bad anyway

latent heart
#

For learning networking, I mean.

#

For a release of a game, do whatever you like.

twin juniper
#

@plucky prawn @lost inlet I am trying to eventually learn how to make a small scale (3vs3) competitive top down shooter. I have been told that a Listen Server is bad because people can cheat, steal IP and is very laggy if the host has poor internet. I was told that you should made a server authoritative game to reduce those issues.

hollow eagle
#

Learn how to work with unreal first before worrying about that.

plucky prawn
#

for anything competitive you want an authoritive server

lost inlet
#

Well you can use the p2p relays that EOS provides to prevent IP leakage

#

But cheating is a concern if your game is competitive in some form

#

Also a listen server is still “server authoritative “

hollow eagle
#

Transitioning to a dedicated server is fairly simple if you've followed best practices (don't assume every instance of the game has a player).
But seriously, don't worry about it until you've actually learned the engine. It's not like you'll be throwing away work with a listen server.

lost inlet
#

A dedicated server just doesn’t have a player on it, thus dedicated

#

Hopefully you can get your server infrastructure optimal with a low player count per game

twin juniper
#

@lost inlet Thank you for the correction! I am still very much learning the terminology.

@hollow eagle That makes sense, so what you are saying is as long as I learn how to make a listen server in Unreal, then my skills will translate?

hollow eagle
#

You're thinking of listen servers and dedicated servers as two different things. They aren't.

#

One just has a player.

#

The other doesn't.

twin juniper
#

Also do you guys have recommendation on resources that actually explains and is beginner-ish friendly? And is either up to date or at least relevant still?

hollow eagle
#

It's not that your skills will translate - if written correctly you could literally flip a switch and it would work as dedicated instead of listen.

#

But again, it doesn't really matter until you've learned the engine.

lost inlet
#

And if you PIE with one player in the “listen server” mode then it acts the same as single player, so just don’t sanity check network code that way

twin juniper
#

@hollow eagle Thank you for the explanation!

hollow eagle
#

The network compendium is a good place to start for an overview of unreal's networking (see pins in this channel)

#

that assumes you have some experience with unreal's game framework though.

twin juniper
#

Thank you guys! Also I have a burning question that I have been trying to get answered. I used to be very competitive in Super Smash Bros Melee and if you know the scene then you know how technical that game was. Even a couple frames off and things feel off, thats why most play on a CRT.

Anyways, what I am trying to get at is why was their Roll Back system sooooo good for online play? Before they added Roll Back nobody really played online because you had to play with the lag, but with Roll Back it honestly felt like Lan (if your ping was under 80).

So my question is why does their and other fighting games roll back feel sooooooo much better than most competitive games? I used to be pretty serious into overwatch and when I played lan tournaments I felt like I was playing a different game. Because when you play online you played with the lag in mind, but in LAN you can actually time things down to the mili seconds.

What's up with that? How can fighters feel so much more responsive than other competitive titles?

neon ether
neon ether
#

I have double and triple check the compendium and other docs and I know im setting the actors owner to the correct player controller. So I do believe that since the actors owner is the client player controller that means when the actor queries out to the most outer owner it should run into the player character of Role Autonomous Proxy which should allow the actor to run the server RPC. Are there any other settings to check for? As I most definitely have quadruple checked that the involved actors and whatnot are set to replicate, but is there anything else I might be missing from the compendium I should look at or any other bits of info I'm not taking into consideration?

latent heart
#

Have you tried routing the call through the PC itself and passing the actor in question as a paremeter?

#

And are you calling the function on an actor you think should be able to send a server rpc of from the actor?

#

(both is also an acceptable answer)

neon ether
#

I belive the answer would be from in that context as its calling it from within itself

latent heart
#

Yeah, don't worry about that part then!

#

A lot of people get that mixed up.

neon ether
#

aka probably just do it the right way

latent heart
#

Always good to leave some wiggle room in your class hierarchy when doing that. Create a c++ class to inherit from and then create a bp from that, so you don't have to go rebasing your PC BPs

#

I'd do that anyway.

neon ether
#

Would trying to do call it say from the owning player character have a similar effect?

latent heart
#

That should work, too.

twin juniper
#

hi all
I am facing a problem with creating session
my iphone and other pc can't find it

neon ether
latent heart
#

Np.

twin juniper
#

I can't find my created session on my local network on other PCs

verbal tendon
twin juniper
#

no I am not using steam

#

but how should i know

verbal tendon
#

what are you using?

#

If you don't know, then you're not using any subsystem and you won't see the sessions. You kind of have to integrate an online subsystem to use

twin juniper
chrome bay
#

There are ways around it, but I myself have never managed to get my locally-hosted sessions to show on PC's on the same LAN network even when connecting through the internet.

#

The best thing you can do is print the steam session ID to the console, then use a console command to join it.

#

open steam.####### - replacing the #'s with your session ID.

#

FindSessions should work if it's marked as a LAN session though.

#

But FindSession for internet sessions only works if the host/client are of different public IP addresses IIRC

twin juniper
#

I was using 4.24.3 and everything works fine

twin juniper
chrome bay
#

Not sure. I've been on everything from 4.16 to 4.25 with Steam and dedicated servers have never shown in the server browser for me when hosted locally.

#

Epic did make a few changes to Steam in recent releases though IIRC. Broke a lot of in-editor testing.

twin juniper
#

so if i host my game in amazon it should work right?

verbal tendon
winged badger
verbal tendon
worthy knot
#

Can someone guide me on advanced sessions ( not steam sessions ) just advanced sessions

worthy knot
#

I want to create a dedicated server session. So when i launch my dedicated server exe , it opens the desired game level and other clients from different networks can join in the level via adding the public ip

#

Possible right?

#

Plus i have public ip ( static ip ) installed on my router with ports 7777 added

rocky night
#

@thin stratus HI again, as it worked yesterday i hope you can find a moment to help me with this: HI, all and @The Jackal i have a replication Problem. i want when Player overlaps with BP to show a message on the screen, works all but😵‍💫 it shows only on Server not on client. I need that only the overlapping player sees it
bp overlap

gritty pelican
#

why GetBaseAimRotation return Yaw 0.f for other clients?

rocky night
#

casting from a bp in th elevel to the hud

thin stratus
rocky night
#

oh sorry, now i know the rules no german and no ping

thin stratus
#

:P Read them

rocky night
#

will do 😄

thin stratus
gritty pelican
#

@thin stratus for Character it must be ControllerRotation i think

#

ControllerRotation must return FRotator(0, 0, 0) for other clients, but GetBaseAimRotation will return only Pitch value, so how i can replicate yaw too?

chrome bay
#

It assumes that the actors' rotation has the same yaw

#

Pitch is handled specially via RemoteViewPitch

gritty pelican
#

@chrome bay Is there any way to add Yaw by rewriting replication in c++ ?

pallid mesa
#

Mostly looking for things to document/write but if there's something written by someone with more experience than me in the field I prefer to pinpoint to these sources

rocky night
lusty sky
#

what is the question so i can have an idea? peepoCry and how is this multiplayer related?

vague fractal
#

Uhm, say i have this structure as replicated variable in my class

USTRUCT()
struct FMyStruct
{
  UPROPERTY()
  int32 PropertyOne;
  UPROPERTY()
  int32 PropertyTwo;
};

If i change PropertyOne, will it only replicate those 4 bytes or will it replicate 8 bytes ?

rocky night
vague fractal
rocky night
#

with a branch?

vague fractal
#

Ofc

rocky night
#

aright

#

thanks

#

ad in the hud? or just in the creating bp like on overlap?

modern cipher
vague fractal
modern cipher
#

why not make them independent uprops if you need only the changed one

vague fractal
#

For the same reason why we use structs generally, to tight related things together >_>

rocky night
#

@vague fractal like this in the BP whos triggering it?

vague fractal
#

Whatever logic should only run on the local client should be in the scope where IsLocallyControlled == true

neon ether
#

So im running a server RPC that calls a multicast rpc from within my player controller and when the logic runs on the client everything runs fine and the multicast runs on the server and client, but when i run from the server side the multicast does not run on the client. Any have any points or tips as to why this might be happening?

low helm
#

The server side of whose Player Controller?

neon ether
#

Server side of the severs player controller

low helm
#

Ah ha

#

Clients never have a copy of anybody's Player Controller

#

except their own

#

So that Multicast is getting sent nowhere

#

The GameState is an object which is replicated properly to everyone, try putting the RPC's there

chrome bay
#

Player State would be a more sensible place to broadcast a player-relevant multicast

neon ether
#

I knew that but didnt realize it would cause that issue, is there an alternative way to moving the RPC's? Is there no way to get a multicast rpc to run on the client as well from the player controller?

low helm
#

Jambax is right

#

No, the clients can never receive Multicast on someone elses controller, the client doesn't even have that object so it can't receive the event.

The proper approach is to move RPC's onto objects that are replicated the way you want.
GameState
PlayerCharacter
PlayerState

These are the primary objects that every client will have, but PlayerState could be best if it is a player specific event.

#

An RPC is an object sending a message to the replicated copy of itself on someone elses computer. If that object doesn't exist on the remote computer, there is no object to receive the message.

vague fractal
chrome bay
#

The owning client will receive the multicast, but nothing else will

neon ether
chrome bay
#

If it's weapon fire it should go in the weapon class itself

neon ether
# chrome bay If it's weapon fire it should go in the weapon class itself

I had it in there originally but was having issues with not being able to run server RPC's from the actor since it was a simulated proxy and even though i was setting its owner as the owning player controller and spawning the actor on the server as is supposed to be done but still could not call server RPC's

low helm
#

You could also put it on the weapon, but that sometimes gets conflated with character

neon ether
low helm
#

Nah for WeaponVFX I wouldn't do GameState, unless it's a small game and sloppiness is of little concern

#

It would work

neon mango
#

When hosting a listen server to be accessed by clients over the internet, does the engine know your unique game instance to separate it from other developers hosting there listen servers when clients browses for list of servers?

chrome bay
#

Ultimately weapon logic should belong to the weapon class. Good practice when it comes to data-locality is paramount in Multiplayer.

#

The weapon should then be owned by the players' pawn, which will allow them to call Server functions on it.

#

You're already at a massive disadvantage using BP for multiplayer though

chrome bay
#

You are given a unique id for your specific server instance from the platform's master servers.

peak sentinel
#

I'm kinda anxious about UObject overhead for replication

#

But I guess its fine 😕

chrome bay
#

just use components

#

My weapon "actor" is the shell and any behaviours I want are components, then I just string them together in the BP class

#

Or use a CPP class if it's something common

peak sentinel
chrome bay
#

I create a BP class, and add components like you normally would to any actor

peak sentinel
#

Ah, gotcha

chrome bay
#

I don't add or remove at runtime, guess i could if I wanted but no need

lusty sky
#

shooting component

peak sentinel
#

How do you switch between them though? Do they have some kind of state machine logic?

chrome bay
#

Not sure what you mean, between different weapons you mean?

#

Every weapon you carry is it's own actor instance, with it's own components.

#

That's the only sane way 😄

peak sentinel
#

Since behaviors are 'modular' behaviors coupled to weapon class, I guess there are "Firing" "Reloading" components right?

#

How weapon switches from Firing state to Reloading state?

chrome bay
#

I just provide inputs to the weapon "StartFire", "StopFire", "OnReload" etc.

#

And the weapon BP decides what to do with it

modern cipher
peak sentinel
#

I see. Mine looks like this. Every state object has a SelectNextState function and returns which module we should switch to. If none found, weapon falls back to Idle module

chrome bay
#

The only UObjects my weapon have are transient ones that are spawned locally to manage state machine stuff

rocky night
chrome bay
#

But my use-case is a bit more unique because I share weapons between vehicles + characters

peak sentinel
chrome bay
#

And there's a common interface for both

peak sentinel
chrome bay
#

It needs some work but my hierarchy looks like this:

-> Weapon_Character
-> Weapon_Seat

WeaponModule (Component)
-> OrdnanceModule
   -> ProjectileModule
   -> BallisticModule
   -> BeamModule
   -> HitscanModule
-> AmmoModule
   -> LocalAmmo
   -> SharedAmmo
-> ReloadController
-> TargetModule
   -> LockOnModule

WeaponState (Transient UObject)
-> FiringState
   -> FiringState_Burst
   -> FiringState_VariableBurst
   -> FiringState_Looping
-> ReloadState
   -> ReloadState_Clip
   -> ReloadState_SingleRound```
#

etc..

modern cipher
#

input actions + checking if weapon equipped maybe

chrome bay
#

Input is routed from the vehicle to it's "Hardpoint Component", which then pushes that to the equipped weapons.

#

For characters it goes to their "Inventory Component", which pushes it to weapons also. Same kind of idea.

peak sentinel
#

Woah, looks really cool as always

chrome bay
#

Then with the help of some custom nodes to make it easier to manage the transient state objects, this is what a basic cannon BP then looks like

#

"OnStartFire" and "OnStopFire", "OnReload" etc are called from the inventory

#

The other event is a component event.

#

The only part I don't like currently, is the overhead of using dynamic multicasts in the components - but I'll probably make them native later, and just specify a function name

peak sentinel
#

Thanks for useful infos, Jambax

chrome bay
#

Haven't actually made a single character weapon yet though 😄

peak sentinel
#

I'm surprised you guys are using replicated(?) components though

#

Afaik dedicated server owners avoid even minimal overheads usually

chrome bay
#

Oh no this is just my own project

peak sentinel
#

Hover tank game 😄

chrome bay
#

Yeah

#

HLL uses the same setup as shootergame really

#

Every weapon is basically the same anyway really

peak sentinel
chrome bay
#

legit 😄

timid crown
#

are there any limitations to using epics online services or can i use it on devices running on steam on oculus together rather than using their own proprietary service?

lusty sky
lost inlet
#

at least we didn't start with ShooterGame

#

but even Valorant did

chrome bay
#

Can't say I recommend it 😄

peak sentinel
#

I didnt start with ShooterGame either

#

But I'm not developing a competitive shooter game or a first person shooter

lost inlet
#

well this is an FPS, and it all started with the very simple first person template from the engine

peak sentinel
#

(only if campaign wouldnt cancelled)

#

Dont mind my inner voice, I like feeding enemy team and dying without even seeing the enemy in Sandstorm 😂

vague fractal
peak sentinel
#

So 4 bytes

eternal canyon
vague fractal
#

Wish i would feel more secure about it now, but it's kinda hard when one person thinks the whole struct will be replicated and now you who says it wont 😅

modern cipher
#

why u worried about 4 bytes xD?

vague fractal
modern cipher
#

they say finish then optimize

peak sentinel
#

There are times you'll die to save 1 bytes

eternal canyon
chrome bay
#

@vague fractal it will only replicate the properties that are changed. USTRUCT members are unrolled

vague fractal
#

Thank god

#

Now i feel more secure about it

chrome bay
#

Technically it won't be four bytes though, it'll also come with property headers etc.

#

Which is at least 2 bytes

vague fractal
#

That's still better than the whole struct which is possibly 500 bytes big or similar 😅

peak sentinel
#

Or do they ignored when declared in a UCLASS directly

chrome bay
#

always

#

Needs to identify which specific property the data is for

#

And that goes all the way up the chain back to the top, if you think structs within structs/arrays etc.

#

So at minimum it's 2 bytes

peak sentinel
#

Gotcha, thanks

coral wing
#

How can I see the server log of my game when it's on AWS?

lost inlet
#

well the log of a server is put into stdout and there's also the file logging

#

which is nothing specific to AWS

tawny nova
#

it.. is specific to your aws setup

#

if you're using something more managed, a lot of times stdout will be getting sent to an s3 bucket

coral wing
#

I want to read the debug log to see why it's not connecting to EOS

rustic kraken
#

Hey i have a question

#

I have a multiplayer door

#

where i am opening it through an interface call when a hit trace hits that mesh of the door

#

but in clients the hiot trace isnt actually registering anything on most of the parts evenb after hitting to door

#

but in the server it is working perfectly

#

By hit trace not registering anything, i meant that the hit actor is returning null

neon mango
vague fractal
#

Is it somehow possible to replicate Attribute only when HasAttribute is true inside of GetLifetimeReplicatedProps or would i have to do this somewhere else ?

modern cipher
#

i was confused how it takes a boolean

#

XD

vague fractal
#

It doesn't need to behave dynamically, i want to have it either replicated or not for the whole lifetime of the object

modern cipher
vague fractal
#

Actually.. would this be possible ?

void APlayerCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty> &OutLifetimeProps) const
{
  Super::GetLifetimeReplicatedProps(OutLifetimeProps);

  if(HasAttribute)
  {
    DOREPLIFETIME(APlayerCharacter, Attribute);
  }

}
lusty sky
vague fractal
#

It totally depends on whenever HasAttribute was set to true in the BP class or directly in C++. So this information would be already available before this instance would spawn

lusty sky
modern cipher
#

same thing being used with actors wheter you want to replicate movement or not

tiny mauve
#

If you wanna connect to a server directly do you use change level? In blueprint I mean

vague fractal
#

Having 2 options makes it kinda hard to decide 😅

latent heart
#

That's what online subsystems are for.

shadow aurora
#

So SetHiddenInGame doesn't seem like it's actually doing anything when it's called in a server-side function call. What are my options here for forcing a mesh to hide itself at certain points that are designated by the server?

latent heart
#

Using an RPC?

shadow aurora
#

Yep

#

I can tell it's definitely running on the server cause everything else is working as expected

#

Just cannot get it to disappear lol

latent heart
#

No, I mean, that's what you'd do if it's not replicating.

shadow aurora
#

Oh I'm following

latent heart
#

I'm assuming you're not creating it on the client separately.

shadow aurora
#

You're saying just use an RPC to the client to set hidden in game

latent heart
#

Yes.

#

I would have thought that was replicated, but meh.

shadow aurora
#

Yeah I also thought it was replicated which is why I was so confused. I'll give that a shot though

lost inlet
#

Pretty much nothing about visual components is replicated

#

Also SetVisibility is more correct anyway

golden aurora
#

Hi, I did a OnRep_Something on C++ but its not being called when I update my value on client. Any clue that can be missing me?

lost inlet
#

well if you're updating a value on client then it won't get called

golden aurora
#

So, I need to run an event on server with a client reference and the new value? To be updated on the server?

#

I will try something like that and similar

#

Yup

#

I'm not sure if its a "good practice" but it worked somehow

golden aurora
lost inlet
#

what?

#

a replicated value from the server will call the OnRep if it differs from the client's version

modern cipher
golden aurora
#

Yes, that's it

lost inlet
#

what? why are you devsplaining lol

#

also what I'm describing is C++ behaviour

#

if you do any kind of updating the value on server or predicting as client, you have to call the OnRep manually

#

and you can flag the OnRep so it's always called even if the client and server values match

#

if that's required

modern cipher
#

bro i have no idea what is going on in here

golden aurora
golden aurora
#

But I run the function on the server to update a variable, and it calls OnRep now

tiny mauve
#

is there an onMatchStart event?

mint nymph
#

does anybody know how I can do a servertravel command trying to travel all players from the client and the server using a combo box

light iron
#

I mean that's just latency.

#

I wouldn't say it's bad, I would say it's expected.

sinful tree
wild patio
#

does anyone here have any experience with replication behaving differently depending on how you connect to the host?

#

when i use the "start session" blueprint node to start my multiplayer session, everything works great. but when i start an editor instance from the command line useing MyMap?listen?bIsLanMatch=1 and everything else is the exact same, I get this error

#

"No owning connection for actor"

#

in the log.

#

like, i've checked everything over and over again. tried re-writing parts. and it all keeps coming back to this. i'm starting to think this might be a bug in 4.22. btw, tried this on two totally different machines, and two totally different networks

sinful tree
#

That message is usually an indication that you're trying to run an RPC through an actor that is not owned by a client.

wild patio
#

got it. that makes sense. strange that it wouldn't appear in the case where i use the blueprint start session node.

#

you mean an actor that isn't owned by a player controller?

sinful tree
#

Yep, or isn't owned by anything that the player controller already owns (eg. playerstate)

wild patio
#

hmmmm. i'll triple check that. but it seems like the issue is coming from an actor component. long story very short, i have an actor component that replicates some VR body IK stuff so the limbs of the player mesh move around on server and all clients. i've tested the replication on a prototype project, and in this larger full game. and both work fine when doing "start session". but the body IK actor component (attached to the player character) stops working **when starting host via command line. it's almost like the actor component initializes without an owner for a split second, and then errors out.

sinful tree
#

Perhaps part of the issue is that the component is trying to send RPCs immediately when spawned on tick as you may be sending movement data? Perhaps start it with tick disabled and on possess of the character enable the components tick then if that's the case.

wild patio
#

ooooo that sounds that could be the issue

#

it's possible there is a single tick firing before the character is possessed?

#

can begin play fire before a pawn is possessed?

#

i appreciate this, tho. i have a few new things i can try when i get back to it tomorrow.

sinful tree
# wild patio can begin play fire before a pawn is possessed?

Most definitely begin play can fire before a pawn is possessed as pawns can exist in the world without being possessed at all.
Not sure if a single tick could be firing beforehand but it's definitely worthwhile to take a peek at if that is what you're doing.

wild patio
#

right. i possess immediately, but i could see the order of operations being slightly different if the server is starting a session from an already loaded map, vs starting a session directly into a map.

lyric skiff
#

can anyone explain how these give different results? This only happens on the host of listenserver

#

bottom is called from a widget button

sinful tree
# lyric skiff can anyone explain how these give different results? This only happens on the h...

It would likely depend on how PrintPlayerIndex is called. The N input can be fed into one player controller, but if you're not calling the event on the same player controller that your host is in, the values can be different.
As I'm already aware of your situation, your issue doesn't lie with this printing two separate numbers - it's a matter of your ghostly player controller and you're likely calling the event on that ghost player controller.

lyric skiff
#

i fixed the ghost problem lol

sinful tree
#

Ok, then it's a matter of your input is being fed to one controller, and your event is being called on a different player controller.

lyric skiff
#

on the host how many player controllers are there?

sinful tree
#

All of them

#

The host is the server.

lyric skiff
#

so basically i think somehow i'm assigning the index wrong, but i really don't see how as its only called once

#

ohhhh

#

wait do hosts call onpostlogin???

sinful tree
#

Yes, they are the server.

lyric skiff
#

no i mean, does onpostlogin get called when the host starts the server?

sinful tree
#

Yes

lyric skiff
#

you're 100%?

#

cause it would make sense that maybe the assign player index doesn't get called or something and thats why the hosts playercontroller is on the default value

sinful tree
#

The host is the server. So whenever the host starts their instance of being a host, they are the server. Their player controller joins the game just like any others, and OnPostLogin is called for their controller as well.

lyric skiff
#

i just can't see how this wouldn't assign him anything then

sinful tree
#

He would be player 0.

lyric skiff
#

yes but then why on one of the calls does it return default valueeee

#

sorry if i'm being rude this is just so frustrating lol

sinful tree
#

Which call? One of these?

lyric skiff
#

and to add to that clients always return the correct value

#

on both of these

#

and a consistent value between these

sinful tree
#

What value are you expecting? You're adding the host to an array and using that as an index. That array won't exist until the game starts, so naturally, the return value would be 0.

#

So the Player Index of the host's player controller should be 0.

lyric skiff
#

okay so it doesn't run onpostlogin or does it before the hosts playercontroller exists

sinful tree
#

OnPostLogin runs when the player controller is created for the host. (*roughly. it gets created before this, but lets go with this - the point being, the player controller is created, and OnPostLogin gets called somewhere after the fact of the server existing and the controller "joining" after being created)

lyric skiff
#

hmm

#

can you recommend anything on how to change get it assigned correctly?

sinful tree
#

You haven't even let me know what value you're actually expecting. Adding the first item to an array would always return 0 as the value. The second one that gets added, 1, etc.

lyric skiff
#

so the N button thing returns the value it should be of 0

#

but the HUD button, and apparently in my gamestate it is 5

#

which is the default value

sinful tree
#

How are you calling PrintPlayerIndex?

lyric skiff
#

this is just onclicked button from a widget

#

but also that player index doesn't get used anymore

sinful tree
#

What is the Chess Controller variable set to?

#

(you can do a print string off of it to get a display name)

lyric skiff
#

its casted when the widget is created,

#

but like i said it isn't hooked up anymore

sinful tree
#

Ok, can you show the cast you're doing?

lyric skiff
#

so that player index isn't being used that is sent from the widget

sinful tree
#

Can you show where this variable is being set in your widget/

lyric skiff
sinful tree
#

Try using Get Owning Player instead of Get Player Controller.

lyric skiff
#

omg okay so that works now...

sinful tree
#

It's really bad to use indexed get player controller on a listen server.

#

or any of those indexed gets

lyric skiff
#

the whole thing works now

#

you're a genius

#

can i give you money

sinful tree
#

It just works. ™

#

Nah

#

Pay it forward. Be helpful to others when they need it.

lyric skiff
#

if i ever get good enough I will absolutely be helping people

#

you're amazing 🙂

twin juniper
#

Hi people, I'm setting up a multiplayer game and I have some questions. I have the core gameplay of the levels setup to work for dedicated server but my question is, how much difficulty and effort is it to setup a dedicated server myself? I haven't approached this yet. I am happy to have the game work with one player being the host although I would need to change a lot of code - i'm prepared for that.

The problem is I still want an initial game mode where players connect with other players willing to play which would need dedicated server I assume? Once I have my players connected, I would switch to local multiplayer at this point if needed - how feasible is that?

I'm working on my login screen/level select at the moment. I'm not sure how to approach level transitions or how to transition all my players to a level, a lot of my level logic runs on 'onpostlogin' events which I think are not getting called when I attempt to travel (except for the server) and crashing the game.

In the lobby itself I have a few possibilities, I'm not sweating what design choice I make here. My preliminary work has just been on assigning one player randomly as the 'host' (even if I am using dedicated server I can just use a randomly assigned boolean to decide who is 'host', or I can choose the actual host if running local multiplayer), who is able to decide what level people travel to, all of who need to click 'accept' before the travel actually occurs.

sinful tree
twin juniper
#

Do you mean for searching for people to connect with? That's my main gripe, I absolutely will want a form of full online mode just while people find other players to connect with. Once the players are connected, it doesn't matter THAT much (although I have most of my game set up for dedicated server)

sinful tree
#

So more like a hangout place while you wait?

twin juniper
#

The lobby, it really doesn't matter at all (ie the level select, AFTER everyone is connected)

#

I want an initial login where players search for other players online

#

Once I found a few players and grouped them, they go to the second lobby where one players chooses the map and the others select/decline

sinful tree
#

I'm not understanding these bits: "I absolutely will want a form of full online mode just while people find other players to connect with." and "I want an initial login where players search for other players online"
Search for players by actually walking around in some sort of game space and actually see other players walking around too? OR Just hit "I want to join a game" and it'll drop them into a lobby with a bunch of random players when it finds them, or select from a list of rooms waiting?

twin juniper
#

Nah it would be more like a visual 'searching for players' indicator

#

By 'lobby' I meant the level select screen

#

The search would be a search online for other willing players not a physical search

#

Level select is AFTER everyone has connected

sinful tree
#

Ok, so yeah, that's what #online-subsystems can help you with. They can help your players matchmake without the client needing to be connected to a server.

twin juniper
#

thanks I will make a note

mortal kernel
#

Hey I have a pawn why can't the client move it? The server works just fine but clients can't move

peak sentinel
#

APawn?

mortal kernel
peak sentinel
#

Pawns are not able to move client side

#

You gotta write your own logic

#

Server is rolling back you to authoritative position

#

You need to send your location from client to server

mortal kernel
peak sentinel
#

Yeah

#

You need to prevent it yourself

#

CMC does all of this for you

mortal kernel
#

I saw you made a plugin for exactly that :o Why isn't it available anymore?

peak sentinel
#

PayPal is restricted in my country and most of the time people were requesting more than what plugin provides like trying to have 1k of pawns in the scene etc.

#

It was also kinda difficult to maintain ngl

mortal kernel
#

I see :o I'm gonna try reparenting to ADefaultPawn and see how that goes

peak sentinel
#

Its simple to achieve if you are not going to implement advanced things like movement reconciliation and root motion replication

#

Just set location, rotation and velocity predictevely on clien and send to server, and let simulated proxies lerp to current location

mortal kernel
#

Nah I just don't like to use a character because it's way too much... I just need a mesh, sphere moving in a 2D space constraining Z

mortal kernel
peak sentinel
#

Just send transform data to server via RPC, thats the most simple step

#

I also remember writing down steps in more detail on Bry's server, have you looked at that?

mortal kernel
#

Yea and I barely understood anything about it

pallid mesa
#

roles don't have to do anything with listen or dedicated server

#

you'd like to use GetNetMode, take a look at the struct definition of the return type

#
enum ENetMode
{
    /** Standalone: a game without networking, with one or more local players. Still considered a server because it has all server functionality. */
    NM_Standalone,

    /** Dedicated server: server with no local players. */
    NM_DedicatedServer,

    /** Listen server: a server that also has a local player who is hosting the game, available to other players on the network. */
    NM_ListenServer,

    /**
     * Network client: client connected to a remote server.
     * Note that every mode less than this value is a kind of server, so checking NetMode < NM_Client is always some variety of server.
     */
    NM_Client,

    NM_MAX,
};
winged badger
#

if you want to show UI on overlap, IsLocallyControlled is the only check that is required
as for Q2 - no when you get the AIControllers into the mix

naive dome
#

Hi guys,

Got an interesting questions.

This is the scenario:

Let's say in multiplayer, people have a widget component attached to their character that is on 'Screen' space (lets call it a chat bubble). When they chat, it appears above their head. A repnotify fires to make it visible, and the chat text appears in the chat bubble. After a certain amount of x time it becomes invisible again.

Now what I want to realize is that only people within a certain distance of this 'chatting player' will get to see the bubble appear above his/her head.

How would I approach that.

So basically, how can I control chat bubbles visibilities of other players based on my location in relation to theirs?

lmk if anyone has pointers

twin juniper
#

is this a bug or am I missing something very obvious. This is logic in my player controller, first image is run on client on begin play and I create a widget then call an RPC using the newly created widget as input. Second image is the RPC itself. The print string is displaying null?

vague fractal
#

I think it's cuz sever don't have widgets

twin juniper
#

Yeah I see that now

twin juniper
#

Can i have a non replicated event dispatcher in my player controller, that I call from the widget owned by my player controller, and bind a RPC to that event dispatcher?

#

I'm trying to figure out a workaround

#

nvm sorted

twin juniper
#

Back again if anyone is kind enough, I am trying to open a level now, naively just using 'open level' (running on server). all the logic up to this point is working as intended and this event is getting called when I want, but the game just opens 'Minimal Default'. Sometimes I get 'building distance fields' or 'building lighting' messages though. I'm just wondering what I am doing wrong but also how I can troubleshoot this, since I'm getting no error messages sadly, just the wrong level opening.

#

Everything is totally different in the level to open e.g. game modes, game states are totally different so I'm sure the logic is breaking somewhere.

mint nymph
sinful tree
mint nymph
#

no

#

which is weird i cut off the other level thing and disconnected it

sinful tree
#

PIE doesn't support it regularly. You need to be running as Standalone game if you haven't set it up to do so.

mint nymph
#

ok for some reason now it let me changes the level but it does let everyone go to the same level

#

I think this weird action where the server is being refused for some reason and then changes all late

sinful tree
mint nymph
#

how can i do seamless travel do i have to make like a loading screen

mint nymph
latent heart
#

That's one hell of a question.

#

Even so, it's still one hell of a question. You need a lot.

sinful tree
#

Account Management, Database Management, Chat Systems, Server Instancing/Fleets, Administrative Tools (things like web-based access to manage parts of your game), Game Moderation systems, maintaining a global presence for players online (eg. you're not going to squeeze thousands of players into one server), likely some TCP/UDP socket connections.... It goes on and on...

latent heart
#

You shouldn't ask what you need to make an MMO. You should flesh out the idea of your MMO and then say, "what do I need to make this?"

sinful tree
#

^

latent heart
#

The answer is all of them.

sinful tree
#

and then some. It's not a comprehensive list @_@

latent heart
#

I would drop the first M off your project unless you have millions of dollars funding and a large team.

hollow eagle
#

fwiw beginners going into gamedev communities and asking how to make MMOs is a big meme. Regardless of your intentions, expect communities to generally not respond particularly well to that kind of question. If you're going into it purely with the intent to learn how things are made you'll get better responses but don't start with "I want to make an mmo" or anything similar.

latent heart
#

And about 5-10 years

sinful tree
#

It is. It's just a lot of work.

mint nymph
#

There is still a lot more to the mmorpg, and yeah you need a huge team. I have another guy with me on a small project with a budget of like 500 dollars and were having some troubles,

sinful tree
#

So you'll need lots of time.

latent heart
#

Just the infrastructure alone will cost money.

mint nymph
#

see you in 10 years

hollow eagle
#

And note that I'm linking to a specific well written comment, not trying to make fun of anyone by referencing the OP.

mint nymph
#

dude it cost a lot of money getting servers

sweet ore
mint nymph
#

up and running and maintaining them

mint nymph
wild patio
#

i remember my first game idea was an MMO. i'm now working on a multiplayer VR wave shooter, and that alone has been enough work for me as a side project, and i've been programming for 12 years.

mint nymph
latent heart
#

That's cool.

wild patio
#

nice man!

#

sounds achievable

mint nymph
#

Quest all were saying it can be possible its just so hard. Be realistic

mint nymph
latent heart
#

As a solo developer, you're probably better off making a not-massively multiplayer game and letting people host their own small servers, like Rust or something

heady python
latent heart
#

And also factor in modability. It's what makes small games really shine.

#

Just because it has a lot of players doesn't mean it's an MMORPG

#

CS isn't a MMOFPS

#

It's not me that doesn't get it here, mate.

wild patio
#

minecraft is actually a pretty good example. i recommend looking up what the first early playable version of minecraft looked like. i think it only had a handful of blocks.

latent heart
#

Overcoming Unity's limitations isn't really the issue.

mint nymph
#

We are just saying first ideas like MMORPG or Big Rpg games are destined to fail with a solo developer espeically without any budget

#

I had an idea of a big rpg game a story I want to tell but right now I dont have the money or the team to do that

#

its going to take you 10 years if you are alone

latent heart
#

Even a gigantic company with virtually unlimited resources would take 5+ years to make a decent MMO

mint nymph
#

and by the time you are done

#

UE6 will be in Preview

#

ROFL

latent heart
#

And Chaos will work properly.

mint nymph
#

Quest how old are you

latent heart
#

Name an mmo created by a solo developer that has any kind of success.

mint nymph
#

how are you about 20

#

its you are 20 or your not lol

sinful tree
#

Project Gorgon (albeit not entirely solo, but it was a wife/husband duo who eventually got another person to help)

wild patio
#

I say, if Quest wants to try to make an MMO, let him have at it. an honest effort in doing so will show the limitations in the act alone.

latent heart
#

@sinful tree does it fulfil the massively part of the description?

sweet ore
#

you can't tell the names because not alot of adds

wild patio
#

replication question: is the character falling through the floor ever a sign something is wrong with replication?

mint nymph
#

does anybody know how to replicate music

sinful tree
#

Massively in terms of what is normally considered an MMO - a system by which you can encounter players in an open-world style setting. Doesn't necessarily mean you'll see everyone who is connected to the "server" in the same place, as there can be instanced servers.

sweet ore
#

for friends *

latent heart
#

You want to tell each client to play the same song? Just send an rpc broadcast?

heady python
latent heart
#

Maybe an audio actor could work? Not sure how that's all replicated, though.

mint nymph
latent heart
#

The player being a client? Or a listen server?

mint nymph
#

client

latent heart
#

Send an rpc from the client to the server and then send an rpc broadcast to all clients

#

(from the server)

sinful tree
#

Click Button > Executes on Server RPC on Player Controller > Executes On All / Multicast on a shared always relevant actor like Gamestate to play the music for everyone.

#

alternatively, have a RepNotify variable on game state that you set that controls which song is playing. Then it becomes Click Button > Executes on Server RPC on Player Controller > Set Music variable >>> On Rep fires on clients, telling them to play the currently selected audio in the Music variable.

#

That way if others join in, they can hear the music playing too 😛

plucky prawn
#

is it ok to replicate a timer handle? i have a round timer id like to replicate and am wondering if theres any known issues or if theres a better way to get a timer on a client to sync with the server

hollow eagle
#

no, timer handles aren't going to replicate.

plucky prawn
#

thats unfortunate. is the game time synchronised? i could use that instead

shut gyro
#

Is there a way to add steam friends with a function? Ideally through the SDK, but through the web api would work as well

plucky prawn
shut gyro
plucky prawn
#

steamworks provides this functionality

shut gyro
#

There is something where you can call a function to open up the overlay and do it, but that's not what I'm looking for

hollow eagle
#

There is no way to add a friend directly.

plucky prawn
#

perhaps im mistaken then

hollow eagle
#

Why would they ever let you do that?

plucky prawn
#

ye seems a bit sketch

#

best way i can see is to open a dialog to let the user confirm

hollow eagle
#

Any interaction with your account must have manual confirmation. They're not going to let your game do whatever it wants to someone's account.

plucky prawn
hollow eagle
#

Which I think is also dumb, but that's still less of an issue than adding friends.

plucky prawn
#

and also join random groups and invite people to join groups and chatrooms

#

ye definitely

hollow eagle
#

Adding friends becomes a privacy issue since it affects who can look at your activity, inventory, etc.

#

So the best you can do is trigger a prompt.

plucky prawn
#

ah ye i forgot about that

lost inlet
#

typically you'd have a button to open their steam profile instead

#

where you can obviously add them

fluid summit
#

Hi everybody! should the main camera be replicated in a mmorpg or just leave it on the remote?

burnt tundra
#

Hi guys,
I Have persistent level(room) and 2 streaming sub level(actor& light moved)
I want to know how travel/teleport/transition between Sub levels and persistent level.
I tried direct jump on sub level 1 using open level by name it showed actor of sub level not actor & floor persistent.

late vale
#

I just switched from Character to Pawn and I realize non of my movement get's replicated. I've enabled Replicates on everything though nothing

twin juniper
#

I'm having trouble getting 'server travel' to work and I'm not sure why. Afaik I do NOT want seamless travel because I am changing a whole ton of settings, for example the game mode class when I transition from my main menu level to the level I am travelling to. here is the BP I have (I have also tried all lowercase)

#

I double checked that my name input matches the level name exactly

#

I have seamless travel unchecked, this is run in the game mode of my title screen level (different game mode to 'Sonoran_Desert')

#

When I run on listen server mode, the server travels though (apart from a load of error messages I get since I haven't setup my 'title screen' to run with listen server)

#

Read a bit in and says I might need to create a session?

crimson void
#

Hi guys, ive watched a ton of multiplayer tutorials now and they are always with some kind of join / host based style. I am looking more for a tutorial/way to make multiplayer support via login and world select or something. Anyone can point me towards a good solid tutorial that focusses more on that? I see these tutorials of join/host and its just not the type of multiplayer im trying to realise

kindred widget
# crimson void Hi guys, ive watched a ton of multiplayer tutorials now and they are always with...

Login and world select sounds a lot like MMO style login? If that's what you're after, you're not going to find tutorials on it because it's not an easy weekend project. You require a backend server for logging into for starts. That's not tutorial level things. By the time you are looking at implementing something like this, you know what you need to do to implement this because it's much less gameplay programming and very little Unreal related and very much server architecture which is a whole separate field entirely.

latent heart
#

You probably don't even want to connect to a "server" at this point, just use a local map with some socket stuff

crimson void
#

hmmm fair points ( I do own webservers, etc and I do understand its not a weekend project) but I thougth there might as well be a good fundamental way to learn how to make mmo based multiplayer (indeed) as thats the kind of multiplayer setup im after for the long haul.

#

just to make a hub where people can connect, chit chat, etc

kindred widget
#

I'm not sure on the specific, but I'd imagine you just need to have some form of interface between your Unreal application and the server. Seen some mentions of people doing stuff like a single component that handles that through the PlayerController and such. Random googling seems to suggest that REST web servers are pretty easy to use with UE4.

latent heart
#

You'll probably want to implement one of the popular OSSs.

#

Steam or EOS.

crimson void
#

Yes thats why I wanted to play around with it and seek further, I also got developers available for server side preperation just wanted to find a very good base that teaches exactly what im looking for as all the other multiplayer videos I checked are certainly not

crimson void
# latent heart Steam or EOS.

Well I looked into Steam multiplayer tutorials as well but I somehow got the feeling thats also still host / join based

#

not as much the way I envisioned which was launching 1, 2 or 3 worlds which people can connect to and interact with the players in that world

latent heart
#

When I say you want an OSS, it's just so people don't need to sign up to one of your services and then you don't have to handle user management.

#

You don't need to use the server stuff at all at this point.

crimson void
#

You mean there is a way to realise it without a server?

kindred widget
#

I feel like ARK might interest you in their implementation. All of their connectivity and such is done through Steam. But they do manage their own gameplay world servers as well as allow users to host their own unofficial ones.

#

Players have their own character name, but all of their data is connected to their Steam ID.

crimson void
#

Online Multiplayer Unreal Engine | 02 -2 | Hosting a Steam Session | Tutorial Series

#

I was watching part 1 and part 2 of this one

#

it was around the steam ID indeed through a Steam plugin for unreal engine

#

but then again the join / host part lol

kindred widget
#

They kind of get around requiring a backend server even for character transfers between servers because it's all handled locally through savegame stuff.

crimson void
#

Will it be sufficient for a hangout/chit chat metaverse concept or would I be wasting time going into that direction via steam integration?

rotund onyx
#

Does anyone know how I can transfer save files to connecting clients? They are too big to simply replicate

quiet fjord
#

Guys, how can I turn off an actor so that he does not reply?

lost inlet
#

Not sure I follow…

ancient badge
#

Hello, quick question.
When i save an integer in my GameInstance, for example 100 for health and i change the level, that integer should be saved and taken to the other level right?

lost inlet
#

Not sure how that’s MP related

#

The GI can’t replicate

ancient badge
#

Ok, and what if i join a listen server?

sinful tree
#

That being said, the server cannot directly access a client's game instance.

lost inlet
#

It exists for the length of the game session or however long a server is up for

#

It does not replicate, you cannot call RPCs through it

#

It’s commonly used to persist data between map changes but there are other ways to do that too

ancient badge
#

What i'm doing right know is that i create a varibale that i save inside my gameinstance and "join" a listen. The Listen server does the same.
When the listen Server and the client both are connected. The Client and the listen Server use the variable that the listen server created.

sinful tree
ancient badge
#

But the client should use the variable he created from his gameinstance

rotund onyx
#

I'm basically asking again to find out if anyone has found a better way

#

It is surely not an uncommon need

lost inlet
#

Large file transfer for that specific purpose is, for modding not so much since that has a centralised cloud service usually

shut compass
#

Blob would help.

late vale
shut compass
#

Sample

late vale
#

I'm not sure you know what I was asking

#

I was asking someone else if the Plugin was still on somewhere like Github or if not maybe they could link me a guide to replicate pawn movement

quiet fjord
#

Guys, how can I turn off an actor so that he does not reply?

sinful marlin
#

What do you mean by "not reply"

graceful flame
#

Disable tick?

quiet fjord
#

I want an actor to ignore sending packets to my server, that's how it is

lost inlet
#

what?

#

also it'll only send packets to the server if there's net ownership

lost inlet
#

you're either calling it twice or NewVar0 defaults to 1

#

which is not really a networking topic

#

which is still not a networking topic, add a breakpoint to the set node

#

and it'll probably tell you why

#

so are you going to test the breakpoint or not?

sinful tree
#

What is calling the aaaa event?

#

How is the aaaa event being triggered? What is making it run?

#

Ok, and you only have 1 thirdpersoncharacter in the world?

#

So each Character then will end up calling that event. Increasing the value to 2.

#

Eg.
Character 1 joins the game > Calls aaaa function > NewVar0 = NewVar0 + 1 = 1
Character 2 joins the game > Calls aaaa fucntion > NewVar0 = NewVar0 + 1 = 2

#

Correct

#

I'm not really sure what you're trying to accomplish as your variables don't give any indication, so I wouldn't be able to tell you.
What is it that you're trying to keep track of?

#

Ok, but why is it that you're incrementing by 1. What is the meaning behind that 1?

late vale
#

Doe's anyone have a guide or willing to help me through replicating Pawn Movement? I'm not the best with multiplayer stuff

#

The only thing I can think of right now is to update a Location Variable whenever the Owning Client Move's and then every event tick set the Actor Location based on that Location Variable on Server

sinful tree
#

Well, what you have right now is that it's incrementing a value any time a ThirdPersonCharacter begins play. So whenever someone joins into the match with a ThirdPersonCharacter, or any time you may respawn a ThirdPersonCharacter, that counter would increment by 1 and since it is a replicated variable it would be getting sent to all clients when it gets set (so long as it is on a replicated actor, such as gamestate).

With that variable having no context, then you can't really ask "What's the best place to call aaaa event" as it doesn't matter where it is called from but just know that any time it is called, it will increment. Eg. If you called it from Begin Play on game mode or on the level blueprint, it should only ever increment once. If you called it from PlayerState or PlayerController, you'll still get 2 if you have 2 players.

GameState can be thought of a shared, common location for values that both clients and server can access, and there's only 1 of them that exists in the game. So it's a good place to store things like cumulative team scores, time remaining, objective statuses, etc.

lost inlet
late vale
#

Well for now I was just using the Floating Movement Component

#

I have added my own Input's with Movement in the Event Graph

lost inlet
#

not sure what's up with the superfluous apostrophes but the pawn itself should be able to replicate its position as-is

late vale
#

According to other's Pawn's are unable to

#

They said it's best to make your own Movement Logic

#

Just not sure where to start

sinful tree
#

Listen server is having one of the clients act as the server or "host" for the game and all other clients connect to that host. So if you have 2 players, the main editor window will usually end up being the host/server, and the second window will be a client that connects to it.
Playing as Client means that a separate dedicated server is run in the background, and the active play in editor clients connect to it. So if you have 2 players, both of those players are only clients and connect to the background server process.

#

Generally speaking, the HUD class.

restive briar
#

I am using a player controller, to check
But is there a better way? to check?

winged badger
#

other clients only have their own player controller

#

so that multicast won't reach them

#

when player A multicasts form the PC, client B doesn't have a player A PC to receive that multicast

#

you should move that to the Pawn/Character

restive briar
#

Is there a better way?

winged badger
#

multicasts from PlayerController will not work

restive briar
winged badger
#

reference to player A player controller will come as null on every machine except Player A's and server

#

so yes, don't use a reference that cannot be resolved

#

and never connect GetPlayerController[0] after any kind of RPC

#

you branch after 44 will only ever return true if its the player that gave the original input

#

you also don't need that check to begin with

#

i am struggling to divine the intent of that piece of code

restive briar
winged badger
#

then you want NOT IsLocallyControlled

#

and you don't need to push any reference through the RPCs

restive briar
#

@winged badger My problem is in the red box.
Suppose if I have a lot of events, I'll need to communicate them all, until I get to the branch

restive briar
winged badger
#

get rid of all PC referecnes

#

and just have branch check IsLocallyControlled

#

and its its NOT, play montage

#

im off to bed

restive briar
winged badger
#

delete them you don't need them

restive briar
#

wait

#

@winged badger awesome, it works

#

Thank you

terse prawn
#

Does world composition level streaming work out of the box in multiplayer, or is there additional setup needed?

rich sinew
#

Could I replicate a const pointer like this?
UPROPERTY(Replicated) AActor * const MyActor;

grand kestrel
#

How can you assign to that if it's const

#

You can do const AActor* MyActor but you can't have a const pointer (but it can point to a const object)

#

Come to think of it not sure I've checked if you can mark a const actor as uproperty either @rich sinew

rich sinew
#

thanks!

warped berry
#

how do I properly disable movement component replication for a limited time and then enable it back again?
I've tried MyCharacter->SetReplicateMovement(false); and then setting it to true again but after that the movement does not seem to be replicating correctly

#

the character moves too fast

#

too fast on his screen and on other clients it's just stuck at the point where I first disabled the movement replication

late vale
#

If I wanted to replicate the rotation would I need to set these in a variable instead?

low helm
#

Looks like a replicated book

#

Bool

#

If clients don’t have another way to infer the change

rocky night
#

HELP! 🙂 up is the HUD function to set visibilty to the Icon (Flashlight)
down is in the Player BP (Where the switch happens by Pressing F
Gadget Selected is just an integer.. so i need when player switch to Flashlight that it shows flashlight icon.. works alone but just on serverside, client sees nothing
would be glad to get an advice on that

#

i just want to see the flashlight icon on server player and on client depends who is using it

ancient bramble
#

any1 know what this error is?

low helm
waxen socket
#

Quick question this morning:

What's more performant, two separate RepNotify variables or one RepNotify struct with two member variables?

Any advice would be appreciated.

Cheers.

summer tide
#

Is this the right way to write repnotify in c++?

if (GetOwner()->HasAuthority())
{
    bIsMounted = true;
    OnRep_IsMounted();
}
else {
    ServerSetIsMounted(true);
}```
chrome bay
waxen socket
#

Jambax, my hero.

kindred widget
#

Only reason to care about bunching or not care, is based on what you need the be replicated together. If you set two separate properties you can't promise they'll both be set in an onrep. Bunching them in one struct you can.

chrome bay
#

perhaps not having it in a struct means a smaller property header.. but I don't think it's worth splitting them if two vars make sense together

winged badger
#

you do ```cpp
UPROPERTY(ReplicatedUsing = OnRep_MyProperty) SomeType SomeProp;
UFUNCTION() OnRep_MyProperty() {}

#

and engine will call it when appropriate

waxen socket
summer tide
winged badger
#

you don't

#

engine does

summer tide
#

So the variable doesn't need to be set using server rpc as well.

winged badger
#

then forget the source of that information exists for your further learning

#

difference between BP and c++ OnRep is that BP will call OnRep on server as well

summer tide
#

So all i need to do is this in normal function? bIsMounted = true;

winged badger
#

you also need GetLifetimeReplicatedProps entry for that property

#

in addition to that snippet above

summer tide
#

DOREPLIFETIME_CONDITION_NOTIFY(URComponent, bIsMounted, COND_None, REPNOTIFY_Always);

winged badger
#

when client receives replicated data, it will use reflection to examine if OnRep function exists, and it there is one it will call it

#

you have4 one OnRep overload available, too

#

UFUNCTION() OnRep_MyProperty(SomeType OldPropertyValue);

#

then you'll have a value before replication available as function parameter

#

(at the time OnRep is called, the property already has new value assigned to it)

summer tide
winged badger
#

yes

summer tide
#

ok thanks

winged badger
#

always means that it will OnRep even if new value is the same as the old one

summer tide
#

So REPNOTIFY_OnChanged is a better choice then

winged badger
#

if that was always true, Always wouldn't exist

summer tide
#

i c

ancient bramble
summer tide
winged badger
#

you can OnRep_ActiveMontage

#

but you probably won't achieve production value with that

#

it would cause problems like client walks into relevancy range, and all the enemies get up on their feet to replay the dying montage

#

which leaves you either the RPCs or the Timestamp added to the Montage pointer and synced network clocks

#

for a learning project though, OnRep alone will do

summer tide
#

nice .. Good to know

summer tide
winged badger
#

possess and attachtocomponent will replicate on their own

#

\movement mode can be dodgy and situations where that desyncs are not pleasant

pallid mesa
#

I mean as an universal solution.... read engine code

summer tide
summer tide
pallid mesa
#

you look at the code at the function that you are calling

#

and you'll find the properties it mutates, their context

#

whether they replicate already

#

it's field work, really.

winged badger
summer tide
winged badger
#

source code

summer tide
pallid mesa
#

that's not what Zlo means

#

what Zlo means is that in order to read engine code

#

you have to open Visual Studio o whatever ide you use

#

and read the actual functions in C++ that you are using in your blueprints

#

or in your C++ code

summer tide
pallid mesa
#

that's good :)

#

my apologies then thought u got confused there for a second :)

winged badger
summer tide
#

I'm doing all these in a custom component by the way

peak sentinel
#

It's implemented in a wrong way but if you understand the idea behind it you can implement it properly and upgrade it

#

Real difficulty starts when you want to implement rollbacks (reconcile feature), replicated root motion etc

summer tide
golden warren
#

I have a question
My projectile weapon won't hit at same location
"Spawn Transform" is same (replicated correctly) and Projectile Actor "replicates" options are checked, but it won't hit at same location, how to fix??

eternal canyon
vagrant grail
#

If I want to do a sprinting system for multiplayer ,should I use multicast or OnRepNotify as if someone joins later he won't be able to see the person sprinting if he started sprinting before the new player joigning ?

#

Please ping me if any answer

shadow aurora
#

Alright I need some input here... I am having a lot of trouble with SetActorRotation. I am currently executing it inside of a multicast function, but still getting a lot of jitter. The most annoying part is I can see that the function is in fact being executed on server, owning clients, and simulated clients.

Anyone have any suggestions as to what I can check here? I am not using the controller rotation for the pawn, so doing something like set control rotation won't do much here.

pallid mesa
pallid mesa
#

(Actually, now that I'm thinking, you might not need the onrep unless you need to propagate the value of maxwalkspeed for whatever reason to your sim proxies)

kindred widget
#

Basic idea is to let the owning client have direct control of their own rotation without server overwriting it, and just let other clients quickly interpolate to the same. Less jitter, no owning client fighting, etc.

late vale
#

For one Client I can move around but for the other client they also control the first Client but play animations on their pawn

scarlet olive
#

Why isn't this variable updating on the server? Calling this from the client as an RPC does update the variable on the client, which means the server must know the value.. except print string to check the boolean returns true on the server

low helm
#

it's not running the RPC

#

the client gets TRUE

#

turns its copy to false

#

and the server doesn't hear about it

#

err

#

show the print string

#

you may be on a different object on server

scarlet olive
#

There are also other gameplay effects based on the variable so can confirm two ways

low helm
#

is this on a character?

scarlet olive
#

And it does run the RPC. I set a breakpoint on the SR version (rpc) and it runs. Yes on a character

low helm
#

So this O press is running on the server's character

#

not the clients

#

So he's reading his own IsManifested value

scarlet olive
#

Yes

low helm
#

had to edit it

scarlet olive
#

How so? It starts false, run an event that sets true, it sets true on the server and the client but then setting it back to false doesn't work on the server, only the client. Even though the rpc works

low helm
#

Does the server have a character?

scarlet olive
#

Yes I'm playing as listening server. Also, I did this and manually calling the rpc works but not when called "naturally" 🧐

#

This part runs at the end of a multicast event maybe that does something?

low helm
#

ok well as I said, the server pressing O would just tell you the server's value on his own character, for more info you'd have to post more pictures, what feeds that switch node

scarlet olive
#

Original call to start the event that ends with ^ screenshot

low helm
#

what does the manifest event do

scarlet olive
#

Set visibility true on the character and some other meshes for a specified time, spawns a sound, then set visibility false again

low helm
#

is SR_Manifest set to reliable?

scarlet olive
#

It wasn't but I tried that and still nothing :/

modern cipher
#

what is the issue its not replicating?

low helm
#

keep it reliable

scarlet olive
#

Yeah it's replicating back properly when I play as client (pie) but when I play as server it doesn't set to false

low helm
#

I suspect it does and your way of verifying that is flawed

scarlet olive
#

I'm gonna try some other test environments and some more breakpoint debugging. I'll let ya know what I come up with. Thanks for the help!

late vale
#

Doe's anyone know why my character randomly teleport's when I begin the game?

modern cipher
#

the character should spawn at the player start actor location

late vale
#

As you see my Y for my player start's are around -226 for each

#

Though the Player almost goe's to the positive version of that number

late vale
#

I just tried a new level and I got 2 player's next to each-other but one spawn's sorta rotated for some reason

modern cipher
#

-226 is the player start y

late vale
#

None of my player start's in this new level are rotated

modern cipher
#

if you want them to spawn at a start point they shouldn't be already placed in the level i think

modern cipher
#

you said you got 2 player's next to each-other

late vale
#

Yeah?

#

Like they spawned because of the spawn point

#

2 Player's

#

But nvm I got it fixed

glad jasper
#

how do i pass data to a dedicated server on open level?

#

like in the case of a character select screen

sinful tree
#

What actor are you calling it on?

#

Actually, nix that.... Is this actor nearby to your clients?

lost inlet
#

you should always use play as client for testing this stuff since the first PIE window will be a bit more misleading

#

not sure why you're using WithValidation either

#

but if in doubt, post code

wild patio
#

question, is it possible to pass a reference of a skeletal mesh component to the server?

tranquil yoke
#

you should pass Actor Reference and find component Inside, this will only work if server has this Actor also @wild patio

wild patio
#

I have a player pawn with skel. mesh on the owning client, also on the server. for some reason I can get the anim_bp reference from the mesh on the client, but when the server tries the same, the anim_bp reference is invalid

#

it seems like when the pawn is created on the client and the server, the client and server skeleton mesh have their own anim_bp

#

unless i'm mistaken? are there limitations or default behavior here i'm missing?

#

side note: it's an actor component doing this replication that's attached to a pawn. the server has no trouble getting the anim_bp instance reference in the pawn itself. but the actor component on the server can't get the anim_bp reference. it's so strange.

#

i'm assuming there's some small thing i'm missing

uneven gyro
#

question about multiplayer, was looking into some documentation about ports on the local router, any way to get around this ? for local multiplayer what if the ports are closed

sinful tree
latent heart
#

There's some hole-punching stuff routers normally use. How it actually works, no idea.

late vale
#

What would be the best way to get player character for multiplayer use

sinful tree
uneven gyro
#

ok great thank you 🙂

late vale
#

I'm a little stupid but I've seen people using ig a plugin called UPNP and I'm not 100% on what it doe's

#

Is it a way easier way to open port's without port forwarding?

#

I seen from it's examples that you can easily add different Internal/External Port Mappings using blueprints

bitter oriole
#

If you're using Steam there is no need for any work on this

late vale
#

Not planning to pay the Steam fee

#

Well maybe later on I will

#

Would you recommend doing this or using Steam?

bitter oriole
#

The UPNP plugin is literally half the cost of that fee

#

And Steam is essentially the PC market

late vale
#

So with Steam can I essentially Host Server's and other's be able to join them without having to port-forward or anything else?

#

And would that work with any Platform or only PC

late vale
verbal tendon
#

That is needed for player hosted games, due to residential routers providing firewalls for their users, which also impedes games' multiplayer capabilities

late vale
#

Isn't there a lot of limits?

#

And I'm not really a CPP person

#

Though assuming Steam isn't cross platform this would be more fitted for my game

late vale
bitter oriole
#

This is only required when players host (listen server, player hosted dedi)

late vale
#

Yeah Players can host

verbal tendon
# late vale So I should use EOS with UPNP

No you want to use EOS with a EOS plugin from the marketplace. The entirety needs some configuring on the Epic backend but it's by far the best solution for developing player-hosted games

bitter oriole
verbal tendon
#

And if you are new to Unreal Engine I would suggest making a Singleplayer game before even attempting a Multiplayer one

verbal tendon
#

Multiplayer makes things exponentially more difficult especially if you have zero to little prior experience. Once you have completed a Singleplayer game from start to finish give a Multiplayer game a go from scratch

bitter oriole
#

Er

#

(nevermind)

bitter oriole
# late vale No

Alright so players host their own servers, or are you doing listen server ?

late vale
#

Players Can host their own servers

bitter oriole
#

If you're doing a multiplayer game with dedicated servers hosted by players it seems to me that Steam is the easy way

late vale
late vale
bitter oriole
#

So listen server = one player is playing and acting as host

late vale
#

Yes yes

bitter oriole
#

In this case if you're not familiar with C++ Steam is pretty much the only option

late vale
bitter oriole
#

It costs more than access to Steam which gives a lot more

late vale
#

Though the Cross platform

verbal tendon
late vale
#

It's fair just pricey for me

bitter oriole
verbal tendon
late vale
bitter oriole
#

Do you know how long your updates take to be published on XBox vs PC ?

#

(since you need the same game version at once evrywhere)

#

etc

#

Personally I think cross-platform as an indie is nightmarish, and it's also pointless for listen servers because you just need like 3-5 players

#

It's a lot more relevant for dedi based games that have 30 players per instance that need to be found

late vale
#

50 On 1 server

bitter oriole
#

I'd put 8 as a max depending on the game type

#

50 is also nonsensical for an indie, 90% of Steam games will never have that many players online

late vale
#

It's not based on how many will play its based on our game

#

Now please if you'd stop shitting on me honestly

bitter oriole
#

I'm not shitting on you, I'm advising you

late vale
#

Well then if I want 50 I want dedicated?

bitter oriole
#

Yes, absolutely

late vale
#

Well no way to run that without a executable is there

#

I mean I heard of a BP Plug-in to run batch. I Could just use that and make it run a Server Executable in my game folder

bitter oriole
#

You probably want to be the one hosting the dedicated servers yourself in various areas of the world, as opposed to hoping some players want to run servers for you

#

But yes, separate game package entirely

#

Also require engine source build, and yes, ports or UPNP or Steam/EOS

late vale
bitter oriole
#

It's a separate copy of the game

late vale
#

Yeah?

bitter oriole
#

So you want it to be a separate download, since it's gonna be as big as the game

#

(Assuming you still want to rely on player hosting with the security, performance and availability problems that will cause)

late vale
#

Yes Player Hosting

#

I could switch to dedicated and use batch and a plug-in in some way to make the whole process easier for the player

#

Though that'd kill Console and Mobile Hosting wouldn't it

bitter oriole
#

You can't host on consoles or mobile anyway

#

Consoles maybe with very small player counts

#

On mobile the performance and connectivity makes it a non-option

late vale
#

Okay the performance isn't gonna be bad hopefully

#

I mean for a small pixel 2d based game

bitter oriole
#

Network performance

#

Phones typically lose connectivity entirely fairly often and when they don't they have high latency, packet loss

late vale
bitter oriole
#

Bandwidth is not the problem

#

50 players is usually difficult to run on actual servers in datacenters

late vale
#

Really?

bitter oriole
#

50 is absurdly large and hopelessly out of reach of indies

#

Again, not saying that to shit on you, just fact

late vale
#

Whatever just gonna give up

verbal tendon
#

I'm gonna reiterate my earlier advice: Start with a singleplayer game, work your way from there

#

You gotta learn to walk first before you can run

bitter oriole
#

There's very literally 2% of all PC games that can support 50 players together, and that's stretching it

late vale
#

Me learning single player magically makes thing's easier for multiplayer

verbal tendon
#

It gives your more context that you didn't earlier have

#

Context and experience are key factors in making the right decision when developing a game

bitter oriole
#

Do make a MP game if you want to, but if you're gonna make a MP game, don't you want it to be a success? I want your game to be a success

late vale
#

Not my game anyways

bitter oriole
#

Just trying to help that, if you don't want help, that's fine with me

late vale
#

I don't even decide on how large server's are

#

And then when a thing like port-forwarding is a thing
My other Team-Member get's mad saying that ruins the whole point

bitter oriole
#

Then it's also not your problem when it fails and we're all good. Do you still have questions on how to proceed?

late vale
#

What would be a high but playable number for Listen Servers

bitter oriole
#

8 is the maximum number I shared earlier, from my personal opinion

#

I'd suggest 3

#

Also needs to be purely cooperative (no pvp)

late vale
#

I only have PVE In Card Battles

bitter oriole
#

Sounds like 8 is fine then

#

Just keep in mind - if the host loses network for 5s, everyone goes back to the main menu

#

Unreal is not peer to peer, it's server based and if the server has any issue, everyone will immediately have obvious bugs

late vale
#

Doesn't EOS have that?

bitter oriole
#

No

#

You cannot

#

(Unless you rewrite multiplayer in Unreal from scratch with sockets)

verbal tendon
#

There's no fullmesh P2P, P2P refers to player hosted games

bitter oriole
#

EOS supports it, but as in "can work with", not as in "provides"

#

Unreal does not

#

It's entirely server based

#

If your game is fine with high latency and has little networking ongoing (you said card game), rewriting multiplayer is in fact not a terrible option

#

Build your own server stack in Python or something and use HTTP requests

#

Free cross platform, matchmaking, no ports problems, no player disconnecting the game

#

Not easy to do but very viable and frees you completely

late vale
#

It's just a Pixel 2D Game

#

Nothing much except Card Battles and Movement

bitter oriole
#

If the movement needs to be responsive in real time and synchronized across players you probably want to stick with Unreal stuff

late vale
#

Is what UE4 Use's better then P2P or Not?

bitter oriole
#

It's not better or worse

#

It's centralized

#

So single authority over the game rules and single point of failure

#

P2P games handle the loss of the host gracefully and usually share the authority somewhat

late vale
#

Okay let's go back.

#

If I want something based on UE4 System that is Cross-Platform and no Port-forwarding is Needed.

late vale
#

Though that still leaves me with small player numbers

#

Unless I use dedicated which only leaves PC User's to Host

bitter oriole
# late vale If I want something based on UE4 System that is Cross-Platform and no Port-forwa...

If you want cross-platform + no ports stuff, assuming you manage to handle the cross platform part, you have options:

  • hosting your own dedicated servers for players (enables 50 players if you ever see them) + EOS or your own matchmaking
  • using listen server + EOS (no 50 players)
  • using your own multiplayer system with a simple protocol like HTTPS on regular Web servers
  • do matchmaking and NAT punch yourself
#

Many options really