#multiplayer

1 messages · Page 507 of 1

bitter oriole
#

Basically competitive games, or games with more than 5-6 players, will need dedicated servers

#

Any hosting provider will do, you can start looking at AWS for the biggest...

woeful ferry
#

Heey!

I'm trying to replicate our building system. It replicates from server to client, but not client to server. What have I missed?

bitter oriole
#

@woeful ferry Replication is only server to client

pastel thunder
#

Hey @bitter oriole suppose I'm making a multiplayer game like pubgMobile... Then how I will set Our max player in a match is 100?

bitter oriole
#

First you hire a team of 10 experienced networking engineers

#

Then you ask them

#

100 players is no joke

woeful ferry
#

@bitter oriole But then how do I send the info from my client to the server?

bitter oriole
#

@woeful ferry You need to use RPCs ("run on server" in BP)

woeful ferry
#

Which I do?

bitter oriole
#

i don't see that

pastel thunder
#

@bitter oriole are u developer?

#

Of any company

bitter oriole
#

Yes I'm a developer

pastel thunder
#

Which game u have made

#

Can I know

bitter oriole
#

Does it matter ?

woeful ferry
#

Oh sorry, wrong picture

pastel thunder
#

@bitter oriole
No but...

bitter oriole
#

I'll answer this : I've used UE for a decade and I will never try doing a game that has more than 6 players, or competitive gameplay, because I think it gets way too hard

#

Multiplayer is too hard for most people to start with

#

So I don't know the answer to your question, other than that it's too hard for me

winged badger
#

networking is just part of a problem for a 100 player game

bitter oriole
#

@woeful ferry Pretty sure you can't "replicate to server" at all

winged badger
#

100 CMC's running around... yikes

pastel thunder
#

I'm 18years old... I want to know multiplayer... System... So that's I'm going here to there... YouTube, blogs... There are lots of confusion...

bitter oriole
#

There's multiplayer, and there's AAA-with-200-engineers-and-millions-players-multiplayer

bitter oriole
#

Fortnite or PUBG are not something you can replicate alone

#

If you really want to do multiplayer, do a game with 4 players

#

That you can play solo

pastel thunder
#

Okay...

#

After that?

bitter oriole
#

After that if you have the budget to hire a 50-people team, do that

#

If not, do another game with 4 players

pastel thunder
#

Okay

#

@bitter oriole is too hard to make a game like asphalt...(simply gameplay leave the other inventory stuff)

bitter oriole
#

Asphalt is made by a team of 150

#

And UE4 does not have built-in support for multiplayer vehicles

#

So there's a lot of work there

viscid bronze
#

@bitter oriole do you know how to keep the server from spawning multiple UI?
i have this in the PC as a temporary fix but it stops any UI from spawning on server at all

bitter oriole
#

Just spawn it from the HUD class

#

That might be enough

#

If not then spawn only if the PC is local

viscid bronze
#

ok hold on

#

@bitter oriole nice, it works! thx

left parcel
pastel thunder
#

@left parcel I have already watched him... And I have to clear all the doubts...

indigo brook
#

Hey guys, I was thinking about making a basic multiplayer game. I made a basic loop of how the experience should be. I want to know how difficult it might be for a intermediate blueprint programmer and a general ballpark timeline for how long it could take to get a solid prototype completed

#

You could click image to get a larger view

#

@ me if you respond to my question, I will be off screen

meager spade
#

@viscid bronze i would limit your use of GetPLayerController

#

you could easily check for "IsLocallyControlled" or "IsLocalController"

#

inside pawn/controller

#

its safer

#

same as GetPlayerCharacter 0

viscid bronze
#

@meager spade however now, on the third time i switch classes the HUDs stop despawning and start overlapping. how do i fix it?

meager spade
#

you are doing a lot of repeated code

#

i mean a lot

#

and you use of GetPlayerCharacter/GetPlayerController is concerning

#

your*

viscid bronze
#

yeah idk what im really doing tbh

#

any solution to that

meager spade
#

i can tell, not being rude or anything

#

so, first, remove repeated code

#

this here can be one function

tough totem
#

Have a server, that travel to a level. Problem is, that all my clients dont travel with the server. They are just stuck in the old level. How can I get these Clients to follow the server in Blueprint?

bitter oriole
#

Use server travel

tough totem
bitter oriole
#

I don't know. It's weird that your clients would stay on the previous level, really

#

They should all be kicked

#

Servers can't have multiple levels loaded

tough totem
#

After the Server travel to the new level, the clients are not replicated anymore. So like the clients have all a normal level without a server

winged badger
#

think you need ?listen

#

at the end of that console command

ember slate
#

So how do you guys go about adding a new movement mode to unreal's Character Movement Component?

peak star
#

@tough totem did you enable Seamless Travel in your project settings?

tough totem
#

@peak star will check it

tough totem
#

Didn't found seamless travel in the project settings but checked the seamless travel option in all of my gamemodes @peak star . @winged badger, with the execute command line the server even don't travel to the new level. Set the "listen" in the option but just the server travel and the clients don't follow.

winged badger
#

cant help but notice you never connected the controller

#

listen server? dedi?

tough totem
#

I use dedicated server

meager spade
#

NetSeraizlization.h

#

Serialization*

winged badger
#

at least it has actual documentation in comments

#

also FHitResult is an excellent example of custom NetSerialize function

peak star
#

@tough totem try leaving off the full path of the level asset and only put the level name in there. I think that is all I ever needed.

#

Also I have a question: if i use console command BP nodes in a shipping build, will they run? I heard they don't run in shipping builds but maybe that was only the case on older versions of ue4

meager spade
#

not sure why they wouldn't work in shipping

#

but i would just test it

#

with a quick shipping build

bronze arch
#

Hey guys, sorry for the paint and stupid question. but i cant brainstorm for that with MULTIPLAYER.
1- These collisions, was added in the world map.
2- Player Blue can pass this collision but red cant.
So i did some tests to in player blue in client remove this collision for passing. but I see some tremblings. because in server doesnt removed this collision, thats why blue player cant pass this. so idk what to do for that.. ?
if i do remove collision in server and client blue player, then red players can pass too. because in server have no collision to pass it.

#

HALP1

#

i did googled but there no answer to do it pepehands

  • new solution didnt work
vivid seal
#

in a multiplayer setting with spell cast bars and interrupts, how do you guys handle timing how long a cast should be on server? if i start the cast when the server receives the command and have it be the same length as the client-predicted cast, then there's a window where a client will predict his cast to be finished but the server might have been interrupted, leading to a lockout after a cast is "finished" or after a client has already cancelled the cast on his own screen. i can reduce the cast time by rtt ping for the server, which lowers that window, but means some casts will go through when a client tries to cancel his own cast at the last second.

kind of a niche question but im stuck

meager spade
#

well what are you trying to seralize

#

oh like encrypt it?

#

or reduce the packet size of that

brave solar
#

From what I've read repnotifies are supposed to work even if a player joins after it being set, but it doesn't, it just shows the default values on all the present players when a player joins the session. It only updates when the repnotify is changed after the player joins?

ocean geyser
#

@brave solar so lets say we load up the default third person project (the small map so all the objects around are relevant) with our custom actor(lets assume its a storage chest that can open/close) that has a rep notify variable on it (lets say its a boolean IsOpen thats set to false by default in the constructor). lets say when this rep notify variable changes to true, the OnRep function fires and if the boolean IsOpen is true then it will play the animation to open the chest. now lets say player 2 joins the server after the IsOpen variable was changed to true, because the chest actor is relevant to player 2, they will see the open animation play. now lets say we have a player that was 5 miles or so away from the chest so the chest was not relevant when the boolean was changed to true. when that player gets near the chest to where its relevant(lets just say beside the chest) then the function will run on his client and play the opening animation on the chest

brave solar
#

Yeah I understand that much, but the players spawn right next to each other and nothing happens still

ocean geyser
#

is the variable being set in the constructor?

brave solar
#

No it loads a savegame on beginplay and then sets the repnotify with data from the savegame

brave solar
#

Haha well thanks for your help.. it turns out I had a bunch of stuff in the construction script that was conflicting with the loading. Now it works perfectly.

warm summit
#

Guys, I'm still really struggling with Bluetooth support for Android.. The only Thing I can see is the Plugin 'Bluetooth Support' by TahaHISHRI. But it's still on UE4.19, which I suppose wont work for uploading it to Google Play Store. Any suggestions? I mean there needs to be a way shrug::skin-tone-2‍♂️.

tiny flame
#

Hello I was wondering if anyone has some time and or suggestions that could tell me what I'm doing wrong or missing I have tried countless tuts and read through documents packaging my empty game multiple times and cannot get clients to connect to my dedicated server on anything but local host and my port is forwarded
I've followed all the steps I know and have found and nothing is working if anybody can help me at all in the right direction I would appreciate it

#

PM me would probably be best

peak star
#

@bronze arch are you handling color specific collision using collision channels or by turning collision on/off? If you handle it by turning on/off, then do you trigger it to change on the server, too or only on the machine that triggered it originally? If you trigger it on the server, is the change replicated to all clients?

thin stratus
#

@warm summit If the plugin comes with source files, you can try to compile it for 4.20+ yourself.

#

Should drink my coffee first, no idea why it swapped GoogleStore with Marketplace. My goodness.

#

It shouldn't stop you from uploading it to the GoogleStore I guess.

warm summit
#

okay, but what do you mean with source files? I mean there's a github version of this plugin. Still I wouldn't know how to install it to 4.20+

thin stratus
#

Source files are the .cpp and .h files that contains the code of the plugin. If that is available, then you can compile binaries for 4.20+.
All you need is a C++ project (can be a new, empty one) of 4.20 or higher, put the plugin into its plugin folder, regenerate project files, open the project in Visual Studio and hit compile.
Good chance that compiling might fail, but at least you can try.

