#multiplayer

1 messages · Page 443 of 1

dark edge
#

OK this is a real head scratcher. Debug spheres are hit result locations.

#

How could it seem like the box collision is still on the ground when it's shown back at the original location on client AND server?

dark edge
#

Turning off "Component Replicates" on the box fixes it. Strange, because as far as I could tell, client AND server both agree that it's up in the air.

winged badger
#

@meager spade , @sharp pagoda as far as i know epic went with using headers files that are mostly comments instead of documentation there, GameplayPrediction.h

sharp pagoda
#

🤔 Was that meant for kaos?

winged badger
#

i saw you were talking prediction and Kaos pinged me during the conversation

sharp pagoda
#

Oh we were talking about gas + lag compensation in fortnite

winged badger
#

yeah, that is one of GAS header files

sharp pagoda
#

They have out of the box rollback and resim?

winged badger
#

not sure it covers the weapon shots tho

#

they have,,, something out of the box, yes

#

first 300 lines of the header are an explanation of what

#

probably not the same on my currently open version as its 4.18

sharp pagoda
#

Huh I thought the gameplay prediction stuff was exclusively for rollback/prediction of just gameplay abilities

winged badger
#

it is an interesting read as they also bothered to write in why they took some particular approach and what problem they encountered

#

this might be just gameplay effects

#

i never used GAS outside of giving it a read out of curiosity

#

but then again, GAS weapon shot is a GameplayAbility

sharp pagoda
#

Yep but that still doesn't cover hitbox rollback for lag compensation

winged badger
#

last version i read it on was 4.18 and it was still unfinished then

grand kestrel
#

@winged badger @sharp pagoda Do you guys know if GAS has any pooling out of the box for spawned ability actors?

sharp pagoda
#

I heard something about some global task pool stuff while lurking in the gas channel, but I don't actually use it so I have no idea for certain

winged badger
#

you should poke Kaos, he spent quite abit of time with GAS

grand kestrel
#

Oh didn't notice there was one, haha

real yacht
#

can anyone help with advanced session plugin? im having some issue with id while connecting to dedicated server

dark edge
#

What happens if I call a multicast reliable function on a replicated actor that I just spawned?

#

Is there any chance of it never firing on the client or is it smart enough to wait until the client side actor is spawned to fire?

jade gazelle
#

I would think if the replicated actor had not yet been propagated to the clients there would be room for error there. I think multicast is fairly simple in design as a fire and and forget type thing — it won’t trigger on replication like a RepNotify event will

#

Could be wrong but that’s my guess

dark edge
#

I'd use repnotify except it doesn't fire on server if you're replicating a custom struct

#

that was a fun one to figure out

jade gazelle
#

Hah

urban dew
#

I have an object in the world, in thats blueprints i have it so when a playerdoes an action, it gets set hidden in game

#

its working for 1 player

#

but no other players

#

i used a cast to, to enable a player input, and after the player presses a button it wontgo invisible

#

ive tested it before the cast to and it doeswork

#

is it because i have the inputaction in a object in the world?

#

a nonplayer object

winged badger
#

Think about it - the InputAction is always local

#

how would a server know you pressed a button as a client unless you RPC it?

urban dew
#

so how can I go about having a world object, interact with the player, and the player being able to remove the object by pressing a button?

urban dew
#

nevermind

fluid flower
#

tell the server to make your player the network owner, then you can call RPC's on it, so it's a two-fold thing

urban dew
#

i did it by making a interface

fluid flower
#

or player input is replicated and it syncs up

fleet raven
#

why the fuck does the netdriver set Connection->ViewTarget to nullptr if it doesn't receive a packet for 1.5 seconds?

#

this is causing reliable rpcs to get dropped if the client lags for a short time

#

wtf

fleet raven
#

took out that branch so it's no longer set to nullptr and now reliable rpcs work as expected

#

what was even the point of that

dark edge
#

What exactly does "Component Replicates" do on a collision component with physics?

winged badger
#

mostly nothing @dark edge if its an engine component and default subobject

#

which is what most of those tend to be

dark edge
#

Any way to set simulate physics without detaching welded bodies?

#

This hacky shit is driving me nuts

real sparrow
#

Hey guys, it there anyone i can have a chat abt networking (dedicated, photon/gamesparks/...). I'm just overwhelmed by the solutions.

dark edge
#

What are you trying to do?

real sparrow
#

Trying to understand, what i need and what i dont.
For example, what i figured out the last days is that the dedicated server of ue is not able to host multiple sessions per map. You'd have to create multiple instances of the server on different ports and you need some kind of backend server to manage this etc.
So if i would create a online game like starcraft, dota or any other rts, what should i look into?

fossil spoke
#

AWS Gamelift for example provides backend Server martialing services.

#

As well as MatchMaking and other things.

#

Basically, Clients report to the AWS service that they want to begin a session, AWS finds another Client for them to connect with and then boots up a new Server Instance (usually it will have one waiting in reserve already) and then tells both Clients to connect to that Instance.

#

When the match is over, AWS can recycle the Instance for the next Clients.

real sparrow
#

Thank you for the answer!

#

Would it make sense in any way to implement a backend service myself? Handeling the sessions, login, multiplayerdata,...?

vapid egret
#

help?

fossil spoke
#

@vapid egret Try #cpp instead mate.

#

@real sparrow I mean theres nothing stopping you from doing it yourself. But the amount of work to setup that stuff isnt small. For AWS Gamelift to work all you need to do is Interface with their API and get the Game Client onto their service and your almost done.

glass plaza
#

@vapid egret In addition to posting in #cpp, look at your Output log. There's usually better information there to help you debug.

real sparrow
#

@fossil spoke thank you again. I suspected something like that.

glass plaza
#

I am looking to see how I can update the Flying Template to be replicated on other clients without having issues of cheat weaknesses (such as letting the clients send in their next position without verifications) but I am getting issues of stuttering.

#

As a first test, I attempted to simply have the server do what the original template was doing locally, but obviously, that comes at the cost of the client seeing stutter in their movement.

#

(Using the BP version right now to explore the situation faster, moving back to the cpp later)

grand kestrel
#

@glass plaza If you're trying to make a character fly then ACharacter has a flying movement mode

#

Otherwise if you want responsive input (processed locally immediately) with server authority you need client-side prediction, exactly what CMC does

glass plaza
#

I will look into this. Currently, the ship from the Template is a Pawn so I will need to update that.

maiden vine
#

The only way I can connect my client to another client in a Listen Server is using 127..0.0.1 anyone know why?

#

my public seems not to trigger the server

#

Im not sure if that is the right way

maiden vine
#

nevermind port was block by router

ripe folio
#

How do you guys prefer to work when it comes to iterating on and testing dedicated servers? Seems like trying to build/package them from the Project Launcher rebuilds the engine and the project every time and takes forever. How do ya'll do this with a decent velocity?

grand kestrel
#

@ripe folio One thing you can do is uncheck 'single process' in the advanced settings

#

If you're testing on same machine

#

But if you want a binary

#

You need to package the project (this is for both server and client), then build the Development Server or DebugGame Server target to get the server Exe

#

Then you copy the server exe alongside the client exe

ripe folio
#

@grand kestrel Yeah that's what I mean - for proper testing, perf testing, etc, you need a proper dedicated server - the editor-based one won't cut it.

grand kestrel
#

Well guess you have the answer? 😐

#

Its a bit of a pain

#

Maybe someone has a better way to iterate

#

In fact if you find a better way to iterate ping me 🙋

copper owl
#

moving here so general isn't flooded

#

@summer rivet

#

Ok I am noticing this

#

Does that have anything to do with why only the host can change colors?

summer rivet
#

that is the replication type, that means if you own this item and call this event it will call it on the server

copper owl
#

Ok

#

So no issue there

#

i think

#

It might help you help me if I explained what I am doing a little more

summer rivet
#

just depends on the event and what you are doing

copper owl
#

My replicated event is in the widget that is supposed to change colors

#

The event starts by casting to the player

#

simple enough

#

Then it goes through and sets the values of the scalar parameters I have in my instances to the values of the slides

#

in this mess

#

I have the three instances replicating using the "RepNotify" option I found in the pdf you sent me

#

I am still making sense of it though

summer rivet
#

that right there is your first issue

copper owl
#

Ok so repnotify just lets you do stuff after it is replicated

#

got it

summer rivet
#

you are always getting the first player character every time you run that event

copper owl
#

I tried to find a way to get the local player

summer rivet
#

so is this running on the character?

copper owl
#

That is running on the event graph for the widget

summer rivet
#

there is another issue, widgets are client only and not on the server

copper owl
#

Alright

#

I will fix that rn

#

So should I put an event in the character, with inputs for all of the values, and do everything from there?

#

no wait I shouldn't

#

im stupid

#

hold on

summer rivet
#

pretty much. UI tells the player something happened. The player then tells the server what just happened and what it wants to do. the server does it and notifies whoever whatever needs to be done.

#

the details on what to do on the server really depends on how you are handing the info. rep notify or just multicast events

