#multiplayer

1 messages · Page 447 of 1

meager spade
#

yucky 😄

#

and was pretty broken

tribal solstice
#

That Epic multiplayer tutorial messed me up pretty badly. Trying to unlearn that and relearn the proper methods

meager spade
#

there is no "Proper" ways well there is, but every situation is different

#

and its learning what you have and if you can achieve what you want in the best way

tribal solstice
#

Yep

meager spade
#

the amount of Tick abuse i see from newcomers

#

is mental

tribal solstice
#

Yeah, I've had people tell me that Ticks are fine to use as much as you want also

meager spade
#

i hardly use tick, and use tick if there is no other soloution to the problem

tribal solstice
#

you use timers/delays?

meager spade
#

well most of my stuff is C++, so i use timers

tribal solstice
#

Yeah makes sense

meager spade
#

but i do use tick, but limit to what actually needs to be in tick

tribal solstice
#

Right

meager spade
#

company i work for, we disable tick on mostly everything. We even disable AI that is out of range of any player from ticking (we set it to Optimized Idle state)

#

and only tick what is required

#

otherwise the game would be crawling 😄

tribal solstice
#

that's interesting

meager spade
#

we have patrol AI,

#

and if no one is near they dont do anything

#

only thing that ticks is the player controller

#

i mean AI controller

#

and checks to see if anyone is in range

#

even that is no longer in tick and is done on a timer

tribal solstice
#

Would you have any idea how to create bots in mutliplayer that read as normal players with PlayerControllers by any chance?

meager spade
#

bots wont have PlayerControllers

#

but bots can have a PlayerState

thin stratus
#

Requires C++ though

#

The bWantsPlayerState boolean isn't available on BPs as far as I know

frank portal
clear copper
#

I have a card game and so far i just have a deck that the player draws cards from. In the PlayerController i have a keybind (Enter) that draws a card by calling the event in the GameState. But, it only works on the server, not any of the clients. What am I missing?

heavy marlin
#

Anyone know how I'd spawn an actor on the server and client but only the owning client?

#

It's basically a new player setup screen

#

So I don't want it spawning on other clients!

cerulean acorn
#

@heavy marlin : Try "Only Relevant to Owner" in the Replication Category of the actor.

heavy marlin
#

Ok thanks

cerulean acorn
#

@clear copper Blueprint or C++ ?

clear copper
#

@cerulean acorn Blueprint

thin stratus
#

@clear copper Use a ServerRPC in the PlayerController

#

And read my compendium (again?) cause you seem to be lacking essentials

#

It's pinned to the channel

clear copper
#

👌👌

dusky willow
#

Hello everyone, I want to make a network game, I have already created my own dedicated server, but I just can not figure out how and where to create a session for the player. If someone knows how to do this or even has a bully lesson, I will be very grateful for your information.

clear copper
#

@thin stratus this compendium looks like it will be really helpful! you made this?

thin stratus
#

Yop

clear copper
#

nice job, it looks like a great place to get started!

#

Question: the GameState blueprint says that it exists on both server and client and is fully replicated, so why do I still have to set variables to Replicated?

#

does that just mean the class itself is replicated, not necessarily everything inside of it?

bitter oriole
#

Yes

#

Exactly

clear copper
#

Ok that makes sense

#

Is there a downside to replicating too many variables?

bitter oriole
#

Bandwidth

#

@clear copper

#

Replicate what you need

clear copper
#

makes sense, appreciate it!

idle flame
#

I'm making a ECS and I want to know if it's posible to replicate only some components of my entities to all client. I have an array of object and I want to replicate only some bloc of this array

#

Someone knows if it's possible ?

jade gazelle
#

Is there any way to test the #if WITH_SERVER_CODE preprocessor flags w/o building and just running from the command line with -server, -clientonly, etc?

#

Whatever changes I make in VS seem to apply globally whether it’s the client, server, etc

#

Assuming this because nothing has actually been built

#

So the flag is the same for everything

chrome bay
#

There isn't. They're preprocessor commands and only evaluated at compile time

jade gazelle
#

Got it, thanks. Guess I'll just have to do periodic testing with completed server/client builds

chrome bay
#

You can use the NetMode and suchlike to do stuff if not, like IsNetMode(NM_Client) etc.

fossil spoke
#

Anyone know if SweepMultis are guaranteed to return the OutHits in the same order on Client/Server?

#

My initial suspicion would be yes.

severe widget
#

what mechanism would ensure the order?

fossil spoke
#

Im guessing since its a sweep it would return based on hit order

#

Last hit would appear last

#

First hit first

meager spade
#

i would setup a test case

#

and make sure

fleet raven
#

does anyone know what a minimal net rpc world is?

twin juniper
#

I'm making a fighting game and I'm wondering how to even out lag between clients. If I have a P2P game, I don't want whoever starts off as the client-host to have 0 ms lag and then the other client have normal lag. How can I ensure the same lag experience for both players?

grand kestrel
#

You'll need to add some forward prediction and also rewinding capability, not a basic matter whatsoever

#

For example, if playerB has 50ms ping and uses a hadouken then the server can tick his hadouken forward .05 seconds on spawn, same with a shoryuken, can offset the start of the animation montage .05 seconds

#

And it will store the locations/etc (particularly hitboxes) of playerA and playerB and when playerB attacks playerA it will rewind to a past hitbox/etc .05 seconds ago and use that for the hit detection

#

@twin juniper

#

Also there is no P2P in UE4, but you can simulate it this way with high latency compensation + listen server

twin juniper
#

@grand kestrel Thanks for the response! Is that really the only way? It sounds insanely difficult to implement seeing as essentially every game mechanic has to have that implemented (I can just imagine the bugs down the road). There are so many fighting games (SFV, tekken 7, mk11, etc.) made with Unreal that I would think it's a bit more streamlined. Or do they not implement this at all and go with the old fashioned "whoever is closer to the server has an advantage"?

grand kestrel
#

@twin juniper

  1. It is insanely difficult to implement
  2. There is a lot of stuff that most games have that barely exists in any adequate form and this is one of them
  3. There will be bugs and you'll remake the system several times over until eventually you've taken a ton of time and learned enough to make it so that the bugs are easy to locate/fix and are ridiculously familiar with it (talking from experience)
  4. Do not know what they do but server authoritative with no compensation wont work as it would be too unresponsive, gamers wouldn't play it. Especially not competitively. At best they're client-side for hit detection but that would limit you, for example parrying in street fighter 3 ultra would not have been realistically possible this way.
#