#

There are also some command line ways of compiling it, but the project one is at least the most straight forward to understand.

#

You are free to google words in my explanation that you don't understand as these are mostly the very basics of how to use UE4 c++

hollow portal
agile lotus
#

hey

#

how do i turn off movement corrections

keen thorn
#

anyone tried custom server solution for ue4 yet? like netcode.io, raknet/slikenet, SteamGameznetworking etc?

#

We are having problem that easch u4 dedicated server eat too.much memory, so we are looking for a lightweight implementation

bitter oriole
#

@keen thorn You probably should try optimizing first, because you'll need to reimplement your entire game logic on your new server tech

keen thorn
#

@bitter oriole does not work in our case since an empty project already runs at 200mb which is way over what the requirement can allow. and we are lucky to not need implement any game logic to simulate the game on the server for our current project.

bitter oriole
#

Well if you don't need the level data or any shared code, I suspect not many people around here will be in the same case

keen thorn
#

we are looking for an implementation that runs only around 50mb or.less, so a golang implementation or something, netcode.io seems promising but was wondering if anyone knows something else

#

also because current ue4 server instance does not support multi session, something we want to gain experience in by building our own server so we can later expand on this

viscid bronze
#

how do I replicate a reload animation? it is a montage, and functions using a boolean variable.

bitter oriole
#

It's complicated. You usually don't want to replicate animation events

#

Instead, replicate the player state - like "is reloading"

#

And then the local animation blueprint can smoothly go into that animation state

viscid bronze
#

I've replicated both the Is Reloading in the screencap and the variable in the character blueprint though

#

but it still only replicates from server to clients.

#

i also use this custom event structure for weapon reloading and setting the IsReloading variable

bitter oriole
#

"only replicates from server to clients" is absolutely what replication does

#

You need to change the state on the server for replication to work

viscid bronze
#

how do i change the state on the server from the client though? is there a node for that?

bitter oriole
#

"run on server" stuff

viscid bronze
#

okay

viscid bronze
#

still couldnt figure out how to do it while not messing up the ammo count and such though

#

input connects directly to the ReloadServer custom event

toxic brook
#

Hello, is there a way to configure bandwith. When I send too much RPCs, at some point my GameState bReplicatedHasBegunPlay is not replicated...

meager spade
#

you are abusing multicasts @viscid bronze

#

why is reload running on all clients?

unique kelp
#

Can anyone here clear up some doubts I have with aws gamelift terminology?

viscid bronze
#

@meager spade i don't know. I kinda just lifted some stuff from the MultiplayerShootout.
Hold on let me open UE4 back up

meager spade
#

that would not work

#

you are running a Multicast

#

change that to Run on Server

viscid bronze
#

it doesnt work this way for me. the server works fine on both reloading and casting the reload anim to everyone, but the client cannot reload at all.

#

@meager spade

meager spade
#

well without seeing the rest of your logic

#

i can only guess

viscid bronze
#

kay hold on

quiet wyvern
#

Anyone got any idea why when i run In PIE with dedicated server the client is super slow and laggy but standalone with dedicated server is fine

cosmic star
#

What is the advantage/difference of putting something inside the PlayerState instead of the player controller, besides the obvious "PlayerState is replicated to every client"? Or is there even any difference?

zealous saffron
#

PCs dont exist on other clients

#

PSs do

cosmic star
#

That's what I mean by "PlayerState is replicated to every client". Bad wording, MB.

zealous saffron
#

PS could be thought of as containers storing replicated data that other players need to be aware of. If it is stored in a PC only the server and client would know of it.

fleet raven
#

if your game uses ai players then you might have to consider whether they need this / will have a controller, a player state, or both

cosmic star
#

So, example: A player has an inventory other players can't interact with -> Controller; A player also has equipment that has to persists through death and can be stolen by other players -> State
Right?

zealous saffron
#

Would make a replicated inventory component at that point.

distant talon
#

how would you approach ai playerstates? that doesnt seem like something the playerstate system is intended or usable for

lost inlet
#

i'm not sure what you mean, you can totally use player states with bots

#

it even has the bIsABot variable

jolly siren
#

You set bWantsPlayerState = true in the AIController

distant talon
#

oh

#

handy

gritty lodge
#

Does anyone know why SetActorTransform from gamemode will move the actor to the correct Location but ignore the Rotation?

#

Does Rotation just not propagate to the clients?

#

Hmmm, SetActorRotation from Gamemode does nothing either.

#

Yet, the Output from the node says the Rotation was applied successfully...

brazen glacier
#

@gritty lodge What happens when you try it as a listen server? Is the actor a character?

#

@cosmic star I've had similar struggles, and the answer is more design theory than anything else. There is no one correct way. Just be sure you know the fundamental diffs between pc, ps, and char well. Another lens with which to view ps I've found helpful is that it's just an abstract representation of the character: you can store vars there instead of on char for modularity. It also has a couple nice functions.

#

For my multiplayer inventory, I spawn a separate actor from each character and have it only exist on that client. my server need only track when a player adds or removes something; it keeps a separate player-inventory array for that

#

of course this wouldn't work if players need to have the ability to check others' inventories

#

though they could do a server check for that. shrug

wary willow
#

Hmm

#

[PacketHandlerComponents] +Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

#

So, added this to DefaultEngine.ini , restarted project. Can't see SteamAuth functions anywhere

cosmic star
#

@brazen glacier Thanks for that. I guessed it was more of a design choice, which is good. More ways are always welcome.

lost inlet
#

@wary willow i'm not sure what you're expecting to happen by enabling that packet handler but all it does it enforce steam auth

#

and it's a fairly passive system that you don't have to interact with

wary willow
#

@lost inlet had hoped to get Steam Auth Token ;)

#

Session Ticket

#

I mean, I know how to do it manually via IOnlineInterface

#

Just hoped that it would have been put in by now. Thought that was the magical ticket. Guess I was wrong

#

😂

nimble stirrup
#

When a client is transferred to a new map via seamless travel, is there a way to determine when all the actors in the client's map are fully loaded? I've tried calling HasClientLoadedCurrentWorld from the server. It returns True, but I have reason to believe an static mesh actor in the map is not loaded since it is not replicated correctly.

lost inlet
#

i'm not sure how reusable steam auth tickets are

#

GetAuthToken should suit your needs for that

bronze arch
#

There is possible to do one way collision with multiplayer?

gleaming vector
#

steam auto tickets are not reusable

#

GetAuthToken will invalidate previous auth tokens

#

and 4.22 should support steam auth flow now

twin juniper
#

i created a packaged executable for try test it, but i don't know how to execute server, and clients to connect to server

#

in editor it launchs the server and clients fine

#

how i do that in the packaged version?

meager spade
#

did you build the server using the source engine?

#

if not, youi wont have a server

grave scarab
#

I’m having problems filling an array of data tables with information from a database using Varest plugin for my card game. I tested my blueprint and the database connection works, and I’m able to retrieve and store data from the database in the data table, my problem is with the foreachloop I am using, due to where the iteration ends I am only storing 1 deck instead of 2, I think this is to do with the loop not connection from Bind Event to OnRequestComplete through the custom event to the fill data table node the loop should iterate after fill data table but I think it iterates at Bind Event to OnRequestComplete. My question is how to handle the foreachloop to iterate after fill datatable here

twin juniper
#

i think you cant fill an data table, since data table doesnt allow changes at runtime

#

unless ure using some plugin or c++ code for that

grand kestrel
#

So if player states are kept alive following a disconnect, and a playercontroller owns the playerstate, what would APlayerState::GetOwner return for a disconnected player

ocean geyser
#

try it and see if it nulls it out, might hold a reference to the old player controller

grand kestrel
#

Guess I'll have to

#

Was hoping someone knew off the top of their head

ocean geyser
#

@grand kestrel report back with results please

grave scarab
#

@twin juniper I am filling one of the data tables I even tested it to see if the values I fill it with can then be added to my base card blueprint and it shows the correct data on the card, the problem is that I should be getting 2 decks with card attribute but I’m getting only 1

grand kestrel
#

@ocean geyser I might forget to, you can ping me sometime tomorrow 😄

gritty lodge
#

Event happens > Game mode grabs a team of players > applies transforms > server applies transform correctly > clients get proper location, but their rotation stays the same on client as before the transform until they move

viscid bronze
#

how do i call a function from a specific player
like say I want whatever player (client or server) gets hit by the raycast to take off a specific value from the variable float "Health"
how do I do that
is there documentation on this?

supple basalt
#

Shooter for C++ and there are some other examples made entirely in BPs. Did you study them?

hollow portal
#

hi im having trouble with replication and stuff

#

i made a basic door and when you open it it opens on one game but not the other so player 2 has the door closed and player 1 has the door open

twin juniper
#

Hello any way to know when the NetGUID of an actor is initialized on server
I'm searching some events or functions in ActorChannel / AActor / PackageMapClient and I didn't find anything

If anyone can help me, it would be nice! Thanks

winged badger
#

my guess would be NetDriver or DataChannel

#

when they are evaluated for replication for the first time

twin juniper
#

Ok I'll check that thanks !

toxic brook
#

I have Pawn on the server and they do not spawn on the client. Any ideas?

#

I have SerializeNewActor failed to find/spawn actor. in LogNet

#

SerializeNewActor: Failed to find static actor:

steady briar
#

so does an AI run PossessedBy when they receive an AI Controller?

astral fossil
#

Hey guys, what could be the reason for a Rep w/ notify working fast on the first time and REALLY slow on the next one?
There aren't many stuff being replicated on my test map but I don't even know where to look on this, also didn't find something addressing that on google

#

(also, no warnings or feedback)

#

