#multiplayer

1 messages · Page 197 of 1

worthy oak
#

but neither is this

#

yeah xD

#

I enjoy conversation haha

dark parcel
#

Well I won't say what I said is accurate either it really depend on the scope of your project

worthy oak
#

100%

dark parcel
#

But if you want to make a polished game imo, please unlock the engine

worthy oak
#

again thats not a fair comment?

#

and thats why I think people give kickback?

#

your implying that if its BP only it isnt polished?

dark parcel
#

It's entirely my opinion

worthy oak
#

the thumbs up...rip XD

#

few steam games will be devasted to learn that their game isnt in fact polished 😂

young pebble
#

so, i follow this tutorial, my hud it work, but my model for player 2 still same with player 1, do i miss something?

#

this is my posses and spawn player blueprint (gamemode)

kindred cairn
#

I will re-post this, maybe somebody could still help 😉

obtuse field
#

What is NM_Max for?

dark parcel
#

and you are always pulling the same data from the GI , which is getting the player on index 0 and it's class

young pebble
#

can i use it?

dark parcel
#

you are just pulling data from your GI, if you don;'t know what data to pull or what index, it tells me that you are just copy pasting tutorial stuff without understanding what the node does

#

these are all variables that you declared in your project

#

there's no way for me to know how they are set and initialize

young pebble
#

this is game instance .h that i use

#

my multiple player index is just integer node

dark parcel
#

you need to follow your code line by line

#

when is the multiple player index is set, when is it read, and who read it

#

this will always give you the resame result, unless you set the member variable (character class) to be different at some point

young pebble
shrewd ginkgo
#

I try to select random impostor like among us but it select server every time. I trigger it in spawn player. spawn player connected event handle start. all of those things in gamemode. just is impostor bool in character bp

pseudo crown
#

I need heeeeeeellllpppp!!

I make hosting and join system(IP) and was testing I write my ip ex(127.0.0.1) I can join my server. But other people can't join my server anybody give me reason pls.

worthy oak
#

You need to allow the default port of 7777 on your router

#

And possibly a firewall exception

pseudo crown
worthy oak
#

unless you are doing sessions through an online subsystem

pseudo crown
#

any multigames use portforwarding?

worthy oak
#

again sessions are kinda the exception

pseudo crown
#

kk

#

thx!!

pseudo crown
worthy oak
pseudo crown
worthy oak
#

palworld port forwards their official servers

pseudo crown
#

when i make official servers then they don't need port forwarding?

worthy oak
#

No you still need

#

thats how networking works

#

"official" in this case means the server palworld hosts

#

as opposed to a player running it

pseudo crown
#

oh

worthy oak
#

unless you are running sessions (which are typically not dedicated you are connecting to another players machine) you will need to open the port for that server

pseudo crown
#

do u know chain together?

#

that game do not use ip?

dark parcel
#

if you use steam, you don't need to do any of them right?

pseudo crown
#

reallyyy?

dark parcel
#

pretty sure you don't, I think the process is called NAT

worthy oak
#

yeah sessions are the exception

dark parcel
#

not that I know much about it but you don't need to port forward and all that stuff

worthy oak
#

its something else its not quiet nat

#

basically it uses ports that are "already open"

latent heart
#

It still happens with steam, but steam sorts it out for you.

worthy oak
#

so you dont need to port forward them hence why listen servers or sessions on steam dont need them

#

depending on your nat settings however to your point

#

you can have connection issues

pseudo crown
#

that i use steam. i use steam server too?

worthy oak
#

if your nat is too strict

#

but generally most people wont have to worry about it

latent heart
#

Listen servers will still need port forwarding, the same as dedicated servers.

worthy oak
#

well kinda

#

unless you use a subsystem

#

if your doing a host/join on steam, steam kinda does the heavy lifting for you

latent heart
#

Not "kinda" - you need to use teh same systems to connect, whether it be automatically set up via sessions or manually port forwarded.

pseudo crown
#

ok i love u guys

#

and thx

worthy oak
#

yes the protcol is the same

dark parcel
#

unless something "does it for us", well I mean that just mean you are still portforwarding one way or another

worthy oak
#

im saying there are some ports that are public nat

pseudo crown
#

i learn "Multiplayer Is Hard"

latent heart
worthy oak
#

let me look it up

#

too early for brain to work lol

#

im forgetting the term

dark parcel
#

Multiplayer is hard

latent heart
worthy oak
#

hole punching

#

thats not quite what i was thinking but yeah

worthy oak
#

they sadly do not just give you dedicated servers XD

pseudo crown
#

then how to setting steam server join

worthy oak
#

if you jsut want players connected for a party game

neon summit
#

And need to see whole function

latent heart
#

Why would you spawn a player on a client?

worthy oak
#

steam sessions in online subsystem

pseudo crown
#

ok

neon summit
pseudo crown
#

thx

worthy oak
#

thats the easiest way to handle it

#

of course

pseudo crown
#

i try now

gray sparrow
#

loading scree asyn can do with blueprints sprnting in multiplayer with client rpediction too

worthy oak
#

yeah but its cleaner in c++

#

less widget weirdness and freezing lol

#

and tbh with a certain plugin

#

stupid easy XD

gray sparrow
#

i think you can do all with bleuperints

worthy oak
#

not quite all no

dark parcel
#

you can think what you want but doesn't change the fact that you are wrong

worthy oak
#

blueprints can do alot but there are limitations

#

exspecially when you get to some multiplayer concepts

#

But depending on your game and the scope, yeah you can make something in just blueprint

#

plenty of games have proven that

dark parcel
#

scope is the important keyword too

worthy oak
#

you are correct, as well btw dont wanna say you arent

#

yes blueprint can hit limits pretty quick

#

and in multiplayer...its pretty darn fast haha

latent heart
#

Lyra has a loading screen plugin. Not sure if it works with umg/blueprints, though.

dark parcel
#

I was thingking of re-writing (copying) but now maybe I can just steal the plugin?

worthy oak
#

yeah tbh there really isnt a reason to force it in bp

#

least in my opinion

worthy oak
#

setup takes like minutes

#

its c++ and you can get some really good looking loading screens

latent heart
#

Pocket worlds is another useful plugin there.

dark parcel
#

I try to learn by looking at codes. As much as possible, I don't want to use a complete system

worthy oak
#

fair enough

gray sparrow
#

you sjut say limits

#

they mme expeccially waht i cant do in blueprtins?

#

give me an example

latent heart
#

Threads?

worthy oak
#

C++ is much more performant

#

So if your making a larger multiplayer game, BP isn’t gonna cut it

dark parcel
#

lack of features, server validation (RPC), half of the engine not exposed to bp

worthy oak
#

And yeah that’s the other one some things you need in multiplayer aren’t exposed to BP

latent heart
#

The rpc validation is a little servere in c++, though, isn't it? It just kicks the player if they fail.

#

Or it used to.

shrewd ginkgo
#

Do I need to connect the spawn player event running in the Owning client that I created in the player controller back here (to game mode). And will I call the function I created in gamemode to the event in the player control?

gray sparrow
#

again

#

you jsut talking thi and this

#

give me an expample

#

waht i cant do with bleuprints

worthy oak
#

Those were examples

#

Optimization

#

is a big one

latent heart
#

The trouble is, if you want specific examples, you can do pretty much anything with BP, but it will be a lot harder and a lot worse without feature X, Y and Z.

gray sparrow
#

you can optimazation in blueprints

worthy oak
latent heart
#

And those features are things like "half the engine not being exposed" and "no threads" and "bad performance"

gray sparrow
#

you jsut talking about eprformance

#

you can do all with bluepritns

worthy oak
gray sparrow
#

maybe its works a little bit betetr with c++

worthy oak
#

C++ will handle that better than BP

gray sparrow
#

but you can do all with blueprints

worthy oak
#

It’s ALOT better in areas

dark parcel
#

or just straight not possible

worthy oak
#

mhm

dark parcel
#

can't include libaries

#

make http request from scratch in blueprint

#

how?

worthy oak
#

Yeah actually that’s a great one

#

Without a plugin like varest which is leaving a bad taste in my mouth

#

You kinda just can’t interact with API XD

latent heart
worthy oak
#

Speaking purely BP only

dark parcel
#

I've been in a place where my project is bloated with plugins

#

such a bad feeling tbh

worthy oak
#

Plus the other downside of a plugin is if you wanna change the way it works

#

You kinda can’t

gray sparrow
#

http modul

worthy oak
#

Is c++ yeah

gray sparrow
#

do all

#

again.

#

http modul

#

cold summer

dark parcel
#

from scratch

#

that's just example

#

w/e plugin or module u get is written in cpp

shrewd ginkgo
#

All of these in gamemode btw

dark parcel
#

