#multiplayer

1 messages Β· Page 19 of 1

torn hull
kindred widget
#

Ah, yeah my bad. It was the net id. GetUniqueId()->GetBytes() as a uint64 is the player's SteamID when using steam. Not sure how that turns out using NullSubsystem

scenic flame
#

I can access the func in BP, but I can't do anything with the output

woeful ferry
#

How would you spawn a level dynamically in multiplayer? Spawning it on both client and server, it will create a duplicate of all actors (even replicated ones). Creating it only server and it will not appear on client

scenic flame
#

I'm not sure how the level transitions are handled tbh, I joined after that was already finished.

kindred widget
scenic flame
#

Alright, thanks for letting me know

kindred widget
#

Well.

#

Not sure if I'd rely on it for more than visual or testing, but you could wrap a library function out of it and return it as an int64, or even just a string of numbers.

#

Would be easier to make an == if there isn't a bp exposed one though. Would still require a library function I think.

scenic flame
#

Thats a pretty good idea actually. Make a C++ function library, give it a function UniqueNedIDStructureToString or something

#

Sweet, that worked perfectly, thanks a lot

thin stratus
radiant cypress
#

Image get updated in clients, but not in server, what am i missing ? ^^

#

also tested without RPC, same result

thin stratus
#

Could be as long as you seamless travel between those levels.

#

It probably won't persist between two sessions

chrome bay
radiant cypress
#

it's on the player controller bp

chrome bay
#

Oh wait

radiant cypress
#

as i saved all the UI widget in the PlayerController

#

i shouldnt ?

chrome bay
#

It's because the Server RPC isn't doing anything

#

It's just calling the client RPC

#

No you shouldn't

#

UI should live in the HUD

thin stratus
chrome bay
#

Also, very odd to have RPCs that update the HUD directly

#

HUD should be driven from gameplay

radiant cypress
#

im not familiar with hud :C

#

always created widgets from pawns or player controllers

chrome bay
#

HUD is just a convenient place to store widgets, and it's easily accessible from the controller

radiant cypress
#

allright

#

are there node that i need to know ?

chrome bay
#

The Server shouldn't see any of the clients' HUDs anyway

radiant cypress
#

yeah thats what i was wondering

thin stratus
#

The HUD is pretty redundant. You just use it as a storage

torn hull
radiant cypress
#

cause it doesnt have to know

dark edge
nimble parcelBOT
#
Unreal Slackers

Support and resources for the Unreal Engine community. Get help, share your work, discuss the latest news.
β€”
Members: 82,267 β€’ 6,773 online
Boost Status: Level 3 26 Boosts β€’
Created: <t:1464706564> β€’ <t:1464706564:R>
Invite: discord.gg/unreal-slackers
β€”
Website β€’ Twitter β€’ GitHub β€’ Donate

woeful ferry
#

Anyone knows why actors spawned from a template in the SpawnParams don't get replicated?

bitter oriole
woeful ferry
bitter oriole
#

idk then

woeful ferry
#

Oh, never mind. I figured it out

bitter oriole
#

What was it?

woeful ferry
#

It get its template from a server only level and thus spawn inside that level which the client doesn't have

#

Can you change an actor's level in runtime?

#
    Actor->Rename((const TCHAR *)0, NewLevel); //Set the outer of Actor to NewLevel
    NewLevel->Actors.Add(Actor);```

Seems to do it
chrome bay
#

SpawnParams takes a Level param

#

You gotta be real careful about renaming objects at runtime if they are replicated

woeful ferry
# chrome bay SpawnParams takes a Level param

Still doesn't work unfortunately.

    {
        UWorld* World = ActorToCloneFrom->GetWorld();
        FActorSpawnParameters SpawnParams;
        
        SpawnParams.Template = ActorToCloneFrom;
        
        if (NewLevelOuter)
        {
            SpawnParams.OverrideLevel = NewLevelOuter->GetLevel();
        }
        
        AActor* Actor = World->SpawnActor<AActor>(ActorToCloneFrom->GetClass(), SpawnParams);
        return Actor;
    }```
#

I tried this and the actors that get cloned, doesn't get replicated 😦

chrome bay
#

Ahh right, maybe it's some issue with using the template

#

That is odd tho

woeful ferry
#

Yea, real odd :/

I need to copy the actors from the sublevel to the persistent level

#

in runtime

chrome bay
#

Isn't there a function to move them into different levels?

woeful ferry
#

I've tried to look for it, but can't find much

#

I have these levels that are point of interests for our procedurally generated world. But I only use them as templates to copy from in runtime

#

Making a whole science lab room inside a BP is a pain

kindred widget
woeful ferry
#

Like this?

kindred widget
#

Yeah. May work.

woeful ferry
#

Gonna try! I've asked on UDN now aswell πŸ˜„

#

See if we can get some answers if this doesn't work

woeful ferry
#

Thanks πŸ˜„

chrome bay
#

Ah yeah, that makes sense

zenith wyvern
#

Might someone be able to solve this for me? I have a UI (A), which is owned by my player controller (B). The player controller created an AI char and AI controller (C and D), and set their owners to the controller (b). The AI char (c) has a replicating component (X). Problem: calls from the UI don't fire server RPCs on X

bitter oriole
#

Has to be PlayerController, possessed pawn.

zenith wyvern
#

It is a possessed pawn

#

It's not possessed by the controller with the UI tho, since its an AI

bitter oriole
#

Possessed by the player

zenith wyvern
#

Even with 'owner'ship set?

bitter oriole
#

PlayerController, pawn possessed by that PC, or actor with ownership set on the server to that PC

zenith wyvern
#

I believe ive set up the entire ownership chain

#

etc

bitter oriole
#

The pawn has to be PC-possessed

#

Possessing changes ownership

zenith wyvern
#

oh, so 'an actor with ownership' excludes possessed pawn

#

so, what option do i really have, besides what im already doing:

bitter oriole
#

The test is "is this actor or component owned by the PlayerController running on the local client"

zenith wyvern
#

On the left, i have to make an RPC on my controller, for every function i want to call

#

The 'remove item' will get the same treatment, 'remove item on server'

bitter oriole
#

Either possess that Pawn directly from the PC, or go through the PC for RPCs

zenith wyvern
#

I'm working with the common 'top down for multiplayer' setup, that has a pc and invisible pawn, then an AI controller and char to appear as though moving from replication

sinful tree
#

Possess shouldn't matter if ownership is set.

bitter oriole
#

Not sure what the AI controller is for, really

zenith wyvern
#

all the ai controller/char does is move to location (which happens on server)

bitter oriole
#

AI controller is specifically intended as a player replacement

zenith wyvern
#

mostly to handle things like move to on right clicks

#

Datura. I've gone through every step of the chain and i feel like it should work...

#

ive even put ownership on the widget

bitter oriole
#

The widget is irrelevant

#

You simply cannot RPC through an AI Pawn

#

Either possess it directly, if you only have one pawn per player; or go through PC

zenith wyvern
#

Does Daturas comment support that? It sounds contradictory, unless im reading it wrong

bitter oriole
#

I guess Datura is saying that you don't have to possess if you set up the authority

#

If you do possess though it has to be the PC

zenith wyvern
#

gotcha

#

Can i get away with.... unposses(), func(), posses()

#

sounds awful to do every call but...

bitter oriole
#

Either possess that Pawn directly from the PC, or go through the PC for RPCs

#

You simply cannot RPC through an AI Pawn

#

The pawn has to be PC-possessed

sinful tree
#

AI Pawns can be owned and RPCs can be sent through them.

#

You can't send RPCs through an AI Controller as the controller only exists on the server.

bitter oriole
#

AIC isn't replicated so no shit

#

Yes, you "can" RPC through AI Pawn, just change the ownership every time you possess it

#

Or, hear me out, design this properly in the first place

zenith wyvern
#

if you google 'unreal top down multiplayer' there are 100 tutorials guiding to this exact setup

#

not saying its the best, but its the starting point for a lot of people

#

so, i was wondering if it can actually be made to work

bitter oriole
#

Just because lots of people teach something doesn't mean it's the best thing to do

zenith wyvern
bitter oriole
#

Anyway, feel free to hack your way through the engine's design, I'm just trying to point out the easy and widely used way to design around this

zenith wyvern
#

as this has an owner set, unpossessing would leave my controller as the owner i imagine, right?

bitter oriole
#

APawn::UnPossessed specifically nulls the owner

#

The initial owner of a Pawn is quite meaningless

#

Pawns are managed through possession

zenith wyvern
#

How about multicast.....

#

i suppose an action like inventory management would actually be? or no?

#

and that i could call from ai pawn?

#

or am i just making you madder by typing that πŸ˜„

bitter oriole
#

You can't fire any RPC from a Pawn you did not possess (or hacked your way through ownership disregarding the engine's design)

#

You have three solutions: don't use the bot system (AIController is meant for shooter bots), or use the common method of routing RPCs through PlayerController with an interface, or hack your way through something

zenith wyvern
#

so the passthrus ive been doing is actually something others do?

#

it feels like its just going to go on forever tho

bitter oriole
#

You don't normally have dozens of independent classes that are server-owned, but player-controlled

#