copper owl
#

Oh I was right?

summer rivet
#

as far as I know yep, I am not a network expert tho

copper owl
#

If I am somehow right then it should work now

#

update: it does not

#

i had this in the widget

#

each float is a value for a color

#

this in the player bp

#

each float is a color

#

each of those nodes set a color to the value

#

oh shit

#

I think I got it

#

nope

#

@summer rivet I did this and the host could see when the other person changed their colors

#

But the other client couldn't see it\

#

Sorry if I'm being a pest btw

summer rivet
#

at what point do you tell the other clients that something has changed on the items they have locally? You have multiple copies most of the time. The server has one and each client has another. they are all not the same

#

so clientA can change his locally, then tell the server to change the copy the server has, but someone still has to tell clientB that there is a change to the local copy it has

#

this is normally a multicast event from the server -> all clients or using the replicated on rep notify for a variable whenever it changes on the server each client can react to the change

copper owl
#

Alright

#

So

#

I will set the event to multicast

#

And if that doesn't work I will use repnotify

summer rivet
#

yep it just depends on what you want to do. rep notify is good if it's something changing, like i dunno the players life and you want a widget to update maybe? you can see the life changed on that player and then adjust their overhead widget to show the new life

copper owl
#

If I make no sense rn it is because my brain is just dead rn

#

ok so multicast made the whole thing stop working

#

Set it back to server

#

Once the other client closes out of the menu, it sets it's colors to be the same as the hosts

#

so could I store the values of the colors in the gamemode then access those from the player blueprint to get the widget stuff out of the way

#

I reread this and confused myself

#

I am so tired lmao

worthy perch
#

I didn't fully read the entire comment chain, but you sure you want to store the colors in the gamemode?

#

Only the server has a GameMode instance.

copper owl
#

i dunno man

#

I am so confused

#

I just want the player to be able to set their colors and for the other players to see it

worthy perch
#

You can pretty much put that property on whatever class you want, just not GameMode or PlayerController.

copper owl
#

Let me explain a bit more

#

I have 9 sliders

#

each 3 sliders are the RGB of one thing

#

I have 3 materials

#

The color of the spikes, the color of the ball, and the color of the cube

#

I want the players be able to use the sliders to change these colors

#

and then other people can see these changes

worthy perch
#

GameState is fine, then. Or you could put it on the spikes, ball, and cube themselves.

copper owl
#

The spikes, ball, and cube are components of the ThirdPersonCharacter

worthy perch
#

I'm not really familiar with how components handle replication, but in that case, you could at least put it on the ThirdPersonCharacter class.

copper owl
#

Not well, I can tell you that much

#

They do not handle replication well

#

I set the flails to replicate and they spazz out for the clients

#

And I don't understand what you mean by "put it on the thirdpersoncharacter class"

#

You mean store the values of the sliders set all of the instance values there?

worthy perch
#

The color properties. Maybe three properties, BallColor, SpikeColor, CubeColor.

copper owl
#

Yeah I do

#

I have 3 dynamic material instances with R, G, and B scalars

#

in the TPC

worthy perch
#

I mean as replicated properties.

copper owl
#

And I have them all being set in TPC

#

?

#

I am incredibly tired I apologize for any nonsense

worthy perch
#

You probably want FLinearColor, don't you?

copper owl
#

yeah

#

oh shoot

worthy perch
#

Then just replicate that, RepNotify, and OnColorNotify, set your local Material Instances.

copper owl
#

wait

#

confused again

#

gimme a sec

#

@worthy perch To start I have this in my widget

#

So far so good?

#

Just makes them linear colors

#

I will next throw those into my character blueprint

ripe coral
#

Is it possible to have multiple maps on server where players can go between maps as they please, but they're independent of other players i.e I can be in map1 and you in map2, you might later come to map1

#

in an open world style networked game

worthy perch
#

@copper owl Yeah, that's good.

copper owl
#

Wait wouldn't that just do the same thing as before?

#

I'll try it just in case

worthy perch
#

Well, then replicate the LinearColor property, with RepNotify, then have an OnRep_LinearColor, which sets the local material instance values.

meager spade
#

@ripe coral no

worthy perch
#

Doesn't SpatialOS do that? I never really understood what they did.

meager spade
#

UE4 by default the server can only run 1 uworld

#

so unless SpatialOS allows more than one uworld, i highly doubt it, not on the same server. Switching to a diff server would be an option

#

so 1 server per map, and a main server which keeps tabs on all players in these servers

#

i dunno

copper owl
#

Testing now @worthy perch

ripe coral
#

@meager spade thanks that makes sense

meager spade
#

thats how bungie done Destiny

#

hence you get loading screens

#

your technically swapping servers

copper owl
#

Didn't work @worthy perch

worthy perch
#

What part? You have to have the client send the values to the server first.

copper owl
#

The colors didn't change for the client on either side and for the host it only changed on the host's side

worthy perch
#

Did you use RepNotify?

copper owl
#

I have all 3 linear colors replicating with repnotify

worthy perch
#

And you implemented the OnRep functions for each?

copper owl
#

The functions for them all look like that

#

It is in the ThirdPersonCharacter class

#

This might have something to do with it

worthy perch
#

Can you check if it's actually being called? With some Print function?

#

Wait, isn't that from UMG?

copper owl
#

Yeah

#

I had no other way of sending it to the TPC class

#

it is definitely working

#

I put the prints in the notify functions

#

But the colors don't change

worthy perch
#

Is Ball Mat valid? I'm a bit confused why/how you're replicating material instances.

meager spade
#

i am lost aswell

#

we change colours by simply replicating the colour and having it handled locally

#

oh i see that is what he is trying to do

copper owl
#

I am lost too

worthy perch
#

Can you make the material instance not replicated?

copper owl
#

sure

worthy perch
#

And the clients all have that material instance referenced? Like, it's a default material on the components?

copper owl
#

Oh shit it works

#

!!!!

#

Thank you!

#

I stopped replicating the instances and it started working

#

I am gonna start cleaning up my game and post it here so you guys can mess around with it

#

should have it up within an hour

worthy perch
#

I'm pretty surprised that Blueprints allows you to mark a UMaterialInstance* property as replicated.

urban dew
#

I'm using a blueprint interface to run this

#

this is in an actor i have in the world

#

im tryingto make it so it teleports the player

#

it doesnt work in mp

winged badger
#

for that to work, it has to be called from server, and Sphere 2 reference has to be valid on every client

grand kestrel
#

I could use some advice for fixing an engine bug in UCharacterMovementComponent
The bug exists in SmoothClientPosition_UpdateVisuals() and only exists when you set the character mesh rotation to World/Absolute rotation and you use the ENetworkSmoothingMode::Exponential which is the default (and the desired for us). Basically the mesh doesn't rotate properly, its unusable.

This part here is erroneous and I don't know how to fix it. It is enclosed in if (Mesh->bAbsoluteRotation)

if (!UpdatedComponent->GetComponentQuat().Equals(ClientData->MeshRotationOffset, 1e-6f))
{
    UpdatedComponent->SetWorldRotation(ClientData->MeshRotationOffset);
}
#

Probably ClientData->MeshRotationOffset is getting assigned incorrectly somewhere, but its assigned from stuff assigned from stuff and its gonna be a headache

manic pine
#

isnt updatedcomponent just the capsule?

grand kestrel
#

Yeah?

#

Gonna try the changes in Master, it is different

#

So hopefully its fixed

manic pine
#

if the mesh has absolute/worldrotation, how does updatedcomponent->setworldrotation affect it?

grand kestrel
#

I'm more interested in fixing this than explaining the inner workings of character/cmc atm sorry

#

This is net smoothing

#

So if you rotate the mesh it needs to be smoothed regardless of whether its relative or absolute

maiden vine
#

Is the only way to get all players in an array at the main menu is by having everyone connect to the server first? I didnt want anyone connected till they log in with password. any ideas?

#

btw I have Web database with mysql setup

#

I was trying do some of this in blueprints

night jay
#

Gamestate holds all the playerstates and updates adds/removes players from its array automatically

maiden vine
#

So If I connect the players at the main menu screen to the dedicated server it should work on gamestate?

night jay
#

Gamestate only holds those players that are connected though

maiden vine
#

Thx I was lost in my work shoulda thought to connect to both servers

#

lol

night jay
#

If you don't want them to connect and have them input a password first, you will need to have your OSS support that

maiden vine
#

appreciate the help

#

it all works i just was blank forgot to connect to the dedicated server on login lol

austere veldt
#

Would it be possible to limit the number of synced players (pawns) to a fixed number? Let's say that I want to sync only 30 players that are closest to me?

grand kestrel
#

That should be happening already through net relevancy, but I don't think it works to a fixed number unless you want to override IsNetRelevantFor and implement it yourself

jolly siren
#

Does NetUpdateFrequency and ForceNetUpdate() only pertain to property replication? Or does it impact actor replication as well?

grand kestrel
#

Oh I misunderstood then

#

Not sure about that

austere veldt
#