A lot of nodes for choosing a random player to be the impostor

#

why not just select a random player from the player list?

shrewd ginkgo
#

I try to learn from internet and they make like that. I cannot access more information because my English is not very good.

dark parcel
#

Make sure that all Players have Joined -> Game Mode -> Get Game State -> Get Players -> Get Random index -> the output is the random impostor

#

Game Mode Impostor = the output

shrewd ginkgo
#

Ty

latent heart
#

What bits don't work?

#

What bits even need to change?

#

If you have any code for any of that directly in your UI, that's a huge problem.

kindred widget
#

Mine is threaded, networked, supports line of sight, and will run on a dedicated server with no render thread because the gameplay and visual parts are separate. Even if I include the custom hlsl I used in the niagara emitter, and the component code which allows tearoff functionality to it's owner, I have about 1.4k lines of code I'm very verbose, use brackets, plenty of style spacing etc.

So no I don't really see 20k at all in any circumstance unless you're too busy complicating things far beyond what they need to be. People spend way too much time just writing in another condition instead of trying to simplify things.

gray sparrow
#

do you know how can i run layered fog of war?

#

i can sen you all codes and pictures?

#

i cant get this work... character team1 see character team 2

twin juniper
gray sparrow
#

maybe it wrks with bp

twin juniper
#

banned

#

@meager spade

gray sparrow
#

idk waht do to to get this layered fog of war work

latent heart
#

You run as a client...

dark parcel
latent heart
#

Yeah that.

#

Damn it I started the editor and everything.

#

In teh advanced options there's a "start separate dedicated server" you should probably tick that.

#

And untick "run under one process" if it's ticked.

gray sparrow
#

i decide now to make my own fog of war system in blueprints

#

is it possible to make fog of war only with blueprints?

limber gyro
#

depends on what your doing, for example steam doesnt work in the editor but if you are using something like playfab you can just do a rest call and wait for a response wherever and it will work

#

you need to be a bit more specific

opal fox
#

Any Replication guru in here that would like to look at my problem, Any ideas what im doing wrong?

-I have a boat AActor that i have set to replicated.

  • I set the owner of the boat to the Interacting Character then call Interact on the boat.
  • I get to the Interact Else Statement and then nothing more happens
  • I feel like I should at least be seeing some logs in Interact_Logic function, but nothing happens
limber gyro
#

i have never used that, i have no idea sorry

#

but from what hosting i used before i dont think its possible

#

in playfabs case for example they provide you with some test environment tools where you package your game and run it there

quick musk
#

doesn't require the game to be built

#

well you don't actually need to build it in order to test it locally, can setup a bat file that points to your editor.exe project.uproject -log -server -AUTH_TYPE=deviceid -AUTH_LOGIN=test -AUTH_TOKEN=test

#

so in my personal case: "C:\UnrealEngine\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Users\xoaus\Documents\Unreal Projects\Git\Fall-Down\TPG.uproject" -log -server -AUTH_TYPE=deviceid -AUTH_LOGIN=test -AUTH_TOKEN=test

#

and the server started on my end :)

gray sparrow
#

is it possible to programm a fog of war like league of legends only with blueprints? is this possible?

woven basin
#

start writing code, and see how it goes

woven basin
limber gyro
#

well i took a better look and u seem to be doing that

#

is "interact called" not being printed?

woven basin
limber gyro
#

hes calling a multicast in the client

#

even if he changes the owner in the server i dont think it will work

#

unless that "interact" is a server RPC no?

quartz grove
#

I haven't done any networking in Unreal before (did a bit in Unity though). If I were to start a project with no plans for multiplayer but it could be a stretch goal, how would you go about it? Are there any architecture decisions, good practices, initial setup stuff,... to smoothen the addition of multiplayer later? Or do you have to include it fully from the start because it would be a nightmare to add later? The degree of multiplayer would probably just be coop with friends, no matchmaking or anything and the game would be deterministic and I imagine just sharing inputs would suffice. But I'm pretty new to networking still.

woven basin
#

you either start with it, or dont

quartz grove
woven basin
#

honestly, if you dont understand multiplayer at all - then its not a "stretch goal" - its a total commitment to doing it or not

#

and either you start doing multiplayer designed code from day 1, or you dont bother

#

if you are new to Unreal - then its not normally recommedend to start with multiplayer until you understand the engine..

carmine citrus
#

Im trying to make a timer for the round, and I had it working but not correctly for replication. I moved the currentTime to the game state. However; it seems like i'm not setting the time, and having that display in UI.

Is there a proper way of getting info from the game mode to the client so it can display it correctly?

quick musk
quartz grove
woven basin
#

and I'm saying it doesnt work that way

#

You either plan for it on day 1

quartz grove
#

Yea I understood

woven basin
#

or you dont

carmine citrus
#

facts

woven basin
#

I'm not saying you cant do it

#

I'm answering the question the way you asked

quartz grove
#

Okay well, I'm not disputing that. But at the same time I have learned nothing about how it works and why it's not a possibility.

woven basin
#

if you want multiplayer - then go for it - just dont think you can add it later

woven basin
#

you have to code everything as RPC/server/client stuff

#

vs single player you jsut do whatever

#

its a whole "mindset" of how to approach the code

#

You can make a singleplayer game using multiplayer, without multiplayer, and it'll work

#

you cant make a singleplayer game using sinnglplayer code and add MP later

#

but the overhead for multiplayer code is like 10x a singleplayer game

#

(10x is made up number - you get the idea)

carmine citrus
quartz grove
#

I've made a little multiplayer game in Unity and it did complicate the whole thing a lot more. I guess from some things in Unreal I got the impression it's a bit more built in and so maybe it might be easier to include later. But I guess not.

#

I noticed the whole mindset thing you mention

#

Then I guess I'll have to decide from the start

woven basin
#

it is "built in" quite nicely

#

but you gotta approach it in mind

opal fox
#

@limber gyro Interact called and client calling server interact both happen, i breakpointed in there aswell, but its the RPC there that never happens

#

@woven basin How do I set the owner to the client so that I may call RPC in this case?

#

@woven basin Before I set owner, it said I couldnt call the RPC cause it didnt have an owning connection

woven basin
#

that's right - so you need to do it another way - perhaps a "interact_with_boat" on the player controller

#

and give the boat reference, and let the server decide if you can interact with the boat or not

opal fox
#

If the RPC is being called by a client to be executed on the server, the client must own the Actor that the RPC is being called on

#

@woven basin ok but thats what im doing

#

Here im calling interact from the DefaultPlayerCharacter

#

And i send myself as a reference to the boat

#

Let me try to just make the RPC call from the DefaultPlayerCharacter directly

limber gyro
opal fox
#

@limber gyro No its the server RPC, the multicast happens when i interact as a listenserver

languid oar
#

Is the replication graph still a think to reduce server load and network traffic, or is there something new / better meanwhile?

limber gyro
#

because it might be triggering in the server and not in the clients

opal fox
#

Nope, im trying to do the RPC directly from the playerCharacter now instead

limber gyro
#

i think i had some confusion wiht that before

limber gyro
opal fox
#

Ive just placed it there in the editor, and ticked netload on client

#

I thought since its an actor it would be spawned on the server and replicated to clients if i tick replicated

limber gyro
#

should be the server then, the thing is, yo uget the owner and then get its authority which is the pawn which i am not sure who has authority in this case im gonna need to check

#

so it might not even go to the server function at all

opal fox
#

Ok it works now

#

After I did the RPC explicitly from the PlayerCharacter on the Boat

#

Instead of calling Interact on the boat, and then trying to do the RPC from the boat with the player as a reference

limber gyro
#

should be a connection issue then

#

your ownership chain should be wrong somewhere

#

you need to set owner ship on the server and the client i think

#

like @woven basin said

viscid tapir
#

I have a question about Fast Arrays : What if I do an Add on a first array and Removal on a second array operations on server within the same frame, are they going to be replicated at the same time, thus triggering PreReplicatedRemove on the first one and PostReplicatedAdd on the second one, in the same frame on the client ?

terse karma
#

Hey everyone , got a question about multiplayer. Im trying to add a basic scoreboard but running into an issue where only one player is showing on the scoreboard. Ive tried everything i could think of and maybe im doing this incorrectly. Im very new to multiplayer but i have read thru the docs and the network compendium to get this far. Any help would be appreciated. the first image is in the widget, second is in the playerController. Is thhere something im missing? Im getting the player array from the gamestate. Am i missing an RPC or am i calling it from the wrong place? Any advice would be really appreciated. EDIT. The RefreshScoreboard Event was something i was trying to work on to only update the scoreboard for the player when it was actually opened each time.Its not being called currently

gloomy axle
#

When you switch gamemodes, like for Lobby to Play to Lobby, does info collected on the LobbyGameMode stay so when you come back to the LobbyGameMode it's still there?

