#multiplayer

1 messages ยท Page 73 of 1

latent heart
#

I would research nat punch through

twilit radish
#

What's the use case specifically for having a TCP connection though? It's quite the rabbit hole to do NAT punch through and you'll also need relay servers as a fallback because punch through does not always succeed. Not to forget that you're now dealing directly with hosting servers for all that stuff... Quite the hassle in the end.

hollow eagle
#

This is not P2P, this is a listen server.
If they are letting players host a server then it is either by spinning up a dedicated host elsewhere (like AWS) or using something like NAT punchthrough or relay servers with a lsten server.

crude marlin
hollow eagle
#

Frankly you are not going to find a solution to players hosting any sort of socket server without dealing with NAT punchthrough or relays. So pick your poison - at least for relays steam provides a free service for that but it requires that you use their networking.

#

There are services for NAT punchthrough as well but it doesn't work for everyone regardless.

#

Unreal has steam socket support out of the box - https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/SteamSockets/
Though I believe the plugin is specifically around replacing the default netdriver with a steam netdriver (which is only used for the normal unreal replication system) - it doesn't do anything for spinning up an arbitrary TCP socket server. For that you probably need to use the steam networking libraries yourself - https://partner.steamgames.com/doc/features/multiplayer/steamdatagramrelay

twilit radish
#

What kind of procedural meshes are we even talking about? Is this a procedural landscape? One character? Entire worlds full of different objects?

#

Because quite frankly I don't see how a separate TCP connection is relevant here. If anything it makes it a million times more difficult and doesn't really fix much if you ask me. Unreal is very much capable of reliably sending data. If it's too much split it up.

crude marlin
hollow eagle
#

procedural meshes sure but no sane survival game is sending the entire mesh...

#

if you cut down a tree you don't replicate the two halves in their entirety to everyone, you just send where the cut happened.

crude marlin
#

Well, by proc mesh data I kinda meant that.
I send all the data that needs to reproduce the proc mesh.
But over time that'll be a lot as well.

hollow eagle
#

Yes but you don't have to send it all at once

crude marlin
#

How do I know how frequently should I send it tho using unreal's udp?

#

I mean I'm not sure how it's handled deep in the source code.

hollow eagle
#

A common solution would be to check how much space is left in the reliable buffer every frame and send it in small chunks until you hit a threshold (you don't want to fill the buffer - that'd block other reliable RPCs from sending)

#

You don't use raw UDP

twilit radish
#

Regardless of splitting it up or not this is likely going to be a mess in the end. What if a player cuts up 5000 trees and a new player joins? You can't possibly send over all that data in a session. Whether you dedicated an entire connection TCP, UDP or what not.

hollow eagle
#

Sure you can. Just gotta chunk it up and send it, ideally with prioritization.

#

There's some point at which things will probably "break" but that's indeed not a problem with the protocol

#

that's just the limits of what you can realistically accomplish

twilit radish
hollow eagle
#

right

#

and it's not like clients always need the full state of the world anyway

#

it's not like when you load into a minecraft world the server sends you literally the entire thing, it only sends information about what's immediately around you

latent heart
#

If a player cuts down 5000 trees, chances are those trees aren't all going to be in the same 100 feet square. As siliex said, prioritise the ones closest to the client and maybe only 100 of those trees are even relevant where they spawn.

crude marlin
#

One tree will have around 2500 bytes of data at max to reproduce the proc mesh.
do you think this is a fine size?

twilit radish
#

It was an example of why a separate TCP connection doesn't matter. You'll need to be smart about it a different way such as indeed splitting up the data. Prioritizing it etc. or what not. That's what I was trying to say with that ๐Ÿ˜„

latent heart
hollow eagle
#

yeah this sounds like you're still sending the entire mesh or something

#

optimize down what you actually need to send, then see if you need to chunk things up.

crude marlin
#

Actually you're right mb. it's around 250.

latent heart
#

You can, realistically, generate billions and billions of unique trees with a single 32bit integer.

hollow eagle
#

250 bytes is nothing

latent heart
#

