#multiplayer
1 messages · Page 583 of 1
Correct me if I'm wrong, but you're still calling InvitePlayerToParty on a clicked player
You need to call that on yourself. The player who is doing the clicking
Ya that call will fail as is lol
oh, wait yea you are right
@fallow shadow protip, do everything you can in one place so the system isn't all spread out.
will do!
I would put everything possible in Gamestate, including the data (array of party Structs l
okay so i changed it and now the server event is called on the player who does the clicking
even the invite player logic?
It looks like this now
The new widget
Send Player to Target lol
Yes, then you can have the widget just call RequestInvitePlayer on the Gamestate, passing in which player you want to invite and who's doing the inviting, and it'll go from there
Ok nvmd self is your player correct
like this?
I'm not 100% sure if you can directly call that from a widget, but try it.
Shouldn't be necessary.
Try a direct call ending in a print just to see if it makes it.
Printing the names of the players or characters or whatever you're passing.
You're just ensuring that no replication calls happen directly from the widget because the widget isn't replicated. You are only making replication calls on replicated things
Can you get the game state from the widget?
Need to clarify again that actor rotation is not replicated when character movment component is disabled?
This is how i did it
Does logic after remove from parent even run?
I haven't done a whole ton of widgets so I'm not sure what their lifecycle looks like
Yea for sanity's sake I'd do it before you remove it
My first thought was a local call on Gamestate that then calls the server side.
yea it does run even after widget is removed
But I'm not sure if widgets can directly reach into Gamestate, test it.
so now it does work(Not through the game state but through the server event you guys told me a few minutes ago)
looking at my code the other day i relized that because I was removing the widget and setting code in that same widget after I removed it.
@dark edge yes they can, I get game state cast it to my game state and call the server rpc from there
i don't think widgets can get to game state
No matter what i try i can't get a message to show
from the widget to the game state
So what's at the end of the call in game state right now.
Also it'll only be running on server so you need to have a way to see the servers print log
you expose a variable for it on widget spawn? and pass it to the widget so that you can access it?
So what's at the end of the call in game state right now.
@dark edge What do you mean? Show you how i call the event?
on the game state
Yeah sure was at the end of that call. Where you say the call isn't working, how do you know it's not working.
It should print out on the server, but if you don't have a client because it's dedicated, then I'm unsure. I haven't dealt with dedis yet
the print is not showing but again as you said you need to see the server's print log
what if i have removed the dedicated just to test?
If you do a listen server then yea its easy to see on the server side client
Or just have to do something, you can even just have it close the game. Just some way to check if the calls making through
All right, turn it from a server side event to just a regular vent, and see if it prints. If it does, then the widget can reach the game state but it can't call a server side event from there.
Then you would just have to go from widget, to client side event, to server side event. The widget and the player are not the owner of the game stage so they might not be able to directly call server side events
All right, turn it from a server side event to just a regular vent, and see if it prints. If it does, then the widget can reach the game state but it can't call a server side event from there.
@dark edge Nothing was printed
but wait i didn't see that last sentence
wait
what i quote above worked
when i removed the server side on the node, the game closed
Yes the widget can talk to the client-side version of the game state. So then just from there, have it call a run-on server event passing the same info along.
well, that's what i did but it didn't work. Hold on let me screenshot it
He's saying to call a function that is local in game state and then in the local game state function then do your server RPC to test it
Just need the widget to Gamestate call and the Gamestate to Gamestate call.
I'm about to be at my computer so I'll take a look, sec
yea that is what I thought. Looks like you are getting the game state of the client not the server. When the character is created seems like you will need to have the server set a game state variable that the server has ready to pass to players.
Wait wait... i'm an idiot.. Gamestate is replicated but it's still server owned
I said before you need to call server RPCs from owned actors like your locally controlled player
You can't do a server RPC from Gamestate on a client
wait so what does that mean?
It means you should only be calling your RPC function from the player or player controller like I said earlier
Not from a widget, not from a gamestate
Yes
sweet
okay but now you got me thinking where it would be the best place to store the party's info
I store everything in the player controller.
The players who make the party
Is it a known issue that animation notifies do not get called on the listen server when the animation is inside of a linked animation graph?
If i want to reduce the health, i should do it in a multicast node because every client needs to be notified of this change correct?
@fallow shadow you could make the health variable replicated and when the server changes this variable it automatically replicates it to the clients
yes
Any reason why you're not using TakeDamage?
@dark edge how
Any reason why you're not using TakeDamage?
You are correct, i didn't think of it actually
That function safe guards doing anything unless you are the authority which is nice. You just have to check to make sure that Super::TakeDamage != 0.
@fallow shadow I prefer doing stuff through the controller rather than character but either way can work.
Yea i was told it's better, but why is it?
Depends on how you implement your game, but if characters are transient, it can throw some stuff off.
if your character gets respawned when it dies etc, if you can change character etc
Is your character in the party or is the player in the party?
Is your character in the party or is the player in the party?
@dark edge It should be the player, the whole blueprint
I tend to prefer to use the PlayerController as the "Player" instead of the character. The character is who the "Player" is driving around, but is not the player.
It all depends on your game, but to use League of Legends as an example, is Nasus in the party or is xXx_420noscope69_xXx in the party? I'd say its the latter.
oh, you are completely correct. Should i move everything into a controller?
It really depends on your implementation. Either way, both the PlayerController and it's owned Pawn can bridge the client-server gap, so you put it either place. I prefer PlayerController for everything not Pawn specific.
Alright, for the time being then i will keep everything as is. Now time to accept the invitation and spawn the proper widgets....
If you haven't done it yet, I'd start with your data structure representing parties then go out from there, getting the joining/leaving working then the UI to trigger the joining/leaving.
sry for the late response
waht do you mean data structure?
i would just put the players in an array and then spawn widgets for every single one of them
Where is the best place to create the party? The game state? Because i haven't yet understood how to use it properly
Every time I think I have it working, it stops working when I put it into the store.
Oh wait that time it's because my wifi was down. Whew!
Thought I had reached that dead end AGAIN
@fallow shadow btw i am curious what type of game are you making?
ahh okay
I want to learn how to replicate in a good level. Anyone has any sources?
what is the ideal way of dealing with projectile-based weapons and client-side prediction?
when the client press the shoot button, should it wait for the server to spawn the projectile and then replicate? This will make it seem laggy
should the client locally spawn a projectile and then, when the real server-projectile replicates, hide or destroy the local projectile?
how would I get the camera manager for a player in their character blueprint for client.
I understand that camera manager is from the player controller. How would I get the correct player controller?
Currently I am using get player camera manager and its input is an index. By using index 0 all clients are getting whatever player was assigned to index 0's camera manager
I need to avoid this
yea, i didn't even know that thing existed. I don't think i can be of help.....
That is the thing I don't know much about it either other than I used it for single player testing and it works fine. Tested it in multiplayer and realized that they are getting the controller from the server at the wrong index for every player.
From what I understand is that I would need to use the game state and get all controllers and give them numbers?
I have to be able to tell what controler on the server goes to each client that way the client uses the correct index or find another way to get the camera manager from the player controller to the client.
What are you trying to achieve?
This but for multiplayer each client needs to get its own camera manager that simple.
This gets the correct world rotation in single player and gets the wrong index for the wrong player on multiplayer.
why not get the camera component instead?
is the object you get with GetWorld() replicated to clients?
yes it is replicated to clients
It is a component on each player character and they need access to their camera manager on their controller. The whole issue is I do not know whos index is whos on the server.
@livid holly if the local client requirements to shot are met you should definitely create local projectile and then destroy it if the server one arrives. You should also instantly spawn FX and play sounds
Yea i can't help you with that , i am afraid...
ok I guess I am getting somewhere
so it must be working as intended because the index of 0 is working per client. So this must mean all clients are using their correct camera manager.
I think there is still an issue with replicating projectiles and their movements. If you spawn a ton of projectiles into the air with long enough lifetimes you end up bogging things down until you are no longer able to see them replicating on the client. I still haven’t quite figured this one out.
There has always been an issue with machine gun mechanics and multiplayer. Mostly needs some type of voodoo.
You will need to fake some of it.
If the projectiles are launched at a constant velocity you might be able to not replicate them and just shoot them on the client and server separately and get pretty close? I’m no expert on the matter and could use direction myself.
@empty axle thanks. But wont that mak it "jittery"?
like if the round trip latency is 0.5s, the projectile flies 10m on the client, and then a new one appears in the client at position 0 after the latency time. It will appear jittery right?
@steel vault i didn't even consider that, it's true. I was thinking just one-bullet projectile, but your example is another thing to consider 😦
I’m in the same situation as you basically. But yes, there is definitely jitter with most approaches. The projectile movement component gets rid of jitter by lagging the mesh behind and allowing it to lerp, but this doesnt resolve the issue of having a ton of projectiles in the air all at once.
really? If you shoot on the client and the projectile has a projectile move comp it doesn't jitter? I didnt know that
Im not at my computer but if you google projectile movement component smoothing you can set it up to smooth yes
awesome! Thanks
Ok got rotation working correctly in multi player. The animation seemed off so I thought it was because it was getting the wrong information somewhere like a wrong player index. Come to find out it was just a little bug in the code because of the tick difference between a the server pawn and the client pawns. The server pawn rotated fine every time, Clients rotated fine every time it was just that when a client stopped moving the tick does not seem as fast as it is for the pawn that is hosting. I set it to just use the last known correct rotation and now clients do not snap to wrong rotation when they stop moving on multiplayer.
you typically want to replicate DesiredRotation and let clients interp themselves
Line traces are rotating correctly per client also. The only issue now is that my attack button on my umg is not replicating my attack animation when each client attacks
if you saw my use case you would think differently rotation of flipbooks in a 3D environment use world rotation not character rotation to show the correct facing per client viewing the flipbook
First Look at Paper3D working in a multi player environment.
so the issue I am running into is that when I host on my computer the tick rate is unreliable for the clients. When ran in a packaged environment the bug is gone under normal gameplay stress.
Anyone tried to make teams have different player blueprints?
Like team A is a TPP player and team B is FPP
Doesn't seem that hard. Just specify a team in the player controller, and override the character spawn in the game mode based on that controller's value.
Hey everyone! Is it possible for multiple controllers to possess a pawn (ie like a vehicle with multiple passengers). Or would only the driver possess the vehicle and the others are simply attached?
So I am trying to understand this, if you look at the video above you can see idle and walking being replicated just fine. Why would the attack button not replicate? Idle and run are set automatically in the component. Attack sets a value in the component. I see that the value is getting set correctly on the client because it starts the attack animation. But on other clients there is not change the character is sitting there idle when it should be showing attacking.
From what I understand is I am just changing the client side component?
I see so this is how I do it? I call attack on server and server calls attack and replicates it to clients?
@vale ermine yes youll need to run that on the server and then multicast it
That way the value the custom event attack sets will set the component on the server
Well I guess I can write it that way and it will still work on single player.
anyone know how Fortnite to design projectile actor. use gameplayability's cue?
@civic vapor Look Into EasyBallistics
spawn actor on server. then replicate to client?
yes basically
@kindred widget thanks for the pointer
I'm trying to get a server IP or ID that players can enter and join, I can't find anything related on the internet, can someone help or redirect me?
@echo snow Like, Dedicated Server?
hi, the action destroyactor have to be multicasted ?
@dusky urchin you are suppose to destroy replicated actors on the server only
I’m in the same situation as you basically. But yes, there is definitely jitter with most approaches. The projectile movement component gets rid of jitter by lagging the mesh behind and allowing it to lerp, but this doesnt resolve the issue of having a ton of projectiles in the air all at once.
@steel vault Yeah, the approach to solve that would be not replicating the movement. Replicate initial position and velocity and let the clients handle the movement on their own. That may produce minor desync of projectiles, but it's smooth and i guess the only way to have massiv amounts of projectiles.
Once you get to a certain amount of projectiles it becomes neccessary to just have players create them locally
Or at least make them net temporary, so they only replicate the initial frame then are immediately torn off
"Bullets" in the traditional sense are so short-lived and so small using a complete actor for them is overkill
I have been going at this for hours. Implemented Gameplay Abilty system and now for the life of me I can't control my player class
Is there a way to get a local server be more laggy? need to get a latency of more than 50ms to reproduce a bug
go into advanced settings and look at "network emulation options" or something it's called
NetEmulation.PktLag seems to work, thanks
Are anim notifies still not always called on servers?
What kind of server? Dedicated doesn't usually do animations, I'd assume that includes their notifies.
Dedicated, some handle resetting states server side and there is an option for calling notify on dedicated as well, just seems like it's still very unreliable
Timers is prob the way to go
What's the use for?
It's a project where they seem to have a bug with the client not getting the bool resetted back to true for bCanMove since it's handled from a notify server sided, either that or some other logic error in their code
So something like... UseAbility, which plays an animation and sets the character unable to move while it's playing and then sets it to movable again when the ability anim is done?
Yeah
I'm thinking of just moving the notify client side and call the server reset state afterwards from client
I suppose it depends on how important it is. But a timer on the server definitely would end up being a bit more secure and a LOT cheaper than allowing animations on the server.
@thin stratus No not dedicated servers. Players will be hosting it
Are anim notifies still not always called on servers?
@soft relic we rely heavily on it and it works just fine, we didnt had an instance were the dedicated server would not get a anim notify
but thinking of it they are probably all branching points, we use, as we use the montage notifies, because we handle much stuff in our abilities rather than the animbp, stuff we handle in the animbp is pretty much all client side
Okay thanks, I've heard many devs talking about how sometimes notifies don't get called properly from server but I guess that's for the queued notifies which are not synchronous
@echo snow The whole "Enter ID" stuff is not so usual in most games. IP can be entered and used via "open <ipaddress>" console command, but the host has to have ports open.
The other thing most people do is use Steam and their Sessions. These are usually displayed in a Server List.
What you could do is add some custom settings to your Session Info, like an ID (not sure how you'd make sure that the ID is unique though, might need additional backend),
and then have players enter the ID and you can then internally use the ID for query settings on the Find Sessions attempt and automatically join if one is found.
@thin stratus Quick way to make sure the ID would be unique would be to go through all available sessions and compare IDs, might be a bit slow though.
Yeah doesn't sound like a nice idea
Pretty sure one can find articles about that
Basically what Phasmophobia does or so
Yeah, will definitely need some more backend stuff if you need something better
I suppose it depends on how important it is. But a timer on the server definitely would end up being a bit more secure and a LOT cheaper than allowing animations on the server.
@kindred widget the problem is if you use root motion you have to use the anims on the server anyway. Otherwise the characters would not move. I guess you could extract the root motion to a curve and drive the character movement with the curve. If you need to save on performance. Also would be interessted to investigate what the server is stripping away on default to save on performance, if anything. But i was under the impression it does strip away purely cosmetic stuff automatically.
@chrome bay my projectiles are quite advanced and do a lot of things so they need to be actors. I have yet to test, but if I were to replicate the actor on server side spawn and then tear it off, will the client keep its own version still or will the projectile die as soon as it is torn off and I will need to spawn a replacement? In that case I feel like I should just create a client side projectile and deal with minor desync...
@wind garden for one it strips anim notifies, montage notifies still work though
even listen server by default will optimize out all anim notifies that are nowhere near the host's camera
we found that our the hard way
@steel vault I don’t know if it’s the best things but in my game how I do it it’s to not set the projectile actor as replicated and multicast an event to spawn the projectiles so it feels more responsive
multicast doesn't really make things more responsive
only way to do that is prediction
@inner cove if you do multicast your projectile, so how do they cause damage to hitting actors.
Again RPC?
When the server’s projectile hit something it causes the TakeDamage
The server projectile is going to do all of the simulation itself and deal damage on the server which should then be replicated down to clients regardless of RPC call.
But yea if you have a replicated property that tells all clients to spawn a projectile you could then have a server projectile and a client projectile. The issue would still be desynch in that case, but I wonder how often that would even be an issue.
You are doing both, but the client side hit shouldn't do anything permanent besides destroy itself etc.
The damage is still only done on the server
So if your client projectile hits a wall and dies, so be it, it looks normal, but the server projectile if it's off even the slightest, might continue on and not die
So now you have a projectile that doesn't do what you think it should be doing on the client.
Or rather, it's not doing what the server says it should be doing because they aren't in complete sync
Exactly @steel vault
If you don't simulate projectile on server this kind of things happen
https://www.youtube.com/watch?v=2degQm1dZP0
And these are easy hacks
You don’t get the point @rich ridge
That's just a lack of a validation check I believe. Doing hit detection on the client would allow for that hack because he can just teleport the character in front of himself and shoot it. There should be validation checks on the server to see if they are even in line of sight or match a minimum distance. Either way if the server is doing the hit checks I don't believe this hack would be possible.
This is most likely an early version of the game where they allowed the client to influence the hit detection and send that up to the server saying it was a valid hit
Right
But anyway, I suppose I can try the "fake projectile" approach and just spawn one on the server and then an unreplicated one on all clients. Maybe when I shoot it I'll just replicate a speed and direction so that all clients can fire their fake ones in the same general direction. Will have to test how accurate it looks.
@rich ridge in my approach even if the client cheats and makes his projectile move elsewhere or change the speed or whatever, the server still has its own projectile which is the one that’s gonna cause damage
how would i make a certain player controller get destroyed or go invisible after another player clicks on them?
Is OnNetCleanup() called on the server, or the client?
or both?
(
class UNetConnection * Connection
) ```
Hey guys do you know how i can create a widgets for all clients including the server in the Gamemode or something else in blueprint
Multicast in the GameState
Or, if it's something peeps should see even if they join late, some RepNotify variable in the GameState
@rustic spruce where have u stuck?
Or, if it's something peeps should see even if they join late, some RepNotify variable in the GameState
@thin stratus can you explain this a bit more?
Well a late joiner won't get that RPC :P
Yes right, but what variable should be RepNotify ? can you give an example?
Not really, depends on your game. Maybe some Enum with a State. Idk what kind of Widget this is about anyway
well the thing is
i want to create the widget in the Game mode
and that server-based
so i'm struggling
^
i've heard i can do it in Game State
but idrk how
btw Pan thx for the PDF yesterday
that rlly helped me
@rustic spruce the pdf I sent you is written by @thin stratus you should thank him instead 🙂
oh
i've heard i can do it in Game State
GameState is not GameMode
oh thanks you so much :D
yes ik
and the problem is i have 2 character in the game one for the enemy one for the human so i that's why i wanna create a function to create a widget for both of them
so what is this widget you want to create?
a widget where you can execute actions , the actions are already replicated i'm just struggling with the widget creation
@rustic spruce that's something very simple you can do, haven't tried it but i guess it works.
where should i put this custom event
at GameState as eXi suggested
oh so that so simple i was researching things too complicated thanks you 🤩
srry for my grammar i'm french
how can i pass information from the player to the game mode?
@frigid gyro the player is a client?
yea, i want to create the player and character in game mode, right? So how do i click play/login, and have the game mode know its a specific player.
its more of a theory question, as i havnt actually done anything.
Sorry, I didn't understand anything xD
Say, i start the game on the login map, that creates a widget for the player, and asks him what his name is. before it creates or loads a 'custom' player character and changes to the playable level. how do i use the game mode to verify or choose the right character?
You just spawn a actor with the class the player select it and possess it.
For the selection screen i use a invisible pawn with first person camera and no inputs. That way you can have a 3D scene on your selection.
is this multiplayer?
Yes
We have a character select sublevel on the server, since the server can only run one map at a time. We do this mainly because characters are saved on the server. But you can also have a client side map with the select and store the selected class in the game instance and rpc it to the server on after join.
@inner cove where should i execute the server event from?
because i got the same issue
I guess your problem is you just let the default pawn spawn? Start with overriding the game mode functions to take control over the Initial pawn spawn.
ok no founded a solution
Ive got a character to spawn onto any number of players that join, but i wanted to set the name of a character say before its spawned
or retrieve its data and load it onto the character
Do you know guys what actors are client-based?
and can send a message to the server
character are
but like to make a random character selector
i need something else
i feel were asking the same things @rustic spruce
oh
All client owned actor can. For example the player controller is a save place to call RPCs from the client.
So the 'PlayerID' variable is on the server?
@frigid gyro the thing is, you need a pawn for the player to possess. You can make a invisible pawn and even show a loading screen while the player possess it. Then you have all the time i the World to set up the actual character and spawn it. And make the player possess it.
well because you custom event execute on the server yes and if you execute it on the GameMode it's on the server too
ok
well i've made this
so soon as some one runs the game they need an actor?
@frigid gyro you search a random character selector?
rather a player controller i guess
when someone selects a character in your game, does the game mode spawn the character into the level?
Also a pawn. I think its not a valid situation to have a player on the server without controlling a pawn. If i dont spawn one. It gives it a spectator pawn automatically. So better have one to have full control. Also you may want to show some scene on the character select. You need a camera as viewtarget for that. Easiest way just make a pawn with a camera.
Yes, i have a function on game mode i can call to spawn a character and possess it.
how does the event of selecting a character tell the game mode to spawn and posses, an interface?
The basic workflow is i Show a widget on the client. The server replicates available character names to the client so it can populate the widget. The client sends the Index of the selected character name to the server via rpc on Player controller. The player controller on the server calls my function on gamemode to spawn and possess the character. The function takes the characters class and player controller reference as input. So it can spawn the class and make the player controller possess it.
You have to implement that.
yes
I mean you have to implement the function on game mode. It does not magically do it. But the required functions are part of the game mode. For example the possess function or node in BP.
" The client sends the Index of the selected character name to the server via rpc on Player controller. The player controller on the server calls my function on gamemode to spawn and possess the character." im confused about this part
can this be an interface, how is the function called in game mode?
Its just a function i made.
Nothing special, no interface.
The index the client sends is the index of the array element of the array with available characters. Its not a good idea to send the class the player selected directly to the server. As this could be abused by hackers to select any character class existing in the game. Even if it should not be available to players.
where is this variable, and how is it attached to the player controller?
I made it.
You need to implement all that yourself. There is no build in character select in UE.
Can anyone point me to a tutorial/briefy explain this:
How do games like fortnite, pubg, fall guys, create a player party on their main menu without loading a level? Do you just force create a session as soon as the game starts or can you create it when you invite someone?
its a custom player controller?
of course it is @frigid gyro , if you want to implement your own logic you don't stick with the defaults
im really just trying to figure out whats not done and what i have to do i guess. like how does the game mode know what the player controller is doing. i guess theres no function for that?
what the player controller is doing
what do you mean?
btw this https://www.youtube.com/playlist?list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ tutorial series is made from UnrealEngine and they show how to make a multiplayer game with Character Selection @frigid gyro
Oh thats convient ;]
thx, @inner cove
and thx @wind garden
no problem @frigid gyro 👌
@rustic spruce maybe this will be useful to you too since you were asking something similar
ok :)
ugh, I'm so rusty on multi.
Is running a pawn input component action / axis to a server_ func impossible?
Do I need to declare that in PC first, then send it to the pawn?
i.E. PlayerInputComponent->BindAxis("MoveRight", this, &ADMPawn::Server_MoveRight);
hey guys quick question : how can i store the player XP and Lvl without editable file? and save it
@alert info This is a legacy article imported from the old wiki. An updated version can be found here: [Not Created Yet] @endalert Overview A macro that adds the current net mode and color to loggi...
Anyone had any success getting this working?
@glad sedge The custom colors only work for -log windows, not inside the editor.
That's fine, I can't even get it to compile though
Well describing your issue helps... Posting your code and the compiler error helps...
So, I can trace it back to this having a hissey
(GetWorld() == nullptr)) ? TEXT("") \
: (GEngine->GetNetMode(GetWorld()) == NM_Client) ? TEXT("[Client] ") \
: (GEngine->GetNetMode(GetWorld()) == NM_ListenServer) ? TEXT("[ListenServer] ") \
: (GEngine->GetNetMode(GetWorld()) == NM_DedicatedServer) ? TEXT("[DedicatedServer] ") \
: TEXT("[Standalone] "))```
term does not evaluate to a function taking 1 arguments\
I'm really not great at Macros, but I can't understand how ((GEngine == nullptr) \ (GetWorld() == nullptr)) is equivalent to GEngine == nullptr || GetWorld() == nullptr
But I'm guessing it's something like that?
Its not, the page contains errors in the code.
Removing that GEngine == nullptr has sorted the issue out, but not sure why that was there to begin with.
(((GEngine == nullptr) || (GetWorld() == nullptr)) ? TEXT("") \
The formatting on that website has caused your error.
also DECLARE_LOG_CATEGORY_EXTERN(LogYourCategory, Log, All); is missing on the CPP part too.
Hmm yeah that makes sense.
bah, silly stuff- thanks @fossil spoke
👍
could someone explain why this isn't working? the diefromclient event isn't firing at all i hooked up a simple print string and it's not even firing that
dude WHY does blueprint OnRep run on the server (and on clients when they set variables locally) but c++ doesn't
i just debugged basically nothing for like an hour thinking my code was all wrong and then it just turned out i forgot to check one RepNotify function in blueprint to make sure we aren't the server
i feel like RepNotify should just work the same in blueprint and c++, i don't care which way 😦
Because they oversold the whole "RepNotify happens when the value changes". So they just added it in the generated code for setting a RepNotify'd variable - it also calls the OnRep.
It actually can't be brought to C++
im just frustrated and want to bitch about it... but i do feel its weird that they didn't just make it work the same in blueprints as it does in c++. its confusing, even if the extra functionality is nice (though sometimes unwanted?)
Best that could be done is maybe the NetDriver calls into the OnRep ... that's a bad idea for several reasons
It's confusing for those of us who often write both, but it's less confusing for the average user
why isn't this working?
the diefromclient event isn't firing at all i hooked up a simple print string and it's not even firing that
put a print string right after your branch, check if its even getting past whatever the condition is
Speaking of RepNotify (heh)
If you pass that branch and the server function doesn't run, you're running code on a simulated proxy and the call to server will never work.
@vivid seal yh it's getting past the branch
its just as soon as the diefromclient event is called it just doesn't fire it
is it because i set it to run on server?
are you calling this from the owning client? run on server will only work from the server itself (where its redundant) or from something the player owns like player controlled, player pawn, etc.
its not from the owning client but the player controller should be in the same room?
not sure
what actor is this code inside of?
thirdperson
thirdperson character or thirdperson controller?
thirdperson it's parent class is character so third person character?
okay, and is this the player dieing, or the player killing another character
this is the player dying
i want the player to flop on the ground on all players screens
but it only works from the server
interesting. if this is the locally controlled player calling code for himself to die (though a server RPC then a Multicast) then it should work
last thing, maybe silly, did you make sure Replicated is checked in the ThirdPerson's class defaults?
yh
yeah tbh idk whats going on then i'd have to see more
or i just missed something who knows
i went back to the basic code
without the events
the character flops over
but only on the clients screen
but obv cos it's not replicating
is there no way to make it's ragdoll state replicate through the properties tab?
Reasons why I hate Listen Servers:
Can never use switch has authority for client side
Run on owning client is useless
Why tf does a server always have to be such a parent
like they want to take control of everything
Just leave the client alone for once
😂
lmao
i have this happening
but it's just not replicating from client to client
when i do it on server it replicates on server and all clients
i realize its nothing to do with on rep dead
since i used this same exact thing on another mechanic and it works fine
its something to do with event interact i think?
how do i do that
literally a custom event Run on Multicast than put it into another one that is run on server than run the run on server event
don't i need to run on server before doing multicast?
other way around
oh so server then multicast
yes
works for me but I use set simulate physics and set collision
yup
nope it doesn't work :(
add breakpoints
did u use a blueprint interface for tracing clicks?
see if it is even running as i gotta go
yh the event interact is running and the branch
but everything after no
thank you anyway for taking time for this confusing issue
UFUNCTION(Server, Reliable) void SendComment();
do I need Server in the ufunction if I am calling out to the GameState in SendComment?
Server means you can call this function on the server from an owning client instance of this class
I think the answer is no
I only would have UFUNCTION(Server) on the function on the game-mode
it isn't needed 2x (one on the object calling the game-state and the game-states server function)
Server functions on GameMode make no sense at all, GameMode is server only
GameState is replicated but never client owned, so it can't RPC from clients either
So Server is also useless / impossible
oh
so you never use
UFUNCTION(Server) on a game-state class function?
did I understand that correctly?
UFUNCTION(Server) allows you to RPC from client to server
This is only possible on PlayerController, PlayerState, possessed pawn, and replicated actors owned by one of these
so this is a widget function
so does the widget-function need UFUNCTION(Server) that then calls a normal function on the GameState?
Widgets should never be replicated, so clearly they shouldn't do server things either
my widget isn't replicated, it just needs to send comments (user interaction) to the game-state so others can grab those comments
would you design it differently? or is that right?
If it's not replicated then it cannot call RPCs, and Server does nothing
oh, so if you say widgets should not be replicated and a user wants to use a widget to send comments to global chat, how would you start with user input into the widget and then where would you take that FText?
I figure it would be sent to the game mode in a list of comments
but that would mean the widget needs to be replicated (if I am understanding your right)
From my previous comment, list of classes that CAN send things to server
This is only possible on PlayerController, PlayerState, possessed pawn, and replicated actors owned by one of these
so considering widget isn't on that list and it sounds like you don't advise a widget replicating, are you saying you would have the widget pass the FText to maybe the playerState and then have the playerState send the text to the gameState?
Yes, though I'd use PlayerController myself
ok, I'll use the player controller
make sense in the idea that less replication means less overhead
so by not replicating the widget I think would make the fps go a little higher
Probably not, but you can get rids of bugs introduced by not having clear separation between client stuff and server stuff
makes sense
so I am modifying the game state from the player controller on a UFUNCTION(Server, Reliable) call and I am not seeing any change in my game state back in my widget.
Any idea why?
Sure the fubction is called at all ? Is the gamestate var replicated ?
no, figured that would have been done in the base class
guess I was wrong
so I added
SetReplicates(true);
bReplicates = true;
to the game-state constructor and I am still not seeing any changes in the widget when I call the game-state via
GameState = Cast<ATheGameState>(UGameplayStatics::GetGameState(GetWorld()));
GameState has always been replicated
Are the things you change in it replicated, though ?
found out I still needed
void ATheGameState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ATheGameState, Comments);
}
which I removed
so even though there is no RPC I still need that code above
This is unrelated to RPCs, yeah
thanks for setting me straight now
I have the widget make a call the the player controller which uses RPC to call the game-state to upload player comments
@bitter oriole I had some issues later but solved them
The issue was that I could not get values to stay on the GameState
The solution was to not have the values as TArray<UTextBlock*> but instead TArray<FText> and then create the UTextBlock on the client side
This makes sense as Epic probably wants users to decrease bandwith as much as possible.
That, and Widgets aren't meant to be replicated :D
Is it normal to have lag issues on Listen server? from USA to Russia. Client's ping is somewhere between 60-70, game is totally playable but sometimes collision and attaching events jittering too much
As far as I know 60 ping is good enough to play a co-op gamw w/o any problems
Just wondering if its my fault with replication or connection issues
In Europe, (England-Germany, Spain-Germany) works very well, but between continents its almost causing trouble everytime, at least collisions always fails to replicate (projectiles doesnt destroy on collision, attaching collision settings doesnt work etc.)
No, thats not normal. Try to activate CCD on the important mesh component and See if it makes a difference. But i guess thats only for low FPS, not high latency.
Framerate is never lower than 45 on that clients
But gonna try it, thanks
Btw not sure if it will help to clarify the problem but its only happening on client, server (host) sees collision working but on clients its failing
But the clients should check for collision on their own. So getting jitter, when client and server disagree makes sense as the server corrects positions. But not having a collision at all is strange.
Hmm.. I was using PktLag to test about it but on my PIEs it wasnt happening. But yeah you're its about server-correction. I have collisions actually, most likely they dont match on server-client
Gonna change my replication order about this. Thanks for giving me idea
But the clients should check for collision on their own.
Also jittering only happens about collision so you're %99 right about it
Maybe its just a matter of allowing higher tolerances between server and client. We have only changed them on the character movement component, but we upped them quite a bit to better deal with high latency situation.
Does Unreal allow us to control the tolerance between server and client?
Or are you talking about simulated/autonomous proxies?
Yeah talking about the proxies
I am not sure how to change tolerances on actor movement replication, if there are even any.
Understood, thanks for your guidance 🙂
I have a question about RPCs, I have a component with an RPC on it that I am firing from a BP, in order to fire an event in BP I'm calling a broadcast from the implementation function. I'm then doing some logic down the chain from the event in BP. That said, I don't have any way of using BP logic for validation. Is there a way to expose a C++ RPC to BP that exposes these functions or do I have to find a way of passing my validation logic in C++?
@twin juniper Probably the easiest way is to create a function in C++ which is BlueprintCallable like so:
if (HasAuthority()) {
DoStuff();
else {
Server_MyFunction();
}
Then your server function implementation is:
MyFunction();
}
@hybrid zodiac Hmm, so I would just skip using the Validate function for anything. I think perhaps there is not much point I can see in creating RPCs in C++. Perhaps I will just use BP RPCs and then have a validation node after the RPC call is received.
https://answers.unrealengine.com/questions/993151/view.html do you know how i can do that?
@rustic spruce ur profile picture looks like onigiri
well oof
yes i do
was that intentional?
well no
haha
@rustic spruce You can use encryption, but still cheaters will find a way to cheat.
Hi, my AI character are stuttering when they rotate. They're rotating based on 'Orient Rotation to Movement'
works fine in singleplayer
@rustic spruce and why to save data on the client side on a multiplayer game if care about cheating?
movement is perfectly smooth otherwise. any thoughts?
actually it looks like it's the movement also, it's just less frequent. it's like the model glitches out, as if client and server aren't in sync
i mean do i need a database or something like that
@rustic spruce If you want to prevent cheating, you have to host data on a server or be a literal god at encryption and even then, someone would probably crack it anyway. If you need scaling you could use something like DynamoDB from AWS.
Unreal's multiplayer is authoritative for that reason, anything on the client should be treated as though it can be compromised any time.
I also think Epic Online Services are offering some kind of storage so that might be a free option to look at but there are probably limitations to it.
If the data is a block or a single file, I think S3 from AWS is what you want.
ok thanks
👌
How can I handle changing actor replication at runtime and only between visible players. For instance if the server casts a ray between two players and they hit, then the server can make them visible to eachother, otherwise they remain invisible
AlwaysRelevant for updating UI on 'core actors' or should I just use RPC's to update the ui and keep it using proximity relevancy?
AlwaysRelevant so that OnRep functions are called, or multicast RPC's to all players
ima go with always relevant i think
it's only going to be 5 actors which will ever be always relevant
@twin juniper look into network relevancy
thanks dan
np
This doesn't work, any idea? I want to implement some check on the server that's why I don't call the AddMovementInput on client.
https://answers.unrealengine.com/questions/191187/add-movement-input-on-event.html It seems that someone had the same problem, so how does someone do some checks on the server side and then AddMovementInput if that's not the correct way?
Movement has to be added on the Client
Because otherwise you won't have any prediction
And yes, there is no nice way of intercepting this if you aren't touching C++ and extending the CMC.
How would I make a widget only available to the host? Would I just use if(HasAuthority()->SpawnWidget())?
Spawn it in the GameMode
Well, yeah. It's not gonna happen by magic :D
Thanks @thin stratus that works.
Hey, iam grabbing the hit location of my cursor with the world in my pc. From there i set the lookat rotation of my pawn. What would be the best way to have that happen in multiplayer?
Set & Replicate the Hit location and then work with a repnotify?
If you're rotating your own pawn, shouldn't it rotate for everyone connected since pawn replication should happen automatically?
why isn't this working?
Should
I grab the location in the PC:Tick
that certainly does just work on the local player controlled pc
@inner cove yh ik im new to blueprints my shit looks like spaghetti 😂
but i can't hear anything
I kind of want to avoid calling a RPC to the Server each tick
@lucid flower That's how i do it, this event runs on Tick on PC
ur pawn should have replicated location tho?
are u using your own blueprint from scratch or is it derived from thirdpersoncharacter or firstpersoncharacter
okay so you're using the control rotation thingy
that should replicate out of the box if i tell the pawn to use that
But as long as the actor is set tp replicate.
Then it should replicate for everyone.
@lucid flower did you tick actor replication?
r u using playerstart's in ur map?
@lucid flower yes, SetActorLocation didn't worked and i searched on the internet and found that you should rotate it with SetControlRotation
@inner cove The Server RPC into Client RPC is the worst you can do
if the player has 50ms ping you'll be at 100ms delay between input an actual movement.
Ohh
@twin juniper widgets dont spawn on the server tho
@thin stratus so how would you suggest to do it with BP?
Check on the Client and hope they don't cheat.
Multiplayer without C++ is not gonna work properly anyway.
Shitt, i have to return to the old bad habits 
but almost no one uses listen servers lol
What makes you think that?
i dont know anyone who uses them outside of call of duty
every serious, competitive multiplayer game ive played uses dedi's. Overwatch, league of legends, dota, starcraft 2
palladins
You are naming games that have to use DedicatedServers
fortnite
There are lots of games that don't need DedicatedServers
and they use ListenServers
minecraft lan
Borderlands 3?
never played borderlands sadly
Basically every game that allows Players to host
Okay @inner cove that works like charm
Outside of UE4 probably even more
@lucid flower 🙂
@thin stratus since i will have to dive to c++, what should i look for?
The proper place to handle movement is the CharacterMovementComponent
does anyone know anything about voiptalker node?
But if you have no C++ knowledge you'll be lost
I have
@wild mantle Not really, no.
theres not that much documentation on it
yh i found a website with a rly detailed tutorial and explanation but the blueprint isn't working still
What are they for anyway? Is that more or less the same as push to talk in game voice?
im casting my gamemode to the current game mode from a client's playercontroller but its returning false?
it's location based proximity chat yh
Ah right. Does that not need the default implementation?
Also can you link that tutorial? Curious too
it's pretty short
like just a couple of nodes
this is the whole blueprint for it
It's strange to me that this is on Beginplay
Without any check
Will the Server execute this for clients too?
Also is that in the Character or PlayerController?
apparently so, i mean it just attaches a voiptalker to the actual characters at the beginning of the game
it just adds it and sets the settings
the voiptalker does all the work and checking
oop
:D
@thin stratus is there a function i need to override in c++ to do the checks when a client calls AddMovementInput?
I feel like running voice data over the game server is expensive
Is this beeing over cautionous?
@inner cove Movement goes through Tick. They go from there to "SendServerMove" or so.
There are lots of places you can do it, but I would assume it should happen somewhere AFTER the sending of the data happened.
And also a function that both server and client call.
I'm not away of which one that would be, cause the CMC is massive.
Ahh, okay thank.
do you know how we make a death montage when you get killed how i should do it? and it replicate to all clients
Send out a multicast call from the server when the character dies? That Multicast Event then play the montage
yeah but do you know how to make the camera look at the face of the monster
i don't remember how to
🙂
hey im having this strange issue with set timer by event
maybe im misunderstanding how it works
there is a half second window i want the timer running during
its not firing consistently
i get some where it fires two or three times
some where it only fires the delegate once
the event is a single keypress in the weapon that is called from the character
is this related to #multiplayer @soft girder ?
ya i found it
its a branch
var is not replicated. we were expecting it to be handled on the server except our weapons are not replicated actors
@inner cove how can i access one of my camera to change the location Offset ? in BP
just had to move a couple of things
wait
why does having a branch in between a server side event and the timer mess it up?
@soft girder can you send a screenshot of the graph?
@rustic spruce
that var is true by default
even when i remove anything changing the value of can fire
@inner cove i mean a cine camera like in a master sequence
actually almost any branch with a default true screws this timer up
how does it work tho
when would i call start timer
would it still be a problem if somethingToDo led to the start timer later in the script
So what exactly are you trying to achieve?
i want the server to deal damage by that timer so i can leave tick just doing the particle effect
i think ive got it now
@soft girder https://docs.unrealengine.com/en-US/Gameplay/HowTo/UseTimers/Blueprints/index.html this might help you since it shows how you can deal damage with a timer
A How To Guide for using timers in Blueprints.
can anyone guide me to the best place to look if i want to make a server model similar to clash of clans type? everything i search about unreal multiplayer shows me session based server model, i want one where all players have their own levels but communicate with a server to provide them with information and perform calculations.
thanks
do you know how i can get a cine cam from a lvl sequence
Hey so I'm trying to test my game using the steam multiplayer subsystem. I know that my game works because I tested it last night on the exact same build, same computers, same steam accounts. But now for some reason the client computer can't find a session. Is this an issue that just happens every now and then or what is the deal?
@rustic spruce u can ask at #cinematics since i don't see something related to #multiplayer in this question.
does any 1 know how to make code in the game mode execute only in the client? #if !ue_server doesnt work
if (!HasAuthority()) {
DoSomething();
}```
ty
Does anyone know why my steam setup would suddenly be failing for no reason?
thats a pretty open ended question....
steam sometimes fails if you have an instace of your game already using it
could be issues with steam itself
what movement type should I be using to move an AI character in multiplayer? I'm getting desynced movement
no idea, love your pic tho, gold old newgrounds
Any reason this would screw up replication? I think it may be causing the jitters I'm seeing
This is what I have. Register Horse Movements is connected to a custom event that updates a variable about which anim montage to play. Register Horse Movements is also connect to a server event which executes the same custom event.
Is it correct? It doesn't work so I assume it was done wrong.
@normal jacinth have you created custom event to replicate your rot
No
So should I put all the logic in server custom event>
Then connect that to Register Horse Movements
Ive anothe I have another multicast event for montage only
So this is what I have.
Register Horse Movements -> Server Horse Movements
Server Horse MOvements -> Event Horse Movements -> Multicast Play Anim Montages
no I guess rotation isn't replicated because it's coming from the player controller
what's the best way to rotate an AI? I've tried a few methods but failed
I followed this answer but it didn't work for me
do you know how can i make a replicated cone raytracing
Gonna leave this here. I'm trying to rotate an AI without them jittering. It's quite subtle now but still there. TargetPos is set from a behaviour tree. Any idea why this would rotation would jitter?
Is PostLogin called upon every connecting player to the server? And does it also get called when the host creates a session?
@twin juniper Called after a successful login. This is the first place it is safe to call replicated functions on the PlayerController
That’s on the docs ^
Yes, it’s called upon every connecting player if they get accepted from the PreLogin
Is it called on the server as well when it creates the session?
I have no idea but I don’t think so.
Does gamemode have a method to know when the session is full?
Funny question. Would it be possible to use discord as a login/flat file database? Example, user logs into discord through game login. discord bot moves them to their channel. Discord bot communicates with server and clears logs and reset the flat file? So basically, user registers in game and it sends the request to join the discord. They are accepted and the bot create a section for that player. Each database variable would have its own channel say hp mana gold. Would any of that at all be possible not saying reliable lol.
Does it make sense though to be possible that way for auth api and saving user information?
You could then set up servers for separate user pools maybe and have the bots communicate this information back and forth??
@twin juniper function is 'ReadyToStartMatch_Implementation' in CPP but you have to define what that means.
i.e. "numplayers == max_players" or something
oh
thank you
that helps a lot
yes I'm doing mine in CPP
I'll implement the delegate
I am going to try it an I will let you know if it works out 😛
Hmm calling a server_ call on a pawn's tick is probably bad practice right?
Hmm calling a server_ call on a pawn's tick is probably bad practice right?
@glad sedge Yeah
I would do some staggered thing
Or have some delegate
What is the function for
Is there a straightforward way to spawn a particle system on all clients?
I'm using a multicast currently but that isn't working
God damn, I cannot get this floating pawn movement to replicate
I can get it rotating, can't get it moving
ACharacter's CMC does send servermoves rpc on almost every tick
yeah this isn't the CMC
Just refering to the question regarding whether it's a 'bad practice', but that depends.
CMC will apply several optimizations to avoid sending server rpc when not really needed. (eg char doesnt move)
oh right
yeah, I update a bunch of variables on tick and then apply that to my Movement Input
it's a racing game
I can get it working on Server itself, but it's not updating the clients. I've tried a NetMulti call but I'm not getting anywhere.
If it's a client authorative game, then i guess it's ok to just send those values to server
If you plan on impelementing server authority and client prediction, that can get a little messy (see cmc code)
yeah I'll need Server authority.
Right now I'd settle having the bloody thing move an inch
You can maybe design your racing movement around CMC, can save you some headache (but you may loose your hair, fair warning)
yeah, fuck it seems floating pawn doens't support networking movement out of the box
floating pawn movment is not replicated
shit
you need to use projectile movment
or you can use input velocity .
when the car turns you want to interpolate around the curve of the turn I guess
I would try both to see what preforms better
Mattxor these movement component (except cmc) are not support online games as well, and not support player controlling that well either. Tho you can probably setup a decent looking movement, but as soon you bring the game online, there will be issues with latency and other network malfunctions. CMC has the toolset to deal with these issues to a large extent.
Also, cmc's implementation hides the sluggish movement, because it allows client to make moves on it's own, and apply corrections only when client goes off path fsr.
I'm not using a bi-pedal person though
CMC is moving a capsule, not a person.
It's a little car, in my case - top down view.
Maybe I could expand the capsule. Hmmm
he is right the projectile movement lags the actor.
Just implement client authority, it's the easiest. Later, you can redesign the movement code with more care.
spawn the model of the actor on the client. Let the client have full control of it but like rob said you will the server move the actor and only correct position when needed.
:) It may be a bit complicted to pull that off, but yes that's the basics.
Only what the server is replicating is what the client will see so if they cheat and move around it wont display anything
That will feel sluggish and difficult to control. Owning client must move the actor like it's local.
that is the right way for sure.
hmm let me dig into it
it should be only when the actor reaches its destination or periodically during the movement the server should correct the client and if the client is only off by a little you may want to adjust the server to the client
Gonna try Character first, and see how I go
For the correction you will use timestamps to synchronize these coordinates in time, but timestamps can also be an attack vector for a cheater.
funny how ragnarok used the animation of a sptite for their cast delay. Users removed sprite instant cast 😛
smart workaround :)
in unreal you'd use gameplay abillity and with a nice setup that wouldnt happen
well that is the thing. There is always more than one way to skin a cat.
To be fair, for cheaters to show up a game must be relatively famous, because not many cheaters are actaully understand how to design a workaround for a certain game behavior.
it comes down to preventing memory hooks but even then your hook can get hooked so what is the point
So it's not a real threat until you reach great numbers.
depending on how competitive the game is it can ruin everything.
for instance potions
That's not a question. I just say, that only a few people can hack a movement code and figure out a script they later share. If they ever show up in the first place.
I wonder how a no clip or wall hack would work in an unreal game.
might be easier to just ban that user.
I guess you would need to figure out a way to break collision.
If it's a client authorative movement, then it's obviously simple to wall hack. With a CMC movement code, that's get a little tricky, but i guess anything is possible. A tiny bug someone discover can be exploited.
Example would be warframe. Warframe would spawn other players that join on the character that is hosting. If you take the host to a part of the map. You could spawn other into the wall and nothing could attack them. yet they could use their skills and kill everything.
sounds like some mild fun
was playing dead island the other week and there was a part were I could not take the vehicle. I ran into that wall at every angle I could. I got the truck on the beach 🙂
It just teleport you the other side of wall?
no the actor got tilted up and pushed over because a prop was blocking the front side
I had to drive backwards 😄
I think breaking games is the most fun part of playing them for me.
for instance you have lords mobile
Yes it's funny, just ruins the immersion for others. If played online ofc.
these people will attack you and then change their name. So I found a way to read their user id in memory so I can go search for them even after they name change
You are hunting them :) hehe
they started it
I'm working on interpolating simulated proxies and I have a bug I could use some help with. I'm seeing random jittering in simulated proxy locations, like its using bad data. I've traced the problem back to when I get the start-transform.
I'm doing SimProxStartTransform = GetOwner()->GetActorTransform(); from inside my component. But the Location inside that transform is sometimes set to wacko values. Even when I do GetOwner()->GetActorLocation() and print the result, I'm seeing Location values that are way off for seemingly no reason, and this in turn is flipping out my interpolation.
Can anyone give me any suggestions on why the Location is freaking out so badly for simulated proxies?
I've attached a screenshot of the wacko values and a gif of the behavior I'm seeing in-game where there is no user input.
@austere needle anything to do with values not initalising?
i.e. FVector YourLocation;
I don't give the SimProxStartTransform a default value, so there is a very short period of time where it's empty. I'll see if setting it a value on play helps at all
No luck unfortunately. I'm still getting wacko values from GetOwner()->GetActorLocation()
@austere needle One thing is for certain is that the reason those are printing way off results, is because the owner of that component has been moved way off from where you expect. The root component of that actor has to be at that location for that to return that value. It'd be really hard to diagnose without knowing how you're moving your actor in the first place or knowing where you're printing those values off.
I've made a little progress. It's definitely a problem with how I'm setting or calculating my interpolated positions.
I'm using FMath::CubicInterp(StartLocation, StartDerivative, TargetLocation, TargetDerivative, LerpRatio); for my interpolation and then using GetOwner()->SetActorLocation(NewLocation); to set the actor's location. If I comment out the GetOwner()->SetActorLocation(NewLocation); then as expected it stops setting the location and and I stop getting bad values. So I'm 90% sure it's me setting bad information or something
But, the math from FMath::CubicInterp(StartLocation, StartDerivative, TargetLocation, TargetDerivative, LerpRatio); seems to return correctly each time. I can't get wacko returns from it. I set a breakpoint and let it step by step interpolate for like 5 minutes of me-clicking-continue-time and it didn't break
in other words, I can't prove that I'm setting a bad position when I GetOwner()->SetActorLocation(NewLocation);
I've read in a couple places that these sort of problems can arise from using a listen server vs a dedicated server, so I'm gunna look at testing with a dedicated server now
woof, that's a pain.
Has anyone tried to implement with Agones?
@vernal light ?
My results after research in replication
#work-in-progress when the link works
Probably not the place to share random videos though
Not Random
@vernal light Its a nice thought, but the video - at least on my phone - is too small to make out any details. Most of the video is black space with a small postage stamp sized view of the actual screen
Try re-encoding the video in a free editor like Lightworks so you dont have all those limitations making the video unwatchable
okay, Thanks @hybrid zodiac
hey everyone, I'm making a PvE game with listen clients, so I'm thinking of going with a client-trusting or client-auth network setup. As I was brainstorming I had a question, in this type of network model, how is AI handled? Does only one copy exist (the one the server)?
@cedar lake Depends on how deterministic the AI is. AI controllers only exist on the server, so AI is only run on the server and the pawn is replicated to clients as any other player would be
The problem with client-side AI that can move around and perform actions is how to keep them in sync across all clients, so you would need some deterministic way to guarantee their behaviour
@hybrid zodiac yeah that's exactly what I was wondering
I don't mind it only existing on the server but is there a way of applying damage locally without needing to predict? or would it just have to be a prediction.
If you don't care about cheating then you could make your own apply damage function. Just alter the AI's health locally for prediction and then make a reliable RPC to the server to apply the damage, which will set the replicated health again on the server, and then it'll update everyone.
Hey so just a quick question: When a client attempts to connect to the server, do the two game versions get checked to see if they are compatible? Is this done by default or is this something I have to implement?
@royal mica you can check by yourself, join your server and server logs the handshake logs on the console. As far as i remember there is checksum validation but don't know whether server rejects the connection.
That was gonna be my question whether it uses checksum or checks the project settings version
Okay thank you @rich ridge I think you're right that it does checksum and then disconnects if they don't match because there is a pre-existing ENetworkFailure type called "outdated client" and "outdated server"
@cedar lake I think the fundamental problem you have is that UE4's networking system is a client-server model, while what you want is a peer to peer model
So even though you can still handle some stuff on the client side, you will still need to go through the server to ensure all clients are kept in sync
Therefore, while you can handle some stuff on the client such as hit detection, all you're really doing is moving a small bit of processing onto the client in exchange for increased network traffic (since the client still has to notify the server that something has happened)
Since clients cannot communicate with each other directly
In practice, your options are either to implement a custom p2p network model to replace the default client-server model, or embrace the default model and make the game server-authoritative
How can the game mode access each player's individual data, like their health or their position. I'm wondering if grabbing their player controller, then getting the posessed pawn to access the data is the right way to do it?
Or is there something better I can do?
Because if for instance it's in spectator mode, it might not be posessing the correct pawn.
I am trying to implement a steam callback for steam friends "PersonaStateChange_t" that is inside "isteamfriends.h"
i already included isteamfriends but it is still complaining about linker errors
@twin juniper You could do it via the player state. The player state persists across the entire game session, regardless of whether the player is spectating or possessing a pawn
@twin juniper GameState has an array that holds all the PlayerState of the connected players, and PlayerState has a property bIsSpectator (but i don't know if this variable gets set automatically or you have to do it manually)
So should any piece of information that a player has which is shared amongst all the clients, can that be stored in the playerstate?
Something like health?
@inner cove do I have to override the playerstate ?
To put my own data in there
Well, health normally is tied to the pawn, but you could put some function in the player state to see if the player possesses a pawn and determine what to display based on that.
Yes health is part of the pawn but what if I wanted all the other players to see that health.
Then it would need ot be shared.
@twin juniper you don't overide, you create a class/bp to inherit from PlayerState
About the health, i have the health on the pawn and set it to be replicated
In that situation you could make the health variable replicated in the pawn, and then in the player state have a function called GetPlayerHealth which runs logic like this:
@hybrid zodiac but then that player state would need a way to get the pawn or character right?
If player is possessing a pawn and not spectating then return the pawn's health, otherwise return 0 or something
@twin juniper
The class APlayerState is the most important class for a specific Player.It is meant to hold current information about the Player. Each Player has their ownPlayerState. The PlayerState is also replicated to everyone and can be usedto retrieve and display data on other Clients. An easy way to accessall PlayerStates, that are currently in the Game, is the PlayerArray insideof the GameState Class.Example information that you might want to store here:•PlayerName – Current Name of the connected Player•Score – Current Score of the connected Player•Ping – Current Ping of the connected Player•GuildID – A Guild's ID, in which the Player might be•Or other replicated information that other Players might need to know about
Yes, so the player state is owned by the player controller
Or there might be a function in player state called get player controller or something, not sure off the top of my head
So if that's the case, where a player state is meant to hold replicated information.
Then shouldn't health just go in the player state?
instead of the pawn
You could do that too, yes
And all data in the player state is automatically replicated? Or does it still have to manually be set to replicated?
Still has to be set to replicate
You still need to mark the variable as replicated, but UE4 will generate a player state for all players automatically and sync them
Cool thank you!
You're welcome :-)
Hey, is there any common reason why DOREPLIFETIME will cause compilation failure. Identifier not found.
For clients, if you want to display the health, you can obtain a reference to the player state from the pawn or from the game state
@twin juniper make sure you include the networking.h header
I read that you include in the project, but do you need to do it in each class?
maybe what I read was before the includes change
Yes you need to include it in any file you need it.
@hybrid zodiac That fixed it, how silly, I've been including necessary headers for months now and for some reason I thought this time was different.
pattern-matching fail
@twin juniper the visual studio is pathetic. Your IDE should be smart enough to tell you appropriate header
@rich ridge I resonate deeply with these sentiments. Have you tried Rider? Been seeing some stuff about it around but not sure about it.
Use this
How is debugging?
@rich ridge you have to fill this form to get it? https://www.jetbrains.com/rider/unreal/
Yes I did fill that form and I got download link on my mail
Intellisense, or dummysense as I like to call it is so slow it hurts, I find myself typing code in or copy-pasting manually because it hangs and I feel my life-force ebbing away as I wait. What is the experience with Rider?
Rider is damm fast..
@rich ridge you got it instantly or you had to wait some days?
Instant
does it have an automated method to change the definition and declaration params at the same time? I find that irritating about VS.
Rider automatically gives option to override RPC functions with appropriate suffix
It can list the virtual functions which you can override
Like java
Hmm, well if you've been using it for 9 months with no issue, it can't hurt to try. What about when you need to rebuild your solution, I find myself doing that when I move classes around and things. I guess you can't use the context option from the UProject in the same way?
you know, Generate VS project files
Actually rider is integrated very deeply
Adding and removing classes with VS is a pain as well, does Rider handle this better?
Yes it does
If you have worked with java using jetbrains IDE, then rider offers exact same functionality
Hmm, but what if the project won't open due to compilation failure
Can you reset from Rider?
open in rider and fix and launch project from rider
With any luck Rider solutions are easier to maintain and don't need a hard refresh so much
this is code maintenance, which depends on nature of game and team
What does it mean by Blueprint support?
Thats so weird, why is it Rider for Unreal engine and not CLion for unreal engine?
Rider is a .NET IDE, CLion is IDE for C and C++
I'm sure it makes use of CLion for the backend but I think they are marketing "Rider" as their gamedev offering (and charging a little more)
Still pretty good pricing though. Going to look into it.
Thanks @rich ridge
its free
Still pretty good pricing though. Going to look into it.
@twin juniper its free
@inner cove there are two variants for rider, one which is available directly, and other is in beta stage called Rider for Unreal Engine
@rich ridge Free for the preview period or free-free?
free till preview, 31st march
I didn't say that, Rider is a .NET IDE, CLion is a C/C++ IDE and they chose the Rider to enhance it for the unreal engine instead of enhancing the CLion @rich ridge
the preview might get extended as they still didn't launch rider on Mac or Linux
I didn't say that, Rider is a .NET IDE, CLion is a C/C++ IDE and they chose the Rider to enhance it for the unreal engine instead of enhancing the CLion @rich ridge
@inner cove they might have cherrypicked C++ from Clion and .net from rider to bring Rider for unreal , who knows what is truth 😀
Rider is already well known in the worlds of .NET and Unity game development for being a smart cross-platform Unity and .NET IDE. And we're now ready to bring it to the world of Unreal Engine development!
It looks like this is the reason ^
reasonable reason
Wow, it feels so brisk and snappy compared to VS
If an actor were to alter the state of a replciated variable would it alter for everyone or only if the server alters it?
I'm pretty sure it's only if the code is executed on the server then it would alter for everyone
just want to make sure
@twin juniper If the server owns it, then all clients should get the replicated variable, but if a client owns it, nothing happens I think.
Yes I imagined so
@rich ridge Do you know how to turn off automatic include wrapping?
can you explain what you mean exactly?
@twin juniper this is what you mean?
ohk, this is one of the features of java based ide.
Is there any point in using an authority switch when I'm calling a server RPC? It's going to happen on the server regardless right?
Has anyone had any luck replicating the rotation of actors?
I have a concept. Rotate in client and server. Make the variable replicated.
Hey guys, I want to do a simple leaderboard for steam based on highscore in my game.
Player position / Player Name / Player Score
I have steam set up in my project and I added 2 achievements successfully but I can't find a tutorial to follow for the leaderboard implementation.
Is this possible with blueprints? Can someone who has done this help me out ? ❤️
@charred crane yes, if the event is marked to Run on server, it will run only on server