Like for example, in LobbyGameMode I have OnPostLogin that adds player controllers to an array "Players". Then I go to PlayGameMode. Then I go back to LobbyGameMode. Would the "Players" array still have the PCs

bright tiger
#

I want to replicate a chaos vehicle. By default, it adds stuttering to the client movement, however, some forums talk about disabling Replicate Physics to Autonomous Proxy, but thats create huge differences between the location of the client and the server.

What should I do?

worthy oak
dark edge
#

just press button, create widget

#

I do see a bug though, refresh will just add MORE children

#

you need to clear children then readd

terse karma
# dark edge you need to clear children then readd

yea i do that . i get an array of all widgets and clear before running again. Currently this doesnt work and i cant figure out why. it only populates the board with the server while the array does contain all connected parties. If i run a print string in that loop it shows all connected but the board doesnt populate

dark edge
#

If it is, then the problem is in your widget

#

test with feeding the widget just static text

terse karma
ripe ravine
#

I have a replicated variable that I set on the server side, but when a client connects the variable doesn’t update, and I’m not sure how to do it properly

sinful tree
dark edge
naive ibex
#

hey asking for a friend, i know nothing about UE5, quote: "i have ragdolls server side but the client only sees reference posed people rolling around, it seems to replicate the transform of the mesh and thats it, how do i replicate the physics and stuff?"

dark edge
#

it should be LOCAL to whoever presses the button

terse karma
terse karma
terse karma
sinful tree
#

What kind of panel are you adding the widgets to?

terse karma
sinful tree
#

🤔

terse karma
terse karma
# sinful tree 🤔

someone else said it was possible i was only getting the client version of the playerstate from the game state but im not sure that makes sense. arent they both replicated ?

sinful tree
#

Yea playerstates are normally replicated to all.

#

and always relevant.

terse karma
#

yea i even tried again after someone else mentioned it and i got my machines name to print 2 times with a different number string at the end

sinful tree
#

How about ignoring the player array for the moment and try making a for loop that just adds several items, see what you get.

kindred oyster
#

Hey, I want to take a deeper look into Savegame for my Prototype. Can someone give me tipps for savegame on multiplayer. (There are Playerstats and World Stats that I need to save)

sinful tree
#

SaveGames are stored locally and cannot be referenced across the network.

#

If you have data you want to save on the server side, then the server must have that data. Same with if you want to save data on the client side.

kindred oyster
#

Hmmm

#

Actually I want to Focus on Singleplayer but also want to include mp functions to be prepared. I actually didnt have a plan how exactly mp sessions will be

#

and if Two Friends want to start a game

#

if they need to always play with, if you understand what I mean

sinful tree
#

Not sure how that relates to saves.

kindred oyster
#

the base game mechanic is a Harvest Moon / Stardew Valley like game

#

so the players have a farm (coop together)

#

Player 1 starts the game, Player 2 joins. The savegame of this game are localy on both right?

sinful tree
#

No. You'd probably have the save game stored on Player 1.

kindred oyster
#

ah okay, so Player 1 has to host the game every time they want to play together

sinful tree
#

Yep

kindred oyster
#

ok this makes it easier

#

ok thanks 🙂 now i need to think about saving actors

terse karma
dark edge
#

Basically someone can join, save the game, and now the save exists two places.

sinful tree
#

Reconciling them though... oof

dark edge
#

Yeah it would take some work to make it 100% seamless. But some games do this. There are recovery saves for games like age of empires or Stellaris

kindred oyster
dark edge
#

I am very glad the save games for my project are very simple.

kindred oyster
#

after that I will try to save game on client side to

#

Actually I save some Player stuff (inventory and so on) thats easy

dark edge
#

But if there are things that are not relevant to the client or are in game mode or game instance, the client will not have it access them.

terse karma
#

@sinful tree I got it ! somehow i had marked the widget component as variable so it wouldnt add it. i appreciate your help that got me in the right direction.

kindred oyster
#

actually i have same player related stuff on game instance, maybe I need to rethink some stuff for this

#

I also want to take a look on other games and how they handle this

#

the savegame stuff for placed actors will be hard, or I overthink this ^^

#

the actos also have items for example producing actors that have 1 ressource on it and are in production mode

sinful tree
#

It'll be easier than you think.

#

The difficult part is more figuring out your data structures.

dark edge
sinful tree
#

Not that I'm aware of :/

dark edge
#

I've seen that there's a savegame decorator for UPROPERTY but I haven't seen it used in the wild

#

I'm very glad that the only things I have to save are user options and simple structs

#

just vehicle designs / blueprints. Way simpler than saving an entire world state.

kindred oyster
#

I will do some Tests Hope IT will be easier than I actualy think

golden pond
#

Hey y'all. I'm Making an AI based of GAS, and it works perfectly fine in Listen Server PIE, But Play as Client, Somehow stops all the movement querries. Is there anything in Particular I have to do to get it to work? The Abilities work fine, and the behavior tree executes, It's just the Move Querries on Both Default Behavior Tree Task and Pawn Class's Simple AI MoveTo. Also The AI Focus Node doesn't get Fired. I use different Movement Components for my Pawn Enemy Class, and Character Enemy Class. Just their Movement. Everything else works fine.

frail barn
#

if PlayerController and GameMode is changed, when new level is loaded, where to store information of clients choices, like chosen character, etc?
seems like Player State is reset with new controller, and the only right place is Game Instance?

dark edge
frail barn
dark edge
frail barn
dark edge
kindred oyster
#

Oh man, who know this Situation. Before you wanna Go to bed you think OK If you Change this Part all Things will be better. After doing that, 10 new Problems Pop Up and you shutdown the Computer totally unhappy 🫣🥲🤣

kindred oyster
#

Yeah

#

And I also know what to do

#

But IT IS to late and my daughter will make Up me in about 5 hours

dark edge
#

chug red bull, code all night

kindred oyster
#

But its a bit Frustrating

dark edge
#

Write it down in a TODO for your changeset so you know what to do tomorrow

kindred oyster
#

Haha yeah I did IT Last Weeks, this Week I will Take some more sleep

#

Thats a good idea

sinful tree
# frail barn so, when i create a "PlayerChar" variable in a GameInstance, and set it from the...

Game Instance only exists on the one instance of the game, so each client has their own copy of a game instance, as does the server. It is not networked so you can't send RPCs through it, nor replicate any variables in it.

If you set your character in the Game Instance, you'd either have to have some way of storing that on the server to begin with and have some means of knowing which client has selected which character, or you'd have to allow clients to send the server their character selection via RPC.

frail barn
meager spade
#

They player stores the load out locally. When they go to a new level, they tell the server hey heres my loud out

#

Server then validates and gives them the losdout

meager spade
#

The rpc is on the playercontroller

#

Which sets there loadout in playerstate

frail barn
meager spade
#

We don't use seamless travel so we can't use playerststr and copy properties

#

We have a local player subsystem

#

Which holds there chosen load put etc

frail barn
meager spade
#

On travel to New map we send server rpc with the load out and server sets this on playerstste which replicates to all players

#

No local player exists for a player

#

And persists till the player logout or w/e

#

It never gets destroyed during travel etc

#

You could just use gameinstance to store it

#

And have server rpc in player controller to set it

twin juniper
meager spade
#

Only with seamless travel

#

Not hard travel

twin juniper
#

But that's a way to do it, there is a tons, like the one Kaos said

meager spade
#

In our game we hard travel

high lotus
#

would it be wrong to store it in the game instance?

meager spade
#

No?

#

That's how we did it originally

#

Intact it's how a lot of games do it

high lotus
#

the player subsystem seems tidier if you need it I suppose

meager spade
#

You need somewhere persistent

high lotus
#

thanks!

meager spade
#

We use player subsystem cause of consoles

#

Before we went to consoles gameinstance was fine

high lotus
#

is that fix for local multiplayer?

twin juniper
meager spade
#

Xbox can have multiple users signed jn

#

And you can switch between them

#

We wanted to persist chosen losdout during this

#

Controller A can be diff user to controller B

#

So when the user playing the game with B controller we set them up with there data etc

#

This way they don't loose there load out and stuff

frail barn
meager spade
#

But if your using seamless travel then copy properties can work

twin juniper
high lotus
sinful tree
# frail barn in which class it need to be stored? looks like PlayerController can not be used...

By default and with nothing to do wtih seamless travel, Game Instance is the only thing that persists.
If you make a selection and want it to persist you must store it on the Game Instance. This can get complicated in multiplayer as the Game Instance only exist on the one instance of the game, so if your player is selecting the character when they're already connected to the server, the server can store it, but again, you need some means of determining which client to store it for (like through Unique Net ID)), or you have to store it on the client's Game Instance, and then when the client joins the server they need to RPC the selected character to the server.

