#multiplayer
1 messages Β· Page 371 of 1
Nothing special
@twin juniper forgot that one
It's triggers after rapidly pressing button for 3-5 times
Is there any way to verify that a person from your friend list is actually part of your current session (to filter them out from invites)
@cobalt whale you can let aim mechanics happen on client side, for better player experience
@verbal wave but I thought input is already client side
@cobalt whale client can change replicated variable but server will override it whenever a change happens server side. the whole logic will tangle terribly when latency is bad
so how can I let other clients to know this player is aiming when get rid of this stuck bug?
use a seperated ReplicatedIsAiming variable, which the client changes via server RPC
but it's just a way to tell the server what is going on. The actual aimming logic doesn't depend on that
actual aimming happens locally
set aim rotation on client, rpc it with tick and set var replication to skip owner
and to save bandwidth, you can do a check has the value changed since last tick, no point sending same value twice
well, skip owner flag seems like what I need
oh and, for aim rpc events I suggest using single event that sends the IsAiming boolean
so, in case of packet loss it doesn't get de-synced
(if you send aim True, then after 100ms send aim False, but first send got lost in the way so reliable sends it again, you would end up with false-true, when the last input was false)
using skip owner does introduce the possibility of desync
well, it doesn't affect direct set values
Hey guys. Is there a way to move character from client? I need to move it a bit on client at some location.. Add Movement Input and Add Input Vector don't work.
I can't use Set location, by the way, as AnimBP works with velocity
Replicate Movement is off, by the way
Oh, and It is another character, not mine
Like other player enters the trigger, and I want him to walk forward on my side
@opaque seal had the same issue, I updated to 4.18.3 from 4.17.2, and am using steamOSS for hosting of sessions, it seems to work for now.
1.] Remember to do a Absolute travel when the host travels to the lobby/firstmap after successful creation of a session and make sure that the clientTravel is absolute when the client first connects to the host. Tried seamless at that point but it did not work.
2.] When doing LAN sessions with steam OSS , make sure you add "?bIsLanMatch=1?listen" to the travel URL, instead of just "?listen". Do this even if you specified the session as lan session in session settings during creation. For some reason that is still necessary...
3.] You can then use seamless travel for other maps and it would work...
@wary wyvern Hey flakky, were you able to solve the GC issue you were having earlier this week ?
@zenith yarrow What issue?
the one where your game would crash because it was unable to find a "item" object ?
Oh, nope( Even 4.19 doesn't help
I have absolute ticked for the
and addtoroot for the uobject didn't help ?
for the server side. I dont know where you get Absolute travel for clientside
@opaque seal client travel should be in on join complete. I was doing stuff in cpp and I set the client travel to absolute instead of relative
@wary wyvern AddToRoot() adds Uobject to rootlist so that it is not GC'd
Yeah I dont get what that means.
I get a length of 0 out of my found sessions array.
After joining a session a client should go to the map the host is on, and for that after join succeeds you need to do a client travel. Also, you may need to use ServerTravel when a session is created, at least that is what I am using...
@zenith yarrow I'l try
It does not find a session.
Another question, by the way.. How to destroy actor on server, but keep it on client?)
I don't think that's how it's supposed to work
If the Actor replicates, it'll be destroyed
You might only be able to tear it off
But I think someone tried that already
What reason is there to keep the Client version around anyway?
Yes, I tried
When character moves to another server, I want to keep his character and sync it with my own server, so player see, what he's doing on other server.
I have seamless travel to another server. Map is splitted my world compose
Each part is own server..
That works?
What works?
The whole "Travel to other Server and keep Character"
Travel works, but character removes from server one.
Cause that sounds more like working against the system
Seamless Travel ,for one, is a ServerTravel thing
Not Client, as the fresh connection to a new server is a hard travel
Never a seamless one
If you want to keep Actors between servers, you'd need to save the data somewhere and request it back when on the new server
At least I wouldn't think that it works properly any other way
That is not the question. It works but I want to see other player from other server
Well, then you need to bypass UE4s servers and save the stuff on your own backend
Like position etc.
That is what I'm trying to make. I sync players with my own server. But I need to keep character on client, when he travels to other server
Because if character travels to other, it gets destroyed from this server, and I cannot see him
You mean if Player A leaves, you want to keep the Character on the Server, visible for Player B?
Yes, but I need to keep it on Client B. No need to keep it on server
That's what I'm trying to make
Okay, how about you don't stop the Character from being destroyed
But rather catch the event (Event Destroyed or Unpossessed)
And then spawn a local version that you handle yourself
Well, I could spawn, yes.
So just a dummy character you spawn that gets information from the backend
On Destroy
Then you don't have to fight with unreal
Good point. The proplem I have is to send all the info, like Equipment, weapons an stuff..
But that is easier.
Well but that's in both cases
I mean, on Destroy, you can spawn "DummyCharacter"
Lightweight version
That is not replicated
Spawn it only on the client and pass it all info from the character that gets destroy
For the initial setup
After that you'd need to handle the character sync via your backend
But that's something you need to do anyway
Even if you keep the client version
Yeah, I got it) Thanks)
@thin stratus if he spawns on the client only the client he spawned the actor on will be able to see it right?, so if there are other clients on the same map they would need to spawn the actor too, right ?
Yes, everyone needs to spawn it, who gets his destroy
Well, OnDestroyed calls on everyone
Filter the Server and let everyone else spawn a local copy
bigger question is why would you want to do this though?
what so thy pick it up you then resspawn them
umm not really, so items despawn and respawn after a while to rotate loot around the map
if its picked up it is destroyed
but if it despawns it just relocates using a pool system rather than destroying
bascially repurposes an already spawned actor
youre already pooling then . so whats the question how to optimise it ?
i guess i do mine differernt from most people . i dont have the items there on the server the whole time . i have a trigger volume for each area of where items are going to spawn. and when a player enters the trigger area only then do i spawn the items . i also start a timer when players leave the trigger. if no players enter the trigger before the countdown the items are destroyed
im just asking if putting the pool actors up in the air outside of a replication distance is a good idea
or should i turn replication off when its waiting
not sure you can turn toggle replication in runtime though
trigger volumes work, but then loot isnt random and spread over the map, it's only in that area
@opaque seal I think I read in a article somewhere, that your steam session need to be presenceSession if you need the NAT stuff. Make sure that while hosting and finding the session it is marked as a presenceSession.
Dunno I'm up to about my 50th forum thread. THis once worked. It worked for a good week, then it stopped working. Not I make it Null and clean out the SteamOSS stuff from Engine, and I cant join over LAN either.
The only way it works is to open 127.0.0.1 on the second window once the first has hosted.
Using the SteamOnline test project, I get connectivity between 2 systems on 2 steam accounts, just like my game used to. I've even copied my entire project 'into' that working Stema example, and it doesn't woprk again.
Sick of compiling over and over to find out it wont work. The basics are all there, using advanced sessions, I even did a Steam Online Subsystem check, and I get true, once I'm sitting in the lobby.
(If I do that in PIE, I get an expected false for Steam, which is normal. But 2 standalones give me true on host, but cannot find sessions on other client)
Have tried 20,000 num sessions to search for as well, using 480 ID.
From getting a good look at so many threads, this would have to be the most randomly unsolved problem with ue4 that goes around since 2014.
My actual project hasn't gone anywhere since about Jan 10th because of this, really irritating and essentially makes me wanna give up. Give us better sessions!
So this this stage I've removed all Steam from defaultEngine so it's just:
[OnlineSubsystem]
DefaultPlatformService=Null
Cannot find LAN sessions either.
I even get this in the log
LogOnline: Verbose: Sending 16 bytes to 255.255.255.255:14001
LogOnline: Verbose: Sent query packet...
LogOnline: Verbose: Received 16 bytes from 192.168.1.200:14001
(One PIE picking up the broadcast for sessions from the other PIE)
are you comfortable using cpp ?
Not particularly. I didn't touch cpp and it went from working to not working.
could you show me the BP where you find sessions ?
try get the advanced sessions plugin it might help
it extends the existing sessions system
Also tried advanced sessions, did not fix it, and does not explain why it went from working to not working in the first place, or why LAN won't work, or why all of this worked in PIE then didn't.
It's messy because of mthe print strings I use for debug
But in saying that, I'll paste what they return
LogBlueprintUserMessages: [ServerMenu_C_0] Server: 2 Find Session Success
LogBlueprintUserMessages: [ServerMenu_C_0] Server: 0
LogBlueprintUserMessages: [ServerMenu_C_0] Server: 4 Loop Complete
LogBlueprintUserMessages: [ServerMenu_C_0] Server: 5 No Session Found After Loop
If you cut out the print strings, it's a dead copy of the Multiplayer Shooter, 28 video set on youtube do make the menu, etc.
I always get array length of 0 on sessions
(So, FindSessionSucess is kinda misleading, ignore that, poor usye of words)
Num Of Sessions Found is set at 20 (where it once worked) but I've made that all the way up to 20,000 (from reading various addpi 480 threads)
appid*
if your are using ossNULL the app ID wont matter
Well right now all my Steam related stuff is removed from DefEng.ini and I just have
[OnlineSubsystem]
DefaultPlatformService=Null
Cannot find sessions with either LAN checked or not. I've also removed links to Enable LAN andd set it manually as another test, did not help.
(On both the find and create nodes)
did you try disconnecting the pins on enable lan and checking them to be true ?
Thats what I meant above, yes. Both ddisabled and Enabled on 2 tests, and both on the Find and Create Session nodes.
Every possible combination. And again, this once worked, so I just dont get it
I also tried advanced sessions and used their node, added a GAMENAME filter on both create and find session nodes, as per their BLueprint example, also did not help.
Can you force replication even if nothing has changed? Trying to combat some crazy desyncwitha boncuing projectile
The host is succesfully created right? and you are on the same lan ?
Well the host joins the lobby using the on suiccess with create session node
I just found a jan 5th backup of my project which works, but is far behind. Considering I've wasted weeks fixing something I've felt is 'just around the corner' maybe I should just go back and r ebuild from there
Hey, suddenly out of nowhere, i canΒ΄t see the other player on joined session. I checked all the common problems like owner no see and so one. Does anyone have an idea why that is happening ?
Not constant weeks, you know, just no reprieve from the problem for that time period. Cheers.
Can someone please double check that I am not going crazy
This signature:
virtual void OnSessionInviteReceived(const FUniqueNetId& UserId, const FUniqueNetId& FromId, const FString& AppId, const FOnlineSessionSearchResult& InviteResult);
Matches FOnSessionInviteReceivedDelegate?
Nevermind, I am in fact an idiot
@thin stratus - Sorry to ping you, just run into a small snag and I google isn't being very helpful... is it possible to accept Steam invites from in-game? So when I get an invite, and I'm in the game, I show a pop-up, the player presses accept and I tell Steam that the invite is accepted.
The IOnlineFriendsPtr::AcceptInvite() is not supported by Steam
Found the problem. Was something inside the .ini . Happend when copying from a post on the internet. The first Time i did it had it all right, second time ( another post) had it wrong. Took me 8 hours to fix this.
@ripe raptor yeah, however can't remember what exact method that was
damn
If you have the code in some project, would you mind looking it up if and when you get the chance? I've been trying to trace back where the OnSessionUserInviteAcceptedDelegate is called to try and find what I might call, but to no avail.
Sure
thanks
hm, the FOnSessionInviteReceivedDelegate isn't getting fired either on the client getting the invite (steam does give an invite notification)
How to check, if actor has serverside copy, or it was created on client?
Oh.. if(HasAuthority() && !IsServer()){}
How can I keep a sound playing across ClientTravel
like if i travel from main menu to in game
i want to keep a song loop playing
So apparently
Steam never fires the FOnSessionInviteReceivedDelegate in my game
Even though it seems to be properly set up no matter how I look at it
Alrighty.. so moving items to a pool based system keeps ping a lot more stable and i dont have the garbage collection hitches
@ripe raptor I know you would search the session via "Sessions->FindFriendSession"
Lemme see
Yeah
And when found
you simply call JoinSession on it
Now about the "React to an Invite"
Let's see if I find that too
OnLobbyInviteReceived
Should be the correct thing
Need to manually bind it via STEAM_CALLBACK_MANUAL(Class, Function, LobbyInvite_t, Callback)
THen register it OnLobbyInviteReceivedCallback.Register(this, &Class::OnLobbyInviteReceived);
OnLobbyInviteReceived(LobbyInvite_t* CallbackData)
THat's the signature of that function
And IDs are like this
FUniqueNetIdSteam InFriendId(CallbackData->m_ulSteamIDUser);```
You can then use that to get info about the Friend via the FriendsInterface
And since that is a steam callback, when reacting to it you will want to move that back to the gamethread
//Send Blueprints Notification
AsyncTask(ENamedThreads::GameThread, [this, FriendName]() {
UE_LOG(LogSteamBeacon, Log, TEXT("Running inside AsyncTask() TRUE"));
BPEvent_PartyInviteReceived(FriendName);
UE_LOG(LogSteamBeacon, Log, TEXT("Exiting AsyncTask()"));
});
Oh, lobby!
Man, thanks a ton
I already posted about it on UDN but eh, good to know
hello has anyone had any experience with this error
LogWindows: File 'aqProf.dll' does not exist
LogWindows: Failed to load 'VtuneApi.dll' (GetLastError=126)
LogWindows: File 'VtuneApi.dll' does not exist
LogWindows: Failed to load 'VtuneApi32e.dll' (GetLastError=126)
LogWindows: File 'VtuneApi32e.dll' does not exist
LogPlatformFile: Not using cached read wrapper```
my dedicated server crashes when calling events as the server
all google answers say to just clear intermediate and saved folders which i tried and didnt work
ive rebuilt the project and repackaged several times. never have any errors at all when packaging etc
you using the vanilla engine version?
Im having issues where my HUD is not being shown to the server and only to client
i create the HUD widget in gameinfoinstance and calling it in GameState
That does sound particularly awkward.
Isn't HUD considered to be a client-only thing?
Yes, but a ListenServer would also have a HUD
Ah, yeah. @opaque tinsel c++ or bp?
sry its bp
thats in the GameInfoInstance
and Im calling Main HUD in the GameState
Is there a reason you're doing that in GameState?
No reason, is there a better place to do it in?
UI stuff is not replicated so should generally be client-side. Character and PlayerController are good places to do it.
i tried calling the HUD in PlayerController but its still doing the same thing
is it weird that it works in new editor but when i package, it doesnt work
Actually
That is fine how you do it
BeginPlay calls on everyone
so that will create one UI per player
You will only want to filter the DEDICATED server, if you plan on using one
For listenServer setups this is fine
Did you try placing a few PrintString to see what code is calling and what not? @opaque tinsel
Is there a way to turn off replication and then turn it back on?
you can set bReplicates to true or false at any point (per actor)
seems to still replicate
Character has a variable called BEARD and it is a replicated variable. When they overlap another object ON THE SERVER I set the variable in the character. The client version of the character thinks BEARD variable is still null unless I run a RunOnOwningClient and pass through the BEARD value. Is this correct?
I thought if you set the variable to replicated you only had to set it on the server and not the client.
@cedar swift what you need help with?
https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)
thaat says target.cs not server target when are youi getting this error ?
when trying to build the server in visual studio>?
take it to pm so we dont flood the channel
Is there a reason ShooterGame replicates down a struct with an impact origin (FVector), ReticleSpread (float) and RandomSeed(int32) with every client shot, even if the hit doesn't cause damage? Seems like it would be more accurate but a bit wasteful if firing a big machine gun that doesn't need to look 100% accurate on remote clients
Hi buds, one question I hope you love:
if the server randomly set a replicated variable very fast , say, bool CoinFlip 10 times in one second. And the network condition is terrible so the package may arrive at different time.
Does the replication system go out of the way to make sure the final result is the same for client and server?
like using a timestamp for every package or something.
@thin stratus yes i did, and the HUD is being called in the server but its not showing it
Anyone know about multiplayer physics issues or have attempted to mitigate those issues?
when you spawn a player does that consume the spawn point? and if so how can I spawn multiple players at the same point (in case for spectators)
no, unless you tag the spawn point as used manually
and playerstart is really a simple placeholder, you should really do a custom system yourself
ah ok cool, atm i was just overriding chooseplayerstart and looping until i found the spectator spawn. however for some reason the 2nd actor to spawn gets spawned at world origin. it's probably something I did in code that it's behaving that way.
actually specator does have some default collision from APawn i believe
that must be my problem
cool well thanks for the info! I'll see if disabling collision makes it work
hmm yeah still not working
looks to be a problem in my function it's not finding the spectator spawn
yup found my problem lol nothing to do with spawns at all more like a possible replication error from one of my checks
@slim holly That's what I thought. I worked with multiplayer physics for months to my dismay, so i had to drop my project. However I found a developer working on a similar game (actually almost exactly the same) and asked him about it and his words: "UE networks physics but they didn't seem to add interpolation so we added it. It looks decent."
So I'm now confused. Half doubting myself half doubting the developer.
Because UE has interpolation
it's doable in small scale, but just interpolation is not gonna be accurate
so it's really use context
i was just fighting with network phsyics myself recently pain in the ass
bandwidth is probably the first hurdle to overcome
that's easy to change
even if you give UE access to excessive bandwidth, latency is the issue
you can't just throttle it and assume it will work
and latency
physics are allergic to time-dilation changes
here's the post and the response by the dev: https://sandbox.facepunch.com/f/gd20/gvtv/Multiplayer-Physics/1/
they didn't change it to make it fixed timestep, so it's not that
oh my god that thread just hurts my brain in general
same xd
Layla is one of like 3 developers on the project, garry used to commit changes but hasn't in a while.
ahahahhah why I came here xd
update rate however, may or may not be fixed timestep, latency on the other hand is not fixed
so if you can sync all those together then yea you can do accurate replication
yeah but if you make the engine fixed timestep you can make physics about as good as source engines, which is what I imagine they're shooting for
you can make it fixed, but do you want to run a video or play a game?
I woudn't make it fixed, I'm just trying to figure out how this dev did it
or is claiming to have done it
do you guys talk about movement prediction ?
no, physics
oh how they'r replicate physic state ?
No, how're they are claiming to keep it in sync by adding interpolation
never tried it, but i would get pos, speed, rot and fix that by adding force and if gap to large reset to new data
But the engine already has physics interpolation
an interesting talk about the subject
but as you can see, even after super hyper optimization the bandwidth will limit the experience to <20players
or, 20 objects
That's actually about where i got with my project
Having about 50 rigid body cubes in a pile is when it stopped working.
yea, and you're suppose to build a game on top of that
reducing the value significantly
the value?
50 cubes minus gameplay replication
was that test in LAN?
Oh, yeah I know. But they're making gmod 2, so a limit of 20 props won't cut
that was test through multiplayer
I mean, "welded" and welded
considering the object data is available for all clients, it only needs to replicate one simulation result
it doesn't need to send location data for each part
Yeah, I'm still confused at that developers comment though. I just felt like I was missing something.
a bs comment
fake it basic rule for everything
but I mean that's the core of that game, there's no point in adding anything else if that doesn't work
it's not fake as such, just well optimized
I mean you can turn off client sim, but waiting 50-100ms for objects to move feels like an eternity imo
you kinda have to
that's why the gmod gravity gun beam bends
it's latency
just hidden in plain sight because it also bends when you try to lift heavy items
Yeah, but in gmod when you as a player walk into/drive into a rigid body, it'll move. Even if you've got a poor ping.
Can anyone with steam help me test to see if you can find and join my server
260mb packaged file with hos t and join buttons
would be quick test
Whats the link?
thats a loaded question. badoom chhhh
it looks right to me. Just an idea, you might think about switching out that AND for a NAND then you could drop all of those NOT's
yeah i tried NAND, but it doesnt really work properly
@opaque tinsel why do you replicate the montage variable
It's an asset, available on everyone. You set it in the BP before you start the game
Also your multicast etc doesn't need to pass it. It's only needed directly at the play Montage node
Would only make sense to pass it if your function was a generic one that plays different montages. For holster or equip you could easily just have an onRep boolean
Are actors such as Character and PlayerController automatically spawned on the server if they are spawned from player start?
PlayerStart is just an actor. It doesn't spawn
It's used as a spawnpoint
GameMode spawns Character and Controller
Does GameMode only run on the server or it's also running on the clients?
or what I mean is when GameMode spawns the Character and Controller, is the server spawning them and having authority over them?
just found your compendium, gonna read through it π
It answers the questions :P
@thin stratus oh also one separate question. For trying to make a networked top down game, people recommend having a proxy actor on the client which has a playercontroller that passes input to an AI player controller on the server which is replicated back to the client
Is this the way you would go about this?
I've also seen people that say that AddMovementInput should be used and a new CharacterMovementComponent should be created
I wouldn't do either
You can simply ask the NavMesh for a Path
And use a normal directly controlled pawn
Or character
Well I'm doing just that
And well actually you can use add movementinput then
oh wait don't shrug just yet, I'm pretty new so I might take a bit to get this
so the easy way would be to have a server RPC which calls SimpleMoveToLocation on the character on the server?
and this would be replicated to clients?
It should at least
However might look a bit laggy
I would try to get a path from the navmesh and use addmovementinput or so to move the character towards tje next path point
and I would be using addmovementinput in the Tick() function for the character?
and this will be automatically replicated?
Addmovementinput is networked yes
don't have to touch the CharacterMovementComponent at all?
Not if you can avoid it
and this would go in Tick()? Just going down the path and using AddMovementInput?
Yeah, you don't have any Axis input here so tick is fine
Direction for the Input is simply "NextPathPoint - ActorLocation".Normalized and Z value set to 0 (after normalizing)
Although, you might be able to leave Z
ah so if I was going up a ramp then the Z should not be 0
Na, you usually use the ControlRotation
Which is the camera view direction
So there it's also not 0
So just leave Z
Shouldn't matter
Great, thanks. All of that made sense so hopefully I can implement it
when i use IP for connecting ("open <IP>"), do i have to use Destroy Session when i quit game or disconnect or i just use Open Level?
Open Level should be enough
ok
are grenades in fortnite physics or somekind of formula/spline?
Grenade physics are really simple tho
throw velocity + 0,0,-980 *delta^2
you could use projectile movement at low velocity for it
if you don't feel like doing it manually
In UE I can do multiplayer game with only 100 players?
okey, but UE has the limit?
not limited, just recommended to 30 players
So I can build own network module or uptade ue network module for more players? For example 200 - 400 players @slim holly
Hello, so im trying to create a multiplayer game however im having some issues. I have a custom Pawn class that has 2 hand child actor components. WHich are of type BP_Hand. This BP_Hand has a skeleton mesh, collision sphere and widget interaction
all components and the BP_hand is set to replicate. As well as all the replication bools are ticked in the BP_Wizzard class. Yet the interaction debuglines disapear on the client aswell as the server cant see the clients had move
Can i tell a multicast to execute on the server at Last?
so like if i use Server Variable with multicast i remove them first on the clients and the last on Server
because if a multicast removes the variable first on the server the clients can't use it anymore
And if i can how can i do that ?
Nvm i fixed it already
Hello everyone! Iβve been modding games for years and Iβm taking this to the next level. My aim is to do a simple FPS game, with the only main complexity being the fact that itβs multiplayer. I already have googled for a list of resources and started following the UE multiplayer screencasts.
Does anyone have good pointers for me, as to which resources youβd recommend starting with? Thank you in advance for anyone willing to input π
It looks like Iβm in for many months of sweating, which is fine π
Has anyone had problems running multiple server on the same dedicated box when using steam as the oss?
I can't seem to get more that one server to init the Steam API.
@sleek pumice Nope, but you need to run them on different ports
UE4 and query ports afaik
If I run what I showed in Β«Event tickΒ», (basicly move forward and backward by input change state) what would you suggest to me if I want to reproduce the same result by using Β«addInputVectorΒ», inside an identical map, with the same start location?
Over a network using TCP
Hey guys, who knows how to make client travel from one server to another and keep it's controller? I need to make this from server, not client.
I also need seamless travel
Is Someone Useing Advanced Sessions? i can't get Session Settings it always fails.. someone else with that problem ?
@wary wyvern Seamless Travel is a Server Travel
Not a Client Travel
From Server to Server is designed to be a hardtravel
But I need seamless travel from server to server
Afaik that's not how UE4 is designed
Then you need to create your own server backend and probably also adjust the engine
You don't need backend. We've made seamless in our project. I just want to make it on my own
I can only tell your that seamless is for server and not client travel
If you made it work then do it again?
99% of the poeple here simply join a server and leave it again. As that's how UE4s Servers are used
@thin stratus I didn't, our programmers made this. I just want to make it again..
What about ClientTravel?
ClientTravel is afaik a hard travel. Seamless traveling is when a server changes maps and doesn't disconnect the clients
If so, there should be a way to send actor to other server..
Does anyone know if there any sort of pre-processor macro that is defined with Steam is enabled?
theres a call for if its loaded or not
Another question.. Is there any way to send data from one server to another? Without other server backend
I assume you could do some TCP/UDP connection stuff in C++
for a multiplayer game with a very simple inventory per player (primary weap, secondary weap, healthpack, ability), would you bother creating inventory logic or instead simply have a pointer for each "slot", as in if the user presses F on a health pack, it'll increment the "CurrentEquippedHealthPacks" var directly
Then if he presses the "Use healthpack" button, it'll check if the CurrentEqiuppedHealthPacks var is > 0 and use
I found UIpNetDriver, so I could connect and send data, but trying to make it work now. Lack of documentation(
@thin stratus
is there a tutorial to implementing sql without using a plugin?
You'd need to integrate a system that handles communication with the SQL server.
Interface with a php doc to interface with mysql ;0
Anyone particularly knowledgable about PostInit() ? I'm getting what looks to be a recursion error (or something of that nature)
i.e. I have this bit of code
if (ItemInstanceClass)
{
//ItemInstance = NewObject<UBSItemInstance>(this, *ItemInstanceClass, TEXT("Instance"));
}
I get a Stack overflow - code c00000fd (first/second chance not available) and it points to that ItemInstance line of code when I uncomment it
What is ItemInstanceClass' type?
If it's a UClass* or a TSubclassOf, you shouldn't have to manually dereference it
Yeah, you don't need to dereference it, but I'm not sure that's part of the issue
Well, if it's just a TSubclassOf, I'm not exactly sure what's even allowing it to resolve to a boolean in the if statement
hmm I thought it'd resolve to null and therefore fail if it wasn't set?
Well, a normal, non-pointer struct can't just 'resolve to null'
It might be using the dereference operator implicitly, dunno
And I guess you don't need to worry about dereferencing it; there is an implicit operator UClass*(), but I'm guessing it's not harmful to do it manually
It just stuck out at first glance
well, might explain why it tries to create a new object and crashes
I'm just talking about compiling, even
Try sticking a dereference within the if statement? That'll check if the internal UClass* is valid
Oh, I really need to read errors better
That's my bad, rofl
I just saw the c0... and assumed nullptr access
π€¦
But huh...that does make things interesting
Actually, just to add more insult to injury
So I have two classes - ItemDef and ItemInstance. ItemDef is what I've CnP'd
But ItemInstance has the same function.
i.e. if (*ItemDefinitionClass) { //ItemDefinition = NewObject<UBSItemDefinition>(this, ItemDefinitionClass, TEXT("ItemDef")); }
An Item Def creates an instance from a TSubClassOf and Item Instance creates an instance of ItemDef from TSubClassOf.
If I comment out one of them, it works fine.
Doesn't matter which one; I'm guessing I've got a recursion problem ItemDef Creates an Item Instance, Item Instance creates Item Def, Item Def Creates etc etc
Yeah, that sounds like an issue π
heh
Truth be told, an item def doesn't need an item instance.
though Sion may disagree. And I don't want to disagree with Sion.
If I run what I showed in Β«Event tickΒ», (basicly move forward and backward by input change state) what would you suggest to me if I want to reproduce the same result by using Β«addInputVectorΒ», inside an identical map, with the same start location?(modifiΓ©)
Over a network using TCP.
https://cdn.discordapp.com/attachments/221798862938046464/409915714447736832/unknown.png
Np
This sounds very interesting
It is, unfortunately they don't use unreal's replication
Can be very convoluted to work with
maybe i understood wrong but isnt that the whole point? unreal replication and networking isnt designed or suited to mmo . so they use their own system and extract the networking away so esentially unreal just becomes a client so to speak
@grand kestrel
Well, sure, but that's still way harder than using Unreal's replication
Though if you're making a MMO, your 100-heads team can surely afford it
Not really to do with whether it's the whole point or not, I say it's unfortunate because then you're tied to SpatialOS (and at their mercy)
The system is really a pain in the ass to work with
A lot of it is outside of the engine and frankly just odd
Like the schemas
Could be on actors or w/e
ah i see what you mean now . true but its only in beta with enough people trying it and giving feedback and time this could change .
and i dont see whats difference between being reliant on unreal or another 3rd party platform . i mean currently im using unreal , gamesparks for database backend and aws for server hosting so im reliant on 3 already . would be nice if there was an all in one solution
You become reliant on two too-big-to-maintain-yourself systems instead of one, AND the support between eachother
If SpatialOS drops UE4 because Unity buys them, or if they are slow to update, or don't support the console you want to ship for, then you're fucked
yeah but its the same for any of them
You can have a very high confidence that UE4 alone is going to exist and support consoles for the coming years, if only because a few major studios use it.
Nintendo uses it, Microsoft uses it, Sony uses it
Epic does PC games
The support for UE4 at this moment is pretty much 100% sure for the 2,3 years to come
yes but ue4 alone doesnt provide everything needed
For a MMO ? Probably not
for most games
What kind of stuff does UE4 lack that "most games" need, and require third-party software rather than a few hundreds lines of code ?
databases. server hosting ??
UE4 is absolutely strangled by the dependance on a single game thread and low core frequency + high core count
Most games definitely do not need databases, and server hosting has nothing to do with the engine
the point was reliant on thirdparty solutions
unreal doesnt provide that so you still need other solutions
If you need a database and server hosting, you can use anyone
Any database works, remotely or locally
And any kind of server hosting can work too
It's very easy to move from one to another
if you don't want to dependd on third party, the only way to roll your own solution
@bitter oriole on that I disagree
if you build backend using cloud
you are pretty much locked down to the single cloud provider
unless you really try hard to use cloud indepedent stack
Sure, but then again, everyone on the planet has that constraint
yeah, no saying not, it's just not easy to move from one hosting to another, unless you just host single servers
Using a specific third-party networking stack is a much more obvious point of failure for your project, than using a cloud provider all your competition uses already
true, although SpatialOS is just glorified orchestrator running on top of FCP
GCP*
@worn nymph As to databases, since this was given as an example - you can trivially build an UE4 game that has zero dependency on the database vendor.
If the database is accessed from the server, as it should.
You're going to want some interface layer that ensures connections are from valid servers, etc - and that software will then tap into a database
The server is just going to see a socket and send requests, or even raw SQL if you're into that
Databases are exactly the kind of stuff that people do swap around during their project's lifetime
Not to mention database technology is mature, stable and diverse
What I'm saying is, don't build large projects upon stuff that could die overnight
Out of your subject, do you guys have try to make client movement prediction (without unreal replication) ?
I've done it with Unreal replication myself
what do you means ?
like you have your own movement prediction but over replication network ?
Unreal replication just offers a way to replicate data, it doesn't do any high-level stuff. Some UE4 classes have movement prediction, like ACharacter - others don't, so you might need to implement prediction yourself
Yes
Not the Character itself
Exactly
I know it comes with the class
Sure, just code location-wise
If you want anything else, you need to do prediction yourself
You'd not extend the character, but the component
To add your own prediction
Still on my list to completely look through that thing and implement proper interp for a physics based pawn >.<
The CMC needs an serious refactor lol
I mean if you need anything else than a walking animated humanoid character, then you need to build prediction yourself from the ground up
Yeah
We currently apply force and that works nicely for low-ping stuff
But yeah, anything a bit higher than 10-20 ping starts to jitter.
Just no time to face the MC
@bitter oriole I'm using my own tcp server and everything was fun until I need prediction for movement
Only heard bad, time consuming things
Well movement prediction is actually a pretty straight forward thing
yeah
Grab the last known data and simulate what the pawn would have down
- some timestamps to make sure the data is uptodate etc
I would love to keep it deterministic lockstep
So I try to only send pressed and release input
For the moment i'm not intersted in float interp.
Maybe it will became the easy solution, but even there I don't find anyway to make sure movement happen correctly with 10ms
@thin stratus If you could only send Β«pressed & releasedΒ» how would be sure position is good ?
do I really have to mark actor as replicated, if I want to replicate it as attachment ?
ie, I have weapon, and it's logic in in seprate object (which is seplicated)
replicateD*
Actor in this case serves only as visual representation in world, so I doesn't really need replication
I tried to spawn it on server and then multicast to all clients (and then spawn it)
but it is really unhandy solution
I thought that attachments are automatically replicated, but it doesn't look like a case
Hello, Can I set two different player one VR and other one non VR ?
on Same Computer
Hm, what logs could I enable to see session and online stuff?
Tried already:
[Core.Log]
LogOnline=VeryVerbose
But still missing session info
Guess manually calling DumpNamedSession might help
Hey cedric, just a quick question - you've sent me the LobbyInvite callback code a few days ago and it has the snipped "OnLobbyInviteReceivedCallback.Register(blabla)... where does that callback come from?
or sorry, bad question, it shoul be "is creating the callback via STEAM_CALLBACK_MANUAL enough to hook it up into the actual Steam system, i.e. will it fire with just that?
or do I have to do something else?
That should deal with setting it up for steam
I mean, the macro's name kinda says that
Yeah, got confused since I was chasing the wrong thing with the normal STEAM_CALLBACK and the way it's setup in FOnlineAsyncTaskManagerSteam
Now the only question remains is how to actually include the necesary headers for FUniqueNetIdSteam, since it keeps tripping a #if STEAMSDK_FOUND == 0 error in OnlineSubsystemSteamPrivate
FUniqueNetIdSteam might be in a private folder?
Had the same sh*t with oculus today
Had to force my way into the private folder
anyone know exactly how replicated vars behave in terms of packet loss? lets say i set X = 5, replicate that, then X = 3, replicate that, but X=5 is lost due to connection problems
whats gonna happen on the client, in detail, assuming no more packet loss
You'll just get X=3
Well, no dice with the lobby invite
the callback just isn't called at all
STEAM_CALLBACK_MANUAL(UArkhamGameInstance, OnLobbyInviteReceived, LobbyInvite_t, OnLobbyInviteReceivedCallback);
...
OnLobbyInviteReceivedCallback.Register(this, &UArkhamGameInstance::OnLobbyInviteReceived);
....
AsyncTask(ENamedThreads::GameThread, this {
UE_LOG(LogTemp, Log, TEXT("GOT STEAM INVITE!!!"));
});
That's in the header, the GameInstance's Init() and the OnLobbyInviteReceived function respectively
hmm i thought it woudl be reliable... e.g. it would wait for client confirmation for X=5, otherwise resend
@manic pine I wouldn't even trust that in correct network conditions
See replication frequency for that - if you change a value every frame and the freq is set at 10, how could you have all values ?
hmm yeah, it would cause excessive traffic too
Does anyone know if i can have an array of FName for this value in ShooterGame?
/** Keywords to match in session search */ #define SEARCH_KEYWORDS FName(TEXT("SEARCHKEYWORDS"))
i was hoping to search on more than 1 criteria for FindSessions
there are 8 CUSTOMSEARCHINT's in OnlineSessionSettings - i suppose those are it?
Yes
there's no example of how to use these - and it straight up says ....
#if !PLATFORM_SWITCH // On Switch, we don't have room for this in the session data (and it's not used anyway when searching), so there's no need to add it. // Can be readded if the buffer size increases. HostSettings->Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineDataAdvertisementType::ViaOnlineService); #endif
"Its not used anyway when searching"
bah - tahts some false advertismeent.....
SearchSettings->QuerySettings.Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineComparisonOp::Equals);
TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SearchSettings.ToSharedRef();
OnFindSessionsCompleteDelegateHandle = Sessions->AddOnFindSessionsCompleteDelegate_Handle(OnFindSessionsCompleteDelegate);
Sessions->FindSessions(*CurrentSessionParams.UserId, SearchSettingsRef);
it IS TOO used.....
Ey guys I got a question, are events (Like Begin OverLap, or OnHit event) already replicated? π
no, they run on both server and client(unless youve done something to prevent it)
separately*
no? so then whatever code i run through it needs to be replicated via Custom events? (Server RPC, mutlicast etc) ?
depends on what your objective is really
seems unlikely youd need/want to run the exact same code in them on both server and client
okeh I get it π thanks lots @manic pine ^_^
just keep in mind the fringe cases... actor position may not be identical, so its possible client could trigger beginoverlap but not server, or vice versa
@worthy wasp - You literally answered your own question. It's not used and there's no room for it ON THE SWITCH
i was told from a co-worker that the code can be ignored by the OnlineSubsystem safely...
specifically: SearchSettings->QuerySettings.Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineComparisonOp::Equals);
if a platform doesnt support something - doesnt it crash the game?
When I attempt to launch a dedicated server on Linux I receive this error: Preparing to exit.Shutting down and abandoning module NetworkFile (10)Shutting down and abandoning module CookedIterativeFile (8)Shutting down and abandoning module StreamingFile (6)Shutting down and abandoning module SandboxFile (4)Shutting down and abandoning module PakFile (2)Exiting.Exiting abnormally (error code: 1)
Well, one step forward two steps back, the othr PC receives my lobby invite callback, but crashes somewhere related to threading
joy.
Finaaally
anything past this would NOT get run on a dedicated server, correct?
if (MyPawn->IsLocallyControlled())
Yeah
Some shootergame code I'm trying to understand
else if (CanReload())
{
StartReload();
}
------------------ Later on in the same function -----------
if (MyPawn && MyPawn->IsLocallyControlled())
{
// local client will notify server
if (Role < ROLE_Authority)
{
ServerHandleFiring();
}
// reload after firing last round
if (CurrentAmmoInClip <= 0 && CanReload())
{
StartReload();
}
}
Thanks stranger
So in the code above, there is no IsLocallyControlled check, so the server and client will both check if can reload
But then later on in the function, it looks like the client will call the same StartReload function again?
Unless I'm missing something fundamental about C++, does the first StartReload() call exit out of the funciton and stop executing further?
Does shootergame support dedicated servers ?
I'm not sure but I'm writing my code to work for listen and dedicated
well there are dedicated server checks in Shootergame
So I think it aims to support all
Asking because IsLocallyControlled() on listen server doesn't do the same thing obviously
Yeah, exactly so this function is basically if local client or listen server, do firing logic, then check if not authority and fire again on server if not
But the StartReload() function seems to get called twice
If you can reload and are out of ammo
It's really headwrecking to consider where and when everything is being called
Just trying to understand if StartReload() needs to be there twice, or if the server and client will pick it up in the first check. I need to delay the startreload by a small amount in order for the end fire FX to properly play on remote clients and I'm debating if both calls of StartReload() need a timer call as it seems only the second one needs to have a timer on it to work
Ok I commented out the first StartReload() that both server and client would hit, and just kept the second one (since the client only needs to call it as there is a ServerReload RPC triggered from within there) and it seems to work fine
Just query unlocked achievements on the start of your game and unlock the gun when the achievement is found?
There's nothing stopping you from doing your own isolated achievement system.
As for cheating
I am not 100% sure if Steam achievements can be broken that easily
but I haven't much looked into it really
I'm fairly sure you can programmatically cheat achievements tbh
Well yeah but that's now a question of what you want to do - save the user's progress as a cloud save or unlock the awards via achievements.
or you can do both as an extra layer of security
@ripe raptor would saving this information in the same place you might save stats be better? Say a data server you have setup that the game reads from?
Does GetNetMode() != NM_DedicatedServer
basically return the same thing as
OwningClient->IsLocallyControlled
If you are locally controlling a pawn, that means you are either a local client or a listen server host, not on the dedicated server right?
It would return the same on the pawn for the local player
GetNetMode() is global IIRC, while IsLocallyControlled() is for a specific pawn
Also IsLocallyControlled() works offline
So they're subtle differences
Thanks for the reply @bitter oriole I'm not sure I fully understand the difference in this case of Shootergame code
if (GetNetMode() != NM_DedicatedServer)
{
SimulateWeaponFire();
}
if (MyPawn && MyPawn->IsLocallyControlled())
{
FireWeapon();
}
Do those need to be 2 checks? or can they both be condensed into 1?
GetNetMode() != NM_DedicatedServer will return true on all pawns if you're playing coop with a listen server
IsLocallyControlled() will return true only on each player's machine
and false for the other player's pawn on each machine
So yes they are different
SimulateWeaponFire() is called on all non-dedicated-server pawns, FireWeapon is fire only on locally owned pawns
That almost makes sense, thanks for the explanation. The only problem I'm having now is that the only pawn that needs to worry about calling that function is the local one, because the server sets a repnotify variable which then will call that same function on remote clients
So I'm not sure if there's any significance for it to be behind that check
SimulateWeaponFire() might just not make any sense on a dedicated server
I guess it's all display
That's why I'd just move that function into the locally controlled check, then the server would never need to call itt
This stuff is so brain melting I swear haha
YOu definitely do not want that
Or SimulateWeaponFire() would be called only for your pawn
And you wouldn't see the effects from another player
No because the server increments a BurstCounter int which is a repnotify variable
That repnotify then calls the FX for remote clients
Ohhh if you were a listen server host tho?
Maybe?
Well, I don't know the other code, i'm just talking about the code here
Man I'm so confused
The only thing I can say is, if you put SimulateWeaponFire() in the IsLocallyControlled() if
Then SimulateWeaponFire() won't be called for "other pawns" anymore
It'll only run on the local client, but it would never run for other pawns anyway because they aren't calling the firing function
"Other pawns" meaning pawns that you aren't controlling - oanwed by other players
They are only calling the play cosmetic fx functions which gets called from an onrep variable set by the server later in the function
So basically I think it only needs to run on the owning client at this point in the code
But there must be a reason it's there as shootergame was made by Epic
Shootergame code is a lot harder than it seemed on first reading
Just because you have to consider not only local, server and remote clients, but if the host is dedicated or a listen host
And do the right things in all of those cases
And they have split screen on top of that...
its not so bad
you have your clients fire function, which creates local effects and notifies server of hit/miss
then server hit/miss function which confirms, then does a multicast for visual fx, then the visual fx function which checks if shot was made locally and skips out if true
so it doesnt duplicate visual effects
@manic pine but things like end fire fx have lots of specific cases to handle especially with remote clients
If you go with the default logic to instantly reload as soon as the last bullet in the clip is used, the remote clients won't play the end fire FX as the onrep var gets set and unset in one frame so you have to offset it with a delay
at a high level the system is fine but when you have to try and ensure that everything happens correctly from many different perspectives, it's a bit difficult
I haven't worked through to the confirmed hits yet but so far there have been no multicast RPCs at all
it is all using repnotify vars to then tell the remote clients to do something
ah yeah, that demo uses full auto fire i guess
ive only dealt with semi automatic in my projects
I'm doing both that can be toggled so it's even more annnoying because some stuff works great with semi and not with full
So just figuring out how to get all cases satisfied with the simplest code possible
hmm... what about a ForceNetUpdate after setting the var?
may not be a great idea, im not actually entirely sure how that function works
I fixed it with a short timer before calling the reload logic which works great
Still some edge cases not quite working like a listen server client being able to fire off an extra cosmetic shot when he shouldn't
But that doesn't happen on dedicated or when hosting lol
I mean it can all work fine as is now but I feel it's better to make the core architecture as solid as possible before trying to build on it
I know it's fixable just will melt my brain before all cases are covered!
Maybe it's better to just not try and code the listen and dedicated cases and just have dedicated only
shouldnt be much difference
It's just so much easier to read- this runs on server, this doesn't
Instead of- this runs on server, this doesn't...unless you are a listen server host in which case it does, so don't actually call that logic again
yeah but you shouldn't usually have to differentiate between them
player input should always lead only to stuff that runs on client
Yeah in general it's fine but when dealing with anything like shooting that needs lots of stuff to happen in multiple places, it becomes difficult
I'll just have to keep rereading and understanding it
have they fixed the bug i submitted yet ?
im trying to find if ive actually made any concessions for listenserver anywhere, but i dont think i have
i think it just works flawlessly in both dedi and listen
if you hold down fire untill all bullets are fired but dont let go it keeps firing on other clients version but stops on local
Yeah stuff like that
Loads of error cases to handle
And stuff like if you hold down a semi automatic shot button and release late, the end fire fx plays
So you have to manually end the semi auto shot but not manually end the full auto
well i wouldnt really trust the tutorial projects to be bug free
No it's a fantastic resource
definitely, for ideas and such
And good to question it too
but the UT source is even better
Just some parts can be hard to understand like that double check for net server or locally controlled
from what I've seen on the UT source, there's loads of fluff around every function
So wanted to keep it simple at first ot learn
fluff as in stats, loads of extra checks (isfeigningdeath etc)
Lots more movement checks
It's a bigger beast
Would you say the code there is pretty rock solid there?
theyve considered a lot more stuff than in e.g. the shooter demo
so it handles a lot more scenarios and fringe cases
as you say though, it also has a lot more features and things to consider, which does make it a lot more complex
Yeah like each weapon basically being its own class
and not a simple BP child class
Will take a lot of time to read and understand
I do think they have some lag compensation though
For shooting
yeah, i believe they have for both hitscan and projectiles
That is great, basically the only public lag compensation example for UE4 shooting?
haven't seen one anywhere else
i think you can find a hitscan tutorial out there, but not necessarily projectile yeah
oh, for your specific case of that visual effects thing
keep in mind there's a prereplication function
not sure how UT handles it though, you could have a look in one of its automatic weapon classes
What would that mean in general, something that is automatically called before replicating down properties?
yeah its called right before an actor starts this tick's replication... on second thought though, it may not be very useful in this case
it might also be an idea to send time instead of just a boolean
i.e. startfiretime endfiretime
seems very messy this way of keeping track of it though
ban automatic weapons
^___^
Not sending a bool, sending an int
So if the currentfiredshot is > 0 when ending the shot, then you know it has fired at least once so play the end fx
otherwise do nothing
right
Hi guys, so I just wanted to know how I can display a HUD Widget just to one player (I got local / steam multiplayer up and running). With these settings it'll display it on all clients.
Anyone know how to replicate instances
I was just wondering what the level of effor twould be to move the character multiplyer perdictability code over to the flying pawn movement?
@dull saddle You can check to see if that character IsLocallyControlled
I've been plugging away at the blueprint multiplayer tutorial on youtube, and it keeps failing to load levels here. Is there a real basic error in these servertravel commands?
iirc you only need the level name, without the path to it
it... actually seems to be working without the path, but not with
so, thanks for that
just Content/Maps
Yeah see
you can't have your maps in the maps folder, and try to load them with Content/MAP
The path needs to be correct
so /Content/Maps/whateverfile or Content/Maps/whateverfile?
If the you have "Content/Maps/MapFile" then just write "ServerTravel MapFile"
UE4 actively searches for the files
aha
The Content/Maps stuff is more for packaging
Maps in different folders might not be auto included/cooked
hm, I always did /Game/Content/Maps/MapFile
In any case, @thin stratus could I bother you with a minute help, been tearing my hair out for a full day on this
Good luck π
But yeah, I managed to set up the lobby invite stuff from earlier, and I am now trying to figure out how to cache the LobbyInvite_t response while I wait for the friendlist fetch. Here's the shortened code I got: https://pastebin.com/6m7DxrLq
It crashes on the "CheckFriendId" log due to a pure-virtual function call, presumably because the FUniqueNetId is invalid at that point
I am 99% certain that passing shared pointers doesn't work the way I did it
Why do you need to read the friendlist at that point?
To show the name of the friend who threw the invite
You don't have to load the list for that
Oh?
void UYourGameInstance::OnLobbyInviteReceived(LobbyInvite_t* CallbackData)
{
AYourPlayerController* const PlayerController = Cast<AYourPlayerController>(GetFirstLocalPlayerController());
if (PlayerController)
{
FUniqueNetIdSteam InLobbyId(CallbackData->m_ulSteamIDLobby);
FUniqueNetIdSteam InFriendsId(CallbackData->m_ulSteamIDUser);
LobbyIdInvite = InLobbyId;
FriendIdInvite = InFriendsId;
IOnlineFriendsPtr FriendsInterface = Online::GetFriendsInterface();
if (FriendsInterface.IsValid())
{
TSharedPtr<FOnlineFriend> FriendInfo = FriendsInterface->GetFriend(0, InFriendsId, EFriendsLists::ToString(EFriendsLists::Default));
if (FriendInfo.IsValid())
{
PlayerController->OnPartyInviteReceived(FriendInfo->GetDisplayName());
}
}
}
}
Something like that
I mean, could be that you ahve to load it
But you can do that way earlier if needed
Won't that work only if the friend list has already been loaded?
That seems reasonable... last thing, can you tell me what type LobbyIdInvite is?
and FriendIdInvite
Hey , I'm following the Blueprint Multiplayer tutorial by Epic in an attempt to add multiplayer to a project I'm working on and I was just wondering if there's a way to use just one character blueprint rather than many? Just I'm hoping to have skill trees and such rather than set characters
Well yeah there's nothing from stopping you doing that
Sweet , Just thought I'd check , thank you for the quick reply π
who are "they"?
The skeleton crew who are only there to make sure that the "forum server" light is blinking green? π
the 2hour stream video on replication by a senior network engineer was the best one yet . in that time he made one run on server event and ticked a check box π
They = Epic
The Lobby Tutorial on Youtube is bad
Tons of wrong information and mistakes
Every time I get a client who used that as a base I could flip 6 tables
I know, I was attempting a snide joke about Epic abandoning those things π
Epic doesn't really support stuff on the long term
Documentation has always been weak, to say nothing of engine support for some features
If I have the uint64 ID of a session, do I have to convert it to a FOnlineSessionSearchResult to be able to join it with JoinSession()?
So apparently, the easiest way to actually join the session would be to store the uint64 session ID and then perform a session search by id
Problem is - what if it's a private, unbroadcast session?
Will it still be found?
If it's not advertised, then probably not
You would better always advertise and make sure you use an additional setting on the session that you can use to hide them
like bIsPrivate
and list only public matches in the ServerList
And yes, if you have the ID, you would search by ID
Afaik, you can also save the whole session result if it ever gets into your hands
You can save whole sessions
Even if they destroy and recreate, teh session data to join should still be valid afterwards
(as long as the IP etc didn'T change i would say)
I thought bIsPrivate makes the session not advertise?
This is not supposed to be a ue4 boolean
You can add your own settings to the session after all
When you query the sessions, you can add the boolean true/false to it to limit the results
You can also use an enum/integer
if you have multiple states
Yeah I use one of the custom ints already
Could technically just use one int and use it as a bitflag
But just to confirm - there is no "direct" way to join a session using the 64-bit int ID that Steam spits out when I receive an invite?
or to be more precise, UE4's online session interface wants a FOnlineSessionSearchResult, so I'd have to convert the Steam ID into that... I've seen how Steam does it internally in OnlineSessionAsyncLobbySteam::FillSessionFromLobbyData and it's not pretty
yea guess there's no two ways around it
aye, let's give it a shot and see what happens...
Hey
I'm not qute sure how to do weapon switching online
right now I'm only calling an RPC to the server
but it will be unresponsive so I need to do it on the client
the problem is that each gun has different movement speed and max jump count, so I can only change these values on the server when the player switch guns
should I switch guns locally and on the server, but the movement part will only be done on the server? wouldn't it be weird?
Your weapons should be replicated
they are
As well as the Variables you save them in
it's all working fine
So if you want to switch them, call a Server RPC and let the server switch them
it will be unresponsive tho
And you can do stuff on the client in the OnRep
oh
Like movement changes
Wouldn't it be unresponsive? even under 50-100 ms of lag
Well 50-100ms is not really what you want to deal with anyway
I mean you can do it like this
Do 2 paths and limit the OnRep to "SkipOwner"
Handle all the client changes for other clients in the OnRep
- also the Server as OnRep calls in BP for the server too
For the local client, perform the changes along side with the ServerRPC
So basicall do "ServerRPC" and then continue doing the things directly locally
You want it to be responsive on teh client
the problem is that the game is baesed around switching gun quickly
so it has to be responsive
so I thought that I would change guns on the local client and the server as well, but change the movement stuff only on the server?
Like that
the question is won't it be weird for the player if on their client they have already switched guns
but they are still slow / cant double jump?
@thin stratus "Well 50-100ms is not really what you want to deal with anyway"
I'd say would be really important to target this ping range and even higher when testing as in reality most players will have 50+ ms ping based on averages I see in many games
Like in Fortnite, I'm not sure if the ping counter is broken or not but it starts out at 150-180ms ping and then eventually goes down to about 80- 100 ms ping during any match
On the right servers (EU)
So
I was wondering why FindSessionById() was returning failure
So I look into OnlineSessionInterfaceSteam
and find this gem:
bool FOnlineSessionSteam::FindSessionById(const FUniqueNetId& SearchingUserId, const FUniqueNetId& SessionId, const FUniqueNetId& FriendId, const FOnSingleSessionResultCompleteDelegate& CompletionDelegates)
{
FOnlineSessionSearchResult EmptyResult;
CompletionDelegates.ExecuteIfBound(0, false, EmptyResult);
return true;
}
Guys i have a little question
Why when im in the client and add a struct to an array then if i try to access that array in the server the lenght is 0?
I send some photos
er
If data is replicated, only the authority (in most cases the server) can change values
if it's not replicated... then any changes will be local only
Ok let me try to set the array to replicated
No, same result dude
I tried to add to the array on server with the array set to replicated and then the lenght is 0 on the client...
Is your component set to replicate?
The component needs to be set to replicate too
Ok let me try
@ripe raptor Thank you dude! It works now, so the component has to be set to replicated, that makes sense, but it will consume a lot of bandwidth right?
Hello guys, i need some help with detecting player leaving on dedicated server. I tried different methods that suppose to do that, but doesnt get called(or I'm doing smth wrong), the only thing that gets called is OnNetCleanup, but thats not helpfull cause it doesnt point me to player leaving.
@stiff lily have you tried AGameMode::Logout
Yes
it doesn't get called
I tried also GameMode:: HandleDisconnect and PlayerController::PawnLeavingGame
I'm trying to set up a voting system in AGameState.... i thought to do a TMap - but obviously this isnt replicated. Do i have any resort to TMap & a getter funcitonality that is accessible by remote clients?
a system to vote on what? what do you need the map container for exactly
and why do you have to replicate it?
FName/Int
because i i need the scores of the vote public accessible to everyone
for UI purpose
ah
well cant you just do a normal tarray of a pair type?
forgive me but isnt that a TMap?
tmap is just a hashmap isnt it
unfamiliar with the term - i'm unsure
well like with a pair, it has a key and a value
that is correct
but the key is meant to be hashed so it has quick access
yes that seems to be the DEFINITION of a TMap
so its very quick to look through
right, but though the tmap isnt replicated, tarray is
so a tarray with a pair should work just fine ye
giving you the same effect but without the hash part(which you dont need)
hmmm actually can that be replicated.........
well if it cant, it shouldnt be a big problem making one yourself, like any struct you replicate
its essentially just two members after all, and getters/setters for them
@stiff lily it does get called im using it in mine
yeah but tarrays will replicate
yeah but you put an object of type tuple/pair inside it
essentially just an encapsulating thing
MyVotesContainer[0].GetKey() or MyVotesContainer[0].GetValue()
yeah, just find out if it a TTuple will actually replicate
if it doesnt you'll have to make your own struct that will
e.g.
USTRUCT()
struct FVoteStruct
{
GENERATED_BODY()
UPROPERTY()
FName Name;
UPROPERTY()
int32 NumVotes;
};
UPROPERTY(Transient, Replicated)
TArray<FVoteStruct> VoteContainer;
Is there any way to spawn something on the server only to other clients and not to the owner who spawned it without using multicast? π thanks
you could try ReplicatedVariable, Replication Condition that excludes the owner and RepNotify
somewhat at a loss at what you're trying to do
Hi! I have a problem with loading screen doesn't disappear in multiplayer VR client. It's just a LAN mode. I'm just running it from UE4 Editor in VR preview. If I start the game as a server - that works just as expected. When I start dedicated server and run the VR preview as network client: I can see the window with game working fine on my PC's monitor but inside of my HMD loading screen ("Please wait" with UE4 icon) never disappears. Looks like something is not running on VR client... But what?
I found the topic: https://answers.unrealengine.com/questions/491177/i-cannot-play-vr-multiplayer-client-side-within-ed.html - exactly the same problem. I can't believe it wasn't fixed since 4.12 (2016) π¦ And I still can't find an answer...
@hidden belfry - If I understand you correctly you have multiple instances of the game using the HMD? Did you try running the client as standalone?
Also, does anyone know if I can run RPCs on a CDO?
@ripe raptor I'm running dedicated server with another instance as a client...
So i can see that actor component variables doesnt get replicated from server to client in blueprints, i thought the cause was that i was replicating a struct array and maybe it doesnt accept that, but i have tried with an integer and a string and the result is the same
My actor component is added to the player controller and the checkbox to replicate the component is set to true
Server
Client
Result
So I have the following situation. I got some basic stuff done in my game and I wanna test it on a real internet connection instead of the UE4 editor. Is there an out of the box way to do that without having to create an ingame connection menu or that sorta stuff?