If you're doing a top down squad-based cover shooter or something you'd have a "send pawn to location" RPC on PC that would take a pawn as parameter

#

If you have usable objects you'd have an "use" RPC with the object

#

etc

zenith wyvern
#

As you can see, this isn't going to work out much longer

bitter oriole
#

I mean having RPCs is a fact of life - your problem here is that you're trying to control things you do not cleanly own

zenith wyvern
#

yeah. i stopped work to try and figure out the right way to be doing this

#

and it doesnt sound like its going to as is

bitter oriole
#

The way I see this, a third of those look inventory related (put that in your player-owned replicated inventory component), a third are normal player stuff (saving, loading) and the rest are things your unpossessed (no AI controller), player-owned pawn could do

zenith wyvern
#

They're all calling inv component functions, because I couldnt directly

bitter oriole
#

Why not though?

zenith wyvern
bitter oriole
#

Just move that RPC to the component

#

You'll always need an RPC of course

#

That's just normal

zenith wyvern
#

not sure i follow. i had the rpc on the component, but i cant fire it

#

because its not owned, as per this whole conversation

bitter oriole
#

Your inventory component should definitely be owned by the PC

#

Or the Pawn, which should be owned by the PC

zenith wyvern
#

its on the pawn

#

and that pawns owned by the ai controller

bitter oriole
#

Then I'm going back to my original point: remove that AI

zenith wyvern
#

right

bitter oriole
#

Either possess (one pawn per player) or don't (>1 pawn)

#

But cut the AI

#

It simply doesn't fit the design

#

Or live dangerously and keep the AI but try to force the ownership after possession, but like I said, I wouldn't like that

fluid summit
#

Hi everybody!
I'm just figuring out AI and my setup is local multiplayer do i need to take anything extra into account?
As far as i know, the AI Controller runs only on server, so it should be all the same, right?

ancient adder
#

I have an rpc function like this cpp UFUNCTION(Client, Reliable) void ExampleFunction();

I call it on the server and to make sure its a server i do cpp if (GetNetMode() == NM_DedicatedServer) { ExampleFunction(); } But its executed on the server, is that normal?

#

I tried both in Standalone and viewport mode, im using "Play as client" netmode

past totem
#

hi does anyone know anything regarding crack protection in multiplayer servers?
I get that for singleplayer u can't really do crack protection, but it might be possible for multiplayer, what do you think?
with Steam.

#

I was thinking that the most common way to crack MP is to emulate Steam right like you own the game?
but maybe the server can check if the player owns the game on steam somehow

sinful tree
past totem
#

ok yea that's what I was thinking, do you know how I can do that ?

#

preferably with as little CPP as possible XD

sinful tree
#

To put it plainly, the only way you could guarantee that the player has indeed purchased is if you control the servers they are connecting to. If you allow players to run their own servers then someone will be able to break it so the check doesn't do anything.

past totem
#

hmhhm

#

can I do it with this?

sinful tree
#

Yep

past totem
#

but then can I package my key into the game or will people hack it and valve will scream at me?

#

or do I need it to be like a separate file that I only put on my servers

sinful tree
#

If you give away your keys, you're giving them access to muck about with how your game is represented on Steam.

past totem
#

well it's just the api key

#

but I guess that answers it I can't put it on the client okay

#

but isn't there anything I can do for serevrs that people host?

#

for example in ARK, it's super hard to crack it to play multiplayer

#

how did they do it

#

you have to download like a whole bunch of shit and it's really complicated to play online on cracked

sinful tree
#

All you can do is deter and make it difficult, but not impossible.

past totem
#

yea

#

how

sinful tree
#

Once you have something running on someone else's hardware, they have the means to mess with it and break whatever security you have in place.

#

That's not something I'd be able to answer myself.

past totem
#

rip

#

okay thx

sinful tree
#

Sadly, you probably won't find any answers to that either, as even discussing "how" someone does it effectively reveals the key to how to break it πŸ˜›

past totem
#