meager spade
#

localplayer persists

#

Localplayer is controlled by gameinstance

#

We don't store load out on server. Intact your not even connected to a server when you choose your load put

#

You are in a party session

#

You only connect to server when you found a game and whisked straight in

brittle ledge
# sinful tree By default and with nothing to do wtih seamless travel, Game Instance is the onl...

I'd recommend having a second object and have the game instance only have a reference to that object.
And have that object handle all the logic and variables and whatever you want to persist.
Just cuz it can same some headaches later if you want to move stuff around and stuff and also gives the possibility of not having that logic loaded at all times if it gets big enough or whatever; def doesn't hurt.

sinful tree
#

Yeah I suppose if you have the game instance as an outer of an object it too will persist, yea?

meager spade
#

Or use localplayersubsystem...

sinful tree
#

Which also sounds like a much better idea 🙂

meager spade
#

Seamless travel is for chumps lol

#

Plus i hate it. So dumb

brittle ledge
meager spade
#

Implementation

#

When we used it we had nothing but issues

#

And most of our crashes were seamless.travel related

high lotus
#

I had lots of disconnects when doing non-seamless, but I switched to seamless, and it's been rock solid

meager spade
#

That doesn't make sense

#

Unless your doing listen server

high lotus
#

dedicated servers, not listen server

meager spade
#

But that seems like a host issue

#

We had 0 issues with hard travel

high lotus
#

likely - custom AWS stuff

meager spade
#

Games like fortnite use hard travel

#

And rocket league

#

We never had issues

twin juniper
#

Wouldn’t quote it as a reference imo

meager spade
#

Why ?

twin juniper
# meager spade Why ?

There is a bug going on since a few months when travelling from main menu to match

meager spade
#

Is rocket league still on ue3

twin juniper
#

Half of players can just don’t spawn and match is cancelled

twin juniper
brittle ledge
neon summit
#

Wait rl not ue4?

meager spade
#

Ot was made before ue4

twin juniper
neon summit
#

Oh i aee

#

See

twin juniper
#

There is rumours of it switching to UE5 but it may be a complete rewrite of the game I guess

meager spade
#

It would have to be

neon summit
#

It's unplayable the past few months

#

Couple

meager spade
#

Cause there was no upgrade path from ue3 to 4

neon summit
#

Keep getting packet loss..

twin juniper
meager spade
#

Hence ut was pretty much rewritten in ue4

twin juniper
#

Except new maps 🤓

neon summit
#

Travel bug happens rarely bit a big deal

#

But past couple months packet loss every game

#

I hear something about ddos but not sure

twin juniper
twin juniper
#

But idk it may be due to ue3, there’s no way they are under trash servers or bad infrastructure during all these years

#

I hope not

neon summit
#

It was fine til couple months ago

#

Never had any lag or anything then one day went to crap

twin juniper
#

just check their subreddit 😄

neon summit
#

It's been perfect for me til then idk

#

Yeah I checked it. Recently people have been complaining with same issue

#

But probably people always complained too so idk

#

I mentioned ddos because that what people talking about recently on reddit

meager spade
#

i think AWS is trash tbh

#

Call of Duty servers been suffering with packet loss

#

and they use AWS

#

for the past few months

neon summit
#

Is that what rl uses?

twin juniper
worthy oak
#

I think call of duty suffers because they can’t code 😂😂😂

worthy oak
#

It’s never cheap 😂

twin juniper
worthy oak
#

It’s pretty comparable in price

#

I mean its cloud computing. its gonna cost money XD

fossil veldt
twin juniper
worthy oak
#

and its def worth it to play around with

quick musk
#

Edgegap is the cheapest tbh

modest crater
worthy oak
#

Not sure what the excuse is then xD

#

they have some laughable bad mistakes at time hehe

modest crater
#

They're cheap an just have shitty tick rates

worthy oak
#

in all fairness its still very well done, its just funny when stuff like menus freeze....T-Poses happen, and of course out of nowhere bam packet loss XD

#

but no game is perfect as the saying goes

twin juniper
twin juniper
#

Future of gaming dw

worthy oak
#

Shadow banned 100% sbmm is complained about more than it should be 😂

twin juniper
#

I’m a just a basic player with a « good » aim, I play 2 times every 5 months, each time I launch this game the first match is good I do a few kills and then sbmm put e into sweats lobby cod league with 109209239$ cash prize

#

That’s how I got disgusted of the ip

worthy oak
#

and I get thats frustrating....but at the same time

#

thats how you improve

twin juniper
#

And just want to chill one night in a month

worthy oak
#

But see its placing you against harder opponents, I can agree its frustrating to be matched with someone way above your skill level

twin juniper
#

But that’s my opinion.

worthy oak
#

but your essentialyl asking to be placed in lobbies where your destroying people

#

which wouldnt be fair to the people your going against lol

twin juniper
#

Like it has always been

#

Xdefiant does it well

worthy oak
#

and to be clear im not saying the matching system in COD is perfect

twin juniper
#

Xdefiant is using a platform matchmaking and then ping priority

worthy oak
#

its 100% got some issues

#

platform and ping?

#

platform being pc/xbox?

twin juniper
twin juniper
worthy oak
#

thats beyond dumb?

twin juniper
worthy oak
#

I mean are they jsut saying its more fair for platforms to go against their own platform?

#

not sure I agree with that, controllers get aim assist

worthy oak
#

It really isnt though

#

different platsforms have different advantages and disadvantages

#

I mean in COD I guess I could see it as controller is generally better

#

so if they seperated it by platform PC players would "have it easier"

#

but tbh in my time playing cod i havent gotten killed and been like "damn I lost cause that guy had a controller and I dont"

#

its more often than not a mistake I made

#

idk its def not perfect not saying it is

#

but lot of the times it seems more like whining 🤣

thin stratus
#

Isn't there usually a checkbox to turn that off if one doesn't want to be matched against other platforms?

#

I don't think it matters for the majority of gamers. The top % are probably annoyed if they lose cause the Gamepad had aim assist. But at the same time they might whine and aren't able to perform at the same level if given the Gamepad. Idk.

Matchmaking always kinda sucked. LoL had like 8 divisions or so to hide the fact that the algorithm sucks.

karmic briar
#

damn i just finished watched AOC solution on their mmo game server backend and just saw they actually managed to make the repgraph multithreaded
(well unral server multithreaded basically) which i didnt know before they are only single threaded and not multithreaded

https://www.youtube.com/watch?v=pdav0as54mU&t=302s

We are excited to give you an in-depth preview of our server meshing technology in Ashes of Creation!

Reminder that Ashes of Creation is an open and transparent development project. As such, you will see work-in-progress art, systems, and mechanics. Leave us your thoughts on our progress in the video comments!

💬 If you have any feedback on wh...

▶ Play video
#

this whole presentation theyre doing is just plain impressive to me

#

i love their network engineer like "but we did it anyways.."

#

what a chad dev

worthy oak
shrewd ginkgo
#

I am making a skill that we can steal the skin of the other player, but currently only the server can get the skin of the other player. the client cannot access the mesh of the other player.

dark parcel
#

if this function run on client, the variable that is marked in the picture below, is only set in the client

shrewd ginkgo
meager spade
#

if your seeing this in listen server, its normal

slim jay
#

I am using Is Locally Controlled to prevent the character from hearing the hit sound, and the code seems to work, but other players still cannot hear the sound in the game

proven pagoda
slim jay
#

yes, i tried spawn sound 2d still same

proven pagoda
#

I'm spoiled by GAS I'm sorry I just use GameplayCue and it's replicated for me. The one time the location wasn't coming in properly, I put a scene component on the end of my rifle and replicated that scene component, call PlaySoundAtLocation and use the replicated scene component's world location for the sound. Maybe

thin stratus
twin juniper
#

On CoD it’s only on PlayStation (so on other platforms you are forced to have cross play enabled)

#

This will maybe change this year since the PS exclusivity deal ends (I guess ?)

thin stratus
#

I guess cause they think they only need to protect Gamepad Players from M/KB

#

Maybe. Strange either way.

twin juniper
#

Xbox are forced to play with M/KB

#

But anyway I’m not a fan of their new matchmaking system, XDefiant is doing the same as the old cod mm system and it’s working well, it’s fun, you’re playing mixed games with people good and bad, that’s cool.

slim jay
thin stratus
#

Please put PrintStrings into your code and see what calls for whom

slim jay
#

Only server with locally controlled

thin stratus
#

And the IsNotValid pin?

slim jay
#

Yes like the first image

thin stratus
#

No, does it print for anyone?

#

is that variable even valid for others?

slim jay
#

printing like this for all characters

thin stratus
#

You aren't answering my question

slim jay
thin stratus
#

