#multiplayer
1 messages ยท Page 332 of 1
thanks man! Guess it should be easy to reference info into my UI then
I really should get my head around how event dispatchers work, but so far with replication, having the pass on targets to them always seems to go wrong
Player session auth request is a function with local ver and so is player session auth, if i bind like this is should all be instances right?
Has anyone run in to the same problem? I'm just trying to set my online subsystem to return my game session implemention.
If anyone is interested I'll provide more information.
@dapper galleon I assume FOnlineSubsystemGameSessionStarfirePtr implements IOnlineSession?
Yes, it does.
class ONLINESUBSYSTEMSTARFIRE_API FOnlineSubsystemGameSessionStarfire : public IOnlineSession
I'm also following what is exactly done in the Steam OSS
but for some reason it shows me that error
could be nothing, since my compiler actually compiles
but when I try to get the game session implementation it returns null ๐ฆ
as in:
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
Sessions.IsValid() -> false
I verified that i'm actually using my subsystem
It's really hard to say what it is
I was about to make a thread
heh
nvm sorted
having an odd issue, not sure if it's working as intended. i have a few maps, starting out with a menu map that can join other maps. i host a game, and have a list of players that i can display. i have another player join, and it all works fine, shows two players in the list. now, when that player who joined disconnects, their name stays in the list. i put some breakpoints in and found out that it's actually destroying the player state, then re-adding it when they join the new map (menu map). but my host who is already in an in-game map has that player state replicated to him, adding his name back up on the list of players. why is it adding a player's state from another map? little confused on that one
How's your list generated?
i was using begin play and end play on player state which cause some issues. i'm using game state instead now and it seems to work as expected
anyone ever had "isvalid" not work properly with playerstate?
it treats the playerstate as always being valid even though the later script complains about it being empty
it straight up just looks like isvalid doesnt work with playerstate at all
quick question, if i have a game which works relatively well on windows PC over the network, will I be able to just port/push that to MAC without changing any networking code? does the engine allow cross platform networking already built in?
QUESTION: I'm having trouble using the UDP sockets to communicate with a server on a public IP.
My understanding is that if a PC behind a router sends a UDP packet first to a server on a public IP, the server can answer to the PC by using the port given in the sender information, therefore telling the router that this packet is for this PC in the NAT.
Now what happens to me in practice is that the server does receive the packet all well and good, and seemingly manages to send a packet back, but the client never hears from it. A quick look through Wireshark indicates a very odd behaviour: The client sends an UDP packet, but somehow it receives a TCP packet with an ACK + PSH flag. Given its size, presumably containing the bits that were intended to be sent over UDP ๐ค
Could this be because, UE4's UDP socket implementation includes an automatic TCP ack (otherwise how could you have the information for "bits sent" in UDP?), and since the server answer happens on the same tick that it received the information, both packets are clumped together in one single answer?
(This last sentence is purely speculation, but if someone around here happens to know if that's the case or not, that'd be very much appreciated ;) - Otherwise I just can't explain how I could possibly receive a TCP packet from an UDP sender socket)
anyone else ever get sick of doing this for listen servers ๐
Make a macro for it
Need some help here to understand what I am doing wrong.
I have some code in my gamemode that changes the state the game is currently in(waiting for players, counting down, inprogress etc.). That is all run on the Server because its important for gameplay, but I need that information(state) to get down the clients, so what I do is pass into my GameState and then run some Event Dispatchers inside multicast RPCs to notify my clients, however the Event Dispatchers are not executed on clients
Gamemode:
GameState:
UI widget:
the event binding never executes on the client
just so u know
stuff in gamemode
only runs in game mode
does not exsist in clients
yep, that is why I pass it to my GameState
I found a tutorial about port forwarding but it's not step by step and i can't understand how it works, can anybody describe this please :
https://answers.unrealengine.com/questions/52877/network-how-to-connect-to-a-remote-listening-serve.html
Afaik GameStates are replicated and created on all clients
yeah
well im out of idea's
start prayin for lethal
if ur still stuck in abit il try and help you just in the middle of something ๐
Could it be because going from Run on Server(GameMode) -> Multicast(GameState) doesnt work
Might need to do it like this: Run on Server(GameMode) -> Run on Server(GameState) -> Multicast(GameState)
the binding is inside a widget on local clients
Yeah but I mean in what event
I have a custom event called Init that I run after the playercontroller has been assigned a Pawn(onRep_Pawn - the one you helped me implement)
OnRep_Pawn -> Create widget -> Run Init inside widget
Okay, I would try making sure your GameState is valid at that point
I wouldn't use pure casts when you're not absolutely sure it will succeed
I think it would error out if it failed, but you said the binding is never occurring so not sure
Is that because the GameState is not replicated in the beginning?
Yeah, it might just not be replicated at that point
Is there any way to create listeners on when stuff is replicated?
like a GameState
Else I would need to make a timer/tick that checks if the GameState is valid and THEN bind the event and terminate the search
I would just try checking if that's the issue at this point
It might get replicated first and I'm unaware of a set order
To answer your question though, I know you're not going to like this answer haha, it's simply using OnRep
It's not very flexible as you can't extend that into another class or into BP, but that's just pretty much how it works
I would love inside my UI that needs pawn reference and now gamestate references to just create listeners on when the playercontroller is assigned and replicated a pawn
instead of having to do variable assignments for the UI inside my playercontroller
Anyways, figured out the problem! The event dispatchers actually fired, but since the UI for my client is created AFTER the state has changed - it never hooked onto the dispatcher in time
once again, a bit of replication delay that fooled me
So I just need to get the curState inside my gamestate upon widget creation
I would also create the binding though, because you're not guaranteed the GameState will get there first AFAIK
yeah, will get the curState and then create the binding because that is neeed later on to display information regarding new round starts etc.
Thanks for the help once again Lethal, owe ya a beer
AFAIK it means as far as I know
ahh gotcha
mfw maybe lobby level & aparently i dont have any controllers when u start on it
10/10
why this this happen to me all the time
I litrally made a blank game mode and controller, set them as game mode and controller in a bank world, > start it up no one has controllers mfw
restarted engine
fixed
.>
Jesus what is going on with my engine
Basic add to view port is not even working
First 3 work
but the umg does not get added
i am 100% confused
restarts engine again
level blueprint begin play not firing
Hi, I'm having a problem with DOREPLIFETIME, I'm trying to call it on a weapon I have it included unrealnetwork.h in my games .h however it's not seeing it, anyone expereince this bug?
I'm going to go out on a limb and say it's probably not a bug :p
What error are you getting, and can you share the code? @vivid fjord
so this is in the .cpp
void AWeapon::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifeTimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifeTimeProps);
DOREPLIFETIME(AWeapon, OutLifeTimeProps);
}
and the DOREPLIFETIME is not working, VisualStudio doesnt see it
Well I'll stop you right there, the second parameter shouldn't be OutLifeTimeProps, it should be the name of your weapon variable
If Intellisense doesn't see it that doesn't mean much, it misses a lot :p
hmm ok one second will test
And wait, I'm confused
You're within AWeapon trying to replicate AWeapon?
That's not really how it works
yeah, Im following a tutorial, mabe its not a good one
Actually wait, never mind, as long as you're replicating variables that's fine
I wasn't thinking, sorry
no worries I appreciate the help I'm stabbing in the dark ๐
network is alllll new to me
with UE4 at least
Yeah, it's a different mindset for sure
What variable are you trying to replicate on the weapon?
And could you link to the tutorial by chance? I just want to check it out
mmm I can't sorry it's a patreon thing
yeah im just following along so /shrug
is it worth putting a switch auth node in front of a event dispatcher thats only for HUD? so the server does not waste its time calling it
hello people :)
I'm having a strange problem, I think... On the client side, when I press the GrabRight button, the string "Pressed Grab Right" gets printed. Moving on, once the "GripState" is changed, the OnRepGripState function is supposedly triggered on the client, but it's not printing "OnRep_GripState started". Does anyone have any ideia why?
Are you sure the RPC is actually making it to the server?
@past pawn
There could be a multitude of reasons for it if not, but figuring out the actual issue is the first step
@past pawn is there an actual change to your Grip State?
yes, it's default value is open, and I only change it when I press that button. weirdly enough, it works when the grip object overlaps something (I change "GripState" there), but not if I press the button
So just to confirm (sorry), you're printing within the server RPC itself and it's being fired?
Because with your additional statement it sounds even more like the RPC isn't getting to the server
apparently it looks like it
I...don't know what that means
regarding the first question, no.
Okay, so you didn't confirm the RPC is being fired on the server?
I confirm that the RPC is not firing on the server
and the custom event is to run on server
Okay. I was just kind of confused since you said "yes, I can see in the log that it does reach the server"
i'm sorry, it seamed like it, but then I put a print on the RPC and couldn't see it on the log
You're fine, just politely it's best to confirm things rather than assume when debugging
Okay, so now we need to find out why the server RPC isn't working.
When you spawn this actor, do you set the owner to your PlayerController?
like if I possess the actor? I have a pawn that is possessed, and then he spawns this actor
it's a vr game, don't know if it matters
Oh, I should've realized this was a pawn, oops.
Or is this...is this the pawn itself or an actor that the pawn spawns?
Sorry, I just am not sure haha
the BPMCRH is an actor that the pawn spawns
And we're on the BPMCRH I assume?
Oh. No
But that reference may be null
Are you confirming that you are getting a solid reference to that actor @past pawn?
I get it, haha, just confused about the naming
Could you show how you're spawning it as well?
Also. Just for kicks, the actor is replicated right?
I'm fairly sure the issue is they're not setting the owner correctly
But just trying to see what issues may come up along the way
"And we're on the BPMCRH I assume?" yes we are (in picture 2 and 3, picture one is the pawn)
"But that reference may be null" I've tested it, it's a valid one
I'll post the spawning
and the actor is replicated
there it is
Okay. What is going into the owner pin?
self
Alright, try using "Get Controller" on that rather than the pawn...I'm not 100% sure it will work but it will eliminate that as a potential source of the problem.
If this script is on "Begin Play", you'll have to move it to "Possessed" or else it will be called too soon
Also, is the RPC marked as reliable?
i'll try it
it is marked as reliable
still not working. sorry to take some time, but I'm testing it on VR and I need to build the game every time
Alright, that's fine. So just to confirm we're on the same page: you have confirmed the client is making the call to the server RPC, but you've also confirmed the server RPC is not being received?
If we've confirmed it's not an ownership issue, I'm not really sure what it could be
You don't need to build everytime
You just need to be smart about what you need to do when doing MP with VR in UE4
Especially since all you're doing is debugging an input
If I had I build everytime I had to test MP for my VR game...I would have probably just given up
but running 2 instances of the game on the same pc is not representative, how do you do it then?
Lol
You cheat the system
Just like you should
You build a "FAKE" VR character
That gets spawned when VR HMD is not in use
As long as your VR pawn is child of Fake, everything that works in Fake, works on Real
Ggwp
$99999 for that cheat please
But seriously. This will only work for so much, but trust me...saved me countless hours.
yeah, that's a good trick, but if you really need to check if everything is replicated correctly (which is what I'm doing) that approach wouldn't work. but if you just need to test interaction, sure ๐
?
Actually...it works perfectly to check for proper replication
As long as you have a decent way to debug
alright, I'll give it a try then, thank you very much
:)
ready to blow my brains out over json requests, while php script runs fine until echo json_encode and decides to send nothing back from the bind results @_@
ready to blow my brains out over json requests, while php script runs fine until echo jsonencode and decides to send nothing back from the bind results @@
Fixed it for you
LOL
ye
echo json_encode(array('status'=>"OK", 'charname'=>$row_username));
Returns me
no status value
but returns char name
MAKES NO SENSE
works fine in other things
Dunno, the water is warm on the Node side of things ๐
JSON is nice in JS because it is JS :p
the examples i have to work from are awful
sometimes they have spaces in things
sometimes they dont
sometimes u have two spaces
just randomly
so annoying
WHat if its a bug with the va rast plugin
It works fine on every other .php
but it wont return any value for status
0 sense made
Could you show your BP?
it works fine
and i can confirm that as im getting it too add data to the table
this is the bp section for it too print
There must be something wrong with the structure
iv been adding sections on and on
printing it
but the status is not coming through
hmm
gonna restart my editor
Yeah
its my structure in the php
i got two things to print now
echo json_encode(array('status'=>'okay', 'charname'=>$row_username, 'level'=>$row_Level 'exp'=>$row_Exp, 'frame'=>$row_Frame, 'map'=>$row_Map, 'x'=>$row_PosX, 'y'=>$row_PosY, 'z'=>$row_PosZ, 'currency'=>$row_currency, 'equipment'=>$row_Equipment, 'inventory'=>$row_Inventory));
looks the same to me though Q_Q
gonna re write it
incase something weird with notepad+++
You don't know it's the PHP, it could be the plugin doing something weird with a field named status or something like that
Like I said, making assumptions is what kills debugging :p
but when i try more its going poof
omg
true
so
echo json_encode(array('status'=>'okay', 'charname'=>$row_username)
works fine but
echo json_encode(array('status'=>'okay', 'charname'=>$row_username, 'level'=>$row_Level 'exp'=>$row_Exp, 'frame'=>$row_Frame));
returns nothing
No comma after the level field?
oh..
LOL
must of been while i was replacing all the spaces
still not working dammit
after rewriting it all
it works
not even gonna ask
@brittle sinew did u see my tag in general?
anyone know how to get uobjects to replicate? i assigned an actor component thats replicated to the outer but it doesnt seem to support it. i keep getting fnetguidcache::supportsobject *uobjectname NOT supported
@sweet spire yeah, but I was helping someone and had no idea
its fixed after deleted the maps but like wth man
Starting any map the first instance of that client was playing the starter content map music
lmao
is 6 int 32's too much for 1 inventory slot?
Say u have 30 slots, your gonna be sending 840's bytes for it :/
when ue4 default is limited to 10,000 a sec right
@sweet spire where did you get that number from?
hi, I posted my solution to the warning thread i created yesterday! https://forums.unrealengine.com/showthread.php?149590-Relevant-warning-on-ShooterGame&highlight=shootergame
hey guys, if I am on server, and I get all actors of class on the characters that each connected player has, doing stuff to that will replicate out to everyone, correct? since I would be adjusting the server's version of it?
If you're affecting replicated variables, yes
Otherwise you'd need to use a multicast
gotcha
what if im affecting components?
im adjusting the camera the players see thru
I'd think it's the same thing, just make sure they're replicated
is this exposed to BP?
i have an array of uobjects that, if i replicate, i get an fnetguidcahce error
google keeps pointing me back to that article
if anyone here is using photon, is it possible to test multiplayer within the editor?
(just by changing the number of players)
Does anyone know if the Event Hit runs on server by default or not in the actor blueprint
^^ Answered in #blueprint
Is there a function callback for determining when the IsLocallyControlled state changes? I know Pawns don't immediately report false in multiplayer (ie: if checked in BeginPlay) but is there a reliable time to check?
Is there some kind of bug or known issue where a blueprint full of child blueprints inserted into the level are 3x bigger larger than they should be if enabling dedicated server?
driving me absolutely mad
Hi all, does anybody know how to get world composition working in multiplayer without using a dedicated server ?
Clients are falling through tiles the server isn't seeing, even thought 'client side loading ' is ticked
@civic belfry Not sure if its been documented but ive absolutely run into that issue. Mainly with Physics Actors. Cant remember how i solved it though it was an long time ago.
Pretty ssure i literally manually set their scale back to default OnBeginPlay
Hah! Wonderful. It's the weirdest thing. I can watch it go through each child bp and scale it up one at a time until it's done with all of them. Weird bug!
Im very confused about using playerstarts
how do you assign one?
or should I make my own Playerstart class?
and is that helpful in anyway?
@slim holly There's a method to override in the Game Mode that selects player starts
It basically just selects every actor of class "PlayerStart"
and do some logic to select the correct spawn
so no actual benefit from using regular start vs manually determining the start
what kind of benefit?
if you need a different behavior from the default start spawn behavior, you could do it
you could manually spawn, but I'd recommend staying in the engine flow
speaking of manually starting
should I store player character equipment classes in playerstate or controller?
considering I need to pull that information every time I spawn a new character
Well, I'd say the only difference is that the player state is replicated to every client
I'd then think if I need every client to know other players equipament
If I remember this would be the essential difference between choosing playerstate or controller
I'd say PlayerState, since it was made to hold information about the player
hey guys, I've got a weird replication bug with my aim offset, seen here:
https://www.youtube.com/watch?v=GX35Fwgkdgo&feature=youtu.be
Anyone got any ideas?
replication bug that I can't figure out regarding my aim offset
I've got more info (anim blueprint and C++ code) if needed
other players will know about the equipment since they consist mostly of replicated actors
attached to the player
@undone crane your delta rotation math is off, not much more to it
it works server-side, but this is what the client sees when looking at the server player
server player animates just fine, and the remote player animates just fine on the server
control rotation replication issue then
so where did I go wrong?
(btw, thanks for even looking at it this much; I struck out on the IRC and my twitter contacts)
I honestly have no idea how control rotation even works
since I dont use it
but It's related to controller, which does not exist on clients
apart from their own controller
I see
so how would you do it? get the pawn's forward vector?
wait, I already do that
control rotation is where the player is aiming
you need to save the control rotation to the pawn on server end
then replicate it
and use it to drive the aim offset
makes sense, thanks so much! I'll give that a try
hey guys, i have a short lag time every once in a while when the player does something and when it gets added to my database, or changed in database. The strange thing is... its doesnt seem to be the database itself, it seems to be the actual client/server process. I left click, yet the event isnt fired for like 5 sometimes takes 30 seconds.
anyone have this b4
you might be too dependent on a replicated variable when it's something that should be done locally instead
oh, 5-30 seconds is way too long regardless
try logging it on the server and logging it on the client and see when it gets from A to B
its inconsistent though
lke
it doesnt always lag
sometimes the response time is instantanious
sometimes I get lag in the editor when I don't in a packaged project; are you testing in a packaged project?
I'm not sure then, sorry
@slim holly I'm still seeing the same problem after replicating the control rotation.
this is my updated code:
and that delta values are in correct order
and this is the relevant part of the anim BP: http://i.imgur.com/4oOUatN.png
your control rotation replication still makes sense given that the character freaks out differently depending on which way he's facing, but he still freaks out no matter what
I shouldn't have to replicate actor rotation on the server too, should I?
also, I'm not adding the deltas; I'm setting the absolute pitch and yaw...in spite of the problems I'm having right now, setting the deltas seems like it would be prone to desyncing
no it's a delta rotation between character and control rotation, which is then clamped to -90 to 90 in pitch and yaw
I just threw out my code and copied a different tutorial verbatum, translating from blueprints to C++. Hopefully that's enough to get the job done. Changing a non-networked tutorial into a networked one just became a mess.
ugh, this other tutorial has the problem I had before, where it has flawless replication, but the client is waiting for the server to respond before it updates the pitch/yaw
I'll try again after lunch
Thoughts on things like 2 floats vs a struct of 2 floats for things like Min & max damage
@slim holly Got it working. The solution is: pitch and yaw logic in the input sections of the character CPP file. Every tick, update the pitch/yaw on server. Don't update or read from the server while processing the input.
heheh ๐ I guess there was a time where we all thought like that, where multiplayer is some sort of module you can just add in to a game. I know I found that out the hard way.
xD
#define USE_GOOD_NETCODE 1
Wait I don't use C++ can I use that in BP?
lol
does level streaming work in multiplayer
@twin juniper Yes it does
@wary willow can i chop up the landscape into separate chunks
from what ive seen i havent seen it been used on landscapes
Umm
I think you'd need world composition for that?
static meshes
I haven't played around with that though
Haha
Like I said, I haven't played around with it
BUt, I think a few people on here were talking about realignment
All I know is that level streaming works
But it works for everyone as soon as anyone loads it
Unless you do a locally controlled check
Lol.
Other than that
i havent really seen it be useful on landscapes
I don't know much, I've rarely used streaming levels in MP
like
(if ever)
i dont think it would be
what i want to know
is what ARK does
i know they separate it
Yes
they use world comp I am sure
but i dont even think it makes that big of a difference
like all it does
is make the map load faster
it doesnt improve gameplay performance
from what i can tell
Hello everyone, This lesson will explain on how to work with Level Streaming. It is an important feature of creating maps and I highly suggest you use this s...
yea
ive seen that
its literally
photoshop layers
for foliage
only way i see it being useful
is basically
if you level stream certain trees
as you enter the zones
or something like that
but i dont even think it would improve performance much
@twin juniper Anyway
Best bet is to just play around with it
See what you can use it for
i feel like every single ue4 training video is 1 hour or longer because they get paid per hour
LOL
question - I'm wondering if all of my cubes/pods should be in one main BP or simply arranged in the level - there are hundreds of pods and using a main BP full of child BPs has been pretty buggy... but I also don't want to go about it in an obviously wrong way
50-100 players start out in the outer layer compartments of an 8x8x8 cube. The outer compartments will either shed off and detach/float away, or will move around like an elevator - vertically and horizontally.
After the first round, the entire outer layer of cubes will be gone, leaving a 6x6x6 cube of pods that will move and detach/destruct periodically, forcing players to find/fight their way inward to the final 4x4x4 arena at the center of the cube.
so would it be advisable to make this beast directly in the level? or to have a main BP that holds hundreds of child BPs? It's really big
When i fire a server event from a construction script on my character it makes my 2 players not connect
I fixed the issue where crap starts growing to 3x its size by disabling "Component repliactes on static meshes" for anyone keeping up
@fossil spoke - see above!!
Interesting. Ty
I realized it was something I was doing when I rebuilt the whole thing in the level, eliminating the parent BP and the same madness ensued
Its such an odd issue though. I was going to investigate the source code but i didnt have time and then i just plain forgot about it lol
So it's my first time attempting to make a Dedicated Server Build. Assuming it succeeds... what map does the server go into? Will it go into my main menu?
oh my brain
why does network smoothing work with jumping and flying, but forbid if you try to use direct velocity manipulation
also it doesn't say that OnJumped & OnLanded only run on server
@cursive iris You can define the Server map settings in your Project Settings.
Ah... cool. Does packaging the project automatically make a server executable too? or do I have to do it from VS every time?
(source build is still building from since the time I asked my first question, so I'm just waiting for the compile)
Hey so at the very start of our game, a player has to log-in and gets sent a bunch of stuff from our server (username, level, friendslist data), is it best to store this stuff in the gameinstance class or is there some sort of OnlinePlayerProfile class I should be extending?
@cursive iris You only have to build the server exe if you change any code.
Wow okay the server was spawning in an additional sword
Welp ok that problem is fixed, but my AttachToComponent isnt replicating on my client
@scenic bronze it can be stored in game mode or the player controller
@gaunt kestrel ill take a look into gamemode, thanks man ๐
https://youtu.be/-xqrlPM8Tsc I think thats kinda what you're wanting?
Tutorials brought to you by Yun from RyseUp Studios. If I'm going too fast, hit that pause button. Sorry about the silent clicks and shortcuts used. I'm doin...
Not sure if you wanted the players to save their data for next time they log in
@brittle sinew @wary willow remember the problem I had 2 days ago? the one with the client calling the server function but the server never detected that call?
it was really an owner issue. so apparently we needed to send the owner of the client to the server when we spawn the actor in the server (because we need to call a function from this actor, and this function runs on the server), so thank you for all your help! ๐
@fossil spoke so... if I have multiple maps and multiple game modes on my dedicated server... is there a way to set which one runs via command line parameters?
Sure you can. Check out the Epic documentation on commandline usage. It has all that stuff there and more useful info as well.
ah... cool. so this step where I set the default map for the server is optional as long as I know the commands
thanks!
Finally managed to build. I ran the server with the -log parameter. It can't seem to find my initial map and my game mode. Any ideas?
Ah... hmm... I seem to need to type in the whole GameMode.GameMode_C in the command prompt. :\
How does UT assign simpler names to their game modes? Don't they just use ?game=CTF or something?
I think UE4 supports prefixes for loading gamemodes
Where do I assign those prefixes?
I'm no sure, I remember reading about it somewhere
anyone know what that's called so it'll be easier to google? haha
@past pawn cool. I think that was something Lethal mentioned early on
If i Construct an UObject from class in Blueprints. It Doesn't have a Destroy() function. Is there no way to remove it after i'm done?
Example like this
or will it be automatically garbace collected?
@plain flume, it will be garbage collected
but it's look strange to create an object each time to save something to database
it will be a better design if you create an instance on your game instance and you get it and make stuff
anyone have problems with uobject references not replicating?
UObjects don't replicate, there's ya problem
@vital steeple, @chrome bay, look at ReplicateSubobject function
but yeah if it's RPC you can't from my own knowledge
Yeah the UObject needs to be replicated via an Actor I believe, it's not that easy to setup generic UObject replication
Actor Component is often the path of least resistance
yeah so i have a component on an actor that has an array of uobjects
array is replicated
if i print the array it pops an error but it does "see" that there are uobjects (the print will grow as i add more uobjects, but the printed content is just blank)
so it just looks like the references themselves dont replicate
@rare cloud problem is that for some reason i cannot create variable from it. Perhaps because it is a UObject created in C
It works, but not sure if it starts to cause issues
Maybe i can create UObject ref in beginning and cast it later
@plain flume literally every time i see people talking about databases on here
they are telling u the wrong way
setup a VM on vmware, or virtualbox
install ubuntu or debian
then install postgresql, or mariadb, or mysql
then it the database to only allow access from within your local network
then call your functions directly
to the database
why are you going through a Http request?
and put all your SQL function calls inside of Server RPCs
and put the #if WITH_SERVER_CODE macro
inside of your rpc function Implementation
so it will cull out all of the code on the client
that is the proper workflow
You heard it here folks, that's the right way
No, when you say "that is the proper workflow" you're not voicing it as your opinion
You're voicing it as fact
yeah ik
but i do genuinely believe
that is the proper workflow
but i can see if people may disagree
What if you have multiple servers on different physical machines that need to access a central database?
that's not difficult, most dbs will allow you to allow access to specific IPs
just make sure its a static ip
That's not scalable at all though, it makes it difficult to interact with new instances
i mean both using a REST service, or my method will both work
yea
u dont even have to limit the IPs though
simply putting the #if WITH_SERVER_CODE will cull out any login information
That's a really bad idea though, you can do way more robust authentication via some sort of web API than a simple user+pass in a DB
Having a public-facing DB, even with authentication, is just not a very good idea
What good is local database when im not running it in my house :S?
@plain flume you can set it up for migration
I honestly think (what i regret not doing) is that everyone should create a schema for all of the tables the db will need to generate in one file
then you can create separate version for each diff database software
like separate query syntax
i regret NOT doing this lol
in my next project im totes going to do that
Do I need to use Sessions for Multiplayer?
No, they just assist in creating matches and things along that line
You'd be fine in rolling your own matchmaking and session creation, though not sure how much I can recommend that :p
I see thanks
Another Question:
How exactly do Event Dispatchers work in Multiplayer?
If I call an Event Dispatcher, will it affect the Clients?
I don't believe they are replicated, no
If you want something to fire on all clients, multicast it on a relevant replicated actor
I see. Thanks ๐
whenever i click "generate proxy meshes" on hlod window
it just lags the shit out
and doesnt do shit
it even lags visual studio
is there anything special with the OnRep parameter that passes in the previous replicated value of a property? I'm replicating a TArray of ints to COND_OwnerOnly. And the previous value parameter is working properly sometimes but not others. If I keep getting kills/assists by the same players it works fine. In other words Player1 kills Player3. Player2 assists. Then Player1 kills Player3. Player2 assists. So forth it works.
But as soon as I do Player2 kills Player3. Player1 assists my PreviousNumMedals turns to [0,0] for both players. Instead of the actual previous replicated value.
I guess I'll dig deeper into the previous value OnRep code
Don't quote me on this, but I think if you declare the OnRep function with a single parameter of the type it gets filled with the previous parameter
Right, that's what I'm doing. But it's acting strange
yeah my description wasn't the best
UPROPERTY(Transient, ReplicatedUsing = OnRep_NumMedals)
TArray<int32> NumMedals;
UFUNCTION()
void OnRep_NumMedals(TArray<int32> PreviousNumMedals);
DOREPLIFETIME_CONDITION(AFPSPlayerState, NumMedals, COND_OwnerOnly);```
PreviousNumMedals comes over with [0,0] values sometimes when it shouldn't be
took COND_OwnerOnly out of the equation and it still does it; so not that
so in multiplayer, if i want to have the player load the map one chunk at a time using level streaming...
should i set the visibility to off for all layer levels by default
then let the client load them?
i just worry what that would mean for the server
I think level streamimg is always to loaded to everybody, no matter who activate it
The Values of (Actor) Arrays are replicated when I set the Array to replicated, right?
I guess I'll write my own shadow logic for this onrep stuff because the ootb is at least bugged for arrays
So i have this code in my Character
'''UFUNCTION(reliable, server, WithValidation)
void UseItem();'''
and it basically spawns a particle effect when near a particular item. However, it's only spawning on the actual server itself and not being replicated to the clients. Here is more code implementation.
Sorry here's the code
UFUNCTION(reliable, server, WithValidation)
void UseItem();
void AShooterCharacter::UseItem_Implementation()
{
if (Role < ROLE_Authority)
{
return;
}
UE_LOG(LogOnline, Warning, TEXT("Calling on server!"));
/***Code removed that grabs the overlapping actors in a loop ***//
AHiddenFire* const TestPickup = Cast<AHiddenFire>(CollectedActors[iCollected]);
// If the cast is successful and the pickup is valid and active
if (TestPickup && !TestPickup->isActive)
{
UE_LOG(LogOnline, Warning, TEXT("STARTED PICKUP!!"));
// Deactivate the pickup
TestPickup->isActive = true;
TestPickup->UseTheItem();
}
}
void AHiddenFire::UseTheItem()
{
UGameplayStatics::SpawnEmitterAtLocation(this, FireSpawnFX, GetActorLocation(), GetActorRotation());
}
}```
i thought spawning a particle effect on the server would work on the clients?
Question about proper server - client replication methods: what is the best way for me to handle personal variables such as thirst, hunger, stamina, etc.? Right now, those are all handled within my player character, but I'm having a tough time figuring out how to separate them between the server character and the client character.
@buoyant hollow you have to use a multicast RPC for the other clients to see it. Otherwise only the server will know about it.
@frank tinsel it depends- do other clients need to know about these values? If not but they are gameplay important, then simply replicate them and make changes to their values using RPCs or with authority guarded logic.
So @inner iris I did try that. I set the UseItem to Netmulticast and then removed the if (Role < ROLE_Authority) code from the UseItem_Implementation and it worked on just the client that called it.
if I left the if (Role < ROLE_Authority) in there, it was never called at all
and spawned on no clients
@inner iris Well, the clients shouldn't need to know about the values unless I decide to show player health? Other than that, I do have a slowdown attached to the stamina if they deplete their stamina fully. That should be okay for replication, yes?
@buoyant hollow Sorry I'm not very familiar with C++ but try a more isolated example such as pressing a key and spawning the particles- it's seems you have other logic here that makes it harder to pinpoint- if it works with the barebones example then add the other logic after. Maybe someone else with C++ knowledge can help you out but the first example looked like it was only running on server and not being replicated to the other clients as intended.
Thanks @inner iris
@frank tinsel The clients would generally only need to know the health of the player perhaps after the player kills them, so they could tell how much damage they dealt but they wouldn't need to know it most of the time (unless you have a specific health UI widget over each player or something). as for the slowdown, if it's purely changing player speed then all you have to do is set the new walk speed on the server and it'll work as intended as the character movement component is replicated.
@inner iris awesome! Thank you
@jolly siren you're probably running into an issue I've discovered recently
TArray size is replicated separately from it's elements - so sometimes the OnRep will trigger because the size has updated, but the elements haven't come through yet.
I've had this problem with replicated arrays containing pointers to replicated objects.
if the array comes through first, the OnRep fires and some array items might be nullptr
No easy way around it I've found other than to just guard against it
late reply ftw
@buoyant hollow when you tried making the RPC multicast, were you calling it from the server or client?
Multicast RPCs should only be called from the server...if you call it from a client you get the functionality you described: it only runs locally on that client
This section along with the tables below is a quick overview of ownership with relation to RPCs: https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/RPCs/#requirementsandcaveats
Designating function replication across the network
I'm pretty new to UE4, so I'm sure I'm missing something obvious... But I seem to be running into an issue where characters placed into the world via dragging from the asset tab appear to hover on clients.
This is just the 3rd person starter, and I've dragged an extra player into the air above that point. On the server, it falls to the ground correctly, however other clients see it fall but stop short of the ground.
So I started doing Multiplayer today, I kinda get it on a basic level.. I can't find all info though. If I make a Function Execute on Server, does that mean the Variables in that Function are covered? (In the case that I don't reuse them anywhere else)
Do you mean the parameters fed into that function?
Yes
Well, it depends on what you mean by "covered" really
You can pass replicated objects as a parameter and it will resolve itself on the other side fine, yes
I've replicated all functions that affects suspension and gravity etc inside my BP but when I try playing with a dedicated server i still have jitter, a very small jitter, but it needs to go
Well, you may have to implement some sort of network smoothing, yeah. Especially if you're both replicating movement and doing stuff locally
If you have two movements fighting like that, things might get jittery ๐
I understand, it's really hard in the start to decide what needs replicating and what not. Right now I get by because of logic alone heh
Right now I'm trying to figure out what the best way to test the Multiplayer would be, without having a second computer that is. Also if it might be better to dive into cpp Replication instead of continuing BP, since I will do such a Transition sooner or later ๐
how would one go about doing dynamic jumpZ force ๐ค
Im running into jittering issue because the force value is different in server and client
soo for some reason
in multiplayer my map just takes so long to load
that the server just times you out
LOL
@chrome bay I'm calling AddZeroed on the array in the constructor tho and not changing the size anytime after that. But that is good to know for sure.
im having trouble with my GameServer.Target.cs file I can't get it to build a dedicated server build
I can't figure out why Visual Studio won't build the dedicated server
I keep getting the error "'UnrealBuildTool.UnrealBuildTool' does not contain a definition for 'GetAllServerPlatforms'"
I think important thing is to let as much as stuff run in client computer as possible so server isnt hanfling too much traffic. Critical variables and events are handled in server ofc.
No point to let server handle stuff for "just in case"
typically Game State is good for spawn?
I get my GameMode to Spawn Players, its Server side only so there is no risk of it accidentally happening on the Client for whatever reason.
so on death via the PC, you just call GameMode::SpawnPlayer(AMyPlayerCharacter) or something like that?
Basically. The reason why an SpawnPlayer is being called depends on the gametype. But yes essentially.
that makes sense to me
SpawnPlayer handles creating the new Character Actor as well as destroying the old possessed pawn should it still exist
Is GameMode just automatically on the server? I'm guessing I'd do a netmulti on the character respawn?
Yes GameMode only exists on the Server.
My GameState on the Server gets an Delegate called on it for OnPlayerKilled. This Delegate is multicast to everyone so that anything can subscribe to it and recieve that event regardless of network authority.
ok cool.
When you respawn the player you only call it on the server as the server would create the new actor and cause the pc to possess it. This would be automatically replicated to clients
possess is automatically replicated?
If called on the server yes.
oh naturally.
I'm at the point of diminishing returns for UE, so I might get some sleep
Any idea why this wouldn't work ?
OnDestroyed.AddDynamic(this, &ACastleKeepersCharacter::OnPlayerDestroyed);
UFunction()
void OnPlayerDestroyed();
Error C2664 'void TBaseDynamicMulticastDelegate<FWeakObjectPtr,void,AActor *>::__Internal_AddDynamic<ACastleKeepersCharacter>(UserClass *,void (__cdecl ACastleKeepersCharacter::* )(AActor *),FName)': cannot convert argument 2 from 'void (__cdecl ACastleKeepersCharacter::* )(void)' to 'void (__cdecl ACastleKeepersCharacter::* )(AActor *)'
hmm maybe I can't pass 'this'
@glad sedge,
UFUNCTION()
void OnPlayerDestroyed(AActor* DestroyedActor);
Where'd you find that? I'm checking out the docs and I couldn't find that?
also er.. thanks heh
@glad sedge, look at the Delegate signature declaration
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FActorDestroyedSignature, AActor*, DestroyedActor );
/** Event triggered when the actor is destroyed. */
UPROPERTY(BlueprintAssignable, Category="Game")
FActorDestroyedSignature OnDestroyed;
ah they're at the top.
If I want a PC to know when its pawn has been destroyed, would I use a broadcast delegate?
That could work, sure
The engine uses an odd blend of delegates and plain old events that get called...I wouldn't really say one is inherently better than another if you're only trying to alert one object
what's the right way to approach it?
Why does it react like this: Start multiplayer test= Everything is shaking. I Replicate 2 variables and it stops shaking, then i take away the replication and test playing again and it doesn't shake still.
Anyone possibly know how that is? Makes it real hard for me to understand it.
Either could work; a delegate allows more expansion in the future since multiple things can bind to it, but the binding is your extra step
Yeah, shaking like the physics ain't duplicating right ๐
@lilac lotus Wild guess, but I think the shaking you're seeing is the server's interpretation of what you're sending through. Maybe when you replicate you're replicating those values to your client
The client is then updating the values of the server every x ticks?
@brittle sinew Thanks, I'll give that a shot.
That may be the case, I'm new with this so I take one step at a time to learn it. Would that mean that it didn't stop shaking because I replicated the variables but because the server only interpret it better?
not exactly
I tried take away and add the replication, after the first time i replicated them it never shaked again, that's what got me dizzy
So when you're trying multiplayer, you're loading up 2+ people?
Are you using dedicated or just a listener-client?
Yeah, I'm doing dedicated server and 2 clients
Currently I'm trying to replicate simple movement, using 2 pawn class vehicles (Using force to move them)
The 2 variables that made the shaking go away was "Current Steering Axis" and "Current Throttle Axis"
And you enabled "replicate" on them both ?
Yes, they are from the same Master Class so it's 2 identical vehicles
At first I thought the replication didn't work because I only had the inputs replicated (i wanna see what reactions i get everytime i add something replicated), since I have created my own movement my 2 most important movement variables was the 2 stated above so I figured replicating them next would make the 2 Clients receive better information about the Vehicle's movement direction and speeds, which they did,
Problem was that I then wanted to undo the replication to see if it truly were those two that solved it but there were no difference between before and after replicating them. (I hope this makes sense)
I had the same reaction when I tried my gravity direction ability in replication, first it didn't work then i replicated 2 other variables , direction and rotation, and it worked. Removing the replication didn't change anything back though
I came to a conclusion that I had no idea what so ever why it worked that way
Well replication is about communicating to the clients what the server has done.
Also it sounds like you're potentially testing this from the server? Can you confirm you're not?
Yeah, positive that I'm doing dedicated server and 2 clients ๐
it might be like a time lag or something, if i wait for an hour or something after after removing the replication the shaking sometimes reappears
Yeah, I'm just going to keep at it until I understand it. That always works sooner or later lol
Time, coffee and Google. That's all you need.
Couldn't have said it better myself๐
dang
ProcesRemoteFunction: No owning connection for actor CastleKeepersGameState_0. Function Server_RespawnPlayer will not be processed.
Might have to run stuff via GameMode
If you're trying to use server RPCs, the GameMode will be even less help ๐
It doesn't exist on clients
Designating function replication across the network
Here's what you're running into, server RPCs can only be called on owned objects
I don't believe so?
Your client really shouldn't be the one asking your server to do a respawn anyways :p
That logic should be on the server for the most part
Well you can still call things onto the GameMode/GameState, that's fine
You just have to call it from the server version of your object
uugh I can't call GameState from Server
What do you mean by that?
You shouldn't have any trouble getting the GameState, unless you mean calling to the server
under my function inside my PC
so my RPC call inside my PC won't call UWorld World etc.
I still don't quite understand what you mean by that
If you're doing it on BeginPlay that's too early
I'm doing it well after.
Okay, so is it returning a nullptr?
not 100% sure as the VAX isn't referencing the header files.
Ohhh, so it's a compile issue?
UWorld::GetGameState is the function you're looking for
I'm guessing it's because UWorld is only relevant to the client?
No?
Could you describe what your actual issue is at this point?
I'm not quite understanding
Ah.. gimmie a sec,
You can get gameState no matter if you are client or server
yeah this is weird.
oh ffs
this is why you don't code for 15 hours straight
ok I'm done.
cheers guys
I mean, if you give code or an error we might be able to help :p
@brittle sinew or the specific use case
@glad sedge
how can players communicate between each other in multiplayer mode?
GameState
To be more precise: How the way you want. Just make sure everyone communicats through an actor that is replicated to everyone
I just named GameState because it is already replicated to everyone
GamState = There is one GameState in level that is replicated to everyone. Could be usefull to keep track of some specific value that is common to every player. PlayerState = Replicated to everyone, but every player has their own PlayerState. Usefull to keep track specific value to specific Player. Like Player Name, Player personal Score etc
i feel like
i wonder if my cpu being a 3rd generation i5 is whats cuasing lag in my game thread, or if its just poorly optimized
step one bDoom with an i5, accepting your death
@brittle sinew ha, no I meant I sorted it out. I didn't notice I had a bracket out of place. Really rookie stuff.
Hello Guys, I'm trying to read some info from a client GameInstant in my DedicatedServer GameMode but I can't, this is my workflow:
After join to map using Open [ip] i call a function in PostLogin in dedicated server game mode to update some info from the new player controller :
void AMyGameMode::PostLogin(APlayerController* NewPlayer)
{
Super::PostLogin(NewPlayer);
AMy_PlayerController* PC = Cast<AMy_PlayerController>(NewPlayer);
if (PC){
PC->UpdateUserInformation();
UE_LOG(LogTemp, Warning, TEXT("GameMode info : Field -1 %s Field -2 %s"), *PC->Field_1, *PC->Field_2,);
}
}
and in my controller player header that function is :
UFUNCTION(Reliable, Client)
void UpdateUserInformation();
void UpdateUserInformation_Implementation();
UPROPERTY(replicated)
FString Field_1;
UPROPERTY(replicated)
FString Field_2;
in c++ :
void ANYX_PlayerController::UpdateUserInformation_Implementation()
{
UMy_GameInstance* GI = Cast<UMy_GameInstance>(GetGameInstance());
if (GI)
{
FMyInformation TempInfo = GI->GetUserInformation();
UE_LOG(LogTemp, Warning, TEXT("UpdateUserInformation PlayerController : Field -1 %s Field -2 %s"), *TempInfo.Field_1, *TempInfo.Field_2,);
Field_1 = TempInfo.Field_1;
Field_2= TempInfo.Field_2;
}
}
void AMy_PlayerController::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ANYX_PlayerController, Field_1);
DOREPLIFETIME(ANYX_PlayerController, Field_2);
}
I've the data in Player Contorller log but i don't have data in GameMode Log, how i can fix this problem?
Triple ticks :p
Makes it a lot more readable
Also, you can't set replicated variables on the client
(and even if you could, in this scenario it would do nothing. The GameMode call doesn't synchronously wait for the RPC to reach the client after the call)
so i should ask the server to change set variables ?
Yep, and just use the data within that server RPC right then
ok thanks i'll test now
There is probably a very obvious solution to this, but I'm just to dumb to see it so I'm asking here..
https://gyazo.com/b4de821a5d0ca36e4de084e19c6ea77b
How would I go about to Replicate this function?
I've tried replicating scene list variable and steer angle. I also added a Variable at the end between makeRot and SetRot and made it replicated.
I also tried making a customEvent Node in EventGraph and replicated that, to no avail.
All other variables I have related to Steering have been replicated for test.
I really don't understand it. Also wanted to add this is a function that rotates the wheels (Just the visual).
offtopic, but why not use GetSteering as alpha for the lerp?
otherwise, for the replication you could drive it using OnRep of the steering angle variable to update the visuals
so technically every client does the wheel visual tranformation on their own when they receive the data
Hey, was grabbing some coffee quick.
I'm not actually the one that did this specific function, all I know is it works perfectly when I'm not in multiplayer at the moment
So I actually didn't think about the onRep, sounds very logical when I think about it, I'm going to give it a shot!
Hi! Have someone seen how can client connect to dedicated server which was launched in PIE through lan? I'm passing ip of computer which launches this dedicated server and they got handshaked (I see it in my log), but than client gets reconnected with error - Cannot load map
But map that it cant load is the lobby map which is already loaded but not the map that is launched on dedicated server
Nice idea, will try now
Doesnt work eather
Standalone dedicated works well. But not from editor. The thing is - pie dedicated gots discovered and tries to connect but I get some wierd error. So I'm assuming that this whole setup is possible but I'm doing something wrong
is it default start map?
I need this because I got tired of rebilding dedicated server every time and my whole team is in one lan
No its not
I have lobby map and default map
so all good until joining lobby
I have hardcoded ip for dedicated, lobby is just a gui for selecting dedicated server by ip
For connecting I'm using ClientTravel in PlayerController
Versions are equal
in a dedi server
is the game instance class shared
between all clients
or does each client have their own
@twin juniper each client have their own. The server also has one.
@tiny coyote Have you tried building the dedicated and seeing if it's the same problem?
@dapper galleon how do u know that xd
so if i store a variable on my game instance
then i load into a server
will i still have that variable locally?
AFAIK the game instance is like a local backpack hehe
I figured this out by doing some research
So the answer would be yes, since it is local and kept between levels
is it normal for playerstate to take a little bit before you can access it? like a second or so?
this is in PIE and running one client as well as dedicated
yea
ok so we just need to test script with that in mind
That usually gives lot of headache!
APawn::OnRep_PlayerState if you're in C++
If not, you kinda just have to work around it
Has anyone messed with int32 GetPortFromNetDriver(FName InstanceName) to retrieve the listen port?
It is failing when It tries to get the world as in:
/** @return the world associated with a named online subsystem instance /
ONLINESUBSYSTEMUTILS_API UWorld GetWorldForOnline(FName InstanceName);
What would be the associated world for an online subsystem instance?
Any idea why the "IsValid" node isn't working sometimes? I am checking that if the LeadingCharacter variable valid and if it is, then code should run. In some situations, the function still gives errors like: PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property LeadingCharacter from function: 'ExecuteUbergraph_BP_EndPost' from node: Branch in graph: EventGraph in object: BP_EndPost with description: Accessed None trying to read property LeadingCharacter
Maybe because it's null ?
hmm. should't the IsValid check for nulls
Hmmm.. that's for an AI?
Could you show your BP of where this is occurring (EndPost)? Usually IsValid should be fine...there are certain edge cases where it's not completely safe but for the most part it's fine
Like this
Strange
Hmm. Might be something to do with server-client sync
Anyone have experience with the replay system? When I call DemoRec on the client it isn't recording my particles and sounds. I have HasAuthority() checks around both of those so the server isn't bothered with uneeded stuff. It looks like it is recording the dedicated servers world.
@rough iron maybe you have used it^ ?
I used it in UE3 xD there you had to hand tweak every think you wanted to get recorded, you might be missing something.
How can I add code to only appear on the dedicated server and show in that console?
@timid pendant is dedicated server
Only run on server ?
@timid pendant You could use the preprocessor macro to compile it out of non server builds.
I will be using if (isRunningDedicatedServer())
Anyone wanna help me and point out my misstake? I can't find it, been trying to debug and understand this for the last hours..
The Rotation works fine, it's not replicating though, so I'm the only one that can see it. (This is all under a function that is called by Tick)
Anyone think it looks like it Should work?
If you where on a super tight bandwidth & cpu budget, what are the thoughts on using components for inventories / equipment when it comes too replication, or should you strictly keep it too arrays using index's to data tables
Yeah, looks like it http://i.imgur.com/zjOUNkH.png
@lilac lotus Did you figure out your issue?
@wary willow I wish, I dropped it for a few hours, went on to the next BP. If you have a suggestion or just a clue what might be wrong I would greatly appreciate it though
its under tick right? the replication itself?
could the clients version of tick be overriding the notify?
I'm not sure, still learning all this multiplayer replication thing. I need to keep it under Tick though, since it's only a visual function it needs to be constantly updated to look like its the actual thing so to speak.
This is in a Master BP though, the I'm doing the Tick event on a child BP
tick is both server & client tho
i think you need to separate whats going on in the tick event, with some authority/remote nodes
since its ran on all machines
@lilac lotus So
The issue is, that you probably aren't calling that reponotify on server
https://gyazo.com/12bd8fddacab4aac5d9045c87d9dcf7e
This is the strings from my tick event (Yellow is for non replicated and Teal is for replicated), the position and movement spin of the wheels worked flawlessly by themself when I started doing it into multiplayer, the steering not so much, hence why im trying to figure it out ๐
thats all connected to tick?
if so then for sure the client and server are fighting each other in variable accuracy then
you know what i mean though? for that object it is tick's at the same time the version on the server does
so when the server replicates steering? the client is already setting steering on its own, completely ignoring wats going on because its happening at the same time!
Well, the real steering is not actually done under Tick, that's a separate function ^^
This is just the Visual rotation of the wheels
@wary willow When I put the variable in its own tick string i can't even see my own steering anymore. Tried it earlier and Im sure that has something to do with it
@twin juniper there must be some fundamental understanding of replication I have missed. Only reason I can think of to why it wouldn't work
@lilac lotus Okay
So, like I said before
It's not getting called on server
Also
That Switch Has Authority is limiting
who is actually seeing what
You are only allowing client to see it
Not the server
So if you're debuggin with only two players, that is why it's not looking like it's replicating
Remove the SwitchHasAuthority and everyone can see it
Yeah It's removed, let me check if this works
So, I removed it and unfortunately it's still the same results. (Im testing with dedicated server and 2players atm)
I'm trying out a few logical solutions atm in hope that one of them might be the correct one
doesn't matter
My logic works with dedicated server
Just tested
So your logic flow is just off
Yeah, I'm not to suprised since I'm still learning all this about replicating. Your examples are a lot easier to understand than some other stuff I've seen on the web regarding all this today.
The multicast - OnServer - OnRep and all other fancy things out will take a while to grasp
Victor learnt from the best ๐ haha
rahahahah
We all need a Senpai from time to time hehe
We all have our masters ๐
Indeed, my current one is named "Stephen R. Davis", c++ for dummies ๐
Haha
@twin juniper ah
Can you be a bit more specific?
I mean, technically, any function you'd want?
But are you talking about overwriteable ones?
In @cedric's document
he says u cant call RPCs on BeginPlay safely
but i need to initialize some stuff
on the player controller
before they possess somethinfg
@twin juniper so, on post login, call the function you want to happen?
can't
The data I need is on the client
so i need the client to pass it to the server
what info?
so, why can't you wait until after PostLogin?
so
the reason is
PostLogin() creates a DefaultPawn
but i want to use my unique id to possess a pawn thats already spawned in
however, i need to get this id from the client, pass it to the server for possession
You see the issue? xD
PostLogin() you can't call RPCs
what else?
Why not just wait a bit and then possess your new pawn?
Just because you spawn with an default pawn doesnt mean you need to use it
@twin juniper Use the playerstate
@fossil spoke Yeah but it dfeels like just a workaround, because i would have to delete that other pawn otherwise u have a character just spawned in at 0,0,0 randomly
@wary willow isn't playerstate cleared when you ClientTravel()
CopyProperties
Set the DefaultPawn to None. Pretty sure that makes sure it doesnt spawn any default pawn.
it will keep it with the player, or should...
PlayerController->PlayerState->CopyProperties(NewPlayerState);
ยฏ_(ใ)_/ยฏ
I'm still a newbie when it comes to Replication in C++
Thoughts on how to handle things like attributes for HUD's? since u cant setup on rep event for them as far as i know
id rather not pull the data every tick
when it could be bound too event on attribute change
or something
I poll for HUD data personally. Widgets tick anyway, so it doesn't cost much
And you never want the HUD to be "wrong"
reading a float or any variable should always be fast anyway
if you have to do something crazy to read some big data then even then you should just read variables set by some larger function during an event
@rough iron do I have to play all particles / sfx on server just to get them to record?
actually my attack animations aren't being recorded either
@dry cloud I noticed you have have gotten demorec working with particles and things. did you have to do anything special for that?
@jolly siren it might be yes, I used listen servers for it so I had all the effects already
but on a dedicated one it would be hard to do so
could you record it on a spectator?
I'm calling demorec from the client which I thought would work but it is recording what the server sees I guess
so I'm not sure a spectator would be any different
I thought this card meant that it was going to record what the client sees
The ability for the client to record replays. The client should be able to record replays while connected to a game server for example.
68
February
If not, I'm not sure what the point of the card was. We could have always done a server rpc to call demorec on the server
it would be nice if it connected as a new client from the server and recorded what a client sees but saved to the server
Hey guys! How is it possible, that variable simply stops to replicate? I enable myBool for like 0.2 sec, but it successfully replicates and calls OnRep. But at some point this bool just stops to replicate..
Anyone could help out with an urgent issue please? I need to find the part in the source which checks for client versions before connecting players. Any idea where I could find this? I found the error message part itself, but that doesn't help much :/
Is this normal, or is there something wrong? I have an Actor that will run a Delegate when person walks past it. It only runs in server and in the end, it will Multicast to function that will find the player that is most right of the Self. For some reason the overlapping character shows differently with different clients. Client 1 thinks it is a Character1 and Client2 thinks it is a Character. Any idea why?
Where do I start a Melee Combat in regards of animation?
Characters are planned to have a "civil mode" and a "combat mode".
Combat Mode gets activated when enemies are nearby and should automatically draw weapons via a AnimMontage.
When I call playAnimMontage, is it replicated?
Wasn't someone working on the multiplayer replay wiki still?
I found it here https://wiki.unrealengine.com/Replay_System_Tutorial
if that's what you mean
it doesn't really go over if they are recording on server or client
Yeah. That's the one..
Does anyone know what are the UniqueId and UniqueNetId and how do I set them in a custom online subsystem?
How do you guys handle dealing with player state taking a while to get established? i keep putting delays in here and there but that seems REALLY sloppy. is it just somethign you live with? do you make the players "sit out" for the first few seconds in a load screen and let everythign get established?
like is there a way to detect when a playerstate is setup? it seems to take 3-5 seconds in PIE
That's pretty good network compensation.
to be able to detect that unfair death and reset you.
hello hello
I got a quesion on making a single player game with a team of 3 into a multiplayer game
here's the thing... something similar to Dragon Age: I got a single player game and I'm thinking of putting everything into the playercontroller for functionality and having a push button to allow player 1 switch to team members 2-3
the team members will hold everything for that specific character such as skills, animations, whatever
is this a logical way of doing things?
then when a new player wants to drop in they hit button and it checks to see if there is a open team member and inserts them into the character control like if they were the first person just switching
it possesses, and AI stops running
How to go about that? is it a create player thing? or would it be better to always have the player created and just when a button push its possess / unpossess
the 2nd player would just be on hold if not possessed?
and of course... all for 3rd player too
@faint python player controllers don't exist everywhere
so if you want to let other players know that other players are on the team
etc
then put it in the playerstate
which is on server and all clients.
player controller is on server and only the owning client.
the player controller holds a playerstate just fyi