#multiplayer
1 messages · Page 579 of 1
Isn't that basically what I wrote?
Oh
You even want to throw the Game Code itself out of the window?
ye
So it could simply use a headless client
I know there are people who replaced the Server stuff with something else
but unreal got some fancy rendering/particle stuff I would like to leverage
And let UE4 only be the client that connects to that new server
But despite that, no idea
I c
main reason i picked ue4 was networking out the box
Yeah but there are some setups where UE4 isn't doing well
Specially large server setups for MMOs and what not
Where it makes more sense to just have some proper Server setup and then translate between what UE4 uses and what the Server uses.
oh god i bet that is hell. ive never tried anything more than 8 players
For me the concern is player count/performance as well as making something where I feel unreal might not be the absolutely best option. I.e. turn based.
Ah, UE4 can do 100 Players if you utilizes their Replication Graph, but even that is not straight forward.
but I might just be to unexperienced and talk out of my ass :)
But I'm more talking about a lot more
thousands
Yop
:}
Turn Based is not really what I would say UE4 is good or bad at
You can write whatever code you need to support that
But there are some other things where UE4 isn't the best option in terms of server architecture I would guess
Like proper seamless transition between Servers
Like if you want to do something like WoW's servers with instances etc.
Oh
UE4 is more build upon the traditional Unreal Tournament Dedicated Servers
Gotcha, also please dont talk about UT, makes me so sad haha
Or whatever Borderlands qualifies as if you talk about Listen Servers
But everything beyond (despite Battle Royal) is usually more fighting than anything I would assume
I would never try to make something bigger in UE4 without having some proper server architecture in the back.
I am mostly mucking about trying to find interesting use cases for stuff at this point, but its good to know whats possible.
A lot of stuff is possible if you throw away the standard build in stuff at the point it becomes unperformant
(i just installed ut99 469 patch with dx11 and high res textures yesterday. really brought back memories)
Like the CharacterMovementComponent
It's "okayish" for what it is, but large scale you need to handle movement replication differently
Okay
Because you can't use that CMC for 1k players or so
But yeah, i can't talk much about it as I never tackled it
@thin stratus @soft girder Thanks buddy I will implement it🙏
My experience is rather limited too, the only time I dealt with something this scale was in a MMO where we did as I said earlier, the game client ran completely standalone and then we used unity for rendering simply and it was performant even in over 100vs100 battles so it seems like a nice solution.
Plus testing is a lot easier if it is a headless client
@thin stratus i have a question. At the end of destroy and posses i have the set nodes. will setting to nothing make the value null? does this work if i wanna clear a value
It's something I would never tackle without having a bunch of programmers at my hand just for that
Well I left the industry and only code for fun these days so not likely to have that kind of resources
I'm not the person to tell you what you should and shouldn't do.
But I personally would not waste my time on this.
I appreciate the feedback
But rather look at something managable and achievable
We can do so much in UE4 for Local COuch Coop or Listen Server based
And a lot can be achieved by one person if the scope is kept small
Yeah I guess I should explore it more
If you just want to check for fun, then sure. Just keep in mind how unlikely it is to get something that huge going without a big team
@soft girder Setting a Reference variable to nothing sets it to null, yes
Anyway gotta run, thanks for the talk @thin stratus :)
It's equal to do this:
ASomeActor* pointer;
pointer = nullptr;
just wanted to make sure it was the same as c++
Yeah it is. These "Reference" variables are not references anyway
They are pointers
ive always wondered. kind of just done it because it worked
so are we replicating pointers?
when we pass them into an rpc
You are replicating net-ids
because addresses are not the same
Which are used on the Client and Server to look up the matching actor instance
ok
Yeah, memory addresses are not the same
ive read your compendium. very good stuff. it helped me and gf alot
thank you for taking the time to make it
Glad it helps (:
So I got my S3 set up so that unreal can upload and download .sav files from the S3 server. Everything seems to be working as intended. Is there any pitfalls I may run into using this instead of using lambda and dynamodb?
I will need to upload and download just as much as I would be accessing dynamodb for the same information.
I am splitting the .sav files up for each user. So one user would have a save file for every item in the game, save file for friends list, save files for every player stat lv hp location ect..
that way when downloading and uploading the .sav files they are as small as possible and I would not need to upload or download sav files that have information that was not or did not need changed.
@vale ermine there is a problem, and really concerning problem.
what is that?
Your client can mutate the data which are r trying to save
the server will be making the changes to the sav files not the client
Meaning dedicated server
yes
Then I don't see any problem..
The only problem now is network charges
If client wants small bit of information then you need to download whole file
May incur more charge on network bandwidth
that what i am saying is i will split all information into separate sav files for every player
that way it would be as small as possible but yea thank you I will watch the cost
Why aren't you considering EOS?
The reason I am not considering EOS is because I develop for android and the person that made the EOS plugin had to hack the crap out of it to get it working
@thin stratus @soft girder need help
I think you aren't aware that epic has started pushing their own implementation of EOS in master branch
yo
@soft girder it isn't working
it needs to be more refined. I am not happy with its current state.
:}
I have implemented on actor
ok show the blueprint
@soft girder can u dm me
ya
I will look into it. I went from lambda to EOS to S3
@soft girder I am unable to text u
i am now happy with s3 but i will take a look at eso again when i have time
thank you for the input
Welcome
Hello - tearing my hair out with this one. Have a listen server with 1 extra client that I am attempting to allow a user to select a character type and then load into the level.
I have a map/GM with a simple button widget allowing the user selecting the character type. If the server selects a character it calls CreateSession and the Open Level. Feels straight forward, but when I click from the server, it looks like it creates 2 sessions, opens the level and loads a character into each.
You are kinda listing multiple problems.
Here are some rules that apply to some of the keywords you wrote, maybe that helps.
- OpenLevel is a HardTravel and should only be used (in Blueprints) to move between Singleplayer Levels, for the Initial
?listenhosting of a Server or to go back to the MainMenu (+- some other stuff). - Once a Server has opened a Level with OpenLevel and
?listen, they have to useServerTravel <mapname>to move to the next map. This can be done via theExecuteConsoleCommandnode in Blueprints. - Only the Server can use ServerTravel.
- Clients, if using Sessions, join to a Server via
JoinSessionNode. Otherwise they join viaopen <ipaddress>also utilizing theExecuteConsoleCommandnode (not sure you can use the OpenLevel node with an IP). - Once connected to a Server, Clients would only use OpenLevel to disconnect from it and return back to the MainMenu.
@ruby rock
Feels straight forward, but when I click from the server, it looks like it creates 2 sessions, opens the level and loads a character into each.
Should that say "but when I click from the client..." ? Because you already wrote that the Server works fine? Not sure what you are actually describing here
Also I don't see you passing over any data for even knowing what Character to spawn. For a Server you can use the Options but Clients for example don't even support that in Blueprints.
Hey, does UE has some methode called on the client for an actor that tells the server it was replicated to a client? (Since it seems RPCs I call, before the client has the actor, just vanish ...)
@thin stratus - thanks for the detailed reply.
Sorry it's getting late 🙂
I'm starting a listen server and a client. But I'm just clicking on the Server - so from your above, OpenLevel seems to be a valid function to use. However, when I do this, both the Listen Server and the Client seem to create sessions (both open windows with the map, and the playercharacter loaded in).
re:Characters - yeah, I dropped that from the example as I didn't want to add more complexity to it. The above image has the same issue.
@marble gazelle Not sure. Usually you set variables that need to replicate with the Actor directly when spawning them on the SpawnActor node (or deferred via c++)
well in this case I call RPCs for add some data read from the players profile
@ruby rock Are you sure you aren't already starting the game connected to each other?
@marble gazelle Why do you need an RPC for that?
You can pass in the Data directly when spawning the Actor
And the Client would have access to it on BeginPlay of that Actor
Yeah that's still only done once
its part of a component part of the player controller
And the component itself requests the data
game connected to each other
Sorry how do you mean?
Where are you testing this, in the Editor?
Yes
What are your play-settings set to?
NetMode "Play As ListenServer" will auto connect them
If your Server presses on the Button to host, it will kick the Client
That's why you think it opens a map on both
Set it to "Play Offline"
I understand that the namespace for AWS S3 is shared among all AWS accounts. The issue I see here is that I want to create a separate bucket for each player. Do you guys not recommend that? The logical thing to do is make one bucket that I would make so that the name space is mine and I will never run into an issue with a used namespace. I don't like having everything in one bucket for all users.
That sounds kinda like a question you should ask on their forums. :<
if someone is interested, I had to delay my calls until AActor::OnSerializeNewActor was called
ok then you answered it for me
@marble gazelle With an actual "Delay" node?
just make a bucket
:D you could just write "yes" or "no"
If the answer is "yes" then you'll get to hear something from me anyway
@thin stratus ehm no? But actually also yes.
So my issue is that on my def env I don't use our "OnlineDataprovider" since I'd need to setup our full stack which I dont want. Ths I added "OfflineDataprovider" that emediately give me a response with the data. But this is bad, since My calls, initializing my components, request the player data. Well this comes in sync, so not in the next frame and thus I call an RPC on the component, that gets lost, because the channel doesn't seem to be ready for this actor. Well shortly after, most likely in the same frame, the call to OnSerializeNewActor comes -> starting replication for the player controller, so a good time to request the data. But since this request in my dev env is still sync, I can't call it in the same frame, so I needed to add a Delegate which is called the next frame. (You are not allowed to call RPCs while you are replicating :P)
Okay. We had a lot of peeps that said "Oh it's not valid yet? Let me add a 2 second delay. Cool it works."
And yeah, that wouldn't be good. Delaying a frame should be fine if you can ensure that the Client receives the data properly.
I assume it even gets bundled into the same package.
It won't get bundled into the same package, since during OnSerializeNewActor you are sending a package
I just can't find good documentation on the Unreal Replication, like what happens when
Usually the answer to that is "There is none, you have to look into the Source Code and breakpoint your way through it."
(For example in on of our inhouse engines we get notified on the server, when a new actor that is replicated got discovored on client side, so you can send some init data, and you know the client has the actor)
that's what I do 😛
I could assume UE4 has that too, but you'd need to follow the packages along and see if they ever call some sort of handshake function
my current assumption is its OnSerializeNewActor
It's one of those things you will never look into unless you need it
ah I can validate that, sec need to add the method to an actor that is not only replicated to the owener
/**
* SerializeNewActor has just been called on the actor before network replication (server side)
* @param OutBunch Bunch containing serialized contents of actor prior to replication
*/
virtual void OnSerializeNewActor(class FOutBunch& OutBunch) {};
Comment sounds like it's differently timed, but then again, not the most informative comment either.
(I'm bit confused, why you posted it, since I actuall have read the code)
but it's exactly it, each time a new connection gets the actor, its called
General discussion info. In case someone else has their eyes on the conversation
😄 fair enough
so tested with 2 clients 1 server. For the player actor this got called 4 times, for the controllers 2 time.
Did you try with some high pings and package loss simulation? Just curious
OnActorChannelOpen seems to be the equivalent on the client btw
? does it matter, its called on the server when it starts replication for an actor
Right. I mistunderstood what exactly you wanted then. I thought you are interested in a callback for when the Actor is also fully available on the client.
ah no^^ I just want to know its good to send RPCs now
Fair enough
Soooo thx my rubber duck 😄 🦆
No worries. I learned a bit more again too.
😉
i have a projectile that gets spawned on the server, currently traveling by applying force on the X axis (it rotates towards the direction it should move) but it looks horrible on the client side (authorian server). Is there another (better) way to handle projectiles in this situation ?
or should i just remove the force on the client side and hope the server sends the correct values ?
We usually end up using the ProjectileMovementComponent
Using Force is ,iirc, using Physics and Physics + Multiplayer is not really want you want here.
yeah i figured that out ... it was build to "work and fix later" later is now ^^
The ProjectileMovementComponent should also have a way to specify a "VisualComponent", so the Mesh, because if corrections and lags come in place, it would teleport the collision but interpolate the Mesh, so it remains smooth in visuals (unless the correction os too big).
However not sure that's accessible in Blueprints.
also, did you ever teach at the HSHL ? I get the feeling i had someone teaching me sharing the same name as you and introducing me to UE4 like 3 or 4 years ago
Nope, I only taught general IT as a Student in Wuppertal.
i guess one day i will run into the deadend and have to use C++ to continue this project ^^
this wouldve been a fun coincidence since i only remember his name being cedric ^^
:P
/**
* Assigns the component that will be used for network interpolation/smoothing. It is expected that this is a component attached somewhere below the UpdatedComponent.
* When network updates use MoveInterpolationTarget() to move the UpdatedComponent, the interpolated component's relative offset will be maintained and smoothed over
* the course of future component ticks. The current relative location and rotation of the component is saved as the target offset for future interpolation.
* @see MoveInterpolationTarget(), bInterpMovement, bInterpRotation
*/
UFUNCTION(BlueprintCallable, Category="Game|Components|ProjectileMovement|Interpolation")
virtual void SetInterpolatedComponent(USceneComponent* Component);
Seems to be exposed
The "UpdateComponent" that the comment is taking about is the RootComponent usually, so make sure the Root is the Collision of your Projectile.
And then call SetInterpolatedComponent with your Mesh somewhere on BeginPlay or so in your Projectile.
so far i just switched to the projectilemovementcomponent and it looks a lot smoother already
Make sure you attach all visuals to the Mesh then
Because otherwise they will not be smoothed
Such as Trail VFX
currently its a beautiful white ball 🙂
Same goes for Characters in case you have them
All components with visuals that should be smoothed should be a child of the Mesh
They don't really tell you that
CharacterMovementComponent smooths mesh location but teleports the root (+ all child components of the root but the mesh)
oh i just started super naive and just did what somewhat worked out ... its mostly just to understand RPCs and how things should be handled from a client <-> server perspective
but thats a super helpful advice, im certain it was soemwhere in your document too (atleast i would guess that) when i read it a month ago, maybe i forgot about it because i started with too little knowledge
need to figure out how to change the root component again
i am not 100% sure this is the correct approach to your suggestion ?
What is the parent class of your actor?
The (Inherited) suggests that the Parent added the SceneRoot
So you need to change it in there
uhm right yeah, im stupid.
Thats a spawnable Actor without anything attatched to it, im using it for basic spawnable behaviour of my objects and as casting target
so this component needs to have the collider ? :/
It's a SceneComponent at the moment
It should probably be the Collision one
I don't see a big reason to have a parent class for all spawnable stuff
I would just make an Actor child BP_Projectile_Base for my Projectiles.
Way too limiting otherwise.
yeah with my new found knowledge my approach seems wrong
but glad to talk about it to figure out my mistakes and fix them 🙂
but i get the feeling i should soon start learning C++ if i ever want to work with UE4 in the industry
when running as a listen server does the editor have view of the data serverside?
as far as i understand the editor should show the client 0, so the listen server. But during the debug you can probably set which side of the data you want to see
@devout yacht the illuminati eye bottom right on the outliner lets you choose which world you're viewing
@winged badger @glacial burrow Thanks thats exactly what I was looking for
@winged badger something i didnt knew before, thanks !
how expensive are client RPC's
in terms of performance
like is it ok to run a client rpc on tick
i want to update a "node" (imagine overwatch capture the point) and i want it to update 3 UMG widgets, the team in control, contesting team, and progress towards capture
You're likely better off relying on replicated variables over direct RPCs.
Server-to-client comms should be replicated variables most of the time
but
how expensive would it be to set a replicated variable
on tick
and its another actor
In which terms? CPU or bandwidth?
Setting a replicated variable on tick is free
The bandwidth for a replicated variable is not large either
Yes
or does unreal have a built in check, to ensure to not update unless the value is changed
But replication is not going to happen at the tick frequency
It's goign to happen at a lower rate depending on bandwidht
like, does the value still get replicated though? what if we constantly set it to 0
if its constantly being set to 0
Obviously it doesn't get replicated if it doesn't change.
will the network code realize "oh wait, the value is still 0"
and not waste any bandwidth?
i dont know the underlying concepts that are going on here under the hood
If you set a value from 0 to 0, nothing happens at all
ok
so
i was thinking then
could i perhaps do this in an OnRep function then?
OnRep() => Update player UI
Sure
question though is
where should i put the onrep function and variables
on the node actor?
thats where i was thinking
but im not sure if another actor, can alter a players UI
like can a server spawned actor, alter MY UI?
As far as something like that similar to Overwatch, you'd likely replicate three variables. Two uint8s for the amount of players that the server thinks are capping for each team and a float for capture percentage, maybe even three uint8s if you want to compress the capture percent down. Either way, it'd be 3-6 bytes per replication. If you run your server at 20fps, that's only up to 120 bytes per second.
do OnRep functions on other players, get called for us?
How much do Enums cost?
I suppose they are integers
Probably 1 byte, they're uint8s usually.
If you want to use OnRep, your actor would need access to that client's widget that gets updated. I usually store all of my widgets in the HUD class, which makes it very easy for clients to get their own since you just have to get the local controller and call GetHud on it. Alternatively, your widget could have a reference to the capture actor and update itself on tick or so.
I would try to make this all EventBased if possible and not use Tick or Bindings
If you want to use OnRep, your actor would need access to that client's widget that gets updated. I usually store all of my widgets in the HUD class, which makes it very easy for clients to get their own since you just have to get the local controller and call GetHud on it. Alternatively, your widget could have a reference to the capture actor and update itself on tick or so.
@kindred widget I suppose the question here is this: What calls OnRep functions? Who calls it I mean?
Depends on how smooth you want the UI to look. If it's only replicating every 10-20 frames, you could smooth that out a little bit with some predictive work based on the last count of how many players were on point the last time it replicated.
Is OnRep called on all clients that are within the network relevancy range?
Thye are tied to the Replicated Variable
Yeah basically
OnReps in BPs are only "OnPropertyChanged" calls
But that's more or less the same
@kindred widget Well let's say for everything that is not needing any smooth update. But you can still use Tick to interpolate between old and new value
It actually seems to be quite the thing to use Global Slate Invalidation
Which marks bindings useless
But I haven't set that up yet. Someone else in our company had to fight that beast
Haven't heard if that? Is that the invalidation box thing that some recent talk had points on?
I think so yeah
By tick, I also literally meant tick function. I avoid actual binding functions like they're a plague.
Iirc it's mainly to save lots of ms
I think it caches the slate data using the box and the call to invalidate will basically refresh that data
Which sounds, overall, like a pretty effecient setup
guess that's more #umg talk though
wait so im a bit confused
here's aquestion
if I call GetPlayerController(0)
on the client
does that return my local PC?
So inside of my OnRep functions, could I just call GetPlayerController(0)->GetHUD()->UpdateUI()
Yes
u can also use GetWorld()->GetFirstPlayerController()
yea that's probably better than including GameplayStatics.
yeah I checked the code between both of those, the kismet get player controller function loops through everything, while the GetWorld()->GetFirstPlayerController() function just gets the first player controller from the player controller iterator, and returns
much less runtime
kismet loops through everything and does an if check for the id lol
Them ease of use blueprint functions though.
GameplayStatics uses the Iterator too
And you will only have one Controller unless you play local couch coop
Sooo
yea but there's a few other variables that are defined in that function scope
If THAT'S the thing that will kill your performance then you def have other problems :P
class APlayerController* UGameplayStatics::GetPlayerController(const UObject* WorldContextObject, int32 PlayerIndex )
{
if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull))
{
uint32 Index = 0;
for (FConstPlayerControllerIterator Iterator = World->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = Iterator->Get();
if (Index == PlayerIndex)
{
return PlayerController;
}
Index++;
}
}
return nullptr;
}
APlayerController* UWorld::GetFirstPlayerController() const
{
APlayerController* PlayerController = NULL;
if( GetPlayerControllerIterator() )
{
PlayerController = GetPlayerControllerIterator()->Get();
}
return PlayerController;
}```
yeah I mean sure, but it's still a lot less code lol
actually it might be about the same
im not sure what GetWorldFromContextObject does
perhaps GetWorld() is bbasically the same thing
Literally calls GetWorld() on it
yea
To be fair, that short loop isn't going to blip a performance radar unless you're planning on calculating the binary manually with a calculator.
Maybe I want to do that.
Haha, more power to you.
lol
I just want to make sure I do stuff right the first time, so I don't have to go back later and fix stuff.
without a lot of experience that rarely happens
Invent a time machine. Do everything the wrong way, fix it all, send it back in time with time machine.
Yeah, you can't write anything right the first time, even with 10 years of experience
This is game development, you'll remove half the features you create when they're not fun or don't fit the game
Optimize when you're nearly done, focus on having a great game first
On package/launch version it doenst open PrototypeMap as i wrote to Open Level, it opens default gamemode map
but in PIE it opens correct map
Any ideas?
You may need to add the map to the packaging.
Yeah just figured out now.. Thanks
Is there a more efficient way to update a world actor (Sun) from the GameState beside casting from a looping event or on tick (from actor to gamestate)? Im using vars on the Gamestate to drive a Day Cycle, Weather, etc so that they can be modified at runtime. but is there a better way?
Anyone know how I can get access to a users Steam Avatar (C++) ? My goal is to save it in the player state. I haven't been able to find any resources online as it relates to C++
Pretty sure you can find code references online about this
It's not a thing you can do in BPs
I only see documentation on the advanced steam sessions
If you google for UE4 Steam avatar you'll find enough stuff
Second page of google has let me know that I need to somehow use the Steam API as it's not supported in the subsystem. I'l have a look at that api and see what i can find
https://answers.unrealengine.com/questions/437212/steam-profile-image.html
https://www.youtube.com/watch?v=K1lf7N3DBoE
https://answers.unrealengine.com/questions/341228/how-do-i-get-a-steam-avatar-with-onlinesubsystemst.html
not sure which one you need but 3rd is C++ as far as i can see
In this video for the Steam Multiplayer series, we’ll get the player’s Steam name and Avatar image and use it throughout the project. This is more of an overview instead of a tutorial. This video replaces the previous one that was almost 30 minutes long and condenses it. The p...
Thanks. I'l give that a watch. It's unfortunate that there isn't good written documentation easily available
yeah a common problem of unreal 😅
there isn't good written documentation easily available
Anyone know where the save game file saves to on the AWS dedicated server? Do all instances use this location? Game\Saved\SaveGames\savefilelocation.sav Would it be like this?
@peak sentinel I was actually looking for that video yesterday lol thx
does each instance have its own Game\Saved\SaveGames\ location?
Good to know, glad I helped üzi 🙂
Someone has experience with setting up Photon for multiplayer, including voice chat?
Photon's youtube channel has only Unity tutorials…
How can we create a inGame Web browser in a multiplayer game which can be seen by other clients too... like a meeting. One of them is the host and browsing the web and others can just watch the screen ?? Can anyone help ?
Not really sure that's possible with native code
The WebBrowser Widget is already quite limited.
You could maybe try to check if it has callbacks for when a website is opened and then use normal replication to get the URL to the other players, but that sounds like all you can do
I have done that. It works. But it’s not secure then.
If one person login into his gmail account, due to the replication of the URL, all other clients are actually getting logged in into his account. It’s not just sharing the view of his web browser, it actually opening each and every URL on every client
thats a very interesting thing and i wonder the solution for that
but just for an idea, there was a component which displays screen of a website, maybe you can use that instead of using webbrowser widget
I am working on the same thing.
My Browser is present on server, so whatever happened to that browser, is replicated to all clients. Though widgets cant be replicated so for that i have done like this
Each user is doing this on local web browser, and also rpc to server then multicast to client, which does the same thing on there own web browser, which creates the effect of the same
Only thing I did not do , is to do the cursor, that would have been very costly. just the clicks and the text.
thats a very interesting thing and i wonder the solution for that
@peak sentinel , where’s that component ? I have no idea ??
this isn't going to ready made for you
you'll have to experiment with the widget component and the web browser control
I am working on the same thing.
My Browser is present on server, so whatever happened to that browser, is replicated to all clients. Though widgets cant be replicated so for that i have done like this
Each user is doing this on local web browser, and also rpc to server then multicast to client, which does the same thing on there own web browser, which creates the effect of the same
@tranquil yoke what about scrolling ??? Scrolling also doesn’t get replicated. And RPCs is not a good solution for this - I have experienced it till now. It has security breach
but the CEF version in UE4 is a couple of years old, renders at a low framerate and won't be synchronised between clients
Guys, how would i package, Server and client code for blueprints, i want something which i dont want on server,because it meant for client only.
that's a bit more difficult with BP, i manage to make a client only code module
Guys, how would i package, Server and client code for blueprints, i want something which i dont want on server,because it meant for client only.
@tranquil yoke For maps, you can use, “cook only map list”
cooking in UE4 is based on what's referenced by your maps list
Guys, how would i package, Server and client code for blueprints, i want something which i dont want on server,because it meant for client only.
@tranquil yoke and for the code, Just add the “ is dedicated server > Branch “ and put your code after that accordingly
but the CEF version in UE4 is a couple of years old, renders at a low framerate and won't be synchronised between clients
@lost inlet what’s that ?
this is an easily googleable thing. chromium embedded framework
@warped apex Scrolling , clicks and Keyboard , these all are inputs. you just need to pass them to each client and replicate the same behaviour on all other clients
What if i want some code, inside blueprint , only to work for client not server , is Dedicated server node is enough
well yes but the BP will still be packaged
@warped apex Scrolling , clicks and Keyboard , these all are inputs. you just need to pass them to each client and replicate the same behaviour on all other clients
@tranquil yoke Replicating every URL, all the inputs... like this... gonna choke the server like hell.... 🤔 It’s too much packet data in a very short period of time... It’s manageable somehow if there are only 2-4 people in the game... But just suppose what if there are 100 at the same time ??
No, it's pretty fine
how is it? that's pretty minimal in terms of network traffic
as opposed to say, movement
Most games have a lot more data than that
yes, i dont think, event based inputs will choke network
What if i want some code, inside blueprint , only to work for client not server , is Dedicated server node is enough
@tranquil yoke yes. It is. I have done it. But yeah, code will be written in the server package too, but will not work.
@warped apex Problem is the thing i am using, is not getting packged for linux.
as it gets packaged, it requires referencing
wait so is this a problem of something NOT getting packaged?
and the windows server target too?
@warped apex Scrolling , clicks and Keyboard , these all are inputs. you just need to pass them to each client and replicate the same behaviour on all other clients
@tranquil yoke , Anyways, that’s not the actual problem which I fear. The main problem is , this is not right way to do it. Because it’s actually opening every URL on all the clients. It’s not just sharing the screen or like that.
you can use the nuclear option DirectoriesToAlwaysCook
but i'm not sure i have enough context here to know why it wouldn't be packaged
its because of the library issue with linux i guess
I feel like I'm bumping into some idiotic little wall that I can't see o.o
I've got a server set up that I can connect to and that I can walk around on. But then, when I shut down the client and I boot it up again and connect.. I don't get a pawn!
Shut down the server, reboot, connect, pawn. Connect again, no pawn.. Is there any particular reason why I might not be getting a pawn on the 2nd+ connect??
@warped apex what cons do you see with this ?
@warped apex what cons do you see with this ?
@tranquil yoke simple - It’s not safe to login into any kind of account. like google account or anything. Because it does on other clients too.
yeah, that is not good.
and due to this, other clients get the cache of your logged accounts and web history etc in their PCs.
I feel like I'm bumping into some idiotic little wall that I can't see o.o
I've got a server set up that I can connect to and that I can walk around on. But then, when I shut down the client and I boot it up again and connect.. I don't get a pawn!
Shut down the server, reboot, connect, pawn. Connect again, no pawn.. Is there any particular reason why I might not be getting a pawn on the 2nd+ connect??
@thick jungle what kind of server are you using ??
you mean the configuration I use to build the Server.exe in UE4? Development Server
I mean , you made the dedicated server using the regular Unreal type ?
when you connect with your client to the server, what error do you get on second trial ? Is it like something - “ No running process found “ - something like that ???
[2020.10.17-20.24.34:281][386]LogScript: Warning: Accessed None trying to read property CallFunc_K2_GetPawn_ReturnValue_1
CharacterFundamentComponent_Blueprint_C /Game/Maps/RealmInPotentia.RealmInPotentia:PersistentLevel.RIP_PlayerController_C_2147482141.CharacterFundamentComponent_Blueprint
Function /Game/RealmInPotentia/Development/Components/PlayerComponents/CharacterFundamentComponent_Blueprint.CharacterFundamentComponent_Blueprint_C:ExecuteUbergraph_CharacterFundamentComponent_Blueprint:0460
[2020.10.17-20.24.34:282][386]LogScript: Warning: Script call stack:
Function /Game/RealmInPotentia/Development/Components/PlayerComponents/CharacterFundamentComponent_Blueprint.CharacterFundamentComponent_Blueprint_C:ExecuteUbergraph_CharacterFundamentComponent_Blueprint
I actually get a "Accessed none trying to read GetPawn ReturnValue". That's server-side. Client-side seems to be acting like a spectator camera
Can’t figure out with this log only.
If your client doesn’t connect the server on the 2nd trial, just open the console on the client and write “ open 127.0.0.1 “ It will try it again. It’s buggy on Local network. Sometimes, it just doesn’t connect seamlessly
Sometimes, it connects the server but doesn’t load further, in that case, you need to click in the CMD window of the server, and hit the ENTER 😅 to load the code and it make it work
lemme write my situation in bullet points, might be easier:
- server running on remote IP address
- dev PC connects with first client, player logs in successfully with a pawn and can walk around (but without animations)
- dev PC disconnects
- dev PC connects with a new fresh client, player logs in successfully but gets a None value returned for his "Get Controlled Pawn" function (error is server side)
- dev PC sees a spectator camera while having a non-spectator player controller
umm.... can’t help without seeing the code. Where did you use the get controlled pawn and how did you use it , etc.
... I mean... the server just doesn't spawn a pawn for a new player?
You have the Default Pawn and Controller assigned in the GameMode settings of the map which you are hosting in the dedicated server ??
the Event BeginPlay etc aren't triggered either on the pawn
yeah, they're set to my own
... I mean... the server just doesn't spawn a pawn for a new player?
@thick jungle but it did when the PC connected it for the first time. You said it.
yeah, but it also does that for single-player for example
that's not technically a "new" player
Are you trying to use “ Get Player Controller” or “ Get player Pawn” etc. nodes with index : 0 , at any place ???
in the Event Begin Play or anywhere ?
of the Level Blueprint or any other Actor BP ?
but that should always return the local player on multiplayer
@thick jungle I also read the same but in reality, it did not. - I don’t know why... on getting the controller of index 0, gives us actually the controller of zero index among all the players...
so you're thinking it's crashing on a bit of my code in the controller or gamemode or gamestate or so, and as a result not spawning the pawn in?
@thick jungle I also read the same but in reality, it did not. - I don’t know why... on getting the controller of index 0, gives us actually the controller of zero index among all the players...
@warped apex so what on earth are we supposed to do instead??
so you're thinking it's crashing on a bit of my code in the controller or gamemode or gamestate or so, and as a result not spawning the pawn in?
@thick jungle may be, but I can’t say surely without looking at the code. Because you said, you set the default pawn in the settings, so it must spawn it regardless of anything. Not in only one case, if you spawn the pawn or change the pawn - something like that with the Blueprint.
it should spawn that class of pawn, WHEN the server says "go ahead and spawn a pawn". I'm thinking my server for some reason doesn't think that that controller needs a pawn or so.. :/
but you've never had anything similar to this happen then? :/ any UE4 server just always spawned a second pawn in on a second connect??
but you've never had anything similar to this happen then? :/ any UE4 server just always spawned a second pawn in on a second connect??
@thick jungle yes. It always spawned for me. No problem at all.
MeshComponent = Cast<UStaticMeshComponent>(GetComponentByClass(UStaticMeshComponent::StaticClass()));
NullCheckRetNone(MeshComponent);
MeshComponent->bIgnoreInstanceForTextureStreaming = true;
MeshComponent->SetIsReplicated(true);
Should that work in the BeginPlay or not?
It is not working in the begin pay and the NullCheck fails in the constructor
any ideas?
If set in the begin play, and change the scale of the object in a Server_DoSomething it doesn't change the scale
I just found out that I was able to
so they are now supposed to replicate, but when I Flop1->SetActorScale3D(CardScale) the scale does not get replicated
Things do not get replicated on themselves. 🙂
You have to make custom events, - RPCs.
On the client, fire a “Replicated on Server” event, from there, fire a “Multicast” event and then set the scale in the blueprint.
Does collision going to replicate all by itself
anyone know how save game object works on dedicated server hosted on AWS? I want to know how I could manage the save files on the server. So there is dedicated pricing and spot pricing. The dedicated is what I want that way I know the save files are on my dedicated server but that is not what I am trying to understand. What I am trying to understand is that if I choose spot pricing that would spin instances up on servers that are not dedicated correct? So this would mean my save folder would not exist on those spot priced server?
Hey, I'm wondering if a server's outgoing RPC buffer saturation is affected by the server's incoming RPC buffer saturation
If clients are sending in large packets, will it mean a higher probability for outgoing unreliable RPCs to drop?
I want clients to, upon successfully shooting a target on their predicted screen, to send a nice buffed packet with a bunch of information, it could be a whole bunch of vectors even... but I'm really concerned about it because the server is already sending a lot of data to the clients and it's hard avoiding saturation as is...
I'm really hoping to get an answer like 'no, it's fine, clients can send large packets to the server and that wont affect outgoing saturation'
well if you want a save game file to persist, you would have to implement something to save them somewhere, maybe to S3
or implement some RESTful service that persists the data some other way
i have them saving to s3 and retrieving them from s3. So what your saying is when the instance spins up. I would then pull the save files for the players on that instance from s3. That would be the best route I guess. So are those saves gone when the instance spins down?
if it's an on-demand instance i would assume that data is gone when the server is gone
i would probably not use save game objects though
ok thank you that is what i was trying to understand
I am using lambda and dynamo db but looking into all options
and the save object lets me use my current system
so I don't know if I will switch over just trying to get to a testing point
for persistent data for a player, i would likely save those in a database and use a web service to retrieve that data when necessary
I am using multiplayer plugin for the login and lamda and dynamodb then using their s3 plugin to test the save files option . what do you mean by web service? a middle man for ue4 and the database?
yes, i would not directly have the AWS SDK on a game server
I see
though for us, we have a public dedicated server so it's not like we'd like to give people our access keys
but even then, it's a nice separation of concerns
it is and I see the issue there
I am in no rush and want to try all options so I will do the Restful way and see if I can write the middle ware
does anybody want to help me with my crappy Among Us 3D? I'm stuck trying to replicate events
I have a topdown game and only want to replicate X and Y movement values. How would I change the character movement class to have the server update only X and Y values every tick? and would this even make a difference in server load?
Hey guys.
Does someone have experience with using Photon for multiplayer voice chat?
Help needed for beginner setup 🙏
@meager spade removed
I am using multiplayer plugin for the login and lamda and dynamodb then using their s3 plugin to test the save files option.
@vale ermine Can you tell me which plugin you are using for lambda and dynamodb?
multiplayer with blueprints
kk
From their tutorial I have learned how to write my own lamda functions and manipulate my dynamodb
its a good plugin, but I can't afford to spend this much on plugin, I m saving money for game launch.
yea our studio got lucky with the loan
Epic making assets free every month, instead it should make useful plugins free.
it would have taken me a few months to expose all that to bp
true.
@rich ridge how's it going? yesterday you recommended I should check VIVOX for unreal multiplayer voice chat.
I did that, but I'm also checking Photon, since I have a guy who knows Photon for Unity. Do you know if Photon works also unreal?
@full ember I have checked photon in past.. it has overwhelming support for unity not unreal.
So I skipped that
As far as I know photon will give you the platform, you will be responsible for modifying that platform for your needs and then host it..
But in case of vivox you don't need to worry about hosting
Vivox is already been integrated into the engine
Just setup the keys and you can start your POC.
isnt it great when 2 plugins use the same libraries. Was fun merging one plugin into the other to avoid duplicate modules. Never done that before.
@rich ridge DM?
Yes
Where can i change UE4's net update frequency?
Hello, I've recently decided to make a multiplayer game, and what I want to do is a ball with physics. I'm wondering how I can replicate the ball physics in a smooth way.
hey everyone I wish to setup a single start button for my multiplayer game
so wish to make a matchmaking
so can anyone help me with this
I am personally waiting for Network Prediction to release before touching physics
@twin juniper lmao ikr
and when will that come? 4.26?
or UE6
Anyway where can i change UE4 net update frequency
i googled but it doesnt show where i can change it
@sharp crest Right now, this is quite really hard to do, and there really isn't a built-in tool for that. The only way in UE4 to have multiplayer physics is to have the host do physics and replicate the results, like the smootsync plugins etc do, but that will work quite badly if players need to be able to touch the ball.
hey can anyone help me to setup a online multiplayer lobby
@twin juniper https://www.youtube.com/watch?v=9qrjmwJBKiY
UE4 / Unreal Engine 4 Multiplayer Playlist:
In this collection of videos, we will cover setting up a project for both local and networked multiplayer projects.
This Video:
In this video, we add the functionality to our lobby widgets to allow players to host and join online se...
I have set up from 2 different buttons
and it is working fine
but need to set up from same button
A bit confused, how do people replicate equipment meshes?
I have a USkeletalMeshComponent for each equipment socket (Like the right hand), and I at the moment set the USkeletalMesh directly from an UObject equipment BP.
I've tried to make the whole thing replicate, while failing at it, but it also seem like people in here don't make the component itself replicate, but rather the skeletal mesh somehow
Oh sht nevermind me, think I found a possible solution further up
hey guys, would someone know how to execute a server consolecommand in the gamemode?
this isnt getting executed properly
PlayerController->ConsoleCommand("...");
yeah that works for players, had to execute console command before in clients
but this is for the server
It's not a player thing
Call it on server and it'll work
Though there are methods dedicated to ServerTravel directly so console commands aren't useful
GetWorld()->ServerTravel is what you want though
ooo okay 🙂
I thought I had to do it through commands cause this is how it worked in blueprints xD
BP do it with commands, yeah
it works 🙂 thanks guys xx
@ruby rock Yeah but isnt it like even that value slider is limited to a number?
GetWorld()->ServerTravelis what you want though
@bitter oriole the server map changes now and spawns in the correct pawn but I cant control the pawn
is it because it doesnt get automatically possessed?
No idea, depends on your game
Is it possible to send huge arrays over network with ue4?
Normally when you try to replicate huge array it will complain that:
Attempted to send bunch exceeding max allowed size. BunchSize=212300, MaximumSize=65536
Can this be overcome by using FastArraySerializer?
so would Amazon API Gateway be good to use as middle ware for my client and server?
Why not use the built in multiplayer
I am at a loss to what I am even doing sigh
I need login and user database for their items that's all I want. But I am realizing there are all these keys I have to keep secure and its not making any sense to me. If the key is being called by the server I do not understand how the client would have access to it. I don't see the point of middleware besides hiding those keys but that is where my understanding ends
You need a central database server with a server software that your dedi servers connect to in order to signal changes to players
Players can connect to the central server, read only
Or they can get their data through the dedis
Only dedis should be able to change data
I would like to get the data through the dedis
You need no middleware here
Just your own server software for the database of course
Non UE
And a HTTP channel between dedis and that server
Using json or something
Probably can use Python or something for the database server
(This stuff is obviously not for a small team)
What options are for a small team. See the only thing I see possible for me right now is to use lambda and dynamodb. Clients would have access to lambda but not dynamodb.
The entire idea is not for small teams
Keeping the database server safe from hackers is a full time job already
Not to mention DDOS prevention
Not to mention the money
But hey I gave you some leads to follow anyway so feel free to try
Stop using that word
You dont know what it means
And you can't "write ddos prevention"
I am going to stop trying to talk about and figure out things I know nothing about thank you
@vale ermine instead of building from scratch you can fork Nakama.
I am open to anything right now
Please check nakam then
thank you
It has UE4 plugin
And good part is it uses grpc not century old http
Distributed server for social and realtime games and apps.
lol another source build wahoo. I am getting close to making my 2t m.2 haha
Digital ocean already has app so hosting is hassle free.
I mean that is all I am asking for is a direction that works
Wait.. if you don't wanna customize it, you can directly use their binary and host it
That is very cool so I would be able to transition to my own servers eventually.
Yes with Nakama you have this flexibility
Well I have one year to do all this so wish me luck but I think you guys helped me get on the right track and I thank you for that
Why one year?
Is Role guaranteed to have been replicated by BeginPlay 100% of the time? Or should I be using PostNetInit ?
I have been doing this check in BeginPlay and never experienced any unsual behaviour
yeah I would expect for it to take quite a lot of players/testing to experience it. But I'm just checking if anyone knows if it is 100%
My assumption is I should be using PostNetInit and not BeginPlay
I guess I can just write a test case
As per my understanding when an actor is created by server , server automatically sets the role.
@rich ridge one year because that is when I am breaking partnership with LLC and starting my own that I have 100% control over. I don't like only having 50%
Like right now because I am 50% I have no control over the project that is being worked. So now you have the other 50% working on their stuff that is a single player and will not go anywhere and I am trying to build my future. I would not say greed but a lack of direction on one of our parts 😛
Hmm
How do you properly handle a virtual RPC? Say I have a Server RPC called AddAmmo() in the parent class, with some AddAmmo_Implementation() in the cpp. If I make a child class, I'm guessing you override AddAmmo_Implementation() then call Super::AddAmmo_Implementation()? Or do you just call Super::AddAmmo()?
Okay cool, that's what I thought. Thanks.
@chrome bay ever used the smooth sync plugin?
I have made this code for joining sessions and it working but with 2 different buttons and I wish to use both buttons together like join a session create one and then join
any help
on this
one
fins session faillure also now working
not
working
So I am trying to form a game plan. From what we talked about here is my conclusion. I use a multiplayer plugin and spoke to the developer. The way lambda and dynamodb is set up, clients only have access to cognito but not dynamodb. Ok from my point of view that is good and what I want. cognito is set up with the correct user groups that have the correct authentication to make lambda a viable solution. The other option is to use an api gateway to communicate from client to gateway to server and reverse and my assumption is that the gateway would be a replacement for lambda.
I must be missing something here and need the web api no matter what route I go.
so lambda would be server-less architecture. I would use HTTP requests via Amazon API Gateway to run the lambda code and return what I need through the gateway
This isn't really UE4 stuff so I don't think most people here are familiar with that
but im trying to get ue4 to work with it crys
Yeah, but you should still try to find people who know what "cognito" or "dynamodb" are
Because I sure don't think many people here do 😛
im learning its fun but i got you 😛
for some reason... my travel error event gets called twice
any idea why?
both times from server
if the map is invalid
Is
Roleguaranteed to have been replicated byBeginPlay100% of the time? Or should I be usingPostNetInit?
@jolly siren
I might be wrong but I'm pretty sure for replicated actors all replicated properties are sent in the initial bunch that creates the actor so I think begin play should be fine
(I might be wrong tho)
howHow do i get player index or controller id for each client so i can set it to an integer variable
@jolly siren a replicated actor will always have the correct role by BeginPlay
After Server Traveling every client from the lobby, how can I wait for all players to connect before beginning match in new level?
In theory, I could store the amount of players in the lobby in the game state, then use OnPostLogin to count every player that has joined the new level. I'm just not sure how that works if a player disconnects their game while traveling, for instance. Then the required player count would be 1 more than it should be
I guess I can check NumTravellingPlayers in ReadyToStart
NumTravellingPlayers is always zero for me 🤔
Is there a way to force two actors to replicate their replicated properties at once, in one packet?
For example, a player and a weapon - having replicated properties of both the player state and the weapon state replicate together is kind of crucial if one should be able to freely manipulate the other
I got a jingle ... You put your user groups in, you take their authorities out, you put the lambda functions in and you invoke them all about, you do the hokey pokey and through the gateway is their route, that's what its all about!
no but I will do my best to answer your question but I don't know about the one packet thing. There is replication graph you can look into.
Oh the replication graph's purpose is different I'm afraid
can any of you help me understand this picture
why is the main viewport showing the 05c (5 of clubs) as the hole card when really that is another client's hole card
this is problematic because if they are using a 2d-scene-capture, they will all see the 5 of clubs
instead of their actual hole cards
well i was running into this the other day. you are pulling this from player controller 0?
there it is using a 2d scene capture where they all are viewing the same card.
no, I am using this by...
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
AThePlayerState& PlayerState = *Iterator->Get()->GetPlayerState<AThePlayerState>();
if(!&PlayerState)
continue;
count++;
FHoleCards HoleCards;
--- code ---
PlayerState.GetTableQueue().Enqueue(HoleCards);
}
so each player state gets their own hole cards
the code above is an object form the game-mode
prior to this game-mode object, I do use
if(!HasAuthority())
return;
Hey guys, does anyone know how can I force all my players in a level to go to another? Let's say there are 4 player in the lobby, and one has the Start game button, when pressed, it only works for that one. Any clues?
@warped field you need ClientTravel/ServerTravel
🤔
if(GetLocalRole() != ROLE_AutonomousProxy)
return;
if(!IsLocallyControlled())
return;
I added though, but the actor is still getting sent to other players and not staying local when I use GetWorld()->SpawnActor
I need it to stay only on the client
@red siren
GetWorld()->ServerTravel
I see a number of example MP systems using either a Default Pawn or using a SpawnActor+Possess to bring characters into game.
When using the Default Pawn method standing up HUD widgets and client side functionality seems pretty bullet proof. Using the SpawnActor+Possess method, this seems to rely upon magic "delays" (assume it waiting for things like replication to finish) - is there a definite event or property for when the client side widgets can be built and used?
OK i got a problem that seems simple in theory but for some reason i cant get over it. If i do this, it works.
this does not
so server shows 0 for the velocity. But if i save it and try to pass it through rpc it still shows 0. What am i missing?
Does anyone here have experience with implementing stun turn into unreal?
PM please if so
as in I still get an empty string when I print them out from the clients
in the game-mode I did
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
AThePlayerState* PlayerState = Iterator->Get()->GetPlayerState<AThePlayerState>();
PlayerState->CardPath = "a card path";
}
and when I print the CardPath out on the player's/client's end, it is still a blank string, any ideas on how to fix this?
for(auto PlayerState : GetGameState<ATheGameState>()->PlayerArray)
{
auto ThePlayerState = Cast<AThePlayerState>(PlayerState);
NullCheck(ThePlayerState, void());
ThePlayerState->CardPath = "a card path";
}
that also failed to modify a data-member of the player state
I forgot about GetLifetimeReplicatedProps
I think that is why I am not getting any changes
it was returning my Steam friends name before but its now only returning my Steam name
anyway fixed like this. someone in forums said playerstate changes i playername auto when steam connected
its a lie or i misunderstood him dont know which one lol 😄
Good time of day. Need match start icon notification on the desktop like in Dota2
hey anyone here who have information and have make online mobile multiplayer game (no dedicated server because of lack of credit card)
please help and I need guidance to do it
Well you can try listen server instead. One phone will be the server.
Of course if that phones goes into a tunnel or loses wifi, then everyone drops from the game
And the phone needs enough uplink for all connected players
And enough CPU to run your game logic for every player
What exactly causes these GUIDs to get sent? is this unique identifiers for each replicated property sent the first time they are replicated? Why are they so huge?
Hi guys so i've been struggling with a custom implementation of the character movement component. Does anybody have any suggestions for what i could possibly do with the saved moves when the client switches pawns ? or is the best way to keep the client as close to the server as possible and then just let the server correct the client side when it switches out.
I'm trying to get player names to replicate correctly.
Everything works fine but with one catch:
a client who joins the lobby at a later time isn't aware of the names of all the other (already joined) clients
Any tips?
Sounds like you are doing a multicast to communicate those names
I am
Use a replicated property
a multicast only fires for the currently connected clients
I am using name in the playerstate, which is a replicated property
But yeah, it is being fed into a multicast
Should I set a variable called "name" which is a replicated property in the HeadText actor blueprint?
You should simply set the player name in he player state, on the server
Mark it as replicated
No other work required
Assuming you are not using the built-in player name
Have the widget read the name from the playerstate, not set in the "SetName" implementation on clients
The reason late joiners can't see the name is that you didn't use replicated variables, as you should have, but a client/multicast RPC, which is not usable for persistent information
server-to-client RPCs should be used for events
The nature of a RPC is that a late joiner won't get it
got you
This is my HeadText actor
so you're saying I jsut change this to the playerstate name right?
Just do this on tick
Using playerstate->playername
Or use a replication event for playerstate->playername to do this
Doing it on beginplay clearly won't work
(no guarantee that the name has even finished replicating before Beginplay)
Just do this on tick
@bitter oriole could an OnRepWork as well ?
my bad just saw that you said that
@stable kindle @bitter oriole any thoughts?
@near bison you'll have to store the player id and their name in an array and replicate that and check against the playerid
what, why????
so that you can actually tell which client is has which name
or is this a replicated name on the player state ?
this is replicated name
as stranger said, I don't need a replicated event
are you doing this on tick ?
yes, just to test right now
but why is tick not working too??
Literally one simple piece of logic
the only thing i can think of is that it's not replicated
you can see player name is replicated
ok im gonna print out the player name on tick now
see? 1 client (the server) has Jack, the other has dorsey
what in the world is wrong
is it something to do with the TextRender component not replicating properly?
Widgets don't and shouldn't replicate
You should check which player state is used on the client
For debugging purposes, you should simply log the name of every player state, to ensure you have the valid information replicated
If you don't, then you just didn't set thevalue on server
I'm checking now, 1 by 1
A good way to do this is logging in player controller if locally controlled
You can they add the network role to the debug string
Like "player ROLE_AUthority, player 1 = jack, Player 2 = Dorsey" ; "player ROLE_AutonomouProxu, player 1 = jack, Player 2 = Dorsey"
When doing multiplayer code you need to invst in debug tools
Looks like that's the problem. Client has the same name for all player states. Server has same name for all player states
You will spend 5x more time than a singleplayer game to do any feature, so you should be sure you can test, diagnose and fix
Wait, but how can player state details be inconsistent? Isn't the playerstate networked
In this case, how are 2 different clients seeing 2 different GameStates (with names in playerstate being set differently)?
Right now, I'm looping through the player array in gamestate, and printing the values of the names in each playerstate (on every client)
Each client is seeing something different
Is the value replicated ?
@bitter oriole Yes
Then this only makes sense if the client has set his own value to PlayerState locally
Which obviously you shouldn't do
short question, is the advanced session plugin good to make test via friendsplay over the internet or should i directly dive into EOS?, i come slowly into the phase where i should start test with steam etc
I'm setting it with an RPC on server
^ this is in my playerstate event graph
Now all clients are seeing Jack, lol
@near bison Why would game instance be involved in multiplayer ??
does it matter? I'm getting my local game instance variable and then using it to set a replicated value
it's a one time thing
Yes it does matter
GI is not replicated
So this can't work on server
it will always get the server's name
On the client it will lwyas get the client's name
What you should do here, is call a Server method with the GameInstance name as a parameter, and then set the PlayerName field in the PlayerState, on the server, using this value directly
You really need to write on paper where every object resides, and where the network comms happen
Same problem
You really need to write on paper where every object resides, and where the network comms happen
@bitter oriole you've gotta believe me, in that I know...
Does SetPlayerName take the actual name as a parameter ?
every other piece of entworking is working for my game. This is just oddly tricky because a client can join at any point, and I don't know where else to get my name form
GameInstance is not replicated so it won't be usable as a parameter over the network
quick question
when I get the game instance (or anything for that matter) and cast it, and send it as a parameter, isn't it creating a copy?
Not at all
so shouldn't my custom event have had the local copy of that player's game instance
Nope
There is no "better off"
@bitter oriole i meant storing the reference
UObjects (every actor or component or generally spaking, anything in Blueprint) are non copiable, they cannot be copied, even in C++
I mean doesn't that depend if I'm passing by value or reference? (which by the way idk what BPs are doing)
No, it does not
UObjects can simply not be copied
Instead, in multiplayer, they are passed as some kind of identifier
The object needs to live on both machines for that to work
aka, be replicated
If the object you are passing is not replicated, you end with a null pointer
GameInstance is not replicated - every player has one, the different versions are fully independent, not networked at all, they just exist
So you can't use it to pass as a parameter
Got you.
can also have a network stable name right ? tried it but i think you can basically set them up to be the same name
Which brings me to the paper again : there are diagrams of which class exist on which machines, and whether they ar replicated, for the whole gameplay framework
You can just print it out and draw your own stuff on it to make sure you got it right
From Cedric's compendium
GameInstance would fit with widgets here
Well, except it's also on the server
hey @bitter oriole if you have a sec i had posted a query was wondering if you had any suggestions
eh?
Flipped the 1 and 2, but you get the idea
ah
And I dont know about network stable names @stable kindle 😉
Just to let you know, I've read the compendium. And I actually have a lot of other networked components in my game that works fine
The reason I struggled with this? I was looking at the wrong place. I always assumed the name was being set correctly (in player state), so I thought something is worng with my widget setting
I never bothered to check if my game instance is yielding the right name
haha
Which it is
Yes, it is
What you didn't do right is using the GameInstance as a network object
UObjects can simply not be copied
@bitter oriole But then you said this 😛
Yes, that was a complete oversight
I'm usually careful about this stuff, everywhere else, where I have to extract something locally and send it to the network, I'm doing it fine
Yeah I'm sure, just voicing some advice
I did a lot of multiplayer before and I still need a lot of time to debug issues
you know what would be really, REALLy useful?
if someone builds a tool that can be opened which shows you everything that's networked
but for starters, at least show all playerstates and gamestates visually
You should be able to view these visually in the level editor window
They are actors, so they should be in the scene outliner
You can select them and see the state, for the server at least
I'll look into it
When I set visibility to true (previously set to false) on a character mesh in a multicast RPC, the simulated Proxies won't set it to true correctly (the character mesh is still not visible). Only if that Character Mesh is moving, the character is visible. I tried using Net Force Update after setting visibility, but it didn't worked out for me.
Can anyone help?
In most cases, the visibility changes come as an effect of changing some other state that you already replicate
I can't think of a scenario where i would directly RPC visibility changes
Let alone use a multicast to do it
My case is, I want to hide the player only for the other clients, not for the client controlled character
and what is the condition?
I use a multicast and check if the role is SimulatedProxy
When I apply an Gameplay Effect that hides the character
on it self
so my controlled character uses an ability that hides himself
but only for the other clients
if (!IsLocallyController()) { Hide(); }
I don't let the server hide the character, because the weapon that the character is carrying is replicated and will be unvisible for the LocallyControlled Player.
if (LocalRole == Role::SimulatedProxy) { Hide(); }
Here are my actual nodes:
the gameplay effect is a state
so clients gtet that state replicated
which means
that can trigger the visibility change
there is no need to replicate that separately
So what should I do? Because in my opinion it need to be replicated separately, since the effect is different for Simulated Proxies then for the autonomous Proxy.
al clients are aware of gameplay effects on all clients, correct?
yes
so its already replicated
and as a state, consistent
there is no need to send the same information over network again
and also
i find generally replicating the visibility.... inelegant
My problem is not the replicated Gameplay Effect, it's that Simulated Proxies doesn't get visible when Setting visibility to true, only when their character is moving.
hook into replication callback of the effect being applied
set the visibility locally on each machine
okay, I try
but wait, I'm using GAS and Gameplay Abilities won't get replicated. Only the Locally controlled client and Server has a copy of that Ability, so the autonomous proxies won't call the Set visibility function
I try it, to be sure just in case
Okay, I'm off for now, so don't bother Zlo for now. Thx for the Help, I appreciate it Zlo 😃
How do i replicate (play sound at location)
Hello ! Someone who already setup a dedicated server with Steam could help me ? My dedicated and client are connected to Steam successfully but I can't see the session and the server is tagged as "LAN" on Steam server list even if I unchecked "LAN" on the session.
need help replicating sound!!!
if a server is in the LAN tab, it'll be there because it's on your local network
enabling the LAN checkbox basically just means LAN only, at least on steam
if it's not available from an internet query, it might because you haven't setup port forwarding
I'm having an issue with replication on a local server vs a remote one. When I run a multi-client session with a local server (via the editor), both my clients see the effect of interest replicated. When I launch my cloud server and connect via client, however, the effect doesn't replicate.
the Regenerate_Event is called in EventTick
@foggy wave sound is an asset you can't replicate it..
You have to program the sound ...
so im using als
how do i make multiplayer
@foggy wave For example footsteps sound is embedded in animation..
To have better syncing of sound with animation..
And save network bandwidth.
And on every client server plays the animation, and when animation plays it plays the sound
@mellow umbra what is als???
advanced locomotion system @rich ridge
What is stopping you to make multiplayer game?
@lost inlet Oh okay. Thanks !
@rich ridge the camera has errors
and wont work for other clients
only the server
Are you using listen server?
Are your trying to control camera from server?
Exactly what is happening with your camera can you explain?
il get a gif
this is what is supposed to happen
the clients
and as the server i can see them move
many errors
Something fishy happening and logs might help you
Your NewPawn is null.
so how would i fix it
This is the culprit
Once you know why this is happening , then fix is really simple...
There could be many reasons for this to haooen
but i dont know why
or how do i figure out why
because als is made by another person
Put breakpoints and navigate around
How would I get a client to possess an actor? When I bring up the possess node it says "Only runs on Network Authority"
Even I m not super expert in multiplayer..
@quartz smelt do in GameMode
GameMode is supreme authority
but i dont know what to look for
So create the function for possessing in GameMode? Do I need to replicate it?
Nope engine has handling logic.
@mellow umbra I guesss this is not your product or game?
Ohk understood now.
But this movement system is not required for multiplayer game..
If you want assets you can copy them in new project and start to work on it
@rich ridge Am I doing something wrong? My client can't cast to the gamemode, but the host can
Casting is not dependent on client or server.
Dang, that's hella weird. I don't know why it isn't working then
@rich ridge what should i look for
Pause execution using Breakpoints to inspect graphs and the values of variables.
Find out exactly what is wrong
@quartz smelt gamemode doesnt exist on client
put stuff that needs to be replicated on the gamestate
Oh, the other guy said it didn't matter. So should I put the possess blueprint in a function inside of Gamestate?
well you shouldnt be possessing on client
you only need to possess on the server
i was just answering why you cant use gamemode on client
Oh gotcha, thank you
I should be able to test client rest api calls without creating a session correct? Use the login token to authorize the lambda function to return a value from users db. The only thing I would need to create a session for would be if I want to change a value on the users db? So client uses an item. client useitem sends rest command to gateway. gateway triggers Lambda function to return if user has item. If user has item true, invoke lambda function on server to remove item from user db and apply effects of item if needed?
can anyone help pls
Does OSC have an huge impact on latency?
Can you access the PlayerState of an AI controlled character in a client? I know you can't access the AIController in clients and I guess it's the same for the PlayerState of the AI since it's owned by the controller I guess
PlayerState is replicated to all clients. If you set things up correctly to have AIController request a player state it should be accessible.
You won't be able to access it through the AIController from clients, but you should be able to get to it via the playerstate array in GameState and Pawn->PlayerState
How to handle overloading server functions?
this
is giving me this
UFUNCTION(Server, Reliable)
void ServerPushBack(FVector PushDirection);
inline void ServerPushBack_Implementation(FVector PushDirection) { ServerPushBack(PushDirection, PushBackDuration); }
UFUNCTION(Server, Reliable)
void ServerPushBack(FVector PushDirection, float Duration);
void ServerPushBack_Implementation(FVector PushDirection, float Duration);
virtual Implementation function
pretty sure UE4 doesn't allow function overloading for UFUNCTIONs
that's why it's giving you the error
well it does, for the Implementation function
especially if you explicitly define it
not sure if the default generated does that or not
or even if it didn't, you could just make it call something virtual
or use delegates
well there are workarounds ofc but I'm saying there is no way to have multiple ufunctions with the same name (overloading)
how would I approach it then, what should I mark as virtual?
or maybe there just exists a simpler way to have member variables as default parameters
Might also be worth considering just defaulting the Duration to -1.0f and building logic around whether there is a duration specified or not inside of the single function.
Yeah that ^^ or
just have for example a normal function PushBack_Local() which is overloaded and have 2 different ServerPushBack functions (ServerPushBack and ServerPushBack_Duration) and have both of those functions call the local implementation which is overloaded if you really wanna go the overload approach
Should you use GameMode's ChangeName or PlayerState's SetPlayerName to have individual names for players ?
@plucky sigil Either depending on how you want to do it. GameMode's ChangeName literally just gets the playerstate of the first argument that is a playercontroller and calls it's SetPlayerName.
Do you know where i should call the SetPlayerName ? Should it be a RPC ?
I want to have the players enter a login or something of that sort, and have them specify their desired Player name
Where should i call the SetPlayerName function
I made this 2 functions
UFUNCTION(Server, Reliable)
void ServerAttack();
void ServerAttack_Implementation();
UFUNCTION(NetMulticast, Reliable)
void MulticastRotateToControllerYaw();
void MulticastRotateToControllerYaw_Implementation();
that are called like this:
void ABaseCharacter::ServerAttack_Implementation()
{
MulticastRotateToControllerYaw();
}
but when I attack on my client he sometimes rotates and sometimes just does nothing. On the server the client always rotates
Hey, do you have any experience with switching between online subsystems, e.g. to use Steam hosting beside Gamelift dedicated servers?
So far I can do it, to switch from Steam to NULL to use Gamelift, sessions run fine, but cannot solve Steam re-initialization properly, thus Steam hosting does not work after Gamelift sessions. Any idea?
also when the server attacks it always rotates but sometimes it does it in a different direction(but to the same place eg, 300 degrees to the left on the client, 60 degrees to the right on the server)
Guessing the actor shown here is not owned by that peer player?
it is an object that can be harvested that I would like to destroy.
You cannot call Server method on actors that are not owned by the local player
ok! so how can I do`?
Probably need to call that method on the server by going through another object - like a ServerHarvestStuff function on your Pawn
hmm ok so I have to delete my object from my peer player
not from the object himself
thanks i will try that
hey guys, is there a way to tell the client, hey a new player joined and loaded into your game fully
i know postlogin for the gamemode but i need it in the cliient
any c++ @royal rampart ?
you want a snippet?
i mean, its not a blueprint only thing?
nono i'm doing everything in C++
override AGameState::Add/RemovePlayer
im trying to add nametags to all the players that joined with the correct names