#multiplayer
1 messages ยท Page 392 of 1
yes unfortunatly you have to rebuild the engine each time when using source.
what i tend to do as its more efficient is to install both source and launcher versions of the same engine
then this way you can do 99% of the programming of the game in launcher version and only switch to source to build out the server when you want to test a build
@vital steeple
also if you want to use an existing project but switch to source. first build the source engine completely seperate on its own
then in your project you need to completely remove all auto generated folders eg binaries , intermediates etc including ones found in plugins
if its a bp only project you need to add 1 blank c++ class which you can delete later.
then right click project switch versions to source. this should auto generate the project .sln vis studio files.
i always do the build from vis and switch the logs to build only as its easier to see the errors and fix if there is any
To be fair, downloading the Engine update also takes time
Usually if you have Source Engine, you put that on your own GitHub Account (you fork it)
And the you simply merge the new update with your Engine (easier if you have no own changes)
And simply recompile
I mean, without own changes you can also go through the process of redownloading it
.>
What I hate with source builds is the random full-engine rebuilds when unity build decides it wants to reorganize everything
Not going back to source myself, way too annoying
Yeah, we have to use source for some changes sadly
For now it works properly, haven't had an engine recompile
But if you only need it for the server, then it's probably better to just compile it with that once in a while and use launcher version instead
they did a good job speeding up the compile process though
in early source versions it took up to an hour
having it on an ssd now might have something to d with it, but I get it compiled in 15mins now
which isn't thaaat bad anymore
I wish we had dedicated server available in sources
Hello, I'm trying to make music from a Media player replicate in multiplayer
When I run in preview, music works fine. When I Launch the game, it doesn't seem to play anywhere, even to the host. Any idea why this might be?
Ah found an error that says "LogMediaAssets: Error: Failed to validate media source -mp3 song name-
just brainstorming way how i should code my vehicle.. is it common that physics vehicles only run the physics on server? or also on client? when thinking at replicating vehicles..
so what about running physics on server only? so it would always be the same on all clients? or cant whith dedicated servers?
does anyone knows a good tutorial or any info about replicating vehicles?
afaik if you only actually let the server run physics you might have some choppy movement
the way it's supposed to work is that inbetween updates the clients run the simulation for themselves
to "predict" basically
ahh yeah right
but i quess just setting both client (as driver) and server to physics is not enough
@full bane how can the server have physics if its a dedicated server?
is that possible?
its all math yeah but.. i mean... does a Dedi Server run a actual client aswell?? ive read it doesnt.
it differents from a listen server i think..
It doesn't have graphics
Nor does it add any client related actors for itself
such as PlayerController
But the rest works the same way
my god im asking to manny in-dept questions though.. so sorry
+- some other things
my question is pretty simple though
Dedicated server runs pretty much everything
It just doesn't render video or sound
It has physics, textures, meshes, etc
@bitter oriole thats pretty clear, and cool its like that ๐
so, im having a SimpleVehicleMovementComponent and willing to replicate it.. what do i do?
Now physics vehicle would have physics run twice : on the "piloting" client, and on the server. Remote clients would use interpolation only.
Don't know anything about SimpleVehicleMovementComponent
@bitter oriole is this 'out of the box' ?
im so confused about what components and actor default setting to use
Well then experiment with them :P
im in c++ mostly btw
No idea. I've re-made my own movement component myself
@thin stratus ive been experiment with it like 5 days ๐
Only? :D
๐
but if u say experiement with it., it seems not clear
but
1 thing to say, i almost had the actual working thing with one client being a little jagging
however, i remade the code and dont remember it my god
actually its hard as any blueprint flag can easily break the network or physics
so i might just clear up my question again soon, and come back with it ๐ฆ
@worn nymph makes sense. i really appreciate all the feedback!
@thin stratus also thank you for additional help. i appreciate it, guys ๐
I have an issue which I don't know how to fix, basically I have a replicated actor that is placed in the world, this is all good and it works all the clients can see it.
If I create a new blueprint and add a child actor component and set it to be that actor from before it doesn't show up on clients screens anymore.
and I am not sure why, anyone experienced this before?
Has anyone tested what happens if more than the NumPublicConnections number of players try and join a steam dedicated server session? Want to make sure that it doesn't allow them to join. I haven't tested this out yet.
is child actor component set to replicate?
Hi all, could someone help me bind a text from the hud to a c++ funcion without use BP? any help is appreciated
or point me to some tutorial
@winged badger I have the Blueprint Actor set to Replicates = true, but not the actual child actor component, I tried setting that to true as well but nothing changed.
When bReplicates is true the actor isn't getting spawned on the client.
through child actor
hey guys
quick question
how do you handle respawning?
I have my respawn function in the GameMode
and the respawn trigger (input) in the PlayerController
server respawns just fine, but unfortunately the client can't access the GameMode
been wrecking my brain for a few days on this
You need to run the PC function on the server's side of it
So EventInput -> (Custom Event - Replicate server) Respawn on server ->
Respawn on server -> Get gamemode -> ect
oh man, thanks @glacial pollen !
I'll buy you a beer IRL ๐
Hello, is there any good book about multiplayer on UE4? I don't need tutorials, i need a book. Thanks.
I am having this exact issue but I can't seem to find a solution, and what that guy said didn't seemed to solve my problem
For gameplay programmers writing C++ code.
[2018.04.27-21.00.37:175][ 10]LogNetPackageMap: Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [7]/Game/Maps/Colorful_Scene/Colorful_Scene.[5]Colorful_Scene.[3]PersistentLevel.[25]Bathroom_GEN_VARIABLE_HouseDoor_C_CAT_6075, Channel: 5
[2018.04.27-21.00.37:175][ 10]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 5
do plugins work with source builds of ue4?
im getting an error when trying to generate visual studio files for my project regarding the low entry plugin
looks like i have to grab the source for the plugin to compile... which is a problem if a plugin doesnt have the source posted somewhere :/
this all seems really ridiculous just for a dedicated server executable :/
player kills NPC. NPC tells game state that it was killed. Game state tells all player states they get experience. each player state (one for each player) then tells the controller it has gotten more exp, which tells the HUD, which tells the player.
Seems overly complicated.
I suppose I could just tell the controller, but I want every player to get exprience from the kill (co-op, one player might do an assist, and not actually make the killing blow)
@austere lintel http://cedric-neukirchen.net/2017/02/14/multiplayer-network-compendium/ Cedric made a really helpful pdf for UE4 Networking ๐
^ yes that
@vital steeple Plugins needs to be recompiled for Source Engines afaik
@fossil spoke So much for trusting UT code :D AUTGameMode* UTGM = Cast<AUTGameMode>(GetWorld()->GetGameState());
Wait or was that Erebel?
:x
Welcome to the dark side.
Also, can anyone tell me why they remove pawns like this?
Is there any given reason or would simply calling "Destroy" on the pawn directly after unpossessing in the first loop be enough?
Ah well, they could have pawns in the scene that have no controller I assume
Like dead bodies
Hahahaha ```
@DevilsD So much for trusting UT code :D AUTGameMode* UTGM = Cast<AUTGameMode>(GetWorld()->GetGameState());
Does that piece of code has a "//Fixmesteve" note XD?
@thin stratus Hahaha what....
Its a pity the project is kinda paralysed
At least you can file bug reports like that one
Na, it's also totally weird to have that code there
It's in a LineUp actor (lines up characters when requested) and they are restarting controllers that weren't handled yet
Looks totally a wip thing to me lol
Theres probably some extra cleanup reasons why they are destroy pawns like that
Would have to dig further into it to see why.
I mean to me its always insteresting how do different developers approach the problem of the HUD - GameState load, didnt have an oportunity to look there, does someone looked already?
IE - you cannot cache references in begin play one or another. Because GS might load after or before the HUD.
but BeginPlay is called after it replicates the MatchState
ReadyToStart
so GS is loaded and ready at that point
UT is older
It uses the HUD a lot
And basically pulls data on Draw
So HUD Class basically creates sub-HUDs (they didn't use many widgets but made their own widgets) and then ticks them in Draw
don't know about that, my point was that while GS might load after the HUD with Unreal today, it will be there before the HUD calls BeginPlay
anyone knows why its so hard to find any info about replicating PhysX vehicles?
I had in the past delegates failing because of that matter @winged badger
don't remember exactly if it was GS or PS
PS takes a while after PostLogin
Thing was that getting the ps/gs from the begin play on a widget failed
and binding them in the GS/ps for the ui to know when it was ready was failing aswell
but not always
it wasn't something consistent
sometimes it loaded first, sometimes not.
I had to create a timer to retrieve the value and cancel it as soon as it is valid
back in... iirc 4.14
i have done something similar for PS, but not GS
prolly ps yeah, I don't remember exactly
iirc PS won't be created until the Pawn is Possessed (don't take my word on this tho)
uhhhhhhh
and its never safe to access PC from Pawn or Pawn from PC on BeginPlay
actually I might have the thing here to check what it was
OnPossess(ed) is good tho
yeah I use that already to cache my things
GS should log any changes in the MatchState in the Output
but I... was wondering if there was another solution than the timer
because for me when I made it, it was like the dirtiest thing ever hehe
and until it changes to ReadyToStart i think it was, BeginPlay isn't called
possibly the most bizzare error you can do is forget Super::GetLifetimeReplicatedProps() in a custom GameState
no BeginPlay (at least on clients, not 100% for server)
yes I got the project, here on the HUD (HUD base class) I'm skipping frames on begin play till Game State is valid
yeah I guess that what you said, GS won't call begin play until readytostart...
could be, dunno would have to check
but I though that the most common thing for begin play to do is to exec as soon as the actor gets created
gonna do a little test
the GS begin play gets called @ "EnteringMap"
@thin stratus thats what i suspected. i found Rama's guide. i guess i have to hope that Cultrarius is willing to share his source for his plugin. thank you for the confirmation, even if its not the answer i hoped for
@thin stratus tried reading ur guide
Gnah, this freaking sql database
one sec
Try again @slim carbon
So, how does one effectively stop Input from being processed on the Server?
Would I just use "SetIgnoreMoveInput" to true on Server and the use "ClientIgnoreMoveInput"?
is the ProcessInput() virtual?
can't check atm, but i probably go and override that one if possible
Yeah, that's a bit too much
I just want them to not have MovementInput process
Look is fine
But it seems like "IsMoveInputIgnored" exists, but is never used by epic
I could set the MovementMode to None
Seems like the Server is however not able to move if I set IgnoreMoveInput to true
Client simply ignores it
why don't you just deactivate the cmc if using character
coming along stopmovementinmediately
There is a "TurnOff" function too
I just want to know the way that Epic basically gives us
I mean there needs to be one clear way of saying "Don't accept the clients movement input"
And weirdly enough "IgnoreMoveInput" is stopping the server from moving
But the ClientRPC that Epic gives one with the PlayerController, in addition, doesn't seem to work
Cause the client can still move
And I also can't even find where IgnoreMoveInput is used
well I think deactivating or turning it off will be also benefitial for performance reasons, so it would be nice to consider doing so that way
I just don't want them to move
That's basically all. Just no moveInputs
I could simply do my own Variable
And plug that everywhere
BUT, AddMovementInput is replicating on its own
So I would need to use the MovementMode
But that sounds hacky
weird, yeah IgnoreMoveInput doesn't seem to be used anywhere directly
just same some bool funcs here and there
but nothing implemented directly o_O
ty @thin stratus
Yeah and it is set on the client but returns false if queried @pallid mesa
I'm confused
But it's also not helpful then
Cause it's already true on the server
and still allowing movement
So that's also the wrong way
@thin stratus I saw that ShooterGame makes use of it
maybe take a look there, they override completely the functions
so might work as you want
Will check
I was wondering tho, why would that be there without needing an actual override, it should have a purpose
dunno maybe they made the stub for the end user to override and make use of it
Yeah well but where
AddMovementInput goes right into the CMC
Weird, they are also only slightly overriding it
To ignore spectator states
void APawn::Internal_AddMovementInput(FVector WorldAccel, bool bForce /*=false*/)
{
if (bForce || !IsMoveInputIgnored())
{
ControlInputVector += WorldAccel;
}
}
I like how that is not turning up in SearchResults
Yeah It doesn't on GitHub either
Thing now is though, that this is executed on the client
here in the shooter game they apply it directly on the controller when the match starts and ends
Heh, I was actually going to start looking into this today, I don't want players to move at all in the beginning of the start of each game (for now anyway)
Here is the issue
but its very plain
AddMovementInput is a Pawn Function
I was just going to put a bool right after each input
Character doesn't override it
If there is a Component, it calls it on the Component
CharacterMovementComponent doesn't override it so we take the PawnMovement
Pawn movement just throws it back to the Pawn (still no character override)
And sets "ControlInput" if the inputMove is not ignored
That happens locally
Then the ControlInput is consumed by the CMC and later passed to the server
And no more checks happen here, so it doesn't matter if the Server has "ignoreMoveInput" true
So to make this work
One has to either use something else (what?) or get the "IsMoveInputIgnored" also checked on server side in the CMC
No idea about the "IsLookInputIgnored"
Ah, also checked locally
void APlayerController::AddYawInput(float Val)
{
RotationInput.Yaw += !IsLookInputIgnored() ? Val * InputYawScale : 0.f;
}
as far as I see this feature is intended only to be applied on the client, since the setters of this thing are purely client sided on SG, UFUNCTION(reliable, client)
so maybe your intention doesn't suit this property
They aren't purely clientsided
That's a Client RPC added in the PC
The normaly controller has that
There is a normal and a ClientRPC
But yeah
You are right, cause there is a ClientRPC, it is probably meant to be used locally
Maaaan, why is there no easy boolean to say "You aren't movement anymore!"
Well
bReplicateMovement to false but that's also shit
well XD
maybe disabling the cmc at the end of the day wasn't a very bad idea, since the cmc is one of the most expensive components on the engine
What about this
Custom CMC Child
Overriding void UCharacterMovementComponent::ReplicateMoveToServer(float DeltaTime, const FVector& NewAcceleration)
Adding
APlayerController* PC = Cast<APlayerController>(CharacterOwner->GetController());
if(!PC || !PC->IsMoveInputIgnored())
{
Super::ReplicateMoveToServer(float DeltaTime, const FVector& NewAcceleration);
}
I think that would make it, some meh polling but it's cheap.
my internet exploded just when I was about to reply you lol
Yeah well it's already checking that on "AddMovementInput"
:D you have to place a bool somewhere
then gg ! XD
Would also place it in the previous function but that's so big
/** Method called prior to processing input */
virtual void PreProcessInput(const float DeltaTime, const bool bGamePaused);
/** Method called after processing input */
virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused);
As far as I can see, it's still local
So calling "AddMovementInput" directly would bypass ProcessInput
i don't think it would get anything at all from that PCs control input
sure if you went to bypass it intentionally, you could
the input gets taken from the fgenericapplication
then viewport
then < <
and it gets added to the input stack on the controller
UPlayerInput::ProcessInputStack calls them
Anyway, a ServerCheck would still be nice
and ProcessPlayerInput calls it
Actually ReplicateMoveToServer is still local
Ah, they moved the RPC to the Character
Bรคh
void ACharacter::ServerMove_Implementation(.........)
{
GetCharacterMovement()->ServerMove_Implementation(.........);
}
lol
I'm way to tired, something worth to write a note about. But again, I'm tired lol.
i don't see a single non assingment mention of IgnoreMoveInput, with the exception of the Get function for it
but IgnoreLookInput makes an appearance in APlayerController
void APlayerController::PostProcessInput(const float DeltaTime, const bool bGamePaused)
{
if( IsLookInputIgnored() )
{
// zero look inputs
RotationInput = FRotator::ZeroRotator;
}
}
Yeah in the InputProcess
I'm still surprised that the CMC doesn't check for that
Like how are competetive games making sure a pawn isn't moving
why not just null out the MovementInput there if IsMoveInputIgnored ?
Even if the Player tries to force it
Cause that's still local
The first point where it information hits the server is in the CMC in "ServerMove"
Which moves the call to the Character
that RPCs it and moves it back to the CMC
you need it only not to move, or is not having any input controls ok?
I need the Server to 100% disregard Movement
Including Jumping and such
Looking around is fine
I just think you are thinking too much in that property... maybe is a good moment to look for another solution, simpler and easier, like we suggested together before, turning off the cmc or disabling it
I don't know, I still think is a reasonable thing to do
you can wrap the enable and the disable of the component in cute little functions so you can use them when you will. Also when the cmc will be disabled/turn off it won't add to the game thread much
SetIgnoreMoveInput from AController worked for me, from BP
and ResetIgnoreMoveInput afterwards
took a while to find it
Yeah but it's applied locally
If the Client sets the uint8 to 0
It's already not working anymore
And we have 3 seconds of start time where the player needs to stand still
sorry, didn't consider the cheating aspects
you could null out the CMCs MaxSpeed, bCanJump and such
wrap that into a function
they won't be going anywhere
Fair enough
MaxSpeed and bCanJump are probably the only two that CMC handles anyway. After that stuff will probably be coded by me
work arounds here, workarounds there, workarounds everywhere. It seems like that's the way this time XD
Yeah it really doesn't add up for me that there is no check in the CMC for that
In UT Epic just doesn't spawn the pawn
But well that's not an option here
and why not disabling the cmc directly?
you could spawn it, set it as view target, but wait to possess it?
It's done through GameMode::RestartPlayer
Would need to see what I need to override/replace
WIll check that tomorrow
Thanks for the discussion .have to catch some sleep! (:
gn
good night.
Can you change the gamemode on shipping content?
Ah options
[/Script/Engine.GameMode]
+GameModeClassAliases=(ShortName="DM",GameClassName="/Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C")```
" that creates an alias to the mode so you can just use game=DM in that instance and it loads the proper mode when loading the level."
So, being new - very new - i went to try a tutorial. The official one, to be specific, which I've been lead to believe isn't entirely accurate anymore? Nevertheless, I ended up at the part where a host menu should be taking me to a lobby map, but instead it goes back to the main menu. Then when I attempt to go host a game again, it goes to a black screen and my cursor is lost. The logs say that it goes black because theres already a hosted game there, but the first errors that appears is LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART and I'm not sure how to fix that. In my LobbyGameplay BP, the guide had me make a pretty intricate bit of work to respawn characters, but never a ChooseCharacterStart override. So i unhooked the first and put together the latter, but it still has the exact same error
The Guide's build http://imagizer.imageshack.us/a/img924/5863/VUhyQi.png
And the override http://imagizer.imageshack.us/a/img924/712/wCFQlY.png
and ive attempting breaking one while hooking up the other both ways
I was wondering about the CMC replication, could the network prediction be done with fixed latency value?
Anyone know a good tutorial for team death match setup?
well, it's a FFA with team tags
only major difference is actually keeping track of team scores
and switching player color to match the team
Yeah itโs easy in concept but not really easy on doing it xD
it's not that complex ๐ค
adding replicated team variable on pawn or playerstate, OnRep changes Mesh material color param depending on variable content
upon death, check source of last damage and and report it to gamestate to see which team gets point
and team check on damage receive events if you don't want friendly fire
@raven holly You can set these alias up in the normal setting by now
No need to manually enter them via ini file
Project Settings->Map and Modes
And then some of the advanced drop down arrows
oh ok
Alrighty, I'm most likely a
, but how do I not make my Server's User Interface(since he is a player, himself) not appear on the Client's screen?
@tawny raven Well, filtering the Server
If really only the ListenServer needs a specific UI, you could spawn it via the GameMode
Hello. I have one PC, so i can't check it. If i set DefaultPlatformService=Null, will i be able to use nodes Create session/find session to play within my home network on different PCs? I know that i can connect by "open ip", but i'm interested exactly in sessions. I think that it wouldn't work, because my subsystem is off.
Come from the other side: I want to use sessions in my logic to play LAN, but i don't want to use Steam or other systems, what should i do ?
SubsystemNULL allows you to use Sessions within LAN
If that's what you want to know
SubsystemNULL does NOT allow you to use Sessions over the Internet
@austere lintel
@thin stratus thank you, i know that i will not see my session on the same PC and this confuses me
Can foliage be handled in MP? (removing and adding instances) almost seems possible as long as the server handles it, right?
Hi all. Iโm sure this has been asked a million times and it might come across as a โdumbโ question but what would be the best way to handle dedicated servers for a multiplayer game? I have integrated Mach making with the GameSparks plugin in my project and have tested it fine locally with 4 players (all from my own pc)
At this moment Iโm stuck and canโt figure out how to run a dedicated server and/or on what platform. I have seen the Amazon AWS/GameLift plugin but itโs not pre-compiled b a binary version?
I also donโt know after reading steam documentation if the steam platform itself actually runs dedicated servers or if it acts as a matchmaking/friends platform only.
I hope someone can help me on this topic a bit I should also note that my whole project is Blueprints only and I have no C++ knowledge what so ever.
Thanks in advance.
@willow surge i believe its done by running a CMD with proper configs (in the cmd)
Steam can use both dedicated servers and listen servers (i.e one client is the host). Dedicated servers require a server and i am sure it works by using different ports if its the same server running it? but i havent got that far in my online implementation
it does require some open ports
one instance of ue4 server on a port, means you can run multiple ue4 instances on different ports with different games running, as that is the way i believe it work
Afaik, Steam is backend
So it doesn't run the Server for you
You can run them yourself and they communicate with Steam's backend
Hosting a Dedicated Server is up to you, so if you Players should be able to host them locally, hand them the .exe
Hi guys, yes I have read about the ports in the AWS documentation as it will start a new server with a new port automatically. I think this is just all a bit to much for me and there isnโt much documentation on it (noob friendly) Iโm happy with the way GameSparks does the match making and allows me to play against each other (client to client) but it doesnโt use the UE4 networking code in any way so itโs more like a always multicast system as far as i can see/understand.
GameSparks is also just a backend
While it has live code, that is more for using in frameworks that don't provide this already
GameSparks matchmakes two players and gives you the opportunity to react to that
Either by making one of the two host (ListenServer) or by telling a different service to host a DedicatedServer
Which would need to be automatic, cause you don't want to fire up the Servers by hand
GameLift would give you that, however keep in mind that this gets expensive fast
Ahhh itโs you ExI love your networking documentation ๐
What would you recommend ? Personally for dedicated servers? (Cheap)
Cheap? Let people host them
Okay up till how much players would that stay โsmoothโ ?
Well, it really depends on what you want there
depends on the hosts network for listenservers
Why do you need Dedicated Servers?
Do they need to be cheat proof?
Iโm making a small battle Royale game and hope to have 25 players in one arena. I donโt have the illusion of having 100+
oh that i see being expensive as i think you need a dedicated server to stop cheating :\
Yop
That will probably be expensive
Servers would need to be hosted away from players if you don't want cheating to be a thing
Well Iโm just a one man โteamโ and just want 25 people to have fun,
If you don't care about cheating and you only want players to simply join and have fun, let one person host
So use ListenServers and not Dedi
Okay then the GameSparks way should be enough?
Yeah, with a bit more logic you could also pass the players ping to the Matchmaking Request
And let then one with the best average ping host
Or simply take the first one from the particepants list
ยฏ_(ใ)_/ยฏ
i need to look into this GameSparks and GameLift. What is its purpose?
Just keep in mind that the ListenHost has Authority and can cheat if he wants
@sharp spire GameSparks is a backend. GameLift a dynamic server host
For more info check their websites
fair enough thank you
Same here Iโm eating and chatting, not very handy with kids....
Thanks for taking the time to answer. Iโll look into ping based hosting instead of the first one entering the lobby.
@thin stratus What do you mean by "filtering the server". So, the server is a player just like the rest of the connected clients and in one of the gamemodes, he's able to pick the side he wants to play as.
Also, sorry for the late reply as I went to bed right after I posted that question.
is it just me or is setting up GameLift is fairly difficult process?
Sorry, its simple, but the UE4 integration seems a bit complex lol
If anyone could shed some light on creating the plugin and UE4 integration with GameLift that would be extremely helpful! Thank you ๐
so to my knowledge GameLift takes your dedicated server and runs individual server sessions ?
Yes, and GameLift has the ServerSide SDK as a Plugin already
First time opening the network profiler tool to analyze a game session, and I see that I do not know whether the values are good or bad. How do I know if these values are good or bad? (got 100 mbit/s download, 10 MBit/s upload speed broadband)
So does this stop cheating and allow lots of individual connections?
Does this end up less expensive on the dedicated with more players or simply just splitting them up?
Sorry so many questions ..
Sorry to be more exact: does this handle 4 servers with 25 players each better then a single server would with 100 players?
Hello. I am working on creating a multiplayer First Person Shooter game in Unreal Engine. I have a rough implementation of enemies which I can kill, and everything works fine. When I try to create AI trees for the enemies, I run into one major issue: I can't seem to find a way to reference the player. I want my AI to attack the closest player, but I can't find a way of getting a reference to all the players. What would be the best way to make the Enemies detect all multiplayer players in the level?
I think what youโre looking to do is sensing if players are nearby and setting that pawn as a key in the AI
Try creating a collision on your pawn and on overlap set the key as your target
And when you have a target, branch off into combat
Well probably a โgotoโ then โattackโ
And setup an end overlap to start a timer before it stops looking for the player or if the player is dead
Or if the length between vectors is simply too large
@knotty ether
@sharp spire GameLift doesnโt have a binary plugin you need to compile it, thatโs where it stops for me. Iโm not into C++ and coding I just want to build and design games with blueprints as soon as I see make an empty C++ class etc Iโm done with it.
I see a uplugin file is that not relevant?
@sharp spire What I would like is for the enemy to be able to find the player at any distance. I have a service set to check through all of the player to find which is closest and set the target. I need a way to find all of the players on the map. Find all actors of class is slow(and doesn't work on the server), and I can't find where I would be able to have each player give a reference of themselves individually.
@willow surge @sharp spire GameLift's ServerSDK should be fully available
Just the Client side is not
And it doesn't do anything to the DedicatedServer directly
It just starts and stops them
It doesn't improve them neither does it make them worse
Also, it's good to avoid C++ for the start
But you can avoid it if you want to do Multiplayer
It's just too much stuff not exposed to BPs
So you can already get used to the fact that you won't be able to dodge it forever
@knotty ether GetAllActors works on the server totally fine
But it's not good to use it
Your AI can either overlap other pawns and get a ref like that
Or you look into the pawn sensing stuff
@thin stratus I know I canโt dodge it for ever but as a one man โteamโ itโs already so much work. I have php/java/html/XML experience and some .NET but donโt want t get into c++ yet
If you want an array of all players ,then you'll want to fill a PlayerController array with PostLogin and such in the GameMode
@willow surge True, however Multiplayer with GameLift and such is nothing a one man team should do
I think a simple c4 server of gamelift, with the few free days you have per month, still cost 150+โฌ
And one can, depending on the game and how resource heavy it is, probably run a handful of dedicated servers
Although linux is cheaper i think
Well yeah, still kinda the same prices
Left number is cores, then RAM
That would be a huge investment when starting, like I said Iโm not a delusional indie developer I know itโs out of my reach ๐ but I do need a online system. Iโll have to see how far I can get with the GameSparks only setup for now I guess.
GameSparks is really just for matchmaking (and other player data management)
You could also simply hook Steam into it and have people host listenServers
As long as you don't care about cheating it's all fine
Steam only has limited BP access, I have seen a Steamworks plugin that exposed more to BP but that hasnโt been updated for 2 years.
Ok. Thanks, that's all I needed to know. Turned out I needed to pass the enemy pawn by reference instead of just using the tick's actor.... Thanks again.
@willow surge UWorks?
Should give you full access
It's on the Marketplace
Costs a bit, but worth the price
I know but then I might just as well get into C++ myself just to expose features that are already there ๐ cost vs time
Well, I'm pretty skilled in that stuff and to expose all the required functions and events, i would probably need so much time that I would be able to buy the plugin 10-20 times if I just use the time to work
If you only need 1-2 functions then maybe
But anything near the plugins amount of functions will def cause more costs than just buying it
Simply trying to give you the best options here.
If you want a fast and easy solution, that saves a TON of time, then Steam + UWorks and GameSparks for matchmaking would bring you pretty far with your multiplayer setup
And you could focus on GamePlay
You might not even need UWorks for the start anyway
You can host, search and connect to Steam sessions with the default nodes
And you could use AdvancedSessionPlugin to get a bit more control
I think that one also exposes some Steam stuff
Like FriendList
Thanks Iโll keep that in mind, itโs hard for me to trust the marketplace the last 3 packages I bought
*A didnโt give support or dropped support soon after I bought them
*B have complete douchebags as developer and simply ban you from their support discord channel for asking questions and then tell you they will refund you (whiteout even asking it myself)
Itโs not about the money itโs about the trust in the marketplace content and saving time as a single โwant to beโ game designer in between my other businesses.
UWorld does seem like a good alternative and, so does uetopia
Well the Programmer is on this Discord and very well known. So you shouldn't have any problems with that
(english double negative. never getting use to that)
Your English is pretty good for a (German?)
Yeah German
Well, living together with a Belgian girl. We speak English all the time. So it improves :P
๐ I would never nit pick on language or spelling errors ๐
Na not saying that. :P I just tend to write something and forget the "not".
And who knows if I really canโt seem to get it all working I might as well hire you for your skills. I have read a lot of the topics youโre involved in on the forums and here on discord. You seem very capable ๐
The main problem for me would be is that Iโm not using any of UE4โs networking code due to GameSparks integration. Everything runs through GameSparks so thereโs no authority anywhere or UE4 replication.
Ah well
Would not do that
You are just giving yourself more work than needed
UE4's network code is totally enough. You should only use the part of GameSparks that deals with Players, Skill and Matchmaking
Itโs to late for that as I based it of a Battle Royale template I bought. I did change a lot but Iโm still dependant in GameSparks to handle everything movement/shooting/replication itโs kind of s semi-dedicated server
Why? Because it works? Because from what I have seen in the last UE GDC talks the engine will go to a similar system without all the relevancy stuff and just a list based network, something like a multi-cast by all system like Fortnite is kind of using.
And donโt forget that GameSparks is part of Amazon now. So I canโt see anything negative coming from this datacenter / server wise in the near future?
So GameLift actually starts and stops dedicated servers? ๐ฎ using multiple ports I assume?
@thin stratus
Basically yes
And I guess my prior question would fall back on wondering if a single server running 100 players has any difference in cost than 4 servers on different ports on the same machine hosing 25 players each
Could have difference
Cause the single dedicated server had to handle 4 times the bandwidth
So the process
Right thatโs what I was under the impression of
So technically in the long run as long as my host has the hardware itโll most likely run a little smoother with seperate servers
I read somewhere about a new open source that allows some type of cloud based hosting where each client ends up being its own host in one big world? It also claims to take care of individual objects like trees and such
I forget the name, but itโs built for unreal engine
the gamesparks SDK likely doesn't replace any netcode
it'll just be for doing backend calls
gamelift is also overpriced, for any size studio
i'm usually fairly skeptical of BaaS companies but at least gamesparks and playfab were acquired by large companies that are continuing the product
gamelift is also only suitable for session-based multiplayer, not persistent worlds
Yeah the earlier conversation was not about open world. No idea why Pierce picked it up
Also I thought GameSparks actually has a NetCode solution? I just never touched it cause I don't want to rely on it while having ue4s NetCode already
no it doesn't, not at least in the plugin description
The plugin is garbage
:<
They used a SceneComponent before I told them to switch to a UObject or at least an ActorComponent
And it crashed if you stopped playing too early
it has a feature called "realtime" but that's for a connection to custom server logic
Yeah that's what the other guy above was using though
KillerSneak
At least he says he's using GameSparks stuff instead of UE4's netcode
reimplementing UE4 replication using that seems like a really bad idea
My words
Maybe he just means something else and words it wrong due to missing key words
ยฏ_(ใ)_/ยฏ
GameSparks does have โnetcodeโ Iโm using it as a replacement for UE4 networking.
Iโm also using it to store user data like gear color. And Iโm planning on using it to set values for weapons that are picked up.
GameSparks has a โrealtimeโ api
I wonโt be be using GameLift As i was just trying to understand its purpose
Iโm not using GameLift neither itโs to expensive.
@lost inlet itโs still PvP based but with a โrelayโ server from GameSparks in between. Like I said โsemiโ dedicated but should run fine with up to 50 players. And thatโs enough for what Iโm aiming for.
Our real-time services provide a network communication layer with the capability to send and receive data in real-time:
What's the best way to go about replicating player spawned actors?
Ex: Player press B & a building is created at the specified location.
Here's the building I'm trying to replicate:
Place building code
thats a very nice scene ๐ @toxic meteor click the drop down and set the owner of the actor, then create another event thats run by the server that runs your current event you posted.
thatll spawn it on the server, and for replication youll need to set each component to replicate aswell
Okay thanks!
also youll need to promote the transform your using to a replicated variable and set it by the server
the server will return null or all 0's if it goes through somehow
I'm planning on having the client use a line trace to choose where to place it, how can I have the server then set that as the transform?
im not sure how particles work with replication, maybe a simple toggle?
ill check
youll just have to create a replicated vector and create a server event with an input of vector (clicked location name whatever you want) and have it set the replicated variable in that server ran event
ill post an example if you need it lol
No need, I got see what you mean
okay ๐
Thanks for your help; nearly got it working now just gotta do the transform
if you dont mind letting me know if particles are a simple toggle or not thatd be neat
They are
thanks
actually I didnt have dedicated server checked; looks like it isnt just checking the component replicates
what is it doing?
Never mind scratch that; the other clients were out of culling distance lol
i think figuring out some type of repnotify will make it relevant when you get close enough
Yeah not too worried about that part quite yet, the UE4 networking example map has some pretty good info on network relevancy
So for some reason some of my RepNotify functions arent being called properly
they are supposed to set equipment
on my players
but it looks like its not always being called
@twin juniper If the property gets replicated, the RepoNotify will get called. Watch out for instances where you update a replicated property on the server and then quickly update it again back to the original value. As this will result in the property not actually getting replicated (this is a common occurrence with bools). Just guessing with the little information I have.
where are they being called? @twin juniper
@jolly siren its a struct
Right, the same rules apply regardless of data type.
One thing to be aware of is that it's possible for the clients to also not call the OnReps, if their local value of the variable is already equal to the value the server replicates down. For that to happen, someone would likely have also locally modified the value on the client though, which is usually ill-advised. Even still, that behavior can also be changed by modifying how you setup your replication statement:
// This will cause the OnRep to always be called on the client, even if they have the same value locally already (usually don't need to do this, depends on your usage) DOREPLIFETIME_CONDITION_NOTIFY(MyClass, MyVariable, COND_None, REPNOTIFY_Always);```
@twin juniper
hey guys
im working on a survival game, like 835 million other people
if players have created 5000 building pieces in the world, with current UE4 networking, wouldnt that mean when a new player joins it tries to spawn all 5000 of those at once?
i mean i can make them visible but still the info is sent to spawn
*invisible
How do the online subsystems work with storing a persistent inventory?
Usually you don't use the subsystem for that. I mean there might be subsystems that can do that or people maybe using it like that somehow, but usually you use a server with database for that
reductor thats nothing to do with it
you just persist the inventory
and do all commands through rpcs
if you want to go nuts you'll need pagination as well
Is persistence normally handled independently? Left to some sort of independent database?
I'm hoping to store things long-term, not just for a single running instance of a game/server
Keep in mind, that you might talk about a Database for one Server
While reductor maybe wants one for different servers
download this while its free: https://www.unrealengine.com/marketplace/usqlite-database
and across multiple different servers
ok then you want something else
Yeah, as said, then you want a Database hosted somewhere
Which you can access through a REST API maybe
figured that might be the case, didn't know if there was an interface in part of the online subsystems to implement for this
Just some SQL Database that fits your needs
Na, the OnlineSubsystem is really more for the Session and Friends/Identity stuff
Steam has a cloud, but I think players can access that
So it's not save to store things there
There's also the steam inventory
thats not what its for
That's more for the tradeables like the CSGO skins
ya, not ideal
it would be good to have a generic data store for a user
Yeah, grab an SQL tutorial that you like and try to do it like this:
- Use a HTTP Requests from GameServer to WebService (something that handles your Database and actually performs the sql requests)
if you're doing anything of scale you really need to learn sql
- Use the Response of the HTTP Request to send data back
- Think about using JSON format as Epic has some functions that can convert a Struct to json and a json to struct
Implementing my own isn't really an issue, was just hoping there was an existing interface to re-use to keep it similar to the way devs expect to work with UE4
So if you have a struct class that has the same properties as your database row, you can easily send JSON back and forth and move between the JSON and your struct
Ah right
Sorry!
Never know the skill level of a user here :P so rather giving more info
all good, I'm guessing it varies quiet alot
also a game should not be connecting straight to an RDBMS
just asking for trouble
i don't know why so many people do it that way, there's even a very popular mysql plugin but i doubt the users of that plugin know much about information security
i also worry about some of these database plugins using copyleft code in them, especially the mysql one
// This will cause the OnRep to always be called on the client, even if they have the same value locally already (usually don't need to do this, depends on your usage) DOREPLIFETIME_CONDITION_NOTIFY(MyClass, MyVariable, COND_None, REPNOTIFY_Always);``` @pallid mesa thanks ill try it
Hello. I want to interact with some Actor both on Server and client (e.g. click on it). If I spawn it on server (actor is replicated), i can see it on Client but can't click on it. What workflow is correct ? Spawn exact copies on both sides ? or I miss something ?
replicated gets created on client
and, depending on the interaction feedback you might need to do the interaction on client side then let server confirm it
@slim holly can you explain your first sentence, please?
spawning replicated actor on server is also created on clients
@slim holly i was wrong, it is really creates on client, thanks
i thought it is like a ghost
no u cant XD
ughhh
Anyone use the XMPP module built into the engine?
Discord voice is god. Has anyone integrated it with ue4 yet? I am extremely disappointed with the ootb ue4 steam voip quality with 10 players
Hey guys, I got my line trace up and running for shooting other clients but how can I figure out which player killed another player? Like e. g. player 1 shoots player 2 and player 1 gets a kill from it.
@jolly siren BossKey productions had Discord voice integration in LawBreakers, don't think there's really a tutorial for doing something like that though.
ah okay, so if a player didn't have Discord then they couldn't use voip?
VOIP redesign is on epic's trello for future releases. Hopefully that happens sometime, because right now it's very poor.
@thin stratus I would not recommend SQL for storing any player data
it's at best good for player login info/static data
player inventory has rarely static data, with SQL you need to know in advance exact data layout and then create schema for it
Document (JSON) data base is perfect fit, since it is schema less and will store any document you throw at it
No idea what inventories you deal with but mine have a fixed Layout. Think it depends on what exactly you save
I can give you example
But yeah, feel free to use whatever database System you want
Don't have the time right now to discuss things so sorry if i recommended something wrong in your eyes
you have weapons, armors, all of them can have varying amount of attributes/perks
not saying it's wrong, it harder to use, because you have to plan in advance the exact data layout );'
Borderlands I guess yeah thatโd be a interesting gdc talk
How did they store player data on infinate possivle@weapons ๐
in general SQL will be better (better storage, performance)
but when you deal with not exactly defined data, then document data base is hand down better
if you end up with to few columns in table in SQL database you are screwed
Well Iโd think a almost IP address style of attributes 100110001 like digit one is weapon one handed or two handed digit 2 is it single shot or fully auto etc
Decide the weapon properties in engine mayhapse
A bitmask
There yah go
@jolly siren I tried to get Discord voice SDK, but failed ๐ญ
I haven't tried again though. Last time I tried it was closed
I think we have all applied at one point to see that same message
Damn them@for@making you even fill it out before it says itโs not available
@wary willow ahh okay, yeah I think I filled out an application for that too. I at least look at it.
@jolly siren You have it?
nope. Forgot that it was a closed system; until you mentioned it.
Ah yeah, it sucks
I wish I would have tried when it came out earlier
I literally only thought about signing up last December
For this game
Maybe in Jan
ahh yeah discord voice is so perfect. It would have been nice.
There's a UE4 plugin for their RPC.
I'm not exactly sure where that fits into the whole Discord ecosystem, however
I guess I will try tweaking the MaxClientRate and MaxInternalClientRate to get the ootb voip working better.
@jolly siren i would love to use this if u find out how to implement it
discord voice my dude
Ive looked into it before
u have to like get a special license i think
and i didnt get approval
sadly.
yeah, it's a private system right now
really dumb though
No real reason for it to be private; from what I have heard it's pretty much a fully functional system.
@jolly siren Have you gotten permission to use it?
No, I can't remember if I applied or not. But I didn't really want to limit voip to only discord users. I hadn't tested ue4 voip with many people at that point tho since it was partially broken until 4.19
Yeah
I haven't gotten it to work at all.
Which is a shame.
When I take the steam audio data and try to play it on a sound component
it just plays nothing
but i am getting bytes, only when i speak
and when i dont speak, no bytes are being sent
ive debugged that much
You shouldn't have set anything up besides flipping the bool in config. And adding the push to talk stuff if you want that.
ah okay
ya
the steam OSS voice is pretty low quality anyway
the opus codec is implemented in the null oss
@lost inlet what voip solution do you recommend then? I would like it actually integrated so I can do team voip
is the owner of a replicated actor automatically replicated aswell? for some reason client 1 and the server can read the server spawned actors properties but client two cant read its properties
failing when casting to the actors owner but client 1 succeeds just fine.. lol
ill try avoiding casts and get back to you
got it.
Why does unreal accept connections from this port
๐ค
It's a bot trying to port scan I believe
@raven holly It's a bullshit message because whoever wrote that log doesn't speak English.
It signifies UE4 has recognized that IP:port combination as coming from a new potential client, as opposed to already connected clients or clients who are "currently" losing the connection and stopped replying. If you were to send a new packet using a custom utility, not related to UE4, you would see the same message.
UE4 then scans the packets to prevents DDoSs and malformed packets so you're safe anyway.
Could I just block all ports except 7777?
The actual handshake is supposed to happen right afrer that message.
Technically, yes, you can modify code to deny any other ports than X-Y range.
Ah, then probably yes, technically, but not a smart move. There 65000 UDP ports and 65000 TCP ports. If you blocked them all, you would have to manually add exceptions for any program such as browsers (80), Skype etc.
Discord...
Actually, let me rephrase that: you can block your OWN ports, you can't blocl the ports from where the traffic originates.
i.e. if you block 7777, it won't receive traffic from anyone at all.
Yes well it's on a server so blocking discord etc wont be an issue ^_^
Only need ports open the server actually needs
Yea, I misphrased that. Ports are like endpoints of a tunnel. You machine can either receive or not, on a particular port. But you can't decide where it receives from.
Yeah I understand how the ports work ๐
Ah ok. I just wanted to be helpful โ
Thanks ๐
Windows Firewall in a server has pretty much everything blocked by default
hey guys i have created a fp and tp mesh and set the owner see only stuff the problem is i have the animations not synced how do i fix it?
@burnt meteor run the animations locally on the fp mesh and rpc to theserver to run the tp mesh animations
Use a master pose node and connect the main mesh to the bottom pin and all attached meshes to the top pin. Thatโll sync all animations without a delay
@Decode.#9604
Using the animation blueprint on multiple meshes in the same file wonโt have that synced and will only get worse as the network gets worse
em, animations desync locally because of delta time variations. how could one expect to sync'em over network?
Masterpose ^
Thatโs what it was, game lag not network lag sorry Iโm still a noob ๐
But masterpose should solve his issue locally
Right?
yes
and animations are local only anyway
they are visual representations of pawn actions
what would be the correct way to replicate an anim montage in c++
you replicate the condition that drives the montage
the montage is played in the c++, not the animblueprint
well what ever triggers it needs to be done on client and server
after server is done checking it can be done ofc
AttackCount is replicated, but another client nor the server see attacks 2 and 3, but always see attack 1
hey guys, im trying to troubleshoot a major problem in our student project, the client doesn't seem load or possess is character in only 1 map, we use server travel and we can go back en forth in any level but this one. the map in question is bigger but so far i didn't find anything else
i suspect the client load before the server or something like that, but adding delay only worked in the engine, when i pack the projet it doesn't work
@meager spade your attacks labeled by Index, right? Have the server set that clients pawns AttackCount and the anim graph should correspond
@stoic elk try having the server start the loading process for the clients
@sharp spire i solved it anyway now, i was using montageplay and a switch statement, i just forgot to make the server replicate the montage
Glad you solved it ๐
@sharp spire after some test (since i'm not the one who programmed our game and the programmers are MIA since the beginning april) it seem it's deleting some widget the problem, i swaped the blueprint between the server and client and now the serveur player is stuck on the loading screen but can move. while the client character load in all the level
ok so i fond that the client doesn't see the server move only in the problematic map https://i.imgur.com/Aa7XtDl.png
the serve see the client move in all the map wt hile the client doesn't see the server move in only 1 map
the movement of the serve doesn't seem to be replicated to the client only in this map, the more i try to fix it the less i undestand what is going on
@stoic elk are the characters created by the GameMode/PC or are they loaded with the level?
each level have a customs spawners, each player enter the level as a spectator and if they are the server get character A and if client character B
custom spawner is an Actor loaded with the level?
yeah
and is it on a persistent or a streaming level?
oh... the client spawner is in the persistent while the server is in the gameplay one
https://i.imgur.com/rv7SqFH.png
https://i.imgur.com/3EQ6Tuq.png
you have a separate spawner Actor on client?
yeah
it can't spawn anything on the server side
its not owned by your PC, so you can't send a Server RPC through it
but it's working in all the other map
is the setup the same?
i'm looking at it
including sublevels, there is an engine... issue where the sublevels that are set to AlwaysLoaded won't become Visible on clients after ServerTravel
workaround is to load them manually (change from AlwaysLoaded to Blueprint, then call LoadStreamingLevel)
ok thank you , i'll check that right away
imo, there should be no spawners of any kind on clients
unless they are spawning dummy actors that should exist only locally
(and i can't even give you a good example for that last one)
i'm just trying to make the projet "work" for a presentation. once it's done i won't touch it anymore
oh it's "working" Thanks @winged badger
i transformed the sub level as a blueprint and now it's working
i lost the element from that sublevel
but i feel close to a duck tape solution
ok i found the bug, it's the number of ai when you enter the level that's the problem
since the other level have max 10 ai and this one have around 30 that explain everything
so i can confirm that the problem was not relied to networking but the load of information generated by the ai that use way too much the tick event
can anyone tell my why with my game running in standalone, one as a listenhost and the other as a connected client, why the second clients movement stutters and hardly moves? :(edited)
it works perfectly fine in the editor with two windows
posted that in blueprints before, sorry
not trying to double post haha
its gotta be because there is no local movement going on, right?
it really should stutter this bad though... lol
i noticed if i move back to the server screen while my character is walking, it walks a lot smoother.. a solid 95% accurate
anyone? lol
figured it out in BP channel, its due to focused windows i believe
@sharp pagoda @sharp spire @slim holly Thanks and sorry for the late reply ๐
hey anyone have any experience with RPCs
for some reason my clients aren't getting my rpc calls
Make sure your Actor is set to Replicate.
my actor is set to replicates
and i call SetNetAddressable and SetIsReplicated
my component is set to be relevant in the constructor of that actor via SetNetAddressable and SetIsReplicated
void ServerActivateAbility(EAbilitySlot Slot);
void ServerActivateAbility_Implementation(EAbilitySlot Slot);
bool ServerActivateAbility_Validate(EAbilitySlot Slot);
UFUNCTION(NetMulticast, Reliable)
void NetMulticastActivateAbility(EAbilitySlot Slot);
void NetMulticastActivateAbility_Implementation(EAbilitySlot Slot);```
this is my logic for activating an ability (which happens on a key press)
{
if (GetOwner()->GetRemoteRole() < ROLE_Authority)
{
ServerActivateAbility(Slot);
}
else
{
NetMulticastActivateAbility(Slot);
}
return // dont worry abou tit;
}
void UAbilityComponent::ServerActivateAbility_Implementation(EAbilitySlot Slot)
{
NetMulticastActivateAbility(Slot);
}
bool UAbilityComponent::ServerActivateAbility_Validate(EAbilitySlot Slot)
{
return true;
}
void UAbilityComponent::NetMulticastActivateAbility_Implementation(EAbilitySlot Slot)
{
ProcessAbility(Slot);
}```
for some reason I always get the owning character as authority when i click a button
Where is that AbilityComponent on?
Is that Character possessed?
they are the default character when you start the game
i am running three of them doing that networking simulation
so I believe so
Well, did you print some messages/create some breakpoints?
Which call is not working?
The ServerRPC or the Multicast
yeah, so when I call Activate Ability
it tells me the role is authority
then i put a break point on netmulticast
So you called it on Server?
that's what it seems like
Well, did you press the button on Client or Server
So the Multicast only reaches the Server
correct
And you are 100% sure the Component is set to replicate
{
AbilityComponent->SetNetAddressable(); // Make DSO components net addressable
AbilityComponent->SetIsReplicated(true); // Enable replication by default
}```
that's in the constructor of my character
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
AbilityComponent = CreateDefaultSubobject<UAbilityComponent>(TEXT("Ability Component"));
if (AbilityComponent)
{
AbilityComponent->SetNetAddressable(); // Make DSO components net addressable
AbilityComponent->SetIsReplicated(true); // Enable replication by default
}
You don't need the SetNetAddressable
That's only really used by Engine code when constructing BP components
gotcha
Might try without that
To make sure it's not causing any trouble
Not sure why your multicast doesn't reach the others
yeah its really strange
It should breakpoint once per player
that' wha ti would expect
So if hit continue it should breakpoint again for the client
that's been my test
since the Client seems to have 0 problems with call the serverRPC
Hm
Just try without the netaddressable first
@tough pumice why not grab some Udemy tuts?
Or look at ShooterGame
And look at @thin stratus comp
Well to be fair, ShooterGame is a minefield
And his problem seems weird
What he showed so far should work
It's a reptlicated comp on a replicated character
The character is possessed
(so owned)
The Client calls Activate which results in a serverRPC
and then in a Multicast
But the Multicast only calls on server
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
Only thing that could be is that some of the points above aren't true
And the Activate is called on the Server
!
correct
the effect component seems to be replicated just fine
that's currently working
lol k fixed that
still the same issue
i accidently toggled replicates on the blueprint
one thing i noticed is that my role is always authority for button presses
is that expected?
I Figured it out!
I was using GetRemoteRole()
instead of using Role
sucks there is no getter for that
Does it all work now?
yeah
๐ญ
thanks for the help
is the server call to multicast seem like an ok pattern?
it seems like a lot
Well the local client should be filtered
And should execute the ability directly
Cuase otherwise you have a lag
So you basically want to check the values required for the ability on the local client and execute all visual FX already then
And then you multiast and filter the owning client
that makes sense
does the client -> server -> multicast
seem like a decent pattern
assuming we do proper filtering
Yup
You should however also think about if a client that gets relevant should also get the notification of the ability somehow
Not idea if that's needed though
Cause Multicast is fire and forget
However gets into relevancy after it won't get the call
@thin stratus Hey there hot stuff... wtf is ServerStatReplicatorClass ?
My GoogleFu is not working
* Class used to replicate server "stat net" data over. For server only values, the client data is
* is overwritten when bUpdateStatNet == true. For data that both the client and server set, the server
* data will only overwrite if bUpdateStatNet == true && bOverwriteClientStats == true.
*/```
Looks like it came from Fortnite
ooooh, that code is extensible? sweet
Ah...hmm
if (Subsystem != nullptr)
{
UE_LOG(LogTemp, Warning, TEXT("Found subsystem %s"), *Subsystem->GetSubsystemName().ToString());```
return NULL even though steam is set in the default engine and has the plugin enabled in the editor plugins window
thats the NULL subsystem not nullptr
Where would you use server stat replicator class in practice?
I guess I'm wondering what epic use it for
sily question, but when handling respawn, is it done in Game State?
if your respawning system has a state that other clients need to see
otherwise it's perfectly fine to just do it in the game mode
+1 Gamemode
If anyone can help, it would be greatly appreciated, So my game functions, but when you host a game, only LAN can see it in the server browser, and I am unable to connect outside of LAN, do you know how to make it so it can work online, not just LAN, is there a certain plug in? Code?
@covert ember Are u using a OnlineSubsystem? and using blueprints? You can do this communication by your own, but in the beginning i suggest use Steam to work online
I recommend these lecture behind
https://docs.unrealengine.com/en-us/Programming/Online
https://docs.unrealengine.com/en-US/Programming/Online/Steam
https://forums.unrealengine.com/community/community-content-tools-and-tutorials/41043-advanced-sessions-plugin
And this tutorial for beggining: https://www.youtube.com/watch?v=TPakLkxc6f0
Advanced Sessions Plugin
Message to users 09/08/2017
I'd like to note that the original intent of this plugin was to shore up blueprint support for sessions
Hey guys, I still cant make the volume louder .. Anyway this time I show you how you can: - add Steam to your project - Host a Game Steam/ LAN - Search for a...
{
FOnlineSessionSettings SessionSettings;
SessionSettings.bIsLANMatch = bEnableLAN;
SessionSettings.NumPublicConnections = NumOfPlayers;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = bEnableLAN ? false : true;
SessionSettings.Set(SERVER_NAME_SETTINGS_KEY, DesiredServerName,
EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
SessionInterface->CreateSession(0, SESSION_NAME, SessionSettings);
}```
is how i am creating my sessions, but i can never find any sessions
{
SessionSearch->MaxSearchResults = 100;
SessionSearch->bIsLanQuery = bEnableLAN;
SessionSearch->PingBucketSize = 50;
if (!bEnableLAN)
{
SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
}
UE_LOG(LogTemp, Warning, TEXT("Starting Find Session"));
if (GameInstance && GameInstance->SessionInterface.IsValid())
{
GameInstance->SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
}
}```
I can't find sessions either, I hope I fixed it now though
i am missing something obvious i can feel it
@heavy epoch also thanks for helping out, I am not sure if I fixed it yet though
@wary willow @grand kestrel iirc it should help debugging server stats on cloud hosted dedicated servers
Cause you can't really view them as usually you don't have access to the hosted server instance
Ah makes sense
Hope there's some resources on usage, could be useful for ours in Google cloud
accessing gamelift servers is shit
you literally have to write like 3 commands in aws console to get the password, then ssh into it
its a pain in the ass
i stopped using gamelift
That's cloud hosting though
The instances aren't meant to be accessed
Doing so is hard cause you usually don't need to
That's why Epic added that class and other stuff
Yup cloud != vps
If you need more controll you should rent Lightsail from aws.
If you need more auto instances /w autoscale and other optimization then ec2
Glad to hear btw epic added replicated stat debug class ^^
yeah ec2 is cool never used it before but now i use their free tier to host and test my server while developing . only thing i nearly went over my limit by accident once because i left 1 running . you have to remember to terminate them or you still get charged.
This is why backend is usefull ;)
Like gamesparks or simple php backend.
With that you can auto call shutdown/server start things :)
Quick replication question. I've got a component that's part of a replicated actor. It's spawned manually on each client on server, as part of BeginPlay.
Now if I want that component to replicate data, surely that doesn't work ? Should I create it only on the server, and setting it to replicate would create it back on clients ?
Noob question ยฏ_(ใ)_/ยฏ
Really, the question is whether a replicating component created on the server is mirrored on clients.
haven't used dynamic spawning of components, but pretty sure you can just replicate stuff the same way you'd do with actors
replicated variables and RPCs
also if you create a replicated component on the server on runtime, it should also be spawned on all clients and just work out of the box
but yet again, haven't tested it yet
So you agree that's what should happen - component is created on other clients too.
well, just like actors
if a replicated actor is spawned on the server, it automatically spawns a replicated version on all clients
Cool. Thanks for the confirmation !
Anyone know why it seems like
sometimes when walking towards a netcull distance actor
it culls out
then a few seconds later loads back in again
is this a engine bug?
lol
AGameSession should i use that for my sessions?
Is this up to date? https://wiki.unrealengine.com/Steam,_Using_Online_Subsystem
How can I change a variable on the clients computer only inside BeginPlay, right now because it is called in BeginPlay it will be called on all the clients and I just don't have any idea how to fix that.
i just ripped out the ShooterGame's GameInstance and GameSession stuff, and implemented it into my own game. Host works so far, not just checking if Find Sessions works ๐
is steam the only platform which manages port forwarding stuff? any other which i could create a listen server/sessions out of the box
GameSparks?