#multiplayer

1 messages ยท Page 423 of 1

cloud ledge
#

It's probably half-baked lol

thin stratus
#

Steam for example doesn't implement this

cloud ledge
#

I think this is just half-baked future-proofing of some sort

#

But I'm not sure!

celest falcon
#

Alrighty, thanks anyways, seems like it'll have to be a custom solution

thin stratus
#

IOS seems to implement it

#

But that seems to be it :P

cloud ledge
#

@thin stratus it's probably something that's iOS specific then haha

thin stratus
#

Yeah

potent prairie
#

how do you set a dedicated server name? default is just my PC name and numbers

rose egret
#

I feel like packet simulation in editor is not working fine. because my ping is 200 but my properties are replicated every frame :))

thin stratus
#

@potent prairie In a Session?

#

You have to set it via one of the Session Keys

#

That's only possible in C++ or via Plugin

#

@rose egret Well, technically, if it's steady 200ms, it's normal that you replicate every frame :D

#

just 200ms later

#

So the first 200ms should be "no replication"

#

But I guess you want to make sure to actually enable the packet stuff for clients and server

rose egret
#

@thin stratus I mean I get OnRep_MyProperty on client every frame. how is that possible if ping is 200?

thin stratus
#

200ms delay

#

That doesn't mean your packages drop

#

It just means they come later

#

You are probably receiving old data

#

Just print the Timestamp for when you set and when you receive

#

And compare

rose egret
#

how properties are replicated? if I change my var on server every tick will it sends several onrep by one packet?

chrome bay
#

No. Property replication is lossy

#

You're not guaranteed to get every change to a variable, especially if it changes quickly

#

ping != packet loss

rose egret
#

@chrome bay I know that. but I am receiving on rep every frame on my client .

chrome bay
#

You will in editor, but you won't in a real world connection

jolly siren
#

Does anyone understand why there is a !bInRagdoll path in this ShooterGame function? Why would a character's mesh ever not exist? Or why would it already be pending kill when SetRagdollPhysics is called? Seems like there would be a better way to just guarantee that the character goes into ragdoll.

sharp pagoda
#

Looks like a safety net to kill the character immediately if the function were called from some unexpected location.

jolly siren
#

Right, trying to figure out where that unexpected location is. I think I'm running into this very rarely. But I haven't been able to reproduce it yet :/

thin stratus
#

Well you kinda never know if it's valid or not

#

Could happen that this is called while the world gets killed/map change or whatever

#

And suddenly it's pendingkill

#

And the second one just checks that the mesh exists and has a phy asset

#

Cause maybe someone does stupid testing without a mesh assigned

#

Who knows

#

If you work in a bigger team you kinda expect people to do bad stuff :D
That's why Setter/Getter public/private/projected exists

jolly siren
#

Yeah that makes sense. I'm just not sure if any of those checks could get hit in normal play. I'm assuming the mesh and phy asset one won't. But not certain about the IsPendingKill check. I'm not sure if there is some scenario where SetRagdollPhysics could get called on the client after pending kill is set.

earnest comet
#

Hello friends, a small question about multiplayer if I may!
I am making a 2D Fighting Game Template for Unreal 4, so people can make their cute 2d games.
I was wondering one thing. Can I code the netcode according to a dedicated server provider, so if they use that provider's servers, things would be way easier for them? -.O

PS: I have zero exp on how multiplayer works so sorry if it's too silly of a question ^^'

sharp pagoda
#

Can I code the netcode according to a dedicated server provider can you clarify?

earnest comet
#

I think the question is confusing because I have no idea how the netcoding works.

#

You see, I am planning my Template to have a netcode already provided so people can create their games if they want it to be a Multiplayer.

sharp pagoda
#

Alright, the short is don't worry about your server provider, dedicated servers are basically listen servers without a client attached.

earnest comet
#

But I don't know if I should code differently for different providers.

sharp pagoda
#

No

earnest comet
#

Ah, so in a very basic terms, a server becomes an Unreal 4 server that is open, and sending / storing data of games am I correct?

sharp pagoda
#

Uh

earnest comet
#

Sorry. ^-^''

sharp pagoda
#

Hm, for the sake of simplicity we'll assume you're using windows and deploying to windows. When you build your dedicated server you get an executable, just like the game executable, but stripped down to not include any rendering components.

#

A dedicated server is just a process, just like your game is

earnest comet
#

Ah, so people just join in and out.

#

I think you answered my question and I better check more about how dedicated servers work themselves, rather than asking more silly questions ^^

#

Thanks!

meager spade
#

dedicated server is just a headless version of your game

potent prairie
#

If people want to run their own dedicated servers for my game, how do they set the name of their servers to whatever they want?

brittle tulip
#

how am i able to get the player controller in a game instance?

swift topaz
#

I'm having a logistics conundrum. Trying to create dynamic locations. A location is an actor with actor components for everything that exists in that location. If I create several locations on a dedicated server, after a certain point, anyone that would join gets kicked out due to a reliable buffer overflow.

Clearly this has to be due to the sheer number of actor components that need to be replicated to everyone that joins. Is there a way to set netculldistance on actor components rather than actors?

stable arch
#

how would i set up a Auto Team balance system through blueprints?

fossil spoke
#

Check the number of players on each team, place the newly connecting player on the team with the least players?

deft ocean
#

ya you should be able to make a function like getSmallestTeam and have it do that logic and return the team with the smallest count

swift topaz
#

Trying to understand the data in the network profiler a bit better, does this value represent the number of properties being updated at this point in time?

stable arch
#

if i have my player teams in Enum how would i get the number of each connected player in that team?

copper portal
#

How can I make a widget that I can show to everyone?

meager spade
#

@stable arch you would probably want a TMap of the enum and number of players

thin stratus
#

@swift topaz Well it says PER SECOND above it

#

an hz is basically how much per second.
219.4 hz means 219.4 Properties per second I assume

#

No idea what 0.4 properties are though :D

#

Also for a "Per second" basis, you either have what happened the past second or what happend per second based on the whole time

#

Think that depends on what data you've selected

warm meadow
#

Guys I'm going crazy! Everything was working great then one day if I run with a dedicated server in the editor I have stutter every second, strange behavior (like set actor hidden called on the server not replicated on clients), things not spawning on the client correctly. I was so depressed yestedday ๐Ÿ˜ฆ and some hours before everything was running great!

thin stratus
#

Is there a way to limit visiblity of Actors or rather components in Splitscreen?

#

We have a 3D healthbar that orientates to the player camera.
That works well in Online situations as there is only one camera

#

But splitscreen has up to 3 cameras looking at one enemy

#

So it would need 3 WidgetComponents where each orientates to one player

#

However even with that, one player could see the Widget of another, cause there is no such thing as "OwnerOnly" in this setup

#

Only thing I can try is adding a widget into the PlayerScreen

winged badger
#

tried making the HUD create it and manage it?

#

it won't work out of the box, but it is close enough, shouldn't be too much work required

rapid ice
#

Guys I want a little bit of direction. I have created an fps environment with a character and a gun. I just need a little bit of hint to how I should implement multiplayer and have two same characters going against each other. Sorry if I sound ignorant...

twin vault
#

@rapid ice start by reading the multiplayer architecture, basically you will have two characters with movement already implemented (if they are a subclass from ACharacter), and you would need to implement stuff like Replicating shooting, replicating health, through Replicated Variables and RPCs

swift topaz
#

Is there a way to limit the amount of default properties needing to update when an actor is spawned in multiplayer?

rapid ice
#

Thank you very much @twin vault

bold heron
#

Is there a way to get all replicated properties on an actor? I'm looking to modify them in the PreReplication override.

winged badger
#

probably over TArray<FLifetimeProperty> @bold heron

#

its where i start anyways, the one GetLifetimeReplicatedProps uses

#

@swift topaz only replicated properties will be sent in initial bunch

#

rest of them will be pulled from CDO from the package

bold heron
#

awesome. I was digging through UChannel to see how it did it ๐Ÿ˜ƒ

winged badger
#

you should have all PropertyNames there

#

from there you can find UProperty*

swift topaz
#

219.4 properties for 1 actor spawned in initial bunch seems a bit odd

winged badger
#

any non integer number of properties seems a bit off ๐Ÿ˜„

#

for 1 Actor

#

besides, 1 Actor won't send bunches more often then its NetUpdateFrequency

#

or FPS, whichever is lower

swift topaz
#

I thought that was the thing as well

#

The network profiler however, is making me doubt things, or I just don't know how to interpret the results properly

#

Ran a dedicated server with 1 client via PIE and did a short capture for spawning 1 actor, which gave me that spike of 219.4 properties per second being modified at the exact spawn time

winged badger
#

yeah, but 1 frame can throw those off really bad

#

then your actual number of replicated properties is 219.4 * DeltaTime

#

so be careful when dealing with intervals of under 1 second

swift topaz
#

Gotcha

bold heron
#

@winged badger I'm looking at FLitetimeProperty and don't see how it converts to a property I can do something to. I can get it's RepIndex but that has to associate with something somewhere.

winged badger
#

there is a TMap of RepIndex to something.... somewhere

#

sorry, haven't dived into that

#

comments in NetSerialization.h do explain how those work

bold heron
#

awesome thanks. I'll look into it more. All I need is a direction and I'll chase the lead.

winged badger
#

as a bonus you get a crash course in FFastArraySerialization

dusty halo
#

Evening guys

#

Question

#

Any idea why, when I set up custom spawn point it rotates server but not client? It teleports and everything is ok, but rotstion makes problem

bold heron
#

I found that an actors world rotation was not marked as replicated in code.

#

@dusty halo

#

relative rotation was though (if I remember corectly)

#

you could also multicast from the server to the clients to update the rotations

copper portal
#

@thin stratus can u send me some code that u used to make a widget show for everyone?

dusty halo
#

@bold heron i guess I found and issue. Only now need to figure out why. So I have BP that rotates player to camera direction. If I turn it off I can rotate player in a direction I want, but still camera stay at wrong dirrection.

#

