#multiplayer
1 messages ยท Page 402 of 1
I was just wondering if you need to change blueprint code
If it works on a listen server will it work on a dedicated server?
@summer nova Still, $10 for that particular course is probably some of the best spent money I ever saw
true
Because I found that some collision box's dident seem to want to trigger
they have some actually good courses
to make people think the website is legit
dont waste your time outside of the actually good "flagship" courses. The rest have a huge chance of being youtube level trash
But I was using it in editior with the "run dedicated server" box checked
And I had the steam plugin
in editor
does that break it?
@mint zephyr (that the right tom ?) I simply can't answer that question because it depends on your game. Really. It depends on how you built your networking. If it assumes that the server is a player, then it won't work.
I'd say mostly it's harder to go from dedicated to listen than the opposite
But nothing in multiplayer ever works seamlessly with just a different option
Right tom yes
Dedicated is supposedly just a minimal version of listen, so most of the transition should work fine
@bitter oriole i was hoping to find any info just on google.. im amazed why there's like no good reference on replicating vehicles
Hmmm, I undestand that thier minimal versions but does that mean that the server does not run the level blueprint information ?
As I have some information stored in their
@gusty raptor The knowledge & skill required for creating smooth vehicle movement does not come free. Well it does - you can find research papers on rollback & replay and go from there
The reason I recommend that course is, I've rarely seen this level of quality in a tutorial from this level of knowledge
That kind of topic is usually taught only in source code dumps and research papers
I'd recommend that course for $100
It's at $10 most of the time so just get it if you want vehicle replication
@mint zephyr The server runs everything
It runs the entire level with code, Blueprint, geometry, textures
It doesn't render the 3D scene but creates and maintain it accurately including physics
Now again, just switching to an entirely different networking infrastructure is never just a checkbox, so you'll need to look back on what doesn't work and fix the issues - which will probably be issues where you assumed there was a local player to do the job
to understand why this thing is hard
you know Rocket League?
the absolute madmen ignored unreal engine physics library
used Bullet (open source)
made sure that it simulates at 120 fps allways
even if the game renders at 30, it still calculates physics at 120
and then, they also made sure that bullet does the exact same physics simulation on every platform
that way, they could syncronize the cars
basically, by uploading "car X is at this position, with this rotation, and this physics properties for inertia and speed", and it would sync properly on all players
and it still desyncs a bit becouse internet is just shit
@summer nova i think the server then calculates physics, clients not?
ive been investigating it and think, maybe the server should run physics and clients just inherit the result..
however i cant find out if its possible to do that ^
That would make the game looks like its running at 10fps, definitely both should simulate physics, and the server result is used if the client is different
@gusty raptor its both
predicition is the key
prediction*
let the client predict the result, the server verify the result. always trust the server
@gusty raptor For any game that has action, you want server and clients to simulate everything
I have 2 cameras in my characters. When I need to swap between them (Third person mode and Scope/zoom mode) I disable one and enable the other. That does work in local but inmultiplayer only the client+server (not dedicated) works fine. Any ideas?
The other clients simply don't change camera.
hello, I'm having a big problem with UE Networking
I'm trying to allow players to play in a WaitingToStart MatchState, but if I'm in a listen server, host functions are not called (for example Event Blueprint Update Animation or BeginPlay or Tick), what can I do?
these functions are only called on remote clients, but not on the server
@thin stratus nope, it's done on client.
But I just discovered that for some reason it cannot get the character from the player controller. It's not valid.
On BeginPlay?
Hehe
If so use Possessed event, its never ready on BeginPlay
@deep island you should start reading source code in AGameMode and AGameState specifically related to MatchState
already done
maybe I have to call NotifyBeginPlay
in HandleMatchIsWaitingToStart
I'm doing that now, if it works I'll be happy
yep, it is "on Begin Play" ๐ I understand that this was a wellknown problem. So I have to do this on Possessed.. but I cannot find that in my PC.
I'm confused. My Server has trouble updating UI when going back to Lobby with SeamlessTravel.
LogWorld: ----SeamlessTravel finished in 0.03 seconds ------
// SERVER
LogGameMode: >> GameMode::HandleSeamlessTravelPlayer: BP_PC_Base_C_0
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogGameMode: << GameMode::HandleSeamlessTravelPlayer: BP_PC_Lobby_C_0
// UI VALID?
LogBlueprintUserMessages: [WB_PlayerList] ### UI PlayerArray ###
LogBlueprintUserMessages: [WB_PlayerList] BP_PS_Lobby
LogBlueprintUserMessages: [WB_PlayerList] ### UI PlayerArray ###
// CLIENT
LogGameMode: >> GameMode::HandleSeamlessTravelPlayer: BP_PC_Base_C_1
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby1
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
// WHAT NOW!?
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### HUD INVALID WHYYYYY ###
LogGameMode: << GameMode::HandleSeamlessTravelPlayer: BP_PC_Lobby_C_1
the ### UI PlayerArray ### calls in the UI when it's refreshed. Prints the same array again.
And the ### OnRep PlayerArray ### prints in the OnRep, before accessing the UI to refresh it
The UI is created in the HUDs BeginPlay
So how can it refresh (even if it's doing that through Construct), but the HUD isn't valid
And that's only on the Server
-.- I dislike SeamlessTravel
I mean, HUD/UI wants replicated Array. And OnRep wants HUD/UI.
Even if the HUD isn't valid in the OnRep, timewise the HUD should grab the replicated array when it's created.
Only on server?
You could try to Copy the HUD in OnSwapPlayerControllers, but that is just a wild guess
Otherwise takes a while for it to instantiate
LogWorld: ----SeamlessTravel finished in 0.04 seconds ------
LogGameMode: >> GameMode::HandleSeamlessTravelPlayer: BP_PC_Base_C_0
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### HUD VALID WHYYYYYBP_HUD_TDM | BP_PC_Base ###
LogGameMode: << GameMode::HandleSeamlessTravelPlayer: BP_PC_Lobby_C_0
LogBlueprintUserMessages: [WB_PlayerList] ### UI PlayerArray ###
LogBlueprintUserMessages: [WB_PlayerList] BP_PS_Lobby
LogBlueprintUserMessages: [WB_PlayerList] ### UI PlayerArray ###
LogGameMode: >> GameMode::HandleSeamlessTravelPlayer: BP_PC_Base_C_1
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] BP_PS_Lobby1
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### OnRep PlayerArray ###
LogBlueprintUserMessages: [BP_GS_Lobby_C_0] ### HUD INVALID WHYYYYY BP_PC_Base1 ###
LogGameMode: << GameMode::HandleSeamlessTravelPlayer: BP_PC_Lobby_C_1
So
I printed the Controller to it and the HUD
Now I am at a loss
I guess I can't access the PC in the SwapPC function
Cause it gives me the old one
Even after the Server already traveld
And why is that printing Base1
-.-
rom experience, takes sometimes over half a second for PC to instantiate HUD and apS for the first time
And PS*
It is an actor, can you flag it 5o persist across travel?
The problem I see is, that "GetPlayerController0" is returning the wrong PC
So it persists*
Don't like typing on mobile
That's also not the issue. I have two HUDs and two PCs.
Both Base and Lobby
Lobby is a child of Base
When going from Gameplay level (Base) back to Lobby, it returns the wrong PC
You can even see that it returns the old HUD with it
And I understand that
Cause at that point, the Server hasn't finished his seamless Travel yet
But why the hell, do I still get the BASE PC, in the SeamlessTravel of the Client
:/
You tried forcing the isseu with console command GameMode arguments?
Yeah, it's forcing the GameMode change
If I loop the list update it also updates
But who wants to hack that
Well at least I know the issue now
Hi, does anyone know a good tutorial for multiplayer over LAN using c++, for UE 4.19? please
Uff
So I need an Event, that I can use to update my CustomPlayerArray, and it needs to happen after everyone has their HUD.
Does BeginPlay of the PlayerState not call when using ST (SeamlessTravel)?
Not sure
Still confused that, after the ST of the Server is done, the one for the Client still gives the Server the old PC (HUD destroyed by then thouhg
Weird.
You could have HUD access the PS and set bHUDReady
Re
Replicate that, and server side OnRep check if everyone is ready
It IS ugly, but it should work
Or just set it serverside and have the steer trigger the check in GS
Still ugly, but little less spo
Steer=setter^
Guys i have a replicated Array with a length of 10
If i set the value of a index as server it will change on server but not replicated to clients
How do i fix it and whats the problem ?
@next falcon where are you storing the array?
in a replicated component.
yes bp
which blueprint?
what do you mean ?
in a component on a character
are the character, the component and the variable all set to replicate?
yes
you may have to run on server, then run a multicast, passing the new variable through each event
mhpf
at some point you'll want to throw another filter or two on there to prevent little yellow errors
warnings*
like switch has authority, or is locally controlled
okay ill do that
or to get the exact behavior you want
but to just get everyone to have the variable, server RPC then multicast RPC, passing thru the variable with the events
on some actors you can just run on server, but it doesn't always work for everything
Can anyone help me with my own problem? I managed to get the "only the server sees the Quest Icon" problem I had yesterday, basically I made the quest icons NOT replicated and run the spawn event on client, so each client has their own version of the Quest Icon for each character
anyway it works perfect on overlap and end overlap with the Quest Icon actor
I fixed it by running an event on the interacting player pawn itself, to shut off its copy of the icon
anyway, that works, but once interacting with the icon, I load um a widget, you know ,for quest stuff
so once I complete the quest itself, I can make it so the icon no longer lights up when you overlap, but I want to shut it off right then and there
so coming from the UMG, I can't seem to access the Quest Icon no matter how I pass it thru
I have the same kind of array in my c++ class and there the replication works perfect... ?
some actors will automatically replicate from server
I think only characters? not sure
maybe it doesn't work on the component automatically
pretty much only pawns by default, you shouldn't assume the rules of replication
^ thanks
the actor also has to replicated for the underlying components to be replicated
so how do I pass through a reference to an actor through UMG? this is killin me
basically this works perfectly on End Overlap with the "Question Mark" directly:
if i can't do a multicast how do i do it than ?
that's incredibly inspecific
But if I trigger this event with a UMG reference to the question mark, it comes back as None
@next falcon you'll have to multicast a lot
down the road
okay fuck
I think 1 more pic to show where the Question Mark is being set
On the NPC
ignore that one branched off node it's just chillin there
so this works on server
but not for clients, but it does work for clients when running directly from the End Overlap on the Question Mark itself
so if I run away and come back, it's disappeared correctly... but at the time of completion, through the UMG, which is spawned by the question mark itself.....
oh damn BP
but usually i would do it as a dynamic multicast delegate on the player controller
bind the event in the UMG widget
and pass it that way
the player controller is always valid for a UMG widget
right
I can trigger the event no problem
but it's not registering the Question Mark actor
the one to set visibility on
from the server you would call a client RPC on the PC most likely
which would then pass the info onto a delegate that your widget listens to
so when I create the widget, I bind the delegate?
yes, the player controller should be valid in the construct event
and then that way, it's the UMG acting on the Question Mark in the UMG event graph?
delegates confuse me so much lol
it's like everything you know, but backwards
you would send a "open conversation widget" RPC over the network, this RPC when run on the client would run the delegate
i presume you have some kind of HUD UMG widget
that can be used to listen to the delegate and create the relevant widgets
i think they're called event dispatchers in BP
yeah
in bp we have "bind event to dispatcher" on one side
and call dispatcher on the other end
so I guess bind event means listen right?
there are more functions they need to do a good in depth tutorial on advanced BP topics ๐
bind and listen mean the same
though the game i'm working on is mostly C++ for game logic
with BP mainly used for data, prototyping and animation
... and UMG
so whats the deal with UMG replication?
they only exist on client right?
considering my question mark is being spawned on client, I really don't get why this is being a problem
there isn't any replication
but any event that happens on the server in a multiplayer game needs to be relayed to your UMG widgets that depend on it somehow
no magic there
UMG widgets are exclusively spawned on the client, i usually use the HUD class to manage the creation of widgets that belong to the HUD
yeah I think they made HUD a backend class in BP
you don't really access it directly, it just automatically does its thing
the HUD class is a pretty legacy class in UE, but that's what i repurposed it for and it works well
Uff, I'm so sick of the event flow in Multiplayer haha
ack holdon
let me repaste that one sec
can anyone give me pointers on this pipeline i have for my source build / dedicated server config setup
I would recommend putting that into a "Comment Only" Google Doc
oo ok
So, order of BeginPlay is: PC->PS->HUD
-.-
So can't access stuff from the HUD in the PS on BeginPlay
Fml
HUD is such a garbage class, let's move the Widgets to the PC
here is my link for comment only if you can consider looking if u have time https://docs.google.com/document/d/1qOp9bPe1LR_TZfUtiIhXmAIVIPa3oFk0tflYK-sQ5H8/edit?usp=sharing
Game Development Notes SOURCE BUILDING A GAME (30 mins) Build unreal from source Install Visual Studio Community 2017 from www.visualstudio.com/downloads/ making sure to select: Game development with C++, Optional->C++ profiling tools, Windows 10 SDK, as per https://docs.unre...
hmm i just had a thought cedric, if you can't access it in HUD cant you move it to game instance? that is the global class right? if u move the vars u need and the logic there, and make callls to the game instance instead?
i only use hud for a UI thing that has little radar blips in my game haha. i never use hud for anything else - oh except for a flight alignment indicator
for a player ui that has like player score and kill count, i store all that in a playerui widget on screen and that gets loaded up by default with create widget
Yeah I have a different problem
i got your comments in the doc thank you
Yeah, have no time to check the rest out
can iask you quick question like really quick about general latency stuff
i am noticing like brief lag spikes in my dedicated server when i am on it - but only after powerups spawn and at least 1 other player is in there
do you think that the replication settings of the powerups and possibly the replication settings of the player is causing this? i am considering overhauling some of my netcode into CPP to fix this issue
That'S the default settings
If you don't have massive amounts of them
Then it should be okay
all right
Well, f*ck it
I really wanted to have a non-polling solution for my UI PlayerLists
But even Epic, in all the Source Code in all their projects, poll the PlayerArray in their Scoreboards
I guess it's just too much work to get all events in harmony to have entries removed/added or at least the list updated.
Specially when using SeamlessTravel
Only thing they do to not recreate everything every tick, they check the length of the array and save it for next time >.>
Hi, I'm replicating addforce it seems to work fine until I simulate lag using Net pktlag = 50 I get a very twitchy erratic behavior on the client. any advice? thanks
So still stuck with my PlayerController not been able to access character (gets Not valid) OnBeginPlay and On Possessed doesn't seem to exists in my PC. What should I do?
are you on listen server
I don't think so. I have a client+server(not dedicated) and 3 more players. Is that listen server?
"3 more clients"
how are you casting
maybe try "get controller" then plug that into your playercontroller cast
o this is the other way around eh
from the PC -> on begin play -> get controlled pawn -> cast to my character class -> to variable. But it's always not valid
I think I have to use a On possessed event or something like that but it doesn't exist in my PC
oh and I just noticed it's the server the only one complaining, the clients PCs seem to reach the characters fine
ah
ok, I'm confused. Should I initialize the PC on the server or just on the clients?
what do you want to do?
well I want to allow my players be able to zoom (swapping 2 cameras in the character BP).
ok, that has little to do with networking
yep. But the camera swapping just happened in the client+server, not in the pure clients
there is APawn::IsLocallyControlled and APlayerController::IsLocalController
it will return true if the player that ownes the Pawn/PC is local to the machine
its used to filter stuff like that
yep, I'm using that
So you have InputActionZoom
different name, but yes
and it should just swap the camera, no RPC, no network calls
"no RPC, no network calls" Don't reallyknow, I'm a newbie with all this. But so far I think it only needs to change the cameras
yes, but there is no need to let the server or other clients know which camera you're using
one thing, that is done via a "weapon component" in the character.
ah I see. So the issue is just a misconfiguration of my stuff here. I should ignore the network code here. Ok, I'll revert this and try again.
there is literally no benefit from that
if you have any InputActions that depend on the camera
like selecting an object under a cursor
you can just do a LineTrace and send the World Coordinates of the hit to the server as part of the ServerRPC input arguments
and you would have to do that anyways, since server has no way of knowing where the client's mmouse cursor is
hmm, not sure if that applies here. This is a Third person shooter game.
Also I don't know yet what the ServerRCP input arguments are ๐ But I'll figure it out.
Where could I learn how to use FSockets? please help
Thanks
What exactly is a UActorChannel?
actually in fact
UNetDriver UNetConnection UActorChannel
anyone have a summary of what these classes do?
Isn't that fairly engine internal stuff that games don't use directly ?
Somewhat, i was combing through some source examples though and there are some places where that's utilized
so wondered what they needed to use that stuff for
No idea, never needed any of that
understanding the UActorChannel is helpful
i just never prepared to articulate something like that
but you can get away with just understanding that anything attached to an Actor uses that Actors UActorChannel for replication
When I get invited into a session, is there a way to find out if the session I'm invited to is a GameSession or a PartySession?
OnSessionUserInviteAccepted(const bool bWasSuccess, const int32 ControllerId, TSharedPtr<const FUniqueNetId> UserId, const FOnlineSessionSearchResult & InviteResult)
The invite result contains only an FOnlineSession and from there you can get the session info, but there is nothing there about the session name right?
Not that I see
But why don't you add a custom Setting to your session? @vocal dagger
because on some consoles it might not work
for example on Nintendo Switch you cannot use SEARCH_KEYWORDS
and on PS4 external session data is very restricted
I'm trying this right now
FNamedOnlineSession* ExistingGameSession = SessionInterface->GetNamedSession(NAME_GameSession);
FNamedOnlineSession* ExistingPartySession = SessionInterface->GetNamedSession(NAME_PartySession);
// Is this a game session
if (InviteResult.Session == ExistingGameSession)
@thin stratus also PS4 external session data is not implemented by UE4 ๐
If you don't join a session, it might not return GetNamedSession
And I assume you want to know that upfront
yep, also I might have game sessions and party sessions running on the client as well
Hm, you aren't aiming for Steam, or?
Steam doesn't allow multiple sessions
just a custom keyword would work
Either Party, or Game.
oh so you cannot create a Game and a Party session?
Nope
oh ok
You have to destroy the party if you want to join the game
well ok, that could still work
Yeah it would. Just saying :D
are you the one who worked on the Steam party session plugin?
well found a way, if I create a party session I just don't set a MAP_NAME, then when invited I know it's a party if there is no map set
but handling which session to destroy when creating a new one or join is quite a pain
pretty sure you can, in our source engine game you could be in an active party and be in a game at the same time
unless it's a limitation of the steam OSS
@lost inlet you are right, you can have a Steam and a Party session at the same time
Hello everyone. When i package my game with an custom app id as a shipping build the steam overlay wont start. appid 480 seems to be working fine. also when starting the game in debug mode this seems to work fine aswell. is there anything i need to configure?
@open gazelle Did you start the game from Steam
no
That's why IIRC
Not really :/ Steam has some pretty weird behavior differences depending on build type
Ok because getting steam running is pretty weird. Sometimes standalone from editor works sometimes not etc.
I should write something about releasing in general because there is so much we learned
That isn't documented anywhere
Maybe anyone knows why the "play -> standalone game" sometime does not find any sessions hosted. While when running from a packaged build there is no problem.
ok need to check. my producer gave me one id
There's only one
But I think Epic has two separate settings
Can't find a source, so maybe that's just wrong
Ah, right
SteamDevAppId=480
SteamAppId=480```
Check that out ^
they are diffrent?
Ok stupid question: If I want my shipping build to be working with my steamapp / steamdevid. What do I need to do?
You need to set both values to your appid
Then for Steam testing on shipping, you should be launching from Steam (unless you have the relaunch option enabled, IIRC, but I haven't played with that)
For "standalone" testing it should "just work" if you have set the SteamDevAppId correctly too
Now I don't know what "standalone" defaults too when clicking play
Should be Development
If somehow it picks the Shipping build, again, shouldn't work (but why would it do that)
Ok thanks! I'll try around a little.
hi, anyone ever replicated a simplevehicle and knows how to?
angular velocity is very jaggy ..
rollback is like fixing position/rotation to match server?
@bitter oriole
these are the default values from the engine. there is no appid 0o
[OnlineSubsystemSteam]
bEnabled=false
SteamDevAppId=0
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true
P2PConnectionTimeout=9
so physX vehicles are not replicated out of the box?
@open gazelle SteamDevAppId should be changed, and yes you need to add your own
what i wanted to say is that there is no SteamAppId entry
Yes you need to add yoru own
only a steamdevappid
does anyone here know how spatialOS integrates with UE4? I haven't found any up-to-date docs on it that have helped me, I am also currently using a mac
@gusty raptor PhysX is basically incompatible with replication so you'll need to implement simulated physics yourself, without using engine physics at all. Replay & rollback is the technique to use for player characters - vehicles, pawns, etc. it's implemented for ACharacter, but for vehicles you need to start from scratch.
I linked you a really great course on this
right ๐
I've been having trouble with their browser interface
and I can't find any tutorials
@gusty raptor Problem with PhysX is that it's not deterministic, so client and server will have different simulations, and you'll have to rollback the client very often
The general problem is that you need real-time simulation on your client, which then goes to the server, is simulated again there, goes to other clients including you
When it goes back to you you rollback (to the server state) and replay player moves more recent than the move the server simulated with
Other clients use interpolation to generate smooth movement between server replication events
That's the gist of it, get the course to get the detailed version ๐
Which course?
ah. are you part of it?
ok cool ๐
doesnt deal with physics though it seems
@twin juniper Very few engine users need to add a custom network engine so you're not going to get real-time support on that
You should probably look if there are spatialOS forums and check with them
@gusty raptor UE4 physics won't work with multiplayer, like at all.
That's a technical limitation in UE4's physics engine that's not going away soon - you need to create your own physics with a small feature set that you control well
Ok, why don't people use spatialOS more? It's like a dream come true for mmo devs
Who don't have big teams and high budgets
Because there is no such thing as a MMO team with a small budget
It used to be impossible, but now it can be done
@twin juniper Problem with MMOs is getting the players - can't do that without a huge marketing campaign
@bitter oriole damn:/ i was kinda sure i was able to do it but hhm:S
This discussion comes up fairly often but basically 100 people who have your game boil down to one online player on average
Combined with how the average Steam indie game get 1000 lifetime players, you get a gloomy outlook for indies MMO
So the ratio of owning to playing tends to be 100 to 1
Depends
CS:GO has something like 30M users and 400,000 peak players this week
So for CS:GO that's accurate
Others have less, others have more, mostly based on age & retention
I was looking to make a 125v125 team-based strategy game
With a unique twist by having a chain of command
But it would be done in a way that doesn't seem too forced
Then you need your game to get 25,000 players, or basically 20 times more than the median indie on Steam
That should get you thinking really hard about it
Right
@bitter oriole so what about MP games that actually have vehicles and use UE?
And more if I want multiple games
im kinda sure the vehicles do use physics, but...
@gusty raptor Maybe they have custom physics, maybe they have client-authoritative physics where clients are entirely trusted to be nice and friendly and not hackers
Maybe they have lots of smoothing to keep the simulations in line despite differences
The key thing to understand is that there is no built-in framework for this, so you need to experiment yourself
I believe it's fairly possible to get physics to behave if you have heavy clamping on most forces, don't do anything stupid like multiple physics bodies colliding, and have lots of smoothing between what the server wants, and what the client has
yeah my idea is to move my bike back into the player actor and just sync the actor
(where the bike is the physics asset)
There is no such thing as "just syncing" ๐
"Replicate Movement" ?
It's days, weeks of hard work with lots of interpolation
Hundreds of lines of code etc
Replicate movement is a joke
It's only viable for debugging / prototyping
for real?
Yes for real it's entirely unusable for anything looking like a game
hhm ure actually the first one that tells that ...
"Replicate movement" will just replicate the current location & orientation
why would that not be enough ๐ ?
The thing is, you might get zero update on clients for half a second, and then get 50 updates at the same time. The average frequency will be lower than your display frequency, too. So the result will always look like shit.
๐
It will look laggy playing with a friend on LAN
It will look very laggy if you have Wifi
It will be absolutely unplayable over the Internet
that doesnt sound very funny :S
There is nothing funny about multiplayer, it makes every feature 5x harder than single player
yeah, well true.. i know a bit.. ive been implementing things like actions..
e.g. getting on/off the bike.. its not really a issue
however im totally stuck on movement/orientation
Like I said, everything is just way harder in multiplayer
Features are slightly harder at best, and impossible at worse
So for non-character movement ? Get that Udemy course
Spend a few weeks working with that
There isn't a shortcut on this
what about moving a character using physics, and set it to replicate? just a quess
@bitter oriole does my steam account need to be linked with the appid for the game i am working on?
@gusty raptor It will work fine on the server, and it will look like a buggy piece of shit elsewhere
There is no such thing as "set it to replicate" for anything that needs to be smooth
If it moves, updates lighting or color, or anything like that - then it needs real work to fill in the blanks
You have two core issues in multiplayer :
- server -> client : need to interpolate cleverly because you're going to get replication data at low frequencies, in bulk, with stupid and random delays between each
- client -> server : need 100% real-time movement on the client, can't wait from server to confirm, but also need to have the server confirm, and handle differences
hi good peoples
I got my issues mostly cleared up yesterday, as far as setting visibility on server only - I simply changed my quest icons to not replicate and spawn on client, and when I set visibility, do a switch has authority -> is locally controlled for server and it works out
the problem I'm having now is that I can fire the Client Hide RPC on my character via an End Overlap with the Question Mark no problem, it fires on client
but I can't find a way to directly hide the quest icon directly, whether it's through the UMG, or by reference, it keeps coming back as None
I just tried passing the reference to Self straight from interacting with the question mark to open its widget (which is easy to tell does in fact open, so I know I'm interacting with the quest marker), so right after that I ran an event on the pawn to set a variable reference, and then later from the UMG, fire that event and it comes back as none ๐ฆ
here's my Client RPC on the Character - the Remote portion fires off normally (the highlighted part) when running from End Overlap, but neither of the Q. Mark references are coming through as valid when I fire this event from the UMG
wow, neeeevermind... I had the variable on the characters whose head had the icon set to replicate. Turned it to Not Replicate, now it works correctly
First time I've had to anti replicate something ๐
anti replicate virgin
:}
UNetDriver UNetConnection anyone know what these classes are used for? I somewhat understand UActorChannel now but itโd help to also understand the other 2
Did you try simply reading through the class?
if 'is server' = NOT true then make lag = 999
save all that juicy latency for server-to-server communication
anyone ever seen this error when trying to start the server? ue4 LogWindows: Error: Cannot load default material 'engine-ini:/Script/Engine.Engine.DefaultMaterialName'
sounds like you're using the default material on something but you turned engine content off on your package?
@thin stratus Yes, but it's definitely helpful to have a high level run down of what it's purpose is and where it's used if that information is available. I can grab the lower level stuff from engine source but it makes the process a bit easier to know a little insight before hand.
like basically something that's a little more description than this:
LOL
seems like UNetConnection handles packets
I think it also handles this on a actor by actor basis
one per actor?
It looks more like this simply handles a connection between server and client
One for the Server and one for the Client
And it holds the ActorChannels
Sends and receives packages
Etc.
Someone here with beacon exp.? i am at loss as to why this is not working .... so i am able to create the session and create the beacon and the clients also can connect to the beacon and the connection is working ... but at a later point when i want to create the listen server and let every client connect it just doens't let me connect to the server with clients that were connected to the beacon (other clients can join just fine ) am i doing something wrong ? do i have to create a new session for it to work ?
So hey guys, ive been asking about replicating PhysX vehicles., networking with @bitter oriole but anyone has a idea about how to replicate vehicles
perhaps its kinda like a difficult thing, but i might just make a good tutorial once i fix it ๐
i mean, the community would need a good vehicle network base to create games with
it shouldnt be totally out of the box, but what if we have some good things to use right?
is there any resource where i could read about the network model in UT4?
@gusty raptor You can't reliably replicate PhysX objects, at all. I thought that was clear. PhysX isn't deterministic so it can't generate converging simulations on multiple devices.
For general vehicle networking, just get the fucking Udemy course
@bitter oriole lol so sorry, but i mean its kinds odd.. just wanted to mention
and @bitter oriole i might get the cource though i did already thanked u for that ๐
but just, im kinda amazed how much about general unreal engine topics can be found on google, and the less about vehicle replication in common
That's because it's an advanced topic with no easy, plug-in solution for everyone
Anyway, good luck
hehe ๐
i might then just release my project once its really working
a real plugin would be good though
If you find something that works for hovering tanks, wheeled cars, bikes and others then sure
All of these are going to need fairly different code
Hi, I'm replicating addforce (from char movement component) it seems to work fine until I simulate lag using Net pktlag = 50 I get a very twitchy erratic behavior on the client. any advice? I've tried everything from simulating on client and server to just server everythings smooth on 0 but any pktlag will cause bad lag on client
@light prawn Similar issues on my end. Solved some problems using SavedMoves, but Im in the same boat in a lot of ways. Creating custom movement behavior can be difficult to get working alongside the client correction
I find that for certain things, calculating new speeds and setting them inoverridden getMaxSpeed can help simplify the process
but it may not be relevant for your particular thing if it doesnt involve input
wrong james ๐
well I'm trying to get 6dof movement working in a no gravity environment
do use inputs
hah thats funny, it sounds very similar to my project
I am doing a flying third person character multiplayer shooter game
ah first person spaceship game here
Anyone know why my client one might not be creating a player controller?
i reccomend checking out the flying movement mode
thats what im using actually
Im doing a slightly modified version of that
essentially just copy pasted and tweaked, along with some overridden functions
hm
but yeah vast majority of my changes ended up being... calculate new max speed, acceleration, and braking acceleration
then in the getter functions for each thing, GetMaxSpeed for example
im doing, return FlightSpeed + BoostSpeed
for example
and boost speed would be calculated somewhere else depending on the inputs
in your case, say you have a jetpack in space. you may want to enter "Space" movement mode when you jump. you would then apply different accelerations depending on your jetpacks or something
hm so I guess you use maxspeed not as a limit but the speed you want to set?
also are you recreating tribes ๐
hah yeah sorta. its the max speed that full input tries to set you at. its not instant velocity
like if i push only slightly on the analog stick it wont do the full max speed, it'd do some percentage
but essentially yeah i set the speed using the maxspeed rofl. i mean it works for my purposes, might not be ideal but eh
still have to make both clients and server calculate this new speed though, and ensure that its the same everywhere
and thats where the SavedMoves comes in
from what i understand, it ensures that things remain in sync
hold on, theres a tutorial about SavedMoves
I started with this: https://wiki.unrealengine.com/Authoritative_Networked_Character_Movement#Boost_Dodge
well, thats how i started the networking portion of the movement controller at least
hm
Its a bit confusing, but imagine it like this; when something changes the server saves the movement that occurred. You want certain things to be saved if it affects movement.
That way if the thing you saved is different on client it can correct itself to match the server
I dont fully understand it but thats how I look at it anyway
does onmovementupdated trigger whenever you move on client?
it happens after all the movement calculations are done, inside of TickComponent
if you look in TickComponent you can see specifically where it occurs iirc
sorry no
it happens in perform movement
and it also happens in the simulated versions, for SimulatedProxies
Simulated proxies are just characters that are not locally controlled. So other players you see but dont control run the simulated versions, which get values from the server to simulate their movement in a way that accurately reflects the owning player'ss desired movement
i see
going to implement this boost dodge see if I can tweak it to handle input axis and addforce
good luck
James are you doing any sort of interpolation for movement? What's your NetUpdateFrequency value for that actor?
The reason why simulating on client AND server didn't work is because UE physics isn't deterministic. This means that if you try to simulate your physics on server and client from the same initial conditions, they will not produce the same result. So you're going to have to use some techniques to alleviate the snapping/twitchy problem because they will eventually go out of sync and the server will send an update to the client which will cause the client to perform a hard snap to new position which gives you that twitchy behaviour.
I found this article very useful when doing this sort of thing so perhaps you might find it helpful
https://gafferongames.com/post/networked_physics_2004/
thank you for the resource! @scenic tangle also thank you @dull stream busy working on this ๐
issue im finding is that setting max speed and accel would conflict if you press multiple strafes (like forward + right)
in what way is it causing a conflict?
well say you set maxaccel when you move forward to 3 and set it to 10 when you move right it seems like it tends apply either one of the values to both
if you press both keys at the time
in that case, you may have to get the characters forward vector and compare it to the acceleration vector direction.
and then set the acceleration to be some combination depending on how far to the right/left it is
theres definitely some math involved
one way to do it is to use dotproduct. ForwardVector DOT AccelerationDir. This will produce a value between -1 and 1.
a value of 1 would be, acceleration is in the same direction as forward, a value of -1 is acceleration is in opposite direction of forward
and values between that mean that its somewhere between forward and backwards (not necessarily to the right or left though, could be up or down)
I suggest looking into some vector math if any of this seems rusty or foreign
@bitter oriole Do you know of any networking udemy courses that aren't done in C++? I'm hoping to take advantage of the Father's day discount of 94% on most courses, but I can't write C++ and I was hoping for a BP course
Nope
Hmmkay. I'm aiming to have 100+ players online, end-goal is a MMORPG-base. Is that possible in BP or would I need to write custom code for that? I've noticed that I might have to make use of the Gameplay-abilities plugin, along with an Open world plugin. I believe most of that is in C++, so buying the courses for learning C++ & the networking with C++ would probably be well worth the money for what I'm trying to achieve? @bitter oriole
the engine barely runs 100 players on c++
for mmo you need something bit more sturdier than blueprint
Custom engine?
I'm planning to add a set of subdedicated servers on a specific amount of tiles in the gameworld, and the players that are in that tile would be connected to that dedicated server. That way I wouldn't have too expensive dedicated server hosting and I was hoping that would cut some slack @slim holly
I have no experience with networking so I'm only thinking loudly here
yeah you likely need a custom server to do something like that
could still use unreal for the game client
maybe something like improbable.io
Hmm, I'll just go ahead and buy the C++ courses then, wont hurt to learn some of the native language
@dusky yoke i am looking at the udemy ones right now, pretty good stuff. am actually in the process of converting some of my game over to CPP to reduce net latency.
I need some help with making a respawn system. PM me for more info
ANYONE AN EXPERT ON NETWORKING i need assistance
ask the question
ALL CAPITALS MAKES MY QUESTION IMPORTANT
Post your question and someone may help
so i have managed to setup 2 meshs (1 for FP and 1 more for Tp) AND 2 gun meshs 1 for fp and 1 more for tp
i have checked the owner no see in my tp mesh but still it appears
@jolly berry how do they sync clientside projectiles?
I was thinking about that myself just now. I want it to be responsive, aka immediately fire when client clicks, and then tell server to to fire as well
but the syncing im not sure, I was thinking maybe slow the projectile a little until it syncs? or rewind? how does UT do it?
if you tell me verbally and I implement it, then its not copying their code ๐
i would suggest you just reimplement it without looking at their project, once you understand the concepts
i dont think epic games would get pissed at you for that
wtf u spawn a projectile not sync a projectile
lol
thats it? you dont think there needs to be anything else done?
Im new to this so you tell me
I haven't finished fully looking through it yet but I know it at least creates it's own replicated movement and I think the idea is to sync that up after it's already spawned simulated
so all owning clients get the responsiveness and accuracy of the server
u just spawn a projectile and it moves lol
sure but that's not necessarily client side responsive if u have high ping
u just need it to be replicated and a projectile movement component
responsive ?
wtf
if you click, you probably dont want to have to wait 100+ ms to see the results
i think thats what he means
or higher than 100ms depending on situation
yeah, if you just do what you're suggesting, you're left with two options, either: A. Validate everything on the server, so when the client fires you have to wait for the Server to tell you to spawn it. Or B. You always spawn it completely simulated at the risk that your location/rotation are incorrect from the Server
u spawn it from the freaking server!!
The idea is to start with B. but fix as soon as you replicate
u just need to setup client side prediction on the character
then the server has the correct location
but i dont think ull be needing that unless u have 15-20+ players
a match
if i play with 500 ms though, just for testing, if i click to fire would it not take half a second for me to see my projectile, decode?
khoas seems to be suggesting spawn immediately clientside to get a simulation of what the server would be doing
yes it would
but with 500ms its imp
yes, that's exactly it
that arises the risk of cheating
how so?
it doesn't, server still validates
client side is purely prediction, Server still autorotates the state and then sends it's information as soon as it can.
yeah the projectile client side wouldnt be authoritative in this scenario. It'd be akin to a particle effect or something, just something to visualize your shot
Client side simulation will correct after receiving that information
If Client decides to manipulate the projectile in any way not true to Server, nothing would happen as Server still spawned and validated the projectile correctly.
Worst someone could do is have a Client that lies to them, for whatever reason.
its encouraging that someone was having similar thoughts to me lol. guess doing character movement first prepared me for projectiles
it doesn't receive any state from the client, only an action to fire
Server always authorizes the game state. Anything happening Client side is a simulation of what it thinks the Server will do.
ok
decode, imagine an exact copy of the projectile class you have, except with no damaging functionality at all coded into it. And it gets spawned client side as a visual effect while the server spawns a real projectile with damaging functionality
thats essentially what hes saying
I work in the industry.
my course has been spending a half month reading the character movement component code until i felt like blowing my brains out
we work in UE3 still but I'm trying to learn the lower level engine stuff of UE4
just to keep up with the new stuff coming out
thats cool khaos. I used to work in industry but the contractors got fired lol.
ah sorry to hear
lol
eh its whatever. fuck em.
they didnt hire me fulltime because i couldnt whiteboard a boggle solution
๐
๐
haha, I feel ya. I know interviews can be rough like that sometimes.
I recently did Baron Samedi on Smite.
oh sick. hi-rez huh?
yeah! joined last year after retiring from the Smite Pro scene
finished my CS major and made a couple games throughout college
was a really easy transition
oh damn, thats crazy. its funny how being into videogames can help you get a job sometimes. someone at my old studio was like a huge WoW person
oops yeah sorry about that
ye sorry
https://cdn.discordapp.com/attachments/221799385611239424/458865305523847180/unknown.png
so i have managed to setup 2 meshs (1 for FP and 1 more for Tp) AND 2 gun meshs 1 for fp and 1 more for tp
i have checked the owner no see in my tp mesh but still it appears
https://cdn.discordapp.com/attachments/221799385611239424/458865687864147969/unknown.png
https://cdn.discordapp.com/attachments/221799385611239424/458865732453793814/unknown.png [REPOST]
Is there any direct way to get CMC to replicate Velocity to Owner?
I have been prototyping something quick, used SimpleMoveTo from PC
result is that only the owning client doesn't have the Velocity vector, and animation blueprint can't read it
yeah
You are getting the velocity from the cmc in the animBP and it is wrong?
and its 0
I mean despite this sounding like something broken, have to tried the capsules velocity
clients see other clients correctly, everything is good on server
i did, its also zero
it is
Cause that has nothing to do with Replication iirc
and all other clients see it fully animated
i can hack my way around it easy enough, but i'd prefer not to
Can you check with default AddMovementInput?
Just to see where it comes from
Might be the move to stuff
it still has WASD connected, and that works fine
Im pretty sure he does that already
that is what it does already @umbral adder
so thats not working?
Youd need to check what the simpleMoveTo stuff does
it eventually ends up calling RequestMove on PathfindingComponent :S
Just make your own velocity vector then
yeah, i guess i'll have to
@dull stream @meager spade Simply put: use RPCs to signal important events, forget about replicating/syncing/predicting on the "instigating" client (only predict on the other clients; don't sync on them either). Example (S - server, IC - instigating client, OC - other clients):
- IC throws a grenades (or fires a projectile, but this one's easier to imagine).
- IC sends a reliable RPC to S with the minimum information it needs to simulate its own grenade.
- S validates the RPC (was IC allowed to throw a grenade? i.e. "Was IC facing north and threw it towards south without having time to turn?").
- S must have a tunable mechanism for the RPCs it receives so you can experiment with the error margin (what you allow vs. what you forbid).
- Assuming S validates the RPC, it uses reliable multi-casts to inform the clients of important events (i.e. first it sends the "grenade spawn" event to OC, then it sends corrections to IC/OC, if needed, such as grenade bounces, just in case).
- After being notified a grenade was spawned with a given direction, velocity and so on (minimum info, including the IC's latency to S), the OCs try to compensate for their latency and IC's latency so that they "defer" the spawning a bit, enough that their simulation becomes accurate of what IC was seeing.
I've experimented with a few methods a while ago. I wasn't pleased. This is what I've started working on and this is the flow that I personally consider most reliable and most pleasant for the UX of the players (but it's nowhere near a point where I'd be able to share it).
@fleet sluice in 5000 words or less!
@fleet sluice thx
that, or make a Client RPC that will send the Speed back to the owning client when it changes
@winged badger You have all info on the client. Rpcs would just add bandwidth
Also, to append on that mega-reply: there must always be at least one latency threshold and a fallback mechanism. For example, never predict clients with over 100ms latency (let them "lead" the shots, with the classic mechanism) and completely ignore the 500ms clients because if you don't, they will ruin your game. And their game is already ruined by having 500ms.
@fleet sluice but that doesnt solve the issue of their being delay when firing on client side during lag, right?
Of course it does. That's how it starts: with clients doing everything locally, with zero-lag, then informing the server.
ohh i was wrong then
The downside of this method is that it will require a shit ton of fine tuning and unique RPCs.
I haven't yet come up with a solution to send "generic" RPCs.
ah yeah i misread the grenade spawn part, you said OC not IC
That would simplify things a lot.
or pin it mabye ๐
It's not such a common topic. Cedric's compendium is the only thing I'd ever pin in this channel.
I need to read his compendium, i skimmed part of it.
Also, going from "grenades" to "projectiles" is a simplification, because they wouldn't bounce so they wouldn't need corrections and stuff. This whole approach is essentially separating causes from effects and nothing more.
I see. thanks for clarifying some things Vlad ๐
Anytime
@thin stratus fixed by issuing the SimpleMoveTo on owning client separately (something i've already tried before but forgot to connect the Controller pin, which doesn't take "self" as context automatically for some reason)
Anyone here have a slightly deeper than superficial understanding of aws gamelift?
Does this Cedric Neukirchen still fare the chat rooms these days?
I have an actor which uses an Actor Sequence Component. Is there a way to make the sequence not replicate to the client?
I want to use OnRep_Notify to play it on the clients but it's also replicating from when the server plays it so the sequence is messing up
or in other words, how do you disable the built in replication for things like rotation, scale, etc.
I only want to replicate variables.
This does not entirely answer your question but...
Have you tried to use a SwitchHasAuthority // CanExecuteCosmeticEvents inside the OnRep function? To make sure it is called only on clients?
Also you could consider using a delegate instead.
You could bind the clients to do whatever you want when the delegate is called.
hmm interesting - no I haven't. I'm using a replicated variable to play the sequence on the clients and it works when they receive the update. The problem is when it also plays on the listen server.. it seems like the updated state is messing with the client's sequence because of replication and it makes the client's version twitch or play twice as much
If I'm running on a dedicated server, it doesn't mess up the sequence because each client plays their own version of the sequence and the dedicated server doesn't play the sequence so the state of it is not being replicated to the clients who are already playing the sequence.
can't work out why he got mentioned :D
Hello, can I ask what the Owner means in ELifetimeCondition?
Does it always mean the actor on the server or it means the actor on the client which can control the actor.
So if I am running a dedicated server, the actor's owner will always mean the dedicated server I guess?
Owner is the one controlling it
Hmm..not sure about it. Because there is also a condition called COND_AutonomousOnly which I assume is the client controlling the actor.
So, I have a struct to hold input of the players.
I gather input on my Pawn cpp class, and then pass it on to my MovementComponent.
But, somehow, after a while, the values of the struct get reset to zero... Any ideas of what it can be?
I pass that struct as a function parameter on the functions I call in my MovementComponent, and in the first calls I still have the right values, but after a while I just get zeros.
An actor may be owned by a client and also be simulated, you set ownership on spawn, or through SetOwner, the ones being controlled (autonomous) are automatically the owners, for other actors u must set yourself
Is ok to use multicast for the muzzle of the weapons? Those are particle systems
@glacial lotus sure, but if the clients know the weapon is shooting, they can do it locally, no need for a multicast
hmm, so from a client I shoot. Then, in the shoot event, at some point I call "MuzzlePS" (run on server). From the server the event lists for all the players(I don't know how to do that) and tell them to locally exectue the actual creation of the muzzle PS. Something like that?
i used an OnRep Notify, if the client has bIsFiring, then all clients simulate the fire
"OnRep Notify" I'll check that. Thanks
if you look how shootergame does it, they use a BurstCounter, and check its greater than > 0 in the OnRep, and simulates the muzzle flash
Reading the chat history, I just realized I accidentally tagged KaosSpectrum instead of @jolly berry in my mega-reply this morning. Ehm... Sorry :/
@twin vault So, deleted UPROPERTY() from every member of the struct, and even deleted UPROPERTY() that I had for the actual struct variable in the classes, still gets reset to zero
It was actually a really good idea, and thought it would solve it, but...
@meager spade Thanks. Is "shootergame" that western multiplayer demo?
ah, ok. Thanks
@twin juniper yeah i said it then i realized you meant in a single frame right? you need UPROPERTY so it doesnt get deleted, but it happens after a while not on same frame
maybe the input is getting consumed on MovementComponent?
is it a custom movement component?
@twin vault So, what I do is gather input in the custom pawn class, and consume it on tick, and pass it on to my custom movement component through a function. On the Tick function in the custom movement component I start by calling the super tick, and after that I do my own things. I access the input struct variable I have in this class and it has the correct values. I pass it on throught several functions, and it still has them correct. After a while I get zeros again...
Does anybody know, why AddControllerPitchInput in Pawn does not replicate controller rotation to the server?
It works with Character, but no in Pawn
Pawn does next to nothing with the network
I thought PC works with camera and networking
PC replicates PC stuff, pawn replicates pawn stuff
The core Pawn class really has next to zero multiplayer support since it does next to zero stuff
Character has thousands of lines of C++ in multiplayer code
@bitter oriole Yes, but Character does not override AddControllerInput logic in any way..
@twin vault But, I didn't understand what you said now: UPROPERTY is needed for it to not get deleted? But isn't that macro used to tell the engine that it should be considered for GC?
yeah, it should be considered, thats why it doesnt get deleted, while the property is used, it holds itself alive
once the object that has that property gets deleted, the reference is lost and it gets garbage collected
if you got something thats inherited from UOBJECT its already getting considered for GC, and if there is no UPROPERTY referencing it, it will try to delete it
it explains more here https://wiki.unrealengine.com/Garbage_Collection_Overview
Hmmm, that makes sense.
still, for your problem its hard to tell without some debugging, couldnt think of anything :/
@twin vault However, I tried a workaround that should work, but it gets the same results.
So, what I did was:
- On the custom Pawn class I setup input, and on each input event, send the axis value to the custom movement component.
- On every tick, the custom movement component consumes that input.
- I pass it on to a function called PerformMovement as a "const FRepPlayerInput& inInput".
- Inside that function that inInput has all the right values.
- Inside PerformMovement I pass it onto another function the same way -> "const FRepPlayerInput& inInput"
- Inside that other function I get the right values.
- Inside that other function I pass it onto another one, and on the latter I just get zeros.
I even did a hard copy to a temporary struct inside PerformMovement and passed that temp struct onto that other function, and still it goes to zero.
It would make sense that this temp struct would get to 0 at the end of PerformMovement, but not while in it...
@twin vault If it helps I can send you some prints of the code
yes
i dint know which text channel this belongs so i am putting this here
what is FInterpto and Lerp?
and where can i learn about all there math functions?
FInterpTo is Float interpolation and lerp is Linear interpolation which is basically a straight line between 2 points
-
Lerp: Goes from a value A to a value B by using an "Alpha" value, which goes from 0.0 to 1.0. An Alpha of 0.5 means a mix out of 50% value A and 50% value B.
For colors that would be for example White for A and Black for B. 0.5 would probably be gray then. All other values are either brighter or darker.
For a float it would be fore example 20 for A and 40 for B. 0.5 would be the middle of them, so 30. -
FInterpTo (or other InterpTo Functions): Goes from a value A to a values B over time by using a Speed value and the DeltaSeconds (to make sure lags aren't causing issues).
i have done this but it just set's it to this
like it stopped mid way
@ me please (if u know answer of course)
@umbral adder FInterp needs to run on tick
Ok thx
But how would I do it in an event like this?
It is a hot market
Hit marker
hey so idk how much you know about advanced sessions but whenever i try to create session it just wont create
Hello! Now I am lost.. When is it not safe to pass references to server? I thought that not replicated, not server spawned actors are unsafe to pass to server functions, but now when I tested this.. It works and server knows the float value, even if the client set it. Why this works? Thanks
In this case, the server prints the correct float value
@plain flume You must be running as the authority, try this code while playing in a dedicated server instance
@hazy herald Count the player states
Or you can iterate a variable in the game mode which tracks the player count then decrement on logout @hazy herald
@sharp pagoda how would i do that
@plain flume Yes, you spawned the actor on the client, the server never knows of its existence so when you try and pass a reference to it via RPC on the server, the server can't resolve the reference and will result with a nullptr
@hazy herald Create a gamemode, override OnPostLogin() and Logout()
In those functions, increment and decrement a variable
Thanks.
thanks
๐
@hazy herald or use the already provided function http://api.unrealengine.com/INT/BlueprintAPI/Game/GetNumPlayers/index.html
Get Num Players
How do I get an actor's actor channel?
when I spawn multiplayer on the editor sometimes I get strange behaviour like teleporting across the map.. this usually happens on the fresh restart of the editor but usually when I start game plays out normally it's very random. I'm stumped don't see anything in constructor or beginplay that could cause this. Generally doing dedicated server with 2 clients
strange if i launch from editor that freeze/launch bug happens but then if I open the character bp and launch from there it doesnt
@plain flume that code only works from a listen server host
wtf/
Hmm, nvm, didn't scroll down and seen its already answered
so when im switching level in game from lobby to map only my server switches lever not the other players. please help
Are you using Steam?
not steam
What command do you use to move maps?
like they all join the lobby but than olny one joins the map
using blueprints
open level
OpenLevel is a hard travel for one player
oh what should i use
Use the ConsoleCommand Node with ServerTravel MAPNAME
Note: If you want to use Steam in the future, you have to work with Seamless Travel
That is a boolean on the GameMode that should perform a Seamless ServerTravel.
@cerulean hamlet What do you need that for?
Try "GetNetConnection"
That returns a "UNetConnection"
@thin stratus thanks it worked
Which has the ActorChannels @cerulean hamlet
NetConnection and not NetDriver @thin stratus ?
Oh great thanks, I was looking in the wrong place
I have a custom netdriver and was doing some custom actor channel stuff but couldn't see where to get an actorchannel after initialization
I have a bool thats being replicated via compressed flags and saved moves in character component. its basically adding some acceleration when true, and becomes true when the player holds down a key
the issue im having is that sometimes, i guess when its doing corrections, it will not set the bool to false (or it gets set back to true) during a replay?
so you get this added acceleration when you arent holding down the key
and you have to press it again for it to be updated
does anyone have any idea what could cause this?
or how to fix it?
how are you setting it to false?
input binding in controller, then controller calls function on character, then character calls function on move comp that sets it to true
oh to false im sorry misread
well it gets set to false when you release the button, so the above is true about the input and controller
but it can also get set to false when the movement mode changes
perhaps this is part of my issue, because it gets set to false through landing
specifically, i am overriding Landed function in Character, so when it lands it also sets it to false
but there might be something wacky going on there, like the super is exiting early and not setting it to false.
anyone have workaround for root motion animation blueprint running in dedicated server? if you have root motion from everything and you have some animation notification events in ur animations, there is 50-50 chance that they wont trigger
wont happen in listen server
yeah the early exits might be an issue
set a breakpoint where you set it to false
and see if you can get into a situation where you expect it to be false but it isn't
I think i might have figured it out Vatyx, or have a direction to go, thanks for talking it out.
๐
I think i might need to more closely mimic how crouching works, perhaps
or jumping
I removed all cases where its being set to false/true so it is limited to purely the saved move assignments and setting via input from the player
so a client correction must be overwriting it somehow
actually no im not even assigning it in PrepMoveFor because im using the compressed flags
somewhere i must have to manually determine, as its replaying saved moves, whether or not to set it back to false the replays are finished? I dunno...
Anyone dealt with making steam items / JSON files? I'm reading the little steamworks description they give, but it looks nearly impossible to do by hand
Could someone help point me towards some resources to get started rolling my own online subsystem? I can create my own external services, but after reading the network compendium as well as the official documentation, I have no idea where to turn now other than just reading the c++ for some ideas. There seems to be little to no information on the flow of this thing or how the online subsystem affects the standard "you start your game up and a level loads with a player controller and default pawn automatically".
I've read cedrics creating a local session blog post as wlel
Subsystem has nothing to do with these classes. At least not that i know
Online subsystem... friends, sessions, matchmaking.
You just have to mimic what the other subsystems do
Create your own classes that inherit the specific Interfaces
And implement the functions
sounds like a crazy amount of work
Could be worse
So I'm looking to start off by having a log in screen, and when the player is successfully authenticated, gets a list of available lobbies, access to friends list, etc. I guess I'm just looking for the best place to hook into the flow to implement these starting points. Also, without having dug too deep, what is the external UI interface used for?
Creating the actual backend of your subsystem is def more work
I have a lot of previous back-end experience.
the external UI interface is to open things with the... external interface xD
As said. If you want your own subsystem, implement the Interfaces
for example with Steam you can request the external interface to open the friends list
There is one main interface that is used to return instances of the parts
Like your own IFriendInterface implementation
Open Oculus or Steam and look through it
There is no tutorial afaik
Or documentation
So these are things that would be displayed in the game window itself? or just trigger an overlay sort of thing?
yeah an overlay
So I still have some concerns though. So let's say I go to implement my own subsystem. There's really no need for a central dedicated server at that point (correct me if I'm wrong)... So at what point would a player get a unique player controller? Once they join a sessioin?
If I'm using the sub system thing, I wouldn't have like 1000 connected player controllers ready to act on. It would just be the single local one until there's a session?
A subsystem != Dedicated server
Right, it's a bunch of separate external services. I've made it that far at least.
you will have the subsystem handle the connections but you still need to setup a dedicated server in that case
exactly
I'm wondering at what point it switches from subsystem to standard oh now there are 12 player controllers inside of a match
also don't get confused, there is nothing like an unique player controller
pcs 0-11
there is an UniqueNetId
I don't mean globally unique, just within the match
that gets assigned from the subsystem, it's mapped from every controllerId connected to the console/pc
Sorry, I know the vocabulary can be ambiguous
ok no problem, it's just that it's already confusing by reading the engine, they have so many names for the same thing sometimes
So I'm on my local client, I'm player controller 0 and I join a session where someone else is player controller 0 on their system. At what point do we become pc 0 and pc 1
Yeah I'll try to be more precise with m y questions. I can see why "unique player controller" could mean a bunch of things
so the subsytem will assign an UniqueNetId to each PlayerState as far as I understand (haven't tested this myself)
but that's when you connect to the server
and I would sort of pass around the meta data as they play matches/join lobbies
if you want to get the UniqueNetId whenever you are let's say on the MainMenu you have to request it
yep
Is this something I can assign to the user? Or auto-generated
Ok so last question for now I think... Is there a part of the subsystem that would be responsible for handling general user authentication? Or would I just use an http lib to make requests to a service.
it's only auto assigned (I think) when you log in from the ExternalUI
it's assigned on the LocalPlayer as I said
Sorry I mean like.... passing a username/password and authenticating it on a server somewhere, then essentially "logging them in" to what the authenticated interface ewould look like.
not that I know of, nope
so with the ExternalUI you can for example open the loginUI for PSN
so you can log in to the subsystem
in this case PSN, or XB1 or whatever
but nothing like auth to a server AFAIK
Yeah that sounds like something I want to implement. But you said its just an overlay? or is it fixed to the game window.
That is auth to a server
depends on how the Subsystem is implemented, on consoles you go back to the dashboard
on Steam there is the overlay
I basically want an external UI to show a login form. Do you know where it gets the external UI from? is it an html page? Just some arbitrary c++ program? If not no worries I'll start digging into the source to find out more
const auto ExternalUI = OnlineSub->GetExternalUIInterface();
then you can do whatever functions are implemented on it
Yeah, like I said if you didn't know any specifics I can just dig into the source code.
I'm not a c++ guru, but I can get around well enough to implement an interface. It's just a large system and hard to grasp how everything should fit together.
oh sorry no I don't know specifics on that
Right on, well thanks for answering what you could. I'm going to delve in a bit deeper and see what pops out.
When I make widget it only shows up for host anyone know y
you made it from a non replicated object that only exists on server
How do I fix it
safest way is to make them from your custom HUD class
Newbie question. When I send a struct to a custom event that's going to be run on server, Is the actual struct sent or is just a point/reference to an identical struct that lives in the server?
struct
Were are you creating the widget?
third perseon character
Hey folks. If I wanted to implement a fog of war type behavior, would implementing custom "relevant for" solve this? Or is that not a reliable way to determine 100% replicated or not
In order to change the weapon of a character and all the other players seen the change, would it make sense to have that info in GameState and somehow tell all the client to refresh the weapons when someone "change weapon"?
@glacial lotus have you read cedric's network compendium? I'm not experienced enough to give you an exact answer, but I just read through his ebook last night and it would definitely help guide you with this. There's more than one way to skin a cat depending on your goal.