In my scenario playermodels are customizable and use many morphs. However, from the gameplay perspective, seeing many other people at the same time is not that important, it's all about interaction with people that are close. So in order to allow people to move freely I'd like to limit the number of players loaded and synced to a fixed number and base it on the distance

#

30 closest players are visible and in perfect sync, the rest is not important

#

NetPriority allows only to set priorities for the actors

#

So I guess if pawns and playercontrollers are taking too much bandwith they are cut

#

And that's not what I want

wide parcel
#

Can someone explain why what I'm doing is wrong? I have a blueprint that places an item, and it works if the server is the one placing the item. IT will show on all clients, but if a client does it, it only shows up for the client.

#

This is being done inside a Pawn class.

worthy perch
#

Actor Replication is only done from Server to clients.

wide parcel
#

nods Whats the best way to make something a client does appear on all connected things (server included)

worthy perch
#

Have the client RPC it to the server.

wide parcel
#

I thought so, but I guess I'm not sure how to do that? Would you do a switch has authority and then... I dunno

worthy perch
wide parcel
#

Thanks, I'll give it a read 😃

scenic raven
#

Maybe this is a better channel to ask this question than cpp, sorry if you're on both and are reading this twice: My PlayerControllers spawn an extra character and save it to a PlayerCharacter variable. In multiplayer I am having all sorts of problems and eventually I tracked it down to a mismatch of the value of that property between client and server (educated guess, not 100% sure yet). Should I set-up that variable as replicated?

jolly siren
manic pine
#

depends on the object and the importance of its location ye

#

i assume pickups are stuff like health packs and whatnot

#

that lie in one spot most of the time

#

(or always?)

turbid robin
#

and iirc, NetUpdateFrequency just determines how frequently that actor will get checked for replication relative to the other replicated actors.

manic pine
#

yeah, its a server-side check

#

e.g. 1 = 1 per second

#

it checks if location has changed and if so sends new one to clients

turbid robin
#

whether or not anything gets replicated at all is determined based on whether any replicated properties have changed.

jolly siren
#

In my specific case, I am reducing it for weapon pickups that are dropped from the player. Bounce/slide on the ground and then come to a rest.

turbid robin
#

1 != 1 second @manic pine --> it's a relative value against all other replicated actors.

jolly siren
#

So with a NetUpdateFrequency of 1 it will only be sending 1 location change per second?

manic pine
#

are you sure about that balto?

turbid robin
#

triple-checking...

manic pine
#
Common update frequency values are 10 (updating every 0.1 seconds) for important, unpredictable Actors like player-controlled characters in a shooter, 5 (updating every 0.2 seconds) for slower-moving characters like AI-controlled monsters in cooperative games, or 2 (updating every 0.5 seconds) for background Actors that are not very important to gameplay, but are still synced over the network and/or are controlled by server-side logic and thus need replication.
turbid robin
#

yeah, i see this comment too: /** How often (per second) this actor will be considered for replication, used to determine NetUpdateTime */

jolly siren
#

I was thinking about updating the NetUpdateFrequency to 1 after the pickup has come to a rest. But I was surprised to see that UT always has it set to 1 and is replicating movement.

turbid robin
#

BUT i'm still checking.

manic pine
#

it wont be sending, it will be checking on server if CurrentLocation != OldReplicatedLocation

#

if that check passes, it will send

jolly siren
#

Right, but that controls when it gets sent

manic pine
#

so it doesnt just lessen bandiwdth usage but server cpu usage

jolly siren
#

If they aren't equal

#

Yeah I know that. I am optimizing server cpu usage right now

manic pine
#

more than once seems excessive, at least if you have some sort of smoothing going on too

#

if you dont wanna be bother with client smoothing then ye

jolly siren
#

Replicated movement already handles smoothing right?

manic pine
#

no

jolly siren
#

Because at 1 I'm not really seeing any issues

turbid robin
#

@manic pine sorry, i was thinking about the adaptive net update frequencies, which slightly changes the meaning of that property. so you are correct.

manic pine
#

ah yeah, that one adjusts the netupdatefrequency as you said

#

based on how often changes are triggered on the server ye?

#

e.g. 10 update checks without changes -> reduce

#

there shouldnt be any smoothing going on erebel, unless you gave it a movement component i guess?

jolly siren
#

Hmm no it doesn't have a movement comp

#

I will test again

manic pine
#

physics enabled?

jolly siren
#

yes

#
PickupMesh->SetSimulatePhysics(true);
PickupMesh->SetEnableGravity(true);

bReplicates = true;
bReplicateMovement = true;
#

In the constructor of my pickup^

manic pine
#

ahh, well with physics enabled it'll run physics on the client as well

#

and as such wont have to rely on movement updates exclusively

jolly siren
#

But it still relies on it somewhat right? So the location should be fairly accurate still between the server and client?

manic pine
#

not necessarily

#

consider a case where your pickup spawns on the edge of terrain

#

on the server it settles down and location stops changing, so server stops sending updates

#

on the client, different deltatime caused it to fall down along the edge

#

and with no more server updates, it'll continue to fall

jolly siren
#

ahh okay that makes sense

#

Would you recommend using a movement comp instead in this case then?

manic pine
#

seems excessively expensive

#

maybe you could have clients stop simulating physics after a few seconds

#

eh there are some cases where it could get weird either way...

#

question is if it'll be frequent enough to be noticeable

jolly siren
#

Yeah that still wouldn't solve the issue of a pickup falling off the edge of the map clientside but not serverside.

#

UT uses a projectile movement comp for them

manic pine
#

ahhh, yeah that one is more lightweight

#

and has physics simulation

#

to some degree.. bounce at least

jolly siren
#

ahh okay yeah that might be the best way to go

manic pine
#

ye sounds sensible

jolly siren
#

I'm also trying to decide whether to switch over to adaptive network update frequency

#

Need to break out my ForceNetUpdates 😃

manic pine
#

hah, i think fortnite took it even a step further

#

making them dormant

jolly siren
#

I mean project wide. But yeah there may be some areas where dormancy could be useful, like pickups that have come to rest. But I'm working on an arena shooter, so there aren't as many opportunities for it as a BR

manic pine
#

yeah, also less to gain from doing so

jolly siren
#

Right, well thanks for your help raap. I'm going to start working on adaptive net update freq and get to profiling our dedicated server cpu more.

manic pine
#

yeah, ive been wondering about situations where adaptive updates are actually useful

#

maybe for some kind of movable AI object that's standing still most of the time but periodically goes active

#

for e.g. weapons in hand i'd imagine very low update rate with forcenetupdate to be more useful

twin juniper
#

i just find that i can host a master server with repl.it

scenic raven
#

