#multiplayer
1 messages ยท Page 299 of 1
Ya, SessionSettings->bUsesPresence must be true otherwise the JoinGame dialog from the steam menu doesn't work
Anyone know why Event Begin Play under player controller is called on the server for every client that connects?
EG: If I have server and two clients it gets called three times on the server, and once on each client.
Every object exists on both the server and client, so all the individual PCs get their BeginPlays called on the server
If you really only want to do something in a client copy, just check for if it's the server or not
And just so you're clear, the BeginPlays that get called on the server don't all get called on the server's PC, each call corresponds to each PC @golden granite
So server has it's own PC plus one for each client, and the clients only have their own. Which would explain why it's firing three times and that the variable checks are seemingly not sticking.
Is the only way to not fire on server per client is to not place under the PC?
Well like I was saying last night, pretty much every gameplay object exists on both the client and server, and tick/BeginPlay run on both
Does the server even get a PC?
I was thinking of dedicated servers
Yeah the server is essentially a server and a client. I still don't 100% understand how they are separated
For listen ^
Ah, so they don't if they are dedicated?
I understand that Begin Play under PC is called on the server once for itself, and again for every client, but there doesn't seem to be a way to know if you're in a client's PC copy, or your own.
There is
//run checks server side only
if (rootActor->Role == ROLE_Authority) ```
ROLE_Authority means its the server
If its not ROLE_Authority its likely the client
I tried that using the Switch Authority in blueprints
It returns true for every event which makes sense because it was spawned on server.
ROLE_Authority == Server
ROLE_AutonomousProxy == Client
Well it will always return true on the server
but shouldn't return true ever on the client
The role variable isn't exposed to BP for some reason, not sure if it counts proxy as authority
Which brings me back to where I was saying how do you know if the event is firing from the PC that belongs to the host, or if it is a copy of one that belongs to the client.
Didn't you use "is server" or something last night? Did that not work?
Is doesn't work, neither does Has Authority.
Hmm, that's odd
I feel like this is something that should be implemented but isn't yet.
are you on BPs?
yes
so your issue is, even if you add a has authority check it always returns remote no matter what?
Let's assume there are 3 players, 1 acting as server 2 as clients. LethalClips explained to me that the server keeps a copy of every players PlayerController, which in my scenario would mean 5 controllers in total: 1 for each player, and two copies.
If I run IsServer or HasAuthority under Begin Play in the PlayerController it will return true three times, false twice. Which makes sense because the three times are the server host, and the two copies stored on the server.
But I don't see any way to know which are copies, and which is the host(player)
It may be certain things that are copied as well, as this doesn't seem to be the case for the level blueprint for example.
IsServer returns true once, and false twice as expected.
Or placed actors even replicated ones seem to be 1 per player.
are we talking about knowing what controller would be the player hosting the game?
the level blueprint has 1 copy per instance
so one for server and one for each client
@modern fable Thats what I am getting
Yes, but the player controller seems to be 1 per client, and a copy on the server for every client. The code in the copy executes as well, and I don't see a way to determine which is a copy and which is not.
I see now
There is a function for this
Check if your current controller equals that
Yeah, I just realized what may work.
It is true that index 0 is always the client(not copy)
But not sure what code you could be running that the server wouldn't need to know about it
are 'children components' guaranteed to be in a same order both client and server side?
(in an array returned by get children components)
I have never tested that, but I believe that as long as its replicated thats true
yup, but given it's the engine itself handling that am not sure
To be 100% sure you could always assign a replicated "id" for each component
and just insure the id rather than component
Here's how you can tell if it's a copy or not.
make sense
I guess yea
Also another hackish way that I was trying to avoid is checking the last letter of the controller name.
If numeric it's a copy. A clients copy would just be PlayerController and copies woudl be PlayerController1 PlayerController2 PlayerController3 so on
But that's obviously not the best way.
that's a nice one either way tho
You can use IsDedicatedServer too
this one work, and yes there is some issue with HasAuthority
I think that concludes my multiplayer woes for the week.
โ anyone here had Steam working on a Mac? Just wondering if there are dylibs that need to be copied over to the packaged game (like we have to copy the dlls and steam_appid.txt for a packaged windows build)
got it kinda working (even cross-platform multiplayer works in a BP-only project wtf)
update on the session stuff i was talking about
1 button lan hosting, other button to connect
works fine
this on NULL
didnt even need c++ for that
has anyone done a instant hit implementation that has less replication than shooter games? ShooterGame's replicates every Hit/Miss via HitNotify.
is that really the best way to be doing it?
USTRUCT()
struct FInstantHitInfo
{
GENERATED_USTRUCT_BODY()
UPROPERTY()
FVector Origin;
UPROPERTY()
float ReticleSpread;
UPROPERTY()
int32 RandomSeed;
};```
I think it would at least be better to only replicate the hits
And misses could just be a simple clientside trace. No need to make them perfect.
careful with clientside hit. Its the easy way, but if you dont check that the hit is valid with the server, you will get easily hacks
maybe send the shot origin and direction alongside some other information, and that way you check if the shot was shot at the target
well the clientside tracers are really just for effects anyways right?
basic implementation using blueprint sessions
on steam
it works
very naive implementation, but works
Hey guys, just wondering if anybody else has had this issue and is aware of any workaround. So i'm working on a dedicated standalone server for a project. The server works fine, i can connect to it using a game client using "open 127.0.0.1:7777".
The game client itself has steam enabled, steam works fine in the game, steam achievements, P2P multiplayer etc.
On the game and server .target.cs files i have:
Type = TargetType.Server; (or .Game)
bUsesSteam = true;
Yet as soon as I use a create session node on the server it crashes. When trying to use a leaderboard function I wrote on the server it appears like steam isn't hooking up to the standalone at all. I haven't got any other steam apps running when trying to launch the server and it should just be using all of the config.ini's from the client as its from the same uproject/.sln. I'm creating the session in my game modes BeginPlay with a create session node from the Advanced Sessions Blueprint in UE4.11.2. I got the same results using the standard create session. Presence is being set to false.
All the log says is:
http://pastebin.com/b00Y5FGS
PS> Sorry for the essay.
Hey I got a question about optimization. I am making a game that has an ability bar, @stiff wasp help me set that up and I got it working. I was playing around with the networking with help from @stiff wasp and other guy that is not in this discord. I got it so the particle effect shows up for all the players, but I was wondering if I am doing it in the best way. I am using a multicast to send it to everyone, but there is three skills for all the players with a max of four players. And 12 multicasts seems like a bad idea, is there a better way of doing this?
any help would be awesome!
@proud wren You spawn particle each time energy change ?
What do you mean @rare cloud ? Every time the player hits Hotkey 1 it takes 25 away from energy and spawns the projectile
@proud wren Ok, well you can replicate with RepNotify, each time your replicated variable is receive by client, a fonction will be call.
in this function you can spawn particle, and use a non replicated float variable 'OldEnergy'
that you set at the end of the function, and at the beginning you can check if OldEnergy < Energy, well player gain energy , well you spawn particle ๐
steam blocks IP connecting
at least it does for me in LAN
even on the same PC
use sessions
they arent hard to use and they work well
no port opening or stuff
Okay, so what I need to do is something like this:
obviously it would need to be the rep notify function
but you are saying put that particle inside of a repnotify function instead of a multicast
What would need to be replicated? Energy?
@proud wren your energy variable is already replicated
RepNotify allow you to do stuff once the client receive it
like a OnReceiveEnergy Event
here the idea
and how you declare a variable replicated using RepNotify
Normally a function will be create
Hmm, let me try that
Thanks ๐
Do I need the switch has authority node?
Forget that last question. But how do you trigger the particle now? Should I put the function on the input action?
i put what you said in the rep notify function, it only shows up for the server
@proud wren You dont need to call it
then nothing shows up
You're not changing the value?
i am
Where
Input is client side
I see in your second screenshot you're setting the Old Energy value, is that replicated?
An input event is fire client side only
Well you need to send with an RPC "I gain some energy"
Server, reply ok guy I will send you the new value
Well simply create an RPC run on server
And set your new energy value
hmm, makes since. But wouldn't that call the OnRep function? I only want the particle to spawn if they player uses their ability (IE lose energy)
so if the player gains energy it'll call it too
right?
The engine call the function for you
In that case, you can juse make a check inside the function that says, "if you are gaining energy don't call. Otherwise call"
@rare cloud I think what he was saying is if the player is regening their energy, that function will get called again. Not sure what he is talking about, just joined the convo.
hey @stiff wasp ๐ I think what Jack said will work. Testing it out now, also going to setup something to regen the energy to see if it gets called again
aight
It is :)
Hi, everyone! Is there a way for dedicated server to know when stream level load is complete on all connected clients?
get the client to send an RPC?
seems to be the most simple way
Does anyone here managed to have VOIP on OnlinsubstymeNull working on 4.13? Seemed to work on my first test (brokin since 4.11) but then it started to don't work again.
Arf, just found this thread on AnswerHub and the ticket related, it's "backlogged"... (and referenced only with Steam where it is an issue with Null too) https://answers.unrealengine.com/questions/500778/voip-unstable-on-steam-network-saturated.html
@ivory parcel yeah, I thought about it. Just want to make sure that there is no other way
how does the VOIP work in steam?
I have not made it that far, but you might want to look at the advance session plugin
It has functions for blueprints and examples for code
Does anyone know if there was a fundamental change in the way property replication happens in 4.13?
Have any of you had steam working with standalone dedicated servers?
i can't seem to get mine to hook up to the steam API
Hello,I have created the inventory system and I ran into this a problem. When I Overlap the storage box I need to create the BP_Storagebox class. And set the storage slots to the players inventory widget. The problem is that the server does not know that I have created the inventory widget on a player and therefore when I spawn the bp_storagebox class it always fails.
This is the inventory widget being spawned
I need that "Main widget" to spawn on server so that I can work with that on server. Any ideasM
?
So basically I need to get the server know that I created a widget and let the server use it
is that possible?
I have made a class that subclasses AStaticMeshActor. I am trying to get AttachTo to work dynamically in multiplayer, but cannot. http://pastebin.com/ucKaFtUC
Works on server, works on clients 50% of the time, works on joining clients 5% of the time.
I'm so frustrated
Most of the time what happens is when I AttachTo, the client completely moves the child actor.
Apparently OnRep_AttachmentReplication is supposed to handle Attachments automatically, but it's not even being called.
All I want to do is weld multiple objects together during runtime. That's simple right?
Okay so i narrowed it down. For some reason when the server sets SetSimulatePhysics(true), that value replicates to the client and detaches it's children?
what's your issue exactly @twin juniper
are you expecting repnotify variables' callback to fire on newly connected clients? @cyan bane
not exactly... I have inventory widgets and they are added to my main widget. In main widget is also Storage widget... and when I open the storage box on map on server it should spawn BP_storage box and add the slots to players inventorys main widget. But the storage box can not find players main widget.
so just do an RPC or smth
@modern fable I have 2 actors that have SetSimulatePhysics(false), they are welded to each other. I call SetSimulatePhysics(true) on the parent on the server. SetSimulatePhysics is replicated to the client. And it breaks the client child actor.
The child actor is no longer attached to the parent.
And the child isn't simulating physics either
For some reason SetSimulatePhysics(true) on a parent updates AttachmentReplication to equal NULL on clients, then the child actor loses it's body instance.
I tried everything... The widget can not be replicated or something..
is it confirmed to be an engine issue? @cyan bane
do an RPC that adds the slots client-side @twin juniper
@twin juniper, You need to use an actor to replicate value
like your character/pawn or the playerstate
It might be because I spawn my bp inventory on server but it is only relevant to owner?
I spawn the widget in an actor but it is only relevant to owner is that the problem?
I don't think it's only relevant to owner with Blueprint
with C++ you can add a condition to replicate only to owner
but what do you want to achieve with your Widget ?
@twin juniper
I spawn the imventory actor on event begin play in character bp... In inventory blueprint I spawn widget. Then I have a chestbox placed in my level and when I overlap them, I need to take the widget and change the values in it according to chestboxs values. But when I spawn the chestbox actor and try to cast to the inventory and then the widget, the inventory is valid but the widget is not
It's probably not an engine issue. I'm sure I'm abusing the system somehow. @modern fable
All I want to do is attach/weld staticmeshactors to each other during runtime.
That also have SetSimulatePhysics(true)
I can get it to work just fine in singleplayer and on the server.
"In inventory blueprint I spawn widget" this is strange for me @twin juniper
Is anyone familiar with Server Replication using pawns? I have a Pawn setup, but none of the movement for it gets replicated on the server... I read that I have to use Characters and Add Input, but a lot of my movement system (very advanced and complicated) uses forces and such... Is there a way to Replicate that? Or is that a bad idea?
Characters handle movement and replicates it automatically thru their movement component @versed thistle
@modern fable My Pawn uses forces to move it around the work... Do I have to use a Character in order to Replicate it on a server correctly?
depends, do you animate your pawn when walking and so on?
if so using a Character is the easiest way to go
Well my Pawn is a Drone. So there will be some animation... but it's nothing like all the other basic projects out tthere. It has a very unique flight controller... It uses physics to fly around and such, which isn't currently being replicated.
so you can set it as a replicated actor
it should automatically replicate its transform
when moved server-side
there's an issue though where some transform values are updated but the actor itself ain't, so beware with that
I believe I have that set...
is it spawned on the server and where are you moving it
So the Drone itself looks like this...
And here is an example of how the movement works...
As for the server... I followed UE's latest tutorial on multiplayer... and everything works just fine, and I can join other people and vice versa... However you can see anyone elses movement. They just stand in place.
And I created a Character as well to test with, and that movement works just fine... So I know it has to be something with the Pawn class and Server Replication... Not sure if I'm missing a step or not moving the Pawn around.
How would I move it server side?
Are there any tutorials out there? I don't think I would even know where to begin...
call a server-sided RPC that moves it
or applies a force and so on
in case you don't have it yet, http://cedric.bnslv.de/unreal-engine-4-network-compendium-released/
I'll look into it! Thank you โค
โค
essentially though,
if a controller is possessing a pawn, it most likely is its owner
Am I going to have to use C++ for something like this? Or is it a better idea to use C++?
so you can call a run on server RPC, which is called from actor's owner's end
naw, it's good in BPs
I am just now getting here, and I saw "movement on the server". I am just going to turn around and leave
๐
@versed thistle if you know how, do it in C++. You'll get much better performance.
well you could technically use the same movement component a Character uses, but given he's using forces and pretty much learnin'
some stuff like roles ain't properly exposed to BPs too
Well I originally used a movement comp but when applying forces to the static mesh... It just wouldn't work. Since it's a child of the collision capsule or whatever. I think.
What is it you are trying to do? GIve me like a 20 word breakdown
children ain't replicated by default, btw
Did you see the screenshots above @stiff wasp ?
no, discord is being stupid for me and won't let me scroll up
I'm using a pawn instead of a character... and I use physics to move the pawn around. Currently, its client side, so it's not being replicated on the server... so I need to setup RPCs for it... is my current understanding of where I'm at.
Multiplayer physics in UE4? Hehehehe
๐
Here are the screenshots... Sorry for the spammy spam.
That's not the full extent of it all... but just an example. I also have a stabalizing function and such that applies physics and yada yada
Yeah, so when I join a server and such, I can see other players, and I can move around, but as they move around as well... They stay stationary on my screen.
Eh
but ๐ฉ
you said though forces ain't applying with the floating pawn component cause it's a child? @versed thistle
I don't remember what happened when I used a character and floating pawn movement... I might go back and try it again...
It's been a while
I'm also currently developing on a listen server... however I'm going to move over to a dedicated server in the long run. I'm not sure if that changes anything or not however
not really
@modern fable I think it is an engine bug, now that i experiment more
The SetSimulatePhysics(true) still makes client objects to lose their body instances, even if i override OnRep_AttachmentReplication and don't call super on it.
So SetSimulatePhysics is replicating something somewhere that's bad.
I can't find it though
@versed thistle have you ever looked through the character movement component?
A little bit... I'm looking more into it now. I think I'm going to update the drone to use it. I have a concept in mind (:
Okay, I think I figured it out with Custom Events and Replicating them... However on the computer that hosts, I can see the other players movements... while in the computer that isn't hosting... I can only see my own movements.
But I'm getting somewhere! ...I think
That is simple
Have you read this: http://cedric.bnslv.de/unreal-engine-4-network-compendium-released/ ?
I did go through that a bit... Still learning so it's a bit over my head
I did a really basic setup to test
And the host can see the movement... but client still cant. x;
I'm not looking for someone to tell me exactly what to do... I like to learn. But if you want to point me in the right direction, that would be awesome (:
Alright, so you are running everyones movement on server.
So of course host can see it
You have to send it back to the clients
Well actually... I just tested it again
And the Client can see both movements
But the host cannot...
Host as in, the computer that is hosting the lobby... It's still I client to itself, but yeah
LAPTOP HOST
Laptop: Only See's Itself Move
PC: Can See Both Move
PC HOST
Laptop: Can See Both Move
PC: Only See's Itself Move
So the computer that hosts... doesn't see the other computers movements. While the client can see all.
Can a third client see everyone move?
Haven't tested it yet...
Going to guess not- your problem seems to be that the server doesn't actually know that the client moves.
The Custom Event is set to Multicast... I'm kinda just trial and erroring right now...
oh boy
multicasts
i hate them lol
don't use a multicast
sometimes you have to, but most of the time they are used cause the programmer was lazy.
Not saying you are lazy, just saying try to use as little multicasts as you can
You want to handle all movement on client, that way the client does not see their character lag.
You just then update the server on the character's location and make sure there is nothing stopping the client from moving
an example would be if the player is dead
if they are dead, than they can't move (shocker)
most of that is handled for you in the character movement component, but since you are not using it you've have to do that yourself.
Interesting. So I set it to Run on Server... And now when I try to move on the client... It stutters. It trys to move, but ends up being set back to its original location (or rotation in this matter)
I think I got it
I had to use the node Set Is Replicated on my actor...
Maybe. We'll see. -.-
Yep! That totally did it.
@versed thistle This is a DefaultClass Setting
You don't need to use the Node
Open the Class Defaults and check for "Replicates" and "ReplicatesMovement"
Also, don't use RELIABLE RPCs for this
Event Axis Tick, they get called multiple times per second
And you don't want to send an RPC multiple times per second without allowing to drop one or another
Reliable is more used for things where you want the Player to receive the RPCs, even if it lags
The Stutter might come from the simple fact that you tell the Server to Set the Relative Rotation and he then replicates that back to the client
So if you still experience a small delay in input, make sure the local client (the one that calls all that stuff and not one of the clients that just see the mesh turning), also set the relative rotation
Otherwise he moves the mouse and waits for the server to react to it
with a 200ms ping or what ever, this feels really bad :P
Any ideas why a dedicated session isn't showing up when searching for sessions? (STEAM API)
Well, what settings do you start it with
And what AppID
480 or your own?
@wise depot
using our own appID
the settings on the session are:
Public Connections: 10
Private: 0
LAN: False
Allow Invites: True
IsDedicated: True
Use Presence: false:
AllowJoinViaPresence: False
Anti-Cheat: False
Uses Stats: False
Should Advertise: True
the server fires off the On Sucess event from create session too
does UE4 report to the "Game Master Server"? i'm yet to fill out the steamgames dedicated server information
oh wait... i think this may be a firewall issue, apparantly i can't ping the server. well I can ping the server directly, but not on the game port
I made a separate project, using shootergame as a template, and remade my issue using blueprints.
Here's my issue and bp's in an album http://imgur.com/a/HE0MZ
Correct me if I'm wrong, but input event is call client side only
maybe if you use a dedicated server, here I guess one of your client host the server too
You're right, however set simulate physics and attachto are replicated
I'm only using the input events on the server
I didn't make the blueprint for the clients to be able to weld or set physics. Just for simplicity.
"The main issue has to do with your Component hierarchy for the Item blueprint. When you set the Body to simulate physics the root stays where it was placed. When you pick the item up it is the root of the blueprint that is attaching to the player."
here a similar issue, maybe you already read this topic: https://answers.unrealengine.com/questions/264030/set-simulate-physics-and-attachactortocomponent-pr.html
No, because it works just fine on the server.
your actor is set to replicated ?
the BP_Cube is, the replicated values are in the album
Replicate movement is true
But that shouldn't matter, simulate physics is replicated, and works on both client and server. The root object falls in both.
there is few things strange on your BP @cyan bane
you try to attach the static mesh cube to the BP
oh you target the first cube
and attach to the second ?
Yes
Which replicates to the client
That's why I have the tick calling the draw debug string on the bp_cube
@cyan bane Yep well I made a first person template and reproduce your bp
the physics is replicate
all is ok
except
rendering
What do you mean?
I mean you can move attached box with the client
when you push both
the collision is like ther are linked
but the attached box is not rendered correctly
They aren't attached though
In my draw debug string i have the child output anything it's attached to
The server outputs the parent, the client outputs nothing
You can see the difference between the first image in the album and the second
for me it works correctly
the string on the client is correctly replicated
I can see attached on both
oh no
once you set physics, my bad
// If we are enabling simulation, and we are the root body of our component, we detach the component
if (OwnerComponentInst && OwnerComponentInst->IsRegistered() && OwnerComponentInst->GetBodyInstance() == this)
{
if (OwnerComponentInst->GetAttachParent())
{
OwnerComponentInst->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
}
if (bSimulatePhysics == false) //if we're switching from kinematic to simulated
{
ApplyWeldOnChildren();
}
}
Actually I don't know, it's look a strange behavior
I will try to add a SceneComponent as root
once update to 4.13.2 is finish
I noticed that OnRep_AttachmentReplication is called on the client, setting the AttachmentReplication variable to null.
Though when I override that in c++, and not call Super::OnRep_AttachmentReplication, the issue still occurs
@rare cloud, overriding OnRep_ReplicatedMovement() had a major positive effect. Whatever is going on has to do with that.
Ok so I think I figured out what's going on.
Before updating the AttachmentReplication variable, the server first sets it to null. And then populates it with new information. The issue is the client detaches the child object from the root object when it gets the onrep call for that variable. And AttachmentReplication is not updated again on the server to reflect the fact that the server still considers them attached.
Hi, if I'm want to make Dedicated Server with Steam, i'm need to use this pull reqest https://github.com/EpicGames/UnrealEngine/pull/2135 or not?
Sooo... when the Multiplayer "Number of Players" option is set to 2, does that mean that there is only one actual player in game? It says the editor counts as a player though it doesn't appear to connect my editor viewport as a client.
editor runs as a listen server unless dedicated server is checked
so like, has anyone looked into running large multiplayer matches (300+ players in one servre) on unreal
ive noticed that ill have weird physics desync sometimes
just in normal multiplayer
What kind of physics?
Doot doot
Hey everyone im using SetActorRotation to rotate my actors towards the mouse location although its working on Server to Client, Client to Server is not quite syncing up
Does SetActorRotation replicate automatically?
This is my current code http://pastebin.com/kZhVpeQT anyone see anything that im doing wrong?
client to server doesn't replicate
How would I go about fixing it
@late sundial you can change replication broadcast types as well as you could make the server authoritive and only respond to input given by the client and then the server distributes the new location/rotational values of that client
@slender fulcrum I'm also curious about how you would pass stuff like that to the server. I know with a current mp game I'm working on I have to run on server which replicates to client but in a game such as a FPS wouldn't that cause quite a bit of lag?
Or would you perform action on client then send to server as non-reliable
and hope that other clients see it right.
@golden granite fps games generally use non authoritive servers, typically udp positional data due toe the speed and reduced header of the unreliable channel
@golden granite the client will send keypresses or actions to the server, the server proccesses them instead of the client and just sends relevant data back to the client or all clients
Some MMOs when you lag out you get stuck in place. I'm assuming those pass through to server first. Others you keep moving but nothing else loads. I'm assuming that's what happens when you let client move freely and pass info to server.
Yes you can also see it when disconnecting while someone is running like when a server goes down
The player will run endlessly
Because the clients cant be told by the offline server that the player stopped
Makes sense.
It can save on data just telling the clients that a player is moving and then nothing till they stop
Instead of constant stream of updates
@golden granite Those mmo hasn't client-prediction, because normally you don't stay stuck you continue to move correctly and server will re-set your correct position
How do I make it so physics objects only move on clients when replicationmovement data is sent?
@cyan bane you don't have to replicate everything, and unless the server is the one moving an object it won't get replicated.
Where can I find the Engine version? Apparently I need to synchronize the version between my Mac & PC builds (so that I don't need a separate copy of my project for the mac version)
Physics simulated objects have their own internal code for replication behaviour. Changing that would be arduous.
Probably best to turn the Net priority down on your objects to ensure they dont oversaturate your bandwidth.
hm... for some reason click/touch event does not work anymore in my project for clients. Is there a setting I should check first?
@pliant cypress Your player controller probably got reset.
@golden granite it was something like that. I have changed how I handle data in my card game, and since there is no more replication involved, client's click's didn't went through. Had to make another stop in PlayerState between the Map and GameMode. Thanks for the reply! ๐
Is there a way for the server to send data to only one client? EG: it's a board game, if player draws a card the server picks from the deck, then only sends the card to that single client to prevent packet sniffing
Quick question, are component objects on the player character replicated? I've been looking at a plugin that costs $80USD and am hesitant on purchasing it as I'm not sure if it will benefit me on my project. I messaged the creator and he said he wasn't sure as he hasn't tested himself
@golden granite Yes RPC (Custom Event) replication Owning Client will send it only to the owning client.
@regal relic Ah, thanks. I'll look into that.
@regal relic The problem I'm having is I'm not certain how to store only the deck blueprint on the server, and have clients only receive a new card from the server without them seeing the deck replication.
Read the Owning Client part on https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/Networking/ReplicateFunction/Blueprints/ -- but that's not getting it's data from the server, but rather the level blueprint.
Guide to Replicating Functions in multiplayer games with Blueprints.
While I have no issue replicating to only one client, I can't seem to pull information stored only on server and then send it to a specific client.
Just make sure any behavior that needs to be server side only are run using rpc call run on server. Only the servers bersion of that data will matter. Any incorrect variables stored on clients is irrelevant. Just dont let them pass their version of variables into the server. Which can only happen if the server actually coded to do so.
For any replicated data (classes, or variables) for instance there are two versions. One server, one client. Just never trust the clients version of the replicated data.
@golden granite
@regal relic Yes, but I don't know how to store something on server only, and not replicate to clients. Then have only a single client request that from the server.
For example: only server holds deck of remaining cards. client needs a card so request one from server. server modifies deck and gives player card. Other players are unaware of what the player received, and no players know what's in the deck.
I can't use run on Owning Client because the client doesn't have a copy of the deck.
And I can't seem to find a way to Run On Server, then pass the info only to a specific client.
So I only see my options as to replicate the deck then pull from clients deck using Owning Client, or store deck on server and pass PC when requesting a card, then Multicast to all clients and only apply card if PC matches.
If that's the route I absolutely have to go I can perhaps seed the value. Have server encrypt value with seed before sending, and have client decrypt with seed.
You can store data in the gamemode. Only one of those exists, And its held by the server. a Black box so to speak.
yeah but how would I go about getting that data to only one client
From what I'm understanding there's no way to store data on server only, and send to one client only when needed.
If you run on Owning Client, client won't see the data. If you Multicast everyone sees it, and Run On Server only server sees it.
probably going to end up using multicast and encrypt the values sent
Work under game or player state, both exist on all clients
Just have a non-replicated deck and update it through a run on owning client RPC - so that only the owner receives it
Using those would be a better practice, as that's game-relevant data
@golden granite
or oh!, when replicating an actor you can specify whether it's only relevant to its owner right?
so if it's updated server-side, only its owner receives that
@modern fable GameState only exist on server. But the idea is to not have replication because we dont want other players knowing whats in opposing players hands.
Only the server should know what each player has.
Anyhow, you can do the last approach
Think of this, player controllers only exist server-side and on its owner's end
yes
You can apply its replication settings to a custom actor, your decks
So, replicated + only relevant to owner
so this is the part that loses me.
If I have a deck blueprint all players own it but only server handles it
if I have an event in the blueprint set to run on Owner Only it won't run on the servers blueprint, so it wont have the values. Is this wrong?
when I say only the server handles it, I mean only the server sets deck values and knows what they are
So lets say, you have a player owning a deck (so it's relevant to him), lets give that deck a bool
If you change that bool server-side, it's not going to replicate unless that variable is set to
yes
So you can essentially either have variables replicating themselves and perhaps do a repnotify in case you want to run specific code on every change
or do same through RPCs instead
repnotify goes to all clients though, right?
Nope, you have the actor set to be only relevant to its owner - so that's the only client it's being replicated to
(not sure if the actor is constructed even on other clients' end)
Anyhow, lets say that bool is a repnotify
If you change it server-side, it only replicates to its owner (relevant) and executes its repnotify function/event
so maybe im going about this wrong
I want the server to know whats in the deck, and whats in each players hand. player(client) should never know whats in the deck, and other players shouldnt know whats in other players hands.
so my way of doing it, or the way ive been trying to...
is to have the player run a function on the server which grabs a card from the deck, then executes a custom event to only run on the owning client with that pulled card
In that case, have the deck itself non-replicated (as the client doesn't have to know about it) and then when a player draws a card, modify its 'current hand' value - which is replicated to the owner
basically what you do yea
yeah, so im not understanding how to go from run on server, then to run on owning client
because I cant go straight to run on owning client because the deck doesnt exist on owning client
thus my dilema ๐
and I feel like theres no way to accomplish that
who wants to talk about mmog topics? (explictily not wanting to talk about how it's impossible...)
I guess the issue is more on how to store players' deck and so on
๐
the only way Ive thought of to handle this is to run on server then multicat to all clients an encrypted value.
are you ok with the server knowing everything
lets start over, where are you handling all that
eg: client says, hey server..heres my encryption seed...server says: okay... so this is the encrypted value with your seed, and sends it to all clients. then the right client says, okay i have that seed and decrypts it
thats not in the coding yet
What is the problem again?
how do you determine a player has to draw
thats just the only thing I can thing of
when a player performs his turn he draws a card.
@distul that sounds like a lockstep floating point sychronization
its not so much a matter of when to draw but how to only get it to that player without the player knowing whats in the deck
like starcraft 1 style
so Gamestate + Playerstate?
what if.. I have an idea
I mean, I'd handle drawing on the gamestate and perhaps save players' hand under their state
PC are on server and client, right? so...
what if I set the variables that old cards to replicate in the PC
then when a client needs the card it Runs On Server (in deck blueprint), passes a reference to its PC, server matches that PC with its own copy, changes value in copy and it replicates
would that work..
also, Im kind of new to player states. did some reading on them but havent needed them YET
This actor is relevant only to its owner
And only hand is replicated
You can have this Deck actor, i.e., under player's state
Someone had a handy little pdf giving some slides and info all about UE4s replication system.
orr oh well, that wouldn't be a cards game
I feel like if I could see an example of relevant to woner only I could work it out pretty quick
I know there is also a handly little hour and a half twitch stream one of the epic guys did a little while back.
excuse my typing im on a compact keyboard
That pdf is pinned here on this channel iirc
No worries. was on a cellphone the past several replys now.
Ok so Distul i think most of what your concerned about is actually a non issue.
just grabbed the pdf btw
See there multiple version of most classes when it comes to multiplayer the the server version of pretty much everything (minus client only stuff like menus), And then a client version of everything except a couple (mainly the gamemode class)
GameState -> Player should draw a card -> Draws a card from game's deck -> Calls an owner RPC on PlayerState that updates its hand
Anyway you never have to worry about the client version of anything, Just the server side version, When it comes to authority.
Just make sure a client never gets to act in a global way concerning the server or other clients, And only the server with have authority over anything that happens.
For instance you have a deck with card number, and its suit. say you tell the server to generate the array of cards, and randomize them. Since only the server is instructed to do this the clients wont know anything about it.
Think of clients as only being able to make requests.
The clients requests the server to do X
Its up to the server code to decide if that request should be allowed, And follows it out internally not referring to the client again for any extra data.
okay so think I understand, let me type out an example
The server is like the dealer. The client is able to act obnoxious and behave like a fool, But any actions the client/player trys to make is only ok if the server specifically allows that action to be carried out.
Server generates deck, client unaware of deck. Client needs a new card but has to go through server so it performs an event thats replicated with Run on Server, and perhaps passes a reference to its player controller(since thats easy)
Sure.. Sounds good.
server pulls a card from its deck, gets player state from controller(were now working on servers copy of the PC), and sets the new card to a variable in the PS
Depends on where you want to handle game's logic tho
since PS is set to replicate and its the servers copy, it will automatically fiire on the clients end as well?
Sounds bout right..
i knew the server kept copies but I didn't know you could have them automatically replicate
Does Playerstate exist on all clients?
I could do a rep notify on the playerstate variable(still on servers copy) and client would get the update
yes
it should
So all clients get the update
Yeah and the server will discard and replicate the bad data with ITS authoritative good data the next time it gets the chance.
That's only if the actor is owner-relevant
Yeah you only want to send the client hand to the singular client until the show of hands.
A controller is, a state isn't
ah but u can set the state to be
Yeah use controller i suggest.
You can do instead
Have a non-replicated value, and do what the automatic approach would do
Namely it does'nt inherit from the same hierarchy as the actor classes do.
Thus casting is a pain.
So set it before calling an owner RPC that updates it on owner's end too
So you manually 'replicate' its value relevant to its owner
wouldnt just setting it with repnotify work?
Other clients would get it too
eg on event postlogin you get the player controllers that logon
pc1 pc2 pc3 so on
I'm talking about playerstate though
client says, I need a new card and provides a reference to its PC
server says okay, finds copy of PC on server and sets values that are replicated with repnotify
then only that one client should get it, right?
or i could do run on owning client instead of using rep notify
within the servers PC copy
Or just have it under player's state with a rpc
I'd stay away from the repnotify till your a little more experienced with the other methods.
I rarely use a repnotify.
Same, but still it's just generally a best practice to have such game-relevant values going over player/gamestate rather than in a PC
well you can get PS from PC
so i dont see why i cant do that
and it has a relevant to owner tickbox
Sure you dont wanna store anythere there for long term, It is instanced after all, But sometimes thats what you want.
think i'll read over that PDF sometime. bit late tonight but im sure theres useful stuff in it I can learn from
per level, right?
but that would be ideal
well I believe I understand it now, and how to handle sensitive data. I appreciate the help ... maybe someone in the future wil ask the same thing and I can clarify haha. I usually help out with blueprint stuff on answerhub
If you dont have an Avatar (actor,character) a playercontroller is not a horrible place to put Controls ๐
theres no avatar other than that for visual, but which ultimately does nothing and u have no control over
After all the server has your playercontroller reference probably easier that anything els.
just kind of a, hey look at me
Its right there when you login OnPostLogin
That reference you get on that event in gamemode is a player controller reference. When it comes to organizing and handling your players.. Thats the place to start.
thats how I know which client is requesting what
Yep.
just keeping the deck private was an issue, but think we have that figured out
Hell you CAN write that code in the controller IF you wanted just make sure it uses the Run on Server RPC
So that was its the servers authoritated version of your controller, and not the client. Then anything the server does you can turn around and make an rpc back to the run on owning client. And only Their controller will receive the call.
i'll probably just use a separate bp for organizational sake
Sounds good. I think you got it now.. Might take some playing with it
BTW if you dont do it i highly suggest watching values, and taking advantage of breakpoints.
havent used them yet because i havent had any unexpected variable results that werent obvious mistakes. I assume it acts like any other programming language where the game pauses and shows you values once you hit the breakpoint, then you can resume manually.
PC is supposed to be on all clients/non-dedi servers right? So it should return true to has authority on clients, right?
hmm guess PC loses auth once a client joins a server
sorted it out? @golden granite ๐
is there a difference between VR multiplayer and regular multiplayer ? (framework I mean, not experience)
not really, you have to figure out though how and what you want to replicate
that'd be replicating motion controllers' location and so on
so basically if I have working MP in my conventional game, I could just use same framework and add motion controllers replication to have MP in VR ?
exactly, plus extra character initialization if you wish
(changing where the origin is and such)
the only thing that really differs is that you want other players to see where your hands (and head) are
I see.. Thanks
there are different approaches on doing that, btw
the best one I know of is having two motion controller components (one for each hand) with their player index set to -1
then I just change that index to 0 if the character is possessed locally
then I just grab components' transform and send it over to the server so that it replicates
just so you know ๐
@modern fable kind of. I was finding that client doesn't have ownership over its player controller. But this apparently only happens after it joins a server.
Just thought it was weird since server has its own copy.
a player is the owner of his player controller but doesn't have authority ever over it
guess that's what you mean? @golden granite
Yeah, sorry
so authority is the network authority, so it's the server always
hey guys, do you know if there is a way to allow two computers on the same network, with the same codebase, to run PIE in editor, and connect via console and IP with one as the listen server? Or do I have to build for networking to work on lan?
@split galeam#2406 I thought clients had authority over actors they spawned, game instance, and player controller. but its np, I believe they still have authority over game instance so I'll use that.
@fossil silo What do you mean with the same code base? You mean launch two clients in the same editor?
Also, you can try launching in the editor as stand alone game, might work.
@golden granite the server is spawning those actors so its their authority
then players possess them and are set as their network owner (for replication purposes)
and well, a game instance exists per game instance ๐ so it's local
@fossil silo not possible, I read that it was a 'planned' feature but yea
Think my brain just needs a rest. I had all this figured out not long ago and now I'm just screwing things up. I'll sleep on it then try again ๐
๐
Hah, right before giving up I fixed it.
I realized my mistake. I forgot I needed to execute a On Server method on an owned object by client
But you and the other guy(I forgot who, sorry but ty) helped me understand a lot that I wasn't aware of previously.
@modern fable Just to confirm: run on owning client is running the servers copy and replicating it to client, right?
run on owning client is called from the server and running on owner's end
other way around, run on the server is called by the owner and executed on the server
and a multicast is called server-side and executed on all clients (+ server?)
Was hoping run on client was servers copy. Would have made life easier.
Run on servers copy and push to client.
Hello, please, has anyone got this inventory and storage working properly in multiplayer? I am stuck on storage box...
What exactly are you stuck on though
Happy days! My card game is working again! ๐
Hey guys, don't suppose any of you know of a way to see where a dedicated server is allocating its memory at all? I've compiled a standalone server and at idle it runs at 1.2gb ram usage and memreport is only accounting for around 300mb of it
memreport -full that is.
it shows the correct ammounts allocated but doesn't show what's using up the majority of it
Interesting question indeed, what UE you are using?
There are some improvments coming to dedicated server memory consumption in 4.14 I believe
And did anyone try to add additional input functionality to multiplayer that is replicated across clients?
Currently I'm thinking to add Nitro to a vehicle, but I'm quite confused how to go about it.
I'll have a vehicle pawn which holds amount of nitro it has, and I need to somehow replicate it so that clients would know about it. And then if client wants to use nitro it should send input to server and apply it without waiting locally.
Which should turn out good, right? Or am I missing something?
And other clients need to know that nitro being used on top of that*
Hey everyone, I have a multiplayer c++ project and I can find LAN games with steam (2 seperate accoounts and machines) but I can't find games online (can't find game that my friend is hosting and she can't find mine when I host). Is there something that I should be looking for or does anyone have a clue on what the problem could be?
And ofcourse we had LAN disabled
do you login with server account?
Yeah
Oh sorry misunderstood you
I might be wrong though
Oh really even with the Spacewar appid?
ah, not sure about that one
doubt it will help though
it mostly used to prevent valve games from being hacked (changing game skins, etc)
Ah, thanks anyway cool to know
Hey, I'm currently a little stuck at a problem in my Multiplayer game: When I call EndMatch in my GameMode, I have a 10sec cooldown and at the end I basically want to restart the match without re-loading the whole map again. Is there any way to go back into the WaitingToStart State? Is it somehow possible to basically reload everything from right after "EnteringMap"?
I've created some cpp code for this now, where I manually set the state using 'SetMatchState(MatchState::WaitingToStart);'. and then ResetLevel.
We're using Steam & UE 4.13 for our multiplayer and we're running into a very consistant issue where the first Join Session attempt finishes loading the level but then gets kicked back to menu with a Connection Timeout failure. After that first failure, all future joins have no issues. Are there any known issues related to this behavior?
does ResetLevel reset components?
it seems like it won't
it looks like it resets jack shit
@keen frigate did you check if it works?
Hey everyone. So I'm creating a multiplayer for my Senior project and I'm having an issue where my client characters do not affect anything happening in the game. My character properly spawns objects like ground traps, bullets and other items but unfortunately they don't cause damage nor does but my server character works fine. I feel like it's something simple I'm missing. Can anyone help, thanks.
Are you only spawning the objects client-side? If you want the objects to affect others you'll have to spawn it server-side @sturdy tulip
I assume I'm spawning it on the client side and they are replicated cause my server character can see it @brittle sinew . I'm unsure on how to make my server character spawn anything on the server side. I've tried setting authority of my "action" button to be the server but when I do that my client can't perform that action all together.
You'll have to set up a client-to-server RPC (if called by the server it just runs too) to spawn the traps on the server... though you want to be careful how much power you give the client in deciding what happens, you'll want to do checks on the server as a general rule in a MP game
I'll try to figure that out when I get home in a little while and respond back to ya, thanks
@keen gale yeah it works as intended. It calls the Reset function on all Controllers and all actors that return true for "ShouldReset"
you can also implement the event "OnReset" that every actor has for custom logic
@sturdy tulip I feel like you might want to look at this architecture: https://docs.unrealengine.com/latest/images/Gameplay/Networking/Blueprints/forward_multicast.jpg
the pic is from this very informative doc page about Multiplayer in Blueprints: https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Blueprints/index.html
The various aspects of multiplayer applied to Blueprints.
Ok, thanks
Basically: gameplay relevant actors should always be spawned on the server side and then replicated to the clients. If your client e.g. wants to spawn a trap, then he should be calling an event that is set as "Run on server" which should then spawn the trap actor and this actor needs to be set as replicated
if I wanted a user to join an advanced session (steam)
would I still use the join session node
what exactly do you mean with "advanced" session?
have you heard of the plugin Advanced Sessions?
i am referring to that
Advanced Sessions Plugin
I don't ask for donations and this plugin is free for use with no strings attached, however due to repeated requests I am adding an (optional) donation link
PayPal Donation
Updated 11/04/2016
I have had several requests for supporting the authentication system for steam and wanted to be up front about it in here. The changes required are likely to be out of the scope of a plugin (or very backwards to implement through one) and I would rather people go
using this for more functions ;p
oh nice, no didn't know about it ๐
yea it's pretty neat
@keen frigate http://i.imgur.com/fR91GS7.png this is how I have it set up right now
like the ue4 tutorial things but using adv session now
then i have this to join
not sure if this node can still be used
maybe the plugin still uses these nodes?
uses that *
hm, as I haven't worked with this plugin I can't help you. But I'd guess that, if he doesn't have a custom Join Session node, the standard one will be fine. Have you tried it?
that plugin only wraps and exposes functionality to BPs
unless there's a connect function included, you should be fine using default one
@modern fable i am using it correctly though, right?
I guess ya
Thanks @brittle sinew and @keen frigate it was me doing the RPCs the incorrect way. Got it working now
You're welcome! Glad to hear it's working now.
Hey @brittle sinew , @keen frigate or anyone who may know the answer to my new question today lol. I have an issue with networked multiplayer and player controllers. I have a few different instances where I use get player controller and because it index is 0 it affects only what the game sees as player with index 0 or it simultaneously does it for all characters. Example when I shoot with my Gun BP I have a LineTrace for the bullets. I'm using GetPlayerController to get my vectors for start and end but all my player shoot and my client players don't apply damage. Also I have it play force feedback but it only applies it to whom the game sees as player index 0, thanks.
I would advise against using the GetPlayerController that takes an index in, I would do everything on the PC then use C-S RPCs to do your damage things
Once again though, be careful how much power you give the client
@brittle sinew I'm lost. C-S RPC works on everything else I'm doing except when I use GetPlayerController. How would I get the players controller to give it rumble if I make my own PC (instead of using the default one)
Where are you calling the rumble?
I'm calling it on my GunBP after it applies damage. The target input for it says it had to be a Player Controller Ref
I spawn it, it line traces, applies damage to hit actor then play rumble
Want me to screen shot it?
Give me a second, I'm going to see exactly how I did it in one of my projects
Ok, thanks
The way I did it was get the controller of the owner of the gun, which is my character
Using the index one isn't great IMO, you're relying on the order of the PCs if you're on the server, I usually just directly use my references to find what I need
You mind sharing that screenshot?
Note that this doesn't use the greatest anti-cheat precautions, this was for a PvE game and I was only planning to play it with friends ๐
Not sure you'll be able to exactly get what's going on if you're BP only
The most important lines are ACarditCharacter* Owner = Cast<ACarditCharacter>(GetOwner()); and Cast<ACarditPlayerController>(Owner->GetController())->(function)
It's my Senior Studio project so for the purpose of getting a grade, I can fix cheating possiblities later, I just need stuff to be playable lol
๐
lol
To be honest there's probably 100 things I could improve here, this was from a while ago
But that's the gist of it
Lol yea, now I'm just over here trying to translate this to BP in my brain
hey there
i need some assistance
I have 2 different modes in my game and one mode is 4 players and the other mode is 5 players
in the creating a server menu, i already mave a widget where it's like Gamemode Type and left and right buttons with text in the middle
would i have to make it so if they have gamemode a selected, it'll use numberofplayersfora variable which is 4 players
i guess i would the text to some sort of function too?
What is your exact question here (:
How you can tell the GameMode of the next Map the Number of Players the User has chosen in the Host Menu?
@bitter veldt
@thin stratus I may have figured it out in my head because I was dealing with another issue but anyways I have 2 gamemodes in my game
like
not UE4 gamemodes
just 2 ways you can play the game
I'll just make a variable and assign it to text
I'll try my idea out in my head
think it'll work
Each way to play the game should have a different GameMode though
I mean, that's the idea of a GameMode
Other information should be passed via the Options String
Same as the GameMode to use
Don't forget you can use inheritance for GameModes too... I realized that flew straight past my head a while ago after the fact ๐
Because most likely a lot of the core functionality is the same
example. Capture the Flag from Team Deathmatch
you remove scoring by kills, addd scoring by flag
and TDM from normal DM, but with same team damage disabled
Well yeah, you can inherit from nearly everything
so if I have one map but I wanted 2 gamemodes
I'd make 2 gamemodes?
and if the host selects one of the gamemkdes
gamemodes
it'll load it?
ah I wait I can't do that
I'd have to have 2 mals
2 maps
different gamemodes
alright cool
@modern fable is that possible lol?
not sure if having seamless travel on and doing that disconnects the clients?
๐
what
does it disconnect the clients
I have no idea still not on computer yet
in bed
no reason for it to disconnect clients?
server will host game
client will find a match and join
yea but given you can't change the gamemode manually, not sure if that works with seamless travel on
well we aren't changing it while they are in a fame
game*
I think it will work I have no idea
I've googled and looked around
oh?
I mean the 2nd gamemode will basically be a copy of the first gamemode
not sure tbh
just a question I've asked before but not in this channel
how would someone go upon joining a game with steam with a dev build
testing it is the only way to find out
with steam on a dev build*
I already have the ability to make steam sessions/servers
but how would someone else join
currently only LAN works
haven't gone around to testing steam
don't steam sessions show up with find sessions
I have no idea. what port would it be looking for
steamworks handles that
yea but isn't that more of a dedicated server thing?
and since I am using appid 480
well you can also host games thru steam
not sure then, you might need your own app
hmm I saw an unreal guy testing it with 2 different connections
one on his laptop connected to another network and different steam account
then he has his desktop who is hosting the match on a different network
and steam account ^
direct connection maybe
you mean connecting via IP and port?
yea, or joining their game thru steam's overlay
not sure though, haven't used Steam that much
but I'd go that way when testing
na he wasn't direct connecting
it was the blueprint tutorial
he just did "find a match"
and boom his match appeared
I'll see
I should probably implement something that finds friend sessions
or the ability to invite people to your own session
na I don't want to look at anymore tutorials at this point
I need to have some fun in unreal ;p
1:23:24
he's using find sessions
nevermind that, that tutorial ain't specific and ends up being a mess
lol
anyhow, find sessions was the interesting part xD
You can add multiple player controller indexes for AI on the same client right?
What do you mean by that?
Well the game is online multiplayer, and I need to figure out how to implement AI into that as a player.
If I could connect AI as a client to the server it would be easy, but I'm not sure that's possible?
Well AI don't use PlayerControllers, so if that's what you're asking about no
Yeah, so there's problem numero uno.
Haven't started on it yet, just trying to think of the best way to implement the AI as it's own client, if possible.
You might want to bump some of your PC functionality up to an AController
So your AI can make use of it too
Though I've never done anything like this, so not sure
Yeah, tricky situation.
do you mean having AI as a player replacement?
hi
I am having a weird issue
so I assigned a mesh/model to my fps so i could see it on another client
but when i am connected, i don't see the other character
@modern fable Yes
ah fixed
@bitter veldt Make sure the actor is set to replicated
Ah yeah, that will do it as well.
@modern fable I'm just brainstorming ideas on how to duplicate data a normal player would have on the server, which is also already a player.
Because currently variables are separated per client, so it works. But if the server is to share AI -- bit of a predicament.
alright so I had my friend download my game
i created a steam session
he can't seem to find it
so i guess i have to have my own app id or something
is lan turned off / if steam overlay working - does steam launch with the game too
LAN is turned off and steam overlay works
it's on steam mode
I packaged the game as development because when it's set to shipping
steam doesn't work
@bitter veldt i know little about steam, but perhaps its steam region? does your friend live geographically near you?
@bitter veldt for the epic mega jam, when we played games, allar had us change our steam region so we could all play together
@tame thunder I live in Canada and my friend lives in united states tn
@thorn merlin **
alright
so i had my friend who lives couple blocks away test out the game
he couldn't find the session either
steam integration works (launches game as Spacewar)
@bitter veldt both you and your friend have to be in the LA download region.
on steam
@stiff wasp what really?
I have to set the download region to LA?
i have the packaging thing to set to shipping
and then i have a steam_appid.txt with the id 480 inside of it
i add the game onto steam
am i doing that correctly?
can anyone confirm this?
regarding the LA download region
alright
so I tried that out
that isn't working either
If both you and your friend are on the download region LA, then you did something wrong in your code
not sure as to what could be wrong @stiff wasp
show me the code
blueprint?
if that is what you programmed it in then, yes. Show me the BP
alright un momento
Hey everyone
I am replicating an array of actors like so:
The display on-screen shows:
Server: <Actor display name>
Client 1:
And indeed, the remote client gets the array size change, trys to iterate over all of the items, but finds None where there should be a replicated Actor
What gives?
Nevermind, found it: the Actor was marked with Only Relevant to Ownerwith an owner that was not the Client in question.
Should "Set Simulate Physics" be called on Server->Multicast or local only?
hello friends!
wanted to ask, is there anything special I have to do to get the Create & Find Sessions working on LAN besides setting the subsystem? I create a session, but cant seem to "find" any on the same network
thanks in advance!
@fossil silo Which subsystem are you using? Are you playing in standalone or PIE?
After using the steam onlinesubsystem-plugin instead of enabling it manually in build.cs I'm seeing this when trying to find sessions:
LogOnline:Warning: STEAM: Removed incompatible build: ServerBuildUniqueId = 0x7ca67746, GetBuildUniqueId() = 0x7c7123d0
LogOnline:Warning: STEAM: Unable to parse search result for lobby 'Lobby [0x1860000A6415FC9]'
Find sessions returns successful, but without results. I'm able to create and travel, as well as friends list.
Try what's in here
Unreal Engine 4 Community
For my question though
I know you can preserve playerstates inside a session so when someone leaves and joins again later he will be rebound to his old playerstate
But how can I make sure the variables in that playerstate are retained?
Stuff like how many times that player died etc.?
When someone quits and rejoins it's reset to 0
How to begin creating Master Server for a FPS Game?
@odd nimbus Get a Server (costs money), setup a Database, setup a layer in between UE4 and the Database via php or so, setup logic to let the Server Register at the Database through Session and
Keys (authentication), setup logic to retrieve a list of the registered servers, ..., profit
...which is why it's usually just recommended to go with Steam
๐
I wouldn't even want to think about setting that all up
Hi everyone! I'm having this issue: https://answers.unrealengine.com/questions/358869/clients-jitter-on-listen-server.html
Looks like this should've been solved in 4.12, but I'm still having this issue.
And I'm also a bit confused with Sean Flint's answer futher down "Many instances of this issue can be linked back to the fact that meshes or other components that are attached to the capsule are not being smoothed because the capsule does not have smoothed position"
Since the capsule component is the root and inherited, isn't everything basicly attached to the capsule?
So testing a MP game with ?listen
is there a console commande to show connected players?
Don't know if there's a console command for that. But you can get the "PlayerArray" from the GameState.
And if you really want to do it by console, you can always set up an event to loop through and print each one, and call that from console
does anyone have experience with writing custom prediction for their games, just wondering about whether it's a better option than dealing with Epic's.. honestly doesn't feel like i have any way to add multiplayer to my game atm because i can't fix anything with epic's implementation
What's the problem @grand kestrel
@wise depot was trying to do stuff that epic's prediction couldn't handle, in the end i think i'm going to write my own, but i found some resources to go through so i'll ask again once i run into another roadblock ๐
Is this a blueprint or C++ projects @grand kestrel ?
C++
for the record i re-wrote thousands of lines in CMC before running into the roadblock to do arbitrary orientation, this wasn't some basic misunderstanding ๐ฆ
but that said, i know almost nothing about prediction atm, so i can't work with their system at all, i feel that i need to start from the basics before giong anywhere near it
so this will kill two birds as they say
Alright. Good luck!
ty ๐
the frustration really got to me this time haha
in the past i've had projects die from similar roadblocks, but i'm more experienced now
Just don't give up and you'll get the hang of it ๐
@cedric_exi Actually I don't want to use PHP as a communication system for my UE4 game and Database. First clarify me some stuffs. For a game which have almost 1k players what kind of database I should use? I am planning to store a lot of data on the database like game history, scores, user settings and some other bunch of stuffs. Should I go with normal MySQL Community Database Server? Now the next question is communication from game to the database through PHP or a dedicated master server C++ application which will be running on a linux box. Which you think more faster, convenient and secure? And I already have a linux server in Singapore to test these things out.
@cedric_exi And the full blueprint networking project link that you gave me I watched but I prefer to code the networking of my game and other core factors using C++ instead of blueprint. I just wanna use blueprint for Menu and HUD the UMG stuffs. Is there any good youtube Tutorial Series link for doing a Multiplayer Game setup with C++ including lobby and everything else like this Tutorial Series
It really shouldn't be too difficult to copy the functions within the blueprint
You can right click BP nodes to find the C++ equivalent of it
Every blueprint can be converted to appropriate C++ codes?
For the most part, yes
I'm not entirely sure how things like delays work behind the scenes, but I think you'll find everything in that tutorial pretty easy to transfer
Hey, could anyone give me a hand with my sessions? I have it setup so when you hit host, it creates a session. And when you hit join, it finds sessions. But when you find a session and join it, it puts you in a different session than the one with the other player, and you can't see each other. Any idea what may be wrong
are you joining the session
if you mean do I have the Join Session node, then yes ๐
I am guessing you have a Open Level node after you create the session like I showed you? Did you remember to add the ?listen to the Open Level node?
I totally forgot to add that, but it still fails to join the session. :/
so i got it to load a session now, and they are still not in the same session even with the !listen in the option
where do you decide whether you are joining or creating a session
I have a button in the widget, when the player clicks it it goes through the Find Sessions and then Join Sessions nodes
so you are not creating a session if finding fails
rite, so the client is joining successfully on its end?
its joining something, but you can't see the host. I create a session with one, and try to join with the other
is the client connected
how do I check?
add a message on gamemode's post login or smth like that
print*
so that a message is output when a client is given a controller
alright, they are joining the same session