#multiplayer

1 messages · Page 298 of 1

rough iron
#

Dedidated using steam sockets would be still P2P but you are able to configure the host properly

#

A downside is that it does not scale

#

Thanks to consoles P2P matchmaking is a standard now

livid aspen
#

Yeah but having o (n) connections for a sever and o (1) client connections is better than o (n)^2

rough iron
#

Of course it's more reliable for you

livid aspen
#

How has reliability with lag and rubber banding been with steam for you?

rough iron
#

No I mean in terms of setup

livid aspen
#

Oh yeah definitely

rough iron
#

You control the host better

livid aspen
#

Having that makes it much easier

rough iron
#

All my previous games had quite a big amount of players so a P2P approach was cost effective

livid aspen
#

Hmm interesting. Max player setup for me is 3v3

rough iron
#

And you woulf setup these?

#

Like, what if you have 2k players?

livid aspen
#

Yeah, I didn't really think about that

#

I mean, it could either be set up so you can host your own server like minecraft.

#

Or I guess I can set up an instance that listens on incoming requests and duplicates a server instance that can host.

#

Probably wouldn't be too hard to run it on freebsd

rough iron
#

But again, try to scale the numbets

livid aspen
#

Run a single instance that hosts a fake 3v3 instance and on connection reroutes to a predetermined server setup

#

But yeah

rough iron
#

For 2k players you need 2k/3 UE instances xD

livid aspen
#

Fuck

#

How reliable is the instance then

#

In even the basic 1v1 I was getting crazy lag

rough iron
#

Host that on amazon and you bill goes quuckly inyo the 10k per month if not more

livid aspen
#

If I want my shooter to be competitive how do I preserve the hosting

#

As in make it reliable for everyone

#

BTW I really appreciate this brain dump. Definitely something I wasn't thinking of

rough iron
#

I would go the P2P route really

#

Eveb gears of war does it

livid aspen
#

How did you fix any lag though. Steam seems to have a lot of it

rough iron
#

The character movement component has client side prediction

#

The stock configuration should be enough

#

Also UT (on github) has a custom one

#

That performs better

#

But is spevific to UT

livid aspen
#

That's probably a better idea. I can just co-opt it into my own. All I need is movement and projectiles to really be super reliable

rough iron
#

Both are there

livid aspen
#

Is there any way to account for the advantage the host gets though?

halcyon finch
#

so who is working on a login system?

rough iron
#

UTs projectile have also a client side simulation one

#

@livid aspen not really, this is why in P2P matchmaking no one knows who is the host

livid aspen
#

Ouch lol. I guess in Lan it doesn't matter too much

#

Maybe you can make it ping each client before replication occurs

#

If every client pings each other before a rep each should have the same delay

rough iron
#

You normally connect only to those with a good ping

livid aspen
#

Right

rough iron
#

Thats enough

livid aspen
#

But in a super highly competitive shooter it gets close

rough iron
#

But even then the guy next to the data center is srewed

livid aspen
#

I've dealt with enough assholes to know nothing is beyond reproach

rough iron
#

I live on an island ^^

livid aspen
#

Yeah but only as screwed as everyone else

rough iron
#

Nope, the closer you are to the server the better

#

So there will be always some players with poor experience

livid aspen
#

Yeah

#

Unfortunate

#

I guess Lan is only the truest way to keep it level

#

And hope no one else complains

rough iron
#

Yep

#

All players on the same switch xD

livid aspen
#

Thanks again for all your help

rough iron
#

Np ^^

livid aspen
#

Nice to have a rubber duck for this stuff

rough iron
#

Hehehe ^^

#

Now back to jamming xD

livid aspen
#

Good luck. Hope it all goes well

naive birch
#

Hi, i have little question. I work for this afternoon on my student project and i want to have confirmation about things.

#

When you set a function like this "UFUNCTION(Server, Reliable, WithValidation)"

#

I know you must to implemente function with the postfixe like this.

#

ServerFire_Validate

#

But the function validate was launched on server or on client ?

brittle sinew
#

It's executed on the server when the call comes from the client

naive birch
#

Ok thanks for answer

livid aspen
#

Do you guys think having hitscan weapons is better than projectile based for network reliability? It makes sense that hitscan would be more reliable but how much more reliable would you think it is? I guess it probably depends on how long it takes for the projectile to impact a target right?

fossil spoke
#

@livid aspen A single Linetrace is extremely cheap, especially when replicating it for network play. Projectiles need to be simulated so that the results are reliable across all connections.

livid aspen
#

Yeah that's what I was thinking. After my talk last night on here p2p might be the best option so making network checks cheap is really important

fossil spoke
#

Depends on what the game is i guess

livid aspen
#

Quake like shooter

#

Max player count is 3v3

knotty kelp
#

Is there a big difference between a line trace vs a projectile that doesn't have any arc that just goes in a straight line?

brittle sinew
#

A line trace is simply an instant scan which is very cheap, even with a straight projectile you'd have to calculate overlaps and keep things lined up on clients if you want it to look good for everybody

twin juniper
#

Heyo. I'm running this function on a RepNotify var change, but it only occurs on clients, not the player who's hosting the listen server. AFAIK RepNotify should run on both clients and clients with authority?

#

Heyo. I'm running this function on a RepNotify var change, but it only occurs on clients, not the player who's hosting the listen server. AFAIK RepNotify should run on both clients and clients with authority?

calm hound
#

It won't be called on the Host because the host is updating the variable, which causes the RepNotify to trigger. So when it triggers, it sees that the Host already has the variable changed, so it doesn't need updated, thus, no RepNotify

twin juniper
#

Thank you, that makes sense. So when the server sets the variable I should also do an "IsServer" check and run the function

#

Nvm, that won't work. Silly

calm hound
#

That'll work

#

and that's usually what you end up doing

twin juniper
#

Hmmm, but if I only want something to happen on client and I use "RunOnOwningCLient" I also need to run the same function on server if it's a player who's acting as server?

calm hound
#

If you're calling this within a Player Controller or Player Pawn, you can use the pawn's reference and do a IsLocalController check

#

and then run the functions for the server as well. It'll return false if it's a dedicated server

twin juniper
#

Isn't that essentially the same as using IsServer for this instance? Just a swap on the true/false execution

#

Or am I missing something

#

What I have there worked, although the server player can see the other players UI as well

calm hound
#

Nope

#

