#multiplayer

1 messages Β· Page 445 of 1

real yacht
#

and this last screenshot is when health is decreased, and nickname is not printed ..

#

i can't get nickname from instigator and i cant get nickname from myGameState (game state exists on clients and server)

#

so my question is, how can i print some var from myPlayerState.

#

πŸ˜ƒ

jade gazelle
#

How are you setting the nickname? If you are setting it on the client then the server is not going to be able to see it

#

And it will be empty as in your image

real yacht
#

im setting in begin event in my pla

#

my player state

#

so i should have server event

#

to set nickname

#

?

jade gazelle
#

Just do a switch has authority after begin play, and set the nickname from the authority branch

#

And make sure the nickname is replicated

real yacht
#

i will try that

#

thnx

#

this is my player state

jade gazelle
#

Yeah you are setting it on the client, so the server won’t have it

#

You may have to use an RPC though if you are pulling data from Game Instance. Since the server won’t have access to your client game Instance data

#

So in that case, on begin play, run an execute on server RPC that sets the nickname and pass in the name data as a parameter

real yacht
#

cool thnx

maiden vine
#

anyway to change port numbers for a listen server?

#

Im using blueprints execute console or open level options listen

ivory portal
#

In settings no?

worthy wasp
#

Is this reacting correclty - NonSeamless gamemodes in a dedicated server - when you use OpenLevel() - the client actually disconnects from the dedicated server?

ivory portal
#

and reconnects

worthy wasp
#

reconnect definitely isnt happening

#

my player array goes from 2 - to 1 when this happens

ivory portal
#

So what happens? You are playing in Map1, dedicated server does OpenLevel and then you are in Map2?

#

"When a client executes a non-seamless travel, the client will disconnect from the server and then re-connect to the same server, which will have the new map ready to load."

worthy wasp
#

maybe thats the problem

#

i was using OpenLevel on the local player

#

so the server has to roll EVERYONE over to a new map?

ivory portal
#

Why not use servertravel?

worthy wasp
ivory portal
#

execute console

worthy wasp
#

roger that

#

i thought OpenLevel was the BP function for this

#

which is why i was using it

naive shell
#

Server travel didnt worked for me after the session is created

ivory portal
#

ah no, you can do execute console with "servertravel newmap"

#

only the server should execute this

#

clients will normally automaticly follow

naive shell
#

Oh

ivory portal
#

don't forget to create an empty level for your transition map

naive shell
ivory portal
#

Don't forget to enable seamless travel in your gamemode

naive shell
#

I did

ruby furnace
#

Are there command line arguments for starting a dedicated server with a different map?

worthy wasp
#

so this maybe something i'm not understanding.....

#

though it doesnt relate to my game at this poitn - i still want to understand it

#

how does an MMO handle clients traveling to different maps -

#

because - its a dedicated server (to my knowledge?)

#

and when one client treavels from stormwind to ironforge - the entire games poplulous doesnt follow....

ivory portal
naive shell
#

Im totally new to multiplayer

ruby furnace
#

You can design that yourself. But probably some main server that knows what servers belong to a "world" or however they call that in MMO games

worthy wasp
ivory portal
#

Stormwind to ironforge exist on one map. Stormwind to orgrimmar are different maps

worthy wasp
#

sorry thats wrong

ruby furnace
#

uhm I mean when you start the server from you command line

worthy wasp
#

so like: "open 127.0.0.1?Map=YourMap"

ruby furnace
#

No when you start a dedicated server

#

not from blueprints

worthy wasp
#

thats set in maps & modes

#

server default map

ruby furnace
#

I know, but rather have a command line argument

#

but it doesn't exist?

worthy wasp
ruby furnace
worthy wasp
#

DefaultEngine.ini

#

you can change it on the fly

#

just by editing the .ini file

ruby furnace
#

yeah I know, well do just that I guess

worthy wasp
#

but

#

does tthat translate to a packaged game?

#

i'm unsure

ivory portal
#

You have a Server Map in project settings

worthy wasp
#

@ivory portal - i can understand level streaming - perhaps thats what all of this is.... and they just do a loading screen while streaming in the level.....?

#

because certainly - players dont all travel from ogrimarm to stormwind when one client does this travel

ivory portal
#

No but this is more because of the network relevancy

#

If AGameNetworkManager is set to use distance based relevancy, the Actor is relevant if it is closer than the net cull distance.

#

So you can say

#

"Give that client the players in X units distance"

#

But see it as

#

One server -> One map

#

But your map can be gigantic

#

Just think about, in vanilla WoW, the areas were massive but as soon in cataclysm you could fly in the vanilla world it was suddenly so small

naive shell
#

I cannot make the servertravel to work once the seesion has alredy been created

ivory portal
#

Whats the error?

naive shell
#

It doesnt load it

ivory portal
#

Can it find the map?

#

Where are your maps located?

naive shell
#

In Root/Maps

ivory portal
#

and they are packaged?

worthy wasp
#

PIE testing - or standalone?

naive shell
#

In what sense

ivory portal
#

Ignore my comment

naive shell
worthy wasp
#

again - as tom said you dont exceuteall -> ServerTravel

#

run it on the server - the rest of the connected clients will follow

naive shell
#

how do i do that im new to multiplayer i

worthy wasp
#

you have code that depicts "when all players are ready" right?

ember needle
#

I'm experiencing something incredibly hard to tackle. I'm really hope that some of you can point me in a right direction because, well, at this point my game is unuseable.

In a multiplayer game I have a slotting level, where players can choose which role to play. When a listening server is created, this level is opened, and the event BeginPlay of the level opens the widget that is responsible for all interaction.

I have a client that connects to a listening server successfully, however the BeginPlay event of the level on the client is never called, hence the client never sees the slotting widget.

#

In this gif you can see that the server is listing both players in the "unassigned" section (still have to choose the role), and the client prints out "successfully joined". I'm using the advanced sessions plugin in this.

I really do not know how to debug this. I've tried removing all functionalities, I've tried opening a standard level (i.e. not one with a widget) and there too, it is not opened on the client.

Can someone help me please, all development is stopped as I do not know how to proceed.

naive shell
#

That event is firend on the lobby map, when a player joins the lobby, he can press join and that event is fired

ember needle
#

that's the issue, it is not

fleet raven
#

just do it in the player controller you use for that level instead of using the level event

ember needle
#

OK I can try that but it has other implications. Is this expected?

#

Could it somewhat be related to a state I should put my GameMode in?

fleet raven
#

I don't know if it is expected, it's just an idea for a workaround so you can go on

ember needle
#

and thank you, it is a good idea, though it requires quite a lot of refactoring so I'd like to understand

#

However it is definitely a good plan if everything else does not work

naive shell
#

I think i fixed it

ember needle
#

I do not use GameMode states (ready to play, etc), is that needed?

fleet raven
#

not really

ember needle
#

right

fleet raven
#

I think most people just use the game mode base

ivory portal
#

@naive shell Execute the command only on server and remove that player controller on it

naive shell
#

I think i got it

#

btw that command only works on standalone play or build game

ivory portal
#

ah yes, dedicated servers are a bit harder to test in the editor

#

In the pinned posts you have an image that tells the differences

maiden vine
#

i still cant start listen server in specific port number can you do this in execute console command or should i be trying other ways

naive shell
#

It did work now i gotta remove the lobby ui for al ll players

ember needle
#

Sorry to bug again, but who here does know when BeginPlay events in the level are supposed to get called?

naive shell
#

when the game starts

#

thats why its called beginplay

ember needle
#

except it doesn't on clients that connect to server.

#

I wander if something changed in 4.21 related to that, because in 4.19 everything worked.

covert garden
#

How to fix pawn is duplicate when more than 2 players spawn? In Dedicate Server

ivory portal
#

?

#

How do you mean

covert garden
kind niche
#

lol

vapid egret
#

How do I connect just by typing 127.0.0.1 without using "open" in my text box?

worthy perch
#

For a client to travel to a server, ClientTravel().

tropic snow
#

why doesn't this work?

#

wont destory session

glass plaza
#

@vapid egret Use the Execute Console Command, and the append string node. (open + textbox) You can also add things like ?listen with that same append.

#

@tropic snow Does it pass the Cast? Looks to me like it could fail there.

nocturne token
#

Has anyone ever had an issue where when they spawn a new pawn and a client possesses it

#