In my PlayerController I spawn a Character that has an AIController assigned to it. How do I go about replicating it? It only remains on the server. This is how I am spawning it ```ACharacterBase *APlayerControllerBase::SpawnCharacter(AMovableCameraBase *MovableCamera)
{
UWorld *world = GetWorld();

check(world);
check(CharacterClass);

FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

FRotator Rotator = FRotator(0.0f, 0.0f, 0.0f);

check(MovableCamera);

FVector SpawnLocation = MovableCamera->FrontLocation();
ACharacterBase *ReturnedCharacter = world->SpawnActor<ACharacterBase>(CharacterClass, SpawnLocation, Rotator, SpawnParams);
ReturnedCharacter->SpawnDefaultController();

SpawnLocation.Z = ReturnedCharacter->GetHeight();

ReturnedCharacter->SetActorLocation(SpawnLocation);

return ReturnedCharacter;

}

#

The only solution I am thinking about

#

is changing my Character class so it replicates the Controller variable

fossil spoke
#

AIControllers only exist on the Server

#

Why do you want to have it Replicated?

scenic raven
#

How do I forward commands to them?

fossil spoke
#

As a Client? RPC?

scenic raven
#

I was doing this to tell AI to move the actor

#
{
    if (bMovingCharacter)
    {
        if (PlayerCharacter)
        {
            AAIControllerBase *CharacterController = PlayerCharacter->GetController<AAIControllerBase>();

            if (CharacterController)
            {
                FHitResult Hit;
                GetHitResultUnderCursorByChannel(UEngineTypes::ConvertToTraceType(ECC_Camera), true, Hit);
                CharacterController->MoveToHitLocation(Hit, 0.0f);
            }
            else
            {
                UE_LOG(LogTemp, Warning, TEXT("APlayerControllerBase::Tick / Invalid CharacterController"));
            }
        }
        else
        {
            UE_LOG(LogTemp, Warning, TEXT("APlayerControllerBase::Tick / Invalid PlayerCharacter"));
        }
    }
}
#

I guess I need to change the part where I was calling CharacterController->MoveToHitLocation(Hit, 0.0f)

thin stratus
#

You can't interact with an AI Controller as a Client

#

You have to call a ServerRPC on the Client's PlayerController and then interact with the AIController

scenic raven
#

@thin stratus it's interesting I was just reading the chapter on RPCs on your pdf 😃

#

thx for that, it's a great reference

winged badger
#

if that is a PC controls an AAIController that controls the Pawn scenario

#

i would take steps to replicate the AIController

#

not overly difficult, just need to tweak the checkboxes in the Replication section of the Actor

dark edge
#

What's y'all's general philosophy regarding input, do you handle it all at the controller or on the pawn?

meager spade
#

Depends

#

I have mixed input some on controller and some on pawn

alpine light
#

Hello, sorry to bother people. I have multiple clients connecting to a dedicated server. Is there anything built in to unreal such that I know when a given client's player state, player controller, and HUD have all been initialized and are ready for variable replication? So far my googling is steering me towards replicating a variable and waiting for a response? Or is there an event better suited to this? Thank you! (Also ... I don't know if I am understanding that solution correctly - unsure if RepNotify triggers for variables if the value changed on the server before the object receiving replication was even created)

scenic raven
#

@winged badger that was my thinking tooo, but for now it works just with the RPC, as I build on it I'll probably revise.

alpine light
#

My problem is that I have things trying to update before stuff is all there - some of it is there, not all of it. And it seems to happen inconsistently 😦

turbid robin
#

@alpine light there are a lot of functions in the GameMode API that will likely have something along the lines of what you're looking for...?

winged badger
#

i even went as far as replicating AIControllers for more then just Owner

#

altho you can easily limit it to owner @scenic raven , just call SetOwner with PC as argument, and make it only relevant to owner

scenic raven
#

@winged badger thx

turbid robin
#

@alpine light - just saw that you want a callback for a specific player and not in general, so the GameMode is probably not going to help much.

alpine light
#

crap ok, darn.

#

yea I need to know when each player is connected and ready, as the game is assymetric

#
  • asymmetric lol (sorry for spelling)
#

I have to do something different in the game mode with each player's HUD

#

or rather

turbid robin
#

oh, well then GameMode may be correct. do you basically want to know when EVERYBODY is ready?

#

or just a specific player?

alpine light
#

basically ... each player gets a different set of units that spawn, and ALL players UIs need to know about them

#

but I can't know ahead of time what units the player has picked

#

so this whole process has to be dynamic - I was trying to do it with player states but the HUD keeps initializing before player state receives replication, amongst other timing issues between players connecting in general at different speeds

turbid robin
#
    /** Initialize the AHUD object for a player. Games can override this to do something different */
    UFUNCTION(BlueprintNativeEvent, Category=Game)
    void InitializeHUDForPlayer(APlayerController* NewPlayer);
alpine light
#

I'm not sure I understand how that would solve it?

#

sorry 😦

meager spade
#

OnRep pawn

turbid robin
#

don't be sorry. 😃 that gets called from GenericPlayerInitialization, which gets called after the player has logged in (or finished travelling). perhaps you can hook into that function either natively or in BP's. from there, you could see if the other actors are ready for you and if not, wait for them to get replicated.

meager spade
#

is called once the pawn has replicated on the controller

#

if you want it earlier, APawn::Restart /** Called when the Pawn is being restarted (usually by being possessed by a Controller). */ virtual void Restart();

alpine light
#

ok so if I am understanding correclty, since my main problem is that a client sometimes does not have replicated player state variables from player states other than their own, I would need to wait for replication of ALL player states on each client to be ready before doing anything with the UI?

meager spade
#

well

#

OnRep_PlayerState

#

gets called once the PlayerState has replicated

alpine light
#

😮

meager spade
#

so at that point the playerstate is ready

alpine light
#

really?? there's an OnRep_PlayerState built into the game???

meager spade
#

yes

#
    UFUNCTION()
    virtual void OnRep_PlayerState();```
#

part of APawn

alpine light
#

and that happens for each player state?

meager spade
#

yes

alpine light
#

holy crap. I think this is exactly what I was looking for 🤦🏽 ... (though I don't feel confident enough to know if I'm right lol...) ONWARD! And thank you all so much, this discord server is solid gold ❤

meager spade
#

np hopefully it solves your issue

alpine light
#

oh actually I do see one more problem up front with that

#

can that event be hooked into from the player controller?

meager spade
#

whoops

alpine light
#

player states don't have access to the player controller