So basicly I need to find a way how to replicate control rotation

#

Becouse if I play as server, everything is ok

thin stratus
#

@copper portal I don't have the time to create a code example.
If you are getting all Actors of class and call a ClientRPC on that, then this should work.
It only depends on WHEN are you calling this. And I think you never showed where/when you call this.

potent hazel
#

good morning lads !

#

I've got an issue with the new Studio template, "Multi User Viewer", somehow it looks like clients can't see servers and vice versa

#

this is regarding matchmaking btw, not once a question of "players can't see eachother in the scene" :p

potent hazel
#

join over ip isn't doing much either

potent hazel
#

right so it seems like LAN with two exes running on the same computer is working at least

rose egret
#

Muticast RPC with const MyStruct& param is empty on client. but valid if I remove the refrence. why? isn't it a bug?

#

``
USTRUCT()
struct FPathMoveRepPath
{
GENERATED_USTRUCT_BODY()

UPROPERTY()
TArray<FVector> Positions;
UPROPERTY()
int Size;

};
UFUNCTION(NetMulticast, Unreliable)
void CastPathMovePath(FPathMoveRepPath path); //this one works well
UFUNCTION(NetMulticast, Unreliable)
void CastPathMovePath(const FPathMoveRepPath &path); //path is empty on client side
``

wary wyvern
#

Hey guys! Is it possible to add one more client while using PIE?

winged badger
#

you just enter the number of players from play menu

#

@rose egret pointers are not replicated as memory addresses, but as NetGUIDs

#

structs don't have NetGUIDs

rose egret
#

@winged badger I know that but its a const refrence to a structure. UE4 must know that :)
Not using refrence will copy my object which has lots of data in it

winged badger
#

as far as i understand it, you actually need to copy something from the stack to send it

#

anyways, if you are sending it over network isn't the overhead of local copy the least of your concerns?

rose egret
#

btw as far as I remember UE4 force u to use & for FString and TArray when used as RPC parameters

wary wyvern
#

@winged badger I need to add player while i'm playing, not before

winged badger
#

i very rarely send anything but an int32 as RPC payload

#

so not sure about that

rose egret
#

@winged badger I send nearly 200 byte every second by one muticast rpc

#

one more thing. its NetSerialize doesn't get called ๐Ÿ˜ƒ

#

๐Ÿ˜ฆ

winged badger
#

that is a little bit odd

#

i know it goes to UNetDriver::ProcessRemoteFunction()

#

can't say i've ever read it

proper olive
#

heya folks, so I know the controller only exists on client and server (doesn't replicate to other clients)... I'm curious if the server's controller also exists on clients? Or is there only one instance of the server's controller among all machines? I'm trying to create a reference to the server's controller, so I can check "is this the server's controller" before doing things, but not sure I'm conceptualizing it right

narrow ingot
#

@wary wyvern if you launch the game from the project file use join 127.0.0.1 (console command with ~), if it's someone else on another PC, I know they can launch from project file (I think PIE might work for them) and they need to join YOUR+IP, you also might have to find your server PIE window and open MAP-NAME?listen, then use the join commands on your other PIE windows to reconnect

plain flume
#

Anybody used the Min Net Update Frequency? Any real life scenario when it has been useful?

static lynx
#

anyone have any idea why my pawn collision moves in single player, but not in multiplayer?

#

the collsion channels and physics are all set correctly.

#

but the line trace will hit the ship in single player, but in multiplayer, it will ONLY hit the original location of the ship, but not any of the updated positions.

slate veldt
#

When you first join a multiplayer game as a client, you go through the PostLogin on Hostside which then (at least in the shooter game example) sets up your spectator camera position on your Player Controller.

2 questions about that:

  • Does it spawn the game mode spectator pawn? Or does it use something else?
  • When ending a game and seamlessly travelling into the "next match" I don't believe the client player goes through the PostLogin function (as they are already logged in from before). So how do we change their pawn/set their spectator location?
swift topaz
#

@slate veldt

  • Yes it uses the same spectator pawn that is defined in the GameMode available on the server.
  • If you plan on starting a new game, Epic recommends not using Seamless Travel as it keeps several pieces alive (such as a character), if you rather use Seamless Travel, then you will need to do your own logic to reload a player's relevant state and pawn
#

Does anyone know if there's a way to figure out when a client has finished acquiring all replicated objects after connecting to a server?

thin stratus
#

Steam forces you to use Seamless Travel (in case you use it)

#
  • Epic also says Seamless Travel is desired
#

You can use "OnSwapPlayerControllers"

#

As well as things like "InitNewPlayer" or whatever the function is called

#

That's called for both forms of Travel

swift topaz
#

Didn't know steam forced seamless travel though

#

Good to know

next falcon
#

Hey i try to save my playerdata
In my gamemode on EventEndPlay a loop for each playercontroller and try to get the characters of it but the are already destroyed ?? how could i fix that ?

slate veldt
#

@swift topaz @thin stratus Thanks and thanks ๐Ÿ˜ƒ Seamless travel is preferable where possible, both for a smoother experience + the fact we're a VR game so I would like to avoid absolute as much as possible.

I'm aware there is a VR splash screen, but I want to utilise this as little as possible, it sorta feels like you're pulling them out of the immersion everytime you use it.

swift topaz
#

I gotcha, use case always counts :p

stable arch
#

if the host of the listen sever disconnects how would i go about making it switch to next player as host?

copper portal
#

to get the next player you can use the get player array from get game state and get a copy of the first player in the array

#

I dont know how to switch the player to host

#

did u use google yet?

#

for switching hosts?

stable arch
#

use google for switching host?

copper portal
#

just search and see if you can find anything

#

@stable arch

slender yarrow
#

has anyone dealt with this error before? :
Network Failure: GameNetDriver[NetDriverListenFailure]: SteamSockets: binding to port 7777 failed (0)

#

im trying to create a lobby using the steam subsystem. Ive made 3 diferent projects and I keep getting this error in th log that cuase the lobby to crash

fringe dove
#

@stable arch I don't think there is any built in support for host failover

#

@slender yarrow that sounds like something else is bound on the port

#

run cmd.exe as administrator and type netstat -a -b

#

and find what is bound on 7777

#

might be a firewall thing too

slender yarrow
#

@fringe dove i got it. Was some setting i left out in the DefaultEngine.ini regarding the steam subsystem

#

thanks for the reply

thin stratus
#

@swift topaz I think "When you want to end and start a new one." Is a bit vague. I read this as disconnecting from a server and connecting to a new one.
Not when moving on the same server from map to map ๐Ÿค”

covert garden
#

built-in's UE4 can create MMO game?

thin stratus
#

@covert garden Maybe now that there is access to the Replication Graph.

#

But def not if you are staying in Blueprints.

#

Doubt that even 100 Players would work with BPs only.

wary wyvern
#

In multiplayer game, when client crashes, server does not handle it and player state stays there for some time. Does anybody know, where is this timeout for removing player state, or how to check, if player disconnected by crash?

thin stratus
#

GameMode Class

wary wyvern
#

Oh, thanks)

thin stratus
#

No idea on the crash

#

cause that's pretty much not available to the server

wary wyvern
#

If player quits manually, it sends some sort of request, so player state removes instantly. But in case of crash, there is no requests and player state lives for some time. I also check server crash manually on client side (just in case ๐Ÿ˜‰ ), and i know there is built in checks on server side, just did not know where timeout is.

thin stratus
#

Is ALT+F4 a crash or a manual disconnect then though :P

wary wyvern
#

Manual

#

@thin stratus Hm, I'm cannot find this settings.. Is it in gamemode? Because I do not have this one

thin stratus
#

Yeah it's in the GameMode

wary wyvern
#

That's all I have

thin stratus
#

What Parent Class do you use

#

And what engine version

#

(even though that should be in most of the engine versions)

wary wyvern
#

Parent is AGameMode, 4.20

#

Hmm, I see it in source files, but it is hidden in editor despite the EditAnywhere UPROPERTY flag

thin stratus
#

strange

#

My screen is from 4.19

#

Maybe it changed

wary wyvern
#

But it is still there in sources

#

@thin stratus No such option in 4.19 as well..

#

Okay, I found the problem. My gamemode was AGameModeBase, not AGameMode %)

thin stratus
#

That's why I asked hehe

slate veldt
#

Hey all,
Following seamless travel, our clients are sat with a black screen until the next match starts (we switch to inprogress)

Can anyone think why this might occur?

thin stratus
#

Sounds like no PlayerController?

slate veldt
#

Ah, you think it might be getting destroyed during seamless travel and then recreated upon game start?

thin stratus
#

Well usually you have 2 instances

#

OnSwapPlayerController gives you the old and the new one

slate veldt
#

Cool I'll investigate

thin stratus
#

Can I hide a mesh based on ownership in splitscreen?

#

Seems like OwnerOnlySee also hides it for the actual local player owner :/

thin stratus
#

Calling "CreatePlayer" and then "RemovePlayer" doesn't let me call "CreatePlayer" again

#

gg

#

I mean, it does call, but after that I don't get the splitted screen anymore

slim holly
#

probably rendering issue?

#

I mean, probably a minor oversight on engine side to make sure to create the split screen again if player gets added second time

thin stratus
#

Probably. I also get an issue when with the camera of spawned ones if they aren't in order

#

e.g.

CreatePlayer->RemovePlayer->CreatePlayer(doesn't do shit)->CreatePlayer(camera at wrong place and doesn't possess pawn)

#

So each player can only be spawned once and has to be spawned in order

#

Even when using -1 as index (so it assigned itself). Weirdly enough another "CreatePlayer" call works then again

#

But as soon as I remove one player I can't readd

slim holly
#

issue with the player array perhaps?

#

if it inserts the new player instead of adding it, I could expect that kind of behavior

thin stratus
#

Actually, i just addsUnique

#

And it also doens't fail any test

#

Cause I get a PlayerController in the outliner

#

It's not possessing the pawns again after getting recreated

#

Handling the Possess myself now

#

Seems to fix it

#

Guess AutoPossess is broken