(that's 4 bytes)

#

You could even have a pregenerated (or generated on startup) list of 100 trees and just re-use those meshes. That'd probably speed up your rendering too.

#

Then you'd only need a single byte.

crude marlin
latent heart
#

How many cuts before it falls down?

crude marlin
#

it's not yet a stable number but around 7 maybe

latent heart
#

Or is "you could have 100 cuts in different places and it'd be okay"

#

So realistically, you need 2 bytes per cut (one for height and one for rotation)

#

And you can adjust the trees which are hit on a per-tree basis.

crude marlin
#

wait I haven't thought as height and rotation
I saved the cut loc with with FVector location and FRotator rotation.

latent heart
#

Why?

crude marlin
#

Now that you say this, it might be possible with that.

crude marlin
latent heart
#

uint8 (1 byte) gives you a granularity of 256. If your tree is 10m high, that's a granularity of 4cm and about 1.4 degrees.

#

I don't think anyone will complain about that. ๐Ÿ™‚

crude marlin
#

Oh I actually know.
Because of the depth I was just using a vector for loc so it's exact. We couldn't really send only the height, because linetrace is quite problematic with proc meshes.

latent heart
#

You could even (locally) adjust the roll of the cuts randomly by a few degrees to make it look prettier.

crude marlin
#

But I might do a calculation for a depth and then only send height depth and rot

latent heart
#

You can encode that into a single byte.

#

How tall are you trees?

crude marlin
#

I can't really tell an exact size. I don't know

#

but let me check it quickly

latent heart
#

Well 3 bytes isn't so big.

crude marlin
#

wait 3 bytes?

latent heart
#

The point is, over the network, size matters. Sending 32bit floats (or 64bit floats) is very bad for something teh size of a tree.

#

height, rotation, depth.

#

64bit floats represent the solar system, not a tree.

crude marlin
#

lmao

#

yeah that's actually right

latent heart
#

(64 float can represent the solar system on a cm scale out to Saturn or something like that)

#

Going back to the random trees for a moment, do you know why I said 4 bytes (32bit int) can represent billions of trees?

crude marlin
#

well, I guess cause a 32bit int has that much value, so it can represent billions of trees.

#

I mean like combination no?

#

Alright cool, thanks for this guys, I'll rethink the whole system with this knowledge.

#

This helped me a lot

latent heart
#

No - it's because random number generators aren't random.

#

You can set a known seed value (your 32bit int) and then get the same numbers out of it every time.

#

So you can generate a random tree on your server with the seed value 1 and get the same return on the client with that same seed value of 1.

#

So you only need to tell the client what the seed is and they can generate your tree.

hollow eagle
#

Ye if each tree is generated based on a deterministic random algorithm then a single number gets you the entire base mesh, so you only need to send that + modifications to it after it was generated (which are ideally in a super packed format).

#

Even sending cuts - you don't need the precision of a full FVector. Even a netquantized vector is probably overkill - you could send a super well packed format based on like circular coordinates or something - a few bits for height relative to the base of the tree, a few bits for rotation around the tree, a few bits for angle of the cut.

#

Ideally when making the cut in the first place you quantize everything to those values so that the server's exact representation of the mesh matches what you send.

latent heart
#

I was thinking that, but I'm not sure you can compact it all into 2 bytes. Probably 3 is enough for everything.

hollow eagle
#

It's something you'd have to play with to see what the minimum for good results is.

#

Even a 32 bit int for a seed could be way overkill - realistically how many variations of trees do you need ๐Ÿ˜›

#

32 bit int as a seed for an entire world would be fine, but then you shouldn't need more seeds for each thing inside the world since they'd just be generated from the initial seed.

latent heart
#

Hehe. True.

crude marlin
#

Okay I kinda understand it, but not fully. So a random seed represents a tree, but how does this work in practice, I mean how would the system work?

latent heart
#

As long as your tree has a unique way of identifying itself, you're good. Tree #352 has to be the same everywhere.

#

That's integral to how your tree is generated, Edmm.

#

How do you generate it?

crude marlin
#

I have a "cut mesh" and I basically do a boolean to calculate the mesh that has cut into it.
Using the MeshOps plugin on marketplace.

latent heart
#

What about the tree itself?

#

Before it gets cut.

#

Are they all teh same?

crude marlin
#

yeah, it's a static mesh turned into proc mesh.

latent heart
#

I think we've been operating under the impression that all your trees are unique.

crude marlin
#

oh, no they aren't

hollow eagle
#

oh so you don't even need to know an initial seed. Maybe an id for the tree type if there are multiple initial meshes.

crude marlin
#

only the scale is different

latent heart
#

Yeah. I'd go with a range of different meshes. Nobody likes the same tree everywhere.

#

Even if it's only 4-5, it will make it feel more alive.

#

And don't forget random rotations.

#

They do this in blood bowl 3 with blood - there's just a single blood decal that they rotate in 1 of 4 directions. It looks horrible.

crude marlin
#

I mean yeah I have different trees, but it works with the same system. the foliage has an id and when we interact with it, we spawn the proc mesh based on that id.

latent heart
#

Ah okay. Fantastic!

#

So basically you can ignore everything we said about randomness and seeds.

#

๐Ÿ‘ ๐Ÿ˜‚

crude marlin
#

At least I learnt about new things lol

latent heart
#

I can see where you'd be getting confused, though! Heh

noble sentinel
#

How can I test my multiplayer steam game with 2 different accounts at same pc?

#

I need to bug check but I cant find anybody so I need to do it alone but steam isnt allowing 2 account at same time so Im stuck

hollow eagle
#

You cannot - steam doesn't allow it.
You can test without steam, but if you need to test specifically with multiple steam accounts then you'll need two PCs or a VM and a beefy PC.

noble sentinel
hollow eagle
#

You can test basic multiplayer without using steam. If you want to test steam features specifically then my answer doesn't change.

#

Again, steam doesn't allow sign-in to multiple accounts at the same time.

noble sentinel
#

So I cant join a server hosted by my other editor, as Im using advanced steam sessions

kindred widget
#

If they're not Online Subsystem features, just test by connecting manually with a console command.

hollow eagle
#

You can, you just do it without using a steam session.

#

furthermore you don't even need two editor instances (nor should you use two)

#

you can test multiplayer PIE, or just run two separate standalone instances.

noble sentinel
#

Anyways, the thing I was trying to test is, sometimes when people join a server, they and their screens are stuttering too much while walking. or doing anything

#

This isnt happen everytime and everybody

#

Sometimes its just unplayable stuttering and sometimes its good, is this caused by some network problem?

#

The thing I mean by stuttering, its like server dont accept their movement and forcing they to stop everytime

hollow swallow
#

Trying to spawn a fireball for when my player casts a spell. But if im playing as the client it keeps spawning 2 fireballs, one from the server, and one from the client. How can i make it so it will only spawn 1? If im playing as the host it works fine. only doubles up as the client

latent heart
#

You need to restrict the anim notify event flow to the server only.

#

I forget the exact node.

hollow swallow
#

is it the has authority node?

#

because i cant use that inside the anim bp

latent heart
#

Well, the issue is, both the client and the server are playing the animation and they're both calling server_castspell.

#

So it's happening twice.

hollow swallow
#

yeah thats right

#

just trying to find a solution. i also need to know which client is casting it so it ignores collision on them, thats why im trying to pass through the owner

latent heart
#

So put some sort of check in so only the server can cast the spell. If it cna't happen in the anim bp, put it in the cast spell method.

#

Make it not a server function at all (the client doesn't need to tell the server...)

#

And add a check.

hollow swallow
#

just discovered the IsServer node, all working well not. Thanks mate

latent heart
#

Np

hollow swallow
#

is there something that only a client spawns but a server wouldnt? if i use IsServer as false, then the host cant spawn it, but it works perfect for every other client. If i have it as IsServer True, then i cant get the owning actor to check if the fireball hits itself and does nothing, or if it hits another player

#

Thats what im currently using, so if its not the server, it will pass on the owning actor that i can check collision against

latent heart
#

Local Visual effects. Sounds.

#

Like you fireball would be a bad candidate because it probably has to travel and hit something.

#

But let's say you have a hand glow particle effect or something, you'd probably just add that on the client.

hollow swallow
#

yeah, my first time working all this out. My current setup is that anim notify triggers, calls an event and passes on the player who triggered it. That then calls a server event to spawn an actor and set the owner. Then when that projectile spawns, on collision it casts to the bp_thirdpersonplayer and checks if thats == to the owner, if so, ignore it. if not, damage the player

#

then that projectile actor has all the logic for sounds / vfx / impact etc

crisp sable
#

I created a blueprint for my GameInstance and assigned it to be the default GameInstance Class in my project settings.

#

The problem is, when I run a dedicatyed server , I get this message complaining that it can't find my blueprint

#

Can anyone help me resolve this error ?

hollow swallow
#

Any idea why this only works for the host? For the client it gets the wrong location for the spell mesh

crisp sable
#

Is the Spell Mesh Component replicated?

#

maybe you need to set that to replicate

hollow swallow
#

yeah, that ac spell system is, and also the spell mesh itself is

crisp sable
#

I'd need to see more of your blueprint to figure out what's wreont

#

wrong

#

show us an image of your detaisl panel for the Spell mesh

hollow swallow
crisp sable
#

can you post a pic of the details panel for the AC Spell System

hollow swallow
#

on this part, i want it to spawn the spell from server only. and it passes through the character object reference into instigator the pawn reference, and from that im trying to cast to my bp_thirdperson to access the spell mesh through that

#

i need it to pass through the client whos calling the function. But if i set is server to false, it will only work for clients. and if i dont have it, then it spawns the spell twice, once for server, once for host

#

long story short, i just need a way for it to fire that anim notify once. It will if im the host, it will fire twice if im the client. If i try use that IsServer, i run into all these other issues

#

Finally fixed it. Just made it set a bool so it wont fire twice

subtle peak
#

Hey boys!
Every 0,3 seconds I run a small trace in front of the player to see if it should lower the weapon. This is done on owning client only.
Problem is that the "lower weapon" bool needs to be set on multicast for the other clients to see the animation that changes too, right?
So do I need to change the entire trace event to multicast? Is there a better way of doing this?

rose egret
#

@subtle peak I think u do it on each clients localy, no need for replication,

subtle peak
#

set by the bool

twilit radish
#

That's because I assume it's a replicated variable right? A client can not set this directly. Only the server can use replicated variables. The way to do this would be to RPC up to the server to change said variable. But I would be curious if it's really needed to network this at all. Would there be any problem with just having clients locally check them selves if a different client needs to lower their weapon? ๐Ÿ˜„

#

If all it does is play an animation to lower a weapon when there's something in front of them I think a networking layer is not needed.

subtle peak
#

Ahaa! Thanks! But if its not networked, then the other players would see each others guns clipping through walls, no?

latent heart
#

Just an fyi, you can't multicast from a client. You would need to tell the server and then the server multicasts it.

twilit radish
#

Imagine it like this: Say you have 2 players. One player looks at the other walking in to wall. Both locally do your linetrace to see if it needs to lower the weapon. The player walks into the wall and soon enough both will locally say "This person walked into the wall. Lets lower the weapon"

latent heart
#

But, yeah, this is purely cosmetic, right? Do it locally per client.

twilit radish
latent heart
#

Agree. Just wanted to make sure they knew about client and multicast!

subtle peak
#

Thanks guys!

hollow swallow
#

on collsion, how can i check if the thing i have hit is a player or not?

latent heart
#

Try casting it to APawn

#

Unless you have AI running around, that'll work.

hollow swallow
#

i feel like it might be a lot of casts then. For every object inside its collision it will cast to see if its a player, or if its another projectile, because i want it to ignore projectiles

latent heart
#

That's fine.

#

Casting is free.

#

It's only when you cast to classes with hard linked assets that you get a problem.

#

And APawn, specifically, has none. That's why I suggested it.

#

Additionally, any cast to a c++ class is just free regardless because they are all loaded automatically anyway.

subtle peak
#

gif above

latent heart
#

That appears closer to a 100% chance.

subtle peak
#

Next one collided, but the recording ended

#

and it works fine in standalone

latent heart
#

What happened when it collided?

#

Explodes?

subtle peak
#

yeah it does whats its supposed to, rolls around for three seconds and explodes

latent heart
#

Honestly not sure then. ๐Ÿ˜ฆ

subtle peak
#

I tried messing with these settings, but didnt seem to help much

hollow swallow
#

So its fine to run casts like that?

#

and they will expand for each type of enemy i want the spell to attach to. thats just making sure it isnt another projectile. And checking if its a player to attach the burning effect to them

subtle peak
latent heart
hollow swallow
#

does it matter that this projectile actor gets destroyed about 10 seconds after hitting?

#

does that get rid of the hard link?

latent heart
#

No. Simply having a reference to the other BP anywhere in the graph hard links them together. It doesn't have to be a cast. Any reference.

hollow swallow
#

hmm, what would be my best solution then? i want the projectile to make sure it doesnt hit another projectile. and i want to check if it hits a player or enemy?

#

all my enemies / projectiles are set up with a master actor, then i make child bp's of them

latent heart
#

Are projectiles based on pawn?

hollow swallow
#

the pawn requests for the server to spawn them, and the player that wanted to spawn it is set as the instigator

latent heart
#

But the projectiles themselves aren't pawns?

hollow swallow
#

no just actors

latent heart
#

So do what I suggest earlier and try casting to pawn. Or even Character (if all your guys are based on Character).

hollow swallow
#

but what about checking if theyre an enemy, or other projectiles etc...

#

casting to pawn is working, so that saves a bit there

#

but yeah im going to have all the other stuff to check as well

latent heart
#

An easy way would be to check if it has a player state. AI don't have one by default. Or try GetPlayerController on the pawn. AIs don't have a player controller.

#

Depends if you mean "enemy" or "ai".

hollow swallow
#

my enemies are of a character actually

#

the enemy ran into me while i was on fire and the fire jumped to them xD

latent heart
#

Human controlled?

hollow swallow
#

ai

latent heart
#

Single player game then? Then just check if they have a player controller. No player controller = not you.

hollow swallow
#

multiplayer

latent heart
#

So there are human controlled enemies then...

#

Eh. Just go with your blueprint.

hollow swallow
#

i set them up a long time ago and didnt get into them much. from what i remember i made a character bp, then attached an ai to them, and use behavior tree to control them all

#

ill deal with them at a later stage haha

latent heart
#

I would use player states for team info, though, rather than character.

hollow swallow
#

just more after a solution to not have to cast to, check if player, check if enemy, check if tree, check if any other object i want to attach my fireballs to, it could become a decent size list and will kill performance

latent heart
#

Use an interface?

#

Try checking if it hits a projectile -> ignore. If it gets an actor, cast to the interface. If that fails, it's hit a wall or something. If it's true, it will be something important.

hollow swallow
#

rogey ill look into interfaces, thanks for the help, appreciate it!

latent heart
#

Interfaces also avoid linking classes together!

hollow swallow
#

what about searching by tags first? or is that also not very performant

pallid mesa
#

Thats okay, but it is a bit limiting

#

depending on what you want to do it might be totally okay

hollow swallow
#

Until I learn interfaces. I'll check the tag for player / enemy / tree to check the tag before I bother doing any casts. Just to help it a little bit to get by for now

pallid mesa
#

๐Ÿฆพ good luck learning!

cyan mirage
#

Hi everyone. So I'm feeling a lot more comfortable with understanding unreal's networking and replication after binging tutorials for hours, and I have some basic examples set up. My only issue though is that I'm struggling to find a way to replicate physics. In one of my examples I have a balloon tied to a weight, any client can walk into the balloon or weight and push them around. The issue is that the balloons quickly become out of sync so I tried replacing the base class of the actor as a Static Mesh Actor and setting Static Mesh Replicate Movement to true which does work but only for the root of the blueprint. If I have a more complex blueprint such as my balloon which has 2 static meshes and a constraint how can I replicate physics?

kindred widget
# cyan mirage Hi everyone. So I'm feeling a lot more comfortable with understanding unreal's n...

There is no real surefire way to fix physics in networking. If you want an easy quick and unoptimized way, just replicate the object's Linear, and Rotation velocity, it's location, and rotation every so often, and have the client set their stuff to that. It kinda mostly works as client will simulate a few frames between replications and most corrections aren't heavily noticed. But it costs a lot of data. Not wise to do for a lot of objects, and needs a system in place to disable this so that it won't continue replicating on non moving objects.

cyan mirage
hollow eagle
#

the level will load first but there's no guarantee on the order that actors are received or initialized.

worn wagon
#

I'm curious, what exactly happens if you join a player's session but don't client travel. What actually changes on the client and the server? I sort of know but I'd have to investigate more, just wondering if you guys already knew. Like does the client get the gamestate/playerstates if they don't travel, since they already have existing versions of those classes on whatever level they are in.

#

Reason is I'm doing a lobby system and I'm wondering if I need to client travel and reload the whole menu level or just send across what's needed

weary lichen
#

Hello i have a problem when i possess a character from listen server, the client works fine but i can't move, rotate etc on the listen server

weary lichen
#

if i set default pawn to none and i possess after it don't work for listen server

#

but if i set a default pawn and possess after it works

#

I just found

#

i was adding the mapping context in beginplay, so before possessing, so controller was null

grand tree
#

hey guys, I'm currently experiencing an issue when attempting to test mp in PIE: If I select 3 players and then launch as listen server or as a client, it launches 1 pie window and then 2 standalone. Only the first window launches as PIE, while the rest are standalone for whatever reason. Is this a known issue? I don't think my settings are incorrect, but who knows lol

#

i'm on 5.1.1 and am using the default build if that helps

kindred widget
grand tree
#

ohhhhh that would definitely be it then

#

thank you

#

yup that was it ๐Ÿ‘

quartz smelt
#

How do you guys like to change max speed? I've seen some friends do it differently so I wanna know how you guys do it:) -- while ingame

rich sinew
#

Hi there, i have a question about replication in blueprints that should be somewhat simple, i'm working on a top down prototype where the mouse position controls the character orientation, but i don't know how to replicate it properly, this is my current setup on the PlayerController and CharacterBP and a small clip demonstrating what happens:

sinful tree
# rich sinew Hi there, i have a question about replication in blueprints that should be somew...

Input like mouse position and key inputs are usually executed locally until you've sent the input to the server.
So the basic way of doing that would be on tick send a Run On Server event and pass through the vector from this node (add a property to the event).
Once you're running on the server, you can do your calculation to determine the rotation.
Once you have the rotation, you should set it in a replicated variable set with notify (OnRep).
You then would use the OnRep function to actually modify the rotation (which I think you're doing already).

fossil spoke
obtuse field
#

How does unreal send RPCs underhood? Via Websockets? Or some other protocol?

hollow eagle
#

custom udp

formal solar
#

Hi guys a bit of a dilemma here.
basically I have a bunch of hives, each can contain dozens of larva actors.
Players can enter hives, what actually happens is a teleport to a place off the map.
I only want players to know about the state of all the larva actors in a hive, once they are in the hive. This information needs to be accurate. However, I can't replicate all the information from all the hives because it is too costly.

  1. What is the best way to 'store' information about a set of actors, in such a way that I can replicate this information at will to a particular player? ('At will' meaning, when a player enters the hive, I want the state of the actors in the hive to be replicated to them)
  2. I will not be using dedicated server. If one player therefore doubles as server, would 'storing' all this information on server be just as costly for the host player as it is for all players in the situation I'm trying to avoid?
hollow eagle
formal solar
#

I noticed certain properties on my larva actors were not replicated past a certain distance (the physical location of the hives is very far away) so they are culled by the net relevance

#

Which was problematic but checking always relevant for all the actors gets costly very quickly

hollow eagle
#

Which is why you use replication graph or iris.

formal solar
#

And the net relevance seems inconsistent, like some properties were more likely to replicate than others

hollow eagle
#

Relevance isn't per-property.

#

It's per-actor.

formal solar
#

yes and some logic would fire and some wouldn't

hollow eagle
#

An actor that isn't relevant doesn't exist on a client at all.

#

If you aren't designing around that then you would be correct, but you'd also be misusing relevance.

formal solar
#

Hmm, looks like I might need to store the actors as data and load them up when I teleport

winged badger
#

there is also a bit of a difference between how net static actors behave with relevancy vs ones spawned at runtime

#

net static actor just won't send any data until its relevant again, but remains on the level while not relevant

#

dynamically spawned actors are destroyed when not relevant

graceful viper
#

I did a simple coin pickup program that generates a random number for coins and wondering what I should do next

agile loom
graceful viper
#

Good idea

grizzled stirrup
#

When passing in session search params, why does it say they are integer but they are actually FName?

/** 8 user defined integer params to be used when filtering searches for sessions */
#define SETTING_CUSTOMSEARCHINT1 FName(TEXT("CUSTOMSEARCHINT1"))
twilit radish
#

Might just be outdated docs. Wouldnโ€™t be the first time ๐Ÿ˜›

#

Unless those specific FNames somehow gets resolved to an integer(?)

sage light
#

Is there a way to implement voice chat to my game that is hosted directed on the dedicated server? I do not want to use some sort of cloud system

#

Are there any packages that support it?

jolly delta
#

can we run console command on server only by specifing the cheatmanagerclass on player controler ?

dusky yoke
#

How can I replicate my camera's look at rotation when it's not attached to my player's Head bone? Using full body, and as such I dont want the camera attached to the mesh.

#

Here's what the clients see - the camera's rotation is not replicated. The component is set to replicate.

queen escarp
#

hi im trying to do some basic multiplayer stuff and trying to learn

#

how would this look if it were a 4 player game ?

steady cape
#

Replace GetPlayerController with GetController

queen escarp
#

how :/ ?

#

oh from the pawn ?

#

nope that was wrong also

steady cape
#

Is this a pawn?

twilit radish
#

Considering it has input it has to be a pawn (or character) I'm pretty sure. But you can just use the "Get Controller" node and cast it to a player controller.

#

It also lists some of the other C++ methods or BP nodes to use.

dusky yoke
queen escarp
#

@twilit radish@steady cape ah thanks but im my case this works even for multiplayer :/ how is that possible with get player index 0 :o?

#

is it the local index or ๐Ÿ˜ฎ ?

#

or is it based on ip or somethng

quasi tide
#

It works...until it doesn't

steel vault
dusky yoke
steel vault
#

You don't need the camera for that, I have to check again but you can use the rotation of the controller I believe which matches what the camera rotation would be.

#

Something that the server owns.

dusky yoke
#

Oh, I will check that out!

#

Thanks!

dusky yoke
steel vault
dusky yoke
#

Absolutely ๐Ÿ™‚

twilit radish
#

Camera's in multiplayer are a bit weird in general. The rotation still indeed gets send to the server but doesn't get applied to the camera unless you do it your self. But not sure if it really matters honestly. It definitely shouldn't be changed any more at this point though ๐Ÿ˜›

#

In before everything falls apart xD

dusky yoke
#

My players spawn randomly between the available spawn points - how can I ensure that they don't spawn on the same spawn point? ๐Ÿค”

steady cape
#

Considering input events (Tab, for instance) are always clientside, you can use that node

#

But, in that context, it's a bad practice, as it's misleading to whomever reading the code and will break if you try to reuse this code on server

queen escarp
#

Ah yeah that sounds obvious!

#

Jupp i gotcha

twilit radish
dusky yoke
#

Hmm okay. Yeah I want players to spawn grouped up together, it's a dungeon crawler, so I just need to see if it's overlapped or something I guess

graceful flame
rich sinew
sinful tree
#

So it should end up looking something like this:

sinful tree
# rich sinew

That set is not necessary. The value the client has needs to be passed to the server which the RPC is doing.

rich sinew
#

ah, right

#

it shouldn't prevent from working though, right?

#

i don't get why the two players look at the same mouse cursor on their instances

sinful tree
#

That's something in your OnRep of Look At Rotation.

rich sinew
#

in here you mean? on the repnotify?

sinful tree
#

Is there anything else setting look at direction or calling the Look At interface?

rich sinew
#

no, not that i remember of

#

i think the only things messing with this look at function are those two bits that i showed, in characterBP and in the PlayerController

queen escarp
#

@graceful flame true

sinful tree
#

Perhaps there's something on tick of the character? You appear to be reusing the look at rotation in one of your earlier screenshots for something too (the purple line goes off screen).

rich sinew
#

Let me take a closer look

#

the value of the lookat rotation (puple line) is just used on the actor rotation of an animation montage

rich sinew
#

@sinful tree did you set it up inside the PlayerController and CharacterBP too?

#

i don't know if that matters or not

sinful tree
rich sinew
#

i'm gonna redo everything just like on your screenshot

sinful tree
#

You don't need to - you already have it.

#

What does your tick event look like on your character?

rich sinew
steel vault
#

@thin stratus no need to respond since I know you're on vacation, but I was able to fix it. It's an engine bug in their implementation. I had to override a few things and you can end up using no velocity with just the projectile movement replicating to adjust the actor's location locally while the mesh lags behind it smoothly.

#

Of course if you were to give the projectile velocity, I think the interp would eventually reach the proper location, will have to test.

rich sinew
#

@sinful tree i found what's making all players to look at the mouse

#

apparently it's my Rotate in Place function, inside the Char ABP

#

with this unplugged they no longer try to look at the mouse like that

steel vault
weary mason
#

is it normal when a static mesh actor is set to become hidden in game via a repnotify any child mesh components to still remain visible ?

rose egret
#

how do I know a Actor is staticaly placed ? (loaded from level)

#

bNetStartup seems to be false if bNetLoadOnClient is false

fathom aspen
#

It has to have RF_WasLoaded

#

Prolly IsNetStartup checks for that

fathom aspen
rose egret
#

@fathom aspen tested RF_WasLoaded, it works fine now

#

bNetStartup is not right

#

it has diffrent meaning

fathom aspen
#

IsNetStartup doesn't only check for bNetStartup

#

It literally checks if the actor was loaded from level and is replicated

low helm
#

Can someone remind optimal strategy for replicating a character's pitch (hands and head) to other clients, should I just Runonserver a non reliable event setting a replicated variable?

weary mason
#

@fathom aspen when you possess another pawn and repnotify is received main actor mesh is hidden correctly but any other static mesh components that are attached to that component are still visible, i tried adding get all children to be hidden also in the notify and visibility but they are still visible which is weird

fathom aspen
#

Debug, find out what's going on in there

fathom aspen
weary mason
#

forgot to mention that new possessed pawn is not a child of the pawn with the repnotify but main actor mesh does become hidden

twilit radish
low helm
#

It is not replicated by CMC

twilit radish
#

Nevermind what I linked was wrong.

weary mason
#

@fathom aspen seems the static mesh components need to have replication enabled so they become hidden when actor is set to hidden in game via a rep notify ...

weak tinsel
#

I built a dedicated server, added it to my project, packaged both game and server and everything went smoothly. Set it up so that thereโ€™s a lobby where you can join the server by clicking a button thatโ€™s set as open map (127.0.0.1) (I also tried with my public ip) but it wonโ€™t work. I will start the server, open the game and click the button but nothing will happen and no messages whatsoever in the server log. I also set a string after the โ€œopen mapโ€ and the string will print but nothing else works. Any help? I also tied to disable firewall but no luck

weary mason
#

@weak tinsel no port ? defaults are 7777 and 17777 for pie, you should try open 127.0.0.1:7777 or 127.0.0.1:17777

weak tinsel
#

this is the log of the server

white raft
#

Hi, I'm starting to look into all the guides, tutorials and documentation but one off question id just eager to know is whether multiplayer can be made to use TCP if it's using UDP, sorry if it's a dumb question.

hollow eagle
#

Unreal's built in networking systems are UDP. I'm not sure why you'd ever want to use TCP with them.
If you want to implement a fully custom socket server you can (and it can be TCP or whatever you want) but that's not leveraging any of the multiplayer systems unreal provides.

white raft
#

Clarification, I just need the other client to check and each check and~~ repeat ~~ confirm the received message, I just heard UDP is sort of clients just listen if they get the packets or not it won't matter, but my project is more critical and things shouldn't be lost or corrupt or incomplete.

hollow eagle
#

UDP alone may be like that but unreal's networking provides guarantees on top of it.

white raft
#

Yeah thanks for the insight, I watched the whole official in-depth on MP a year ago, about replication, and some other youtube videos, and seems like a lot of it is built-in, but I sort of have to know the behavior and limitations ahead of time so I can better know what direction to go with my project, ... for starters whether I would have to go C++ and not just blueprints, etc.

hollow eagle
#

Unreal's networking works in blueprint (with some limitations), and it's not two separate systems between BP and C++.

#

You're also digging into the wrong things if you're asking about UDP vs TCP.

white raft
#

If I can manually add in code that tells clients to confirm received packets by still using default systems and protocols then I guess it could work out. On the other hand, this is actually speculation for now, perhaps things would work just fine.

hollow eagle
#

You're thinking way too low level.

#

Read the link I sent. Unreal's networking is way higher level and you should not be thinking in terms of packets.

white raft
#

I could perhaps create a general limit if ping/jitter is over 50 ms for even 1 second then everything stops until that client returns below threshold, for example, and avoid issues with UDP that way.

hollow eagle
#

Unreal has its own protocol on top of UDP. You do not send "packets" out, you replicate variables or send RPCs which may or may not be reliable depending on the RPC itself.

white raft
#

It's sort of a mission critical type of project where you just can't lose even 1/4 of a second, there is potential it could totally affect the outcome, for example if 2 people speak and one says "This is unconfirmed" ... and there's a network issue in the very moment the person says "un" and it turns the sentence to "this is confirmed" ...

hollow eagle
#

Err, you can't make that kind of guarantee.
You can guarantee that RPCs will be received eventually (or the client gets disconnected) but it is physically impossible to make any sort of latency guarantee for any specific bit of functionality.

#

Even with a completely custom networking layer you cannot guarantee that anything will be received in any specific amount of time. It's just not how networking works.

#

If you're talking about implementing deterministic lockstep networking then you're still thinking about things at way too low of a level. The transport for which things get sent/received is almost irrelevant to the complexity of deterministic calculations themselves.

white raft
#

Oh, aha, now it's not actually time sensetive in the sense that it has to arrive on a specific time for any or all clients, eventually works too, but until every client has the thing what it should, the "gameplay" in this case shouldn't continue and everyone would just have to wait, but it's not particularly fast-paced project with huge amounts of physics and graphics activity, fairly low on that.

hollow eagle
#

In which case you're still thinking way too low level.

#

Confirming that someone received something is trivial, and not thought of in terms of packets on unreal's framework.

#

Again, read the link. Unreal's networking is entirely built on variable replication and RPCs.

white raft
#

If client 1 sends signal AB, all other clients must have AB and once they do, for extra confirmatio, the should have to report they really have AB back, and then gameplay can continue. In this kind of project, speed isn't a problem so if things go slower it's fine, it just has to be as exact as it can. But this kind of stuff doesn't necessairly need to be done on the low level, it could literally be done by implementing it into "gameplay" and let other clients manually do it, for larger and occasional game events things, but ofcourse not for things that happens hundreds of times a second. I guess I'll do some more reading and then asking again, I realize I also need to properly state my questions. It's possible I may not yet know how to actually explain what I'm exactly meaning.

hollow eagle
#

That's called deterministic lockstep.
But I'd stop for a moment - if you're thinking about doing full P2P where clients can talk to other clients then you're in fully custom networking territory.

#

Unreal's built in networking is server-client only. While it's theoretically possible to implement a P2P netdriver it's not something you should do without quite a bit of experience.

white raft
#

Aha, but dedicated server too?

#

Sorry if I'm mixing a bunch of things, EOS is something else right?

hollow eagle
#

EOS has nothing to do with networking

white raft
#

Right right.

hollow eagle
#

and a dedicated server implies client-server, yes

white raft
#

I was about to say "client send to server" ... but I thought it was P2P, but I see now in the docs, it's server-client

#

This architecture doesn't negatively affect the project I think. It's actually better to have a dedicated and authoritative server in such case, but I can't think of a particular reason right now, although I feel it.

#

There's a mention of voice, does it go through this same system, ... the doc you gave me didn't say much but it felt so, just want to be sure.

nova wasp
#

Trying to get the gamestate on the client in a PIE 2 player listen server

#

In a world subsystem OnWorldBeginPlay

#

It's a nullptr... too early?

#

I must be missing something

#

fwiw the goal was to just figure out the kind of game the world is

#

could probably go the playerstate route instead...

pallid mesa
#

PlayerState as GameState aren't guaranteed to exist on your client OnWorldBeginPlay, you shall need to wait

fathom aspen
#

Actually GameState should have replicated by the time the World begins play on clients

chrome bay
#

Not for UWorld::BeginPlay()

#

UWorld::BeginPlay() tells GameMode, which tells GameState

#

Actor BeginPlay() means the GameState has been received though

fathom aspen
#

I see, so there's kind of a race between GameState replicating (instigated by World's BeginPlay server-side) and World's BeginPlay getting called client-side

#

And yeah most prolly World's BeginPlay will be called before GameState has replicated

queen escarp
#

Hey guys how can i get my IP adress ? im just trying to display it on a widget

#

is there a premade function for it or ?

sage light
#

If I'm using EOS (Epic online services) for matchmaking and voice chat, will players in my game have to have an epic games account and log into it?

kindred widget
modern swift
#

anyone got idea why 5.1 still kick player immediately if use world partition for dedicated server. is that any way to work around ?

sage light
#

Also I found a video where the maker declared that it is not required as far as I understand
https://youtu.be/Fd9m4cG2hnU?t=1574 (clicking will bring you to the exact moment)

Unreal Engine 5 Epic Online Services - Set Up EOS for Your Multiplayer Game

Set up Epic Online Services for your multiplayer game!

Epic Online Services Dev Portal:
https://dev.epicgames.com

EOS Documentation:
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Online/EOS/

Multiplayer Plugin:
https://github.com/DruidMech/Multipla...

โ–ถ Play video
buoyant wedge
#

Hello all. It's wrong to create this logic on the character to call a elevator?
i have problem to put the logic direcly on a button that call the elevator. I have try to just call the console button and check the authority but something fail

elfin copper
#

I have this setup for changing the animation state when changing weapons but how to replicate it? replicating the variable doesn't seem to change anything. The server sees all clients change but the clients themselves keep stuck in the first animation state

kindred widget
elfin copper
#

thanks!

modern swift
# modern swift anyone got idea why 5.1 still kick player immediately if use world partition for...

https://forums.unrealengine.com/t/dedicated-server-and-world-partitioning-missinglevelpackage/602938 this issue was said fixed, but still not work more many people in 5.1.1

Epic Developer Community Forums

I am packaging a dedicated server with a map that uses world partitioning. Thereโ€™s an entry map that connects to the server, and when I start a client from that entry map from the editor, in โ€œStandalone Gameโ€ mode, I get kicked out immediately after connecting, with the following messages in the server log: LogPlayerController: Warning: ServerU...

quasi tide
rugged sandal
#

Hey folks, a question.
I have accidentally discovered a weird behavior of multicast rpcs (specifically, reliable ones).
I have the following setup:

  • 2 players, Listen Server and Client.
  • Server player controls Character 1, Client player controls Character 2
  • Characters are replicated normally.
  • Characters have a component on them, which is set to be NOT replicated
  • Said component has 2 multicast RPCs, one unreliable and one reliable

Expected behavior part:
server player calls unreliable multicast on their character (character 1) component. That multicast doesn't get delivered to the client player's simulated proxy version of the character 1. All good, since the component is not replicated.

Weird behavior part:
Server player calls a reliable RPC on their character (character 1) component. And that RPC gets delivered to the client player simulated proxy version of the character 1. That is unexpected, because, as I said, the component that implements these multicasts is not replicated.

Is it a bug, or am I just missing something about how the replication system handles the RPCs under the hood?

Found it accidentally, forgot to set the component to replicate, but still was receiving part of the multicasts (reliable ones)

warped steppe
#

I'm kind of new to actual multiplayer code so I'm flailing around a fair bit trying to figure out when to expect things to be stable

latent heart
#

Never is the answer.

twilit radish
winged badger
rugged sandal
winged badger
#

Unreliable MC is the only RPC that also takes relevancy into account, but id still exoect both to work

rugged sandal
#

Well in my setup characters had default relevancy settings, and they were like 2m (200 uu) from each other, so that could be taken out of equation

winged badger
#

If youre using c++ you can look at UActorComponent::CallRemoteFunction

#

Unreliable MC might be an exception here

#

Buf you can freely send any other RPC from a non replicated component

rugged sandal
#

huh, interesting, didn't know that. It's seems to be kinda contradictory to the whole concept of being not replicated ๐Ÿ˜„

#

i've stumbled on this in UE 5.1 btw. So may be something have changed there.

winged badger
#

Its not

#

Was always like that

#

Components redirect their RPCs to their actor

#

Unreliable MCs can get expensive, and are generally not gameplay critical

#

So they have some optimizations added

molten mauve
#

Hi team!, any clue why in multiplayer test with vehicle starter the clients replicate nice but a little jumps

rugged sandal
#

well i guess i'll tinker around the rep driver code with some breakpoints, and figure out what's causing this difference ๐Ÿ™‚

edgy helm
#

Hey, I am trying to figure out how seamless travel works in UE 5.1, but nothing worked so far. Any tutorials?

rugged sandal
#

Was it even changed since UE 4?

#

I saw some folks were having issues with it when World Partitioning was in play, but if you are not using it, i think UE4 guides should get you up and running no problem

twilit radish
#

A lot of things are still the same from UE4 -> UE5 yeah. Don't think anything changed if you're not doing anything special.

turbid cloud
#

Can anyone give me some feedback on what to look for regarding vehicle assets in multiplayer? It seems some vehicle assets are replicated but not well (lacking various special parts like server side prediction?) Iโ€™d love to get good cars going for dedicated servers, but am finding it hard to k own what asset to invest it

#

In*

quasi tide
#

I don't know if I'd trust any asset on the marketplace for this. Vehicles are a PITA to handle networked. Not going to trust someone who is charging like $20

turbid cloud
quasi tide
#

Nope. I just know it's a PITA. Just seeing the results of all of the people who have attempted it over the years, not to mention AAA fights it as well.

turbid cloud
#

Hmmmm. Any idea whatโ€™s so challenging with it? Any thoughts on best AAA success to study?

quasi tide
#

Rocket League and Halo Reach have really good talks about prediction

turbid cloud
#

Very nice thanks!

clear island
#

whats the size limit for replicated properties?

#

for example if I have a replicated FString

#

is there some network limit to how long that can be?

plush wave
#

Is there a default way to tell if it is the first time a player has spawned in?

#

Guessing I need to keep track of that myself somehow

pallid mesa
pallid mesa
#

subsequent respawns will call reset, at least it is that way if you are using gamemodebase spawning method

clear island
pallid mesa
#

DefaultEngine.ini I think, iirc the var is called MaxBunchSize

#

And defaults to 64K i think ๐Ÿค”

#

but you can change it, although not recommended

clear island
#

I see

#

good to know

pallid mesa
#

if you exceed the buchsize your bunch will be dropped

#

it doesnt split it for ya, if thats your question

#

it just drops it

plush wave
pallid mesa
#

correct thats what i said

#

subsequent spawns call restart (meant restart actually)

plush wave
#

Isnโ€™t โ€˜RestartPlayer()โ€™ called every time, including on the first time?

pallid mesa
#

only the first spawn will spawn the controller

#

yes restartplayer gets called every time

#

but what spawns the controller before calling restartplayer isnt

plush wave
#

Right, so with function spawn the controller?

pallid mesa
#

dunno right now i dont have the engine in front of me

#

but it is there

#

in AGameModeBase iirc

plush wave
#

Ah ok, Iโ€™ll look for it. Thanks

pallid mesa
#

npnp

dark edge
#

Rocket league vehicles are basically like Characters in most other games

#

but vehicles are hard as hell because they're unpredictable, fast, and often physics driven

weak linden
#

So, I realize I've left this a bit, but did you get much further with your implementation? I just spent some time faffing around with mine and I have something that appears to be working great, what issues/problems were you running into?

mortal mica
weak linden
mortal mica
#

I know the NPP seems to have a client side predicted physics implementation, but I haven't been able to get it to work

weak linden
turbid cloud
mortal mica
weak linden
dark edge
hollow eagle
fathom aspen
#

Like you would anywhere else, to make sure it's replicated

turbid cloud
# dark edge Depends on the type of vehicle

Ah I gotcha. If I was fine to go super arcade'y, would that make things easier?
I'm not worrid to much about acuracy, just thinking on a big map a character needs to get around!

sinful tree
#

Just to be clear, the Game Instance itself isn't replicated, so any replicated variables you may be setting on the server in there won't appear on clients, and RPCs will not function as one would expect.
For an actor to be replicated, it needs to be spawned by the server and the Replicates boolean on the actor needs to be set to true. Spawning a replicated actor can be done in the Game Instance, but again, if it's not running on the server, the actor will not be spawned by the server and replicated to others.

tribal solstice
#

Hey ya'll - what would be the best method for implementing chatrooms in a multiplayer game? Structs that store the chatroom name and player controllers that are in each one? Any suggestions would be appreciated. Thank you!

mellow stag
#

How would I go about optimizing for an open world survival game on map with about 50 players, similar to the game rust.

short arrow
#

I can link you to several optimization guides and general networking information if you'd like

mellow stag
#

Right now I tested the game on a 5k by 5k map with around 20 players there is building etc. but the server starts to lag after 20+ players. checking the memory usage on the vps it's barely being used to capacity

short arrow
#

The doesn't really tell me anything. Are you using a marketplace asset for your game? If so then you'll probably need to make lots and lots of changes

#

Marketplace asset templates usually have a mountain of issues

sterile plaza
#

Evening everyone.

short arrow
#

If youre using survival game kit then I will pray for you

sterile plaza
#

Are there any reasons to use an Actor for player associated stuff rather than an ActorComponent on the PlayerController or PlayerState?
I've used components and subsystems that use a work-brewed networking uobject, but haven't used actors for stuff like this. I'm trying to think of reasons why an actor would be preferable than a component.

short arrow
#

I haven't heard any other reason someone else would make a separate actor. Unless that separate actor needed to store information for multiple players

sterile plaza
#

I was using an actor to try it out and it quickly became apparent it was more work than if I was using a component.

#

Thought I'd see if I was missing something before I switched it over.

#

I'm using player state for the first time. :D
Nothing I've worked on has needed to persist between maps that is unique per player.

plush wave
#

Can clients technically run functions marked as server locally?

#

AKA do my server functions need to have a HasAuthority() check?

hollow eagle
#

sure?

#

err

#

unless you write code manually calling the _Implementation then nothing is going to call those functions on an actor that doesn't have authority

#

could someone modify the game to call those functions? Sure. I'm not sure why you'd care about someone ruining their own experience though.

plush wave
#

Was running through a mental exercise of combating cheating. Wasn't sure if a check was needed

hollow eagle
#

the worst someone could do is call that function on their own client. Which, if your networking is properly designed, could do no more than have them ruin their own experience

#

and a HasAuthority check wouldn't do anything, they could just... remove the check.

#

If a client modifying data can break the game then the solution is not further client checks that can be simply removed, the solution is to not accept invalid data on the server.

plush wave
#

Right, makes sense

#

Thanks for the insight

#

And not to be super dense...

#

But clients can call client marked functions by design, yes?

#

Or are client-marked functions only meant to be called by the server?

hollow eagle
#

a client can call a client function, yes

#

but in general if a function exists and isn't explicitly compiled out then a user can do literally anything they want with it. A server doesn't have to accept what they do if they try to send invalid ata, but you have no control over what happens on a user's machine.

#

and even if a function is compiled out a user can modify memory however they want

plush wave
#

Right I just know client-marked functions are intended for the server to call to then rep to the client

#

Didn't know if designing the client to call them too was frowned upon

faint eagle
#

๐Ÿค” in which situations can it happen that a server spawns a replicated actor and clients which connected before or after spawning this actor won't get it? let's assume that the actor is always relevant

fossil spoke
chrome quest
fossil spoke
#

Make sure you verify that you arent forgetting to call Super on BeginPlay for example

chrome quest
#

I was pulling the spawn class from the GameMode which only exists on the server. I assumed replication would automatically broadcast to the client but it didn't work

faint eagle
# fossil spoke It might have been short lived and been destroyed immediately

well the tricky part is that the actor is spawned in UGameInstance::StartPlayInEditorGameInstance for reasons I am not 100% aware of and since it is spawned by the world (which I am not sure about if it's 100% ready for usage at this point) and not destroyed by something, then it shouldn't really be destroyed. Also this actor feels itself quite well on lister server, it just seems it never gets to the connected clients.

I think the references were not set right or something but the actor never replicated
Hmm, I don't have any replicated UPROPERTY for this actor at this point. I am trying to get this actor via UGameplayStatics::GetActorOfClass, but now when you said it I am questioning myself if world's actor list is replicated at all ๐Ÿค”

chrome quest
#

If I may proffer my humble opinion, the entire setup doesn't sound right at all. You don't want to be manipulating actors in the GI. Certainly not that early.

Also, I'm not sure how GetActorOfClass works but if it's anything like TObjectIterator, I wouldn't be calling it too often

faint eagle
#

yeah dude I agree with you this looks sceptical to say the least. But again, I didn't put this logic in the game instance, I just need to make the actor replicated

#

I'll try to store somewhere replicated pointer to this actor, will see if that helps

chrome quest
#

Good luck. If you know what exactly caused the issue, I'd be interested

kindred widget
chrome quest
#

So I have a problem(?) and would appreciate some insight.

I have a some data in a world subsystem that is only on the server. The data can not be replicated. Think a TMap.

Clients need to retrieve only a small part of that data once in a while so I don't think I need to replicate everything anyways.

At the moment, I'm using a somewhat complicated method of asking for that data from the server using RPCs on the player controller. Then some delegates since there is a slight delay between requesting the data and when it's received.

Just a mess of things.

It works, somewhat, but I don't think it's great on performance and it's just so complicated.

Does anyone know any methods for sending data like that without replication?

#

For example if you want to retrieve a value from a TMap on the server and you have the key, how would you do it?

kindred widget
#

Probably just ServerRPC->ClientRPC.

chrome quest
#

Which is what I'm doing. But since there's a delay between actually calling the RPC and seeing the results, I use a delegate to broadcast the data in the client RPC.

The player controller doesn't even need the data I'm only using it since it's the most convenient class that exists on both server and client.

kindred widget
#

Does the data change often on the server?

chrome quest
#

I guess that's the only way. Just need to find a way to simplify stuff.

I'd still appreciate more ideas

chrome quest
kindred widget
#

How large is it in general?

chrome quest
#

I can't tell. It's an ecs world.

kindred widget
#

Wondering about a replicated actor spawned for that subsystem that any client could get globally and pull the data from it when they need. Would ensure instant data for them.

chrome quest
#

The data itself is not an unreal type so I can't replicate without custom serialization. Which I have no idea how to do for it

kindred widget
#

Wait, how are you RPCing it then?

chrome quest
#

Think of it like a TMap. The keys and values are unreal types but the map itself can't be replicated

#

So, I just rpc the keys and values back and forth

edgy helm
#

Can someone send me a link for seamless travel tutorial please? The stuff I found didnโ€™t work.

weary mason
#

when making a squad system that requires player info to be displayed on clients in a widget where should i store the info, game state or game mode ?

rich locust
#

playerstate

rich locust
hollow swallow
#

prompted me to just text, my stats reset when i die... rip. guessing ill have to send them to the playerstate before i die. Then retrieve it on respawn

rich locust
#

well carry it over playerstate if it is persistent

#

you will be safer

hollow swallow
#

im too far in xD

rich locust
#

by player you mean pawn I think

hollow swallow
#

too much to change

#

yeah

rich locust
#

well thats a problem witn blueprint

#

if a project big then BP is a problem

hollow swallow
#

its my first project, and im a few months in. Ill end up breaking a whole heap of stuff if i try change it now

rich locust
#

good luck

hollow swallow
#

ill just pass it over and back ๐Ÿ˜› save myself a few weeks of pulling my hair out

craggy briar
#

Hey there, we are running into an issue with my team using the animX marketplace asset and trying to replicate it to the clients, the movement in the world is properly working as well as the IK, but the whole animation of the animals only works on the server.
We've tried enabling replication (the asset wasnt created with multiplayer in mind) to a lot of the variables, aswell as firing their initialisation from server to clients via multi cast with no luck.
Any lead on where to look, what information to provide to give more insight ?

I will add that a lot of these animations use root motion and was wondering if that is the source of the problem, although disabling root motion on the locomotion blend spaces still yielded no results. Thanks !

fathom aspen
jolly siren
#

Has anyone implemented a CMC driven movement ability that moves to a given location and works well with packet loss?

nocturne quail
#

these both are for same purpose?

    if (GetNetMode() != NM_DedicatedServer)
    if (!GetOwner()->HasAuthority())
latent heart
#

No. I think authority will be true on a client-owned actor, such as a player controller or pawn. I honestly can't remember, though.

#

Also netmode could be listen server or standalone too.

#

You wanna check dedicated server when dealing with A/VFX.

#

You want to check != client when looking for servers.

nocturne quail
#

thank you for your precious time explaining this

twilit radish
latent heart
#

Oh never mind then.

twilit radish
#

I find HasAuthority very often to be awkward to use though. I mostly use other checks.

latent heart
#

Maybe I'm thinking of role?

#

autonomous vs the other one

#

Man it's been ages since I did any mp.

twilit radish
#

With roles you have a remote and local role. So kind of depends.

latent heart
#

Ah simulated that's the word I was looking for.

#

Either way, the 2 things aren't equal because !authority isn't the same as !dedi server

round acorn
#

Anyone have insight on Epic's progress with updating the standard CMC e.g. with Iris or other projects?

I'm trying to convince myself not to buy the General Movement Component from the marketplace and instead wait for Epic to update CMC.

#

Realistically I am going to have a max of ~5 players in any multiplayer session. And in terms of movement the only somewhat exotic movement types would be dodge/roll, perhaps vaulting/hoisting, sprinting and maybe sliding.

#

Of course, lots of root motion too, from skills.

quasi tide
#

Don't hold your breath for Epic

#

Do what you need to do to get your project moving now

round acorn
#

Aye but my game is years away from completion heh

quasi tide
#

There is no guarantee that they're even going to touch CMC

#

And for 5 people...CMC should be fine.

round acorn
#

I already have rolling replicating fine almost

#

So I figure yeah should be doable with CMC

#

But GMC looks so good

#

I'll just wait for it to go on sale

nocturne quail
#
void AArmaCharacter::ServerBeginInteract_Implementation()
{
    BeginInteract();
}

Error C2447 '{': missing function header (old-style formal list?)
what does this error means?

quasi tide
round acorn
dark edge
quasi tide
odd sundial
#

(Server on the left, client on the right) Thanks again, as always you're all so helpful. Zero responses and my original question was removed with zero feedback, all while people chat about random game bullshit instead of helping anyone else. Great resource here.

round acorn
#

I really wanna buy it but my game is so far away from being finished... if I go down the road of CMC and then decide to swap to GMC I wonder how much rework that is.

quasi tide
#

A complete rework

#

GMC is not compatible with UE's Character

round acorn
#

My character is currently a combination of player character and player state using GSC (GAS Companion)

#

Hmm

#

But in terms of character movement I've not spent a great deal of time, so I think most of the work I've done with GAS can just be moved over to a GMC character.

#

I may have to do some coding to get GSC working with GMC though

quasi tide
#

@fathom aspen Wait - does this mean it doesn't work on consoles? Are they using any windows specific APIs or something? Or just not tested?

prisma snow
#

but who knows

quasi tide
#

It would be. But hey - I don't have the plugin

round acorn
#

heh thanks for reminding me why I didn't buy GMC last time I had my finger on the trigger

#

I really want this game to run on consoles

quasi tide
#

Well - it depends on if they mean development platforms

round acorn
#

yeah I am pretty sure it means the build won't compile for e.g. PS5

#

but yeah that's kinda ambiguous

#

I do all of my playtesting with a PS5 controller in PIE right now

fathom aspen
#

But hey GMC v2 is coming some time soonโ„ข๏ธ demondevil

quasi tide
#

Can't you just ask in the server ๐Ÿ˜…

#

Be my vessel!

fathom aspen
#

I will prolly check back on it when it's doneโ„ข๏ธ

#

Gotchu ๐Ÿ˜‰

quasi tide
#

I just want another component in my arsenal to complain about

fathom aspen
#

Not the GMC boi

quasi tide
#

Going back and looking at the way they have the framework set up, is quite nice to be honest

#

I love that I can just use the MRC version for a lightweight version

#

@fathom aspen did you test that it worked with pathfinding and all that fun stuff?

round acorn
#

I used to strafe jump with the best of them back in my Quake days

fathom aspen
quasi tide
#

๐Ÿ˜ญ

fathom aspen
#

Hence why my review is monetized

quasi tide
#

2 tests if you find the time:

  1. See if they do work
  2. See if they are lighter weight than the the CMC's navigation stuff
#

I'd imagine they would be, if you're not using the OMC

graceful flame
#

How well does GMC run with moderate amount of latency and packet loss? Say 60min, 110max and 3% loss.

quasi tide
#

Apparently - insanely good

#

People have tested with 200-300 ping, still seemingly flawless

round acorn
#

Really well from the lone youtube video I've watched on it in the game Slappy or w/ever lol

graceful flame
fathom aspen
#

Hit the GMC with the right preset and you're good

#

They got presets for the type of game you're working on

quasi tide
#

The video that Mythic is talking about, they tested it in bad conditions, which is excess of 3% loss. Still completely unnoticeable for them

graceful flame
quasi tide
#

Does the ORC inherit from the base movement component of UE? @fathom aspen

fathom aspen
#

I believe so, otherwise things won't be compatible

quasi tide
#

If it does - then I'd imagine navigation stuff just worksโ„ข๏ธ

fathom aspen
#

If code was at my fingertips I could check

quasi tide
#

I believe base movement component inherits from NavMovement

round acorn
#

Are you guys aware of a less expensive option that would be enough for a Dark Souls 3 / Elden Ring level of multiplayer? Just use CMC?

quasi tide
#

Just use CMC

fathom aspen
#

CMC should almost work in all scenarios

round acorn
#

Aye, thanks. I'll stick with it.

fathom aspen
#

I kinda bought it for the fun tbh

quasi tide
#

If you look up Reid's Channel, he explains how to implement sprinting and wall running networked, properly.

round acorn
#

Yeah I saw that. A little bit of C++ but nothing huge from what I watched.

quasi tide
#

If you actually sit down and understand what he explains, you can take these same concepts and apply it to w/e you want to do

round acorn
#

That was the video with bitflags?

quasi tide
#

I don't remember.

round acorn
#

Wall running though yeah that must've been it

fathom aspen
quasi tide
#

I just remember him actually covering how CMC actually works under the hood when it comes to corrections and what not.

round acorn
#

Ah thx

quasi tide
#

And then implementing custom stuff to be compliant.

round acorn
#

my game is not competitive (insofar as any Soulsborne is competitive) so I'm leaning more toward client experience than prevention of movement hacks

#

couch time with friends, taking down big bads

sterile plaza
#

Do actor components replicate variables less often than actors? I had a value that changed on actor tick and it was replicating to clients smoothly. I switched it over to a component and now the OnRep is only called... something like 3x a second?

#

Oh. Player controller defaults to 100/sec and player state to 1/sec.

twin juniper
#

so they depend on it

subtle peak
#

Hey there, this far I've been using two clients to test my game, but after testing it in "listen server mode" I see the respawning of players is messed up.
Again works fine with two clients.
Now when the server is killed it respawns on the client, and the server is just stuck in the old camera without a new pawn. Any clue why this is happening?

sterile plaza
subtle peak
sterile plaza
#

To clarify, OnRep doesn't get called on the server that's changing the replicated variable.

subtle peak
#

My guess is its something to do with getPlayerController? Whats the difference between this in listen server and two clients?

sterile plaza
#

If you're using a call that gets the player controller by index, the server will have 2 and the clients will only have 1

#

Clients only have a player controller for themselves, not for anyone else.

subtle peak
#

Yeah, I suppose thats the problem then. What should I use instad of getPlayerController by index?

#

Or to ask differently, should getPlayerController by index not be used for online multiplayer?

quasi tide
#

To clarify - OnRep only doesn't get called on the server in C++. It still will in BP.

rose egret
#

how and where location and rotation is replicated to autonomous proxy ?
I used Teleport() or SetActorLocationAndRotation() but I feel like its not sending rotation

devout dagger
#

Where is the best place to place the money system to buy weapons, for example, when I kill an enemy I will receive money, so that in the next round I can buy other weapons.

quasi tide
#

Pawn - if you want to drop money when you die
Controller - if you want it to persist throughout deaths
State - if you want others to be able to see how much money you have

devout dagger
#

thank you , well I think I will put in player controller

round acorn
#

None of these should be used in multiplayer really.

subtle peak
round acorn
#

yw

fossil spoke
round acorn
#

Not even sure I follow the question and I have GAS in my project heh

hallow fiber
#

Hello, I am having a bit of a replication issue here. I have replicated properties on my Actor that are client authoritative and thus I don't want to replicate to the owner. Replicating to the owner would cause the replication updates to mess with the local calculations and cause bad things to happen. Ideally I would like to use a replication condition: COND_SkipOwnerOrInitialOnly, but that doesn't exist. So currently I am using COND_SkipOwner and not setting the owner initially so that those properties get replicated down. Not setting ownership has been problematic though (RPC's won't work and there's no way to tell if locally controlled). I want to set the owner and still have properties replicate initially. I tried initially sending a reliable client RPC to set those parameters on begin play, which with some work does function. However, the RPC doesn't seem to be part of the initial actor replication bunch and causes those properties to not be set on BeginPlay. This is problematic as there's already functionality expecting it to be valid at that time. My other option is to create either duplicate properties set to COND_InitialOnly or a custom struct that would replicate the properties initially and reflect that onto the real properties OnRep - this seems to be the better approach. Has anybody else encountered this issue and is there a better way this issue could be solved?

round acorn
#

What kind of actor is this?

hallow fiber
# round acorn What kind of actor is this?

Well there's multiple classes dealing with this same kind of issue but one example is a magazine actor (closest Unreal class type is AStaticMeshActor). It has an ammo property that's set to COND_SkipOwner but I'd like ammo to be replicated with the actor if it it's initial value is different than the default value

sterile plaza
#

You want ammo to be client authoritative?

hallow fiber
#

Yes, with how things currently are

sterile plaza
#

I strongly encourage you to not do that as that means a client can modify things to give themselves infinite ammo.
And is that information that other clients need to see?

#

I realize this isn't addressing your initial question, but I'm still thinking about it.

hallow fiber
#

Yes, the server tracks ammo as well per shot

#

The thing is, this is not ideal, I know that. There are other examples of things like this as well, not just ammo. It would be ideal for me, in the meantime, to have a way to replicate that property initially with the Actor

sterile plaza
#

I'm trying to think of examples of something that should be client authoritative and shared with other clients.

hallow fiber
#

The magazine reference is client authoritative too. It's set locally and notifies the server

#

Magazine reference on the firearm

sterile plaza
#

All of this should be server authoritative. But ignoring that...
You could have a struct of initial state for owner that's COND_InitialOnly, COND_OwnerOnly.

#

RPC is another way, but as you mentioned, timing between RPC and Replication is not the same.

hallow fiber
sterile plaza
#

This is why locally predicted exists.

hallow fiber
sterile plaza
#

That said, it's possible VR changes the problem space.

#

I don't have experience with VR.

hallow fiber
# sterile plaza This is why locally predicted exists.

I'm not sure if it's quite the same as locally predicted as the local player would be the one which would have to initiate the mag insertion out of necessity. The replicated controller positions wouldn't be accurate enough for server-side checking or anything like that.

sterile plaza
#

oh, is this gun/magazine/etc actual models you're moving around because the player is holding them?

hallow fiber
#

Not an animation or anything

#

Separate Actors

sterile plaza
#

When you said ammo I assumed that was an integer.

#

:P

hallow fiber
#

The issue is that guns will often spawn a magazine when "holstered" (ready to be fired). With COND_SkipOwner though, the magazine reference won't replicate to the owner when I only want it to be done initially.

#

Currently there's no owner set to mitigate this but it's a bad hack and causes other issues

#

I could use COND_None but I'm wondering if there's another way

#

Would be nice if COND_SkipOwnerOrInitialOnly existed

#

(They've got COND_InitialOnlyOrOwner but not the other one :/)

#

Adding another condition would require engine modifications and I would rather not do that

sterile plaza
#

What do you mean guns will spawn a magazine?

hallow fiber
#

On BeginPlay of the Firearm, if it's holstered and there's ammo, I will spawn a magazine and set that as the firearm's magazine reference. Since magazines are replicated actors, I need to spawn them on the server, so I have no choice but to have it replicate the reference down. There's existing code expecting the magazine reference to be correct on BeginPlay so I would rather not send a reliable client RPC or something like that

sterile plaza
#

the magazine gets created one time per firearm?

#

what is the data that's client auth and changing?

hallow fiber
#

Not necessarily, sometimes they spawn with a magazine if it's part of your loadout. Finding a magazine in the map doesn't necessarily means it spawns with a magazine however

sterile plaza
#

position?

hallow fiber
#

The magazine actor reference in the firearm

#

There's others like this, that's just one example

sterile plaza
#

that doesn't sound like the client needs to do anything with it

hallow fiber
#

Clients need a reference to the magazine so if they pick up the firearm it's magazine reference is valid

sterile plaza
#

sure

hallow fiber
#

If the magazine is set to COND_OwnerOnly (which is used to be), then they have to wait for the magazine reference to replicate down before they're able to fire

sterile plaza
#

but server spawns it, tells everyone it exists
what else do you need to do?

hallow fiber
#

I need to have that magazine reference on the Firearm replicate down to the owner of the firearm

#

which is not possible with COND_SkipOwner. This is the only situation in which the owner needs the magazine replicated down to the owner. Won't happen again after the Firearm Actor has been created

sterile plaza
#

why would it need to happen for anyone else later?

hallow fiber
#

Because the magazine can be swapped out with another

#

Which is initiated by the owner and notifies the server and replicates to other clients

sterile plaza
#

the round trip time is unacceptable for swapping a magazine?

hallow fiber
#

Huh?

round acorn
#

ping

hallow fiber
#

Oh for the local player, yes

sterile plaza
#

I've only ever done fully server authoritative stuff, so trying to think about how to not do that seems weird.

hallow fiber
#

Yeah...

round acorn
#

Have you mapped this out in a simple flow diagram?

hallow fiber
#

In VR usually things need to be initiated locally

round acorn
#

That always helps me, usually I am trying to make things more complicated than they need to be.

sterile plaza
#

What's the issue with the client setting it, telling the server, and then the server replicating it back down to the owning client?

#

shouldn't do much since it's already set

hallow fiber
#

Otherwise you'd grab a slide or a charging handle and wait a quarter of a second before gripping which feels bad. Especially with higher ping. Just one example.

round acorn
#

Yea but as he said, locally predicted, server gets the info eventually and lets it happen

#

No weird animation delays

#

In theory you'd only get weird glitching if the network was way slow or the client was trying shenanagins

hallow fiber
sterile plaza
#

why not?

#

replicate to everyone all the time

hallow fiber
#

Because the magazine property has it's replication condition to COND_SkipOwner. It replicates to all clients EXCEPT the owner because it's intended to be locally simulated

round acorn
#

yeah I don't get it either. server should be the authority and to stop perception of lag you need prediction. does VR somehow make this impossible?

hallow fiber
#

Which works fine in all instances except the one I just mentioned. The way I've got around this is by not initially setting ownership until the firearm was grabbed which allowed properties to be replicated to the owner but this has not been ideal.

round acorn
#

I don't see how VR makes one iota of difference tbh. It's just a different way of viewing and inputting

sterile plaza
#

There's also COND_Custom but I can't seem to find any examples of implementing SetCustomIsActiveOverride

#

oh, there's an example right in the docs

hallow fiber
hallow fiber
sterile plaza
#

If custom condition value changes a lot, this can slow things down.

west pawn
#

I'm trying to implement multiplayer co-op in my UE5 project with Steam SDK, does anyone know of good resources for doing this? I've been looking around and the best one I've found is a YT tutorial for UE4.1 and uses features that are now gone.

sterile plaza
#

sounds like it can change

#

I still think prediction is the answer.

#

I'm not sure why it wouldn't work, but again, no experience with VR>

hallow fiber
sterile plaza
#

seems to be called over and over in my project

hallow fiber
#

Well the issue isn't that it wouldn't work, it's just seemingly unnecessary to have properties replicate to the owner when I only want it initially, as the owner is the one setting those values before notifying the server (there's nothing to predict here, the properties are client authoritative out of necessity). But there likely isn't any elegant solution to this issue without setting the condition to COND_None and just allowing the properties to replicate extra NM_peepoShrugSmile.

#

It's just a shame is all.

sterile plaza
#

custom seems like it would do what you want

hallow fiber
#

You sure?

sterile plaza
#

no

#

I've never used it.

#

But it looks like you can change whether it replicates or not at any point.

hallow fiber
#

Fairly certain that's used in PreReplication to enable / disable replication on a property

#

Look at the macro DOREPLIFETIME_ACTIVE_OVERRIDE

#

Well yes, but you can't tell it to not replicate to specific clients

#

Just shuts on / off replication using the same replication condition

#

So I couldn't initially have it on for the owner then off

sterile plaza
#

ah, interesting

#

it does seem to indicate you lose the granularity that the other conditions give you

hallow fiber
#

I don't believe there's any way to just replicate to specific clients without a replication condition from an Actor (atleast not without a lot of work). Would be nice though

ivory bear
#

anyone here know of a good tutorial for a multiplayer same level restart and player reset?
Mine restarts the host, but drops the other players.

Blueprint:
The red circle is the gamer timer has ended section and the match is over>

sterile plaza
#

I still like my initial only struct

hallow fiber
#

Yeah, that's what I'm leaning towards

hallow fiber
#

Ammo is another issue currently dealing with. The existing code uses COND_SkipOwner as well so it has the same issues as with the magazine reference. What is the predicted version of this? Just COND_None?

sterile plaza
hallow fiber
#

Because with no condition it clobbers with the local ammo count

sterile plaza
#

I've mostly only used prediction with rollback with GAS.

hallow fiber
#

Yeah, I've used GAS before

sterile plaza
#

does ammo count need to be client auth?

hallow fiber
#

Would be better off that way

#

There's UI for ammo and if it decremented with ping it would look strange

#

But with no condition the ammo count jumps up and down because of the server replciation

#

There's server-side checking and ammo is synchronized from OnFire RPCs so there is no desyncing issues

#

Seems ideal to me. Not sure

sterile plaza
#

could use RPCs for all updates

hallow fiber
#

all updates?

sterile plaza
#

any that need to work this way

hallow fiber
#

You mean for initial replication of a spawned Actor?

#

of it's properties

sterile plaza
subtle peak
#

Can you not communicate with the gamemode from widgets at all?

#

I have my "spawn player" logic in the gamemode and I want to select what unit to spawn via widget. But all the "cast to GM" fails

sterile plaza
#

you can

#

client or server?

subtle peak
#

client

sterile plaza
#

gamemode only exists on the server

subtle peak
#

But you can run custom events "On server" via widget? or not?

sterile plaza
#

you'll likely want to do something like this:

  • select class type in widget
  • call PlayerController.ServerRequestSpawn(class type) // (RPC)
  • PlayerController.ServerRequestSpawn calls GameMode.Foo()
#

what do you mean?

#

if your client is also a server, then widgets can get the game mode

#

clients can call RPC functions that get sent to the server, but only on actors they own, which is essentially your player controller or something the player controller owns such as: its pawn, actor components on it

subtle peak
#

I'm setting a reference to the GM at start, but it always fails

sterile plaza
#

what class is this in?

subtle peak
#

User Widget

sterile plaza
#

the game mode does not exist on clients

subtle peak
#

Ok, so how can I communicate with the server to respawn?

#

with the Gamemode*

subtle peak
#

Right, thanks

sterile plaza
#

the server can replicate variables and call RPCs on any actor
but clients can only call RPCs on actors they own

subtle peak
#

thank you

white raft
#

Hello, would creating dedicated server and client have to be different project and therefore executable?

fossil spoke
white raft
#

Ah, right. Thanks. Though while I will probably distribute separate (pricing difference, etc) , but if one really wanted if it could be done in same executable?

chrome bay
#

Just make sure that if server fails to fire, you also send the correct ammo amount back to client.

#

You can't really avoid sending it to the owner because if something goes wrong, they could end up in an unrecoverable state

low needle
#

Hi! Did you find a solution about controls?I am trying to posses to a AI character at runtime, but movement input is not received by possesed pawn movement component

hollow swallow
#

my current health is set to replicated. When i update it on the server side to a different number. Other clients only see it as what it originally was. Do i need to do a server then mc when i update it?

agile loom
hollow swallow
#

It is but they cant see it for some reason

#

i increase the amount in a server function

agile loom
agile loom
hollow swallow
#

set to none at the moment. And im updating it from my player bp which is replicated

torpid tree
#

can anyone tell how to replicate custom movement and animations ? Blueprint

tight isle
#

I want to have an array in PlayerState that stores some data which can tell if object related to this player state

The question is what is better to that data to be to for multiplayer in term of performance (replication)

Make object unique id and store in that array
Or store actual object (by reference) in that array?

weak cobalt
#

Hi! I am sorry to message here, but I think I've found a bug in Unreal Engine 5.1, no one can seem to fix the problem I am facing. I'm creating a local multiplayer game for a Uni assignment, and although controllers are being made they all end up possessing player 1 (0). Can someone please help?

round acorn
round acorn
weak cobalt
#

I've tried every set up imaginable

#

๐Ÿฅฒ

#

What details do you need? I'll try my best to give them

quasi tide
#

Show code is what they mean. Walkthrough how things are currently set up.

#

You can always override an event in the GameMode and handle the possession logic in a custom way.

weak cobalt
#

Yeah I'm not very good with unreal so I'm confused with what you mean by this ๐Ÿ˜›

quasi tide
#

Take a picture of your code

#

Post it here

#

We analyze it and walkthrough it to help you debug the issue

round acorn
quasi tide
#

It's not networking related. It's local multiplayer.

round acorn
#

oh, gotcha, misunderstood

weak cobalt
#

I have downloaded a framework and tried that, so I genuinely donโ€™t think itโ€™s my blueprint errors either :(:(

quasi tide
#

Word of advice - if you want help, don't ignore what people are asking for.

weak cobalt
#

Iโ€™m happy to send blue prints, which ones though? Thereโ€™s a lot

#

I'll send anything I think has to do with it in my own work, and then the set up of the other project too :)?

round acorn
#

Mainly need to see where you're possessing the pawns

quasi tide
#

You need to show your setup code.

#

You can override PostLogin or HandleStartingNewPlayer in the GameMode to create custom logic on how you are possessing players

weak cobalt
#

==Player 0 = Keyboard, Player 1 = Gamepad (C++)== By default, the first controller always maps to player 0. The keyboard also always maps to player 0. Thus, in order to control two local players you are required to have two gamepads. A common request is to allow for player 0 to use the keyboard and player 1 to use the gamepad. Unfortunately, it appears the only way this can be done at this time is via C++ code, and the simplest solution is a bit hacky. It is also worth mentioning that this solution works for Game Input, if UI input is set, then the two functions we'll override in the following will return false due to bIgnoreInput being set to true when in UI Input Mode (Haven't found a fix yet).

#

I'm testing with a keyboard and a game pad

round acorn
#

Sounds like just get another gamepad and test onward yeah

#

Unless you really need the functionality of keyboard+gamepad for 2 players

weak cobalt
#

I'm not sure๐Ÿฅน Iโ€™ll have to ask my lecturers

#

Thank you for that

round acorn
#

If it's non-concurrent control (e.g. turn based) you could swap input between pawns

#

in other words, not control both pawns at once

weak cobalt
#

Unfortunately it isnโ€™t, ๐Ÿ˜ฆ

round acorn
#

then you're just handing the gamepad back and forth for example

#

ok, just checking

#

good luck ๐Ÿ™‚

weak cobalt
#

Thank you for the suggestion thoigh

#

You have both actually really helped ๐Ÿ™‚

dim sundial
#

I play as listen server and two players, one is fine, but the other is not. Problems are like can't see VFX, not triggering InputAction

round acorn
#

Sounds like you have multiple issues. Replication and possessing pawn/player controller assignment.

#

Do you know the basics of replication?

dim sundial
#

I see many documents of replication, but still confused with UE's replication tbh. has authority, locally controlled, ga replication are just confusing

#

I run the multiplayer example project, but the output is not explainable to me.

round acorn
#

Watch all 3 of these

dim sundial
#

If i want to turn on a bulb, I need to run this on server and multicast the action. or use a variable and in client side do the things in rep_notify

#

is that all about this?

#

are those videos about this?

round acorn
#

in the OnRep function, yes

#

VFX is no different. if you're not seeing it on the other clients it sounds like you aren't replicating it

dim sundial
#

I am using gameplaycue and confusing

#

addgameplaycuetoowner(looping) this node doesn't do the replication

round acorn
#

Well, GAS and multiplayer are two different things really.

dim sundial
#

it says it will run on server and repliate, but still one client not seeing vfx

round acorn
#

You may be replicating the cue but if the other clients aren't running that logic e.g. through an OnRep function, why would they ever show the VFX?

#

Simply replicating a variable isn't enough. The clients need to run logic associated with that variable or nothing will happen.

dim sundial
#

I play client 1 and client 1 not playing VFX, but client 2 can see VFX

#

I play as listen server, I don't know if client 2 is a client or it's a server

round acorn
#

If you're in C++ a RepNotify doesn't run on the server by default IIRC

dim sundial
#

I have a theory that client 2 is not just a client but also a server, that's why he can see VFX, is this theory right?

round acorn
#

No, in the window's title bar it will say whether it's a server or client.

#

When you play in editor, launch separate windows (don't play in viewport)

#

Look at the title bar of the window, one will say server and one says client (in a listen server setup)

dim sundial
#

yes, i am in separate windows

#

the title bar says netmode:server

#

that's useful, I don't notice the title bar. so the aforementioned client 2 is not a client, but a server and server only

#

right?

round acorn
#

well, the title bar will tell you

#

client 1 usually the server in a listen server imo

#

or client 0

dim sundial
#

I mean it's ambiguous, the server shouldn't have any visuals

round acorn
#

in a listen server mode the client and the server are the same thing

#

for the host client

dim sundial
#

server plus client, all server has it has and all that one client has it has.

round acorn
#

so what kind of replication are you using?

dim sundial
#

so I have a c++ function with "BlueprintAuthorityOnly" and it doesn't work

round acorn
#

Ah, well I'm not very well versed in native replication. Might have to ask someone else here. I can do it in BP all day.

dim sundial
#

I copied from somewhere else, but it surprisingly disable the Input action that used to work

#

my mistake, the ia is not working for the client no matter the c++ function

#

that 's weird

livid sluice
#

If I have a object inside the server that runs a function on beginplay. Would the function still run if the user joins the world at a later time?

chrome bay
#

Well clients will call BeginPlay yes

#

If it's a client/multicast function called from the Server, then no it won't run on clients when they join

round acorn
livid sluice
#

So the use case is. When the server starts. On Begin play it sets a variable called IsMorning to True (Going through Switch has Authority).
This variable is set to Repnotify.
When a client joins, would this variable be set to True or would it remain false (default value)

round acorn
#

The variable is set to true on the servee but when you use a repnotify you need to also do logic in the OnRep function

#

Whatever the client would need in order to see/experience what you want it to experience from the IsMorning variable. So perhaps set that variable in the OnRep function to true is all you're going to need, if the client is using that variable in logic elsewhere. Or actually putting that logic in the OnRep function itself.

livid sluice
#

That makes sense, Ill check again. Thanks!

gritty pumice
#

Hello!
I'm trying to make a multiplayer game where players control ships.
My ship is a blueprint with lots of child actors different modules and interactables.
I'm getting this warning spammed whenever I try to play as a client and I walk on my boat. What does it mean ?

ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction!```
wheat rose
#

Hello! How would I make it so that if a player walks upto a door and presses E on it, they would travel to a new level, however everyone else on the map would not come with them. But if someone else presses E on the door then they would join the other player on that other map.. thank you!

winged badger
#

The way you described it

#

By using multiple dedicated server instances

faint eagle
#

Is there a virtual function that is called for simulated proxy actors when they are initially replicated from server to clients?

winged badger
#

You can cheat though, keeping multiple levels separated in one of them

winged badger
#

All actors will call PostNetInit

#

After their initial onreps are done

faint eagle
#

well autonomous will do too. I mean when a replicated actors that was spawned on server has just arrived to AP/SP

winged badger
#

And you can check the net role they have there

#

Replucated Actor spawned on client:

#

Spawn-Set replicated variables and call OnReps-PostNetInit-BeginPlay

#

In that order