: - (

marble thorn
#

Hey Guys, i have a project in which OnlineSubSystemforSteam is used for building a listen server based game. Bow I want to remove the steam server code and build a new dedicated server with the same game logic. How hard will it be and are there any resouces to similar projects? What will be the steps to be taken to successfully build a dedicated server from a listen server project? Thanks in advance

kindred widget
# ancient adder I have an rpc function like this ```cpp UFUNCTION(Client, Reliable) void Ex...

For starts I'd recommend avoiding Dedicated server checks unless it's for some form of optimization. Like not having particles or sound. If you want a server check then do GetNetMode != NM_Client. Anything except for a client is a server.

As far as a ClientRPC running on the server, yes that's possible. It will run on the server if the thing it's on is not replicated, it will run on server if the thing is replicated and server owned.

quasi tide
#

< NM_Client is always some form of server. There is a netmode that is > than Client. It's not used anywhere, but you never know πŸ˜…

ancient adder
#

Aha, the issue is i was calling the rpc too fast, had to wait till the client was setup

ancient adder
kindred widget
#

Dunno. Not sure what you'd gate RPC wise for a dedicated server only. I would personally prefer to keep options open. Your net code generally should not really matter if you're running Listenserver, Dedicated, or Standalone. The specific checks like Dedicated are usually only ever used specifically for optimization purposes. Keeping the server from creating costly materials, doing unnecessary visual setup code, etc. And that all just gets checked locally in some functions, it's not really netcode as in RPCs usually.

ancient adder
#

Isnt there a way to prevent a code from executing on server no matter what?, GetNetMode doesnt help, code runs on server even if NM_Client, will #if !WITH_SERVER_CODE or #if !UE_SERVER do the job?

chrome bay
#

Only if you compile a dedicated server

ancient adder
#

Great to know, one more question, does #if !WITH_SERVER_CODE or #if !UE_SERVER Disable the code block or removes it completely for dedicated server?

chrome bay
#

removes it completely

cosmic yoke
#

hello i have a character that has a cube attached to the camera and i want both clients to see the current rotation of the cube. I set the camera and the cube mesh to replicate and launch a listen server and the rotation done on the listen server client are visible on the other client, but not the other around. why is that?

#

also, if i set to dedicated server, only the local character has the cube rotation set, so it's the same problem but for 2 clients

#

i can fix it on the listen server if i do a server rpc to add controller pitch input on the server instead of the client, but shouldnt the add controller pitch input on the client do that automatically?

radiant cypress
#

Using RepNotify variable for my character's healthbar. Working perfectly.
But it doesn't get updated at the begin play.
Do I really have to SET the variable at Begin Play ? Or is there a better way ?

#

i mean the default value of the health variable is the health i want him to have at BeginPlay

thin stratus
#

Well the OnRep doesn't call for the initial value unless it's changed

#

So in your healthbar you just get the current value on Construct

radiant cypress
#

When i do it in construct, it is too soon, it doesnt work

#

^^

thin stratus
#

That is not needed

radiant cypress
#

but its a widget component

#

i tried to mess with construct

thin stratus
#

The proper way of doing that is getting the value on Construct and listening to a delegate

radiant cypress
#

i see

thin stratus
#

For future changes

#

If Construct is too early then you have to manually init it whenever it is not too early anymore

radiant cypress
#

How comes we cant set an image variable in a data table ?

thin stratus
#

Image variable?

dark edge
radiant cypress
#

@dark edge "Image"

thin stratus
#

That's probably a UImage which is a pointer to an image widget

#

What you want is either a material or a texture 2d

radiant cypress
#

Got it πŸ™‚

#

thx !

lost inlet
#

is the most up to date example of a repgraph still the shootergame one? I didn't see one in lyra

#

there is UBasicReplicationGraph but I'd like to see a more game-specific example

odd ruin
#

Hi, simple question: if i run a multiplayer game with 3 players, how many PlayerController do i have? Only 3 for each controlled Character or does every simulated proxy has an PlayerController as well?

short arrow
odd ruin
graceful flame
#

You can think of a controller as like a Playstation or Xbox controller or even a Keyboard+Mouse combo that a real human uses.

#

A human only uses one controller at a time, but maybe you have a few different ones in your game for them to use at different times.

short arrow
#

@odd ruin do consider watching this in the future.
https://www.youtube.com/watch?v=JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

β–Ά Play video
odd ruin
#

simple example: if i run the simple code: if(PlayerController) { do XYZ;}, will this line excecuted on the proxies?

short arrow
#

I have watched it at least 5 times now and learn something new I didn't understand before every time

odd ruin
short arrow
#

awesome

short arrow
#

unless I'm over thinking it... But I'm pretty sure you would want to check if it's not the dedicated server

#

and if true; then you'd get the reference to the controller -> and then do XYZ

pallid mesa
#

πŸ€“ controllers exist in server and owning clieeeent 🎡

#

To ensure that a controller is local you can check IsLocalController 🎡

odd ruin
#

the reason i am asking is, i am trying to pass the MouseCursor position to the server and from there to the clients since this is the position where my bullets go (TopDown Shooter).

pallid mesa
#

that's okay, similarly onclick or ondrag you can forward to your server controller input data

short arrow
#

as long as it's not the dedicated server then we know for a fact a controller exists

pallid mesa
#

dc server or not the server will hold all the player controllers

short arrow
#

indeed, that wasn't what he asked though

pallid mesa
#

I think its answered already with all the info that was written down

#

πŸ˜„

short arrow
pallid mesa
#

server rpc first if not authority, and then replicate if stateful, or multicast rpc if transient (in case you want to forward this input data to the other existing connections)

odd ruin
pallid mesa
#

take a little read to my article, towards stateful replication, maybe it helps to grasp concepts of transientness vs statefulness

pallid mesa
#

no problem, regarding specifics, replication on an actor channel that is replicated only to the owning connection will have no effect over simulated proxies

short arrow
#

it's really all it takes

dark edge
short arrow
#

True! this wouldn't work in the player controller. Perhaps I'd put it on the clients pawn

#

though the concept remains the same

pallid mesa
dark edge
#

I'd replicate a variable myself but either or will work

short arrow
#

replicated variables are reliable

#

:p

#

at least it's never been unreliable as far as I can tell

odd ruin
short arrow
#

yeah you can't do it in the player controller, I don't know how I forgot that

#

put it in the pawn

short arrow
#

the way you explain things are really complicated. You could also just say "player controllers don't exist on other clients"

pallid mesa
#

I said it πŸ˜„

short arrow
#

you right you right

pallid mesa
#

problem is...

#

i like to be a bit of a goofball when explaining things

#

cause I enjoy multiplayer a lot

#

🀣

dark edge
pallid mesa
#

you want to kill me right 🀣

dark edge
#
  1. Do heavy math on server, replicate result
  2. Replicate seed, do math everywhere.
pallid mesa
#

soyougenerateaseeddeterministicallyoneveryasblablah

dark edge
#

In my case result is MUCH smaller than the intermediate stuff

#

but it'd still be replicating say 5k actors of various complexities at worst case

#

individual walls and doors and windows etc

pallid mesa
#

you can always route replication through a network manager 😏

#

but I get it

#

it's a PITA

#

as long as your profiler doesn't yell at you for your use case

#

it'll be okay πŸ’ƒ

#

you can actually leave these optimizations for a later phase if needed

dark edge
#

This isn't our project but targetting about a square km map at this sort of density.

pallid mesa
#

you might want to speak with le kaos and le zlo

#

they had to deal with a similar complexity pretty recently

odd ruin
#

OMG i made it. Thanks for you guys help. Short version: if(IsLocallyControlled()) {Get the Mouselocation from the playerController; Than Call Server RPC with passed in Mouse location; which calls MultiCast RPC with the Location}

dark edge
#

Sorta like a live-action XCOM is what we're going for

oak prawn
#

I want them to connect directly to their friends on Steam by inviting them through the lobby. The invitation goes to the person, but when he accepts it, it does not connect to the map automatically.

#

FriendList Δ°nvite button

#

Friend Accepted

#

FriendList

#

What is wrong or missing?

fossil spoke
#

You have to travel them to the session being hosted once you "Join Session"

oak prawn
#

Is there a guide on how to do this?

fossil spoke
#

Have you checked if the session join is failing?

oak prawn
#

I don't know exactly as I didn't put the invite accepted print string

#

If it was successful, wouldn't the session join?

radiant cypress
#

Poping a little text BP when Overlapping my shop. I set the shop NON replicated, as i think its not necessary ? I need every player to see his "personnal" text widget when approaching, just like this :

#

But somehow it messes up with clients

#

(the textBP im speaking about is the "Press C !")

#

Also tried with setting the shop REPLICATED, and with RPCs, same result

dark edge
radiant cypress
dark edge
#

locally, the shop displays the widget component when CONDITION. The server doesn't know or care about it.

radiant cypress
#

but when playing as client, server still sees the widget

#

btw its a BP with text render, not a widget

dark edge
radiant cypress
dark edge
#

You'd doing that locally yes, but on the server AND client

#

btw that's gonna break when you have 2 clients nearby

#

Actually it might not as long as you gate by if the ship is locally controlled for all entries and exits

radiant cypress
#

when approching the shop with server's ship :

dark edge
#

Yup that's correct

radiant cypress
#

and btw

#

i intend to create a respawn mechanic when a ship dies

#

ive done it before

#

and when it happens, its not locally controlled anymore

#

i dont understand shit about this

#

but that's another story

#

Thx for the help, it works now

limber cloak
#

how to get a list of playercontrollers in C++?

radiant cypress
#

Currently worried about the respawn mechanic

#

in C++ ? πŸ˜„ Cause i can tell you in blueprint

limber cloak
#

yes in C++

#

the array

radiant cypress
#

In game mode, on "Event PostLogin", you need to add the incoming player controller to an array

#

And "On Logout", remove it from the array

limber cloak
#

is there a tutorial that i can learn from?

#

can you link it to me?

radiant cypress
#

well i think you just have to find the corresponding C++ functions

#

of what i just told you πŸ™‚

#

i dont know any tutorial for c+

#

GameMode => Event Post Login, and Logout

limber cloak
radiant cypress
#

πŸ™‚

shell field
#

Hey folks, I'm trying to get my hands on modding the Unreal engine 3 and on a tournament 3 or the Unreal development kit, something like that. I really want to mod the game, any of you can lend a hand in an advice, what would be the best option? Also yes I know the engine's longer used. I'm just trying to mod the game, any tips or advice?

latent heart
#

We're not really a modding community!

shell field
#

oh

#

Sorry didn't know that

oak prawn
#

After adding the advanced session plugin to my game, the game does not work when rendering, what is the reason?

#

It works fine when rendering without the advanced session plugin.

limber cloak
#

for multiplayer, is it better to cast to APlayerController or AController when you are storing the players?

plucky prawn
plucky prawn
#

do you have a player controller type that you have made?

limber cloak
#

you mean MyCustomPlayerController?

plucky prawn
#

yes

limber cloak
#

no i didnt make any custom player controller

#

ohh ok thank you

#

Also what code do you place in a playercontroller?

#

do you have an inventory component?

#

i doubt you can add an inventory component

plucky prawn
#

personally i would make this on the character instead but like with everything it can depend on what you want to do

limber cloak
#

i mean i never tried

plucky prawn
#

having it on the character means that possessing other characters will not persist inventories and such

limber cloak
#

yeah

#

Thank you

#

What code do you add to ACustomPlayerController class?

#

like no code at all or?

#

like maybe owning pawns if its an RTS?

#

or its on the default pawn

plucky prawn
#

whatever code is needed for the player controller? it will persist across possessions and afaik its supposed to be like the "will" of the player. eg what the player wants to do. think of it like the actual person themselves. what info do they need? maybe some OSS stuff?

limber cloak
#

ahhh ok ok thank you

#

now I get it, when you said its like the player itself and his will πŸ˜„

#

like OSS stuff

sinful tree
#

Separation of code in regards to the player controller usually is a bit easier to understand when dealing with multiplayer, but ideally Player Controller should be used for any controls that do not pertain to the specific character they are possessing. An example would be like an input for a pause menu. If you're making an RTS game, then you're probably routing most of the controls of your units through the player controller as well since you're probably not directly possessing any of them and are instead issuing commands to your units who then have an AI Controller that handles the commands.

dark edge
sinful tree
#

Yeah probably

odd ruin
#

How expensive (Bandwidth) is it to replicate whole Actors (i.e. Weapons). Should i avoid it if possible or does it not matter?

sinful tree
thin stratus
#

Depends on the additional data in the actor. What usually is way worse is the ms it costs to consider the actor for replication. Tweaking some of the replication numbers for less important Actors is a good idea

limber cloak
#

guys if I want to make a player own an actor/pawn i just need to SetOwner(playercontroller)?

#

for lets say RTS

plucky prawn
limber cloak
#

A camera that contains a list of selected units i guess

marble thorn
#

I tried to build a dedicated server for a multiplayer grame having steam engine listen server. I tried removing the steam onlinesubsystem plugins and configuration from defaultengine.ini file. But I am having a few issues. One of them being the lobby game mode not working when lobby is set as the default server map. In the server log, I am getting the following error, β€˜LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.

Any idea why and how to resolve the issue?

past totem
#

Good morning everybody

#

I playtested my game yesterday on a server

#

It was great fun

#

My code is incredible

#

120 ping but smooth gameplay apart from what isn't

past totem
#

And in packaged or standalone

marble thorn
stoic ore
#

Do I get it right? In the network compendium it says that a non-seamless travel must occur

  • When loading a map for the first time
  • When connecting to a server for the first time as a client
  • When you want to end a multiplayer game and start a new one
    Means, that if I travel from my lobby to the game map, I need to do non-seamless travel? Since it didn't get loaded before.
bitter oriole
#

Pretty sure it's just the first map your game load, as in the menu one

#

If connected to a lobby on a server, traveling to a different map can be seamless

stoic ore
#

ah great. I was already a bit confused, since it would make seamless travel useless on my end. Thanks πŸ™‚

chrome bay
#

yeah, should AFAIK just be the initial connection to the Server - so long as you stay in that server everything can then be seamless from then on

radiant cypress
#

Hey ! Using RepNotifies to update a widget component above head. Life is a Float variable, and everything is working fine.
Level, however, is an Integer, and the widget component update only on Clients. Everything is set up the same. Are there difference with Integers on RepNotify ?

chrome bay
#

noop, should be the same

radiant cypress
#

When changing the variable to a float, and making the rights move to repair nodes involved

#

it works

#

so it must have a difference

#

My level get updated on the server widget component when it's a float

#

very strange behavior

weary laurel
#

I'm thinking of renting a virtual server, which Windows Server version would be better for me to rent? 2016, 2019, 2022 or does it matter?

thin stratus
#

The newest I guess. But I would suggest you check if Linux works for you. They are overall cheaper

chrome bay
#

+1 for Linux VM's

dark edge
chrome bay
#

Also +1 for digital ocean

eternal pumice
#

Hey guys, could someone tell me what would be the best way to store data for a non-seamless travel? Lets say I have a variable in player controller, where should I move it so that its value should not change? I might have multiple game modes

eternal pumice
#

its data seems to get changed tho

limber cloak
#

for example, multiplayer

#

the session doesnt die

#

if you cant find anything useful, you can save it on a file

#

ask again cuz i didnt solve your problem πŸ˜„

#

sorry

eternal pumice
#

its all good, I'll try something new on a new project and then see what might be done

halcyon totem
#

when we run a dedicated server, do we have to make each server use a different port when using the same game? I have a problem if I launch 4 different servers and 4 different game modes everyone can only join the first server I run

#

even though all the others show up...

sinful tree
#

If it's running on the same computer, then yes, different ports for each server.

worthy magnet
#

When using dedicated server (testing in editor) client 0 is extremely laggy, but every other client that connects is fine

halcyon totem
#

@sinful tree I tried different ports but it still only connects to the 1st server that runs

#

I start my server with a bat file is this the correct way to do the port? -Port 7778

oak prawn
#

I want to invite my Steam friends and join them directly from the steam interface. but it stays in the main menu. Session not connecting

#

Accepted

#

FriendList

#

FriendInvite

#

where is my mistake or omission?

split siren
#

Design question - Let's say my character has 8 skeletal meshes which make the body. (Head, torso, hands, gloves etc) Like Fortnite does.

Would you create 8 separate replicated FSoftObjectPath in the character class OR would you wrap the 8 FSoftObjectPath in a struct and replicate that.

My first instinct was to wrap them in a struct with ReplicatedUsing, but then it's a bit annoying to find out which one of the 8 values changed.

wind dirge
#

has anyone seen a method for replicating live link data across a multiplayer session (e.g. body/face data?)

vagrant falcon
#

i have TArray in Actor Component replicated and acting as proxy for my subsystem
is there any way to find out what index was modified when repNotify fires up without parsing it with a previous copy in my subsystem?

fathom aspen
#

You have the param of the old value in the OnRep function, i.e. OnRep_Blah(OldValue)

floral tulip
fathom aspen
split siren
split siren
halcyon totem
#

is this the correct way to set the ports for unreal egnine dedicated servers?

#

is the append node correct? Is it suppose to open level by name?

twilit radish
halcyon totem
#

EmbryosServer -log -Level=Complex1Hunt -Mode=Hunt -ServerName=TDM_Server_Long_Beach_NY -port 7778 -AUTH_TYPE=deviceid -AUTH_LOGIN=test -AUTH_TOKEN=test -MapRotation=Complex1Hunt

pause

#

I have it coming out into the host

#

and then into the open level by name

#

but its not working

#

am I doing something wrong?

oak prawn
#

this code is not working. I can invite a friend on Steam, but nothing happens when they accept it.

halcyon totem
#

@oak prawn did you put the steam 480 file in your folder?

oak prawn
#

yep. The code of my game, which is currently on steam, is written in txt

halcyon totem
#

i dont know if your using version 4 or 5

#

but we needed to use advacnced sessions

oak prawn
#

5.03ver

halcyon totem
#

maybe you should try that and see

plush otter
#

Hello, I have problem with placed actor in the level.

radiant cypress
plush otter
#

when I place a replicated actor in the level, the repnotify functions seems not firing when variable is changed on the server

#

only does if I spawn the actor on the server

#

the variable is stored in an actor component

#

I have no such issue with variable in the actor itself

oak prawn
dark edge
plush otter
#

yes

dark edge
#

Show your replication settings from the actor down to the variable. Actor, component within actor, then variable inside component

plush otter
#

I tried without dormancy. same issue

dark edge
#

which component is it

plush otter
#

AC_Inventory

dark edge
#

does the value replicate out and just not fire the repnotify?

plush otter
#

I think is repnotify not firing

#

I use it to refresh client side inventory UI

#

When manually call a refresh function on the client, the repnotify variable is indeed changed

dark edge
#

Show the repnotify function

#

Or just have it print a string to see if it's even firing

#

You don't know if it's not firing or if it's just not doing anything useful

plush otter
#

the print string doesn't showup

dark edge
#

Don't do this

plush otter
#

but this is even after print string

dark edge
#

Just nuke all that and remake the repnotify and have it print a string

plush otter
#

ok

#

same thing

#

it only functions when I do this on server.

#

doesn't work when actor is dragged into the level

#

of course I can use a walkaround to place anchor points and make server spawn the actor

#

just want to know what is causing this issue.

plush otter
#

That OnRep variable is an array of structure. If I only change the structure within this array. OnRep doesn't fire.

#

If I add an extra index to this array. OnRep fires.

#

It's Blueprint structure, so I did not mess up anything with c++ structure define.

dark edge
#

BP structs are kinda scuffed anyway

plush otter
#

maybe I should submit a bug report

fluid summit
#

Hi! does anyone know if there's some free API to generate multiplayer chat in-game?

So different sessions just hit the API and get updates from it when you are on.

past totem
#

is there anything I can do to reduce the ping I get?

#

or is that only related to the location of the server vs client

dark edge
#

I mean there's connection quality etc

past totem
#

I get like 100-140 ping between Israel to United Kingdom (4 hour flight). Does that make sense?

#

I feel like that's really high

dark edge
#

That 100% depends on your network conditions and there's nothing software you can do about it.

past totem
#

okay thanks

fluid summit
dark edge
#

@past totemI bet half of your ping is between your machine and the ISP and the servers machine and ISP

#

Tracert it

halcyon totem
#

can someone please help, everything is so confusing, spaces before the append, spaces after then append, now I read something and I need an equals sign? what is the correct way to set the bat file for the port? I have this set up with the bat and it works but Its not working with the ports, is -port 7778 ok, or do I need -port=7778? I cant run more the one dedicated server on a PC unless I tell it what ports to use. do I need any - in the append any = in the append, is someone could help and post the code on the paste bin to help out, it doesnt want to connect to any other server but the first one I start because of this port issue

past totem
limber cloak
#

I have 2 questions:

  1. where do I store my clients data, before they join a server and after they join a server. As long as the game is running the data needs to be present there?
    2)Where do I store my server data, as long as the game is hosted, even if it changes the map?