To be more specific I'm setting a actor reference on Server that is setted to replicate w/ notify.
the first time, the print thats on the OnRep function executes on server and shortly after on cliente.
Next time, it prints on server, but not on the client for a large amount of time, like 20 /30 sec (if prints.., most of the time it doesn't).
This is on my Pawn with this replication config
Im testing in PIE, dedicated server and 1 player

astral fossil
#

any hint?

ocean geyser
#

try testing outside of editor

worthy perch
#

Run the netprofiler, you're probably net saturated. @astral fossil

astral fossil
#

I ran, I don't think thats the case

#

its a very empty levle

#

and its consistently after the first execution

#

PowerUpAttached should have count 2 in this

#

I left that problem on hold and am working on other stuff, will be glad if anyone has idea on how to investigate this

winged badger
#

you using a replication graph?

red pollen
#

Hey, I've run into a problem and I just can't figure it out. I have restarted all my assets from scratch, still the same problem arises, wondering if anybody in here has a clue what the problem is

#

I'm using the Advanced Sessions Plugin on 4.23, and whenever I create a session without LAN ticked, the session fails to create.

#
LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '15' k_EResultAccessDenied (access denied)' failed in 0.256152 seconds
#

This is the error that gets spat out.

#

Any ideas would be appreciated, Presence is on, I'm testing in standalone (works in viewport??).

supple basalt
#

k_EResultAccessDenied - Your game isn't set to allow lobbies, or your client does haven't rights to play the game.

red pollen
#

Okay, thanks for the response. How would I go about checking these two things?

#

"or your client does haven't rights to play the game.", I'm using AppID 480, Space War, if this helps.

supple basalt
#

Don't use that.. Just make your own project on the steamworks dev portal.

red pollen
#

I don't have to pay the $100 fee to use that?

supple basalt
#

Also, make sure the steam account you are using is a dev attached to that project.

#

Yes, you do. You are a professional developer, right :))?

red pollen
#

I'm a uni student wanting to learn hahahah right okay.

#

I'm almost certain people have got this working using the free id though

supple basalt
#

Well, we don't know how to circumvent that so we just paid it also (:

#

The 480 AppID is used by everyone so there may be some issues with it and also, you cannot actually config stuff regarding that project on that portal. I'm not sure it is recommended for serious development, if others have more experience with it..

red pollen
#

I hear what you're saying, I just figured that creating a session should be easier than this -.-, i just don't have $100 sadly xD

#

Yeah, maybe someone else knows about this stuff who can lend a hand. Thanks for your time dude ❤️

supple basalt
#

Well, the one thing I can tell you is that the code in their samples (like Shooter) works out of the box with everything discussed above configured correctly.

#

You're welcome :) I hope somebody else can give more details about 480 dev tradeoffs, I'm curious too.

ocean geyser
#

one thing ive noticed using 480 is i have to allow for a TON more search results for a valid result of a server of my game to be able to be found as it seems like its searching through all servers using the 480 app ID

#

yea
SessionSearch->MaxSearchResults = 8000;
did the trick

thin stratus
#

@ocean geyser Correct. It only filters it at the last second. When the tags don't match in the SteamSubsystem of UE4 when parsing a result it throws it away. But the raw query for results seems to be done only on the id itself. So you are getting other devs sessionresults until you get your own id

#

You should be able to use 480 though to host and search during the time of development. Just not for release. It also doesn't allow you to actively change all the settings on the dev page. So you will have to get the id eventually unless all you want to do is play around with ue4 and never really release the project. @red pollen @supple basalt

desert glacier
#

Hi, Can you help me to replicate my anim offset is the last problem of my online game, ideas?

severe widget
#

Replicate your state, in its entirety.

#

Then, base your animation off the state you've previously replicated

supple basalt
#

@ocean geyser @thin stratus Thanks a lot guys!

nocturne berry
#

hey guys, where is the best place to fetch the player state of a player before he disconnects?
I want to save its data so that if he reconnects his data is not lost

thin stratus
#

There is a place where PlayerStates turn inactive (in case you lost internet connection or so) and it gets reused if you reconnect.
That's meant for a short duration, so not for multiple hours of "they might come back".

#

If you need multiple hours of "save the data in case they come back", then I assume you could just do it when the PlayerState gets removed (EndPlay or so)

nocturne berry
#

@thin stratus no i actually need it for up to 30 mins tops (average game is 30 minutes so counting the worst case of disconnection)
how can you reuse a player state? as far as i know they get destroyed

thin stratus
#

GameMode should have a float value for how long a PlayerState persists.

#

Given you have a Subsystem with a UniqueID per player, the PlayerState will be taken from the InactivePlayerState array and will use OnCopyProperties/OnOverrideWith functions in the PlayerState to set things back up.

#

At least that's how I understand it. Never actively used/tested it.

nocturne berry
#

hmm, i'll have a look at it

plain lagoon
#

what kind of replication do overlap events do? I try to replicate a function through either multicast or run on server, but it only replicates properly when I use an overlap event instead of a custom event.

bitter oriole
#

I'm guessing they do not replicate at all

#

They just probably also happen on the client

plain lagoon
#

nah, when i print it shows that both the server and client print it

#

so there would need to be some replication, no?

#

or would client and server both separately act upon the begin overlap

#

I just want to delete an actor from the client, but I can only delete it from the server. DeleteActor just runs on the client and does nothing, even when I try to use all replication options

#

i feel like it might have to do with the fact that it's not the owning client

desert glacier
#

When I test my game on two PCs, the PCs can not find the sessions, but can only create one. That's the problem, but in the editor with two windows open it works well. Ideas ?. How make without use steam, an simple method

bitter oriole
#

@plain lagoon That both devices show the log doesn't mean it's replicated, just that it happens on both

#

UE runs the entire game on every client & server, so while some things happen only on server and are replicated, most of the engine just runs in parallel

#

Stuff like collision and overlap is typically not replicated and just happens to trigger simultaneously on every player because well, the same game is running

plain lagoon
#

cool, then i know that

#

i kept on looking and it's probably because the client i try to call "Run on server" on isn't the client owning the actor, since I have the actor in the level from the beginning

#

would you know any workaround to that?

bitter oriole
#

Well first think about whether the client shouldn't actually own it in the first place, do that if that's the case

plain lagoon
#

the thing is that that actor can be interacted with by both the serverClient and the other client, (using basic multiplayer)

bitter oriole
#

If not, you'll need to tunnel that event through the player controller or pawn, and then call the actual event from the server-side of either

plain lagoon
#

and an actor can't have two owners, right?

bitter oriole
#

Nope

plain lagoon
#

all right, i guess i'll have to do some hacky stuff to call it from the server client, thanks a bunch for the help

bitter oriole
#

Actors can however change ownership

#

But that only works if only one player can interact at the same time.

plain lagoon
#

what if I changed ownership upon interaction?

#

would that work?

bitter oriole
#

Yes, except you still can't do that from the client

#

But if the server can decide that autonomously, you're good

royal isle
#

Hello, is there a way to run some code on when a player crashes or shortly after?

desert glacier
#

How does it fail?

#

@royal isle

royal isle
#

yeah let me rephrase, what I want to do is run some cleanup code any time a player crashes from the server for any reason, this can include a network error or a fatal error in the client's game etc

red pollen
#

@thin stratus @ocean geyser thanks for the reply guys. I've heard about the search query thing before, and so have my search results at 9999, although I still can't seem to create a session. At the minute I'm just playing around and testing, without a serious product etc, so it would be cool if I could get this to work. Any more info on the error code would be much appreciated. Thanks

tribal shard
#

I'm having some issues updating a widget on all clients. I've previously used a text widget and updated it using setText and that worked just fine, but I cannot get it to work using a web browser widget with loadUrl. It seems to load on the host pawn (for all clients) only, but not for others. I'd appreciate any help.

thin stratus
#

@red pollen does the account you use have SpaceWars in its library?

red pollen
#

I'm not sure I'll have a look give me 5 minutes

thin stratus
#

Because that could be a reason

red pollen
#

Sorry for the late response. My steam account does not have Spacewars. How do I get it in my library?

#

Cancel that, I now have it

viscid bronze
#

How do I make the set visibility function to work in a multiplayer setting? Currently this only works on the server and can only be visible from the server

red pollen
#

Sadly, still the same error @thin stratus

#

@viscid bronze

#

You're gunnah wanna make a few custom events. I'd start with an event that runs on server and is reliable, and then another event that is multicast and reliable

#

Make the server event call the multicast event, and make the multicast event run the visibility.

#

And then have your input event call the server event.

#

Input [Sets Variables etc] --> Server --> Multicast [Sets Visibility]

#

Hope this helps

viscid bronze
#

@red pollen thx ill try

meager spade
#

i wouldn't use multicastr

#

not for a "state" change

#

replicated bool PlayerHidden set to RepNotify

#

and in the RepNotify handle SetVisibility

plain lagoon
#

Is there a way to make material parameter changes visible for a single player while the other still sees the old material?

viscid bronze
#

@meager spade alright hold on

meager spade
#

weapon should handle there own state

red pollen
#

Any chance you could help with my issue @meager spade , you seem to know what you're talking about way more than me xD

normal girder
#

@thin stratus Hello. after more than 1 years after read and share 10 times a day the document "UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf" i just realise that you are the autor of this 😄
well, thk a lot for this doc. Really !!

thin stratus
#

