#multiplayer
1 messages Β· Page 493 of 1
exactly you need to PingServer the query port
the game server port will be in the response
yea it was a pain in the ass for me too to figure out but thats the benefits of Steam's secure system
Yeah true
I know Epic didn't want to mix subsystems but they really didn't communicate that well enough
When I got the UniqueID mismatch error after updating to 4.22 I was a bit annoyed
For PAX I was implementing a -lan command line argument which disabled Steam completely and used lan
would -nosteam not do that?
not on shipping builds
"Winsock2.h"
make sure to wrap that code in #if PLATFORM_WINDOWS
also do you use Visual Assist X?
if not I'd highly suggest getting it
Yeah I do
Suggested a scrollable list of headers to add to fix this
So I rather asked :D
yea
ue can be a bitch we had a problem with cooking mods for linux servers on a windows machine
the UAT needs the linux toolchain for staging which is stupid and not ideal for users using our editor
but we ship the editor on stock 4.20 so what I ended up doing was i ship a custom patched UAT with the mod editor and if you initiate a cook it will backup UE4's original UAT and patch in our custom one, cook with it, and after it copy the original one back as if nothing happened
feels super hacky but gets the job done
Yeah I doubt any modder will notice :P
Will do, thanks a ton!
Can anybody confirm that 4.23 generates the dedicated server build for Windows or Linux without any errors
I m having unknown error
@worn nymph I am trying to get my multiplayer working on a Linux Server (Strato). UE4.22 Visual Studio 2017. I am following the steps according to https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)#section_7_Building_and_deploying_a_UE4_dedicated_server_for_Linux . After coping the game and gameserver file to the server. I tried to start the server and got the following error : ./FluidDynamicsServer -log
./FluidDynamicsServer: error while loading shared libraries: libApexCommonPROFILE.so: cannot open shared object file: No such file or directory . Somebody a suggestion?
I started with 4.23 and Visual Studio 2019. I also got all kind of errors. So I went to 4.22 and VS 2017. I made sure that VS 2019 was really uninstalled from my computer. Compiling went without a problem. Next phase is to get the project working on the linux server
@steady dirge means for you also 4.23 is not working
If you are building binary for dedicated server
@rich ridge I did not get it working, but I am not an expert. Maybe it also had to do with the fact that I had VS2017 and VS2019 installed?
I have 4.22 with 2019 and it works fine
So if there are errors, they come from 4.23
@thin stratus Did you also get your game working on a linux server?
@thin stratus So how did you get it working on the linux server?
Building the Server is kinda straight forward. Then I deploy it onto a docker container to make sure it runs fine in there and after that I just use an image of that container
That way it doesn't matter what the Linux Server has
@thin stratus Which docker container?
@thin stratus I found the website. This is new for me https://unrealcontainers.com/
You don't need that. You can do it with the defualt docker stuff. Doens't need extra ue4 setups
@thin stratus I am looking around on the web. As I said docker is new for me. Is there e website I could look at
The fastest and easiest way to get started with Docker on Windows
hmm I'm attaching an actor to another actor in a multiplayer game - I get weird behaviour sometimes where it's like the attachment is quite offset
@thin stratus Thanks, I will give it a try.
@thin stratus I am still trying to grasp the docker philosophy. If I am correct , I will build my Unreal project in the linux docker on my windows computer. So I download the Unreal Source and a Linux compiler in the docker, build the dedicated server in linux in the docker and next image the complete docker to my linux online server. So crosscompiling to linux in UE is not necessary?
Hello... This must be a very basic question. I am trying to implement facebook login with the online subsystem facebook. I already have a server that does the mapping after I get the facebook Id.
@steady dirge you got it wrong buddy,
What you need to is u can build your dedicated server and run it inside the docker so that u actually don't need to host on remote sever at least for testing. In this way u are saving some money that you can spend while you are promoting your game.
You connect your clients to the docker
@rich ridge Ok thanks. I am gona try, maybe I get the same error as before π
That's not what the docker is for either wtf
You are still paying hosting costs
You download UE4Source. You setup the Linux compilation stuff. You build your Linux Server. You setup a Docker image that represents what your final Linux should be (e.g. Ubuntu 18.4 or so).
You utilize Docker to copy over the DedicatedServer build to the docker container. You make an image out of this and now you have a self-contained system that you can just put onto whatever allows it and your server should 100% run.
As long as it runs in the docker container that you setup and you use that image in the future, you can be sure that it will work
We upload these docker images to PlayFab/Azure and they just run then
@thin stratus you mean I can't run docker on my local machine
Sure you can, but that's not what this is for
You can also just put a Linux Machine up
And run it on there
If all you need is a server running
Well, the testing part of the docker container is part of the process
I said for testing purposes you can use docker locally
But yes you could also use it to just test locally in general
But that's also achievable with a lot of other systems
e.g. VMachine or just a laptop with linux
Let docker scale locally
@glad sedge what do u mean?
Ah, just general chit chat.
I've learned a bunch of stuff about multi about mid-way through my project.
Well, I do have a question of sorts related to Multi
I seem to have an issue with projectile component and the speed at which it overlaps a character's sphere to initiate a 'snap to component' function.
But sometimes I get this weird offset and I'm having trouble finding what it could be, multi-wise. In my case I have sports game, so the ball is spawned and owned by the GameState, and its movement and itself is replicated. So I'm not sure how attach-to works with regards to an actor being attached - I imagine it's just replicating the movement, but if it's attached to a pawn - how does that work?
how do I show a loaing screen during connecting to the server for the first time?
this didnt work for me.
https://wiki.unrealengine.com/Loading_Screen
@thin stratus @rich ridge So the most important benefit of a docker is that if my UE dedicated server works on my linux docker on my local windows computer, it will also work on the server in the cloud. Thus the docker also takes care of the ports. Because that also can be an issue.
docker*
@thin stratus Changed it π¦
Ports probably not
As that is the router that sits between you server and the outer world
But yes, the rest is basically the idea of a docker container/image
Update: looks to be my bone was causing some issues (maybe related to WeldSimulatedBodies?)
So I installed docker, made an ubuntu image added my compiled unreal files (game and gameserver) Try to run , but still got the same error : ./FluidDynamicsServer: error while loading shared libraries: libApexCommonPROFILE.so: cannot open shared object file: No such file or directory
well does libApexCommonPROFILE.so exist where it should be?
Where should I find it. I used this guide https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)#section_7_Building_and_deploying_a_UE4_dedicated_server_for_Linux
I found a forum discussion om a similar problem. The suggested answer was that it should be included in the package, I think I did so? The result of the packeging is 1 big exe file
According to the guide after compiling the server and game there a 2 files Game.exe and GameServer.exe. All the lib should be included?
Yes for linux and yes both are files without .exe
Yeah the game one you don't need
Only the Server one
You should also look into using UnrealFrontend to build and package your Server
You should have these files in your main server folder
In the the tutorial You needed both Game and GameServer
Then the tutorial is wrong
Game is only needed for the Client
If you use the UnrealFrontend, step 2 and 3 will besically be one button press
And it will also only generate the server
You can find the Frontend either in the editor
Or in the Source Engines Binary folder
Thanks I am going to look into UnrealFrontend
When I start UnrealFrontEnd, it has to do with compiling for other devices. There is no linux there?
I found the Add An Unlisted Device. I can add a Linuxserver. Looks all very complicated. I hoop there is some proper documentation
Most video's on Youtube discuss Frontend in UDK? <2013 Old
Can you do saemless travel to lobby after game? It works for server but not for clients π¦
i m running my current event on server
you can
as long as lobby is on same game instance
as in same instance of the game on the same machine
just to cover checkboxes, i can imagine a scenario where your lobby and play GameModes aren't the same
and you forgot to check seamless travel on the play GM
@gray scroll
@winged badger but for server... they can servertravel without the lobby and gamemode being the same?
Because the server is able to travel
but just not client
if server starts seamless travel clients get pulled with it
i have a server event that runs that calls another server event that runs servertravel on each player controlleer @winged badger
but client is not moving to the other map... just server
that isn't how you typically do seamless travel
seamless will call the travel on each PC under the hood
that is hard travel
maybe you are thinking in cpp... in BP... i can only do it via console command
oh then what should i be doing
run the console command
thats a listen server?
yes
ServerTravel <LevelName>?listen on host's PC only
with boolean for seamless ticked in GM
Should connecting Android and PC in the same LAN via the session nodes work by default? Or would that require a special setup? In this particular case I want Oculus Go/Quest devices to connected with a Vive on PC.
What is the C++ equivalent of Event AnyDamage?
@clear salmon OnTakeAnyDamage
i assume i need to bind a function to that delegate
eh well sorry, im setting it up for multiplayer π considering it is a Server Side Event right
@craggy oxide Technically, if both use SubsystemNULL, it should work.
Thanks a lot for your reply, @thin stratus ! Thought that not having the Oculus SDK installed on the PC but using it on the APK might be the issue.
Guys, I have a very weird problem. I have a multicast node. When my dedicated server and TWO clients are connected everything works fine. When I have three clients connected and he multicasts the multicast doesn't happen AND the whole server crashes for UnknownFunction errors?
anyone else noticed this problem as well?
It has something to do with the actor set to replicate or not while debugging further
I've changed the multicast event to a gamestate with onrep and fixed the problem
still weird
GameMode multicast to two actors in level
So something in those actors would change
This works to host a multiplayer session in editor and opens the specified map
but when I package and run this on Android, nothing happens
Is there a different way to create and join sessions in Android
Hey, is root motion only supported by ACharacter children?
all documentation seems to refer to root motion as being a feature of characters
but nowhere specifically says it is 
if you look in ACharacter.h you can see how it's implemented and copy that to other classes. I think there is unfortunately no Interface or class which handles this by itself
#include "GameFramework/RootMotionSource.h" maybe you will look here for rootmotion
ye I feared as much, ty
Is there anything special to netprofiling on a Steam listen server?
My log gets flooded with this LogOnline: Warning: STEAM: FInternetAddrSteam::GetIp is not supported and will set OutAddr to 0..
I am not on a shipping build with UE 4.21, if that's relevant.
Anyone else having problems finding sessions using Steam Advanced Sessions?
?
Hm, whenever "Find Sessions Advanced" is called it immediately fails. I can Shift-Tab and my name in the game is my steam name
@worthy perch Well Steam doesn't support ip addresses like this.
@twin juniper it's blue cause you are casting PlayerController to PlayerController.
Alright. I was more so wondering if anyone else has run into this issue while trying to netprofile.
Strangely, I seem to be the only one who has this warning.
I don't think this warning ruins the netprofile, but it's definitely annoying in the logs.
Unless there's another way to profile.
well it does if you disable p2p sockets
@thin stratus yes, I think it went wrong at some point with too much data or something
Can anyone answer my question posted 15 hours ago?
Null
And you are in the same LAN?
Does the Session create or not even that?
Do you connect to a PC, from a PC or both Phones?
Logs?
How can I get logs? via adb?
okay.
I also heard that there was this bug in 4.21 and 4.20. So i just installed 4.23 now. Let's see if that works
Yeah that happens if you try to create it more than once.
Or if you didn't properly destroy it.
Soooooooo DedicatedServer + Steam, right? Our most beloved topic here. What is up with the #defines in the AsyncServerSteam cpp?
- Aren't they exposed now to the build.cs or Target.cs file?
- Are they still too long so you they have to be redefined to not cause an overflow?
Oh what
They made them even longer?!
#define UE4_PROJECT_STEAMGAMEDIR STEAMGAMEDIR
.>
Actually not sure if that was the overflow then
Is "not able to locate the map" the problem here or is it something else?
Well you are using GOOGLEPLAY as Subsystem in that screenshot
GooglePlay has no Session Interface
The other thing is the map missing I guess
Not sure how you package and how everything is setup
I thought everything in the Content folder is cooked unless you specifically exempt it
i think there is a option to not cook non referenced assets
Still trying to figure out why cross-platform local multiplayer isn't working: PC and Android (Oculus Go) can both host and find the other platform's game. Android can connect to PC, the map will load/travel just fine. PC cannot join Android. Android cannot join Android. Travel doesn't seem to happen in most of the configurations. :/ Any ideas maybe?
It's a rather simple VR game. What would make it a heavy scene?
So a quad overdraw could lead to the system not being able to join another in multiplayer, even when they can do singleplayer just fine?
if it works in singleplayer just fine it shouldnt be a problem
We had it working over online multiplayer at some point, but wifi, voice and gameplay make it hard to really play it via online service, due to the lag
It's rather frustrating that the games work solo, host can be found in network, but joining/traveling just doesn't work. Tried opening the map with ?listen, as well as staying on a lobby map, to then do a ServerTravel, after a client joined the host. Neither seems to be working as expected.
does anyone know what the difference is between BeginPlay and StartPlay in AGameModeBase?
startplay calls beginplay on all actors (including the game mode itself)
void UReplicationGraph::RemoveConnectionGraphNode(UReplicationGraphNode* GraphNode, UNetReplicationGraphConnection* ConnectionManager)
{
ConnectionManager->RemoveConnectionGraphNode(GraphNode);
} // anyone know why use removeconnectionGraphnode will also kill the playercontroller?
Can a dedicated server handle more than 1,000 simultaneous players?
@vapid egret It's not impossible but you probably don't own the hardware to do it and it's too expensive to pay a thirdparty to host it
for a single dedi? it is impossible
no, split
only way you can do it is splitting the load
What if I make a network, can unreal connect tcp and udp connections without problems?
I've only done ded with AWS, not sure about native UE networking, Zlo might know
SpatialOS is a middleware that uses unreal networking and allows for distributing the load over several servers
Anyone up for some Linux Steam DedicatedServer debugging?
[2019.09.26-16.19.05:419][ 0]LogOnline: Verbose: OSS: Creating online subsystem instance for: Steam
[2019.09.26-16.19.05:419][ 0]LogOnline: Verbose: STEAM: Initializing Steam Game Server IP: 0x00000000 Port: 7777 SteamPort: 7778 QueryPort: 27015
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
dlopen failed trying to load:
steamclient.so
with error:
steamclient.so: cannot open shared object file: No such file or directory
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[2019.09.26-16.19.05:419][ 0]LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
[2019.09.26-16.19.05:419][ 0]LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
[2019.09.26-16.19.05:419][ 0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2019.09.26-16.19.05:420][ 0]LogOnline: Warning: STEAM: Steam API failed to initialize!
[2019.09.26-16.19.05:420][ 0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
Checking for steamclient.so tells me "You shouldn't even need that for a gameserver."
Sooooo this should just be normal ue4 code
It falls back to using IpNetDriver, so I can't ignore this I guess
Well it says no such file
There is also "No such file", as this is not a steam client
adding the steamclient.so from the steamcmd fixed it
But the docker has connection issues to steam even though I should be openeing ports properly, but well
Hey guys, I'm having some trouble setting up a dedicated server for our project. as outlined in this guide: https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)
I've followed the instructions and I have a dedicated server running on UE 4.23.1 like so:
but it doesn't seem to actually listen on port 7777, or even load a map. I can't join it. I've repeated the build process many times and beyond it not listening on port 7777, there doesn't seem to be much else going on. Logs don't say anything beyond what you see in the screenshot.
Building a server with a blank third-person project does work, which tells me it's specific to our project. Does anyone have any ideas?
Hey
Does anyone know if you can connect to ip address using advance sessions plugin
You can connect via ip without it
with open (ip) ?
Also why is my char not moving or accepting any inputs in Multiplayer
Yes, open <ip>
Cause you mostl ikely did something wrong
We have no idea what
It's like me asking you why my microwave isn't working
(it does work)
Anyway, my Linux DedicatedServer doesn't show up in lists but allows steamp2p address connections
So I guess that's fine /shrug
Is that with steam?
Non steam
Can only guess
Multiplayer movement is immensely complicated, so take it step by step
Check that RPCs fire, check who's possessing the pawn, debug everything
In any case, Steam is not related to this
Did you try with multiplayer in editor first ?
So start there
Open the editor, and just play with two players first
Dedicated is much harder to get running
So forget about that, and go back to the basics
Editor, two players, no "open" or Steam or dedicated
Yes, that
its loading
Hit play, and get your code to work there
Did you make sure to hit "play", not "launch" ?
i did
the other client is connecting to something
It failed
This one i see map but cant move
Well, disable whatever in your game code is trying to connect to stuff
This is a "your game" problem - a new project does not do anything like that
could it be character BP
it could be anything, but I can't help you, since I don't know anything about your project
What's v100 ?
Look, I've no idea what you're doing here
That one has multiplayer working
That one ? What ? Your game ?
Okay ? So all is well ?
So fix the error
I tried remaking all blueprints
i think its an engine issue
but the multiplayer works
If the packaging fails, put the log on pastebin and share it on #packaging
www.paste.org - allows users to paste snippets of text, usually samples of source code, for public viewing.
Clear the log and restart the packaging so that you have only the last one, or only put the end of it
Lots of error in there
LogBlueprint: Error: ProxyFactoryClass null in K2Node_LatentOnlineCall /Game/Blueprints/Multiplayer/ExampleBlueprints/ExampleAdvancedSessionsFunctionsChar.ExampleAdvancedSessionsFunctionsChar:EventGraph.K2Node_LatentOnlineCall_31. Was a class deleted or saved on a non promoted build?
This ExampleAdvancedSessionsFunctionsChar Blueprint is broken
[DragonAnimationCharBP] ANIM_MOUNTAIN_DRAGON_death to ANIM_MOUNTAIN_DRAGON_idleLookAround will never be taken, please connect something to Can Enter Transition
And finally, master_vine_spline_C has materiual problems
Failure - 2 error(s), 6551 warning(s)
Still think it's an engine bug ?
MenuCaroussel
was the problem
in v200
Now it's ExampleAdvancedSessionsFunctionsChar, DragonAnimationCharBP and master_vine_spline_C
Fix these and you'll be fine
Problem fixed
evreything works
it was a depresed option
(A option which wasent supported by ue4 anymore)
Hey guys quick question. If I declare a NetMulticast on an actor, and call that NetMulticast from the server on the actor, will the function only be called on clients that are relevant to that actor? Or is it server wide?
there is no actor on client if its not relevant
@outer wolf it depends, is the actor to set to replicate? If so then the netmulticast function should be called on all relevant clients. However, there has been debate around the forums where people point out that the netmulticast function in this case would get called on all clients regardless of relevancy. You can see these discussions here, https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1501818-need-some-clarification-on-netmulticast-events-and-actor-relevancy. And here, https://forums.unrealengine.com/unreal-engine/feedback-for-epic/1511578-improvement-of-netmulticast-to-save-performance-and-bandwith-on-nonrelevant-actors. Of course if the actor only exists on the server, then the function will only get called on the server.
@fleet raven sorry to bother u, but do u know what triggers the StartPlay function in AGameModeBase to get called?
@twin minnow how hard is it really to find the function in the source code and search references?
fair enough, I should have done that before asking. It seems to go UWorld::BeginPlay() -> AGameModeBase::StartPlay() -> BeginPlay() for all the actors
Just for testing purpose i only add walk forward animation to final animation node server side everything is good but client has foot sliding can anyone help me
Hey guys. Just read the documentation of the CharacterMovementComponent and saw that MovementTimeDiscrepancyDetection is disabled by default. But why? Are there any disadvantages using the detection and resolution of time discrepancy?
Can someone identify that what is Presence on Online Subsystem?
Overview of the presence interface.
@bitter oriole Thanks. Got it.
Does Unreal also use tcp for networking or only udp? Are reliable RPCs send via tcp and unreliable RPCs via udp?
IIRC it's UDP for both with TCP-like logic reimplemented on top for Reliable RPCs
It doesn't matter tbh
Reliable behaves like TCP, Unreliable behaves like UDP
K, thx
I'm trying to implement a multiplayer system similar to planetary annihilation where they send data about stuff in keyframes and interpolate to the keyframes on the client as detailed in this article https://www.forrestthewoods.com/blog/tech_of_planetary_annihilation_chrono_cam/
Technical deeptime into the unique networking architecture of Planetary Annihilation.
and that makes perfect sense if you can predict stuff, like if you say "by 55 seconds ingame the building will be constructed", then the clients can interpolate the rest of the construction. however if you are sending position data, that you cant predict the future of, the client will have to interpolate this information with an added delay
but I cant think of a delay method that wont break due to a higher ping. like if I have a set 250ms delay,that would mean anyone with 250+ ping the interpolation would no longer function
Shouldn't "IsDedicatedServer" work in PIE too? o.o
So you can't do "GetNetMode()" in gamemode
YOu have to do GetWorld()->GetNetMode for it work in PIE
sigh
Is it possible to create Character (with CharacterMovementComponent) and replace mesh to be something else, for example car, airplane, ship... Can we assume that interpolation and prediction should work?
yep
Hello everyone, I have a snippet of code that makes sense to me but apparently not to Unreal, as the netmulticast is never being called on other clients (other than the one originating the first server call). Any clue?
void AVVPlayerController::Ping()
{
UWorld* World = GetWorld();
if (!World)
{
return;
}
if ((PingActor) && (!PingActor->IsPendingKill()))
{
return;
}
FHitResult HitResult;
if (GetHitResultUnderCursorByChannelIgnoringSelf(UEngineTypes::ConvertToTraceType(ECC_GroundTargeting), OUT HitResult))
{
Server_Ping(this, HitResult.Location);
}
}
bool AVVPlayerController::Server_Ping_Validate(AVVPlayerController* PingOwner, const FVector WorldPosition)
{
return true;
}
void AVVPlayerController::Server_Ping_Implementation(AVVPlayerController* PingOwner, const FVector WorldPosition)
{
UWorld* World = GetWorld();
if (!World)
{
return;
}
Multicast_Ping(WorldPosition);
}
void AVVPlayerController::Multicast_Ping_Implementation(const FVector WorldPosition)
{
UWorld* World = GetWorld();
if (!World || World->IsServer())
{
return;
}
PingActor = World->SpawnActor(PingActorClass, &WorldPosition, &FRotator::ZeroRotator);
}```
that kinda looks like it would run only once
the actor dies on its own after a while
Well
You are aware that this PlayerController
Does indeed not exist on any other client
oh shit
you're right
when I do the netmulticast
it tries to do it on itself
not A player controller
on the clients π
hey, since what version doesn't that immediately boot clients out?
It boots clients out if you mark it reliable iirc
it is marked as reliable
Then they fixed that
I had the same issue @winged badger. I had a component that could sit on multiple classes, one being the PC.
A multicast was to update everyone (inventory UI). On PCs it caused the booting.
along with replicating TMap not crashing anymore, just spamming warnings
TMap replication. Hope will never die.
its not that hard to do it by hand
Depends on the stuff in the TMap
its easy to do it by hand, generic way not so much
It was a simple Struct of 2 TArrays
With Keys and Values generated.
Probl was iirc, that the values had a struct again and in there a Tarray of actors.
The size replicated fine, the Tarrays of actors broke
Epic's response, nesting that stuff is not really supported.
So you can do the TMap replication via 2 arrays, but it really depends on what shite you are having in the arrays
worst case, you can actually write a NetSerialize yourself
It all goes down to being two arrays again though
at least there are some excellent examples in the engine
Keys and Values
Right, it's also a special case
I think it's
TArray<FStructA>
And StructA having a TArray<AActor*>
And that TArray<FStructA> is the Values array.
And replicating that gives the right sizes for the inner TArray<AActor*>
But the values are broken af.
If the first Array has e.g. 3 entries, all 3 entries are valid.
All following Arrays have up to 3 valid entries.
So if you have e.g. Two arrays in the FStructA, first having 3 entries and second having 5 entries.
After the replication the client has the first entry totally fine and teh second with size 5 but only 3 valid entries.
Total shitshow
ouch
All 8 Actors in this example are replicating fine and available
It always depends on how many entries the FIRST array in the struct has.
Has it 0 entries, all following actor arrays will have the correct size but not a single valid entry.
And yeah, "ouch" is a good reaction to that :D
bool FHitResult::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
excellent example of NetSerialize in engine, btw
you could theoretically pack all AActor* arrays into a single one, then serialize an int32(length) for each struct instead of the array
(that is beyond the point what i'd consider elegant code)
But that's where the fun begins :D
does anyone know where the UniqueId variable in AGameModeBase::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage) comes from? For example, when a player connects to the server I currently call OpenLevel, so I know I can pass options to that method call. However, do I pass in a uniqueid through that method as well? Or do I set the UniqueId in PlayerState before connecting to the server?
That stuff usually comes from the underlying subsystem
so this uniqueid shouldn't be manually set?
Usually not, no
ok gotcha. I was just wondering because I have to assign a unique player session id for aws gamelift and wanted to know if I should use this UniqueId parameter or just make a new property for it.
No, you need to keep that the same type as your client is
Otherwise you will be outright kicked from the server on connection
So whatever Subsystem your client uses, the server has to use the same
so does the UniqueId in PreLogin correspond to the one in PlayerState before and after calling openlevel?
Technically it corresponds to the ID it has all along
afaik the ID is passed on connection
Your PlayerSessionID has to be passed via the options
Not via the unique id
oh ok i see this is what I do now, passing a playersessionid via the options.
would it be bad practice to use the unique id as the player session id for aws gamelift?
I just said you shouldn't touch it :D
GameLift has nothing to do with your Subsystem
The ID should be stored and passed additionaly
alright, thank u for dealing with my ignorance
Also are you using Steam on the Client?
not currently, but eventually yes
Then be ware of the fact that UE4 will force you to have Steam on the Server too
And Steam doesn't do IP connections
So you will have to get the steamID of the Server from the IP you get from Gamelift
- Crossplatform would require you to setup your own subsystem to get a uniqueID that is shared across all devices
In case you ever want to go the way of Xbox etc.
thank u for the heads up, will definitely keep this in mind
Does anyone know why advanced sessions give you a username you dont want
i set Username but it keeps changing it!!!
Arggg
Advanced Sessions doesn't have anything to do with the Usernames afaik
You can set a ServerName
Not sure if they allow passing any other data along
the default/null subsystem uses the computer name of the client as the user name, it's extremely dumb
Yeah cause you actively set the name
Yes
Or from some backend?
Tek Plus Network API => Client => UI name
If it's from the client, then you need to tap into the ClientTravel function iirc and pass ?name=Dragon Test
ClientTravel function?
Usually ClientTravel is called when you use the JoinSession function
Ok
Once the Session is joined, the client travels to it
So you'd need to adjust that
Since you have the source of the advanced session plugin you can easily do that
Be aware that Multiplayer dev will force you into c++ eventually
No one said that
or i can use C++ in the blueprint
You can but not for this
You have to edit the plugin source you have from the advanced session plugin
To pass the name with it on connection
You have to turn your project into a c++ one
Then you can see the source of the plugin too
By adding at least one c++ class via the editor
mind there is no way back to a BP only project after that
at least afaik
So make sure to push all changes to your source control first
Just close the editor, remove your intermediate folder , rightclick the uproject file and hit "generator visual studio project files"
That should give you a fresh intermediate folder
and an .sln file if you don't have any already
If you open that you can access your new class and under plugins in the solution browser also the plugin source
Once you did your changes you can rightclick the project in the solution view and hit build
Once that build you can open your editor again
No, they won't
so it breaks the entire game?
-_- no it doesn't
okay
i trust you π
hopefully my beta testers wont be like what happend?
alright it has a sln file
That's the source of the plugin, yes
Actually
It's engine level
Why do you have that on engine level
idk
Uff
plugin folder in my project?
Yeah you would need to move it from the engine to the Plugins folder of your project
Then you have to regenerate the project files again (intermediate folder can stay this time)
Would be recommended
alrighty
I hope i can still use blueprints
they are fun π
Alright so now i need to find the class to edit
I found it
That's the wrong class though
You need to modify the one that joins the session
So you can pass the name along
ok
I have been making a Dark Souls like combat system and when I set the Root Motion in the Anim BP to Root Motion From Everything it causes all clients to play animations very quick while the sever plays at the right speed. I can't figure out what is causing this
Might be called something like "JoinAdvancedSessionCallbackProxy" or so
none of that
@thin stratus buddy can you help me with my problem
Are they actually providing a custom node for joining?
I think its get session
Well you are using it
It most likely has a similar name
These nodes are based on the class
They are used to create latent nodes
So nodes that call back later in time
So every one of these Join,Create,FindSession nodes
are each one class with something like JoinSessionCallback
The engine has default ones
so they most likely are named JoinAdvancedSessionCallbackProxy or something like that
How are you currently joining the session
Join Session
And that's the standard node?
Yes
Maybe i can try it with Create session
for client hosted
Like client hosts its own server
well it needs its player name
That doesn't give you the ability to get the name from the clients
So one thing you should do now
Is rightclick your project name in the solution windwo of vs
and hit build
And wait for it to complete
so you can get back to working in blueprints for now
I would say you rather workaround this by storing the playername in either a savegame or the gameinstance of the individual client
And after they connected (PostLogin in GameMode)
You send a ClientRPC
The client RPC gets the name from savegame or GI
And then sends a Server RPC back
can all be done inside the PlayerController class
That is a work around, an ugly one though
or save the unique client id
with a token from the launcher
and get the player name from the Tek Plus Network Database
aka MySQL
I literally asked you if the name comes from a backend
Then the Server should use the unique id of a connecting player
Its a public server
to retrieve the name from the db
so sharing address is fine
Yeah
sweet it worked
so basicly i can mix C++ and Blueprints?
Yeah, you can leave the sln file alone if you don't do any c++
Well yeah
Blueprints are C++ Child Classes
Low FPS and terribly optimized? 
No
WIthout that
My game is pretty well optimized rn
I try to stay away from loops and too many meshes
Too many meshes, that usual performance problem
something is clearly not working
Thats weird
i think its a replication issue irght
Hi, i was wondering, if we have different players in the same game are they all going to be the thirdpersonCharacter?
Hey does anyone know if you find servers outside the network with advanced session plugin?
In this 2017 GDC session, Ubisoft Toronto's Matt Delbosc explores the techniques used in Watch Dogs 2 to replicate vehicle trajectories, compensate for netwo...
Hmm in an online sports game, like NFL, would you make the ball an actor - or would you potentially just set the location of it via the server and then update the client's version of an actor?
Hey guys. Just read the documentation of the CharacterMovementComponent and saw that MovementTimeDiscrepancyDetection is disabled by default. But why? Are there any disadvantages using the detection and resolution of time discrepancy?
it's somewhat broken and can result in false positives
Has anyone managed to advertise (internet tab) a steam dedicated server using advanced sessions plugin in 4.22.3?
What are things that you needed to implement on every multiplayer project, regardless of the actual game. I am compiling a list for me and the programmers to start looking into and setting up the next 4 weeks, while the game concept is being created?
- A menu to handle sessions.
- Custom Session Nodes (or just functions).
And that's pretty much it on "every" project
Rest seems to be depending on the project
What do you mean by custom session nodes, for connecting outside steam and things like that?
We know a few things about the project already, we will be using steam, we wont be doing dedicated servers, we need some kind of matchmaking, local split screen play, drop in drop out system (meaning you cant really play offline and every match is a listen one) and we have to make sure the game runs on ps4, altho we don't have networking license for that, so just running it locally with split screen
oh and we probably need to look into host migration
So you basically want to use a different engine :D
Well at least if you need the host migration
Cause that's pretty much never done if even possible
Haha, ok then I guess we wont be looking into host migration
if you use the replay system, wouldn't it be possible to host again, and restore stuff based on the data from that recording?
But yeah, that is another topic. I also planned to look into proper keybinds support, that isn't MP related but still has to be done for every project
UI for Splitscreen is a nightmare
Specially with Controller support
Be prepared to create a lot of custom widgets that just wrap existing ones
iirc you had to use add to player screen, instead of viewport
We also have to support dynamic split screen like in A way out, so it will be even trickier with anchors and stuff, so I guess I should try test some UI stuff
Any other generic stuff come to mind? Might not even be MP related
Oh, since we will be doing networking, and the gameplay will be done in BP mainly + the replication, what kind of stuff would you recommend that is exposed from C++ to BP, replication wise
Uff, that's really hard to answer
You will just have to encounter the blocking stones yourself
Idk what stuff you could run into
I already have noted the OnRep thing, where C++ allows you to receive a notify even if it is the same as the last update
I also never touched online splitscreen
idk, I am trying to make use of these 4 weeks
wait, I played 4 player split screen on Hoverloop
or do you mean that you havent tried to have a client play in split screen, while networked
Correct
We avoid online splitscreen
- most splitscreen stuff in ue4 is literally just a second camera
And that's performance heavy af
yeah, I have already removed the requirement for dynamic split screen, (the voronoi shit)
as James's research on that proved it will be rly hard to do
So we will stick with the default split screen wrapper, and avoid creating scene capture stuff
The UI in Hoverloop has a lot of custom stuff
Basically every usercontrol is a custom widget that wraps the native one
- the whole umg setup is build up on a way that each widget can pass focus onto an inner widget
until it reachs a usercontrol
cause if your gamepad loses focus, you've a problem
Any specifc reason you avoid online split screen?
No docs I guess
I know they have stuff in place for it
But after having splitcreen and online working, we tested crossing it
And it wasn't working directly
Didn't want to invest time into it
It costs too much performance anyway
But, is there anything specific that would prevent this from working
Unless UE4 has some problem with 2+ possesed player controllers from a single client, idk what else would interfere
How can I have each player have different abilities for a turn based game? Would they each have a player controller so they have different unique turns?
I have a issue with my replication
What is going on?
This is my animation
D: what is causing this i cant figure it out
animation blueprints aren't supported for networking
you grab a replicated variable from the pawn or his movement component
doing networking in BP looks like such a pain
typically for your ABP you'd update the animation state in the Update Animation event, looking at the pawn's state
rather than updating variables directly from interactions, that doesn't really work that well over the network
They already told you how.
- Animation Blueprints aren't replicated.
- You replicate the variables and states in the Pawn/Character.
- You get the variable inside of the AnimBP from the Pawn/Character and save them to AnimBP variables to further use them.
Buddy, it's really not more than we just explained.
By getting the OwningPlayerPawn
That node should even be in the event graph by default
right next to the update event
I seriously don't understand how peeps like you post in #work-in-progress how they push new gamemodes, but at the same time can't cast a pawn to their custom class.
Like, don't get me wrong, great you are doing this and learning it
well im working onit
But seriously, go a step back and learn the basics
I did
No you didn't. Casting is one, if not THE, most fundamental thing of C++/BPs
You should at all times know how to go from Pawn to BP_SurvivalCharacter
Right, you'll figure it out. I'm off to bed, cheers!
So i use update event
Yes
When i cast
Oh maybe i cant make it in the state itself
It crash when i click compile
!?!?!
What is wrong with ue4
I think i got it working now
YES IT WORKS thanks @thin stratus
I was a bit stupid but now i get how anim blueprints work
Simply looking at the anim blueprint of either FPSTemplate or TPPTemplate characters would have helped you here. Just saying
Anyone successfully network replicated a riding system either player riding a horse or a car?
@summer tide Never done that sorry, but isnt that built-in?
hey all, I've got voice chat to work ( using steam oss ) but the volume is super low, does anyone know how to bump it up?
Agh AI returning true for IsLocallyControlled() on the listen server host's machine has thrown me off so much. If I want to make sure I'm only running code (UI stuff that wouldn't matter for AI) on the actual local human player controlling the game and not the AI, would this check be ideal? return OwningCharacter->GetIsLocallyControlled() && OwningPlayerController where the player controller gets set when the weapon is picked up?
IsLocallyControlled should return false on clients for AI controlled Pawns
Oh you mean on hosts machine
Yeah only clients
So on the server they do return true
And run all the UI code
So it's best to have a separate check for IsLocalHumanPlayer() or something right?
Right but you'd still need a reference to a player controller to call that right?
So even returning true if a OwningPlayerController property is valid would be enough for the check I think
That property gets set whenever a weapon is equipped
And player controllers are local always so other clients wouldn't have access to them
Since I have a PlayerController property already in use in the class for other stuff it's probably simpler to just return if that ref is null or not
But thanks for the help
Good to know that IsLocallyControlled() does NOT mean local human player only
In my game there is a timer that starts from 5 to 0 and I want if for example me I shoot you and I have +1 to the score and when the timer is 0 in the player who has the highest score it says you win and at the rest of the players you lose
Who knows it online?
Hello,
I have a very strange problem with multiplayer and I was unable to google this... :D
So im coding my multiplayer game using c++
and I made a rpc call UFUNCTION(Server, Reliable, WithValidation)
Now in the _Validation method when I return false;
The action is activated with a press of a button and now the strange part starts.
Im testing it using 2 New Editor Windows where one is host and other is client.
When the client presses the button that acitaves my _Validation method the Client will be sent to main menu(my default map), but when I do the same thing on the host, nothing happens.
It has not happened to me before, I have used rpc before, and I was unable to google this thing out...
My perfect scenario would be, that if _Validation returns false, nothing should happen.
@faint lintel returning false means the player is a cheater and is kicked from the game
returning true means it's all good to let that RPC happen
You can't help me?
@silent birch reference shootergame they have exactly what you are looking for implemented nicely
Thank you @grizzled stirrup , I thought that when there is a cheater, that returning false would just prohibit the cheater to cheat, but continue playing
π
that'd make multiplayer dev very easy, unfortunately your program has no idea about how the player is cheating, just that he is
@faint lintel I think you're trying to use the _validation for something other than its meant to be used
It's a discord server @grizzled stirrup?
why not just do the validation manually and not call anything to the server
@twin sable seemed, I had a special jump mechanism, that was supposed to be allowed on special occations, I had made different methods for that already, so it was functioning, but then I decided to but it running through the server, and misunderstood _Validation purpose
up until a very recent version, validation is necessary for server RPCs
Who can't help me?
Usually you set it to true if you don't need any validation
kk
Thank you guys! π
Is it acceptable to send a struct of data on every gunshot as opposed to a simple float for damage? For example if I wanted to send a float for damage, a bool for crit, an enum for the type of damage and the instigator actor, is that still fine considering it could be sent say 100 times a second if many players are firiing?
why not?
as long as you serialize it
fortnite send a RPC for every shot
with hitscan
which includes a struct
Ohhh very cool, is there info on how much info they send per shot?
Also how can I serialize it correctly?by not using UPROPERTY(Transient)?
yah they send TargetData
technically it should be 3 RPC's per shot
but they batch it to a single RPC
as they use ability system for firing
search for FGameplayAbilityTargetData
Thank you will look into that for some examples!
thats what they send every shot
As for the serializing question, should I be doing anything special per shot to serialize?
just ensure your struct is as small as it can possibly be
use uint8 over int32, use FVector_NetQuantize over just a FVector
etc
bitpack your bools if you want, if you have 6 bools, put them one after each other, and use uint8 bSomeBool : 1;, etc
plenty of things you can do to make the struct as small as possible
https://media.discordapp.net/attachments/357887918183940096/627789584398549006/unknown.png
Hello everyone, I canβt understand why the client sees the server only inside one network
Thanks a lot Kaos!!
Also Actor references are 1 byte right?
As they are just an ID
4
Ah ok thanks
Yeah I'm sending an AController* and an AActor*
Then an enum a float and a bool
I don't need to , the server can actually calculate both the actor and the controller, but it's part of the struct
Is it less bandwidth to leave those entries empty?
And fill them on the server?
why not make your own lightweight struct specifically for replicating
I calculate the damage info on the client and send it as a const MyStruct&
True I can split it up so the DamagingController / Causer are in a separate struct
It's just that it's nice and clean to have a single const struct passed from the client through all the functions and health component etc.
and make sure it works before you optimize
True! It does work up until now but I was only sending a float before for damage and populating the struct on the server
Just added the type of damage and the crit which the client calculates in my case
But actually makes more sense to just have it all calculated on the server, thanks Kaos!
rule of thumb is, replicate what is needed
replicating too much/un-needed stuff is wasted bandwidth
I'm just in a strange position where I'm doing a lot of calculation on the client because it's not a PvP game
So the client has a lot of upgrade and other info that would influence the type of damage and the crit etc.
So I guess the best option would be split up into two structs, the stuff the client calculates and sends and the stuff the server has access to
in fortnite they don't do calcs server side
client creates data of who he has hit, sends the location of the muzzle of the gun, rotation, etc
server just checks to see if its sane (i.e not stupidly out)
server ensures the firerate is ok (ie enough time has passed since last shot), then validates the shot, and applies the damage
server just does one simple trace to see if the shot was blocked by anything that came to the server (like in fortnite a wall going up) that would have blocked the shot
but apart from that, server does nothing else
Very nice and lightweight
Are there threads on this info? Could learn about how FN does things for days
i asked the question in the c++ forum
and got a reply from Epic Game's Dave Ratti (one of the Ability System programmers)
Very nice!
ill get link
Thanks a lot!
I think I can get my struct down to a float, bool and enum which wouldn't be too bad per shot
So i currently have GAS implemented, and currently working on the weapon firing.
Now i know a lot of games, the weapon is fired on both client and server at
Ty!
I wonder for their shotguns, would they have to send an array of those structs
As potentially a single shotgun blast could hit 3 different people
So 3 sets of separate data in terms of who was hit and how much damage was specifically done to each
so..
TargetData RPC sends a TargetDataHandle
this can combine multiple TargetData structs
into a single struct
for things like shotgun with 5 pellets
its still one RPC
What I have been doing before was an array of DamageAmount floats and an array of HitActors
Send both in one RPC
But with the struct this of couse gets more expensive as you are sending more data per hit
So with a 16 pellet shotgun that's potentially 16 structs
Per shot
right but if you serialize your structs
and only send whats needed
its not that bad
Again is there anything special to serialize other than using lightweight types like FVector_NetQuantize?
Will it be serialized automatically?
yeah but sometimes you might want to write your own serializer
bool FGameplayAbilityTargetDataHandle::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
check out that
Thank you will do!
And if only populating certain entries to the struct, would that be more lightweight than filling all with fresh data?
its inside X:\UnrealEngine4.23\Engine\Plugins\Runtime\GameplayAbilities\Source\GameplayAbilities\Private\GameplayAbilityTargetTypes.cpp
but structs do serialize themselves
so it might be ok just to let the default serializations handle it
Ok thanks I certainly don't have the XP to write my own at this point
but don't be scared sending a struct over rpc
its more beneficial to send one struct over 4 pointers and a float sometimes
for simplicity aswell
It does seem like a lot of info but yeah like you said, both for simplicity and sometimes you really need to send some extra info
A single damage float is fine for simple stuff but more features usually mean more data to be sent!@
And I'm sure the CMC is sending structs on tick via RPC π
Judging by some of the crazy examples I saw before there
So it's probably less data than I'm imagining
yeah but Unreliable
True
Still probably not near the freq I'd ever hit even firing fast weaps so all good!
Will be sure to use stat net
And keep an eye on the average there
@meager spade Sorry last question π If the struct contains an AController* and by default in the struct it is nullptr, does it cost the same when sending the struct with that AController being default (nullptr) via an RPC versus if it was set beforehand on the client and pointed to something? Would it take 4 bytes to send either way?
is it possible to spawn an actor on the local machine only? iirc, if I spawn an actor (it's a widget holding actor, should only spawn locally) on the server it'll spawn for the clients too right?
@solar stirrup Yes if you spawn after an if check of (if (Role < ROLE_Authority))
Or if you also need to factor listen server hosts in then check if the local player controller
yeeeee but if it's a listen server host player
means that the listen server host player will accidentally spawn it for everyone
Not if that object isn't replicated
If it's not replicated it'll only spawn on the listen server host machine
@grizzled stirrup yes, unless you do a custom netserialize
@winged badger hello
look at FHitResult::NetSerialize for an example, they use bitflags to communicate if they are sending some of the data there, and default it if they arne't
hi, i don't speak french π
doesn't matter if you could pack the nullptr in less then 4 bytes, if the struct on the receiving end expects it to be 4 bytes long
i am about to go for a walk, so im mostly afk for the next hour and change
OK
ask your question, plenty of people around
Someone know how I can run anim montages of AI's on Server, so that every player can see the montages?
Thanks Zlo!
The format of the images that we put as his game on unreal engine 4 what format?
Use .tga
@grizzled stirrup It's the right format?
For most things yes it's an ideal format and used by Epic
Not a #multiplayer question btw
@tough totem You have to tell the simulated clients
either multicast it or replicate a property with a struct
Isn't 4 bytes about the minimum size assigned to almost any variable anyway?
Depending on system but lol
no
int8 is 1 byte
int16 is 2 bytes, int32 is 4 bytes, int64 is 8 bytes
pointer is 4 bytes, reference is 4 bytes
which is why its a lot of programmers send a const reference to a type over a certain amount of bytes, like a 20 byte struct copying it would be an additional 20 bytes where you could just send a reference to it at 4 bytes
@meager spade Okay works. Thx so much
when you cast to the thirdpersonbp, and get the player character index, how does one match the index to the proper character in multiplayer? anyone have any suggestions on how to do this?
Send a screenshot?
When you cast to a character, you get the reference to that particular character