ember slate
limber cloak
#

what if a client starts the game, there is information to be stored, does the game instance work for the clients? Can they grab those information?
Lets say a client is on the main menu and stores some data.
Now the clients joins the server, can he retrieve the data that he stored in the main menu?

ember slate
#

Yes, that's the point of the game instance.

However, its obviously not replicated, this is local to each player.

limber cloak
past totem
#

My game has better fps in single player compared to playing on a server, does that make sense?

#

Has anyone ran into multiplayer issues with world partition? I feel like it gets laggier the more I explore, like the chunks won't unload or something.

#

Dedicated servrr

twilit radish
#

Profile your game/server and see what comes out of that πŸ™‚

past totem
graceful flame
#

You can test with the net profiler

narrow nacelle
#
auto AICtrl = Cast<APhobosUnitController>(Cast<APawn>(Actor)->GetController());

this fails on clients, and i cant seem to find the problem

#

to be precise, it stops a for each loop when i hit this line???

#
for (const auto Actor : SelectedActors)
        {
            if (!IsValid(Actor)) continue; // Skip null actors, they shouldn't be in the list anyway.

            auto AICtrl = Cast<APhobosUnitController>(Cast<APawn>(Actor)->GetController());
            if (!IsValid(AICtrl)) GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "Invalid AI Controller");
            
            // We create a new command object, and wrap it in a USTRUCT to be able to pass it to the RPC function.
            // TODO: This is just a prototype
            FUnitCommandMoveToLocation* Command = new FUnitCommandMoveToLocation(FMath::RandRange(0, 9999), AICtrl, FormationPositions[0], Direction.Rotation());
            FCommandWrapper CommandWrapper = FCommandWrapper(Command);
            
            GiveCommandToActor(AICtrl, CommandWrapper); // Call the RPC function
            
            FormationPositions.RemoveAt(0);
        }

it executes properly on the server

past totem
#

To do this, you need to use a version of the engine with stat tracking enabled I don't know if this includes development builds

#

and do I need to do this network profiling on the client, or the server?

narrow nacelle
chrome bay
#

Note AI controllers don't exist client-side

narrow nacelle
worthy magnet
#

Can anyone explain why get player controller doesn't work for multiplayer? What am I supposed to do instead?

quasi tide
#

Often enough, you can just do a regular GetController call anyway.

worthy magnet
#

What is the difference?

