#multiplayer
1 messages ยท Page 390 of 1
if you are the host, you can see each players equipped weapon, but each client doesnt see any equipped weapons on any players including their own
even when the listenserver sees thenm
them*
Alright, that's the expected behavior. So what you need to do now is move that code into a Multicast RPC
Called from the server RPC, that is
Yep
something went wrong again @sharp pagoda lol
client gets sent to a weird camera angle almost as if the pawn was destroyed
That's odd behavior, I'll take a look at it when I have the time
no problem thank you for all your help
@sharp spire ah yea. That bit me in the ass too
While im at it, let me give yall another PSA
Both times they told me to make a (private, no one will see it, so its useless for others with the same issue) report via their new tracking system
@glacial pollen do you know why the last tidbit i posted causes clients to lose its pawn?
skeletal mesh is replicated right?
topdowncharacter and both mesh and socket component are replicated
I would turn this on:
May not help with this, but its beautiful
It auto breakpoints anytime there is a null ref
Hey not everyone has the authority to change another players mesh?
You should just change the mesh for that character on the server copy
component replication for that mesh should automatically send it to the players
this was my setup before and it didnt work https://gyazo.com/0a3cb38fcc2a04963ed4b49fce00fa96
You have to make sure that whoever calls that function actually has authority over that object
or the server will say f u, and ignore it
unless you have clients changing other peoples characters
its being ran from the controller, using getControlledPawn and breaking down the itemStruct for the mesh
getControlledPawn is the Pawn pin being sent in, and New Mesh is the itemStruct Mesh
is the new mesh replicated?
You may have to re-set replication on that component after changing the mesh?
well you are sending a reference from a local controller that the server is not aware of
Are you storing that structure on the server side controller?
Cause then you could just replicate the structure and reference it locally
And then the server will be like, Ah yea, I got that right here
so going with that theory, the Struct is actually part of an Array attached to the player controller again lol
but the pawn holds the Socketed Skeletal Mesh. should i consider moving my equip event to PlayerState?
Which side does the Struct reside? Server side/ Local Side?
Like does the Server create the struct for you, or are you creating it locally?
PlayerControllers have "two sides"
But server is authoritive, so you can't send data backwards on a replicated variable, without explicitly sending and setting it server side
For example, if I have float_test = 0, in my playercontroller, and I change it to 20 LOCALLY, and then try to reference float_test, in a server side controller's function, it will see 0
You have to send 20, to the server, and tell the server to set float_test = 20; before you can reference the updated variable
Or people would just be able to cheat all day long
People can still hijack the RPC call and put whatever value they want in there, but there you just run sanity checks
okay i think i understand
so any variables being sent to the server from a controller need to be replicated first otherwise itll grab the local number instead?
kind of
variables that are replicated : when changed on server, server will tell owning client automatically
so for example my equip function sets the array element(0) to be the struct, then sends that element to be a replicated component. but techincally its not working because the server sees the equipment array(0) as nothing still?
However, if you modify a replicated variable LOCALLY, the server will not see it
sorry that was a terrible explaination on my end lol. yes im modifying my array locally and not on the server so the server still sees a blank array, right?
even if im sending my local changes to the server to replicate, its blocking it for obvious cheating reasons?
hard values as in not replicated?
Like I can send character CLASS "Char_Base"
but I could NOT send character REFERENCE "Char_Base"
Because the server does not have THAT reference you have
Hard values, as in anything that is NOT an object
int/float/string
class/name
im not actually creating any references before the RPC :\
Whenever you reference ANYTHING during a server function, it will only see the server version
ooh during..
(if it even exist)
y7ea
if you want the server to "see" it, you needs to "send" it
so my issue is using the controller pin to reference my top down character; it isnt going to work
the controller pin is valid because the server always has a copy
the mesh however
im referencing it durintg the server call from a controller pin
unless the server knows what mesh reference...
I'm still wrapping my head around it
ALSO, MAPs and SETs do not replicate, even in a struct ect
If you use em, split em up, and send them in pieces and reconstruct on the other side
what if im splitting them up, then sending a piece i need from it. that would work wouldnt it ?
ill send my whole function one sec
You are not using MAPs or SETs that I can tell, I was just giving you a heads up
so i need to promote item to a replicated variable and break that down instead?\
And here the local controller is REFERENCING a local copy of a struct, that is referencing a mesh
Just make the struct replicated, but you need to create the struct on the server
so where i set the array element, it should be set on the server instead?
yes
whatever you put into that array needs to exists on the server side, and then you put it into a server side array (all replicated of course, so the client knows whats going on)
And since you are using multicast, you might want to look into using RepNotify instead of regular replication
right so when the equipment array gets changed by the server, itll change the skeletal mesh aswell?
i was curious how that worked, is the repnotify's function automatically replicated?
or ran through the server* i should say
if someone is too far away to be bothered by whatever change happened (say a chest was opened on the other side of the map) the player wont know until he gets close enough, but regular replication would skip him (too far away)
repnotify will wait till he gets closer, and then tell him "oh btw this was already opened, let me show the open_chesh_mesh so you don't think its closed"
When your replicated array gets changed on the server, it will tell the client, and when the client says "hey server, get this mesh reference from your array and change my mesh to that"
hmmm....
the server will look at its local copy, find the reference, and pull the local copy of that mesh, and set it
sounds so much more simple than i arranged it to be
Just keep the mindset that everything you want to do, usually is actually done by the server
ill change that in just a moment and give it a go, thank you for sheding so much light on the topic. so to answer my question directly, RepNotify will run the function to all clients when theyre within range?
yes
and a noob question, what decides when theyre within "range"
is there a cull distance?
its hardcoded in the engine I believe?
NetCullDistanceSquared under replication
replication is a one way street, just think of that too
there is also AActor::IsNetRelevantFor() and APawn::IsNetRelevantFor() overrides it
default is 15000 UU for distance based relevancy
This 2 minute video will give you an overall understanding of everything discussed just now
Very handy! So I assume that a rep notify gets called from a server event?
So that the client and server see the changes?
if you change the replicated variable locally, repnotify function only runs locally
if you change it server, then both server and client run the function
replication is one-way only
i think i understand, i stepped out but just stepped back in ill try it out now
already lost.. how do i know which value was changed during the repnotify?
๐
considering its an array
or at that point would i just run through each piece of equipment array and set all the meshes
doesnt seem to be working out well :\ can i cast and promote to replicated variable for my pawn before hand and use that in my repnotify?
Show me where you create the array
idk how to handle that
gyazo isnt working... lol hold on. The array is created in the pc, and the SkeletalMesh is in the pawn
should they both exist in the same class?
The array is created in the pc (as server)
to save hassle?
yes
is that what the replicated toggle technically means? created in the server?
The skelatalMesh is spawned on the pc (server)
Replicated just means Server will send updated info to client
(automatically)
replication will not work, if its not created on the server
Server is boss
during a RepNofity, how does it keep track of the PC that called it?
automatically
how do i reference it then :\
???????????????????????????????????????????????????????????
Wait
okay i think i need to move my equipment array to my pawn
that would remove a lot of unnecccessary referencing
Lets try this
alright ๐ฎ
Imagine a Dedicated server, with 1 client
The dedicated server will not OWN its own PC, because its not a player right?
right
But, the server will own a COPY of client 1's PC
And Client 1 will have its own
So there are 2 controllers in the multiverse, but they actually both reference just 1 controller
If the client wants to talk to the server, it uses its copy of the PC to "bridge" to the servers copy of the PC
so the Replication toggle is the automatic bridge?
not yet
sorry
with this bridge, only "hard" data can be shared
Like numbers/letters/ types of classes
but you can't share an object... or ... an "idea"
If you want to do that
the server HAS to create it
Because replication is a special "add-on" bridge, but, its a ONE way street
That goes from the Server TO the client
This is the only way to share objects or "ideas"
So
Make the server make the array, AND any object reference "idea"
So the server can Replicate that "idea" to the client
So when the client says I want to change my mesh to a REFERENCE (an idea, object)
the server knows what he is talking about, because the server told him about that idea in the first place
hmm
It takes time and fooling around to get the concept stuck in your head
Imaging the client is a student, and the server is the teacher
the studen can't talk to the teacher about something he hasn't even learned about
okay so, since my pawn is set to replicate its class, and the component is set to replicate, then the server already has a reference to these objects right?
Yes, hopefully you spawned the character in gamemode, and told the client to posses it
i did yes
great
Now, when you want to change your mesh, to your pawn, the server will know what you are talking about, (but it still doesn't know what you want to change it TO)
the gamemode switches when you join a session with the pawn as the only difference in gamemodes; thats alright right?
This is where the array comes from
As long as the gamemode thats in the current map, has all the logic for spawning the array and data inside
sorry i know that was off topic
alright cool thank you lol
alright so when i want to change a skeletal mesh in my pawn the server knows what mesh it is but isnt sure of what its changing to?
yes
because it did not create the array, and it did not create the items in the array
to the server the array is blank
okay so since its replicated the server and client both have a copy, and calling an event to the server to change the equipmentArray will let the server know of my new "idea"
right?
(its VALID and not null, because you "preprogrammed" the knowledge of the array by creating the array variable in the PC
the server needs to know ALL the ideas you may have
the struct is in the array which is replicated and changed through the server, that gets it ALL right?
The server teaches the client what ideas (references) its allowed to talk about
sorry if im ahead of myself
Yes, only the server should add or remove or change anything in this replicated array
because changing it on the client would cause the server to think its cheating, right?
in a way yes
clients are submissive
A client can mess around in its own playground, but it better not try to show the server the new sandcastle it made, cause the server doesn't know what a sandcastle is
so by changing this replicated array in my PC, simply using getControlledPawn() and casting would work? or is casting not ok in server events
Now, if the server was like "Hey look, this is what a sandcastle looks like" and the client took it and played with it, and then showed off to the server, all is cool
You can change the replicated array in PC, but you must be running as the server
right right, so a server event that changes the array, causes a repnotify which then can use a cast from there without any issues?
casting from controlledpawn
because the server should know of its pawn right?
since its replicated?
sorry, the server should know of its pc's controlled pawn
right?
yes
Once you set the array on the server, the client becomes aware of this new toy and can play with it
That part is fine
aw jeez man
where is the rest of it?
starting small I see.
Starting small?
I mean you're over here explaining RPCs and var rep, and he's got all this.
I wish I could pin the last hour of messages, would make for a good session
well if equipment array is set to repnotify, would the repfunction take care of the rest? is that what you mean by the rest?
sorry lol
Yea, I just wanted to see where you actually create the item
im veryt new @severe widget i wouldnt understand what i have written down if it werent for him lol
and others aswell, everyone has slowly led me to this point
Yeah, all good.
i know you've definitely helped me aswell
meh, not sure what you mean by the deep end but i wont give up
Out of most of the help I've given this guys has always stuck through till he got it
So this runs when you change something inside of that array right?
okay, how is the array initially populated?
Is it preset in the defaults, or runtime?
Show me where you add stuff to the array
ah
ill post it if you want.. lol
yup
Here in a second, im about to take you to hell and back, so multicasting will work in this case
its in the actor defaults, then a struct in there
ah
you can see it broken down in my onrep function
@sharp spire if having a copy of the old value of the array will help you you could TRY making your onrep take an array of the same type.
that works in C++ not sure if BP behaves the same.
no inputs for onrep :\
@sharp spire So what I am seeing is that while the server is aware of the array now, the defaults for each item's actor class are set to NONE
wait i think im confused lol
its okay, just jump back here for a sec
show me that
client authoritative about what its equipping?
no, he wants to multicast
He's almost done
but we havn't quite gotten to the multi part
it was actually an interchanged name https://gyazo.com/345b2951d6c203d1d93af1a89e314771
(gamemode)
you are missing a part at the end
you are setting NONE as the item in the array
Also, you need to show me this item BP
whoa there
just caught this
Okay you are using Get Class Defaults
yea because nothing in the class gets changed
its more or less a permanent reference guide
Yea, show me the itemBP
yea, but before you do that, we need to solve a small issue
okay so what about this class do you need to see, its variables?
I want to see this mesh reference
Okay, its blank...
ah
nah its okay
alright lol
Why don't you just change that reference to a hardcoded class?
A reference is blank be default
Until you spawn the reference TYPE and SET the reference, no one knows what it is
So if you use Get Class Defaults, all references will be NONE
but technically its not getting class defaults of that master class its getting the defaults of the child class
If you spawn the item, and just store that, you'd be gold, because internally when you spawn the item, it will spawn the mesh, and store that as the reference to itself
Yes, but a blank reference is a blank reference
You can reference a TYPE of static mesh
but the reference to the actual INSTANCE is still none
IMO if you're using a class as a lookup table you really ought to give data tables a go
but you're here to get MP goin
He has already learned the ways of Parent/Child xD
(which you hate)
or dislike xD
but are datatables hardcoded?
did you teach him this
nope
kk
Best pupil ever xD
What you want to do, is just do a class instead of object reference
i just found out about this chat two weeks ago and i started using unreal engine heavily over two years ago lol
it is a class reference
not an object refence
thats the struct my equipment array uses
then the itemactor class reference has the second set of struct
Okay, where it says skeletal mesh, your going to change it to skeletal mesh again, but this time pick the purple option below the default
yes, but you can create the "idea" from the class
well regardless i cant have any objects right?
alright sorry lol
This will all make sense soon
one second tho
Yes, changing it is going to screw up some stuff
changing that to a class reference, i just have to go through and make sure i didnt get any errors real fast
already expecting it
yea me too lol i havent looked yet
luckily this is a new project and it was only refenced once.. lol
Alright, now show me the equip func again
how do i set a skeletalmesh from a class ._.
you don't but you will see
right but i cant continue until thats fixed...
the end is missing the new mesh because its now a class
open the itemBP child
https://gyazo.com/52c7d9aa8bb7654bb037c11a6fcc61eb heres my equip
all it lets me do now is set its type to skeletal mesh.. lol
yea one sec
just fyi
my method with the skeletal mesh as is, seemed to work just needed a multicast
imo
go back and do the third option, the soft object
but im still following lol
Well shit, I tell you waht
as in the server was receiving the mesh just fine i think
just change it back to mesh reference for now
We will do the multipart now
so set it back, and make sure the child has the mesh set again
alright all setup back to normal
Okay, remember that bridge stuff between the two sides of the controller, Server and client side
Okay, well there is no bridge to another players controller from your controller
so how would you get data to another controller?
asking the server to reference it?
yes, but where, because the the array is on YOUR controller, no one else but you and the server can see it right now
where is the one spot EVERYONE can talk to?
the GameState?
gamemode can have logic?
gamestate would be nice because it
of course
gamemode can spawn SERVER characters
and do stuff with its own characters
like AI?
yup
good to know o.o
so does that make GameState an alternative location?
and is GameState and GameInstance the same?
gamestate is also shared between all players
Game instance is hardcoded, local only, no exeptions
so having a host session node is a good or bad idea to be held in the gameinstance?
if you want to get data out of game instance, you need to do it from the playercontroller CLIENT side, then send it to the player controller SERVER side
Thats fine, because only the host needs to do that
the server has its own instance
i literally just have a host session event, and a news string array and its only used when in the main menu and not in a session
but does not have a controller (unless its a listen server but for now we are sticking with a dedicated setup)
so in the future ill move my News array lol
it'll be fine
just change it to multi
the onrep stays?
and move the logic around if onrep goes away
i think if its in gamestate its already multicast
not sure whats even happening...
when running my equip event on the server it only shows locally on the client and server doesnt see the any changes.. lol
is the onrep not running on the server for some reason?
team viewer or discord screen share
i dont have either installed, im using a browser for this :\ im going to look it over and see if thats the issue
i think this is my issue https://gyazo.com/a75427dd5413cdb14ac3bdd7b14c5f05 getControlledPawn() isnt going to get the right pawn when ran throught the server will it?
On Rep should run for anyone who has that variable
but only for them right?
yea
You may not need multi
causes the clients to see the skeletalmesh locally, and the server not any at all..
is E.RightHand replicated?
yes
so is the mesh its attached to, and the capsule that that is attached to, aswell as the pawn
@severe widget Help?
i swear the onRep isnt running on the server.. lol
It would help to see what bp those are in, it takes forever to scroll up to find
all in PC
k
youve done enough if you want to give up for the night evo lol
i can just sit back and think about what ive been taught
Yeah you think about what you've read. :P
Oh I've always just called it on server.
isnt that technically called on server?
not sure if that's bad practice or if OnRep doesn't fire.
Fires for local clients
onrep has to fire, because it equips it locally
So post-replication but pre-assignment, a comparison between the existing value and the replicated value is done if they're different you get the onrep.
That's my understanding.
Now, that all sounds like non-server stuff.
But you know they gotta keep a delta on the server to trigger the replication at all
So there's no real reason why it couldn't also happen pre-replication, post-assignment.
so is the server keeping up with the changed value, but running the function locally?
This is where my generalism kinda falls short.
If you're getting OnRep on clients but not on Auth (you should test), then its safe to assume for now until you get a correction from somebody else.
Nah, that defeats the point
Does you OnRep just never happen?
Alright
even though its ran as a server event
no but my equip function is
its literally a ufunction
that sets the variable for onrep
No, but he changed the variable during a server event
so he changed the server side, PC variable
Yeah... did you see what I wrote?
so server should on rep, and client?
There no reason that it doesn't, but I'm not sure that it does.
It just logically seems like a post-rep thing.
OnReplication
Okay
Now, I'm perfectly fine being wrong, so if somebody who actually does know could tag me that'd be great.
so he remove the rep notify, and just manually does it during his server event
i need my weapon to show up for all clients... thats it.. lol
OnRep is better than multicast if something needs to have happened for clients
So if you're changing a mesh out... you could set up the mesh in OnRep
i did :\
And then when you change the variable on the server, just call it on the server manually.
I'd have to review what all screens you've got though.
When I said you were in the deep end this is kinda where I was expecting this convo to go.
https://gyazo.com/3c1711167552db89d2c0e48cab0b5a54 theres the equip functions thats ran by the server and the equipment is set to repnotify
I would just call the event on server, make the array change AND change the mesh in the same event, since the component is replicated
Yea right there
move your on rep stuff into that
https://gyazo.com/d459295baa420eaa47a9ab3c9c7398de and here is the onrep the fires when its changed
ยฏ_(ใ)_/ยฏ
Just move everything from the on rep to the server event
_b.... _
so when the server changes the replicated mesh, the client does too
....but calling OnRep is the same thing and it can then also function as clientside updates....
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
well onrep isn't changing the mesh on the server, only for the client?
He messes with an array, that calls the onrep, and within that onrep, he is changing the mesh
ยฏ_(ใ)_/ยฏ
OnRep is literally just a function, and if the issue is that it isn't being called on the server I don't see the harm in calling it explicitly.
Solved
Notice the talk about abusing this bug at the bottom O.O
Neat
"Array variables marked as RepNotify are not calling OnRep on the server when they are not directly set using a Set 'VariableName' node."
Oh, yeah, ok. That makes sense.
So..... and for the last time just call it manually
why not just merge that code into the server call itself?
Cause calling the function will functionally do the same, and if clients are going to have to do it then you reduce code duplication
alright
I want this code to run when this variable changes
so this is what ive gotten to so far
the clients will do this twice then
wut
its a replicated mesh that he is changing
so if the server changes the mesh, then the clients will too
Well I would hope that when the server changes the mesh of a replicated component, that the client gets updated...
@sharp spire Right now either way would work, either just call the OnRep manually, or just move everything out of that onrep, and just put it back into your server call
There is a onrep bug
And the results?
Isnโt it a problem if that index variable isnโt replicated?
o/
Plus this part is ran on the server, so the client only cares about the array itself
Mp is just the greatest to work with.
i kind of like its challenge lol
So whats it doing?
Yeah puzzles to figure out
If you go back 2 hours in here, you will probably have a new lease on life
results are only the server sees the mesh
the clients dont see anything
theirs, or others
Howโs equip called
Server sees hatchet on his pawn, and clients pawns (if they equipped it) but the clients dont see any hatchets no matter whos equipping it
the 2 input key as a test at the moment
and is a split struct
hardcoded basically
For fun just so this. Equip(run on server)-> equipmc->your code
do it the way ImmutableLambda said to
So, back to the onrep notify
but after you change the array in the event, do a manual call for the onrepnotify
i tried that @hasty adder but it causes clients to lose their pawn somehow... lol
This way the client and server both run
Lol
hmm..
Just leave it as is, recreate the onrep
you do believe thats the best way? @glacial pollen
I believe that OnRepNotify is bugged, and this is the best way around it
Hm you said split strict struct
Isnโt a struct just a pointer and the values arenโt replicated unless the values fed in are replicated?
right, so wouldnt i want to avoid that?
so keep my onrep
So the server part will change the mesh on the server
and the on rep part will change the mesh on the client
for bug reasons yes
ill give it a go
Plus if you ever want to do peer to peer better hope the server updates ๐
almost worked evo
except my prediction came true lol
client2 has no idea... haha
listenserver knows, client1 knows, but client2.. lost.. lol
and client 1 cant see listenservers mesh
:\
i think i NEED a mc
Okay, do this then
but im not very good at mc yet, calling a multicast event and casting to a pawn using your getControlledPawn() wouldnt cast for everyone, would it?
change the onrep into a multicast server event
and call it at the end of your equip server event
that is inside the PlayerController?
Is this in the controller or pawn?
you can't multicast from the controller
gamemode is even slightly worse
controllers can't talk to each other
where should i run a mc?
MC from a client will not disconnect the client that owns the PC (but will disconnect every other client)
Playerstate is a good friend to@mp
MC from a GameMode will disconnect all clients
But keep it close to the item thatโs being changed
Character visuals on the character
You can call from controller to run an event on your pawn to then update its visual stuffs
So just a jump from the controller to the gamestate, and then actually run the code
so running a MC on a pawn is ok?
If itโs servers version
All clients need to see his mesh change
Let me use a small example if you have a gun that is firing and spawn the effect pressing l which on character spanwsnit only client sees it. If you have l on character run on server spawn the effect only server sees it. If you run on server and mc all sees it including server
Because server called the mc
I canโt say for sure on rep but usually a call on server to change an onrep for a character will goto everyone to rub the same logic on the local clients version of that character
Think of it like an animation bp
I think yall are missing something
He make a change in an array, and also changes a mesh
he tried using the onrep for the array to change the mesh
Itโs been happening with the controller who says itโs functioning right to begin with all this time
Right here let me explain myself lol
Zlo will set it straight ๐
and you can't reference a non-replicated mesh component that wasn't loaded from a package over network
Basically I have a pawn that has a mesh, that has a skeletal mesh attached to a socket.
Itโs set to component replicate, the mesh itโs attached to is set to replicate, same with the actor
The mesh itโs getting to set from, is coming from a replicated array
mesh is originally coming from client
The server sets the array
no, the mesh is on the server in the array
what do your logs say?
output window, open it
It is 01:04 am lol
Access none here and there maybe
basically, your client sends the struct to the server, which includes the mesh
unless your server sent that very same mesh to client first
there is no way to reference it
Yes and in the long run the skeletal mesh is the nine
Of access none?
Yeah canโt reference
Is it my casting method? Or because itโs in pc
Other pc canโt access another pc
Thereโs that fun graphic in exi thing
Compendium showing what can access what
I have getControlledPawn connected to Cast to Topdowncharacter to reference the mesh
Hereโs a fun thing I do and I dunno if itโs good practice
But I set in my character hard coded references
Like gun1 gun2
And then I can have my gun set to gun1
Everyone uses the same character so they have that reference
But everyone uses the same itemBPclass that contains the mesh
Where is the itembpclass stored?
Literally my only issue is having other clients see my mesh lol. I can get the server to see each clients individual meshes at my current setup
And even get local visuals if I run it locally aswell
But only the listenserver can actually see these changes
I swear itโs a simple mistake with trying to properly mc
Pc1 cannot pc2
Iโll move my equipment and my functions to my pawn and it should work
It canโt multicast in a pc
Simple as that right?
Server can tell the controller to do stuff but if server tells 2 1 doesnโt know and other way around
Right
States and pawns are a nice overlap
and that is not just not working, its actually disconnecting everyone who doesn't have a local copy of the PC doing the multicast
That explains why my camera and input goes crazy when I multicast ...
Lol. I try to go with closest relation and keep in mind who needs to see what
Thanks for clearing that up @winged badger @hasty adder and by god thank you so much @glacial pollen youโve been a HUGE help
Thatโs what I thought, but i guess I was experimenting accidentally lol
Thatโs how chat is handled?
Yeah I keep@mine in the hud which then uses ps to have server mc
Morning. Any idea what is the correct way to get PlayerController or ControllerPawn for example inside GameState in multiplayer game? What I heard, you should not get Player Index[0] because server might see it as a clients etc..
I always use event possessed to cast to incoming pc and set a reference
In the character
For the local user
@hasty adder Thanks! Clever
Oo good to know lol goodnight guys thanks for everything
Your welcome
Enjoy mate bed time here too 1:23 am up in 5 hours gg
I'm headed to bed too, so yea, goodnight
1:23am here and up at 9 thank god
East coast ftw
is there any particular reason I wouldn't be able to join a game with build A that is hosted with build B? I have a demo build that I would like to be able to play with the full version. Just got them both running and they can't seem to find each other
which is strange because i've gotten this working in the past
No idea despite Version mismatch on connection, but that might be fine if your demo uses the same project
Have you enabled verbose logging and checked the logs?
Is there a way to make a projectile skip forward in time via its movement component?
I wanna try and compensate for latency basically
and pretend that the projectile has been travelling for longer than it really has, serverside
so I cant directly invoke the movement component to do it for me?
not really
but sweeping is just a couple of lines of code
so not that hard to implement
yea I just think that would have been cleaner, since it would have also accounted for gravity and other stuff
maybe I can find something by digging deep into the source
doesnt every game handle it kinda differently anyhow?
makes sense
@thin stratus I think it's a steam issue actually. Can't use matchmaking if you're not subscribed to the app...
that's my theory anyways
Oh yeah haha, you need the app in your library
might be able to just use the demo appid for both but i reckon it would show up to friends as "Demo". And I'm not 100% sure full players would be subscribed to the demo app. this just got tricky
Hm, you'll need a different appID for the Demo I think
Your default one can't handle two projects without granting access to both
but if I have a different appID for the demo, they use different lobby pools. and as far as I can tell there's no way to make them share
Yeah
You'll want to ask Steam directly for that in the dev forums
I haven't had the need for a Demo and the real project to use the same pool yet
Well actually never had to handle a demo in the first place
mhmm invoking the components tick func actually seemed to work just fine
it even still collides correctly
due to sub stepping probably
Has anyone been successful with using UpdateSession with steam?
Tried calling it from GM::BeginPlay and GM::InitGameState and both are crashing here https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineSessionInterfaceSteam.cpp#L435
that looks like SessionInfo is not FOnlineSessionInfoSteam
or that it's null
other things work?
Well nothing is working now because the server crashes. But before adding UpdateSession everything worked fine.
its steam, so... steam client running?
yes, the steam stuff is all fine
been iterating on this project for years ๐
void AFPSGameMode::UpdateSessionInfo()
{
if (/*GameSession && */GetNetMode() == NM_DedicatedServer)
{
// Get the session settings
FOnlineSessionSettings* SessionSettings = nullptr;
const IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
const IOnlineSessionPtr SessionInt = OnlineSub->GetSessionInterface();
if (SessionInt.IsValid())
{
SessionSettings = SessionInt->GetSessionSettings(GameSessionName);
if (SessionSettings)
{
// Update the session settings (to include the new gamemode and map settings)
SessionInt->UpdateSession(GameSessionName, *SessionSettings, true);
}
}
}
}
}```
dedicated server part new addition?
no, it's always been dedicated server
worked fine before this build, which added UpdateSession to try and keep the gamemode and map names correct on the server list ui
and nothing useful in the logs?
just the trace I pasted
your UpdateSessionInfo() looks OnlineSubsystem agnostic
so unless you have something other then OSSteam running, i have nothing ๐ฆ
yeah, it's OSSteam. I'm going to attach a debugger to it and check it out
some online subystems can take as long as 0,15 or so seconds to initialize
right, I'm thinking it is an ordering issue and that the session info is still null
But I had it in BeginPlay before and it would be surprising to me if the session info wasn't initialized by then
mornin folks... anyone on that can help me puzzle out why my RepNotify (on a bool) that attaches my character to another character (a horse) that's saved as a "Horse" variable on the character, then snap it to the component itself... if the server mounts up before a client logs in, when that client logs in, the RepNotify works perfectly, the server is attached to the horse, the client can mount up and the server sees it.... but when I dismount and mount again as the server, I'm getting "None" as the horse and the character falls through the void after attaching to the actor? It seems to find the actor but as soon as I've attached to it, it can't find the actor to find the variable of its mesh?
@jolly siren Not related to this issue, but I remember you saying "open 127.0.0.1" was broken a while ago and that it had been broken for multiple engine versions. Seeing you are using Steam, it makes sense. The USteamNetDriver class broke any sort of "open IP:port" connection and it's actually "by design" from some smart ass at Epic.
Yeah, I opened a bug around the "open 127.0.0.1" issue and they never added it to the ue4 issues :/
But that issue was while working in the editor itself. So that would just be the null subsystem
I am trying to make a multiplayer chat system but the cast fails to my chat widget
Errors: โ
Chat widget adds the msg to scroll box โ
Gets text and sends to pc for getting sender name and text โ
not sure but it looks like it's being run from a client that's not on GamePC character
or run by server maybe
it's getting None for the GamePC tho, that's your clue
here's mine:
1sec
Player Controller
PC
===
Now The Error Is The Cast Fails When I UpdateChatWindow In Chat WIdget
===
Help?
@proper olive hm..
no its on GamePC only
what's LobbyPC in your comments there?
Hi guys .. can classes derived from UObject replicate ? I'm getting conflicting answers, currently in the process of implementing this wiki https://wiki.unrealengine.com/Replication#Advanced:_Generic_replication_of_Actor_Subobjects
yes @stable kindle
@burnt meteor would that wiki work ? or do they do so regardless
i dont know about wiki but u can use replicate = true and repmovement =true and it works
i forgot the c++ name for replicates
bReplicates is for c++ i know Actors have that property not sure about UObject
i might mention i'm on 4.17.2
?
Does anyone know how to pipe a windows server log to a file? FPSGameServer.exe -log logs in a separate cmd, but I want to pipe it to a file
@burnt meteor thanks for the prompt answer btw ^_^
@jolly siren would you care to elaborate . Does the wiki i'm basing my setup cover what i need?
So anyone know why my other clients aren't getting this "Horse" variable unless they log in to the server already mounted up? Mounting at runtime doesn't replicate this highlighted node
@stable kindle yep, that wiki covers it
@jolly siren thanks ^_^
@proper olive u need a Player Controller to possess
this is like super overboard, but I'm just trying anything I can to set the Horse variable
the Possess is working fine, it's the attach to component that doesn't work
like I can ride around as the horse as the client or the server
attach what?
yes cause ur possess works on server but not on client
u need a pc in the server
thats why
...
?
ahh figured out my issue https://wiki.unrealengine.com/How_To_Send_Game_Logs_To_Custom_Files_%26_Log_Without_Console_Window
the possess works, it's the attach that doesn't work
if I move as the server, the horse moves around, but the attached pawn is floating around under the map
show me the attach
it's the Horse variable on this Rep Notify that it's reading as None
I tried setting Horse variable to RepNotify too but that didn't helpo
Any errors/warnings in the logs @proper olive ?
ill get back to u 1sec
as you see it's not setting the Horse variable
@proper olive download https://app.prntscr.com/en/index.html
like how do I rep notify the set horse?
its easier for screenshots
print screen is easier
u get to select what to screenshot
@jolly siren @burnt meteor sorry to bug you guys again .. would the method workd for ubojects in an array ?
As long as they have an actor owner that replicates, it would
@winged badger thanks ^_^
@winged badger any insight into setting an actor variable to replicate properly for use in a RepNotify code like that?
I am not sure what the chain of ownership is after you attach the possessed character to a horse pawn
On mobile, so screenshots are a little problematic atm
๐
my man falling off the horse:
๐
lol badly copied screen shot ignore the top framing
lol
Horse mounted on server, server sees client mounted....
on the right, client sees self mounted, server is off the horse
and if another client logs in, clients can see each other mount up just fine when they mount up at run time
that's the weird part
Try SetRelativeTransform ontop of everything else
but their rep notify doesn't work
its not replicate properly
I do that actually
@winged badger that's later in the code, works fine on self as you see
it's a mess rn while I work on it ๐
in the meantime can anyone explain what exactly Authority means? It's not always just the server, right?
It is just the server
@proper olive yes authority mean server owner actually
oh ok that's good
not server always
what about Is Locally Controlled
that means the server or the client, whichever one owns the pawn in question?
i highly suggest get this course worth it
here's the confusing part: at run-time, clients see each other mount up perfectly
it's only the server that other clients see fall off his horse
when logging in to see repnotify conditions already set, it's the opposite - server appears mounted to other clients logging in, but other clients are disconnected
they are not server owned(authority)
I am using RPCs. You have to use RepNotify to update people when logging in
2m i am busy
when I put this code on the multicast the same problem happened
LocallyControlled checks if the PC is (and by extension its pawn) is in a local controller via GameInstance
first run on serverthen multicast
no i am eating
Decode everything you tried to tell me, I already knew
Try not assuming I'm an idiot
I appreciate the help tho
Useful for stuff like when you want to show a widget only to the plater tbat ran into a trigger volume, for example
Then OnOverlap, you would cast other actor to Pawn and see if its localy controlled, and if it is, display that widget via its HUD
Ok yeah that's exactly how I thought it worked
was just making sure ๐
trying this Owner thing now
When you mount up, you possess the horse?
Try setting both the character and the horse to AlwaysRelavant just to rule out some weird NetRelevancy issue
yeah I thought about doing that liek you said, just to test
trying to just clear Owner for the same reason
how dangerous is it to leave always relevant on for something let's say like all items :cringe:
I know attaching costs more so I just leave them hanging out hidden when they get picked up and move them unhide when dropped
Depends on how many they are and how large your world is
haha of course ๐ so very bad if it were to be a lot and very large?
I destroy mine and create an actot component
my player states were losing reference to items all of a sudden and I had Always Relevant turned off for weeks, so I'm not sure what was causing them to lose relevancy
Then recreate the pickup if dropped
yea
May I?
so because the players moved far away, they lose relevancy? It was happening even with items they spawn with
Use team viewer and solve it
Freshly logged in client seeing the server and the client who had mounted up before he logged in, all working perfectly
so confuse
at least it still looks purdy :sigh:
it seems the only thing that's not working right is other clients reading the server's Horse variable when he mounts up at run time. It looks like pretty much every other condition is valid
server or client mounted before client logs in: check
clients seeing each other mount and dismount: check
server seeing other clients, check
clients seeing server attach to horse on RepNotify when logging in after the fact? check..... (most mysyerious)
client seeing server attach to horse at RUN TIME? ..... falls through the earth.
what bugs me the most is the fact that I'm ONLY getting an error for this AttachToComponent node
and NOT the Actor node right next to it
but the None is coming from the ACTOR
lolllllllllll
Also @proper olive youโre running a check to see if itโs a server or a client during a server ran event
it'll spawn twice on client if I don't filter out client
should I run on client again something?
set horse on client?
Why is it spawning twice? Can you post where itโs being called
what will spawn twice?
any time I spawn actor from a Server RPC on client, it spawns twice
so I Switch Has Authority
because the RPC runs on server and client, that's how it works
But that switch is inside of a server can event, im still fairly new so maybe I see it wrong. @winged badger ?
client generally shouldn't spawn anything
except maybe some visual only related dummy actor
it spawns it on its own side
Should this be a multicast at some point?
well visual is visual lol
Heโs spawning a horse for mounting and wants all players to see it
I think RepNotify basically makes Multicast unecessary? I could be wrong but it seems to work better without the multicast. Multicasting messes everybody up lol
all players do see all other players do it
But his snippet a few pictures up has an authority check during a server ran event
then you spawn a horse on server
but hwen the server does it, it's not working right on clients
and let it replicate
thats what I'm doing
so, what was the "spawns twice" part about then/
Is the mesh in the BP set to component replicate aswell as the class?
yeah @sharp spire ๐
Without an authority check during a server ran event it spawns twice
the spawns twice is the reason for the Authority checxk
yea
anything will
test it out yourself
just do a Server RPC, spawn a replicated actor, and run it on a client, it'll spawn on the server and the client
Server RPCs aren't meant to run on clients
they run on both
I am new so donโt take everything I say as the answer, but from what Iโm understanding: you should only spawn on the server and let the clients see itโs replicate state
you connect that to the ServerRPC ServerMount directly and do all mounting logic inside it