I mean your code is pretty straight forward. Whatever CharacterRef is (it's not replicated and I don't know where it's being set), if it's not LocallyController, which it will onyl be for the owning client of that character, it will play the sound.

#

The only thing that could really be at fault here is the CharacterRef variable

slim jay
thin stratus
#

Maybe, but that's usually how it's done

slim jay
#

got it thank you for your time

thin stratus
#

If you put a PrintString right after the Multicast, does it print for everyone? So even before the Getter

thin stratus
#

And right after the Getter too?

#

These 4 places would need a print. First two should print for both. Right two should print only for one of them each, depending on who is the CharRef.

#

if that all works, then you should possibly test on 2 different PCs maybe.

slim jay
#

its printing only server after 2. stop

thin stratus
#

cause it can totally be that the other player, if they are in the background, aren't audible

slim jay
#

i mean after getter

thin stratus
#

Right, then the Variable is invalid for the Client

#

Then you gotta fix that

#

Where is that variable being set?

slim jay
#

when i shoot the gun with interface

thin stratus
#

And that's called on the Server I assume?

slim jay
#

yes

thin stratus
#

Yeah then this doesn't work

#

You could change CharRef to be replicated, but the chance that it doesn't replicate when your Multicast hits is there.

#

So I would advice passing the Character with the Multicast

slim jay
#

thank you so much again

thin stratus
#

Just be aware that the CharRef being replicate might not replicate before the Multicast hits if done in teh same frame

slim jay
gloomy axle
#

So I'm setting up persistent data between levels with multiplayer. Like for example, going from the player lobby, to game, back to lobby.

  • When a new player connects, they're added to a ConnectedPlayers on the GameInstance, just their pawn (I'm only using one pawn for this game, C_Lobby, i can just make child pawns anyways)
  • Each C_Lobby has a PlayerInfo data structure which a variable storing the current player controller's net id
  • When going back to lobby gamemode, on "handle new player", I read the connected players on the game instance
  • To ensure the player controller is connected back to their originally owned pawn, I check the net id the pawn stored from its previous owner with the player controller on handle new player's net id
  • If they're equal, then the player controller possess that pawn
#

how does that flow sound

#

Actually, how does storing a pawn reference on the game instance work?

#

id still need to spawn in the pawn right

ocean geyser
#

question on just opinions one way or the other regarding dormancy vs a replication managing actor. for example ill be having several hundred windows/doors/drawers/etc (they all use the same component to drive them) that are interactable and i want to replicate. im contemplating going the dormancy route which would be woken up when the actor is interacted with and put back to sleep once its completed what it needs to do, or having a dedicated actor with a replicated array of this data alongside the fast array serializer to trigger off for clients which door was interacted with. im starting to write up the dedicated actor route that manages replicating the information now but im curious as to what some peoples opinions are for one way or the other and reasons for their opinions and such just to gain some insight/learn from. looking forwards into Iris, this line "A hope for Iris is that the shift to a fully push-based replication system would make dormancy unnecessary, as only dirty objects will be considered for replication" has me questioning if either of these optimizations would be beneficial given that it sounds like the component/actor wouldnt be polled at all to replicate unless i marked the property used to replicate the doors as dirty?

torpid lantern
#

Is there a trick to debugging Steam integration? From what I can tell, you need to run the game in standalone for Steam to activate and generate auth tokens.

I don't see a way to breakpoint or read logs when running in standalone.

I am finding that I need to breakpoint via "print strings" and it's a massive pain in the ass. Is there a better method?

zenith osprey
#

Honestly am I missing something? For some reason the 'OnRep_IsProne' is never being called.

Header

    /** Set by character movement to specify that this Character is currently prone. */
    UPROPERTY(BlueprintReadOnly, ReplicatedUsing=OnRep_IsProne, Category=Character)
    uint32 bIsProne:1;
    
    /** Handle Proning replicated from server */
    UFUNCTION()
    void OnRep_IsProne();

For context ive essentially copied the Crouch code from the CMC to add a Prone state. Which works just for whatever reason OnRep_IsProne is never called stopping the Prone from being replicated

#

this is in a custom CMC built on top of the standard UE CMC

torpid lantern
dark parcel
kindred widget
winged crow
#

Hi all,

I am wanting to build some lag-free custom multiplayer character movement in blueprints, but can't do it with a server authority without introducing network lag.

I have found this pack on marketplace: https://www.unrealengine.com/marketplace/en-US/product/general-movement-component but it has a lot of features that aren't required for our project and feels a bit like overkill.

But then again, maybe it isn't overkill. "Implementing lag-free, server-authoritative multiplayer movement is a notoriously difficult task and very hard to get right - the GMC will help you immensely with this by automating almost all of the complex setup required for you."

Are there any other plugins or solutions to this problem? Our team has a lot of blueprint only devs and would much prefer to design our movement abilities in blueprints. They aren't complicated -- they just need to be lag-free.

Thanks!

Unreal Engine

Save hundreds of hours of work with this innovative locomotion framework which completely replaces Unreal's built-in character movement with a much more comprehensive and easier-to-use alternative - no C++ required.

zenith osprey
#

Imma take a look again tomorrow with a fresh mind incase I'm missing something very obvious

kindred widget
#

You've set it in the GetLifetimeReplicatedProps for the character?

zenith osprey
#

Yeah

kindred widget
#

You've set it on the server? And the character is relevant to a client somewhere?

zenith osprey
#

The CMC sets it on the Character as in when Prone() gets called in that function it sets bIsProne on the character which OnRepIsProne is linked to. But OnRep never gets called

#

I'll slap some more debug in tomorrow just so I can see the full journey of the code in the logs. But I'm gunna be missing something blatantly obvious I just know it haha

#

But I know it all seems to work at least in standalone but just not being replicated cause of above issue

kindred widget
#