latent heart
#

It'll only work for the owning player because they aren't replicated to anyone else. Use player states instead if you want to share info or whatever it is you're doing.

#

Or pawn etc.

past totem
#

How do I run netprofile disable on the server?

#

It's literally impossible because the log cmd thing can't have commands entered to it.

#

Do I need to code an RPC that executes commands that I want on the server? or is there an easier way

#

also, I networked profiled on the client (logged in on a dedicated server), do these results seem alright?

graceful flame
#

Watch the epic deep dive video on networking optimization they explain how you use the network profiler

past totem
# graceful flame Watch the epic deep dive video on networking optimization they explain how you u...

This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.

NEWS

Unlocking Breach’s combat with Unreal Engine
https://www.unrealengine.com/en-US/tech-blog/unlocking-breach-s-combat-with-unreal-engine
...

β–Ά Play video
graceful flame
#

Try to minimize waste on the actors

#

Yeah

#

Around 20:40

past totem
#

thanks let me look

past totem
weary laurel
#

I write the port with my IP address to the "open level" function to connect to the server, but there is no interaction.
Do you have a method to reach another server that you know or see this resource?

weary laurel
past totem
cold moat
#

Guys, If I'm creating a multiplayer game that can be played on single-player, will the RepNotify functions be called when on single-player as well?

woeful ferry
#

If you're in c++, in BP they're called with every set

cold moat
#

I'm on BP hm

woeful ferry
#

Then it's getting called already

#

In BP it gets called every time you set a variable both on server and client

cold moat
#

So I don't have to worry about calling them even on a single-player instance of the game?

woeful ferry
#

No

#

Only arrays are iffy, if you use Array.Add(), repnotify won't be called

#

On server

#

So you have to call it manually there

cold moat
#

I see, okay!

#

tysm :)

woeful ferry
#

np!

past totem
#

hi,
I have an actor that I spawn on the server and is replicated to clients,
and apart from that, it just has some RPCs. no replicated variables. Can I set it to Dormant All and it will still work fine? Also I need it to get deleted for all clients when I delete it on the server.

worthy timber
#

hey guys, any idea why im getting a bit of lag on my client(peforming the action) screen? everyone else but the person viewing themselves perform the action on the clientside sees it correctly. also is what i circled in red redundant?

past totem
#

it must be done in cpp because it's part of the movement component

#

here is how to do it

#

files download included

worthy timber
#

thats crazy. so i cant just change the default max walk speed?

#

i also had a similar issue when i changed the scale of the character to be a giant(just for testing) seemed like it was causing some lag to the person who is performing th action

past totem
past totem
limber gyro
#

has n1 here tested how many players can "out of the box" unreal server hold without issues?

past totem
#

so if you remove all functionality, probably 300+

limber gyro
twilit radish
#

Really depends on the hardware though.

limber gyro
#

but i was just looking for a ball park figure

twilit radish
#

There's not really a simple answer IMO, depends on all the features you have / the nature of the game, how well optimised your server is and like just said the hardware you want to run on. And in the end if you plan on actually running dedicated servers you should look at it your self because it's a lot of money down the drain if you buy/rent more expensive hardware then you need.

limber gyro
#

say a not so complicated shooter like COD on ur average top of the line desktop

#

do u think it would be able to hold like 64 players?

#

or maybe 50

#

also whats the bottle neck exactly? the amount of data the network has to send?

#

or the processing power nescessary for the server?

twilit radish
#

I mean Fortnite and PUBG can run a hundred at once in a pretty big map, so it's possible. I just don't know what hardware they run and how optimised it is.

limber gyro
#

could some you get away with it if you slowed down tick rate for example=

twilit radish
#

You can definitely squeeze some performance out of that, which isn't ideal for a PvP shooter though if we're talking COD like.

limber gyro
#

ye but form what i know the netcode for fortnite is modified

#

battlefield does 64 players i think

#

so it should be doable

twilit radish
#

Battlefield doesn't use Unreal though.

limber gyro
#

im just not aware of how hard it would be

#

or if it would be hard at all

twilit radish
#

Regardless of in specific the player count, dedicated servers them selves are complex and very pricey. You need to maintain them which people really underestimate if you ask me. You need to do a lot of work to even get it to work most of the time (or pay even more to do stuff) for things like matchmaking, inventory systems, crossplay, shops and whatever else your game may have.

#

May I ask if you're doing this alone or with a team?

#

If you're alone I would honestly say it's going to be extremely difficult. If you have a team you could do it, but that likely assumes you have people that know more about it already.

limber gyro
#

im doing something with servers but the players per server is going to be 6 players max so its not an issue

#

i am going to be doing dedicated dynamic servers tho

#

but i am taking it slow

#

im coding a matchmaking server now going good so far

#

hopefully i will be able to run some servers for ranked matchmaking on a spare laptop that i have

cold moat
#

A variable set to replicate will ALWAYS replicate even if has not been changed on a RPC?

fossil spoke
#

Replicated variables will only replicate their value to Clients if the value has changed on the Server.

#

Read the Compendium that is pinned in this channel.

dark edge
cold moat
cold moat
# fossil spoke Read the Compendium that is pinned in this channel.

Quickly jumped to the replication part, so from what I understood, the best way of changing a replicated variable to be replicated, is doing it on a RPC, since RepNotify does things AFTER the variable has been changed, and does not change it on the server and then do the stuff, correct?

sinful tree
# cold moat Quickly jumped to the replication part, so from what I understood, the best way ...

Replication doesn't require RPCs. Replication only requires that the variable is set on the server.
Take the following examples on a replicated actor.

The begin play will fire on the server, and set the "ReplicatedBoolean" to true. This variable will replicate to clients without requiring an RPC.
The OnActorOverlap will set the "SomethingIsOverlapping" boolean to true. This variable will replicate to clients without requiring an RPC.
The OnActorEndOverlap will set the "SomethingIsOverlapping" boolean to false only if there is no other overlapping actors. Again, no RPC required.

All 3 of these events can trigger on the server and the client, but the "Has Authority" forces the next bits of code only to run on the server.

There is no "best" way to set a replicated variable - there's only one way to properly do it and that's by setting it while running on the server.

RepNotifys signal that the variable was replicated, meaning you can then do something because it was replicated, like update UI or change the state of something.

dark edge
#

If you want to do soemthing and have it reflect everywhere, you:

Client
Run On server Event passing data

Server
set variables

Everywhere
Repnotify fires

fleet crown
#

Hello, are DedicatedServers on UE4 supposed to have a PlayerController?

cold moat
#

Thank you for these great examples, I got to understand it better now thanks to you guys

#

I'll keep on learning as much as I can, tysm!!!

dark edge
#

an empty dedicated server doesn't have any hanging around I'm pretty sure.

lunar dirge
#

Hi I am wanting to add a spawn effect for when a player joins / leaves the session like a dissolve effect how would I go about doing this much thanks.

kindred gazelle
#

If I'm overriding a multicast... it's still a multicast, right? Or am I gonna need a new event

plucky prawn
nimble hemlock
#

Does anyone have some educational resources for proper replication in UE one can look into or some examples of it?
I watched some youtube tutorials but they are either not teaching proper practices or doing bare minimum & not explaining in enough detail so one can understand it & apply to it's own code.
These tutorials only made me confused so anything to help me with the proper thought process is more than welcome.

plucky prawn
# nimble hemlock Does anyone have some educational resources for **proper** replication in UE one...

Check the compendium in pins. It gives you some examples but focuses more on explaining how replication works. From there you can apply it to your game. Some common sense goes a long way, such as "don't trust the client" and don't make them an authority of anything. If they send data to the server, validate it the best you can. If the client needs to do anything on the server, RPC from the client to the server to do it

nimble hemlock
empty harness
#

is there a way to have a client temporarily leave the session but store the session result somewhere as a persistent variable and travel to a new single player map and then once done, use the saved session result variable to rejoin the same session again assuming its valid?

plucky prawn
#

Pretty sure this could work. I haven't looked into it but you join a session from a handle

past totem
#

Or be more specific on what you don't know how to do..

coarse lichen
#

Hello can someone help me about UE5 dedicate server online?

#

I have a dedicate server working good, i want to know if i can or if its possible create a session inside of the thedicate server, to made matchmaking 1v1 etc...

#

thanks

fleet crown
empty harness
# plucky prawn What problem does this solve?

so i'm helping someone who is making a multiplayer game that consists of mini side games that are launched client side only and are themselves only intended to be single player, they were wanting to possibly have separate maps for the mini games, and trying to see what the best way to accomplish this (they dont necessarily have to be separate maps, anyway that would be most efficient)

dry pebble
uncut coyote
#

Hello everyone,
I have a RepNotify in my weapon blueprint which should trigger an event in the character blueprint.
This variable replicates as "inital only" as it should only be triggered when a player enters the relevant distance.
Despite the fact that my character has a higher Net Prioity he is not reachable with GetOwner as soon as this value is transmitted.
Therefore I let the function repeat every tick like in the picture below until the character is valid.

But now I wonder If I can optimize the whole thing, so that the character is always valid at the first call. Is that possible?

barren patrol
#

