#multiplayer
1 messages · Page 568 of 1
you are using projectile movement component right?
Because of you send the client off at a velocity and the server off at a velocity they would battle I would think
Oh does it? Is it on by default?
yes
Well it isnt working then because it’s not smooth at all
then you did something wrong (like clients not having the correct velocity)
so they are fighting the server
I am spawning the actor on server only and setting velocity server only
that is why then
So the actor is not mismatching at all
Yes at sole point after
how does the clients know that velocity?
I was assuming that a replicated actor just knew where to be
doesn't work like that
Ahh ok
velocity is best set before you call finish spawning, if you need to speed it up, you should replicate a velocity property, that OnRep adjusts the projectile movement comp
nothing in the projectilemovement is replicated
Ok so server spawn it, when im ready to launch it because it doesnt launch right away, I set a velocity property on it and respond on client to that change on rep and set the movement component speed. Im not at my pc right now so Im not entirely sure I’m using the projectile movement component. If I am not, would you say that I still just need to set the velocity on client at the same time I change it on server?
Basically my projectiles are spawned being held by an actor and then released
For gameplay programmers writing C++ code.
I believe this pretty much sums up what you guys have told me. Going to try out implementing it now thanks for the help!
Hey guys, anyone has used the advance sessions plugin? I'm trying to send the server name as extra settings but I'm receiving a null array in the client end. Has anyone had this happen before?
Hey Guys. Anyone with dedicated server multiplayer experience?
I think there is a chance, so why don't you just ask you question?...
How can we do matchmaking in dedicated server?
i wish the steam auth stuff was built in a more cross-play friendly way
since it changes how every packet is sent over the network
I need to develop a multiplayer game for android and Ios is the anyone experienced in that?
I think your questions are a bit too generalized. You will need to google tutorials for that and then come back with more specific questions about issues I think. Unless you are looking to pay someone then you can ask in looking for talent.
I wanted to know what all options are there for doing matchmaking in dedicated servers
"all options" xD
Simplest solution, have a service where all servers report to, that they exists and display a server list.
Anyone has used the advanced session plugin? Having trouble sending info via Extra settings.
Was watching a video on multiplayer replication and the guy said..."We could put this in our level blueprint but that's a no no for multiplayer" ... ..but never explained..I don't get it
that very much depends on context
by default LevelScriptActors (ie. level BPs) are replicated
i want to make multiplayer voicechat, should i then first make a dedicated server, and in dedicated server make a "session"?
(i am using advanced sessions:!, sorry for short, impolite question)
Hey guys I have a problem with my animations... Well not really the animations.. the direction of the character on the server is not replicated to the clients... And I dont know where I should ask my question. In the mutliplayer channel or in the animation channel???
And since my direction variable is used in my blendspace the animations are not working properly for the server
anyone use json for database queries?
@dapper hatch did you try making a variable and replicating that?
can i get someone to help me out real quick?
If you have questions, just ask them, dont ask for help.
i wasn't done typing 😦 lol
is getresolvedconnectstring setup correctly here?
i am using this version of the overloaded function
bool GetResolvedConnectString
(
const class FOnlineSessionSearchResult & SearchResult,
FName PortType,
FString & ConnectInfo
)
Bear in mind that Fstring Url passes an empty string.
URL Will most likely get filled with the "ConnectString"
Hence the function name
So yes, with what you have shown, it appears as though your using it correctly.
Your better off looking into the Engine source for similar usages and learn from those.
okay, i am just trying to figure out why my connection keeps timing out.
[2020.09.12-01.50.04:429][414]LogOnlineSession: Warning: STEAM: Steam could not resolve session info! ValidP2P[0] ValidHost[0] ConnectionMethod[Direct]
[2020.09.12-01.50.04:430][414]LogOnlineSession: Warning: STEAM: Invalid session info in search result to GetResolvedConnectString()
[2020.09.12-01.57.09:918][542]LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 5.01, Real: 5.00, Good: 5.00, DriverTime: 5.01, Threshold: 5.00, [UNetConnection] RemoteAddr: 90138720266127365:15000, Name: SteamSocketsNetConnection_0, Driver: SteamSocketsNetDriver_0 SteamSocketsNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: STEAM:Beefie [0x125DB6FC370]
Well it looks like its timing out because of the other Warnings
Steam couldnt resolve the connect url
So maybe look into that?
hmm... strange. Anyone else come across an issue where multiplayer client and server seem to be in seperate game instances when using PIE, but works fine in standalone after upgrading from 4.23 to 4.25? I'll keep you guys posted on what I find out
oh wow, what a newb I am 😄 The upgrade simply changed my default PIE mode from NetMode=PlayAsListenServer to NetMode=PlayOffline
Is multicast the best way to play gunshot sounds?
@wicked brook No, the gun being fired should already be replicated, therefore no further replication or RPC should be necessary
@grand kestrel so what i have is a spaceship so the player/ gun are the same. The problem i have is if i dont use a separate multicast for the sound, it does not play.
Have the actor you're spawning play the sound
Ah ok didnt think of that. ill try it. thanks
is it possible to client rpc "RunOnServer" on an event dispatcher bound in a level blueprint from client?
i have some function that i want to keep in level blueprint but am wanting to invoke from a client. seems like the client has is not an owner so it's not invoking RunOnServer
@grand kestrel That worked fine. Thanks again
@verbal gust how are you testing?
Not for sure if it will work either way but i know some things you have to run separate process flag in editor when testing
delegates have nothing to do with networking
or event dispatchers, as blueprints call them
they are strictly limited to the instance of the game on their own machine
you can't bind a server function to client dispatcher
or the other way around
@wicked brook just using the editor new PIE window with 3 players to test
@winged badger makes sense. then how would you call a level blueprint function from a client pawn?
@wicked brook na that didnt work
i wouldn't... but level BP can bind to Pawn's event dispatcher
and it can do so selectively, only if its not server
or only if Pawn IsLocallyControlled
level blueprint can't send server/client RPCs though
thanks for clearing things up
Hello everyone, I'm sorry if this has been asked multiple times, but I'm developing a game that is multiplayer. I'm using Zeuz which is a third party cloud hosted service that authenticates users, stores inventory etc. I have a player which plays the Listen server and can have up to 3 clients connect. My question is, if I wanted to have the server and all clients have all inventory information, what is the best choice? Client authenticates with API, can grab the updated inventory, but server, should it do the same call as well? Essentially doubling every API call. The server must have the inventory in order to replicate the inventory information (weapons and such) to all other clients. Anyone have any ideas?
host shouldn't be able to send the client users auth
which leaves you at clients fetching their inventory then RPCing that to server
yeah I don't want to pass the client auth, but how would server get the clients inventory?
and that's ok to trust as far as client is authenticated?
you can put some sanity checks
I see, some kind of token authentication to verify client is who they say they are?
letting server send a request "does the User<ID> really have 3 swords of shooting lightning bolts out of his arse?"
rather then fetching the entire info
and just verify a random 1 or 2 items
instead of bothering with everything
I see ok, this is what I was thinking, wanted to make sure I wasn't going crazy, thanks @winged badger
Makes sense to me
@vale ermine look in the "animation" channel I posted what I did :p
just got my first cloud code working in gamespark yay. I can now set player hp mana exp and level. 🙂
Hi all. Is there an easy way to have three player split screen also in "Grid" mode instead of "Favour Top / Bottom"? And if not, is there a way at all?
I have two PC's one is a Ryzen 5 1600x ( black pc ) , and the other is a FX 8370 ( red pc ), When i run the dedicated server on the black pc and make the black pc client join, it manages to join sometimes, when i run the dedicated server on the red pc and make the black pc join it, it still manages to join, again, but if i try to make the red pc join the dedicated server on the black pc or itself, it manages to load the level for a few seconds ( in the center of the level ) then crashes . I caught the error log and it says this
Why cant the red pc properly join the hosted level? what does the message mean?
my standalone game is 30 GB in size, and i have a lot of AI actors and a few vehicles inside the level the server loads
is it possible for one player host a game and other players join and freely be able to go to different levels without everyone havening to switch to that level
like Minecraft having the overworld nether and end that players can be in or out of
You can sort of hack it, but probably not to the same scale as Minecraft. Unreal Engine has a very distinct one world concept unfortunately.
i mean the worlds scale will be the default ue4 recommended world size i just will want players to be able to travel between these different worlds without the host having to send everyone to a new level
Hello, I have a little question about the online subsystem in the UE. Is there a way to join a session using the SessionID only? Unfortunately, I have no idea about the UE's online subsystem.
Guyss, can I somehow reset state of everything on dedicated server without destroying old one and making everyone join new one?
So I got my projectiles replicated and looking very smooth. The last issue I seem to be experiencing now is that when I see a projectile on the client simulated proxy by launching it on the listen server owner, it sporadically seems to continue moving through collision surfaces on the client while it has been exploded/destroyed on the server. I feel like this is some kind of race condition happening. What's the proper handling of this situation. Do I delay the destroy for x seconds to make sure it accounts for the client catching up or am I missing something more specifically?
I would just replicate down a state change, but then I feel like the projectile might explode too early before it has hit its target? Maybe not though.
Meh, I decided to just replicate down the state change and it seems to work well enough..
hey
guys
if i call a montage on the server, will it play on the clients?
if not, how should i handle playing a death montage
What you mean by montage?
i want to play a montage, and have it weight before calling my respawn functionality
an Anim montage
i want the anim montage to finish before calling Respawn function
Hmmm getting the weirdest null pointer crash in live playtests likely tied to a replication issue, but debugging through the IDE isn't giving me much detail. Anyone got a tip for hunting down read violation crashes (and thus doesn't print to the crash logs)?
Also @quick flint, you can grab the duration of a montage when you call the PlayMontage function, which you can use as a means of setting a timer on the server that then respawns your character when the montage ends (you can also trigger a respawn event with animnotifies on the server if you prefer that).
But just remember that you need to be replicating the death event across the various clients (especially the server). I like doing this with replicated variables that trigger an OnRep notify on clients, which then plays the montages locally for simulated proxies (and calls all other required effects and whatnot). However, if you're running this in blueprints, you can just get away with a multicast event, following the method most BP tutorials present, and call it a day.
have anyone done Multiplayer Session? i want to make a simple voicechat room, i could host and join session in local host, but i can not join from another laptop
I've seen that, voice chat doesnt work in dedicated server.
i am using 4.23.1 advanced sessiosn
hey guys need some help,
I have a editable widget interacting with widget component, which is going to be common for all the clients , so if someone is typing to it, it should be valid for all the clients. need some guidance how should i handle this.
@polar wing why not a net multicast function
can anyone help me set a value in gamespark from unreal engine.
Guyss, can I somehow reset state of everything on dedicated server without destroying old one and making everyone join new one?
Hey Guys, I am trying to set a LAN multiplayer game between 2 computers using online subsystem null
I am able to establish lan session if both clients are on the same PC
but when I am trying to connect 2 PCs over the same LAN the session is never found
anyone know what could it be ?
have you LAN bool ticked?
@warped violet I think i have kind of same problem
is it even possible to make a dedicated server or listen server, that people can communicate each other based on voip?
Hey guys, I have a custom movement system set up that only takes in InputAxis MoveForward and InputAxis MoveRight then calculates how the player should move from there.
Before, I was able to see the client moving on the server's screen, but after following this tutorial for damaging other players, the custom movements doesnt work any more on the Client.
The client can still jump and look around, but trying to move causes it to rubberband back to where it was while nothing happens on the server's screen,
My question is, how would I replicate the custom movement in the server?
So does anyone have any idea why connecting to a beacon might timeout the connection?
anyone know the set up for getting values from game spark? I have setting values working in blueprint but having issues with getting values. looking for blueprint and cloud code for get event.
@vale ermine You pack them into the response.
Im assuming your calling a Cloud Code function?
never mind i got it. it was the cloud Code
var POS = ""
var API = Spark.getGameDataService();
var player = Spark.getPlayer().getUserName();
var entry = API.getItem("PlayerData", player);
var data = entry.document().getData();
POS = data.Level
Spark.setScriptData("POS", POS);
then I was able to use getgsdata node with the name POS and hooked it to the getfloat game sparks script data node. Now I can get my players level on login 😄
👍
I would also recommend heavily that you setup an inhouse caching system for all the data your bring in from GameSparks.
The GameSparks plugin has a major fundamental flaw.
That if your not careful can result in a nasty Object Leak
GetGSData and GetGSDataArray create new UObjects, since the GameSparksScriptData Object uses a nested approach to holding onto its data, you can end up very easily creating thousands of UObjects that only might get accessed for a single frame and become obsolete, only being cleaned up on the next Garbage Collection pass.
I can see how that could leak quickly
Its only a problem if you DONT cache stuff yourself and only rely on accessing your GS data from those 2 functions.
So i recommend you work out the best way to cache the GS Data once (or as little as often).
ok thank you for that. I am putting a lot of work into this and that may have saved me from crashes and not having a clue where to start
its one thing leaking on a dev computer vs a mobile divice
Do a test so you can see. Call GetGSData and GetGSDataArray on Tick for some random piece of Data and watch your Object count explode.
🙂
Anyone available to help me clear up how to properly create/use delegates so I can utilize the FriendsInterface? I thought I had a handle (no pun intended) on it when I got sessions working but I seem to be lost.
I noticed that when I change cloud code and change the blueprint names for the gs functions I have to disconnect the gslog node and and reconnect it for the changes to work.
what happens if I call the same unrealiable client rpc on a pawn several times ?
will UE4 try to put them all in a packet for sending or just ignore the old ones and send the last call ?
I need something like Replication but trough RPC cause I need to send different data for each client and Replication doesn't supper that.
hey guys, does any one know that when make a server check in blueprints or code if that code is compiled for the client aswell?
trying to understand it for security reasons
i need to make a call to the back end to update the players MMR
and im trying to understand how much i can get away with haha
in cpp you can exclude it from client with #if UE_SERVER
but if it's required for listen servers too, then you need to eliminate those by building client only as client, with no server.
er let me rephrase that.
it won't be included for listen servers either, but if you WANt listen servers, then you can't hide it
i only need the compiler to skip the "update mmr function" so there should be no issue, thanks
has authority is a way to go i think in this case
UE_SERVER if dedicated is compiled or WITH_SERVER_CODE if game should have server code at all
I just find this header file with most of defines
source : ShadowRiver
@tall raft except an authoirity check, still leaves the code in the binary.
it sounded like he wanted clients to not have the code at all, so they cannot snoop.
if servers are not publically released, this is how you'd do it.
hi all anyone have idea why my movement component switch to flying mode when using root motion to let the AI jump and after the animation complete I switch back to Walk mode for the movement node . After that the AI is keep shaking, I have disable all the network replication, what I am using is setting the replicated location and rotation variable, then VInterp the location and rotation on client. It was smooth before I playing the animation that using root motion and fly mode in movement node
@sage halo what do you mean by lobby system? people usualy use steam for that kind of stuff but you can also try epic online services
I have a strange problem. When I try to join my dedicated server via IP or session, I always get the error: "Connection Timeout". What am I doing wrong? I am using version 4.24.
if the connection is timing out your client is probably not receiving info from the server
if its a remore you might need to open your router ports
Dedicated server and client run on the same PC. Steam is switched off. However, I do not see my IP address in the server log and I also do not see that the client has tried to establish a connection to the dedicated server. When I have started Steam and start my dedicated server, the server is also found in the Steam server list. A client from another PC can also find the session.
@limber gyro
Hello Friends Is it possible to host A session on dedicated server Instead of host it on a pc..
for example when the player creating a host P2P the session will open on dedicated server ?
@wanton tulip when you run the steamsubsystem all kinds of weird shit happens because steam is very anal when it comes to connections
you either do stuff steam's way or you dont
how are you trying to join? with a console command or join session node?
i had some issues connecting with steam but i never had a timeout
see if you can connect with the nullsubsystem, as in, turn steam completly off
just to see if the issue is with steam or not
Ok. I will build it and answer you when I tested it.
@limber gyro Nope Connection Timeout 😕🤔
It's bad done.
You dont have to Play Sound on server, and when using Get Player Controller on server you are directing that into first player on map.
do i need online subsystem to connect sessio? i am trying with advanced session
@wanton tulip then it must be something on your end, i still suspect ports
fluran: no
Nope Connection Timeout 😕🤔
I just noticed it when I was looking into the client log. The complete log only consists of:
[2020.09.13-13.04.58:978][583]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
[2020.09.13-13.04.58:984][584]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
[2020.09.13-13.04.58:992][585]AdvancedFriendsLog: Warning: GetFriendsList Failed to get friends interface!
[2020.09.13-13.04.58:992][585]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
[2020.09.13-13.04.59:000][586]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
[2020.09.13-13.04.59:007][587]LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver```
So I can host in a client 1, and should i use console command "open ip"?
or i should just use search session node
open ip:port , yea
search session will provide you with all broadcasted servers (on LAN mostly)
dedicated server will broadcast without calling create session i think
@wanton tulip post how you are connecting
@limber gyro Host or Join? Join is the command
i shouldnt use dedicated serverwithout subsystem like Steam for multiplayer session,
do you know why i doesn't work?
why, you should when you are on lan or just having pc somewhere with outside IP.
(or cloud or whatever)
i thought Session system doesnt work with dedicated server.. with voicechat
@wanton tulip the join
okay, so Dedicated server or listen server is like a big house, and sessions are small rooms in that house.
also try using the open command
to join small room , i should first join big house.
also try using the open command
@limber gyro I only use the command, because Join has the Same Result
@wanton tulip not sure if they are the same tho
@dim geode mmm, not exactly. For example you cant have 1 dedicated server running multiple maps and sessions at once. You have 1 house for everyone.
and to join big house, i should have exact address, with port.
:0 is it impossible to have several maps in a dedicated server?
you cant have them all running separately.
You can do instancing for that i think
never did it before so hard to tell
@wanton tulip gimme a sec let me check how i do it in my project
i'm using OpenLevel mostly.
oh, i guess maybe thats where my problem comes from :D, i didnt do replication to server, when i put "advanced session create" i didnt make replication node
i am still confused, but i will try again
@wanton tulip are you not opening your servers manualy?
have you tried building the server exec, running it, and trying to connect?
What do you mean? Yes I start the server by my own.
i mean not using "create session" node
I could test this. But I knoe Create Session Success every time
i am not sure how that node works i have never used sessions only dedicated servers
you could try checking the "LAN" tick box
since it is running localy
bu the timeout is in the client correct?
or is it in the server?
you said the server is not even registering the attempt to connect so must be the client
what ip are you using to connect when you connect directly?
The 127.0.0.1 . Yes Timout ist on the Client
i have no idea man, try specifing the port 127.0.0.1:7777
oh other thing
if you have aother service in your computer running on port 7777 it might cause issues
so ur gonna have to check that somehow
And how?
i dont remeber how it is done but it was something in CMD
also if there is a windows specific service running on 7777 WHEN THE SERVER IS RUNNING there should be no problem
scvhost or something if i remember correctly
but if it is something else you are proobably gonna have issues
What is if my Server is launched and the Port is not in the netstat list?
And when I am executing svchost nothing happen
u dont need to execute svchost, windows does it for you everytime you run a program that needs to run network stuff i think
you definetly dont need to run it
if ur netstat is not showing the apropriate responde then i think something is wrong but i am not sure about that, again i never worked with sessions
I removed also the Session node only Open Level listen. Same error. It's not a Problem with the Session
do you have a server .exe?
send it to a friend that has ports open and try to connect to him
I will take a look what i can do. 😕 Thank you.
yes@dim geode
Member AActor::Role is inaccessible why?
Edit: For those of who who want a workaround, use GetLocalRole()
Anyone familiar with Set Level Transform, or Open Level Instance in multiplayer?
I cannot for the life of me get the server/clients to replicate loading or moving level streams.
Anyone had any luck with Steam Invites? I'm trying to use SendInvite() in the Friend Interface but the Steam Interface is spitting out a message saying SendInvte() is not supported.
Edit: You can use IOnlineSession::SendSessionInviteToFriend
@limber gyro There was a Problem idk. I forgot to remove the NetDriver it was not enough to simply change the DefaultOnlineSubsystem to Null. But when I'm joining the Server, what is working now, I only have a black screen. In the ServerLog is standing:
[2020.09.13-15.50.21:833][ 14]LogModelComponent: Model /Game/MP_SK/Maps/LMS/LMS_Hub.LMS_Hub:PersistentLevel.ModelComponent_1 has elements that reference missing vertices. MaxVertex=12200, NumModelVertices=0
a lot of times
@wanton tulip do you have any models in your client that your server does not have?
Server and Client uses the same Build. In one there is just the Server.exe @limber gyro
strange man, never saw that kind of error
but clearly your persistent level references things that dont exist so
you should look there
I right now try to delete my Binaries etc. and build all things again
Guys Can i make the Session Hosted on VPS other than Player's PC ? on P2P
Gonna need to rewrite that question in a way that makes more sense :/
UE4 doesn't do P2P
Steam Advanced session does
Nah
Sessions are just sessions
They're with Steam, there's no P2P involved
So I guess you're saying there is no dedicated server involved
That's one option yes
That's a listen server where one player has full authority over the game
Sessions are nowhere, they're just a matchmaking tool
The actual multiplayer model is somewhat unrelated
You can create a session on your machine and then join a server
No relation
idk why im thinking like a dumb xP
instead of this complex things i can create Dedicated server when the player Click on Host he will open dedicated server somewhere on a machine
and the players will be able to join
idk why i was thinking to Host the Listen server on VPS or dedicated Machines
I'm able to Open Level Instance on each client if they each click on something, but I can't make it replicate on 1 players click. Is that possible?
Hey guys, i have this problem where, i am not able to call the RPC on server from my client, although the actor is owned by the playercontroller.
Any tips to look for ?
@zenith wyvern you want one player to click and it should open level for all the players ?
yeah, with open level instance
i have the click calling a 'ruun on server' event to do the load, then that calls a multicast event to do it also, buut it doesnt work
'load stream level' works in 1 click, but i need to set the transform and i can't make that replicate either
right now in an actor
i have it's on click start it
i think i've tried puutting the fuunction in the character, and calling on each character acter
the actor should be owned by the player controller,
If you want to send RPC from client to server , actor must be owned by the owning client.
maybe thats the issue. How can I wire up an actor on click back to controller?
or i define the function in controller, and onclick, get playercontroller, call func?
i'll try that, thanks!
and you would want to from RPC(onServer) -> RPC(NetMulticast)
so I have a custom way of moving my character that basically just sets their velocity based on their inputs and is being called every frame. I'm having trouble figuring out how to put these calculations on the server side and just sending input to it. How exactly do I get the server to do something then send a result back to the player/all players? I'm thinking I have the client send inputs to the server, the server calculates it's next velocity or position, then sends this data to all clients, but I'm not sure how to get the server to do specific things
In C++ I mean
@tranquil yoke Still not working. Client does nothing and i cant figure out why
what are some good in depth resources to learn multiplayer, i thought i understood it a bit but i'm not even able to replicate a few animations.
i thought that voice chat in multiplayer is hella easy
3 weeks spending full time on it ,no sucesss
Im working on a fps with a third person mesh. The firing animation works for the owner client but i can't get it replicate
And it even works for the owner no see pistol as well
i saw some tutorials about that
it wont help you cause i believe youve watched them already but i send you links
In this tutorial I try to explain how I view the basics of replicating in UE4.
thanks i'll chack it out
@zenith wyvern you are doing like this ?
Widget -> player controller (RPC server) -> RPC multicast -> Code which opens the level ?
actually. its working 1 direction now, which is amazing progress. one of either the server or client it's not working
what do you mean 1 direction
either the client or server it works, but not the other
@dim geode in terms of voip i’d recommend using vivox
I had 0 success with the default system
i will first make normal global voice chat, no positional voice
then i will implement vivox
have you ever implemented vivox?
what's the point of doing that? the online subsystem voice isn't really compatible
@lost inlet I was just going through the search, and read a comment by you about how you created a lag compensation component, how did that work out for you/how would I go about achieving that with unreal? I've been searching (a lot) the last week or so for how to approach it with unreal in a reliable way for server-side hit detection.
we went with a CSHD system in the end, the verification uses that component but it's much simplified from before
a lot of games these days use it, the server side verification in the end ends up achieving the same thing
an engine like source did it because it had a simple animation system so you didn't have to store the location for all the bones the player can hit for each player each frame
i am assuming that the animation snapshot is not performant? or has some restriction, and just storing hitbox locations? For each player? couldn't you just run a check if a check was necessary to begin with to alleviate that?
i'm not sure what you mean by that
but CSHD with more simplified verification checks is going to be way more performant than any kind of animation snapshotting and rewinding
which? the check? a larger bounding box or a larger cast to check when a player shot to see if a rewind is even needed
i'm not sure how you would implement that check, you can't pre-emptively know if a player is going to shoot or not
sure, but when they do "fire" you can check a larger area to tell if a say enemy position is even possible to be hit to begin with? if so, run the rewind logic, just an idea
oh, I think i misread something, I guess I'm not understanding how storing an animation pose snapshot or just the hitbox position/rotation each frame is a problem?
yes but that doesn't work because what the player sees is in the past because you know, packets have to travel over the internet
that's what i mean pre-emptive, when the client tells the server they fired, they actually need to compare against whatever they saw on their screen, which could be 20-100ms behind what is currently happening on the server
right, so what was the roadblock with unreal and storing animation pose or hitbox locations and rewinding?
on the server, of course.
performance
oh, well damn. how bad was it?
compared to just storing position, pretty bad. also could never get it working quite right and got a lot of complaints about missed hits in alpha testing
Whats CSHD mean?
client side hit detection
heh
Thinking like CounterStrike HD or something lol
i am suprised fornite doesn't do that, but then again, performance is probably the reason
rewinding? with that many players? that's nuts. lol
they don't predict projectiles nor do client side re-wind
anyway, that sucks @lost inlet thanks for the insight though. hopefully epic does something to help, aren't they working on a prediction plugin that is supposed to support some sort of rewinding?
thing is, you can just do some checks server side like yaw angle, and maybe a bit of a fudge box around the player to see if the shot would have actually hit
there was a demonstration that showed shooting, don't know if it was part of the system though
that's to do with the shooting interaction i suspect and not the thing you're shoot at
Valorant had a interesting talk on what they did
ah, i didn't really look too deep into it, but yeah that makes sense.
valorant seems to have a prediction system similar to source, and the client sends a timestamp with each command
which makes it easy to rewind, but their blog doesn't go into detail about if the hit is completely on the server or if it's CSHD with checks
its completely on server, they rewrote how the engine does anim graph nodes, so they could do on demand calls to animation state.
i was hoping that wasnt the only option with unreal, as they did do that many years ago
maybe that's why it takes them like 2 months to do engine upgrades
yep
that and using the mobile renderer, not the desktop one
"Heres how we did Hit Detection... oh by the way, we had to rewrite a big piece of the Engine"
lol, basically 😦
Would be nice if Epic released some code resources from Paragon
unless you're designing a highly competitive 5v5 game, i would just do the position verification on the server rather than where all the "hitboxes" are
yes
they never did that
and i wish they did
i wanted SpeedWarping! 😄
Yeah see, tahts the problem. that's what im doing LOL
They released near everything else but code resources lol
i wanted it back in the day for their replay implementation
we actually did ok in the end
I bet Replay was tough... I dont even want to think about it.
we use the HTTP streamer, works pretty well now
any issues with the UT implementation for hit tracing? ( for my personal education )
So you dont store replay info on the Client?
Any particular reason?
Ohh i see
The Server records the Replay
Not the Client itself
yeah, the PUBG implementation was pretty bad and actually drained client performance
and then it would only record what's around the player
Yeah for sure, makes sense.
Do the replays end up being very big?
@twin juniper Not particularly, if you can make sense of it.
yes looking at AUTCharacter::GetRewindLocation(), AUTWeapon::FireInstantHit(), AUTWeapon::HitScanTrace() which all seem like pretty standard rewind all pawns
UT does basic rwinding
no hitboxes/animation, just bounding box positional checks, from what I've read
what's the point of doing that? the online subsystem voice isn't really compatible
@lost inlet I want to make virtual web confernce, video call environment, in virtual reality.. 😦 right now i am aiming to implement voicechat, webbrowser, first basic function, voice chat.. well.. for now i could use discord. then, I want to have Webbrowser screen.
i should know how to replicate input from single client to another clients when using web browser.
How does video chat work in VR if you're wearing a HMD anyway?
Hey guys one question, if there is one object which is placed on map, and is replicated, will it be shown to all the clients,
I am having problem with one of my blueprints, which has child actors in it, but seems like child actor does not show for the clients ? any idea
@tranquil yoke have you set the child actor to be a replicated property of whatever actor its a child of?
Yes i did,
But somehow, it was not replicating.
I had to spawn the actors on the server mamually.
I am trying to portforward my dedicated server withsteam, my server is not showing up on the steam servers page (only on lan). Is my port forwarding correct?
How do you guys setup for multi-user editing to work properly .. my sessions always seem to get confused
I'm trying to setup my computer and my wife's computer for multi-user editing .. so far its always been crashing
Yes i did,
But somehow, it was not replicating.
I had to spawn the actors on the server mamually.
@tranquil yoke Wait, replication never works from client to server. If you want anything to be replicated it needs to be created on the server
Only way a client can communicate to the server is by calling RPCs on an object that was replicated from the server to them
not just that. you can only go client->server through a plaeyr controller, or a player owned actor /(or) a possessed pawn
yeah, that's what i meant by player owned
ah it sounds like player owned possessed pawn
😄
now it's clear. haha
amount of people who try to replicate stuff or send rpc's in non owned actors is pretty mental
indeed.
it even tells you in the bloody console "no owning connection"
if you try to do it, which should give it away, but i guess it's not descriptive enough
saying that when i first started doing MP, i did the same but i figured it out after i saw that message
someone should make a noob friendly update to all error messages "blah blah no owned connection - this means you cannot send an rpc from this actor, becuase it's not owned by your local client's player controller on the server"
and remove replication settings from UserWidgets
and certain local actors lol
like HUD, etc
indeed
Is it possible to use Unreal networking insights on only one computer
read the steam OSS documentation page
i know this is a pretty complex topic after digging through some of the UT source, but i had a quick question about spawning a client side projectile while also sending the request to the server to create the real projectile. currently, i have the projectile to not be seen by owner, and then only on client side changing that variable, but what feels dirty to me is knowing that when the server creates the real projectile, it gets replicated back to the client that shot it. even though he can't see it, i know there's 2 projectiles on that particular client. is there a way to tell just that client not to spawn the projectile?
So I just looked over how UT source does it
they spawn a fake projectile on the client, and set a destroy timer. If the server's projectile is replicated before the destroy timer completes, it destroys the existing client fake projectile in BeginPlay().
server-replicated projectile 'replaces' the client-side one either way
Take a look at AUTProjectile::BeginFakeProjectileSynch
whoops I got that backwards. thought BeginFakeProjectileSynch was getting called on the fake projectile. now I see the server one hides itself client-side after syncing the fake projectile to itself
ah, so there is two of them client side then, and just one of them is invisible
thought maybe i was just doing it weird then
There's one client-side, but then when the server one replicates, the "fake" one syncs up with it and the server one is destroyed IIRC
BTW the server-spawned ones have the bNetTemporary flag set as well
So as soon as the replicated ones are spawned, they're torn off
So if there any desyncs after that, client doesn't know about them, nor get any further updates about that projectile
Works fine so long as the rest of your game is tightly synchronised and/or the projectiles have a short lifespan (which they do in UT)
is it same for the C++?
yep
RPC's are latent by nature, so returning values or modifying input values is not possible
thats sad :\
does latent functions means "using ticks" ?
you cant run a latent function without tick enabled*, right?
No, it just means it takes time to happen. If you send an RPC you have to wait for it to travel along the interwebs first
So unless you blocked the rest of the game from continuing, a return value wouldn't be possible
If you need to request a value directly, you'd need to use two RPC's.
Hmm, understood thanks
noope
cool
If you're using dormancy, apparently it does - but I've not seen it work that way
And that UDN post was from 2012 so probably not relevant anymore
hey guys 🙂 i think im slowly getting the hang of Networking in UE4 (it still feels weird to do so little to achieve so much)
but i am a bit confused about "Execute On Server" events
when i build my event with 2 inputs. The client would send the inputs of the Event to the server and the server handles the rest? Or do i need to treat event inputs differently when sending to server ?
By input you mean input from the keyboard/mouse etc?
Typically you don't wire that directly into an RPC
Yeah, so client will send those values with the RPC
oh, when i look at it just now, isnt this a stupid approach ?
the position and rotation would be taken from the client side now, i should recheck them in the RPC to take them from there ... right ?
Well typically when you fire a bullet (looking at func name) - the clients view is important
But you may want to then sanity-check those values server-side
i guess thats a good improvement to this script... thanks for the advice 🙂
and yeah it simply spawns an actor that moves towards the players view direction (as of now)
this is no real multiplayer question, more a UE4 specific one but do you even build shooting mechanics in the controller script ? The whole controller thing in UE4 really confuses me ^^
in c++ there is a _Validate function as part of the RPC thats made just for those sanity checks
in BP, it will be far more verbose
and no you do not @glacial burrow
Yeah Typically you don't build that in a controller
but in a weapon or something that the players' pawn owns
idea is to structure the Pawn so you could swap the PlayerController with AIController
and it would still work
is there a good resource to read up on it ?
not really, online tutorials aren't big on software architecture
this system is quite clever, but its a bit hard for me to wrap my head around.
as a rule of thumb
Controller tells the Pawn what action to take
Pawn knows how to execute those actions
Pawn owns Weapon, Weapon has fire Events, controller controls pawn, so controller somewhat tells pawn to use weapon ?
there is also a fine line there in games that change Pawns
as you can't manage input on the PC then
but a top down shooter example
PlayerController - deprojects mouse to screen, figures out what the player is aiming at from there and then tells the Pawn to shoot at that location
AIController - has a WeaponTargetActor it teleports around depending on where it decides to shoot based on its behavior tree, then fires at that Actor's location
in both cases the Controller is responsible of figuring out where you are supposed to shoot at
while the Pawn has to be able to handle the rest
okay ... i think i get it now. Its a pattern i would usually implemented myself, just having UE4 source it into a own controller script confused me a little
thanks for the Help Zlo 🙂
from all of that we could say the controller should not interact with the netcode much ?
controller has plenty of interactions with netcode usually
mine interprets the input action, RMB can be move, or interact for example
and then calls the Interaction RPCs if its Interact
which all go through the same Interface
Mhm i see ... lots to learn for me 🙂
there are also use cases for syncing network clock (RPCs in Controller to server and back), showing endgame screen (Reliable client RPC form server to every controller) and many many others
Oh... i havent even tought about UI stuff yet.
I wouldnt have guessed to solve it with the controller aswell
UI should be handled by the HUD
Hello guys please advice me im still thinking since yesterday if the player host a dedicated server ...
If 100 players host a server that mean 100 dedicated server
What is the easiest way to handle servers like this
Because each machine have 1 IP will be assigned to onededicated server
residential connections can't handle 100-player games anyway
If you want 100 players, you'll have to look into server providers and paying them to host always-online servers.
Hey can someone explain to me the difference between IOnlineSubsystem::Get(); and Online::GetSubsystem(GetWorld(), NAME_None); from what I understand they should return the same? But if I use the first one I can't later fetch the GetResolvedConnectionString(..);
Full source
@chrome bay yes but i meant if each player created his own host it will be 100 different server so isnt that alot ,?
If server provider like AWS how much they will charge for each server
If a player wants to create their own dedicated server, they would have to pay for it - so that's not the developers concern really.
But also you probably wouldn't distribute the server binaries directly to players, you just partner up with some providers and players pay those providers to rent a server.
I just want something other than Listen server instead of hosting on his own pc the session
Want it to be on other machine so less lag better performance
If you had 100 players listen servers are out of the question anyway
Look at providers like G-Portal, Nitrado etc they're some popular ones.
No i meant 100 each player will create his own host
So how many players are in an individual session?
4 or 6
Then forget dedicated servers
Co op
Massive overhead and cost that you don't need
Yes but i thought we can create instances on one dedicated server
When the player click host he will connect to instance
You can yeah, but someone has to pay for that server
And you need some other intermediate hub to communicate between player clients and the provider hosting those servers.
Like each server can handle 10 sessions for example
Okay we're talking something different here
Box = the actual hardware, the hardware can run multiple instances of the Server .exe
Yes
A Server .exe can only support ONE session.
True
But regardless, that is a massive amount of infrastructure and financial overhead you don't need in a 4-6 player co-op game
So just keep them listen servers on player's pc
yeah, 100%
I thought AWS can create these things with lower cost xD
It's not that low
Last thing you want is someone spamming a "host session" button in your game, then you get a $10,000 bill from amazon
dedicated servers are anything but cheap

Can't be cheaper than free, aka listen servers
Listen servers are good
I love listen servers
😋
But yeah in future when i get a good sales i must do it on dedicated for crossplay
Xbox , Pc
If they apporved my Id@xbox in future
Yeah worry about that later, when you can actually get those sales/numbers
Indie multiplayer is a sad state of affairs
Yes true
We need to get 1M budget
Joking i hope i can get something from the budget im using
Thanks for info and sorry about massive questions
Just keep your expectations in check 😄
vast majority of indie MP games do not do well
Yes but trying to do new idea
Restoration Simulator With Co-op
Maybe will be new idea
Does any 1 know if it is safe to pass a players MMR through server options?
MMR?
Oh.. Matchmaking
Typically only the server backend stuff knows about that no?
Some database somewhere
Some database somewhere
@chrome bay why database?
Just maintain runtime queue.
Good morning. I'm having a little trouble with joining a game via invite. I'm using the Advanced Sessions plugin. When I accept the invite on the client, it fires the success pin on JoinSession and the log reports "Successfully Joined" but the client doesn't travel or otherwise show that it's joined.
Any advice on this would be much appreciated.
Cheers.
@waxen socket isn't advanced sessions plugin is based on NullSubsystem??
Well, there's AdvancedSessions and AdvancedSteamSessions. They come bundled together.
So what if someone doesn't use steam, so what is fallback then, NullSubsystem??
Can you even use Null for anything other than testing?
I mean, if you package a game with that, players won't be able to connect outside of LAN, no?
For Lan based games it works fine
Yeah. I've got LAN working, now I'm trying to get online going.
If you are planning to go online NullSubsystem won't work
Yeah, I'm testing with Steam.
Ohhh I got it now
I don't have to open port 7777 for online play, eh?
u can use the nullsubsystems if you are going for remote hosted servers
depends on what you want to do
you gotta open the 7777 port if the server is hosted on your machine and some one from outside wants to connect
only the host has to open the port
I'm trying to set up a listen server that can be connected to via Steam invites.
So for players downloading the game on Steam and hosting their own listen servers, they would have to port forward too?
if your server is static you gotta host the server itself in the steam backend
they have a tut on that
Static? You mean dedicated? Cause I'm only doing listen servers.
i mean as you dont need to spawn servers on the fly
just turn the server on and leave it there
That sounds like dedicated server stuff to me, no? I'm only allowing players to host their own servers on their computer.
So does a listen server always have to port forward?
if the players host their own servers then u just need regular sessions
and with sessions i dont think u need to port to forward but i am not sure since i have never used them
Yeah, that's what I'm trying to figure out. It seems that Epic changed the port at some point to "17777" but my logs only mention "7777" still.
Yeah, it's in the 4.18 release notes.
The new port is set by default to 17777, which may conflict with projects that have hardcoded their ports when playing in editor.
Maybe it's that they can't connect on the same network?
strange im using 7777 just fine in .24
Using TCP?
udp, unreal protocol is made on top of udp
Good to know. I opened it on both but CanYouSeeMe still says it's closed. 🤔
hey
how can i know if the match has started or not
without having access to game mode
GetWorld()->bMatchStarted gives different results for diff clients
ive been doing
if (GetWorld()->bMatchStarted && GetWorld()->GetGameState()->GetServerTimeSeconds() > 0) {}
but this seems shitty
also does anyone know how to do automated tests in multiplayer?
when a match has started, begin play will be called on everything..
Has anyone had the issue that your controllers no longer work in UE4 when steam is running in the background
I didn't know exactly where to put this but here we go. I am making a local coop game (4 player max) and I was wondering how much, if at all, I should utilize Game Mode and Game State. I see almost no responses referring to this type of game. most posts are "if single player no need" and then "if online then need" and I am not single player and not online so Im a bit confused. Advice?
both do kind of what they sound like. game mode is for variables on thee game mode, for which there may only be 1
like. 'quick match'. time in round: x minutes, abilities allowed, Y
right
GameState is there more for replicating it
game state for things like 'did they use X key yet'
mirroring the GM, but available to all players in MP
you can opt not to use the GameState in this scenario
So i should use it. I just wanted to make sure I could pull good functionality out of it even though Im local coop
it is a very convenient central place to say, keep scores
I figured gamestate was the one that was on the fence
as its statically accessible, and it has an array of PlayerStates
but in strictly local co-op, the main purpose of a GS is moot
if you find one that suits your needs though, go for it
thanks a ton!
How are you guys? How can I make a multiplayer map rotation system?
make lobby sever and have it spin up servers and connect people to it.
@limber gyro Hi. I did an empty project today and did everything like the last few days. it worked. Now my question could it be because I had switched the engine Version to a newer Version? (4.21 to 4.24).
could be, you never know what happens behind the scenes when u updgrade
So what should do now? Just Migrate all my Maps to new Project?
Only Option I think😅
unreal should convert those maps by default if u copy them into the assets folder i think
unless they did some heavy changes from .21 to .24
which i dont belive is the case
Yes. But will this solve my Problem 🤔
well if the connection is working the maps wont change anything
and if they break the connection at least you know where problem is
and you are working on a better version of the engine
My Last problem was that the Server has Map errors And the Client has a black Screen
oh ye
Even if I created a new Map
i remember
well then i am not sure
copying the old maps to the new project should take you 2 minutes
test it out
if it doesnt work ur just gonna have to redo them i think
Tomorrow
The only Change was now that I am Not opening the map per Open Level. Instead I used the Server Startup Map
Maybe my Source Engine has an error. But tomorrow I will test by mograte my Project. Thank you 👍
Friends, a smol question if I may.
For some reason, "Apply Damage" is applying damage and killing all the slimes of a developer I am talking with.
"Other Actor" returns only one actor.
However, they ALL get destroyed.
I think me and him both are missing an important thing about Apply Damage function and multiplayer structure. ^-^
I just started learning about UDP and TCP and I got a few questions related to unreal... does Unreal uses UDP / TCP in order to perform replication and RPCs? Is the difference between Reliable and Unreliable RPCs related to TCP (reliable) and UDP (unreliable)? Can you make netcode using only UDP or TCP and not relying on unreal's architecture? And would that be a sane thing to do?
afaik its just udp
Been forever since I looked into it but iirc I found the same
so in theory it would be possible to use udp to make your own netcode? (although probably very unwise to do so)
Is there an easy way to disconnect a client from a server if the server gives some bad data?
For instance, I have the server replicating a list of UClass pointers for inventory items, but I don't want to check the UClass pointers for validity (they implement the required interface and aren't null) every time I access them.
I figure if the server is sending out invalid objects, the game is already in an undefined state and instead of handling it, or crashing, I should just exit the session back to a menu.
Hello everyone. I have something weird coming up. I'm making a game with a lobby where you can select if you wanna make a LAN connection or a connection through steam. If I make the LAN connection with steam closed in both machines works perfectly, similarly when I have steam selected (With steam open of course) works as intended. However, If I try to make a LAN connection while steam is open in either machine I get all sort of errors. Any idea why is this happening and how to prevent it? Or they are just incompatible by design?
Actually scratch that - how do I disconnect from a server 😅
Google is giving conflicting answers, like deleting the player controller (that doesn't seem safe), typing disconnect in the console, and calling HandleDisconnect from the GameInstance
I have a quick question, is there a way to hide a component for one players camera, but show it on all others? Essentially player 1 doesn't see his Playermodel since it would block his view, but all other players do see it?
This is for a multiplayer FPS if that helps
@wild frost you can set OwnerNoSee on a primitive component
@analog rover That is exactly what I was looking for, thank you!
No problem!
@analog rover there is a PC command
or maybe not..
ah
AGameSession::KickPlayer or AGameSession::UnregisterPlayer
maybe is what you are looking for
but ultimately just destroying the pawn and destroying the controller should do it
Which is the "best practice" method? The destroying pawn and controller method?
that is ultimately what the engine does
but just make sure you clean up anything you need to before so
like the session, etc
Gotcha - thanks!
@warped violet
that's for if you want udp on destination port 7777
or you can just say udp and it'll capture everything - there shouldn't be that much noise, mostly DNS and stuff
unless of course you need TCP, then you'd just write tcp :)
It doesn't allow me
idk why
But I managed to run LAN
it was a problem on mac
for some reason I can't connect to mac
but managed to connect to another windwos
if i am spawning an actor and then setting its replicated variable, will it replicate to clients?
or do i have to wait until the actor is replicated to the clients?
most of time, it'll be received as part of the "initial bunch" for the actor
but not always
that's why it's good to have an OnRep
how would on rep help me
to deal with the late replication???
also you should spawn it deffered, to make sure it goes through on the initial bunch
i prefer to be explicit rather than risk it
How can my clients detect a change in the game state?
For instance, a variable in the game state called "PlayState" which is an enumeration that contains the current state of the game (lobby, playing, etc...)
I know that this variable is replicated to clients since it is in the game state, but how can they listen for changes on this variable?
I'm unsure of how that works in the context of the game mode / state
game mode doesn't exist in clients so it wouldn't work, but it works in game state
it works in any actor
do you know basic variable replication?
Yeah, I guess I was thinking in terms of the game mode not existing on the client rather than the game state
I haven't used the game state too much. I'l look at putting the onrep function in there
oh
the game state kinda function exactly like the game mode, there is only one instance and it's used to keep general info about the match progress, the difference being that game state exists on clients as well
That makes sense
I think that after installation of UE4 there should be a document with a printable tree about Gamemode/Gamestate/Playerstate etc and what is where and when it beginsplay etc.
I have it written down and put on a wall when i'm doing something with multiplayer and jumping between levels.
//joke. But to make it less offtop, i'd add that GameInstance is also cool, it's persistent between loading levels etc.
afaik GameInstance is not replicated
each machine has their own different game instance
Yup, you right.
It's cool to store info like avatar type or playername etc. Then on beginplay on the server you take variables from GameInstance and set it in PlayerState.
(i've been struggling with that when I was making offline lobby system + online games with a lot of levels, was so proud when i got it)
What method do you guys use to add widgets to players? Each game mode will have it's own widgets for different parts of the game. For instance, a "ready up" widget. Does it make sense to have the gamemode tell the player controllers to add widgets? I'm thinking from a infrastructure perspective
I guess I will need a custom player controller method for adding widgets that replicates to the client, since I cannot simply add a widget to the player viewport from gamemode
here's a reference I use for remembering the differences between things like GameInstance / GameMode -- figured could be useful for others although it's quite basic
https://www.tomlooman.com/ue4-gameplay-framework/
(it's also c++ focused)
Useful resource, thanks
I want to set my Player State as a variable after casting in Begin Play, but I guess that the player state is null when begin play is initially run on the client. Is the only solution to use a delay before setting? Sounds hacky
@lucid vault I use a messaging system. PlayerState -> MessageBus -> OnPlayerStateSet()
When a PlayerState is setup, it tells the MessageBus, the MessageBus then broadcasts it out.
Objects that want to know about PlayerStates can listen for this message and update themselves accordingly.
Yeah don't use delays to get around networking issues. Won't last very long, and creates bugs that are hard to repro.
@foggy hinge overriding functions that add/remove playerstates from the array in GS and adding a delegate there seems like a more elegant solution
then involving a third object
@lucid vault make a HUD class with common functionality across all GameModes, then derive a specific subclass for each GameMode from there
and set it on the GameMode
GM should have nothing to do with widgets
Only if you know the GameState exists at that given time.
GameStates are replicated to the client, so if the UI is setup before the GameState is replicated; you're out of luck.
But each to their own, I prefer this method because I can set up these delegates at any time and never have to worry about whether an object exists or not.
Because the objects that are involved at a minimum exist all the time.
I'm trying to make the top down template (Simple Move To Location) work in multiplayer. It 'almost' works, but the client walks in place until i tab back to the server, then the focus change (or something) makes the client finally start moving. Does that sound like anything obvious?
@foggy hinge with GameState (unlike GameStateBase) there is one very conventient guarantee - GameState exists before any Actor calls BeginPlay
so you kinda to know 🙂
Yes, but sometimes the things I'm doing aren't always Actor based.
But each to their own, I don't see either methods as better or worse; as I usually find creating a Message Bus object super useful for a lot of other things
actually, it seems like as long as the client doesnt have focus it properly executes
Does anyone have any decent links to replicating firing in UE4? Currently, most of the logic is in the weapon BP, including applying damage, line trace and spawning particles etc. Just trying to figure out what and what not to replicate as I want to keep the load as small as possible as there’s no dedicated server. Replication noob here, so any pointers welcome.
replicate anything that every client needs to know aboutu. dont replicate local variables/internal functions
particle effect locations, projectile speed, all replicate worthy
@zenith wyvern Thanks. I think I might need something that holds my hand a bit more at this point. 😦
starting out i wouldnt worry about reducing load, focus on learning the functionality. then when it works, you can go backwards and un replicate things as needed (or not needed) and you'll see when something breaks
@zenith wyvern Currently, my weapon BP is set to replicate, there's a custom event that's set to run on the server that does the firing / spawning logic as well as applying damage, the remote (inside weapon BP) is just set to run the fire event, then in the character BP the input fire event handles the logic to say whether the player can fire and handles automatic firing. Inside Character BP IsFiring bool is replicated, so I can't work out what I have done wrong (quite possibly a lot).
weapon BP set to replicate
character bp with logic for firing input
I think I might need to set the particle system component to replicate inside the weapon BP, so going to try that next.
all components need 'replicate component' checked
and all related actors should at least have 'replicates' checked
Designating function replication across the network
check outu 'requiurements and caveats' section
I think I have done that, but thanks for the link.
or anything "visual" like that
@meager spade Interesting. What's the particlesystem 'set to replicate' node for then? And how do you sync up on hit particles?
well that is normally done either via a multicast or a burst counter replicated property
gotcha
(burst counter being a uint8 that increments for every shot on the server)
either way works
but you won't get any luck using Component Replicates on a particle/sound
I guess I'm going to have to pick apart the logic for spawning from the logic for raycasting, with spawning particles as a multicast right?
well, depends on how your shooting model works
my game for example, weapons fire locally and send the hit result to server
nice
server sends a multicast which shows muzzle flash, tracers, impacts etc
That sounds ideal.
client firing, does all that locally (i don't let the multicast run on the owner)
one caveat with client side firing
is cheating
do you know of any YT links that cover this neatly?
well, your BP right?
don't really know many BP tutorial but it is pretty straight forward
Have looked at a lot, but just trying to get all the logic in the correct places - want to keep firing in weapon, but maybe that's foolish> Thought it'd be neater and give me the chance to have weapon pickups later
my firing is in the weapon
cool
player holds a reference to the current equipped weapon
yeah, that's what I have
when fire is pressed, player does Weapon->Fire
object weaponBP
the weapon is owned by the player, allowing it to send RPC's
(done by setting owner to the player)
my system gets a tad complicated though
cause i forward the actual shot off to the Gameplay Ability system
this handles the actual trace, spawning the FX, etc
I have weapoBP set to replicate, but I don't think I set the owner atm
I just cast to player character
you have to set owner if you want to use Server/Client RPC's
not for Multicast, multicast it just has to be replicated
gotcha, just have to figure out where!
there is a node
Weapon->SetOwner
you would do this when you equip it, or get given the weapon from a pickup, for example
set in weapon
same as GetPlayerController, etc
GetPlayerCharacter 0 on the server might not be who you think it is..
oh that's another thing to learn then 😦 - what would you set it to?
I thought 0 defaulted to any player, not setting player 0
there are plenty of bp tutorials out there for this, but be warned, most of these (though with good intent by the author), are not usually done in a proper way. They use things that should not be used or do stuff in a weird way. Most of the them tutorials are made by people who have used UE4 for a week and want to show off what they have done, even though it does stuff stupidly. One of the downside to BP tutorials, is that it's hard to trust if they are actually worth following.
heck even epic official tutorials do crazy stuff like that.
one of there live streams i was like WTF! 😄
Yeah, I hear you. Done in lots of different ways and I'm never sure whether I'm following best practice. Hence the ask for good links.
i really wish i could give you one, but i use C++ for the most part, and never really looked at many BP tutorials
if you said C++, i would have quite happily pointed you to Tom Loomans Udemy course 😄
@meager spade That's kind of you. I'll soldier on 🙂
https://www.udemy.com/course/unrealengine-cpp/ if you ever decide to dig into c++ 😄
it's not as scary as you think lol
i mean, weapons are pretty straight forward
Yeah I have it all working in SP
converting from SP to MP is a pain
yup
either MP at the start or don't bother 😄
we converted a single player game to MP, but we actually just re-wrote nearly everything, i don't think much of the original code exists lol
Good morning. When opening a level with "listen" in a packaged build, does anyone know why I would encounter invalid URL errors like these?
url is invalid?
we converted a single player game to MP, but we actually just re-wrote nearly everything, i don't think much of the original code exists lol
@meager spade Yeah, that makes sense. I'd actually torn the house down and started again with everything MP (sprint, crouch, aim, health) but hoped I might reuse firing and reloading. Oh well, lesson learned and thanks again for your input.
Yeah.
right... so show me how you are travelling
also did you cook the Menu map?
cause you kinda broke UE4 layout for maps
levels should be in Maps folder
menu is like a lobby?
I'm "going online". I press a button, and it reloads the current level as a listen server. Friends can then join via invite.
oh i nromally just use Exec command lol
I use the command afterwards for travelling around.
😩
where do you pass ?Listen?
it seems like your just calling servertravel with map name
also why do you call OpenLevel
before you server travel?
I call it in the game instance.
i think the issue is you call OpenLevel
I don't need to travel if I'm going to be the server though, right?
yes you do
but you are calling Open Level
then you travel
which is wrong
you either Travel or Open Level
No no, sorry. I don't call that servertravel command at all until I need to load another map. Ignore that image.
oh
I thought OpenLevel with "listen" options sets you up as a listen server.
But in any case, just calling that OpenLevel node in the packaged build causes those invalid URL errors.
Do you think "/Maps" vs my "/Levels" is a real problem?
OutputLog
That's where I'm finding the invalid URL errors, yeah. Maybe it's all to do with the "listen" argument because it doesn't complain the first time it loads the map when the game opens... only when I press the key to open it again with "listen".
did it print the invalid URL you tried to open?
The log does like this, yes.
I think the reason my client side pathfinding isn't working is because 'character movement component' is fighting changes. It works if i disable chars 'replicate movement', but then I obviously lose replication of movement... How can I replicate those changes without movement component? I'm already multicasting from server and doesn't seem to be working
this is wrong ... this only spawns the bullet on the server ... should i call a multicast event from there with the spawn so all clients have the object too ?
@zenith wyvern what are you trying to do
I'm trying to convert top down template to multiplayer. I've seen a dozen solutions over the last decade online, and many of them get me close but none perfect
im doing the same right now Niim 😄
I understand simplemovetolocation wasnt supposed to work on multiplayer, but since then allow client side navigation seems to have been added
but, ive got an issue where when the client has focus, it ruuns in place, as if the client having focus is firing something thats fighting
if i just tab over to any other window, he runs properly
yeah exactly
@meager spade that looks good to my eyes ?
yeah client moves instantly
i basically overrode some stuff in the CMC and Player Controller
and made the player Autonomous
then it moves just like as if you are pressing WASD with the normal CMC
so it does use the cmc
ye
but since you two seem to have a clue about network, can you look up my screenshot and tell me if my assumption is right ?
@glacial burrow mark the bullet as replicated
and it will replicate itself
hopefully your bullet also has projectile movement
so it can smooth itself
as long as its replicated actor and has replicate movement ticked
it will also be spawned on all clients (via replication)
wow that was easy
thanks for the help 🙂
when i want variables to just be on the server, i just dont replicate them ?
I want a list of hit targets in my bullet so each bullet only hits each enemy once
i was trying something similar with CMC and SimpleMoveToLocation, but even in editor i get a lot of error corrections, and the pawn jumping being set back, and its even worse outside the editor. the plan now is to ditch the CMC entirely
ive been trying to do with CMC off, but that just creates new issues
seems crazy to me, especially given the MOBA craze, that there isn't a simple solution for basic click to movement in muultiplayer
not basic, with pathfinding...
figured, thats why im looking to get around it. its only fighting me
Of course CMC does an immense amount of work by being mutliplayer enabled
Re-doing that is no small feat
yeah, and speaking of, i have a question regarding the topic too.
i'm currently wondering whether my character should be possessed by the player controller,or an aicontroller, since you dont control it directly(but a camera actor instead), and you get some benefits like it being able to use aiperception. but it makes things a little more awkward with ownership, playerstates not being on the character, and probably a myriad of other things i'm overlooking right now
Hey .. wondering if someone could help me with some basic concepts...
I'm running this off a UI Button Click....
When I run it from the Client, I get the message: No owning connection for actor BP_GameStateBase_C_0. Function SendChat will not be processed.
I don't get it .. Of course it's the "Owning Client" because the UI is owned by the client. What am I not getting here?
so my current thought is to go back to possess the character with the PC, and implement the perception features i need myself, and dont worry about any of these other things
are there any other downsides for sending commands to an aicontrolled character, it being a simulated proxy instead?
@next fable Can only run server RPCs from player controller, possessed pawn, player state, objects owned by them.
Game state, which is the relevant actor, is not client owned
So the RPC fails
@bitter oriole Thanks.... I knew it was something stupid...
writting multiplayer code for 6 months and I still don't know what i'm doing. 😦
In pursuit of tracking down this Invalid URL error, I tried executing an "open" console command instead of using the OpenLevel node. Now, unlike before, I even get the error in PIE. With OpenLevel, the error only appeared in the packaged game's log. The plot thickens...
Maybe one just can't open the same level they're already on?
And it only triggers the error if I include the "?listen" option. If I don't provide options, it opens the level without complaining.
Is there a way to specify that a certain default actor component is client only?
Or should I just go HasAuthority()->Destroy on its BeginPlay or similar (which feels hacky)
Create it on the client in BeginPlay
Has anyone tried the Network Prediction plugin, and it is it relatively stable?
I had a little tryout of the demo project, it looks pretty good so far! Not had a go on the master branch version though
Oooh, neat! I've been using GAS for some prediction, but I'm working on implementing things that might be better suited for generic prediction
Is that a plugin by Epic themselves?
Yup!
Oh... I didn't know any of what they were working on was accessible.
It's in the 4.25 release actually (not sure what release they added it in)
Yeah I think it was in 4.24, but the 4.24/4.25 versions are quite out of date now
I'm also not sure if it has a dependency on Chaos atm
Ah, dang