meager spade
#
    virtual void OnRep_PlayerState();```
#

exists on AController

#

...

alpine light
#

OH! my bad I thought you said it was on player state 😃

#

thank you, that works great then

meager spade
#

APawn and AController

#

both have a PlayerState OnRep

#

i use it for this purpose, my CharacterAnimComponent requires information from a component on PlayerState

#

so i wait for it be repped back, before i initialize it

#

i am guaranteed to have the info i need at this point

alpine light
#

is ATheiaCharacter your controller class? or your pawn class?

meager spade
#

my pawn

alpine light
#

ok

meager spade
#

Controller also has a OnRep_PlayerState

#

make sure you override and call Super

#

else things will break

alpine light
#

thank you for that, I would have forgotten

dark edge
#

Anyone here know how I can get physics to run on server AND clients, with server correcting clients periodically?

alpine light
#

If anyone is so inclined, I have one more question for those of you who are more experienced with replication. If I have an int MagicNumber on GameState, and it is ReplicatedUsing=OnRep_MagicNumber , if the game mode updates MagicNumber to a different value (let's say 20) BEFORE a client connects, does the GameState on that client's machine trigger OnRep_MagicNumber immediately once it's connected, or does it just default MagicNumber to 20 (instead of 0) without triggering OnRep_MagicNumber?

#

(this is with dedicated server)

meager spade
#

OnRep will be called for new and existing clients

#

if the property changes

#

so every client will have the same value

dark edge
#

How to feel dumb..... Try to multicast something inside of PlayerController and wonder why the 2nd client never fires. Doh!

severe widget
#

What's even more fun is exploiting that fundamental fact as an AutonomousProxy check and having to explain that you understand how PlayerControllers work =D

limber plaza
#

hehe! I've been there Adriel.

#

Hey gang. I was wondering if anyone has experience running a ue4 (steam) dedicated server inside a docker container. I have been able to get my server running in there, but it seems invisible from the outside. I have confirmed my server IS visible on an ubuntu vm (so it's not a problem with the linux build) just it's not visible from my docker container.
Additionally I have set up some node-js udp servers just to be sure I am able to create a udp server within a docker ubuntu based image (so it's not the port exposing / binding).
Does anyone have experience like that? Or know a better place to ask this q?

glass plaza
#

Fun times. Trying to debug why my NetMulticast is not firing properly on the owner of the object.

glass plaza
#

Trying to figure out why this updates every client properly except the owning client (FlyingTick is called as a part of PhysFlying in a CMC.)

opaque oriole
#

any tips on replicating the sequencer ? I'm multicasting event that creates and runs the sequence, it does fire alright, launched from the server, and the whole sequence gets played on the clients, there are however issues with some of the animations and effects not being applied to the clients end

#

should each actor in the sequence have replication on or sth ?

thin stratus
#

@glass plaza You gotta follow it backwards to see where it'S coming from

#

The CMC has lots of checks in the TickComponent for filtering Server, Owner and Simulated Clients.

real yacht
#

hey guys, i'm having few questions:

  1. Who keeps record about dedicated servers, how much players currently are in some server playing, when dedicated server is full, start new instance, etc?

    • Is it okay to use mySql with that informations?
  2. I'm having nodeJs server (master-server) when some client want's to play, he communicate to master-server (with socket.io) and master-server starting new dedicated server, and sending back ip and port to client, so client can connect. Is this okay logic for my first question?

urban dew
#

having a small bit of an issue with multiplayer replication, im trying to make a player teleport

#

im trying to call it from a object in the world however

#

nd using a blueprint interface

thin stratus
#

What is executing that teleport

glass plaza
#

@thin stratus , I can trace it down to the fact that my CapsuleComponent (the UpdatedComponent) replicates its Rotation to all the other clients except the owner himself.

urban dew
#

@thin stratus the players character

#

has an interact function

thin stratus
#

And where do you RPC?

#

Cause well to call a Multicast, you need to be on the Server

#

So you gotta ServerRPC somewhere

#

And that can't be in the Actor you interact with

#

Cause that is not owned by the Client

#

Soooo you gotta ServerRPC before you Interact, and then Interact with the Object and then call the Multicast

urban dew
#

im havig it so if a world door is unlocked, you can teleport through to the other side, do you know a better way to do this then?

#

i dont know rpcmeans

thin stratus
#

Then you shouldn't try to do multiplayer, but rather learn first.

#

Check the Compendium that is pinned to this channel

#

@glass plaza That could totally be true as the owning client doesn't need that to be replicated

glass plaza
#

Gah, problem seems to have been that I was trying to set a rotation during the phys loop. Moving my replication function to Tick made it work.

thin stratus
#

Lovely how GameSparks completely changed their pricing model

#

Bye GameSparks!

#

Any alternatives? I guess PlayFab or what it was called.

grand kestrel
#

@thin stratus I got that email. They said it's for transparency and optional if your game is released prior to the change more or less. I didn't read the details though, what did they actually do

#

That's the problem with these services. Using them is a risk. Making your own is too much work. Just can't win.

thin stratus
#

Yeah if it's released prior

#

But most games aren't

#

There is lots of people (like my client) who setup the backend some while ago but haven't released yet

#

So they are part of the dev tier

#

And to use the Matchmaking one, you need enterprise

#

While before all of that, they were in the Indie tier, which now doesn't exist anymore (unless you already had a live game in it)

fleet raven
#

wtf they made it even more expensive?

thin stratus
#

And + all of that, the Matchmaking stuff will be turned off and replaced with a new, announced system

#

Yeah, Standard tier is 299$ + the MUA stuff

#

And that doesn't include Matchmaking

#

Or the Realtime code

#

So for an indie, that's just not usable anymore

#

EPIC ;-; Release your backend

fleet raven
#

but it was already insanely overpriced

jolly siren
#

Does ForceNetUpdate() do anything if the actor's Net Update Frequency is set to >= the server tick rate?

winged badger
#

it might, if the network is a bit clogged

#

will probably push it to top priority

jolly siren
#

That would be nice if that is the case

grand kestrel
#

@thin stratus it's definitely good for epic though

#

Gamesparks is asking to be replaced

thin stratus
#

Epic's stuff till takes until at least end of the year though

grand kestrel
#

Yeah

thin stratus
#

The time between that is kinda shit for people who want to release soon

grand kestrel
#

Yep

#

Everything is always shifting though

#

There's always something on the horizon

dark edge
#

Does this seem right to you guys? I want to set the values locally but also have them replicated everywhere BUT locally.

thin stratus
#

Yop

dark edge
#

The motion of the main body and attached parts is server authoritative, but the driveline sim and wheels are locally simulated

hollow lance
#

Hey there, newbie to UE4 here.

I'm trying to replicate my character (yaw value only). I found out that SetActorRotation would not be replicated, and AddControllerYawInput would, but it is not exactly what I need.

As my character rotates to where the mouse is pointing at, I'd imagine that the local client would update his yaw value, sends this value to the server and then the server just forwards it to other clients to simulate.

I'm thinking of declaring a UPROPERTY(Replicated) float MyYaw value, but the UE4 doc says explicitly that changing this value on the client-side is not recommended. What would be the correct way to do it?

jolly siren
#

Does anyone know what the comparison for replicated properties (to see if they need to be sent out) is called in session frontend?

jolly siren
#

The stat name in the profiler

winged badger
#

i think that has to do with IRepChangedPropertyTracker

#

not even remotely sure tho

#

check AActorComponent::PreReplication

#

@hollow lance replicating a FRotator DesiredRotation then doing an interpolation towards it on Tick is a simple way to go

#

in the Pawn itself

#

also, your server will have no idea where the client's mouse cursor is, as it doesn't have either its mouse screen position or the viewport size/position in order to translate that to world coordinates

hollow lance
#

@winged badger thanks man, I just figured it out with SetControllerRotation, and set the Character to use its Controller's rotatoin as well

real yacht
#

hey guys, i'm having few questions:

  1. Who keeps record about dedicated servers, how much players currently are in some server playing, when dedicated server is full, start new instance, etc?

    • Is it okay to use mySql with that informations?
  2. I'm having nodeJs server (master-server) when some client want's to play, he communicate to master-server (with socket.io) and master-server starting new dedicated server, and sending back ip and port to client, so client can connect. Is this okay logic for my first question?

thin stratus
#
  1. You would need some sort of backend to keep track of that. The Servers themselves know it, but not in a way to just read i from the outside.
    That means you need to let the Server tell the Backend that there is a new player or that one left.
    This is usually done via Sessions and a MasterServer, simiar to what you state in your part 2.

For the "Start new Instance" stuff, you most likely need a Service that keeps track of how many Servers are full and how many Servers are idling.
Usually you don't want to spin a new Server up when every over is full, but rather spin a new one up if only x Servers are NOT full.
Services like GameLift do this for you, but they are more for games that have matchmaking, like Overwatch, CS:GO or BattleRoyal like queueing.

  1. Yeah, kinda, it depends on what you want. Usually MasterServers are used to show ServerLists.
    You can of course also use it to provide information about a new Server being started.
    You do however want to already have a Server up and waiting like explained above. That will remove the time of the Server having to start up etc.

If you look into how GameLift handles this and do it similar, you shouldn't have a problem.

#

@real yacht

real yacht
#

@thin stratus thanks for detailed answer. So if i want to use amazon gameLift, my master-server need to be unreal dedicated server or i can do that in nodeJs?

thin stratus
#

GameLift is the MasterServer at that point

#

GameLift lets you upload an Unreal DedicatedServer to their backend.
And they will start these based on some settings you can change.

#

But if you are already good with your own setup you should follow that

#

GameLift is not the cheapest

real yacht
#

currently, for local testing, i have nodejs + dedicated server

thin stratus
#

Yeah, your NodeJS MasterServer should have a Database it can communicate with

#

May it be MongoDB or similar

real yacht
#

so that was my next question

thin stratus
#

And store relevant data in that

real yacht
#

mysql or nosql (mongo)

thin stratus
#

I would always go for MongoDB + Mongoose when using NodeJS

#

But that's preference I assume

#

The Discord Bot (AAICharacter) you can see on the right is using NodeJS + Sqlite

#

Which is def not so nice to work with :D

real yacht
#

yes, and it's not relation database, so i can put whole JSON object

#

😄

thin stratus
#

If you use Mongoose, you can use Schemas

#

So basically you define a class of what data should be stored

#

I haven't used it myself yet, but it looked fun to use as a programmer

real yacht
#

sounds cool. and one more question

#

im using socket.io to communicate with nodejs server, so i can do some events with clients,

#

i think that is okay?

thin stratus
#

I haven't used Socket.io yet. A client of us uses it to communicate between devices.
Last time I did a MasterServer I simply used HTTP requests iirc

real yacht
#

i found this interasting, because it's event based

#

and works really cool

thin stratus
#

POST to give the Server data
GET to retrieve data from the Server

#

Worked well /shrug

#

You should use what you find best working for you

real yacht
#

thanks mate! this was helpful!

#

😃

fierce jetty
tame quail
#

in offline multiplayer, is there a way to do something like "press A on new controller to add player" ?

chrome bay
#

console command 'CreatePlayer' does that I believe

tame quail
#

thank you, i'll have a look into that

#

and all controllers automatically have input and a player index?

fierce jetty
#

@thin stratus I believe that does not exist?

#

As in, not player friendly

thin stratus
#

No, it doesn't really.

#

As far as I know (and just tested again for sanity), the second controller (or third and fourth) won't do anything with Input until it has a PlayerController assigned and spawned.

#

And to do that you need to call AddPlayer.

#

So the solution would be spawning the Players upfront and then listening to the Controller Input.

#

However, creating a Player will instantly make them counted for Splitscreen, so the Screen will split, even if you don't press A.
As well as spawn a Player in the actual Game if you travel to a new map.

#

@chrome bay Correct me if I'm wrong here. Maybe I just didn't see something obvious. (would be good, then I can add that stuff for hoverloop)

chrome bay
#

Oh I honestly am not sure. It's been years since I used any of those commands 😄

#

I gave up on local multiplayer :/

#

mixing it with online is a minefield

thin stratus
#

Yeah well that's still in front of me :P

fierce jetty
#

You'll manage 😉 !

scenic raven
#

Can anyone help me with the most stupid bug? I want to generate a random color for a player and keep it consistent across all players. In my custom PlayerState I have this:

#
    FColor PlayerColor;
#
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(AVirePlayerState, PlayerColor);
}```
#

In my Character BP I have

#

if I launch a listen server, the character has a color. If I launch a client, it has a color. When the client first joins the server it gets a different color on the server and, but on its own game it loses the color and goes to the default one (for all the characters)

#

I have no clue why this is happening

#

Characters on server after the client joins

#

It's driving me nuts

worthy perch
#

I don't know what MMesh is, but maybe you can't replicate that.

scenic raven
#

the replication shouldn't be there. I am replicating the color that is applied after possess

worthy perch
#

Yeah, but maybe that property is invalid for clients.

#

Also, does Possess() get called on clients?

sharp pagoda
#

@scenic raven Use either OnRep_PlayerState or APawn::Restart() for your callback

#

Also a better approach is to use a rep notify so that you can change the color during runtime

scenic raven
#

thx will look inmto that\

#

into that

chrome bay
#

You can't replicate a material instance

#

Which is what that Blueprint is trying to do

#

In fact you can't replicate an FColor either

scenic raven
#

As I said, forget that part. I'm not trying to replicate the material instance (as that blueprint says). I'm trying to replicate a PlayerState property and use it to set a material instance parameter on my Actor.

chrome bay
#

FLinearColour you can

scenic raven
#

@chrome bay this is much more interesting, thx 😃

#

I hope it's just that, I'll give it a go. Thx a lot

chrome bay
#