That pawn does not think its locally controlled on the client?

vapid egret
#

@glass plaza Thx

#

thank

dark edge
#

I'm working on spawning a pawn and various attached actors for multiplayer. How can I confirm that all the attached actors have replicated client side before doing some client side setup?

glass plaza
#

My players are suddenly spawning as Spectators instead of with their pawn and I can't figure out why. (I checked, GM->StartPlayersAsSpectators is not on true)

dark edge
#

What is the default pawn in game mode?

glass plaza
#

Ended up figuring it out. Forgot Super:: when I override PostLogin

tribal solstice
#

I keep getting a 'Steam API disabled' error when packaging my game. When I run it, the steam window still pops up in the bottom right, but my friend cannot join my server. Any ideas? I followed the Blueprint Multiplayer tutorial from Unreal.

#

Is there an updated tutorial of how to get Steam subsystem working? I just did that whole official tutorial and it's not working. Any help would be awesome. Thanks.

fossil spoke
#

The process hasnt changed at all. Make sure your friend is in the same region, as the Dev App (ID 480) is region locked by default.

tribal solstice
#

Copy that. Any idea what the 'Steam API: disabled' warning means?

#

LogPluginManager: Mounting plugin OnlineSubsystemSteam
LogPluginManager: Mounting plugin SteamVR
LogOnline: Display: STEAM: Loading Steam SDK 1.39
LogOnline: Warning: STEAM: Steam API disabled!
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: OSS: Unable to create OnlineSubsystem module Steam
UATHelper: Packaging (Windows (64-bit)): LogOnline: Display: STEAM: Loading Steam SDK 1.39
UATHelper: Packaging (Windows (64-bit)): LogOnline: Warning: STEAM: Steam API disabled!
UATHelper: Packaging (Windows (64-bit)): LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
PackagingResults: Warning: STEAM: Steam API disabled!
UATHelper: Packaging (Windows (64-bit)): LogInit: Display: LogOnline: Warning: STEAM: Steam API disabled!

fossil spoke
#

Steam is not enabled while packaging

#

Its safe to ignore it

tribal solstice
#

@fossil spoke Okay, thanks. I'll check regions.

#

How do I ensure we're in the same region? We live in the same city.

fossil spoke
#

Your region is in your Steam settings

#

If all that fails, make sure that whatever machine is hosting the Server has the correct ports forwarded and that the Firewall is not blocking the Server process.

tribal solstice
#

Is there any documentation on making sure correct ports are forwarded?

#

and how to set Firewall to allow server process? I'm not seeing anything being blocked.

#

App looks like it's set to public in firewall

tribal solstice
#

Ahhh.. looks like it may be an issue with Max Sessions Found as well. Since it uses app id 480 by default, there are generally a couple thousand other people playing 'Spacewar' at the same time so setting a Max for Sessions fails to find your specific one.

#

Gonna try setting to 10,000 or so

thin stratus
#

@nocturne token Not directly, could only imagine this to return false before the client knows they got possessed

#

E.g. BeginPlay. But I'm pretty sure you call your stuff properly timed.

nocturne token
#

So apparently GAS has a different way of checking locallity which is what I was fucking up

thin stratus
#

Ah well that system..

ember needle
#

If anyone has ever seen something similar or would know where to start looking it would be really helpful. I've been 20h on this already to no avail.

#

TL;DR: level is not loaded on clients after joining.

#

If I cannot find a solution I have to restart the project and gradually import, something extremely painful at this point (1 year of work)

thin stratus
#

@ember needle Nothing in your log suggests that it's not loading the map

#

Rather the opposite

#

Both Server and Client properly report that both are browsing and loading the map.

#

Why do you think it's not loading the map? Cause the UI isn't showing up?

#

Are you sure that this isn't a bug in your UI code?

#

The LevelBlueprint should NOT hold the logic for the UI

#

This should be placed in your PlayerController or HUD Class

ember needle
#

@thin stratus Because the level does not show. I've also tried loading a stupid level instead of the level with the widget, and that also doesn't appear.

#

Also, the BeginPlay event does not get fired on the level of the clients

#

I can surely move the logic from level to playercontroller, however the level is not loaded anyways

#

the other weird thing is: sometimes if I resize the window it MAY suddenly appear. Or, if I record it with Gyazo, then it works all the time.

#

So it seems something is related to displaying

#

As per the bug in the UI, I've changed it to an empty UI with "TEST" only written in the middle of it, same thing

thin stratus
#

Can you recreate the issue in a fresh project?

ember needle
#

I was hoping to avoid that, but it seems the only thing I can do is to create a fresh project, and gradually import all the work of 1 year

#

it's going to take a while and I was hoping to at least pin point what the issue might be

#

everything is so dependant now that it's a nightmare to restart everything

#

So my only hope is to recreate everything and "see if it works (TM)"? πŸ˜ƒ

thin stratus
#

No, you want to make a simple fresh project

#

And check if traveling works

#

That takes like 5 minutes.

#

If that works, then you have a bug in your project. And I'm still kinda sure this is related to your own code, because as mentioned, the logs show that the client travels and loads the map properly.

ember needle
#

I understand

#

What I do not get though is: once I've established that an out of context small project works, how do I go in understanding what the issue is. Because I'm not stating it's an UE bug, it's most probably in my code indeed.

#

I mean what can I possibly do for a BeginPlay event not to be fired, is the question.

real yacht
#

is this correct way to use instigated by (because when i have 2 clients, always prints one client nickname, but in gameState both are in array) what could be a problem? thnx

#

when i'm printing playerArray from GameState

#

both have correct nicknames

thin stratus
#

That you are passing the wrong Instigator

#

@real yacht

real yacht
#

i was passing controller player in apply damage, now i think that maybe i should pass get instigator controller?

#

is that correct?

thin stratus
#

You need to make sure you stay relative to the player applying damage

#

You can't use PlayerController0

#

So yeah, InstigatorController might help. I don't know where you call ApplyDamage.

real yacht
#

let me try with instigatorcntroll.

#

@thin stratus it works now

#

my mistake was with playerController()

raven holly
#

Everyone has access to game state yes?

#

But only authority can modify

#

I remember in the old IRC someone made a diagram of all these classes lol

#

I should remake it

thin stratus
#

There are diagrams in my compendium

shut surge
#

Hi, i'm studying replication documentation. ROLE_None says object won't be replicated. So why to use this role at all? What's the difference between non replicated object all together?

red glade
#

Non replicated isn't told to other clients/server.
A player UI is only for the player, other players have no need to know it exists.

bitter oriole
#

I'm guessing the role is set when you disable rep ?

red glade
#

It's useful if you want to do something client side for a minute, then tell the server

shut surge
#

thanks, i think i get it!

red glade
#

Like if you are opening a paid door in game, lets say it costs $2000 to progress this way. And if you only have $1500 why even ask the server to check? Just check player side, if not enough cancel. (Using unreplicated events) and if they have enough then ask the server if they can open the door (then server does its check for security)

shut surge
#

and which actor in this example would have role set to None?

red glade
#

The door can be "unreplicated", I always prefer to not replicate static animations, you can tell the player to play the door open animation and it's much smoother as it's running directly in sync with your framerate. (Also not getting data from server then showing it, always seems to "lag" a little)

chrome bay
#

You don't really want clients opening things like doors locally. What happens in the case of late-join, or if the server decides you can't in fact open the door

hoary spear
#

Do you even want clients to localy check amount of $ ?

#

wouldnt think so atleast

#

Request server to open door -> Server checks players cash vs cost to open door -> Server opens door for specific player if enough cash

shut surge
#

do ALL actors in multiplay game have to have role? even static light pole?

chrome bay
#

Role is managed automatically - you shouldn't ever have to touch it

#

If you do, expect things to break

shut surge
#

Right! I set replication rule. Engine will handle roles

chrome bay
#

Exactly, just set whether an object is replicated or not and the engine will handle the roles etc. based on ownership

#

If something affects the state or rules of the game, the server should always handle it.

#

Otherwise you just open yourself to cheating and/or desyncs

hoary spear
#

if someone gets desynced they're just thrown out, right?

chrome bay
#

By desync'd what i mean is, the client might open a door but the server might not

#

Now the client has an open door, and both server and client don't know about the "true" states

shut surge
#

peer-to-peer throws peolpe out because there's not way to sync back players. In server authority case, you just roll back player to latest knows state