Hi all, trying to debug a crash when I run a separate server in a separate process. The window closes immediately. Does anyone know where the editor puts those logs?

#

I don't have any problems when I run under one process, which is also weird.

soft dawn
#

Should be in saved/logs If you're running editor from IDE you should see any errors in the output as well

near sedge
#

After a while of going crazy, I'm going to ask two questions:

  1. Does anyone know about any approach to a load screen that works in multiplayer that doesn't use the video player? Specifically I'm looking for something that allows chat and such during load.

  2. I had one idea for this and this was to have an empty uworld and use level streaming to prepare the levels but I can't find any information on managing a secondary uworld instance (doesn't even really need to do much, just exist as a secondary place for clients to exist in). More or less as long as a player can join the session into the empty world and send+ receive rpcs this would be all I need.

For both cases I'm capable of writing any supporting c++ logic, just not having any luck figuring out how to manage a secondary world for question 2.

For why I'm avoiding the video player: it seems like it only works with slate and I couldn't get it to work in editor for testing.

narrow nacelle
#

where can i find resources about serializing raw classes?

im wrapping a raw class in ustruct to pass it into a rpc, however the server receives a null, kinda expectedly..

foggy idol
#

Can I change the map a session is in

#

like literally change the session map

plucky prawn
twin juniper
#

hey guys, im trying to spawn a widget on all player screens on begin play, but for some reason its generating an error, images are attached, and thanks in advance for any help!

deep shore
twin juniper
#

like this? also doesnt work

twin juniper
sinful tree
twin juniper
sinful tree
#

Ok. You don't want to create widgets on begin play on characters. You run into problems as every character in a game can trigger and retrigger the widget to be created. So if you have 2 players, each player will run that same code twice. Not only that, but the dedicated server itself cannot have widgets, so it can cause the error there as well.

You're better off creating in the player controller's begin play, and use Has Authority (Remote) > so that only the clients create it for themselves.

twin juniper
sinful tree
#

Ideally you'd have your UI bind to an event dispatcher in the character.

#

Your UI can also "get" the "Owning Player Pawn" when needed.

twin juniper
sinful tree
#

Create an event dispatcher in your character. The spot to do so is usually under the variables.

#

You can also add inputs into the dispatcher in case you want to pass data through it.

#

In your ui, you'd have to cast to your character class and then bind to the event.

#

Then you just call your event dispatcher in your character whenever you want to.

twin juniper
#

works like a charm! thanks a lot!

twin juniper
#

one more, so I have this pickup, and its supposed to chase the player when the player overlaps with a sphere collision, until it hits the player than destroys itself, and it works ok on the client, but not on the other clients (server i assume). When the coin chases on the client, it just instantly disappears for the others. Can anyone help me understand why this happens? Im not so good at networking

#

any help would be much appreciated

fluid summit
#

Hi! how do you all deal with Monster Spawners-Item Drops, etc?

I'm spawning one Actor for each, but having around 100 (spawners) and probably hundreds of (Items) dropped at the same time means hundreds of actors only for that. I think it's insane, does anyone know of a better way?

cold moat
#

Not sure why (have been testing for hours), even though I filter the player class and the player actor itself, if I hit enemies or another players, my character loses health, which doesn't make any sense

#

It works completely fine on single-player, but on multiplayer it happens on the server/host and on client as well

#