IsServer and IsLocalController are different. IsServer checks to see if you have authority/controlling power of the game. IsLocalController checks to see if you're controlling this controller. It's a little confusing. But it'll turn true on the client, always. Because the client only ever has their controller. But when you run it on the server, the server has everyone's controller. So it'll return true only for their controller, all the others are being controlled by the other players so it'll turn false. IF the server HAS no controller (IE: It's a dedicated server) it'll always be false while IsServer will be true still

twin juniper
#

Ah I see

#

So, RunOnClient will actually run on the server as well?

calm hound
#

Hehhh

#

I don't use blueprints often so I'm trying to convert this from C++ to blueprints a little. But it depends on what your setup is

#

Essentially you'll want to do this though:

twin juniper
#

Thanks for helping out. This is all in a pawnBP

calm hound
#

well hang on actually. Explain to me what you're trying to achieve real quick. Is this a typical scoreboard? Player presses F1 and see everyones score?

twin juniper
#

No this is displayed when player dies

#

Just a placeholder TextActor

#

I do "SetVis" and "SetText"

#

In the showscore function

#

The server executes

calm hound
#

So when the player dies. A score pops up?

twin juniper
#

Correct, match is over and they will both respawn

calm hound
#

Then I would make this as simple as possible and do this

#

Have a variable that's your score, and set it to replicated

#

if you want to see OTHER player's scores as well, you will need to use a Player Controller State. Since every client will have one of those for every controller. It's a way of replicating a player controller on a very low-bandwidth solution

#

That variable holds the score for that player.

#

When the player dies, you use IsLocallyControlled and simply call Show Score. No need for a client function

#

That'll only run on the player's controlled controller. Whether it's server, or client. As long as your death event is called to everyone.

#

If it's not, you can mark your Death function as a NetMulticast which is called on both server and ALL clients. Everyone BUT the person who's controlling that pawn will have IsLocallyControlled false. So it'll only ever be called on the proper player

#

In your death function, you use IsServer, if it's true you do all your server handling of the death, if false, then do another check, IsLocallyControlled? If yes, call your show score. Nice and neat

twin juniper
#

Fact is that I'm using this event to display score for all players when one die, so I can use the multicast and run the function locally and not pass any variables

#

You said that "Only player ever has their controller". But I use a OnPostLogin in GameMode to save all current connected playercontrollers in an array, and that is working? Does the gamemode then hold a reference to the clients controller, and doesn't actually know anything about it?

calm hound
#

The server will always have all player controllers

#

GameMode is only called on the server, clients never even have the GameMode class create

#

created*

twin juniper
#

Ah you meant that the client only ever knows about their own controller, gotcha

#

Had to read it again

surreal prism
#

Hi guys, what is COND_InitialOnly property of DOREPLIFETIME_CONDITION really do?

#

from docs // This property will only attempt to send on the initial bunch

#

but what is " initial bunch" ?

#

if i'm login in world, this property replicated once? but if i'm create new object this property not replicated

terse lodge
#

can anyone tell me how I get a characters Index number?

#

using blueprints

calm hound
#

@surreal prism InitialOnly means you're only replicating the variables when a new player joins the game and is creating their version of the world. I don't believe it replicates if that player is already in the world, and you create a new object however because the server and the client will be matching in defaults when it's constructed. The server would change things after its own construction, and by then the object will probably already of been sent to the client for creation so it'd already be considered as "initialized" on their end

surreal prism
#

@calm hound Thx! One more question, Can I use COND_Custom with UObject Derived class? i'm using ReplicateSubobjects for replicate array of inventory items, but UObject don't have PreReplicataion(...)

calm hound
#

only Actor based classes have replication capabilities. I don't believe it's possible to replicate a UObject at all

surreal prism
#

@calm hound Ok, Thank for your answers 👍

calm hound
#

sure thing

jolly siren
#

Would you guys use property replication or rpc for doing a stun? I normally try to avoid rpc's when possible. However, I think it might be necessary for doing stuns because if I do replication and there is high ping the player is going to keep running on his screen and then teleport back to the position they are really at on the server.

eternal anchor
#

i would do client side prediction

#

assuming client does not cheat

#

it will go over smoothly

#

means, I would apply stun on client side, then server would apply, then compare client result with server result

#

and if it matches, simulation go on

jolly siren
#

yeah I'm applying on client and server right now. But sometimes they aren't the same and I'm getting cases where the player is stunned on the server but still running around on the client.

eternal anchor
#

@calm hound it is possible to replicate UObjects

#

then there is something wrong with your simulation

#

i would rather resolve this problem first, rather than trying to hack it around

#

unless you are talking about other clients, not the one which applied stun ?

jolly siren
#

yes, I am talking about the client that receives the stun

#

the one that is getting stunned

eternal anchor
#

hm

#

theoretically you can try to predict that as well

calm hound
#

oh, my bad. Guess they can be.

eternal anchor
#

idk how did you setup your system

#

but if there is enough data replicated, you can try to predict stun on all clients

jolly siren
#

I haven't done any prediction yet really

eternal anchor
#

ie, you might now in advance that certain ability will apply stun effect, and if all clients have this ability replicated, then you can just use information about when ability has been activated and let all clients simulate from this point

jolly siren
#

has anyone else seen projectiles with a low velocity move very jerky on clients?

#

omg nvm I see what it is

#

they are still attached to the socket I spawned them at lmao

#

that is pretty funny

#

so my idle animation is moving them while they are flying through the air

#

🤣

#

I lied, I'm not doing that. Oh well, will keep debugging

chrome bay
#

@jolly siren might be a tolerance thing somewhere maybes?

#

Mind you if it's just regular replicated movement I don't see why that would be the case

jolly siren
#

yeah I'm not doing anything special. just normal replicated movement.

#

creating a fp template to see if I can reproduce there

jolly siren
#

oh dang shooter game has a crazy world gravity set. I was trying to figure out why my speeds weren't matching up. trying to test over there

jolly siren
#

hm maybe I will just have the client spawn his own projectile. because this jittery is ug

dim wharf
#

hey @jolly siren yes i am. my writing has really dropped off but i'm going to get back into it, and i'll definitely cover how i did projectiles and the component i wrote for it. i'd like to get feedback on that code too so this post can't come too soon!

jolly siren
#

awesome 😃 I'm sure people in this channel can give you good feedback.

#

I'm having jitter issues when projectiles have a small speed, like 1000

dim wharf
#

@jolly siren i should mention that everything is c++ now (looks like i was using blueprints when i wrote that answer). hopefully that is still useful

jolly siren
#

yeah I do c++ mostly with bp for high level stuff. It is useful. I'm just really surprised that ue doesn't have smoother network projectile movement built in

#

I'm going to dig through UT and see what they are doing

dim wharf
#

that's a great idea, i read that codebase a lot and find it very helpful

jolly siren
#

yeah me too. I will look out for you post tho

#

this looks like an interesting function

#

so it looks like they are using client side prediction for at least some of their projectiles

#

anyways, if any multiplayer gods want to show how they do their projectile client-side prediction I would love to take a peek 😄

dim wharf
#

@jolly siren yeah, i had more success with client side as well (with server correction); in my case synchronizing bouncing simulated projectiles was the challenge - they can move very quickly and change direction suddenly

#

it will be good to write something up so i remember what it is i actually did 😃

jolly siren
#

Yeah I'm very interested in what your final solution was. I would love to see how server correction works.

jolly siren
#

@ripe folio did you ever get your client side prediction working?

jolly siren
#

@dim wharf btw why do you do a multicast from the server to spawn the projectile clientside? instead of just spawning the projectile clientside without an rpc

#

hm well I guess the rpc is needed for spawning it on simulated clients

#

since the fire input will be on the autonomous proxy

jolly siren
#

@dim wharf it does seem like your implementation would create 2 projectiles on the clients tho. Since you are spawning on the server and replicating them. and also spawning them in the multicast.

raw wing
#

Hmm... reliable RPCs... how "blocking" are they? I need a method that, on level load, can be called from a client to give information (an int32 but that's irrelevant) to the server BEFORE CheckPlayerStart is called on the server.

brittle sinew
#

I definitely wouldn't base that on a network race condition that might work, that's just asking for trouble off the bat

#

You'll probably have to do some overriding to delay flow until you get all the clients' info within a time threshold

livid aspen
#

Hey guys

#

A bit stuck on replicating the function setActorRelativeLocation

#

Before I tried to replicate it,. the function was working

#

I didn't have the timeline hooked into the lerp

#

Ok so it works for the hosting character now but not any of the connecting characters

livid aspen
#

Welp I got it working. In case anyone was wondering, I was getting the wrong actor for location and trying to only run it on the host.

ripe folio
#

@jolly siren A while ago, yeah, but not with PhysX

#

It was with hand-coded physics

#

And it wasn't always right, but it was using the 'proper' techniques

#

Not sure on how to do any of that with UE4/PhysX though

dim wharf
#

@jolly siren i think i do it all quite differently now so it's highly likely that if it looks like an error, it was an error!

jolly siren
#

@dim wharf ahh okay well if you can share what you ended up with I would appreciate it. At least a quick summary.

#

@ripe folio I'm just using unreal's built in physics

orchid cairn
#

the awkward moment when your clan mates think you've left them to play some new game called "spacewar" on steam... 😃

jolly siren
#

@dim wharf are you still replicating the projectiles at all then?

jolly siren
#

I see why I'm getting jerky projectiles now. Replicating movement actually does do client-side prediction of sorts.

#

I am modifying the velocity on the server only and velocity isn't replicated. So my server and client projectiles are moving at different speeds.

jolly siren
#

so movement components velocity isn't replicated. but Actors have a FRepMovement property that is replicated. So I thought setting the LinearVelocity there would stop the jittering on the client. But it doesn't

#
float Speed = FMath::Max(MinSpeed, MovementComp->InitialSpeed * ChargeUpPower);
MovementComp->Velocity = GetActorForwardVector() * Speed;
ReplicatedMovement.LinearVelocity = MovementComp->Velocity;```
#

dang everyone is jamming

jolly siren
native zephyr
#

Hi folks! I'm learning about how to implement networking, multiplayer and online services and I just learned about OSS (https://docs.unrealengine.com/latest/INT/Programming/Online/index.html). I'd like to know if you guys like this feature and, also, what implementations of the interface are available. I can only see the Steamworks implementation on the docs. Are there others? Ideally I'd like a distribution platform independent implementation.

modern fable
#

@jolly siren is it only the velocity var not replicating?

jolly siren
#

well nothing on the movement components is replicated

modern fable
#

is the component replicated itself

#

unless, are you sure the velocity value itself ain't replicated?

#

so that the value is replicated but not applied

jolly siren
#

ah good point no the component isn't replicated. but it doesn't really matter if it was because it doesn't have any properties that are.

#

That is what replicated movement on the actor is for

ivory parcel
#

What is the callback for a steam lobby session invite ?

dim wharf
#

@jolly siren sure, the gist of it is this:

  1. the owning client's projectile "fires first" and ignores the server for a moment (to give you the client side feel)
  2. as soon as the first round trip is made, the server is in control - however it has used the client's ping and firing information to predict where the server projectile should initialize
  3. simulated proxies have also made the prediction (using something simple for lin and ang vels like dead reckoning)
  4. after the initial round trip, all proxy roles listen to the server, but they perform their updates using only physics movements (teleporting only when the error distance is too large). this "local movement" override is what allows them to be smooth and full physics locally. they'll actually simulate on each client - what will change is their goal velocities and locations, which they will move toward at a rate that is a function of the error distance
  5. since my projectiles often bounce, and at high velocity, there is special case handling for significant velocity angle differences between server and client. for example, if the dot product between the current velocity and the target velocity is suddenly severe, the client takes a few packets off (checking each time if the dot product severity goes down). this is a way of saying "did the server just bounce? maybe i'm about to bounce?" and either we make progress toward the authoritative location and velocities or we don't, at which point you're either okay to start applying updates from the server again or you should teleport to the right location because you missed a turn
#

that's all from the top of my head, could be missing some things. hopefully that makes sense

#

for my game i have a lot of momentous entitires, so dead reckoning as a function of ping has been really helpful for mostly putting everything where it should be

#

entitires isn't a word but entities is!

#

i should add that i'm not using ProjectileMovement anymore, i doubt i made that clear. the physics and replication are pretty much all custom at this point. this was a tough decision for me because i really like to rely on proven, existing code where i can (hence using an engine). but i did a lot of experimentation and i'll probably continue to experiment with different approaches up until release.

jolly siren
#

This is great, thank you for the explanation 😃

turbid stratus
#

anyone had issues with Steam overlay screwing your viewport after level restart?

#

my game is in 16:9 - if I bring up the overlay (to invite someone to my game), then reload the level, the game renders as 4:3 with black bars either side

#

^ this only happens if I've used the overlay though - if I don't use the overlay, it renders the full window as it should

#

4.13, steamworks v132

#

even changing the resolution after that doesn't get it back to normal.. have to delete the appdata... so the generated configs might give me a clue, will search those.

#

interestingly, the UMG hud/widgets still render correctly, it's just the game itself, strange

regal relic
#

Camera

#

Somehow....i think.

turbid stratus
#

yup, you were right

#

overlay usage was just coincidence, there was a rogue dupe camera

#

thank god

#

(actually no, thank YOU for mentioning it)

turbid stratus
#

"By default, Steam sessions are created using ‘Steam Presence’, what this means is that instead of using Steam’s master server list for global server searching, Steam will only return sessions within your Steam region and sometimes sessions related to the people on your friends list."

#

I'm using the Advanced Sessions plugin which has a tickbox for using "Presence" or not... my game us unlikely to have many servers so I'm not sure if I want Steam being even more selective with which ones it returns... I wonder if I should just turn "UsePresence" off?

turbid stratus
#

could be misunderstanding that.. think I'll leave it on for now

chrome bay
#

@turbid stratus latest SDK is 137, might be worth updating too!

worn shell
#

any way in blueprint using the event logout to stop a client from immediately destroying their possess pawn on disconnect?

#

I've tried setting it up to un possess off of the event log out in the game mode but it seems to just immediately destroy the pawn before anything else can happen

turbid stratus
#

@chrome bay yea.. but I'm scared of C++/VS, just happy I managed to get it compiling (so I could use plugins), so I've stuck with what Epic had in 4.13

ruby furnace
#

Anyone had the issue with steam overlay that you get the popup in the bottom right corner but you can't get the overlay with shift+tab ?

ruby furnace
#

^ it was caused because of steam VR

ivory parcel
#

I have an odd problem with Steam Sockets currently

#

One end( the host) has no apparently problems and the ideal time stays under 1 second

#

the other end (the client) keeps receiveing ack timeouts and the connection overall eventually times out

leaden violet
#

I have a question about replication. If you set a variable to replicate, and the variable changes only once, does it add lag to the game?

#

I guess what I'm saying is, are tons of replicated variables that don't change often bad for performance network wise?

regal relic
#

No.

#

Bp all have a net priority which will help determine which data gets first dibs on the next packet. And what can wait till theres less pressing matters.

livid aspen
#

I have a match on a map with 7 rounds. Thoughts on using gamestate vs game instance for match data / current score?

#

it seems like using the game instance would make more sense but my game instance also holds references to all of my menus and transitioning between menus and playing

fossil spoke
#

Unless you perform actual level transitions between rounds, GameState would make more sense?

livid aspen
#

Thats what I was thining. Im actually doing some reading on the ue forums and it seems like game mode might be a better idea

#

I need to handle all of the rules of the game mode for max players, when to start a round, death, respawning, and win condition

#

my respawn logic is already in game mode and the level shouldnt be "reset" per say after rounds

#

Or does that not make sense?

fossil spoke
#

You can reset a level without a transition, GameMode and all Controllers remain persistent when this is done. It gives a convenient way to "Reset" for rounds for example

#

I handle all rules for a game in the gamemode

#

This includes scores

#

Any data i need clients to know about get replicated through the gamestate

livid aspen
#

ok thanks

chrome bay
#

All Replicated Variables have to be 'checked' periodically to see if they've changed, so there is some overhead for having a UPROPERTY marked as replicated. However they only have a network cost when they are actually sent out to clients. They're not replicated unless they have changed.

twin juniper
#

Hello, has anyone created a dedicated server which can be found through server browser?

#

cause I can connect through console command but the server is not shown in server browser

brittle sinew
#

Are you using Steam?

#

@twin juniper

twin juniper
#

yea

#

but I tried null and it did not work out either @brittle sinew

brittle sinew
#

Well yeah, null wouldn't work. Didn't know if you were doing things over Steam or not, that's about all I can help I think 😛

#

Your session creation is working fine? You said you could connect by console but do sessions work

#

And when you're using Steam the overlay comes up and everything, correct? I've seen people just trying Steam in their config file without all the setup, doesn't quite work

twin juniper
#

When I make a game through game, I can connect on another computer

#

But when I create a dedicated server, it does not work

#

And When I Add Node Create session to Gameinstance after Event Init And I am running dedicated server in editor, it works

#

I can disconnect players and the server is still up

#

But when I cook the server it just does not work

#

@brittle sinew

brittle sinew
#

Hmm, not really sure. Haven't personally done stuff with dedicated servers, sorry :/

livid aspen
#

@twin juniper When doing some googling for mp stuff with steam I saw that there were some known issues with dedicated steam servers. I would make sure that steam is opened and running on the machine with the server.

#

@twin juniper Also make sure to check that the required ports on the dedicated server are open. This includes any routers as well. Usually if you can't see an advertised session its because your network is blocking the advertisement.

#

I would try that before anythign else

twin juniper
#

So basically I should Open port 7777 and try it then?

livid aspen
#

I think theres a handful of them to open.

twin juniper
#

yea but by default it runs on 7777

vestal cobalt
#

why doesn't this work? :S

#

it worked on my old project but not the new i made

modern fable
#

define doesn't work

vestal cobalt
#

well steam overlay nor the steam ingame "message" in the right hand corner doesn't popup

#

so somethings wrong

#

has something changed? :S

#

in ue4 i mean

#

all there is to it is to put the code into "DefaultEngine.ini" and you're done

modern fable
#

perhaps [/Script/Engine.Engine]?

#

that line differs from what's in the docs - not sure if that matters though

#

given the docs often are outdated

livid aspen
#

Make sure you enable it in the plugins menu too

#

@vestal cobalt

vestal cobalt
#

oh fuck yea Dream

#

ty for that

#

that's the problem

livid aspen
#

Np. I was fighting this forever

modern fable
#

lul

livid aspen
#

If it doesnt work after that close steam and the editor then reopen steam before the editor

vestal cobalt
#

it worked now ^^

#

tyty ^^

#

was driving me nuts

#

couldn't remember that little detail xD

livid aspen
#

No problem. The guys on this board helped me, glad I could pass it along

#

4.13 is great except that its not really documented lol

ruby furnace
#

Hey anyone had this warning:
LogOnline:Warning: STEAM: Can't start an online session (Game) in state InProgress ?

spark zephyr
#

I am a bit confused on the use of the dedicated server. Is it a simple server that once compiled you connect to and just works? Is there some good documentation on expanding it and writing server side code?

spark zephyr
#

Thats perfect. Thanks!

thin stratus
#

You're welcome :P

#

@ruby furnace This means that your GameMode is in State "InProgress" and you tried to Start it again

#

If you game doesn'T break, ignore it

ruby furnace
#

@thin stratus I am creating a session with steam in C++. It gives that warning, but it still works

#

was just wondering if it was an issue

#

btw do you have tips for running two steam sessions on one pc for testing ?

thin stratus
#

You can't

#

Maybe with a Virtual Box

#

@ruby furnace But yeah, if you look into the code, it somewhere calls "ReadyToStartMatch" (which you can override) and if this is true, it calls "StartMatch" or something like that in GameMode.
And that goes through GameMode, GameState and GameSession. And GameSession will probably call your Steam function

#

But it sounds like you are manually calling it too late

ruby furnace
#

tried virtual box but it doesn't have DX10. Well soon I have two pcs, then I don't have this issue.

And thanks, will check it out

#

You made that blueprint multiplayer example right ?

#

@thin stratus

thin stratus
#

eehm

#

Which one

#

The BallBump

#

?

#

That's outdated in terms of knowledge

#

@ruby furnace

#

But I have a WiP Steam Example project

#

For Session stuff

#

Was supposed to give examples for Steam functions (Friends etc) and Sessions, but haven't had time to add more than the session

#

and they are not done yet

#

But if you need a peak, gimme your github account name or email

#

peek/peak? English

#

I guess 'peek'

ruby furnace
#

@thin stratus Oke, I am working on a C++ plugin for steam and session stuff

#

but your thing is on the marketplace right ?

thin stratus
#

Öhm, slow, I have a Lobby System on the Marketplace, but that only uses the BP nodes for Sessions.

#

And I have the Session Tutorial for C++

#

Which is a wiki entry

#

And I have a private GitHub repo with more C++ code for Sessions and better commented

#

@ruby furnace

ruby furnace
#

@thin stratus Aah oke that explains it :p

wary willow
#

@ruby furnace C++ Steam/Session plugin that exposes everything to BP ?

ruby furnace
#

pretty much

wary willow
#

JustDoIt

ruby furnace
#

Yeah I found that everybody is like following tutorials (either from Epic or not) and everybody has to do it everytime. Plus C++ has so much more options

surreal prism
#

If i'm want to use Dedicated Server with Steam, I need to download third party addon for steam sessions?

thin stratus
#

@ruby furnace @wary willow Then concentrate on the Steam part. There is already a Session Plugin

wary willow
#

@thin stratus @ruby furnace no need for two plugins though if someone is willing to do it all

#

I would rather have one plugin for it all

#

And pay good monies for it

thin stratus
#

Session != Steam

wary willow
#

Aye

thin stratus
#

So no, keep it two if possible

wary willow
#

But, like I said

#

All in one Steam Multiplayer Plugin

thin stratus
#

That's stupid

wary willow
#

All-In-One

#

Why?

thin stratus
#

Why would I want to download a Plugin that exposes sessions stuff if I don't want the Steam shit in it?

wary willow
#

...

thin stratus
#

Expose the Steam functions in a separated Plugin

wary willow
#

Did you read what I said?

#

wrote*

thin stratus
#

¯_(ツ)_/¯

wary willow
#

heh

#

What you said just now didn't make any sense with the conversation that was had

#

If I want a Steam Multiplayer Plugin

#

I want EVERYTHING that I need to make that happen

thin stratus
#

Steam functions and Session functions are 2 different things.
Session Funtions are covered, so Steam functions alone are enough

wary willow
#

If I am using a STEAM MP plugin..

thin stratus
#

Do you now understand it?

wary willow
#

I WANT it all...

thin stratus
#

Then download both Plugins

wary willow
#

to ensure I can run my Steam game

#

I know they are man

#

My point...

thin stratus
#

There is no special Session stuff for steam

wary willow
#

and is still quite valid...

thin stratus
#

It's only different settings

wary willow
#

There is NO reason to have to download two different plugins by two different people

#

when one person can just do it all

thin stratus
#

There is also no reason to rewrite a plugin that already exists

wary willow
#

Is it perfect?

#

I mean, this is subjective

#

Of course anyone can rewrite a plugin that already exists

#

And make it cater towards the Steam side

thin stratus
#

I don't care if someone wants to waste his time on exposing all the code for sessions again.
Sure do it, but my advice is to expose Steam alone

wary willow
#

Aye

#

As a customer, if I wanted to do Steam stuff, then I would want one plugin that fit the bill, from start to finish, not have to learn two different plugin, deal with two different people, etc.

#

This is from a customer standpoint. And if @ruby furnace feels like selling his plugin on the MP, then this would be a great way to get some $$$

#

People are lazy by nature

#

This is how you get into their pockets

thin stratus
#

Sure

#

why not create 4 of them for all subsystems

wary willow
#

You could

thin stratus
#

make sure to copy paste the session stuff each time

#

...

wary willow
#

Anyway, not sure why all the beef

#

But, if he wanted to do it, and I would suggest he does, especially if his intention is to sell...

#

Then he should do it.

thin stratus
#

There is no beef. I just say that it makes no sense. There is a good plugin with all kinds of stuff. There is nearly no second why of writing it.
It would be a complete copy and costs lot of time.

ruby furnace
#

I am not really sure what my plan with it is. First it a learning experience. Normally I only write code for the editor/engine, using the engine on a game level is always good.

thin stratus
#

Either you accept that or have your own opinion. I'm not arguing to a point where I convince you :D

wary willow
#

If it is a complete copy...and nothing can be improved on...then Epic is failing us

thin stratus
#

Why Epic

wary willow
#

Because they choose not to expose things when it is possible and has been for some time now.

thin stratus
#

You only realize this now?

wary willow
#

And people are dependent on community plugins to make the engine work like it should by default

thin stratus
#

Of course they can expose tons of stuff and decide to not to

wary willow
#

Of course not man

#

lol

#

Shit has been obvious since I first started

thin stratus
#

Yeah so, Epic fails you then.

wary willow
#

I mean, RIP Paper2D

thin stratus
#

They don't want to expose certain things due to "Too complex for BP users"

#

and due to "We have no time and our resources are elsewhere"

wary willow
#

For some reason, I don't think that logic works anymore

#

But for sure, it's more about priority than not

thin stratus
#

Open an AnswerHUB post. Ask for Quaternions being exposed to Blueprints and name reasons such as "Gimbal Lock"

wary willow
#

Although..they could just accept the PRs...

#

Aye, I know all about gimbal

thin stratus
#

They will tell you that Quaterions are too complex for BP users and that they want to keep it simple with Rotators

#

¯_(ツ)_/¯

#

And that applies for Session Stuff too

#

And even you put up a PR, then they tell you to create a Plugin

wary willow
#

Aye

#

Like I said awhile back. A uservoice would be nice.

#

But they have "issues" page now, but that's barely used.

ruby furnace
#

anyway, for me it is just learning and I'll see what I include and if I am going to sell or something

#

I dont have time pressure for a game or something

heady delta
#

@wary willow Allar was working on a full plugin solution for steam + dedicated servers but it was a long time ago and you would have to ask him if it is still being developed

livid aspen
#

Quick question to anyone who has tried, does the PartyBeacon LobbyBeacon system work with the steam subsystem?

ivory parcel
#

Who knows

#

I have been trying to get it working for the past 3 weeks

#

Here is my answerhub on it and it has a link to my forum thread without any answers

#

I got LobbyBeacon almost working however the client never seems to finish the connection

#

the LobbyBeacon system is almost needed to test the PartyBeacon system so I havn't gotten that far yet

#

@livid aspen One bug to watch out for with steam beacons is that they can ONLY host on steam sockets with how engine code is currently setup

livid aspen
#

Hmm

ivory parcel
#

I hope to finalize some changes on my end and put a PR in for it and see if its accepted

livid aspen
#

Sounds good. I think I'm gonna put this on the backburner for a while and come back to it later. But if you're using steam and its at least getting set up thats good

#

Rocket league uses it I think and they use steam

#

so I'm not super worried

ivory parcel
#

They use unreal engine 3 however

#

My first thought was to email them and do some research however they use the old system from UE3 which is different

#

If you use that code however it should atleast start a connection, its the client that never finalizing the connection and im not sure why yet

#

The client keeps reporting ack timeout even though the host can communicate with the client fine

livid aspen
#

Hmm

#

That just makes me think its a port configuration error

#

I don't really understand the system yet though. Thanks for your help

#

I might send you a message in a couple of weeks to see if you've made any progress

ivory parcel
#

Ya np, no documentation on it at all

#

and working on it through steam requires atleast 2 computers and 2 accounts

wary willow
#

Yeah, Steamworks is a pain for the first timers

#

I'm back at it, trying to figure it all out

lament kettle
#

I can get the server to shoot and show the clients. And I can show the client shooting. But I can't get the client to tell everyone that they are shooting.

#

Thoughts?

#

I can do it fine in the base player, the replication. There is no issue.

#

But when I do it inside another bp there are issues.

livid aspen
#

From what I've read, there is no true p2p in UE4

#

So if you want to update all clients about an action its either through the server or not at all

#

But I could be wrong

#

@lament kettle

spark zephyr
#

Whats the best way to set a players velocity and have it networked? I have been setting the velocity with UCharacterMovementComponent and that works great in single player.

modern fable
#

that component does all the replication for you

#

@lament kettle what's the issue

#

I see all your events are set to execute on server? so none of them executes client-side?

thin stratus
#

@lament kettle Define "another Blueprint"

#

I would guess he tries to call "Server RPCs" in Server owned Actors

modern fable
#

looks like he's trying to spawn the projectiles client-side here

twin juniper
#

What does exatly RCP mean?

modern fable
#

given there's a 'client' event running server-side

#

remote procedure call

twin juniper
#

Thx

modern fable
#

so pretty much a 'function'/event that runs remotely

twin juniper
#

Yea I know what it is I just did not know the words😃

modern fable
#

😛

ivory parcel
#

Especially whenever the host appearntly has no problem talking to the client

wary willow
#

Is Source really the only way to fix the Steam Leaderboard bugs?

cursive herald
#

As far as I know

#

or just get the steam oss plugin source and recompile it

#

but then you have to share the binaries with your entire team

wary willow
#

Damn, lame

wary willow
livid aspen
#

@ivory parcel Maybe try pinging one of the epic staff

ivory parcel
#

Wouldn't know who to ping

ivory parcel
dim wharf
#

@ivory parcel if you have the engine source, you can do a git blame on one of the subsystem files, which will show you who has worked on those files, which should help you figure out which devs to contact (assuming they're active on the forums, etc)

#

alternatively if shooterdemo has subsystem code you can git blame there and see (i forget whether it wraps up steam or not)

naive crater
#

Anyone know how to keep an anim notify from double triggering on client?

thin stratus
#

Well, filter the Client call

#

Switch has Authority

#

@naive crater

naive crater
#

yeah i ended up using an is server check in the animation blueprint

#

Thanks though 😄

balmy gazelle
#

@wary willow voted

thin stratus
#

@wary willow Is there a PR for it?

ruby furnace
#

@ivory parcel I am also learning in my spare time how sessions (with steam) including creating lobby beacons work. I am asking around if there is someone who knows.

ivory parcel
#

Ya, I am beginning to think that the current implementation of steam sockets is bugged or something

ruby furnace
#

@ivory parcel I favorited your question, so I won't forget :p

ivory parcel
#

Ya I messaged one of the few epic staff that has said stuff on beacons so I hope to get a reply soonish

ruby furnace
#

I am a contractor for Epic

#

But I want to create a plugin that makes using sessions (mainly steam) easier for both C++ and Blueprints

ivory parcel
#

Ya, its a good explanation for beaons themselves but not Lobby or Party beacons

#

I have managed to get a simple Test beacon working using the standard IpNet driver

#

however I have not managed to get Lobby or Part beacons working and it appears Steam Sockets may be broken

#

But such a plugin would be nice honestly, there is already the Advanced Session Plugin for blueprint

#

I don't think its targetted to steam however

modern fable
#

is there a working approach on setting a player to spectate thru BPs?

thin stratus
#

@ruby furnace If you have questions while creating the plugin, just ask (:

#

I don't know everything, but I already encoutered some stuff

ruby furnace
#

@thin stratus Cool thanks!

#

Will be moving in a week though, so won't have spare time for a while 😦

thin stratus
#

Well, let's make it like this.
Create a private repo for your Plugin and add me.
If you have a question or need help, I will look over it

ruby furnace
#

btw that plugin you were talking about is mainly for blueprints, I want my plugin to also make it a lot easier to do stuff in C++

thin stratus
#

For the C++ part, any idea how you want to do this?

#

Easier mostly means that you wrap functions into other functions to take away confusing code

#

While working with C++ Steam/sessions, i feel like more freedom is better

ruby furnace
#

Still allow freedom but have all the basic things implemented.

#

I mean projects are alive, when something is wrong with it you fix it

thin stratus
#

Are you aware of the test classes for Network functionalities?

ruby furnace
#

for now I just need to implement the default stuff, since I know barely anything about it

#

and no

thin stratus
#

@ruby furnace Haven't checked them out in terms of actually using them. But they show use cases

#

Might be help ful

ruby furnace
#

ooh cool!

#

doesn't look like a lot of work is being done

thin stratus
#

Na it's mostly classes you create and call the test function to check if oyur stuff works

ruby furnace
#

but you can't actually use it for your game ?

thin stratus
#

Na it's really just test classes for your subsystem code

#

But they might show how to actually call what stuff

ruby furnace
#

yeah it does! thanks for the reference

wary willow
#

@thin stratus one attached to that issue report but there are like 2 others that are similar PRs... almost a year later

ruby furnace
#

what ?

ivory parcel
#

I wish I knew these test exist, still not sure it would help with my steam socket problem

merry pawn
#

Quick question. How difficult is it to set up two different charaters and controlers? Nothing fancy.

#

not remote or online or anyhing, just in the same game locally

#

In blueprints

flint nest
#

@merry pawn Very simple, by using 2 nodes: "Create Player" and "Get Player Controller" (or just setup last one in character's details "Pawn" and "Input").

merry pawn
#

Ok cool, I hadnt looked much into it but was wanting to do some playtesting and was wondering if that woudl be easier than ai

#

cause I dislike AI -_-

ivory parcel
#

well it dislikes you as well

ivory parcel
#

Well, if I disable steam sockets everything seems to work ¯_(ツ)_/¯

ivory parcel
#

So, the steam subsytem is setup such that unless your playing a lan game it doesn't allow you to get the IP address and forces you to use steam sockets.

#

That seems rather short sighted

wary willow
#

Why does an AuthToken change constantly?

#

Why wouldn't a Steam Authentication Token be the same for the player throughout the session?

#

(well, if that's what I even have that is)

#

Actually, some of it stays the same ... ahh... so newb at this stuff it's annoying

#

Hmm, well, it's running on tick, I wonder if it gets used up after I ask for one

#

(╯°□°)╯︵ ┻━┻

dim wharf
#

@wary willow I'm not sure how Steam auth tokens work specifically, but typically you (1) request an auth token (by passing credentials, for example) and then (2) include it in your requests until it expires at which point your system should (3) defer to a refresh token! (if you received one in the original auth token response) or (4) request a new auth token and begin using that. And repeat.

#

do you know the expiry for steam auth tokens, and if they use the refresh token model?

#

The reason some of that string may stay the same is that it might be an encoded composite token which contains some static information (for example, your requester ID and permission or something that doesn't change) and then more transient information (like your auth token and perhaps a refresh token)

#

Often an encoded token in a system with several token types will be able to announce its type through its value, if that makes sense

#

so the "type" part of the token string would remain constant

wary willow
#

I don't know shit

dim wharf
#

hey man that's a start! 😄

wary willow
#

All I know is I am calling the GetAuthToken from the IOnlineSubsyem

#

Originally, I was trying to get the PlayerController to decide the authtoken for the player, but for some reason I couldn't get that to work, so I just set it to 0, since I only care about the local player for now.

#
FString AMyCharacter::GetSessionTicket(class APlayerController* PlayerController)
{
    FString SessionTicket = iOnline->GetIdentityInterface()->GetAuthToken(0);
    return SessionTicket;
}
dim wharf
#

So like I said I don't know about Steam specifically, but in most authentication systems you can think of the GetAuthToken request as a login

wary willow
#

Aye

dim wharf
#

so you would ideally only do it once (or when necessary, like i mentioned above)

#

so perhaps just moving it out of Tick for now to test would help

#

and then try using it some time later to request information -

wary willow
#

Well, it didn't matter actually

#

I did move it out

#

And only called it once

#

I am using GameSparks

dim wharf
#

and then you try to make a different request to the subsystem and it fails?

wary willow
#

and was trying to get Steam Authentication to work

#

I needed a session ticket

#

I get the ticket, input it to the Steam Authenticator, but there's still something wrong

dim wharf
#

Does it return any errors?

wary willow
#

Yeah

#

NOT_CONFIGURED

dim wharf
#

What do they look like?

wary willow
#

Um, nothing viable on UE4

dim wharf
#

Does it have an HTTP error code associated?

#

like 401 or something?

wary willow
#

Since I am using a plugin, it's something on their end maybe

#

Nope

dim wharf
#

i see, and maybe the full error isn't propagated completely

wary willow
#

That's one problem, but as long as I have the session ticket, I am fine for now

dim wharf
#

you could grep around the stack (yours, through the plugin, the steam subsystem code) for that NOT_CONFIGURED error and see what throws that

#

cool

wary willow
#

If this doesn't work

#

I might just DL the SDK again

#

And try to access it directly

#

Steamworks SDK

dim wharf
#

that's a good idea; that will at least allow you to compare requests/errors and isolate the problem

wary willow
#

Aye

#

Thanks for the help though @dim wharf

dim wharf
#

anytime!

#

not sure how helpful i was ...

wary willow
#

FUCK YEAH

#

(╯°□°)╯︵ ┻━┻

chrome bay
#

Anyone have a network-heavy game and given 4.14 a shot? Keen to see what these improvements have done

#

Cus if Paragon is anything to go by, not a lot haha.

wary willow
#

@chrome bay lol

chrome bay
#

I know paragon is a fairly network heavy game, but sometimes it lags like a right bastard. Never really sure what the cause of it is

#

But it doesn't give me much hope working on an FPS / RTS hybrid -.-

heady delta
#

@chrome bay Is paragon still running 4.11?

#

I know UT moved to 4.12

chrome bay
#

Paragon is on it's own version, UT too to some extent

#

Lots of changes for the engine the last few releases have come from Paragons internal engine build

#

Which makes me wonder if these network fixes have come from it too

#

well, improvements shall we say

heady delta
#

40% is a mighty claim

chrome bay
#

I agree

#

And Paragons net performance isn't exactly amazing at times

heady delta
#

if these are changes for that reason, I'm going to be forced to version change... and embrace the future

#

and... broken voip

chrome bay
#

Yeah, to be honest when a new version comes out, I always prioritise upgrading. Simply because I have no idea how many versions will come out before I release, and god knows what thing will arrive in the future that I'll want

#

Did screw me over during 4.12 previews for a few weeks though...

heady delta
#

I bet 😛

#

I'm going to be jumping from 4.11 to 4.14, and a new version of physx lib

#

I am really not looking forward to see what breaks

chrome bay
#

haha

#

what fun

heady delta
#

it's annoying situation because aparrently VOIP broke after 4.11, and tesselation performance somehow got worse

#

¯_(ツ)_/¯

#

I wish I had the knowhow to bring in select changes I want to my own source engine, since I have changed a whole bunch of crap in it too

chrome bay
#

Fuck that, I tried working with source engine a couple times. Utter nightmare

#

I just embrace the issues :p

heady delta
#

noooOoooOOoo

#

it sounds like the have changed a bunch of things in the gamemode class too

#

that's going to screw me

chrome bay
#

Yeah Gamemode got some attention for sure

#

They did one change which IMO is really godamn stupid. Added an override for InitNewPlayer, which just calls another verison of InitNewPlayer

#

Instead of changing the calls TO that function, they just made a new one and did what I would call a bandaid fix

#

Totally undocumented ofc

heady delta
#

=/

#

honestly the only thing they needed to do to gamemode is just go in and expose all the stuff to BP that should already be exposed, like spectator functions and bools, and things like that. It's a paint to have to expose these things yourself when they are so basic

#

pain*

#

I remember I was chasing a problem with spectators being reset when the gamestate changed, but the said they were reworking the gamemode to fix this

#

or something

chrome bay
#

I gave up and wrote my own spectator system haha

#

I knew what I wanted so it was easier

heady delta
#

just... check always spectator and fixed ><

#

yeah true

#

I have it so if you go spectator it makes onlyspectator true and then the player won't be reset and spawned accidentally

chrome bay
#

Ah I did my own spawning system and everything, basically shredded the gamemode to pieces.

#

I needed multiple rounds etc as well, which gamemode doesn't natively have any support for

#

Got my own respawn timers etc. Was actually oddly fun to do, make a cool gameloop

heady delta
#

huh sweet sounds like you went all out

#

Mine just has CS style round, warmup preround etc, and spectate

#

I have to make an assault and capture gamemode next, not sure how that's going to work

glad wharf
#

about VoIP (a bit late), it seems to work again in 4.13, at least on the Null subsystem

glad wharf
#

okay, just tested again, not so sure anymore... -_-

twin juniper
#

Hey all,
I've recently been trying to setup local asynchronous multiplayer where one player would be in VR and one using the desktop and have run into all sorts of problems.

To help me wrap my head around it, I've decided to strip out the VR side for now and create a simple setup as follows:

  • Dedicated server
  • 2 players
  • Players start as spectators
  • 2 different actors are spawned
  • each client possesses one of these and gains control
#

Seem to constantly be running into problems with the possess side of things. I've read the documentation and tried to follow that, but feel like I'm going in circles.

#

Is anyone able to explain how this should be done. What should be put into my game mode BP, what should go in the level blueprint, etc.

brittle sinew
#

Are you looking to significantly differ from default functionality? The default GameMode flow spawns a PlayerController and Pawn for each player, then has the PC possess the pawn it spawned

#

I would look at the default GameMode if you're confused to what exactly goes on, it shouldn't be too hard to follow what happens when and in what order

twin juniper
#

Apart from there being 2 different pawns, no, that sounds like what I'm after. Maybe my mistake was making my own GameMode BP to start with

brittle sinew
#

Well it's fine using your own GameMode BP, the default GameMode functions still occur, you can just override them

twin juniper
#

If I switch to the default GameMode and hit Browse to Asset in Content Browser it does nothing...

brittle sinew
#

You have to manually enable engine content, but the default GameMode is written in C++, so it might be a bit hard to follow, didn't know you're in BP

twin juniper
#

ah yeah, wouldnt have a clue looking at code rather than BP

#

maybe this is better asked in the BP channel

glad wharf
#

What is your problem exactly with the possess side of things?

#

on our side we used a bit of C++ but should be doable in BP

glad wharf
#

Well, VoIP does not work anymore on my last build, I don't understand. This VoIP thing starts to be a nightmare ^^

jolly siren
#

I'm replicating a bool. Does anyone know how I could reset it on the server AFTER it's been replicated without an RPC?

modern fable
#

wut

jolly siren
#

lol what part didn't you understand?

#

also, does a value have to change on the server to replicate?or will it check if the client value is out of sync and replicate it to fix that?

livid aspen
#

I would assume the server would correct the client if the client didnt explicitly call for an update on the server

#

Its how you prevent cheating

dim portal
#

If I set a box component on my character to be replicated, is that not enough to replicate things like its relative location and collision state?

rare cloud
#

@dim portal depend of your need, you need to replicate those thing to many player ? what the logic between this box component ?

#

you need to change his location during runtime ?

#

but I think it's better to prototype your game and optimize bandwidth later, nevermind if there are some useless replicated variable

dim portal
#

bandwidth shouldn't be an issue, right now I got it working with a multicast, but I thought maybe some its properties should of been taken care of if I set it to be replicated using SetIsReplicated

wary willow
jolly siren
#

If I set bTriggered to false at line 64 then it won't replicate to the client

jolly siren
#

💩

ivory parcel
#

@wary willow Have you managed to get SteamSockets working ?

wary willow
#

@ivory parcel haven't tried that

#

But I'll be playing more with whatever is default in the engine

ivory parcel
#

They seem to be entirely non-functional for me on 4.11

wary willow
#

And then, move onto Steamworks SDK proper

ivory parcel
#

I havn't even really got into the Steam SDK too much, just what the steam subsystem automatically does in place of normal IPNet Driver

#

Using IpNet everything works OK, but the subsystem seems to prevent you from retrieving that

wary willow
#

No idea, I don't know crap about onlinesubsystems other than from the past few weeks trying to disect them, I need to really up my game with MP though, but yeah, OSS are used for more than just MP

ivory parcel
#

True, My problem has been that steam doesn't seem to tell the engine if the server in unreachable I guess

#

so if you join game and the sockets are not working the engine gets no warning

wary willow
#

sure it does

#

It has to do authentication

ivory parcel
#

I don't see anything in the logs if I click JoinGame in steam

wary willow
#

so, if steam is not available, nothign would happen

#

Hmm, that part I am unsure of, like I said, complete newb in this field really

#

But I do know you can catches to see if Steam is available or not

ivory parcel
#

Unless I host a session with bUsePresense is false in which case it joins a "lobby" session of some type

wary willow
#

You can force OSS to only be Steam

#

and if it's not available, then do something else

#

It'll throw out an error for sure

ivory parcel
#

Im not talking about that sadly, im talking about joining sessions

#

On the steam friends interface if you right click your friend and click join game its suppose to send off a call to OnSessionUserInviteAccepted

#

However if the server they are on is unreachable steam doesn't appear to do anything as far as I can tell

#

Which is annoying

wary willow
#

So

#

There is a bool in there

#

saying if it had any errors

#

joining

ivory parcel
#

Ya, but the problem is I don't see it being called if it failed

#

Not sure if steam is not calling the method or the engine prevents it somewhere

wary willow
#

OnSessionUserInviteAccepted gets called first to cleanup stuff it looks like

#

And then it says it calls JoinSession()

#

Or rather, that's how the invite is accepted

ivory parcel
#

Yep, should be

wary willow
#

there is a param in the cleanup code, that states if it was successful or not

#

bWasSuccessful

ivory parcel
#

The whole flow according to steam and what I have seen is that whenever you click it either in the overlay or steam client itself it calls a GameServerChangeRequested event

#

The engine is suppose to capture that and that calls OnSessionUserInviteAccepted

#

So I am about to see if steam isn't broadcasting that or the engine is ignoring it

wary willow
#

Yeah no idea. But if you haven't figured it out by then, eventually I'll have to mess with that.

ivory parcel
#

Yep

#

it appears that that particular callback was not registered in the subsytem, not sure why though

ivory parcel
#

Well thats odd and interesting. GameServerChangeRequested _t Is not in the current OSS for steam however if you are hosting a GameServer session its whats called

#

GameLobbyJoinRequested_t is Only called for lobby sessions and is the one registered

#

So if bUsesPresence is true then the steam overlay essentially doesn't work

regal relic
#

Running 4.12.5. Im Getting some weirdness from what appears to be the CharacterMovementComponent when my Character spawns a whole bunch of actors (bullets) the CharacterMovementComponents replication seems to slow down to near 1 FPS updates while everything else appears to be carrying on at 100+FPS.

#

No sign of any issues in ANY of the stat data. So im wondering if its not somehow intentionally slowing itself down to a frame crawl. I even tried removing the projectiles and children under the character thinking maybe their tick time was somehow sinking the primary characters tick time. But no luck.. And its purely on the replicated (Third party screen) First party screen updates as expected.

#

Checked my bandwidth.. Plentiful. No bottleneck there. Far as i can tell. Besides its net priority is set to 3 so..It should get first dibs, But alas... Nadda..

jolly siren
#

I don't think replication is measured in FPS

#

could be wrong tho

regal relic
#

It turned out it was the Net Priority. Still not sure how it calculates the priority per actor, But basicaly Even though my Projectiles were only set to Net Priority : 1 . They were still getting all the net priority over my Character (Net Priority : 3).

#

After finally adjusting the Net Priority down to : 0.1, And cranking my character up to 100 priority it appears to be much better.

#

So im wondering if each individual projectile actor is creating an additive effect on the priority. Something like Each Projectile has priority 1, And i have 30 projectiles therefore net priority = 30.. Or something.

#

Anyway its obviously sortable.. Gladly... But put into question my understanding of their replication priority system.

golden granite
#

Any thoughts on how to track when a client joins the server? And assigning clients unique IDs? As well retaining the unique IDs across level changes? Been at this for awhile. Blueprint project.

ivory parcel
#

Not sure on blueprint

rare cloud
golden granite
#

I'll look into that later, have to head to work 😦 If you have any links or more information feel free to leave it in chat. Thanks.

drowsy veldt
#

Does ue4 really have no LLAPI?

ivory parcel
#

@wary willow I have found that the Steam callback required for the Join Game button on the friends list is not implemented

#

So I have had to implement a version thats likely not PR safe currently

#

Atleast Its not implemented if the server sessions is created with bUsesPresense as false

#

If bUsesPresense is true then there is a callback to OnSessionUserInviteAccepted

golden granite
#

@regal hazelblue#4427 I suppose I'm not understanding how to communicate with the client that connects once they're received through the OnPostLogin event.

heady delta
#

Dumb question: Is there any way to get player pawn or controller from the gamestate player array?

modern fable
#

any workaround on setting a player as spectator thru BPs?

thin stratus
#

@heady delta if you are on the server side, yes

#

The owner of the PlayerState is the PlayerController

heady delta
#

@thin stratus sweet cheers

wary willow
#

Yo

#

Anyone know if I need different domain names/steam web api for different games?

#

I should be able to just have one steam api key for all games right? I mean, it's not like I can get more than one api key anyway...

#

Probably just answered my own question nvm

golden granite
#

I'm trying to assign clients a unique ID. I know I can generate an ID per client connected using OnPostLogin, but how do I get that ID to the client connecting?

brittle sinew
#

You could feed it onto the PlayerController, or the PlayerState

#

Most likely the PlayerState if you want all clients to know about other clients' IDs

#

Though I'm not 100% sure when the PlayerState gets constructed, don't have the source here with me

golden granite
#

The problem I'm having is that the OnPostLogin is server only, so arrives only to the server. I do see that the player controller is supplied. If I cast to the player controller blueprint does it automatically apply to the proper client?

brittle sinew
#

If you use a replicated variable, yes. You can't guarantee when that variable will arrive at the client however, so you should wait until the RepNotify to do anything

#

Or form a flow that can go on without it

golden granite
#

I did try that as well, but it seemed like it wasn't replicating. Perhaps it didn't yet travel through but I'd think on LAN it would be almost instantly.

brittle sinew
#

Are you checking for the replication once? Or multiple times

#

Because you're most likely running into a race condition, even on LAN

golden granite
#

Well I scrapped all the previous attempts. I'll try something new here real quickk.

golden granite
#

Got it working with one unexpected issue.

#

The server gets the call three times, the total amount of players (server client client), but every time when it gets to the second branch check int != -1, it always returns true.

#

So what happens is the server is updated with every unique ID, keeping only the last.

#

When it should be keeping only the first.

#

If I remove the IsServer Branch check and add a print string to the end this is what shows up.

brittle sinew
#

When your server logs out, it's most likely not the server's PC, but the server acting on the client's. Unless that's not what is happening

#

Personally I would keep the player's struct replicated and change that on the server, not let the client set its own

#

But that's just from what I'm seeing here

golden granite
#

That does make sense but then that would put me back to my initial problem: how do I know which client is talking to the server?

#

The idea was that when a client performs an action it sends along it's unique ID

#

Unless there's another way to identify which client is talking to the server so I may pull the right information about that client.

brittle sinew
#

You should just be able to identify by what PlayerController makes the call

golden granite
#

I noticed player controllers come through as PlayerControllerName# in the OnPostLogin event but when a client sends a player controller it's always just PlayerControllerName.

#

Maybe the name doesn't matter and there's another identifier I'm not seeing through debug text.

brittle sinew
#

Just wondering, what kind of actions are you looking to perform that requires what you want?

golden granite
#

It's a board game so I want the server to be aware of which client is sending information. That way I know if it's their turn, if they have the card they're trying to send, and so on.

#

All that information is held on the server but I just need to be able to identify which client is sending the information so I can pull the correct stored information.

brittle sinew
#

You probably would set up server functions on the PC itself then, and can do checks on its info within the server's version of the PC

#

And delegate function calls from there

golden granite
#

Yes

#

Awesome, think I got it.

#

Still don't know why the server's player information isn't sticking but other than that good.

brittle sinew
#

Because you're setting it on the client, its ID is 0 when you set it on the server

golden granite
#

Even when I throw in the IsServer check then assign the ID, it still seems to be lost. It's not an issue though because I'll be using player controllers instead which will eliminate that process.

brittle sinew
#

Your issue is the struct isn't replicated, so it'll stick onto the client but not the server

golden granite
#

ah

brittle sinew
#

It can be tough to wrap your head around the multiplayer model, don't get too discouraged at it 😄

golden granite
#

Still doing it but I believe that's just due to things running out of order.

#

And it's bad practice that way any how so I'm just going to delete itand go with what I know works.

#

So assuming I'm using a lobby system I store the player controllers into an array as I get them through OnPostLogin. Then if a client says, "I want my name to be Distul" they will pass Distul through a Run On Server event along with their player controller as well. Then I just use Find In Array on the server with the provided player controller to get my index, and then change the data.

brittle sinew
#

If you're using a run on server event you don't need to pass the PC, because it's already running on the server's copy

#

And then (assuming the variable is on the PC), you can just change it right there. No finding involved

golden granite
#

I meant pass the PC of the client.

#

EG: Custom Event named ForfeitGame which is Run On Server. If a client wants to forfeit they perform ForfeitGame with their PC passed through the event, then the server knows which PC/client is quitting.

brittle sinew
#

"The server" isn't some one thing, each PC exists on the server

#

And when you perform a run on server call, it calls the function on the same PC, just the server's copy

golden granite
#

oh

brittle sinew
#

Which will then propagate replicated variables back down to the client's copy

#

Yeah that's where I had a hiccup in understanding too.

golden granite
#

So let's say my client is multiplayer_pc3 on server, and the player draws a card which issues a Run On Server DrawCard event. Let's assume that when the DrawCard runs it's done on the server. If inside DrawCard I used GetPlayerController would that return multiplayer_pc3 or the servers PC which would likely be multiplayer_pc

brittle sinew
#

You wouldn't use GetPlayerController, you can act on the PC just the same as if it's the client's

#

Each object has its own server functions, and its own server copy

#

I understand it's a bit tough to get your head wrapped around it, I was in the same spot at one point. But each object is its own thing, and when you call server functions it acts on the same object it's called from

golden granite
#

I believe I understand you but I'm just having a hard time visualizing it.

#

I'd have to see it in blueprints to fully grasp it. I've been watching some tutorials but all the ones I've found are a bit excessive. EG: I watched one on session handling and part of it was adding the UMG. However, instead of just adding the buttons and talking about the code they went on for fifteen minutes about how to anchor buttons, place them in size boxes, and so on.

#

All very useful information but rather watched that in a different tutorial and saved some time. So yeah, don't have time for that lol.

brittle sinew
#

Just try to think of the server as less of a central hub in this situation. Each object in the game (that's replicated) exists on both the client and the server. So when you call server functions from the client, the server still calls the function on the same object, just with authority over it

golden granite
#

Yeah, that I completely understand. The problem I was having is I wanted to store certain information on server only, and I wasn't sure how to identify which client was requesting that information.

#

I'm starting to see my errors though.

#

I also noticed you can't run functions on server.

brittle sinew
#

What do you mean?

golden granite
#

There's no option to Replicate functions, eg: ReturnItemName (not custom event). But I suppose you wouldn't really need to. Sorry, as I'm talking I'm kind of visualizing things and figuring it out as I type haha.

#

There's no reason to replicate a function because they should just be used to modify local data and return results which if needed to be replicated would be done in the custom event.

brittle sinew
#

Yeah, but if you need to run functions to get info on the server I would generally do that on the server side to prevent clients doing stuff with it

#

Rule 1: Never trust the client 😛

golden granite
#

That's what I'm aiming for. That's the idea of RunOnServer, right?

brittle sinew
#

Actually that might be what you meant

#

Hahaha sorry, misunderstood. Yeah

golden granite
#

Yeah

#

This is obviously my first multiplayer game, and although I want to do my best to ensure people can't cheat. Especially since I'm doing it for another.

#

It's not a big project though so it's a good opportunity for me. I'm fine with everything else, just getting down the multiplayer stuff.

brittle sinew
#

Yeah it's definitely a big leap coding for multiplayer. But once you get it down, it'll be second nature

golden granite
#

Thank you for all your help btw. I've been at this for a couple days and you really clarified it for me.

brittle sinew
#

No problem, glad to help 😃

regal relic
#

Ok so. Get World Delta Seconds seems to just break after a client connects to a server.

#

Its seems to be pretty much stuck at 0.01 .

regal relic
#

All day to find out my level file was apparently corrupted. Or so it seems. Still not sure bout the stability of the Get World Delta at the moment, But apparently migrated everything into a new level fixed the hung delta bug i was experiencing.

#

Nope.. Nevermind.. false alarm somehow time dilation got messed up for my (broken level), Cant believe i missed the (World Settings).. Facepalm.

pliant cypress
#

Hi everyone! I'm a bit lost with variable replication. I have a struct array in GameMode, which I would like to share with (only) 1 Client. I'm sure I'm overthinking this by now, so could you please elaborate on how would you approach this issue?

rare cloud
#

@pliant cypress Hi, GameMode only exist on server, well you can't replicate variables with.

#

You can use GameState, PlayerState or your Pawn instead, it depends on what you want to achieve :)

pliant cypress
#

@rare cloud Sorry, my (card) game is running in GameMode, but Variables are in GameState as it should be. I wish to "pass on" data to the individual players, so they have an array as well, but not for everyone, just one player, because all players see the game area differently. I can "pass on" the data to the "Server Player" but not the Client, which makes me think that I didn't really made anything and just had access to the data because it is on the server already.

rare cloud
#

@pliant cypress Ok well if you need to filter which player need this informations, you will need to override the AActor::PreReplication function, and use the DOREPLIFETIME_ACTIVE_OVERRIDE macro, this macro will check a boolean, like bReplicateMyAwesomeArray, if set to true your array will be replicate, well inside your gamemode you only need to set to true this boolean and set the array.

pliant cypress
#

@rare cloud I have no problem separating the data for each player, but I'm not sure how to send the information to a client

modern fable
#

what kind of data is it

#

@pliant cypress

pliant cypress
#

@modern fable it is a Struct Array

modern fable
#

yea but I mean, is that data game-relevant?

pliant cypress
#

@modern fable it is the core data to determine what the player sees on the map

rare cloud
#

@pliant cypress " but I'm not sure how to send the information to a client" can you explain more precisely where did you need help ? this is really vague ^^

#

Your replication will be on your Pawn or your PlayerState, it's a Card game well I don't think you need to respawn your pawn (you will lose all informations inside your Pawn whereas PlayerState's informations stay persistant)

#

well choose the most confortable for you

#

after "Tag" your variable as Replicated inside the UPROPERTY of this variable, using a RepNotify here can be really useful to update your map render once the array is replicated 😃

pliant cypress
#

@rare cloud sorry if I am not clear enough, still a beginner :)
I would like to show the game board differently to each player, as they do not see each other's hands. To achieve this, I made a struct array in GameState, where I store all the game data, and through GameMode is the only way to change that array. I made 2 other arrays, which only contain information for 1 player, so they cannot cheat and look into the code and see what is in the other player's hand. My question is, what would be the best way, to make that array available to the players, each only accessing the array relevant to them? How to "send" the data to the client? Where should I store it in a way, that each side can access their data and based on that will be able to build a map?
To be clear: the only question here is to "push" data from the server to (only) 1 client.

rare cloud
#

@pliant cypress No problem, you're welcome :D
Well GameState is better to replicate global informations, not for individual one, PlayerState is better for those kind of things

#

Well you need to:

  • Create a PlayerState, declare bReplicateStructArray and your struct array (don't forget to add Replicated to its UPROPERTY) , override PreReplication() and write something like:
DOREPLIFETIME_ACTIVE_OVERRIDE( AMyPlayerState, ReplicatedStructArray, bReplicateStructArray );

also don't forge to declare the GetLifetimeReplicatedProps(..) function and include "Net/UnrealNetwork.h"

  • Set your custom PlayerState inside your Gamemode

  • Now, Get the player you want to replicate the struct array, get his playerstate set bReplicateStructArray, and set your Array.

It will be replicate to the client and only this one 😃

#

Also I explained before, using RepNotify instead of a simple replication will be better for you to update map render on client side

pliant cypress
#

I'm using BP only, I should have mentioned that

#

I try to send a screenshot, but Print Screen does not work anymore on my PC for some weird reason

rare cloud
#

@pliant cypress Ok ok it's BP only, hmm if you add a non-replicated struct array to your Pawn/PlayerState and you create an RPC with your array as parameter

#

and you call this RPC from GameMode it will work normally

pliant cypress
#

@rare cloud I think I see what you mean. I never used PlayerState before, probably that is why it was so hard to find a solution alone. Thank you for the great advice, I will try this! 😃

rare cloud
#

My answer is imcomplete, don't forget to fill your non replicated array with the RPC's array

#

@pliant cypress No problem 😃

pliant cypress
#

@rare cloud "create an RPC with your array as parameter" could you explain that

rare cloud
#

Create a Custom Event

#

set it as Run on owning client

#

for replication

#

and add your struct array as parameter

pliant cypress
#

@rare cloud the Custom event should be in PlayerState?

#

no, in GameMode I see

pliant cypress
#

hm...

#

what object should I connect to Player State so I can cast to it?

#

GameMode GameState, Player Pawn and PlayerController doesnt work

brittle sinew
#

A PlayerState is its own object, you don't cast to it

#

Unless you have your own custom one, but you still need to get the player state

rare cloud
#

@pliant cypress, your custom event will be on your playerstate, and call from your GameMode

pliant cypress
#

@rare cloud jepp, got it now, I have input on the Client side as well. Still not perfect but I will figure it out the rest tomorrow with fresh mind. Thank you very much for all the help! 😃

rare cloud
#

@pliant cypress No problem 😃

summer nova
#

one thing, direct IP connection doesnt work becouse ports and stuff

#

with Sessions, will it get opened or something?

#

i mean no online subsystem

#

and if i use steam as online subsystem to host the session, does it work then?

ivory parcel
#

What do you mean because I have been struggling with that for a bit now

ivory parcel
#

Just starting a session doesn't seem to open ports automatically in say your router

#

@summer nova If you Use steam subsystems you cannot connect via direct IP unless you open the map with the option bIsLanMatch

summer nova
#

first, im opening the map as Listen

#

and im not using any subsystem for now

#

in fact, i have to close steam

#

if steam is opened, then i cant connect by IP even on Lan

#

but with that closed, i can play Lan

ivory parcel
#

If you are using the steam subsystem than that makes sense

summer nova
#

but not online with external ip

ivory parcel
#

otherwise it doesn't

summer nova
#

btw, what is the default?

ivory parcel
#

as far as I know

summer nova
#

my gamemode is just child of GameMode

ivory parcel
#

The default is Null subsystem

summer nova
#

but i cant seem to connect from external

ivory parcel
#

that is probably because of NAT on your router

summer nova
#

alright

#

if you use steam subsystem, does it bypass it?

ivory parcel
#

To my knowledge UE4 doesn't attempt todo UPNP

#

In my experience currently on 4.11 the steam subsystem with steam sockets doesn't work at all and im not sure why

summer nova
#

probably older steamworks

#

im using 4.13

ivory parcel
#

It attempts to but the connection never completes, in theory according to the steam SDK it should

#

It will either use NAT punchtrough and if that fails use a steam relay server

summer nova
#

the thing is that i shouldnt use steamworks

#

becouse its a VR game and ill probably release on oculus store first

#

i doubt steam is going to be happy if i use steamworks for development and end up releasing on oculus

ivory parcel
#

I have no idea on that one, Im just a code monkey not marketing person

#

but its not a full tutorial

summer nova
#

fuck

#

i want people to host their own servers

ivory parcel
#

They can, this just punches holes in routers for them

summer nova
#

so this is the only way?

ivory parcel
#

otherwise you would have to link them to https://portforward.com/ or similar and tell them to open ports 7777

#

Another way would be to petition epic to include UPNP by default 😄

#

would make my life easier

summer nova
#

might try that thing

ivory parcel
#

It basically removes problems for less-technically oriented users

summer nova
#

// Create the proper Steam P2P address for this machine
NewSessionInfo->SteamP2PAddr = ISocketSubsystem::Get()->GetLocalBindAddr(*GLog);
NewSessionInfo->SteamP2PAddr->SetPort(Subsystem->GetGameServerGamePort());
UE_LOG_ONLINE(Verbose, TEXT("Server SteamP2P IP: %s"), *NewSessionInfo->SteamP2PAddr->ToString(true));

#

this from the steamworks session code

#

p2p adress and stuff

#

with steam, can it work without opening the port?

#

as expected, steam does indeed do nat punchthrough

#

for p2p servers

#

it seems unreal DOES use that P2P stuff

#

have you tried it @ivory parcel?

#

bool FSocketSteam::SendTo(const uint8* Data, int32 Count, int32& BytesSent, const FInternetAddr& Destination)

#

this function in the steam subsystem sends internet data through Steam API

#

wich is P2P and automatically bypasses everything

#

there is a similar thing on oculus online subsystem

ivory parcel
#

If there is something for the oculus system you can use that

#

As I said I have not had luck with the steam version and 4.11, it never seems to finish the connection on the clients side because the client constantly responds with ACK timeout

summer nova
#

seems to be a lot of stuff regarding that. Not on IP, but with Sessions connection

#

wich connects p2p

#

welp

#

il try myself tomorrow

ivory parcel
#

Ya, if you attempt to connect via sessions on steam it automatically attempts P2P

summer nova
#

the basics of my VR Deathmatch game are done, the very basics

#

now, for testing, i need some basic infraestructure

ivory parcel
#

I modified my engine to avoid that using a config variable

summer nova
#

why?

#

becouse it failed?

ivory parcel
#

ya

summer nova
#

have you tried 4.13?

ivory parcel
#

and direct IP works

summer nova
#

but do you use that port thing?

ivory parcel
#

Not yet but that code doesn't appear to ahve been touched

#

Ya, I use port forwarding, not UPNP yet as the game is not that far along

#

The only change to steam sockets that I see is that its copyright notice was updated

summer nova
#

maybe the linked steamworks library is other version

#

or something is missing in steamworks settings

ivory parcel
#

Not sure

summer nova
#

late today, but tomorrow ill get a LAN server browser going

#

after that, on Steamworks

#

hope that part isnt as bad as the achievements/leaderboards part

#

becouse that thing is useless

ivory parcel
#

just realize, that with Steamworks you need to host your game with bUsesPresense as true otherwise none of the hooks work

#

That part is also not in any of the documentation

summer nova
#

good that i have the shootergame code

#

its presence, btw

ivory parcel
#

Ya, I don't think they explicitly cover that in the shootergame code but its a gotcha for sure

#

Ah yes that one

summer nova
#

/** Presence enabled session */
bool bIsPresence;

ivory parcel
#

Is that in the session creation?

summer nova
#

yes

#

its the part im investigating

#

ill create a very simple server browser with UMG that calls the session functions