chrome bay
#

If the Server doesn't know the client opened the door, it won't tell it to close again.

#

Just a simple example, but in general it's bad practice to manipulate something on the client before the Server says it's ok, or without the Server doing it.

#

It costs one bit to say whether a door is open or not - worth paying that cost to prevent state desync

thin stratus
#

I don't think that's an issue though?

#

If the state of the door is a simple RepNotify boolean

#

Even if you open the door locally and the Server doesn't,

#

As soon as the door actually gets opened, the RepNotify will call

chrome bay
#

Yeah but if they've opened the door already on the client, they won't get a rep

thin stratus
#

And then later to close it.

#

Why wouldn't they?

twin vault
#

but if youre opening locally, whos gonna make the server open it, unless youre opening beforehand as a prediction

thin stratus
#

You don't have to set the RepNotify boolean on the Client

#

Just use a local indicator for door open or not

chrome bay
#

So Client opens Door A and sets the replicated bool to 'Open' - Server gets the request to open it, and decides not to, so the bool stays false on the server, therefore it never sends an update

thin stratus
#

If I open the door on the client and I set my "Client Boolean" to "true", while the Server doesn't set the OnRep Boolean to true.

#

I can later check in the onrep if my door is actually open

#

And then either play the open anim

#

Or just not

chrome bay
#

I mean you could.. but why would you πŸ˜„

#

A lot of hoops to jump through to eliminate a few ms of lag when opening a door

#

Also when the door does fail to open you'd get an ugly snap back to closed too I guess

hoary spear
#

In the example case aswell, the door costs something to open, so you should do request via server anyway, shouldnt you ?

thin stratus
#

Snap backs will always happen

chrome bay
#

IMO yeah

thin stratus
#

You def need to ask the server

chrome bay
#

Ask the Server to open the door, and the server sets the state of it

#

When client receives that state, open or close

#

That's the way I'd handle it

thin stratus
#

But nothing stops a player from opening a door clientside

#

If it's important that whatever is behind the door can't be accessed without paying

#

Then you should also tie the state of hte room behind the door to the server

#

Means if I locally open the door by cheating money

#

I should stand in an empty room

shut surge
#

I'm with eXi. Smoother experience. Although implementation might be complicated

thin stratus
#

It's the little things I guess

#

You could also argue the same about shooting a projectile

#

Does it matter if the Player sees it spawning a few ms later?

#

Not it doesn't.

#

Most players will never notice

hoary spear
#

Are there specific ways to handle resyncing aswell ?

#

in case of a desync

chrome bay
#

nope

#

nothing outside of what's specific to your game

hoary spear
#

seems like most games do some re-join event

thin stratus
#

Probably more of an case to case situation

#

Or however you say that in English

#

If you door state desyncs, it can always be resynced next time the server forces you to sync it

#

If you need this for something, you can always tell the Server what you current state is and if that state is not the state that hte server has, force it

chrome bay
#

This is a lot of effort for something as simple as a door πŸ˜„

thin stratus
#

The Door is an example :D

#

It's how the CMC basically gets the "Move" RPC from the Client, performs the same movement and checks if the endLocation that the Client passed matches to what the Server reached.

chrome bay
#

That is true, but the client is always sending updates and the server is always checking the state in that case

thin stratus
#

I haven't seen a UE4 Game desync yet though

chrome bay
#

And the server does no simulation until the client tells it to, so it's kind of taken care of through the implementation

thin stratus
#

Most of the times, desyncing was encountered in Multiplayer Mods

#

Not counting forcing a desync by cheating money and openeing the door locally

hoary spear
#

True that, i've only had issues connecting in the first place now that you mention it

chrome bay
#

Yeah that's the kind of thing I'd want to avoid

#

So all it would boil down to is "hey server can you get this door for me fam?"

#

then Server says yes or noop

#

predicted doors? man that's next level

hoary spear
#

half way through the door, it slams back in your face. prediction was wrong

shut surge
#

TheJamsh, how you'd implement shooting?

chrome bay
#

shooty guns are hard

#

lag really matters then

#

hence most games use hitscan cus it's easier

#

Look at ShooterGame for a starting point, even though I personally hate it

#

or wait like 10 years for me to finish this damn plugin

hoary spear
#

hitscans feel unfair tho, but im not sure how much you'd notice it

chrome bay
#

most players never notice tbh, and it gets hidden with FX and the like

hoary spear
#

"If you reacted to the sound of the gun going off and required 0.20 seconds (twice that of the fastest Olympic sprinters) to react, then you would need to be at least 500 feet away to successfully dodge a bullet."

#

i guess that says it all

chrome bay
#

When you start moving away from arena shooters and tackling larger engagement ranges though, then it's more noticeable

#

yeah

hoary spear
#

if you're in the crosshair, you ain't dodging it

chrome bay
#

lag compensation is the big thing, but few games bother with it. Or if they do it's very much favour the shooter

winged badger
#

that depends on the speed of the bullet πŸ˜› some of those fly faster then sound

#

the game doesn't feel responsive when you play if if you wait for server confirmation

hoary spear
#

sucks when you run behind the concrete wall , but get hit cuz lag compensation

thin stratus
#

Golden Rule: if(bIsPlayerBehindWall) bIsDead = true;

chrome bay
#

haha

thin stratus
#

Otherwise you fail the proper implementation of HitScan

chrome bay
#

I've dabbled with it recently, it's actually quite easy to implement lag comp.. but the tuning is the hard part

#

gotta be enough to be noticeable, but not so much that people just feel robbed

hoary spear
#

A neural net for tuning

#

Rei got that going

thin stratus
#

Sure thing for a single dev.

#

Need that for my MMO.

chrome bay
#

UT went with 120ms which IMO is quite high

thin stratus
#

UT...

hoary spear
#

120ms lag compensation ?

thin stratus
#

I have it open on my right screen. They have two implementations of Stats

#

Where none of the two is fully used.

#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

chrome bay
#

haha

#

UT is a frigging mess

#

some of that code is in fortnite too

#

amaze right

#

at least, I'm told fortnite uses a very similar system for it's weapons

#

since gameplay abilities doesn't really scale to shooty-shooty gun weapons

thin stratus
#

Hm, maybe the AUTGameMode* UTGM = Cast<AUTGameMode>(UGameplayStatics::GetGameState(GetWorld()); is in there

chrome bay
#

da fuq

#

I guess in fairness they never finished it πŸ˜„

#

too damn bad because I really wanted to see how they were gonna handle vehicles

#

my gut tells me client authority 😒

#

with a dab of sanity checking

shut surge
#

haha

chrome bay
#

lol

#

GG

thin stratus
#

They also havea bug with RepNotify in it. Their RespawnTimer that is visible on the Screen only shows the Countdown the first time.

#

Second time you die, the RespawnTime is set again to the same value, not calling the OnRep, not updating the Client Variables

#

Which results in the UI showing "Press Fire To Respawn" while there is actually still the countdown

#

I first thought I had that bug on my end (was using their code), but well found out it wasn't my fault after all

chrome bay
#

I've discovered using ServerWorldTimeSeconds is really handy for that kind of thing

#

It stays surprisingly well in-sync so long as your lag isn't fluctuating a lot

thin stratus
#

I just force the value with an RPC now.

#

I don't see why i would need an OnRep for a time variable that is in the end only for the UI

#

It's not like you get relevant to your own PS and require the OnRep to fire

thin stratus
#

Thoguth you'd like having a look at that

chrome bay
#

Haha, I had to go through someone to find that πŸ˜„ they finally made it public!

#

Their whole engine is based around ECS which is cool

#

totally different to unreal though

shut surge
#

man how i hate official ue4 video tutorials.. too much patronising. just get to the fucking point

#

and apparently they are buggy πŸ˜„

thin stratus
#

That is my post, yes.

shut surge
#

you get karma points for that post

thin stratus
#

They haven't addressed it in 2 years

#

:P

astral gust
#

Hey guys, does anyone know how to set a Steam session to game (play) rather than lobby? I haven't been able to find anything about this on the forums or docs.

thin stratus
#

Usually when start a session you can specify the name

#

Party or Game

#

Game is default, Party is most likely needing you to use C++.

#

It can be that Steam labels both "lobby" though idk

chrome bay
#

Yeah I think it does

lost inlet
#

one thing i'm wondering, if you join a game in progress and there's a replicated actor that has a replicated property that is not at the default value, will its rep notify be called?

fleet raven
#

yes

#

need to be careful though: this will run before beginplay

lost inlet
#

yeah i figured as much, i'm trying to look into a join in progress desync bug

#

unfortunately it's kinda hard to test those in the editor

bold hatch
#

Hey guys does multiplayer have to be built at the beginning of a project ?

#

I havent read up the documentation yet but, ive been told it works really well and is alot easier to implement in ue as opposed to unity

thin stratus
#

If you need Multiplayer, then yes

#

Otherwise you'll basically code your project twice

bold hatch
#

How is it tested? Im a bit of a hardware guy, is the only testing be done locally?

thin stratus
#

Depends on what you are going for in the end

#

To test Multiplayer in UE4, just for you, you can simply select 2+ players to have a ListenServer setup

#

Or 1+ Players in combination with enabling DedicatedServer to have a DedicatedServer setup

#

Both should however every now and then be tested in a fully packaged and compiled build

glass plaza
#

Yeeahhh... My issue with my players appearing as Spectator pawns and not their properly pawn is back...

winter harness
#

@thin stratus is 100% right about testing with packaged builds. The dedicated server simulation and multiplayer code in the editor is not quite right, and may be misleading when something work that wouldnt actually work in a true multiplayer setup.

bold hatch
#

I was thinking of peer to peer multiplayer, is that do able in UE?

gleaming vector
#

true peer to peer is not

#

but having one of the players be a host and others connect to it (like most console games do) is perfectly possible

#

host migration is a pain in the butt though

bold hatch
#

Does UE's documentation have more info on that @gleaming vector ?

gleaming vector
#

uhm

#

i dunno

bold hatch
#

@gleaming vector haha no worries ill try to research it. Not like its for money anyways, just a student project

thin stratus
#

ListenServer and DedicatedServer :P

#

Not P2P

bold hatch
#

Yeah ill read up those in the documentation. Im just working for squares and circles anyways

thin stratus
#

Make sure to read my compendium ;)