(I've never made a fighting game nor this system for a fighting game, but I implemented similar solutions for an FPS with shootable regions and server-authority, in the end the methods are similar enough that I know the issue and how to resolve it)

twin juniper
#

What have I gotten myself into 😫
Are there any functions for "ticking forward" or do I have to implement that differently for every single mechanic (e.g. for a fireball I have to calculate where it should be in .05 sec and then sweep the space in between)? My main issue if I have to do that manually is that for example, if I have an animation and I have to offset the start, I could have something important happen in the first few frames of that animation that is now skipped.
I see what you mean, the last thing I want is inconsistency. Thanks again for your help.

grand kestrel
#

A fireball would be a projectile with a movement component, call tick on the movement component and pass their latency (converted to seconds) for the delta time

twin juniper
#

Oh I can just call tick multiple times in one frame or something like that?

grand kestrel
#

No, just call it once

#

I mean, you can, but theres no need

#

All tick is doing is passing the time between frames

#

So if you pass it somethign else

#

It will move forward that amount of time

#

So if you pass it their latency, it will move forward by that amount

twin juniper
#

OHHH I get you, I forgot tick had a parameter

grand kestrel
#

FYI you'll never be able to build this in blueprint

#

Gotta use C++

twin juniper
#

it's fine I'm in C++ mainly

#

hmmmm

grand kestrel
#

Have a look at UT when they fire a projectile they tick it forward

#

They have forward prediction for their projectiles

#

So you can see how they do it

#

They have rewind for hitscan but not projectiles, but its a base to start from

#

At least you can see how they're storing positions etc

junior jacinth
#

i developing mmo rpg 😫

twin juniper
#

Good to know, thanks! I'll put the source to download right now.

The biggest issue I can think of at the moment is that there's a decent chunk of gameplay that depends on certain parts of the animations. E.G. you can short jump or long jump depending at what point in a character's jump-squat animation you let go. How could I "speed up" the montage to catch up rather than just cut to the new point in time? if you know ofc 😋

grand kestrel
#

You could just get the running montage from the slot, get the current time, start it again with current time + predicted time, off the top of my head

junior jacinth
#

as i understand, open world need to create master server

grand kestrel
#

There might be a more elegant solution though

twin juniper
#

@grand kestrel wouldn't that skip the time in-between?

junior jacinth
#

hmm may be

grand kestrel
#

OK so treat it as two actions:
Start squat, server adds predicted time
On release, jump up animation, server adds predicted time

#

But at this point you need to just start making it

#

I have no idea if that will work

twin juniper
#

yeah I get you, this is dependent on every mechanic influenced by animations

grand kestrel
#

@junior jacinth UE4 has no out of the box support (nor capability) for an MMO, you will need to do a lot of research before you start

#

@twin juniper Sounds like you'd be better off heading to #gameplay-ability-system and learning how to use that plugin, it will do a lot of this for you

#

The forward prediction part, it has no rewind

#

Its very complex, but i think it will be worthwhile for you (and its complex because it does stuff that is far more complex than the system itself)

twin juniper
#

I thought about it but I'm not sure how it would work for a fighting game, it seems very RPG/MOBA focused. For things related to animations like what I mentioned, would it help? Or would it only be for attacks/abilities?

grand kestrel
#

It handles that well

#

I'm not very experienced with it, but from what I understand it should actually work pretty well

#

It should take care of the forward prediction, animations, etc

#

After you have all that setup the only thing left is rewind capability (which is a beast in itself)

twin juniper
#

by rewind do you mean correction?

grand kestrel
#

No, I mean hit detection in the past

#

Because PlayerA will not be in the same place that PlayerB attacked him in

#

This is what will happen

#
  1. You'll fire a hadouken (eg)
  2. It'll tick forward by 50ms (eg)
  3. The hadouken is now .05 seconds ahead of where it was fired from on the server, and as a result, it is matched to where the instigator was when he fired it, all good
  4. The target will not be where he was .05 seconds ago
#

The forward prediction is half the puzzle

#

The rewind is the other half

#

Rewind isn't a correction

#

That hadouken needs to see the player .05 seconds ago

twin juniper
#

ahhh I see

#

is there any literature I can read on this? I could definitely use a good book or something kappaross

grand kestrel
#

Probably, you'll have to look though

#

This is just stuff I found myself

#

By working on stupidly complex stuff

twin juniper
#

I see, thank you a lot for your help. I'll look into GameplayAbilities and the UT code.
Last thing if you know, if I end up going with delay-based network instead of rollback, how do I make both players have the same amount of input lag?

grand kestrel
#

Sorry that ones for you to figure out 😃

twin juniper
#

np, you've helped enough already, thanks

grand kestrel
#

That sounds awful and I have no interest in ever doing it ;P

#

Everything I make is responsive and secure haha

twin juniper
#

yeah it's definitely preferable

ivory portal
#

Hi, when I do a servertravel it seems my HUD stays on the client. This will spawn a lot of errors so I would like to destroy my HUD etc but can't find in the controller or such an event that is a "pre-travel". Should you custom make this or?

worthy perch
#

There's PreTravel in GameMode.

#

ProcessServerTravel and PostSeamlessTravel.

ivory portal
#

But GameMode is server only

#

so you would need to RPC to all clients to destroy the HUD?

thin stratus
#

You mean Widgets are staying on the screen?

#

Cause the HUD class itself is def nothing you want to destroy by hand

ivory portal
#

Widgets yes

#

(Also, the PreTravel/ProcessServerTravel isn't available in Blueprints it seems)

worthy perch
#

I think the PlayerController has some stuff that would be indirectly or directly called after a Travel.

#

Maybe even Possession or BeginPlay?

#

I'm not sure if BPs has this, but there's NotifyLoadedWorld() in PlayerController.

#

And this:

PostSeamlessTravel()
Called after this player controller has transitioned through seamless travel, but before that player is initialized This is called both when a new player controller is created, and when it is maintained
PreClientTravel()
Called when the local player is about to travel to a new map or IP address.
SeamlessTravelFrom() and SeamlessTravelTo(). I'm not sure where these are called, though.
ivory portal
#

Not available in blueprints, I also think it would be too late because during the transition level you would also have the HUD (and the HUD shows stuff from the playerstate)

#

The seamless travel events are not available in blueprints (sad :-()

worthy perch
#

I just checked my project, and I remove all the UI stuff On PreClientTravel.

ivory portal
#

That's prolly only C++ as well, don't see it in PlayerBlueprints

worthy perch
#

You could implement the stuff into BPs. I think the lack of server-esque stuff not being BP accessible is why I started to do C++ stuff.

ivory portal
#

Yeah, I prefer to use the blueprint system so my partners can follow easier but it seems I will need to do it

thin stratus
#

We are removing UI on preClientTravel too iirc

#

Multiplayer is sadly really the place where BP only falls apart :P

ivory portal
#

It will improve over time I think (hope)

thin stratus
#

Doubt

#

It's been like that since the start

#

You can PullRequest changes in if you want, such as the OnCopyProperties and OnOverrideWith stuff in the PlayerState which I exposed

#

But I don't think Epic will expose a lot more if at all something

worthy perch
#

They did add ServerTravel to BPs recently, I think.

thin stratus
#

BPs always had ServerTravel via ConsoleCommand

#

So that's just a minor thing

pallid mesa
#

hello everyone, I'm trying to host a dedicated server without being logged on steam, which works, but it requires me to have the steam process running on the background (even if not logged the server boots up [which is expected]). I'd like to distribute a dedicated server build where I don't depend directly on having steam booted on the background, is this posible? ~

thin stratus
#

Hm, doesn't steam require you to have their weird console installed?

#

Where you then download the Server via the AppID of it etc.?

#

I'm pretty sure you do need Steam in some way

#

At least if you need your Dedi Server to talk to Steam.

pallid mesa
#

In linux with the .so file it worked. No steam running in the background, just a library creating a mini steam enviro

thin stratus
#

Yeah but "mini steam enviro" is still "Steam in some way".

pallid mesa
#

In windows, different story, not geting the same results even tho I have the equivalent dll's

#

yeah, it is still steam, because it needs to communicate with it

#

but what I mean is like...

thin stratus
#

That thing

pallid mesa
#

oh yeah I tried, however when I tried to download the server with the steamcmd it wouldn't. It doesn't show up in the steam server list webpage, probably I need to fill something on the steam end?

thin stratus
#

Well you do need your Server Files to be hosted with the Steam system

#

It works with games that use the SteamPipe content system.

#

SteamCMD is the thing your players would use to download and install the Server

#

I'm also half sure I didn't need to have Steam installed for my Servers

#

But I'm not 100% sure

pallid mesa
#

well in our case we have the dc server tool, which you download from steam

thin stratus
#

I know you have to place the ThirdParty DLLs of Steam into the BInaries folder of the server

#

Otherwise you run into issues

pallid mesa
#

so I'll check what the steampipe is

#

because probably that's what is missing

#

oh our server works perfectly

#

it's just the little annoyance that the steam process needs to be running

#

on the background

#

I copied and pasted the most recent dll's

thin stratus
#

Thing is, I'm half sure I did not install Steam on our servers

#

That would be annoying enough for me to remember

pallid mesa
#

haha

thin stratus
#

All I did was copy paste the Server Build (or rather the cooked content + server.exe) including teh steamDDLs over to it

pallid mesa
#

right now is just a convenience question, nothing else, if end up not figuring out I'll probably open a ticket or something else, (or just rent linux servers)

#

right, we have a different depot for the dc server, included as a tool, shows up on the steam server list and so on, but not in that webpage I sent, which maybe is the reason I'm unable to get it from the steamcmd

#

I did everything you mention

#

ty cedric, let's see what I can do ^-^

thin stratus
#

Oki

pallid mesa
#

oh, we show up in the list, god dang it haha, I didn't read the "this is not a complete list" silly me, gonna try a couple more things and I'll update for those in the same situation as me (I was using the wrong appid [silly typo])

ivory portal
#

and now I see how bad my C++ level is ugh 😛

pallid mesa
#

okay I see now... I need to release publicly for login anonymous to work, I feel a bit dumb xD

ivory portal
#

Would you guys share how you delete your widgets? For some reason my code doesn't work and sometimes makes my screen just black before the game even starts 😦

#

I think I am using the FClassFinder wrong

ivory portal
#

I just did it now with UUserWidget::StaticClass() 😕

worthy wasp
worthy wasp
#

guys question - i have a level being streamed into a persistent level - loaded via blueprint::LoadStreamingLevel().

Dedicated Server

This level has a blueprint actor in it - that i'm trying to fire an event inside of it on server - but it appears to not be happening in a replicated fashion - the class is set to bReplicates=true..... and i'm doing a (what i believe to be) proper RPC chain - local function (called from another actor in the world) -> ServerRPC (of the problematic actor). I"m trying to increment a replicated float in the actor, and pass that floats value to a 3dWidget (Component of this replicated actor) for display of like a scoreboard.... however the value is always 0 (in a packaged game - for some reason it works fine in PIE mode....). Why would this work PIE and not Packaged/Launched?

RPC Chain: https://puu.sh/CYoBE/b73c80eb19.png

SetTimerTxt(): https://puu.sh/CYoDa/16afd90445.png

#

when I call INIT from the external actor - this print string runs fine... however the functionality doesnt happen and i've even debug print stringed inside of the timer function - which appears to never run (on server or in client - its not printstringing)

rotund sapphire
#

walldiv, do you use nativization by any chance?

worthy wasp
#

@rotund sapphire - no nativization

#

in PIE testing - the print strings work fine... with DEDICATED SERVER selected. in a packaged game - when server is run as a seperate process - and the client from its own .exe.... the print strings dont happen at all.

rotund sapphire
#

i see it now. i think. srv_init only runs on server, which will run the timer on server only. nothing will update on client.

worthy wasp
#

so let me understand something correctly.....

#

on a replicated actor - i thought that was all that was needed?

#

are you saying - i should run this into a Net Multicast RPC?

#

to run the timer?

#

(because i've done just that....)

#

with the same exact output - no change in visibility, no output to the WidgetComponent

rotund sapphire
#

since you're already replicating the time float value, just run the timer on client too, and it should display you the data in the widget.

#

timers are not replicated. and i think you wont need multicast rpcs only to update these widgets on clients that would be a bad design

worthy wasp
#

SwitchHasAuth -> Auth() (as above) ; Client() (run the timer) ??

rotund sapphire
#

srv init only runs on server, and that's the only place you setup a timer - so that wont trigger anything on clients with-or without switch has auth.

#

just put the timer at begin play when on client and it will trigger updates for you on client showing the replicated value

twilit swift
#

Does anyone know if it's possible to refresh the steam net driver without disconnecting a client from a match?

#

I'm having a weird desync issue and the only thing that seems to fix it is leaving the match and returning.

chrome bay
#

destroying the net driver would terminate the connection - which you would expect

twilit swift
#

Yeah, I figured.

#

I'm having an issue where when the server runs UWorld::AddToWorld() the client's player controller becomes "local" as if it's a couch co-op situation and client movement breaks.

#

I tried marking the function that runs AddToWorld() with (Client, Reliable) and (_Implementation()) but it still affects clients.

chrome bay
#

Client means it runs on the Client, so that's what I would expect?

twilit swift
#

Oh. damn.

#

How can I mark it so that when run by the server it doesn't affect clients?

chrome bay
#

Well if only the Server is calling that function, that's what will happen

#

Something like if (HasAuthority()) or some-such

#

Every connection must be making the call to AddToWorld() already locally

#

So if you only want the server to call AddToWorld(), just wrap it with if (HasAuthority()) or something to that effect

twilit swift
#

Well, I just don't want it to affect the connected clients. Only the host, if that makes sense.

chrome bay
#

Well AddToWorld() doesn't do any network behaviour as far as I can tell

twilit swift
#

It's really weird. I can't figure out why desync is happening when I run that function on the server. When called by the client, everything works as I want it to.

chrome bay
#

Level visibility is managed between server and client. Server needs to know which actors to replicate to clients based on which levels they have avilable

#

Making a level visible on the client eventually calls 'ServerUpdateLevelVisibility' - so I assume there's something going on there.

twilit swift
#

hmm... ok.

ivory portal
#

@worthy wasp I had that but to search for my custom Widgets I needed to get the class object but that always failed

twilit swift
#

Hey @chrome bay , so I looked at ServerUpdateLevelVisibility while running on client and server. It doesn't seem to be running in either case. I'm not changing any visibility on the client side. Just on the server side. The thing that has me bamboozled right now is that when I look at the PlayerControllers from the server side, before I run add to world one is local and the other is remote. Then after AddToWorld, the client's player controller becomes local for the host. Any idea, what might be causing that?

#

Ever seen that before?

rotund sapphire
#

Amph, you should loose the dot, and use space instead. Also, running the command from cmd line might only affect the running client, while server won't throttle. The console window i think is a better choice for running this command. Alternatively, just go for the app Clumsy.

timber anchor
#

Guys

#

is it normal that my Dedicated server.exe will run the client of my game?

#

Shouldn't it be only the prompt running the server?

idle flame
#

Hey, someone know why GameState BeginPlay function is call after Other actors BeginPlay function ?

fleet raven
#

on clients?

idle flame
#

Yes

fleet raven
#

replication happens in no defined order

#

you can have a pawn before having a player or game state

#

because br_big_brain

#

have to guard everything

idle flame
#

But GameState Actor seems more important

fleet raven
#

I agree it's annoying, that's just how it is from what I've seen

idle flame
#

Ok so I have an other question, I need to store a proceduraly generated map so I can access it everywhere, where do you think I can store it ?

thin stratus
#

If it's only relevant to the Server, store it on the GameMode

#

If it's relevant to everyone, store it on the GameState

#

And use a Seed to not need to replicate all information

idle flame
#

Client need to have the map too

thin stratus
#

Yeah then put the info into the GameState or into a Component on the GameState

#

And replicate the seed

#

Let the clients rebuild the map based on that

idle flame
#

I'm already storing it in GameState but I have an actor that need to have info about the map but GameState hasnt replicate when I try to access the info

thin stratus
#

Then setup a safety net for this

#

Simple combination of boolean and EventDispatcher

idle flame
#

So I can spawn actor on client & server without replicating them ? And with the seed they are going to have the same thing

thin stratus
#

Well Procedural stuff is usually based on chance

#

50% chance to spawn a door

rotund sapphire
#

Zeblote, isn't net priority will force the actor to replicate earlier?

thin stratus
#

30% chance to spawn a left floor etc.

idle flame
#

The problem is that How can I call my actor begin play after my GameState beginPlay has been call ?

thin stratus
#

If you make sure to drive all these by a seed

#

Then you can use the seed to recreate the map on the clients

#

By asking in both directions

#

Actor BeginPlay checks if GameState BeginPlay has called, if not it waits

#

And other way round

idle flame
#

@thin stratus When I was doing that I had an error saying that the mesh I was walking on as client wasnt replicated

#

(when I was spawning all map actor on both client & server)

#

when you say 'if no it wait' I can set up a thing like that within my Actor BeginPlay While (MyGameState->MyVariable == null);

#

What do you think is the better way, spawn my map with the seed on both client & server (what I am already doing in part) or put this wait condition ?

rotund sapphire
#

starkmax in case of static mesh components i found that replicating the comp is important, without that character wont' be able to figure out what it is standing on, regardless if the same stuff exists on both ends. alternatively there is a way to trick the movement component to think all is good, but i get strange stuttering with hacking this, so i'd not recommend going down on this path.

#

a solution here is probably to use instanced mesh component here, which is more tolerant to this problem, since the comp will be replicated, thus the movement component will be feeling all right

twilit swift
#

I'm trying to run this function on owning client only when called by the server, but I get compiler errors when I try to compile it this way:

    void PlayKillcamReplay(FString ReplayName);```

```void UMyGame_GameInstance::PlayKillcamReplay(FString ReplayName)
{
    TArray<FString> Options;
    Options.Add("LevelPrefixOverride=1");
    Options.Add("ReplayStreamerOverride=InMemoryNetworkReplayStreaming");
    PlayReplay(ReplayName, nullptr, Options);
}```
#

Anyone know why UE4 isn't letting me mark the function this way?

fossil spoke
#

Your Implementation signature isnt correct.

#

void UMyGame_GameInstance::PlayKillcamReplay_Implementation(FString ReplayName)

fleet raven
#

can't use rpcs on game instance, missing _implementation, fstring should be passed by const ref

fossil spoke
#

^^ That to

twilit swift
#

Ok, so is there a better way I should be doing this if I want PlayReplay only to run on the host?

#

Right now this runs well on client, but when I call it from the host it causes clients to desync.

#

@fleet raven are you saying that UGameInstance::PlayReplay() won't allow me to call it on owning client only (if server)? Because I've got a bunch of other functions in my custom GameInstance that are running that way.

rotund sapphire
#

game instance is not replicated you may want to use replicated actor channels to fire events on clients from server. a playercontroller probably is better suited if you wish to address clients individually.

twilit swift
#

I really just want to keep calls of this function local.

#

if that makes sense.

#

It's for a killcam so I don't want other players affected.

fossil spoke
#

They wont be, you choose the PlayerController to call it on.

#

Server has all PlayerControllers, you can find the one that needs the Replay and then call the Client RPC on that PC

twilit swift
#

Ok. I'll give that a try.

mild forge
#

Hi everything, I am wondering if it's possible to get rid of building engine from source when trying to build a dedicated server with latest release 4.21?

rose egret
#

how do I don't let the anonymous players join the server. I know I can do my authentication in GameModeBase::PreLogin and return the error string. but my authentication function that calls the back end is async

thin stratus
#

@rose egret You could check what happens if the error string is not empty and do the same in your async callback function

#

@mild forge Don't think so. You'd need to check the release notes if you want to be sure.

rose egret
#

if I fill something to the ErrorString the remote client will get that eeror and server will close the connection. as far as I tested

thin stratus
#

I meant you to actually check the source code

#

And see what it does

#

Then replicate it (no in the multiplayer replication sense)

winter harness
#

@mild forge sorry you must use the source version to build dedicated servers. There are dependencies in that which are not available from the standard client needed to build against.

idle flame
#

Hey, I want to create a class that I will store in my GameStaten this class will hold my Map. I'll also load my map on client & server from a seed someone knows what type of class I am supposed to create ? (An actor ?)

#

I can't use an actor cause I can't know when my actor will be replicated to client

thin stratus
#

Actor is the only class that replicates though

eager geyser
#

I just end up getting the gamelift server and client sdk working in my project but now the content files cannot be read
Error:constructor game mode cannot find blueprint/character
can anyone understand where the error could possibly be

thin stratus
#

And of course you can know if the Actor is replicate. When you spawn it on the Server, set it to a RepNotify variable

#

Or just a normal Replicated one

#

You can easily check if that's valid @idle flame

idle flame
#

I'll do that thx @thin stratus

#

@thin stratus Do you know if replication can fail ? Cause I have a variable within my GameState Class that's set to UPROPERTY(Replicated) But this value is not replicated in Client GameState Class

thin stratus
#

If using C++ you need to make sure that you also list the variable in the "GetLifetimeReplicatedProps" function

idle flame
#

It's in this function

#

And my variable is an int32

thin stratus
#

Then it shouldn't fail

idle flame
#

Well I'm printing the value in the Tick function on Client side and it's 0 and on Server side it's an other number

#

On GameState .h

class MAZELEGENDS_API AMazeLegendsGameStateBase : public AGameStateBase
{
...
    FRandomStream RandomStream;

    UPROPERTY(Replicated)
    int32 RandomSeed;
}

GameState .cpp

void AMazeLegendsGameStateBase::BeginPlay()
{
    RandomSeed = 0;
    if (HasAuthority()) {
        RandomStream.GenerateNewSeed();
        RandomSeed = RandomStream.GetCurrentSeed();
        UE_LOG(LogTemp, Warning, TEXT("Initial seed on server = %d"), RandomSeed);

        ...
    }
}

int32 AMazeLegendsGameStateBase::GetCurrentSeed() const
{
    if (!HasAuthority()) {
        UE_LOG(LogTemp, Warning, TEXT("AMazeLegendsGameStateBase seed on Client Replicated ? = %d"), RandomSeed);
    }
    return RandomSeed;
}

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

    ...
    DOREPLIFETIME(AMazeLegendsGameStateBase, RandomSeed);
}

What I have :
Initial seed on server = 27865
and then I'm printing thousand of time the Log of GetCurrentSeed
AMazeLegendsGameStateBase seed on Client Replicated ? = 0

thin stratus
#

Where is your Super::BeginPlay

idle flame
#

LOL

#

thx

timber anchor
#

Guys

#

I compiled my dedicated server, but when i open it, it will open the game client

#

is it normal?

#

This is my Projectname.Server.cs
// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

public class VRG01ServerTarget : TargetRules
{
public VRG01ServerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Server;

    ExtraModuleNames.AddRange( new string[] { "VRG01" } );
}

}

thin stratus
#

You usually cook the whole content

#

And compile the DedicatedServer exe

#

And place the exe in the Binaries folder of the cooked content

#

Openeing that exe will not open the client version

#

@timber anchor

timber anchor
#

Exactly this is what i did, i followed the guide of the documentation.
But i tought the error was inside the cs file but seems not

#

So i will try to rebuild the dedicated server again

#

This is probably the problem

#

1>------ Skipped Build: Project: ShaderCompileWorker, Configuration: Invalid x64 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: VRG01, Configuration: Invalid Win32 ------
2>The selected platform/configuration is not valid for this target.
========== Build: 1 succeeded, 0 failed, 2 up-to-date, 1 skipped ==========

#

I don't understand why ShaderCompileWorker, it should be the bame of the project

thin stratus
#

Why is your Configuration invalid?

timber anchor
#

Don't know honestly VS Studio isn't so easy ahah

thin stratus
#

Make sure it's Development Server at the top

lost inlet
#

long shot, but has anyone ever had issues with actor replication where a client loads too fast (possibly before the server has finished loading). the actor is in a sublevel

#

using seamless travel

jolly siren
#

Has anyone had an issue where the relative location for an actor gets out of sync on the server and client because of AttachToComponent and FAttachmentTransformRules::KeepRelativeTransform?
It looks like my actor is spawning on the server, replicating to the client at location {0,0,0}, and then the client's AttachToComponent call attaches the actor but with an offset from {0,0,0}.
So the actor ends up with large relative offset clientside and shows up really far away from where the socket I am attaching to.

I'm wondering why ShooterGame calls AttachToComponent on the server and client. AttachmentReplication already takes care of the clientside attachment, so that is odd. It looks like I can fix this issue by either only calling AttachToComponent on the server or by using FAttachmentTransformRules::SnapToTargetIncludingScale instead of relative

timber anchor
#

Guys

#

I finally did the dedicated server

#

but when i try to join it from the client

#

my character won't spawn

#

and this is the error inside the log of the server

#

[189]LogScript: Warning: Accessed None trying to read property CallFunc_GetGameServer_ReturnValue
VergaController_C /Game/BASE/Maps/lobby.lobby:PersistentLevel.VergaController_C_1
Function /Game/BASE/VergaController.VergaController_C:ExecuteUbergraph_VergaController:0278
[2019.03.12-23.10.44:477][189]LogScript: Warning: Script call stack:
Function /Game/BASE/VergaController.VergaController_C:BeginAuthProcess_RPC
Function /Game/BASE/VergaController.VergaController_C:ExecuteUbergraph_VergaController

[2019.03.12-23.10.44:478][189]LogScript: Warning: Accessed None trying to read property CallFunc_GetGameServer_ReturnValue
VergaController_C /Game/BASE/Maps/lobby.lobby:PersistentLevel.VergaController_C_1
Function /Game/BASE/VergaController.VergaController_C:ExecuteUbergraph_VergaController:0317
[2019.03.12-23.10.44:478][189]LogScript: Warning: Script call stack:
Function /Game/BASE/VergaController.VergaController_C:BeginAuthProcess_RPC
Function /Game/BASE/VergaController.VergaController_C:ExecuteUbergraph_VergaController

#

Any help? it would be higly appriciated really guys... ❤

thin stratus
#

Well, you should really know what an AccessedNone error means

#

If you don't know that yet, please learn about it. It's very fundamental and you shouldn't have to ask us about them if you want to do a proper Multiplayer game.

#

That said, it means that the RETURN VALUE of "GetGameServer" is not valid.

#

Yet you tried to access it.

#

And that happend in the EventGraph (I assume) of your VergaController

#

In the BeginAuthProcessRPC I think

#

But that's your code, so you gotta check that out yourself.

#

@timber anchor

timber anchor
#

The problem is that, inside the BP everything it's fine

thin stratus
#

This is a runtime error

#

Not a compile error

#

This will only show up at runtime, even if your code is fine during compilation

timber anchor
#

Wait

#

Wait

#

The same exe file that im using in local, it's used by the server atm.

#

But inside the VPS it's showing up this error

#

And locally it isn't.

thin stratus
#

If 100% the same build does two different things on two different PCs

timber anchor
#

Infact, locally i can join and play as much as i want

thin stratus
#

Then it's most likely something that is changed runtime

#

As said, your "GetGameServer" function doesn't return a valid value

#

So I assume your VPS makes this fail

timber anchor
#

And another funny thing is that inside my VergaController there isn't any "GetGameServer" so probably it's something related to a UWorks function

#

Wait

#

Is it possible that the VPS since it doesn't have steam installed

thin stratus
#

The log should show steam issues usually

timber anchor
#

Will not create the Session and it won't let the server run "Correct"?

thin stratus
#

If not, try enable verbose logging

#

(google)

#

Well, it clearly states that there is a GetGameServer" function being called

timber anchor
#

Yup saw it

thin stratus
#

Idk how UWorks works

#

So idk if that has this function somewhere

timber anchor
#

Yes it's UWorks

thin stratus
#

You want to check if Steam is properly initializing on the VPS

#

You need to have the Steam DLLs in the Binary folder of DedicatedServers

timber anchor
#

Ok the problem is steam basically

#

we haven't steam inside the VPS

thin stratus
#

Don't think you actively need to install Steam

#

But at least place the dlls into the binaries folder

timber anchor
#

Ok let me google that

plain mauve
#

was refered to here to ask this.... in my unreal engine project, when i launch it with 2 players, and one player interacts with door, some stuff happens + matinee plays, however it plays the matinee for both players...how can i prevent that

fleet raven
#

using matinee in 2019? o_o

plain mauve
#

was a tutorial i watched on doing screen fade to black

#

havnt figured out how to do it in sequencer

#

either way

fleet raven
#

why not just use a umg widget to block the screen?

plain mauve
#

perhaps.... but i imagine where im at now it would probably still happen on both players screens 😛

fleet raven
#

then it won't have any multiplayer stuff built in either

plain mauve
#

oh.....hmm

plush wave
#

I'm still not sure how one should handle local split screen. I know that "Add Player" function but when should we call this? When a secondary controller is detected?

timber anchor
#

@thin stratus the problem was just a dll from steam missing

#

So thank you, even if were a bit rude in my opinion. But you told me the solution some how. I made it working

mild forge
#

I see, thanks for the info @winter harness @thin stratus

#

Seems I got this exception while installing dependency for building the engine from source: Checking dependencies (excluding Mac, Android, Linux)...
Updating dependencies: 99% (33911/34200), 5845.1/5847.1 MiB | 0.14 MiB/s...
Failed to download 'http://cdn.unrealengine.com/dependencies/2636758-e606e606851e4693b1729dd35dcef7ae/345f37ad429b27f1360cf26aa535ef037724f7c4': 指定的路径或文件名太长,或者两者都太长。完全限定文件名必须少于 260 个字符,并且目录名必须少于 248 个字符。 (PathTooLongException)

fleet raven
#

install the engine in a shorter path

mild forge
#

Ok I will try to move it to a shorter path

fleet raven
#

something like C:\UnrealEngine\ works good

plush wave
#

So can we assume that all connected players are synced with UTC time? Like if I want to network an event at a specific date

fleet raven
#

not necessarily

#

system time can be way off

#

you might even get players who turn it back on purpose to see the event again

tribal solstice
#

Hmm, when I assign a custom GameState in my GameMode and try to create a sesson, I just get a black screen

#

Didn't change anything else

#

But when I remove it from the GameMode it works again. Anyone know what that could be?

plush wave
#

@fleet raven so what's the best way to pre-sync events in a multiplayer game

fleet raven
#

depends on what it is

#

and how your game is working

plush wave
#

Think for example in Fortnite, in order to save bandwidth I assume the entire circle route is predetermined then sent to clients are start

#

The timing of the circle needs to be synced for clients, which should be super easy assuming they all have their clocks correct

fleet raven
#

that doesn't require a specific date, it's just something like "2 minutes in the future"

#

you can easily set a timer

plush wave
#

Right but "2 minutes in the future from a specific date"

#

Date as in the start time of the game

fleet raven
#

whether people see the circle with millisecond accuracy isn't that important

plush wave
#

Right

fleet raven
#

you can just send how much time the server thinks there is left and then use that value on the client

plush wave
#

But if someone has their time off and joins a match it would screw it up I would assume

#

Maybe kick players whose time is not synced with UTC?

fleet raven
#

timers are always just offsets

#

like 1 minute from whenever you called set timer

#

whether the system time is correct is irrelevant for that

plush wave
#

Hmm but a timer still has to be "started" which would require the server sending 100 RPC calls (in the case of battle royale)

fleet raven
#

fortnite probably sends thousands of rpcs when the game begins 🤷

plush wave
#

Damn

#

Thought that wasn't possible/good practice

fleet raven
#

sending a few one-off rpcs isn't going to matter

#

it'd be a problem if you tried that every frame

#

with more than a few

plush wave
#

I know every tick is a no-no

#

Didn't know you could call thousands tho at the beginning of the match

#

Then again, maybe they have ridiculously powerful servers

fleet raven
#

I mean to all users, not thousands * 100 of course

thin stratus
#

@timber anchor Sorry if it came over rude. Wasn't my intention.

timber anchor
#

It's ok man, i understood that probably the question sounds a little bit "Newbie" but i was pretty sure that the function wasn't the problem so it was my bad! 😄

grand kestrel
#

@plush wave FDateTime::UtcNow()

#

This method returns the Coordinated Universal Time (UTC), which does not take the local computer's time zone and daylight savings settings into account. It should be used when comparing dates and times that should be independent of the user's locale.

tribal solstice
#

hey eXi, how goes it? I've adapted my chatroom method to the one you suggested with Maps holding chatroom info with strings (names) as the keys and structs containing PlayerControllers as the value. Having trouble adding PlayerControllers to the struct within the Maps though. If you don't mind taking a gander at this blueprint and letting me know if I'm doing it wrong that would be awesome...

#

I have a feeling my method is off for adding to the array within the struct

#

The Maps within the GameState are found just fine by string (name) but I can't seem to get the PlayerControllers to add to the array of the struct inside.

thin stratus
#

That's an issue with not knowing about value and reference

#

You are basically getting a copied value with your find node. Everything you add to that won't add to the original entry.
What you should do is save the struct to a local variable after finding it. Then modifying that struct and later calling add on the tmap with the modified struct. That will override the original entry

tribal solstice
#

Ahhh I see

thin stratus
#

TMaps are useful but not 100% straightforward to use in BPs cause of things like that

tribal solstice
#

But if I call 'Add' on the tmap won't it override the whole thing for each player?

thin stratus
#

Normal arrays have a Get (Ref) node which will create a reference for you. That way editing the ref will edit the array entry.

#

In bp that doesn't exist for tmaps..

tribal solstice
#

I see

thin stratus
#

Well idk what exactly your code does. But it will only override for that chat room

#

I mean it's a ChatRoomName, Struct relation in your map

tribal solstice
#

Not quite sure how to handle this then. I was calling this from the PlayerController so everytime a player creates a named widget chatroom they would add their controller to the struct array within the map in the GameState

thin stratus
#

And keys are unique

tribal solstice
#

So would every player need their own key?

thin stratus
#

No, this is to identify a given chatroom.

#

By name.

#

The struct holds all info about the chatroom

#

What users are in it etc

tribal solstice
#

Right. That's how I have it setup

thin stratus
#

Yeah so what's the issue then?

tribal solstice
#

String as the name (key) and struct containing player controller arrays

#

I need to be able to add playercontrollers to the struct's array as they enter

#

but Add will overwrite the whole struct each time, won't it? Instead of just adding the PC to the array within

thin stratus
#

The array that you get has already x controllers

#

Adding one and then overriding the map entry is basically adding one to the map array

tribal solstice
#

Ahhhh of course

thin stratus
#

You dont reconstruct the array. You get the struct first. Modify that and use that to override. Which results in it being the old array + whatever you changed

tribal solstice
#

So get struct from Find, create local variable out of that, then break struct pin to get array ref, add to array, and Add the new local variable struct to the Map

#

Worked like a charm, thanks a ton eXi

ivory portal
#

Hey, maybe I am doing it wrong that's why I want to pickle your guys brain. I have my Lobby map where they choose a team. Team is saved in PlayerState but on changing from Map you lose all info in the PlayerState(?). Should I make my playerstate same over all my levels or put everything in playercontroller and switch with the OnSwapControllers event?

wheat eagle
#

hi guys. I have a question: How can I send information from a player to a session when that player is connecting to the session? I'm using advanced sessions plugin

ivory portal
#

You can just RPC the server at beginplay of your playercontroller

wheat eagle
#

i dont really understand could you please give me a representation?

ivory portal
#

PlayerController -> Event BeginPlay -> Custom Event (Replicated: Run on server) do you stuff you want to ask the server

#

Event BeginPlay calls the Custom event

wheat eagle
#

ok but the thing is that Im trying to get the location of the player before connecting to the server. When the player joins the session with a new map , I want the server to teleport the player somewhere based on his location before connecting. Will what you told me work for that?

ivory portal
#

So your player is playing offline and when he travels to your server you want him to pass along his coordinates?

wheat eagle
#

yes

ivory portal
#

You can pass along options

wheat eagle
#

orrr i could send the info to the gameinfoinstance and when connecting to the server get that info and pass to the server

#

will that work?

ivory portal
#

A game instance does not share any information (Server Game Instance does not sync with Client Game Instances)

#

You could use it to do the RPC call with it

wheat eagle
#

it worked for me what I said about the gameinfoinstance

#

thanks for the help and link though

#

i will look through it

twin juniper
#

Hey, what's the latest method to get a simple multiplayer dedicated server running? Any changes from around 4.18 where all my searches point?

fleet raven
#

you just duplicate your Project.Target.cs to make a ProjectServer.Target.cs and change it to be Type = TargetType.Server;

twin juniper
rose egret
#

is there any event on dedicated server to tell me that the server connection is listening and ready or failed?

maiden vine
#

Anyone know why when i join my server with client 1 and set master pose on my equipment then join with client 2 the master pose is not working for client 1 on client 2?

#

I did this with multicast btw

#

should I refresh equipment or something?

graceful cave
#

@maiden vine a multicast will run for connected clients and thats it

#

clients who join later wont have any of that info

#

replicated variables will be received by new clients when they join and if theyre set to repnotify, they will run whatever function is associated with it

maiden vine
#

thank you, so I must refresh for the joining player

graceful cave
#

use repnotify

maiden vine
#

awesome i was stuck thinking my function was failing

maiden vine
#

Got it thank you much on rep I set the master pose it works perfect

chilly mason
#

how can I specify that an actor, placed in world in editor, be client-only?

graceful cave
#

if an actor is placed in the editor then its part of the level and everyone loads it

#

if the actor isnt set to replicate then any changes the server makes wont replicate to clients so they will have their own control over it for changes that only show up locally

chilly mason
#

right, so there's no way to have an actor only load on clients when it's placed in the editor, correct?

#

meaning I'd have to spawnactor on each client individually and turn off replication, right?

graceful cave
#

if replication is off you might be able to destroy it on the server when it loads

#

but your method is fine

chilly mason
#

thanks

thin stratus
#

By default Pawns Blocks each other

#

And you can't step on other pawns

#

Getting pushed out of each other is something you can probably somehow setup

fleet raven
#

disabling the collision between them would be easy, but then you need to be doing this force thing on both the client and server (including when the client is reconciling moves)

twin juniper
#

hello, i'm having an issue with some crazy ass bullshit that is comfusing the shit out of me on 4.21 involving BoxCollision, Pawns, and Overlap in a networked server/client dedi setup

you see, i have an Actor with BoxCollision on it, this box collision is indeed enabled and replicated and net load on client, same as the rest of the Actor

it is set to generate overlap events with everything, including Pawn, and print a generic piece of text with PrintString to the log when it does begin an Overlap
when ramming my Default UE4 Pawn into it, the Client will print the log, but not the Server
the server will never ever call the overlap event for some godawful reason
i've verified the serverside Pawn exists, I've verified it's at the same X/Y/Z coords as the clientside pawn using the debugger stuff
it just isn't calling it and it's incredibly obnoxious, my project is stalled out right now until I can debug this

#

this is on 4.21 btw

#

both the pawn and the box collision are set to overlap with eachother's object types as well

#

reproduction steps:

#
  1. make a blank UE4 project, blueprints
  2. make actor
  3. slap Box Collision on that Actor
  4. tell it to Overlap with Pawns and/or everything just to make damn sure
  5. make subtype of Default Pawn
  6. tell it to Overlap with Everything
  7. set it as the default Player Pawn
  8. boot that shit up, Dedicated Server Mode, whatever number of players
  9. fly a Pawn into the BoxCollision
  10. Watch as the only prints are Clientside according to your output log
  11. Cry a lot
#

oh, also check all the Replication shit and check "create overlap events" obviously

#

i'd throw together a Test Project for you following exactly these steps but I've spent about 3 hours ticking and unticking every possible replication and networking related option to figure out why the events aren't getting called on only the serverside despite both the actor and the pawn definitely 100% existing serverside, and my head is going to explode

#

if anyon ehas any ideas please let me know

#

oh and yes i also tried just directly checking the OverlappedActors list on tick

#

that also doesn't get populated

fleet raven
#

don't have vs open anymore to check when that is called, but if it uses CalcVelocity during reconcile it's probably fine

#

you want to make sure the ClientUpdatePositionAfterCorrection (or similar) is using the logic again

#

it goes through the saved moves and does them again

#

sure, maybe I can use something similar for my project 🤔

#

not sure how well it's going to work with the movement being based on the other replicated players positions

#

100+ is just normal

#

I have it set up so the editor is always simulating 200ms with some packet loss when using multi-PIE

#

I think I added something to the game mode that sets the setting on start

#

err

#

game state

#

needs to be set on both sides

#

I actually have no idea what tick rate a server runs at

#

seems to work fine with listen servers at different fps than clients

unique thunder
#

Does a server travel re-initialize the GameInstance on the server or the GameMode?

fossil spoke
#

GameInstance is like the process. It is created when the game is started and it is destroyed when the game is closed. Anything that happens inbetween then the GameInstance does not change.

#

The GameMode may change on Server Travel though yes.

unique thunder
#

GameState may as well?

fossil spoke
#

Yes

unique thunder
#

Thankyou

fossil spoke
#

👍

unique thunder
#

If I run this in the GameInstance on the server to server travel

#

And then cast to the GameState to update variables there

#

Will they persist in the GameState post-server travel or is there a legitimate way to carry this data from GI to GS after the travel?

#

Dumb question, I can cast to GI from GS on event init and grab the variables

fossil spoke
#

Keep them on the GI when the Servers GS begins play just grab the values from the GI

plush wave
#

When is NetDriver initialized?

rotund sapphire
#

Always, i guess. Why?

fossil spoke
#

Probably at somepoint in LaunchEngineLoop

plush wave
#

I'm trying to get the time elapsed for a multiplayer match.

#

Was hoping the time variable in NetDriver would provide that

fossil spoke
#

Just make your own?

idle flame
plush wave
#

Is there a list of classes that have locally-owned network connections? (Aka classes that can call RPCs). The obvious example is the PlayerController but what other classes do this?

fossil spoke
#

Any class that has a net owning connection. So that means if an Actor has an owner in its owner hierarchy that comes back to a PlayerController then it can call an RPC

plush wave
#

Ok so basically only the PlayerController or any PlayerContoller-owned actor can call an RPC?

mild forge
#

I am tweaking with TwinkStick template for multiplayer gameplay, when I started it with 2 players in PIE, no pawn was spawned(Logs show: no game present for joinning session). Currently I dont any PlayerState class or PlayerController class yet with thinking dont need it yet. So now I am wondering what I am missing for it.

#

What I have done includes: Added HP bar widget with pawn and implemented TakeDamage, ApplyDamage, set some variables to replicate and some functions to be called on server side.

#

Before I deleted the pawn from the map, the pawn was spawned, I thought if I delete the pawn, and when player join the game the pawn will be spawned automatically, so I missed something i think

mild forge
#

I messed up the game modes, and finally the default pawn is spawned for the first player, but not the second player, seems caused by pawn collision at the same location.

mild forge
#

Okay after changed the collision handling method, i got my pawns spawned. alex

twin juniper
#

Okay, another question: Is there any way to access current session IP on blueprints? Been trying to put off diving to custom c++ classes/overrides.

#

Also wondering why all my searches only return stuff from circa 2015-16

ivory portal
#

At the moment I have some sort of puzzle where two players but stand somewhere before a variable will be set with repnotify which will make something visible. The detection if the player pawn is standing correctly happens on the server side with a switch-auth node. Now, this will set a variable that has repnotify. But it seems this only repnotifies to the server because when I overpass the switch-auth the client also see something come visible. Does repnotify behind a switch-auth only repnotify the server?

#

Or wait, the repnotify isn't the problem. It seems setting visibility to false doesn't work on my clients (I just tried with an RPC from server->clients to do it. Making it visible works, making it invis not)

soft relic
#

Hey, could someone tell me a possible reason that my game won't find the lan session the second player makes when searching?

#

it doesn't seem to find the lan session at all no matter if it's steam or lan

soft relic
#

okay i worked that out but now the sessions is shown 4 times instead of once.

solar stirrup
#

Hey guys! Just need a little pointer on something

#

RPCs invoked by the client only run on the server if the client owns the object that invokes

#

What does ownership entail?

graceful cave
#

@solar stirrup if the client's player controller is set as the Owner of an object

solar stirrup
#

Does the client also own the components of said object?

graceful cave
#

it should

#

worth trying

solar stirrup
#

alright ty ^^

graceful cave
#

if not just call the rpc on the parent actor

solar stirrup
#

Alright

#

NetMulticast means the RPC will be executed on the Client and Server version of the component right?

chrome bay
#

Ownership is an actor-level concept - so yeah they will "own" the components if you like

#

Component RPC's / Data is actually sent via the actor

graceful cave
#

yeah as long as the server calls it then it will run on every machine the object exists on as long as it replicates

#

including server

solar stirrup
#

What if the client calls it?

graceful cave
#

only that client runs it

solar stirrup
#

I need to replicate moving an item in an inventory

#

So it also needs to happen on the server

#

(validation there would also be nice)

chrome bay
#

You would ask the server to move it

solar stirrup
#

How does one ask the server to move it?

#

Call a client rpc to the server and have the server call a multicast rpc?

chrome bay
#

Well in theory, your inventory is replicated right?

#

If not, it probably should be.

solar stirrup
#

I'm working on it, but how should it be replicated?

chrome bay
#

Well depends on the system really.

graceful cave
#

what is it stored in?

solar stirrup
#

It's a TMap<int, FItemSlot>, so the way I was going to make it was have replicated AddItem, MoveItem, RemoveItem functions

chrome bay
#

TMap's you will struggle with

graceful cave
#

maps dont replicate

solar stirrup
#

FItemSlot contains the Quantity of an item in that slot and a pointer to the item

#

What else can I use to replicate then?

chrome bay
#

TArray is probably best

solar stirrup
#

Hmm then that means I have to store the placement of an item slot in itself

graceful cave
#

you could use RPCs or an array but do you need multicast like you said earlier?

#

or does only the owning client need it

#

if you need all clients to have the info then arrays set to repNotify are your best option

solar stirrup
#

Server and Client need to know it moved

#

Are pointers replicated? FItemSlot has a pointer to the item

#

How would it be replicated?

chrome bay
#

Here's how mine works

#
InventoryContainer
- Holds a TArray of InventorySlot

InventorySlot
- Holds a single InventoryItem
- Replicates the pointer to InventoryItem
- Player becomes the "Owner" of whatever is in the slot.```
#

InventoryItem in this case is a replicated actor of some kind.

solar stirrup
#

fudge

#

my inventoryslot is a struct, and holds a pointer to another struct 🤔

chrome bay
#

Moving an item becomes a simple case of asking the server to move the actor from one slot to another

solar stirrup
#

So my inventory slot should have a pointer to the actual Actor of the item?

chrome bay
#

I mean, you can do it however you like - this is for my weapon inventory, but if I was doing a "minecraft" inventory or something with a fixed number of possible objects, you could just use data

solar stirrup
#

oh okay

#

I mean I'm converting a project from BPs to C++ and this is what they were doing

chrome bay
#

E.g, this slot contains 'X' amount of 'ID' item

solar stirrup
#

so I don't really know how well it works

#

yeah

#

alright I'll switch to TArray

chrome bay
#

There's not really any defined way to do inventory since it can be very unique per-project.

solar stirrup
#

I mean if TArray can already be replicated I'm fine with using it

#

I'll store the item's position on the grid in the slot itself

#

or I could point the new slot to the item and clear the pointer on the old slot

chrome bay
#

Yeah, for something simple you can just have a TArray<FInventoryItemData>

#

And ask the server to move data from one index to another in the case of moving items around

solar stirrup
#

Actually would that work?

- Move item from slot A to B
    - If slot B has an item, temporarily save the pointer of slot B
    - Point slot B to item from slot A
    - Point slot A to temporary pointer
    - If slot B had no item, just clear the pointer on slot A
- Update UI
chrome bay
#

If it's just a struct of arbitrary data, you can just swap the elements.

#

Same with anything really

#

the index of the array is your "slot" if you like

solar stirrup
#
struct FItemSlot
{
    GENERATED_USTRUCT_BODY()

public:

    int32 Quantity;
    FItem* Item;
};

That's the item slot

#

Is there a way to have empty slots then?

chrome bay
#

What's FItem?

solar stirrup
#

contains all of the data of an item

#

icon, meshes, details like max stack amount, health etc

chrome bay
#

You can't have UPROPERTY pointers to structs, so you can't replicate that

#

It looks like it's being overcomplicated

#

Here's what I'd do

#
USTRUCT()
struct FInventoryItem
{
    UPROPERTY() int32 NumItems;
    UPROPERTY() int32 ItemID;
}

UPROPERTY(ReplicatedUsing = "OnRep_Inventory")
TArray<FInventoryItem> Inventory

void OnRep_Inventory()
{
    UpdateUI();
}
solar stirrup
#

the thing is items can have things like durability

#

so I can't just save them by ID

chrome bay
#

Right, well in that case you can't replicate pointers to arbitrary data. The pointer has to point to some other replicated object, either an actor or a component etc.

#

In which case, you need something like this:

USTRUCT()
struct FInventorySlot
{
    UPROPERTY() AInventoryItem* SlotItems;
}

UPROPERTY(ReplicatedUsing = "OnRep_Inventory")
TArray<FInventorySlot> Inventory

void OnRep_Inventory()
{
    UpdateUI();
}
solar stirrup
#

bluuuuh

#

so make an actor for the item that holds data in a component?

chrome bay
#

that or an actor that holds the data itself

solar stirrup
#

oh right actors can hold data too i'm stupid

chrome bay
#

In my case I have a chain:
AInventoryItem->AEquippableItem->AWeapon... etc

solar stirrup
#

welp guess I'll do that

thin stratus
#

I usually do mine via ActorComponents

#

So I can slap that Inventory stuff onto everything that needs it

solar stirrup
#

I don't know how the fuck it worked in Blueprints

thin stratus
#

One ActorComponent for the Inventory itself

solar stirrup
#

yea

thin stratus
#

And one for Managing the interaction between two Components

#

E.g. Move Item from Chest to PlayerInventory

#

Spend quite some time on a regular inventory, like you'd see it in RPGs.

#

That's on the Marketplace right now, just in case you want to learn from looking at existing stuff

#

BP only though

chrome bay
#

Yeah loads of different ways to do it. In my case I have:

-> Stores a Tarray of: UHardpointSlot::UObject
      -> Stores a pointer to ASomeWeapon::AActor```
solar stirrup
#

the more I dive into converting the blueprints, the more complicated it becomes mmLul

thin stratus
#

Yeah in my case it's a struct that sits in the array

#

That holds an FName for a dataTable (static information) and then values that are dynamic

chrome bay
#

@solar stirrup It's more that as you go into C++ you find better ways of doing things 😄

thin stratus
#

Yeah definitaly

#

Specially Struct inheritance

solar stirrup
#

okay looks like there is an actor for items in Blueprints

#

Don't understand how it works tho

#

welp time to figure out

chrome bay
#

tbh I find writing inventory systems kind of theraputic 😄

#

I'd just like to get away from the overly-OOP style mine uses atm

#

But UE cried itself to sleep last time I tried to replicate a pointer to an interface

ivory portal
#

I think I am overseeing something. An actor from the server (not player or anything, just a building or something). When he has variables with OnRep, do these OnRep also execute on non-owning clients?

chrome bay
#

They do

ivory portal
#

Because I am now just doing onrep of a bool with just a print but the print only executes on the server 😕

chrome bay
#

Is the actor spawned by the Server?

#

Or pre-placed in the level?

#

Not that it should matter IIRC

ivory portal
#

pre-placed in the level

chrome bay
#

So yeah in theory if the bool starts off at "false" and the server changes it to true, the on rep should fire for that actor

#

If it doesn't, out of interest, what happens when you uncheck Net Load On Client

ivory portal
#

Maybe I'm doing it wrong there

#

Can only the server set is false?

chrome bay
#

Well it can set it to anything, but the OnRep won't fire if the client has changed the value locally

#

OnRep's will only fire if the received value from the server differs from the current local value

#

So if you're changing the value on Server and Client, you'll potentially get sync issues

#

In C++, you can tag the variable with REPNOTIFY_Always, in which case the OnRep will fire whenever the server sends the value, not just when it changes from the local one

#

I'm not sure if BP has that

ivory portal
#

Oh my

#

put me in the shamebox

#

(I forgot to replicate the Actor itself)

chrome bay
#

Haha yeah that'll be it

#

Yeah it looks like BP doesn't have RepNotify_Always (it would in theory go where RepNotify is)

ivory portal
#

I only replicated variables and components and was pulling my hair why nothing was working

solar stirrup
#

@chrome bay quick question, since you use actors for items, do you make the invisible when they're in the inventory and then make them visible if you drop them?

chrome bay
#

I don't really have a concept of dropping in this case, but yeah they are hidden when unequipped

#

It's up to the item to decide what it does when equip/unequipped though

timber anchor
#

Guys basically client won't destroy the actors of his body meanwhile the host of course will

#

basically i need to replicatete destroy function?

real yacht
#

@thin stratus can you explain me this table please, because i'm not sure about client-server replication in some cases

thin stratus
#

It basically shows what happens if an RPCs is invoked from either Client and Server.

#

And how the Actor Ownership changes the outcome

unique thunder
#

Can a widget access the GameState properly? It seems to work sometimes which is what makes it confusing because I know widgets aren't replicated and anything in the GameState that exists on the server should not be accessible by the widget itself. But sometimes it is.

thin stratus
#

E:g. Lower Table shows all RPCs that are issued by a Client

#

First row means the RPC is issued by a Client on an Actor they own

#

Like the PlayerController

#

ServerRPC runs on the Server

#

Etc.

#

If the Client calls a ServerRPC a not owned Actor

#

It's dropped

#

Rest you can read out of the table

#

@unique thunder Of course you can access the GameState

#

GameMODE is what is not available

real yacht
#

can you give me example when actor is owned by other client and RPC invoked on Server

#

?

unique thunder
#

Hmm .. here's what I've got:

  1. GameInstance BeginPlay > checks a few variables, sets them, then server travels.
  2. GameState BeginPlay > casts to GameInstance and retrieves variables.
  3. Player joins server > creates widget > widget casts to GameState to retrieve variables.

The variables the widget ends up with are the default ones I enter in the editor, not the ones the GameInstance overrides on its beginplay prior to server travel.
Could this be because the GameState retrieves the default variables on BeginPlay but does not re-initialize after the server travel to retrieve the updated ones?

Since a server travel occurs, the GameState beginplay should re-initialize, casting to the GameInstance and retrieving the updated variables.

real yacht
#

@thin stratus

thin stratus
#

That's the top most row

real yacht
#

so if game Mode spawn pickup that pickup is owned by server?

thin stratus
#

That depends on what you pass as owner

#

Server has to spawn Replicated Actors anyway

#

Doesn't matter where you do that as long as you do it on the Server side

#

And then you can pass a PlayerController as owner (or anyother client owned actor) if you want

fallen oracle
#

Hello
I've made a cooldown on jump for my character. Its just a simple float, decreasing by deltasec in tick.
CanJumpInternal function overridden, checks if the float is bigger than 0, then it cannot jump. Im setting the float in the "OnJumped" function
However, when playing with 4 players, sometimes, very rarely it happens that the character jumps on client, but not on server, so the character gets snapped back on client side.
I'm thinking that maybe the client is ahead, and it's cooldown is down, but when the server gets the event, it still has a small cd.
I think it's caused by the way unreal replicates the movement (queues up the moves, and executes them in a fixed time rate, so in one tick, it could process several move commands). That causes some desync between the actual move (and the jump), and the character's jump cooldown.

Now I could just go ahead and ignore the CD on the server, and keep it on the client, but that is a bit hackish.
I could use timers too, but I think i would run into the same problem.

Any advices on how to solve this?

pure abyss
#

Can some one tell me what should I do to get UOnlineBlueprintCallProxyBase::Activate() called?

thin stratus
#

That should call by default

#

Just follow the existing callproxy classes

#

I also made a ue4 stream tutorial about them, exposing the steam friend list

fringe dove
#

Steamworks SDK v1.44 - New Networking APIs

#

supposedly gives big latency improvements

chrome bay
#

100% reliable NAT traversal

#

bois

bitter oriole
#

🔥

chrome bay
#

about bloody time I say!

bitter oriole
#

How bad was the existing one ? NAT punch was working well already wasn't it ?

chrome bay
#

I don't think it worked at all, I seem to remember UWorks or something had some huge issues with it

bitter oriole
#

🤔 I thought it was working well

#

Or was UE4 using another punch library ?

chrome bay
#

I think it was in regards to player hosting servers or something.. players had to forward ports or something

#

I can't remember now haha

bitter oriole
#

This is the stuff I want to do so you've got me worried here 😛

#

My understanding was that Steam packed its own NAT punch, UE4 using either that or another library, everything working out of the box

chrome bay
#

There's a few old threads around saying it didn't work or something.

#

Ah here we go.. although this is super old

#

Apparently steam does do the NAT punch before.. maybe it wasn't super reliable?

#

UWorks dude would know

bitter oriole
#

Yeah I can see the existing tech not being 100% reliable

#

Anyway I'll learn soon I guess

sharp pagoda
#

Steam networking uses libjingle which implements ICE (reliable traversal) and iirc falls back on the steam proxy backend if you're in a situation with symmetric NAT etc, so I don't think "100% reliable" is anything new... @chrome bay

bitter oriole
#

Thanks for the details Xenonic

fleet raven
#

wait, games using steam networking can use this relay network for reduced latency without extra cost?

#

am I understanding that correctly?

bitter oriole
#

The relay network adds latency

#

I mean if we're talking about the NAT fallback ?

fleet raven
#

they're saying it reduces latency by using better routes than the open internet

#

I'm talking about the post linked above

bitter oriole
#

Ah, the new one then, don't know

fleet raven
bitter oriole
#

"No extra cost" meaning "as part of 30%" then

fleet raven
#

yes

bitter oriole
#

Still a pretty good thing

fleet raven
#

something actually useful in return for the 30%

bitter oriole
#

Yes

fleet raven
chrome bay
#

Ah okay.. I wonder what the issue was with UWorks then

sharp pagoda
#

Yea zeblote using their custom routes really is only beneficial for long distance connections + bloated routes. Fiber connections within the same country are probably always going to beat their system

fleet raven
#

can you do both? connect through this and directly and use the one with less latency

sharp pagoda
#

In theory yes

#

I haven't looked at their api though

fleet raven
#

they're saying this protects game servers from ddos attacks

#

so exposing directly is probably a terrible idea

sharp pagoda
#

Yea that's one of the biggest benefits of their backend imo

#

IP masking

#

If you're hosting dedicated servers though... I would rather implement my own mitigation infrastructure than suffer the latency costs

fleet raven
#

I'm expecting player hosted servers with usually long distance connections

tropic snow
#

why does my game run faster in stand alone, built, but when uploaded to steam and hosting it slows down?

#

theres hitches/stutters

fleet raven
#

use the profiler

tropic snow
#

actually it lags on the package build

#

and i did game, draw output seems fine. I testing in a simple level fps is fine too in standalone and no stuttering

#

when package even on the simple level the game stutters

bitter oriole
#

profile it

#

If you're sure it's a performance issue (missed frames)

#

If it's not performance related (solid framerate but teleporting objects) then your multiplayer code has issues

tropic snow
#

I think I found the issue it was a fullscreen issue.

#

created a DefaultGameUserSettings.ini on the config folder

#

runs like editor now.

#

inside I added this : [/Script/Engine.GameUserSettings]
bUseVSync=True
WindowPosX=-1
WindowPosY=-1
bUseDesktopResolutionForFullscreen=True
FullscreenMode=0
LastConfirmedFullscreenMode=0
Version=5

mild forge
#

Is there any detailed guide for projectiles&weapons for multiplayer?

#

c++ prefered

timber anchor
#

[2019.03.15-00.38.08:252][798]LogScript: Warning: Script Msg: Modulo by zero

#

Anyome knows the origin or this error?

#

Dedicated server won't spawn my charact

winged badger
#

best guess you did a remainder of division by zero somewhere

#

odds are that it either caused your spawning logic not to execute at all

#

or caused a NaN in the SpawnTransform

#

in 2nd case you have a LogSpawn OutputLog entry explaining it

#

@mild forge i believe ShooterGame template is closest you'll get to defailed "guide"

mild forge
#

Okay I will check it, thanks

timber anchor
#

@winged badger the only calculation i have is a conversion from float to integer

#

So i don't think this is the problem

thin stratus
#

Easy enough to test, right? Remove the conversion and test again

mild forge
#

I am converting a Pawn to be a Character, so I wont need to handle movement in tick manually, however the bound method was never called when the keys are pressed.

thin stratus
#

@mild forge FireShoot

#

vs FireShot

tranquil steeple
#

All the resources I can find about doing player hosted sessions either use LAN or Steam. Is there an alternative online subsystem out there? Just want to explore all my options before I settle on steam.

fringe dove
#

@tranquil steeple just stick to the generic subsystem interfaces as much as possible and you can move between them in the future

#

epic has some stuff on the way related to it:

tranquil steeple
#

Thanks, @fringe dove

unborn nimbus
#

Anyone use gamelift? I'm trying to deploy my server to AWS but it's saying the server crashed and I have no idea how to access the log

tranquil steeple
#

No way to use Steam's subsystem without giving them that $100 eh?

bitter oriole
#

Yeah

#

The $100 is more than just the online infrastructure though

#

GOG has an online subsystem too (good luck getting on GOG)

#

Creating a new, independent subsystem is a good idea, like Epic themselves did

#

But it's a lot of work unrelated to your actual game, and you'll need people to use separate accounts just for your game, which will annoy most of your clients

fleet raven
#

if a game has separate accounts but is sold on steam, ideally it would just auto-register one when they launch it for the first time without taking much time away before it can be played

chilly mason
#

noob multiplayer question: if I have my player controller invoke Broadcast() on a delegate that's sitting on a component attached to an actor that is not possessed by said controller... will that call get invoked on server, owning client, other clients, none, all?...

#

the actor being a character that's replicated

thin stratus
#

The Component uses the Actor

#

So whatever rules count for the Actor will count for the Component

#

Given it's marked as replicated

#

Also "Broadcast" and "Delegates" have nothing to do with networking

#

The call will get invoked on the side you called Broadcast on

#

@chilly mason

chilly mason
#

@thin stratus thanks, so if I'm calling broadcast from a client it'll never reach the server, correct?

thin stratus
#

As said, Delegates have nothing to do with networking

#

RPCs are used to move from OwningClient to Server, Server to OwningClient, or Server to All (who have a copy of it)

brave moon
#

Does anyone know what is the recommended number of players for listen server, is 10 to much ? Because when i open the same project 3 times and play it doesn't have any problems, but when i open 10 project there are some problems like some player names are not loaded, can't hit ant player until server hit it... etc Don't know if it happens bcs im running 10 projects at once or is it network problems, would it work normal if i test it on 10 computers(need to find 9 people to test it)

thin stratus
#

Delegates are something totally different

#

@brave moon Well, technically, given UT can do that, UE4 without any extra stuff should be able to handle like 16-32 players ,depending on the game

#

Testing 10 games at once on the same PC is def not recommended

#

You are basically simulating the traffic and hardware resources of 10 games on one PC

#

That could totally lead to some issues

brave moon
#

@thin stratus thanks for the answer

main sentinel
#

Hey there!

How can I get the region from a session result? I want to display the country's flag of the server location

mild forge
#

@thin stratus The 'FireShoot' is the binding name it's working good to trigger fire action., my issue is the movement input is not triggering movement(MoveForward, MoveRight) in my code.

gusty lily
#

i'm sure this is going to sound familiar to someone. in a server-client (non-dedi server) setup, both players spawn and possess their characters. both can move around and shoot etc. however, the client is not sending back any information on it's position to the server, and while it moves on it's end, the server doesnt see any update. It does see projectiles the client spawns etc. The client sees the server player as per expected. i'm not sure what i've changed, and character and character movement is replicated (checked). any ideas on why the client pawn is not moving on server end?

gusty lily
#

one weirdness is that this bug does not reproduce in the editor, maybe it only produce when the client joins after game start.

worthy perch
#

What version are you on?

gusty lily
#

4.21.2

#

@worthy perch thx

#

and before that, from character and controller, but i think that is not connected because the issue occurs before any respawn/death of character

worthy perch
#

What is the Player class's Auto Possess setting?

gusty lily
#

hmmm... where is this option?

worthy perch
#

Class Defaults in your Character/Pawn class.

gusty lily
#

"disabled" on character BP

worthy perch
#

Can you post a picture of your Character's Class Defaults settings? I'm a bit out of guesses of what could be wrong.

gusty lily
#

sure

worthy perch
#

And the replication category settings under that?

gusty lily
worthy perch
#

Hmm... that respawn function in your GM, is that the only place it's called? Can you make it not an RPC -- not Run On Server? It would already be only available on server anyway.

gusty lily
#

ah ok. yes i think that is the only place it is called but will check

#

it is called from player controller also

#

bbut only on death

#

which is after this bug

#

but i will test with replication off on respawn and get back to you i guess

#

<- player ccontroller

worthy perch
#

Just for the sake of testing, can you not call it in your PlayerController and make it not an RPC?

gusty lily
#

ok will do and will get back to you.

worthy perch
#

Also, OnPostLogin, if you right click on that node, select Add Call to Parent Function.

#

I think the Add Call to Parent Function will fix it.

#

This is in AGameModeBase::PostLogin, and it does sounds related to your issue.

// Notify Blueprints that a new player has logged in.  Calling it here, because this is the first time that the PlayerController can take RPCs
    K2_PostLogin(NewPlayer);
gusty lily
#

ah ok

#

a semi related question. in the screen above i reference a particular gamemode in player controller. i've done this because a bunch of tutorials had a similar setup. but what if i want to add other gamemodes? do i also need new player contrllers for them?

worthy perch
#

You could use an interface.

#

You shouldn't do this, but just for the sake of telling you, you could just do a series of casts and see if any of those succeed.

#

Did Add Call to Parent Func work?

gusty lily
#

just uploading on second machine to test

worthy perch
#

Wait, damn, I misunderstood what OnPostLogin was.

gusty lily
#

no that did not affect anything. i tested changing the rpc to play unreplicated and also added a call to parent function on the respawn event

#

oh sorry on the post login event

#

actually i only tested the call to parent function

#

my bad

#

will now test that and also an unreplicated respawn event

#

ps i am using steam for nat punching, but i am sure this issue exist in normal client connection

#

negative

#

thanks for your help. let me know if you or anyone has any ideas. i will test when i get back from walkies

worthy perch
#

I am out of ideas. But if everything else works fine, then it is probably something on your character class.

gusty lily
#

gotcha. cheers.

safe marsh
#

hey, have a question regarding replication/rpc

#

I have a server which has a moving platform, when a client connects the platform movement initializes and it is out of sync with the server

#

whats the best way to synchronize them?

#

right now when I try to jump on the platform on the client I fall through it

thin stratus
#

@mild forge Wasn't sure if it was a typo. Thought your binding has the same name as the function. :P

#

You could try to mark the Move function with a UFUNCTION()

#

Both of them

meager spade
#

@safe marsh you need to replicate the position vector of the platform

#

so when clients join the state of the platform is already set, you can handle this with a onrep call that teleports the platform to the servers position, but there is a few ways you can handle it

safe marsh
#

I am using an interpTomovement component in bp

#

to drive the position

#

I thought that kind of stuff was handled with the actor movement replication flag

safe marsh
#

doesnt seem to be a way to update the position using this component

#

the actor and all components are set to replicate, but they dont synchronize

jade gazelle
#

Can a TSoftObjPointer not be passed in an RPC? Basically I just need the FSoftObjectPath it contains, so I got it work by switching the RPC param to that instead

#

Just curious at this point

safe marsh
#

well the solution was something like this, freeze the platforms on the client until they loop around a sync with the server and start them all

#

uses less bandwidth than updating the location of the platform all the time, seems like InterpToMovement doesnt have a function in bp that can initalize the movement of a client platform at a certain % of the loop so they sync up on beginplay

mild forge
#

@cedric_eXi#4538 I will try it, thanks

solar stirrup
#

Can a client execute a multicast RPC on the server?

#

Just thinking this out, it's for a "DestroyItem" RPC that destroys an actor on every client including the server

#

The client should be able to invoke the RPC if he owns the item

worthy perch
#

Have the client tell the server to delete that actor. When destroy is called on a replicating actor from the server, the destroy will also propagate to all clients with that actor.

solar stirrup
#

the compendium says something about doing that in the PlayerController

#

through an interface

#

I guess that could work

#

since the client can only destroy things in its own inventory or an inventory it looks like

inner hedge
#

Anyone here happens to know why there's always a 60% chance that the other player doesn't spawn? https://puu.sh/D0SqX/3e4a5b1769.png
The playerstarts are set to Always spawn, Ignore collisions
The playerstarts are floating above the ground

meager spade
#

is there something blocking the player start?

#

it sounds odd

#

i can spawn lots of pawns in the same start

inner hedge
#

Second player is being spawned in through: UGameplayStatics::CreatePlayer( (UObject*)GetWorld(), -1, true ); Same in BP

cedar finch
#

So I have my own variable that stores my playername. I used it to set the playername widget above my head. My issue is that it sets all player's widgets to my name. So if Player 1's name is Whippy then he see's everyones name as Whippy. But Player 2 see's everyone's name as his. So if Player 2's name is MemeKing then he see's everyone's name as MemeKing. I'm not sure what I did wrong in the replication. I stored the playername variable inside playerstate and then retrieve the variable inside my widget

solar stirrup
#

If I want to replicate an FDataRowHandle for an item, can I actually do this?

UPROPERTY(Replicated)
FDataRowHandle Item;
#

or should I use a unique item id

worthy perch
#

You should probably use the unique item id. It would save net bandwidth.

solar stirrup
#

alright

cedar finch
#

I'm struglging with weapon sounds and replication. I have an animNotify for my reload sound but everyone in the game can hear it when a person reloads. What do I need to do to fix it? Does it have something to do with Mono and Stereo?

heady delta
#

probably your attenuation settings

winged badger
#

@inner hedge there is a LogSpawn entnry in OutputLog for every failed spawn, usually giving you an understandable reason why it failed

#

warning category

inner hedge
#

Oh yeah, it just said it failed at the spawn location..
No other actor or anything useful really :(

winged badger
#

you said the PlayerStarts are set to AlwaysSpawn, IgnoreCollision, i assume you meant PlayerPawns?

inner hedge
#

Uh, no, the player start actor :o

winged badger
#

they are not preplaced on map?

#

because that is the... usual way to use them

inner hedge
#

Is it?
Isn't the usual way to have the spawned in?

#

Them*

winged badger
#

mine are preplaced on map

#

i have overriden the ChoosePlayerStart function in GameMode

#

to pick one

#

its just that you are introducing another failure point if you start spawning players before your PlayerStarts are spawned

severe widget
#

The usual way to "use" a pawn is to have it spawned in

#

via playerstart

winged badger
#

he said his PlayerStarts are AlwaysSpawn, IgnoreCollision

#

so i was talking about those

severe widget
#

the playerstarts should be pre-placed

inner hedge
#

They should get spawned in at Beginplay which is after handleinprogress()

#

They are

severe widget
#

So then its something else

winged badger
#

i spawn my players from HandleStartingNewPlayer override

#

i never spawn them at the exact same location tho

#

because while your PlayerStartActor might be set to AlwaysSpawn, that doesn't extend to your PlayerPawns

inner hedge
#

It doesn't ? O_o

winged badger
#

and depending on your collision and physics settings, in most cases, even if you manage to Spawn several players at same location, chances are one or more will get catapulted into orbit because their colliders will overlap when they spawn in

inner hedge
#

So the spawn collision setting on the spawn point are to regulate the spawn behavior of the spawner itself? -_-