#multiplayer
1 messages · Page 197 of 1
Well I won't say what I said is accurate either it really depend on the scope of your project
100%
But if you want to make a polished game imo, please unlock the engine
again thats not a fair comment?
and thats why I think people give kickback?
your implying that if its BP only it isnt polished?
It's entirely my opinion
the thumbs up...rip XD
few steam games will be devasted to learn that their game isnt in fact polished 😂
so, i follow this tutorial, my hud it work, but my model for player 2 still same with player 1, do i miss something?
this is my posses and spawn player blueprint (gamemode)
I will re-post this, maybe somebody could still help 😉
What is NM_Max for?
assumign Spawn Player is a server function , it will get the game instance that exist on the server
and you are always pulling the same data from the GI , which is getting the player on index 0 and it's class
sorry i am newbie, so how i do it to make it for different player index?
can i use it?
you are just pulling data from your GI, if you don;'t know what data to pull or what index, it tells me that you are just copy pasting tutorial stuff without understanding what the node does
these are all variables that you declared in your project
there's no way for me to know how they are set and initialize
and that doesn't tell me anything
you need to follow your code line by line
when is the multiple player index is set, when is it read, and who read it
this will always give you the resame result, unless you set the member variable (character class) to be different at some point
ow i will try something with this part, if it's work i will tell you, i think i know something
I try to select random impostor like among us but it select server every time. I trigger it in spawn player. spawn player connected event handle start. all of those things in gamemode. just is impostor bool in character bp
I need heeeeeeellllpppp!!
I make hosting and join system(IP) and was testing I write my ip ex(127.0.0.1) I can join my server. But other people can't join my server anybody give me reason pls.
Short answer is port forwarding
You need to allow the default port of 7777 on your router
And possibly a firewall exception
then how to join and hosting server do not port forwarding?
you dont
unless you are doing sessions through an online subsystem
any multigames use portforwarding?
ok thx!
yeah every game has too at some level
again sessions are kinda the exception
wait i do port forwarding and other people join my server. then other people when make they server they need port forwarding too?
if they are hosting their own dedicated server yes
then how to make do not use port forwarding like Palworld
again yoou dont
palworld port forwards their official servers
when i make official servers then they don't need port forwarding?
No you still need
thats how networking works
"official" in this case means the server palworld hosts
as opposed to a player running it
oh
unless you are running sessions (which are typically not dedicated you are connecting to another players machine) you will need to open the port for that server
if you use steam, you don't need to do any of them right?
reallyyy?
pretty sure you don't, I think the process is called NAT
yeah sessions are the exception
not that I know much about it but you don't need to port forward and all that stuff
It still happens with steam, but steam sorts it out for you.
so you dont need to port forward them hence why listen servers or sessions on steam dont need them
depending on your nat settings however to your point
you can have connection issues
that i use steam. i use steam server too?
Listen servers will still need port forwarding, the same as dedicated servers.
well kinda
unless you use a subsystem
if your doing a host/join on steam, steam kinda does the heavy lifting for you
Not "kinda" - you need to use teh same systems to connect, whether it be automatically set up via sessions or manually port forwarded.
yes the protcol is the same
unless something "does it for us", well I mean that just mean you are still portforwarding one way or another
im saying there are some ports that are public nat
i learn "Multiplayer Is Hard"
100%. Just you aren't doing it manually.
Multiplayer is hard
Steam don't offer dedicated servers afaik, just the sessions, friends, etc.
it would be sessions, steam dedicated servers are your own hosted servers thatyou provide the ip/port info to steam
they sadly do not just give you dedicated servers XD
then how to setting steam server join
if you jsut want players connected for a party game
And need to see whole function
Why would you spawn a player on a client?
steam sessions in online subsystem
ok
Well that's just the name he chose
thx
i try now
loading scree asyn can do with blueprints sprnting in multiplayer with client rpediction too
not true
yeah but its cleaner in c++
less widget weirdness and freezing lol
and tbh with a certain plugin
stupid easy XD
i think you can do all with bleuperints
not quite all no
you can think what you want but doesn't change the fact that you are wrong
blueprints can do alot but there are limitations
exspecially when you get to some multiplayer concepts
But depending on your game and the scope, yeah you can make something in just blueprint
plenty of games have proven that
I agree with this btw incase you think I am just picking a fight whenever we get into argument
scope is the important keyword too
absolutely and no not trying to argue more public conversation 😄
you are correct, as well btw dont wanna say you arent
yes blueprint can hit limits pretty quick
and in multiplayer...its pretty darn fast haha
Lyra has a loading screen plugin. Not sure if it works with umg/blueprints, though.
I was thingking of re-writing (copying) but now maybe I can just steal the plugin?
humble suggestion if you need an easy loading screen, jsut try async loading screen plugin?
setup takes like minutes
its c++ and you can get some really good looking loading screens
If you mean the Lyra one, go ahead. You're meant to use it.
Pocket worlds is another useful plugin there.
I try to learn by looking at codes. As much as possible, I don't want to use a complete system
fair enough
you sjut say limits
they mme expeccially waht i cant do in blueprtins?
give me an example
Threads?
Well I’ll do the obvious one
C++ is much more performant
So if your making a larger multiplayer game, BP isn’t gonna cut it
lack of features, server validation (RPC), half of the engine not exposed to bp
And yeah that’s the other one some things you need in multiplayer aren’t exposed to BP
The rpc validation is a little servere in c++, though, isn't it? It just kicks the player if they fail.
Or it used to.
Do I need to connect the spawn player event running in the Owning client that I created in the player controller back here (to game mode). And will I call the function I created in gamemode to the event in the player control?
again
you jsut talking thi and this
give me an expample
waht i cant do with bleuprints
The trouble is, if you want specific examples, you can do pretty much anything with BP, but it will be a lot harder and a lot worse without feature X, Y and Z.
you can optimazation in blueprints
Not to the level of c++
And those features are things like "half the engine not being exposed" and "no threads" and "bad performance"
Specific example number crunching or doing heavy math operations
maybe its works a little bit betetr with c++
C++ will handle that better than BP
but you can do all with blueprints
It’s ALOT better in areas
or just straight not possible
mhm
Yeah actually that’s a great one
Without a plugin like varest which is leaving a bad taste in my mouth
You kinda just can’t interact with API XD
It'll end up like javascript, "there's a library/plugin for that"
Speaking purely BP only
I've been in a place where my project is bloated with plugins
such a bad feeling tbh
Plus the other downside of a plugin is if you wanna change the way it works
You kinda can’t
http modul
Is c++ yeah
you can
do all
again.
http modul
cold summer
Guys, if you know so much, how about you help me with this problem here? 🥲
All of these in gamemode btw
A lot of nodes for choosing a random player to be the impostor
why not just select a random player from the player list?
I try to learn from internet and they make like that. I cannot access more information because my English is not very good.
Make sure that all Players have Joined -> Game Mode -> Get Game State -> Get Players -> Get Random index -> the output is the random impostor
Game Mode Impostor = the output
Ty
What bits don't work?
What bits even need to change?
If you have any code for any of that directly in your UI, that's a huge problem.
Mine is threaded, networked, supports line of sight, and will run on a dedicated server with no render thread because the gameplay and visual parts are separate. Even if I include the custom hlsl I used in the niagara emitter, and the component code which allows tearoff functionality to it's owner, I have about 1.4k lines of code I'm very verbose, use brackets, plenty of style spacing etc.
So no I don't really see 20k at all in any circumstance unless you're too busy complicating things far beyond what they need to be. People spend way too much time just writing in another condition instead of trying to simplify things.
do you know how can i run layered fog of war?
i can sen you all codes and pictures?
i cant get this work... character team1 see character team 2
not really, BP is really good in a way
maybe it wrks with bp
idk waht do to to get this layered fog of war work
You run as a client...
Yeah that.
Damn it I started the editor and everything.
In teh advanced options there's a "start separate dedicated server" you should probably tick that.
And untick "run under one process" if it's ticked.
i decide now to make my own fog of war system in blueprints
is it possible to make fog of war only with blueprints?
depends on what your doing, for example steam doesnt work in the editor but if you are using something like playfab you can just do a rest call and wait for a response wherever and it will work
you need to be a bit more specific
Any Replication guru in here that would like to look at my problem, Any ideas what im doing wrong?
-I have a boat AActor that i have set to replicated.
- I set the owner of the boat to the Interacting Character then call Interact on the boat.
- I get to the Interact Else Statement and then nothing more happens
- I feel like I should at least be seeing some logs in Interact_Logic function, but nothing happens
i have never used that, i have no idea sorry
but from what hosting i used before i dont think its possible
in playfabs case for example they provide you with some test environment tools where you package your game and run it there
nlxc is using eos core so they can follow the docs that points them on how to test dedicated servers locally before anything https://eoscore.eeldev.com/docfiles/multiplayer/dedicated-server#launching-the-server
This Example has a Video Tutorial that you can find here: Related Video
doesn't require the game to be built
well you don't actually need to build it in order to test it locally, can setup a bat file that points to your editor.exe project.uproject -log -server -AUTH_TYPE=deviceid -AUTH_LOGIN=test -AUTH_TOKEN=test
so in my personal case: "C:\UnrealEngine\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Users\xoaus\Documents\Unreal Projects\Git\Fall-Down\TPG.uproject" -log -server -AUTH_TYPE=deviceid -AUTH_LOGIN=test -AUTH_TOKEN=test
and the server started on my end :)
is it possible to programm a fog of war like league of legends only with blueprints? is this possible?
mate - you keep asking the same generic question(s) here. Anything is probably possible - but no one is going to give you the answers to generic questions
start writing code, and see how it goes
if the client is changing the owner to themselves, that wont work, because the server wont know/agree to that
Tagged you in #blueprint
if that RPC is being called from the boat actor u need to set the owner before it is being called so that it has an owning connection
well i took a better look and u seem to be doing that
is "interact called" not being printed?
he's doing it from the client, not the server, so it wont work
ye thats what i was getting to
hes calling a multicast in the client
even if he changes the owner in the server i dont think it will work
unless that "interact" is a server RPC no?
I haven't done any networking in Unreal before (did a bit in Unity though). If I were to start a project with no plans for multiplayer but it could be a stretch goal, how would you go about it? Are there any architecture decisions, good practices, initial setup stuff,... to smoothen the addition of multiplayer later? Or do you have to include it fully from the start because it would be a nightmare to add later? The degree of multiplayer would probably just be coop with friends, no matchmaking or anything and the game would be deterministic and I imagine just sharing inputs would suffice. But I'm pretty new to networking still.
its completetly different
you either start with it, or dont
Could you elaborate a bit on that?
honestly, if you dont understand multiplayer at all - then its not a "stretch goal" - its a total commitment to doing it or not
and either you start doing multiplayer designed code from day 1, or you dont bother
if you are new to Unreal - then its not normally recommedend to start with multiplayer until you understand the engine..
Im trying to make a timer for the round, and I had it working but not correctly for replication. I moved the currentTime to the game state. However; it seems like i'm not setting the time, and having that display in UI.
Is there a proper way of getting info from the game mode to the client so it can display it correctly?
Set it on gamemode and pass it off to game state. gamemode is server only and game state is replicated to everyone
I understand your reaction, but I'm not new to unreal, I work in it everyday. I've dabbled a bit with multiplayer, just not with Unreal. I was looking for a few more concrete insights from people here, I may not gain just from reading the documentation and messing around with it myself.
ok - but your original question was "no plans for multiplayer but it could be a stretch goal"
and I'm saying it doesnt work that way
You either plan for it on day 1
Yea I understood
or you dont
facts
Okay well, I'm not disputing that. But at the same time I have learned nothing about how it works and why it's not a possibility.
if you want multiplayer - then go for it - just dont think you can add it later
This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.
you have to code everything as RPC/server/client stuff
vs single player you jsut do whatever
its a whole "mindset" of how to approach the code
You can make a singleplayer game using multiplayer, without multiplayer, and it'll work
you cant make a singleplayer game using sinnglplayer code and add MP later
but the overhead for multiplayer code is like 10x a singleplayer game
(10x is made up number - you get the idea)
I am setting it on the game mode. and i get the game state is replicated.
//ctr
GameStateClass = AGameGameState::StaticClass();
//begin play
_gameState = Cast<AGameGameState>(GameState);
_gameState->SetCurrentTime(_currentTime);
When i get the value in BP, its always zero. even though its counting down from Max - deltaTime
I've made a little multiplayer game in Unity and it did complicate the whole thing a lot more. I guess from some things in Unreal I got the impression it's a bit more built in and so maybe it might be easier to include later. But I guess not.
I noticed the whole mindset thing you mention
Then I guess I'll have to decide from the start
@limber gyro Interact called and client calling server interact both happen, i breakpointed in there aswell, but its the RPC there that never happens
@woven basin How do I set the owner to the client so that I may call RPC in this case?
@woven basin Before I set owner, it said I couldnt call the RPC cause it didnt have an owning connection
that's right - so you need to do it another way - perhaps a "interact_with_boat" on the player controller
and give the boat reference, and let the server decide if you can interact with the boat or not
If the RPC is being called by a client to be executed on the server, the client must own the Actor that the RPC is being called on
@woven basin ok but thats what im doing
Here im calling interact from the DefaultPlayerCharacter
And i send myself as a reference to the boat
Let me try to just make the RPC call from the DefaultPlayerCharacter directly
so its the multicast that never happens?
@limber gyro No its the server RPC, the multicast happens when i interact as a listenserver
Is the replication graph still a think to reduce server load and network traffic, or is there something new / better meanwhile?
is it triggering at all?
because it might be triggering in the server and not in the clients
Nope, im trying to do the RPC directly from the playerCharacter now instead
i think i had some confusion wiht that before
it might be an issue with authority, who spawns the boat? the server?
Ive just placed it there in the editor, and ticked netload on client
I thought since its an actor it would be spawned on the server and replicated to clients if i tick replicated
should be the server then, the thing is, yo uget the owner and then get its authority which is the pawn which i am not sure who has authority in this case im gonna need to check
so it might not even go to the server function at all
Ok it works now
After I did the RPC explicitly from the PlayerCharacter on the Boat
Instead of calling Interact on the boat, and then trying to do the RPC from the boat with the player as a reference
should be a connection issue then
your ownership chain should be wrong somewhere
you need to set owner ship on the server and the client i think
like @woven basin said
I have a question about Fast Arrays : What if I do an Add on a first array and Removal on a second array operations on server within the same frame, are they going to be replicated at the same time, thus triggering PreReplicatedRemove on the first one and PostReplicatedAdd on the second one, in the same frame on the client ?
Hey everyone , got a question about multiplayer. Im trying to add a basic scoreboard but running into an issue where only one player is showing on the scoreboard. Ive tried everything i could think of and maybe im doing this incorrectly. Im very new to multiplayer but i have read thru the docs and the network compendium to get this far. Any help would be appreciated. the first image is in the widget, second is in the playerController. Is thhere something im missing? Im getting the player array from the gamestate. Am i missing an RPC or am i calling it from the wrong place? Any advice would be really appreciated. EDIT. The RefreshScoreboard Event was something i was trying to work on to only update the scoreboard for the player when it was actually opened each time.Its not being called currently
When you switch gamemodes, like for Lobby to Play to Lobby, does info collected on the LobbyGameMode stay so when you come back to the LobbyGameMode it's still there?
Like for example, in LobbyGameMode I have OnPostLogin that adds player controllers to an array "Players". Then I go to PlayGameMode. Then I go back to LobbyGameMode. Would the "Players" array still have the PCs
I want to replicate a chaos vehicle. By default, it adds stuttering to the client movement, however, some forums talk about disabling Replicate Physics to Autonomous Proxy, but thats create huge differences between the location of the client and the server.
What should I do?
Never said it wasn’t. But c++ has advantages which is what the convo was about
Assuming the scoreboard just reads replicated data then you shouldn't need any sort of networking here
just press button, create widget
I do see a bug though, refresh will just add MORE children
you need to clear children then readd
yea i do that . i get an array of all widgets and clear before running again. Currently this doesnt work and i cant figure out why. it only populates the board with the server while the array does contain all connected parties. If i run a print string in that loop it shows all connected but the board doesnt populate
Put a print string here, ensure the text is what you expect
If it is, then the problem is in your widget
test with feeding the widget just static text
it displays the text fine. i already placed a print string there and it prints both player names on screen but for some reason it fails to create the child widget for the client . it only does it for the server
I have a replicated variable that I set on the server side, but when a client connects the variable doesn’t update, and I’m not sure how to do it properly
It's probably because you're creating the widget at the wrong point in time, before the client has had a chance to receive all the players in the array.
why is the server even a thing here?
hey asking for a friend, i know nothing about UE5, quote: "i have ragdolls server side but the client only sees reference posed people rolling around, it seems to replicate the transform of the mesh and thats it, how do i replicate the physics and stuff?"
it should be LOCAL to whoever presses the button
the server player. the hosts Player
i get that and the player controller creates the widget thats the event graph for the scoreboard. that is creating the child actors with a name and getting score from the playerstate
well i have even tried not pushing the button for the widget until both games are connected and loaded and iget the names of both clients from the print string but not the child widgets to reflect that. i also take the child actors in an array and clear them and rebuild the list before displaying the widget again
What kind of panel are you adding the widgets to?
im adding them to a vertical box
🤔
i tried overriding the size to see if that was the issue but it still only displays one. in the designer when i add multiple it functions how it should too
someone else said it was possible i was only getting the client version of the playerstate from the game state but im not sure that makes sense. arent they both replicated ?
thats what i thought so i shouldnt need to get on the server first or anything i should just be able to get the player array and loop thru it . when i print string on the for each loop is does show both instances of my machine
yea i even tried again after someone else mentioned it and i got my machines name to print 2 times with a different number string at the end
How about ignoring the player array for the moment and try making a for loop that just adds several items, see what you get.
Hey, I want to take a deeper look into Savegame for my Prototype. Can someone give me tipps for savegame on multiplayer. (There are Playerstats and World Stats that I need to save)
SaveGames are stored locally and cannot be referenced across the network.
If you have data you want to save on the server side, then the server must have that data. Same with if you want to save data on the client side.
let me try that 1 min
Hmmm
Actually I want to Focus on Singleplayer but also want to include mp functions to be prepared. I actually didnt have a plan how exactly mp sessions will be
and if Two Friends want to start a game
if they need to always play with, if you understand what I mean
Not sure how that relates to saves.
the base game mechanic is a Harvest Moon / Stardew Valley like game
so the players have a farm (coop together)
Player 1 starts the game, Player 2 joins. The savegame of this game are localy on both right?
No. You'd probably have the save game stored on Player 1.
ah okay, so Player 1 has to host the game every time they want to play together
Yep
Yea i cant even get it to spawn multiple entries, no idea why. it prints string 4 times but doesnt add 4 child objects
Assuming the client has all the required data to also make a save game on their end that is identical to the hosts, then it can work like that.
Basically someone can join, save the game, and now the save exists two places.
Reconciling them though... oof
Yeah it would take some work to make it 100% seamless. But some games do this. There are recovery saves for games like age of empires or Stellaris
yeah I fokus on 1 save game, its also to make my tests a bit easier for me.... actually I have to to alot of things to test all stuff
I am very glad the save games for my project are very simple.
after that I will try to save game on client side to
Actually I save some Player stuff (inventory and so on) thats easy
Assuming the client has all the info needed, then it should be trivial, just use the exact same save function.
But if there are things that are not relevant to the client or are in game mode or game instance, the client will not have it access them.
@sinful tree I got it ! somehow i had marked the widget component as variable so it wouldnt add it. i appreciate your help that got me in the right direction.
actually i have same player related stuff on game instance, maybe I need to rethink some stuff for this
I also want to take a look on other games and how they handle this
the savegame stuff for placed actors will be hard, or I overthink this ^^
the actos also have items for example producing actors that have 1 ressource on it and are in production mode
It'll be easier than you think.
The difficult part is more figuring out your data structures.
Is there a writup on making a pretty automagic savegame system?
Not that I'm aware of :/
I've seen that there's a savegame decorator for UPROPERTY but I haven't seen it used in the wild
I'm very glad that the only things I have to save are user options and simple structs
just vehicle designs / blueprints. Way simpler than saving an entire world state.
I will do some Tests Hope IT will be easier than I actualy think
Hey y'all. I'm Making an AI based of GAS, and it works perfectly fine in Listen Server PIE, But Play as Client, Somehow stops all the movement querries. Is there anything in Particular I have to do to get it to work? The Abilities work fine, and the behavior tree executes, It's just the Move Querries on Both Default Behavior Tree Task and Pawn Class's Simple AI MoveTo. Also The AI Focus Node doesn't get Fired. I use different Movement Components for my Pawn Enemy Class, and Character Enemy Class. Just their Movement. Everything else works fine.
if PlayerController and GameMode is changed, when new level is loaded, where to store information of clients choices, like chosen character, etc?
seems like Player State is reset with new controller, and the only right place is Game Instance?
Server's gameinstance, a savegame on the server, or have client resend it from their own gameinstance or a savegame on client
so, when i create a "PlayerChar" variable in a GameInstance, and set it from the client, it'll store a data of every client independently, or just a one client?
and i need a variables like "1PlayerChar", "2PlayerChar", etc?
Right now, how and WHEN does a client tell the server what character they wish to play as?
why its important?
in a menu, players choose a characters
then game level loaded, game mode and player controllers changed
when game level loaded, chars, chosen in a menu level, need to be spawned
I'd just save a map of player ID to char class or something of the sort in the servers GameInstance for now
Oh man, who know this Situation. Before you wanna Go to bed you think OK If you Change this Part all Things will be better. After doing that, 10 new Problems Pop Up and you shutdown the Computer totally unhappy 🫣🥲🤣
You have source control right?
Yeah
And I also know what to do
But IT IS to late and my daughter will make Up me in about 5 hours
chug red bull, code all night
But its a bit Frustrating
Write it down in a TODO for your changeset so you know what to do tomorrow
Haha yeah I did IT Last Weeks, this Week I will Take some more sleep
Thats a good idea
Game Instance only exists on the one instance of the game, so each client has their own copy of a game instance, as does the server. It is not networked so you can't send RPCs through it, nor replicate any variables in it.
If you set your character in the Game Instance, you'd either have to have some way of storing that on the server to begin with and have some means of knowing which client has selected which character, or you'd have to allow clients to send the server their character selection via RPC.
where to store information about players chosen characters between menu level and game level then?
if GameInstance is not replicated, and GameMode and PlayerController with PlayerState is changed?
They player stores the load out locally. When they go to a new level, they tell the server hey heres my loud out
Server then validates and gives them the losdout
PlayerState
in which class it need to be stored?
looks like PlayerController can not be used for this, because client use another controller in a game level
and PlayerState is created by the PlayerController, so all data inside will be wiped out, as i understand it right
so, where to store then?
We don't use seamless travel so we can't use playerststr and copy properties
We have a local player subsystem
Which holds there chosen load put etc
wiped, when controller changed? or no?
On travel to New map we send server rpc with the load out and server sets this on playerstste which replicates to all players
No local player exists for a player
And persists till the player logout or w/e
It never gets destroyed during travel etc
You could just use gameinstance to store it
And have server rpc in player controller to set it
You can copy properties from old player state to the new one with seamless travel
But that's a way to do it, there is a tons, like the one Kaos said
In our game we hard travel
would it be wrong to store it in the game instance?
the player subsystem seems tidier if you need it I suppose
You need somewhere persistent
thanks!
We use player subsystem cause of consoles
Before we went to consoles gameinstance was fine
is that fix for local multiplayer?
What's wrong with GI on consoles ?
Xbox can have multiple users signed jn
And you can switch between them
We wanted to persist chosen losdout during this
Controller A can be diff user to controller B
So when the user playing the game with B controller we set them up with there data etc
This way they don't loose there load out and stuff
how to do it right?
can u provide me a good video or an article about it, pls?
But if your using seamless travel then copy properties can work
Oh yeah true, forgot about them
@frail barn https://wizardcell.com/unreal/persistent-data/#persisting-data-across-seamless-travel might be a start
By default and with nothing to do wtih seamless travel, Game Instance is the only thing that persists.
If you make a selection and want it to persist you must store it on the Game Instance. This can get complicated in multiplayer as the Game Instance only exist on the one instance of the game, so if your player is selecting the character when they're already connected to the server, the server can store it, but again, you need some means of determining which client to store it for (like through Unique Net ID)), or you have to store it on the client's Game Instance, and then when the client joins the server they need to RPC the selected character to the server.
localplayer persists
Localplayer is controlled by gameinstance
We don't store load out on server. Intact your not even connected to a server when you choose your load put
You are in a party session
You only connect to server when you found a game and whisked straight in
I'd recommend having a second object and have the game instance only have a reference to that object.
And have that object handle all the logic and variables and whatever you want to persist.
Just cuz it can same some headaches later if you want to move stuff around and stuff and also gives the possibility of not having that logic loaded at all times if it gets big enough or whatever; def doesn't hurt.
Yeah I suppose if you have the game instance as an outer of an object it too will persist, yea?
Or use localplayersubsystem...
Which also sounds like a much better idea 🙂
In principle or the implementation?
Implementation
When we used it we had nothing but issues
And most of our crashes were seamless.travel related
I had lots of disconnects when doing non-seamless, but I switched to seamless, and it's been rock solid
dedicated servers, not listen server
likely - custom AWS stuff
Why ?
There is a bug going on since a few months when travelling from main menu to match
Is rocket league still on ue3
Half of players can just don’t spawn and match is cancelled
Yes
considering it's only been happening since a few months it's likely something else; otherwise it'd have always had that issue
Wait rl not ue4?
Ot was made before ue4
It was in dev before ue4 released
There is rumours of it switching to UE5 but it may be a complete rewrite of the game I guess
It would have to be
Cause there was no upgrade path from ue3 to 4
Keep getting packet loss..
ikr
Hence ut was pretty much rewritten in ue4
Packet loss, level travel bugged, no new stuff…
Except new maps 🤓
Travel bug happens rarely bit a big deal
But past couple months packet loss every game
I hear something about ddos but not sure
Got it 3 times in a row yesterday 💪
Nah their servers are just trash
But idk it may be due to ue3, there’s no way they are under trash servers or bad infrastructure during all these years
I hope not
It was fine til couple months ago
Never had any lag or anything then one day went to crap
I have the game since it's release in 2015, I can tell you servers has always been an issue
just check their subreddit 😄
It's been perfect for me til then idk
Yeah I checked it. Recently people have been complaining with same issue
But probably people always complained too so idk
I mentioned ddos because that what people talking about recently on reddit
i think AWS is trash tbh
Call of Duty servers been suffering with packet loss
and they use AWS
for the past few months
Is that what rl uses?
what's good then? (and low price)
I think call of duty suffers because they can’t code 😂😂😂
For comparisons too AWS nothing
It’s never cheap 😂
the one from google seems cheap
Nah
It’s pretty comparable in price
I mean its cloud computing. its gonna cost money XD
hetzner
there's a free 300$
yeah but most do that
and its def worth it to play around with
Edgegap is the cheapest tbh
be fr 😆 you think they arent re using a well refined engine with proper in place net code ahahah
Not sure what the excuse is then xD
they have some laughable bad mistakes at time hehe
They're cheap an just have shitty tick rates
in all fairness its still very well done, its just funny when stuff like menus freeze....T-Poses happen, and of course out of nowhere bam packet loss XD
but no game is perfect as the saying goes
iirc RL uses google clouds
Or getting shadow banned and put into cheaters lobby, or sbmm 🥰
Future of gaming dw
Shadow banned 100% sbmm is complained about more than it should be 😂
I don’t think so
I’m a just a basic player with a « good » aim, I play 2 times every 5 months, each time I launch this game the first match is good I do a few kills and then sbmm put e into sweats lobby cod league with 109209239$ cash prize
That’s how I got disgusted of the ip
Not when you’re someone who don’t play all day 24/24
And just want to chill one night in a month
But see its placing you against harder opponents, I can agree its frustrating to be matched with someone way above your skill level
But that’s my opinion.
but your essentialyl asking to be placed in lobbies where your destroying people
which wouldnt be fair to the people your going against lol
That’s what ranked is
No, mixed
Like it has always been
Xdefiant does it well
and to be clear im not saying the matching system in COD is perfect
Xdefiant is using a platform matchmaking and then ping priority
Which should be(was?) the norm in fps
Pc Xbox ps5
thats beyond dumb?
It works tho, do better
I mean are they jsut saying its more fair for platforms to go against their own platform?
not sure I agree with that, controllers get aim assist
Which is kinda logic ?
It really isnt though
different platsforms have different advantages and disadvantages
I mean in COD I guess I could see it as controller is generally better
so if they seperated it by platform PC players would "have it easier"
but tbh in my time playing cod i havent gotten killed and been like "damn I lost cause that guy had a controller and I dont"
its more often than not a mistake I made
idk its def not perfect not saying it is
but lot of the times it seems more like whining 🤣
Isn't there usually a checkbox to turn that off if one doesn't want to be matched against other platforms?
I don't think it matters for the majority of gamers. The top % are probably annoyed if they lose cause the Gamepad had aim assist. But at the same time they might whine and aren't able to perform at the same level if given the Gamepad. Idk.
Matchmaking always kinda sucked. LoL had like 8 divisions or so to hide the fact that the algorithm sucks.
damn i just finished watched AOC solution on their mmo game server backend and just saw they actually managed to make the repgraph multithreaded
(well unral server multithreaded basically) which i didnt know before they are only single threaded and not multithreaded
We are excited to give you an in-depth preview of our server meshing technology in Ashes of Creation!
Reminder that Ashes of Creation is an open and transparent development project. As such, you will see work-in-progress art, systems, and mechanics. Leave us your thoughts on our progress in the video comments!
💬 If you have any feedback on wh...
this whole presentation theyre doing is just plain impressive to me
i love their network engineer like "but we did it anyways.."
what a chad dev
There is indeed. You can turn off cross platform.
I am making a skill that we can steal the skin of the other player, but currently only the server can get the skin of the other player. the client cannot access the mesh of the other player.
as client, you need to use Server RPC to set the replicated variable as replication only happend from Server to Client
if this function run on client, the variable that is marked in the picture below, is only set in the client
oh I just realized it but I have diffrent problem. I get ''none'' message when I connect print to skeletal mesh asset
if your seeing this in listen server, its normal
I am using Is Locally Controlled to prevent the character from hearing the hit sound, and the code seems to work, but other players still cannot hear the sound in the game
Is the component it's attaching to replicated? Maybe the sound on clients is spawning attached to 0 0 0
yes, i tried spawn sound 2d still same
I'm spoiled by GAS I'm sorry I just use GameplayCue and it's replicated for me. The one time the location wasn't coming in properly, I put a scene component on the end of my rifle and replicated that scene component, call PlaySoundAtLocation and use the replicated scene component's world location for the sound. Maybe
Have you tried simply printing or breakpointing to see if the the code does what you think it does?
There is on Xdefiant yeah
On CoD it’s only on PlayStation (so on other platforms you are forced to have cross play enabled)
This will maybe change this year since the PS exclusivity deal ends (I guess ?)
I guess cause they think they only need to protect Gamepad Players from M/KB
Maybe. Strange either way.
Yes annnnd no, this is just a PS exclusive option
Xbox are forced to play with M/KB
But anyway I’m not a fan of their new matchmaking system, XDefiant is doing the same as the old cod mm system and it’s working well, it’s fun, you’re playing mixed games with people good and bad, that’s cool.
it looks like ok but i can't hear the sound, when i use it like in the second image, i can hear the sound but own character also hears it, I don't get the desired result
Please put PrintStrings into your code and see what calls for whom
Only server with locally controlled
And the IsNotValid pin?
Yes like the first image
printing like this for all characters
You aren't answering my question
if you mean character variable yes it does
I mean your code is pretty straight forward. Whatever CharacterRef is (it's not replicated and I don't know where it's being set), if it's not LocallyController, which it will onyl be for the owning client of that character, it will play the sound.
The only thing that could really be at fault here is the CharacterRef variable
Is it possible to implement it in another way besides using locally controlled?
Maybe, but that's usually how it's done
got it thank you for your time
If you put a PrintString right after the Multicast, does it print for everyone? So even before the Getter
yes it does
And right after the Getter too?
These 4 places would need a print. First two should print for both. Right two should print only for one of them each, depending on who is the CharRef.
if that all works, then you should possibly test on 2 different PCs maybe.
its printing only server after 2. stop
cause it can totally be that the other player, if they are in the background, aren't audible
i mean after getter
Right, then the Variable is invalid for the Client
Then you gotta fix that
Where is that variable being set?
And that's called on the Server I assume?
yes
Yeah then this doesn't work
You could change CharRef to be replicated, but the chance that it doesn't replicate when your Multicast hits is there.
So I would advice passing the Character with the Multicast
its working when i make char ref to replicated. I actually use third-person rifle and first-person rifle separately, and the rifle we're talking about here is for third-person, so it was only running on the server. But now I need to make some adjustments for client-side prediction
thank you so much again
Just be aware that the CharRef being replicate might not replicate before the Multicast hits if done in teh same frame
this also working without replicate char ref so do you recommend this one
So I'm setting up persistent data between levels with multiplayer. Like for example, going from the player lobby, to game, back to lobby.
- When a new player connects, they're added to a ConnectedPlayers on the GameInstance, just their pawn (I'm only using one pawn for this game, C_Lobby, i can just make child pawns anyways)
- Each C_Lobby has a PlayerInfo data structure which a variable storing the current player controller's net id
- When going back to lobby gamemode, on "handle new player", I read the connected players on the game instance
- To ensure the player controller is connected back to their originally owned pawn, I check the net id the pawn stored from its previous owner with the player controller on handle new player's net id
- If they're equal, then the player controller possess that pawn
how does that flow sound
Actually, how does storing a pawn reference on the game instance work?
id still need to spawn in the pawn right
question on just opinions one way or the other regarding dormancy vs a replication managing actor. for example ill be having several hundred windows/doors/drawers/etc (they all use the same component to drive them) that are interactable and i want to replicate. im contemplating going the dormancy route which would be woken up when the actor is interacted with and put back to sleep once its completed what it needs to do, or having a dedicated actor with a replicated array of this data alongside the fast array serializer to trigger off for clients which door was interacted with. im starting to write up the dedicated actor route that manages replicating the information now but im curious as to what some peoples opinions are for one way or the other and reasons for their opinions and such just to gain some insight/learn from. looking forwards into Iris, this line "A hope for Iris is that the shift to a fully push-based replication system would make dormancy unnecessary, as only dirty objects will be considered for replication" has me questioning if either of these optimizations would be beneficial given that it sounds like the component/actor wouldnt be polled at all to replicate unless i marked the property used to replicate the doors as dirty?
Is there a trick to debugging Steam integration? From what I can tell, you need to run the game in standalone for Steam to activate and generate auth tokens.
I don't see a way to breakpoint or read logs when running in standalone.
I am finding that I need to breakpoint via "print strings" and it's a massive pain in the ass. Is there a better method?
Attach a debugger post launch.
Honestly am I missing something? For some reason the 'OnRep_IsProne' is never being called.
Header
/** Set by character movement to specify that this Character is currently prone. */
UPROPERTY(BlueprintReadOnly, ReplicatedUsing=OnRep_IsProne, Category=Character)
uint32 bIsProne:1;
/** Handle Proning replicated from server */
UFUNCTION()
void OnRep_IsProne();
For context ive essentially copied the Crouch code from the CMC to add a Prone state. Which works just for whatever reason OnRep_IsProne is never called stopping the Prone from being replicated
this is in a custom CMC built on top of the standard UE CMC
How do I attach a debugger to a standalone process?
That's much better but I'm pretty sure what he is saying if you don't pass the actor ref in the rpc, you are playing with a rat race.
If the multicast rpc called before the variable gets replicated then your function break as it will not access the intended character red.
It might "work" when you test but you just got lucky.
CMC is not replicated. If you check the Crouch code you mentioned, you'll see that it sets state in the Character and the Character replicates it.
Hi all,
I am wanting to build some lag-free custom multiplayer character movement in blueprints, but can't do it with a server authority without introducing network lag.
I have found this pack on marketplace: https://www.unrealengine.com/marketplace/en-US/product/general-movement-component but it has a lot of features that aren't required for our project and feels a bit like overkill.
But then again, maybe it isn't overkill. "Implementing lag-free, server-authoritative multiplayer movement is a notoriously difficult task and very hard to get right - the GMC will help you immensely with this by automating almost all of the complex setup required for you."
Are there any other plugins or solutions to this problem? Our team has a lot of blueprint only devs and would much prefer to design our movement abilities in blueprints. They aren't complicated -- they just need to be lag-free.
Thanks!
That's the setup I have, but for whatever reason OnRep ain't being called
Imma take a look again tomorrow with a fresh mind incase I'm missing something very obvious
You've set it in the GetLifetimeReplicatedProps for the character?
Yeah
You've set it on the server? And the character is relevant to a client somewhere?
The CMC sets it on the Character as in when Prone() gets called in that function it sets bIsProne on the character which OnRepIsProne is linked to. But OnRep never gets called
I'll slap some more debug in tomorrow just so I can see the full journey of the code in the logs. But I'm gunna be missing something blatantly obvious I just know it haha
But I know it all seems to work at least in standalone but just not being replicated cause of above issue
I would first make sure you're setting it on the server.
- Actor is replicated
- Property is marked replicated using with a UFUNCTION marked function specified
- Property is macroed in GetLifetimeReplicatedProps
- Actor is relevant to the client
- Property is changed on the server and is different than what the client has when it arrives(or you macro it with always broadcast
OnReps don't run on server
Yeah my only theory is that it's being set on the client and not on server causing OnRep not to be called. So need to do some backtracking. But I have it setup like how Crouch is in the normal CMC so either I've missed something or their do something funky with the Crouch code "behind the scenes" since it's apart of the EngineAPI
But it's most likely me missing something
Client can only know their own controller
playerstates would fit better as those are replicated
since there isn't a metric for what is good and bad here I don't really know what you want me to say
it makes more sense to me to have each playerstate point to which team they are on
more accurately a single place that maps playerstates to teams and vice versa
this could be in the gamestate
I have GMCv2 and its excellent.
An alternative is "smooth sync" on the marketplace - which I think works more with client auth - but not 100% sure
Ultimate FPS Template Plugin: https://www.unrealengine.com/marketplace/en-US/product/ultimate-multiplayer-first-person-shooter-template?sessionInvalidated=true
Patreon: https://www.patreon.com/SneakyKittyGaming
Discord: https://discord.gg/W5g6pZXfjh
In this video I cover the basics of debugging a failing packaged project.
I think there is a written blog/tutorial about it somewhere - maybe pinned in c++ channel - I know I've read it - but cant find it at the moment
if you have Rider - I know you can launch the "game" (rather than "editor") a attach a debugger that way - I've done it with Steam debugging before - but been a while
Yeah I've used smooth sync but yes it is client auth
How does servers like e.g. miencraft keep track on what should be destroyed? Lets imagine situation, where you have several block like redstone, sand and signs connected to each other. To make game feel smooth, client needs to simulate everything, and then ask server for confirment on block placement/removal. Now, if I destroy the construction of sands, redstone and signs a lot of block destruction needs to be simulated on both client and server. But what in case if there is a lag and server and client got desynchronized and client simulate all this destruction, and server doesn't? How would client know? And how should it handle it? It can't just undo all of this simulation(I mean, it can, but that's a lot of work, and state keeping)
Thanks
Thats exactly what you would do. You would roll back the state of the Client if it miss predicted.
You also might want to choose to not allow Clients to predict downstream destruction events like that.
And instead wait for the Server to tell the Client that event occurred.
The Client can predict the initial Block destruction.
But if that results in another Block or Entity being destroyed, that event would need to come from the Server in order to be triggerred.
There are tradeoffs to both approaches. Like anything, its all about tradeoffs.
One option is the "effect" of the block been destroyed occurs client side - like a particle effect, sound, fade animation etc. But the actual removal of the block is done server side.
This will make the deletion of the block feel instant to most users.
Pretty sure Minecraft has the client predict the destruction, the server reverts it if it doesn't agree
Just wondering has anyone else has issues with 5.4 having problems with finding CoreNetTypes include??? I seen one post about it here someone has a problem in 5.3.. (the include is correct)
I'm getting a litle more confused by trying to delve deeper into online sessions. There are online services now. If I want to use EOS (or EOS+ more specifically for crossplay), do I need to use services interface instead of sessions?
If I am a player controller on the client and send an RPC to the (listen) server version of myself, what is returned when on the server I used "Reference to self"? Do I get the server proxy version of myself, or do I get a correct reference to the player controller on the client?
wut
Yea my bad. If I use "Reference to self" in bp, what does it return on the server? And is that different from what would be returned on the client?
Client only knows it's own controller
there is only one instance of an actor on each server and client
Okay, so would the server return a reference to the controller that the client knows about? Or would the server return a reference to the proxy player controller that exists on the server?
I'm not sure where you got this proxy invention from
The tl;dr is that the server and client has a way of addressing the same actor
But each client and server has its own instance, it's not like Unreal has some special way of sharing memory over the network or anything
Right gotcha, that clears things up for me.
What I don't understand then though is that any actor we replicate that exists on the server, also exists on the client. The actors on the client are copies of the ones on the server right?
Thanks for the graphic. That clears it up even more
In a fundamental sense, "self" on server and "self" on client for a replicated object can be considered to be different objects because they are on different machines. But in Unreal terms, they are the same object. The references or pointers would be considered identical.
It's effectively 1 object in 2 places.
Just like if you and I had a synced folder with a photo file in it
Right, this was the confirmation I was looking for. Super glad to hear that Unreal has this covered in terms of managing the reference to these 2 virtually separate objects
It's a bit hard to get your head around but once you get used to thinking "Am I the server version, owning client version, other client version, or all 3 of them right now?"
Certain events only happen in certain contexts, so tracing from the event, through any gating by context, and you can narrow down where this code would run.
Yea that is also where my confusion came from. I was thinking that in any one of those scenarios, I was a copy, yet separate version of the actor I was working with. I wasn't sure if referencing the server version, would be a reference to the same actor running on the client
Even using the word server is kinda wrong here, the question is more like "Do I have authority, ownership, both, or neither?"
Correctly architected, the same code should work fine in standalone, listen server, dedicated server, owning client, and other client contexts.
That is really cool to realise.
Is it possible to join an online session with an id or name without doing a search and needing a sesionsearchresult struct? Or would I need to set a custom parameter that would make that session unique, search for that custom parameter and join to the first and only (hopefully) search result?
Most online services also allow invites
So you could make your game send a special invite and have the other client automatically accept it
@upbeat basin
Obviously make sure the other client is expecting that invite before automatically accepting, otherwise cheaters could harass other players by sending those invites themselves
Otherwise, searching is your only option
if i wanted to let the players be able to make a custom map and invite players in it, would the owner sending the invite be a server or a client?
and how would i go about sending the custom map information?
Depends on if you are using dedicated servers or not, what online subsystem you are using etc.
I have a character that starts with the AutonomousProxy role. When I trigger an ability on this character by user input, it behaves as expected. However, if I call a client RPC on the same character during the RPC call, its role unexpectedly changes to SimulatedProxy. I can't locate where this role change is happening within the RPC code.
I use the fire event in this way, when I simulate lag, the number of shots fired changes depending on the severity of the lag. Normally, when the lag is 0, it fires 30 shots if there are 30 in the magazine, but as the lag severity increases, the number of shots fired in a single magazine increases to 33-36-38 etc .How can i fix this?
Still trying to figure this out. I am using TearOff(). I was thinking I could override the function TornOff() on the server to destroy the actor once it gets confirmation that replication has ended, but this function never fires.
Any ideas? If there is some function I can override for when replication ends on the server, that'd probably be the solution
Basically I'm trying to be sure replication is over on the server before I delete the actor, and leave the client's version of the actor intact locally
My understanding is that when I call TearOff(), the changes don't necessarily take effect immediately. So I'm looking for a way to only destroy the actor immediately when I know that it is no longer replicated. (Thus ensuring the client does not also delete it's representation of the actor)
what type of actor is it? could the server destroy it, and the client receives the OnRep or Destroy, and during that, copies the actor, and spawns a local one in its place
I suppose so if that's the only way. I thought of that, but the issue is that it's a Terrain Chunk actor, and I would likely have to regenerate the mesh on the client if I use this method.
Unless there is a way for the client to pass the components of the actor along to the new local actor while leaving them intact
But that's still a bit more messy than I'd prefer
Really all I need though is a way to know on the server when it's safe to delete the actor locally. I've got the unlinking part working fine from what I can tell.
Still looking for a good solution on this.
does any 1 know if its nescessary to ping steam servers to get their ID for connection? or is that information somewhere already when the server starts?
can u please add a little detail to this?
GameMode exist at the server only, so multicast event can not be used at this class
GameState and PlayerState is replicated from the server to every client, so multicast event can be used
but PlayerController is replicated to the clients independently, every one has his own
so, can multicast event be used in the PlayerController, or not?
or in a PlayerController we need to use Exequte on owning Client event?
You can call a multicast on the player controller but it would only execute on the server and the owning client of that player controller, no other clients would receive the multicast.
"Run on Owning Client" will do exactly that - run only on the owning client - the client that the player controller is owned by which will only be that single client. In other words, there is no means to communicate on an actor that doesn't exist on other clients. Since the Game Mode doesn't exist on clients, calling a multicast on it means that no clients receive the message. Since the Player Controller exists only on a single client and the server, calling a multicast on it will execute only on the server and that one client.
thank you, it is clear now
i'm glad i got it right
Hey guys, trying to get a server up and running, but I have this error, where I'm having a problem with a premade asset registry when I'm trying to run a built development server: [2024.07.02-23.20.21:277][ 0]LogAssetRegistry: Error: Failed to load premade asset registry. LoadResult == 1.
[2024.07.02-23.20.21:277][ 0]LogStreaming: Display: FlushAsyncLoading(1): 1 QueuedPackages, 0 AsyncPackages
[2024.07.02-23.20.21:277][ 0]LogPackageLocalizationCache: Processed 44 localized package path(s) for 1 prioritized culture(s) in 0.000117 seconds
[2024.07.02-23.20.32:141][ 0]Message dialog closed, result: Ok, title: Serialization Error : Action Needed, text: Corrupt data found, please verify your installation.
[2024.07.02-23.20.32:150][ 0]LogWindows: Error: appError called: Assertion failed: CurrentPos + Count <= TotalSizeOrMaxInt64IfNotReady() [File:C:\Program Files\Epic Games\UE_5.3_Source\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 8478]
Seeked past end of file /Engine/EngineResources/DefaultTexture (33930 / 33926)
The build worked fine, a couple of warnings but no errors, and now this shows up. I have been able to cobble together a solution for the second error, but if anyone knows an actual fix for that, that would be great. A bit more info, this is using the 5.3.2 source build of unreal, and I have changed some of the files in the engine folder because of a problem I was having (I have done this: https://forums.unrealengine.com/t/error-compiling-the-automation-tool-after-updating-visual-studio-today-unreal-5-3-2/1393088/17). Any help would be incredibly appreciated, and if you know anything/need more info, ping me!
if i wanted to add bot opponent to my game, is there a way to get unreal to spawn an artificial playerstate object for the bot so that i can just add the bot's decision making logic in there without having to change the multiplayer logic for the rest of the game?
What do you mean decision making logic?
AI typically make use of a Behavior Tree for that.
alright i will make use of that. but still for each player i have a playerstate object and the ai has to set values in there when it makes a decision. Is it possible to spawn a playerstate for the ai even though there will be one real player?
Yes its possible.
great! I found out there is an option i can check in the ai controller 'wants player state' 👍
if i spawn a replicated actor, then pass the ptr through a multicast, is there a ptoential race condition there ?
Yes
The multicast will likely be called on the Client before the Actor has been spawned on the Client.
If I have one bool property in my struct and then in my NetSerialize a few local bool variables (to check some stuff) could I pack all of them with flags ?
Something like this
gad damn
?
You are already serializing a local
Flags is a local
Yup, I'm just wondering if it's good to do this
I appear to have stumbled upon the answer!
Overriding this allows me to inform the server that actor deletion on client is taken care of (which my system handles separately). Exactly what I was looking for!
Somebody yell at me if this is stupid
It's amazing how many functions Unreal provides that you can use, and they're just hiding in the classes waiting for someone to find them.
whats a pretty good way of identifying a client or server output for logging?
I personally use UE_LOG(LogTemp, Display, TEXT("Running on %s"), GetNetMode() == ENetMode::NM_Client ? TEXT("Client") : TEXT("Server"));
Okay thanks. Just to be sure, actors hard ptrs does not need to be serialized in NetSerialize ? iirc replicated actors just sent an ID across the network
If you override NetSerialize, you need to manually pack everything you want to be replicated.
Implementing NetSerialize you are saying that you are manually handling serialization for the entire type
Okay wasn't sure, how to serialize actors hard pointers tho ? Searched on google and saw nothing
Also searched in a few engine structs but none of them are using ptrs
Ar << MyActorPtr;
That's what I was doing, got errors
thanks, wasnt aware of netmode. Appreciate it
I checked it all the night and missed that part lol, mb.
AActor* HitActor = nullptr;
Ar << HitActor;
Thanks for the help, it seems to work.
I'm looking to replicate some variables to my ABP from a character component. I'm getting some issues when I actually go to apply the values to my ABP.
Currently, I just set the reference to the ABP in blueprints sometimes after Begin Play, just as a quick and hacky way to get things working.
This is fine when playing solo - whether standalone, listen server host, or client - it seems to work just fine.
As soon as I get into multiplayer however, it appears that I get an 'access violation'.
My guess is that it has something to do with the fact that I am not replicating the ABP variable in my component, however I feel like I shouldn't have to as that should be automatically set for all characters in the level naturally. Do I have some fundamental misunderstanding as to how this works, or does somebody have any idea of what might be going on?
the simple thing here is to just get the anim instance every time I think
caching it requires you to listen for when a new anim instance appears
hmm true, I guess it doesn't cost anything to do so really, and it's not happening every frame
Still, I wonder why this isn't working, it doesn't make sense to me that the character would exist but not actually go through its begin play operations
Huhhhh if I put a longer delay, it works from client->server, but not server->client for some reason
I really thought that if you have logic that runs on a character without need for user input, it should run on characters of that class no matter what machine its on, kind of like how an ABP just functions based off of data without needing to replicate specific things
This makes no sense to me, hmm
beginplay can be delayed until network init
it is not exactly when the object was created
please do not use a random timed delay here
how is it replicated? servers don't onrep on authority except for bp onreps
this ABP variable is not replicated at all, I figured it didn't need to be. When I replicate the values that drive the ABP, I simply am trying to reference it and set the values from the component
So, does this mean things on begin play are not gauranteed to happen for all players on a game??
yeah, of course but how is the replicated data replicated?
it makes perfect sense to drive the abp from replicated data on the pawn
Oh, through a repnotify / RPC (for client prediction purposes). I guess I'm not certain that the replication works
no, more so that it gets delayed until the initial network state shows up from how I read it
I do make it through to my onreps and such just fine however
its just inside the OnRep, where i say 'now update the ABP', it crashes
Right, so to stop the crashing I added a if(MyAbp) statement so now itll not crash, but my point still stands I suppose
I need to learn how to properly set variables like this that should be in synch just from things like begin play and such
Even if it's not the proper implementation (I do agree it makes more sense to just get the reference every time like you say - I use anim layers and those can change, so this makes more sense), but I still would like to know why this isn't working and what I should be doing differently
generally the anim instance just reads the variables upon ticking
and if they are different, oh well
the replicated variable can change whenever
is it not more expensive to get those variables every frame?
yes but you have to tick the anim instance anyways? how are you avoiding ticking here?
I'm not avoiding ticking, I just am not sure how performance works - I figured accessing a ton of variables would still be costly to some degree, is that not the case?
Getting variables isn't bad, you're just reading memory. Calculating values that goes into variables on tick could be bad depending on the complexity of the operations needed to determine the value.
Hmm I see. All the variables that are being replicated are changing on events, and these events definitely won't be happening every frame.
Still, it is surprising to me that I cannot find a way to initialize a value on this Actor Component from somewhere else without needing to replicate it
how would i have two players possess something? im working on multicrew tanks
You dont
You would likely separate the tank into individual pawns
One that makes up the turret
another that makes up the body
They of course would be attached to each other
But the body would only perform vehicular movement
I prefer this one:
UE_LOGFMT(LogTemp, Info, "Session updated with Game Instance settings! {0}", *GetDebugStringForWorld(GetWorld()))
Which gives you ListenServer, DedicatedServer, Client1, Client3 etc
Which means I can do stuff like this:
UE_LOGFMT(LogTemp, Info, "{0} - OnHit registered", *GetDebugStringForWorld(GetWorld()))
And then in my logs see:
Client1 - OnHit Registered
Client2 - OnHit Registered
ListenServer - OnHit Registered
The turret would perform rotational movement and firing etc
makes sense
Ahh! Handy! I had a feeling there was more advanced stuff like this I was unaware of. Always more to learn!
I have a physics-driven space sim (non-multiplayer example linked), and I am trying to network it. I have tried using resimulation, but even with fairly low simulated latency, the simulations diverge. From my understanding, isn't the resimulation supposed to hard-snap things once they get too far? https://www.youtube.com/watch?v=MKpTG-ikjx0
Displays a circle target indicating which direction the ship nose should be pointed with the current thrust so that you'll rendezvous. This lets you focus on the target ahead of you instead of relying on head tracking to see your target.
Also, would it be a bad idea to have a semi-client authoritative model where server is willing to accept the client's simulation as long as it is within a margin of error, but will force a correction if the pawns transform strays too far?
Thats pretty much the only reasonable way of handling Physics movement.
Is there a client-side method for checking if replication is still enabled for an AActor?
I'm using TearOff() on the server but am not receiving the TornOff() function on the client for some reason.
Either a client-side function that fires when replication ends, or way to check from the client if it is still replicating at any given moment would work.
Maybe just do a Client_RPC that you are about to tear off, and the client knows that actor is now its own.
What might be interesting - if you do a check post TearOff - what's the ownership of the actor on the client - does it know it is now in charge of that actor locally, or does it still think it is server owned?
Not sure on the second one. Lemme check
HasAuthority does appear to update pretty soon after TearOff(), however it's hit or miss at the point my function is called
I supposed I just need to figure out why TornOff doesn't fire 🤔
Are you sure you're only tearing it off server-side?
Is using a thirdparty matchmaker, creating a session and listen server by the host (decided by matchmaker), setting a custom parameter as match ID (again, provided by matchmaker) to the session settings and searching for sessions that match to the custom parameter (matchID) from other clients an acceptable concept for achieving this?
Yeah, just checked.
Unfortunately I've got to hop off for the night (it's quite late here haha) but I'll be back at it again in another 8 hours or so.
Hey y'all! Currently making something that is like Among Us for personal purposes, using EOS Integration Kit. So right now, I'm struggling with getting the finished task amount by each player. Each player has an integer variable, and then I have tried a few ways to print the amount of tasks finished by all players. Using Level Blueprint, Game State, and an actor that acts like a Task Manager. Every variable is replicated, and increased in server and multicast events. Yet, nothing.
How can I make it so both players' task finished amount are added together, so then again, both players can find the total task finished amount?
What class actually holds the integer?
Each player (basically the player class) has a integer which says their tasks finished. Task Manger holds another integer, that adds all the players' tasks finished to a total, which then should be possible to access by all players.
Which class? There is no player class, at least not what you're talking about. Is it in the player state? Player controller? Pawn?
Sorry, didn't know what you meant. The pawn (BP_ThirdPersonCharacter)
For fun, I've been trying to convert my solo player game so that it would work with multiplayer too. I've managed to replicate some stuff into my game. Individual actors have been a breeze to replicate with using "has authority" and doing events for server and multicast and all that jazz but when it comes to my Character and AnimBP I'm having issues. I set up the logic for my character to crouch and it's custom (as in, not using the crouch that comes with the movement component). The AnimBP is checking the character if it is crouching and then sets its own "IsCrouching"-bool which in turn plays the proper animation inside the AnimBP (not a montage). What happens is that when I crouch, all players crouch! And it's only the animation side of the crouching that is being mirrored for each player. The crouching also reduces the size of a capsule component but that works just fine and is not being mirrored. Where could the issue be?
So...
- Character presses crouch and "Is Crouching"-bool is set on character side.
- AnimBP notices that the Character is crouching and sets its own "IsCrouching"-bool on AnimBP side.
- All players in the game play crouching animation instead of just the actual character.
- There's no casting happening anywhere. The "IsCrouching"-bool is sent via Blueprint Interface.
The base start of the crouching looks like this. Nothing weird there I guess?
How do you check on the ABP that if the owning character is crouching?
I'm trying to join a listen server using the connection string retrieved from IOnlineSessionPtr::GetResolvedConnectString(). The session creation, find and join are working fine. I can see the connection string is also valid and related to my steam ID (using OSS Steam). Initial Connect Diagnostics: Sent '10' packets in last '10.002317' seconds, no packets received yet. repeats 6 times and when 1 minute is up the connection timeouts
Few extra info:
- Testing on 2 different pc with 2 different steam accounts on standalone mode
- If I only change the oss to Null by keeping everything same, it works fine
- Using open command to host and join (
open GameMap?listenandopen [LocalAddress]:7777) works fine as well
I'm not sure what is the problem or how I can debug this, any pointers would be appreciated
Ok so when a pawn completes a task, it can tell GameState or GameMode which can add up all players pawns score and store it in GameState as a replicated int.
Yeah thanks. I think the issue was that I was getting player character instead of owning actor with Anim Instance as the target. I suppose getting player character is mostly a "no-no" when it comes to Multiplayer Logic?
Yup. It's working now. Thank you for that small question. It was all I needed. 🙂
Yup, when you're developing things for multiplayer, logic should depend on the owning/related actors, instead of using get character/controller functions
There already is a TArray<APlayerState> PlayerArray variable, filled with the player states of the currently connected players, inside GameState. Players are being added to and removed from there as they connect and disconnect. And you can reach GameState from GameMode
Hey guys, any chance someone can point me in the right direction? I'm playing around with the VR template character and its out of the box GrabComponent, and I'm trying to get replication working for actor grabbing. Issue is I'm guessing the client doesn't have access to the Server ran event 'Server_TryGrab'. Does anyone have an idea how I can replicate actor grabbing for server and client characters?
Ay is copy properties called on clients or only on server?
This gets called on the server. No TornOff on client though...
Edit: I'm apparently unable to even get an RPC through, so I guess there's my issue. Must've set up the replication improperly. I've got a bit of an unusual setup so I'm sure I did something wrong
I notice that when I emulate bad network conditions on a listen server, everything is a little jittery on the host - however, everything is smooth on the clients. What's that all about? 🤔
for reference, I'm talking about a procedural animation that doesn't have any changing values, it's like the in between steps aren't smoothing like they ought to be
if only there was an easier way of representing code than a low res screenshot
Ohh. My bad
whyu are you doing so much
FlushDormance, Flush this, flush that, force this
then TearOff
Welp, I think it's irrelevant anyway.
Only to be absolutely sure none of those were the reason TornOff doesn't get fired on the client. It was a test case
also that if condition is stupid 😛
ChatGPT may or may not have had a hand in it 😁
:/
I'm not getting any RPCs to get through to the client though, so I think I'm setting up my replication wrong
well is the chunk spawned server only?
I'm spawning my Terrain chunks locally on client and server, and then renaming them to the same thing and enabling replication when they need to link up (Only when close by and they need collision). I thought that system was working perfectly. (It seems to solve the issues of the server being confused by what actor the client is standing on) but since this is not working, now I'm not sure
no no no
dont ever do no renaming
spawn them with the correct name
it should be determenstic
Well it is deterministic
for example in our game, we use the seed
then the client spawns the exact same actors as servers
But I don't always have a chunk on the server until it is very close to the client
but it doesnt matte
matter*
server when it needs to make those chunks, should be determenstic
with the seed
I guess I see your point
But the reason I rename the chunks is because if I delete them and need them again, I thought they needed a new name?
So how do I avoid naming conflicts without renaming?
if they are deleted then they will be gone when the GC runs
so its fine to reuse names once you can, but again this is the flaw with the whole unique name thing
but you should NEVER have chunks on client that server doesnt have
server tells the client hey spawn chunk, heres some meta chunk data so you can make that chunk copy
This is news to me
I guess I assumed it was fine for the client to have local chunks just for visualization
ofc mincraft, is a bit different, it was designed from scratch to handle that
with Unreal Engine, your fighting the engine design a lot
not even sure minecraft works like that?
Seems like it'd kinda suck to have to have everything on the server. I've got pretty extreme render distances
iirc chnks are always on server if client can see those chunks
Ok so to reiterate, you're saying that anytime a client needs a chunk, the server should spawn it first, and they should be linked up throughout the entire client side lifetime?
It'd really suck to have to rework this that way lol
cause of ue limitations thats the easiest
I felt so close
ofc there are other ways
So my current approach is this:
- Client spawns chunks locally anywhere it needs:
- Server spawns only chunks that are needed for collision (a much closer radius), enabling replication for them
- Server has a deterministic name based on location, but adds to that a counter for every chunk location, so we avoid naming conflicts from deleted chunks
- Server sends counts to client every time the client moves into a new chunk, and client combines the counts with the deterministic name by location to get the same name as server, thus linking the chunks
- Client hides any chunks that it wants to delete if the server still contains them
- Client does not delete any chunks that have been linked with the server, until the server deletes them, thus ensuring we don't delete and then spawn a chunk that would have the same name
I was under the impression this was working swimmingly, despite being a bit bloated.
I'm currently on the last step, trying to mark chunks safe for deletion if the server stops replicating them.
I had thought about having the server just spawn collision chunks with NetLoadOnClient, which would make things simpler, but then I was afraid I'd have to regenerate chunk meshes on the client. Maybe that'd be worth it IDK.
I suppose I could try to move the mesh component from one actor to another, but that feels weird.
Also I am stubbornly wanting to cling to my "client side local chunks outside the collision radius" 😅
If anyone has advice I will gladly take it. Been stumbling around in the dark on this one hahaha
that's not necessarily true, you can have them, you just can't edit them
Sure
My approach replicates chunks long before they are in range to be edited
But either system is not easy
And why do the chunks need to replicate is a concern
We never replicated them
We had a system to maintain the chunks which exist or not
See for the longest time I never had them replicating
Using the chunks and ids of blocks in the chunks etc
Yeah the chunk actors
yeah don't need to do that at all
na, just use the chunk coordinate as a key
so yeah that's exactly what I do
and write over the data on it
But I thought I needed to replicate them to stop getting these weird errors where the server didn't know what actor the chunk was standing on
It was just little things like some clients saw others as falling when they weren't
No, they just need to be stably named (so when you create them you give them the same name serverside and clientside)
Boy I'd love to avoid replicating the chunk actors if possible
that sounds like a collision issue
fyi this happens in minecraft too
So like difference on server and client? Can't see how that could be, but maybe
it's only a problem if they fall on the server
on clients you don't care, it will get corrected
but you should be locking the entire chunk from running logic if the server hasn't loaded it
I just mean like animations looked like falling
No, no partitioning
I use RuntimeMeshComponent
Lemme try to reproduce the warning real quick
what does that mean
never used it so idk, but if it makes the same collision on both server / client in theory you should be fine
Wait what does cmc stand for again?
Yeah I'm sure it does
character movement component
Oh right lol
Yeah I'm using it
Example warning: LogNetPlayerMovement: Warning: ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction! Client currently at world location X=-747.262 Y=-3585.239 Z=-3159.850 on base RealtimeMeshComponent
This when standing on a non replicated chunk
yeah ok movement base related that tracks
based movement was half the reason i stopped using the CMC for mine
xd
And this is going to be a Marketplace Plugin so faking it probably won't cut it
Yeah, can't really change that
@meager spade can you weigh in on this? Is the solution to replicate the actor the client is standing on like I thought? 😅
Yeah I was fine with faking a fix for my game, but now I'm building a Marketplace Plugin so... yeah
Runtime spawned not replicated/netaddressable Meshes etc. will always be a problem
Mover has the same issue, even uglier
yea my solution was to use mover and just not use movement bases ay lmao
Yeah... that's what I was afraid of.
So back to square one ROFL
You got my hopes up Snaps, 😭 😂
But I appreciate it anyway haha
well i mean, if you don't need movement base
you can just null it out on the cmc
and you'd be fine
most minecraft style games don't need based movement
Mover's BasedMovement works
It just reacts shitty if you stand on such a mesh
Cause the Client will reconcile cause the MovementBase is null
But I can't assume that people who purchase my plugin will do that
Yeah, makes sense
But then use the Location as its correct location, which the Server sent as a relative one
ah ok it's a plugin i didn't realize
Really lovely
Yeah, long story. Shoulda just made a game hehe
But it's gonna be pretty dope
I should probably add a flag to it bHasMovementBase, so the Client knows when this shit happens
But the log is spammed anyway I guess
I've definitely spoken to others in the procedural world realm who have been confused by this issue haha
Hold up. What if it was only one actor and all the chunks were components?
Would that fix the issue?
Of trying to link with replication I mean
I've been told that components are better for chunks anyway.
one thing i've been actually wondering lately is if I fucked up not just using world partition for my voxel world tbh
Always more to optimize 😅
well that's why i'm worried I might have fucked up 
I'm trying to learn that at some point I just have to tie up the loose ends and ship. Easy to say I know lol, but this is taking an eternity
If the Components are runtime spawned, you just gotta make sure they are Stably Named and set to be NetAddressable
The issue isn't really complex :D
So I can't just spawn them locally then I guess
Basically same issue then right?
Yeah easy for you to say, legend 😂
You can spawn them on both sides, but they need to share the same name and need to be set to be addressable
Gotcha
So in other words, I've had the right approach all this time, and we just went in circles with the theory just to land where we started LOL.
Well that's good news I guess
So I had Chunk->bNetStartup = true;
Does that make Chunk->SetNetAddressable(); redundant?
I don't think so
Interesting, ok
void AActor::SetNetAddressable()
{
bForceNetAddressable = 1;
}
oh wait
yeah okay it does
bool AActor::IsNameStableForNetworking() const
{
return IsNetStartupActor() || HasAnyFlags( RF_ClassDefaultObject | RF_ArchetypeObject ) || bForceNetAddressable != 0;
}
You're faster than me haha
In any case, I wouldn't manually change that bool
Yeah