Also for some reason, when I restore health on characters, on server it works but on client it doesn't, but if I'm playing only with clients, it works on both (I'm using two games to test)

fluid summit
fluid summit
cold moat
fluid summit
#

It will only replicate if the health variable is set to replicate and the owner is set to replicate also.

cold moat
#

The player attacks, the server verifies what is inside of the collision, filters the player itself and other players as well, then it proceeds to decrease the health, this is all being called on the server hmm

#

Yep, both health and the actors, components as well

fluid summit
#

how are you decreasing health?

cold moat
#

I made a "Remove Health" event that decreases (subtract node) on the given amount, also runs on the server hm

fluid summit
#

or where ever it's called, I want to see what actor you are passing as the target

cold moat
#

Oh, I already turned the computer off, was heading to bed, I'll send you screenshots when I get back from work D:

fluid summit
#

no problem, feel free to quote tomorrow.

cold moat
fluid summit
#

btw, without knowing the system I would put a check on that for each loop and see what actors it's gathering (to make sure your filters are working okey).

cold moat
#

I made sure to print it once, the print would show the enemy but the health was being subtracted on the player lol

#

I'm almost sure is something network related that is causing the issue, as it works fine on singleplayer

fluid summit
#

btw2, if you want to remove yourself from the overlap check, add yourself to the "Actors to ignore" List.

cold moat
fluid summit
cold moat
#

Thank you for taking your time to help me btw, sorry I'm away afk now

sinful tree
# fluid summit Hi! how do you all deal with Monster Spawners-Item Drops, etc? I'm spawning one...

Your spawners should likely only spawn anything if there is a player nearby. If you want to further optimize it, then you'd probably also handle removing actors that were spawned but there is no longer any players nearby. If you have some form of respawn timer then you'd also want to incorporate it -> if the timer is up but no player is nearby, don't spawn anything and only spawn when a player comes into range. If the timer is up, and there is a player nearby, spawn it.

As far as drops go, they should have a lifetime given to them so that they only exist for so long.

sinful tree
# twin juniper one more, so I have this pickup, and its supposed to chase the player when the p...

You probably don't want to use RPCs for any of this. Everything should be handled on the server VIA a replicated actor. The actor should only react to overlapping on the server - use a Has Authority (Authority)> node to restrict actions of the overlaps on the server. The server can make the item move on its own without needing a client to send an RPC to the server telling it to do so. Similarly since it is a replicated actor, its movement would be replicated automatically without having to do a Multicast. Finally, destruction of the actor only needs to happen on the server for it to be destroyed for everyone.

Last thing, rather than using a delay to perform the move, just use tick and a gate. Movement is one of those things where it's fine to use tick.

barren patrol
#

is World Partition client/server aware? aka can the server tell when a given actor is not loaded / relevant to the client?

harsh ice
#

How can I run a dedicated server on Android ?

#

Do i have to package the server for android separately ??

plucky prawn
harsh ice
#

Is it necessary to package games with source engine

#

I have 2 pc. And i package the server with 1 and apk with another

plucky prawn
plucky prawn
harsh ice
#

Okay πŸ‘Œ

plucky prawn
loud frost
#

What is IsLocallyControlled()

loud frost
sinful tree
# loud frost What is IsLocallyControlled()
bool APawn::IsLocallyControlled() const
{
    return ( Controller && Controller->IsLocalController() );
}

bool AController::IsLocalController() const
{
    const ENetMode NetMode = GetNetMode();

    if (NetMode == NM_Standalone)
    {
        // Not networked.
        return true;
    }
    
    if (NetMode == NM_Client && GetLocalRole() == ROLE_AutonomousProxy)
    {
        // Networked client in control.
        return true;
    }

    if (GetRemoteRole() != ROLE_AutonomousProxy && GetLocalRole() == ROLE_Authority)
    {
        // Local authority in control.
        return true;
    }

    return false;
}
loud frost
#

Am i correct ??

sinful tree
#

When Standalone
On client controller on the client
On listen server's controller on the Server

loud frost
#

I want to do like when a player overlap actor sphere , then a widget come only on that person which overlap it
So i am thinking that
Remote role = authority || localrole = autonomousproxy

#

Isnt that work ??

sinful tree
#

Get the actor that overlapped, check if locally controlled, if so, display the widget.

#

Same with the reverse on end overlap, check if locally controlled, if so, remove the widget.

loud frost
sinful tree
#

It doesn't specifically have to be. If it isn't, other actors can still trigger events on the clients. If it's only spawned on the server, then you'd have to tell the clients that they've overlapped through an RPC or an onrep variable of some kind.

loud frost
#

Okk let me try this , btw thanks for helping

loud frost
#

I guess i have to call rep notify so that all clients know that someone pick actor

foggy idol
#

Can I change the map a session is in
like literally change the session map

#

while keeping the session active and players connected ?

chrome bay
#

You would do a seamless server travel to the next map

echo dragon
#

hello people. i'm having issue switching pawn for the client, the logic works fine on the server side;

When the client interact with an actor, a server RPC is issued spawning the new pawn passing the reference to the controller who asked for the pawn to be created, i then try to possess it but the client will just spawn the paen but will not be able to control it.

Once i created the pawn trough the server RPC should i do some Client RPC to control it? what am i missing? thanks for the answer

echo dragon
austere gull
#

Hi, im a beginer with ue5. I have a Dedicated-Server setup. When run 2 players in the viewport and connect to the server the second client that i connect to the server is getting a black screen. When i pack the client like the server and run its exe it works well. Anyone knows this issue and can give me a hint?

#

this is what the second client screen looks like:

dark inlet
#

Hello guys! I have some questions regarding working on a multiplayer game as a team.
For reference: the game we're thinking of making is an FPS Multiplayer, something like DayZ (dedicated servers, no matchmaking)
When working with a team, does everyone need to have the source engine built?

bitter oriole
#

No, you can and probably should develop with a listen server with regular source control

#

And then periodically test with the heavier dedi method

dark inlet
#

Ok. Will the listen server allow us to join from different networks? (Everyone from their home)

bitter oriole
dark inlet
#

Ok, do you have any documentation on working on a multiplayer game as a team?

bitter oriole
#

"multiplayer as a team" is just "gamedev as a team" except you need to agree on a commit, and find someone playing as listen server or deploy a new dedi

echo dragon
woven basin
#

Is there anyway to force a listen server to always call itself for on_rep notifies (when a value changes)?

If we take a simple idea - that you update a variable and then want "clients" to react to it, this is what I would like to occur:

void ServerUpdateAmmo()
{
    Ammo += 5;
}

void OnRep_Ammo()
{
    UpdateAmmoHud();
}

But unless I'm misunderstanding something - I always need to do something like this?

void ServerUpdateAmmo()
{
    Ammo += 5;
    if (! GetGameInstance()->IsDedicatedServerInstance())
    {
        UpdateAmmoHud();
    }
}

void OnRep_Ammo()
{
    UpdateAmmoHud();
}

Is there a way to tell the listen server to treat its own client as something that needs to be handled like any other client?

plucky prawn
plucky prawn
#

That's actually a more better option

woeful ferry
#

Setter functions is a good idea anyhow, way easier to debug things with setters even though the variable is public

#

imo

woven basin
#

but where am I calling the setter function from? I would still need to handle two pathways though right? ListenServer + Client?

#

SetAmmo() - I have to call that one in each path?

woeful ferry
#

What?

#

SetAmmo(int32 NewAmmo)

woven basin
#

Sorry, I'm probably missing something obvious - but I still need to call that twice dont i? How does the listenserver client get the HUD update in this example?

void ServerUpdateAmmo()
{
     SetAmmo(5);
}

void SetAmmo(NewAmmo)
{  
      Ammo = NewAmmo;
}

void OnRep_Ammo()
{
     UpdateAmmoHud();
}
#

i'm keen on the idea of using setter functions if its a better habit - i'm just trying to get my head around the 'flow'.

sinful tree
woven basin
sinful tree
#

Right... So then in your SetAmmo function, since it's only running on the server, you can forcibly call OnRep_Ammo().

woven basin
#

yeah - it just feels... weird that I need to do that for basically all my functions.

I dont understand why we cant have the listen server treat its own client like all clients, because to me that would greatly simplify the coding? It feels really strange that we need to handle two different scenarios - like when would you not want your local client to match a remote client getting the same type of data...

Anyway - yeah, I'll just use setters and call on-rep itself I guess...

fluid summit
twin juniper
#

im having a bit of an issue with replication. I made a coin that will follow the player when the player gets close enough to it, until it reaches the player, and is then destroyed and adds a score to the player. This functions well, however it does not work when spawning it. Im trying to make a chest actor that spawns a coin, and shown below is the spawning function. The coin is spawned only on the one client which interacts with it (interacting is done through a bpi, where when the player hits E, it sends the event to all chests overlapping the player (they have a box overlap), and the drop event is called). The drop event is not replicated, and simply says where the coin should spawn, which is then passed to the next event, which is a multicast, and actually spawns the coin, which has replicates ticked. Ive also attached a video showing this. any help would be much appreciated

past totem
#

keep in mind that Multicast events have to be called from the Server

#

(so if u want to call a multicast from the client, u need to first have a server event, and then a multicast event from that)

#

and no I did not read the wall of text

twin juniper
past totem
#

yea so just like I said above.

twin juniper
past totem
#

did u print log and make sure it executes on the server?

#

maybe ur actor isn't replicated correctly

twin juniper
#

print log doesnt execute

past totem
#

pic ur replication vars in the bp

twin juniper
#

i have no replicated vars

past totem
#

I mean the default ones

#

like 'replicates' etc

twin juniper
#

on component

past totem
#

show on actor

twin juniper
#

on coin

past totem
#

show all of them

#

not just that

#

all under replication category

twin juniper
#

its also set in the coins component for good measure

#

coin replicates fine

#

however, when it is spawned from the chest, it does not seem to be replicated

past totem
twin juniper
#

chest component

#

coin is spawned from the chest component

past totem
# twin juniper chest component

FYI there is no reason for the component to have replication on if replicate movement on the actor is off and if you have no replicated variables in the component

past totem
#

or u can call an event on another actor to spawn the coin

twin juniper
#

enabling replicates on the chest has no effect

past totem
#

(an actor which is replicated)

twin juniper
odd sundial
#

What's the best way to block new people from joining the session after a certain point? Say a couple minutes into a match-in-progress, what setting can I change at that point to stop new players from joining?

placid flame
#

I'm trying to join to a session, is working when I use the Console Command, but not through blueprints.
I'm having this message, any ideas?
TravelFailure: LoadMapFailure, Reason for Failure: 'Failed to load package '/Game/_CustomServer/UEDPIE_0_Mapa''. Shutting down PIE.

past totem
#

show how it works and show how it doesn't work

#

code

#

also did u try googling that err

placid flame
#

when I execute the command manually directly in the console is working

#

when I execute these commands is not

past totem
#

just use the command, what's the issue using it?

#

if it works

placid flame
past totem
#

?

#

just use

#

execute console command node

placid flame
past totem
#

sounds like ur level is broken somehow

#

try with another level

placid flame
#

I did it, a totally new level

past totem
#

and it still won't work ?

placid flame
#

is the one I'm trying to use

#

is not

past totem
#

did u try with 2 levels

#

or only 1

placid flame
#

2

past totem
#

did u try in packaged?

#

and in standalone?

#

instead of in editor

vagrant falcon
#

is if (GetOwnerRole() == ROLE_Authority) the same like switch has authority in bp ?

placid flame
placid flame
past totem
#

try in packaged

sinful tree
sinful tree
# twin juniper im having a bit of an issue with replication. I made a coin that will follow the...

Your coin should likely be a replicated actor if you want it to spawn on all clients and for there to be one single referenced coin. Using a multicast will make it so every client and the server spawns its own copy of the coin, but none of it is replicated.

What you probably want is:

  1. Make sure your chest is marked as a replicated actor.
  2. Have your interaction input call an RPC to the server.
  3. While running on the server, get your overlapping actors and loop through them and call your "Drop" interface.
  4. The drop interface on your chest can then spawn actor from class - make sure that any actor you are spawning is a replicated actor so all players can see it.
twin juniper
vagrant falcon
#

@sinful tree but i can use it safe or better to use your method?

#

i call it inside of Component

sinful tree
# twin juniper Im not quite sure what an RPC is, is that just an event that replicates to serve...

RPC = Remote Procedure Call. When you mark an event as "Run On Server", "Run On Owning Client" or "Multicast" you're marking that event as an RPC.
"Run On Server" RPCs can be called while on the server itself, but is meant to be called from a client to ask the server to execute something. In order for this to work, the client must own the actor the RPC is being called on. So for example, a client could call a "Run On Server" event on their player controller or character as they own those actors, but they couldn't call it on say, an NPC or a spawned actor unless that actor was marked as owned by that specific player.
"Run On Owning Client" RPCs will only work if there is an owning player of the actor you're trying to RPC on.
Multicast RPCs can only be called while you're already running on the server, and will only run on clients where that actor exists. It also will run on the server itself. This is a means of having multiple clients react to something that is like a fire once and forget, like visual or sound effects.

twin juniper
sinful tree
sinful tree
empty harness
twin juniper
sinful tree
twin juniper
#

also do you know what this means? LogScript: Warning: FLatentActionManager::ProcessLatentActions: CallbackTarget is None.

#

that error arises everytime client 0 hits e

#

you may also notice that client 0 also gets a coin added even when it looks like no coins are going to him, and the coins are going to the clients

sinful tree
#

No idea, but again, this is likely an an issue with the chase/pickup logic you've made so far, and likely has nothing to do with replication and everything to do with how your items are behaving once spawned.

twin juniper
#

oh

#

i kinda suck at networking

brittle wigeon
#

How do I give a client permission to have inputs on an actor in the level?, Would I need to unpossess his character first?

brittle wigeon
#

Basically be able to press key to do something on an actor in the level, I've currently got enable input on the actor and disable input for the character but neither things happen

#

It's a puzzle

#

I feel like the input actions are not working on the actor as I still have control over my character, I guess un-possessing is the only way to disable input of a character?

dark edge
#

What's the actual game mechanic

brittle wigeon
#

Like Press Up, Set rotation +10 degrees

#

The input sides are not working

dark edge
#

You could also do this

Press Key -> Set MyPuzzleActor -> Set view target to it

Other inputs
Input -> if MyPuzzleActor.IsValid -> RPC -> DoThing

#

You're basically making a shitty temporary possession mechanic

#

Or you can have server set ownership and enable input then it should do things too. Really depends on the specifics

brittle wigeon
#

I'll try possessing, my only concern was unposessing from a input action, ig I just call from server to unpossess should be fine

dark edge
brittle wigeon
#

Ah, good idea, thanks buddy

dark edge
#

However you end up doing it, remember that you can only call RPCs (influence ANYTHING on the server) through actors that you own. You automagically own your possessed pawn, and you can also own other actors if the server sets the ownership to you.

brittle wigeon
#

That's what I was missing, so technically you can enable input but you have to own it first

#

Possessing would work in my case though as I want to lose control of the player and have full control over actor

#

or pawn should i say

dark edge
brittle wigeon
#

Thanks again buddy I'll give it a shot, the code is all done just need to figure this part out lol

dark edge
#

If not then the code is just started lol

brittle wigeon
#

I haven't fully tested it in multiplayer, but I've used similar fundamentals to my other blueprints, only the possession side is different

#

I'm confident

#

But then again who knows, it's definitely 99% trial and error 1% logic lol

loud frost
#

Does we have to replicate collision of actor also ??

placid flame
#

Is it really necessary to build the project as "development server" to get the server build working?
The connection is working in the editor, but not in the build.

brittle wigeon
visual urchin
#

I'm having problems trying to start a camera shake with owning client only. The way this event is called is something like:

Server event > Multicast Event > Owning Client Event (screenshot)

The problem is that the camera shake is being called in all clients, and I don't know why.

sinful tree
visual urchin
#

Isn't any way to "escape" the multicast for this specific event?

visual urchin
placid flame
plucky prawn
cold moat
#

Guys, simple question, but wanted to ask to have some confirmation. As the server and clients are each an instance of the game running, every code runs on every game, correct? So for example, if I'm setting VERY IMPORTANT variables, I should do on the server only, right? (For example using Switch Has Authority)

Although, if I set replicated variables on Begin Play or anywhere else, using Switch Has Authority, will these variables be replicated to the clients as they're being set on the server?

dark edge
cold moat
#

But then if I call an Event that replicates (on mode "Run on Server"), inside Begin Play, will it be called normally on the server?

#

I remember reading to not use begin play on online games for some reason

#

Probably because if there are too many things inside BeginPlay on too many actors it can get data expensive?

mortal sinew
#

Is it possible to spawn and posses a non replicated pawn on a client for a client?
Ive tried it through the controller, it still gets spawned at the server side and not posses at the client side.

Is the a way to decouple the client controller from the server somehow?

sinful tree
# cold moat I remember reading to not use begin play on online games for some reason

You can use begin play, you just need to understand how it functions and when it is called.
For example, using Begin Play on a character on clients is sometimes a bad idea as that code can be called multiple times when the character goes out and back into relevancy range. You can't reliably do everything on Begin Play, say for example, you do Begin Play on your player controller on a client and want to get their playerstate, but their playerstate likely hasn't replicated yet.

Setting variables on the server should normally be handled while already running on the server. You really shouldn't need to have the client tell the server to do anything on Begin Play via a "Run On Server" event as Begin Play already runs on the server, so it should run it's own code using the Has Authority (Authority) > path.

twin juniper
#

hey guys, having a bit of an issue (again). basically i call an interface each time a collision overlaps, with the target being the player, and when the event is called in the player, an event dispatcher is called, which tells a widget to change the score. issue is that the widget doesnt seem to receive the dispatcher event. a print string shows that the player interface event is called properly, (at least on the server), however the widget doesnt seem to receive the dispatch, though it does sometimes catch the dispatch.

#

this issue is generated (on the server) seemingly each time the dispatcher is called: LogScript: Warning: FLatentActionManager::ProcessLatentActions: CallbackTarget is None.

#

i find this to be because only client 0 is calling the pickedUp event, why is that

dark edge
#

listen server or dedicated?

twin juniper
#

dedicated

#

it was working before, but then i changed smth and now it doesnt work

dark edge
#

So where in this logic chain does it get from server to client?

#

Show the entire chain from overlap to widget update

twin juniper
#

overlap: box collision is created on begin play, event is binded

#

interface in character is called, which shoots a event dispatcher

#

however, ive found that only client 0 is sending the interface, not quite sure why

#

widget (is supposed to) update text when dispatcher is called

#

btw widget is made here in the controller

dark edge
#

So where are you doing the server/client differences? I see no RPC here. Are you just doing the pickup stuff on client?

twin juniper
twin juniper
#

when the box is overlapped, the pickup actor is destroyed, and the pickup is communicated to the player with an interface

dark edge
#

so you need replication somewhere in there

twin juniper
#

what should i do?

#

i mean i do this as well

dark edge
#

OK what is this component meant to do?

#

You're doing a lot of stuff at Begin Play that seems like it can just be set at construction time or just by instance properties

twin juniper
#

component has no construction script i believe

#

also this system is supposed to turn an actor into a magnetic pickup

dark edge
#

What i mean is why not just have the component replicate by default?

#

also you're setting the OWNER to replicate, not self

dark edge
#

This component could be a subclass of SphereCollider too btw I think

#

just a spherecollider that does pickup stuff

twin juniper
#

not sure how to do that, i just spawn a sphere

#

also id like to point out that the interface fires with actors that are spawned rather than already in the level

#

ones that are already in the level seem to send their interface to client 0

dark edge
#

well consider that the other clients don't exist when the server boots up

twin juniper
#

but the reference to the player isnt passed at startup

#

its passed on overlap

#

client 0 shouldnt be overlapping any or all of the actors on begin play

#

i believe it has smth to do with this error, and the overlap defaults to client 0 or smth but i have no clue what it means LogScript: Warning: FLatentActionManager::ProcessLatentActions: CallbackTarget is None.

twin juniper
#

not sure, gives no details, but i believe it has smth to do with the overlap here

twin juniper
#

every time an actor overlaps with a pickup already in the level

#

and again, not all actors, most, but sometimes it will randomly work

dark edge
#

First off I'd filter the pickup by Authority

#

so nothing happens on client machine only

#

and print OtherActor and see what happens

twin juniper
#

like this? it seems to return true every overlap, the name is printed correctly in the server log, and for the spawned actors (the ones that work), its printed to all clients

#

the error is also printed tho for the server (on the non-spawned actors)

#

i take my previous statement back, just realized the name passed in the log is the pickup actor, not the player, which isnt a target class so it shouldnt be working

#

however, if i use the false of has authority, it prints the character name, but also says the characters class isnt in target classes (as seen in the branch), which it most definitely is

#

well actually no, it does pass the branch, the do once node fires, just the destroy actor doesnt seem to work

#

im guessing its not working because the owner doesnt have authority

#

thats odd because the owner replicates

dark edge
twin juniper
#

how can i give it the authority to kill the actor?

#

i tried an RPC but that didnt do anything

dark edge
#

I mean your whole setup seems goofy, I'd start from the earliest parts and make sure it works all the way through the chain

#

This component sure is doing a lot to its parent actor

twin juniper
#

yeah it does literally everything, parent is empty

twin juniper
#

which i think is now tied to the authority

cold moat
#

I'm saving these tips, I really appreciate it.

twin juniper
#

so now im pretty much 100% sure the error relates to the interface, but again im not quite sure what causes the error

#

actually ive learned how to replicate the issue, by running away from the pickup, but not quite sure why it causes an error, especially as the collision follows the pickup

#

for some reason this doesnt happen to client 0

twin juniper
soft dawn
#

I have a dedicated server and clients have a pawn which has modular mesh parts. I use replicated structs on the playerstate for torso, head, legs, etc. which contains the mesh and material reference. OnRep functions set the mesh and materials appropriately. This has been working fine so far, even under heavy lag. The other day though, I had a client unable to see some of the characters in the lobby and then inside the game map (i copy these mesh/material refs during seamless travel to new playerstate). I see a bunch of these types of errors in the client's log that couldn't see some of the other characters.

...
LogNetPackageMap: Warning: GetObjectFromNetGUID: Attempt to reassign read-only guid. FullNetGUIDPath: [2149]/Game/_Assets/Military/Mesh/Body/SK_Military_Head6

Looking through this discord I see something similar happens when an actor is spawned on the server but the client hasn't loaded the class yet. Would that make sense for what is happening in this context? Like the modular mesh or materials aren't loaded on the client? I have hundreds of possible mesh parts for the character so I don't want to load all of those.

Can I check on the client to make sure the mesh components are loaded correctly and if they aren't, reset the playerstate and hope i get correct values replicated again? What would the right way be to do this?

past totem
#

hi is there a launch parameter to set the server's language?

deft umbra
#

does anyone know where i would find the documentation on implementing voice chat into my game? just general voice chat, i don't need it to be proximity vc, im using advanced sessions w/ advanced steam sessions in UE5

twin juniper
#

Is it possible to replicate media files?

#

like if I want to watch movies together in a multiplayer setting using a local video

plucky prawn
# twin juniper Is it possible to replicate media files?

Not really something I would recommend. Typical 1080p movie would be several hundred MB and not everyone has a reliable or fast internet connection or data cap. It could take a few minutes to a few hours for this to download. You also wouldn't be looking at replication for this but rather a straight download from the server, or a CDN somewhere. I'd be careful about copyright laws with a CDN though

twin juniper
#

@plucky prawn Hi, I just want to know if it's possible or not.

#

I don't think there would be any copyright strike either, it's basically an mp4 player. You can't blame dev for allowing mods in a game

bitter oriole
twin juniper
#

I see, so not from the get go?

bitter oriole
#

Absolutely not

twin juniper
#

Got it, thank you

#

how about Png files?

#

I suppose if it's not replicable right from the start, we can just get the pixel values?