slim holly
#

they should just get rid of the autopossess

#

causes more trouble than benefit

thin stratus
#

There is still a bug though

#

It works all fine like this, but if I call the same code for Possessing offset, so first for player 3 then for player 2, player 3 bugs out

#

So the order of possessing a pawn seems to be important for splitscreen players

#

Player 2 needs to have a pawn before player 3 o.o

#

Strange enough it doesn't cause any issues when doing it in the gameplay level

#

So I'm not sure if I do something wrong

twin juniper
#

Im trying to use VaRest plugin to send data from ue4 to a database and i've been watching these tutorials: https://www.youtube.com/watch?v=CEQ860h4rKA the only issue is I cant seem to figure out how to send data from ue4 to the database, only how to retrieve it. Anyone know of any documentation or tutorials on how to go about doing this?

This tutorial has been made to show everyone how to make a full online system and game using UE4 Donation Link for the channel : http://tinyurl.com/WazzaFund...

โ–ถ Play video
swift topaz
#

I used VaRest a long time ago and am a bit rusty with it, but the concept behind sending the data should be the same as in a regular http request via the IHTTPRequest. Create a post request and add your post fields to the request then just target your php script and retrieve your data.

cedar finch
#

I set the ThirdPerson Character to the variable 'OwningPlayer' that way I can easily reference the variables for health, stamina, etc for my HUD stuff

thin stratus
#

@cedar finch Does that mean you fixed it?

#

Cause otherwise the error is pretty easy to explain

cedar finch
#

@thin stratus I didn't fix it. I'm open to any suggestions

thin stratus
#

Well you are creating the Widget once at the start I assume

#

@cedar finch

#

So when you Player dies, the "OwningPlayer" is getting cleared

#

Cause well, you Pawn is destroyed, so it doesn't exist anymore.

#

The Contruct won't be called again, so the Variable stays empty

#

What you can/should do is use teh "Possessed" event in the PlayerCharacter

#

Call a CLIENT RPC on the passed PlayerController

#

And in that ClientRPC you get your UI again and update the OwningPlayer

cedar finch
#

I was thinking the same thing but how does everything work for clients when they die and respawn? Server player doesnt work but clients do. It's wierd.

#

I didn't have this issue until I started using a BASE character with all my variables and code then using a child actor as what players actually play as. That's where my old respawn system stopped working. I think I may need to redo my respawn system

#

I handle everything in my Thirdperson player controller and gamemode. IDK if child actors use the same player controller or not

winged badger
#

@thin stratus @cedar finch AController::SetPawn(APawn *InPawn) is a conventient function to override

#

its called from both AController::Possess() and AController::OnRep_Pawn() and is virtual

cedar finch
#

@winged badger I still havent started to learn the code side of things I'm still wrapping my head around blueprints lol. I'm trying to follow cedric_eXi's instructions but can't figure out how to get it working yet. It makes perfect sense I'm just slow

#

I guess my struggle is where I'm supposed to handle the respawn and the creation of the new HUD. I have my character, my controller, and my gamemode. Inside my character I tell my controller to create the HUD on the owning client. Then when I die I call the respawn event inside my gamemode which should create the HUD the same way as before right? But I can't get it to work for both client and server its always one or the other. ๐Ÿ˜Ÿ

thin stratus
#

You only need to create the HUD once

#

Either in your PC (BeginPlay, filter by LocalPlayerController), or in your HUD.

#

The thing you need to do is keep your PlayerCharacter reference valid

#

You are setting it once at the Start, which is not enough, as the Player can die.
So you have to update it when the Player gets a new Pawn.

#

The Client RPC is already a good start

#

but you want to simply update the HUD instead of creating it again

#

(specially since you are probably not removing the HUD or?)

unique thunder
#

I spawn and attach an actor to my vehicle in multiplayer but after driving a bit, clients see the actor disappears but the server continues to see it. No idea what could possibly cause a bug like that, the attached actor isn't simulating physics and it's attached to a non-simulating scene component inside the vehicle. Any ideas? ๐Ÿค”

fringe dove
#

how frequently do reliable channels check for missing ack before a resend? do they use some estimation of half-RTT? anyone know where in the code to look?

sharp pagoda
#

@fringe dove I think that's handled in the MessagingRpc module, but not certain.

#

MESSAGE_RPC_RETRY_INTERVAL is the macro that defines how long to wait before resending it looks like.

fringe dove
#

@sharp pagoda thanks!

sharp pagoda
#
/** The interval at which calls are being re-sent to the server (in seconds). */
#define MESSAGE_RPC_RETRY_INTERVAL 1.0
fringe dove
#

damn, and it is big

#

@sharp pagoda ah wait, I might have asked the wrong thing

#

messaging rpc isn't the same as actor channel rpcs is it?

sharp pagoda
#

I think it is...

#

It's been a while since I've look at the message bus code, but I'm pretty sure RPCs construct net messages.

fringe dove
#

not completely sure, but I think it is for that message bus thing

#

oh ok, I thought that was totally separate

#

hmm

sharp pagoda
#

Yea it does use the message bus, but I thought the message bus sent out to the net driver. Would have to go digging for that though

#

EngineMessage module is for the non-networked message bus I think

fringe dove
#

yeah I just think actor channel stuff is still separate from the networked message bus too but could be wrong

#

I've just never ended up in there when stepping through actor rpcs in the debugger

sharp pagoda
#

Oh man I have a stack trace I think I saved which has the whole RPC process laid out

#

The online subsystem util's TickDispatch() is the first place to handle incoming RPCs, so working backwards from that should show if it uses the message bus or not.

winged badger
#

ProcessRemoteFunction() is in NetDriver

sharp pagoda
fringe dove
#

I think what I'm looking for might be here:

#

