#multiplayer
1 messages · Page 507 of 1
Heey!
I'm trying to replicate our building system. It replicates from server to client, but not client to server. What have I missed?
@woeful ferry Replication is only server to client
Hey @bitter oriole suppose I'm making a multiplayer game like pubgMobile... Then how I will set Our max player in a match is 100?
First you hire a team of 10 experienced networking engineers
Then you ask them
100 players is no joke
@bitter oriole But then how do I send the info from my client to the server?
@woeful ferry You need to use RPCs ("run on server" in BP)
Which I do?
i don't see that
Yes I'm a developer
Does it matter ?
@bitter oriole
No but...
I'll answer this : I've used UE for a decade and I will never try doing a game that has more than 6 players, or competitive gameplay, because I think it gets way too hard
Multiplayer is too hard for most people to start with
So I don't know the answer to your question, other than that it's too hard for me
networking is just part of a problem for a 100 player game
@woeful ferry Pretty sure you can't "replicate to server" at all
100 CMC's running around... yikes
I'm 18years old... I want to know multiplayer... System... So that's I'm going here to there... YouTube, blogs... There are lots of confusion...
There's multiplayer, and there's AAA-with-200-engineers-and-millions-players-multiplayer
Fortnite or PUBG are not something you can replicate alone
If you really want to do multiplayer, do a game with 4 players
That you can play solo
After that if you have the budget to hire a 50-people team, do that
If not, do another game with 4 players
Okay
@bitter oriole is too hard to make a game like asphalt...(simply gameplay leave the other inventory stuff)
Asphalt is made by a team of 150
And UE4 does not have built-in support for multiplayer vehicles
So there's a lot of work there
@bitter oriole do you know how to keep the server from spawning multiple UI?
i have this in the PC as a temporary fix but it stops any UI from spawning on server at all
Just spawn it from the HUD class
That might be enough
If not then spawn only if the PC is local
@pastel thunder IF you wan't to make a multiplayer game look this : https://www.youtube.com/channel/UC6LArEEHAkHIQs6xhEloSKA
For gameplay and world building chek this one ( not related to multiplayer ) : https://www.youtube.com/channel/UClb6Jh9EBV7a_Nm52Ipll_Q
@left parcel I have already watched him... And I have to clear all the doubts...
Hey guys, I was thinking about making a basic multiplayer game. I made a basic loop of how the experience should be. I want to know how difficult it might be for a intermediate blueprint programmer and a general ballpark timeline for how long it could take to get a solid prototype completed
You could click image to get a larger view
@ me if you respond to my question, I will be off screen
@viscid bronze i would limit your use of GetPLayerController
you could easily check for "IsLocallyControlled" or "IsLocalController"
inside pawn/controller
its safer
same as GetPlayerCharacter 0
ok. did this in the Character BLueprint.
@meager spade however now, on the third time i switch classes the HUDs stop despawning and start overlapping. how do i fix it?
you are doing a lot of repeated code
i mean a lot
and you use of GetPlayerCharacter/GetPlayerController is concerning
your*
i can tell, not being rude or anything
so, first, remove repeated code
this here can be one function
Have a server, that travel to a level. Problem is, that all my clients dont travel with the server. They are just stuck in the old level. How can I get these Clients to follow the server in Blueprint?
Use server travel
Like that? That dont work for me. Did I something wrong there?
I don't know. It's weird that your clients would stay on the previous level, really
They should all be kicked
Servers can't have multiple levels loaded
After the Server travel to the new level, the clients are not replicated anymore. So like the clients have all a normal level without a server
So how do you guys go about adding a new movement mode to unreal's Character Movement Component?
@tough totem did you enable Seamless Travel in your project settings?
@peak star will check it
Didn't found seamless travel in the project settings but checked the seamless travel option in all of my gamemodes @peak star . @winged badger, with the execute command line the server even don't travel to the new level. Set the "listen" in the option but just the server travel and the clients don't follow.
I use dedicated server
at least it has actual documentation in comments
also FHitResult is an excellent example of custom NetSerialize function
@tough totem try leaving off the full path of the level asset and only put the level name in there. I think that is all I ever needed.
Also I have a question: if i use console command BP nodes in a shipping build, will they run? I heard they don't run in shipping builds but maybe that was only the case on older versions of ue4
not sure why they wouldn't work in shipping
but i would just test it
with a quick shipping build
Hey guys, sorry for the paint and stupid question. but i cant brainstorm for that with MULTIPLAYER.
1- These collisions, was added in the world map.
2- Player Blue can pass this collision but red cant.
So i did some tests to in player blue in client remove this collision for passing. but I see some tremblings. because in server doesnt removed this collision, thats why blue player cant pass this. so idk what to do for that.. ?
if i do remove collision in server and client blue player, then red players can pass too. because in server have no collision to pass it.