The other problem is race conditions. The character might replicate before the player state, or the possession might replicate before the player state. You have to workaround those cases

#

Unfortunately blueprint doesn't seem to receive the OnRep_PlayerState() event

scenic raven
#

It does not. And my CPP doesn't know about the mesh

#

I can use my CPP OnRep_PlayerState to call a BlueprintNativeEvent though.

chrome bay
#

Yeah exactly

#

Also, other player controllers won't exist on clients, so you won't be able to get the player state from them

scenic raven
#

@chrome bay thx for the tips

#

I was able to solve it in a more elegant way I think

#

based on your suggestions

#

This is the relevant part of the header file

#
    FLinearColor CharacterColor = FColor::MakeRandomColor();

    UFUNCTION()
    virtual void OnRep_Color();

    UFUNCTION(BlueprintNativeEvent, Category = "CharacterBase")
    void UpdateMaterialInstanceColor();
#

This is the CPP part

#
{
    UpdateMaterialInstanceColor();
}

void ACharacterBase::UpdateMaterialInstanceColor_Implementation()
{
    return;
}

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

    DOREPLIFETIME(ACharacterBase, CharacterColor);
}
#

clean and character handles almost all of it by itself.

twin juniper
#

i need help in making multiplayer game. Server hosting, login and stuff like that

#

I can pay if needed

chrome bay
#

Yeah way cleaner, much more nicely done 😃

tropic fjord
#

Does anyone know if there's any way to replicate a TArray<TPair>?

fleet raven
#

replace it with a proper struct

tropic fjord
#

So you mean just have the Key inside of the struct? @fleet raven

fleet raven
#

key?

tropic fjord
#

I have an item system and I want to store which slot it's taking up without using a simple array index

#

Cuz if I wanted to assign something to my 6th item slot even though 1-5 is empty, it'd be kinda weird, no?

fleet raven
#

depends on the scale

#

if you have 10 slots, it won't matter if the first 9 are just empty placeholders

tropic fjord
#

I mean, can have "empty" objects in the array that get replaced, but..

fleet raven
#

if you have thousands, maybe

tropic fjord
#

Isn't there a better system than having empty placeholders? It's how I did it before, but it feels ugh

#

Was trying the TPair method, but doesn't work

#

if only TMap replicated...

#

.<

balmy kindle
#

Hey guys, did you ever had an issue where the server cannot see a specific actor but the client can? 🤔

rigid sonnet
#

I need help with figuring out the best networking solution for a real-time combat styled MMO. There will probably be about 8 players per map, and zelda-styled world with medium-small sized areas, dungeons, towns etc

vapid egret
#

Can I send the build of my game to the players without the server together?

cerulean hamlet
#

Why is ClientSetHUD a thing that's built into the PlayerController?

#

Why doesn't the PlayerController set up its own HUD when it spawns on the client and if the server wants to change the HUD later on a custom RPC should be written to do that

gleaming vector
#

odds are, a UT game needed it at one point

#

there is a lot of legacy cruft from UT3 and Gears in the GameFramework

cerulean hamlet
#

Makes sense. Seems like an awkward way to go about initializing the HUD

maiden vine
#

Is there any way to get a player's player state after they start a listen server? All i can get is the player states that are still on my main menu level.

#

I need his Ip once he starts the listen server to send it to the other clients

#

Im trying to use a button on the menu to get the player IP

glass plaza
#

Is there a way for me to instanciate a different GameInstance type on Clients than on the server?

winged badger
#

@maiden vine having multiple players on the same level, menu or not, means you already have the connection

#

and do not require the use of IP/port to maintain it

#

see: ServerTravel (Seamless)

maiden vine
#

the player goes to different level while i'm lookin in main menu for the ip to connect to

winged badger
#

they are either already connected

#

or they are each in their own main menu

maiden vine
#

I have two dedicated servers

winged badger
#

first case, you do not require an IP/Post you can just ServerTravel

maiden vine
#

ok

winged badger
#

should still be able to Travel, altho seamless won't work when switching servers

maiden vine
#

I was joining the listen server after so i could show the hosts on a widget in main menu

winged badger
#

you can also stash the information in the GameState instead of specific playerstate

maiden vine
#

ive been trying game state and playerstate I just cannot get a variable back to the menu

#

i print number of player states before and after i start a listen server the joining player sees 2 then 1 after the listen server starts

#

My join button tells me Im not finding the variable or it would make a list with one entry

dark edge
cold crystal
#

What database should I use for my card game? I'm familiar with Postgres and MOngoDB, but i'm open to learning something new. Must be able to compile to windows, mac, iOS, and Android. It will be used for Accounts, and people's currency/card collection.

kindred sandal
#

We want to list all Backend services in below sheet , Feel free to write Backends you know in the sheet
https://docs.google.com/spreadsheets/d/1x0eok6EZzigar_K3QNdzTYNhp5NLywLGqBuopKiVzao/edit?usp=sharing

glass plaza
#

Is there anything I should be paying attention to in specific when spawning Actors in Multiplayers?

#

Access violation, even though I checked, ProjectileClass is definetely valid.

fleet raven
#

that code doesn't make any sense

#

you don't use Cast with classes like that and you don't call StaticClass in a non-static way

#

what type is ProjectileClass?

glass plaza
#

This is more debug code than anything. I was trying to make sure it wasn't crashing because of ProjectileClass not being a derivative of AProjectileBase.

#

ProjectileClass is TSubclassOf<AProjectileBase>

fleet raven
#

in that case, it can not be not a subclass

#

so the check is unnecessary

glass plaza
#

Still doesn't explain that SpawnActor is crashing

fleet raven
#

what could happen though is that it is nullptr

#

you're not getting to that line at all as the branch before makes no sense

#

ProjectileClass will be of type UClass, casting that to type AProjectileBase will always return nullptr

glass plaza
#

Yes, I am getting into it.

fleet raven
#

replace it with if(ProjectileClass)

glass plaza
#

Anyways, figured it out.

#

My Pooling Manager is a UObject, so no World context.

cold crystal
#

@kindred sandal thank you! can you give me a brief rundown of this sheet, it's a bit overwhelming at first glance

kindred sandal
#

We are cleaning it up, wait few hours then it will be simple

cold crystal
#

Awesome, thank you

#

@kindred sandal does gamesparks work with mobile?

kindred sandal
#

Yes it does

#

But after pricing change and Removing indie plan , Many are searching for alternatives

cold crystal
#

i think i'm still going to try to work with postgres, but if that doesn't work out, gamesparks looks great

#

how do you do instanced matchmaking in unreal? like for a cardgame, have clients queue, and then placed in an instance of the server for a match. Anybody have a good place to learn how to do this?

kindred sandal
#

Easiest way is BaaS

cold crystal
#

@kindred sandal could you elaborate a bit? i know it means backend as a system, but I fail to see how i'd go about using a BaaS to instantiate matches

kindred sandal
#

There are many sample projects If you search in GitHub

real yacht
#

can someone explain me difference between

  1. building dedicated server from Visual Studio and engine source development_server configuration
  2. building dedicated server from project launcher (unreal editor) but project is started with engine source version (right click, change engine version to source) and start project.
wanton pebble
#

hey guys

#

i'm having a bit of an issue with my multiplayer, probably with my router settings

#

i followed a course on C++, and that ended with networking a game project

#

it works locally, but whenever i send it to a friend we can't connect to one another

worthy perch
#

You probably have to port forward.

kindred sandal
#

Port forward 7777 and 7778

#

And check your firewall

high current
#

any reason why this doest work on dedi?

#

I tested with a fixed impulse value, and it seems to work, so it looks to be that it cant get the proper vectors if its a client and not the server

maiden vine
#

anyway to stay connected to dedicated server after you start a listen server?

#

I cant get data from my player who starts the listen server back to my main menu

#

I wanted the other players in the main menu to know what the host was doing on the other map

#

When he starts the listen server i notice dedicated server says he left and his player state is gone

#

I need that player state if possible thx

sharp pagoda
#

Are you trying to make a lobby system?

maiden vine
#

bingo

sharp pagoda
#

Yea, it's a hell of a lot more complicated than that. Look into beacons

maiden vine
#

I got all working with my web database up till now

#

im bad in php

sharp pagoda
#

I have a whole folder of bookmarks on lobby systems I can send you in a few hours if you want

maiden vine
#

I would appreciate that

#

I cant get the ip of the host that leaves

#

tried a gang of ideas not working tho

sharp pagoda
#

Yea you need to use beacons

#

Dont ha ck it together

#

SteamParty on the marketplace is a good place to go if you want to jump right into the deep end

maiden vine
#

thx for the info Im just trying my own path

#

if i could write array in php to get the data i need but I thought the engine would be easier

scenic raven
#

I have a dedicated server running on an AWS windows EC2. All inbound traffic is open, but my clients can't connect to it, they timeout. Any clue about what to look into?

chrome bay
#

Confessions from a Gamesparks Dev. Interesting.

#

If it's to be believed, that is.

fleet raven
#

seems believable, considering their were bought by amazon

