#multiplayer
1 messages ยท Page 303 of 1
so
you can give it anything
likke i can say "MyGameSession"
because i tried that
and it didnt work
I'd recommend you using BPs + the Advanced Sessions plugin
then you can just look thru that plugin's code
@modern fable that ended up working great. thanks a lot
โค
So ok
why does the second value "Result"
return 5
is that some sort of result code
lol
because you are casting an enum to an int lol
that means it's the 5th enum in EOnJoinSessionCompleteResult
Hey, you guys know how printing in debug mode with clients usually says something like "Client 1: Hello!" "Client 2: Hello!" or with server, "Server: Hello!" ?
Well my client says "Client -2: Hello!"
That's not a problem, right? lol
yeah but thats what
@jolly siren thats what the tutorial does lol
and it isnt joining the match
yeah it's just outputting that for debugging purposes
ive only gotten it
to work once
and join a session lol
like i added a debug, and it says there is one session on the network
but when i call my function which i modified to join the first session in the SearchResults array
it doesnt actually join
can gift hub for for working on the same ue4 project at the same time with 1 person for free?
@rugged radish go to the jobs section
ok so i figured it out, the 5th element in the enum is "AlreadyInSession"
what do i doo @jolly siren
i have
a packaged build
with two separate windows open
i want to be able to join on two separate windows
is this just the null subsystem?
yeah you can't do that
oh?
that's why it's giving you that
hm
ok
also uhm
SessionSettings->bIsLANMatch = true;
if that is true
does that mean its not using steam?
should i set it to false lol
it's how steam locates sessions based on location
oh
leave it on if you are using listen servers
so where are matches actually hosted?
does steam host sessions?
like how does that work lol
if you are using dedicated then turn it off and then you need some stuff because epic steam + dedicated is broken and they are bitches
Do you know what i mean?
like where are the matches hosted, and who is hosting the list of matches?
the listen server registers with steam
the listen server is the host
if you aren't using a dedicated server
but you need to register with steam
right now im just using the test app id
isnt listen basically a p2p server?
yum
nop
you need a pull
which is managed by someone who isn't an expert
and epic has dropped the ball hard on picking it up
i dont get it then lol
like
so is there not a way i could learn to do it myself
lol
have fun
and like comment on the pull too
the more the merrier
or however you spell that
anyways i gotta go eat
same to you
@jolly siren https://forums.unrealengine.com/showthread.php?69901-Advanced-Sessions-Plugin does this thing do it?
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/20/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
Hey guys, anyone have advice for debugging client movement hitching with ping higher than 10 ms?
Really rubber bands baddly
ping higher than 10ms is usually expected
unreal handles movement component quite elegantly in their native side
are you doing any Set Actor Location manually in your code/script?
@neon mango
I actually found the cause!
Or nearly one or both of these lines caused the hitching
//this->GetMovementComponent()->SetIsReplicated(true);
//this->GetCapsuleComponent()->SetIsReplicated(true);
I'm suspecting more the first but could be both
@soft inlet ^
you tagged the wrong guy
lol
remember one very important philosophy
never replicate anything after 'DeltaTime'
example... location = velocity * deltatime
if you replicate location. you're in for trouble
that's just an example. it's applicable to rotation , and any other values
Dang didn't notice lol
So I'm having an issue now where my replicated method happens on the server only and while my Client seems to do the same method none of the debug logs I have show client side. Does this mean its all happening on the server? I basically want to update some bools for the client as well How should I handle this?
Ok I think I figured that part out
but now I'm getting some jitter from what I believe is because I'm changing gravity and that isn't replicating?
hey, what's the preferred way to force all connected player controllers to call a custom event?
@vivid siren Run a multicast on the server
Awesome, that's what i've been doing but i'm not getting the behaviour I wanted, I guess it's a separate problem then, thanks!
you have to run multicast from server, if the events arent firing its not beign run from server
@golden granite Right, I've done this as well but my possessed camera actor for the client seems to reset itself to 0,0,0 whenever it gets rotated by the multicast
make sure the camera isnt set to replicated
the camera blueprint
ive done that by mistake
This is just the default CameraActor from UE4, not a customized one
I don't see anything about replication in it
@golden granite I'm using a character actor now with the camera and the same problem occurs, even when disabling replication on the actor
Not sure without seeing it. heading out for the night though. Replication sure is fun stuff to figure out though :p
It sure is, lol, thanks for the other help tho, see ya!
I had this same problem, a multicast wouldn't work.
Because you're trying to call functions on PlayerControllers that don't exist on clients other than the owner
Plus, a multicast is for one object. If you want to call a function on all PCs, you'd want to go through the PlayerController iterator and do it there @vivid siren
Hello, how do I set the "Owner" of an actor as "The Server"?
@still finch, you can't simply set the server version of an actor
what is your actor ?
@rare cloud Why not? The actor already exists on the level, why can't we "simply" set the owner as the server?
The owner is another object, not just "simply" the server
Is the owner not "simply" set when the server spawns the actor?
You can feed an actor in when you spawn an object to be the owner
Who owns this actor
If you don't set it manually, it doesn't have one
Does "everyone" need to own this actor in order to manipulate it?
Clients can only call RPCs on actors they own. So if you want to call back to the server to make a change, you would have to own that actor, but you only can have one owner
That's where you can feed stuff through your PlayerController to make requests to change things indirectly from the server, but you can't directly change an object without being its owner
Hmm
@still finch Basically you can only issue server calls on an actor owned by the client/server making the call. EG: PlayerController.
So if we have a structure, such as a building that we want to destroy. If I want to shoot that building, I have to own it then manipulate it. Then if someone else wants to shoot it, they, at that point have to own it before they can shoot it?
Not quite.
You can manipulate actors without owning them, you just can't make server calls on them without owning them.
Lets say you want to change a players name.
Client can change a variable that holds their name, and it could update their name. But if the call isn't made on the server it never actually changes across all clients/server.
And you can only change it on the server by owning the actor you are attempting to make the change from.
I think part of the issue is you aren't familiar with replication, nor ownership.
My advice is to read through this http://cedric.bnslv.de/unreal-engine-4-network-compendium-released/ this then come back. It says 100+ pages but half of it is examples and c++ stuff so can be skipped if you want.
Are RPC's more expensive then variable replication.
@neon mango how do you mean?
Question guys - i'm trying to seperate "InProgress" match in BP project.... but it is firing immediately after "WaitingToStart" and I dont see any code that is firing this natively/default...... GameMode travel type is SeamlessTravel(True) DelayedStart(False).... suggestions?
In terms of bytes sent
@neon mango i would imagine that depends on how much data you are sending.... RPC's are just functions that are casted to either one/many if i'm not mistaken.... but i'm unsure as to how many bytes each node casted would cost.... you'd have to packet-trace this i would assume with a software like WireShark and filter out the packets.... Variables obviously would be different in the nature of the variable... . a texture file would be tremendously bigger than a 32bit INT or a string of text - no?
so are we sure that ue4 steam sessions is using peer to peer?
@twin juniper i'm testing this very thing as we speak....
i tested across my LAN and it connects fine in hosting/finding sessions.... as well to my brother on a test project across many staates
it looks as though steam HOSTS a virtual lobby persay - i'm going to test this out by using multiple clients hosting a game sesesion on steam app.... and see how many show up in FindSessions()
right now i'm just testing 1 host + 1 FINDSESSIONS() from a remote client (states away)
FYI - setting DelayedStart(True) seperates the match states - it's a good sunday so far! โค
I guess rep notify isn't working as I thought?
I have a float var GravityScale
And I have it ReplicatedUsing a method
OnRep_GravityScale
rep-notify is to run a function when the value of the replicated variable changes
something like this:
HP(changes)->RepNotify(apply HUD red flash)
i mean thats REALLY stupid high level of what could be done
Yea
I have an RPC call executed on the server that does GravityScale = 0
So my RepNotify_GravityScale should get called where I say Player->GravityScale = GravityScale
Right?
ok so think of this first
does GravityScale need to affect movement at all i would assume?
Yea
ok so....
i would ASSUME gravity scale is global to the entire map? Can affect any player right?
No, just this player
Issue I was having is the RPC call executes on the server only
so I thought I could set it with a var
what STARTS the GravityScale change?
a volume in level?
trigger?
some level event?
A button press
ok my own workflow (i'm not saying this is gonna work....)
i would do ButtonPress()->CastToCharacter()->Client_GravityChange(SetGravityScale)->Server_SetGravityScale(Replicated to server)
then you would have a server RPC funciton that does this:
ServerFunction()->SetGravityScale(#)
Gravity Scale is obviously replicaated
the thing i had troubnles with earlier on in MP setups... was understanding Replication of variables
and the biggest success i had was to A: run it on client locally first for visual effects
Well what I'm trying to do is this
and then B: Run server RPC function to change the same variable (as server this time so it IS changed and replicated to everyone else)
ButtonPress() -> Calls an RPC (Server) -> Sets GravityScale = 0 -> Calls OnRepNotify?
so is the steam matchmaking using p2p
i dont think you need to use repnotify in this situation
but i could be wrong
@twin juniper - i'm unfortunately not at matchmaking yet .... not with this portion of the game i'm doing
but in my own experience with OSS (Gamesparks) -> Matchmaking is handled with serverside scripting..... you would have to have a TEAM (array of players connected) ... which if i'm not mistaken would require some form of either A: Hosted Lobby or B: Dedicated Server
@twin juniper the matchmaking just serves to get players connected, the servers themselves are still P2P
With a pure P2P setup? There's really no way
I haven't used dedicated servers, does that not work?
I mean dedicated game servers
that wouldnt work
for a game which needs to work in states
like round 1, round 2, round 3
match ends... submit results to db
bring back to main menu
Well you would most likely have to set up your own custom server flow
Yeah, it would have its own state machine of sorts
eww
Well...? That's kinda how you would need to do it
You might be able to mess with proxies if you still want P2P, but that would be a lot of custom connection and latency introduced, I don't think that would be worth it
They don't
It's easy to scale a game with it, COD for example was P2P up until a few years ago
its the easiest way, yet most unsecure and laziest way to setup a match making system
how did they get away with that
lool
It's not like it's the devil himself lol, it has disadvantages for sure but it's not unusable
And trust me, if you're looking for random people to ddos, you don't have to look too far
ya
I mean like
if u ddos the person hosting the match
doesnt that just crash the whole match
lol
Yeah, that would
Sniffing is pretty easy for people who know how to do it, but it's not like everyone is just itching to do it
yea
idk im just wondering
how plausible it would be
for a game like h1z1
to do p2p
On that scale, I would say most likely not possible
Just because of the world scale
And I'm 99.9% sure that even if games use steam matchmaking, they still have to implement a lot of their own stuff into it
Steam is just great because everyone uses it, and the infrastructure is already there
ya
Ok so I but a log into my OnRepNotify method and I'm not seeing it
So maybe I've done it wrong?
UPROPERTY(ReplicatedUsing = OnRep_GravityScale)
float GravityScale;
Might have been me forgetting this
DOREPLIFETIME_CONDITION
does the client own a copy of the game instance?
Clients have their own game instance, it's not a copy of the server's or anything
It persists throughout the client's lifetime, regardless of sessions or anything
awesome, thanks
@neon mango is the function a UFUNCTION?
I got it working
It was missing the DOREPLIFETIME
I'm confused still on if I should use an RPC or replicate the vars
I'm currently replicating two bools and a float to achieve something, it seems fine but should I just put them all into an RPC and handle it that way?
That question for me usually involves asking myself a couple other questions. 1. Do i need these new variables updates right now? Or is it ok if they silently update somewhere down the line. If its okay they update later then just replicate the variable. If their part of time crucial gameplay mechanics then use an RPC. 2. Even if my variables are not time sensitive, or gameplay crucial. But when those variables finally DO update. Is there any logic i need to perform? If the answer is no. Then your probably great for a simple replicated variable. If the answer is Yes then you might consider Instead using a RepNotify, Which is kind of like a function, But it executes every time that particular variables is changed, and replicated. Excellent for UI/HUD stuff if you ask me.
So I have a chessboard-esque level with different types of units, all of which inherit from a single parent class. Some of these units will properly replicate while others will not, and the ONLY difference is their skeletal-mesh. Any ideas on what I should check out to solve this?
It's essentially a chess game where player 1 (server) can move any of his pieces and player 2 (client) will see, but when player 2 moves one of their pieces, some work while others do not.
The behaviour is not consistent either. Sometimes a knight will replicate, sometimes it wont.
Can the net load be too much sometimes? It's poorly optimized so maybe too much traffic could be breaking it?
I moved the client's knight on multiple trials, all of which had identical steps leading to it, 3 results came
- the piece did not replicate to the server (most common)
- the piece successfully replicated to the server (about 1 out of every 5 attempts)
- the piece successfully replicated but after about 5-10 seconds of waiting. (only happened once)
Any ideas are appreciated, I'm off to bed for now. Will check tomorrow. Thanks.
I have an event: OpenTheDoor, which is run on owning client. When it executes, I'm calling setRelativeRotation node for door mesh and rotate a door. It works fine visually. Door is opening on a certain client. But there is a problem with door collision. Collision still the same if a connected client opens the door - which mean that door is closed, even if visually it was opened. And if player, which created the server, opens the door, then even if a connected player didn't open the door, he can walk through. How to fix that?
@vivid siren check each of the child classes and make sure is replicated is checked
@vivid siren using OO in UE4 sometimes settings get messed up
@vivid siren im not sure how things are these days but a year or two ago, I was being constantly punished with glitches doing OO, i.e with settings gettting overwriten - so I changed to data driven classes from data tables instead of all my logic being held in my object hierarchy
you forgot to mention @vivid siren
Hi everyone, I can't wrap my head around one problem that I have. I work on a lobby for my multiplayer game.
I simply want to notify my Lobby Widget that a new player connects. I get the incoming connection from GameMode C++. How can I establish the connection between the two ? I can't figure out globally the workflow between Widgets and the rest of the game. Thanks
GameMode -> PlayerState -> PlayerController -> HUD is what I do
Can you get Widgets from HUD Class though ?
normally I define the widget in my hud class c++
via a TSubclassOf<class UUserWidget>
and then set the property in the bp editor
then spawn it in the hud
So all your widgets are spawned directly from the HUD class ?
I used the level blueprint
Alright thanks i'm gonna try that
sure np
void AFPSCharacter::StartStun()
{
// Stop running
SetRunning(false);
MulticastStartStun();
}
void AFPSCharacter::EndStun()
{
MulticastEndStun();
}
void AFPSCharacter::MulticastStartStun_Implementation()
{
DisableInput(nullptr);
// Pause the animations
GetMesh()->bPauseAnims = true;
if (GetCharacterMovement())
{
// Stop and disable movement
GetCharacterMovement()->StopMovementImmediately();
GetCharacterMovement()->DisableMovement();
}
}
void AFPSCharacter::MulticastEndStun_Implementation()
{
EnableInput(nullptr);
// Unpause the animations
GetMesh()->bPauseAnims = false;
if (GetCharacterMovement())
{
GetCharacterMovement()->SetMovementMode(EMovementMode::MOVE_Walking, 0);
}
}```
does anyone know why my animations wouldn't be pausing on the server?
I'm trying to call the multicast rpc from the server
@jolly siren Is that Multicast Called on the Server?
What part of your code, exactly, is not working
it's not pausing the animations on the server
GetMesh()->bPauseAnims = true;
I'm digging through core
Stupid question, why do you have anims playing on Dedicated Server at all?
because they are driving gameplay elements via anim notifies
Uff
I would not be surprised if you can't pause on a dedicated server
I would not use AnimNotifies for gameplay logic
Only for FX
I'm pretty sure paragon uses notifies for gameplay logic
Can't say
Ok so, it's going into the "ShouldTickPose" function
Which consits out of && in the return
so if you set it to true, that should return false
Even on the Server
The "TurnOff" function, that normally sets the Mesh to be paused (function of ACharacter), excludes the Dedicated Server
Yes, that one
yeah I"m not using turn off
Na just saying
So just to recall: You want to turn it off?
So it's still ticking on the Dedicated Server?
Okay and I assume you already debugged it that much that the DediServer is 100% still calling it
no I'm about to throw in a breakpoint, need to use a conditional because it's a ticking function
sec
so yeah it's still hitting ShouldTickPose with a bPauseAnims of false when the player is stunned
I set a conditional breakpoint on that line with the condition of bPauseAnims==false and disabled it until I stunned the player
well it should always call ShouldTickPose. but bPauseAnims is still false on the server after the player is stunned
and yeah it's not a single frame
Weird..
๐ฉ
Did you, even if it's a really simple thing, try to instantly print "GetMesh()->bPauseAnims" on the Dedicated Server Multicast only
Maybe something accesses the value at the same time and sets it back to false
instantly after setting it to true*
no I will try that tho. I never see it being set in core code tho besides for in the TurnOff function
and that is setting it to true
True though
But on the other hand, if you set a var to true and it ticks with false, something is off
yeah, and it's not hitting the end stun part of my code until it should. so it's not my code that is setting it back to false incorrectly
@thin stratus if you had to make a project with ded servers and mostly working steam integration which UE version would you use: 4.11, 4.12 or 4.13?
I would use 12
Since I did not hear anything about a version working better or worse, i would use the one that fits the needs of the rest of my project
Steam + Dedicated Servers don't work with blank UE4 Versions anyway
So what ever you take, you need to PR the SteamDedi Server fix anyway
I'm on 11 which works perfectly but there is a problem where bad packets fatal the server, they fixed in 4.12.. but they don't know where the commit is so I can't merge it lol
right?
sounds about right
Idk, what keeps you from using 4.14?
yeah the pull has been updated to 4.14 so I would use that. I haven't verified that it works tho, I'm still on 12
well I really don't like moving at all, I have made a lot of changes to the engine, and everything works fine... moving version always breaks
- new version of physx murders my custom vehicles
yeah I tried upgrading to 14 and my cloth caused crashes
to be fair
you didn't say upgrading
You asked for what version i would use if I would make a project
ye
I know steam voice works on 4.11, is broken in 4.12, works in 4.13 but drops packets if more than 2 ppl speak at once
๐ฌ
it works in 4.11 with a pull
well if you are on dedicated server
but hasn't worked since
it's not just 2 ppl speak. you get like a couple words out of an entire conversation if that
Alex pointed me to this thread because I've been complaining about these things..
From what I understand Achievements are supported in BP. However, Leaderboards are not working correctly and it's still hasn't been fixed. This dev provides a fix https://lordihean.net/2016/04/21/ue4-tutorial-resolving-steam-leaderboards/ and I don't see how Epic can't fix it in the stock UE4 ?!
No one really knows if Cloud Saves, Player ID, etc. are supported at all.
Not to mention anything multiplayer related is not working and not even exposed to BP.
The odd thing is that most of,
so i guess that's where we are posting if you want to join the club
I guess it's time for everyone to get their pitchforks out
๐ฑ
sigh
I don't want to but I feel like I want to bring up the whole "we only succeed when you do" and the lack of steam love
I think it's time for us to do that tho
I have been waiting patiently for a long time
Yeah, it's a real no brainer too, how many people are going to use steam vs a VR editor, if I was to put it coldly ๐
yeah they have been pushing vr so much, but we really just need these steam things fixed. I listed the 2 main issues on the thread. Those are critical issues in my opinion.
especially the dedicated server bit, I mean come on
@thin stratus hrm so this is printing true
void AFPSCharacter::MulticastStartStun_Implementation()
{
ENetMode Test = GetNetMode();
DisableInput(nullptr);
// Pause the animations
GetMesh()->bPauseAnims = true;
if (GetCharacterMovement())
{
// Stop and disable movement
GetCharacterMovement()->StopMovementImmediately();
GetCharacterMovement()->DisableMovement();
}
if (Test == NM_DedicatedServer)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("bPauseAnims: %s"), GetMesh()->bPauseAnims ? TEXT("true") : TEXT("false")));
}
}```
There I replied to thread ๐
good work, yeah we need more people bringing attention to it
nvm those are different skeletal meshes lol
I do have this set but I don't see why that would cause issus
GetMesh()->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
Think that's only for the start setting
oh I'm looking at it's super shouldtickpose now
bool USkinnedMeshComponent::ShouldTickPose() const
{
return ((MeshComponentUpdateFlag < EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered) || bRecentlyRendered);
}```
I set it to AlwaysTickPoseAndRefreshBones because I want the animations to still run on the server for clients that aren't being rendered
but still
it is an and in USkeletalMeshComponent
return (Super::ShouldTickPose() && IsRegistered() && AnimScriptInstance && !bAutonomousTickPose && !bPauseAnims && GetWorld()->AreActorsInitialized() && !bNoSkeletonUpdate && !bAlreadyTickedThisFrame);
so that shouldn't matter
Are you 1000000% sure that the mesh you check the bool in is the one that still ticks?
needed to walk away for a couple minutes to get a fresher perspective. going to look at it again
Hey I am still quite new to replication so I'd be very happy if someone could help me with an issue.
I move my characters spine with a transform bone animation node as seen here: http://puu.sh/sNswQ/a814a010ec.jpg but when I run for multiple players only the host can see other peoples bone transform
@thin stratus so it looks like it isn't ticking for CharacterMesh0 which is the mesh in question. But the animations are still playing on the server. So confused
damn thought I had it
GetMesh()->bNoSkeletonUpdate = true;```
that visually stops the animation on the server now
but the notifies are still getting hit somehow
strange
the notifies are only getting hit on the server
hmm there is a Montage_Pause
GetMesh()->bPauseAnims = true;
GetMesh()->AnimScriptInstance->Montage_Pause();```
this looks to work
montages must work differently? the montage still paused fine on the clients, but not on the server with bPauseAnims
so that is still weird to me
@jolly siren go into your character, click the skel mesh, scroll down to skel mesh section above optimization
go to mesh component update flag
try setting it to always tick pose and refresh bone transforms
that's what it is
๐ฆ
calling Montage_Pause fixes the issue tho
along with bPauseAnims
I guess montages work a little different
huh
I think I did that flag thing to fix a problem I had where the dedicated server was screwing up my hitboxes because of animations not working properly
like shoot a guy in the head would return the wall behind him lol
yeah I've had that set for a long time
GetMesh()->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
because i want animations to run on the server even if they aren't being rendered
ye need that
oh that's a vague question, I was going to get a general opinion of people who play shooters. the capsule style hitboxes epic skeletons have vs replacing them with more generous box shapes like source engine
I find the more accurate capsule shapes tend to make picking shots and getting a "feel" for the aim a bit less consistent
idk though
Does Spawn Actor from Class automatically replicate the spawn actor?
The Actor must be Spawned on the Server and have bReplicates set to true
Hmm.. odd.. i did that.. although doesn't always work
Like it works
Then it doesnt
Back to the drawing board :D
Sorry, I wasn't going to delve into my issue. Basically the player picks up a non existent item (i call spawn item on the server with no parent) then do some local add impulse from the player onto the newly spawned object (reference was passed by the server). Works perfectly in editor. On a packaged build the ball sometimes spawns, sometimes doesnt but when it does, it wigs out and doesnt impulse
@carmine parcel make an event which runs on multicast that does the transform animation node
Make sure that event is called on the server though
Does anybody here know about an obvious way to use Player-Specific UMG UI in a local multiplayer splitscreen situation? It doesn't scale to the player's part of the screen.
I researched google & forums and there is not that much ot there. What's out there indicates that there is no solution for this inside the engine out of the box. Correct, or am I missing something?
Is there a way to test multiplayer in editor with different IP addresses?
i'm facing a veyr werid multiplayer issue
apparently one of my replicated actor play some soudn when it enters the world
however, the funny thing is that, for some player the sound only play when they first 'SEE' the actor
any idea why
i am pretty sure it have to do with network relevancy... but the funny thing is that everytime it becomes relevant again the soudn will play again
i don't suppose BeingPlay recycles itself right?
if they become relevant, they are technically constructed on that client at that moment and the begin play fires
so is it being fired in the begin play? is the sound set to auto play?
@compact gulch are you using network distance culling? if so begin play will fire each time they come in and out of range and begin getting replicated again, unless it is a placed actor (placed on map with net load on client checked, rather than spawned at runtime)
@fringe dove @thorn merlin you guys are right... everytime it comes into relevancy BeginPlay fires again... this is something new
Anyone know why the blueprint event for NetworkError loops? for instance, if I lose connection to the host NetworkError is called endlessly informing me of that
weird, I wonder if its because I call Destroy Session in that event?
Could be
Make sure to only call that stuff if ti's not the server
Otherwise you kill the server when someone has an error
The passed bool exists for a reason :x
Hm
not sure if this is the correct way of going about it but since I cant pinpoint why its an infinite loop (might be due to standalone testing) this is my workaround http://i.imgur.com/zCrX7jU.png
Did anything major with Steamworks break between UE 4.13 and 4.14? Having issues with fetching name, setting stats and updating achievement progress. No issues with our Oculus platform build. Recreated ini but still no luck.
Looks like we tracked down issue. Getting one of the Steam stats seems to be crashing the Steamworks subsystem. Removed that node and all is working again.
.-.
What do you mean by that? If a client is connected to a server within UE4, then yes
But if you're doing the actual matchmaking and not using Steam or something else, you'd have to most likely build your own web API
@twin juniper using beacons you can add your own communication between clients in your matchmaking process. Not from BP though. It may also require some deep knowledge about the beacon system.
is there a way to create automated tests to simulate player input from multiple clients?
If a client has a ping of 50ms, that means physics objects are simulating and displayed 50ms in the past, as there's no interpolation, right?
But that's not the case for characters?
xPost from ue-blueprint: Anyone know how UE4 determines what camera a PlayerPawn will use? I have a pawn with a CameraComponent, but for whatever reason when my player joins a game and the pawn is created the camera is placed at 0,0,0 (inside my level.)
I've got a two client setup where one is a listen server and whenever P2 joins, P2's camera doesn't use the camera component on P2's Player Pawn actor.
You might have auto assume camera set in player controller. Also, you can assign camera with set view target with blend
Are you positive the camera is spawning at 0 0 0 or is the player spawning at 0 0 0?
some sample blueprints dont assign a default pawn, but have pawns placed in the world with auto assign controller to 0, so in a mp scenario that falls apart
(i think the vehicle demo has this problem, or at least it did)
the only other thing could be a collision issue - it sucks but you really gotta pull it apart to figure out whats going on
Or he simply doesn't possess the pawn
Which leaves the PlayerController at 0,0,0
Aka the cameramanager aka the camera
@keen frigate Try tthe "add to player screen" node instead of the "add to viewport" node.
@cyan bane pretty sure simulated physics don't replicate
@night jay yes! thank you, my lifesaver ๐
hey guys in matchmaking with steam, what happens if the host crashes?
is there any way to setup a host switching system
where if one host leaves the game
another player takes over?
like in call of duty
host migration?
You could probably implement some way to serialize all important data and send it over to another client, though I'm not exactly sure of a way to do it if the host crashes. COD most likely has some sort of master server that handles that, though that's just speculation on my part
thats basically how you would handle ddosers tho
if someone ddos's the host
migrate to a new host
migration makes a lot of sense otherwise too
if host just rage quits when losing etc
Ok, yeah, it's just when an actual crash occurs it's probably different, since once you don't have a host not much you can do from it
You would have to do most of it on your own most likely
well, for that to work, you'd need to have all clients to have the same data as host
or some other place
and if it's some other place, why would player even host the game in the first place?
It's a lot easier to host a simple web API than a game ๐
A master server that updates every so often that just pulls data from the host might be possible
You would have to set up your GameMode in a way that it can take in parameters to set up a game in progress based on them, and set up a way for everyone to get a new IP/session
Sad to see simple host migration to not be implemented natively though
^
Well, it would most likely be pretty difficult to support that out of the box
You would have to make sure that people are assigned to the right PCs, that possess the right pawns with the right parameters, make sure nothing in the level/game is dependent on the game starting normally, etc
Could someone link me to a tutorial on Beacons? and what they are for
man the entire ue4 answer hub is dead
https://answers.unrealengine.com/questions/322515/ue4-steam-host-migration.html
https://answers.unrealengine.com/questions/509631/what-happens-when-host-disconnects.html
https://answers.unrealengine.com/questions/407475/host-migration-2.html
https://answers.unrealengine.com/questions/193834/how-to-handle-host-migration-in-network-programmin.html
all dead
@night jay Simulated physics do replicate, if you set their movement to replicate. It'll simulate on clients and correct location using data from the server.
Problem is it jitters (the worse the ping the worse the jitter) because it's old information.
Hey guys! I'm having massive netlag on the client side when I play in editor. I'm using New Editor Window and 2 players. So one is server and one client.
But the client is more or less unplayable. If I launch the game on two different computers it works just fine. It's just when I play two at the same time in the editor this happens. Anyone else had this issue?
If you're sure that it's not frame lag, and is indeed netlag, you may have entered the command to simulate netlag.
Yup, it's indeed netlag. A lot of rubberbanding. Don't think I've entered any command to simulate netlag by accident, but I'll check it out.
@lapis quarry whats your servers cpu like? i get that if my physics is being starved on the server
Have a timer on server and "SecondsRemaining" variable, which I cannot replicate, because it's inside a struct, which is inside TMap(which is not replicatable in UE as I know). Any ideas on how to send this variable to the client each tick of timer?
Replicate it through the GameState
@fossil spoke And how can I do this? TMap is inside ActorComponent, which is inside a PlayerState, but TMap on server and on client are different. And I should get this variable in UMG widget.
Why would you hold it inside a TMap?
@fossil spoke Because it works faster than TArray.
Well you have a problem then your TMap cannot be replicated so you need to pass it into a replicated variable first to be able to replicate it
@fossil spoke I tried to mirror data to TArray on each timer tick(which is not good, but for testing purposes is fine), but got the same error, like when I tried to replicate TMap - something like PropertyMap.cpp deprecated code 404 line...
Don't know why, because I didn't set Replicated to TMap in UProperty, when I tested this
Is the TMap just holding the SecondsRemaining?
No
As I said previously, it holds a lot of data and seconds remaining is inside one of struct
Im assuming these are Timed Events or Quests or something?
Something like that
You probably want to replicate all the data in the Struct as well yes?
Has anyone encountered OnlineFriendsInterfaceSteam not setting this rich presence info correctly? https://github.com/EpicGames/UnrealEngine/blob/e528f9f7fa161504dd629c3b390deac93650e43a/Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineFriendsInterfaceSteam.cpp#L242
SteamFriendsPtr->GetFriendRichPresence(SteamPlayerId,"Joinable")```
@fossil spoke No, not necessary
System works fine without this
All important code runs on server. Basically I just need this variable for UI only
and only this variable at this moment
Just have a proxy variable on the gamestate thats sole job is to present the replicated value to clients
@fossil spoke I really don't want to make a links between my ActorComponent and GameState. And I can have unlimited(in theory) number of this(SecondsRemaining) variables, because it's TMap, which means that it can contain a lot of entities. So we're returning to TArray, which didn't worked in a last test. Probably, I will try it in a different way tomorrow... Thanks for help anyway.
Hey guys have any of you used the Http request stuff? I can't seem to get mine working right
in c++?
@wise depot forgive me for promoting my own stuff, but i released a hacky game browser using fhttp, so this will work for you - https://github.com/bitporters/RC_TRAINER/blob/master/Source/MyProject/rcGameMode.cpp
I see you too found Rama's post from the Sagittarius Link Client? ๐
yeah thanks for the example though! my stuff looks pretty identicle to yours barring mine is GET not POST. can't seem to get it working though -.-
thats probably where i learned it back in the day yea, back then i think he had the only real MP examples out there
where/how is ti failing?
maybe try switching yours to a post to see if it works
if (Http->IsHttpEnabled()) { OnFailure.Broadcast("Http disabled"); return; }
apparantly http is disabled
this is my cpp file:
using an asynchronous blueprint function if you're wondering about the proxy stuff
but essentially the order of operations starts at Activate()
@thorn merlin any ideas?
i think you want a whack in there
oh nm
i dont have time to get into this mindspace but perhaps its your device? does this have same behavior on other machines?
i thought thats what it was but i quickly doubted that thought because i quickly eyeballed your code
i do that alllll the time, i have a similar situation tho when trying to get tcp sockets but it actually DOES fail, but I think its because the engine is already using the one i want to work with
(trying to do a hacky NAT punch on android)
it was actually still failing after i fixed that, turns out there's some stuff that's meant to be in Project/Saved/Config/Engine.ini that wasn't there. so i've added it to that wiki page
now if only i could figure out what was responsible for populating the default Engine.ini file
Has anyone here worked with the IOnlinePresence interface?
It looks like steam supports RichPresenceData but IOnlinePresence doesn't support key/value pairs, just updating the status key
This works using delegates for create, start, end, destroy, join session events.
ISteamFriends* SteamFriendsInt = SteamFriends();
if (SteamFriendsInt != nullptr)
{
if (!SteamFriendsInt->SetRichPresence("Joinable", "true"))
{
UE_LOG(LogOnline, Log, TEXT("SetRichPresence failed"));
}
}
Somehow this spawns my controllers perfectly on the server, but the clients does not get any controllers.
the clients does see the servercontrolled pawns controller. but they dont get their own.
I want a server to spawn players with a different replicated variable when connecting in VR vs 2d; so far the only way I've found is to add an IsVREnabled parameter to the join session URL, then have a map in GameMode that maps UniqueNetId to IsVREnabled, and set the value of mapping during PreLogin, where you have access to the URL parameters. Then in PostLogin, where you no longer have access to those parameters, look up the UniqueNetID from the player controller, and check the the map setting before spawning.
and even then, when spawning, the variable might not get replicated before begin play on clients?
is there a simpler way?
I'd imagine you'd need something similar if a client wanted to connect as a spectator; is there already an example of that somewhere that does things right way, and plays nice with all the GameFramework stuff?
@unique patio You're not giving anything to client, you're only giving client references. Replicating just means client can see the changes made to the server object, but they still don't have their own.
You have to create on client.
Okay, do basicly a multicast and spawn/attach. But how do i replicate it to the other clients. Multicast and then send references and let the other clients attach the same objects?
Non replicated objects can't be passed
If you have non replicated objects, you need to create them on the client side too
However If the object is replicated, you can pass it
Replicated actors, spawned on the server, will also spawn on clients
The actors are replicated by flag.. but somehow just flagging for replication does not replicate the actors...
It should though
Yeah.. but it doesnt :/
If i client spawns a actor with replication flagged it does not replicate :(
Yeah i just wrote the server needs to spawn it
Clients do not have authority
Otherwise cheating would be an easy thing, right? :P
Yeah but even if i do if auth -> run on server. It doesnt spawn anything but the servercontrolled pawn
Authority IS the server
Remote is the client
If Authority gets called, you are already on the server
Okey so i should just do begin play and do a run on server event where i spawn and attach?
Begin Play in which actor?
Every pawn
Not really. But same thing. Motion controllers
Oh, you are from the forums
Or?
Read someone similar today
Anyway
You would use BeginPlax
I got the transforms replication working perfectly though
y
Switch has Authority
Use the authority exec
And spawn the controllers from there
If they are set to replicate, they should spawn for the client too
Yeah.. i thought so aswell
Haha
But they dont ๐
I gotta head to bed.. but thanks exi and ben!
Ill keep trying it in a fresh project
anybody have an issue getting a game instance in a widget? it doesnt seem to be appearing o.o
I noticed this is on event play. is it possible it's performing multicast before all clients are connected? @unique patio
He should not need to multicast
Player Joins, Character gets spawned, Beginplay, limited to server, spawns replicated controller actors
@unique patio people always balk at me when I suggest this, but the best way to learn how to attach things in multiplayer right now is the multi vehicle turret asset on the marketplace
thats not my asset btw, i just bought it to solve this problem, its nothing complicated, you just have to do it a certain order
Anyone know how to make a multiplayer menu?
ue4 cant do direct peer to peer can it, for mobile
@boreal bay Nope, no P2P build in afaik
@rugged radish A multiplayer Menu?
Like, host join, stuff?
yes
Boy, you should be able to find Youtube Tutorials about this
Multiplayer Shootout (Epics Learn Resource on the Launcher) should have one
ShooterGame has one
And even the Video Tutorial of Epic about the Lobby has one
Although i don't like that tutorial series cause of the mistakes in it
the epic recent epic one had far too much umg and other things getting in the way of the multiplayer stuff
i cant wait till @summer rivet does a refined WTF and HTF multiplayer series
I wish @thin stratus would do a series on them he has that stuff down pat ๐
Wouldn't I be a bit stupid to cover the stuff my Marketplace project offers in a tutorial? :P
A Menu and a Lobby will always have a lot of UMG in it @thorn merlin
But I agree, a basic Multiplayer Series would also help
But then you can also just read the PDF
Since that's the same information i nthe end
well.. im not sure what i mean.. it just that last epic tutorial seemed to be doing too much to really refine out the actual MP education
the zak perrish content is what i learned on, that was perfect and i wish was iterated and expanded on
ill prob buy your marketplace thing in the future, you learn so much pulling apart someone elses work, im still digging through generic shooter like crazy and finding gems
My Project is also UMG heavy
There is a lot of stuff happening in the UMG
But of course also in the actual Replication process
So, yeah, you might be able to learn a lot from my project
Although that wasn't really the idea behind it, as it's more about providing you with a good lobby solution
Despite that, a basic tutorial about replication in a gameplay scenario might be worth more
Who knows why my Character is jittering in MP but not in local?
guys i have a doubt about event replication, i was gonna ask it here but maybe there are more people with this doubt so i posted on the forum, https://answers.unrealengine.com/questions/538369/networking-doubt-about-event-replication.html
@dense citrus You are probably setting the location via the server only
And not also on the owning client
So client and server fight about the position
im trying to host a game and then on the second client im trying to get the server up in the server list on "Find Server" (using Advanced Sessions plugin) it find's the server but it fail's to fetch "Extra Settings" -> ServerName and fires off the "Not Found" execute pin -.-
@meager walrus Yo, this is an Ownership question
Check the docs or my pdf and look into ownership
It should feature tables that show how RPCs are handled on specific actors while they are called from owning client, non owning client or server
So basically what you are asking
@vestal cobalt You should ask the plugin creator :/
it's just a coding error not a plugin failure but i can't f'in find it -.- been looking over the code for hours now and fail searching everything
Settings are passed in the create session node
Make sure it's named the same
Other than that, no idea without seeing the code
it is i've copied it directly from create session
and this is create session part
Are the other settings working?
well it fail's on the ServerName and that is the first node so it wont get any further as you can see, only if the extra setting is found it will execute the next one
Try retrieving a different one
Wanna know if only the servername fails or all
Also you are testing this on lan and not on steam with 480 appid or?
tested now, it fail's on the next one aswell (Map not found)
im testing this with steam yea
steam is working
480 appid?
ye
You could end up retrieving other 480 sessions
That don't belong to your game
Also I'm not sure if steam doesn't have special setting names you need to use
Please try it on lan first
i have gotten this to work befor (sadly i lost the project) -.-
Good morning everybody on ETZ ;)
@thin stratus also my jittering is only on client side visible, everybody see the next one without jittering :) but how I can set it right ?
Hey, guys. Would it be possible to make a 100-200 player FPS in UE? I know, I know, completely impractical for me to do on my own, I'm more curious as to how it would be done than anything else. My theory is low level socket programming and a custom back end program to handle the sockets and data transfer? Would that be how you would handle it?
@mokilok You'd have to create your own networking solution. UE4's networking is not optimized for large player counts
with 4.14 and really basic collision geometry in your level you might get close though
guys
to test multiplayer with steam is it possible to just to into the project, right click the project file and "Launch Game" 2 times, wouldn't that be like 2 completely seperate instance's?
Yes, that are 2 different instances
but Steam doesn't allow the game twice on the same PC
@eternal quiver @stiff wasp @heady delta What I read the past months, and don't quote me on that, is that the 200 movement components of the character have the biggest impact. You might be able to get 200 people on a server if you fight the bottlenecks
@dense citrus That adds to me idea of you setting the Location somewhere on the Server.
Do you have a point in your code where you call a ServerRPC and pass it a Vector to set the Location on the Server side?
so i have to test it on to seperate computers with 2 diff steam accounts? _.-
-.- *
my VMware is flipping out and not helping -.-
so i can't test it there
Correct
If you are a single developer, it's a pain
If you have teammates, make sure your stuff is setup to fastly share client builds
im trying to update (Windows Update) on the VMware but it get's stuck on 9% -.-
oh NOW it suddenly jumps up to 45% -.-
I'm not sure if you can manage to give your VMware enough resources to actually launch your game properly
But give it a shot
i've given it 8Gb memory more then that i cannot set
it uses default video card, cpu and so on
if i remember correctly i have used VMware befor and tested sucsessfuly
@thin stratus MmH hard to say , I have only couch jump run walk and the pitch for aimoffset replicated :) but didn't know is this right
As I said, if you set the Location of the Character by hand somewhere
Then this might be the place where it goes bonkers
@thin stratus now i've tested it with 2 computers and 2 steam account's and i can't "Find Server" -.-
@vestal cobalt try to increase the numbers how much sessions you will can find like 1000 it should help
i have it 1000 xD
@vestal cobalt ok funny
it somehow can't find the "Extra Settings -> ServerName".... so it fails
Well, I stay with my idea of 480 being a bad thing to test Session finding with
Try it on 2 pcs with LAN
If that works, then I'm kinda sure that you are just retrieving tons of other sessions that don'T belong to your game with the 480 appid
You can even check your logs
ok i tested it on LAN and it's on lan i get the "Server Name NOT FOUND" -.- so atleast it find's the server on LAN but it can't get the "Extra Settings -> ServerName" :S
i have double, tripple checked the key name it's "ServerName" :S
Hm, at this point I don't know anymore. If also all other keys fail
Then it might be something with the plugin
:/
that's weird cause as stated earlier i have gotten it to work befor
ye
@vestal cobalt ok moment i will send you a pic as an example like i do it always
kk ty
i have done it befor, but for some reason it fails now -.- if only i had my old project....
Is it possible to forbid my animation BP auto replication?
So that don't even try to send information to server
Your AnimBP shouldn't replicate or?
It mostly checks the variables it as locally
So if you don't replicate the variable, such as "crouching" it shouldn't do stuff
Who knows to get the Steam name into a Game ?
Has anyone here ever gotten LateJoinInPie experimental feature to work? Would be super usefull
@dense citrus get player name variable in playerstate. If you use Steam it'll automatically return the Steam name.
Ahh ok thanks
One other question , how I can set up the voice over ip ;) is this complicated
Damn i lost the link to @thin stratus PDF... does anyone have it?
Nvm it was pinned ๐
Btw when im spawning something and i use the player controller (not server) as "owner" it means that the controller itself has authority?
if i leave it empty, its default server Authority?
If you spawn something not from the server, the whole logic fails already
Server has authority. He spawns the replicated actors
If a client does it, it will only exist locally
@unique patio
@dense citrus If the plugin doesn't support it, then voip would require c++ afaik
Hm, sadly never used the plugin. Doesn't he have a tutorial
Nope
I asked this in #blueprints too:
[11:36 AM] MrCheese: I'm setting my player name before starting/connecting to a server. Once I'm in MP, I can't get the name to work properly.
[11:36 AM] MrCheese: I've tested the replication thing on 3rd person template, it works and I get it.
[11:37 AM] MrCheese: But getting the names to come from BST (Before Server Time) seems impossible
[11:38 AM] MrCheese: I don't even know why I'm getting a new PlayerState, I was sure that was the right place to put everything.
[11:38 AM] MrCheese: Any clues?
I'm going mad now. Been up all night and nothing I've tried gets all the names right
Ok, so there is no place to actually give the Server the Name while connecting
Unless you use Steam or something, that handles it for the PlayerName variable, back in C++
If you don't use steam, you simply need to store the Username, before connecting, in the GameInstance or SaveGame
And after connecting, you use the PlayerState BeginPlay (Authority) to go over to the owning Client (RPC), ask him for the PlayerName he saved and then going back to the Server (RPC) and letting him set a replicated variables
It's actually pretty straight forward
I don't seem to be able to do that
I'm getting the names back out of the instance ok now, but I'm not sure how to set the names back to the clients
I'm currently in the player controller and have a replicated variable with the correct name in it
I'm now stuck getting it one the pawns
on^
Is this not how I should be setting the name?
It looks like I am now getting the correct names on to the pawn, in to the TempName
But the replication isn't going
No this is not how you do that :P
Show me the PlayerState part where you get and set the var
Weird, it was an example that worked in a 3rd person template test
I'm not using the PlayerSTate anymore, that didn't work and this does.
Then it calls the Update Avatar call from the previous screenshot
And this is the part before that
Really complicated system for get player names ;) or what is your plan
I couldn't get them to persist when I connected to a MP session any other way than saving the name in the instance and getting it back.
I'm probably missing something, but my Google-Fu failed to find anything
Once I get my head around how this works, rather than me just messing about with trial and error, I'm sure it'll be fine
I see there is a pinned PDF guide, I'm going to read that.
Thanks @thin stratus ๐
In PlayerState->BeginPlay->SwitchHasAuthority->AuthorityExec->CustomEvent RunOnOwningClient (GetPlayerName)
In PlayerState->GetPlayerName(custom event)->GetGameInstance->CustomEvent RunOnServer (PassPlayerName) with StringInput
InPlayerState->PassPlayerName->SetReplicated PlayerName Variable
The replicated Variable should be RepNotify. In the RepNotify function, set the TextRenderer
Thanks, that makes sense. Is there an easy answer as to why my solution wasn't working?
CallUpdate is not going back to the Server
Delays are not a thing if you want to properly code networking
Only because it works with a delay, doesn't mean a lag won't break it again
Ok, I think I understand
UpdateAvatar das the exact same thing, despite setting the Variable as the Server
Yeah, the delay was temporary
that doesn't, at all, make sure that the variable is actually replicated when you call the Client path
That's what the RepNotify is for
Along with all those extra connections, I have to print everything to a string to see if it works because it's quicker than building and looking to two HMDs ๐
Nice, thanks
@thin stratus Nope, I'm a dumbass. The RepNotify variable should be on the pawn, yeah?
You could use the Pawn, yes. You coul also place it on the PlayerState and get the Pawn inside of the function
Either waay, I'm not hitting the right pawn ๐
In the PlayerState
GetController
And GetControlledPawn from it
If GetController in the PlayerState doesn'T exit
try GetOwner
and cast it to controller
Using a 3D widget instead of a text render would make things a bit easier
Then you don't need the RepNotify stuff
You would simply create the 3D widget in the Pawn
And pass it the PlayerState reference
That one then binds the name to the text your setup
So if you change the PlayerName variable
the binding would update
Yeah, good point
There are probably tons of other ways, way better ways, but in the end, having it working is the base point you need to reach
I'm casting to my Pawn in PassPlayerName, the client pawn is still getting the server name
ive just started setting up my networked game, however all client pawns are invisible to the server
i can see none of the components from the server
i know about replication functions/events
but how do i show the pawn/character components by default?
hey guys, so there's some event in the game instance for network errors (can't remember offhand)
ever since upgrading to 4.11.2 our game also goes back to the entry map on network errors which we've never put as part of the handling events for that, any ideas why this happens now?
@dull river are the actors/pawns/components all marked for replication? and is the server spawning all of them?
you have to mark them as replicated/repnotify yourself
@thin stratus I haven't been able to cast to the locally controlled pawn. It's exactly the same problem I had before ๐ฆ
PassPlayerName needs to be a ServerRPC
You want to give the Server the Name
And don't use "GetPlayerController0"
As this gives you the Server one
Yerah, I noticed right after the screenshot
You need the one that controls the PlayerState
Use GetOwner
And cast it to the PlayerController
It doesn't. I'm beginning to think I do understand, there is just something else is broken.
AFAIK The casting fails on the casting is failing on the controlled pawn and working on the other
BEcause I put an IsLocallyControlled check on the RepNotify
If the Cast fails, and you don't get an AccessViolation error
Then your pawn is of the different class
Ok, then there's something I can try...
I am spawning a replicated actor on the server via SpawnActorDeferred, setting it's mesh, and then calling FinishSpawningActor. The mesh is not replicated, however I thought that it would spawn with the correct mesh on the clientside, since I'm deferring the spawn on the server until after I set the mesh
doesn't seem to be the case
So I have to replicate the mesh?
Does it just spawn the default version of the actor on the client regardless?
@thin stratus Well, it looks like my pawn possession isn't even happening for the client. Hopefully that's the issue and it's easy to fix
Pawn possession should be called once on the server
And the Pawn needs to be a repliacted actor of course
@jolly siren Afaik, it spawns the default + replicated values
And the StaticMeshComponent is not replicated iirc
well actors don't have mesh components by default
you have to add them, but okay. I was expecting it to create what it had created on the server
@thin stratus As far as I can tell, eveyone has the right pawn and controller class.
Still not working and I can see anything wrong
Sometimes these things just are staring you right in the face.
@green berry Which of these casts fail
Had that problem last night lol.
PlayerState
Or PlayerController as a component
The PlayerCharacter can always get destroyed somehow
Then the data would be lost
right, but killstreak only matters while he is alive
Longest killstreak is not a thing?
Keeping track of who ended his killstreak or maybe a deathstreak breaker
yeah it is, I guess that would be a separate property on the playerstate
I would put it onto the PlayerState
okay cool, thank you
im using a multicast event to update the materials on a mesh in a bp that isnt the player pawn, yet it doesnt seem to run or do anything
any reason why this is?
i get the first print (auth) but not the second one (server)
(the second one should be multi - but it still doesnt print)
i fixed it by putting the server and multicast functions in my character and calling it from the other bp
@thin stratus I'm getting the correct names from my Instance, moving them in to the State is easy enough but it's getting them on to either the controller or pawn that I can't do
So at the moment, it doesn't matter whether I'm aiming for the Text or a widget, as far as I can tell
.
I just guess
that you PlayerCharacter
isn't yet spawned/possessed
when your PlayerState calls the function
And if a cast fails
then the Owner seems to not be the PlayerController
@green berry
Print the display name of the Owner you get
I get: controller
NULL, sorry
So, that's why I tried a delay, for testing
If I bind stuff to a key to fetch the name from the State way later, it returns NULL
Somehow, I've got the two completely separated
Ok how about you trash the text renderer idea
And finally use the 3D widget
It would make all of this really easy
With the 3D Widget, you would simply save the Replicated PlayerName in the PlayerState. Without a repnotify and all that stuff
And then you pass the 3D widget the PlayerState (the PlayerCharacter has a Pointer to it)
I don't see how that helps, because my State is not connected to my PawnController
and the widget just pulls the name from the PlayerState
No, you are currently trying to access the Controller and Pawn on beginplay of the PlayerState
Where you don't even know if everything is yet spawned and connected
PlayerState sets the name correctly at the begininng though, I can't get that data out at all
Even when I try it after I've started playing
How can it set it correctly if your cast to the Controller fails
It's getting it from the instance
I can set the pre game menus to set it directly to the State, which is easier, but at the moment, that's not what is broken
I know, but I've just been concentrating on fixing the broken part, then I can make it efficient
It's not about efficient
If your Controller and or the Pawn aren't yet fully spawned and connected to the PlayerState
it would fail setting the variable
The PlayerName variable should sit in the PlayerState itself
And then you can access it from outside
If you really want to use the TextRenderer
then try this:
I'm saying that the PlayerState has the correct name for the players