#

Pinned to this channel

bold hatch
#

Yessss i will

#

also, maybe one last question, does it all work with blueprints or will i have to dive into C++ code?

fossil spoke
#

If you want a Dedicated Server you will need to build that from source code. Bluprint only projects do not have the ability to create a Dedicated Server executable for the final packaged build.

#

But its perfectly doable to write your entire game in Blueprints.

gleaming vector
#

when it comes to multiplayer, I do not recommend using only blueprint

#

you can achieve what you want to do, but it's much harder than writing C++ code

#

and there are more features available on the C++ side than the blueprint side

fossil spoke
#

Totally agree.

#

I certainly recommend C++ over BP if you have those skills.

bold hatch
#

Thanks guys, i do not, coming from unity i know a bit of C# but am not the great.

tribal solstice
#

I can't seem to connect to a server after following the Epic Blueprint Multiplayer tutorial. Driving myself nuts over here. I changed the Max Sessions to a super high number, firewall seems fine. Any help would be super appreciated. Is there a working version of this project I can download?

gloomy flint
#

how are you trying to connect @tribal solstice ? (what's the exact syntax you're using?)

tribal solstice
#

I'll post some screens. One sec

#

There we go. I tried to trim the stuff I didn't need. All I want is players to appear in chat room with their name.

#

First screen is the 'Refresh Servers' macro

tribal solstice
#

@gloomy flint Let me know if you need more info. Thank you!

gloomy flint
#

Ah, I'm not sure I can help you with this 😦 Hopefully someone else will catch the error

tribal solstice
#

@gloomy flint No worries, thanks for taking a look!

opaque forge
#

What's the best way to replicate a really large string? Like a string the size of a web page source.

gleaming vector
#

why?

#

if you need to do it once, just replicate it

#

otherwise, if it actually is a web page, just send the client the url

opaque forge
#

Because things like ads and randomized things won't be consistant

gleaming vector
#

?

#

is it static?

opaque forge
#

No

gleaming vector
#

hm

opaque forge
#

It could be anything

#

It could be a literal youtube video

gleaming vector
#

well

#

straight up, if it's a web page, you can't just replicate it

#

especially if it's like a youtube video

#

what you need to do is load page on clients

#

and hope they stay in sync

#

or write some code to force them to stay in sync

opaque forge
#

But we can't account for everything a website might have

#

The theoretical approach is to run javascript on the game server and replicate all document changes

#

And ping the webserver itself for media

gleaming vector
#

you can try that but you are doing a lot of replication you dont need to do

#

and you will lag your server down

opaque forge
#

How do you recomend replicating a web browser than

#

In a way that is consisistant across clients?

gleaming vector
#

I dont think you can

#

at least not perfectly

#

or, take a screenshot and send the image

#

but you wont get video

opaque forge
#

That would be laggier

gleaming vector
#

indeed

opaque forge
#

Having the client run the rendering engine is a must

gleaming vector
#

yes

#

and by nature of rendering the page on each client prevents you from syncing the the page perfectly

opaque forge
#

Of course

gleaming vector
#

unless you have full perfect control over the page

opaque forge
#

But stuff like "I got this ad" should be synced

gleaming vector
#

to my knowledge, you cannot sync that

#

unless you render it out on the server and send that render to the clients

#

because an ad is select at the point of rendering

#

at least for things like google ads

opaque forge
#

Hmm

#

i wonder if I ran all javascript on the server, than propogated document changes to the client, it would work

gleaming vector
#

yeah

#

you could do that

opaque forge
#

But how do I replicate a really long string (the html)?

cyan light
#

STUTTERING IS PRABABLY THE BIGGEST PROBLEM

#

oops

#

do not recommend html5 uis though

#

you can load large html5 files trivially locally

potent prairie
#

how would I create a custom ini file that players can use to set dedicated server settings? Is there a wiki or any tutorial on this?

opaque forge
#

@cyan light The problem is I'm pulling html from a webserver that can be literally any website (because it's a vr multiplayer web browser).

covert garden
#

how to replicate name's player to text render on head pawn?

hoary shell
#

i am using the default networking

#

Movement works fine

#

but i am getting errors in the logs and the bullets are not replicating

#

LogLoad: Took 0.066939 seconds to LoadMap(/Game/Maps/UEDPIE_1_Port)
LogNet: Client netspeed is 10000
LogNet: Join request: /Game/Maps/Port?Name=Mainframe-A0ED2A3B42D8DB5D5F495D994D89E761?SplitscreenCount=1
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogNet: Join succeeded: Mainframe-A0ED2A3B42
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogNet: World NetDriver shutdown IpNetDriver_16 [GameNetDriver]
LogNet: DestroyNamedNetDriver IpNetDriver_16 [GameNetDriver]

#

What is now happening with the GameSession

#

Ok still sort of having that problem but now, I can see the projectile if the server fires it - and i see it on the client

#

the client is not doing it at all, so i guess my onFire trigger is not being replicated properly,

#

BUT the projectile is not moving but just appearing so i guess somehow its not being made moveable

#

yep that is what it is

#

PIE: Warning: Mobility of /Game/Maps/UEDPIE_2_Port.Port:PersistentLevel.FirstPersonProjectile_C_24 : StaticMeshComponent0 has to be 'Movable' if you'd like to move.

#

ok Its not doing the correct thing, Just wondering if there is some default code that is hard coding the projectile, i have changed it in the character BP but not elsewhere

#

ah! gotit

#

I havent replicated my onfire command

fluid flower
#

hey guys, I'm trying to get dedicated servers working on steam but having no luck so far. Has anyone managed to do get dedicated server sessions running through steam? If so, any good resources on it? thanks!

tribal solstice
#

I think it's just a matter of combining that method and adding a Steam Online Subsystem, which is covered in the Epic Multiplayer Blueprints tutorials. I had trouble getting it to work but just figured it out, so feel free to ask me questions and I'll help as best I can

fluid flower
#

Thanks for the link :), yeah I got a dedicated server running ( I think my name is mentioned in that article, I had no idea lol ) It's just the steam part that i'm having no luck with 😦

#

my players can host through steam sessions and join no problem, it's working great. But now I want to host an official dedicated server and want my players to see it when searching for sessions.

#

but everything I've tried so far never shows the dedicated server sessions, do you remember the session settings you used when creating it?

tribal solstice
#

I haven't gotten Steam working with dedicated yet, but I'm working on it so I'll update you when I get somewhere

