#multiplayer
1 messages Β· Page 531 of 1
You can't. Anybody viewing that data needs to refresh it
When a player joins a server, the server updates the count and updates the "master" server which advertises it with the new data
Other players have to "refresh" their view of the master server to see those changes
You could continuously refresh if you like, but you would have to modify the engine to handle this better.
Can't i just update the Variable that holding the current player number ?
like +1 every time player joining
How can it if it doesn't know who is looking at the data?
The "server browser" doesn't ask for information from servers directly, it gets the information from the "master" server for the game.
Otherwise those servers would be constantly hammered from outside packets querying it for info
Yes its working when the players refreshing the list
Exactly
Players have to refresh the list themselves
There's no alternative
So as a "sort of" solution, you can just keep refreshing the list
We found that Steam stops showing you servers if you do it too often however
Getting a list of servers is a one-way transaction. You can ask for info, but the master server cannot tell you the info
Yes i have assigned the refreshing when player clicks on Server browser button
or refresh button
yep, and you'll get a list from the subsystem of what servers are currently available and any advertised properties.
But only the list as it currently stands
Yeah, steam master servers don't always give you the info reliably
Especially if you search too often
ok got it
I have a huge thread on UDN about issues with Steam searches, in the end we found the answer was to use the old advertising system for steam servers.
you can use https://partner.steamgames.com/doc/api/ISteamMatchmakingServers#PingServer to query single servers instead of requesting a new list from steam
But there are hard caps on how much data you can advertise that way
will refresh players etc
That only works for dedicated servers too
ok cool about servers list update i thought its because of we are using the appid of starwars and its have alot of servers
yeah but we're talking about servers and not lobbies afaik
thats why its take time or not showing sometimes
Could likely be that yeah. It's probably a good idea to get your own appID when testing online features.
If not essential
Does anyone know a guide or something for understanding the Network Profiler?
I'm comparing the profiling of a game where things went smooth, and one where it was very laggy (sending more info), and I can't see an obvious difference between the two.
Not sure what numbers are good and bad and what to look for.
Other than the huge initial spike nothing about that graph looks particularly bad
yes that what i was thinking but at least i need to finish the maps before getting own appid xD
It tells you how much data each asset class uses, outside of that that's pretty much all it's useful for
Yeah that's a player joining. Hmm, because that client warps around on the server's view when they're sending some extra floats ;/
The key is getting those numbers as low as possible
It's hard to say because its always very game specific
But in theory if someone is sending too much info, it should be possible to determine it through this graph right?
You just have to look at how much data each individual actor is sending and why, then work out ways of trimming it down
You may also need to profile the server and client independently, you'll get two different graphs.
Hmm yeah that's a good idea.
The lagging only occurs when testing through Steam (on a real build etc) now. Is there a way to provoke the same results with the settings in the editor with just the PIE windows?
Thanks, will check it out
Run PIE, then enable whatever effects you want in clumsy. It works out of the box thankfully.
has anyone implemented a system where AI takes control of pawn when a client disconects? I'm having trouble trying to do so
I couldn't use GameMode Logout because I couldn't find the pawn from the controller argument
so on the Pawn, I override OnUnPossess to send the info to the game mode to spawn a new AI which will possess the pawn
the repossession works but I think the pawn is still sending Replicated functions to the client that doesn't exist anymore, causing the game to crash
@chrome bay So I found the RPC that is sent (that is causing the intense lagging), from the client's profiling, and see that the total size is enormous compared to everything else, but the average size is same or lower. The struct that is sent in this RPC is exactly 4 floats and marked Unreliable, sent in the TickComponent of a CharacterMovement class.
Do you know what the big total size indicates?
22.7 x 2377
Yeah, it was sent 2377 times
what framerate is your game running in final build/steam vs PIE?
Even character movement doesn't send moves on ticks
It combines multiple moves into single packets and sends them at a lower rate, up to a maximum delta time between packets
yeah you're sending an RPC update every single frame, you definitely don't want that
Each float is 4 bytes, so 16 bytes per RPC
Ahaa. I think the frame rate is uncapped for the clients and the server, so it could be running 120 FPS for example.
What's the recommended approach for sending RPCs like this? A repeating function called every x seconds?
- the RPC headers
the players can join the session even when the session is full
@rain coral The recommended approach is to never send anything on tick - my advice would be to override CallServerMove() in the CMC and put the RPC there
you will at least send the RPC at the same rate as the movement RPC's then
And unless you need full precision I would also compress the floats
Ah, makes sense
but yeah otherwise, impose limits etc.
You can do simple stuff like this too:
{
SendRPC();
LastSentTime = GetWorld()->GetTimeSeconds();
}```
Yeah. I think I assumed there was something like this behind the scenes taking care of send rates for RPCs
Nah nothing. Engine doesn't do any dynamic bandwidth control
Well, glad to find the culprit, thanks!
TheJamsh
When i make session with 2 slots 4 players can join
Im trying to open 4 windows one for host and 3 searching for servers they are finding the result at same time and when im joining with 3 of them without refreshing they are all joining
you're trying to enforce max player cap on the client side??
i don't know anything about this specific stuff, but .. figure it out proper π the server handles how many people can connect, not the clients
The session Public Connection is setted to 2
but 4 players can join if they found the server at same time
but if one of them refreshed the list he will not be able to find the server
Players will still be able to attempt joining yeah
The server should kick them out if they joined a server that's full
So i must Check between the max server and current server when the player click join
no
You join anyway
Then if the server says "you joined a full session" it will kick you out
The client will also load the map too even if they get kicked. We implemented a server queue and joining via beacons to prevent that.
None of it is straightforward however
oh
You are always potentially working with out-of-date information in the Server Browser.
Yes that what can i see
You have to find ways to mitigate the problems yourself, like refreshing when trying to join for example, or refreshing continuously. There's no other way around it.
But if used Refreshing Continuously will that cause Performance or not ?
@steep cipher With this query ping, how would I get the ip address to ping?
It's not a good idea to do it too often yeah
So i will refresh each time player click
Perhaps the steam function that @steep cipher linked will make it easier though.
I.e, just query a single server instead of refreshing the whole list
Jamsh, is there anything about this server setup that would indicate someone could not find it in a query is they were using the same client doing a findsessions? https://paste.centos.org/view/afb0b8e3
I have no idea
this could be something, IDK:
SessionInfo: HostIP: INVALID SteamP2P: 76561197962486250:7777 Type: Lobby session SessionId: Lobby [0x18600000BFDCAF7]
Cannot find anything online about what that means
Hello, so i am trying to make a pickup so when a client pickup a weapon all the others can't see it any help?
Replicate on server function, have the server do the picking up, give it to the client, then multicast a destroy function or other necessary cosmetics
hoi
Does anyone here have experience in "chunking" UPROPERTY replication?
I have some massive structs I want to replicate, but running into max chunk size. Do I really have to split it into multiple UPROPERTYs, or is there some way to tell the engine not to send it atomically?
I don't even mind if OnRep is called multiple times, once for each chunk tbh
You probably don't want to be using replication for anything over a few bytes
Well I need to replicate it to clients... Are you saying I should be using reliable RPCs?
That gives me problems with late joins though
How big are we talking here ?
LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=71522, MaximumSize=65536
But I probably will have much bigger than that one eventually
@pallid stone hmm now its not destroying (i have made it NetMulticast )
And how often is that data updated ?
@tawdry pond Read this : https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html
Designating function replication across the network
Very seldomly 
@odd idol My advice would be to do a completely custom system then, using sockets, to transfer the data in bulk when connecting
"Much bigger" then 70KB isn't going to be doable every second on any network
It's going to be a lot less frequent than that. More like a couple of times per session.
But I take it then that there is no support for automatic chunking in the engine :/
Replication is built for constant, adaptative update of thousands of small properties, with a lot of logic to vary the frequency down to zero depending on distance, etc.
What you want here is a download, plain and simple
It's unfortunately not that simple, but I appreciate the advice!
No, it's not simple, but it's going to be simpler than getting replication to work with this
I'll try to see if I can figure out a path forward. I don't think a custom socket solution will work for me. I would really like to leverage the reliability of the replication stack.
I'll post if I figure something workable out π
Alright, but keep in mind it's reliable because it's a typically a 10KBps channel
hmm its still not destroying @bitter oriole
Good info, thanks! 
I'm pretty sure replicating 1MB of data through replication is simply going to delay every single other update, breaking all movement for a few seconds
Yeah, I think this will have to be a combination of things to make it work
@bitter oriole it dose not destroying ?
Why are you tagging me ?
idk
Read the link I sent you, and plan your multiplayer architecture based on that
You're not going to randomly find a working answer
Does anyone here use ragdolls upon player deaths? If so, how do you typically handle them (do you replicate the impulse when players shoot them, or have it individualized? do you have collision on them?)
@pallid stone from the server list
@bitter oriole Yes, thanks for the link. I have already read the docs though, I make it a point to do that before I ask here.
No-one said anything abut randomly finding an answer. Reading the source code and drawing conclusions is how I like to find mine.
It seems like a combination of breaking up the UPROPERTY and spreading out other replication might be the answer for me.
Thanks for the input though.
So what is your current solution, how does it behave, and hjow do you want it to ?
I don't know the answers to those questions yet. But I have gotten past my initial problem. I might ask some more questions later on if you don't mind though π
Well, the solution for now is what I mentioned above
But I probably need to do more work before it really behaves like I want it to.
Basically if you want the server to do something, just use a reliable server RPC from an owning client
Multicast is for server to clients
Yes, I am still considering solving late join by having clients ask for data.. But I also need partial updates of some of the data, so I don't think that works as a complete soution
Same for the random answer part
Hello! I am making a dice game and I have 2 types of actors, player type and dice type, the thing is that I would like the player to be able to save an array of dice actors to be able to control the play but I am unable to do so, could you help me?
If you are trying to store an array of actor types, you could try using a TArray<TSubclassOf<ADiceActor>> and replicating that
how can i do that if i am using blueprints ? D:
@bold totem make a variable of type ADiceActor (or maybe make an interface for it) and then there's a little bar next to the variable type you can use to convert it to a collection
Hi Everyone.
I'm trying to pass an array of structures to my server so it can essentially roll some dice for me and replicate the results down. The server function i on the player controller to let it have authority but sometimes the array is null. Other times it's not. Not 100% sure why. Any thoughts?
It ends up crashing in cpp in the Invoke function before it reaches the actual graph.
What do I need to replicate for animations to show on other clients?
@violet geode Best practice is to replicate whatever is triggering or driving those animations.
For mmo's is it better to have character data (inventory, health, experience) on the character bp or the player controller bp?
Is it possible to make an array of FUniqueRepl structs in BP and use the contains method? Doesn't seem to work for me - contains always returns true
Even when the values are different
How does it work to have replicated actors spawned in the level?
does the server still create them, how would running code on them locally work before the server connection is valid?
@bitter oriole what do you mean by this, "You don't exactly have access to the level before the server connection is valid" ?
I mean when you connect to a new server, you only see actors when the server gives them to you ?
But yes, they'll be created on the client first
And then they'll get the initial replication bunch
Anyone knows about the best practice for clientside prediction and resimulation when it comes to extending the CMC?
Currently I'm overriding FSavedMove_Character and FNetworkPredictionData_Client_Character, and saving and applying inputs back with the SetMoveFor, PrepMoveFor and Clear functions. All the ticking code for the characters is called at the end of PerformMovement and SimulateMovement.
It's kind of hard to tell if the resimulation is working as intended or not, but just wondering if anyone has some do's and don'ts?
that is the only way to do it
i do the same for sprint, and walk
its bad just to change the movement speed for big changes
@rain coral Hey, you've definitely nailed most of it by the sounds of it, but consider doing your movement code in the OnMovementUpdated function (just override it). Those functions you mentioned call this function anyway. https://docs.unrealengine.com/en-US/BlueprintAPI/Character/OnCharacterMovementUpdated/index.html
SabreDartStudios does some amazing tutorials. Here's a CMC one that I found super useful. https://youtu.be/Of8SGBa3WvU
On Character Movement Updated
In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.
We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.go...
only issue is debuffs/buffs that modify speed is pretty sitty.
ah Darntella's tutorial
I've added stuff to PerformMovement and Simulate Movement before, but those were very specific things that pretty significantly modified how the move would be simulated. However, the same thing can be done by modifying MaybeUpdateBasedMovement for pre-move stuff, as far as I know.
@polar wing Thanks, will check that out!
What kind of things did you put in PerformMovement/SimulateMovement instead of OnMovementUpdated?
We've modified a bunch of things, such as a how jumps are calculated (jumping lower/higher/further based on your speed and how much you crouch), and the hardest things so far to deal with is climbing, which involves using root motion to move and getting parented to a moving platform.
Is any of that a reason to not put something in OnMovementUpdated?
in that case, I don't think there's much of a reason to move out of OnMovementUpdated. When it comes to climbing or "parkour" elements, you could create a custom movement mode and switch to it via a flag you set (like the bWantsMovementSpeedChange flag).
Then, you can write your own simulation code for how it's handled in the Phys_Custom function (basically follows the same pattern as the other movement modes, like how the walking movement mode calls Phys_Walking, except you create your own logic there). However, for simplicity's sake, you could try get away with sticking to the normal movement modes and maybe doing a few logic rewrites. This gentleman has a pretty decent video on how to do the custom movement mode stuff (it's not really a tutorial, so mostly just take a look at how the code works) https://youtu.be/DoZyH86n_gs.
When it comes to working with root motion, though, I'm unfortunately not very clued up.
Higher playback speed recommended. It makes those moments of dead air where I am figuring out what the hell I wrote more palatable. Also the mumbling.
Table of Contents
2:12 Sprinting
26:14 Jetpacking
55:02 Gliding
1:26:02 Networking
This project: https://github.com/HarryPe...
I see, well it's only the networking part that is kind of 'off' regarding climbing. On the server we've got it working properly by using the flying mode. Anyway, we don't need to get too deep into what's wrong there. Sounds like I should use OnMovementUpdated for ticking my character, and keep doing what I've done otherwise.
I kind of can't see a difference when commenting out stuff in PrepMoveFor and not, but maybe I'll make a 'rewind' functionality that plays through the entire client buffer just to see if it resets the character properly.
Anyway, thanks for the info!
awesome, glad to help in any small way! I've been doing some pretty significant rewrites to things, so figuring out the best way to get them networked in the CMC has been a nightmare hahaha. I can't wait for the network prediction plugin π«.
Hah yeah, I've kind of been all over with my networking code. Have attempted custom server reconciliation and resimulation, before we learned more about CMC and that it makes sense to do do this in harmony with it π
I went absolutely mad over this stuff. I could basically rewind my entire character's state and watch the last minute be reperformed in near perfect detail like a movie, but when doing it in a for-loop in response to a server update, we encountered issues with jumping that was absolute torment.
oooof I feel you. I also attempted to make a custom replication component at one point, but realised that the CMC just does so much for you.
Aah. Yeah it's great to be able to extend it, and it's pretty customizable, but takes a lot of time to learn the proper ways to do things.
One of the main reasons why we went our own way with replication for a while was because of things like the client being able to set their own global time dilation and cheat their move speed ;D So we didn't trust it to be authoritative. Try it on your own if you want to see a hilarious exploit in the CMC ;S
CMC actually already has speed hack prevention
See bMovementTimeDiscrepancyDetection and bMovementTimeDiscrepancyResolution
Oh thanks, will check that out!
it's disabled by default because it does not work without changes
for one, it does not prevent you from going slower than the server and doing things like floating after jumping off a ledge
and on long running servers (even a single day) it will slowly drift until it thinks everyone is speedhacking all of the time
! Damn, sounds not too good.
We tried to 'validate' move distance on the server manually some time ago, and also struggled to not only limit how far you can move, but how 'short' you can move
I'm more curious why they take the client's time dilation as a truth to begin with
Hopefully they'll look at all this with the new movement stuff.
considering that has a fixed tick rate, it'll be way easier to add
yeah for sure
Hey Guys GoodDay
im trying to Swap the Controller from lobby PC to Game PC the event not firing
i've tried to open the game stand alone and tried it from editor too samething
Could I get some feedback on this layout for a simple networked equipment system?
Essentially, I'm thinking of adding a replicated property on each character to indicate what item the player has equipped, and then using a server RPC from the client to notify the server of an equipped item change
And calling server RPCs on the client for stuff like attacks, then having the server do multicast RPCs to broadcast the attack events
@analog rover Sounds very reasonable to me at least! Replicated on the equipped item so new joining players can get the update, RPC + Multicast for the attacks which likely are just one-off events
Thanks! I'm always a bit sure about what best practices for networking should be
hey guys. So a few issues with ragdolls in MP. When I add an impluse to a player, I want them to go to ragdoll mode. Once they land, I blend the ragdoll into a get up montage. However, when I simulate physics on the mesh to ragdoll, it doesn't follow the capsule anymore. What's the best way to fix this?
@grand lance not sure if this helps you, but apparently if you call SetSimulatePhysics on a component, that component gets detached from its parent: https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/UPrimitiveComponent/SetSimulatePhysics/index.html
Sets whether or not a single body should use physics simulation, or should be 'fixed' (kinematic).
yeah the issue is when the skeleton mesh gets simulated and detaches from parent. Do I need to replicate both that the skeleton mesh is simulated and pelvis bone location? Then have the server move the capsule component to follow the skeleton mesh position?
Yeah, I think you'd want to replicate all the simulation toggles and movements just to make sure it's consistent across clients (imo)
Hey Guys GoodDay
im trying to Swap the Controller from lobby PC to Game PC the event not firing
if you can see it guys xD
@odd iron so you're switching the controller but the event isn't firing?
@odd iron are you using seamless travel to transition from your lobby to the game? It looks like the event will only fire on seamless travel
yes im using seamless travel
@odd iron sorry, I'm a bit out of my depth with this one since I've never really messed with seamless travel
No worry mate i thought there is a check box or something i missed
Can you verify that the player controllers are actually changing to the new type when you switch map?
Yes i can use Printstring with Chat button one sec
My last thought is did you put the OnSwapPlayerControllers event on the new game mode or the old game mode?
Sorry, I'm officially out of ideas π
I remember in the past there was Seamless Travel Checkbox but i forgot where to find
or i dont know if its still exist π
no worry mate thanks for help
at least we tried :d
Yeah - I'd love to help more but I'm still figuring out all this multiplayer stuff myself π¬
goodluck
@analog rover You know sometime im being idiot π i forgot to tick use seamless travel for Lobby GM
Hi guys,
are all properties replicated together? so say I have 20 properties that were updated on the server in one tick (all in the same actor). after this unreal pushes them to the clients. in the next clients tick will all 20 properties be updated, or is it possible to get like 15 property updates on a tick, then the other 5 on the next tick?
Hey, I've been trying to set up a REALLY simple multiplayer using blueprints but it's not working correctly
I can have multiple players in the editor, but once I build the game, they can no longer connect
Maybe I'm doing something wrong, but if I am, any help is greatly appreciated
Hello! I have a very simple BP that spawn an Actor around players. It's supposed to be local only, and is not replicated
- In local it works
- in networked with dedicated server it work
- In networked without dedi, it breaks. Basicallly, the server player works, but the clients dont spawn the pawn anymore??
Disconnecting the two events is enought to make the clients work in a non dedi nertwork environment
Any help would be appreciated, thanks!
@brazen sluice What type of networking is your end result? Dedicated or P2P?
I tried both, Dedicated works, but not P2P
But what's your end result?
P2p, the server player work fine, but the client dont spwn anymore
I'd like to have both working
Have you looked into the Switch has authority node?
Same result
Client dont spawn the default pawn
OK I have more
It seems the clients are not allowed to perform a SpawnActor
But only with my specific class
Which is a C++ class
If the clients are not allowed to perform a spawn actor, then either let the server do it, or make the function to do so a replicated one
It can't be replicated
But it's odd thought, I guess something is fishy in the class itself
Then use the switch has authority node
It's only a static mesh generated with the lib RuntimeMeshComponent
OK Update it seems clients break when setting a Collision Mesh, going to ask the author of the lib thanks for your help @ornate holly
yw
Now I need help lol
When I build my game and open two windows, the players don't connect to each other
idk why on earth they don't since they connect fine in the editor
Umm is there any tutorial about how to create a loading level for the player to have fun while waiting while the server is loading
it is also including the loading of another level while not in it
Im ok with this one as well
I dont want the player to get in the game and walk through unloaded objects teleporting around
@brazen sluice never use https://www.thegames.dev/snaps/Discord_cbF6TfiQOx.png
GetPlayerCharacter in multiplayer
unless you know what you are doing
its very very bad practice.
there are plenty of other ways
but GetPlayerCharacter is a crutch, works fine in Singleplayer, but in multiplayer, i really don't trust it as far as i could throw it
i have never had to use it
Expand xD what kind of other ways, I couldnt find any other node able to return a player handle in my BP
Or they all rely on the same mechanism
Do you mean looping throught player array and stuff?
if you want the first player, i use GetFirstLocalPlayerController
but this it the local player
Well I want the local player which Im assuming is the first one
So the first player is always going to be the server even in the clients?
there is no guarentee
I mean surely there's a reliable way to get the current player in a client
XD
yeah we did
Does it return Player index 0 ? Lol
controllers only exist
on owning client and server
so GetController node on a client
with index 0 will be there controller
GetCharacter on the other end i don't trust/refuse to use
best way to get the local player pawn
anyway probably wont fix your issue of clients not having a pawn
if that was your issue (think we got sidetracked)
where is this logic?
I was just checking Calibrator's idea of checkign for authority which did not work
Yes yes
Essentially uppon spawning the world I create a terrain mesh, using RuntimeMeshComponent lib
The mesh is local to the player (since htey can be in 2 different spots in the map)
Everything work fine when using a dedi server
but in P2P the client are not allowed to set the collision box of the procedural mesh for some reason
Well I say "not allowed" but I have no error whatsoever
The pawn simply dont spawn if I call StaticProvider->SetCollisionMesh(CollisionData);
If I comment out the last line, everything is fine in P2P but obviously Idont have collision anymore
never thought I'd be debugging netcode w/ OBS
When I build my game and open two windows, the players don't connect to each other
idk why on earth they don't since they connect fine in the editor
Can someone help?
are you using a dedicated server?
Yes
are you opening one of your windows with the listen argument?
if you're using a dedicated server
I'm sorry but I don't have enough knowledge on ue4 to know what that means
launch a window with the -server argument
Where do I put that argument?
how are you opening them now?
I package the project then open the generated exe file
π€¦
we all start somewhere
yeah lol
also if you're wanting to test it as a packaged build, you also need to build your dedicated server
which requires you to build source
which you can read how to do that here: https://michaeljcole.github.io/wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_&_Linux)/
Wow thank you so much
as for testing a dedicated server without packing
i'll DM you
to not flood the channel lol
hey y'all I just finished packing my game as a windows dedicated server, and I noticed that my search for servers function always returned nothing, and when I connected to the local server using open 127.0.0.1 I could join the server but got this warning:
is the warning related to not being able to find any servers? I should also clarify when I run the game in PIE with the dedicated server tick set to on, I am able to search for the server and it always shows up
simple question : is ip hosting local or global for multiplayer? meaning if the client types the ip of the dedicated server from anywhere, can they connect?
@cerulean escarp iv always wondered what that warning meant. if you find out anything let me know
will do
@shy kelp it should be global, ive had others connect through my IP before
Thx, Im new to networking so I need a lot of help lmao
did you try doing what it tells you to
like?
you know this stuff?
@fleet raven
lets say im trying to do this with a shortcut arguement
to launch a dedicated server through the editor you pass your project file and -game -server
not exactly all i need
Is it more expensive to send an Enum that is the size of a byte than a byte?
No
Enums can be much more than this, but if it's an uint8, it's an uint8
That's very interesting why don't they just store the EMovementMode in CMC? they specifically store the uint8 and they call it packedmovementmode ?
uint8 StartPackedMovementMode;
Why not,
EMovementMode StartPackedMovementMode;
Because it's old as fuck, probably
Actually it was recently changed...
uint8 MovementMode;
// Information at the start of the move
uint8 StartPackedMovementMode;```
Perhaps it performs better as a uint8
Oh whats the new enum?
Hello all!
Was wondering this scenario:
- I have an actor WorldManager which hold level information (There's a wall here, a chest there that's unopened, etc...)
- I have clients who load / unload the world in local (Since they might not be in the same emplacement, they load what's relevant to them)
Up until that point everything is fine. Now, I would like to make the WorldManager server owned, and have the client do getStuff() in RPC, without having to replicate the whole world to every clients.
The issue i'm running into, is that clients can't execute RPC on actors they dont own (WorldManager) so my clients when LevelManager tries to to do WorldManager.getStuff(), will just drop the call since they dont own WorldManager.
Essentially my question is, how would you implement a simple getStuff / here'sYourStuff pattern within Unreal (using C++)
i have a
UFUNCTION(Server, Reliable)
Level* getStuff();
How do I call it from the client, to get the stuff, without having the whole world replicated?
Thanks for help!
the RPC would have to be on the controller
and the controller (server side) calls Level->GetStuff
Alright and since the controller is replicated, boom
RPC's dont care for replication
it only cares for owning actor
a non replicated actor can still send rpc
And I store the level infos on the controller itself
Well the levelActor would need to get that infos at some point so it's not a direct PC
Because the level Actor spawns stuff, if I replicated you will get spawned stuff that are not in the same part of the world as you
You only spawn what's within a certain radius around you
why you doing it like that?
Open World, no boundaries
hmm
looks like you want some spatialization grid system
and only replicate a subset of information to each client
Yeah it's in an H1 octree
depending on what nodes they can see
Repgraph does that
I have the tree already, just need to do a getNode() to the relevant places
might be worth a dig into the code for it
oh
so why not replicate the subset
the actor can be replicated
but only replicate what is actually needed
for that client
Not sure how to do this tbh
I'm assuming if I tell Unreal to replicate a client, it will replicate to all clients
not just the ones that are within a radius?
replicate a node*
Oh I see there's a distance based relevancy system
interesting
That's kinda heating up my mind TBH
So I set the "node" actor to replicate (multicast?) and I add distance based relevancy.
But then I need a client-only method to call the actual "spawn" may be, so I can stream the content of the nodes rather than the geometry? Or is Unreal a smart-ass that will replay the geometry instanciating?
If that actually work that easily, I would kiss you
OK So progress: I implemented something like :
Node [Replicated actor] {
UPROPERTY(replicated)
theData
}
The on Begin:
if(HasAuthority) { // whoever spawn the actor
theData = loadData();
}
// Client would get theData already populated
SpawnTheStuff(); // read and spawn everything in theData
The thing is, the clients freeze completely upon starting the game... not sure what I'm doing wrong
How much is "LoadData"?
Hm right. Well keep in mind that you can't do that all at once in the end.
Either way, not sure what the comment "Whoever spawn the actor" is about
Server has to Spawn the Actor
Right
And the freezing,.. do they unfreeze eventually?
Doesnt feel like it does, but also it seems not to be completely frozen, BC I can see the clouds moving it's just that the FPS is so low that I couldnt notice it
Anyhow from client's perspective, it seems no Actor are being spawned at all
I cant see a single node, but with a breakpoint, I can see the lifecycle of the actor being run throught so they def spawn server side
You aren't doing any EventTick RPCs that are Reliable or?
Are you calling RPCs on tick
No I'm only spawning meshes
On tick?
Why do you need tick for that?
BC meshes are loaded Async
So I have a thread, who sets a bool when the meshes are ready
Does the game freeze for the clients if you don't load the data?
Does it also do ready=false afterwards? :D
yes lol
π
Replaced by if(false) and it still freezes
Gonna try to comment out the thread then
OK Only commenting out loadData() seems to work
if (HasAuthority()) will only execute on server right?
OK am I allowed in loadData to just do mySharedData = some new Array() ?
Or does it need to keep ref?
Will BeginPlay have been executed alreaady on the server once the actor is replicated?
Holy shit, I moved the loadData to the constructor and it works π
I'm going to cry I'm so happy! Thanks @thin stratus @meager spade
in C++ how do I know its being compiled for dedicated server ?
I want to exclude some useless components from the dedicated server build to save a little memory
There's a pragma:
#if WITH_SERVER_CODE
....
#endif // WITH_SERVER_CODE
How many time a day you guys read "Well This isn't very helpful Amanda"
Hey Guys
When the player disconnect of close the session im using " Destroy Session " Node to destroy the session he have made
but when im trying to make a new session without restarting the game
the player cant control anything or move i've looked into the log
found this
LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2020.04.04-16.22.07:206][720]LogSpawn: Warning: SpawnActor failed because no class was specified
its look like the old session data stay at the game when he try to connect some of old data still there
imagine I spawn a replicated actor on the server and initialize some of its properties at the same time .
``
FActorSpawnParameters asp;
asp.Owner = this;
WeaponRifle = GetWorld()->SpawnActor<AProtoWeaponBase>(RifleClass, asp);
WeaponRifle->RelicatedClass = MyClass;
//...
``
on the client side what event is called when the actor is spawned for the first time ? I need something before BeginPlay
I want a guaranty that properties are replicated as well ? is BeginPlay ok with that ?
Quick one, will hasAuthority be true only on server? (if server spawned)
Hey Guys
When the player disconnect of close the session im using " Destroy Session " Node to destroy the session he have made
but when im trying to make a new session without restarting the game
the player cant control anything or move i've looked into the log
found thisLogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating [2020.04.04-16.22.07:206][720]LogSpawn: Warning: SpawnActor failed because no class was specified
@odd iron
Edited : Found the Issue the Input was Focusing on UI for somehow π
When I set a property to replicate in UE, does it replicate all the time or only when it's actually changed ?
I'm trying to set an array of String to replicate, and it get super slow VERY quickly
Like about a few hundreds strings in my array to replicate and the game becomes totally unplayable..
So I added a delay of 1sec to late the game start fresh which works
But it gets weirder... It seems the problem isnt the size of data, because the first actor, with an Array of 5000 sync just fine, but the second one, with the same size, is taking forever to come...
As if the server sent the replication, and was waiting for something before sending the second one
And that something somehow gets slower, the bigger the array
But still the first actor is instant to sync with an array as big as any other
Can I somehow log what's being replicated to see if something is wrong?
why are you replicating all of this?
They only replicate when changed
The initial replication might already be overkill
You usually don't replicate such big arrays, at least not at once
Did the command for simulating packet lag change from net pktlag = n?
no
Ok thanks, wasn't popping up in my autocomplete for commands so wanted to double check
@jolly siren @thin stratus It's my level, they're generated on the server and then sent to the clients
Why does it need to send the whole level?
Why not just the values to generate it?
If that's all info that is needed then this might need to be done differently
Either way you might want to try the same thing in a fresh project
just the 5k+ FString replication
What if I want to override the implementation of RPC in child class ?
is this is correct virtual void ServerRPCFunction_Implementation(int32 IntegerParameter) override; ?
Hey guys. I have a problem with a multiplayer lobby. All client cards have the same icon and name of the server icon and name who created the lobby, even though each one has different info that they set before. Anyone has any idea to why this is happening? I'll gladly provide more information
@quartz venture if you're setting the icons via blueprint, make sure to have a default value for the icon variable
for some reason, if you don't set a default value for Texture2D object reference in blueprints, changes to it are not reflected
Anyone here working with Amazon Gamelift?
Thanks for answering. I have indeed a default icon value. Perhaps it is my approach thats causing the problem because im using PlayerState to store the values of each player
Each time a player joins I loop through the player array and get the values. it works correctly only for the server
is there a way to convert std::string -> FString -> std::string without loosing the UTF-8 symbols ?
im getting it from GameState
the loop to get player array, is in GameState ?
no its in the Widget BP
hey so, im having a problem that only occurs in multiplayer. The first client has a pawn spawn for it but the second client does not. Does anyone have any ideas why this could be happening? I can send any screenshots needed for clarification.
the "correct" approach to do this, is to use GameMode, when a player joins the game, you use that event to loop through the array of all player controllers connected, and tell them to update
@tropic prairie need more information
commonChunkData = FString(UTF8_TO_TCHAR(compress_string(TcommonChunkData).c_str()));
replaces non latin wiht ??
I'm just stupid. I have a function called "Initialize" that loads the player info from a save file into the player state. It was set to execute on server instead of owning client. Thank you and sorry for wasting your time hahah
@tropic prairie what kind of a pawn spawn? are they PlayerStart?
I think my problem must have something to do with the pawn. Using different paws with the game mode works fine.
@quartz venture Its the NetworkPlayerStart that comes with the First Person example
And the pawn is based on this: https://docs.unrealengine.com/en-US/Programming/Tutorials/PlayerInput/index.html
React to player input by extending the Pawn class.
only difference is that I used a cone instead of a cube
or rather I made a blueprint from the C++ class
Okay tell me the logic you use to spawn your pawns. we can go private if you want
I haven't really set much up, I just have the NetworkPlayerStart and the Game Mode is set to use this pawn as the Default Pawn Class
Considering that I'm very new to this, there's a good chance there might be something else that I need to do that I'm just unaware of
so you have NetworkPlayerStart and the Default Pawn Class and youre pressing play
yeah pretty much
I also have the Number of Players increased, and it's running a dedicated server
okay im starting a new project to try and do what you did.
okay, thank you!
i have a problem, when i have multiple swords on the field to be equiped only the sword which was equipped first has damage. for example, one of the swords in the field does 50 dmg, the other one does 10( networked btw). If a player pickup the one that does bi 50 dmg first, then another player pickups the sword that is supposed to do 10 dmg, it still does 50 dmg. dmg is replicated. I only have a SINGLE sword bp, which i can edit with instances to specify dmg.
I'm raw in networking
@tropic prairie okay i just started a project. i did nothing except i set players to 2 and checked dedicated server and started. everyone spawns
should i change something?
@quartz venture It only didn't work for me with the custom pawn set as the default pawn
Would it be easier for you if I sent my project?
sure send it
or wait
i changed the default pawn
to a normal cube
and the same thing happened
hmm
i'm doing some experimenting now and I'm starting to think it has to be a character instead of a pawn?
When I play with the same multiplayer settings and use a character, it spawns multiple characters
er, it spawns 2 characters at least. One's below the map and the other's at the expected point. The other 2 clients don't get characters.
For anyone wondering, FString sucks ass, so I'm replicating an array of int8 and I convert it to/from std::string manually, now it works fine
@quartz venture this problem seems to only occur in the editor. I packaged it and ran a test server and then connected multiple clients and that worked fine with the character. I'm going to try it with a pawn now.
the problem persists with pawns
weird
@tropic prairie it seems random. I tried putting multiple PlayerStarts and clicked Play
i tried with 4 players as well
and 3
sometimes all players spawn
sometimes only one spawns
thats weird
sometimes only two
huh
I would say write a code in the GameMode to spawn all players
that's probably a good idea
also i noticed something
i mean its the same thing that happened to you
character works and pawn doesnt
it is probably something in the GameMode functions when the map loads. You just need to write your own code to handle spawning
probably
anyone ever encountered a bug where you try to simulate multiplayer in editor but client is spawning the pawn, posessing it yet no input can be given. Also it cannot see the servers actions for some reason and stuck there forever ?
I am using 4.21 source build and only change I made before it gone crazy was creating a new gamestate and playerstate class and switching the old ones
No matter what I did it stayed broken even though I reversed everything I last did as well
Hi guys,
I ran into this error message whenever I play in MP:
PIE: Warning: Invalid Simulate Options: Body (DeployableMine_2.Sphere Collision) is set to simulate physics but Collision Enabled is incompatible
It works fine in SP though. so I can't enable physics in MP in run-time?
@tall pine are you trying to do this on a dedicated server?
have you set physics to be enabled on dedicated servers?
can you turn it off on server?
iirc it's default is to be disabled on dedicated servers and you have to enable it but I can't for the life of me remember how
I tried doing physics on multiplayer once and it was so annoying so I just didn't do it
yes physics replication has its own little world of wonders
I was able to have an android join a game hosted by PC before, when they were both dev build. i made my first shipping build and I am trying out the same cross platform LAN between them today and my android cannot find the session to join it. Is something different in shipping builds?
wait, you can set physics to be enabled on dedicated server?
Where can I set that?
so those warning message I receives is from the server? Interesting
those error are from the client side though, not the dedicated server. Also, even in cooked build, I would see the PIE in front
PIE: Warning: DeployableMine_2147480344.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.
i have a stick on my player character. i want other clients on a dedicated server to see when my STICC moves up and down. what do?
Sticc movement is made from the mouse input and parented to the camera.
Tell the server your stick position, average it on the server so that it's smooth, then have that result replicated to other clients, and inteprolated again for smoothness
@bitter oriole : do we still need to set simulate physics on dedicated server? Or is it an older engine thing?
When I tell the server stuff, how does the server implement the rotations?
@bitter oriole
@tall pine I don't understand the question. Servers don't do anything special regarding physics
@swift cargo It doesn't
You need to replicate the same logic on the server and send the information you need
Which is the camera position I guess
In blueprint, @bitter oriole what would it look like and what would you recommend?
Look. What you have is a component that moves depending on where you look at, right ?
Good morning Guys How can i get all players controller in widgets
i have scoreboard and i want to call all players controller
i tried to get player state -> All players Array and loop its getting all online players but all values same
I've repost it here because its related to Multiplayer xD
player controllers are the same you shouldnt access that via server
they are not replicated hence you cant modify it and there is a reason
why would you want that ?
@swift cargo so assuming you have code that moves the stick depending on where you look at :
- Send the "look at" information to the server
- Have the server replicate the "look at" information to other clients ("skip owner" will be useful)
- On every player, just keep doing the stick animation based on the local, or replicated data
you can get the all players via gamestate
@odd iron You need to use playerstate, not player controller, for this.
You mean get Player Array from player state ?
You won't be able to get player controllers at all
i've tried to do that its working but its duplicating the values
The data needs to be in player states
Player controllers don't exist for remote players, at all
Yupe That what i know but i wasnt know any other fix π
its because it is giving it a duplicated name
So if I store the data in variable and get the server to multicast the variable it works?...
but it is actually not
btw any one have any idea why this happens, I asked yesterday but nothing
anyone ever encountered a bug where you try to simulate multiplayer in editor but client is spawning the pawn, posessing it yet no input can be given. Also it cannot see the servers actions for some reason and stuck there forever ?
I am using 4.21 source build and only change I made before it gone crazy was creating a new gamestate and playerstate class and switching the old ones
No matter what I did it stayed broken even though I reversed everything I last did as well
@swift cargo yes it does
IDK why but vertical rotation is not handled by server
@cedar badger
whoops
sorry
too many chases :/
Lul
there would be too much rpc call
Still very confused but I'll try it soon anyway
I would have to see a blueprint example for me to think
@swift cargo It's simple : you have data that originates on one player, you send the data to the server, which replicates it to the other clients. Animating the stick based on the data happens everywhere.
So this is the last result i've reached
but i want to set custom variables when i set it in Playerstate its return null
you need to replicate those variables created in player state
player state replicating is not enough
and set the variables on server not on client
Thanks @twin juniper and @bitter oriole
i've made something like that in PlayerState i think its ok
and player info feeding from controller bp
anyone here using Amazon Gamelift ?
I have been banging my head over the keyboard for two days over this issue with no avail
i dont think error window gives you accurate reports, but in this case maybe an issue of double including the module for build script may cause something like this. also it's sometimes worth cleaning up project by delete intermediate folders (both in project and project plugs), generate sln and compile everything. also quit editor when compile, hot reload is a mess.
Didn't Server RPCs require the WithValidation specifier?
Because my 4.23 project doesn't whine about me not adding it to a server rpc π
is that normal?
It is no longer mandatory afaik. Since 4.23 maybe 22
someone should make a script now that goes through your code and deletes all the empty validation functions you were forced to make earlier
I've cleaned the project, i've rebuilt it, rebuilt the C++ libraries, done basically everything except actually deleting those functions
which is alot of headaches
so if anyone here using a recent UE4 version with the Gamelift SDK, help would be appreciated π
How many crash reports a day does Epic receive
Millions, most like
i never send it
I also don't, but mostly because 99% of the crashes I get are in my code
Oh im sending it, taking them down with me xD
considering there is a send and restart and not a don't send and restart button I'm sending
same
In pie test a delegate fired on client ends up being executed on server version of the pawn implements the event. Is this a known bug?
its not quite a multiplayer related topic but yes im also in this game with ya. these folks are so good with managing web stuff, i am truly amazed.
Do you guys have any advice on replicating a large array (around 1000 vectors) over the network without dropping packets or choking the shit out of the server?
if its a local net stuff just increase the network limits from 10kb/s to something like 1mbit and it should not choke that much
oh shit where can I increase this network limit?
the're also limits for array size in length and byte those are editor settings you can increase
ini settings
Wheeze had the same issue yesterday
The way I fixed it is by compressing the levels in 2 way :
- manual compression by removing redundant data
- GZIP compression
does steam subsystem handle nat punchtrough for players behind routers for listen server ?
Yes
you probably cant use it for other purposes other than steaming
but webrtc has similar features could be an alternative tho
Can you switch collision profile in mp at run time for a static mesh?
Yes
When i do i get this warning
PIE: Warning: DeployableMine_2147480344.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.
It doesn't happen in sp
I can't seem to find these network limit .ini settings @rotund sapphire - This at least doesn't work:
there will be at least 2 or 3 stages where limiting the net, in different settings you must increase them both
i think that (or a similar one) AH post should point out more
@tall pine you have to replicate the change somehow. The collision settings won't automatically replicate.
these answers on AH don't even tell me which .ini's they are modifying lol - I'm assuming it's DefaultEngine.ini
[/Script/OnlineSubsystemUtils.IpNetDriver] [/Script/Engine.Player] these sections also have limitation settings for net you should adjust
you can put them in engine.ini
I'm assuming it's DefaultEngine.ini
That one actually in basegame.ini so defgame.ini rather, but i think it might just work from engine ini too why wouldnt.
Hi @chrome bay : i have that code run on both client and server, so i still need to replicate the change?
if it runs on client and server then no
Well, assuming all clients have run it
Which late-joiners might not have
I think he means he run the getmass on both, but instead he should adjust collision on both is what you asked him to do.
No, i run the change collision code on both. I inherit the code but it does seem we run physic simulation on both client and server
It does hit the breakpoint on the client when i change the collision enable profile
That's ok then. Could you try run this project using Standalone mode, and disable the "single process mode" in settings?
I've seen problems with PIE simulation that doesnt happen in standalone mode
Ok will try
Sry for being an irritant @rotund sapphire - but this is what my DefaultGame.ini and DefaultEngine.ini looks like (the configs in ProjectFolder/Config/)
I just put all the settings I could and put it in both configs and put a couple of zeroes to make the limit much higher but it's not working
Did you restart editor?
this is what the network profiler looks like, peak bandwidth is around 40-50kbps
Yeah I restarted as well
and the peak bandwidth is where everything chokes up and it takes the server like 2 seconds to sync up again
for other clients
min dynamic bandwidth is around 40k, also player's replication is still limited to 10
try larger numbers and test again it should do it quicker
alright, should the min dynamic be higher as well?
also, depending on the vector's dimensions you can try netquantized structs for cutting the costs a bit
yes why not, it's for testing
It's an array of structs, the struct containing 2 vectors
I'm doing all this in blueprint btw
vector is 3x32bit data, but netquantizers are smaller (less accurate tho)
doesn't have to be super accurate, I'll take a look at that thanks
ayy it worked! thanks
just raising the numbers I guess lol
just crank it up
@rotund sapphire : I still get this in stand-alone
PIE: Warning: DeployableMine_2147480350.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.
The interesting thing is I only get that the second time that code get called. The first time everything is fine.
Not much to go on, but that could be a valuable finding for you to understand what exactly happens in code, so you can figure out why things gets messed up. You maybe loose a reference, or reference a wrong comp, perhaps you spawn new comp but execute collision changes on old. Or you're addressing wrong pawn etc :)
could be. The actor is a mine, and we use pooled actors, so this could be the case. Thanks for the idea, I'll double check
although if this is the case, I feel like it should also happen in SP
is it net safe pooling? do they sync server client pawns to have same guids etc?
when you run it single player only one pool exists, but in networked game you're dealing with two i guess
i'll read through the code, I don't think they sync the actor pool
perhaps you should use pooling onlyon server and allow client for normal spawn behavior upon replication
on that note also make sure you dont spawn mesh on client, but instead just allow the one coming from server to spawn automatically
oh, so pool on server and just set to replicate so the mesh will spawn on client automatically?
yes
i actually was expecting you dont spawn objects on clients at all but was worth mention to shut this out
maybe you're double spawning stuff here and that cause confusions
but if I do spawn object on client, and simulate physics on both side, that should work right? I mean if I don't set the actor to replicate
you're breaking authority with that. server must spawn the server authorative object and set replicate on so it will show up on client automatically
I see. ok, thank you. I'll double check that, thanks for your help
btw its possible to spawn a client object and pretend its coming from server, i've done this hack before tho its ugly. been managed to modify cmc too so it will accept standing on it.
i see. I think I need to look at the pooling to make sure we don't spawn actor on client
@swift cargo use a replicated variable, have it skip the owner for replication. in the look up function (the one you have it all set to) calculate your new pitch like you did, then pass that value to the server and have the server set the replicated variable to equal it (so its replicated to other clients and they can see you look up and such). dont multicast, especially in a situation like that lol
lol
here? in this discord xD
Has anyone ever setup quick play? So like, the user clickes and button and it searches through all the sessions found and then joins the lowest ping...?
oh ok
ya
Woah
He's replicating the players pitch so that everyone can see it in a MP game
hmm ok
Noice
ye
Still, how would anyone recommend me goin about setting up a quick match button?
how is a quick match any different from just joining a match?
so you dont have to choose?
Let me show you what I have set up...
my brain hurts
oof
is this what being good is like?
Wym?
?
dont worry about it
lol
Okay so I have something setup with the Quick search and join, but i dont know if its correct or is its even a good to go about doing it....
This is what the code looks like for the button
Any opinions? Corrections? Lol, I want this to be as perfect as possible so that when I release this free Mp Template, it all works smoothly. π
im not touching that unsolicited link
Its a link to https://blueprintue.com/
BlueprintUE.com is a tool for sharing, rendering and rating blueprints for Unreal Engine 4. UE4 is a game engine which use visual scripting called blueprint.
ik its still unsolicited
Its a website where you can share your code without sharing your project or sending pictures
Its very helpful π
nice
Has anyone made a quick match mechanic?
hey do u know the fix for this error
its the DX11 level 10 is required to run engine
Question : I have the server up and running on gamelift. I Can connect android devices and play with out any issues. I build the same game to ios and join the game and it crashes. If there are no android clients connected it works on ios clients but as soons as an android client connects to the same server it crashes on IOS client, android doesnt crash and server is still good though
Does this mean that i have to have seperate servers for IOS and cross play would be impossible on unreal for a Client to server model as of now
Im trying to drop a sword in a replicated function. This code works on the client side, but if another player looks that them, they are still carrying the sword.I'm raw to networking sry.
nvm, i learned it
i should do more trial and error lmao
Hey, could anyone point me in the direction of making root motion work in multiplayer? I currently can't move as a client when I play because the server is correcting me. I can stop that from happening by enabling "Ignore Client Movement Error Checks and Correction" under the Character Movement component but I am still unable to see the clients movements or orientation so the client just sits still when viewed from the server player or another client. I believe this is because the Animation Blueprint doesn't replicate (from what I've researched). Quite a while ago, I some how fixed the animation replication issue but the speed at which the animation plays was different for the viewer and the player controlling.
you shouldn't use Root motion animations inside the AnimBP
only play root motion networked via Montages
Hi, all, could anyone please point me to a good example of persisting game state, player state, and repossessing character on seamless server travel for blueprint?
I know to use game instance to do so, but trying to find an example to work from..
I see that there was a few answers to my previous question on replication, but that part I've already got down and I can see my own anims....now ofc I need all other players in range to see them. Any advice?
Basically looks like this right now and I want other players to see those anims happening, not just me staring rocks and trees into nonexistence (all the highlight stuff is client only) https://www.youtube.com/watch?v=N1ihQcTf8Eo
This is a WIP video with some very basic gathering mechanics, bad animations, and no Chaos.
So UObjects can only be replicated by their outer
Which leaves some issues when transferring ownership of objects from one actor to another (e.g. an item being transferred from an inventory to another).
Would it be sane to have one actor that owns all objects and replicates them all?
I could separate it per player to have a way to optimise replication frequency, perhaps using the replication graph π
I have access to whatever I want during this process technically
Just trying to understand what it really needs to be
Has nothing to do with inventory, that's a separate process pretty much
and this whole thing is like 70%cpp 30%bp
Just for the ease of plugging in certain things
theres anyone who can help me with an amazon gamelift stuff?. i just want to make a gamemode in blueprint with gameLiftSdkModule->InitSDK();
@solar stirrup or you can DuplicateObject<>
that will of course cause allocations it may or may not be an issue though
No allocations would be better but my current system does allocate anyway
What about my idea, is that maintainable?
also my current system dupes the object already but without using that function haha
yes it will be. But you need to add a way to block replication inside component to non owning actors
you don't want your inventory component to replicate to everybody else
that's fine
my inventory uses the fast array serializer
so it just won't replicate content
it doesn't really chgange anything
arrays are already replicated by delta
FAstArraySerliazer just make checking for what changed faster (+ gives you nice events)
My player inventories only replicate to owner already ^^
So I guess I'll go with one actor to replicate them all route
at least, all objects of a specific type
aha so I assume you have separate inventory and equipment componenets with different implementation
yup
or
as simple as ticking a box
how so
Wouldn't I be able to call ReplicateSubobject on all objects from the outer?
if you have component on player state and player controller and set outer to PlayerState items on PlayerController won't replicate
I meant having all objects outer be a specific actor made to replicate the objects
That way my inventories only hold a weak pointer to the item stored inside said actor
i know, that will work (;
though in all honestly
duplicating item is easier : D
feeling good is actually bad indicator ;p
my item system works on discreet componets and duplicate items between them
Everyone's got their own implementation haha
I have one base component, with some minor alterations in childs
well never really god any problem with it : D
got*
that's how i do it too
used to work perfectly but I opted to have uobjects for item instances alongside the structs for item slots
for more flexibility
similiar setup
though at one point I thought about getting rid of uobjects
and doing polymoprhic ustructs qith custom replication
with*
similiar to how ability system handles various replicated things as TSharedPtr<> internally (like GameplayEffectContext)
sounds nice
Hey friends! I've got a multiplayer (pure server) game that sometimes doesn't recognize the client moving. The player appears to move on their client, but the server isn't updating it. As the client, they get spammed with the attached message.
Haven't been able to find much in the google. Anyone able to point me in the right direction?
in a client server setup, should the client also run the construction script on actors?
It will run the constructor yes
and it should
The Replication Graph only works for actors right, not uobjects?
If so, should I make my items as actors and make use of it?
if i run the construction script on on the server (using switch has authority), the actor is still loaded on the client
i'm just having troubles because i'm getting a lot of warnings and i think its because i have duplicate objects
its a platform the player is standing on, and if i let the client run the construction script to also create and add the platform, then the client is constantly saying it can't resolve the new location that the server told it to go to
but if i don't replicate it and construct on the client, it still loads, but i have a different kind of issue where its telling me that add instanced mesh component is not supported
either way everythign seems to be mostly working fine, client is a little jittery though, but i'm getting a ton of warnings constantly either approach i take
oh i just realized i get the cannot resolve movement warnng either way
ugh
i get this constantly when the client runs around
until i go to another room
interesting, so if i don't level stream, i don't get those errors
i only get them after i've streamed in a sub level
even though i'm nowhere near that sub level at the time
@solar stirrup UObjects replicated with Actors
so what benefit would you gain?
replicate*
Eh not much
I just decided to go for something else with uobjects
Have them be replicated by one actor but stored in different arrays depending on who they're relevant to
Well at least I don't have to dupe them every time because I need the outer to change
Only one actor will replicate them
I'll just play with net relevancy to avoid replicating them to everyone when it's not needed
I was told that'd cause issues π
Besides it also means I won't have to implement ReplicateSubobjects in every actor/component that plays with the items right?
not sure what these "items" are
but then again i don't know you game
items in my game are just destroyed and spawned as pickups (if they are world items)
then again, they are not even UObjects yet (just a fast array entry, atm)
only Weapons have an actor
I wanted mine to be flexible and stateful
objects are great for that imo
compared to structs
so my inventory's slot is a struct that only contains Quantity and a pointer to the item instance (object)
Wanted to confirm my assumption but if I have replicated variables in a single player game, will the game still run any additional "multiplayer" checks for changes? It relates to one of my tools and easily hot swapping from a multiplayer version and singleplayer version
@solar stirrup in my game, i have WorldInventory which is a replicated fast array, my quickbar just holds the item ID for the item inside the WorldInventory
that works
I store anything related to the item's state in the object instead of a struct
that's the main difference i see
yeah thats what i plan to do for account items
but for world items it makes no sense, since they only persist for the gameplay
I just found it very annoying to deal with structs as items
i mean i could still do it actually
idk what to do :/
hello, Im following tutorial on how to make a local multiplayer game, it is managing to assign different game pads to different players, however, the keyboard input is being sent to player 1, would it be complex to make the keyboard input be assigned to the next player after gamepads have been assigned?
e.g. if 2 gamepads, player 3 uses keyboard
Just a quick question. It's not possible to easily retrieve a players Steam profile picture in blueprint is it? I'm talking about not exposing things or using plugins. I'm just looking for Yes or No. It's not a big deal lol
@cedar finch I just searched for a function that could do it but all I could find was Get Steam Friend Avatar
so I don't think so
Ok thanks for looking. π I figured It would require some extra stuff. Someone was asking me and I couldn't find anything either. Just wanted to check if anyone else knew. No problemo. π
Anybody knows what went wrong with my network replication of the main character.
https://gyazo.com/5efa358b3dd7cd4755579a2da0b943f7
@summer tide Could be movespeed not being replicated or animation states colliding. Did you push sprint when it stops working?
Pressing W jogs that appears a little faster then regular. When I hold shift to sprint, it does that. So two issues.
That happens running in dedicated server with 1 player.
So make sure when you are pressing shift, the movespeed change is set on the server
Check your blendspace based on movespeed. It might need to be adjusted if it is a bit faster than it should be
The studdering is likely from the client running faster than the server thinks it should. The server will make location corrections based on its known movespeed for that character
ok let me try
Can you use FArchive to replicate arbitrary data you know the type of?
still learning networking, why does the destroy actor (inside death function) only run on the server. It gives client xp and everything, just doesnt destroy the actor, i tried everything
everything i know of
you cant call multicast from client
you need to Server > Multicast
also why use multicast if you are just gonna block it with has auth node
So I have a bug when using dedicated server. I'm using a muzzle socket on my weapon to shoot projectiles. But when playing on dedicated servers it's as if the muzzle location isn't following the animation. The projectile is starting at the wrong location but is still going in the correct direction. Ideas? https://youtu.be/GVHBcS29ctQ?t=34
"ListenServer vs ClientSide" Mixed Up "Standing vs Crouching" Projectile Launch Location
skeletal mesh has a setting that prevents animating when not rendered (eg dedicated server)
@twin juniper so shouldnt this work?
no
yeah how do you decide it is the server
isnt event anydamage always server? im confused
its not
AnyDamage is server only indeed.
@rotund sapphire I found it. Thank you so much. I totally forgot about that. π
yh
There is another issue tho, the anydamage will fire multiple times until your character is actaully dead. In that 200ms he may receive more bullets.
i can change it with an isValid
@twin juniper so umm how do i fix it
why cant the clients see the "death"
but still get the effects
create a simple bool instead, IsDead, and set it true immediately there (no delay). You can make this prop to replicate, and use onrep events to fire death sequence etc.
thats wut the death function is
multicast rpc is kinda expensive, an onrep should do it just fine
additionally, when late joiner comes in game he will see your pawn is alive, because nothing will indicate he died.
yeah use isdead, and replicate it so everybody can always know the dude is dead already