chrome bay
#

Real damn shame.

#

Can't put your trust in any third party vendor these days

#

Epic being one of few exceptions so far it seems.. hope they keep it up

fleet raven
#

so of course they will try to turn it into a aws (amazon web scam) product

chrome bay
#

I am immediately flooded with remorse about moving to AWS servers recently :/

worthy perch
#

What's a good alternative to AWS?

chrome bay
#

Well I used Azure for about 2 years thanks to their BizSpark programme, but once that ran out it ended up being pretty expensive

#

So to be honest I'm not sure

#

Setting up EC2 instances on AWS was pretty painless, and I've got some credit to use up there before I start paying.. after that.. who knows

worthy perch
#

Well... maybe that gamedev post was fake. That's really not impossible.

fleet raven
#

linode / digital ocean

#

aws is just overpriced crap these days

worthy perch
#

Is it really that overpriced?

fleet raven
#

yes

#

especially if you're going to serve any data

#

bandwidth on aws is literally 10 times more expensive

#

for no reason

#

I guess you could call it the "enterprise tax"

#

the large companies that are aws target customers will pay it just fine

#

since they have infinite money

worthy perch
#

Hmm, I will look into linode and digital ocean. I had wanted to use AWS because it is big and popular (and thus easier to work with).

chrome bay
#

digital ocean are good

#

I use OVH for my personal servers, they've been okay so far

kindred sandal
#

I think BrainCloud is best alternative to GameSparks

chrome bay
#

but yeah.. the enterprise tax definitely exists

fleet raven
#

maybe don't use linode

#

their networking seems to be unreliable

#

it just randomly dropped my ssh connection for no reason

glass plaza
#

I am failing to understand how this is not deleting the actor for clients.

jolly siren
#

If the actor is replicated you can just destroy it on the server.

glass plaza
#

My actor is set down in the scene yet refuses to be destroyed on Clients

dark edge
#

Are the actors themselves replicated?

#

otherwise you just have 2 parallel actors, they aren't the "same one"

thin stratus
#

unless you specifically tell them to have authority over an actor

#

Not sure that is true

#

Owning != Authority

glass plaza
#

Problem got away after I toggled Static Mesh Replicate Movement and Always Relevant.

thin stratus
#

Both nothing you want to use for that

#

"Always Relevant" would replicate the state of that thing everywhere, even if you aren't even remotely seeing it or close to it

#

And ReplicateMovement has nothing to do with Destroying an actor

thin stratus
#

Done for 4.22

#

(last point)

#

@chrome bay @jolly siren Think you two would like reading that?

#

Hopefully the whole Steam + Dedi Server stuff will get nicer

jolly siren
#

ooooh the trello has been updated ❤

#

Yeah I'm really glad that they put some more work into Steam 😃

sharp pagoda
#

@maiden vine Alright here's the resources I was talking about:

https://docs.unrealengine.com/en-us/Gameplay/Networking/OnlineBeacons
https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1355434-onlinebeacons-tutorial-with-blueprint-access
https://answers.unrealengine.com/questions/467973/what-are-online-beacons-and-how-do-they-work.html
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/85348-party-beacon-how-does-it-work-o-o
https://wiki.unrealengine.com/PartyMatchmaking```
idle flame
#

Hey,
I have a question, I have an actor with a lot of properties (Arrays of Procedural Mesh & InstancedStaticMeshComponents).
This actor is spawn and work well on the serveur, but for someone reason, this actor does not exist on my clients (but bReplicates is set to true).
I set the position of this actor to the position of my pawn when spawning.
When I'm setting AlwaysRelevant to true on this actor, it work and the client get this actor.
Why do I have to set this variable to true to get my actor on client side ?

meager spade
#

because your net relevancy for that actor is making him not relevant

#

always relevant will ignore the GetRelevancy check

idle flame
#

But why the actor's Net Relevancy make my actor not relevant ? This actor is in front of my player

#

Net Relevancy depend on the distance with my client pawn right ?

still nexus
#

Anyone know how OnlineSubsystemNull works? Without a master server? I don't understand. This is for a game I'm planning to host on a website (html5)

jolly siren
#

Is it possible to receive an OnRep for a property on an actor that only existed in the previous level that you just travelled from?

#

I have a replicated property on a gun that uses OnRep. And it appears to be getting hit after the match ends and you have travelled back to the lobby

#

According to a crash report

#

I thought the previous world would have already been destroyed

dark edge
#

Am I designing my ass into a corner by putting all my client/server stuff on the playercontroller?

#

like the spawning and possession of pawns, etc

sharp pagoda
#

Hmm I suppose it's possible if the packet got heavily delayed and was received after the actor was destroyed. You might need to add a safety mechanism (mod that bit of the engine) if you quickly travel from game end -> post match @jolly siren

#

@dark edge Spawning pawns should happen through the game mode

idle flame
#

Hey,
It's me again ... I don't understand anything, I have on actor named MapGenerator in my level.
In the log I have 2 time this message : I'm the server

This actor has been create 2 time, and I think my 2 client are on different server because they can't see each others ...

void AMapGenerator::BeginPlay()
{
    Super::BeginPlay();
    if (HasAuthority()) {
        UE_LOG(LogTemp, Warning, TEXT("I'm the server"));
    }
}

I also have this error, I think the server is create again after it :
LogNet: Warning: Network Failure: GameNetDriver[FailureReceived]: Outgoing reliable buffer overflow
LogNet: NetworkFailure: FailureReceived, Error: 'Outgoing reliable buffer overflow'
This error appear when I try to replicate a very big array of UStruct

Thx for any help

urban dew
#

inside my player controller, im trying to make a function to make ai move

#

ignore that its not for mp

dark edge
#

Is "self" a friendlyship?

urban dew
#

self was just a latest test, i had tried "get owner" bunch of things

#

friendlyship is a ai blueprint in the world

#

im trying to cast to friendlyship

tropic snow
#

anyone know why I cannot rejoin the same server after disconnecting? I have to close out of the game entirely for both server and client?

dark edge
#

@urban dew you need to get a reference to an actor of type Frienflyship somehow. Try the get all actors of class node.

tropic snow
#

how do you call it when a player accidently gets kicked (goes to main menu)

#

should I add a destroy session in main menu on begin function?

#

nice thank you

copper owl
#

So after you join a game I have this

It sets the value of session in the gamemode to the value of the session you are joining

#

My copy and paste broke 1 sec

#

that

#

wait nvm I am stupid ignore this

#

I forgot to make the event actually run

#

welp that still didn't fix it

#

so

#

I have this running on tick in the gamemode bp

severe widget
#

🤔

copper owl
#

for some reason respawn is always set to false in the characters

severe widget
#

You know you can uh.

#

You can override SpawnDefaultPawn and set that property when the player spawns, right?

copper owl
#

what

#

No actually I have no idea what that means

severe widget
#

A moment if you will

copper owl
#

ok

severe widget
#

My editor is loading

#

Presumably.

copper owl
#

ok

#

The SpaceX stream just came back so I can wait

severe widget
#

Click override (blue circle), then you can override SpawnDefaultPawn. I've noted other interesting functions with yellow indicators.

#

A basic override like this will let you set a property on the character as it spawns

#

Don't think you're going to see SpawnDefaultPawnAtTransform used

copper owl
#

Where did that "Parent" function come from

severe widget
#

right click menu

copper owl
#

Elon Musk is into vaporwave

#

who knew

#

The spacex stream is playing some vaporwave rn

severe widget
#

does he directly control the playlist?

copper owl
#

idk

severe widget
#

could be someone else

copper owl
#

Knowing him he probably had some say in it

severe widget
#

Fitting tho

copper owl
#

So would I do this?

severe widget
#

Yeah

copper owl
#

ok

#

thanks!

#

lemme see if it works

severe widget
#

Erm

#

missed a thing

copper owl
#

?

#

oh yeah

#

return value of the end node

severe widget
#

return

#

💯

copper owl
severe widget
#

bravo

copper owl
#

That emote is too good to be free

severe widget
#

Anyway

#

failing just using the normal functionality of the engine

copper owl
#

Elon musk has good taste

severe widget
#

make it print a string on the two unused pins

#

If you never see those strings and the pawns are still behaving as if you have respawn = false, then its an error in the Sessions API you're using.

copper owl
#

I am using AdvancedSteamSessions

#

plugin

#

ok I think what I should do is make a separate gamemode for when you are actually playing

#

because this fires when you are in the menu

#

Ok it said not found when I loaded into my game

#

The key is named respawn

severe widget
#

I'll stand aside because I don't use the AdvSessions plugin

copper owl
#

I think I know where the issue might be

severe widget
#

Sorry my suggestion made you crash

copper owl
#

It didn't crash my engine

#

The standalone window crashed

#

It probably won't work because I am using the gamemode

#

I should use the game state or something

idle flame
#

Hey,
I'm using BeginDeferredActorSpawnFromClass to spawn on my server an actor.
Then I init some value on server side by calling a function of this actor.
And finally, I use FinishSpawningActor to spawn it.

