#multiplayer
1 messages Β· Page 445 of 1
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.
π
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
im setting in begin event in my pla
my player state
so i should have server event
to set nickname
?
Just do a switch has authority after begin play, and set the nickname from the authority branch
And make sure the nickname is replicated
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
cool thnx
anyway to change port numbers for a listen server?
Im using blueprints execute console or open level options listen
Is this reacting correclty - NonSeamless gamemodes in a dedicated server - when you use OpenLevel() - the client actually disconnects from the dedicated server?
and reconnects
reconnect definitely isnt happening
my player array goes from 2 - to 1 when this happens
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."
maybe thats the problem
i was using OpenLevel on the local player
so the server has to roll EVERYONE over to a new map?
execute console
roger that
i thought OpenLevel was the BP function for this
which is why i was using it
Server travel didnt worked for me after the session is created
ah no, you can do execute console with "servertravel newmap"
only the server should execute this
clients will normally automaticly follow
Oh
don't forget to create an empty level for your transition map
Don't forget to enable seamless travel in your gamemode
I did
Are there command line arguments for starting a dedicated server with a different map?
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....
Im totally new to multiplayer
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
@ruby furnace - you owuld append ?Map=NAME to the options: https://puu.sh/CT2Ls/bc3b30b0c7.png
Stormwind to ironforge exist on one map. Stormwind to orgrimmar are different maps
sorry thats wrong
uhm I mean when you start the server from you command line
it would be ?Map=NAME to the end of "open ipaddress" In https://puu.sh/CT2MM/21f77a4d97.png
so like: "open 127.0.0.1?Map=YourMap"
because this doesn;t work either:
https://docs.unrealengine.com/en-US/Programming/Basics/CommandLineArguments
yeah I know, well do just that I guess
You have a Server Map in project settings
@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
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
I cannot make the servertravel to work once the seesion has alredy been created
Whats the error?
It doesnt load it
In Root/Maps
and they are packaged?
PIE testing - or standalone?
In what sense
Ignore my comment
This event is fired when all the players are ready
again - as tom said you dont exceuteall -> ServerTravel
run it on the server - the rest of the connected clients will follow
how do i do that im new to multiplayer i
you have code that depicts "when all players are ready" right?
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.
That event is firend on the lobby map, when a player joins the lobby, he can press join and that event is fired
that's the issue, it is not
just do it in the player controller you use for that level instead of using the level event
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?
I don't know if it is expected, it's just an idea for a workaround so you can go on
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
I think i fixed it
I do not use GameMode states (ready to play, etc), is that needed?
not really
right
I think most people just use the game mode base
@naive shell Execute the command only on server and remove that player controller on it
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
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
It did work now i gotta remove the lobby ui for al ll players
Sorry to bug again, but who here does know when BeginPlay events in the level are supposed to get called?
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.
How to fix pawn is duplicate when more than 2 players spawn? In Dedicate Server
lol
How do I connect just by typing 127.0.0.1 without using "open" in my text box?
For a client to travel to a server, ClientTravel().
@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.
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?
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?
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)
What is the default pawn in game mode?
Ended up figuring it out. Forgot Super:: when I override PostLogin
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.
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.
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 Okay, thanks. I'll check regions.
How do I ensure we're in the same region? We live in the same city.
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.
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
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
@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.
So apparently GAS has a different way of checking locallity which is what I was fucking up
Ah well that system..
I've written down the issue that I was explaining here yesterday. It's in https://answers.unrealengine.com/questions/878536/level-does-not-load-on-client-after-joining-a-serv.html
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)
@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
@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
Can you recreate the issue in a fresh project?
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)"? π
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.
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.
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
i was passing controller player in apply damage, now i think that maybe i should pass get instigator controller?
is that correct?
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.
let me try with instigatorcntroll.
@thin stratus it works now
my mistake was with playerController()
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
There are diagrams in my compendium
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?
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.
I'm guessing the role is set when you disable rep ?
It's useful if you want to do something client side for a minute, then tell the server
thanks, i think i get it!
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)
and which actor in this example would have role set to None?
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)
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
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
do ALL actors in multiplay game have to have role? even static light pole?
Role is managed automatically - you shouldn't ever have to touch it
If you do, expect things to break
Right! I set replication rule. Engine will handle roles
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
if someone gets desynced they're just thrown out, right?
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
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
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
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
Yeah but if they've opened the door already on the client, they won't get a rep
but if youre opening locally, whos gonna make the server open it, unless youre opening beforehand as a prediction
You don't have to set the RepNotify boolean on the Client
Just use a local indicator for door open or not
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
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
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
In the example case aswell, the door costs something to open, so you should do request via server anyway, shouldnt you ?
Snap backs will always happen
IMO yeah
You def need to ask the server
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
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
I'm with eXi. Smoother experience. Although implementation might be complicated
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
seems like most games do some re-join event
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
This is a lot of effort for something as simple as a door π
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.
That is true, but the client is always sending updates and the server is always checking the state in that case
I haven't seen a UE4 Game desync yet though
And the server does no simulation until the client tells it to, so it's kind of taken care of through the implementation
Most of the times, desyncing was encountered in Multiplayer Mods
Not counting forcing a desync by cheating money and openeing the door locally
True that, i've only had issues connecting in the first place now that you mention it
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
half way through the door, it slams back in your face. prediction was wrong
TheJamsh, how you'd implement shooting?
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
hitscans feel unfair tho, but im not sure how much you'd notice it
most players never notice tbh, and it gets hidden with FX and the like
"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
When you start moving away from arena shooters and tackling larger engagement ranges though, then it's more noticeable
yeah
if you're in the crosshair, you ain't dodging it
lag compensation is the big thing, but few games bother with it. Or if they do it's very much favour the shooter
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
sucks when you run behind the concrete wall , but get hit cuz lag compensation
Golden Rule: if(bIsPlayerBehindWall) bIsDead = true;
haha
Otherwise you fail the proper implementation of HitScan
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
UT went with 120ms which IMO is quite high
UT...
120ms lag compensation ?
I have it open on my right screen. They have two implementations of Stats
Where none of the two is fully used.
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
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
Hm, maybe the AUTGameMode* UTGM = Cast<AUTGameMode>(UGameplayStatics::GetGameState(GetWorld()); is in there
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
haha
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
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
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
@chrome bay https://www.youtube.com/watch?v=W3aieHjyNvw
In this 2017 GDC session, Blizzard's Timothy Ford explains how Overwatch uses the Entity Component System (ECS) architecture to create a rich variety of laye...
Thoguth you'd like having a look at that
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
man how i hate official ue4 video tutorials.. too much patronising. just get to the fucking point
and apparently they are buggy π
That is my post, yes.
you get karma points for that post
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.
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
Yeah I think it does
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?
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
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
If you need Multiplayer, then yes
Otherwise you'll basically code your project twice
How is it tested? Im a bit of a hardware guy, is the only testing be done locally?
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
Yeeahhh... My issue with my players appearing as Spectator pawns and not their properly pawn is back...
@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.
I was thinking of peer to peer multiplayer, is that do able in UE?
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
Does UE's documentation have more info on that @gleaming vector ?
@gleaming vector haha no worries ill try to research it. Not like its for money anyways, just a student project
Yeah ill read up those in the documentation. Im just working for squares and circles anyways
Yessss i will
also, maybe one last question, does it all work with blueprints or will i have to dive into C++ code?
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.
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
Thanks guys, i do not, coming from unity i know a bit of C# but am not the great.
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?
how are you trying to connect @tribal solstice ? (what's the exact syntax you're using?)
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
@gloomy flint Let me know if you need more info. Thank you!
Ah, I'm not sure I can help you with this π¦ Hopefully someone else will catch the error
@gloomy flint No worries, thanks for taking a look!
What's the best way to replicate a really large string? Like a string the size of a web page source.
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
Because things like ads and randomized things won't be consistant
No
hm
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
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
you can try that but you are doing a lot of replication you dont need to do
and you will lag your server down
How do you recomend replicating a web browser than
In a way that is consisistant across clients?
I dont think you can
at least not perfectly
or, take a screenshot and send the image
but you wont get video
That would be laggier
indeed
Having the client run the rendering engine is a must
yes
and by nature of rendering the page on each client prevents you from syncing the the page perfectly
Of course
unless you have full perfect control over the page
But stuff like "I got this ad" should be synced
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
Hmm
i wonder if I ran all javascript on the server, than propogated document changes to the client, it would work
But how do I replicate a really long string (the html)?
STUTTERING IS PRABABLY THE BIGGEST PROBLEM
oops
do not recommend html5 uis though
you can load large html5 files trivially locally
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?
@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).
how to replicate name's player to text render on head pawn?
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
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!
@fluid flower Looking for the same thing myself. Have you found the Dedicated Server wiki (https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)) ?
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
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?
I haven't gotten Steam working with dedicated yet, but I'm working on it so I'll update you when I get somewhere
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)
if i don't respond on this server message me directly
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?
@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.
i remember seeing a article about that on the forums and how to use it
(replay system)
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 π¦
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?
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
Alright, thanks.
@thin stratus
- 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
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
Gamesparks is not looking so good in pricing for me π€
I've heard and looked into playfab but their pricing seems to be about the same
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
Heroic Labs builds Nakama - an open-source social and realtime server for games and apps. It includes a large set of services for users, data storage, and realtime client/server communication; as well as specialized APIs like realtime multiplayer, groups/guilds, and chat.
We stick with PlayFab now
I need to to work atm, not to be customizable
But that's just a per project argument
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
for the long term big project tho its a good idea, but for small projects, i wouldnt recommend it exi is right about that
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.
i assumed that the scaling servers would remedy that
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
The scaling servers are the expensive thing
listen serves wouldn't work i have a feeling as it might allow the host to cheat
@spare glade
- Backends aren't UE4 specific
- 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
What kind of Game were you looking at making for the backend @flint plover
Specially since I can guarantee you that you won't get hundret thousand players into your game, specially if it's paid.
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
it was a free game, but i figured that ad mob might cover server costs
Rip gamesparks, wouldve been perfect for ya
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
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
let me see if i can find my screen capture and ill show u a video from a few months ago
oooo yes plz π
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'
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 π
i wanted to take it in a new direction
you got the right idea of it tho just gotta take it far enough
There is a Tetris Battle Royal. So why not a space 2D MOBA
old scool top down arcade/moba
mix & match games
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?
i mean name a scenario of where they would cheat
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
ok ill throw out a few, and tell you why they couldnt and how you would stop it
k
thats what i thought
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
so they have axcess to the api codes too?
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
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
Otherwise you can just stop caring about competetive at all
@spare glade That all stops if you let players host locally.
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
yeah. idk i guess it's going on a shelf as sad as it is, cant afford servers myself, i barely make rent DX
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
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
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
true
https://sellfy.com/p/fc9C/ There is a kit for it but pricey
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
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
https://www.youtube.com/channel/UCRQowuKOwqeKiva-UZkpzzg
I think beefalo got some back when, whenever we were talking
@thin stratus Yeah I feel that response a lot, exactly my feelings, unfortunate
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)
@smoky ore You receive sessions but they should be filtered
So they won't appear in your serverlist
I don't have a server list available, it'll just try to join the first available session.
Same thing
@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
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
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.
@thin stratus right, but it'd be cheaper like that regardless of who i use though right?
@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
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)
just have players host listen servers, free multiplayer achieved
there's no need for all this cloud stuff outside of official competitive things
and the user's network setup
nat punchthrough needs a cloud service
or at least a remote service
a very simple one compared to actually hosting the servers though
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
Its probably being Destroyed before it gets the call.
huh
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
yep looks like thats exactly the issue
You should have a Manager class that handles Spawning instead of trying to get the Object itself to do it
Gotcha ok. Thank you
can you not load a stream level with a listen option on 'Create Session'?
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
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.
The PlayerController here should just be GetPlayerController as it is denoting the client that should be the server, correct?
@dark edge Ah ha makes sense. Thank you! π
@crystal leaf what are you asking?
What exactly the node Player Controller is asking for, and what it means.,
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.
π
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?
You using steam?
No,
2 standalones should do it
I tried to open a second one and it just closed the first,
is there an option I've missed?
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
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
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
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?
Yeah they're just 2 instances of the game
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
@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?
In base of you want to do
I mean
if you want a steam integration
AdvancedSession it's quicker and easier with BP
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.
Yes, you're doing Listen Server
^
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
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
Don't worry! If i can suggest you something, try to look up on youtube, there are different tutorials, even without the steam integration π
been looking at a few, atm the http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf has been very helpful
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
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.
yes
How do I check the applicable ip to connect to within my machine or should i use 127.0.0.1?
I thought "Execute Console Commands" nodes don't work in Shipping.
Then that would be a serious flaw.
You can use ClientTravel if you want to connect to a server.
I'm not sure if it's exposed to BP, but it's this: https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/APlayerController/ClientTravel/index.html
Travel to a different map or IP address.
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?
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.
Not seeing a Server Travel Either
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
ooo
also, because of limitations of what you can do with structs in BP, using custom serialization is impossible as far as i know
if I learned a tad bit of cpp and made a couple custom nodes it might be easiest then
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
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
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
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?
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
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
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
hmm. mmmk
Yop
So I click Host
And they both give me the same message,
There is no Server: Successs... or Client: Success... Ect
Any idea?
- They are both Standalones, so not connected at the Start. You can see that on their window title bars.
- 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
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
In Blueprints, don't think so
Are you joining a Server with the JoinSession Node?
@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
what's better writing replication - blueprints or c++ ?
What happened to ReadyToStartMatch in GameMode?
Should still be there
Make sure you have a GameMode child
Not GameModeBase child
@ivory portal
Make sure to also use GameState instead of GameStateBase then
Otherwise it won't work
@ivory portal
If anyone knows how to override the name parameter on connect I will love you forever
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
Most likely already does beginplay yeah
does gamemode->getnumplayers and getnumspectators update on its own?
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?
@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)
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?
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
@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.
Ah the BLueprint Multiplayer tutorial
Infamous
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
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
Thanks so much, man!
Do I need to create a PlayerState blueprint or can I just pull info from the automatically generated one?
And I just do that with a cast to it and store a reference?
The Default PlayerState is already a PlayerState
I mean there is no need to cast
cause that's already teh class :D
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?
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
@winged badger what is an exec wire exactly?
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
Hmmm
Because right now im trying to bind a function that calls getnumplayers in widget
@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?
Kinda, keep in mind that Clients don't have access to the GameMode
They need to RPC first
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?
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
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?
Yeah the RPC needs to be in the PlayerController
@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?
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
Yus
So I have this logic in my widget:
And this in my PlayerController:
Am I getting warmer?
Yop, perfect
Awesome!
Plus points on using GetOwningPlayer :P
Just make sure you actually add the Owning player when creating the widget hehe
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
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++
Hmm, not quite following
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
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
Right
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
Yus, there it's missing
Copy that
Either you call "GetPlayerController0"
And pass that
Or you move that stuff into the PlayerController to begin with
so even if the player is 'offline' for that widget creation it must have a 'Get Owning Player'
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
Ah okay. So all widget creation should be within the PlayerController?
Makes a lot of sense
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"
Okay great, and then it persists across Open Levels is what you're saying?
Just make sure you do a "IsLocalPlayerController"+Branch
Having it inside the gameinstance is also okay?
Cause otherwise the Server Version of this will add a widget too
I see
@inland pond Depends on why it's in there
Thanks eXi
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
Ahh okay thx ^^
Or at least not in the GI
Got it
So when creating widgets in the PlayerController, do you need to specify 'Get Owning Player' as well?
or 'Self'?
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
player controllers exists both on client and server, so yeah you are better to be check the script runs on client side only
copy that, thank you very much
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
@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
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)
@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.
;)
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?
absolutely!
@limber plaza Thanks
GL ! π
Awesome. Good luck @balmy canopy
Thank you.
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?
how are you getting it?