flint plover
#

Ok guys, I'm done banging my head on the wall. Anyone here want to collaborate? I got a 1v1/3v3/5v5 MOBA I'm working on, and the alphas been pretty much done for awhile now, but I wanted to get a prototype online and I completely lack any experience with matchmaking and starting sessions.
Looking for someone who knows about gamesparks and aws dedicated servers. looking for a simple system that just search's for other players that are searching and connects them, no lobby (think a super cell game's style match making)

flint plover
#

if i don't respond on this server message me directly

bronze stream
#

Hey there. I've spent the past couple of days working my way through UE's source and documentation in hopes to find out how replays function under the hood and despite having hardly any cpp nor UE knowledge I've managed to work my way through to a point where I understand it mostly, however I am now stuck at a point where I dont know how to continue. The way I understand it, "ReplayData" is pretty much the entire network stream that you’ve received from the server, would that be correct?

thin stratus
#

@flint plover That system is expensive, I hope you are aware of that

#

GS changed their pricing, if your game isn't live yet it's most likely affected.

#

And the session stuff needs GameLift, not AWS. And GameLift is also quite expensive.

#

@bronze stream Given the lack of documentation, not a lot of people used the replay system or even know about it.
Might be tough getting an answer here.

fleet viper
#

i remember seeing a article about that on the forums and how to use it

#

(replay system)

fluid flower
#

i've got the basics of the replay system working if thats what you want, how the internal stuff works: no idea

#

has anyone encountered the 'incompatible_unique_net_id' error as of 4.20 i think? We're using steam and tried connecting to our own dedicated servers, and even that is not working anymore unless we turn steam off on the clients 😦

worthy perch
#

If I replicate an int32 with a value of 0, will that have a netbandwidth of less than 4 bytes or will it still be 4 bytes?

winged badger
#

4 bytes, value doesn't matter

#

the int32 type is serialized

#

and client unpacking that value needs to know exact number of bits it contains

worthy perch
#

Alright, thanks.

flint plover
#

@thin stratus

  1. holy shit its exi replying to me
    2.what would be a more practial way to approach what I'm looking for then? I assumed AWS and gamelift were pretty much the same thing lol
thin stratus
#

AWS is just the "static" Servers

#

You set one up and you can install you stuff on it.

#

GameLift utilizes AWS but has the whole scaling stuff with it

#

So you basically tell them " Use that Server Tier and start my build on it."

#

It will then create instances of that ServerTier and host your Servers on them, as well as kill them again if no one plays.

#

But that all doesn't come for free.

#

The only other Service that I know of is PlayFab

#

They have that all in one package, however utilize Azure

#

(Cause well Microsoft owns PlayFab)

#

They take the default Azure Server Costs + 10% i think

#

Just for the Server Hosting

spare glade
#

Gamesparks is not looking so good in pricing for me πŸ€”

flint plover
#

I've heard and looked into playfab but their pricing seems to be about the same

thin stratus
#

GameSparks is shit now after the update

#

They basically kicked out all Indies

spare glade
#

having to contact them atm to get my license details otherwise throwing them out the window

#

yeah they raised the price on indies and lowered the price on BIG games

#

Been talking to one of the engineers over at https://heroiclabs.com/ , and they seem to have a good thing going, way more customizable since ur hosting it urself, so you dont have to pay per user and ur paying for the server price anyways gamesparks wouldve charged

thin stratus
#

We stick with PlayFab now

#

I need to to work atm, not to be customizable

#

But that's just a per project argument

flint plover
#

man, kinda depressing, I got close to getting done then looked into the prices of even releasing a game on diffrent marketplaces, plus the server costs, and its like... such a buzz kill

spare glade
#

for the long term big project tho its a good idea, but for small projects, i wouldnt recommend it exi is right about that

thin stratus
#

Well, Golden Rule: Don't do games with complex hosting when you can't easily afford it.

#

Small or Single Dev Teams should stick to ListenServers or allow players to host their own Dedi Servers.

flint plover
#

i assumed that the scaling servers would remedy that

spare glade
#

my question is WHERE IS ALL THE BACKEND DOCUMENTATION, XD i just want some guides or example from any1 really doesnt have to be epic, of building backends, would like to see how others achieve it

thin stratus
#

The scaling servers are the expensive thing

flint plover
#

listen serves wouldn't work i have a feeling as it might allow the host to cheat

thin stratus
#

@spare glade

  1. Backends aren't UE4 specific
  2. Backends are usually cut to a project
#

If you want to know how to do a backend, here:

Use a MongoDB on selfhosted Server.

#

That's basically it. GameSparks is just a MongoDB

#

Then you need to write an API in e.g. NodeJS that talks to the MongoDB and listens for requests.

#

You then send the requests from UE4 to the NodeJS Server and that modifes the MongoDB or returns stuff

#

@flint plover Correct, Listen and DedicatedServers allow cheating.
The only way to not allow cheating is by hosting the DedicatedServer yourself, away from players

#

And that is infact expensive

#

So if you start a project with a relatively small budget, you might not want to make a game that requires this

spare glade
#

What kind of Game were you looking at making for the backend @flint plover

thin stratus
#

Specially since I can guarantee you that you won't get hundret thousand players into your game, specially if it's paid.

flint plover
#

its a 1v1/3v3/5v5 moaba

#

moba*

thin stratus
#

So if you release a free game with that stuff and monitize it via microtransactions, you will have to pay the servers out of your own pocket until the game picks up

flint plover
#

it was a free game, but i figured that ad mob might cover server costs

spare glade
#

Rip gamesparks, wouldve been perfect for ya

flint plover
#

yeah thats why i was all over it lol

#

i dont want to see it die, but it might have o get put on the shelf until i get more monopoly

spare glade
#

i mean could start like a kickstart or something if it has a demand and you have the ideas and the right people look at it its a possible way

flint plover
#

let me see if i can find my screen capture and ill show u a video from a few months ago

spare glade
#

oooo yes plz πŸ˜›

flint plover
#

thats the 1v1 map, i've fixed the homing on the lasers since this and tweaked alot of the numbers. i have a few other ship classes planned, ie 'tank' and 'assassin'. that one has a jump ability, speed boost, and shield system

#

its more of a 'mage class'

spare glade
#

never seen a moba like that XD, im a big smite player, But hey develop it enough make it smooth and you can make it πŸ˜›

flint plover
#

i wanted to take it in a new direction

spare glade
#

you got the right idea of it tho just gotta take it far enough

thin stratus
#

There is a Tetris Battle Royal. So why not a space 2D MOBA

flint plover
#

old scool top down arcade/moba

spare glade
#

mix & match games

flint plover
#

i love galaga and LOL, thought i'd clash the two lol

#

oh, and they have the basic tele to home base ability mobas are known for lol

#

but everything's working multiplayer wise, took awhile but i got everything replicating fine and it honestly seems really fun, but i really dont want to allow cheating, i guess i could adopt a listen server at first and change it later right? maybe after its gotten on its legs and can pull in enough to cover its own server costs?

spare glade
#

i mean name a scenario of where they would cheat

flint plover
#

I honestly don't know how to myself. But I've read that if players host servers it give them auth to change stuff on their end?

#

keep in mind Im pretty much a noob here on netowrking

spare glade
#

ok ill throw out a few, and tell you why they couldnt and how you would stop it

flint plover
#

k

thin stratus
#

You can't stop it if they selfhost

#

Easy as that

flint plover
#

thats what i thought

thin stratus
#

The Server has the Autority. The Server decides if Damage is Dealt, if a Player is at Location X, if an Ability is on Cooldown or not

#

If you let Player host their own Servers, they can adjust that

#

Even your backend is basically unsafe at that point

#

Cuase the Server is the one sending requests to adjust the backend

flint plover
#

so they have axcess to the api codes too?

thin stratus
#

If Players host their own servers they can submit requests like "I won 5000 matches"

#

At that point yeah

#

You def have to host a DedicatedServer away from Clients

spare glade
#

In Rocket league, they have a client that allows you to change ur skins to anything in game

The Server overall has ownership of everything that runs on its end, but the client it cant control. so the client could change anything they want on their end to look cool but the server would only know and see the car has all the default skins and stuff, and every other player would only see what the server knows, because clients dont communicate with eachother

To prevent this you need a local anticheat to make sure files arnt changed locally and require it be on by the server or else kick that player

