#multiplayer
1 messages ยท Page 569 of 1
No way...
(hopefully not)
Which version were you testing from @chrome bay ?
I think I downloaded the 4.25 plugin but was using 4.24 at the time. Had to make some small tweaks to get it to compile there
Demo project does work though, I don't think there's any interop with GAS yet though
Mostly just movement-orientated atm
I was more looking to just do generic interaction systems without having to route everything through gameplay abilities
Might be overkill in that case ๐ค
not entirely mutliplayer related: can you get navmesh path info without using the CMC?
yeah, can get a navpath from anywhere
PathFollowingComponent interops with UNavMovementComponent
yeah i'm currently trying to follow the code. i want to implement my own method on how to traverse the given path, but i dont even get any path result from FindPathtoLocationSynchronoously
and that would be pretty much all i need
@limber gyro All working now fine and new Project, when I'm using my IP instead of 127.0.0.1. Thanks for your help man C: (NULL Subsystem, Steam i have to test)
@wanton tulip i dont think i did much but you are welcome hahaha
Hey what does steam means
Steam Online Subsystem
Is there a trick to get steam to work from the editor (play standalone)? It works if I launch the game by right clicking the uproject file but not from editor
so is there a downside to doing this:
.h
UFUNCTION(Server, Reliable)
void ServerMyFunction();
.cpp
...
{ // if(something)
ServerMyFunction();
}
void Class::ServerMyFunction_Implementation()
{
// stuff here
}
vs
.h
void MyFunction();
UFUNCTION(Server, Reliable)
void ServerMyFunction();
.cpp
...
{ // if(something)
MyFunction();
}
void Class::MyFunction()
{
if(!HasAuthority())
{
ServerMyFunction();
}
else
{
// ... stuff here
}
}
void Class::ServerMyFunction_Implementation()
{
MyFunction();
}
Seems like it's redundant to do the 2nd one, no?
Actually wait, yes that is redundant
I just see the second method used in everything, so just curious why do all that extra work and functions instead of just directly calling the server function
i think that depends on dedicated vs listen server
I guess technically it's not though because when you call into the function and you are the server it doesn't call itself again
So the first one can used if you are a dedicated server, but the second one if you are peer to peer?
What I normally do is check if I have authority, if I do, I call the normal local function. If I do not, I call the server function which then calls the normal local function
Yeah, I'm just curious why go through all that loop around lol
Is calling the Server function if you are already authority (the server) not good?
If you are doing client actions, the server needs to know about them so it can do the same thing and basically synchronize your client with it
Yea it's a waste of a call
You don't need to RPC if you are already on the server
Unless you are trying to tell the client to do something from the server
i guess that pattern is there so even if a client were to call Myfunction, you'd be sure that it is actually executed through the authority
but if I was a client, and called ServerMyFunction(), wont that just go through the server anyway?
yes, ifyou were to call the server function
Yes. You are calling to the server to tell it what to do
The server knows nothing about a client action unless you tell it
this would be when you wanna make sure that this function never executes on a client to begin with
The server is your source of truth. If you fire a gun on a client you better tell the server to do the same or else no one else will know you fired your weapon besides you
Which means you basically never fired it at all
If you want to synchronize things properly, you would tell the server to fire it, and then communicate that same action back to the client OR just call the same function before calling the server one
but why do:
Fire() which checks authority, calls serverfire, then goes back to Fire to do the shoot
than just
ServerFire() directly tell the server to shoot
it also means you can make MyFunction blueprintcallable, and not clutter the node api with Server_ functions
By calling Fire() inside a server function you are telling the server WHAT to do
its a design pattern to make sure you're executing function where they're supposed to run.
Fire is an already made function that you just want to get called on the server, so you must tell the server to do it by calling an RPC aka a server function
And the server function mimics the same behavior by simply calling Fire()
It's just the way RPCs work
If you did not call fire on the client and only on the server, however, the server will see it happen and your client will not
but I just don't get why I can't just say hey ServerFire() which is a server RPC, than doing Fire(), which calls the server rpc and goes back to Fire(). Can't I just put all the Fire() logic inside ServerFire(), call ServerFire() directly, and it do the same thing
But what happens when you don't want it to fire on the server?
You're splitting out logic so that you can use it for non server implementations if necessary
then I don't call ServerFire?
i would only call Fire() if I wanted to fire on the server to begin with, no?
because it will go through and call the server rpc
What you posted before with MyFunction() basically tells you to call the server no matter what if you are the client, and only call the local implementation if you are not
If you have a Fire() function that is just a regular function with logic, then you make a Server_Fire() function that is UFUNCTION(Server) and only call it when you need to call the server then that is fine
if(!HasAuthority())
{
ServerMyFunction();
}
else
{
// ... stuff here
}
But I am saying if I am not the server, call my server, which then calls this function again, and it will then go down my else branch.
My question is, why can't I just put that else branch inside ServerMyFunction() and just call ServerMyFunction() directly, instead of it going through basically a loop with Fire();
But I just don't understand why most do that redundant call if it's redundant lol
I didn't know if there was a point to that
or just choice
You're trying to keep logic in as few places as possible. I don't do it the way you have posted. I make a function called Replicated_Fire() which says am I authority? If so call Fire(), if not call Server_Fire() and Server_Fire() simply calls Fire(). There is no redundancy there
Then I just call Replicated_Fire() if I want it to be replicated to the server
Or Fire() if not
but isn't that putting stuff in more places than just calling ServerFire() directly?
Calling Server_Fire() is calling an RPC. You don't want to call an RPC unless you need to
Server_Fire() would be marked UFUNCTION(Server)
You want to keep your RPC deciding logic on the client
So you don't have to call into a server RPC to figure it out
so if I am already the server, such as a listen server, I don't want to call the RPC on myself, just call the function
Correct
but if I do call the RPC on myself, is there any implications to that, or just an unnecessary RPC call basically
Should yes. But I wouldn't recommend it
Haha, alright. Thanks man. Sorry for the confusion
Np!
ugh. i just realized that my packaged game, when not focused, running at ~5fps, and i'm assuming that this might be where all my replication issues stem from. its the first time i see that happening in packaged versions though. does anyone happen to know the flag to disable that?
Anyone here know a best practice for telling clients about damage taken or do you just multicast the event from the server? I assume everyone lets the server decide when damage happens and replicates it to clients.
I was considering just adding a replicated property for last damage taken and saying OnRep and then react to it client side.
it depends on usecase, generally i'd just replicate the health variable
Well my health variable is replicated, but for me if I want to decide more things to happen based on the damage type or hit location etc, I would need the same amount of information that take damage has passed in
then i reckon an unreliable multicast is your way to go
Hey guys,
I've been having an issue with changing a projectiles initial speed value for a long time. Every different way I've tried has either not worked or produced laggy results for clients. Could anyone help guide me in the correct way to change the initial speed of a projectile?
Is initial speed the right way to go, or should the projectile movements velocity be changed instead? If so, should this be on a rep notify?
Context, I'm spawning an arrow that has it's initial speed changed depending on how long the player has held down the fire button
you're not changing it in flight
if your arrow is replicated, then just having a replicated FVector InitialVelocity there would make sure that InitialVelocity is good on clients before they call BeginPlay
in which case they just need to set velocity on ProjectileMovement to INitialVelocity and they are good
no additional replication required @lucid socket
deferred spawn is your friend
because then you can use same BeginPlay logic on server + clients
thanks for the reply, I'm just trying to visualize it, sorry one sec
you also want client authority for determining the initial velocity and then RPCing that to server
otherwise it will feel clunky and non-responsive
ok so, am I correct in saying there is a variable I set called Initial Velocity (FVector) in the projectile in the construction script, the value sets the projectile movements Velocity?
I currently have it like this, sorry if I'm misunderstanding
ah
not when its replicated to clients
as construction script then runs before replication
BeginPlay ruins after
thanks for clarifying, i've been misinformed for a long time about the construction script
๐
this seems to work smoothly now, just the spawn rotation to fix when spawning now, appreciate the help!
Is there any way I can make use of ReplicationCondition "Custom" from Blueprints? I've found no BP counterpart to SetCustomIsActiveOverride
I'm confused by the fact that it is available there but I can't seem to find any way to operate with it
What is the optimal way for HUDs and players to communicate in a multiplayer game? Currently, I use dispatchers from my player state that get received in my HUD class. Does it make sense to do this as opposed to having the player controller send information? I figured that if the player controller was the one setting data, I would need a new player controller for every game mode that has a different HUD with different requirements
i do both, depending on the type of information.
even gamestate for some stuff that doesn't matter if it lags behind.
if it's something that should be reliable, like it must be received, and it only needs to be sent once, then with an rpc
i often call into the HUD directly, as the delegate setup is far more verbose and HUD is large as is
i never call into widgets directly though
If the player controller calls into the HUD directly, does that mean you have a different player controller for every game mode?
Also, when you say that you do not call into widget directly, I'm assuming that means you use the HUD as a mediary?
i have two PCs but they all both have their own HUDs
no, widgets have a context
and use event based approach with what they are supposed to display
HUD just manages which widget is shown when and where
So i'll have something like HUD->ShowMissionObjectives();
i do have almost 300 differnt widgets in the prject
so while HUD doesn't manage all of them directly
its still way too verbose for HUD to just respond to event dispatchers for show/hide
That makes sense. So you don't create HUDs based upon gamemodes, but rather player controllers
If your widget requires a variable from the player state, do you pass that variable from your controller to the HUD?
i pass it a reference to the playerstate
well, not really, as it can find the PS on its own
but if its context was something thats not as easy to find as PlayerState
i'd pass it a reference to that object when the widget was instantiated
From what I understand, it's better to design your game from the ground with multiplayer in mind. That being said, if you've already got a full game, since UE4 has a lot of built in MP support, how difficult would it be to make that game multiplayer?
You need to change every BP which should be replicated, which means any change to that should be visible to other players.
Also, some of functionalities depends on user being server, so in multiplayer none or just 1 player (listen server) is a server, so you need to remake that in mind.
Every statistics/health counters etc needs to be rebuild too.
There are a lot of caveats about that and you need to rethink most of things you did. And test if everything works fine.
Alright, thanks. I have a good idea of what would need to be rebuilt, but tbh I have next to no experience with networking. I know it'd be a massive undertaking.
Multiplayer is complicated and not trivial at the beggining.
It's not that hard when you get your mind around it, but needs some effort. And a lot of headbanging when something is not working.
Yeah, I was working on a very small MP thing and it took me about an hour to realize UMG events needed to be marked as reliable
widgets are not replicated in the same fashion as actors, thats one of caveats ๐
Yeah... the tutorials I've seen are lacking. It's like "let's spend 6 hours doing UMG, skip a video, and it's working"
Yea, it's sometimes like that.
Or, on the other hand, some tutorial guys are going in opposite direction too much - they explain every basic thing too much :P. Fastforwarding them and looking for that 1 click that does all job is sometimes time-consuming.
i have yet hear about a good MP tutorial video
There is one, full written documentation-tutorial about this topic.
It's a great one, i have parts of it printed in front of me when i'm working on multiplayer. It's from 2017 but fair enough. It's even pinned to this channel.
Hey everyone! I am pretty new to creating multiplayer games and wanted to know if its worth it to use GameLift/Playfab for my multiplayer backend. I am fairly comfortable in native AWS, but wanted to know if those these services provided features yall thought were super useful/time efficent or if they were worth the price point.
GameLift is expensive.
Not sure about Playfab.
Though either solution is better than rolling your own.
However #epic-online-services might be a viable alternative now, not sure however.
We use GameLift.
Functionally its great.
trying to replicate character movement, getting client stutter and cant seem to figure out how the hell to fix it lol
nvm figured it out. ima dingus
Happens to the best of us.
i'm not sure if PaaS is always better than rolling your own
it depends on what your needs are
and at least if it's custom, it's yours and you can do whatever you want with it and you don't have to worry about API deprecations or the service just disappearing one day
gamelift seems terrible though, i've heard so many horror stories about it and that amazon's own game teams don't want to touch it with a 10ft barge pole
Ive had problems with documentation and a few bugs here and there that we discovered.
But its usable for our purposes and given that i dont have anything to compare it to i guess im biased.
though the latter is worrying, being at the mercy of... amazon
Its worked out reasonably well for us so far. Their support team has been quite helpful.
Although, we wont be using it for our next project lol
i preferred the look of playfab even though our current backend is on AWS
this line crashes "access violation error" on multiplayer, why?
GetCharacter() is controller 0 only?
Instead GetCharacter() and GetControlledPawn() how can I access my pawns CharacterMovement?
Hello, I have a question about networked projectiles and attachment/detachment. I'm making a game on which the character has a weapon attached to his hand and what I want to make is an ability on which the character throws that weapon towards the enemy.
For this, the weapon replicates (and replicates movement) and has a projectile and a rotating movement component and what I do right now is calling a "Throw" function on the weapon. This function if the caller has authority detaches the weapon and activates the rotating and projectile movement components (which are deactivated while the player has the weapon on its hands).
if (HasAuthority())
{
DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
SetActorRotation(Direction.ToOrientationQuat());
FVector Velocity = FVector::ForwardVector * Force;
ProjectileMovementComponent->SetUpdatedComponent(GetRootComponent());
ProjectileMovementComponent->SetVelocityInLocalSpace(Velocity);
ProjectileMovementComponent->Activate(true);
RotationMovementComponent->Activate(true);
}
The problem with this is that even if in single player everything looks perfectly fine and the throw has a nice trajectory and spinning effect, when in dedicated server and with "average" lag simulation option the throw animation is done on the character and the bat does some strange teleports and ends where it would have landed and the trajectory or spin can't be seen at all.
If someone can tell how to make weapon/projectile throwing look fine even with lag let me know. I guess im missing something but I dont know what.
@drowsy belfry why don't you make your server only to teleport and let your clients handle animation or rotation stuff.
Your player character does know that enemy is throwing his weapon, so animate that weapon coming towards you, and server is doing translation update.
That might be an optimization (using projectile movement on server and rotation movement on clients only) but it's not what I'm asking, the teleport would still happen if the server is the one handling the projectile movement
Is it possible to make replicated variable in base class, but only replicate that value on selected inherited classes?
Or does it take bandwith to have replicated values that never change?
Is this what dedicated server machines look like?
this is my test machine ^
So i upload my packaged game with the dedicated server here and launch it ^ ?
Need some huge tips on this
@random nymph you can do stuff like this:
if (OverheatConfig.bSupportsOverheating == false)
{
DisableReplicatedLifetimeProperty(AShooterWeapon::GetClass(), AShooterWeapon::GetClass(), "PackedOverheatData", OutLifetimeProps);
}```
But that only works for flags that you set on the class itself.
Oh, cool
So if you had an actor component that had a flag, you'd have to subclass the component, then add it to an actor
I added a UPROPERTY meta tag "EditSubclassOnly" to avoid changing it accidentally
If you want to do dynamic switching on/off of properties though, you can override PreReplication()
Okay. What about the overhead of replicated property if it never changes? When replicated actor is spawned on the client are the replicated values initialized to default value without any additional data sent over the network if the server has never changed the value?
If it never changes it's never sent
Okay that's nice
But it will still be in the changelist manager and compared
If the value is different from the serialized value, then the server will send the property
So if you change it in begin play or post init comps or something, it will be sent
Okay makes sense. Thanks
ACharacter has an implementation for PreReplication btw
Which enables/disables the root motion replication stuff
I'm pretty sure disabling it there removes it from the changelist manager / skips comparisons too
i disable replication in PreReplication
on my weapon
{
Super::PreReplication(ChangedPropertyTracker);
bool bCanReplicateAmmo = false;
if (UKaosAbilitySystemComponent* ASC = GetPawnASC())
{
bCanReplicateAmmo = !ASC->IsAbilityActive(PrimaryAbilitySpecHandle) && !ASC->IsAbilityActive(SecondaryAbilitySpecHandle);
}
DOREPLIFETIME_ACTIVE_OVERRIDE(AKaosWeapon, AmmoCount, bCanReplicateAmmo || bUpdateLocalAmmoCount);
if (bUpdateLocalAmmoCount)
{
bUpdateLocalAmmoCount = false;
}
}```
I still need help with nerworking pleaaaaase ,anyone good at it please tag me
@vagrant grail if you have a question ask it, without doing it in multiple channels
@winged badger It's the same as yesterday, I can't printstring the num of players to all clients
Is this what dedicated server machines look like?
@worthy knot Does anyone know about this?
Dedicated server machines look like what you use for your dedicated server
Usually a random Linux VPS with a bit of CPU
I have a widget component whose visibility is changed to true when a player walks close enough. The problem is that the visibility is set on all players. Is there a way for me to only change the visibility for the player that is close enough?
@bitter oriole The machine i am using is a total windows server and doesnt use a graphics card
or audio
@twin juniper handle visibility locally, no network involved
So i deploy my packaged game folder with the server .exe and launch it from there for testing right? @bitter oriole
@worthy knot Most people just rent a VPS since it's much cheaper, easier, safer and provides more performance than hosting your own machines.
For testing you can run your dedicated server from your development computer
I have tested from my own pc, but i need to test from an actual server machine that will be on 24/7
with a better CPU and ram
so tell me im not doing anything wrong here
Well, does the actual server machine has access to uninterrupted redundant power and 100MB uplink ?
Because that's a lot more important than RAM
Basically if your server hardware is not in a data center you are doing it wrong
Other than testing - testing you can do on your own development computer
im using an IBM's server
and its customizable, right now i have only taken a test machine
Okay but the important part is not what is it but where is it
its in India
Sigh
What I'm asking you is is this machine in a data center
yes/no
If it is, then you're good
if it's not, then you're not
Okay so thats how it is, ill ask the staff if it is or not
@bitter oriole it is a VPS machine of HP hosted through ESXi
im sure its in a data center
ooh aight
so about testing on the server machine , i just have to launch the server exe of my game, then make my pc join it via public IP right?
Yes
Ok and do you know anything about joining the server via steam?
thanks
I think there something I don't quite understand yet about RPC's. I have a combat game that clients can hit AI enemies. When an attack starts it will call a function in the enemy that tells him to react to that attack (They use this by starting an ability from the ability system) and play an anim montage. We start this ability by doing an RPC call to the server, since I supose there is where the ability should start. However, something weird is happening, since 9 out of 10 times this system will work nice, but every once in a while the attack will start and the hit reaction wont start. The RPC is reliable since Its a core gameplay feature. Is anything I'm missing?
This is what starts the ability
In each attack I have a reference to my target, so when is time to start the Reaction I tell him to call the function.
If you inflate the ping a lot, does it fail consistently then?
If not, it might not be a network issue
If it does, then maybe something to do with timing? Some event/function being fired off in the wrong sequence
If I play locally always works.
Maybe is something about syncronization. I'll give it a look. From your perspective the RPC is fine, right? This should be made on the server?
How does reliable vs unreliable for RPCs work?
Does unreliable mean it's actually sent over UDP, and reliable over TCP?
Or are both sent over UDP and then taken care of accordingly by the engine?
I'm not an expert on multiplayer ๐ But looks fine
As far as I know, reliable means that the game will make sure that the packages are being recieve over the network. Unreliable means that they may or may not arrive to the destination. Usually used for visual effects.
UE4 uses UDP. Reliable just means that it will queue it up and then fire it at some point
Or something like that
And yeah, unreliable ones can be dropped if the queue is too long
Okay. It's actually a question more pertaining to how UE4 is utilizing the transport layer. Was wondering if UE4's networking implementation was some sort of UDP + TCP hybrid like modern VoIP
Really? I don't browse this place often ๐
lol
thank you! ๐
get lost with time lol
That's the one thing I don't like about discord. information is ephemeral and not search indexable
yeah there is a search above tho
but yeah i understand what you mean
its not easy to find previous stuff
Yeah. Maybe discord will introduce a message history cap like Slack.
10k messages and you have to pay or something
Just realized that the problem may be in the animation. I have anim notifies that use the Send Event to Actor, but only some times this event won't arrive. Is something I need to do or this method is not good for networking?
make the notify Branching point
if its from a montage
ensure it happens before blends
(montages default to a .25 blend)
this can cause notifies to not fire.
@limber gyro Today I just change the Online Subsystem from NULL to Steam ~ Not working ๐ฃ. The Client outdates even if I try to connect to my IP instead of 127.0.0.1. I tried it with Steam on and off, but nothing helps. Do you know what I have to change when I would like to use Steam for Dedicated Server?
is the steam subsystem still supposed to work when you run standalone from the editor?
hmmmm. doesnt work for me, but it does if I launch the game by right clicking the uproject file
that is strange indeed, works fine in .24
@wanton tulip if it complains about id's then you gotta override login and prelogin
@wanton tulip what is the error in the log?
@limber gyro There aren't any Error in the Server. Nothing Red, but I can send you Client and Server Log if you want.
what does it do?
Who, Server or Client?
client
does it show the map and then goes instantly back to the previous one?
like it tried to connect but got rejected
No nothing
well there must be a something in the logs to tell you what is going on
if you are attempting to connect something must be going on
Oh, here an error on the Client:
[2020.09.16-13.58.09:257][775]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
No, that isn't the problem. I already read this. I turned on everywhere seamless ServerTravel
Maybe because in the beginning is standing:
[2020.09.16-13.58.08:855][725]LogNet: DestroyNamedNetDriver IpNetDriver_2147482045 [GameNetDriver]
[2020.09.16-13.58.08:855][725]LogExit: GameNetDriver IpNetDriver_2147482045 shut down
[2020.09.16-13.58.08:855][725]LogOnline: OSS: Creating online subsystem instance for: Steam
[2020.09.16-13.58.08:871][725]LogSteamShared: Warning: SteamAPI failed to initialize, conditions not met.
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamUtils() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamUser() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamFriends() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamRemoteStorage() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamUserStats() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamMatchmakingServers() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamApps() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamNetworking() failed!
[2020.09.16-13.58.08:871][725]LogOnline: Warning: STEAM: Steamworks: SteamMatchmaking() failed!
[2020.09.16-13.58.08:871][725]LogOnline: STEAM: [AppId: 0] Client API initialized 0
[2020.09.16-13.58.08:871][725]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2020.09.16-13.58.08:872][725]LogOnline: Warning: STEAM: Steam API failed to initialize!
[2020.09.16-13.58.08:872][725]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()```
that in PIE?
No Packaged Game
is your steam client running? ๐
I tested both. But maybe when it is on, my Server use it so my Client cannot use it
ok, so what the problem could be?
well, this looks like that whatever machine ran that code couldn't find a steam client running on it
But when I shut down the Server and start the Client this errors don't appear in the log?!
usually dewdicated servers don't run on same machine as client
but i haven't worked with them much, so i wouldn't know
Ok, I now started my Game first and then my Dedicated Server and then happends what sonicphi discribes, the client joins and get instantly kicked, because the UID not matching, because Client uses Steam and Server NULL. So I try to run my Dedicated Server on my laptop with another account.
Still having this eerie problem in multiplayer setup -
An AIController is controlling a pawn on the server which the client is never supposed to see. The pawn is not replicated.
Insanely, the unit shows up on the client anyway, but does not even run Beginplay logic, it's like a ghost. TearOff works, but only for currently connected clients. Clients who log in later will see all the ghosts of the controllers.
how's it spawned?
The server runs a non-replicated spawnactorfromclass node, then that pawn runs SpawnDefaultController on server only branch, this replicates the pawn to the client
someone at Epic is on drugs or something
how much c++ is involved?
all bp
If you Tear it off, client has to destroy it
It will initially replicate, then tear off just closes the channel down and gives client authority over the pawn
Is there a proper way to replicate setting a clients velocity? Iโve been trying to set up a system where the client asks the server to calculate itโs next velocity then the server tells the client what it is, but everything Iโve tried has failed.
I havenโt tried replicating their velocity variable directly yet, as Iโm not home right now, would that be the way to do it?
Also asking the server to do this every frame wouldnโt be an issue would it?
velocity already is replicated if you're using Replicated Movement
Well Iโm asking cause we set up a custom way of calculating velocity, but I think I may have figured out what my issue was
The way it calculates velocity is reliant on what the current inputs of the client is and I wasnโt sending that to the server when I asked it to calculate the next velocity
So those axis values were probably just staying as 0 when I asked the server to do stuff
I really wish I were home to test it lol
Is there any event that fires on client to signify a tear-off occurred and the client now has authority?
hey all, I got beacons working somewhat, but now wondering: if I run multiple instances of a server on the same machine, will the beaconports also have to be unique? if so, what is the commandline for it or is there another way?
Ok, I now started my Game first and then my Dedicated Server and then happends what sonicphi discribes, the client joins and get instantly kicked, because the UID not matching, because Client uses Steam and Server NULL. So I try to run my Dedicated Server on my laptop with another account.
Seems to work, but only, when I am hosting on my PC an joining with Laptop. I think, because my Laptop uses the Windows defender. Thanks for your help ๐ (Zlo and sonicphi)
I'm using a Character, and I want to set a custom world rotation for the Mesh component that it has by default. That worked with just an additional cube staticmesh component that I added, but for the default skeletalmesh component, it seems like it's not working
I'm guessing maybe it has something to do with the prediction code of the CharacterMovement component?
Actually, I was being half-stupid. Stupid because I hadn't set "Component Replicates" for that skeletal mesh component. But only half-stupid because it reverts to 0 rotation as soon as I move. So I guess the prediction issue is still valid.
@low helm yes in C++, in BP probably not
@zinc garden The rotation has to be the default property
CMC will rotate it back to the default rotation for network smoothing
Also you don't need to mark that component as replicated
Wouldn't do anything in that case anyway
@chrome bay Alright, thanks. Yeah this is in BP. I'm going to try and figure out a hack to get around the issue. Like add a second skeletal mesh that I'll use instead. ๐
You can just set the rotation in the details panel
It just has to be the default rotation for that class
Hmm... what do you mean? For the default mesh?
That's what I tried, but it resets it to 0
Is there a way to send an RPC to just one client without routing it through a client owned actor?
has anyone ever had a problem where you put two player starts in the level, and when you run a multiplayer game, sometimes the game only spawns 1 of them?
I think the game is sometimes trying to target the same player start to spawn the 2nd player, and failing
while sometimes it works and each player goes in a diff start
I get a LogSpawn: Warning: SpawnActor failed because of collision at the spawn location for BP_Pawn... yeah but shouldn't you try another player start?
ok I found an overridable game mode function, InitNewPlayer, where you can pass a string param that will be a tag for the player start... this should be standar dbehavior IMO though
I also had to learn that the hard way recently.
where is the multiple pistols
the pistol pointing right, there are two front sights. In the firing animation you can see one of the front sights staying still
cause that last screenshot doesn't really show multiple pistols
yeah but you shoulda moved them slightly or highlighted them ๐
and with that little bit of code, nope
yeah lol, i'll try to get a better shot
need to see more of your flow
if you are spawning them beginplay
then you are likely spawning two copies
cause you are doing a server rpc
so client and server both ask to spawn a weapon
Yeah it's begin play
BeginPlay runs on Server AND client
so use HasAuthority node
and choose a direction
tbh server should just spawn it
no need for the RPC
So use the authority and just go straight to the function?
yes
Can I get the player controller from the player state on the server?
sure..
in bps ๐
yes
how?
PlayerState owner is the PlayerController
so PlayerState->GetOwner->Cast PlayerController
oh, lol. That makes sense
is there a delegate / a function / any way for the game mode to know that the game state has spawned in clients and can multicast there?
I'm starting the match at PostLogin, when the right number of players have entered. Then, from the game mode, I'm calling a Multicast function in the game state... but it only executes on the server
if I give a delay (2 sec), it executes in both sides... however delay is not a good way to handling netcode
what are you multicasting?
the proper way is to NOT start the match till criteria is met, then you call StartMatch
a custom funciton to kick off the match, the game state will do broadcasts and handle some initial states and allow the match to begin
players all connect and wait, once gamemode says, yep all players connected, then it starts the match
yeah I'm doing this on Post Login after I've ensured all players connected, but aparently I need the game state to exist in clients as well
as in, right after Post Login it's too soon
why not just send a Client RPC to all players?
if they need to do something
you can do that at any time if the RPC is on the client.
err PlayerController
I could refactor indeed, it's just bc I put some "general state" logic in the game state, while the players handle more their own things
is there a built-in function or delegate or trigger for the game mode to know that the game state exists in the client?
no
yeah, probably I'll have to change the logic to use the PCs then... or make the client game state communicate with the server game mode...
thanks
Could someone help me figure out why this isnt replicating
I went to two players and multiple things broke and I cant figure out why
Can clients not use event dispatchers?
because you're using level blueprint
its not Owned by the client's PC
so it can't send a Server RPC
only MCs from Server are allowed for non-owned Actors
Owned = PlayerController, PlayerPawn, PlayerState, their Components + anything that had any of them set explicitly as Owner
Is player controller[0] always the local controller server-side with a listen server?
yes, you should get into a habit of not using that function though
why is that?
people mostly use it to create ridiculous cross-wiring bugs in their netcode
there are other ways to get the PC
simplest one is via c++ GatGameInstance()->GetFirstLocalPlayerController()
from Pawn its GetController(), from PS its GetOwner cast to PC...
from HUD its GetOwningPlayerController... etc
Why is it that when I possess on the client the server also possesses?
if that happens to you
you used GetPlayerController[0] hooked into a Server RPC
@lucid vault my point just made for me
haha
@radiant jolt whatever is hooked into a Server Event, executes on Server - meaning GetPlayerController[0] is evaluated on Server, and it doesn't return the same thing as when its evaluated on Client
im in bp tho
ok
its the same as for non-networked events
click the red node, goto details panel on the right, Add Input
http://cedric-neukirchen.net/2017/02/14/multiplayer-network-compendium/ read that a couple of times
so basically I want to get only the client PC
wtf I cant move now after the possesion on client or server
@winged badger I still dont understand how to fix my problem
oh nvm i got it
ty so much!
so in a function if I calling GetPlayerCharacter(0); I should always replicate it to client if I want to get clients character?
because ue4 crashes when I call it on dedicated mode
Would anyone know why a connection would timeout when connecting to a server?
NetworkFailure: ConnectionTimeout, Error: 'UNetConnection::Tick: Connection TIMED OUT.
port is the default port 15000
default port is 7777
yeah well,if it's not connecting, there's only 3 reasons for why you'd fail to connect: 1) port isn't actually open (from router pointing to the server) 2) there is a firewall in the way, or 3) the address is wrong.
there may be a fourth, but i can't think of it at the moment.
i guess #4, could be that you're trying to connect on the port, that the server is not actually listening on.
I have my ports forwarded to 20150 and 7777
and the firewall one is interesting? I am slow in the head do you mean my own firewall or do servers have firewalls?
anything can have a firewall, it depends on where your server is.
the address being wrong is plausible. but the address of my server when printed on the server logs returns my IP address which makes sense.
ah right #5; the server is running locally on the same machine, and you're trying to connect to an external ip address.
locally on same machine / or on same network
yeah.
some routers can intelligently forward that
so they redirect the public ip to lan ip
it's easier if you have a domain name you can use, because then in windows for example, you can modify the host file, and redirect the name to resolve to a lan ip
Okay thanks.
@twin juniper are you trying to connect to a dedicated server machine?
and yes i get the same timed out connection too
if you're locally on the same network, and trying to connect to a public ip, ie: your actual internet address, this will fail.
unless you have an uber intelligent router, that magically can redirect public ip, that every machine on the network shares, to redirect to a lan ip
@gleaming niche So i have a windows server machine ready, and i copied and pasted my packaged project into it through remote desktop, i launched the server .exe shortcut log , and now i try to join the server machine by putting both the public and local IP with port 7777 but it wouldnt connect, Then i accessed the server machine through direct VPN, i then launched the server exe of the game through that, then put the VPN ADDRESS into the join domain info of the game , it joins, now i dont know if this is the correct thing happening, cause all the steam games join their servers via public IP i believe
my firewall is disabled btw
if you're using steam, you should be using sessions. then it will connect via steamid, and deal with the NAT traversal through the steam sockets, and then you don't have this problem.
@worthy knot have you resolved your issue?
with the exception, of not being able to host a dedicated server on the SAME pc as a client, as usual.
@twin juniper No regarding the timeout no, i need to look into that, but as of now i cannot join the server hosted game via IP
shitty. that's where im at.
Do you have your game folder inside the server machine ?
Yeah.
ok and you ran the server .exe shortcut ?
oh
i think this could be some port forwarding problem
do server machines have use different port?
did you disable the firewall on the windows server machine?
or add exceptions, so it can open ports?
i did it right now and i will test
it's been a while, but from what I can remember, windows server doesn't do the popup like normal windows does, so if you didn't explicitly modify the firewall, you'll get no indication that it needs to be
Do i need to put some other port number other than :7777?
im using the default UE4 one
I am using steam
then no, only 7777 by default
steam is different
steam needs 27015 for the query port (to show up in session lists)
and then 7777 base port for actually connecting
you can of course change all of it on command line.
๐ค
with steam it's super easy with sessions
cuz you just query, and join
and it will use the steam ports
and doesn't matter if server is on same network, cuz it can do nat traversal.
(as ong as it's not same pc)
since steam itself is running, it will connect via lan automatically
No port setup is needed with Steam AFAIK
Ah, alright.
dedicated needs the ports open for whatever range you happen to be running, if you're going to run more than one DS on one machine / vm
Ok so i disabled firewall and joined via LOCAL IP , joined successfully
now heres whats confusing for me, Is Local IP or Public IP required to join dedicated servers?
depends on where the server is lol.
if it's on your network, you need to connect with lan ip.
if it's a different public ip, you connect with public ip.
its not on my network, its a VPS
and then it depends on if they are forwarding ports for you.
steam just makes it all easy lol
"easy"
haha
if you use the sesions properly, it takes 10 minutes, i dunno what your problem is beefy, beecaue i don't know how you implemented anything.
or how you're trying to connect.
or how you're defining this different port of 10000
so this means i gotta see what port the server machine is using? then use that port with its public IP?
for steam dedicated severs, it's as simple as
yourbinary.exe -port=7777 -queryport=27015 for first server
yourbinary -port=7778 -queryport=27016 for second server on same machine, etc.
and then you just find sessions in the client
and join session
and just make sure all the ports are open in the router.
for the server itself.
in mine and servers?
and it will work over lan and internet
because steam will do the resolving for you.
I have yet to integrate steam sessions in my game and set the IP address of the server on steam, i will look into that asap, but before that i must test and confirm it the basic way of joining via public ip
your issue is going to be because of ports not being forwarded to the machine, via public ip. if you can now connect to the thing over your VPN, then you can just proceed, and do the steam sessions and you should be fine.
you sure steam will recognize all the ports and join via public IP without an issue? cause i havent ever looked into this stuff before
ah, you're using beacons, instead of just sessions.
Yep
and your server is on the same network
so you're trying to connect via public ip
which won't work.
Well i've tried from a dedicated machine and that gave the same connect timeout error
and was it forwarding the ports, on that dedicated machine? lol
How would i know that? lol
well there ya go.
if you don't even know that, then i'm willing to bet that's the reason.
forget beacons and just use sessions, and your life will be happy.
lmao.
Obviously. We had it working before i included beacons.
and then i tried doing initclient
and its failing.
@twin juniper you are using steam sessions ?
@gleaming niche Tell me if i should proceed with a steam integration tutorial , are there any specific ports that i need to provide?
I just want the server IP to be up on the steam server list and when i search sessions, it should show the active server IP and i should be able to join it without a hassle ๐
if you guys can help please look at there
https://answers.unrealengine.com/questions/984536/ue4-crashes-when-editor-play-as-client.html
I suggest to not use GetPlayerCharacter if you know your character ๐ use GetPawn() on a controller, and cast it to your character class, way less error prone.
and check you actually have a pawn of course
Do i need my game uploaded on steam to get an app id for testing?
you need an app before you can upload.
an app? like my packaged project?
no.
a steam app + appid.
you need that before you CAN upload.
since depot is tied to the appid / steam application
by a steam app you mean the steam desktop application or some app inside steam like another game?
are you able to log into partner.steamgames.com?
and you have an app, on the site?
with an appid?
if so, then you can upload.
yeah i am logged in
not sure what you mean by "app" application or a game
gotta hit this?
yup.
Okay i got the sdk
So what am i supposed to do with this now? does it give an app id in it?
You need to login to the Steam backend, sign up as a partner and create an App. It's not free though.
sorry i didn't pay attention to your red line
i mean i would think it's obvious, if your intent is developing a game.
Oh i need to sign up all the tax info and stuff just for the app id
$100 to create a new app, this can be used as my first video game title right, because thats the fee to publish every new title
yep
@gleaming niche Just a recap to the port openings, I need to add 7777 in one of these?
Yeah under forwarding.
wow huawei sucks.
why? is something missing?
the ability to actually define a port
and not just pick from a list.
maybe you need to enable "advanced" mode or something in the router.
ill check if there is a setting
hmm no advanced setting
what router are you using?
i have a few different ones. asus, cisco, etc.
and they allow to define a port?
yup.
Lucky
i dont think the server machine needs port forwarding, cause i tried accessing the router homepage it wont load up ( well its a server machine so yea )
just my end that needs it
what is the best way to setup vr replication (so that users can see others) [tracked controller, teleport location, etc]?
@verbal gust if you want a quick start to it, the VR Expansion Plugin by Mordentral has pretty much all the networking already figured out for you
thats annoying, just spent a week pondering over things i didnt need too, ty for pointer
imo, that plugin is the best for VR stuff.
will have a look cheers
Can anyone tell me why get mouse position returns 0,0 every other tick on client in multiplayer?
its fine on server
Turns out get mouse position was returning false every other tick on client. can branch around it, but wondering why that would happen
are you running multi-PIE? if so, each PIE window is going to be ticking independently (obviously) and your mouse can only be over one window at once, so the others are going to fail to read mouse position that tick...
is using the DrawDebug___() functions serverside going to network the debugging call to the clients so I can see the serverside debug information?
for example DrawDebugSphere() etc?
no
that is how i have to do it
should have come ready with the engine
well you can use Gameplay Debugger
what's that?
ah right, thanks, will do
though that custom GD stuff
is old
i did have a tutorial on my blog (but i lost it) to create a new category
but its fairly simple
{
public:
FMyCustomDebugger();
static TSharedRef<FGameplayDebuggerCategory> MakeInstance();
virtual void CollectData(APlayerController* OwnerPC, AActor* DebugActor) override;
};```
FMyCustomDebugger::FMyCustomDebugger()
{
bShowOnlyWithDebugActor = false;
}
TSharedRef<FGameplayDebuggerCategory> FMyCustomDebugger::MakeInstance()
{
return MakeShareable(new FMyCustomDebugger());
}
void FMyCustomDebugger::CollectData(APlayerController* OwnerPC, AActor* DebugActor)
{
AMyCustomPawn* MyPawn = Cast<AMyCustomPawn>(DebugActor);
if (MyPawn)
{
MyPawn->DescribeSelfToGameplayDebugger(this);
}
}```
that is the basics ๐
then in GameInstance Init just do IGameplayDebugger& GameplayDebuggerModule = IGameplayDebugger::Get(); GameplayDebuggerModule.RegisterCategory("MyCustomDebugger", IGameplayDebugger::FOnGetCategory::CreateStatic(&FMyCustomDebugger::MakeInstance), EGameplayDebuggerCategoryState::EnabledInGame, 6); GameplayDebuggerModule.NotifyCategoriesChanged(); and voila ๐
oh neat
then your custom pawn can show anything to the Gameplay Debugger
good stuff! this will come handy for my lag compensation scripts
@fleet raven was in standalone
What's the cleanest way to replicate num players
Is there a better solution than creating a duplicate replicated variable?
What's a good way for widgets / BPs to subscribe to changes in the playerarray length? I need some function that runs client-side when the playerarray changes, so I can use an interface to let everyone know
With replicated variables in the game state, I use onRep which in turn get's every actor/widget and calls an interface function to let them know of changes to that variable
overriding Add/RemovePlayer in GameState and adding a delegate broadcast to it
is the cleanest way, c++ only
Is there any benefit to using a delegate over an interface?
I plan on moving my code over to C++. I've just been prototyping quickly in BPs
delegates are portable, anything can subscribe to it
interfaces considerably less so, and you somehow need your gamecode to be referencing UI widgets which is also not great
and by "which is also not great" he means you'll regret it ๐
yeah ๐
Nothing less fun than trying to redesign a UI that has spiderweb code all over your project ๐ฆ
Hey Jambax, i replied your reply on answers, can you check it out if you are avaiable?
nvm i misread it
solved now
Is it bad practice for the player controller to conditionally render widgets depending upon the game mode? Originally I had multiple player controllers for each gamemode, but the player controllers are mostly the same apart from widget rendering.
yes, you have HUDs pretty much designed to do that
I was thinking about using the HUD class, but everyone kept saying it was outdated
I guess I could use a widget class called HUD
So, you would add a generic HUD class that is responsible for looking at the gamemode? Or you conditionally add HUDs based upon the gamemode in the PC?
yeah treat the HUD as a convenient manager for widgets
Should the HUD conditionally render based upon the game mode, or do you typically have separate HUDs for each gamemode?
different HUD for each gamemode, since the gamemode defines what HUD class is used anyway
But, I suspect most of the gamemodes still share a lot of common elements
I see, that makes sense. So, it probably makes sense for the HUD class to be the one that interacts with state, and it can pass the state variables down to it's widgets
Well not necessarily, widgets can grab info from the game too
But the HUD is a convenient place to store all your widgets and instantiate/manage them, since it's closely linked up with the player controller
But there's no need to route information through the HUD into widgets, if widgets can just grab the info themselves
E.g. our scoreboard might be stored in the HUD, but it updates itself
I guess I'm just coming at it from a React web dev perspective, where the display elements only get passed data and never directly read from the state
For instance, if a scoreboard widget wants to be re used for different game modes, it can't really get the game state directly
If you have a common gamestate it can, most scoreboards will likely be showing the same thing
E.g, a list of players, possibly sorted into teams, etc.
the advantage of widgets manging their own internal elements and what they display is that you can put them wherever you want and they "just work" without any dependencies on some other class
If your widgets are totally dependent on the HUD to function, then it becomes a pain when it comes to redesigning stuff, or if you want to reuse a widget elsewhere etc.
I didn't think about having a super class for the hud. That makes more sense now
Sorta depends really. I don't have any webdev experience tbh, I just go with what works for general game level stuff in UI too
I just tend to keep UI as separate as possible from the game-code. HUD/Game might control what is visible and when, but widgets control their own appearance and grab whatever info from the game they want to display. Avoids a lot of nasty tangling of code.
I have been watching this video.https://youtu.be/QuuRUzZcmGE
So I m very much interested how is this even possible to do even though fortnite has AntiCheat.
HACKERS STILL EXIST IN FORTNITE!! And your favorite Fortnite streamers are still getting trolled by them!
โ๏ธ Submit Your Clips - Get Featured!
https://fortnitelegion.com/
โฌ๏ธ Creators Featured in this Video โฌ๏ธ
(Please support our content creators! ๐)
โค๏ธ Chap - https://www.tw...
If I know how to hack then I can code to prevent this.
But I couldn't think of anyway to hack
And most of the hacks are from current season
Someone wants to make some hacks ๐
The hacker were able to bypass collision, twist the physics
Some of the hackers were like Barry Allen- The Flash
anti cheat is not infallible
Be amazed what people come up with
the vast majority of what EAC does is pattern matching
it will upload the signatures of everything people inject
if any of those are later verified to be a cheat -> all of them banned
This was one of my personal favourites we had to deal with at one point https://www.youtube.com/watch?v=2degQm1dZP0
This is ridiculous
MP is just a barrel of fun
Do you believe these hackers do have good knowledge of Unreal engine??
better than all of us here
Ohh
Problem with UE being "open" source, is it gives people a lot of shortcuts too...
yeah
Hmm, so it's fair to assume whatever game I m making now won't be immune to hack
you can garauntee it
unless you are exclusive to stadia
then people can still use neural network aimbots on the video stream...
Yes right
some dumb stuff like you see in that video you can protect against, we missed some pretty basic things at launch
All these hacks are from current season of fn
ah I meant the one I linked.. but yeah no idea with FN
I mean you would assume Epic has done everything they can at the game level to prevent obvious exploits, but you never know
The teleporting one was our own fault. the hit-reg verification was just a dot product.
So hacker could teleport a pawn to their location on the client end, shoot them, then send a hit to the server and it'd would be like "you're looking the right way that's fine"
So obvious when you look at it now
funny really
that particular cheat is fairly common
Ok understand
yeah. really easy to protect against, but so common. Doesn't help that a lot of shooters are using the shootergame template as a starting point which has a less-than-ideal implementation
that cheat is only common because doing hit detection so badly is common
it is ridiculously simple, just teleport the target infront of a gun just as it fires
overwatch is the only one that did it right
the fast sprint was because we put out a dev build with all our console commands exposed. ๐
GG WP
it's too hard to do it like them
Didn't they do a talk about their anti-cheat approaches? Like doing crazy memory stuff and whatnot
they do full server side hit detection and since they have fixed ticks and deterministic logic they can actually do latency compensation perfectly
lmao @chrome bay that video is golden
Ahhh right, yeh determinism helps a lot I guess
@chrome bay I get the problem statement of your hack, so how did you prevented it. I still didn't understand
Solution was to simulate the bullets on the server too.
I'm working with a fixed tick and deterministic logic, Im funnily enough just now setting up a hit detection script
Ok ok
even a common sense check on _Validate would prevent most of it
yeah
Right
like, is the Target hit location anywhere around where Server thinks the Target is?
We do fancier stuff now, but looking back it's comical how easy we made it for people
So obvious when you look at it
no, they are game specific
Ok
assuming that's a custom system
it is yes
epic should finish their new network prediction plugin 
it has proper fixed tick systems
what are its features?
4.29-4.40, its just around the corner
fixed-tick chaos and everything
well chaos is the least interesting part
yeah true
so whats the most interesting part?
it gives you a proper framework for predicted, fixed tick simulations
..unless your doing a lot of physics stuff, in which case very big news ofc
handling multiple objects and everything
And they are integrating it with GAS too.
oh man
what am i doing with my life spending months of work getting my shit to work
they are also making properly working physics prediction based on that and chaos
when that plugin is around the corner, and can solve all my problems
you can see it in the new fortnite season, vehicles are using it
link?
don't have one
ye
@fleet raven you mean fn using prediction plugin already??
yes
what do you think why this exists
they are making it for fortnite
the predicted physics vehicles is already live
Yes they told it's for fortnite, but I didn't expect to go in production soon
yeah the boilerplate in that video is big egg
like how does one even go about making a generic prediction system
but that's because the chaos API isn't quite there yet
he said it won't be like that
so
am I wasting my time trying to do this myself (well not exactly this, but my own private case of it, so less generic) for a game I plan to work on for the next 3 or 4 years?
The idea eventually IIRC, is to just determine what input and outdata there is, and the simulation itself
Without having to worry about how the netcode works
So unlike the horrific approach CMC takes where netcode is heavily interlinked with the simulation
And it's a pain to change anything
even when it starts working, you'll have to be intimately familiar with netcode for anything but the 2-3 basic scenarios
its like that every time with unreal
is there a place I can read more about this prediction plugin btw?
if you don't have a deadline then yes you are wasting your time
smfh
CMC emits a lot of bytes and eats up alot of network bandwidth
hmm
so as to physics prediction
whats actually preventing us from using substepping and our own custom rewind/rollback solution for prediction?
Non deterministic physics
@fleet raven Will the new prediction system be that much better?
physics can be deterministic if we give it a fixed deltatime value though
yes
it will be good
they're also making a new character movement based on it from scratch and throwing the old mess away
so basically it comes down to our inability to manually call Engine->TickPhysics(Time)?
I've always wanted to enable players to push around physics actors. But it breaks with more than 50 ping, especially when multiple players are pushing on the same object
Is this new net code coming in UE5?
that scenario will probably always break
yeah, I wasted a ridiculous amount of time trying to get it to work
what were your approaches?
I disabled replicate movement and tried to apply impulse nudges to keep the physics synced up, but it never ended up working good enough
The best theoretical solution that I ended up deciding on was to locally simulate the physics actor on the nearest player, and to use replicate movement when more than 1 player is near that physics actor
I haven't implemented that yet though
With the first solution, I used a fixed timestamp and send along previous transforms of the actor, that way corrective nudges could be made
Didn't work out too well ๐
this scenario will work fine with the new physics prediction system
chaos can do selective re-sim
fortnite has no issues with multiple predicted player controlled vehicles colliding
how tho? if the local player is still some ticks ahead of simulated proxies?
@unkempt tiger the local client is predicting other players around it by simulating ahead with their last known input.
most likely
hey guys is https://docs.unrealengine.com/en-US/Gameplay/Networking/QuickStart/index.html outdated?
Create a simple multiplayer game in C++.
followed it exactly and got bulk errors even after using code samples
this puts the simulated proxies in the same "time frame" so it can properly simulate collisions
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "IDamageInterface.h" ForsakenAndForgotten C:\Users\Ty\Documents\Unreal Projects\ForsakenAndForgotten\Source\ForsakenAndForgotten\ForsakenAndForgottenCharacter.h 7
and a bunch of others
please don't randomly DM people
how do I set variables to replicate?
in code or BP?
Code
UPROPERTY(Replicated) above the property and then override virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override; to include the property, don't forget to call the Super
#include "Net/UnrealNetwork.h"
ty
wait now when I try to use something that replicated i get an error saying attempted to access missing property?
nvm its a bug reloading editor fixed it
ty
@unkempt tiger the local client is predicting other players around it by simulating ahead with their last known input.
@signal lance Yeah, tho I still don't see how prediction can work in that scenario, since its fundamentally different than other scenarios (each client can affect every other client when everyone is pushing the same prop, the net latencies alone just make it seem impossible without solving the case manually with specialized netcode, I may be wrong though)
Hey, I have a hard time figuring out how to structure my BPs to get something to work. What I want to do is:
Player connects, becomes a spectatorpawn and gets a widget where they can enter their name. When submitted, that name is saved in their player state so that others can see it in the scoreboard. - So far, okay.
Then I want to spawn the character and have the new player possess it. - This is where I'm stuck
I can't talk to the gamemode directly from the widget, because the widget is clientside and the gamemode only exists on the server.
If I fire a serverside event on the playerstate, it's gonna happen for all players, so it will spawn a character for every player currently connected instead of just the player who submitted their name.
Fixed it ๐
@unkempt tiger https://youtu.be/ueEmiDM94IE?t=2442
In this 2018 GDC talk, Psyonix's Jared Cone takes viewers through an inside look at the specific game design decisions and implementation details that made the networked physics of Rocket League so successful.
correct me if Im wrong (I havent played rocket league myself so I can't tell for sure, although I did see videos): there are two differences between rocket league and what @lucid vault described though, (which is a scenario where several players are actively pushing against the same prop). the first is that in most cases, rocket league's car-to-ball interactions are single events rather than a continuous dynamic system (I may be mistaken here, so please correct me) and this can make accounting for in the net code easier, and the second more important part is that usually, not more than one car is actively pushing the ball at a time, right?
im thinking out loud here more than anything else
so the pushing car has all the data it needs to know where the ball is going next, upon impact
Oh, there we go
In this 2018 GDC talk, Psyonix's Jared Cone takes viewers through an inside look at the specific game design decisions and implementation details that made the networked physics of Rocket League so successful.
He explains that this doesnt work very well with other cars
The ball also seems much more predictable
Re: network prediction, has anyone here used it for anything outside of the examples?
I was mostly digging through the mock simulation examples out of curiosity, since trying to implement anything with it in my project would probably not be worth it
are you talking about the current prediction solution ue4 provides atm?
Nah, the new Network Prediction plugin
Some people have been using it here though it's still experimental
I saw someone mention that FN is using the plugin for their vehicle sims though
Oh neat!
I guess I was wondering how experimental it is, though according to the update notes it seems like the API is mostly set for now and most core features are done
That's probably true
I'd definitely be interested to see if they provide some more fully-featured examples/documentation with the full release or whenever they merge CMC functionality into the plugin (whatever year that ends up being ๐ )
Provided they actually do that
You're thinking they won't change the CMC?
Yeah
It's an immensely complex feature that you can't really change much since like 90% of UE4 projects use it
Probably including Fortnite itself
Definitely including every shooter under the sun
Yeah, that would definitely be a big change. I know they stated a desire to replace CMC (I think that might even be one of the main goals) with it at some point, but I suppose we'll have to wait and see if they actually do
I think a generalized Pawn movement with network physics would be incredibly more valuable tbh
Yeah, I can see that
I didn't actually realize they were working on generic networked physics
Chaos is very much meant for network
Right now you just can't have server-authoritative vehicles in UE4
Are the networked vehicles coming in 4.26? Or is that just single-player vehicles?
(I saw Chaos vehicles listed on their Trello for the 4.26 release)
they seem to be tested well in Fortnite
so im hoping they release something
also i spoke to a few people and got told the CMC is not going to be removed/changed, but a more generic framework will be useable including a new client movement system. Hopefully this is more encapsulated, and not needing to be hardcoded to use the PlayerController/ACharacter to do everything
So just something new alongside of the CMC, but keeping the old one for legacy purposes?
I'm having an issue with the Steam Subsystem where once 2 people are in a session, the session can no longer be found. On the NULL subsystem I can have any number of people join, no issue. I've got my NumOfPublicConnections set to a good number.
The issue also arises if someone joins, leaves, then tries to rejoin. It's like the session can't be found after the first connection.
by CMC you mean character movement component right?
Yeah
I would hope that whatever solution they end up coming up with would be easily usable in place of/with the existing character classes so that you don't have to incorporate a Pawn instead or rebuild everything to get your characters working with the new stuff.
Would be nice if it had an easy way to replace the CMC if you so wish
I for one, am super amped about Chaos and properly simulated net physics because my game is supposed to have a ton of destruction and physics in it.
'GetDefaultPawnClassForController': illegal qualified name in member declaration
Why is this ๐ค
I found my problem:
LogOnlineSession: STEAM: Updating lobby joinability to false. Any idea where the steam interface would be doing this?
I found this:
// Auto update joinability based on lobby population
bool bLobbyJoinable = Session.SessionSettings.bAllowJoinInProgress && (LobbyMemberCount < MaxLobbyMembers);
UE_LOG_ONLINE_SESSION(Log, TEXT("Updating lobby joinability to %s."), bLobbyJoinable ? TEXT("true") : TEXT("false"));```
But I'm curious why that bool would become false? Obviously it thinks I'm hitting the MaxLobbyMembers. But when I create the session I'm setting my NumPublicConnections to a decent amount.
Hello guys. I have a replicated actor that i need to move on a dynamic patterns that changes over time.
The actor is not a pawn (nor character).
So i resorted to overuse the SetActorPosition (and some VInterpT and RInterpTo) but the replication is super weird, jumps back and forth all the time.
Is there a better way?
There's the movement component and InterpTo components you can use
Haven't used them myself
Usually if you have jumping that means the client position does not match the server position
I for one, am super amped about Chaos and properly simulated net physics because my game is supposed to have a ton of destruction and physics in it.
@steel vault What are your planned alternatives for Chaos?
or rephrased
assuming chaos net physics isnt a thing, how do you plan on networking your physics?
I have purposely held off on creating destructible actors and replicating the movement of a lot of actors on screen for this very reason because I was hoping to have a plug and play solution like chaos. That being said, I currently have a handful of movable actors on screen that when I impulse follow pretty closely to what happens on the server so I would probably implement a very generic/basic interp of the location and rotation client side on a slower frequency to eventually match what the server sees. Albeit, not the greatest solution. Or I did read something about lock stepping that might work better.
would you use the client's frame time when calculating it's velocity on the server?
whose velocity?
character you're controlling
character velocity should be independent of frame time
I believe the CMC on the server provides that value for you
it should be frame-time-integrated when simticking though
I'm not sure what frame-time-integrated means or simticking but I'll look into it
its just the way we originally designed the movement was framerate dependent
and I'm really not sure how to translate that to a server
why do you want to calculate the character's serverside velocity on the client?
calculate it based off of what?
It does not look like Chaos destruction has any networking in it.
when the player gives it an input it makes an acceleration vector that's used to calculate the characters next velocity, like how they do it in source and quake. So, our movement calculates this every frame and it was frame rate dependent to keep it consistent, but now I have to get this to work with networking and I'm not sure how the server should be handling this
Thanks guys, i've avoided the interpto movement because i need to reset the target each frame.
i have the feeling the jumping is due to that. by changing the target each frame, the interp steps on its previous interp. or maybe is the clients prediction.
Server shouldn't have to do any prediction. That should all be handled client-side.
Sure, but I'm afraid of doing this client side because wouldn't that mean the client has to send the server what it thinks its next velocity should be, giving way to cheating?
@vagrant saddle "and it was frame rate dependent to keep it consistent" makes no sense, frame rate dependent code means keeping things inconsistent
@prisma crescent yup i'm talking about client prediction. the movement on the server is fluid, but on the client its like jumping back and forward quickly
but anyways, it seems like your problem is your application of velocity += acceleration and position += velocity is not properly time integrated @vagrant saddle
those should always be integrated
What do you mean by integrated here?
it'll explain things better than I could
but in a nutshell - you integrate your motion so that your logic is framerate independent - the better the integration method, the more independent it is
if you're doing what source did, then you should fix your time steps
I'll read up on it, but I wish I could explain why I made it frame rate dependent lol
you probably made it frame rate dependent because its the easiest way to go about things when prototyping shit
you just dont have to worry about integration and all that stuff
unless you had another reason
