#multiplayer
1 messages · Page 318 of 1
Anyone know how to display correct time/date for a multiplayer chat message ?
It works in standalone but not in editor or packaged game
So not sure if it's bug or I'm doing something wrong.
Might be replication issue but I can't see how as the message and the username are replicated fine and they are sent in exact same way as the date/time
https://answers.unrealengine.com/questions/585179/problem-correctly-displaying-utc-datetime.html
Thanks
Anyone an idea what can cause this?
Randomly I was unable to connect over steam anymore and I've thrown quite a bit of potential fixes at it but none seem to work. I assume that this warning is the reason as to why looking for sessions on internet on a steam-connected game stopped working
It only comes up in a packaged game, not if i launch it with a bat file
anyone who knows why i dont find any steam sessions using when i find sessions using steam online subsystem?
@loud wolf you launch the game via bat/packaged or doing in-engine? Anywho, if you launch the game does it say you're in steam game Spacewar(or your game)?
i tested it both in packaged game and play(standalone) game. yes, if i launch it i see the steam notif in the bottomright, and in my steam client it says im in Spacewar. I am able to host a session. But the other machine cannot find it.
I'm also testing if I can find my own session, but still no sessions are found.
Engine version?
Also can you check if you have the same warning as I have above? We might have the same issue
4.15. Sure i'll look at it
@wintry cove have you looked into your DefaultEngine.ini and see if DefaultPlatformService is set to Steam?
maybe try adding the game in steam client and launch it there?
it worked?
not that directly
can you share it here once you're done? 😃
do you have c++ in the project?
yes.
did you setup the build file?
yup.
The most obvious question is, is the IP address right?
And have you tried connecting to a LAN IP?
yes. enabling LAN works fine. i was able to host and find my sessions.
kk what about an ip in the same regionas you?
im testing on machines both in the same network
@loud wolf i have the same issue
It's the fact that Epic won't update the engine
(is what everyone tells me)
@chrome bay you made a chat system can you help me with my problem?
possibly
IIRC, Date Time Variables don't have any UPROPERTY values, so they won't replicate. let me check
Yeah, the Date Time won't send because interally, it's a uint64
so the only way to get around it is to send a uint64 and rebuild the datetime struct on the other end
But that requires C++
The solution in Blueprint is to send the extra string data, but that makes the chat messages more expensive
alternatively, you can break the date time first, send all the int32's accross the network and then re-make a DateTime struct on the other side
again, more expensive than C++
In my game I use local date and time anyway. Computer clocks aren't garaunteed to be the same and you'll get wierdness with people in different timezones
Also worth noting, PC ID won't make any sense to clients - they only have one player controller
You're better off sending the Player State, and getting rid of SenderName, MessageTime and PC ID. SenderName you can get from Player State, PC ID won't be useful, and DateTime can be constructed client-side
Oh so it is replication issue . What if I break the date time structure and use it to set the variables before I send it then it should work? My chat system us using interface so the player controller I'd gets stored into an array and this array gets added to the list of interface listeners it's not used for the message and the sender name I get from the playerstate already I just have a function setting the variable before I create the message structure
It will work doing it that way yeah, but it's expensive to do so
Sending strings over the network is not cheap
Something to be aware of in future
@twin juniper dedicated server? public using steam?
i have tried this @chrome bay and i still cant host a dedicated without the steam client being present! I have all the API .dlls ect, yet nothing i try works
Honestly no idea, unfortunately those who have solved it appear to not want to share the solution
Yea
its a shame really as in general, the UE4 comminty is great !
idk
@chrome bay @hushed garnet yea my server only shows up on the LAN tab of the server list
it doesnt show up becuase i dont have it on right now but normally it would show up right there
Just checking, you are building a dedicated server binary too right? Not trying to run a game server etc?
I.e. using source version of engine?
yeah, my server just chucks out the, could not initialize steam api
sooo
......lol
is this pull request really the ONLY way to get steam to show my server on master server list?
i just got the dedicated server working without the steam client open....but can still only run one instance of the server ! I really need to be able to host multi dedicated servers on one machine
no you don't need that to get steam dedicated server working ootb
is your session lan only? are you using presence?
@hushed garnet you have to use a different port and queryport for multiple instances
i changed the port using -PORT=6666 on the command line?
when i start the second server it spits back the cant initialize steam api - maybe because a steam server/client is already running
you need a different QueryPort too
port=7781?QueryPort=27016
for example^
you can run multiple servers on the same box. but you can't test your game on the same server you need to use a different box for connecting
ok going to give this a quick try
and you need to port forward the new ports obviously
yeah 2secs just trying it now
np
@twin juniper are you port forwarding the port and queryport?
@twin juniper are you port forwarding the port and queryport?
what does your FindSessions call look like?
make sure you pass false for both bIsLAN and bIsPresence for the FindSessions call
but i dont think its working on my friends pc (he lives literally right down the street)
you have to port forward and make sure you are passing the right stuff to FindSessions
well what happens
i have it loading into my server browser
and when u click the server browser
nothing happens
(The button calls JOinSession() with a session search result gathered from FIndSessions())
mhm and what does JoinSession return?
lol
duh
like a library, school..etc
yes
to the engine
no
ootb ue4
c++ implementation for sessions
I don't use bp for anything important
gl to you
you legend ! multiple servers on one machine all working 😛
with vanilla UE4 tho
yes
ok
p.s im using bps to host the sessions and its working just fine
@hushed garnet awesome, congrats man
Heh
Ok
@jolly siren so what ports do i need opened?
also
when i JoinSession()
basically what happens
is it doesnt change the map
lol
like nothing happens
to should start => Main Menu => OnCLickServer() => Load "World" map
whatever you are using for port and queryport. by default it is 7777 and 27015
right, so debug the travel url
and see what it looks like
I know I have to call ClientTravel manually in OnJoinSessionComplete. But I'm not sure how the BP stuff works.
Oh
so maybe thats why lol
How do u have multiple servers on one server? @jolly siren
I just explained that to Parabellum-Ka0s
run multiple instances of the server exe
use different port and queryport for each
port forward new ports
done
oh
lol
thats what i thought
@jolly siren Important: If you have a server and a client behind the same router, the client cannot connect to the server through the server browser. In fact the server may not be visible in the server browser of the client. The client must connect to the server using the server's internal IP address.
do you know if this may be why i cant connect
lol
i have the server hosted on my laptop
(on a diff steam acc)
it was just on my laptop
lol
and then i have my desktop
as the client
it shows up in the server browser but when i click my server
nothing happens
that will work fine. I join my sessions all the time
that's why you use c++
so you can see wtf is going on
is a ClientTravel being called?
that is what moves you to the new map
im not sure
im using the AdvancedSessionsPlugin
and i havent looked at all of the code he has yet
look for the ClientTravel call in his join session stuff
debug it
and see what the string looks like
it should be steam.13094890238409283094
something like that
mhm
ill check
honestly tho
i use to want to always do everything from scratch
until i learned that... if ur spending more time devloping something which u could just use an already existant solution then whats the point
lol
like u arent devloping anything new
so you can figure out what's going wrong when things break lol
well i already know how it works tbh
why are you asking what's wrong then? 😛
okay, the default c++ function doesn't call ClientTravel for you at least. But would have to dig into the bp code
what about it?
yeah I used that for a while
but it's only needed for security. I stopped using it because it's never going to be merged
does it actually do anything tho
do i need this to get the server to show up?
Like what does it exactly do ? @jolly siren
no you don't need it
i already told you that I'm using out of the box ue4
Like I said the PR is for security. It adds steam authentication. Which is a way to make sure the user who started your game owns the game.
lol ok
it's for anti-piracy
hmm
so like
where do u create the session
in your C++ file?
are u doing it in RegisterServer() => GameSession.cpp?
yes
IF so, could you show me yours
i already told you where to start and it's not there
confirm that clienttravel is being called
figure out what the url looks like
@jolly siren
sorry man, I told you where to start. I have to get to my work.
i mean its a yes or no answer but ok
Do you need a Steam App ID to host a dedi server (or can 480 work fine)
Evening one and all, Dunno if anyone could help me see where I am going wrong? I have this... apparently it should be working... I just need to know if this is correct I can start debugging elsewheres 😄
Well the Switch Has Authority isn't really needed on GameMode
The ServerRPC neither
It's a class that only exists on the Server anyway
I don't know about your PlayerStart array
is that actually filled when the first player conencts?
@wise bridge
@twin juniper 480 works fine
it's easy to debug
look at OnlineSessionAsyncServerSteam.cpp
it logs things with UE_LOG_ONLINE verbose
turn on logging
read to see why the warning is coming
you might have glitches with 480 because there are so many other games testing on 480
highly doubt that
yea
@jolly siren im about to test this with my friend, i need 7777 port forwarded, anything else?
hello, why do I see my server on LAN tab of Steam Server Browser even though i set bIsLANMatch to false?
Update: so I tested the sample shooter game of Epic, I was able to host, find, and join sessions using steam but I'm wondering why I cannot see it on Steam's Server browser
@loud wolf You mean that old Server Browser thing from back in the time where only Counter Strike and HL was a thing o nsteam?
I haven't even used that for the past 5 years or so
Isn't it enough to have the Sessions in your game's own ServerList?
Playerstate persists until session ends, right?
ah, I see it doesn't unless you copy it manually
How do I replicate a decal?
Am I required to multicast or can I replicate it simply by running it on the server?
@thin stratus i just tested it to see if I can use it for testing.
I may have to start from scratch. I downloaded and tested the sample shooter game, and I can find my own sessions on steam. My mind's so cluttered right now so i'm gonna take a break 😐
Is anyone here good with replication? I want some advice on an approach
Is it possible to replicate a variable on demand?
Anyone remember where and how to open the replication analyzer?
I.e. the program the engine has that can see how much and how long it taks for actors and variables to replicate
I remember using it, but can'r recall where it's located
@wintry cove no sorry but if you do find it I'll be interested in where it is so I can look that sounds usefull . Thanks :-p
Tool for displaying network traffic and performance information captured at runtime.
The documentation is a little confusing so I need to build the engine editor as debug and then use the console commands to capture the profile ?
I don't recall needing to do that
you use the console command to capture the file
you open the file with
/Engine/Binaries/DotNET/NetworkProfiler.exe
what do you mean?
without travelling at all? or just without changing maps?
and why? what are you trying to do?
trigger new UI generation + variable reset
cuz otherwise I need to manually reset all the playerstates and controllers
that's the normal flow. to use PS::Reset and PC::PostSeamlessTravel
if you are using seamless travel
if you don't use seamless than you don't have to worry about persisting, but it has it's own issues
beyond that you could call PostLogin yourself if you don't want to use travel at all
There seems to be reset function
calls reset on all actors except gamemode and controllers
so reset+manual recall on UI generation
makes sense
restart game might work
Im getting debug messages from player logging in
but again, it's same as opening level
blargh
also there seems to be a new experimental feature in project settings
called Download Maps on the fly
Sick
RestartGame travels under the covers
either seamless or not depending on your settings
ended up getting my server to work
lol
it was not connecting because
GetOwningPlayerPawn() -> Get Controller -> Cast to PlayerController
doesnt work
on widgets
lol
so i just used GetPlayerController(0)
because owning player is controller
heh
or should be
you can leave it undefined when creating widget
yay, manual fake login works
wonder if anyone can help? I am running a linux dedicated server, all working, but it doesnt seem to read a custom string in the DefaultGame.ini file like windows does? both .ini files are setup the same, just the linux doesnt pick it up?
Hey guys so when I load my dedicated server I have it spawning in a bunch of Actors that I serialized to json. However, in my PostLogin() function I have it setup so that the player will possess one of those actors based on their unqiue steam ID. However, this only seems to work when the player disconnects, and logged back into the server. If the server itself crashes (or I reboot it) the player doesn't possess the proper pawn.
@hushed garnet hey man, I have never used a dedicated server but this is just my random guess..
Can you check the file encoding of the .ini file? That may be causing problems.
It could also be the line endings.
@twin juniper Mind me asking why you're evne serialising it to JSON?
I have a wild question to everyone..
If the host shuts down his game, the connected clients will leave the game but they will still be locked to the session.
Is there any event like .. "EventOnSessionEnd" or smth?
do you not want to destroy the session?
@tranquil yoke because I plan to turn it into a MongoDB server later on
@jolly siren im not trying to destroy the server. I want to keep it running (Think about like ARK or Rust) you logout, then your character is replaced with a lootable character, then u logback in and that lootable actor is destroyed and replaced with your real character
I was talking to Simple
use @tranquil yoke
mhm
Basically my problem is:
If the host leaves, the clients disconnects.
But the client cannot resume and join games as normally because they're already in a session.
Now if I were to press ESC I would destroy the session cause of a binding i have. But I want it to be done automatically
So basically I want to detect if the host leaves the game
@tranquil yoke im not sure of the encoding, its always been standard
[ServerDetails]
Name=Blabla
Is all im adding to the defaultgame.ini
yeah but if the file is saved using a windows text encoding standard, it might give issues to Linux systems
errr....not sure tbh, unreal build tool spits its out, but to be honest i have deleted on the linux machine and created a new one with nano and it still doesnt pick it up
@tranquil yoke its because you are using matchmaking
if u are using sessions like that
yeah that's why I was wondering if there's a solution to it
its like the server crashes
are u trying to do matchmaking?
or a dedicated server
or what
In my case I was just using create session and join session
sort of like matchmaking
anyways I have to get going home, already 9 pm 😛
I'll work on it on monday
thanks
ok
theres get owning player - which can be casted
oh no i replied to a super old thing
aight, im slowly going crazy
i have made PlayerController
which spawns actors which are handling camera positions
i want to run on dedicated servers therefore all my clients are listen
to position the camera i need the clients palyerController
is there any trick to get the current local playerController, i searched my ass of and nothing is working
So you only need to get the PlayerController references locally?
I feel a bit dirty using it (and recommending it), but there's UGameplayStatics::GetPlayerController
Though if you have a way to plant a reference on the actors directly, I would do that
i fergott to mention im within blueprints
i coould use a c++ script in the bp tho, but is there no clean way to get the current player controller??? I cant actually belive that somehow
Well the method is the same in BP
It's the one that takes an index
I shy away from using it in MP as if you use it on the server you don't really always know whose PC you're getting, but on a client, it only has its own
yeah so getPlayerController with the default 0 should work right?
On clients, yes
well it doesnt
What issue are you running into?
which basically means that player controller returns null
i just thought i can use self
because im actually within a player controller bp class
but aint working either
The error mentions PlayerCharacter... do you have a reference to the pawn at hand?
And I'm not quite sure what you mean by the last couple lines...what isn't working about it?
the input for the function is the the player controller from the first screenshot
since i'm within a PlayerController BP self should be the reference to the current player controller which is spawned right?
AFAIK ID != index
Additionally, you have other characters on the client, so that risks getting other characters
If you're on the PC, why not just run Get pawn?
Rather than using these static iterator methods
I'll try that
give me a sec
basically this is my problem
i created a camera actor assigned it to a variable and want to set it active for the current player controller
the pawn/actor is not helping me there
I don't understand why you were getting the character then
for some other stuff, i setup two main variables
PlayerController
PlayerCharacter
and i use them troughout my player controller bp
if i run it on the server everything works out fine
if i run it on a listen server, he cant get the controller nor the character, therefore not caluclation the positions correctly, and not setting the camera active
If you're on the PC, no need to get it, just use self. If that's not working, the issue is something else
And you say it works on the server but not a listen server, what do you mean?
if my machiene hosts a game (being the server)
self is the right player controller
if i connect as a client to the server (listen client) it aint working
Client != listen server...in this situation your machine is the listen server
Where are you calling these methods originally, however? That's probably the core of the issue
Why are you getting the controller within the controller? I don't understand hahahaha
Same with the character, just use get pawn
I'm still not clear on what the issue is however, all I'm hearing is it "aint working"
haha ^^ i just use those two functions a setters
so i have to adjsut anything i do it at this player
rather than thruout the whole blueprint
within the get PlayerController i use self
and in my get character i get the pawn
and the problem is this
I mean, I guess? I would just use self and the get pawn when you need it, so the variable has no chance of turning stale
as server/host
as client
and this happens because the camera doesent get set to active for the clients player controller
Okay, well do your best to debug why the call isn't working
If you get a specific error, great
If not, it's probably something in your flow
i gues i have a very specific error
but i dont get why the PC is none/null if i use self
Confused, your PC is called Player Controller but the error is CharacterController
Additionally, you're not using self, you're using a variable you set to self earlier in the graph
my bp is called characterController but it has the playerController as parent
this isnt self? 😉
Well you're throwing so much at me man, haha.
yeah i know xD sorry for that
i had like the whole class layed out perfectly
and then i hit the dedicated server button
i have 30 of those errors
all saying i cannot acces from none
and it all referes back to the palyerController or its pawn
therfor the palyerController is none
well, i think i'll sleep over this
maybe it's a flow flaw or some misconecption of myself
anyways thx for the help, appriciated
hey guys, I am having a little trouble w/ some replication stuff...I am trying to store a variable on each clients PlayerState and show that variable above them in a widget their characters have.
somehow each of the players see their own info above the other characters.
This is the node that gets the text shown above each characters head
I am thinking GetowningPlayer is getting the actual playercontroller from the client you are on, even in each of his instances of other characters
ahh, maybe thats because each client only has his own playercontroller
Hey guys, if a dedicated server crashes, I am unable to reconnect when I restart the server I have to also reboot the client (even though it finds the session) is there a way to destroy my clients session?
@fossil silo Clients only have their own PlayerController, this is why PlayerState exists, to be able to share information across clients. All Clients has access to all PlayerStates for all other Clients.
thanks @fossil spoke ! I noticed that shortly after I asked...just finished adjusting to store reference to playerstate instead of controller and its working 😃
@twin juniper You probably didn't destroy the client's session
@thin stratus do i have to do this on the server? or on the client?
who is destroying the session
Hey guys. If as a server I do an Apply Radial Damage to clients, do I process the damage in the client? Or do I ask the server to proccess my damage with an RPC inside the Event Radial Damage?
I'm thinking that if the code to proccess the damage was inside the client it could be tempered.
I believe apply damage is a server-only function, so if you're calling it from the server (where you have to), it'll be processed on the server
From there, if your health is replicated, it'll make it down to the client
hm.. I see, so the event On Damage would only be played inside server-side?
Or do clients receive that event as well?
When you say "apply damage to clients", I think you're misunderstanding the client-server system a little bit. Yes, the clients own the pawn, but there's a server version of the pawn, and the damage call occurs on that server version
The client version doesn't receive the event directly, no. But it can get the effects of it replicated down via replicated variables
👍
If you want to tell the client when something happens though, you can call a client RPC within that function, that would work fine
But in that case, the client could change how the function works and do a custom code when it receives the RPC, right?
Well, you wouldn't let the client handle the damage itself.
It would mostly be just a notifier of something happening
yeah, that makes sense
You could also use the OnRep of the health variable, either way
Logically I wouldn't want the server to handle everything, like notifications and stuff like that
So it does make sense to do something like that
Thanks again!
Is there a way to replicate InstancedStaticMeshComponent() when i remove an instance on the server, if a new player connects its not "Relavant" to the new player
I'm curious how deep does breplicates work on an actor? Does it also replicate its components?
Pretty sure i just discovered something some people may not know
you cannot Possess() a pawn that the client does not own
UE_LOG(LogPlayerController, Warning, TEXT("Trying to possess %s without network authority! Request will be ignored."), *GetNameSafe(PawnToPossess));
^ Someone else may need this in the future, so i posted it lol
Not true
The call comes up with you call Possess on the Client
It's a ServerOnly function
Ive got a question with streaming volumes on multiplayer
i am using client side level streaming
and the actors that are loaded in the first time on a client do not have their beginplays called
but the second time the same player steps into the streaming volume and streams the level from the network, it works fine
anyone seen this or know about this?
@thin stratus yea?
when implementing a vaulting system its best to put it into char movement comp for prediction yes?
would this be the correct way to handle firing for a client->server?
cause obviously the client wants immediate feedback, but it also needs to replicate to the server
or is this gonna make it spawn twice?
If the homing actor is replicated then yes, it would spawn twice for the client
@jolly berry
@jolly berry It looks like you're trying to use a multicast here? For this case, I would recommend a structure like this: Input Fire -> Server Fire -> Client Fire (Multicast) Then in Client Fire (Multicast), you want to implement all of your shooting mechanics. Because of how RPCs work, this will work if called from the authority and remote.
He is telling the Server to Shoot, which spawns the homing missle
And at the same time he tells the Client the same to prevent lag
Which is a good idea, but not if the missle gets spawned replicated
So yeah, he should probably set the missle to NON replicated
Then have the Server call a Multicast
In that multicast he should filter the owning client
Exi, using what I said will cause initial fire lag on the client, but if you were shooting some projectile that can be predicted, you should have seemless prediction. Pros and cons to both.
Well, you should just spawn the missle non replicated
And let the server deal with the actual explosion dmg
while all clients spawn one through a multicast to simulate the rocket
Though filtering the owning client so he can spawn the rocket directly instead of waiting for the multicast
Exi why wouldn't you want the missle replicated?
Because then it gets spawned on all clients, which results in the owning client to have 2
Initial fire lag is shit
The rocket is only visual anyway
And technically should not behave differently when fed with the same velocity
If he doesn't care about initial fire lag, then he only needs the server RPC
and no Multicast or owning client call
@wary willow Spent this weekend trying to setup SpatialOS. Got the demo working with...a few issues, nothing too bad though. A few unexplained crashes, but the main problem is I tried to change something, compiled and everything broke. Probably need to re-setup the project which takes about an hour. Would suggest waiting before trying it out cause the documentation is not quite there yet. I might give it another shot next weekend and actually try to change something but we'll see.
Any idea how can I achieve proximity-based voice chat?
I assume quantized vectors don't behave well when put into structure?
@native axle Thanks for the info, I played around with the unity integration but I saw that the unreal sdk was lacking some core features
newbie question: how do you fake latency in play in editor?
There are some console commands you need to enter
on server and client iirc
A quick google should give them to you. Don't have them at hand either
thanks a bunch!
I remember there is a rama video demonstrating replicated physics where he uses that console command
T H A N K S
how do I filter the owning client in blueprint?
for a multicast call
@thin stratus
cause what u said is exactly what I wanna do haha
Well what did you set the owner of the weapon to
As i assume that code snippet is in the weapon?
Usually the owner is the PlayerController
And that things as a function called "IsLocalPlayerController"
should I just pass in the player controller to the multicast and check to make sure im not calling fire again if it's on the same client?
by using that is local
So, I have to ask this: I often prototype multiplayer games. I start with the thirdpersoncharacter from unreal and customize it according to the needs, since it already has basic movement functions with prediction.
I test my protos in LAN with 4+ computers connected to the same router.
Now what I often see is that the game behaves as if there is almost no prediction at all: the updates are not so frequent, the latency seems bad, the characters warp around and sometimes the net just crashes. This also happens if I just build the third person character right away.
I can reproduce the behavior in editor by adding packet loss on client (30%+). Packet loss from server does not seem to bother the client, and adding ping is fine aswell.
Still, the builds are barely playable because of this!
What am I doing wrong? Is this not a proper workflow to test multiplayer games? The router is decent but nothing special. Maybe it's all router's fault?
@junior tree look into update rates, they default at 100 which is very rare in mp games
update rate you mean an engine setting or a character component settting...?
sorry for the question, just need to know where to find it
iirc it's in the class defaults...maybe?
try tuning it down for character and controller
thank you!
so actually lowering the update rate could help decrease the update time and thus grant more stable updates...?
I noticed I can go as low as 10 without losing much in smoothness. Thanks a bunch!
@jolly berry that's not a good solution
PlayerController only exists on server and owning client
Passing it via a multicast will result in accessed none on everyone else
Make sure to use "is valid" on it before accessing it
Anyone know why the number of players on the server doesnt work right?
always returns 0
@thin stratus Yeah I added the isValid node earlier today. Had that problem earlier.
oh i see
yeah I also made it so that if the controller isn't valid it just fires then during the multicast
is there an upper limit to the number of human players in an UE4 based game?
or is it not just based on resources available?
Anyone know best solution for doing a number of players online widget . Do I just set an integer equal to the length of the playerArray in the game state ? Or is there a better way thanks ?
Hey Devs! I'm stuck in a situation. I have a question to be asked from Client 1 to Client 2. I've successfully coded message passing functionality in c++ in player controller c++. From here I'm passing id to the character and which is passing id to the 3d widget added in its heirarchy. I can see while debugging blueprint that its should update the value as I call the function. But its not actually changing the value. I'm clueless where to look for error. Any pointers please
After passing the id from client 1 pc to another client pc. I use blueprint to call UI Widget function which is in client 2 character bp.
While debugging I can see its calling the correct function. But the values aren't updating in the game
I'm fairly new to UE4 and I just realized that Game Mode is Server-only.
question: when using advanced sessions plugin, does "Allow Join via Presence" mean all clients in session will automatically join the new session created?
can I use appID 480 for testing steam multiplayer?
only one steam account per connecting client
-> can't run the game twice using single steam account
Ahh
any reason you know why I cant create an advanced session in a packaged game?
ie do I have to set it to shipping?
not really without seeing the code
build settings should not affect
except 4.13 engine version had bug where it only included steam files to developer builds
note; run your session management in GameInstance
not in UI
because latent actions and stuff
meddling with map loads can cut any execution short
because it destroys everything except gameinstance
print string is your friend
also I would recommend trying to get it to work locally first before going to steam
question is more of "did it really connect" or was it just PIE helping you out
but when i packaged it I couldn't create the session, no matter if I hotkey it or just the UMG
I will check after i try out this packaged build
it also occured to me, did you see the session in server browser?
Oh you mean if I create the session and then look for myself?
I can see the session when I play in editor
let me check if I can see it in packaged
how would you know the session creation failed if you didn't look for it?
are you even seeing the steam overlay in your packaged game?
Yeah I'm seeing the overlay for Spacewar right now
okay so its not that
[2017.04.10-08.31.00:957][984]LogBlueprintUserMessages: [FPSVive_PawnCharacter_C_0] CreatingSession [2017.04.10-08.31.00:957][984]LogNetVersion: GetLocalNetworkVersion: CL: 3299760, ProjectName: vrexppluginexample, ProjectVersion: 1.0.0.0, EngineNetworkVersion: 2, GameNetworkVersion: 0, NetworkChecksum: 928417868 [2017.04.10-08.31.10:988][743]LogOnline:Warning: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '3' k_EResultNoConnection (no connection)' failed in 10.030624 seconds [2017.04.10-08.31.10:990][743]LogBlueprintUserMessages: [FPSVive_PawnCharacter_C_0] failedToCreateSession
Dont know if thats helpful or nah
try basic session then
that's why I said make sure it works locally first
define locally because I may be mis understanding.
And create basic session gave me essentially the same logs
ok then, Open 2 players in editor play, create session in one and join with the other
if that works, then the issue is with steam
It must be steam then
do I need the Steam APIs installed?
wait no I already have the overlay, so that should e it right?
yup
no it's not down
Is there a way to stop a Client from Moving if input is handled via "AddMovementInput"?
Some bool I can set on the Server? Otherwise I add my own Movement logic -.-
@thin stratus if u dont want the player to move... why dont u do it on the client? why does the server need to stop the movement of a client?
lol
You ever heard of cheating?
If that check happens on the client, he just changes the boolean or what ever to false
And can move again
Multiplayer is authorative
Might just set the MaxWalkSpeed to 0 -.-
yeah
idk ive always thought about it like this, what is the actual reality of the amount of hackers u will have
like, is ur game going to make them money
loll
(No offense)
Doesn't matter, I'm working for clients
ohh
And the amount of hackers is huge
e.g. GTA5 there is not a single lobby without one
Cause they don't do their checks on the server
They can spawn objects, teleport you, spawn money, etc
Well I called them cheater
To begin with
it's too easy to cheat on GTA online
I tried some stuff few time ago
I have something like 2 billion on my bank account and no ban actually
that's pretty bad for an AAA game
Money is actually the thing they ban in waves
But yeah
I don't get why there even is a way to spawn such stuff
That is actively implemented
Client tells the Server to do stuff
they don't check it
they just ask for cheaters
I hope next GTA use SpatialOS 😛
hey so
in your AddMovementInput
couldnt you just create a replicated boolean
and say
if(bCanMove) { AddMovementInput(); }
like that? lol
AddMovementInput happens on the client
oh
RIP
i do know that
MaxWalkSpeed on Charmovementcomponent
is replicated
because just yesterday i was messing with it
and it wouldnt let me change it without doing a server RPC
It's not afaik
/** The maximum ground speed when walking. Also determines maximum lateral speed when falling. */
UPROPERTY(Category="Character Movement: Walking", EditAnywhere, BlueprintReadWrite, meta=(ClampMin="0", UIMin="0"))
float MaxWalkSpeed;
idk why it wouldnt make a change unless i did that then
lol
likke when i set it to 5,000 is didnt do shit unless it was inside of a server rpc
:l
WEll yeah
cause the Client and the Server start fighting about the speed
You try to move fast as a client
But the Server is stopping you by updating the location
lol
If you move 5000 units on the client and the server only moves you 600
You get the Server location
obviously
That's one way, but I would still like to have it kill the input
yea
set movement speed before addmovement is called? then check movement if it is 0 or not?
lol
The whole net stuff happens in the C++ charactermovement component
I have no entrance point
It calls AddMovementInput on client and handles the rest
Alright got it
Seems like "Disable Movement" stops it also on the Client
I searched for "SetMovementEnabled", hence I didn't find the function
gg
oh
OnRep functions are called on the local client right?
So I cant do OnRep=OnPlayerDied, remove my player from an array of players
if that array is replicated
because it wont be a server function
Is there a way to expose the voice chat input from the player to blueprints?
@thin stratus why not transfer movement input to server side directly, then do the check?
it's not gonna cause any more latency anyway
is it possible to cast to the game mode >? i ve tried everything . im trying to access the function get num of players but everything i try fails the cast?
Yes, you can, and definitely might need to
Are you trying to access it on the client? It only exists on the server
@brittle sinew well thats the thin how do i access it . i am trying to get the value from the gamemode and then send it to a variable in the gamestate which is bound to my widget , this all worked but for testing i was doing it on tick event in gamemmode which i dont want instead i want to be able to call the custom event to only run when i want it to
Has anyone noticed that this funciton is broken?
int32 UFindSessionsCallbackProxy::GetCurrentPlayers(const FBlueprintSessionResult& Result)
{
return Result.OnlineResult.Session.SessionSettings.NumPublicConnections - Result.OnlineResult.Session.NumOpenPublicConnections;
}
You would want to do all the updating on the server, and just access the variable from the GameState on the client
inside of the engine
which works in the game state instead but just seems silly having to do it yourself when they have a function there already
the variable in game state is bound to my widget
the pproblem is how to call the event on the gamemode when i cant cast to it
From the client, you can't
So you'll have to find a way to get the info at the server level and pass it to the client
so i either have to have the event on tick or just not use it at all
so may as well just use the player array in the gamstate
Well, if you're updating it in the GM, you could just update it when you change it rather than tick
But yeah, if the default player array works that's fine
oh wait
can i repnotify itself
then just get it to change the variable in gamestate
I don't think that works only on the server
cant any way it has to have an in execution
just seems stupid why have a really usefull function that you cant even call from anywhere
Well, that's your choice by putting it on the GameMode
i didnt put it there its a built in function of the gamemode
Oh, I thought it was a custom one
nope
if i do this inside gamemode it works perfectly but just didnt want to call it on tick
lol forgot to hook up the values but you get what i mean
You could try to just change it on login/logout
wonder if i can use a blueprint interface
but then its more effort
may as welljust use the gamestate player array
lol
so yeah tho
anyone know that this is broken and how to fix it? ```cpp
int32 UFindSessionsCallbackProxy::GetCurrentPlayers(const FBlueprintSessionResult& Result)
{
return Result.OnlineResult.Session.SessionSettings.NumPublicConnections - Result.OnlineResult.Session.NumOpenPublicConnections;
}
its inside of the engine steam subsystem
I was thinking i could manually edit the session information
and add a new connection via PostLogin() and remove one on Logout()
but how would i access the session info
lol
lol.
Anyone around who might be able to help before I headdesk myself into an early grave? xD
In short: Host a session, host joins level fine, client can join the session, spawns in at one of the locations correctly, doesnt possess the spawned pawn, spawned pawn exsists on the server and is being registered as auth through this snippet of janky ass BP 😛 For reference, this picture is inside my pawn BP
@gaunt kestrel You would be a god amoung men in my eyes xD
You probable want to handle possession within the Controller for your pawn. That way you don't net to get the player character index.
Can you show me what youre using to possess the pawn?
Make sure your player reference is Replicated.
okay
In your pawn there is an event called "On Possession" which you could use to help debug
Can I see where you're setting your player reference?
Let me open up my editor so I can help you
Cheers dude 😃
Oh wait is the on possession event called "event possessed"? XD If so I found it lol 😛
lmfao Eek
Because the internet told me so 😄
slaps²
GameMode exists only on the Server
If you access a class while working in it, e.g. the passed PlayerController, you will still remain on the server side of things
^
And please never ever use a delay in multiplayer related things
It has a reason why something wasn't ready yet
And if that was caused by replication lag, then someone with higher ping will still fail the delay
Okay 😃
This is what I'm using in my player controller to spawn and possess
Then the actual possession is just like this
I shall adjust and see what she does! 😄
So possess doesnt need a target nessecerily?
God damn I suck at spelling xD
@thin stratus And please never ever use a delay in multiplayer related things
It has a reason why something wasn't ready yet
And if that was caused by replication lag, then someone with higher ping will still fail the delay i agree in his use case but in some cases you have to use a delay otherwise things dont work for example here i am sending a welcome message to the clients http://image.prntscr.com/image/a2f69491edaa4dbaa395699422123f44.png and it wont work at all without the delay
Not really. Then you just did it wrong
I don't have a single delay in my network code
how is that code wrong
when widget is constructed do soomething
but never works unless a delay
i was stuck debugging it for hours
only way that code executes is with delay
i think the reason in my case i need delay is because
@gaunt kestrel Testing now 😛
the name variable it is trying to acess is loaded in from the database, so without the delay it means sometimes the event fires and the variable doesnt exist because it hasnt been loaded yet
@thin stratus I got rid of the delays.... Sorry boss xD
@thin stratus I mean whats wrong with the delays though
like...
all its going to do is stop them
from moving forward right?
its basically like
Thread.Sleep(long miliseconds)
@worn nymph the general opinion is that you should use event callbacks rather than just delaying a flat amount
Let's say you try to access a pointer, like the PlayerState directly
Now you notice "wait, the PlayerState isn't spawned yet. Let's add a delay of 2 seconds"
Now it solves the issue
but now someone has a small lag that takes 3 seconds
yea
oh i see so when data is loaded call the custom event send message rather than using on event construct
that makes sense
So, not sending the Player the Data at the start of the game is not gamechanging?
Omg yes! Steam multiplayer works with appID 480!!
"Hey, sadly you can't have your name displayed, cause sending the data got caught by a lag and I used a too small delay."
No, cause the call happens after 2 seconds and the PlayerState is still null
if u have 900 milisecond delay
i dont even want u on my game
im sorry
like i dont play games if i get any more than 90 ping
:P Well then work with delays
there you go fixed it lol thanks now i just call this function once i know data is loaded :-p
@wise bridge hows it looking?
@worn nymph 😄
basically if u set the delay to 2 seconds for example, but their ping is 3,000 (for whatever ungodly reason) the data would be initialized to null because the 2 second delay didnt catch someone who would have 3,000 ping it would only stop a 2,000 ping delay
thats what ur saying right?
lol
I mean idk who is going to have 1,000 ping tho
1,000 milisecond delay
like if ur ping is that high why are u even playing lol
@gaunt kestrel I took the delays out and it causes my Vive bool to not get set in time so just moved the check into off of begin play into the spawn event so about to test again 😛
Not only will it save time in the 99% (arbitrary) of cases where it loads faster than 0.5s, but it prevents failure in the case it takes longer @worn nymph
i worked out a system for myself which basically maces mp straight forward, and im looking for some suggestions
does someone mind if i post some blueprints ? 😄
Like when I play on a server located in Japan (im east coast USA) I only get like 300 ping. So that's 300 milisecond delay
Lol
idk how u could get anymore of a 1 second delay
Even if it doesn't seem probable, it shouldn't be designed in a way that would break if it does occur
If hes lucky lol
I mean ping isn't based on download speed
@brittle sinew @thin stratus yeah it makes sense now my brain was just being dumb all that time i spent trying to figure it out and the answer was simple. for some reason i was thinking the error was caused by the widget taking a certain amount of time to run through construction process and somehow event was firing bfore it had finised
lol
Ping is based on latency
its based on how long it takes for the data to travel
not the speed of the data
hard to explain lol
latency != download speed
u could have a 10 ms response time and still have 10 mbps download speed
lol
Once you get past a certain threshold, yes
But at really low speeds, your ping will be affected
ping is location based
Since the packets take a non-negligible time to be uploaded
lol
like the closer u are to the server
the better ur ping
which is why i get like 1 ms in my house
and my friend down the street gets like 10ms
mhm
At decent speeds, the upload time is negligible versus the speed it takes to travel
At lower speeds, it's not
yeah
@gaunt kestrel Still doing the same thing 😮
I'm going to try not specifying a target on the possess xD
you can only do that if you're handling the possession within your player controller
I am 😃 its in a custom player controller
why im passing the reference in the first place..... is questionable! 😛
@wise bridge I had this weird bug where my second player wasnt possessing the pawn.
All I did to fix it is migrate over my pawns to a new project
seemed like a engine bug
quick questin, the default character replication resets the rotation of the skeletal mesh everytime i apply some movement input
does anyone know a way around that
?
@gaunt kestrel Is it possible that I am creating the session incorrectly?
I'm doing it out of my custom player controller BP
Can you join the session and see both players?
yeah you want to make your session in your GameInstance typicallly
at least I think right @thin stratus
You can... I believe... on the server, the pawn appears, the client can see the servers HMD moving around
I am using the get player controller for the Create session and Find session nodes I also just realised I was using the player reference you said for me to replicate as the player controller for the Join Session node
that could be self surely as its in the player controller BP?
is there a BPs node for detecting server crashes?
You should have it cast to GameInstance (or a custom game instance) and have the session creation and find and join nodes in there
thats just whats typically done
but it doesnt sound like what your problem is
Indeed 😄
have you tried testing it without VR? Just Play In Editor
I have not no, I package it out (only takes 2 mins) and just test it for realsies xD
PIE is good for testing this kind of stuff cause you can see what is flowing where
Interestingly, when the client joins, I can see the controller and HMD on the floor and when I shake the HMD around the headset moves in a really wierd way lol
server cant see it moving
client can see the server moving headset just fine
Just have it so if they don't have a headset it spawns a non VR pawn. Then you just play (nonVR) preview
Well you can create the session everywhere
I usually end up using GameInstance in BPs
Is that for debugging purposes? I dont have a use for nonVR pawns as not planning on using nonVR 😃
and GameSession class in C++
Replication for VR is not properly working or needs some random things
Like I was able to control the hands of another player
why ever
Never really tried more after that
The work around to that is using the get position and ori of tracked devices (something to that end atleast)
rather than using the motion controller component
as thats not working for VR MP at all (and still is not to my knowledge)
So just updating the mesh componnent that way... rather than it being a child of motion controller 😃
okay 😄 i searched every checkbox, cant find where the controller resets the mesh position
could it be that the default replication has a higher priority than my own implementation?
if so, that sucks
Im actually beginning to think its a problem with something in my Pawn @gaunt kestrel