No biggie, glad it helps (:

viscid bronze
#

@meager spade you mean to put the repnotify in the weapon blueprint?
i kind of just put it in the character blueprint because it is a class based shooter so it doesnt really matter right?

normal girder
#

promis, 10 times a day on our discord :"i want do this, but on server it s ok, but not on client...."

  • have you read this : UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
  • No
  • so.. read it
#

😄

meager spade
#

i mean, sure, i would have kept my weapons encapsulated though

#

regardless

#

weapons handle reload/hiding/showing/etc

#

rather than the pawn

thin stratus
#

@normal girder Good, that's why I wrote it :D

normal girder
#

👍

meager spade
#

never read it..

#

i will take a look, i mean i know the replication system and stuff now, but it would be interesting to take a peek, might do that later tbh

viscid bronze
#

@meager spade thanks, your method worked

red pollen
#

Hey, I've run into a problem and I just can't figure it out. I have restarted all my assets from scratch, still the same problem arises, wondering if anybody in here has a clue what the problem is...
I'm using the Advanced Sessions Plugin on 4.23, and whenever I create a session without LAN ticked, the session fails to create.

LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '15' k_EResultAccessDenied (access denied)' failed in 0.256152 seconds

This is the error that gets spat out.
Any ideas would be appreciated, Presence is on, I'm testing in standalone (works in viewport??).
Rebump cause issue is still a thing and people can't see it D:

astral fossil
#

@winged badger no :0 just repNotify on blueprint

nimble basin
#

Is it possible to spawn actors into streaming levels and have them replicate properly?

nimble basin
#

seems I can only spawn into persistent level?? I've also seen gumblings about actors in sublevels not repping correctly. Anyone know where i can look for a little more info on the topic. google didn't help. Trying to get spawns in sublevels working and replicating properly.

worthy perch
#

If you have a weapon that shoots projectiles, do you want the "weapon fire" animation to play immediately?
If you play it immediately (on the client), it's pretty weird with the delay from the spawned projectile actually replicating down ~100ms later.
I think I'm leaning towards the delay. So that code between simulated and owning clients are the same. 🤷
The proper way is probably with saved moves.

meager spade
#

dummy on client, client sees a fake projectile

#

server spawns real projectile

#

hidden from client

#

shrug@

nimble basin
#

Found answer with a search ... spawn with owner already in level to spawn into level or do manual move to sublevel in c++

supple basalt
#

@worthy perch you should client-side predict everything or it will look bad. If your animation for firing is long enough and the latency is decent, maybe you can get server confirmation to arrive in time for spawning the projectile (you tell the server in advance you began the animation).

#

If the lag is too much, just predict it and reconcile if needed.. still better than not firing for some time. If you predict movement, the player won't understand why movement is ok but not the shooting stuff.

woeful ferry
#

Hi!

I have a electricity system where you connect pylons. It all works fine and all and it spawns from client to server, but not server to client because the actor itself is not replicated.

#

However when I check the replicate box, it crashes upon spawning the actor.

winged badger
#

that is not enough information

#

i am guessing c++ since its hard to do that in BP

woeful ferry
#

No, it's all in BP.

#

And no it's not a spaghetti. 50 nodes across 3 BPs with parent/childs

#

This is what the system is, so the spawn of the cable component is what crashes the game if I check the replicate box.

meager spade
#

what is the cable component

#

a scene component?

royal isle
#

hi, how can I change my dedicated server's port? And will unreal auto increment ports if I run more than 1 instance of the server on the same machine?

woeful ferry
#

Fixed it

#

🙂

red pollen
#

Can't believe I'm still having trouble after all this time

#

I must be doing something wrong

red pollen
#

Is anybody able to help out?

#

Really can not carry on testing my game without fixing this

ivory portal
#

I am currently trying to receive logging from a linuxserver shipping build but -log or -log LOG=/... does not work :S anyone any idea

bitter oriole
#

No logs in shipping builds

ivory portal
#

but how does UnrealTournament do it?

#

They als orelease shipping build servers with logging

bitter oriole
#

They modified the engine config to build with logs

ivory portal
#

does that also mean I always need to do dev builds for a bit of logging?

bitter oriole
#

Generally yes

ivory portal
#

also, when I did dev builds with -log LOG=location it didn't work, it always kept logging in the default log folder

bitter oriole
#

Don't know about that, sorry.

ivory portal
#

UEBuildConfiguration.bUseLoggingInShipping = true;

#

apparently

bitter oriole
#

bUseLoggingInShipping in your project.Target.cs file

indigo brook
#

Quick question, if I joined a match and want to leave, which bp node do I use to leave the match? Or do I simply just OpenLevel to main menu/lobby?

#

Reading up, it seems that if a player leaves, the game mode will notice a playercontrol leaving so essentially just OpenLevel my way outta there?

lost inlet
#

logging does have a potential performance impact so that's why it's disabled in shipping

#

by default

#

depending on how verbose the output is, flushing the log to disk can hitch

#

you can also build a test client and connect to the shipping server as long as they have network compatibility

fleet raven
#

when you run a packaged build with -log on windows (so you get the console window) then every single log message blocks the main thread for 0.5-1ms

indigo brook
#

Are you guys responding to my question or something else? haha

crude sparrow
#

Quick question, is it ok if launch dedicated servers on linux without "?listen" on 4.23 because I have a lot of errors like this one "LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver" and some people says it is related but I can't manage to see the difference

lost inlet
#

up to 1ms is pretty significant, didn't realise it was that bad

fleet raven
#

this function takes 2ms without -log

#

it writes only 14 lines

half jewel
#

is that the new profiler ?

#

is that not in 4.23?

fleet raven
#

this is 4.24 preview but insights is in 4.23 too

bitter oriole
#

Beware this might be 1ms on another thread

#

I'd be surprised if a log was 1ms blocking

cosmic yoke
#

hello, what is the cleanest way to respawn a player in a multiplayer game? as in destroy the current player and respawn a new one and repossess

#

I'm trying to use AGameModeBase::RestartPlayer but that seems to try to use the existing player and reset it

bitter oriole
#

You can't really destroy the player

#

Usually you want to destroy and respawn the pawn

cosmic yoke
#

yes i meant the pawn

red pollen
#

Why are you trying to repossess a player? You're going to lose all of their data.

#

Such as score etc

cosmic yoke
#

he's suppose to lose everything

bitter oriole
#

Destroy pawn, do restartplayer, or just create a new pawn and possess it

red pollen
#

Can't you just

#

Do it the normal way

#

And then reset the variables?

bitter oriole
#

He's asking that

red pollen
#

He's asking what the normal way is?

bitter oriole
#

Yes

red pollen
#

Oh, my bad o.O

bitter oriole
#

How to respawn the player pawn

cosmic yoke
#

the player state is associated with the player controller

#

so destroying the pawn wont lose the score

bitter oriole
#

You can't destroy the controller or player state, just the pawn.

#

Reset variables if you need that

cosmic yoke
#

so i just need to do Destroy() on the pawn (in the server) and then call GetWorld()->GetAuthGameMode()->RestartPlayer(GetController()); ?

bitter oriole
#

And if that doesn't work, just create a new pawn and possess it

cosmic yoke
#

the way i'm doing right now is doing: PlayerController->ChangeState(NAME_Inactive); PlayerController->ServerRestartPlayer(); Destroy();

#

and it works, except that the attached actors (weapon) dont get destroyed, so i think i need to delete them manually with GetAttachedActors and call Destroy on them

#

is there a way to delete the attached actors automatically?

red pollen
#

You have a health variable?

#

On Repnotify?

cosmic yoke
#

i have a health variable but its not on rep notify

red pollen
#

Okay so start there

#

Make it repnotify

#

And then when it drops to say, 0?

#

<=0

#

Destroy child actors, destroy whatever you want, cast to controller etc

cosmic yoke
#

but i dont need to do it on the clients

#

so the repnotify wont do much

#

i just need to do it on the server

red pollen
#

You need to remove actors on server and not client?

cosmic yoke
#

no

red pollen
#

I need more context here

cosmic yoke
#

since the actors are being replicated, if you issue a Destroy() on the server they are automatically destroyed on the client

#

so i dont need to use repnotify to manually delete them on the clients

red pollen
#

You can Run On Owning Client

cosmic yoke
#

i was asking if there was a way that the Destroy() automatically destroys attached actors, but from what i just read he just dettaches them

#

so i think i always need to manually delete them

red pollen
#

I'm gunnah back out and let someone help you out cause I'm confused mate

#

Sorry

cosmic yoke
#

no prob, thanks anyway 🙂

meager spade
#

the correct way of handling it is to make sure you cleanup anything that pawn had

#

the engine doesn't keep tract of that

#

track*

#

when my "pawn" dies, he sends a delegate out, which things like inventory manager, etc (on playerstate) listen for, and cleans up everything, this includes the current weapon he has

cosmic yoke
#

@meager spade i believe the pawn has a OnDestroyed delegate that you can bind your actors and stuff

#

that might come from actor

#

so you dont need to create one

meager spade
#

mines called before the pawn is destroyed

ocean geyser
#

question, how would you guys setup shooting in multiplayer when it comes down to effects and such? i was planning on this:
when the client shoots, the sounds/effects and such are played instantly on his client so there is no delay. during this i would cast a line trace and send the hit result to the server, the server would check and see if this shot is even valid (meaning the client didnt try to cheat and shoot through a building for example by sending a line trace from the clients weapon to the location of the hit point on the hit result and see if anything is blocking it). then the server would multicast an event by playing effects on the weapon such as muzzle flash, and an effect on the hit point such as a bullet impact.
does this seem good? also is there a way i can prevent the multicast event (this would be running on the weapon, i set the weapons owner to the clients character when its picked up) from running on the client that picked up the weapon so he only has the instant effects that run on the client?

twin juniper
#

hi i need help i want to create a dedicated server on unreal engine 4.23 but i don't know how

foggy idol
#

Please I need help

#

So my clients won't update untill I move to another window or minimise then reopen the game window

#

And this makes debugging especially hard

#

I'm using 4.23

peak star
#

@foggy idol what kind of computer are you developing on?

foggy idol
#

A laptop

#

And I'm also beginning to suspect it's hardware limitations

#

And that my PC just can't safely do everything at once

nimble basin
#

Since repNotifies aren't ordered, is it ok to have them wait on a variable if you need them to run ordered after some other functionality finishes? i notice the repNotifies on late joins are firing before setup from begin play finishes that needs to happen first. Is this a NoNo for any reason to wait in the repNotify? If so, how to wait properly in late joins

nimble basin
#

posting questions on here is like talking to a wall so far for me.. I guess i'll just use this forum for the search feature only.

winged badger
#

they are ordered

#

they happen in order of DOREPLIFETIMEs in GetLifetimeReplicatedProps

#

and when Actor replicates, the client receives a single bunch, that is pretty much "Spawn Actor of this type on this FTransform and assign it this NetGUID. Also, here are all its replicated variables."

#

client then spawns an Actor, sets the replicated variables, then calls the replication callbacks, then PostNetInit, then BeginPlay

#

@nimble basin

nimble basin
#

@winged badger I see. Thanks for the info. Very helpful to know the ordering. On the blueprint side is there a proper way to wait on functionality to finish from begin play then in reNotifies, or is it the case that I just shouldn't be doing it that way to begin with? Maybe I should move that functionality into it's own repNotifies. If that's the case, how then can I know which repNotify will happen first? I don't think all this functionality should go in a single repNotify..

winged badger
#

in BP the only way to get the BeginPlay to behave the same on server and client

#

is to ExposeOnSpawn all replicated variables you set right after spawning the Actor

#

and i have no idea how BP registers its RepLayout, i avoid doing networking in blueprints

#

it would be either the order in which variables are listed, or added, i imagine

nimble basin
#

OK, maybe I can run some tests to find out how it orders them.

#

Wanting to make sure I understand this bit: " ExposeOnSpawn all replicated variables you set right after spawning the Actor"

winged badger
#

the alternative is to wrap the related variables into a struct

#

then replicate it

#

as the struct will replicate whenever any of its UPROPERTYs are changed

nimble basin
#

do you mean i make the vars instance editable and expose on spawn, and just replicate the vars right after spawn so the repNotifies fire?

winged badger
#

i mean, if you spawn actor

#

then set a couple of variables

#

those variables get set after BeginPlay on server

#

but before BeginPlay on client

#

unless they are set via ExposeOnSpawn, then they are available before BeginPlay on both server and client

#

simplifies network construction somewhat

#

as you don't have to branch BeginPlay depending on if you're on server or client

nimble basin
#

Hmm ok makes sense. So is there a reason I need to put them in struct? I mean, would the firing before begin play on both client and server be the case whether i'm setting individual variables or have them all combined in a struct? I suppose the only diff with not using the struct is I won't know the ordering of the individual variables repNotifies unless I test with that to find out?

winged badger
#

if you want a repnotify to always fire after either or both of say 2 variables are replicated

#

in blueprint

#

best to wrap them in a struct and repnotify the struct

#

as you are then sure that you have updated values for both of them available

#

when onrep gets called

nimble basin
#

Ah, I get it now. Need the struct to ensure ordering since any one of the variables could change out of order .. which could cause issues with late joins.

#

but seems like it's then replicating too much? I guess the price to pay to ensure ordering with BP.. and only struct the ones that need to have ordering.

winged badger
#

yeah, struct wrapper only for groups of variables that all have to be up to date prior to onrep being called

meager spade
#

doesnt the order of the DOREP also adjust what gets replicated first?

#

oh BP, yeah you can't do that

fleet raven
#

wrapping in a struct does not guarantee atomic updates

#

updates to properties inside it can still arrive in the wrong order or out of sync

winged badger
#

if they are set on the same tick on server, they should all arrive before the replication callback

fleet raven
#

it isn't guaranteed they will

#

your client can temporarily have a state that never existed on the server

#

(inside the struct)

winged badger
#

that sounds awfully inefficient, and also means NetSerialize would have to be called more then once and results sent in separate packets

#

and its one packet per Actor update

fleet raven
#

I think replayout just flattens structs unless they have a custom serializer

winged badger
#

that would do it

fleet raven
#

but with a custom serializer you would always be sending the entire struct, losing the ability to send only a delta of changed properties

winged badger
#

for his BP only situation, custom serializer is not an option

nimble basin
#

Hmm, too bad I can't i change the order of the DOREP in BP? That sounds like the best way..

winged badger
#

for construction it won't matter, as you can just handle it all inside BeginPlay

nimble basin
#

So I take it that I must expose on spawn if i care about the ordering before beginlay being consistent for vars on client/server. I wrap any variables in a struct that must be ordered before the dorep. If I also want that struct to be ordered consitently for beginplay client/server i expose on spawn the struct

#

will try what i was doing again with this. pls let me know if any of that isn't going to work.

winged badger
#

for ExposeOnSpawn doesn't really matter if you have structs or not

nimble basin
#

right.. unless i also care about ordering for beginplay.

winged badger
#

its just a way of setting variables server-side before BeginPlay is called

nimble basin
#

ok makes sense. Thanks for the help!

modern swift
#

hi call when I tried to spawn an actor on server by blueprint, there are no actor spawn on client

#

do I need to add a customer event for multicast?

worthy perch
#

Is the Actor replicated? That's pretty much all you need.

modern swift
#

I dont understand why when I use switch has authority , the actor can not find in the scene even in server, when I not using it the actor can find in server

#

above node are in open level blueprint

#

ok , I know now I need to tick always relevant

void orbit
#

Quick question. Trying to do something like a class limit for multiplayer

#

I figured I'd have the limit in the GameMode, which works, but I cannot change it on each level

#

How can I do that in a way that's quickly exposed to a level designer? I can only think of having the Level Blueprint cast to the gamemode to set the limit, which sounds dirty and fairly hacky.

ruby rock
#

Not sure this is the correct forum to ask - but I'll give it a shot. Seems like a problem solved by people working on multiplayer systems

For the game I'm developing we'd like to have a list of items that changes periodically. We'll keep this in a DB, but want to be able to ship that information to clients (perhaps on start up or similar). Or perhaps even using the UI to search for items stored remotely.

We can use something like REST or GRPC for this - as a transport.

Are there patterns around to do this (eg integrating with data assets in BP, or a more standard C++ distributed object approach?).

winged badger
#

@void orbit the other way around is not

rose egret
#

@ruby rock we are doing it by JSON, UStruct and UAssetData.
a UStruct is defined to keep the properties we need. then they are placed in a Assetdata so that developer can create and edit the properties in editor.
whenever he wants he press the save button and all the configs are stored as JSON in master server.
when game client is launched we receive all those config and override it on the asset data we have.

winged badger
#

derive from ALevelScriptActor, put your settings there, reparent your level BP to it, and have GameMode access it

#

actors loaded from the package will all be available before GameMode is even spawned, so you don't have a problem with order of initialization
having said that, custom WorldSettings class is easier to handle from the editor

ruby rock
#

@rose egret - thanks, and you use REST or something similar to read/write the data from the server?

rose egret
#

@ruby rock I am using my own JSON RPC plugin over Websocket. cause we have our own back end for login, friendship, inventory , ...

ruby rock
#

@rose egret - nice one

viscid bronze
#

How do I make an explosion sort of damage replicate properly in multiplayer? I already have set up a raycast, and I want the explosion to spawn where the raycast hits something.

#

My fire function is
Input > Executes on Server > Replicated to Owning Client > (raycast)

thin stratus
#

Input, ExecuteOnServer, RayCast, OnHit, Multicast, SpawnExplosionFX

#

You can then add client prediction if you want

#

Which would be in addition to what I wrote

#

Input, RayCast, OnHit, SpawnExplosionFX
And then filtering the owning/local client in the Multicast so it doesn't spawn the explosion twice

#

And maybe add a IsServer check to not cause this to happen twice on the server

winged badger
#

alternative being spawning an actor that goes bang in BeginPlay

thin stratus
#

Yeah, will have inputlag though

winged badger
#

it has less options for prediction tho

thin stratus
#

Yus

viscid bronze
#

okay. i will try that
2 questions though,
Is LineTraceByChannel the RayCast you mentioned and can I just feed the Impact Point from Break Hit Result directly into Origin of Radial Dmg

winged badger
#

yes

viscid bronze
#

ok. i will be rewriting some code. thx

#

Although the VFX seem to show up in the right place, the print string seems to always report false even if I'm hitting the other player directly.

#

Is there a way to fix?

ornate crescent
#

Hi, if possible use the ReplicateUsing inside a struct? in a property?

ebon nimbus
#

Anyone here ever have issues with FP Camera line trace not lining up between client and server?

ornate crescent
#

Hi, i working in a inventory system for multiplayer game. We are working with Struct for items, each item have their Textured2D for the Item icon and Mesh for weapon/armor items.
We want to each client load the Texture2D and Mesh when the item is replicated. What is the best approach?

#

One system is use a ReplicatedUsing in the TArray<FInventoryItem> Inventory; and call a function where the client load the Texture2D and the Mesh. But we have the question about is this is the best approach? because we can have 30 items in the inventory and when the new item is added in the inventory, the client try to load the texture2d and mesh again?

zealous saffron
#

@ornate crescent you cannot use replication declarations on your struct items.

#

You can replicate an instance of your struct however.

#

Make sure they're UProperty() so they can replicate.

ornate crescent
#

i make a test and see struct cannot replicated members inside the struct

zealous saffron
#

Doing so will replicate the struct's values

ornate crescent
#

yeah but the another question is about Mesh and Icon, if i add UProperty() inside the UStruct members (for the Texture2D and Mesh) this are replicated too? maybe is to heavy for replication. For improve the replication i want to replicate the item and with the Item ID, the client read the ID and load the texture2d and Mesh

winged badger
#

assets replicate by full path the first time, after which they are assigned a NetGUID

#

a FName would be cheaper for replication, identifying a DataTable row from which the client can load the item-related assets and other static data

#

at least for initial replication, later on it kinda depends on the amount of static data

ornate crescent
#

aha, ok @winged badger so... if i have in the struct the Texture2D and Mesh inside the Struct with UProperty maybe this not have a lot of problem for replicate? for the bandtwich?

winged badger
#

they can be tagged NonReplicated

#

but no, later on its 4 bytes, only initial bunch will be larger

ornate crescent
#

them,


    UPROPERTY(EditAnywhere, BlueprintReadOnly, NotReplicated, Category = Item)
    USkeletalMesh* Mesh;

    UPROPERTY(EditAnywhere, BlueprintReadOnly, NotReplicated, Category = Item)
    UTexture2D* Icon;

And add in the Inventory replication (n the client side) read the Database and load the mesh and texture

#

thanks @winged badger

winged badger
#

the very cheapest way is have a DataTable or other static data container that can be identified with a byte or an integer

#

replicate the ID, convert to FName, grab the DataTable pointer from a GameSingleton, grab the row with the resulting FName, load the assets

ornate crescent
#

yeah, and only replicated yeah, thanks @winged badger

#

thats is the best approch, thanks

winged badger
#

with structs you won't have the option to set the DT asset in blueprint

ornate crescent
#

another question is if u know what is the best way to create/clone new Inventory Item (struct) from the DataTable

winged badger
#

so GameSingleton is my preferred way

#

you'll typically want a FTableRowBase derived struct for a DataTable

#

and another you actually use when the game is running representing the item, not item data

ornate crescent
#

i have this

            FPZItemDatabase* ItemInDB = ItemDB->FindRow<FPZItemDatabase>(Id, "");
            if (ItemInDB && ItemInDB->Item)

but the problem is this is a pointer, if i want to change only a Hitpoints for 1 specify item, this change the others hitpoints of the same struct

winged badger
#

with a constructor taking the DTRow struct

#

and probably == operators for those 2 types + some helper functions

#

yeah, you'd have something like

ornate crescent
#

yeah but with this i have a pointer for a struct, i need to create another new struct from this struct

winged badger
#
    FPZItemDatabase* ItemInDB = ItemDB->FindRow<FPZItemDatabase>(Id, "");
    if (ItemInDB && ItemInDB->Item)
    {
        MyItemContainer.Add(FPZItem(*ItemInDB));
    }
ornate crescent
#

because is new item and maybe have change like Hitpoints

#

with this create a new struct with the info of the item?

winged badger
#

you create one struct to hold data

#

one struct to use during runtime

#

and you make a constructor for "runtime" item struct that takes a data struct

#

basically copies what it needs to, loads what it needs to, initializes properly

ornate crescent
#

yeah, amazing, thanks @winged badger

ornate crescent
#

`sorry @winged badger another question, i try to create a DataTable with this structure

    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    int32 ItemId;

    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    FTestItem Item;

and i have other 3 DatTable, each per each ItemType

FTestItem
FWeaponTestItem
FArmorTestItem

You know how i can reference in the ItemDatabase the reference of differents items?

#

I want in the DataTable, in the ItemDB this structure

    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    int32 ItemId;

    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    FTestItem Item;

With the Item is a reference of another Struct, maybe weapon, armor or another derived struct of a FTestItem

winged badger
#

the DT rowname is its ID

#

you can transform it for replication

#

but the DT row struct doesn't have to know it

ornate crescent
#

i have workaround, in the Singleton i can see the base Type and depends the Type see in different DataTable, but i want a DataTable with containt alls Ids and references of differentes struct

#

to have all items in one DataTable, and 1 DT per ItemType but maybe is not possible?

winged badger
#

you can have separate datatables for items, weapons and armor

#

or you can have one for items with optional FDataTableRowHandle field

#

that can point to additional information for weapons/armor

#

and you can write helper functions in singleton, or w/e you end up holding the DT poitners

#

to grab what you need in simple manner

#

kidna depends mostly on whoever is going to work with that data is most comfortable with

ornate crescent
#

maybe i try with the FDataTableRowHandle field for a one Item Database DT and create another DT for Weapon and another for Armor. And reference in the Item Database DT the item with the ID

#

to have in one database all items

#

thanks!

granite jolt
#

let me my blur correcting glasses on for that screenie :p

quiet wyvern
#

im trying to run Server.exe

#

and i have some commandline stuff i want to pass

#

like Players=10 GameMode=2

#

no matter what i try it runs it with MenuMap?Player=Name?Players=10...

#

whats the proper way to accept commandline arguments into MenuMap with Server.exe

quiet wyvern
#

Ahh i was trying to use GetConsoleLine

#

those params are accessed from gamemode options

outer radish
#

Hi all strange issue. I have a repnotify variable which does fire and change server side, but client side variable does not change, sometimes. When I open the project, it doesn't work. Randomly as I am attempting to debug why, it starts working and stays working until I restart the project. I can set the variable using multicast but I'd really like to know why it's not replicating to clients in the first place. The variable is a struct consisting of uobject variables

#

example: before making my last message it was NOT replicating, now I tried again, changing absolutely nothing, and it worked

#

just restarted proejct - not replicating anymore

outer radish
#

Figured out what's 'triggering' the successful replication, but it's very very strange. I have to save the map by either moving an object around or doing anything at all really, I just need to save the map. Then replication works.

I thought this was compiling the item or something, so I went an manually compiled the item, but that didn't make replication work, I had to still save the map. Here's a video: Hopefully someone can give some insight into this weird issue: https://www.youtube.com/watch?v=VQTUWhrJRAo&feature=youtu.be

royal isle
#

Hey, looking through the IPNetDriver class I found this cvar IpNetDriverUseReceiveThread, this states that If true, the IpNetDriver will call the socket's RecvFrom function on a separate thread (not the game thread) . Can someone give me an example of when this should be useful?

twin juniper
#

Hi, any way to print in the game the in/out bandwitch and the Ping related to the server?
Without use net stat command console

scarlet cypress
#

Hello people ✌🏻 i need some help with replicating data in my multiplayer game... if anyone has some time for a discord call real quick, please hit me up! Thanks a lot!

red pollen
#

@thin stratus

#

Been reading your compendium, very very helpful, thank you

#

I've run into an issue with the CopyProperties event on my player state

#

I'm using the event, but the cast to my new player state blueprint fails, meaning the values aren't transferred, any reason why?

#

Does it have anything to do with my gamemode changing between a menu gamemode and an actual in-game gamemode?

winged badger
#

new PlayerState will be of type set in the new GameMode

red pollen
#

Huh?

winged badger
#

GameMode has all those class variables

#

when you hit class defaults in BP

#

one of them is for PlayerState

red pollen
#

Yup

#

That's all set up correctly

#

I think I know what's going on two seconds

winged badger
#

menu has its own PS with no CopyProperties override?

red pollen
#

Well, my menu does have its own ps, but it definitely does have the override

#

I thought it may have been because my transition map didn't have a ps, but that's not it either.

winged badger
#

back to your original question: swapping GameModes isn't a reason to CopyProperties to fail in itself

red pollen
#

Oh, good.

winged badger
#

unless the PS class is set wrong

red pollen
#

The PS classes are 100% set correctly, I've tested with print strings

winged badger
#

i do have menu/lobby/game GM/PS separately and CopyProperties works just fine

red pollen
#

Haha I got it, never mind

#

I recently deleted my main menu gamemode and re-made it, and I forgot to enable seamless travel.

#

No hate please I suck I know xD cheers @winged badger

thin stratus
#

May I notice: MainMenu in a Multiplayer Scenario shouldn't perform SeamlessTravel

#

The whole SeamlessTravel and "PersistData" shizzle is meant for an ongoing session where everyone is playing together and you move between maps.

#

E.g. Counter Strike or UT switching levels.

#

Or Borderlands moving to a new zone.

#

The Host and Connection process (openLevel mapName?listen) etc. should technically be hard travels.
If you need to persist data between that you should do that via savegames and similar.

#

@red pollen

red pollen
#

Right... I do have a lobby system if that changes anything

#

Where everybody is loaded into the session before being sent to travel to the actual game map

thin stratus
#

Just picture it as that: As soon as the Server hosts and is on the level that players connect to, you can start seamless traveling.

#

Doesn't matter if it's a lobby or directly the map to play on. Connecting to the Server and the Server hosting should both be hardtravels as far as Epic's docs go

red pollen
#

Yeah yeah, that's all good. I might have done it in a bit of a weird way but I'm sure I've done it right 😄 I'll let you know if I hit any more humps. Your compendium is so sick btw 😄

quiet wyvern
#

im running into issue where listen server works from within game on steam but as soon as i run a dedicated server i cant find the game anymore using steam.

#

LogOnlineSession: Warning: STEAM: Server setting ,GameMode_s:Free For All overflows Steam SetGameTags call

#

i have that in log

quiet wyvern
#

Ok so it seems the reason i cant see it cause its a incompatible build id

gray scroll
#

im spawning a weapon on server and passing in Self (character) as the owner to it... in my master weapon... im checking to see if get owner is locally controlled... it comes as false for clients but true for server

#

any idea why that would be?

thin stratus
#

In which function are you spawning the Weapon and in Which are you checking the owner?

gray scroll
#

spawning inside character

ocean geyser
#

@gray scroll i had a similar issue, i ended up setting the owner of the weapon on both client and server

gray scroll
#

and checking owner inside master weapon

ocean geyser
#

even when set on the server, the client didnt know who the owner was, im assuming its not replicated

thin stratus
#

@gray scroll I asked in which functions. Be more precise.

gray scroll
#

the begin play is inside master weapon

thin stratus
#

And WeaponSpawn is called from where?

#

I'm asking cause I lot of people assume a Pawn/Character is already properly setup on BeginPlay.

#

While BeginPlay is usually too early cause the Pawn/Character isn't possessed at that point.

narrow prairie
#

the input node owner

#

can u drag wire from there

#

and get controller

#

ur passing pawn reference

#

not player controller

thin stratus
#

That shouldn't matter

#

Also IsLocallyControlled will return false on all other clients anyway.

narrow prairie
#

oh damn, i didnt read properly

#

srry

#

@thin stratus u are epic staff?

thin stratus
#

Does it anywhere say I am?

narrow prairie
#

just curios 🙂 take it as a no

thin stratus
#

No I'm asking in case something is misleading

narrow prairie
#

seems i found the ue4 wizard

thin stratus
#

But no, I'm not working for Epic Games.

gray scroll
#

@thin stratus its spawned on possession

#

Not begin play

thin stratus
#

In that case, not fully related to the issue but, you don't need the event to be an RPC, right?

gray scroll
#

I need the weapons to spawn on server

thin stratus
#

OnPossess in the Character already only calls on the Server

gray scroll
#

Ah

rough anchor
#

is it possible to run a peer to peer network in unreal and can someone point me in the right direction?

ocean geyser
#

anything is possible, but im not sure of the difficulty in this case. but is there a reason you dont want to use the client server setup?

rough anchor
#

I get paid late december and im brassic rn

ocean geyser
#

brassic?

#

oh derp googled it

rough anchor
#

sorry aha, slang term for in debt/skint

ocean geyser
#

you can still have the client host the server, you dont need dedicated servers setup

rough anchor
#

That'd work, where can I find documentation?

ocean geyser
#

youtube and google what all your trying to do, most multiplayer tutorials generally go this route. for example if you launch a third person example project on one pc and then on another pc in the console type "open IPAddressHere" it should connect to the first pc and the 2 can play together

#

you can do the same via steam and such as well but that gets more complicated than simply having a text box where you enter in the IP address to connect to but its enough for testing until your ready to move to something more complex

rough anchor
#

Thank you!

plain flume
#

Any idea why network dormancy doesn't work in blueprint project? I have a single actor which has a replicated variable that server changes. It does not matter what the dormancy setting is, the variable is always replicated to clients. I tried to set dormancy to Dormant All, but values are still replicating.

knotty badger
#

I'm using the third person template and everything is really jittery on the client, especially moving

river estuary
#

Nott entirely sure it fits here - but what's a simulated client? can't find a clear doc from googling

gray scroll
#

is there any way to set current game mode via bps?

#

instead of doing it on the world outliner

#

that way i can have multiple child game modes and set them depending on game mode selected

lost inlet
#

you can specify the ?Game= parameter with the full path to the class (you can create aliases in an ini file later)

gray scroll
#

like this? listen?Game=/Game/Blueprints/Game/GM.GM_C @lost inlet

lost inlet
#

I think so but I've only dealt with native gamemode classes

hollow arrow
#

How can I get my local IP address in-game? (Like 192.168.xx.xx)

desert glacier
#

Can be by the node get my index ID? 🤔

desert glacier
#

With the node get controller ID ou le get controller from ID

mighty rover
#

this is a bit more of a general question, but I'm having trouble with timing of my animations and syncing up over the network, in a dedicated server environment. I have a throw animation that triggers an animnotify which calls an event dispatcher within my anim_bp. I bind to that dispatcher from within my Pawn and trigger the throw code. If you are throwing, your client sees it perfectly every time, however, sometimes, the opponent client sees the object thrown before the animation plays.
Are there any gotcha's anyones run into in a similar situation?

NOTE The animation is based on a replicated "state" enum in PlayerState

mighty rover
#

Fixed it. Added a Force Net Update on my PlayerState where the server sets the "state" enum

viscid bronze
#

How can I check whether an actor (like a Weapon) is attached to another actor (Character Blueprint)

serene cloud
#

i have a small problem im new to replicating

plain flume
#

Any help for my dormancy problem? Does the dormancy setting work for you guys?

meager spade
#

@viscid bronze by check its parent

#

checking

#

well the root components parent

viscid bronze
#

@meager spade yeah I just used a check parent socket
because sometimes the gun would float in the air

fleet viper
#

Hey there ive got an really annoying bug in my customization system. Ive got a datatable which stores the skin and the materials per faction/row. I load them via a custom function and voila based on the selected faction it will return the mesh and the materials which i then plug into my cpp function. This cpp function changes two variables replicated with OnRep. The OnRep function then sets the mesh and the materials to my char. Somehow this doesnt work? Any ideas? (btw will provide screenshots etc. if you need them)

bitter oriole
#

Bit of a weird question

#

You never need to do that in UE4 unless you're working with an external service

#

So maybe some context ?

meager spade
#

is there a reason you want to make your own server?

bitter oriole
#

@uncut oracle There is no such thing really

#

Every single UE4 class implements its own serialization or deserialization

winged badger
#

there is this void UActorChannel::ProcessBunch( FInBunch & Bunch ) i don't think touching that is the way to go though

red pollen
#

Another day another bug. Is there any reason why this wouldn't run on every client that joins the game? It's in the GameMode asset.

#

(Sorry for butting in I think someone will have the solution fast)

winged badger
#

you can (de)serialize that just fine (and anything else) without touching the unreal's network infrastructure

red pollen
#

This is so frustrating, nothing I am trying is working. For some reason, when I enter the game, only the listen server spawns, not the other players.

#

I've tried having it all set up in the gamemode, that doesn't work. I've tried having it hosted in the player controller, doesn't work

bitter oriole
#

@uncut oracle No single class does it. Every type implements its own.

#

You know you'll have to write hundreds of thousands of lines of code, right? The entire UE4 framework needs to be replicated

#

UE4 multiplayer clients expect the entire game framework to run on the server

#

You'll need all of Actor, GameMode, PlayerController, Pawn etc at a minimum

twin juniper
#

@hollow arrow Getting "a local IP address" is a difficult question. E.g. my dev workstation has 4 local ip addresses. You can use ISocketSubsystem::GetAddressInfo to retrieve the addresses, but then it's up to you to choose which one is the "right" one, which is rather difficult in practice. One option is to ask a server. What are you trying to do?

bitter oriole
#

No

#

There isn't even one stream of data AFAIK

#

And there isn't a single reader or writer

#

It's literally all over the code

#

Even if you did, you would still need to reproduce the behaviour of the entire UE4 gameplay framework on your server to get a client to connect

#

If you're doing this, drop UE4 multiplayer features entirely and implement your own protocol

#

It's going to be orders of magnitude easier

#

I don't see a question there

#

... Yes ?

#

Does that change any of what I wrote earlier ?

twin juniper
#

@uncut oracle I've done something like what you're talking about before. we did it by ignoring UE4's networking totally.

#

you make your own protocall and bind it to the uobjects via whatever system fits, and the game assumes its in singleplayer

#

its totally not simple

bitter oriole
#

This is absolutely the way to go, yes

winged badger
#

and what he needs is a custom struct with a custom NetSerialize function

#

which is significantly simpler then writing an entire network infrastructure

twin juniper
#

but that is totaly dependant on the protocall

#

protobuf or captn proto are good places to start

#

messing with UE4's networking stack is pointless if you are not using their server

#

there are way too many assumption

bitter oriole
#

^

#

Either use the built-in server system, or ignore all of the replication/RPC/multiplayer stuff entirely

#

It's quite easy to do your own communication system, get updates from a server, read them and apply them to your objects

twin juniper
#

compared to hacking and changing UE4 yes, but I would not call it easy

bitter oriole
#

That's not how this works.

twin juniper
#

out of interest what are you trying to achieve? @uncut oracle

bitter oriole
#

You cannot implement a game server that is compatible with UE4 clients, and uses the built-in networking, without effectively rewriting all of UE4

#

Or at least an immense part of it

#

I'll stop answering this since there is no point repeating

winged badger
#

you put all your data inside a struct

#

you implement NetSerialize that can serialize that into array of bits and deserialize from that same array

#

and thats all you need

random birch
#

I can't seem to get the RelativeLocation of the mesh of a character to replicate on other clients.
I'm doing and RPC multicast with RepNotify on the variable, the function from that changes 3 things, and RelativeLocation is the only one that doesn't get sent to other clients (But it works on the server). Component Replicates is enabled on the mesh and capsule. Any help would be appreciated
https://media.discordapp.net/attachments/608637922115321868/651080850057854980/unknown.png?width=788&height=904
https://media.discordapp.net/attachments/608637922115321868/651085014683090973/unknown.png

#

The initial event is called from the Controller and everything is executed on the parent class of my characters (Avatar)

red pollen
#

Can someone point me in the right direction to a decent way handle player spawning when they first enter the map?

#

Because I'm seeing so many youtube tutorials just do it wrong, like trying to get the gamemode client side and shit like that

winged badger
#

override HandleStartingNewPlayer

#

if you want default functionality (RestartPlayer call), call parent when you override it

#

if not just spawn your character, possess it, do w/e else you need doing

twin juniper
#

how can I call an RPC on a spesific client from another client without the use of multicast

#

Client 1 > Server > Client 2

#

function has to be working locally so I cannot execute it on the server

#

It needs to be executed on locally on the other client

#

so How to RPC to only one spesific client by using player state or something ?

red pollen
#

How do you know which client you want it to run on?

twin juniper
#

I know it by an overlap event

#

but overlap doesnt get executed on the target

#

I have a grass that hides the player

#

so when the player enters the grass he sees the player inside

#

but the player inside doesnt see the player who entered

#

because overlap has been already fired

#

I cannot continuisly call overlapping actors cuz its not ideal

#

so I want to tell to server

#

that I overlapped with someone

#

and send the player state to server to pass it back to that player

#

I am using C++ as well

#

so any help would be appreciated

meager spade
#

why would the client ask the server to affect another client?

#

i mean, overlaps fire on server and client

#

so why not just get the server to send a client rpc?

twin juniper
#

because players inside the grass are only meant to see eachother

#

yeah thats just what I thought

#

let me try and get back to you

meager spade
#

right but that looks like something the actor (grass overlap) should handle

#

it should know who is in the grass

#

and and let the players no accordingly

twin juniper
#

well

#

thats heavy

meager spade
#

why is it?

twin juniper
#

because grass is not a single chunk

#

its more like

meager spade
#

so you don't have some high level manager

twin juniper
#

made with a lot of pieces

meager spade
#

which can store who is in grass or not?

twin juniper
#

to destroy those later

#

well

#

there would be at least 100 grass

meager spade
#

and?

twin juniper
#

and 100 replication of arrays

meager spade
#

no why would it

#

i just said, a manager

#

a single class

#

one replication

#

when you enter grass, you tell the manager

twin juniper
#

of 100 arrays

meager spade
#

wtf, why would that be

#

your logic is wrong

twin juniper
#

because every grass piece needs to hold who is in it

meager spade
#

why?

twin juniper
#

so the players can see each other

meager spade
#

and why does that need to be replicated?

#

no your logic is wrong

twin juniper
#

it does because

#

everytime i move in the grass

#

I would need to call rpc to server to check if there is a player there

meager spade
#

why would you?

twin juniper
#

so server can show him to me

meager spade
#

but server knows who is in grass, and so do you

#

no need for rpc's

twin juniper
#

yeah

#

but here is the thing

#

lets say I have 50 radius capsule of stealth sight

#

and 10 radius of hitbox of the player

meager spade
#

yup

twin juniper
#

stealth sight is not meant to put you in stealth

#

so hitbox does

#

but when I enter the grass and if the player is there

#

stealth has already overlapped the player

#

so he cannot know without me telling him I got in

#

or constantly checking if there is someone nearby

meager spade
#

that seems like a logic issue, not related to the grass

twin juniper
#

its not related to grass anyways

#

Its working perfectly with only that bug

meager spade
#

you just said, you have a overlap

twin juniper
#

yeap

#

but I stop it before executing

#

if the player is not in the grass

meager spade
#

which when you enter grass it should tell the other client you spotted him without that client knowing you entered

twin juniper
#

so it doesnt execute begin overlap again without leaving and getting back in

meager spade
#

can you show it in action or something

#

so i can understand cause im a tad lost

twin juniper
#

yeah hold on

meager spade
#

but either way to send a client rpc to another client

#

is quite simple

#

but requires two functions

twin juniper
#

yeah

#

Server then client

#

I was gonna try it just now

meager spade
#

but dont forget server should also overlap

#

so it will be like

#

ServerDoSomething(APlayerChar* OtherPLayer);

#

then that will do OtherPlayer->ClientDoSomething();

#

but shrug i still feel there is a better way

twin juniper
#

there is always a better way of course

hoary lark
#

seems like you need something like:

MySuperIntelligentGrassManager
{
static TMap<GrassObject, TArray<Player>>
}

  • Whenever a player enters a grass object they get added to that grass object's array
  • Whenever a player leaves a grass object they get removed from that grass object's array
  • Also whenever a player enters a grass object, the manager can simply look up which other players are in it and do whatever you need to them
twin juniper
#

yeah that was my first try

hoary lark
#

only on server of course

twin juniper
#

the problem is

#

only 2-3 players inside the same area

#

should see eachother

#

others doesnt need to know

#

so I would need to call at least 2 rpc to do this

hoary lark
#

like if there's 5 players inside a single grass object you need to filter which ones become visible to which other ones? should be handled where i said "do whatever you need to them"

#

yet another option: player locally stores TSet<GrassObject> GrassObjectsImIn and server broadcasts every time other players enter/leave grass objects. local player reacts as needed by showing/hiding. probably easier to cheat (if I can cheat memory to say I'm in every grass object)

twin juniper
#

yeah I know there is a catch to that

#

and that s the way I have choosen but

#

its not really important

#

its not really a major issue

#

since areas can be destroyed anyways

#

and you cant really do that

#

because I am doing it by overlap events

#

you should be moving your client locally every grass

#

and it doesnt work that way since movement is handled by the player

viscid bronze
#

This is in my HUD_BP Hud class blueprint. How do I call this from my character blueprint and not have it accidentally replicate to other players

twin juniper
#

is locally controlled > Branch

viscid bronze
#

put the is locally controlled in where

twin juniper
#

before calling your function

viscid bronze
#

in character blueprint?

twin juniper
#

yeah ?

viscid bronze
#

ok thx

#

works perfectly, thx

twin juniper
#

uw

ancient root
#

Any one had luck with VOIP and aws

lost inlet
#

here's one that not many may have run into, but has anyone run into a situation where an actor of the same class is destroyed and recreated in the same game frame with the same owner but the new actor has different names between client and server?

#

so things like RPCs don't work

fleet raven
#

huh

#

even if you used the same name, it should still make a new actor on the client

lost inlet
#

client world has the actor suffixed with "1"
server does not have this suffix

all RPCs fail

fleet raven
#

wtf

#

that doesn't seem right

#

it should make a new actor channel and then the name doesn't matter

stable cairn
#

Hey, guys!
Has anyone ever had a problem with a client beacon not receiving replication when connected to a hostbeacon on client build configurations?
to be more precise ALobbyBeaconHost and ALobbyBeaconClient

fleet raven
#

are you trying to run the beacon host on a client build?

stable cairn
#

Well, is there another way to make a party session?

harsh lintel
#

When I bind a function to an action/axis mapping, how does the server know which client has the right to trigger that function?

winged badger
#

input only ever happens locally

harsh lintel
#

Yes, lets say the input triggers a server rpc defined in an actor owned by controller X, what prevents controller Y from triggering that same object's rpc. I know it's weird but I can't get it out of my head : D

winged badger
#

it doesn't have a data channel to send it with its own input handlers

#

you might call the X's RPC directly from Y if you fuck up though, nothing automagically helping you there

#

but you'll have to do it using X object reference

harsh lintel
#

what do you mean by data channel if you dont mind me asking

winged badger
#

having input handlers in protected: section of the header

#

will cause a compile error if you try to cross wires on them

#

as in, each controller gets one

#

its the only thing that can send Server or receive Client RPC

harsh lintel
#

Thanks

lost inlet
#

@fleet raven i do get "Error: ReceivedNextBunch: Reliable bunch before channel was fully open" whenever this occurs

fleet raven
#

this sounds like something is bugged

#

normal replication should never ever cause that message

winged badger
#

spawning an actor with same class and name as the one you just destroyed that frame though...

fleet raven
#

should be fine in theory

winged badger
#

its something i would not readily trust unreal with not to break

lost inlet
#

i deferred it by a frame and it still does it

fleet raven
#

I guess the package map isn't going to like that at all

lost inlet
#

also the destroyed actors are still visible in the world outliner on the client

winged badger
#

@lost inlet if you spawn the Actor by changing its name in FActorSpawnParameters?

lost inlet
#

i tried that

#

but that caused worse issues

winged badger
#

that shouldn't cause issues 🤔

lost inlet
#

orphaned actors that only exist on the client is an issue though

winged badger
#

was the original instance loaded from the package?

lost inlet
#

you mean from the level? this is an actor created at runtime (ie. a weapon)

winged badger
#

same name is not required for addressing replicated Actors, they will use NetGUID

#

or replicated UObjects of any kind for that matter

#

only times when names have to match is when you count on IsNameSupportedForNetworking() to return true for addressing to work

#

AActor* UWorld::SpawnActorAbsolute

#

i would be curious if a breakpoint in the function triggers on client after you do the weapon swap

quiet wyvern
#

Hey im trying to run my dedicated server on a linux box how do i make this work?
Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.

#

I dont have a AppID yet, so im using the temp Dev one

lost inlet
#

well one thing that's happening is the RPC is never leaving the client

#

how can i debug that? the owner is correct

winged badger
#

you can try see whats going on in GetRemoteFunctionCallspace and ProcessRemoteFunction

#

(i am guessing at this point)

lost inlet
#

‡ AActor::GetFunctionCallspace returned 1 int
which is Remote

#

UNetDriver::ProcessRemoteFunction does get called on the client

#

and then to InternalProcessRemoteFunction

#

UActorChannel* Ch = Connection->FindActorChannelRef(Actor); doesn't return a valid actor channel

#

so what reasons could there be that a channel doesn't get created for a specific actor?

winged badger
#

never read that part of the source 😦

#

does the client spawn a new weapon when server does?

#

it will use UWorld::SpawnActorAbsolute

#

you can go couple of steps back from there in the callstack to where it received the bunch with instructions to spawn it

lost inlet
#

the client doesn't run any spawning logic, i even added check()s to make sure

#

the switch weapon RPC (which runs on the character) works fine, it's just any RPCs that are called on the weapon itself

#

i also made a UDN post for it so hopefully someone from epic knows

winged badger
#
bool UChannel::ReceivedNextBunch( FInBunch & Bunch, bool & bOutSkipAck )
#

thats where your log comes from

#

but the code involved is not light reading

lost inlet
#

it seems the log gets printed for each weapon resupply anyway so it's not really an indicator if the issue will exist

#

it's pretty specific in which weapon is affected since it uses its own spawning logic (underbarrel weapon), even though it shares a lot in common with the rest

#

it's not 100%, but i can get it to happen pretty easily

winged badger
#

log LogNetPackageMap log