HALP1
i did googled but there no answer to do it 
- new solution didnt work
in a multiplayer setting with spell cast bars and interrupts, how do you guys handle timing how long a cast should be on server? if i start the cast when the server receives the command and have it be the same length as the client-predicted cast, then there's a window where a client will predict his cast to be finished but the server might have been interrupted, leading to a lockout after a cast is "finished" or after a client has already cancelled the cast on his own screen. i can reduce the cast time by rtt ping for the server, which lowers that window, but means some casts will go through when a client tries to cancel his own cast at the last second.
kind of a niche question but im stuck
well what are you trying to seralize
oh like encrypt it?
or reduce the packet size of that
From what I've read repnotifies are supposed to work even if a player joins after it being set, but it doesn't, it just shows the default values on all the present players when a player joins the session. It only updates when the repnotify is changed after the player joins?
@brave solar so lets say we load up the default third person project (the small map so all the objects around are relevant) with our custom actor(lets assume its a storage chest that can open/close) that has a rep notify variable on it (lets say its a boolean IsOpen thats set to false by default in the constructor). lets say when this rep notify variable changes to true, the OnRep function fires and if the boolean IsOpen is true then it will play the animation to open the chest. now lets say player 2 joins the server after the IsOpen variable was changed to true, because the chest actor is relevant to player 2, they will see the open animation play. now lets say we have a player that was 5 miles or so away from the chest so the chest was not relevant when the boolean was changed to true. when that player gets near the chest to where its relevant(lets just say beside the chest) then the function will run on his client and play the opening animation on the chest
Yeah I understand that much, but the players spawn right next to each other and nothing happens still
is the variable being set in the constructor?
No it loads a savegame on beginplay and then sets the repnotify with data from the savegame
Haha well thanks for your help.. it turns out I had a bunch of stuff in the construction script that was conflicting with the loading. Now it works perfectly.
Guys, I'm still really struggling with Bluetooth support for Android.. The only Thing I can see is the Plugin 'Bluetooth Support' by TahaHISHRI. But it's still on UE4.19, which I suppose wont work for uploading it to Google Play Store. Any suggestions? I mean there needs to be a way shrug::skin-tone-2♂️.
Hello I was wondering if anyone has some time and or suggestions that could tell me what I'm doing wrong or missing I have tried countless tuts and read through documents packaging my empty game multiple times and cannot get clients to connect to my dedicated server on anything but local host and my port is forwarded
I've followed all the steps I know and have found and nothing is working if anybody can help me at all in the right direction I would appreciate it
PM me would probably be best
@bronze arch are you handling color specific collision using collision channels or by turning collision on/off? If you handle it by turning on/off, then do you trigger it to change on the server, too or only on the machine that triggered it originally? If you trigger it on the server, is the change replicated to all clients?
@warm summit If the plugin comes with source files, you can try to compile it for 4.20+ yourself.
Should drink my coffee first, no idea why it swapped GoogleStore with Marketplace. My goodness.
It shouldn't stop you from uploading it to the GoogleStore I guess.
okay, but what do you mean with source files? I mean there's a github version of this plugin. Still I wouldn't know how to install it to 4.20+
Source files are the .cpp and .h files that contains the code of the plugin. If that is available, then you can compile binaries for 4.20+.
All you need is a C++ project (can be a new, empty one) of 4.20 or higher, put the plugin into its plugin folder, regenerate project files, open the project in Visual Studio and hit compile.
Good chance that compiling might fail, but at least you can try.
There are also some command line ways of compiling it, but the project one is at least the most straight forward to understand.
You are free to google words in my explanation that you don't understand as these are mostly the very basics of how to use UE4 c++
https://gyazo.com/41c2622dc4a2ae4bb728b74d3629b5d0 any way to fix this ?
anyone tried custom server solution for ue4 yet? like netcode.io, raknet/slikenet, SteamGameznetworking etc?
We are having problem that easch u4 dedicated server eat too.much memory, so we are looking for a lightweight implementation
@keen thorn You probably should try optimizing first, because you'll need to reimplement your entire game logic on your new server tech
@bitter oriole does not work in our case since an empty project already runs at 200mb which is way over what the requirement can allow. and we are lucky to not need implement any game logic to simulate the game on the server for our current project.
Well if you don't need the level data or any shared code, I suspect not many people around here will be in the same case
we are looking for an implementation that runs only around 50mb or.less, so a golang implementation or something, netcode.io seems promising but was wondering if anyone knows something else
also because current ue4 server instance does not support multi session, something we want to gain experience in by building our own server so we can later expand on this
how do I replicate a reload animation? it is a montage, and functions using a boolean variable.
It's complicated. You usually don't want to replicate animation events
Instead, replicate the player state - like "is reloading"
And then the local animation blueprint can smoothly go into that animation state
I've replicated both the Is Reloading in the screencap and the variable in the character blueprint though
but it still only replicates from server to clients.
i also use this custom event structure for weapon reloading and setting the IsReloading variable
"only replicates from server to clients" is absolutely what replication does
You need to change the state on the server for replication to work
how do i change the state on the server from the client though? is there a node for that?
"run on server" stuff
okay
still couldnt figure out how to do it while not messing up the ammo count and such though
input connects directly to the ReloadServer custom event
Hello, is there a way to configure bandwith. When I send too much RPCs, at some point my GameState bReplicatedHasBegunPlay is not replicated...
Can anyone here clear up some doubts I have with aws gamelift terminology?
@meager spade i don't know. I kinda just lifted some stuff from the MultiplayerShootout.
Hold on let me open UE4 back up
it doesnt work this way for me. the server works fine on both reloading and casting the reload anim to everyone, but the client cannot reload at all.
@meager spade
kay hold on
Anyone got any idea why when i run In PIE with dedicated server the client is super slow and laggy but standalone with dedicated server is fine
What is the advantage/difference of putting something inside the PlayerState instead of the player controller, besides the obvious "PlayerState is replicated to every client"? Or is there even any difference?
That's what I mean by "PlayerState is replicated to every client". Bad wording, MB.
PS could be thought of as containers storing replicated data that other players need to be aware of. If it is stored in a PC only the server and client would know of it.
if your game uses ai players then you might have to consider whether they need this / will have a controller, a player state, or both
So, example: A player has an inventory other players can't interact with -> Controller; A player also has equipment that has to persists through death and can be stolen by other players -> State
Right?
Would make a replicated inventory component at that point.
how would you approach ai playerstates? that doesnt seem like something the playerstate system is intended or usable for
i'm not sure what you mean, you can totally use player states with bots
it even has the bIsABot variable
You set bWantsPlayerState = true in the AIController
Does anyone know why SetActorTransform from gamemode will move the actor to the correct Location but ignore the Rotation?
Does Rotation just not propagate to the clients?
Hmmm, SetActorRotation from Gamemode does nothing either.
Yet, the Output from the node says the Rotation was applied successfully...
@gritty lodge What happens when you try it as a listen server? Is the actor a character?
@cosmic star I've had similar struggles, and the answer is more design theory than anything else. There is no one correct way. Just be sure you know the fundamental diffs between pc, ps, and char well. Another lens with which to view ps I've found helpful is that it's just an abstract representation of the character: you can store vars there instead of on char for modularity. It also has a couple nice functions.
For my multiplayer inventory, I spawn a separate actor from each character and have it only exist on that client. my server need only track when a player adds or removes something; it keeps a separate player-inventory array for that
of course this wouldn't work if players need to have the ability to check others' inventories
though they could do a server check for that. shrug
Hmm
[PacketHandlerComponents] +Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface
So, added this to DefaultEngine.ini , restarted project. Can't see SteamAuth functions anywhere
@brazen glacier Thanks for that. I guessed it was more of a design choice, which is good. More ways are always welcome.
@wary willow i'm not sure what you're expecting to happen by enabling that packet handler but all it does it enforce steam auth
and it's a fairly passive system that you don't have to interact with
@lost inlet had hoped to get Steam Auth Token ;)
Session Ticket
I mean, I know how to do it manually via IOnlineInterface
Just hoped that it would have been put in by now. Thought that was the magical ticket. Guess I was wrong
😂
When a client is transferred to a new map via seamless travel, is there a way to determine when all the actors in the client's map are fully loaded? I've tried calling HasClientLoadedCurrentWorld from the server. It returns True, but I have reason to believe an static mesh actor in the map is not loaded since it is not replicated correctly.
i'm not sure how reusable steam auth tickets are
GetAuthToken should suit your needs for that
There is possible to do one way collision with multiplayer?
steam auto tickets are not reusable
GetAuthToken will invalidate previous auth tokens
and 4.22 should support steam auth flow now
i created a packaged executable for try test it, but i don't know how to execute server, and clients to connect to server
in editor it launchs the server and clients fine
how i do that in the packaged version?
I’m having problems filling an array of data tables with information from a database using Varest plugin for my card game. I tested my blueprint and the database connection works, and I’m able to retrieve and store data from the database in the data table, my problem is with the foreachloop I am using, due to where the iteration ends I am only storing 1 deck instead of 2, I think this is to do with the loop not connection from Bind Event to OnRequestComplete through the custom event to the fill data table node the loop should iterate after fill data table but I think it iterates at Bind Event to OnRequestComplete. My question is how to handle the foreachloop to iterate after fill datatable here
i think you cant fill an data table, since data table doesnt allow changes at runtime
unless ure using some plugin or c++ code for that
So if player states are kept alive following a disconnect, and a playercontroller owns the playerstate, what would APlayerState::GetOwner return for a disconnected player
try it and see if it nulls it out, might hold a reference to the old player controller
@grand kestrel report back with results please
@twin juniper I am filling one of the data tables I even tested it to see if the values I fill it with can then be added to my base card blueprint and it shows the correct data on the card, the problem is that I should be getting 2 decks with card attribute but I’m getting only 1
@ocean geyser I might forget to, you can ping me sometime tomorrow 😄
Event happens > Game mode grabs a team of players > applies transforms > server applies transform correctly > clients get proper location, but their rotation stays the same on client as before the transform until they move
how do i call a function from a specific player
like say I want whatever player (client or server) gets hit by the raycast to take off a specific value from the variable float "Health"
how do I do that
is there documentation on this?
Shooter for C++ and there are some other examples made entirely in BPs. Did you study them?
hi im having trouble with replication and stuff
i made a basic door and when you open it it opens on one game but not the other so player 2 has the door closed and player 1 has the door open
heres the code
Hello any way to know when the NetGUID of an actor is initialized on server
I'm searching some events or functions in ActorChannel / AActor / PackageMapClient and I didn't find anything
If anyone can help me, it would be nice! Thanks
my guess would be NetDriver or DataChannel
when they are evaluated for replication for the first time
Ok I'll check that thanks !
I have Pawn on the server and they do not spawn on the client. Any ideas?
I have SerializeNewActor failed to find/spawn actor. in LogNet
SerializeNewActor: Failed to find static actor:
so does an AI run PossessedBy when they receive an AI Controller?
Hey guys, what could be the reason for a Rep w/ notify working fast on the first time and REALLY slow on the next one?
There aren't many stuff being replicated on my test map but I don't even know where to look on this, also didn't find something addressing that on google
(also, no warnings or feedback)
To be more specific I'm setting a actor reference on Server that is setted to replicate w/ notify.
the first time, the print thats on the OnRep function executes on server and shortly after on cliente.
Next time, it prints on server, but not on the client for a large amount of time, like 20 /30 sec (if prints.., most of the time it doesn't).
This is on my Pawn with this replication config
Im testing in PIE, dedicated server and 1 player
any hint?
try testing outside of editor
Run the netprofiler, you're probably net saturated. @astral fossil
I ran, I don't think thats the case
its a very empty levle
and its consistently after the first execution
here's an image of one of the short profilings
PowerUpAttached should have count 2 in this
I left that problem on hold and am working on other stuff, will be glad if anyone has idea on how to investigate this
you using a replication graph?
Hey, I've run into a problem and I just can't figure it out. I have restarted all my assets from scratch, still the same problem arises, wondering if anybody in here has a clue what the problem is
I'm using the Advanced Sessions Plugin on 4.23, and whenever I create a session without LAN ticked, the session fails to create.
LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '15' k_EResultAccessDenied (access denied)' failed in 0.256152 seconds
This is the error that gets spat out.
Any ideas would be appreciated, Presence is on, I'm testing in standalone (works in viewport??).
k_EResultAccessDenied - Your game isn't set to allow lobbies, or your client does haven't rights to play the game.
Okay, thanks for the response. How would I go about checking these two things?
"or your client does haven't rights to play the game.", I'm using AppID 480, Space War, if this helps.
Don't use that.. Just make your own project on the steamworks dev portal.
I don't have to pay the $100 fee to use that?
Also, make sure the steam account you are using is a dev attached to that project.
Yes, you do. You are a professional developer, right :))?
I'm a uni student wanting to learn hahahah right okay.
I'm almost certain people have got this working using the free id though
Well, we don't know how to circumvent that so we just paid it also (:
The 480 AppID is used by everyone so there may be some issues with it and also, you cannot actually config stuff regarding that project on that portal. I'm not sure it is recommended for serious development, if others have more experience with it..
I hear what you're saying, I just figured that creating a session should be easier than this -.-, i just don't have $100 sadly xD
Yeah, maybe someone else knows about this stuff who can lend a hand. Thanks for your time dude ❤️
Well, the one thing I can tell you is that the code in their samples (like Shooter) works out of the box with everything discussed above configured correctly.
You're welcome :) I hope somebody else can give more details about 480 dev tradeoffs, I'm curious too.
one thing ive noticed using 480 is i have to allow for a TON more search results for a valid result of a server of my game to be able to be found as it seems like its searching through all servers using the 480 app ID
yea
SessionSearch->MaxSearchResults = 8000;
did the trick
@ocean geyser Correct. It only filters it at the last second. When the tags don't match in the SteamSubsystem of UE4 when parsing a result it throws it away. But the raw query for results seems to be done only on the id itself. So you are getting other devs sessionresults until you get your own id
You should be able to use 480 though to host and search during the time of development. Just not for release. It also doesn't allow you to actively change all the settings on the dev page. So you will have to get the id eventually unless all you want to do is play around with ue4 and never really release the project. @red pollen @supple basalt
Hi, Can you help me to replicate my anim offset is the last problem of my online game, ideas?
Replicate your state, in its entirety.
Then, base your animation off the state you've previously replicated
@ocean geyser @thin stratus Thanks a lot guys!
hey guys, where is the best place to fetch the player state of a player before he disconnects?
I want to save its data so that if he reconnects his data is not lost
There is a place where PlayerStates turn inactive (in case you lost internet connection or so) and it gets reused if you reconnect.
That's meant for a short duration, so not for multiple hours of "they might come back".
If you need multiple hours of "save the data in case they come back", then I assume you could just do it when the PlayerState gets removed (EndPlay or so)
@thin stratus no i actually need it for up to 30 mins tops (average game is 30 minutes so counting the worst case of disconnection)
how can you reuse a player state? as far as i know they get destroyed
GameMode should have a float value for how long a PlayerState persists.
Given you have a Subsystem with a UniqueID per player, the PlayerState will be taken from the InactivePlayerState array and will use OnCopyProperties/OnOverrideWith functions in the PlayerState to set things back up.
At least that's how I understand it. Never actively used/tested it.
hmm, i'll have a look at it
what kind of replication do overlap events do? I try to replicate a function through either multicast or run on server, but it only replicates properly when I use an overlap event instead of a custom event.
I'm guessing they do not replicate at all
They just probably also happen on the client
nah, when i print it shows that both the server and client print it
so there would need to be some replication, no?
or would client and server both separately act upon the begin overlap
I just want to delete an actor from the client, but I can only delete it from the server. DeleteActor just runs on the client and does nothing, even when I try to use all replication options
i feel like it might have to do with the fact that it's not the owning client
When I test my game on two PCs, the PCs can not find the sessions, but can only create one. That's the problem, but in the editor with two windows open it works well. Ideas ?. How make without use steam, an simple method
@plain lagoon That both devices show the log doesn't mean it's replicated, just that it happens on both
UE runs the entire game on every client & server, so while some things happen only on server and are replicated, most of the engine just runs in parallel
Stuff like collision and overlap is typically not replicated and just happens to trigger simultaneously on every player because well, the same game is running
cool, then i know that
i kept on looking and it's probably because the client i try to call "Run on server" on isn't the client owning the actor, since I have the actor in the level from the beginning
would you know any workaround to that?
Well first think about whether the client shouldn't actually own it in the first place, do that if that's the case
the thing is that that actor can be interacted with by both the serverClient and the other client, (using basic multiplayer)
If not, you'll need to tunnel that event through the player controller or pawn, and then call the actual event from the server-side of either
and an actor can't have two owners, right?
Nope
all right, i guess i'll have to do some hacky stuff to call it from the server client, thanks a bunch for the help
Actors can however change ownership
But that only works if only one player can interact at the same time.
Yes, except you still can't do that from the client
But if the server can decide that autonomously, you're good
Hello, is there a way to run some code on when a player crashes or shortly after?
yeah let me rephrase, what I want to do is run some cleanup code any time a player crashes from the server for any reason, this can include a network error or a fatal error in the client's game etc
@thin stratus @ocean geyser thanks for the reply guys. I've heard about the search query thing before, and so have my search results at 9999, although I still can't seem to create a session. At the minute I'm just playing around and testing, without a serious product etc, so it would be cool if I could get this to work. Any more info on the error code would be much appreciated. Thanks
I'm having some issues updating a widget on all clients. I've previously used a text widget and updated it using setText and that worked just fine, but I cannot get it to work using a web browser widget with loadUrl. It seems to load on the host pawn (for all clients) only, but not for others. I'd appreciate any help.
@red pollen does the account you use have SpaceWars in its library?
I'm not sure I'll have a look give me 5 minutes
Because that could be a reason
Sorry for the late response. My steam account does not have Spacewars. How do I get it in my library?
Cancel that, I now have it
How do I make the set visibility function to work in a multiplayer setting? Currently this only works on the server and can only be visible from the server
Sadly, still the same error @thin stratus
@viscid bronze
You're gunnah wanna make a few custom events. I'd start with an event that runs on server and is reliable, and then another event that is multicast and reliable
Make the server event call the multicast event, and make the multicast event run the visibility.
And then have your input event call the server event.
Input [Sets Variables etc] --> Server --> Multicast [Sets Visibility]
Hope this helps
@red pollen thx ill try
i wouldn't use multicastr
not for a "state" change
replicated bool PlayerHidden set to RepNotify
and in the RepNotify handle SetVisibility
Is there a way to make material parameter changes visible for a single player while the other still sees the old material?
@meager spade alright hold on
weapon should handle there own state
Any chance you could help with my issue @meager spade , you seem to know what you're talking about way more than me xD
@thin stratus Hello. after more than 1 years after read and share 10 times a day the document "UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf" i just realise that you are the autor of this 😄
well, thk a lot for this doc. Really !!
No biggie, glad it helps (:
@meager spade you mean to put the repnotify in the weapon blueprint?
i kind of just put it in the character blueprint because it is a class based shooter so it doesnt really matter right?
promis, 10 times a day on our discord :"i want do this, but on server it s ok, but not on client...."
- have you read this : UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
- No
- so.. read it
😄
i mean, sure, i would have kept my weapons encapsulated though
regardless
weapons handle reload/hiding/showing/etc
rather than the pawn
@normal girder Good, that's why I wrote it :D
👍
never read it..
i will take a look, i mean i know the replication system and stuff now, but it would be interesting to take a peek, might do that later tbh
@meager spade thanks, your method worked
Hey, I've run into a problem and I just can't figure it out. I have restarted all my assets from scratch, still the same problem arises, wondering if anybody in here has a clue what the problem is...
I'm using the Advanced Sessions Plugin on 4.23, and whenever I create a session without LAN ticked, the session fails to create.
LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '15' k_EResultAccessDenied (access denied)' failed in 0.256152 seconds
This is the error that gets spat out.
Any ideas would be appreciated, Presence is on, I'm testing in standalone (works in viewport??).
Rebump cause issue is still a thing and people can't see it D:
@winged badger no :0 just repNotify on blueprint
Is it possible to spawn actors into streaming levels and have them replicate properly?
seems I can only spawn into persistent level?? I've also seen gumblings about actors in sublevels not repping correctly. Anyone know where i can look for a little more info on the topic. google didn't help. Trying to get spawns in sublevels working and replicating properly.
If you have a weapon that shoots projectiles, do you want the "weapon fire" animation to play immediately?
If you play it immediately (on the client), it's pretty weird with the delay from the spawned projectile actually replicating down ~100ms later.
I think I'm leaning towards the delay. So that code between simulated and owning clients are the same. 🤷
The proper way is probably with saved moves.
dummy on client, client sees a fake projectile
server spawns real projectile
hidden from client
@
Found answer with a search ... spawn with owner already in level to spawn into level or do manual move to sublevel in c++
@worthy perch you should client-side predict everything or it will look bad. If your animation for firing is long enough and the latency is decent, maybe you can get server confirmation to arrive in time for spawning the projectile (you tell the server in advance you began the animation).
If the lag is too much, just predict it and reconcile if needed.. still better than not firing for some time. If you predict movement, the player won't understand why movement is ok but not the shooting stuff.
Hi!
I have a electricity system where you connect pylons. It all works fine and all and it spawns from client to server, but not server to client because the actor itself is not replicated.
However when I check the replicate box, it crashes upon spawning the actor.
No, it's all in BP.
And no it's not a spaghetti. 50 nodes across 3 BPs with parent/childs
This is what the system is, so the spawn of the cable component is what crashes the game if I check the replicate box.
hi, how can I change my dedicated server's port? And will unreal auto increment ports if I run more than 1 instance of the server on the same machine?
Can't believe I'm still having trouble after all this time
I must be doing something wrong
Is anybody able to help out?
Really can not carry on testing my game without fixing this
I am currently trying to receive logging from a linuxserver shipping build but -log or -log LOG=/... does not work :S anyone any idea
No logs in shipping builds
but how does UnrealTournament do it?
They als orelease shipping build servers with logging
They modified the engine config to build with logs
does that also mean I always need to do dev builds for a bit of logging?
Generally yes
also, when I did dev builds with -log LOG=location it didn't work, it always kept logging in the default log folder
Don't know about that, sorry.
bUseLoggingInShipping in your project.Target.cs file
Quick question, if I joined a match and want to leave, which bp node do I use to leave the match? Or do I simply just OpenLevel to main menu/lobby?
Reading up, it seems that if a player leaves, the game mode will notice a playercontrol leaving so essentially just OpenLevel my way outta there?
logging does have a potential performance impact so that's why it's disabled in shipping
by default
depending on how verbose the output is, flushing the log to disk can hitch
you can also build a test client and connect to the shipping server as long as they have network compatibility
when you run a packaged build with -log on windows (so you get the console window) then every single log message blocks the main thread for 0.5-1ms
Are you guys responding to my question or something else? haha
Quick question, is it ok if launch dedicated servers on linux without "?listen" on 4.23 because I have a lot of errors like this one "LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver" and some people says it is related but I can't manage to see the difference
up to 1ms is pretty significant, didn't realise it was that bad
I didn't either, until I saw this https://cdn.discordapp.com/attachments/605189116941959171/649785390361870351/unknown.png
this function takes 2ms without -log
it writes only 14 lines
this is 4.24 preview but insights is in 4.23 too
Beware this might be 1ms on another thread
I'd be surprised if a log was 1ms blocking
hello, what is the cleanest way to respawn a player in a multiplayer game? as in destroy the current player and respawn a new one and repossess
I'm trying to use AGameModeBase::RestartPlayer but that seems to try to use the existing player and reset it
You can't really destroy the player
Usually you want to destroy and respawn the pawn
yes i meant the pawn
Why are you trying to repossess a player? You're going to lose all of their data.
Such as score etc
he's suppose to lose everything
Destroy pawn, do restartplayer, or just create a new pawn and possess it
He's asking that
He's asking what the normal way is?
Yes
Oh, my bad o.O
How to respawn the player pawn
the player state is associated with the player controller
so destroying the pawn wont lose the score
You can't destroy the controller or player state, just the pawn.
Reset variables if you need that
so i just need to do Destroy() on the pawn (in the server) and then call GetWorld()->GetAuthGameMode()->RestartPlayer(GetController()); ?
And if that doesn't work, just create a new pawn and possess it
the way i'm doing right now is doing: PlayerController->ChangeState(NAME_Inactive); PlayerController->ServerRestartPlayer(); Destroy();
and it works, except that the attached actors (weapon) dont get destroyed, so i think i need to delete them manually with GetAttachedActors and call Destroy on them
is there a way to delete the attached actors automatically?
i have a health variable but its not on rep notify
Okay so start there
Make it repnotify
And then when it drops to say, 0?
<=0
Destroy child actors, destroy whatever you want, cast to controller etc
but i dont need to do it on the clients
so the repnotify wont do much
i just need to do it on the server
You need to remove actors on server and not client?
no
I need more context here
since the actors are being replicated, if you issue a Destroy() on the server they are automatically destroyed on the client
so i dont need to use repnotify to manually delete them on the clients
You can Run On Owning Client
i was asking if there was a way that the Destroy() automatically destroys attached actors, but from what i just read he just dettaches them
so i think i always need to manually delete them
no prob, thanks anyway 🙂
the correct way of handling it is to make sure you cleanup anything that pawn had
the engine doesn't keep tract of that
track*
when my "pawn" dies, he sends a delegate out, which things like inventory manager, etc (on playerstate) listen for, and cleans up everything, this includes the current weapon he has
@meager spade i believe the pawn has a OnDestroyed delegate that you can bind your actors and stuff
that might come from actor
so you dont need to create one
mines called before the pawn is destroyed
question, how would you guys setup shooting in multiplayer when it comes down to effects and such? i was planning on this:
when the client shoots, the sounds/effects and such are played instantly on his client so there is no delay. during this i would cast a line trace and send the hit result to the server, the server would check and see if this shot is even valid (meaning the client didnt try to cheat and shoot through a building for example by sending a line trace from the clients weapon to the location of the hit point on the hit result and see if anything is blocking it). then the server would multicast an event by playing effects on the weapon such as muzzle flash, and an effect on the hit point such as a bullet impact.
does this seem good? also is there a way i can prevent the multicast event (this would be running on the weapon, i set the weapons owner to the clients character when its picked up) from running on the client that picked up the weapon so he only has the instant effects that run on the client?
hi i need help i want to create a dedicated server on unreal engine 4.23 but i don't know how
Please I need help
So my clients won't update untill I move to another window or minimise then reopen the game window
And this makes debugging especially hard
I'm using 4.23
@foggy idol what kind of computer are you developing on?
A laptop
And I'm also beginning to suspect it's hardware limitations
And that my PC just can't safely do everything at once
Since repNotifies aren't ordered, is it ok to have them wait on a variable if you need them to run ordered after some other functionality finishes? i notice the repNotifies on late joins are firing before setup from begin play finishes that needs to happen first. Is this a NoNo for any reason to wait in the repNotify? If so, how to wait properly in late joins
posting questions on here is like talking to a wall so far for me.. I guess i'll just use this forum for the search feature only.
they are ordered
they happen in order of DOREPLIFETIMEs in GetLifetimeReplicatedProps
and when Actor replicates, the client receives a single bunch, that is pretty much "Spawn Actor of this type on this FTransform and assign it this NetGUID. Also, here are all its replicated variables."
client then spawns an Actor, sets the replicated variables, then calls the replication callbacks, then PostNetInit, then BeginPlay
@nimble basin
@winged badger I see. Thanks for the info. Very helpful to know the ordering. On the blueprint side is there a proper way to wait on functionality to finish from begin play then in reNotifies, or is it the case that I just shouldn't be doing it that way to begin with? Maybe I should move that functionality into it's own repNotifies. If that's the case, how then can I know which repNotify will happen first? I don't think all this functionality should go in a single repNotify..
in BP the only way to get the BeginPlay to behave the same on server and client
is to ExposeOnSpawn all replicated variables you set right after spawning the Actor
and i have no idea how BP registers its RepLayout, i avoid doing networking in blueprints
it would be either the order in which variables are listed, or added, i imagine
OK, maybe I can run some tests to find out how it orders them.
Wanting to make sure I understand this bit: " ExposeOnSpawn all replicated variables you set right after spawning the Actor"
the alternative is to wrap the related variables into a struct
then replicate it
as the struct will replicate whenever any of its UPROPERTYs are changed
do you mean i make the vars instance editable and expose on spawn, and just replicate the vars right after spawn so the repNotifies fire?
i mean, if you spawn actor
then set a couple of variables
those variables get set after BeginPlay on server
but before BeginPlay on client
unless they are set via ExposeOnSpawn, then they are available before BeginPlay on both server and client
simplifies network construction somewhat
as you don't have to branch BeginPlay depending on if you're on server or client
Hmm ok makes sense. So is there a reason I need to put them in struct? I mean, would the firing before begin play on both client and server be the case whether i'm setting individual variables or have them all combined in a struct? I suppose the only diff with not using the struct is I won't know the ordering of the individual variables repNotifies unless I test with that to find out?
if you want a repnotify to always fire after either or both of say 2 variables are replicated
in blueprint
best to wrap them in a struct and repnotify the struct
as you are then sure that you have updated values for both of them available
when onrep gets called
Ah, I get it now. Need the struct to ensure ordering since any one of the variables could change out of order .. which could cause issues with late joins.
but seems like it's then replicating too much? I guess the price to pay to ensure ordering with BP.. and only struct the ones that need to have ordering.
yeah, struct wrapper only for groups of variables that all have to be up to date prior to onrep being called
doesnt the order of the DOREP also adjust what gets replicated first?
oh BP, yeah you can't do that
wrapping in a struct does not guarantee atomic updates
updates to properties inside it can still arrive in the wrong order or out of sync
if they are set on the same tick on server, they should all arrive before the replication callback
it isn't guaranteed they will
your client can temporarily have a state that never existed on the server
(inside the struct)
that sounds awfully inefficient, and also means NetSerialize would have to be called more then once and results sent in separate packets
and its one packet per Actor update
I think replayout just flattens structs unless they have a custom serializer
that would do it
but with a custom serializer you would always be sending the entire struct, losing the ability to send only a delta of changed properties
for his BP only situation, custom serializer is not an option
Hmm, too bad I can't i change the order of the DOREP in BP? That sounds like the best way..
for construction it won't matter, as you can just handle it all inside BeginPlay
So I take it that I must expose on spawn if i care about the ordering before beginlay being consistent for vars on client/server. I wrap any variables in a struct that must be ordered before the dorep. If I also want that struct to be ordered consitently for beginplay client/server i expose on spawn the struct
will try what i was doing again with this. pls let me know if any of that isn't going to work.
for ExposeOnSpawn doesn't really matter if you have structs or not
right.. unless i also care about ordering for beginplay.
its just a way of setting variables server-side before BeginPlay is called
ok makes sense. Thanks for the help!
hi call when I tried to spawn an actor on server by blueprint, there are no actor spawn on client
do I need to add a customer event for multicast?
Is the Actor replicated? That's pretty much all you need.
I dont understand why when I use switch has authority , the actor can not find in the scene even in server, when I not using it the actor can find in server
above node are in open level blueprint
ok , I know now I need to tick always relevant
Quick question. Trying to do something like a class limit for multiplayer
I figured I'd have the limit in the GameMode, which works, but I cannot change it on each level
How can I do that in a way that's quickly exposed to a level designer? I can only think of having the Level Blueprint cast to the gamemode to set the limit, which sounds dirty and fairly hacky.
Not sure this is the correct forum to ask - but I'll give it a shot. Seems like a problem solved by people working on multiplayer systems
For the game I'm developing we'd like to have a list of items that changes periodically. We'll keep this in a DB, but want to be able to ship that information to clients (perhaps on start up or similar). Or perhaps even using the UI to search for items stored remotely.
We can use something like REST or GRPC for this - as a transport.
Are there patterns around to do this (eg integrating with data assets in BP, or a more standard C++ distributed object approach?).
@void orbit the other way around is not
@ruby rock we are doing it by JSON, UStruct and UAssetData.
a UStruct is defined to keep the properties we need. then they are placed in a Assetdata so that developer can create and edit the properties in editor.
whenever he wants he press the save button and all the configs are stored as JSON in master server.
when game client is launched we receive all those config and override it on the asset data we have.
derive from ALevelScriptActor, put your settings there, reparent your level BP to it, and have GameMode access it
actors loaded from the package will all be available before GameMode is even spawned, so you don't have a problem with order of initialization
having said that, custom WorldSettings class is easier to handle from the editor
@rose egret - thanks, and you use REST or something similar to read/write the data from the server?
@ruby rock I am using my own JSON RPC plugin over Websocket. cause we have our own back end for login, friendship, inventory , ...
@rose egret - nice one
How do I make an explosion sort of damage replicate properly in multiplayer? I already have set up a raycast, and I want the explosion to spawn where the raycast hits something.
My fire function is
Input > Executes on Server > Replicated to Owning Client > (raycast)
Input, ExecuteOnServer, RayCast, OnHit, Multicast, SpawnExplosionFX
You can then add client prediction if you want
Which would be in addition to what I wrote
Input, RayCast, OnHit, SpawnExplosionFX
And then filtering the owning/local client in the Multicast so it doesn't spawn the explosion twice
And maybe add a IsServer check to not cause this to happen twice on the server
alternative being spawning an actor that goes bang in BeginPlay
Yeah, will have inputlag though
it has less options for prediction tho
Yus
okay. i will try that
2 questions though,
Is LineTraceByChannel the RayCast you mentioned and can I just feed the Impact Point from Break Hit Result directly into Origin of Radial Dmg
yes
ok. i will be rewriting some code. thx
Although the VFX seem to show up in the right place, the print string seems to always report false even if I'm hitting the other player directly.
Is there a way to fix?
Hi, if possible use the ReplicateUsing inside a struct? in a property?
Anyone here ever have issues with FP Camera line trace not lining up between client and server?
Hi, i working in a inventory system for multiplayer game. We are working with Struct for items, each item have their Textured2D for the Item icon and Mesh for weapon/armor items.
We want to each client load the Texture2D and Mesh when the item is replicated. What is the best approach?
One system is use a ReplicatedUsing in the TArray<FInventoryItem> Inventory; and call a function where the client load the Texture2D and the Mesh. But we have the question about is this is the best approach? because we can have 30 items in the inventory and when the new item is added in the inventory, the client try to load the texture2d and mesh again?
@ornate crescent you cannot use replication declarations on your struct items.
You can replicate an instance of your struct however.
Make sure they're UProperty() so they can replicate.
i make a test and see struct cannot replicated members inside the struct
Doing so will replicate the struct's values
yeah but the another question is about Mesh and Icon, if i add UProperty() inside the UStruct members (for the Texture2D and Mesh) this are replicated too? maybe is to heavy for replication. For improve the replication i want to replicate the item and with the Item ID, the client read the ID and load the texture2d and Mesh
assets replicate by full path the first time, after which they are assigned a NetGUID
a FName would be cheaper for replication, identifying a DataTable row from which the client can load the item-related assets and other static data
at least for initial replication, later on it kinda depends on the amount of static data
aha, ok @winged badger so... if i have in the struct the Texture2D and Mesh inside the Struct with UProperty maybe this not have a lot of problem for replicate? for the bandtwich?
they can be tagged NonReplicated
but no, later on its 4 bytes, only initial bunch will be larger
them,
UPROPERTY(EditAnywhere, BlueprintReadOnly, NotReplicated, Category = Item)
USkeletalMesh* Mesh;
UPROPERTY(EditAnywhere, BlueprintReadOnly, NotReplicated, Category = Item)
UTexture2D* Icon;
And add in the Inventory replication (n the client side) read the Database and load the mesh and texture
thanks @winged badger
the very cheapest way is have a DataTable or other static data container that can be identified with a byte or an integer
replicate the ID, convert to FName, grab the DataTable pointer from a GameSingleton, grab the row with the resulting FName, load the assets
yeah, and only replicated yeah, thanks @winged badger
thats is the best approch, thanks
with structs you won't have the option to set the DT asset in blueprint
another question is if u know what is the best way to create/clone new Inventory Item (struct) from the DataTable
so GameSingleton is my preferred way
you'll typically want a FTableRowBase derived struct for a DataTable
and another you actually use when the game is running representing the item, not item data
i have this
FPZItemDatabase* ItemInDB = ItemDB->FindRow<FPZItemDatabase>(Id, "");
if (ItemInDB && ItemInDB->Item)
but the problem is this is a pointer, if i want to change only a Hitpoints for 1 specify item, this change the others hitpoints of the same struct
with a constructor taking the DTRow struct
and probably == operators for those 2 types + some helper functions
yeah, you'd have something like
yeah but with this i have a pointer for a struct, i need to create another new struct from this struct
FPZItemDatabase* ItemInDB = ItemDB->FindRow<FPZItemDatabase>(Id, "");
if (ItemInDB && ItemInDB->Item)
{
MyItemContainer.Add(FPZItem(*ItemInDB));
}
because is new item and maybe have change like Hitpoints
with this create a new struct with the info of the item?
you create one struct to hold data
one struct to use during runtime
and you make a constructor for "runtime" item struct that takes a data struct
basically copies what it needs to, loads what it needs to, initializes properly
yeah, amazing, thanks @winged badger
`sorry @winged badger another question, i try to create a DataTable with this structure
UPROPERTY(EditAnywhere, BlueprintReadOnly)
int32 ItemId;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FTestItem Item;
and i have other 3 DatTable, each per each ItemType
FTestItem
FWeaponTestItem
FArmorTestItem
You know how i can reference in the ItemDatabase the reference of differents items?
I want in the DataTable, in the ItemDB this structure
UPROPERTY(EditAnywhere, BlueprintReadOnly)
int32 ItemId;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FTestItem Item;
With the Item is a reference of another Struct, maybe weapon, armor or another derived struct of a FTestItem
the DT rowname is its ID
you can transform it for replication
but the DT row struct doesn't have to know it
i have workaround, in the Singleton i can see the base Type and depends the Type see in different DataTable, but i want a DataTable with containt alls Ids and references of differentes struct
to have all items in one DataTable, and 1 DT per ItemType but maybe is not possible?
you can have separate datatables for items, weapons and armor
or you can have one for items with optional FDataTableRowHandle field
that can point to additional information for weapons/armor
and you can write helper functions in singleton, or w/e you end up holding the DT poitners
to grab what you need in simple manner
kidna depends mostly on whoever is going to work with that data is most comfortable with
maybe i try with the FDataTableRowHandle field for a one Item Database DT and create another DT for Weapon and another for Armor. And reference in the Item Database DT the item with the ID
to have in one database all items
thanks!
let me my blur correcting glasses on for that screenie :p
im trying to run Server.exe
and i have some commandline stuff i want to pass
like Players=10 GameMode=2
no matter what i try it runs it with MenuMap?Player=Name?Players=10...
whats the proper way to accept commandline arguments into MenuMap with Server.exe
Ahh i was trying to use GetConsoleLine
those params are accessed from gamemode options
Hi all strange issue. I have a repnotify variable which does fire and change server side, but client side variable does not change, sometimes. When I open the project, it doesn't work. Randomly as I am attempting to debug why, it starts working and stays working until I restart the project. I can set the variable using multicast but I'd really like to know why it's not replicating to clients in the first place. The variable is a struct consisting of uobject variables
example: before making my last message it was NOT replicating, now I tried again, changing absolutely nothing, and it worked
just restarted proejct - not replicating anymore
Figured out what's 'triggering' the successful replication, but it's very very strange. I have to save the map by either moving an object around or doing anything at all really, I just need to save the map. Then replication works.
I thought this was compiling the item or something, so I went an manually compiled the item, but that didn't make replication work, I had to still save the map. Here's a video: Hopefully someone can give some insight into this weird issue: https://www.youtube.com/watch?v=VQTUWhrJRAo&feature=youtu.be
Hey, looking through the IPNetDriver class I found this cvar IpNetDriverUseReceiveThread, this states that If true, the IpNetDriver will call the socket's RecvFrom function on a separate thread (not the game thread) . Can someone give me an example of when this should be useful?
Hi, any way to print in the game the in/out bandwitch and the Ping related to the server?
Without use net stat command console
Hello people ✌🏻 i need some help with replicating data in my multiplayer game... if anyone has some time for a discord call real quick, please hit me up! Thanks a lot!
@thin stratus
Been reading your compendium, very very helpful, thank you
I've run into an issue with the CopyProperties event on my player state
I'm using the event, but the cast to my new player state blueprint fails, meaning the values aren't transferred, any reason why?
Does it have anything to do with my gamemode changing between a menu gamemode and an actual in-game gamemode?
new PlayerState will be of type set in the new GameMode
Huh?
GameMode has all those class variables
when you hit class defaults in BP
one of them is for PlayerState
menu has its own PS with no CopyProperties override?
Well, my menu does have its own ps, but it definitely does have the override
I thought it may have been because my transition map didn't have a ps, but that's not it either.
back to your original question: swapping GameModes isn't a reason to CopyProperties to fail in itself
Oh, good.
unless the PS class is set wrong
The PS classes are 100% set correctly, I've tested with print strings
i do have menu/lobby/game GM/PS separately and CopyProperties works just fine
Haha I got it, never mind
I recently deleted my main menu gamemode and re-made it, and I forgot to enable seamless travel.
No hate please I suck I know xD cheers @winged badger
May I notice: MainMenu in a Multiplayer Scenario shouldn't perform SeamlessTravel
The whole SeamlessTravel and "PersistData" shizzle is meant for an ongoing session where everyone is playing together and you move between maps.
E.g. Counter Strike or UT switching levels.
Or Borderlands moving to a new zone.
The Host and Connection process (openLevel mapName?listen) etc. should technically be hard travels.
If you need to persist data between that you should do that via savegames and similar.
@red pollen
Right... I do have a lobby system if that changes anything
Where everybody is loaded into the session before being sent to travel to the actual game map
Just picture it as that: As soon as the Server hosts and is on the level that players connect to, you can start seamless traveling.
Doesn't matter if it's a lobby or directly the map to play on. Connecting to the Server and the Server hosting should both be hardtravels as far as Epic's docs go
Yeah yeah, that's all good. I might have done it in a bit of a weird way but I'm sure I've done it right 😄 I'll let you know if I hit any more humps. Your compendium is so sick btw 😄
im running into issue where listen server works from within game on steam but as soon as i run a dedicated server i cant find the game anymore using steam.
LogOnlineSession: Warning: STEAM: Server setting ,GameMode_s:Free For All overflows Steam SetGameTags call
i have that in log
Ok so it seems the reason i cant see it cause its a incompatible build id
im spawning a weapon on server and passing in Self (character) as the owner to it... in my master weapon... im checking to see if get owner is locally controlled... it comes as false for clients but true for server
any idea why that would be?
In which function are you spawning the Weapon and in Which are you checking the owner?
spawning inside character
@gray scroll i had a similar issue, i ended up setting the owner of the weapon on both client and server
and checking owner inside master weapon
even when set on the server, the client didnt know who the owner was, im assuming its not replicated
@gray scroll I asked in which functions. Be more precise.
And WeaponSpawn is called from where?
I'm asking cause I lot of people assume a Pawn/Character is already properly setup on BeginPlay.
While BeginPlay is usually too early cause the Pawn/Character isn't possessed at that point.
the input node owner
can u drag wire from there
and get controller
ur passing pawn reference
not player controller
That shouldn't matter
Also IsLocallyControlled will return false on all other clients anyway.
Does it anywhere say I am?
just curios 🙂 take it as a no
No I'm asking in case something is misleading
seems i found the ue4 wizard
But no, I'm not working for Epic Games.
In that case, not fully related to the issue but, you don't need the event to be an RPC, right?
I need the weapons to spawn on server
OnPossess in the Character already only calls on the Server
Ah
is it possible to run a peer to peer network in unreal and can someone point me in the right direction?
anything is possible, but im not sure of the difficulty in this case. but is there a reason you dont want to use the client server setup?
I get paid late december and im brassic rn
sorry aha, slang term for in debt/skint
you can still have the client host the server, you dont need dedicated servers setup
That'd work, where can I find documentation?
youtube and google what all your trying to do, most multiplayer tutorials generally go this route. for example if you launch a third person example project on one pc and then on another pc in the console type "open IPAddressHere" it should connect to the first pc and the 2 can play together
you can do the same via steam and such as well but that gets more complicated than simply having a text box where you enter in the IP address to connect to but its enough for testing until your ready to move to something more complex
Thank you!
Any idea why network dormancy doesn't work in blueprint project? I have a single actor which has a replicated variable that server changes. It does not matter what the dormancy setting is, the variable is always replicated to clients. I tried to set dormancy to Dormant All, but values are still replicating.
I'm using the third person template and everything is really jittery on the client, especially moving
Nott entirely sure it fits here - but what's a simulated client? can't find a clear doc from googling
is there any way to set current game mode via bps?
instead of doing it on the world outliner
that way i can have multiple child game modes and set them depending on game mode selected
you can specify the ?Game= parameter with the full path to the class (you can create aliases in an ini file later)
like this? listen?Game=/Game/Blueprints/Game/GM.GM_C @lost inlet
I think so but I've only dealt with native gamemode classes
How can I get my local IP address in-game? (Like 192.168.xx.xx)
Can be by the node get my index ID? 🤔
With the node get controller ID ou le get controller from ID
this is a bit more of a general question, but I'm having trouble with timing of my animations and syncing up over the network, in a dedicated server environment. I have a throw animation that triggers an animnotify which calls an event dispatcher within my anim_bp. I bind to that dispatcher from within my Pawn and trigger the throw code. If you are throwing, your client sees it perfectly every time, however, sometimes, the opponent client sees the object thrown before the animation plays.
Are there any gotcha's anyones run into in a similar situation?
NOTE The animation is based on a replicated "state" enum in PlayerState
Fixed it. Added a Force Net Update on my PlayerState where the server sets the "state" enum
How can I check whether an actor (like a Weapon) is attached to another actor (Character Blueprint)
i have a small problem im new to replicating
Any help for my dormancy problem? Does the dormancy setting work for you guys?
@meager spade yeah I just used a check parent socket
because sometimes the gun would float in the air
Hey there ive got an really annoying bug in my customization system. Ive got a datatable which stores the skin and the materials per faction/row. I load them via a custom function and voila based on the selected faction it will return the mesh and the materials which i then plug into my cpp function. This cpp function changes two variables replicated with OnRep. The OnRep function then sets the mesh and the materials to my char. Somehow this doesnt work? Any ideas? (btw will provide screenshots etc. if you need them)
Bit of a weird question
You never need to do that in UE4 unless you're working with an external service
So maybe some context ?
is there a reason you want to make your own server?
@uncut oracle There is no such thing really
Every single UE4 class implements its own serialization or deserialization
there is this void UActorChannel::ProcessBunch( FInBunch & Bunch ) i don't think touching that is the way to go though
Another day another bug. Is there any reason why this wouldn't run on every client that joins the game? It's in the GameMode asset.
(Sorry for butting in I think someone will have the solution fast)
you can (de)serialize that just fine (and anything else) without touching the unreal's network infrastructure
This is so frustrating, nothing I am trying is working. For some reason, when I enter the game, only the listen server spawns, not the other players.
I've tried having it all set up in the gamemode, that doesn't work. I've tried having it hosted in the player controller, doesn't work
@uncut oracle No single class does it. Every type implements its own.
You know you'll have to write hundreds of thousands of lines of code, right? The entire UE4 framework needs to be replicated
UE4 multiplayer clients expect the entire game framework to run on the server
You'll need all of Actor, GameMode, PlayerController, Pawn etc at a minimum
@hollow arrow Getting "a local IP address" is a difficult question. E.g. my dev workstation has 4 local ip addresses. You can use ISocketSubsystem::GetAddressInfo to retrieve the addresses, but then it's up to you to choose which one is the "right" one, which is rather difficult in practice. One option is to ask a server. What are you trying to do?
No
There isn't even one stream of data AFAIK
And there isn't a single reader or writer
It's literally all over the code
Even if you did, you would still need to reproduce the behaviour of the entire UE4 gameplay framework on your server to get a client to connect
If you're doing this, drop UE4 multiplayer features entirely and implement your own protocol
It's going to be orders of magnitude easier
I don't see a question there
... Yes ?
Does that change any of what I wrote earlier ?
@uncut oracle I've done something like what you're talking about before. we did it by ignoring UE4's networking totally.
you make your own protocall and bind it to the uobjects via whatever system fits, and the game assumes its in singleplayer
its totally not simple
This is absolutely the way to go, yes
and what he needs is a custom struct with a custom NetSerialize function
which is significantly simpler then writing an entire network infrastructure
but that is totaly dependant on the protocall
protobuf or captn proto are good places to start
messing with UE4's networking stack is pointless if you are not using their server
there are way too many assumption
^
Either use the built-in server system, or ignore all of the replication/RPC/multiplayer stuff entirely
It's quite easy to do your own communication system, get updates from a server, read them and apply them to your objects
compared to hacking and changing UE4 yes, but I would not call it easy
That's not how this works.
out of interest what are you trying to achieve? @uncut oracle
You cannot implement a game server that is compatible with UE4 clients, and uses the built-in networking, without effectively rewriting all of UE4
Or at least an immense part of it
I'll stop answering this since there is no point repeating
you put all your data inside a struct
you implement NetSerialize that can serialize that into array of bits and deserialize from that same array
and thats all you need
I can't seem to get the RelativeLocation of the mesh of a character to replicate on other clients.
I'm doing and RPC multicast with RepNotify on the variable, the function from that changes 3 things, and RelativeLocation is the only one that doesn't get sent to other clients (But it works on the server). Component Replicates is enabled on the mesh and capsule. Any help would be appreciated
https://media.discordapp.net/attachments/608637922115321868/651080850057854980/unknown.png?width=788&height=904
https://media.discordapp.net/attachments/608637922115321868/651085014683090973/unknown.png
The initial event is called from the Controller and everything is executed on the parent class of my characters (Avatar)
Can someone point me in the right direction to a decent way handle player spawning when they first enter the map?
Because I'm seeing so many youtube tutorials just do it wrong, like trying to get the gamemode client side and shit like that
override HandleStartingNewPlayer
if you want default functionality (RestartPlayer call), call parent when you override it
if not just spawn your character, possess it, do w/e else you need doing
how can I call an RPC on a spesific client from another client without the use of multicast
Client 1 > Server > Client 2
function has to be working locally so I cannot execute it on the server
It needs to be executed on locally on the other client
so How to RPC to only one spesific client by using player state or something ?
How do you know which client you want it to run on?
I know it by an overlap event
but overlap doesnt get executed on the target
I have a grass that hides the player
so when the player enters the grass he sees the player inside
but the player inside doesnt see the player who entered
because overlap has been already fired
I cannot continuisly call overlapping actors cuz its not ideal
so I want to tell to server
that I overlapped with someone
and send the player state to server to pass it back to that player
I am using C++ as well
so any help would be appreciated
why would the client ask the server to affect another client?
i mean, overlaps fire on server and client
so why not just get the server to send a client rpc?
because players inside the grass are only meant to see eachother
yeah thats just what I thought
let me try and get back to you
right but that looks like something the actor (grass overlap) should handle
it should know who is in the grass
and and let the players no accordingly
why is it?
so you don't have some high level manager
made with a lot of pieces
which can store who is in grass or not?
and?
and 100 replication of arrays
no why would it
i just said, a manager
a single class
one replication
when you enter grass, you tell the manager
of 100 arrays
because every grass piece needs to hold who is in it
why?
so the players can see each other
it does because
everytime i move in the grass
I would need to call rpc to server to check if there is a player there
why would you?
so server can show him to me
yeah
but here is the thing
lets say I have 50 radius capsule of stealth sight
and 10 radius of hitbox of the player
yup
stealth sight is not meant to put you in stealth
so hitbox does
but when I enter the grass and if the player is there
stealth has already overlapped the player
so he cannot know without me telling him I got in
or constantly checking if there is someone nearby
that seems like a logic issue, not related to the grass
you just said, you have a overlap
which when you enter grass it should tell the other client you spotted him without that client knowing you entered
so it doesnt execute begin overlap again without leaving and getting back in
yeah hold on
but either way to send a client rpc to another client
is quite simple
but requires two functions
but dont forget server should also overlap
so it will be like
ServerDoSomething(APlayerChar* OtherPLayer);
then that will do OtherPlayer->ClientDoSomething();
but
i still feel there is a better way
there is always a better way of course
seems like you need something like:
MySuperIntelligentGrassManager
{
static TMap<GrassObject, TArray<Player>>
}
- Whenever a player enters a grass object they get added to that grass object's array
- Whenever a player leaves a grass object they get removed from that grass object's array
- Also whenever a player enters a grass object, the manager can simply look up which other players are in it and do whatever you need to them
yeah that was my first try
only on server of course
the problem is
only 2-3 players inside the same area
should see eachother
others doesnt need to know
so I would need to call at least 2 rpc to do this
like if there's 5 players inside a single grass object you need to filter which ones become visible to which other ones? should be handled where i said "do whatever you need to them"
yet another option: player locally stores TSet<GrassObject> GrassObjectsImIn and server broadcasts every time other players enter/leave grass objects. local player reacts as needed by showing/hiding. probably easier to cheat (if I can cheat memory to say I'm in every grass object)
yeah I know there is a catch to that
and that s the way I have choosen but
its not really important
its not really a major issue
since areas can be destroyed anyways
and you cant really do that
because I am doing it by overlap events
you should be moving your client locally every grass
and it doesnt work that way since movement is handled by the player
This is in my HUD_BP Hud class blueprint. How do I call this from my character blueprint and not have it accidentally replicate to other players
is locally controlled > Branch
put the is locally controlled in where
before calling your function
in character blueprint?
yeah ?
uw
Any one had luck with VOIP and aws
here's one that not many may have run into, but has anyone run into a situation where an actor of the same class is destroyed and recreated in the same game frame with the same owner but the new actor has different names between client and server?
so things like RPCs don't work
client world has the actor suffixed with "1"
server does not have this suffix
all RPCs fail
wtf
that doesn't seem right
it should make a new actor channel and then the name doesn't matter
Hey, guys!
Has anyone ever had a problem with a client beacon not receiving replication when connected to a hostbeacon on client build configurations?
to be more precise ALobbyBeaconHost and ALobbyBeaconClient
are you trying to run the beacon host on a client build?
Well, is there another way to make a party session?
When I bind a function to an action/axis mapping, how does the server know which client has the right to trigger that function?
input only ever happens locally
Yes, lets say the input triggers a server rpc defined in an actor owned by controller X, what prevents controller Y from triggering that same object's rpc. I know it's weird but I can't get it out of my head : D
it doesn't have a data channel to send it with its own input handlers
you might call the X's RPC directly from Y if you fuck up though, nothing automagically helping you there
but you'll have to do it using X object reference
what do you mean by data channel if you dont mind me asking
having input handlers in protected: section of the header
will cause a compile error if you try to cross wires on them
as in, each controller gets one
its the only thing that can send Server or receive Client RPC
@fleet raven i do get "Error: ReceivedNextBunch: Reliable bunch before channel was fully open" whenever this occurs
this sounds like something is bugged
normal replication should never ever cause that message
spawning an actor with same class and name as the one you just destroyed that frame though...
should be fine in theory
its something i would not readily trust unreal with not to break
i deferred it by a frame and it still does it
I guess the package map isn't going to like that at all
also the destroyed actors are still visible in the world outliner on the client
@lost inlet if you spawn the Actor by changing its name in FActorSpawnParameters?
that shouldn't cause issues 🤔
orphaned actors that only exist on the client is an issue though
was the original instance loaded from the package?
you mean from the level? this is an actor created at runtime (ie. a weapon)
same name is not required for addressing replicated Actors, they will use NetGUID
or replicated UObjects of any kind for that matter
only times when names have to match is when you count on IsNameSupportedForNetworking() to return true for addressing to work
AActor* UWorld::SpawnActorAbsolute
i would be curious if a breakpoint in the function triggers on client after you do the weapon swap
Hey im trying to run my dedicated server on a linux box how do i make this work?
Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
I dont have a AppID yet, so im using the temp Dev one
well one thing that's happening is the RPC is never leaving the client
how can i debug that? the owner is correct
you can try see whats going on in GetRemoteFunctionCallspace and ProcessRemoteFunction
(i am guessing at this point)
AActor::GetFunctionCallspace returned 1 int
which is Remote
UNetDriver::ProcessRemoteFunction does get called on the client
and then to InternalProcessRemoteFunction
UActorChannel* Ch = Connection->FindActorChannelRef(Actor); doesn't return a valid actor channel
so what reasons could there be that a channel doesn't get created for a specific actor?
never read that part of the source 😦
does the client spawn a new weapon when server does?
it will use UWorld::SpawnActorAbsolute
you can go couple of steps back from there in the callstack to where it received the bunch with instructions to spawn it
the client doesn't run any spawning logic, i even added check()s to make sure
the switch weapon RPC (which runs on the character) works fine, it's just any RPCs that are called on the weapon itself
i also made a UDN post for it so hopefully someone from epic knows
bool UChannel::ReceivedNextBunch( FInBunch & Bunch, bool & bOutSkipAck )
thats where your log comes from
but the code involved is not light reading
it seems the log gets printed for each weapon resupply anyway so it's not really an indicator if the issue will exist
it's pretty specific in which weapon is affected since it uses its own spawning logic (underbarrel weapon), even though it shares a lot in common with the rest
it's not 100%, but i can get it to happen pretty easily
log LogNetPackageMap log