My problem is that I want to replicate the value that I init before spawning it (here this value is a simple integer).
But it appear that this value is not replicated.

Chunk is my Spawned Actor (bReplicated true & bAlwaysRelevant true)

MainClass : (Where I spawn my actor)

            Chunks.Add(Cast<AChunk>(UGameplayStatics::BeginDeferredActorSpawnFromClass(this, ChunkClass, SpawnTransform))); // Start DeferredActorSpawn from Blueprint Class
            if (Chunks[Chunks.Num() - 1] != nullptr) { // Check nullptr

                Chunks[Chunks.Num() - 1]->InitServer(IAmAnInteger); // Call actor's function to init variables

                UGameplayStatics::FinishSpawningActor(Chunks[Chunks.Num() - 1], SpawnTransform); // End Spawn of actor

AChunk Class : (The actor that I spawn)

void AChunk::InitServer(int32 IAmAnInteger)
{
    LocalVariable = IAmAnInteger;
}

``` Somone know why this value is not replicated at construction ?
fossil spoke
#

What is InitServer() doing?

twin juniper
#

Let's say my hardware can run UE4 games between 70-120fps steady on the lowest settings with a fully mesh map (ex: LawBreakers). By example, Unreal Tournament Pre-Alpha runs great in singleplayer, offline.

However, in multiplayer... it's very different in the sense that for some obscure reason, things would run smooth most of the time. But sometimes I would experience a sudden isolated frame rate drop (freeze) during a match or it would stutter for a few seconds. Sometimes, it occurs during a whole match. When I was playing LawBreakers, some matches were butter smooth and the next match in the same map would be very inconsistent.

If your opponents have much lower pings, could it have a negative impact on performance in multiplayer?
Could the new PhysX 3.3 be the cause of this drop in performance in multiplayer?
Any other theory?

#

Or is it because in order to run UE4 games specifically in multiplayer you need to have higher hardware requirements?

fossil spoke
#

Honestly it could be anything. It maybe a large asset being synchronously loaded that was never needed in your previous session.

twin juniper
#

Well i can clear that out.

#

And that's not what is causing the issue.
Don't get me wrong, they could definitely contribute. But in this case, the fully meshed map isn't the cause of those issues.

#

They occur even with an empty map or map with simple meshes or BSP.

#

Of course, the video above is too short. But you can see the graphics.

#

But I do experience from time to time, those freeze and stuttering in multiplayer.
That affects aiming, sometimes the input arent registered.

fossil spoke
#

It maybe GC running.

#

Without actually debugging the issue its hard to guess at what it could be.

twin juniper
#

What does GC stand for?

fossil spoke
#

Garbage Collection

twin juniper
#

Yeah, that was one of my theories too.

fossil spoke
#

Input Latency is very high in UE4

twin juniper
#

Yes it is.

#

I do feel the difference by swtiching to Forward Shading. I cant stand playing and aiming with Deferred

#

There is a tiny delay

#

but it's enough to throw my aim off

fossil spoke
#

UE4 wasnt designed for ultra low input latency games.

twin juniper
#

I understand.

#

It's a bit unfortunate considering the history of the engine that started with UT.

#

I hope that some day, the devs will consider making a special low latency mode for this kind of games.
Unless that's already what they tried to do by adding Forward Shading and they also made a few changes recently.

#

It's also not limited to UE4. Other games recently released are having the same behavior.

fossil spoke
#

I would suggest that you properly profile the game, you can use the Session FrontEnd to help identify what is causing the frame hitches.

#

It maybe a thread taking up alot of time doing something specific which you can target for optimisation

#

Forward Shading was added to better support Mobile.

twin juniper
#

Do you think that once the UE4 dev team are done with the Vulkan API support for High End PCs that it could help improve input latency on PC?

fossil spoke
#

I doubt it.

#

Low Input Latency is not a high priority issue

twin juniper
#

It's my current assumption considering that DOOM 2016, specifically with Vulkan API, doesnt seem to have any significant amount of input latency.

#

I mean of course it has some... but not like UE4

#

"Low Input Latency is not a high priority issue"
I understand.

#

Would be great to see a ''community effort'' at some point to give us at least a work around for the devs that want to make those kind of games

#

Some kind of UE4 branch for low input latency games or something

#

There is one thing I cannot know, because... Im stuck with an old PC.
Does it help to use a high end PC? or is the overhead still the same?

fossil spoke
#

You would have better luck contracting someone to investigate trying to lower the input latency for you, either that or find a like minded community that has sufficiently skilled persons to help.

#

The input lag will still be high even with higher specs.

twin juniper
#

yeah, that's what I was afraid of. 😦

fossil spoke
#

But it may help. I mean, if your running on a potato you should consider upgrading.

twin juniper
#

I might know someone.

#

jitspoe, the gameplay programmer who worked on LawBreakers. He is currently working on an indie sidescroller with Godot.

#

(Nathan Wulf)

fossil spoke
#

If your trying to make a pro game, running it on a 60hz monitor with a gtx260 isnt going to help at all.

twin juniper
#

hahahaa

#

I agree.

#

Im making an indie FPS game, but was juggling between Unity and UE4.

fossil spoke
#

If low input latency is a core requirement, then dont choose UE4

twin juniper
#

Mainly because I feared that I wouldnt be able to solve this input latency issue with Ue4

#

Yeah, that's pretty much the only logical conclusion I can think of at the moment

#

The thing is, when we played lawBreakers.
The game run surprisingly great on the Beta Map

#

And it wasnt using BSP

#

The cubes used were actually meshes

#

And I had no issues at all with that experience

fossil spoke
#

Like i said, if you profile the game you will more than likely be able to narrow down where the issue is coming from.

#

Frame hitches sound like a slow returning thread that could be doing cleanup or asset loading

twin juniper
#

So, it could really just be the garbage collection afterall...

fossil spoke
#

Could be

#

Profiling will tell you if it is or isnt

twin juniper
#

oh I see.

fossil spoke
#

Research how to use the Session Frontend profiler

twin juniper
#

Noted.

fossil spoke
#

The profiler is a really powerful tool.

twin juniper
#

I will.

#

Thank you for your time. I'll investigate. And I'll have a short discussion with Jitspoe.

#

👍

fossil spoke
#

Good luck

twin juniper
#

Much appreciated.

twin juniper
#

So yeah, it's very likely to be the GC.

#

Just talked with Jitspoe.

#

Well, a combination of using a less powerful PC and UE4 that uses a GC.

crisp spruce
#

Hi I have been struggling with multiplayer and need some advice.

Here is what i need to achieve & how im trying to solve it.

1-. Create a game with 4 players and a Dedicated Server
2-. The first player should have a flag (it can be a sphere, a text, particles or any object that other player should see to recognize who has the flag)
3-. A player can steal a flag shooting the one who has it.
4-. For each second, the player with the flag gain points.

What i have done

1-. I have already set the game to 4 players and checkmarked the dedicated Server : Done
2-. Now i want to set the flag for the first player, I have been told that each player connects 1 after another even if it appears to load all at the same time. To test that, I am running an event that execs on the Server and Multicast to Clients, so i can see for ever player that joins, the Local Variable PlayerCounter gets updated, adding 1 to the counter for each player, but it isn't happening like that, and instead, it always starts from 0 and results in 1.

twin vault
#

what is that blueprint

crisp spruce
#

The ThirdPersonExampleMap

#

the Level Blueprint

twin vault
#

BeginPlay on a map will only execute once for each player, it will never go past 1

#

gamemode's OnPostLogin will execute on server each time someone connects

#

my wording was shit

crisp spruce
#

Doesn't Begin Play execute for each Player?, when i cut the server part, and only do the Event Begin Event, each player prints Client1: Joined, Client2: Joined etc.

#

i tough i could use that to run an event on the server for each one

twin vault
#

they execute locally, increasing the playercount on the client

#

which means nothing, as a replicated variable will be replaced next time the server decides to update it

#

right now the players are executing that code, you want the SERVER to do it

#

the SERVER should calculate the info, and give it to players

crisp spruce
#

Mmm maybe here is where Im confused, can a Replicated variable be modified on both server and client?. I though i was doing what you say, modifying the variable on the server just by setting the event to run on server and being called by the client, like when you say for example with a javascritp node js game.

I want to move top with a button, but you don't actually move your position values, you call a function on the server and the server moves your position in (x,y)

twin vault
#

it can be modified, but its meaningless cuz it gets replaced, so dont do it

crisp spruce
#

That's why I'm son confused. The code seems logic, but Im missunderstanding

twin vault
#

what you have to think is: where is that code being executed?

#

the Map's begin play will execute once in the server, once for player 1 locally, once for player 2 locally, etc.

#

meaning the server will execute it only ONE time, and that variable will never be higher than one

#

on other hand, gamemode's OnPostLogin will execute in the server many times, everytime someone joins the server

#

so that would be a good place to put your code

crisp spruce
#

Ok, i will try that, I have another doubt, why does it prints 3 times a message running on the server only once?