#multiplayer
1 messages ยท Page 359 of 1
ah so it starts out empty then adds them as you pass them?
no, i add them in-editor
i place the checkpoints in the level and then add them to the array
manually
there's no other way to do that afaik
a linked list?
ah yeah, but i generate that based on the array
because i can easily rearrange the array
mind you, you couldn't even reorder arrays manually up until a few UE4 versions ago
sad
yeah
but can obstruct view?
ye could get annoying
i'll have to fade them out if they get too close or something
maybe make closer players on a client transparent
right ๐
since everybody will be running their own races and probably restarting a lot, it shouldn't be that big a problem though
because players will spread out
we'll see
i mean, of course i'll do my best to make it easy to learn but hard to master
but the game is inherently hard as fuck so we'll see how well i do with that lol
0G handling is tricky
haha yeah, your idea reminds me of independence war 2's tutorial
it had you doing some zeroG time trails through asteroid fields and stuff
i remember that lol
having to check every cp
it was
but the controls in the game were horrible
it was lovely too, i love the flight system once properly customized
the ability to go full newtonian
yeh
i'm thinking of letting players switch between full newtonian and "easy mode" in my game
easy mode would limit your linear/angular velocity
or turn on damping and stuff like that
yeah correctional thrust to go where camera points
just make sure they go into different high score categories
maybe i'll turn on easy mode by default but give time bonuses if you turn it off, or add "powerdowns" that turn it off
yeah could be map based i guess
yeh
not sure what i'll do yet seeing as i'm making this game up as i go
well not really
i know what i'm making but i don't have plans for specific features etc
you mean leaderboards?
right
yeah, no point in doing those when i have client-authoritative movement
@manic pine so the problem is now btw
with loading the NPCs lol
it can go from 0 to 5000 pretty quickly, but slows down around 6000
what slows down?
SpawnActor
where you calling it?
Also
or rather, how many times per tick... all at once?
have you checked if its changed somehow after game start?
im not quite sure how ue handles movetick off but movereplication on
what were you using to disable ticks doom?
oh no it's a different issue
damn list of objects in the blueprint debugger is bugged or something
running into the problem we talked about yesterday @manic pine
listen server counts as server so anything running off switch has authority > remote doesn't execute on listen server
so if i want to run something clientside only i have to do this whole setup to see if we're either remote, or a server but not a dedicated server
yeah in that case you should use check
why not just do continue unless dedicated
im not sure which functions blueprints have available hmm
but surely there's a way to check if youre dedicated
Is therew a way
I can load these NPCs faster
lol
multiple threads is what im thinking
I still think its funny...
Tick() runs on UCharMoveComp no matter if u disable it or not
are you trying to load all the npc's even if they're on the other side of the map? @twin juniper
i'm trying to spin up a steam dedicated server, which works if i have the steam client installed and running. but i'm hoping that i can someway get it to run without having the steam client installed. is this possible?
this is literally
the most asked question
can we just make a youtube video
and have a bot which links it to people
then it should be pretty simple to answer ๐
@twin juniper the question was not about the consistency of world replication. But exactly about not adding all the RPCs into player pawn or controller to keep things modular instead.
@polar bridge You shouldnt need Steam installed if its an dedi server.
@polar bridge You just need to copy paste the Steamworks Binaries from the ENGINE ThirdParty folder to your packaged Servers Binary Folder
It's 4 files
Should be the same for a BinaryBuild (Launcher)
In regards to using Steamworks with Dedicated server, how would one let the server login to account ( or is that even neccesary ? )
https://wiki.unrealengine.com/Using_Steamworks_with_UE4
I kinda just wrote what you need to do :D
can't find it...
u mean this part ?
"If you have a Steamworks account with an app ID, go to Edit Steamworks Settings -> Application -> Dedicated Servers and then edit the Dedicated Game Servers Information section"
I'm referreing to steam client account if you need them for dedicated server . and how would one run it?
No you don't need one
You just copy the binaries over
Otherwise you'd need one account per server, which is a bit impossible thinking about the limitation of one application per account and one account per computer :P
yeah ... i was thinking about crazy that would be
but if the server don't have a steam account , I can't quite imagine how would steam recognize the hosted sesions. I guess is by using the RegisterServer() thing as you mentioned.
So this would means the server need no authentication i suppose ( as in client needing to BUY the game on steam )
Yeah
They register via Session Functions in RegisterServer
Leaving Presence to false as there is no presence for them
ic ic
i'm starting to think in our case there might not be a need to enable steam for dedicated server since we're not doing listing. we're doing invitation-based only game.
in which the backend will host and pull the related player in via ID
btw the pu ll request you make @thin stratus
https://github.com/EpicGames/UnrealEngine/pull/2135
is not available. is it already in default engine binary?
Lemme check which one you mean
Can't reach the page
either github or some DNS in the middle is slow af
<-- i got it from here https://wiki.unrealengine.com/Using_Steamworks_with_UE4
That is not my PR then
That's the Authentication one from someone who dealt with this quite some time ago
It's not up to date and also has flaws
oh okay yours is the sessions th ingy
I would rather not use it anymore
If you want proper steam support, do yourself the favor and buy UWorks
too many unknowns now. i'm going to try something and expand my knowledge from there.
I think UWorks will only make sense after they integrate into OnlineSubsystem
They are doing so
I mean, the worst you can run into is redoing some of the online things that the subsystem does later
Means hosting or searching
Subsystems don't offer THAT much
So you'll see yourself using the Steam header anyway
hmm that's true as well..
E.g. Getting Avatars
And you'll probably see yourself in front of a big wall when going to PS4 or Xbox anyway
I would focus on making the game work for Steam first if that's your goal
it works on Steam now fully with listen
we do all the fancier stuff with AdvancedSessions from mordentral
Avatar etc
hey guys, can any one help with my multiplayer setup? I am able to connect, but on spawning my first person charector is getting pushed into space randomly on the other player joinin/spawning
@restive spindle are you using a single PlayerStart object?
maybe you can put more
No i am spawning them in various locations atleast 600 units apart or more
doing this via few vector variables plugged into different spawn transforms
uworks locks you into steam, and the steam api isn't really that hard
unless you need everything to be BP
@compact gulch for some reason github isn't loading PRs for me, is that the authentication one?
what PR?
the one you linked
I get greeted by this for every UE PR
iirc the 2 big gotchas of the steamworks OSS are 1) can't connect to servers by IP because for some reason epic decided to use p2p sockets by default 2) no authentication
no one at epic works on the steam OSS because they aren't shipping a steam game
Normally widgets are owned by the client, however, is there a way for it to be owned the server and all clients? You could add to a client's viewport but all the data would be on the server like the game state?
Anyone have experience with gamelift?
i do recall it's a pretty expensive service
even more so than provisioning the equilvilent servers through EC2
I pay 50 bucks a month for a vps and can probably host 5 servers on it running 24/7
GameLift is more expensive
However it also gives you the scaling options etc
Your own v-server can't automatically spin up servers and shut them down
So you kinda pay for that service too
Is there a massive number of actors we can have on a map at a time
No love for us small outfits. Yeah I was wondering what the cost is if it's just one instance running to get an idea. I'll keep researching. Wonder if the implementation is easy enough to try the trial service. "Free tier"
You can simply check their free tier listing
It's x cents per hour
Then you just need to calculate that times hours of a month
Right on. It's like free 125 hours or something
Not sure what that means ec2 live time maybe.
@thin stratus whats the largest number of replicated actors you have had on a map
Probably totally up to server resources
I've been having a little trouble getting a missile to replicate its movement seamlessly, from a listen server to a client forgive me for the low quality of the video (client right /server left) on the server while following the missile it fine but following it on the client while moving it visibly stutters does any one know why this could be ? https://drive.google.com/file/d/1eM9_CZ6QWypTSgfvCGsrRcYMcsEbUSgm/view?usp=sharing
P.S its fine on client while still (or atleast appears so)
It occurs due to the update of its position from server to client
Make the Windows really small see if it looks better. It might just be the specs of running everything
Hmmm
I still have this issue after closing a few programes and have 120 fps ?
(I checked my CPU, DIsk and network usage all below maximum)
20-40%
Im@not sure of the workflow exactly but you can not replicate it's rotation and have the initial event of the rocket spawning replicated per client so they individually use there own simulation locally
Forgive me I dont understand what you mean
Are you suggesting I spawn a copy both on the server and the client and then update the client off the servers location ?
The stutter is from@the frequency if I recall that replicate movment is done so the server tells the clients to update its position and this causes the stutter. A trick is to have the event spawn it local. And then replicate to the server to tell all clients to spawn the same rocket with the same logic. The server would as well but it's not replicating its movement. Tough for me to explain but there are a ton of YouTube videos for this stutter
Is there anybody who is german and knows a lot about replication to help me with a big problem ?
@thin stratus just saw your messages. Copied those binaries over and it seems to work. Thanks
anyone know why a listen server pawn might return as not locally controlled after being destroyed and respawned?
nevermind, looks like i got it https://answers.unrealengine.com/questions/463875/the-server-is-never-locally-controlled.html
So I've just begun working on multiplayer compatibility for my game. Instantly I noticed that some stuff isn't working right - mostly stuff that I've implemented over the default character movement
This leads me to believe I've done a dumb dumb
There's two things that I see that don't get communicated to the server it seems - capsule half-size, jumping and sprinting.
I change the half-size based on a few conditions, I implemented the jump using "add impulse" node, and sprinting by setting max walk speed
Now, I assume this is basic stuff. Any idea how to get this whole thing to replicate properly?
Maybe I'm skipping a step here
does anyone know if i can pass variable to a dedicated server executable through a command line?
@twin juniper
- MaxWalkSpeed doesn't replicate. Use a RepNotify Variable and set the Speed with that inside the OnRep function
- Capsule size might be the same as MaxWalkSpeed
- Jumping should work, however if you feel like it doesn't, then you should also apply the Impulse on client side
Anyone know of good instructions or even a video of compiling a Linux dedicated server and uploading to something like an aws or digital ocean box
I compile it and I get one file if i do it one way and multiple files of I do it from editor I'm confused lol
@thin stratus This explains my struggles with the sprint
Another kind soul explained to me how to properly communicate player actions to the server
But the sprint still doesn't work, which makes me worried
Hm
Let me try your solution!
heck, my stuff broke inexplicably out of nowhere and i can't figure out why
I'm starting to get really agitated tbh
gamedev is a masochistic job
Wouldn't have to be if I wasn't so fucking stupid and kept multiplayer in mind from the stat
*start
Now I'm trying to figure out where the hell the miscommunication between client and server is
lol i'm in the same boat...
except i'm not even sure if that's the problem or if my project is somehow corrupt or something
๐คฆ
well it's even more masochistic if you don't use source control
@twin juniper I'm pretty sure you need to expose something to BP to change half size across the network
since I think the capsule size does not get refreshed during play unless you crouch or make your own function
@lost inlet lol, too early to bother for me
clearly from what you've been saying it isn't
well, what am i supposed to do?
i'm not going to pay for source control at this point in my project
learn git or perforce?
@twin juniper you can expose crouch half height and then use the crouch function + a flag to create a custom movement mode in BP, otherwise gotta create a new movement mode
Ok test ec2 Linux box is up. Now compiling Linux server in front end. Lets see if I can figure this out ...
Does anyone know if the Steam Online Subystem still works with the Dev AppID and does the Unreal editor use the steam port, or does it always use port 7777, even if the port is different in advanced launch settings?
Like real sessions made with steam enabled true?
Sorry. A listen server on 4.18
Steam will use its 20115 or whatever ports to tunnel through steam.
Not dedicated.
Here's the catch is this your appid?
Right. That'll work
but with steam direct, didn't know if thats stopped working.
No still works it's for development before you get on steam
Just remember you can use the same box as the listen and connect to it from another instance of the game
You need two computers
And prob have to be on different networks or atleast when i tested it seemed to be the cAse. So I used my network and another comp on a public wifi
I was trying to do it online. I have perforce and a couple of other guys working on the game, fully updated. Couldn't get it to work, but I'm guessing it's because I followed the official UE Multiplayer blueprint tutorial. Read a load of stuff including that that's not the best tutorial to follow.
The blueprint thing for a lobby and junk?
Yeah, it was a playlist copying the Multiplayer Shootout method made by one of the UE staff.
I think most of my problems are stemming from port forwarding though.
I tried using no subsytem and connecting via public IP's and I just couldn't get it to load at all.
all through console, no blueprint.
Thanks anyway pal. Really appreciate the help. ๐
Gah Linux server doesn want to run
Ok got info all good
Hello, Why I cant get custom player controller in GameMode?
What do you mean?
I cant cast another custom player controller
I tried with get all actors of class node but its not working
Are you sure you have the right player controller in the game mode, and that the game mode is set in correctly in your level?
I want use 2 player controller for my multiplayer game
I created 2 different player controller
but in gamemode I cant change it
I'll pm you
Does somebody know why I cant cast 2 player controller in GameMode
because you are doing something wrong. paste us what you have @regal narwhal
@hazy haven I would like to create a multiplayer game. The Server should have different player controller. Server will be like world creator add some mesh or add some character.. And will do it with mouse . but client will be only a normal player like VR Pawn. so I tried create 2 different player controller for this. When I tried cast or get all actors of class for custom player controller which is different from right panel in gameMode, it gives me nothing.
I hope I could tell what I try to do
paste your blueprint, you can certainly cast to many player controllers from gamemode.
can you open up that Mouse Controller blueprint while running in editor, click Debug Filter and see if any instances of that exist
You can't have different playercontroller classes
You need to use different Pawn/Character classes
ok I see but Server will be like world creator for add some mesh or add some character.. And will do it with mouse . but client will be only a normal player like VR Pawn.
I created different player classes for to this. So you mean I dont need use different player controller class?
You can't use different controller classes
If you have different logic for players, it needs to be in the pawn class
but I cant add movement component to pawn class
VR Pawn might need movement
I never used a component for that
@thin stratus thanks for anwser. I will try find another way ๐ฆ
Cause it properly bypasses the missing features that epic probably won't implement.
Afaik, AdvSessions isn't offering all features as it still works along the subsystem
But u tell everyone to use it
Yeah, as I know that it completely exposes all Steam functionality
don't get uworks if you plan on targeting a non-steam platform at any point
also if you're comfortable writing c++, using the steam API directly isn't really that difficult
To be fair. The parts that the subsystem interface offers are being worked on
so other than "it has missing features" your sales pitch is pretty thin
For someone who calculates in hours and money, getting the plugin is a lot cheaper
Well I'm happy with the plugin. As it's still not mine, feel free to code everything yourself or use the advsession plugin
I am spawning and possessing the pawn in the game mode ON the server but the client player has no input. ANyone run into this?
in the game mode ON the server
No idea if that's clear, but GameMode only exists on the Server, so that is kinda always the server if you use the GameMode :P
You will want to share code
yes, just wanted to be clear that I wasn't calling a run on owning client from gamemode.
I actualy got it figured out. It had to do with input to game only wasn't getting set after the connection to the server on the client.
@heady epoch should you explain our send a pic please?
I am also having the Dave problem
Same not dave
Basically all of the players join into the server. Once everyone is there I then run my spawning function from the gamemode. When I spawn the player I also pull of that pin and possess the pawn with the player controller of the connected player (You can get this and save it in an arrary from the PostLogin Event in t he game mode. I also then call an RPC (Run On Owning Client Event) that executes on the player controller I just used to possess the pawn. That event in the player controller simply executes the node InputGameOnly
Why not just doing it in the PlayerController
On BeginPlay
Limited to the Client
Not need to use an RPC for that
Does anybody know if I can use the old method of using the Steam online subsystem, or do I have to use the new updated documentation version (https://docs.unrealengine.com/latest/INT/Programming/Online/Steam/) including compiling the engine from source and downloading the steamworks SDK? Or do I just adjust the Defaultengine.ini file to include the net definitions etc. if I want to use the Dev AppId for spacewar? Also big thanks to Cedric_eXi if you read this. Your documentation has been a massive help. Read through your consolidated networking guide, really helped me understand a load of concepts + a bunch of forum posts, I pretty much just defer to your better judgement for everything now, ever since watching the official video for setting up multiplayer in blueprint and reading your forum post about it. Honestly man, you've been a massive help and a huge timesaver.
Thanks @heady epoch
@thin stratus Possibly could do that, their input is delayed due to a countdown timer
I don't understand how I can determine, which instance of the blueprint is the local one and which is one of another player. My actors are gettings spawned from the gamemode when they join the game, but the listen server also does have a player itself. Switch has authority does only tell me if it is the server or client, but not if the instance i am looking at right now, is it's own or not, or am I mistaken in this?
Is Locally Controlled
oh
if it doesn't work, it's because you're calling it too soon after BeginPlay
and the pawn still needs to link up to its controller or something
@small temple I did test it and it works fine now. thanks ๐
I had many different blueprints that seemed like they would do what IsLocallyControlled does, but never found the actual IsLocallyControlled bp...
@short whale great!
remember it can mess up if it happens right after beginplay without a short delay first
hey guys, do event dispatchers only fire server-side or something?
hmm, i'm calling mine in a custom actor, from a non-replicated event
If you set an actor to not replicate after spawning... So lets say the constructor is bReplicates = true... We spawn it, its now replicating... so we call SetReplicates(false); what happens to the replicating actor? Does it disappear?
why not try it @twin juniper ?
Well if someone already knows... Saves me time from trying it lol
But if no one knows ill be the first!
That's why I ask lol
lol the avatar change
me too
@thin stratus can you see any reason at all for this to fire on the server only?
Despite the Actor only existing on it, no
If I have a widget actor that is created by the game state, can I use it to store variables as long as it isn't destroyed at any point during game play?
Listen Server/Client is the VR player, who observes a scene and reports tactical priorities - , the 2nd client is the non-vr user who connects via lan on another computer and manipulates the scene using a Widget .... as long as that widget is set to replicate, will he have access to the values? or will it somehow make a seperate instance of the widget...note, the VR player never actually adds to widget to it's viewport, it's create in the gamestate so it SHOULD be accessible to all players correct?
I have the widget and the functions on it set to replicate or mutiicast
@thin stratus I also read through your compedium, dude, seriously, THANK YOU for taking the time from your life to make that
It cleared up a lot of the mystery of networking in UE4, although there are still some concepts that will take some exposure to
No biggie (:
lol i'm a fucking idiot, it was only triggering on the server... because i was flying through it with the server
@small temple are u running on dedi mode btw
i always have that on so i know it will be running how i expect
nope
gotta make sure listen servers work for my game
so i test with listen servers
Is just adding a lil bit more to the code
Anyone ever had issues seeing particle emitters on static meshes when client is firing weapon?
I copied example of spawning impact effects for projectiles from shootergame and for some reason when I shoot around as a client, server can see particles on brushes that I have in my level but not on static meshes
Could it have something to do with collision settings?
When server is firing, everything is spawned correctly on both sides
@manic pine you there?
yep
got a question for you because you know half my game already at this point
if i did my checkpoint stuff server-side in the gamemode, how would i replicate it back to the specific player that needs it only?
so if i touch a checkpoint, the server disables it but only for me
just a regular client rpc will do
client rpc being a run on owning client sort of thing?
where are you detecting checkpoint triggers on server?
in the checkpoint right now
but well, the checkpoint detects the trigger and dispatches an event to the gamemode which actually deactivates the checkpoint and activates the next
right, the event contains a reference to the character who triggered it then
well it sure can yeah
can? it must, how else are you planning on identifying who passed the checkpoint?
...magic?
eh he he
multiplayer stuff then
i would probably be fine if i were just doing traditional stuff like an fps or whatever
someone triggers your checkpoint... in a single player game, its obvious that its the player(unless NPCs can too)
but here you have multiple players, so you need to know who triggers it, so you can notify them(the client) that they did
oh yeah i'm making sure it's the local player of course
but i'm not passing it to the gamemode at this point
no i'm considering doing it on the server
still, yeah
had other stuff to deal with
yeah you mentioned you were sending an event to gamemode from checkpoint, or was that just how you intended to do it
the only reason i'm still considering running the gamemode stuff in the actual gamemode is because it's cleaner and easier to work with
yeah that's how i'm intending to do it
sorry, confusing terms
right, well throw the character with that event so gamemode knows who triggered it
then, either in character class or charcontroller, make a Client rpc which receives a checkpoint that's been triggered
a client rpc being what exactly?
you mean i run an event on the server that runs an event on the target controller
a client rpc is just a function that's only called on the object's owner's computer
ah, yeah
it would honestly be clearer if they did
what is it called?
you set an event to "run on owning client"
ah so its all events
yeah
hence i'd have to run an event on the server that runs an event on the client telling it to run another event yadayada
right so checkpoint triggered by player, cp sends cp# and character to gamemode, gamemode runs client event telling which cp was triggered, client activates next cp
yeah i guess
god i hate it
what i don't do for cleanliness
oh that's not how the saying goes is it
anyway thanks, i'll go and see what i can do
yeah, good luck
ill try to make my AI fire something other than invisible projectiles meanwhile ^___^
everything is at times
Lol what
speak of the devil
This is super random I waiting for a school play to start for my kids
And I checked to see if someone had answered my question
and did they?
I'm swell now, but you should see me the week before I do a demo, I'm rushing to get as much functionality as possible and this channel becomes my virtual Google genie
Not really, I'll paste again
I'm a bit confused about widgets and multi-player.... My Server/Client is the VR player, who observes a scene and reports tactical priorities - , the 2nd client is the non-vr user who connects via lan on another computer and manipulates the scene using a Widget .... as long as that widget is set to replicate, will he have access to the values? or will it somehow make a seperate instance of the widget...note, the VR player never actually adds to widget to it's viewport, it's created in the gamestate so it SHOULD be accessible to all players correct?
So, I get it can store most things on game state
But if the widget is created by the game state, does it persist as well? Can I have ean event on game state that adds the widget to a certain players viewport and it doesn't create a 2nd instance of the widget?
yeah i'm feeling too stupid to answer any of that right now, but it sounds like a cool idea to have one player in VR and not the rest
widgets dont do replication
AActor is the base class for replication, but a widget is not an actor
but even if it did, you cant have one client change a replicated object and expect that the other players will see the change; replication only goes from server to client
@manic pine were you implying i'd have to go cp > gamemode > CONTROLLER > cp?
emphasis on going through the controller to reach the cp
why do you need to reach the cp again?
to deactivate it
ah right
or activate...
you can choose any number of classes to handle your Client RPC... the character, the controller, the playerstate
yeah but only ones that are actually owned by a playercontroller as such
so not a random checkpoint actor in the world?
right, for which that specific client is the 'net owner'
hmmm
no, gamestate is owned by server and replicated to everyone
ah
this seems like an awful lot of steps to go through
compared to just running stuff locally
nonsense, setting this up in blueprint would take you like 5-10 minutes when youve decided how to handle the ClientRpc
even if that stuff is harder to access from outside
and yeah it's not necessarily a lot of work
a lot of thinking eh?
ehhh more like bad design?
why go through so many steps if i can go through fewer all the same?
you can do fewer
why go cp > gamemode > controller (which has no business in this btw) > cp if i can just go cp > special actor > cp
this could technically be handled by the character on the server
once he triggers cp, he immediately sends clientrpc(also on character) back to client
two functions, both inside character
hmm
yeah i feel like this is none of the character's business
imagine that your client character just arrived at checkpoint and the player pressed 'respawn'... on server, the cp check triggers sending a client rpc to character, who is now dead...
right
it wont necessarily cause problems mind you, but its one of those potential gotchas
yeah i'm not a fan of potential gotchas
that's why i'm not just doing this locally in the first place ๐
i know it's dirty and i'm afraid of the potential gotchas in the future
you have some sort of overlap thing now on the checkpoints right
mhm
i'd suggest on overlap begin, call a function(event?) on character, i.e. CheckpointTriggered(checkpoint id# or whatever)
inside character, use GetOwnerController or whatever and call a Client RPC to activate that cp on the client
i'd rather do it one of the other ways then, lol
what are you worried about?
handling gamemode stuff in my character
(it's actually a pawn btw)
i think i might try doing it through the playerstate like you said, because the playerstate is involved anyway
arent you already doing the overlap test in character?
or is that on the actual checkpoint
on the checkpoint of course
ah well its simple then
in checkpoint class, get character get controller get playerstate?
i wish
you never even leave the checkpoint function
yeah but i'd like to involve the gamemode
i keep saying "involve" and stuff but you know what i mean
i might do multiple gamemodes
so the gamemode will have to handle some stuff
yeah but all this does is inform the player he went through a checkpoint
how you use it is up to the client
since youre letting client be authoritative
you cant have authoritative client and control gameplay from gamemode at the same time
well youre keeping track of everything on the client right
from movement to time and whatnot
which checkpoints have been passed, etc.
well, only movement really, the rest is up for debate
right, well you need to decide
because that in turn decides whether stuff should be in gamemode or on a client class
right
you cant have it both ways, or at least it'll get messy if you try
that's my problem right now ๐
yeh
so i have problems with the design like, how do i switch gamemodes if my gamemode logic is in a custom actor?
it's much easier to switch if i put it in an actual gamemode class
because that's what the engine is built for
so yeah, it's a design problem
i should just bite the bullet and do it the traditional way, even if just to try
i do think you should try to use the existing system; it's really quite decent
right
but its also not that hard to do custom client mode
keep in mind, the GameMode will spawn whichever classes you want for the client
custom characters, gamestate, playerstate, controller
wish i could spawn checkpoints for each player ๐ข
no no lol
oh just the same ones
'twas but a joke
each client can change their local version of the checkpoints without it affecting the other clients' checkpoints
yeah i know
but the gamemode can't do anything with those client checkpoints
not separately
it can do anything you want
if i go through a bunch of hoops first, yeah
one client function is pretty much all you need
but it can't be in the gamemode
haha no
but keep in mind you can have any number of e.g. charactercontroller classes... or pawn classes, or whatever
one for each client game mode you want
mhm
@manic pine do you reckon i could also use net relevancy for this?
wait no that wouldn't solve anything would it...
i'm playing with google clud in order to host my dedicated server...do you know which distribution of linux is best to use?
ubuntu, debian , cenots?
for development, you probably want something simple like ubuntu
Anyone have any experience with getting the File Descriptor of a FSocket?
if you are a developer, you want to spend the least amount of time dealing with server hosting
to that end, I would actually recommend windows server, since it's even easier to get running
@twin juniper I agree with Ubuntu, especially if you are unfamiliar with linux
my linux fanboi friend says any linux distro will do for that, says linux mint is the easiest and to avoid ubuntu for its spyware @twin juniper
@manic pine i think it works ๐ฌ
So how should setup my blueprints I have a regular client access a widget that has persistent variables?
you mean "to have a regular client..."?
Not the server
It'd two players period, the listen client and the 2nd client
But isn't the listen client ALSO the server?
yep
I swear that's what the network compendium said
it's true, struggling with it myself right now
for starters, you'll want to store the variables somewhere else
Heyo friendo's, Ive been thinking about level design for my game recently, and was wondering about how best to implement "levels". whether i build all of the game "levels" in one unreal map, or i make each level in a new map, or perhaps spawn them in as i go within one map, and if so how would i go about doing that. Also the game is 4player coop, so does any1 have any thoughts on the best way?
How i would ideally have it would be, when a level is complete, make it drop out of the sky and have the new level fall into place with all of its bits and bobs and players and enemies etc, the levels arent too large in size but would have quite a few little bits in.
My 2 problems with that are, how best to make sure everything lands in place for both the server and clients, aswell as how to build levels for a system like that, where everything gets spawned in into a location.
Sorry for the wall, any comment is appreciated. โค
@cerulean rapids how far apart can you 4 players be? can they be in different levels? Will they always fit on the same screen? can they be miles apart?
i wouldn't try to lift or land the entire level for starters, unless it's just a visual effect
better to lift or land your players
@blissful thorn yes the players will always be together, in the same arena so to speak, they will move between levels together.
same effect anyways
one level would roughly be like this, perhaps a little larger . ๐
Thats a rather small area, so you could stream the next level when its close to switching
note that test level will have a lot of detail in it, but its roughly that size ๐
How do I have the same gun attached to the first person camera and the thrid person model?
or honestly since its really small you can keep one single level and load in the new level assets and objects on the fly, at points where performance is an issue you can look into streaming
now thats the second time you mentioned streaming, is it similar to seamless travel?
Asynchronously loading and unloading levels during play to decrease memory usage and create seamless worlds.
its a way to load levels without needing to stop gameplay
huh
so do i stream another maps content into this map?
or just load it inthe background ready for a quick travel
it loads in the background, but you need it to start at a time prior to when you want the level visible
its also super simple to implement
also you can just make your levels and set this up later, right? @blissful thorn
yes
also, that previous image is for unloading the current (now previous level at that point) , here is the one for loading the next (soon to be current level)
so with this, i would build each level in a new unreal map. and then stream it towards the end of the level, and when we are ready, we travel to it, effectively loading up the new map but instantly?
yes and no, its not instantly, but the transition is hidden to the players completely when done well
the time is dependant on the content in the new level
and the clients performance
Games like Dark Souls do things very similiar to this, but since the levels are so large they will hide the trigger to load the next area a bit before you actually interact with the next level
but honestly if your game is rather small, and only has a few areas you could potentially get away with it all being in one map, especially if the maps and the enemies all use the same textures
@cerulean rapids you WOULD build each level in a new unreal map though, so you can decide later how you want to load them
but i dunno if i expressed my thought clearly
i would like the transition of levels animated nicely is all, with little to no delay
perhaps the loading could occur in the blank space, after the current level left, and befor the new level fell?
What determines moving to the next level? when all the enemies are dead?
something to that extent, there will be a clear trigger, such as all players standing in the "victory" square
you could start loading the second map at the start of the first one too
So add another trigger, something that will reliably be 20 seconds (alter for level cost as needed) to begin streaming the next level
as for dropping in the level, thats not going to be part of the level streaming , but programmed into each level once it is loaded and ready to take over
aye
What Apst said is a good idea, the game is rather small at any given point so there probably wont be any harm in loading in 2 levels at any given time
my levels are designed to be quick, perhaps less than a minute, so i could just always be streaming the next level?
Thats true to a point, it wont always be streaming as the level will probably be fully loaded after a few seconds
So you want to make sure you have some command to initiate the levels logic (ie: spawning enemies, items, enabling navmesh)
my worry is network stress, i dont want the players to have potential lag due to loading map information, or will it be a network trigger that tells them to load the level within their files?
the lag wont be from the network, it would be from cpu/gpu/memory lag
perfect.
server just sends the commands to load the levels, it doesnt actually stream the levels down to the players
my game is very gpu/cpu friendly
level streaming isnt related to streaming across a network, it means you are loading in the level at a rate that wont disrupt the player into the systems memory and then displaying it once completed
perfect.
so its completely isolated to the client!
also, as we are technically changing maps right
yes
will i have the issue of players being re given new controllers?
in the terms of UE4, you are changing the map currently in charge
You have full control of how player controllers persist
currently i am using seamless travel between the lobby and the first level, to read controller info
so the problem i had for a while, was setting and possesing players characters, before they were fully loaded in and ready to recieve replication
would i have to deal with this again, aka, do some sort of ready check
Unfortunately I'm inexperienced with replication as I do all my netcode in house so I cannot say
thats par for the course
well i will definately look into streaming
and i appreciate your time, kind person. ๐
good luck, and keep at it. Developing isn't hard, just time consuming
never before have i wanted so badly to make a simple singleplayer game as i do right now
god damn
Hi guys, anyone experienced with CharacterMovementComponent and has some time to save me from a couple of doubts?
i have an actor who has child actor components, how can i link the netrelevancy from the childs to the parent ?
@Kai#5929 I've posted it on the forums here with some detail:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1399156-some-charactermovement-clarification-needed
hey guys
I'd love to hear your opinion on how you would design this:
I'm making a multiplayer VR Game
and there are throwing mechanics
I want to trust the client
so that his throws are sent over the net with values regarding linear and angular velocity
furthermore
I don't want lag when generating the throwable object...
the player holds trigger and generates a throwable object
I basically want the client to be able to do everything regardless of his ping
and just send the result over the net
but...
the throwable object has to be replicated for the other clients...
this causes an issue
the local player on the client needs to have a copy of the throwable object but will also receive the replicated one
it's a mess
Hi everyone, a simple question, when I play my game in the editor and check the Run Dedicated Server option, the breakpoints I put in code will be hit both on the client and the server, is there anyway I can decide whether the code is running on the server or on the client?
C++
yeah that's easy then
yep that
Authority is server
AutonomousProxy is the local client
SimulatedProxy is a simulated client (not local)
So autonomousproxy is the one that will be giving keyboard/mouse/controller inputs
make sense?
Yes, thanks. But I am a little confused.
I am a little confused about the SimulatedProxy and ROLE_AutonomousProxy.
So my situation is I checked the Run Dedicated Server and play the game in editor
So the viewport I see should be a client but I am not sure which one it is.
I've put a breakpoint in this piece of code. and it gets hit.
@cursive shard If you play with 2 clients. Each client is a AutonomousProxy to itself. And then the replicated instance of the other client is a SimulatedProxy.
So my number of players is 1
Thank you very much for the link. I'll have a look and see if I can figure it out.
how TArray replication works ? i have a replicatedUsing on it and when i add 2 items, the size is 2, the callback is called 2 times once with 1 pointer to null and 2nd time with all pointers valid
@elder sable It's updated when the replication ticks. The behaviour you are describing is correct. The array changed in the server and the change is sent when the Actor replication happens (depending on net update frequency for the actor). That's why the 2 items are sent in the same tick and the OnRep callback is executed. Both adds happened in the server before the server ticked the actor for replication.
@cursive shard If you mark dedicated server, the viewport in the editor corresponds to an AutonomousProxy character. In the server, the actor representing that character has role Authority
Thank you very much @trail bloom I seem to get clear about the Role sutff. ๐
@cursive shard you're very welcome
@trail bloom So what is the good way to fill widgets from this array ? actually i remove then re add childs but it looks bad
can i know when all pointers are valid or i have to check myself ?
@elder sable Depends on what the array is.
it s a list of objects in my ship
when i load my ship interface, i load objects in my widget
@elder sable Are those objects replicated too?
yep
(i m using the child actor component, i replicate actors and i store ship objects in my ship)
Then if the pointer is in the array then it is "valid", valid being existing in memory. And they will be at least until next replication cycle
client side ?
client side yes
unless if you dont do anything weird like manually destroying a replicated actor client side and maintaining references to it
LogTemp: Warning: objects_update
LogTemp: Warning: obj 000001E61C123900
LogTemp: Warning: obj 0000000000000000
LogTemp: Warning: objects_update
LogTemp: Warning: obj 000001E61C123900
LogTemp: Warning: obj 000001E607F94F00
i don t have all pointers valid
only the last call contains all valid pointers
A null pointer is a valid pointer, just null.
but the object is not replicated yet
The array property being replicated is being initialized with size 2?
The objects you have inside the array client side may not be the same as the ones client side until they are synchronized
i call 2 times my function object_add()
so how should i do to fill my widgets only when everything is sync ?
i check it manually ?
You get a notification when the array changes client side. When that happens you should go through the array and create the widgets that you have in the client at that time
There is no way to know if what you have in the client is exactly what you have in the server since the server can arbitrarily change states and notification to clients suffer from network delay, etc
But you do know that what you have replicated in the client is something that was in the server some little time ago (your ping)
so i should loop in the array until all pointers != null then fill my widgets ?
You could go like this when the property is replicated:
Widgets.RemoveAll()
For each Elem in Array
{
if (Elem != nullptr)
{
AddWidget(Elem)
}
}
ok, is it better to use RPC maybe ?
It depends
I made an inventory system and I used RPCs but then moved back to normal replication using custom replicated UObjects as objects descriptors to initialize more badwidth heavy objects client side. There are many different approaches to be fair
ok, optimisation stuffs
If objects dont change often and they are lightweight maybe it's better to just do an RPC and send them over.
Exactly
ok i see, thanks for your time !
You're welcome!
As a client when I join a server the Widget disappears, is there a reason for that? It basically shows up for like a sec and then it's gone. I am not calling RemoveFromParent() anywhere in my code.
how do i replicate 1 variable of game started for team winning blueprint not checking of who wins?
ok found a problem what was causing that, get all actors with tag doesnt work :/ i have 2 players tagged CT or T, it returns only the server itself, if server is CT, it shows T : 0, CT : 1 and doesnt count clients
but cant fix that problem
ok fixed it
I'm broaddcasting a delegate from my gamestate to end a match (showing a UI in the playercontroller.) The Playercontroller is binded to this (shown below) and onl;y my server is picking up on this (LISTEN SERVER). Any thoughts as to why my client controllers arent catching this broadcast? Do I need to maybe go to PlayerArray[]->GetOwner() & forloop run a function in my controller instead?
GAMESTATE:
EndMatchDelegate.Broadcast(InTeamB);
PLAYERCONTROLLER: (Ran from a .1 looped timer to get gamestate & cache it on start play - the CLIENT DOES THIS SUCCESSFULLY)
void APController_Game::PollForGamestate()
{
GEngine->AddOnScreenDebugMessage(-1, 1.f, FColor::Green, FString::Printf(TEXT("[%s] - POLLING FOR GAMESTATE"), NETMODE_WORLD));
MyGameState = Cast<AAvantGardeGameState>(GetWorld()->GetGameState());
if (MyGameState)
{
MyGameState->EndMatchDelegate.AddDynamic(this, &APController_Game::EndOfMatch);
GetWorld()->GetTimerManager().ClearTimer(PollForGState_Handle);
}
}
Idk about c++ but in BP I would use multicast
i dont know why a multicast would be preferred - seems like unecessary RPC call - but doing my above proposed fix did actually work.....
for (auto e : PlayerArray)
{
APController_Game* ThisController = Cast<APController_Game>(e->GetOwner());
if (ThisController)
ThisController->EndOfMatch(InTeamB);
}
Hey guys! Is it possible to replicate dataassets?
I choose it on server and I want client to get info from it.
The problem is, server is referencing it's own dataasset object, and this object does not replicating
@wary wyvern - DataAsset is a base of UObject - which is replicate-able... so in short your answer is yes - you can replicate it.
to pass info to the client - use RPC's appropriately passing the args
Hey guys! I have project multiplayer, I want the player when is on server and disconnect connection I want the character stay on server...I want create similar system sleeping present in more game, how Rust, Ark,etc...can help me?
Yes, but I do not want to replicate this object, I want to replicate Asset reference, so I use Asset from my Content.
@worthy wasp
@cedar galleon - y ou'll have to store a reference to the loggedout/disconnected player - and place an actor at that location (the Character class pawn).
On Reconnect - search for this pawn that he SHOULD own (you'll have to have some sort of reference in the characte rclass so he knows what pawn to pickup.... IE: AccountName or some HashID) - and possess it again.
@worthy wasp Like
UPROPERTY(Replicated)
TAssetPtr<UMyDataAsset> DataAssetPtr;
@wary wyvern - i'm not sure exaclty what your trying to do.... but on server - take the information you want to pass to the client & route it through an RPC to the client - passing the args of the information you want to send.
@worthy wasp I don't have understand the system when logout...for reconnect I use possess but for logout I don't have solution
@cedar galleon - the way ARK does it - they SimulatePhysics(True) on logout/disconnect - so that hte player's mesh goes into a ragdoll .... for the cool effect of ragdoll physics.
one sec - i'll get you a link to some information on LOGOUT/DISCONNECT
@cedar galleon - https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AGameMode/Logout/
Called when a Controller with a PlayerState leaves the game or is destroyed
@worthy wasp I'm already have all the information.. They are DataAssets, that client have inside game content. There is no need to send this info over the network.
It's better to send reference to asset, so client know, hat DataAsset to use..
Flakky - "I choose it on server and I want client to get info from it."
so with that said - simply pass it a FText of the assetReference
and load it on the client
@worthy wasp not is possible with BP?
static ConstructorHelpers::FObjectFinder<UDataAsset> DataAssetToUse(TEXT("REFERENCETEXTHERE"));
UDataAsset* ThisDataAsset = DataAssetToUse.Object;```
i'm unsure in blueprints
i gave up on doing stuff core in blueprints a while ago ๐
@worthy wasp ๐ ๐
It's okay if C++. Just tried to replicete UDataAsset and TAssetPtr<UDataAsset>. No luck..
Load asset uses TAssetPtr, wich is also not replicating..
i dont know why you need to replicate anything if its locally on the machine to use as part of the packaged project (which this DataAsset would be)
server tells client - "use this asset (PassedAssetAsArg)"
@worthy wasp I have map, I have more level in the map divide in different area...when I play the player go down the landscape because the terrain, collision, etc...not is ready, how can solved this problem?
@worthy wasp The question was about "How to tell client, what asset to use"
But I got your idea. Thank you!
got a question about replication if anyone's listening
i'm working on a racing game with checkpoints that are client-side and i want to be able to set the order of those checkpoints in the gamemode
so the checkpoints themselves are clientside meaning i can't replicate them, but the order of the checkpoints should be determined serverside
what's the best way to pass the order from the server to the clients in this case?
You could ID the checkpoints and rep an array of IDs
@jolly siren i ended up setting the order in the gamemode and passing the result to the clients through their playerstate
ahh okay cool
Hi peeps! Hope someone can help us. We are developing a local multiplayer game for VR, and we got some issues with the login. We got the map, and the GameMode handles the logins, through the PostLogin node. We basically grab the controller, pick the player name, create a pawn accordingly (spawn location + color is fixed for client names) and then possess those pawns with the login controller. However, we got a "bug" or we are just messing something up, not sure to be completely honest. So basically what happens is that clients keep logging in, and they work perfectly, up until the third client. When the third client logs in, it is not possessing the spawned player, and ends up at 0-0-0 inside the map. If one of the previous players exit, sometimes the possess pops back on the third client, and we can move around, shoot, etc, like nothing bad happened at all. All events are reliable, and we have no reliable event overflow (checked logs + running with custom RELIABLE_BUFFER value).
So a quick note of the process of logging in:
Post Login -> Cast Controller -> Get Player Name -> Spawn Pawn -> Posses said pawn
Any ideas where we might be messing up?
Tried smashing the whole login process with printing, and it does not get stuck anywhere at all.
I'm having issues with my multiplayer game, I've got basic inventory functionality up, but I'm trying to configure the replications. I havent got my head completely around how it all works. What kind of replication would I need for [Custom Event] Pick up item -> Add to inventory -> destroy item in world.?
Right now I assume it'd be multicasted and reliable?
Any help would be greatly appreciated. I've checked out tons of tutorials and nothing seems to clear this up for the exact cercumstance I'm looking at. Thanks!
In order for a multicast to work, it has to be run from the server, otherwise it will only run on the client that called it. If your inventory events are handled by your pawn, then you have to add 2 custom events: one server, and one multicast. When called on the pawn, use the "Switch HasAuthority" node (if on BP), and if it has authority (server), then you call the multicast. If it is remote (client), then you call the server event, which then calls the multicast event.
Ah, I was wondering how switch has authority comes into play..
So I will need to call this EVERY time I need to do anything related to client-client interactions?
Pretty much. The server handles almost everything in Unreal
No, you only want to call the multicast if it has authority (is the server). So if it is remote you want to call another event, that executes on the server, and have that event call the multicast
that way you always reroute it to the server, because only the server can call multicasts
Damn I'm pretty confused
Its 4am here, gonna call it a night and pick it up again tomorrow. Thanks for the help friend!
pm me tomorrow if you want
I'm having a weird issue where when I connect to my server the player will have a 0.5 second view under the world, than snap to the player start.
Gamemode has everything set properly... any thoughts?
There is a default camera that is spawned into the world at 0,0,0 I believe so its probably that. As to why its happening hard to tell without code
Yea, that sounds exactly it, hmmm
@tawny parcel @twin juniper Camera is not the right word here, as Cameras in general are just "placeholders" for a location.
The actual view you see can also be an Actor. "SetViewTargetWithBlend" is usually used to move the View to another Actor.
That will then prioritize the offset coming from a found Camera Component.
For your mentioned issue: Without having a Pawn possessed (which becomes the mentioned Viewtarget), the PlayerController/PlayerCameraManager will be the Viewtarget.
And that sits at 0,0,0 when you spawn it.
You may want to introduce a loading screen (:
if you look in the outliner though it usually shows a camera
It does, but that's just because we humans can better work with thinking about the camera
The Cameras in UE4 aren't actually Cameras that records the scene :P
Yeah, they are only location
And Rotation
My point is, that non-cameras can also be the viewtarget. Which here is the PlayerController when you join
He might be able to shift the viewtarget to a camera in the scene in the beginplay of the Controller
But i don't know if that kills the early 0.5 s
Can be, not sure. If it does, then only to have a viewtarget as camera.
I'm kinda sure it prints the controller or manager if you print the viewtarget
@thin stratus If I want to replicate the movement of my custom pawn, I don't use AI controller or Character class. Do I need to extend UCharacterMovementComponent ?
Or can I just replicate the pawn normally
Think RTS units
I am sure I read that actors that are set to replicate have thier movement and rotation automatically replicated
location and rotation update normally on every actor
Doesn't have to be a pawn
But you have 0 interp on clients afaik
You can override the MovementComponent if you want though, but that's a lot of code digging
And if you want to use the CharMovementComp, you are probably force to have a capsule component as root afaik
@twin juniper
@thin stratus How much work is it to send my own packets over UDP using unreal? I was looking into UChannels, I think I can just create one and then send my own packets over this channel to server? Then I don't need to use replication at all. I don't really need replication I would be fine with just clients sending position updates and actions.
and having a seperate client-server
Shouldn't be that hard? Idk, never done it
failing that I can integrate a third party lib I suppose. As I am not gaining anything using replication
While creating a session, I create a custom setting with "SessionSettings->Set(FName(TEXT("MatchType")), MatchTag, EOnlineDataAdvertisementType::ViaOnlineService)" ,where MatchTag is a FString that I set based on diffrerent gamemodes (1v1, 2v2, etc)
While finding sessions I use a custom query with "SessionSearch->QuerySettings.Set(FName(TEXT("MatchType")), MatchTag, EOnlineComparisonOp::Equals)"
But I am still getting result that have differing Matchtags ? shouldn't this query only find sessions with the same matchtype ?
Basically I wish to filter sessions based on their types, the shooter game example had something similar,
HostSettings->Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineDataAdvertisementType::ViaOnlineService);
SearchSettings->QuerySettings.Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineComparisonOp::Equals);
@twin juniper if you are doing it on BP's the easiest way to know when a net update has happened is having a location and rotation variable set it to "onrepnotify" inside that notify you can do with that new location whatever you want, im doing client smoothing with a custom pawn and it looks really good
Zak M explains it here very well
@pallid mesa ???
Akin to what cedric said of movement replication interpolation on clients
But you have 0 interp on clients afaik
@pallid mesa I have an actor that is basically my "AI" already rotating and moving alone using custom pathfinding.
Is that actor a pawn?
It can be
Or a character?
If you can fit its collision in a capsule and it will move like a "human" use character
If you need something more "custom" use pawn
Soldier -> character
nah
Tank -> pawn
Then youll need to handle collisions by yourself
Then discard character
right but if I want to replicate the actors movement
Easy, read the link i sent
@pallid mesa Thanks, theres some useful stuff in that link
:) also check in AActor the NetUpdate keyword in the engine's code, maybe you are able to find something helpful
really I dont like replication. Its quite frustrating I prefer the server to be seperate from the client
I can make sense of it much easier
nope. I am thinking I wont even use replication but if my attempts fail then at least I can fall back on that
I dont really need client side interp for RTS
That is if you are using replication
Yes it will be
I will do all movement on the client
server just sends position to client once every 10 frames and client smooths
no im not replicatiing the whole actor
the actor just moves
the client is just a dumb renderer
sending postion updates
and recieving
nope
I just send the position from client -> server then server ->client ok
add in some artifical delay
nope
Server is just storing locations, it doenst reply imediately
or to every call
client->server can happen 60 times then server->client once
YE i think I need it
๐
See you in 2025 at game launch party
So
according to this: https://docs.unrealengine.com/latest/INT/Programming/Online/Steam/index.html
An overview of Online Subsystem Steam, including how to set up your project for distribution on Valve's Steam platform.
I have to copy the 4 binaries listed into my Steam plugin directory
problem is - I can't find steamclient64.dll anywhere.
It's not in the SDK nor in my Steam client folder
This whole thing seems outdated, the #define STEAM_SDK_VER TEXT("Steam141") stuff is wrong too
I see the .dll in my client folder on my end...why do you say the define is wrong?
Because that file doesn't exist for me
I don't see the PCH, but the file without it has the same line
That said actually, I'm on a launcher build on this computer, where the article notes that it's for the source build
Have you built the engine? Possibly that PCH doesn't show up until you've built it
I've built it, and I did try changing it in the non-PCH header, I get a "macro redefinition" error
The system's definitely changed.
ok been scraching my head about this for weeks now cannot get ot solved, Anyone know how to fix this
When running a GetActorsInRadius() on server and on client, there's no way to ensure that they receive the same ordering of actors is there?
You could sort them by something that would be the same on both client and server
@unborn nimbus
Yea I thought about that. I was just curious if there was another way. THanks
@stark dome Any idea what to sort by? is there like an internal Actor ID or something like that?
I'll drop this here again, maybe this time ^^
Hi peeps! Hope someone can help us. We are developing a local multiplayer game for VR, and we got some issues with the login. We got the map, and the GameMode handles the logins, through the PostLogin node. We basically grab the controller, pick the player name, create a pawn accordingly (spawn location + color is fixed for client names) and then possess those pawns with the login controller. However, we got a "bug" or we are just messing something up, not sure to be completely honest. So basically what happens is that clients keep logging in, and they work perfectly, up until the third client. When the third client logs in, it is not possessing the spawned player, and ends up at 0-0-0 inside the map. If one of the previous players exit, sometimes the possess pops back on the third client, and we can move around, shoot, etc, like nothing bad happened at all. All events are reliable, and we have no reliable event overflow (checked logs + running with custom RELIABLE_BUFFER value).
So a quick note of the process of logging in:
Post Login -> Cast Controller -> Get Player Name -> Spawn Pawn -> Posses said pawn
Any ideas where we might be messing up?
Tried smashing the whole login process with printing, and it does not get stuck anywhere at all.
@raven viper - how are you testing? Standalone or PIE?
Packaged version + Standalone as well, same issue
i have a similar problem with the exact same scenario in PIE - 3rd player actually crashes my editor
can you throw out your POSSESSION (PostLogin) script?
I vaguely remember that the default port was changed in 4.18. The new one is "77777" instead of "7777" right?
@twin juniper 17777 for me
I can't find the docs where I read about it
ALso, I'm supposed to be able to set it myself
I remember seeing a screenshot from project setings
But I can't find the setting
@twin juniper Editor Preferences > Level Editor > Play?
under Multiplayer Options
but that's for PIE i suppose
heh yeah np but it's for PIE though
@small temple I think they talked about it in the 4.18 patch notes stream, and they said it was for the server, not necessarily just PIE
yeah I'm not sure now
I've been using steam where I don't have to care about opening ports, direct connection is a little different though
heh
well i don't get it anymore
i'm trying to replicate a variable from the client to the server in my playerstate
exactly the same way i'm doing it somewhere else
and it doesn't work
like this
doesn't seem to be anything wrong there
right
but it doesn't work
well maybe i'm asking a bit prematurely because i haven't spent multiple hours troubleshooting this yet
but as far as i know, it should work
are you printing the values of "currentRacespanServer"
or how do you know it's "not working"
and you're sure the owning client is firing the timer?
that shouldn't matter
yeah that's not it
if it's non owning it just won't do the RPC
right
so yeah i have no idea why this isn't working
actor is set to replicate, always relevant by default
so i guess i'll have to do the timer serverside
that is better anyway
yeah it's complicated in my game @twin juniper
it always is ๐
anyway i shouldn't have to do anything more than calling the timer on the server and putting it in a replicated variable right?
because that's not working on my client, hmmm
can the variable be different for different clients?
or is it one global timer for all?
if so, you should do it GameState
it's an individual timer
i run it in a component on my playerstate and then pass the result to a replicated variable in the playerstate itself
bit obsolete to pass it to the playerstate but whatever, i'll change that later
just make sure that the server sets the variable, and it should work
yeah i was about to say, i guess it's because i'm setting it on tick?
make sure that you're using the server side tick