I would first make sure you're setting it on the server.

  • Actor is replicated
  • Property is marked replicated using with a UFUNCTION marked function specified
  • Property is macroed in GetLifetimeReplicatedProps
  • Actor is relevant to the client
  • Property is changed on the server and is different than what the client has when it arrives(or you macro it with always broadcast

OnReps don't run on server

zenith osprey
#

Yeah my only theory is that it's being set on the client and not on server causing OnRep not to be called. So need to do some backtracking. But I have it setup like how Crouch is in the normal CMC so either I've missed something or their do something funky with the Crouch code "behind the scenes" since it's apart of the EngineAPI

#

But it's most likely me missing something

dark parcel
#

Client can only know their own controller

nova wasp
#

playerstates would fit better as those are replicated

#

since there isn't a metric for what is good and bad here I don't really know what you want me to say

#

it makes more sense to me to have each playerstate point to which team they are on

#

more accurately a single place that maps playerstates to teams and vice versa

#

this could be in the gamestate

woven basin
woven basin
# torpid lantern How do I attach a debugger to a standalone process?
#

I think there is a written blog/tutorial about it somewhere - maybe pinned in c++ channel - I know I've read it - but cant find it at the moment

#

if you have Rider - I know you can launch the "game" (rather than "editor") a attach a debugger that way - I've done it with Steam debugging before - but been a while

winged crow
obtuse field
#

How does servers like e.g. miencraft keep track on what should be destroyed? Lets imagine situation, where you have several block like redstone, sand and signs connected to each other. To make game feel smooth, client needs to simulate everything, and then ask server for confirment on block placement/removal. Now, if I destroy the construction of sands, redstone and signs a lot of block destruction needs to be simulated on both client and server. But what in case if there is a lag and server and client got desynchronized and client simulate all this destruction, and server doesn't? How would client know? And how should it handle it? It can't just undo all of this simulation(I mean, it can, but that's a lot of work, and state keeping)

winged crow
#

Thanks

fossil spoke
#

You also might want to choose to not allow Clients to predict downstream destruction events like that.

#

And instead wait for the Server to tell the Client that event occurred.

#

The Client can predict the initial Block destruction.

#

But if that results in another Block or Entity being destroyed, that event would need to come from the Server in order to be triggerred.

#

There are tradeoffs to both approaches. Like anything, its all about tradeoffs.

woven basin
solar stirrup
#

Pretty sure Minecraft has the client predict the destruction, the server reverts it if it doesn't agree

fervent jay
#

Just wondering has anyone else has issues with 5.4 having problems with finding CoreNetTypes include??? I seen one post about it here someone has a problem in 5.3.. (the include is correct)

chrome bay
#

What does your include look like?

#

Should be "UObject/CoreNetTypes.h"

upbeat basin
#

I'm getting a litle more confused by trying to delve deeper into online sessions. There are online services now. If I want to use EOS (or EOS+ more specifically for crossplay), do I need to use services interface instead of sessions?

half iris
#

If I am a player controller on the client and send an RPC to the (listen) server version of myself, what is returned when on the server I used "Reference to self"? Do I get the server proxy version of myself, or do I get a correct reference to the player controller on the client?

lost inlet
#

wut

half iris
#

Yea my bad. If I use "Reference to self" in bp, what does it return on the server? And is that different from what would be returned on the client?

neon summit
#

Client only knows it's own controller

lost inlet
#

there is only one instance of an actor on each server and client

half iris
#

Okay, so would the server return a reference to the controller that the client knows about? Or would the server return a reference to the proxy player controller that exists on the server?

lost inlet
#

I'm not sure where you got this proxy invention from

#

The tl;dr is that the server and client has a way of addressing the same actor

#

But each client and server has its own instance, it's not like Unreal has some special way of sharing memory over the network or anything

half iris
#

Right gotcha, that clears things up for me.

What I don't understand then though is that any actor we replicate that exists on the server, also exists on the client. The actors on the client are copies of the ones on the server right?

neon summit
half iris
dark edge
#

It's effectively 1 object in 2 places.

#

Just like if you and I had a synced folder with a photo file in it

half iris
dark edge
#

It's a bit hard to get your head around but once you get used to thinking "Am I the server version, owning client version, other client version, or all 3 of them right now?"

#

Certain events only happen in certain contexts, so tracing from the event, through any gating by context, and you can narrow down where this code would run.

half iris
#

Yea that is also where my confusion came from. I was thinking that in any one of those scenarios, I was a copy, yet separate version of the actor I was working with. I wasn't sure if referencing the server version, would be a reference to the same actor running on the client

dark edge
#

Even using the word server is kinda wrong here, the question is more like "Do I have authority, ownership, both, or neither?"

#

Correctly architected, the same code should work fine in standalone, listen server, dedicated server, owning client, and other client contexts.

half iris
#

That is really cool to realise.

upbeat basin
#

Is it possible to join an online session with an id or name without doing a search and needing a sesionsearchresult struct? Or would I need to set a custom parameter that would make that session unique, search for that custom parameter and join to the first and only (hopefully) search result?

solar stirrup
#

Most online services also allow invites

#

So you could make your game send a special invite and have the other client automatically accept it

#

@upbeat basin

#

Obviously make sure the other client is expecting that invite before automatically accepting, otherwise cheaters could harass other players by sending those invites themselves

#

Otherwise, searching is your only option

narrow oak
#

if i wanted to let the players be able to make a custom map and invite players in it, would the owner sending the invite be a server or a client?

#

and how would i go about sending the custom map information?

soft relic
#

Depends on if you are using dedicated servers or not, what online subsystem you are using etc.

thick vector
#

I have a character that starts with the AutonomousProxy role. When I trigger an ability on this character by user input, it behaves as expected. However, if I call a client RPC on the same character during the RPC call, its role unexpectedly changes to SimulatedProxy. I can't locate where this role change is happening within the RPC code.

slim jay
#

I use the fire event in this way, when I simulate lag, the number of shots fired changes depending on the severity of the lag. Normally, when the lag is 0, it fires 30 shots if there are 30 in the magazine, but as the lag severity increases, the number of shots fired in a single magazine increases to 33-36-38 etc .How can i fix this?

normal raven
#

Still trying to figure this out. I am using TearOff(). I was thinking I could override the function TornOff() on the server to destroy the actor once it gets confirmation that replication has ended, but this function never fires.
Any ideas? If there is some function I can override for when replication ends on the server, that'd probably be the solution

#

Basically I'm trying to be sure replication is over on the server before I delete the actor, and leave the client's version of the actor intact locally

#

My understanding is that when I call TearOff(), the changes don't necessarily take effect immediately. So I'm looking for a way to only destroy the actor immediately when I know that it is no longer replicated. (Thus ensuring the client does not also delete it's representation of the actor)

woven basin
normal raven
#

Unless there is a way for the client to pass the components of the actor along to the new local actor while leaving them intact

#

But that's still a bit more messy than I'd prefer

#

Really all I need though is a way to know on the server when it's safe to delete the actor locally. I've got the unlinking part working fine from what I can tell.
Still looking for a good solution on this.

limber gyro
#

does any 1 know if its nescessary to ping steam servers to get their ID for connection? or is that information somewhere already when the server starts?

frail barn
# neon summit

can u please add a little detail to this?
GameMode exist at the server only, so multicast event can not be used at this class
GameState and PlayerState is replicated from the server to every client, so multicast event can be used
but PlayerController is replicated to the clients independently, every one has his own
so, can multicast event be used in the PlayerController, or not?
or in a PlayerController we need to use Exequte on owning Client event?

sinful tree
#

"Run on Owning Client" will do exactly that - run only on the owning client - the client that the player controller is owned by which will only be that single client. In other words, there is no means to communicate on an actor that doesn't exist on other clients. Since the Game Mode doesn't exist on clients, calling a multicast on it means that no clients receive the message. Since the Player Controller exists only on a single client and the server, calling a multicast on it will execute only on the server and that one client.

frail barn
proper oak
#

Hey guys, trying to get a server up and running, but I have this error, where I'm having a problem with a premade asset registry when I'm trying to run a built development server: [2024.07.02-23.20.21:277][ 0]LogAssetRegistry: Error: Failed to load premade asset registry. LoadResult == 1.
[2024.07.02-23.20.21:277][ 0]LogStreaming: Display: FlushAsyncLoading(1): 1 QueuedPackages, 0 AsyncPackages
[2024.07.02-23.20.21:277][ 0]LogPackageLocalizationCache: Processed 44 localized package path(s) for 1 prioritized culture(s) in 0.000117 seconds
[2024.07.02-23.20.32:141][ 0]Message dialog closed, result: Ok, title: Serialization Error : Action Needed, text: Corrupt data found, please verify your installation.
[2024.07.02-23.20.32:150][ 0]LogWindows: Error: appError called: Assertion failed: CurrentPos + Count <= TotalSizeOrMaxInt64IfNotReady() [File:C:\Program Files\Epic Games\UE_5.3_Source\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 8478]
Seeked past end of file /Engine/EngineResources/DefaultTexture (33930 / 33926)

The build worked fine, a couple of warnings but no errors, and now this shows up. I have been able to cobble together a solution for the second error, but if anyone knows an actual fix for that, that would be great. A bit more info, this is using the 5.3.2 source build of unreal, and I have changed some of the files in the engine folder because of a problem I was having (I have done this: https://forums.unrealengine.com/t/error-compiling-the-automation-tool-after-updating-visual-studio-today-unreal-5-3-2/1393088/17). Any help would be incredibly appreciated, and if you know anything/need more info, ping me!

warm sparrow
#

if i wanted to add bot opponent to my game, is there a way to get unreal to spawn an artificial playerstate object for the bot so that i can just add the bot's decision making logic in there without having to change the multiplayer logic for the rest of the game?

fossil spoke
#

AI typically make use of a Behavior Tree for that.

warm sparrow
#

alright i will make use of that. but still for each player i have a playerstate object and the ai has to set values in there when it makes a decision. Is it possible to spawn a playerstate for the ai even though there will be one real player?

warm sparrow
#

great! I found out there is an option i can check in the ai controller 'wants player state' 👍

ember vine
#

if i spawn a replicated actor, then pass the ptr through a multicast, is there a ptoential race condition there ?

fossil spoke
#

The multicast will likely be called on the Client before the Actor has been spawned on the Client.

twin juniper
#

If I have one bool property in my struct and then in my NetSerialize a few local bool variables (to check some stuff) could I pack all of them with flags ?

#

Something like this

ember vine
#

gad damn

twin juniper
#

?

fossil spoke
#

Flags is a local

twin juniper
fossil spoke
#

There is nothing wrong with it?

#

You can pack it with whatever you like.

normal raven
#

It's amazing how many functions Unreal provides that you can use, and they're just hiding in the classes waiting for someone to find them.

lean girder
#

whats a pretty good way of identifying a client or server output for logging?

normal raven
twin juniper
fossil spoke
#

Implementing NetSerialize you are saying that you are manually handling serialization for the entire type

twin juniper
#

Also searched in a few engine structs but none of them are using ptrs

fossil spoke
#

Ar << MyActorPtr;

twin juniper
lean girder
fossil spoke
#

Look at FHitResult

#

It is a good example

#

For overriding NetSerialize

twin juniper
#

Thanks for the help, it seems to work.

gritty warren
#

I'm looking to replicate some variables to my ABP from a character component. I'm getting some issues when I actually go to apply the values to my ABP.

Currently, I just set the reference to the ABP in blueprints sometimes after Begin Play, just as a quick and hacky way to get things working.

This is fine when playing solo - whether standalone, listen server host, or client - it seems to work just fine.

As soon as I get into multiplayer however, it appears that I get an 'access violation'.

My guess is that it has something to do with the fact that I am not replicating the ABP variable in my component, however I feel like I shouldn't have to as that should be automatically set for all characters in the level naturally. Do I have some fundamental misunderstanding as to how this works, or does somebody have any idea of what might be going on?

nova wasp
#

caching it requires you to listen for when a new anim instance appears

gritty warren
#

Still, I wonder why this isn't working, it doesn't make sense to me that the character would exist but not actually go through its begin play operations

#

Huhhhh if I put a longer delay, it works from client->server, but not server->client for some reason

#

I really thought that if you have logic that runs on a character without need for user input, it should run on characters of that class no matter what machine its on, kind of like how an ABP just functions based off of data without needing to replicate specific things

#

This makes no sense to me, hmm

nova wasp
#

it is not exactly when the object was created

#

please do not use a random timed delay here

#

how is it replicated? servers don't onrep on authority except for bp onreps

gritty warren
gritty warren
nova wasp
#

yeah, of course but how is the replicated data replicated?

#

it makes perfect sense to drive the abp from replicated data on the pawn

gritty warren
#

Oh, through a repnotify / RPC (for client prediction purposes). I guess I'm not certain that the replication works

nova wasp
gritty warren
#

I do make it through to my onreps and such just fine however

#

its just inside the OnRep, where i say 'now update the ABP', it crashes

nova wasp
#

you should not dereference a null pointer

#

regardless of how you replicate things

gritty warren
#

Right, so to stop the crashing I added a if(MyAbp) statement so now itll not crash, but my point still stands I suppose

#

I need to learn how to properly set variables like this that should be in synch just from things like begin play and such

#

Even if it's not the proper implementation (I do agree it makes more sense to just get the reference every time like you say - I use anim layers and those can change, so this makes more sense), but I still would like to know why this isn't working and what I should be doing differently

nova wasp
#

generally the anim instance just reads the variables upon ticking

#

and if they are different, oh well

#

the replicated variable can change whenever

gritty warren
#

is it not more expensive to get those variables every frame?

nova wasp
#

yes but you have to tick the anim instance anyways? how are you avoiding ticking here?

gritty warren
#

I'm not avoiding ticking, I just am not sure how performance works - I figured accessing a ton of variables would still be costly to some degree, is that not the case?

sinful tree
#

Getting variables isn't bad, you're just reading memory. Calculating values that goes into variables on tick could be bad depending on the complexity of the operations needed to determine the value.

gritty warren
#

Hmm I see. All the variables that are being replicated are changing on events, and these events definitely won't be happening every frame.

Still, it is surprising to me that I cannot find a way to initialize a value on this Actor Component from somewhere else without needing to replicate it

keen hound
#

how would i have two players possess something? im working on multicrew tanks

fossil spoke
#

You dont

#

You would likely separate the tank into individual pawns

#

One that makes up the turret

#

another that makes up the body

#

They of course would be attached to each other

#

But the body would only perform vehicular movement

woven basin
# normal raven I personally use `UE_LOG(LogTemp, Display, TEXT("Running on %s"), GetNetMode() =...

I prefer this one:

UE_LOGFMT(LogTemp, Info, "Session updated with Game Instance settings! {0}", *GetDebugStringForWorld(GetWorld()))

Which gives you ListenServer, DedicatedServer, Client1, Client3 etc

Which means I can do stuff like this:

UE_LOGFMT(LogTemp, Info, "{0} - OnHit registered", *GetDebugStringForWorld(GetWorld()))

And then in my logs see:

Client1 - OnHit Registered
Client2 - OnHit Registered
ListenServer - OnHit Registered
fossil spoke
#

The turret would perform rotational movement and firing etc

normal raven
charred island
#

I have a physics-driven space sim (non-multiplayer example linked), and I am trying to network it. I have tried using resimulation, but even with fairly low simulated latency, the simulations diverge. From my understanding, isn't the resimulation supposed to hard-snap things once they get too far? https://www.youtube.com/watch?v=MKpTG-ikjx0

Displays a circle target indicating which direction the ship nose should be pointed with the current thrust so that you'll rendezvous. This lets you focus on the target ahead of you instead of relying on head tracking to see your target.

▶ Play video
charred island
#

Also, would it be a bad idea to have a semi-client authoritative model where server is willing to accept the client's simulation as long as it is within a margin of error, but will force a correction if the pawns transform strays too far?

fossil spoke
normal raven
#

Is there a client-side method for checking if replication is still enabled for an AActor?
I'm using TearOff() on the server but am not receiving the TornOff() function on the client for some reason.

Either a client-side function that fires when replication ends, or way to check from the client if it is still replicating at any given moment would work.

woven basin
normal raven
normal raven
#

I supposed I just need to figure out why TornOff doesn't fire 🤔

chrome bay
#

Are you sure you're only tearing it off server-side?

upbeat basin
#

Is using a thirdparty matchmaker, creating a session and listen server by the host (decided by matchmaker), setting a custom parameter as match ID (again, provided by matchmaker) to the session settings and searching for sessions that match to the custom parameter (matchID) from other clients an acceptable concept for achieving this?

normal raven
#

Unfortunately I've got to hop off for the night (it's quite late here haha) but I'll be back at it again in another 8 hours or so.

blazing berry
#

Hey y'all! Currently making something that is like Among Us for personal purposes, using EOS Integration Kit. So right now, I'm struggling with getting the finished task amount by each player. Each player has an integer variable, and then I have tried a few ways to print the amount of tasks finished by all players. Using Level Blueprint, Game State, and an actor that acts like a Task Manager. Every variable is replicated, and increased in server and multicast events. Yet, nothing.

How can I make it so both players' task finished amount are added together, so then again, both players can find the total task finished amount?

dark edge
blazing berry
# dark edge What class actually holds the integer?

Each player (basically the player class) has a integer which says their tasks finished. Task Manger holds another integer, that adds all the players' tasks finished to a total, which then should be possible to access by all players.

dark edge
blazing berry
meager spade
#

why does the pawn class hold this

#

not the component?

frozen palm
#

For fun, I've been trying to convert my solo player game so that it would work with multiplayer too. I've managed to replicate some stuff into my game. Individual actors have been a breeze to replicate with using "has authority" and doing events for server and multicast and all that jazz but when it comes to my Character and AnimBP I'm having issues. I set up the logic for my character to crouch and it's custom (as in, not using the crouch that comes with the movement component). The AnimBP is checking the character if it is crouching and then sets its own "IsCrouching"-bool which in turn plays the proper animation inside the AnimBP (not a montage). What happens is that when I crouch, all players crouch! And it's only the animation side of the crouching that is being mirrored for each player. The crouching also reduces the size of a capsule component but that works just fine and is not being mirrored. Where could the issue be?

So...

  • Character presses crouch and "Is Crouching"-bool is set on character side.
  • AnimBP notices that the Character is crouching and sets its own "IsCrouching"-bool on AnimBP side.
  • All players in the game play crouching animation instead of just the actual character.
  • There's no casting happening anywhere. The "IsCrouching"-bool is sent via Blueprint Interface.
#

The base start of the crouching looks like this. Nothing weird there I guess?

upbeat basin
upbeat basin
#

I'm trying to join a listen server using the connection string retrieved from IOnlineSessionPtr::GetResolvedConnectString(). The session creation, find and join are working fine. I can see the connection string is also valid and related to my steam ID (using OSS Steam). Initial Connect Diagnostics: Sent '10' packets in last '10.002317' seconds, no packets received yet. repeats 6 times and when 1 minute is up the connection timeouts

Few extra info:

  • Testing on 2 different pc with 2 different steam accounts on standalone mode
  • If I only change the oss to Null by keeping everything same, it works fine
  • Using open command to host and join (open GameMap?listen and open [LocalAddress]:7777) works fine as well

I'm not sure what is the problem or how I can debug this, any pointers would be appreciated

dark edge
frozen palm
frozen palm
upbeat basin
#

There already is a TArray<APlayerState> PlayerArray variable, filled with the player states of the currently connected players, inside GameState. Players are being added to and removed from there as they connect and disconnect. And you can reach GameState from GameMode

ebon cloud
#

Hey guys, any chance someone can point me in the right direction? I'm playing around with the VR template character and its out of the box GrabComponent, and I'm trying to get replication working for actor grabbing. Issue is I'm guessing the client doesn't have access to the Server ran event 'Server_TryGrab'. Does anyone have an idea how I can replicate actor grabbing for server and client characters?

fossil veldt
#

Ay is copy properties called on clients or only on server?

normal raven
gritty warren
#

I notice that when I emulate bad network conditions on a listen server, everything is a little jittery on the host - however, everything is smooth on the clients. What's that all about? 🤔

#

for reference, I'm talking about a procedural animation that doesn't have any changing values, it's like the in between steps aren't smoothing like they ought to be

lost inlet
#

if only there was an easier way of representing code than a low res screenshot

normal raven
#

Ohh. My bad

meager spade
#

whyu are you doing so much

#

FlushDormance, Flush this, flush that, force this

#

then TearOff

normal raven
normal raven
meager spade
#

also that if condition is stupid 😛

normal raven
meager spade
#

:/

normal raven
#

I'm not getting any RPCs to get through to the client though, so I think I'm setting up my replication wrong

meager spade
#

well is the chunk spawned server only?

normal raven
# meager spade well is the chunk spawned server only?

I'm spawning my Terrain chunks locally on client and server, and then renaming them to the same thing and enabling replication when they need to link up (Only when close by and they need collision). I thought that system was working perfectly. (It seems to solve the issues of the server being confused by what actor the client is standing on) but since this is not working, now I'm not sure

meager spade
#

no no no

#

dont ever do no renaming

#

spawn them with the correct name

#

it should be determenstic

normal raven
#

Well it is deterministic

meager spade
#

for example in our game, we use the seed

#

then the client spawns the exact same actors as servers

normal raven
#

But I don't always have a chunk on the server until it is very close to the client

meager spade
#

but it doesnt matte

#

matter*

#

server when it needs to make those chunks, should be determenstic

#

with the seed

normal raven
#

I guess I see your point

meager spade
#

secondly, you have to do some fakery

#

to allow replication to work

normal raven
#

But the reason I rename the chunks is because if I delete them and need them again, I thought they needed a new name?

#

So how do I avoid naming conflicts without renaming?

meager spade
#

if they are deleted then they will be gone when the GC runs

#

so its fine to reuse names once you can, but again this is the flaw with the whole unique name thing

#

but you should NEVER have chunks on client that server doesnt have

#

server tells the client hey spawn chunk, heres some meta chunk data so you can make that chunk copy

normal raven
#

I guess I assumed it was fine for the client to have local chunks just for visualization

meager spade
#

ofc mincraft, is a bit different, it was designed from scratch to handle that

#

with Unreal Engine, your fighting the engine design a lot

#

not even sure minecraft works like that?

normal raven
#

Seems like it'd kinda suck to have to have everything on the server. I've got pretty extreme render distances

meager spade
#

iirc chnks are always on server if client can see those chunks

normal raven
#

Ok so to reiterate, you're saying that anytime a client needs a chunk, the server should spawn it first, and they should be linked up throughout the entire client side lifetime?

#

It'd really suck to have to rework this that way lol

meager spade
#

cause of ue limitations thats the easiest

normal raven
#

I felt so close

meager spade
#

ofc there are other ways

normal raven
# meager spade ofc there are other ways

So my current approach is this:

  • Client spawns chunks locally anywhere it needs:
  • Server spawns only chunks that are needed for collision (a much closer radius), enabling replication for them
  • Server has a deterministic name based on location, but adds to that a counter for every chunk location, so we avoid naming conflicts from deleted chunks
  • Server sends counts to client every time the client moves into a new chunk, and client combines the counts with the deterministic name by location to get the same name as server, thus linking the chunks
  • Client hides any chunks that it wants to delete if the server still contains them
  • Client does not delete any chunks that have been linked with the server, until the server deletes them, thus ensuring we don't delete and then spawn a chunk that would have the same name
#

I was under the impression this was working swimmingly, despite being a bit bloated.
I'm currently on the last step, trying to mark chunks safe for deletion if the server stops replicating them.

#

I had thought about having the server just spawn collision chunks with NetLoadOnClient, which would make things simpler, but then I was afraid I'd have to regenerate chunk meshes on the client. Maybe that'd be worth it IDK.
I suppose I could try to move the mesh component from one actor to another, but that feels weird.
Also I am stubbornly wanting to cling to my "client side local chunks outside the collision radius" 😅

#

If anyone has advice I will gladly take it. Been stumbling around in the dark on this one hahaha

fossil veldt
meager spade
#

Sure

normal raven
meager spade
#

But either system is not easy

#

And why do the chunks need to replicate is a concern

#

We never replicated them

normal raven
#

really??

#

Interesting

meager spade
#

We had a system to maintain the chunks which exist or not

normal raven
#

See for the longest time I never had them replicating

meager spade
#

Using the chunks and ids of blocks in the chunks etc

fossil veldt
#

Wdym by replicating

#

the actual actors?

normal raven
#

Yeah the chunk actors

fossil veldt
#

yeah don't need to do that at all

normal raven
#

wut

#

you kidding me

fossil veldt
#

na, just use the chunk coordinate as a key

normal raven
#

so yeah that's exactly what I do

fossil veldt
#

and write over the data on it

normal raven
#

But I thought I needed to replicate them to stop getting these weird errors where the server didn't know what actor the chunk was standing on

#

It was just little things like some clients saw others as falling when they weren't

solar stirrup
#

No, they just need to be stably named (so when you create them you give them the same name serverside and clientside)

normal raven
#

Boy I'd love to avoid replicating the chunk actors if possible

fossil veldt
fossil veldt
normal raven
fossil veldt
#

it's only a problem if they fall on the server

#

on clients you don't care, it will get corrected

#

but you should be locking the entire chunk from running logic if the server hasn't loaded it

normal raven
#

I just mean like animations looked like falling

fossil veldt
#

are you using cmc?

#

and how are you generating collisions

normal raven
normal raven
#

Lemme try to reproduce the warning real quick

fossil veldt
fossil veldt
normal raven
fossil veldt
normal raven
#

Yeah I'm using it

#

Example warning: LogNetPlayerMovement: Warning: ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction! Client currently at world location X=-747.262 Y=-3585.239 Z=-3159.850 on base RealtimeMeshComponent

#

This when standing on a non replicated chunk

fossil veldt
#

yeah ok movement base related that tracks

#

based movement was half the reason i stopped using the CMC for mine

#

xd

normal raven
#

And this is going to be a Marketplace Plugin so faking it probably won't cut it

#

Yeah, can't really change that

fossil veldt
#

tbf it shouldn't in theory matter

#

in this case

#

that is weird

normal raven
normal raven
thin stratus
#

Runtime spawned not replicated/netaddressable Meshes etc. will always be a problem

#

Mover has the same issue, even uglier

fossil veldt
#

yea my solution was to use mover and just not use movement bases ay lmao

normal raven
#

So back to square one ROFL

#

You got my hopes up Snaps, 😭 😂

#

But I appreciate it anyway haha

fossil veldt
#

well i mean, if you don't need movement base

#

you can just null it out on the cmc

#

and you'd be fine

#

most minecraft style games don't need based movement

thin stratus
#

Mover's BasedMovement works

#

It just reacts shitty if you stand on such a mesh

#

Cause the Client will reconcile cause the MovementBase is null

normal raven
#

Yeah, makes sense

thin stratus
#

But then use the Location as its correct location, which the Server sent as a relative one

fossil veldt
thin stratus
#

Really lovely

normal raven
#

But it's gonna be pretty dope

thin stratus
#

I should probably add a flag to it bHasMovementBase, so the Client knows when this shit happens

#

But the log is spammed anyway I guess

normal raven
#

Hold up. What if it was only one actor and all the chunks were components?

#

Would that fix the issue?

#

Of trying to link with replication I mean

#

I've been told that components are better for chunks anyway.

fossil veldt
#

one thing i've been actually wondering lately is if I fucked up not just using world partition for my voxel world tbh

fossil veldt
normal raven
#

I'm trying to learn that at some point I just have to tie up the loose ends and ship. Easy to say I know lol, but this is taking an eternity

thin stratus
#

The issue isn't really complex :D

normal raven
#

Basically same issue then right?

normal raven
thin stratus
#

You can spawn them on both sides, but they need to share the same name and need to be set to be addressable

normal raven
#

So in other words, I've had the right approach all this time, and we just went in circles with the theory just to land where we started LOL.
Well that's good news I guess

#

So I had Chunk->bNetStartup = true;
Does that make Chunk->SetNetAddressable(); redundant?

solar stirrup
#

I don't think so

normal raven
#

Interesting, ok

solar stirrup
#
void AActor::SetNetAddressable()
{
    bForceNetAddressable = 1;
}
#

oh wait

#

yeah okay it does

#
bool AActor::IsNameStableForNetworking() const
{
    return IsNetStartupActor() || HasAnyFlags( RF_ClassDefaultObject | RF_ArchetypeObject ) || bForceNetAddressable != 0;
}
normal raven
#

You're faster than me haha

solar stirrup
#

In any case, I wouldn't manually change that bool

normal raven
#

Yeah

solar stirrup
#

Better to call SetNetAddressable() than tamper with that one

#

In case it's used for other stuff