thin stratus
#

Otherwise you can just stop caring about competetive at all

#

@spare glade That all stops if you let players host locally.

spare glade
#

yes, I always refer to dedicated servers, local servers are a bad idea, unless its a small game thats suppose to be locally hosted

#

for honor found this out very soon

#

XD

flint plover
#

yeah. idk i guess it's going on a shelf as sad as it is, cant afford servers myself, i barely make rent DX

spare glade
#

local party games between friends are alright but stranger ones over the internet randomly selecting enemies and partying with friends need to be dedicated

#

πŸ€”

#

its a harsh world out there in the world of networking

flint plover
#

they were right btw, stick to singleplayer for your first game XD just a sidenote

#

I've learned so much on this adventure though, so f it

spare glade
#

Firebase would be a good option if ur game is mobile

#

You could run a realtime session

#

would take a little more work setting all that up but very possible

#

Realtime sessions arnt ue4 sessions so remember that πŸ˜›

#

maybe start a youtube talk about ur development process or crowd fund and You could probably pay for your firebase and more then have ads and that will actually get you some more to grow the game, Just gotta use all ur options up till you get to ur final destination of self sustaining

flint plover
#

true

spare glade
flint plover
#

I've thought of crowd funding but i think that part of me doesnt think people will even dig the idea let alone throw money at it and make a demand

spare glade
#

Could always contact the plugin maker ik sometimes for advertisement later on in ur game or paybacks(rarely) the would do for if ur game shows potential which i think a little more polish and maybe could get there to get that

bronze stream
#

@thin stratus Yeah I feel that response a lot, exactly my feelings, unfortunate

smoky ore
#