void ReliabilityHandlerComponent::Tick(float DeltaTime)
{
    const float CurrentTime = Handler->Time;

    if (CurrentTime - LastResendTime < ResendResolutionTime)
    {
        return;
    }

    LastResendTime = CurrentTime;

    // Resend UNACKED packets
    // We resend all packets just to make sure
    // This is very inefficient and wastes bandwidth, we will want to implement NAK version at some point
    for (int i = 0; i < BufferedPackets.Num(); i++)
    {
#

found from this part of UNetConnection::Tick:

    // Tick Handler
    if (Handler.IsValid())
    {
        Handler->Tick(FrameTime);

        // Resend any queued up raw packets (these come from the reliability handler)
        BufferedPacket* ResendPacket = Handler->GetQueuedRawPacket();
#

seems to be hardcoded to .1, that seems inefficient for >100ms half-RTT connections

#

mentions some stuff about naks though and I'm not sure how that plays into it

winged badger
#

then again, engine doesn't spam reliable RPCs

fringe dove
#

there would also be other acks coming that could stand in for the dropped ones

#

if you are sending a lot of data

#

so it would only happen on sparse reliable rpcs and they aren't a big bandwidth concern anyway

#

assuming it is per net connection and not per actor channel

winged badger
#

actor channels do not send data directly, only net connections do iirc

#

they do make FOutBunches

#

but NetConnection will only send the relevant ones

#

and reliable ones

#

regardless of relevancy

fringe dove
#

I would like the ability to peek at reliable RPCs that arrive out of order or after a drop

#

cause in some cases I can fill in the gaps using the future one

sharp pagoda
#
/**
 * Interface for RPC calls.
 *
 * Every time an RPC call is made, a request message containing the call parameters is
 * sent to the remote endpoint. While the remote endpoint is executing the call, it may
 * send back progress updates in regular intervals. Once the call is complete, the remote
 * endpoint sends a response message containing the result.
 */
class IMessageRpcCall

so now where does MESSAGE_RPC_RETRY_INTERVAL come into play in all of this? ๐Ÿค” Is the MessagingRpc module used for sending cross process messages, not network messages?

fringe dove
#

I think it is for cross process stuff

#

but can be networked also

#

mainly used for things like distributed lightmass, but not used in game networking

#

they used it to make an ipad control a desktop for the mcclaren demo thing

sharp pagoda
#

Interesting, sorry for misleading you a bit haha

winged badger
#

not sure MessagingModule works without debug build

fringe dove
#

np, I'm still not 100% sure on that, and I'm going to need to look into the message bus at some point for some other stuff

winged badger
#

@fringe dove give the GameplayPrediction.h a read

#

starts with few hundred lines of comments

#

might find some hint there without the effort of digging through the source

fringe dove
#

@winged badger cool, I'll check that out

cedar finch
#

@thin stratus I am removing it but I guess I can just Hide it by changing it's visibility when a player is dead and spectating. Then I can make it visible when they respawn. I can't figure out how to set my new character reference in my HUD widget though. Once I respawn the player inside my gamemode, how do I set the 'OwningPlayer' variable inside my HUD widget? I can't cast to it can I? So I guess I'll have to use a get all widgets of class and somehow set it inside a foreach loop or something.

winter zenith
#

Hi everyone. I'm having a problem with actions being performed quickly on newly joined clients. My guess is that everything hasn't fully finished replicated, in this case, Controller via GetController(). The problem is I'm having trouble checking to even see if Controller is valid or not. IsValid or checking against nullptr doesn't seem to work. I'm hoping there is just a mechanism I'm missing for being able to check to see if a variable has in-fact been correctly replicated, or at least not have Controller default to a non-nullptr value. Thanks ๐Ÿ˜ƒ

#

what I'm trying to call out of interest is GetController()->IsLocalPlayerController() to determine if the actor (character) is locally controller for some logic, though checking the result of GetController() beforehand using either IsValid or != nullptr. no dice ๐Ÿ˜ฆ

thin stratus
#

@cedar finch Well I kinda already told you how :D

#

Assuming your Widget is created and stored in the PlayerController:

In your Character, "Event OnPosessesed" -> ClientRPC on passed PlayerController Reference -> In that ClientRPC, get the Widget Reference (as said, assuming it's created and stored in your PC), and pass the "GetControllerPawn" over to the Widget.

#

And if you really can't figure it out, just poll the "GetPlayerCharacter0" in your binding for now (make sure to check that it's valid).
And only try to improve this if you notice performance issues.

cedar finch
#

@thin stratus Thanks for your help. I get what your saying and I've narrowed down my issue to my respawn system. It doesnt work right all the time. So sometimes you respawn and sometimes you don't and sometimes the hud works and sometimes it doesn't. Your explanation does work though sometimes when the player respawns correctly. If you know of any guide on server/client respawn systems, maybe with spectator pawns and stuff please let me know. I'm struggling to find proper respawn systems. Everyone cops out and just teleports players and resets their health values or doesn't replicate it for multiplayer.

thin stratus
#

Well, the main thing people don't realize is, that UE4 has a Respawn System Build in

#

But I'm not sure how much that is exposed to Blueprints.

#

But in general, you should be able to call "Respawn" or "Restart"Player either on the PlayerController or the from the GameMode.

#

And that should respawn the Pawn that you setup in the DefaultPawnClass of your GameMode.

#

In case you can't use that or it's not exposed, what you usually do is:

When the Pawn dies (that happens ServerSide), you tell the GAMEMODE that the person died.
Here you want to pass the Controller of the Pawn that died.

E.g.: (In the Pawn) OnDied->GetGameMode->OnPlayerDied (passing "GetController" along)

#

At this point, the Pawn still exists, and is possessed!

#

Now in the GameMode, to make it easy, you can first get the "ControlledPawn" from the passed controller and Unpossess, as well as Destroy it.
That way you get rid of the old pawn.
After that you can call "SpawnActor" for a new Pawn and call "Possess" on it again, still with the passed controller.

#

And that's it. That's the most basic respawn system.

#

@cedar finch

cedar finch
#

yea

#

I'm reading through it all. Thanks man.

#

my problem is: Server shoots Client and kills Client. But Server respawns and client is unaffected. Same if I run as dedicated server. Client 1 kills Client 2 and Client 1 respawns. If i do the opposide Client 1 still respawns.

#

@thin stratus It's 4:20 AM so I'm gonna call it but I'll be working on it tomorrow. I appreciate your help.

thin stratus
#

One big issue I already see is that you call an RPC on the GameMode

#

The GameMode doesn't exist on the Client

#
  • you code for dying should already be on the Server
#

I assume it is on the Server, so with that you don't have to make the Event an RPC

#

and in addition, you are using "GetPlayerController0"

#

Remember, you are on the server

#

this is always the servers controller

#

you need to call "GetController"

#

Which gets the controller of that pawn

#

That's a big difference!

cedar finch
#

Ahhh I see. whoops.

thin stratus
#

So you basically always say atm "Someone died, respawn the Server-Player!"

cedar finch
#

So my player health should be inside gamemode and not inside thirdpersoncharacter?

thin stratus
#

Noooooo

#

Leave it in the Character

#

Just swap out this "GetPlayerController0" with "GetController"

#

And don't make "OnPlayerDie" an RPC

cedar finch
#

hahaha ok I knew it didn't go in gamemode, just messin with ya. So I changed it and it works perfect. Thank you so much. I'll sleep better tonight knowing I got the basics done today

bronze arch
#

Its reading "skill name" but cannot read map directory node...

#

i mean. working only client 1-2-3 floats from found integers.

#

But why not work send to server same details?

timber flicker
#

The architecture is wrong

#

Server should send values to the client, not client to server

bronze arch
#

why cant send client to server GWfroggyKermitReee

#

but skill name can work. how did it GWfroggyBlobWokeThink

timber flicker
#

As everywhere and everyone says: never thrust a client ๐Ÿ˜€

bronze arch
#

eh true but there no other way ๐Ÿ˜ฆ

timber flicker
#

The client should be just like a renderer, just render the things, play particles and sound effects
The server should do all the logic, physics, collisions, etc.

#

Should be

#

other way

bronze arch
#

can u give me some tips?

twin juniper
#

@bronze arch Can you be specific with your actual issue, instead of some image which is incredibly hard to understand.

bronze arch
#

err. i doing kovenas ideas, i cant find another way. Anyway thanks.

copper portal
#

@thin stratus I changed the code a little but it shows only for server and the widget doesnt disappear. What I have done is in the tick event of my character bp, I cast to gamestate, grabbing 2 different booleans for hiding and showing the widget and I use branches with those booleans to check if they are true. If they are true, it should show the widget. The bools in the gs are set in the gm when I run an event that executes every time a player is killed. At certain points, I set the booleans to a value. It still doesn't show for everyone but it does show for the server except it doesnt hide the widget. Here is my code: https://gyazo.com/ff0a28ae5137e95b610a27b72f174d2e https://gyazo.com/481c8149fa6ebd2aeac52d10492d58da https://gyazo.com/d9e5b39dd08ac4a49fd6db1269dbaa62 https://gyazo.com/24d5be0de5c136fa83eec8eb01a20b01

โ€‹

โ€‹

โ€‹

โ€‹

meager spade
#

are you sending a client rpc from the server to the client to show the Widget?

#

you have a lot of bools and it looks like you are fighting the system

copper portal
#

no

#

@meager spade

meager spade
#

why not?

winged badger
#

you made that 5 times more complicated then it had to be

#

at least

#

and its not working, apparently

copper portal
#

@meager spade cuz it didnt work

#

I did what cedric told me to

winged badger
#

not to mention, every client and server knows when a player died

copper portal
#

but no widget showed

#

now, at least something is showing

winged badger
#

so you have no need whatsoever to send anything over network to show widgets

#

3 classes are involved:

#

PlayerCharacter, which grabs its local GameState when it dies

#

(on all machines, so OnRep_Dead, or whatever you have to drive the "Death State" does this part)

#

GameState has an EventDispatcher with PlayerCharacter input on it

#

when player dies it grabs the GameState and Calls that Dispatcher

copper portal
#

I hope you know that I haven't done anything like this

#

so I can't just do that

winged badger
#

your HUD class binds an event that shows the Widget to the GameState's Dispatcher

copper portal
#

cuz I dont know what ur talking about

winged badger
#

result: when players boolean Dead is set to true

#

Widgets are shown automatically

#

as for closing them i do not know what conditions for closing them you had in mind

#

and we are talking less then 15 nodes for the entire setup here

#

EventDispatcher is an object

#

that other classes can... subscribe to

#

by Binding their Events and/or Functions to it

#

whenever the EventDispatcher is Called, it will Invoke Every Function and Event subscribed to it

#

step 1: in your GameState add EventDispatcher (its added similar to variables, below them)

#

name it and when its selected (like a variable on the left hand side) you will have its Details Panel right

#

add an input of your PlayerCharacter's Type

#

step 2: in your PlayerCharacter, i assume you have a boolean Dead which is replicated

#

set its replication to RepNotify, then edit the automatically created OnRep_Dead function

#

in it GetGameState->CastToYourGameState->Call<event dispatcher you created>, passing a reference to Self in the additional pin

#

step 3: in your HUD class, on BeginPlay, GetGameState->CastToYourGameState->BindEventTo<that same dispatcher>

#

from the red square pin on the node, drag and create CustomEvent

#

connect the CreateWidget node to it, and save the result as a variable if you even intend to close it later

#

all done

haughty burrow
#

would someone be willing to spend a few minutes to help me understand how to get the basics of a top down twin stick shooter working for multiplayer? i've managed to get two players to connect through steam and their basic character location is replicated, but i'm using a 'look at rotation' between the player character and player mouse in order to set the rotation of the character mesh. i have a video if that helps

bronze arch
#

Yikes! i thought fixed up to 4.20v
YAMETEEEEEEEEEEEEEEEEEEEEEE GWfroggyKermitReee

copper portal
#

@winged badger thanks for providing steps for me. I will try it now

#

but I have a isDead variable in my playerstate which is used for respawn system

#

so should I use player state boolean or create another boolean in character bp and just replace the playerstate's isdead bool with the character's?

charred crane
#

Xpost from #blueprint
I have an interesting issue. I have a multiplayer game with no voice setup....When I host, we play through the game, and I seamless travel back to lobby, people can hear me through my microphone. Any idea how thats possible?

meager spade
#

using clientrpc works fine for me

cedar finch
#

Ok so I was getting help with this yesterday but couldn't figure it out. So I'm trying to make my player HUD variables work again after respawning. The health and other variables come from my Thirdpersonplayercharacter. And my widget sets the thirdpersoncharacter as its "owningPlayer" variable in order to retrieve all the variables for the HUD. So when a player dies I need to update that Owning player to my new thirdpersoncharacter that I spawned and possesed. I get the logic but I can't get my code to work. Can somebody take a look and help me out? https://i.gyazo.com/0430475366d5b5d5a0c40a4415571a13.png https://i.gyazo.com/1f72fe471f7ce2f900689b683cfd7cb6.png https://i.gyazo.com/6bb767c31953d9c3539785f329b3d983.png

meager spade
#

HUDWidgetRefrence is probably invalid

#

could you not destroy the hud and recreate when re-possessed?

cedar finch
#

Yea I did that and it works but the HUD is a widget so it never really gets destroyed it just stays in memory and gives me a bunch of errors saying 'pending destroy' or something

meager spade
#

also owning player should be a controller should it not?

#

i thought controllers show own the widget

#

should(

#

should* ffs lol

#

any reason why your changing to the character?

cedar finch
#

Are you talking about inside my PlayerHUD widget?

meager spade
#

yeah or is that your own variable?

cedar finch
#

I made a variable called OwningPlayer in order to easily access health and other variables inside my widget

meager spade
#

i would rename it OwningCharacter cause it sounds too much like the Widgets Owning Player

#

have you stepped through to see if the function gets called

cedar finch
#

Hmm so i just did it and It fails

copper portal
#

@meager spade thats what I did

#

but it doesnt work

meager spade
#

works fine for me

copper portal
#

can u call me so I can share screen or something

#

so then I can show you what I did

#

and see if you can catch any mistake

cedar finch
meager spade
#

put a break point on that cast

#

and see what the value is of the controlled pawn

cedar finch
#

So it won't run with the breakpoint. I've never use it before so maybe I'm soing it wrong.

#

It passes all 3 steps when the game starts

#

But stops at step 1 when respawning

#

@meager spade last night cedrick_exi told me how to do it but I haven't got it working yet. Can you tell If I followed these instructions right? "In your Character, "Event OnPosessesed" -> ClientRPC on passed PlayerController Reference -> In that ClientRPC, get the Widget Reference (as said, assuming it's created and stored in your PC), and pass the "GetControllerPawn" over to the Widget.(edited)
And if you really can't figure it out, just poll the "GetPlayerCharacter0" in your binding for now (make sure to check that it's valid).
And only try to improve this if you notice performance issue"

meager spade
#

where is your client rpc?

#

client rpc means marking the event as Run on Owning client

#

i dont see that anywhere

cedar finch
#

Well I changed the 'UpdatePlayerHUD' to rpc but it still does the same

#

I'm not sure why it won't get past step 1 when respawning

#

This is basic game stuff why am I struggling to get this crap working. ๐Ÿ˜ฆ

meager spade
#

did you check to see if the character was null or invalid

#

like put a break point and see what the value is?

#

instead of using text logs

cedar finch
#

I'm watching a video on breakpoints. I've never used them before

meager spade
#

fundamentals of blueprint debugging

cedar finch
#

This is a nice feature.

meager spade
#

exactly pawn is null

#

the bp event is probably called before the controlled pawn variable is set

#

put a delay of .1

#

before the cast

#

see

#

what happens

#

@cedar finch ^

cedar finch
unique thunder
#

@cedar finch are you running something in the UMG that references the player?

#

on tick

cedar finch
cedar finch
#

So I fixed it all and got it working. I had to put an "isValid" node inside every function in my Widget. That fixed all the errors. ๐Ÿ˜ƒ Live and Learn. Thanks for all the help guys I love this Discord everyone here is so nice and helpful.

next warren
#

in multiplayer dedicated server "access none try to readproperty hudref"error showing.. when i pickedup the item it will be added to my player inventory and also it shows in inventory widget bt i m still getting this error in client side when i come out of the play mode but in" listen server"server side no error...only in client side i m getting this error but its all working...

#

Dedicated server 2 client... whenever i pick up an item" error is showing after i come out of the play mode"but it still working adding item to my inventory and widgets

#

Anybody help...thz in advance

#

Hudbp "hudref none trying to read property" in bpinventory

open cape
#

@next warren hudref isnt replicated

#

your client isnt getting it

next warren
#

Is that necessary to replicate hudref

#

Hudref is only for client

#

Why should i replicate that

open cape
#

well where are you setting it

twin juniper
#

Hey, I am using Steam in ue to get the multiplayer, its working and all, but my problem is that only the host can move, but the other player cant. Can anybody help? Thanks

bitter oriole
#

Hard to help you on that

twin juniper
#

Umm why?

bitter oriole
#

Presumably, your implementation of movement doesn't work in multiplayer

#

Nothing to do with Steam btw

twin juniper
#

Its nit only the movement, when I try to use the mouse (for example, to shoot) it doesnt work either

#

Well, its using steam servers isnt it?

bitter oriole
#

No it's not

#

Steam doesn't have game servers

twin juniper
#

Lol whay

#

What*

bitter oriole
#

It only does the matchmaking, and hosting is up to you after that

#

That's why it's called a host

twin juniper
#

Oh wow

#

So.. Its not using a server, its using your own pc as a server huh?

bitter oriole
#

Well, you tell me

twin juniper
#

Well that's just embarrassing.. Can I use this multiplayer if I gonna release it on itch? Or it gotta be on steam?

#

That's why Im getting 242ping๐Ÿค”

bitter oriole
#

You can either have your own servers and ensure you have enough for your player base, or not have dedicated servers and let players self-host

#

Which would only be suitable for non-pvp, < 8 players

twin juniper
#

Its a fps zombie game, it will be a problem

#

So I'm basically done, huh?

bitter oriole
#

Dunno, just saying this is a thing. PVP for a first game is a shit idea anyway

#

You'll get hackers in hours

twin juniper
#

Oh why?

#

Nah I dont really care about hackers

balmy kindle
#

you just need to learn a lot more stuff about multiplayer and networking. Like all of us did and most still do^^

bitter oriole
#

You don't care about your game being unplayable ?

twin juniper
#

I mean, I wanted to do something a lot different, but it seems impossible to me so..

twin juniper
#

Oh no what

#

Hackers? Why would they be?

bitter oriole
#

Because PVP

#

We had them in 8 hours on my first (pvp) game

#

For fun, I guess

winged badger
#

if you prefer the word Cheaters, it applies just as well

bitter oriole
#

Anyway, my 2 cents multiplayer is hard, competitive multiplayer is harder, large-scale multiplayer is not possible for indies

twin juniper
#

~

bitter oriole
#

Also, MP-only isn't possible for indies because of low sales

twin juniper
#

^

bitter oriole
#

You're bound to get 5 online players on average

twin juniper
#

5 will be amazing

#

Its my first game ever

#

(not my first, my first to me publicly released)

bitter oriole
#

5 would be a game that sells more than average on Steam, which isn't a high bar, but well. Anyway, just saying, here be dragons ๐Ÿ˜ƒ

twin juniper
#

Mp is easier (except for programming the mp haha)

#

Because you dont need animations to the story

bitter oriole
#

MP is 5x harder to code

twin juniper
#

You dont really need a story

#

You dont need voice acting

#

You dont really need a lot of models

bitter oriole
#

Well, that's your opinion

twin juniper
#

Yeah

bitter oriole
#

You don't also need a story, VA, lots of models in a SP game

#

We definitely have none of those

twin juniper
#

So... What are you doing in sp?

#

Killing AIs and that's it? :/

bitter oriole
#

It's not a shooter

twin juniper
#

Yeah

#

That's why I decided fps lol

bitter oriole
#

But killing AIs can be pretty fun too

#

It's still most of gaming

twin juniper
#

With a story..

#

Unless its sandbox

#

I did thought about an idea, a sp game that's actually not shooter (lol I barely even PLAY something that isnt shooting)

#

Anyways, Thanks

#

I got to go, goodbye :)

dapper summit
#

hey guys how do i get a car to work on a multiplayer project because im not to sure if its multiplayer related because when i click the key to enter my buggy my character doesn't posses the buggy and i can't use the buggy and my character can't move and when i jump when its glitched or what ever it is i fall through the map

gusty lily
#

Heya. issue with steam integration. (advanced steam sessions plugin). It all works well when launching as standalone game from editor (eg: overlay, playername, and creating/hosting a session all good), but if I package (dev or shipping, no difference), steam doesn't seem to connect (no overlay, no name, host session button that works otherwise, does nothing). Any ideas?

loud mountain
#

@gusty lily make sure next to the game.exe you have the appid.txt with your steam app id

gusty lily
loud mountain
#

yes

gusty lily
#

Hmmm. It must be another issue.

loud mountain
#

hmm is your project a code project or blueprint only?

gusty lily
#

blueprint only

loud mountain
#

do u have the steam stuff setup in your DefaultEngine.ini?

gusty lily
#

i have had issues not being able to open projects after including c++ :/

#

yes I have, let me paste it in

#

this is in the project's config folder's defaultengine.ini - it's not present in the packaged game config folders.

#

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

loud mountain
#

hmm

gusty lily
#

ps I'm a total noob at this.

loud mountain
#

maybe it is the "SteamAppId" without Dev

gusty lily
#

Right. I did enter that line. Somehow it's not there now. will repackage

#

no luck there.

loud mountain
#

is the steam plugin enabled too?

#

heres my complete DefaultEngine.ini: ```[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
PollingIntervalInMs=20
DefaultPlatformService=Steam
VoiceNotificationDelta=0.2

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=XXXX
SteamAppId=XXXX
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVacEnabled=0
bAllowP2PPacketRelay=true
P2PConnectionTimeout=90

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="/Script/OnlineSubsystemSteam.SteamNetConnection"

gusty lily
#

I seem to have the same settings, but I don't include as much un the subsystemsteam section

#

i only have [OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480

#

I'll see if it makes a difference

loud mountain
#

I've never used the plugin there so I don't know if it does its own kind of initialization

gusty lily
#

Another weird thing that might be connected, is that I can't access console from the packaged builds, while I can from launching standalone

loud mountain
#

are u doing a shipping build?

#

because console is disabled there.

gusty lily
#

oh wait yes, I can access with a dev build. but no steam still

loud mountain
#

any logs?

gusty lily
#

they didnt mention steam. will double check

#

oh. yes. LogModuleManager: Warning: ModuleManager: Module 'OnlineSubsystemSteam' not found - its StaticallyLinkedModuleInitializers function is null.

loud mountain
#

u sure the plugin is enabled? (the OnlineSubsystemSteam one)

gusty lily
#

i'll check that.

#

I have the advanced sessions plugins in the project folder, enabled, and the online subsystem and steam subsystem plugins are enabled for the engine

#

ill re-enable and restart and see if that affects

loud mountain
#

try adding PollingIntervalInMs=20 to your ini under [OnlineSubsystem] if that doesnt help

gusty lily
#

now i'm getting build errors, after having disabled. re-enabled the steam related plugins and restarted. i think this is related to a previous attempt to install ue4 source. the log noted in the build error includes reference to a folder that isn't there - there is no d:/build/

#

it's getting hairy

loud mountain
#

wait you get try to rebuild from source because of the advanced sessions plugin?

gusty lily
#

at some point i believed i need source to run dedicated servers. now i konw i can do p2p without it, but the fact is i installed it

loud mountain
#

oh well for dedicated servers yes, but steam in game should be able to run on binary.

gusty lily
#

I guessI have a new question now. thansk for your help man ๐Ÿ˜ƒ it's possible that I've fixed this issue, but won't know until I've resolved the other one.

loud mountain
#

sometimes things dont makes sense ๐Ÿค”

gusty lily
#

@loud mountain all good! thanks for your help man. i believe re-enabling the plugins fixed the issue we were discussing here... not 100% about anything though :p

cedar finch
#

I have a quick question. I have a simple Boss zombie that moves to the player's location. But I just realized his running animations only work on clients and not on the Server player if using a Server/Client setup. So on the Server player the Boss just slides across the ground where on the Client the Boss plays his correct running animations. How do I fix this? Here is my events where the Boss 'moves to location' https://i.gyazo.com/5eff262dc5863f41820b4cae9f45ddcf.png

oblique junco
#

Does steam provide game servers for multiplayer?

#

anybody know?

sharp pagoda
#

They don't, you need to host your own if you want dedicated servers.

oblique junco
#

dang

sharp pagoda
#

You can always use p2p networking :p

oblique junco
#

nah

next falcon
#

Does anyone have some hints for me to make a Multiplayer-able Foliage system ??

sharp pagoda
#

Way too broad of a question, you have to ask about specific features

#

Like, what would this foliage system need to do?

next falcon
#

its simple i need to change the size of each foliage but thats easy with a multicast
i need something that sends the changes to new players but the array will be too big (sometimes maybe) so is there another way ?

next warren
#

@open cape in my bpinventory

rose egret
#

Hi because of some network performance I am writing my own structure for transform replication. which is 2D.
which one is better using a structure for x, y, velX, velY, rotation. or separating velocity to another property?
how much property handle replication costs?

thin stratus
#

Does Splitscreen not use Ownership?

#

"OwnerOnlySee" and "OwnerNoSee" act like the Pawn isn't owned by the player

#

Owner prints properly on both pawns

#

Yet using "OwnerOnlySee" hides it for all players

tawny drum
#

Hey guys. I'm trying to replicate animation from client to every other client that is connecter to server. What I'm doing can be found in this screenshot:
https://imgur.com/a/8pANr6N
This seems to work, but I found it kinda hacky, is there a better way to force animation to be run on server and therefore displayer on every client?

#

What this solution achieves is to run on server a piece of code that then multicast replicates to every client

sharp pagoda
#

@tawny drum What is "hacky" about this? The two other ways to handle this are in the animation blueprint or through an OnRep, but your solution is fine and gives more control to the caller on whether or not the animation needs to be reliable.

tawny drum
#

Having to call it like this for every piece of code that I need to replicate seems like I'm trying to break through a door, that is open somewhere else

#

could you elaborate on the OnRep?

sharp pagoda
#

"every piece of code that I need to replicate". You replicate function calls (aka run code on every local machine) by using either a multicast or an OnRep

#

OnRep is a callback that runs when clients receive a network update for a variable

#

It's just a callback for replication

#

Note that it doesn't run on the server

tawny drum
#

well it doesnt seem like an unusual need to need to execute code from clients on all of the other clients. What seems hacky is that I have to manually tell server to multicast this function on the clients.
Okay, so using OnRep could be really similiar to this solution

#

If I replicate mesh that has animation blueprint assigned to it, and replicate all variables that are necessary for ABP, I should also achieve this result, right?

#

mesh component*

sharp pagoda
#

@tawny drum Sorry had to bail for a bit. Once you understand the networking model you'll see that what you're doing isn't hacky at all, in fact it's in elegant solution. And yes, replicating the components needed to reconstruct the anim bp on all machines would work too, but is probably not favorable in your situation. I'm not sure what kind of montages you're playing, but for example what you'd pass through that multicast function would be fire-and-forget animations, like a reload animation for you weapon, or an animation of your character putting his weapon away on his back. For the animation blueprint you don't use montages nearly as often, but can end up using them for locomotion modifiers and such.

tawny drum
#

These are actually attack combo animations, so they kinda are fire and forget (I'm not an animator myself, so I don't really know much about it).

#

Thanks for the response, Xenonic

elfin garnet
#

So, question on ServerTravel... I have a project with two levels that I'm trying to travel between, both with their own game mode but the same PlayerState (lobby/game world). Both GameModes have bUseSeamlessTravel set and I have the Transition map set in my project settings as well (the transition map even as a game mode with bUseSeamlessTravel). My PlayerState also overrides CopyProperties. For some reason, the PlayerState's values are still reset when I ServerTravel. Am I doing the seamless travel incorrectly? Or is there something I'm missing?

#

Also, would the absolute flag on ServerTravel effect any of this?

opaque flicker
#

hi, i'm having session ping 9999 with steam subsystem with my friend, any1 know a solution to this common problem ?

twin juniper
#

isnt that a tcp/ip setting somewhere in steam

#

that u need set on dsl/cable speed

#

havent tested but u could use hamachi with steam uts not MP but lan based, for MP than u are bound to hosting or private mp server but in most case u need setup portforwarding

#

some router have it as virtual server

#

maby am missing something but why would u use steam? if u want run dedicated ut servers ur better of installing a server package and run from batch file with ucc uses less cpu resources if am correct and more easy to configur i think

#

btw ive got rid of my retail router off the network sinds most consumer routers are lunsecure and have security issues and big leaks but okay thats not UT talk

fossil spoke
twin juniper
#

i guess thats the best solution for the steam ping problem which DevilsD presents

broken parrot
#

Hmmmm, I'm running into an error that hasn't been as googlable as I'd like.

I have a data structure I'm trying to pass to the client when they join a dedicated server. This structure contains several TArrays of various other structures such as the player's talent points, their status with other players, and some more basic data such as where they logged out, what they were playing as, and what their stats were.

It's working for the most part, but we've been trying to track down what's come to be known as the "save bug," by our testers. Client-side, rather than receive the information from the server, I'm seeing this:

[2018.10.15-23.46.34:087][188]LogNetPartialBunch: Error: Final partial bunch too large
[2018.10.15-23.46.34:087][188]LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1

The data being passed isn't very big, but it is passed as a struct that contains structs, some of which further contain TArrays of structs, so maybe it's just too complex or something?

twin juniper
#

something is to large and it isnt me

#

though i would look into typo`s filenames, access folder etc check the basic things first but looked at the error itself i need more info on what u use what kind of mod or serveractor etc

broken parrot
#

It's a big blueprint struct. It's been working most of the time, but occasionally it'll come up with that error.

#

I'll show you what it is:

twin juniper
#

yeah okay if i dont know than maby other will i think

broken parrot
#

This is what's supposed to be called client-side after the server has found the data for this player's Steam ID. Server finds the data just fine and then tries to call this

#

And that's when the error comes up. I have a print immediately after this, and it never goes off, so it's getting stuck right here

#

That's what the ServerData pin contains. Most of these contain TArrays of structs as well. For example:

#

This is PlayerScoreData

#

The others are similar, I'm wondering if UE is just getting confused by the complexity of all these nested structs inside TArrays. It works alright for like an entire day of players logging on and playing on our test server, but eventually it seems to hit some tipping point where the players will connect and fail to retrieve their data from the server. I'm assuming this is maybe hitting some critical size where it starts getting too large.

twin juniper
#

is their no way to set the max download connections per minute or so

broken parrot
#

I'm not really sure tbh. I'm considering maybe just bumping all this up into C++ and seeing if it works better

twin juniper
#

the coding part is really a dead road for me am just thinking simple

broken parrot
#

We've been migrating a lot of our more heavily used, older blueprints up into C++ but the agony of moving these big structs up has been something I have NOT wanted to do.

twin juniper
#

but it couldnt hurt checking it in C++ i guess

#

maby u will see something that u would miss in that bluescript

broken parrot
#

It'd be a couple days worth of refactoring at-least, it's a ton of work to bring those structs up into C++. They're all over our project

twin juniper
#

have u contacted Steam about it?maby they know something that would save u alot of work

#

somethign u missed or

#

am not sure if Steam has a developer option or something

#

that sometimes opens more posibilities to a developer

broken parrot
#

I don't think it has anything to do with Steam.

twin juniper
#

aha ok

#

is it by using UED?

broken parrot
#

hmm what's that?

twin juniper
#

unreal editor

broken parrot
#

Oh no, this is a dedicated server being run on PingPerfect

#

we've been trying to bug scrub our game prior to release, and this bug's being particularly nasty to track down

mighty rover
#

I got my Huli game running on 2 phones on a local network (good enough for our demo booth on Saturday), but I've been plagued by a bug. The stack disappears on the client after the first round, only if client goes first. If client goes second, it disappears after the host's turn, on the client's first turn. Here's a video of it: https://www.youtube.com/watch?v=qnSfchoEf6M&feature=youtu.be NOTE sorry for the poor quality - had to record on my junk webcam lol

Here's a sample of the multiplayer within Huli, between iOS and Android.

โ–ถ Play video
fossil silo
#

Does anyone have opinions on using BaaS platforms to handle the networking, matchmaking, inventory, etc for UE games? I have been looking into GameSparks and PlayFab...Leaning towards GameSparks, but still kinda unsure of if its the right choice

thin stratus
#

It's the right choice if it does what you need and you can pay what they ask for

#
  • you not having another way of doing it that costs less
fossil silo
#

hehe, well, i guess I should've made my question a little better...you are very right...we were thinking that the amount of time we would save trying to build all of the platform functionality and matchmaking and server management stuff would be well worth the cost (something like .02c per monthly active user after 100,000 monthly active users)

#

have you used GameSparks?

#

we're trying to find the easiest and most scalable way to handle matchmaking, certain networking stuff, inventory, in-game currency & marketplace, etc...they even have wagering of in-game currency on matches...which is a super cool feature we've been thinking about

thin stratus
#

I used GameSparks for Clients, yes. It's basically a backend that allows you to connect known Subsystems to it. E.g. a SteamAccount.
You can save data for users, such as Skill, Customizables and what else you can save as a JSON.

#

You can also perform purchases through it, I think it forwards it to the specific subsystem

#

So for crossplatform progress it should be quite nice to use

#

They have a build in matchmaking system that matchmakes based on the skill or whatever you give it

#

And you can modify this quite a lot, but it's not a straight forward thing to learn, even with their docs

#

However the Matchmaking only parses you that players were found

#

You still need to either tell players to host and join

#

or have another system that can give you a server that players can join

#

Which in addition costs money again

#

Writing your own system takes time and you still need to host it.

  • you need to be able to manage and support it
#

And you don't even know if your game will be a hit, which if not, will result in wasted time

#

So GameSparks does have its advantage

#

@fossil silo

fossil silo
#

I thought I read about gamespark hosting servers

thin stratus
#

I think that's only if you use their own backend for replication

#

So not UE4's networking

#

@fossil silo

glacial lotus
#

I tried with the array replicated and also repnotify (that I don't know what it means)

#

Ah, I know now with repnotify does. But it doesn't help here I guess

thin stratus
#
  1. Why a ServerRPC on BeginPlay?
  2. Why not "SwitchHasAuthority?
  3. Arrays tend to not Replicate through nodes like "Add". Try setting the Array with itself.
glacial lotus
#

@thin stratus Ah, thanks!

glacial lotus
glacial lotus
#

ok, so I want to apply different scales to my players and the scales should be consistent between clients and the server. My best try got me server and clients scaled but the scales were not consistent, they were mixed up. All this with BPs.

thin stratus
#

It should be enough if you call the set when the loop completes

glacial lotus
#

yep, that worked, sorry I forgot to mention it. Now I'm focused on the different scales for the players

#

ok, I know what the problem is. I was getting all actors of class "the player class" but that array probably is unconsistently ordered between clients. Does that make sense? So now I need to find a way to get a consisten list of players. Using GameState?

thin stratus
#

If this is per player data

#

why are you doing this with an array somewhere?

#

Just put ONE scale value into the PlayerState, or PlayerCharacter or PlayerController

#

That way you have it already ordered

glacial lotus
#

Because I'm working in a team and I'm not allowed to touch those files directly. I can however hack them on runtime ๐Ÿ˜› Not ideal situation

thin stratus
#

How is it helpful if a "Team" limits you to properly implement code?

glacial lotus
#

well this is just a prototype and we are close to a release so it's not a good time to modify those files. So I need to work "on the side" for some time.

thin stratus
#

Hm then I can't help

glacial lotus
#

I understand, but thank you!

thin stratus
#

UE4 has a Gameframework which should be followed to, even when being close to a release.
Not allowing a coder to touch main Framework files is like driving a car without a steeringwheel.

glacial lotus
#

I know ๐Ÿ˜ƒ

simple cypress
#

When a struct inside an actor is set to replicate, are all the structs UPROPERTYs replicated, or only the properties that are also set to replicate?

#

Same thing with UOBJECT classes where the instance is set to replicate

#

Is the behavior the same?

glacial lotus
#

How to get a consistent list of players in all the clients? I'm trying Get Game State->Player Array->For each loop-> Get Player name? And I don't know how to get the player pawn/actor from here

fossil silo
#

thanks @thin stratus , do you have any suggestions for scalable dedicated ue4 server hosts that you like? Also, we aren't against using GameSparks replication stuff if it makes everything easier to have them host servers too..

thin stratus
#

@glacial lotus You can't get the Pawn from the PlayerState, at least not if you aren't saving it yourself

#

The PlayerState has a Controller ref in the Owner variable

#

Only available to local player and server (cause playercontroller doesn't exist on other clients)

#

PlayerState holds the PlayerName if you need that

steady briar
#

if i spawn and attach an actor to my character, is that like a 1 time deal that it gets replicated? or is it constantly replicating that its there o.O not sure the best way to explain what i mean...

#

like if i use SetMasterPoseComponent, does it replicate each individual mesh separately or does it just know its attached to the Master one and just replicate that?

thin stratus
#

SetMasterPostComponent is called on the Component, passing the MasterComponent

#

If you plug 10 Comps into that, it calls it 10 times, once per component

steady briar
#

10 times, but once? or 10 times and it replicates each object separately

glacial lotus
#

hmm, so no way to get a consistent list of all the player pawns from the clients directly?

sharp pagoda
#

Pawns controlled by players or pawns of some class

drifting plank
#

Hello guys !
I have a very strange bug !
I've a boxCollider with overlap events. I've implement the event in both BP and C++.
The events are correctly triggered (on server and clients) the first time.
But all the other time, the events are not triggered on server but works correctly on all clients.

Any idea why this happend ?
Thanks in advance for your help !

glacial lotus
#

@sharp pagoda Player pawns controlled by actual players

winged badger
#

TActorIterator<YouPlayerPawnClass>, filtered by IsPlayerControlled

#

or, ugh, GetAllActorsOfClass

#

cheaper to just have them register somewhere accessible

#

@drifting plank my guess is that your Server Actor has a non-replicated collision volume, and that it never actually left overlap

drifting plank
#

Hum I found my mistake ๐Ÿ˜ฆ

#

I've put accidentaly a lifetime to my actor

#

Thanks in any case ๐Ÿ˜‰

trim dirge
#

I am trying to test a game on a different pc with a different steam account, the ping is always 9999 and it never connects

#

it waits for like a min then disconnects

winged badger
#

ping 9999 is pretty standard with steam even when it works

#

read the output log, from opening map with ?listen and onward is the interesting part

trim dirge
#

don't know what you mean

#

the game is done fully in BP

#

in the log it said "falied to bind to the listen board"

steady briar
#

so i had something working single player, trying to get it working multiplayer. im spawning an actor, setting it as a variable with RepNotify, using the OnRep function to align the skeletal mesh and SetMasterPoseComponent. it spawns the mesh but it doesnt animate. thinking its a replication problem more than an animation problem because it worked before. any ideas? O.o

unique thunder
#

If I multicast enable a sound component, will new-joiners also hear it or do I have to enable it via RepNotify?

sharp pagoda
#

You'll need repnotify

swift topaz
#

Is there a way to limit the amount of default data being replicated? Trying to spawn 10000 actors (with nothing in them, just blank actors) takes over 16 seconds on a local dedicated server.

spare lynx
#

do you guys know any good plugin for TCP communication?

unique thunder
#

@sharp pagoda What if a repnotify calls an event that calls another event that enables the sound, will it still be heard by new players?

#

Sorry for nub question

sharp pagoda
#

The notify will call just like a normal function for the joining players (assuming their value is different from the server's). So yes it will

#

@unique thunder

unique thunder
#

Okay thx a lot

solar flower
#

I'm prototyping an RTS resource manager game and i've set everything up as structs so far

#

Like I have a BP_Item but it just has a FItem struct with all the major properties

#

Is this a bad foundation?

#

Structs in BP seem difficult to change

#

Especially when they have arrays of other structs

thin stratus
#

Structs are known to break in Blueprints when adjusted often (the actual struct)

#

sometimes even when just starting the project the next day

#

We tend to put our structs all in C++, just to avoid them breaking, ccause if they break you'll have to replace them al lby hand

#

(also use sourcecontrol!)

solar flower
#

Hmm, my C++ enums broke when I tried using them in blueprints

#

Guess it's the other way around for structs

thin stratus
#

Never had C++ enums break, but yeah

solar flower
thin stratus
#

Despite that, you can save the items just as structs too

solar flower
#

I'm just curious how you would structure it, would you put them in the BP without a struct?

thin stratus
#

it kinda depends on what your items can do

solar flower
#

I'm either thinking one BP that contains the Item and can be used for one purpose

thin stratus
#

You could just put the stuff into the Item directly

#

at that point the struct is mostly organization

solar flower
#

Or having a class hierarchy

thin stratus
#

Keep in mind that BP structs can't* be inherited

#

While c++ ones can

#

So you can't extend the struct in bps

solar flower
#

Yea, didn't realize that when i started so now the structs are messy

#

You think i should abandon the structs and just make everything class variables?

thin stratus
#

Iirc, my Items are UObjects

#

And only the Server has them

#

They have a function that they can override for filling a "FItemInventory" sturct

#

Which holds data for displaying

#

cause that's all the client needs

solar flower
#

So you made both?

#

And you just package your UObject into a struct when it goes into an inventory?

#

Does the UObject have the same class variables as the struct?

thin stratus
#

My Inventory is an Array of the UObject

#

The Sturct is just info that the Client needs to display

#

Actually

#

I think I did do it with 2 structs, sorry

#

Lemme double check

#
USTRUCT()
struct FInventoryItem
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Inventory Item")
        class USGItem_Base* ItemRef;

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Inventory Item")
        EItemType SlotType;

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Inventory Item")
        int32 StackSize;
};
#

So the item is in fact the UObject

#

the Array is a TArray<FInventoryItem>

#

So yeah and array of struct

#

I do also have this struct:

USTRUCT(BlueprintType)
struct FUIItemInfo
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Item Info")
        FString ItemName;

    UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Item Info")
        TAssetPtr<UTexture2D> ItemIconID;

    UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Item Info")
        int32 StackSize;

    FUIItemInfo()
    {
        ItemName = "None";
        ItemIconID = 0;
        StackSize = -1;
    }
};
#

And my UObject has this function:

FUIItemInfo USGItem_Base::GetItemInfo()
{
    FUIItemInfo ItemInfo;

    ItemInfo.ItemIconID = ItemIconID;
    ItemInfo.ItemName = ItemName.ToString();

    return ItemInfo;
}
#

(Old code, could be a lot better I guess)

#
// Create and array of FUIItemInfo of the same size as the inventory
        TArray<struct FUIItemInfo> Inventory;

        Inventory.SetNum(_InvCom->Inventory.Num());

        for (int32 i = 0; i < Inventory.Num(); i++)
        {
            // If the item is valid, let it fill the struct with the interface function
            if (_InvCom->Inventory[i].ItemRef)
            {
                Inventory[i] = _InvCom->Inventory[i].ItemRef->GetItemInfo();
                Inventory[i].StackSize = _InvCom->Inventory[i].StackSize;
            }
            else
            {
                Inventory[i] = FUIItemInfo();
            }
        }

        Client_CallbackWholeInventory(_InvCom, Inventory);
solar flower
#

So, you store most of the vital info in the UObject?

thin stratus
#

In the end I have a function (here as an example a ServerRPC) that parses the acutal inventory in the smaller UIItemInfo strcut

#

And then sends it to the client

#

Yeah and that only lives on the Server

#

Cause the client (in my cases) only needs visuals for displaying it

solar flower
#

Are UObjects setup for replication by default?

thin stratus
#

Nope

#

You'd need an Actor taking care of subreplicating them

#

I'm also not replicating them

solar flower
#

I'm doing this mostly in BPs so I guess i need to stick with AActors

#

For items

#

Then store their properties as class variables

thin stratus
#

I don#t see why you need to replicate the items

#

It's enough to keep them as object on the server

#

and send only visual updates to the client

#

My Marketplace pack works nearly the same iirc

solar flower
#

I need to replicate their position and stats

thin stratus
#

Fair enough

solar flower
#

right?

thin stratus
#

Well you can still send vectors and stuff to the client via a struct

solar flower
#

Hmm, it's a week prototype so i was gonna keep things simple

#

Everything has been structs so far tho and that's caught up

#

Guess i'm just wondering if that's usually where people store all the stats

#

Makes it easy to migrate but a pain to change

#

Well, look at that

#

Just came back to the project today and the structs are broken

cedar finch
opaque flicker
#

do player controller/player state and gamemode get destroyed during seamless travel ?

hybrid ermine
#

@cedar finch i don't think you need the multicast, just set the bool on the server, since the variable is replicated, everyone will receive the update anyways

cedar finch
hybrid ermine
#

in that image, your turn on event doesn't do anything

#

oh nvm that is a call to turn on

#

that set call of the can activate trap variable needs to be on the server

cedar finch
#

Idk I've tried everything. I hate how the most simple things are so complicated for multiplayer. ๐Ÿ˜ฆ Right now it only plays for the person who presses it.

#

I think I'll take a break and think about it. Then come back to it. That usually helps me figure these things out

gleaming vector
#

oh, hey @thin stratus remember like a few weeks ago i was having issue replicating that array of structs?

#

i figured out what the issue was finally

#

NetSerializers update in place, so if you are replicating an object you need to clear it manually in the netserialize code if the object is null

#

I was under the assumption the constructor was called (which would have 0'd out the property), but they are not

slender yarrow
#

does anyone know for an multiplayer FPS with replication. How you would register that a certain player got a kill on the server? I know there is the Apply Damage node that has the instigator option on it. Im just wondering how you reference different player controllers on the server to register that they got a kill. Do you just plug Get Player Controller into the instigator slot on Apply Damage? or is there a better way

gleaming vector
#

write a Die() function

#

and handle it there

#

ideally your applydamage function has an instigator

#

which should be the pawn that is dealing the damage

#

ie, if you have a weapon, the instigator is the guy holding the weapon

#

from there you can credit the instigator

slender yarrow
#

yeah i originally thought to register it after the charcters death. guess that was correct after all. Thanks

gleaming vector
#

yeah

#

what I like to do is pass it to the gamemode

#

have some OnPlayerDied function

#

and have the gamemode deal with it

#

send out notifications and the like

mighty rover
#

@thin stratus got any ideas for why my stack keeps disappearing on client after the first round?

#

It's a replicated object, managed by the server (who's also a client), and it shows up on the client for the first round, but not the second round, when it's the clients turn. The stack will always show up on both screens when it's the servers turn.

mighty rover
#

When it's the clients turn, the stack disappears from both screens.

winged badger
#

its a replicated object of what type?

#

what creates it?

#

what happens during a turn?

subtle nymph
#

I cannot get the first person template projectile to replicate on the Z axis for clients
It only fires at one vertical angle, but still moves with the player and the horizontal angle that they are looking in

#

any idea why?

winged badger
#

they would not put something only occasionally used to replicate out of the box, by default

mighty rover
#

@winged badger - sorry got caught up in debugging lol

#

It's a replicated object of type 'Actor'

#

The server creates it

#

during each turn, the server removes any caps in the stack that have been flipped over, then it calls the Build stack Event again. I have switch has authority set to 'Authority' when it builds it

#

during the BuildStack event, it calls a function called "Build Stack" which creates individual BP_Cap's via SpawnActor node

#

here's the Stack blueprint when building the stack.

#

During the round reset, within the Pawn, I'm calling the Build Stack event

winged badger
#

thats the only call to build full stack?

mighty rover
#

except on the initial loading of the level, yes

#

one thing I did notice is that the print string, contained within the BuildHuliStack event, only prints to the screen during the server's turn. I'd expect it to print every turn...

#

Here's the replication on the Stack Actor itself:

winged badger
#

it can't execute during client's turn

mighty rover
#

but during clients turn, if the server is controlling the building of the stack, shouldn't the printstring execute on the server's screen no matter what?

winged badger
#

well how would it get there?

#

it can't pass HasAuthority or IsServer checks

mighty rover
#

right, but the build stack event is "Executes on Server", doesn't that mean the server controls those specific objects even for the client(s)?

winged badger
#

No offense, but putting the rebuild stack calls and/or logic inside the Pawn is alsoa terrible idea

mighty rover
#

Fair enough, still learning my ropes in multiplayer

winged badger
#

its not their purpose to manage that

#

its not MP, its OOP

mighty rover
#

Pawns are replicated, which is why I put it in there, where else would you suggest I put it?

#

No offense taken btw

winged badger
#

into a GameMode component

#

that handles turns and stack rebuilds

#

and nothing else

mighty rover
#

I have game mode handling turns right now, so it knows who's turn it is

winged badger
#

or GameState, depending on the need to replicate

mighty rover
#

so I can just slide it into that, np

winged badger
#

but your client can't call the ServerRPC to rebuild the stack

#

because its not a server, and you have a branch checking for it

mighty rover
#

gotcha - thanks for the help. Give me a few and I'll restructure my stack rebuilding and will tell you how it goes.

winged badger
#

basically, the change of turn and rebuilding of the stack are atomically linked

#

you should handle both at the same place

mighty rover
#

the build huli stack portion in the huli pawn btw, was when I created the game in single player - I learned the hard way that building your project with multiplayer intentions from the beginning I can't cut corners like I can in single player.

#

first single player game ๐Ÿ˜‰

#

*multiplayer

winged badger
#

yeah, i had the privilege of refactoring a codebase of a SP game to MP

#

hope i never have to do it again ๐Ÿ˜„

mighty rover
#

not fun - but now I know lol

#

@winged badger - another thing that confused me and why I thought it was ok to have the build stack there is that this problem doesn't occur between PC and Mobile, only Mobile and Mobile

#

deploying changes you suggested now to both mobile devices...will let you know how it goes

mighty rover
#

@winged badger you're dope! Thanks, that worked! everything is working as intended now. Huge thanks!

thin stratus
#

No idea if that was mentioned (didn't read the convo), but that event at the bottom right doesn't need to be a ServerRPC

#

You are already on the Server

#

And I know why it's an RPC

#

But maybe make a non-RPC for the stack rebuild and create another Event that is an RPC that calls the normal event.
It's better practice in my eyes

thin stratus
#

Does anyone know why Epic routes the RPC Calls of the CMC through the Character?

#

So basically "CMC::ServerMove->Character::ServerMove_Implementation->CMC::ServerMove_Implementation"
Where the Character one is the actual RPC and the CMC only has non-rpcs

slim holly
#

maybe it's a compatibility thing for different movement components ๐Ÿค”

#

or, something else needs to call it too

#

and it cannot be sure does that particular component exist

mighty rover
#

@thin stratus that RPC build event you mentioned already calls a non-RPC function that actually builds the stack. It's only purpose is to call that function. Is that want you were recommending?

red sand
#

Hi , is it possible to make widget hidden on owner but visible to others?

slim holly
red sand
#

i tried that but it doesnt work

slim holly
#

I'm pretty certain it works

#

set it to screen space and check draw size first

#

AND make sure the widget set operation logic is compatible with all other clients

red sand
#

draw size is, x:100 y:40

slim holly
#

I wouldn't know is it correct, I assume your widget is custom size of 100x40

#

and not fullscreen sized

red sand
#

yup

winged badger
#

you can hide it manually

#

BeginPlay->if self IsLocallyControlled-> SetHidden

#

assuming that is on your character

#

@red sand

red sand
#

Thanks alot Zlo

gloomy sedge
#

hey, i've been following NiceShadow's Advanced Sessions tutorials, and i have encounted a problem. I'm using server travel and understand that this only works in standalone game. But the server travel doesn't seem to work even in standalone. The Server owner will press the start game button and all Player Controllers that are connected with be sent over to the map, but this doesn't seem to happen and they get stuck on the loading screen

#

I know it's not a lot to go on

#

but any help would be appreciated

near drum
#

Hey guys! Does anyone have experience in writing an own Online Subsystem and has some tips for me? Or an blog post or even an tutorial how to do it?
My idea for now is to copy the OSS Null and overwrite the whole LAN Broadcast stuff with the HTTP Calls to my own Online REST Service

next warren
#

On begin ovwrlap all clients getting updated

#

My inventory is created in player controller (pc)

#

My inventory func all are in pc

#

New var2 (pc ref)

#

Anyone suggest me y all my clients getting updated

steady briar
#

so if i have a server function that spawns a weapon and attaches it to my player, if i set any variables so my player has a reference to it, the variable has to be replicated?

#

also, after it initially attaches it, the server doesnt know that the weapon is animating with the player? O.o hmm

balmy kindle
#

Hey guys, i have some room prefabs which is essentially a Main Blueprint with a bunch of child actor components. In PIE everything shows correct. But over LAN or Steam Multiplayer some child actors are only visible to the server... The room itself (the parent actor) is replicating though. I tested every combination of component replicates, turn off replication in the child actor and so on. I don't know what i am doing wrong here.. Is there any "correct" way to properly replicate child actor components?

next warren
#

On begin ovwrlap all clients getting updated

#

My inventory is created in player controller (pc)

#

My inventory func all are in pc

#

New var2 (pc ref)

#

Anyone suggest me y all my clients getting updated