#multiplayer
1 messages · Page 443 of 1
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?
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.
@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
🤔 Was that meant for kaos?
i saw you were talking prediction and Kaos pinged me during the conversation
Oh we were talking about gas + lag compensation in fortnite
yeah, that is one of GAS header files
They have out of the box rollback and resim?
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
Huh I thought the gameplay prediction stuff was exclusively for rollback/prediction of just gameplay abilities
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
Yep but that still doesn't cover hitbox rollback for lag compensation
last version i read it on was 4.18 and it was still unfinished then
@winged badger @sharp pagoda Do you guys know if GAS has any pooling out of the box for spawned ability actors?
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
you should poke Kaos, he spent quite abit of time with GAS
Oh didn't notice there was one, haha
can anyone help with advanced session plugin? im having some issue with id while connecting to dedicated server
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?
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
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
Hah
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
Think about it - the InputAction is always local
how would a server know you pressed a button as a client unless you RPC it?
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?
nevermind
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
i did it by making a interface
or player input is replicated and it syncs up
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
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
What exactly does "Component Replicates" do on a collision component with physics?
mostly nothing @dark edge if its an engine component and default subobject
which is what most of those tend to be
Any way to set simulate physics without detaching welded bodies?
This hacky shit is driving me nuts
Hey guys, it there anyone i can have a chat abt networking (dedicated, photon/gamesparks/...). I'm just overwhelmed by the solutions.
What are you trying to do?
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?
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.
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 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.
@vapid egret In addition to posting in #cpp, look at your Output log. There's usually better information there to help you debug.
@fossil spoke thank you again. I suspected something like that.
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)
@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
If you can use ACharacter then take a look at my wing suit tutorial for a starting point, the link is on the description https://www.youtube.com/watch?v=wIXDQx0GqC8
Created for the unreal wiki tutorial https://wiki.unrealengine.com/Character_Wing_Suit_Controller Github Repo https://github.com/Vaei/WingSuitTutorial
I will look into this. Currently, the ship from the Template is a Pawn so I will need to update that.
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
nevermind port was block by router
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?
@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
@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.
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 🙋
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?
that is the replication type, that means if you own this item and call this event it will call it on the server
Ok
So no issue there
i think
It might help you help me if I explained what I am doing a little more
just depends on the event and what you are doing
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
that right there is your first issue
you are always getting the first player character every time you run that event
I tried to find a way to get the local player
so is this running on the character?
That is running on the event graph for the widget
there is another issue, widgets are client only and not on the server
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
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
Oh I was right?
as far as I know yep, I am not a network expert tho
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
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
Alright
So
I will set the event to multicast
And if that doesn't work I will use repnotify
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
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
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.
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
You can pretty much put that property on whatever class you want, just not GameMode or PlayerController.
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
GameState is fine, then. Or you could put it on the spikes, ball, and cube themselves.
The spikes, ball, and cube are components of the ThirdPersonCharacter
I'm not really familiar with how components handle replication, but in that case, you could at least put it on the ThirdPersonCharacter class.
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?
The color properties. Maybe three properties, BallColor, SpikeColor, CubeColor.
I mean as replicated properties.
And I have them all being set in TPC
?
I am incredibly tired I apologize for any nonsense
You probably want FLinearColor, don't you?
Then just replicate that, RepNotify, and OnColorNotify, set your local Material Instances.
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
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
@copper owl Yeah, that's good.
Well, then replicate the LinearColor property, with RepNotify, then have an OnRep_LinearColor, which sets the local material instance values.
@ripe coral no
Doesn't SpatialOS do that? I never really understood what they did.
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
Testing now @worthy perch
@meager spade thanks that makes sense
thats how bungie done Destiny
hence you get loading screens
your technically swapping servers
Didn't work @worthy perch
What part? You have to have the client send the values to the server first.
The colors didn't change for the client on either side and for the host it only changed on the host's side
Did you use RepNotify?
I have all 3 linear colors replicating with repnotify
And you implemented the OnRep functions for each?
The functions for them all look like that
It is in the ThirdPersonCharacter class
This might have something to do with it
Can you check if it's actually being called? With some Print function?
Wait, isn't that from UMG?
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
Is Ball Mat valid? I'm a bit confused why/how you're replicating material instances.
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
I am lost too
Can you make the material instance not replicated?
sure
And the clients all have that material instance referenced? Like, it's a default material on the components?
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
I'm pretty surprised that Blueprints allows you to mark a UMaterialInstance* property as replicated.
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
for that to work, it has to be called from server, and Sphere 2 reference has to be valid on every client
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
isnt updatedcomponent just the capsule?
if the mesh has absolute/worldrotation, how does updatedcomponent->setworldrotation affect it?
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
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
Gamestate holds all the playerstates and updates adds/removes players from its array automatically
So If I connect the players at the main menu screen to the dedicated server it should work on gamestate?
Gamestate only holds those players that are connected though
If you don't want them to connect and have them input a password first, you will need to have your OSS support that
appreciate the help
it all works i just was blank forgot to connect to the dedicated server on login lol
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?
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
Does NetUpdateFrequency and ForceNetUpdate() only pertain to property replication? Or does it impact actor replication as well?
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
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.
Actor Replication is only done from Server to clients.
nods Whats the best way to make something a client does appear on all connected things (server included)
Have the client RPC it to the server.
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
Perhaps you should take a look at this: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
Thanks, I'll give it a read 😃
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?
Does anyone know how UT gets away with a NetUpdateFrequency=1.f on an actor that has replicated movement?
https://github.com/EpicGames/UnrealTournament/blob/clean-master/UnrealTournament/Source/UnrealTournament/Private/UTDroppedPickup.cpp#L31
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?)
and iirc, NetUpdateFrequency just determines how frequently that actor will get checked for replication relative to the other replicated actors.
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
whether or not anything gets replicated at all is determined based on whether any replicated properties have changed.
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.
1 != 1 second @manic pine --> it's a relative value against all other replicated actors.
So with a NetUpdateFrequency of 1 it will only be sending 1 location change per second?
are you sure about that balto?
triple-checking...
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.
yeah, i see this comment too: /** How often (per second) this actor will be considered for replication, used to determine NetUpdateTime */
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.
BUT i'm still checking.
it wont be sending, it will be checking on server if CurrentLocation != OldReplicatedLocation
if that check passes, it will send
Right, but that controls when it gets sent
so it doesnt just lessen bandiwdth usage but server cpu usage
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
Replicated movement already handles smoothing right?
no
Because at 1 I'm not really seeing any issues
@manic pine sorry, i was thinking about the adaptive net update frequencies, which slightly changes the meaning of that property. so you are correct.
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?
physics enabled?
yes
PickupMesh->SetSimulatePhysics(true);
PickupMesh->SetEnableGravity(true);
bReplicates = true;
bReplicateMovement = true;
In the constructor of my pickup^
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
But it still relies on it somewhat right? So the location should be fairly accurate still between the server and client?
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
ahh okay that makes sense
Would you recommend using a movement comp instead in this case then?
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
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
ahhh, yeah that one is more lightweight
and has physics simulation
to some degree.. bounce at least
ahh okay yeah that might be the best way to go
ye sounds sensible
I'm also trying to decide whether to switch over to adaptive network update frequency
Need to break out my ForceNetUpdates 😃
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
yeah, also less to gain from doing so
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.
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
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
How do I forward commands to them?
As a Client? RPC?
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)
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
@thin stratus it's interesting I was just reading the chapter on RPCs on your pdf 😃
thx for that, it's a great reference
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
What's y'all's general philosophy regarding input, do you handle it all at the controller or on the pawn?
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)
@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.
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 😦
@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...?
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
@winged badger thx
@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.
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
oh, well then GameMode may be correct. do you basically want to know when EVERYBODY is ready?
or just a specific player?
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
/** Initialize the AHUD object for a player. Games can override this to do something different */
UFUNCTION(BlueprintNativeEvent, Category=Game)
void InitializeHUDForPlayer(APlayerController* NewPlayer);
OnRep pawn
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.
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();
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?
😮
so at that point the playerstate is ready
really?? there's an OnRep_PlayerState built into the game???
and that happens for each player state?
yes
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 ❤
np hopefully it solves your issue
oh actually I do see one more problem up front with that
can that event be hooked into from the player controller?
whoops
player states don't have access to the player controller
OH! my bad I thought you said it was on player state 😃
thank you, that works great then
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
is ATheiaCharacter your controller class? or your pawn class?
my pawn
ok
Controller also has a OnRep_PlayerState
make sure you override and call Super
else things will break
thank you for that, I would have forgotten
Anyone here know how I can get physics to run on server AND clients, with server correcting clients periodically?
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)
OnRep will be called for new and existing clients
if the property changes
so every client will have the same value
How to feel dumb..... Try to multicast something inside of PlayerController and wonder why the 2nd client never fires. Doh!
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
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?
Fun times. Trying to debug why my NetMulticast is not firing properly on the owner of the object.
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.)
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 ?
@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.
hey guys, i'm having few questions:
-
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?
-
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?
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
What is executing that teleport
@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.
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
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
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
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.
Lovely how GameSparks completely changed their pricing model
Bye GameSparks!
Any alternatives? I guess PlayFab or what it was called.
@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.
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)
wtf they made it even more expensive?
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
but it was already insanely overpriced
Does ForceNetUpdate() do anything if the actor's Net Update Frequency is set to >= the server tick rate?
That would be nice if that is the case
@thin stratus it's definitely good for epic though
Gamesparks is asking to be replaced
Epic's stuff till takes until at least end of the year though
Yeah
The time between that is kinda shit for people who want to release soon
Yep
Everything is always shifting though
There's always something on the horizon
Does this seem right to you guys? I want to set the values locally but also have them replicated everywhere BUT locally.
Yop
It's a bit rough around the edges but it works boys.
The motion of the main body and attached parts is server authoritative, but the driveline sim and wheels are locally simulated
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?
Does anyone know what the comparison for replicated properties (to see if they need to be sent out) is called in session frontend?
The stat name in the profiler
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
@winged badger thanks man, I just figured it out with SetControllerRotation, and set the Character to use its Controller's rotatoin as well
hey guys, i'm having few questions:
-
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?
-
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?
- 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.
- 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
@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?
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
currently, for local testing, i have nodejs + dedicated server
Yeah, your NodeJS MasterServer should have a Database it can communicate with
May it be MongoDB or similar
so that was my next question
And store relevant data in that
mysql or nosql (mongo)
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
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
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?
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
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
I don't know if anyone is struggling with the same problem, but here goes: https://forums.unrealengine.com/community/general-discussion/1586708-alternative-for-gamesparks
Hello there,
Yesterday GameSparks announced a new pricing plan, where they locked matchmaking behind an "Enterprise" license, which does not have a
in offline multiplayer, is there a way to do something like "press A on new controller to add player" ?
console command 'CreatePlayer' does that I believe
thank you, i'll have a look into that
and all controllers automatically have input and a player index?
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)
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
Yeah well that's still in front of me :P
You'll manage 😉 !
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
Character on listen server
Character on client
Characters on server after the client joins
Characters on client, reverting to default color.
It's driving me nuts
I don't know what MMesh is, but maybe you can't replicate that.
the replication shouldn't be there. I am replicating the color that is applied after possess
Yeah, but maybe that property is invalid for clients.
Also, does Possess() get called on clients?
@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
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
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.
FLinearColour you can
@chrome bay this is much more interesting, thx 😃
I hope it's just that, I'll give it a go. Thx a lot
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
It does not. And my CPP doesn't know about the mesh
I can use my CPP OnRep_PlayerState to call a BlueprintNativeEvent though.
Yeah exactly
Also, other player controllers won't exist on clients, so you won't be able to get the player state from them
@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 BP
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.
i need help in making multiplayer game. Server hosting, login and stuff like that
I can pay if needed
Yeah way cleaner, much more nicely done 😃
Does anyone know if there's any way to replicate a TArray<TPair>?
replace it with a proper struct
So you mean just have the Key inside of the struct? @fleet raven
key?
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?
depends on the scale
if you have 10 slots, it won't matter if the first 9 are just empty placeholders
I mean, can have "empty" objects in the array that get replaced, but..
if you have thousands, maybe
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...
.<
Hey guys, did you ever had an issue where the server cannot see a specific actor but the client can? 🤔
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
Can I send the build of my game to the players without the server together?
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
odds are, a UT game needed it at one point
there is a lot of legacy cruft from UT3 and Gears in the GameFramework
Makes sense. Seems like an awkward way to go about initializing the HUD
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
Is there a way for me to instanciate a different GameInstance type on Clients than on the server?
@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)
the player goes to different level while i'm lookin in main menu for the ip to connect to
I have two dedicated servers
first case, you do not require an IP/Post you can just ServerTravel
ok
should still be able to Travel, altho seamless won't work when switching servers
I was joining the listen server after so i could show the hosts on a widget in main menu
you can also stash the information in the GameState instead of specific playerstate
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
Why the hell would the bottom one work but not the top one?
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.
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
Is there anything I should be paying attention to in specific when spawning Actors in Multiplayers?
These lines are giving me a crash.
Access violation, even though I checked, ProjectileClass is definetely valid.
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?
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>
Still doesn't explain that SpawnActor is crashing
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
Yes, I am getting into it.
replace it with if(ProjectileClass)
@kindred sandal thank you! can you give me a brief rundown of this sheet, it's a bit overwhelming at first glance
We are cleaning it up, wait few hours then it will be simple
Yes it does
But after pricing change and Removing indie plan , Many are searching for alternatives
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?
Easiest way is BaaS
@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
This tutorial guides you through the process of setting up your Unreal game and integrating the GameSparks plugin and explains:
There are many sample projects If you search in GitHub
can someone explain me difference between
- building dedicated server from Visual Studio and engine source development_server configuration
- 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.
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
You probably have to port forward.
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
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
Are you trying to make a lobby system?
bingo
Yea, it's a hell of a lot more complicated than that. Look into beacons
I have a whole folder of bookmarks on lobby systems I can send you in a few hours if you want
I would appreciate that
I cant get the ip of the host that leaves
tried a gang of ideas not working tho
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
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
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?
seems believable, considering their were bought by amazon
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
so of course they will try to turn it into a aws (amazon web scam) product
I am immediately flooded with remorse about moving to AWS servers recently :/
What's a good alternative to AWS?
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
Well... maybe that gamedev post was fake. That's really not impossible.
Is it really that overpriced?
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
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).
I think BrainCloud is best alternative to GameSparks
but yeah.. the enterprise tax definitely exists
maybe don't use linode
their networking seems to be unreliable
it just randomly dropped my ssh connection for no reason
I am failing to understand how this is not deleting the actor for clients.
If the actor is replicated you can just destroy it on the server.
Are the actors themselves replicated?
otherwise you just have 2 parallel actors, they aren't the "same one"
unless you specifically tell them to have authority over an actor
Not sure that is true
Owning != Authority
Problem got away after I toggled Static Mesh Replicate Movement and Always Relevant.
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
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
ooooh the trello has been updated ❤
Yeah I'm really glad that they put some more work into Steam 😃
@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```
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 ?
because your net relevancy for that actor is making him not relevant
always relevant will ignore the GetRelevancy check
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 ?
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)
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
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
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
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
inside my player controller, im trying to make a function to make ai move
ignore that its not for mp
Is "self" a friendlyship?
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
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?
@urban dew you need to get a reference to an actor of type Frienflyship somehow. Try the get all actors of class node.
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
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
🤔
for some reason respawn is always set to false in the characters
You know you can uh.
You can override SpawnDefaultPawn and set that property when the player spawns, right?
A moment if you will
ok
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
Where did that "Parent" function come from
Elon Musk is into vaporwave
who knew
The spacex stream is playing some vaporwave rn
does he directly control the playlist?
idk
could be someone else
Knowing him he probably had some say in it
Fitting tho
Yeah
bravo
Elon musk has good taste
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.
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
I'll stand aside because I don't use the AdvSessions plugin
I think I know where the issue might be
Sorry my suggestion made you crash
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
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 ?
What is InitServer() doing?
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?
Honestly it could be anything. It maybe a large asset being synchronously loaded that was never needed in your previous session.
Well i can clear that out.
I completely lowered the graphics to the maximum to verify if it had anything to do with ''graphics''.
https://youtu.be/--THmHi10fQ
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.
It maybe GC running.
Without actually debugging the issue its hard to guess at what it could be.
What does GC stand for?
Garbage Collection
Yeah, that was one of my theories too.
Input Latency is very high in UE4
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
UE4 wasnt designed for ultra low input latency games.
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.
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.
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?
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?
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.
yeah, that's what I was afraid of. 😦
But it may help. I mean, if your running on a potato you should consider upgrading.
I might know someone.
jitspoe, the gameplay programmer who worked on LawBreakers. He is currently working on an indie sidescroller with Godot.
(Nathan Wulf)
If your trying to make a pro game, running it on a 60hz monitor with a gtx260 isnt going to help at all.
hahahaa
I agree.
Im making an indie FPS game, but was juggling between Unity and UE4.
If low input latency is a core requirement, then dont choose UE4
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
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
So, it could really just be the garbage collection afterall...
oh I see.
Research how to use the Session Frontend profiler
Noted.
The profiler is a really powerful tool.
I will.
Thank you for your time. I'll investigate. And I'll have a short discussion with Jitspoe.
👍
Good luck
Much appreciated.
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.
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.
what is that blueprint
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
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
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
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)
it can be modified, but its meaningless cuz it gets replaced, so dont do it
That's why I'm son confused. The code seems logic, but Im missunderstanding
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
Ok, i will try that, I have another doubt, why does it prints 3 times a message running on the server only once?