so. sorry if this sounds odd. but if someone else is using the spacewar appId to make an online game, and they're hosting a session as well, would unreal try to connect to that session even if they're two completely different games? me and my friend who was testing our game kept noticing we were trying to join another persons session (we found out they're an unreal dev, keeping their name a secret for privacy concerns)

thin stratus
#

@smoky ore You receive sessions but they should be filtered

#

So they won't appear in your serverlist

smoky ore
#

I don't have a server list available, it'll just try to join the first available session.

thin stratus
#

Same thing

flint plover
#

@exi (off current topic XD) so, would it be way cheaper to host a small scale mmo compared to the moba style i wanted to do before? because I had been looking into spatialOS and like the look for something of that nature

smoky ore
#

So it's no big deal then? Just a weird quirk with the find/join/create session thing?

#

im just concerned that they somehow got access to a packaged game that should only be between friends is all

thin stratus
#

Only sessions. Not your game.

#

@flint plover SpatialOS is not free though either.

smoky ore
#

So... they may not have access to the game. but they can still host sessions? Sorry i'm a bit confused with what you're trying to say.

flint plover
#

@thin stratus right, but it'd be cheaper like that regardless of who i use though right?

grand kestrel
#

@flint plover @thin stratus spatials pricing still can't be gauged prior to use, they're working on it

#

Their new gdk revolves around the fact that most games don't start out needing spatial and their progress is solid so maybe worry about having a game first though I guess you're getting close

gleaming vector
#

spatial is very hard to price

#

it's not cheap

#

i was quoted around $1.20 per player

#

you basically aren't going to find free or cheap multiplayer

#

if you want to do anything beyond simple local mp or classic dedicated server hosting, you should have a funding plan

#

and even with the classic dedicated server plan, you need to have official servers

#

as you can't guarantee users will be able to spin up enough server capacity for as many players may play

#

(something i've seen twice now on projects I've worked on)

fleet raven
#

just have players host listen servers, free multiplayer achieved

#

there's no need for all this cloud stuff outside of official competitive things

gleaming vector
#

i disagree

#

users these days expect to just be able to play games

fleet raven
#

well they are with this setup

#

I guess it depends on the game

gleaming vector
#

and the user's network setup

#

nat punchthrough needs a cloud service

#

or at least a remote service

fleet raven
#

a very simple one compared to actually hosting the servers though

worthy oak
#

Hey everyone having a weird prpblem (thats likely me just forgetting sometjing) Im trying to spawn health/ammo pickups when someone dies. The logic is working fine on the server/host but its not making it to clients. What am I doing wrong?

#

also tried it with multicast

fossil spoke
#

Those images are to small man

#

Cant read anything

worthy oak
#

apologies, one moment

#

These are being called in the event point damage

fossil spoke
#

Its probably being Destroyed before it gets the call.

worthy oak
#

huh

fossil spoke
#

Your destroying the Actor immediately after its queued a Multicast RPC

#

The Client version of the Actor is probably being destroyed before it gets that RPC

worthy oak
#

yep looks like thats exactly the issue

fossil spoke
#

You should have a Manager class that handles Spawning instead of trying to get the Object itself to do it

worthy oak
#

Gotcha ok. Thank you

tribal solstice
#

can you not load a stream level with a listen option on 'Create Session'?

trim oriole
#

hello every one i would like to ask for some help im trying to add health as a variable health and is dead but well adding it to mycharacterBP i found myself looking for how to replicate it and get authority but cant get it to work had an easier time getting a full working server with no health so im stuck im looking for any help with the BP part of this how do i add health and then server check it an links or picture would help its multiplayer as well so it needs to have that authority node just not sure how to use it for health

dark edge
#

If the health is only ever changed on the server and is replicated, it should work. How are you applying damage?

#

@worthy oak in Gamestate or Gamemode, make an event CharacterIsAboutToDie and pass it the player character and location. Then you can do stuff like spawning pickups and adding to scores and whatnot. Make sure that anything that needs to know about the character actor gets to fire before the actor is destroyed. I'd recommend having a death animation and fade out instead of just instantly destroying the actor.

crystal leaf
#

The PlayerController here should just be GetPlayerController as it is denoting the client that should be the server, correct?

worthy oak
#

@dark edge Ah ha makes sense. Thank you! πŸ˜„

crystal leaf
dark edge
#

@crystal leaf what are you asking?

crystal leaf
#

What exactly the node Player Controller is asking for, and what it means.,

dark edge
#

Sorry your pic took a minute to show up. Yeah just get player controller, or owning controller, or self if that's in the controller.

crystal leaf
#

πŸ‘

#

What's the best way to test this?

#

Open two stand-alone games?

o I can't,

How is it I can go ahead and test this?

Do I have to package it and run it twice each time?

dark edge
#

You using steam?

crystal leaf
#

No,

dark edge
#

2 standalones should do it

crystal leaf
#

I tried to open a second one and it just closed the first,

#

is there an option I've missed?

dark edge
#

Launching from editor or no?

#

just set it to be 2 players and it should launch 2 standalones from editor

#

but if it doesnt, just right click the project file and hit launch game

crystal leaf
#

Yeah from editor, I'll try the right-click thing rn

#

also failing to run 2 copies of it,

#

interesting

#

Got it, I had to select play in viewport

#

it then denotes the viewport as the server and other windows it opens as Client X

dark edge
#

Yeah in PIE it'll auto connect them

#

but once they're up you should be able to just type open MapName in console to break away from the server to test connecting

#

No matter what you should be able to launch many instances of the game from the project file though, I've had like 4 up at once before

crystal leaf
#

oh I don't think I tried clicking it multiple times

#

if I load it from the file itself they aren't auto-connected yeah?

dark edge
#

Yeah they're just 2 instances of the game

trim oriole
#

its a dedicated server so server and client server handles health but just not sure how to place the nodes in for my health to be handled by the server iv added it to playercontrollor but its not server wide its only working for client not showing to others and not checking or no authentication to see if its what there health really is real time just cant get the nods right and where to put the health for my fps and how to do it correctly for online server hosted to clients

timber anchor
#

@crystal leaf Man can i ask you what are you using for creating the multiplayer session?

#

Uworks? or just the standard BP system with the plugins?

crystal leaf
#

BP, no plugins

#

Should I be using plugins?

timber anchor
#

In base of you want to do

#

I mean

#

if you want a steam integration

#

AdvancedSession it's quicker and easier with BP

crystal leaf
#

Not looking for steam integration, (I keep hearing everyone talk about this, is it way easier??)

#

Each client has the ability to be a host, and the other players can hook up to him.

timber anchor
#

Yes, you're doing Listen Server

crystal leaf
#

^

timber anchor
#

If you're not looking up for the steam integration than you're doing fine πŸ˜„

#

I was asking because everyone do everything different in multiplayer projects

#

and hearing from different people what they're using/thinking to do it's always a way to understand new things

crystal leaf
#

I appreciate it immensely, I'm starting to feel lost in the sauce over here just trying to get the games to connect

#

just trying to take this one step at a time

timber anchor
#

Don't worry! If i can suggest you something, try to look up on youtube, there are different tutorials, even without the steam integration πŸ˜„

crystal leaf
timber anchor
#

Best "Guide" (It's not a guide but you can call it like this xD) so far

#

I mean you can understand a lot from him

crystal leaf
#

Is this still the accepted way to do this?

#

Seems hacky and doesn't give me a way to tell if the connection went through or not.

real yacht
#

yes

crystal leaf
#

How do I check the applicable ip to connect to within my machine or should i use 127.0.0.1?

worthy perch
#

I thought "Execute Console Commands" nodes don't work in Shipping.

crystal leaf
#

Then that would be a serious flaw.

worthy perch
#

You can use ClientTravel if you want to connect to a server.

worthy perch
crystal leaf
#

ahhh,

#

I'm seeing a LOT of people using cpp within this channel.

#

Should I not be trying to use BP for a multiplayer game?

worthy perch
#

I think a lot of people use BP for multiplayer, so I guess it's fine.

#

At the worst case, you just expose some native functions.

#

I think ServerTravel was one of the ones that needed to be exposed, but I think they added that to BPs.

crystal leaf
#

Not seeing a Server Travel Either

winged badger
#

its an ExecuteConsoleCommand node

#

for server travel

#

and doing networking in c++ vs. BP is more different then just exposing a few functions

#

some things (like OnRep/RepNotify) doesn't behave the same in c++ and in BP

#

in BP its not a replication, but a property setter callback

crystal leaf
#

ooo

winged badger
#

also, because of limitations of what you can do with structs in BP, using custom serialization is impossible as far as i know

crystal leaf
#

if I learned a tad bit of cpp and made a couple custom nodes it might be easiest then

winged badger
#

i find BP network code difficult to follow, its just too bulky

#

its fine for something small, but when you have to network 20 functions... ouch

crystal leaf
#

it's the easiest way I find to follow the game code though, I would learn cpp if there was a handy way to understand and follow all the different shortcuts (I forget the technical name for them) but there isn't one that I have found.

#

My thing is something small, I just don't have a ton of understanding.

#

It's nothing like a 16+ person FPS, it's a little four person turn based thing

winged badger
#

the most annoying thing so with BP replication for me, is if you have a RepNotify variable, and you set it locally on client, OnRep will execute

crystal leaf
#

Already beyond me,

#

Haven't even gotten the clients to connect.

crystal leaf
#

How can I test that btw?

#

Everytime I open it up they automatically connect.

And if not, how do I get the IP it's opened on so I can input it to connect to?

thin stratus
#

There is a boolean in the play advanced settings that you can toggle off

#

Then they don't connect by default

#

@crystal leaf

#

If you test in editor, then the IP is 127.0.0.1

#

So localhost

crystal leaf
#

I'll look for it

#

I've been trying localhost this whole time, I assume that their auto-connection is stopping it from triggering

#

ty

#

p sure their still-automatically connecting.

#

This is still triggering twice on start

thin stratus
#

That will trigger twice anyway

#

Cause each instace, even if not connected, is on that map

#

The difference is what is printed in front of it

#

If it prints "Server..." and "Client..."

#

Then they are connected

#

@crystal leaf

crystal leaf
#

hmm. mmmk

crystal leaf
#

This should be fine and work exactly as the normal console command would yes?

thin stratus
#

Yop

crystal leaf
#

So I click Host

#

And they both give me the same message,

#

There is no Server: Successs... or Client: Success... Ect

#

Any idea?

thin stratus
#
  1. They are both Standalones, so not connected at the Start. You can see that on their window title bars.
  2. The Print Message showing up on both is just the Editor working in a Single Instance/Core. This won't happen if you Rightlick the UPROJECT file and hit "Launch Game" twice.
#

If that print message means that you create a session, then I don't see what the issue is?

#

Creating a Session is just information about the Server/Client. After you created the Session, you need to open the Map with ?listen option

#

And then afterwards search for sessions on the player that should connect

mellow cipher
#

When you join a server it automatically adds your name as an option to the end eg NewMap?Name=DESKTOP-GQIB0VT

Is there a way to override what the Name = on connect?

#

Trying to set it myself doesn't seem to work

thin stratus
#

In Blueprints, don't think so

#

Are you joining a Server with the JoinSession Node?

#

@mellow cipher

mellow cipher
#

Nope just the open command

#

I could use another option afterwards but since the gamemode is already passing the Name to SetPlayerName() I would rather just take over that

shut surge
#

what's better writing replication - blueprints or c++ ?

ivory portal
#

What happened to ReadyToStartMatch in GameMode?

thin stratus
#

Should still be there

#

Make sure you have a GameMode child

#

Not GameModeBase child

#

@ivory portal

ivory portal
#

oh thanks

#

Was indeed using Base

thin stratus
#

Make sure to also use GameState instead of GameStateBase then

#

Otherwise it won't work

#

@ivory portal

mellow cipher
#

If anyone knows how to override the name parameter on connect I will love you forever

ivory portal
#

Yeah thanks!

#

Does beginplay wait for start match on all objects or only on player objects?

#

At the moment my tests say after start match

#

but I'm always reluctant because of the speed of localhost

#

ah no, just tested it without single process. It seems that beginplay on server-owned objects already does beginplay

thin stratus
#

Most likely already does beginplay yeah

twin minnow
#

does gamemode->getnumplayers and getnumspectators update on its own?

sterile crown
#

Can someone give me a rundown on the current status of World Origin Shifting for MP? It is required when using World Composition correct? Is it just a few simple checkboxes in the engine? Does it require a dedicated server?

thin stratus
#

Doubt it requires a DediServer

#

However I only used it in SP games

winged badger
#

@twin minnow it will give the correct number when executed, however the pin from blueprint exec functions changes only when an exec wire runs exec through it

#

Its like that for all non pure BP functions (pure ones are evaluated whenever exec runs through anything they are connected to)

tribal solstice
#

I'd like to store player info in an online database and GET and POST to it using the VaREST plugin. Can anyone recommend a solid database with web app interface solution that is free/cheap?

#

Or steer me in the right direction if there is a better solution?

thin stratus
#

It's actually quite easy to write your own NodeJS app with a MongoDB in teh background

#

You can then host that for like 5€ a month on a DigitalOcean droplet

#

@tribal solstice

#

That NodeJS app will listen for GET and POST requests

#

and modify the mongodb

#

There are probably youtube tutorials that get you fully started

tribal solstice
#

@thin stratus Perfect! Thank you so much. Also thanks a million for your network compendium. I'm trying to reverse engineer my game after following the 'Blueprint Multiplayer' tutorials from Epic using your guide.

thin stratus
#

Ah the BLueprint Multiplayer tutorial

tribal solstice
#

Infamous

thin stratus
#

Yeah sorry that still exists

#

A few years back and Epic would've actually cared :P

tribal solstice
#

It's okay, at least it got me up and running for the most part. Thankfully you wrote your guide.

#

Actually, while you're here, I'd like to ask: I have a very simple online game that's text-based (think MUDs) so all I really need is player names and their text in 'chat rooms'. Where's the best place to store and retrieve player names and all that? GameState?

#

Cause as of now there's a lot of logic happening in the PlayerController (from tutorial) but from what I understand from your guide that's bad practice

thin stratus
#

PlayerNames are saved on their PlayerStates

#

So each PlayerState has a "GetPlayerName" function

#

To get your hands on all of them at once, you can use the PlayerArray of the GameState

#
  • Information about a specific Player that everyone should be able to access -> PlayerState
  • Information about the match that everyone should be able to access -> GameState
  • Information and Logic about the match that is supposed to stay on the Server only -> GameMode
  • Information and Logic about a specific Player that only the Player and the Server should care about -> PlayerController
  • Information and Logic about a specific Character/Pawn -> Character/Pawn
  • UI stuff -> PlayerController/HUD/LocalPlayer(not exposed to Blueprints)
#

@tribal solstice

tribal solstice
#

Thanks so much, man!

tribal solstice
#

Do I need to create a PlayerState blueprint or can I just pull info from the automatically generated one?

thin stratus
#

If you don't need additional info per player

#

Then you can use the default one

tribal solstice
#

And I just do that with a cast to it and store a reference?

thin stratus
#

The Default PlayerState is already a PlayerState

#

I mean there is no need to cast

#

cause that's already teh class :D

tribal solstice
#

So if I wanted to grab a player's name to display in a chat room, which blueprint would I request the name in and using which node?

#

I guess my question is if not using casting, how else do you get the reference of the Player Name from the Player State?

#

The tutorial had us make a struc and store player name in there, which seems to make no sense at all.

#

Ah... can't change PlayerState PlayerName in blueprints?

thin stratus
#

Yeah you can but really annoying to do so

#

The GameModeBase (and so also the GameMode, depending on what you inherit from) has a "ChangeName" function

#

You pass the PlayerController of the player which name you want to change

#

Well it depends on how you grab the reference to a PlayerState

#

Let's make a very easy example

#

You want a Widget that shows all playerNames in a List

#

So you would go into your Widget, add VerticleBox

#

And then in your code "GetGameState->GetPlayerArray"

#

Then "ForEach" on the PlayerArray

#

On each of the Loops you call "GetPlayerName" on the element and use that to add a new custom TextWidget (that one you gotta create too) to the VBox

#

You can also access teh PlayerState via Pawn, Character and PlayerController

#

@tribal solstice

twin minnow
#

@winged badger what is an exec wire exactly?

thin stratus
#

I assume they mean the White Wire that comes from Nodes with White pins

#

That's the Execution Wire that defines what gets executed in which order

#

From left to right

twin minnow
#

Hmmm

#

Because right now im trying to bind a function that calls getnumplayers in widget

tribal solstice
#

@thin stratus I see, thank you. So I have a dropdown box in a widget where players can choose a chat name, and I have this logic in there:

#

Does that look about right?

thin stratus
#

Kinda, keep in mind that Clients don't have access to the GameMode

#

They need to RPC first

tribal solstice
#

Ah okay. So in the widget you'd select a name, and then that would call a RPC event to the server to change within the Game Mode?

#

I'm still getting the hang of what an RPC is. That tutorial really has confused me more than it was worth I guess.

#

Is that closer?

thin stratus
#

Closer but wrong

#

Widgets have nothing todo with multiplayer

#

They aren't replicated

#

Neither should they be

#

So they also can't execute an RPC

#

Cause there is no SErver version of this widget

#

You have to call the RPC on a Client Owned Actor

#

e.g. PlayerController, PlayerState, Character, Pawn

tribal solstice
#

I see, that makes sense. So 'On Selection Change' node would cast to PlayerController of owner and do an RPC to the server GameMode to change the name?

thin stratus
#

Yeah the RPC needs to be in the PlayerController

twin minnow
#

@thin stratus im currently using an rpc to use the gamemode functions but do i have to manually update the player and spectator counts or do they automatically adjust when a player state's spectator flag is changed?

thin stratus
#

I usually have a Function that returns the count

#

On the GameState

#

That just goes over the players and counts them based on their state

#

The issue of updating then resolves itself

twin minnow
#

oh i see

#

very nice thank u

thin stratus
#

Yus

tribal solstice
#

So I have this logic in my widget:

#

And this in my PlayerController:

#

Am I getting warmer?

thin stratus
#

Yop, perfect

tribal solstice
#

Awesome!

thin stratus
#

Plus points on using GetOwningPlayer :P

#

Just make sure you actually add the Owning player when creating the widget hehe

tribal solstice
#

Thanks, man! Really appreciate all your help!

#

What do you mean by add the owning player when creating the widget?

#

Oh I think I understand

thin stratus
#

Define, Pass, etc.

#

I can't English anymore

tribal solstice
#

Like this? This is how I create the widget, which is nestled in another widget

thin stratus
#

Yeah

#

Ultimately you need the first widget taht got created to have the PlayerController beind passed

#

Which is why you most of the time place your UI code into the PlayerController

#

Or LocalPlayer if you have access to C++

tribal solstice
#

Hmm, not quite following

thin stratus
#

This is how I create the widget, which is nestled in another widget

#

That's fine

#

But the "other widget" also has to get the "OwningPlayer" set

tribal solstice
#

So this is kind of confusing, but the first widget is a simulated OS environment. Then you double click an icon which opens the 'online' widget and chat room. The player is logged in to the server at this point

#

but is offline while using the OS widget, if that makes any sense

thin stratus
#

The thing is

#

Somewhere you are calling CreateWidget

tribal solstice
#

Right

thin stratus
#

NOT from inside another Widget

#

Somewhere the first widget, the outer most has to be created and added to the viewport

#

And that one has to have OwningPlayer beind passed too

tribal solstice
#

So this is the highest level in my level blueprint

thin stratus
#

Yus, there it's missing

tribal solstice
#

Copy that

thin stratus
#

Either you call "GetPlayerController0"

#

And pass that

#

Or you move that stuff into the PlayerController to begin with

tribal solstice
#

so even if the player is 'offline' for that widget creation it must have a 'Get Owning Player'

thin stratus
#

That stuff shouldn'T really be in the level

#

Otherwise you always have to copy that into the next level again

#

You don't have to

#

But it's good practice

tribal solstice
#

Ah okay. So all widget creation should be within the PlayerController?

#

Makes a lot of sense

thin stratus
#

You can argue if PlayerController, HUD Class or whatever

#

But it's def not wrong to put it into the Controller

#

E.g. On Begin Play, call a function "SetupUI"

tribal solstice
#

Okay great, and then it persists across Open Levels is what you're saying?

thin stratus
#

Just make sure you do a "IsLocalPlayerController"+Branch

inland pond
#

Having it inside the gameinstance is also okay?

thin stratus
#

Cause otherwise the Server Version of this will add a widget too

tribal solstice
#

I see

thin stratus
#

@inland pond Depends on why it's in there

tribal solstice
#

Thanks eXi

thin stratus
#

Widgets don't survive level changes

#

So it would be cleared anyway

#

even if it's in the GI

#

So I would argue it should be in the PC

inland pond
#

Ahh okay thx ^^

thin stratus
#

Or at least not in the GI

tribal solstice
#

Got it

#

So when creating widgets in the PlayerController, do you need to specify 'Get Owning Player' as well?

#

or 'Self'?

rotund sapphire
#

i pass in self since 4.20 without that i got way too many ensures/errors in pie

#

in PC you have no owning player btw

tribal solstice
#

do you do a 'IsLocalPlayerController' branch?

#

Copy that, thanks Robert

rotund sapphire
#

player controllers exists both on client and server, so yeah you are better to be check the script runs on client side only

tribal solstice
#

copy that, thank you very much

tribal solstice
#

Should my 'Create Session' and "Find' and 'Join Session' logic all be in the PlayerController as well?

#

Tutorial series told us to put that in the 'Server Selection' widget, but now with eXi's help I understand that it may not be correct to put logic like this in the widgets

true dagger
#

@balmy canopy meet @limber plaza

#

I "helped" (not really) @limber plaza get his UE4 Steam multiplayer thing going in Docker.

#

I know he's done some network coding and can probably help you get a grip on what you need to do.

#

@limber plaza thanks for helping out mate appreciate it

limber plaza
#

Wave What up Phisix.

#

NP! Yea Phisix feel free to message me about what you're trying to do. Sooner is better than later (got a business trip starting nex fri to the 18th so afk)

true dagger
#

@limber plaza I've told @balmy canopy you're happy to write all his networking code for him, for free, for the life of his game. Enjoy.

#

;)

limber plaza
#

Ha

#

Har d har har.

balmy canopy
#

Hahaha. @true dagger thanks. @limber plaza Hi. I'm just redoing my test project to see if I can get it working but I highly dought I will but let me just see before I bother you. Can I juat add you so I can find you easier when I need to?

limber plaza
#

absolutely!

balmy canopy
#

@limber plaza Thanks

limber plaza
#

GL ! πŸ‘

true dagger
#

Awesome. Good luck @balmy canopy

balmy canopy
#

Thank you.

twin minnow
#

has anyone tried getting gamestate before?

#

it's returning null for me even tho im doing this in a server rpc

#

hi @winged badger i hope im not bothering you, but have u experienced this kind of issue before?

winged badger
#

how are you getting it?