#multiplayer

1 messages ยท Page 359 of 1

small temple
#

how else can i manually add the checkpoints to the array?

manic pine
#

ah so it starts out empty then adds them as you pass them?

small temple
#

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

manic pine
#

ah thought maybe you turned them into a linked list

#

the cps

small temple
#

a linked list?

manic pine
#

current cp has previous cp and next cp

#

pointers to*

small temple
#

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

manic pine
#

sad

small temple
#

heh

#

very annoying

manic pine
#

your spaceships are running the same course yes

#

but cant collide

small temple
#

yeah

manic pine
#

but can obstruct view?

small temple
#

right now yes

#

i'll have to do something about that

manic pine
#

ye could get annoying

small temple
#

i'll have to fade them out if they get too close or something

manic pine
#

maybe make closer players on a client transparent

small temple
#

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

manic pine
#

true

#

its gonna be difficult courses?

#

or just easy but hard to master

small temple
#

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

manic pine
#

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

small temple
#

i remember that lol

manic pine
#

having to check every cp

small temple
#

tried the game like a year ago

#

that was EXTREMELY hard

manic pine
#

it was

small temple
#

but the controls in the game were horrible

manic pine
#

it was lovely too, i love the flight system once properly customized

#

the ability to go full newtonian

small temple
#

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

manic pine
#

yeah correctional thrust to go where camera points

#

just make sure they go into different high score categories

small temple
#

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

manic pine
#

yeah could be map based i guess

small temple
#

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

manic pine
#

global time tracking? ^____^

#

would be nasty with cheaters i guess

small temple
#

you mean leaderboards?

manic pine
#

right

small temple
#

yeah, no point in doing those when i have client-authoritative movement

twin juniper
#

@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

manic pine
#

what slows down?

twin juniper
#

SpawnActor

manic pine
#

where you calling it?

twin juniper
#

Also

manic pine
#

or rather, how many times per tick... all at once?

twin juniper
#

some reason the char movement tick

#

is still running

#

even tho i disable it lol

manic pine
#

have you checked if its changed somehow after game start?

#

im not quite sure how ue handles movetick off but movereplication on

twin juniper
#

it isnt being changed by me

#

lol

small temple
#

spooky ๐ŸŽบ

#

oh jeeze, GetPlayerPawn doesn't work on listen servers?

manic pine
#

what were you using to disable ticks doom?

small temple
#

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

manic pine
#

right, but what kind of function is it

#

you might not need to check at all

small temple
#

checkpoint overlap

#

i don't need need the check but it seems proper to do it

manic pine
#

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

small temple
#

yeah there is

#

and i guess you're right

twin juniper
#

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

small temple
#

are you trying to load all the npc's even if they're on the other side of the map? @twin juniper

polar bridge
#

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?

twin juniper
#

this is literally

#

the most asked question

#

can we just make a youtube video

#

and have a bot which links it to people

polar bridge
#

then it should be pretty simple to answer ๐Ÿ˜ƒ

lost fulcrum
#

@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.

fossil spoke
#

@polar bridge You shouldnt need Steam installed if its an dedi server.

thin stratus
#

@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)

compact gulch
thin stratus
#

I kinda just wrote what you need to do :D

compact gulch
#

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?

thin stratus
#

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

compact gulch
#

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 )

thin stratus
#

Yeah

#

They register via Session Functions in RegisterServer

#

Leaving Presence to false as there is no presence for them

compact gulch
#

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

thin stratus
#

Lemme check which one you mean

#

Can't reach the page

#

either github or some DNS in the middle is slow af

compact gulch
thin stratus
#

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

compact gulch
#

oh okay yours is the sessions th ingy

thin stratus
#

I would rather not use it anymore

#

If you want proper steam support, do yourself the favor and buy UWorks

compact gulch
#

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

thin stratus
#

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

compact gulch
#

hmm that's true as well..

thin stratus
#

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

compact gulch
#

it works on Steam now fully with listen

#

we do all the fancier stuff with AdvancedSessions from mordentral

#

Avatar etc

restive spindle
#

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

compact gulch
#

@restive spindle are you using a single PlayerStart object?

#

maybe you can put more

restive spindle
#

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

lost inlet
#

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?

compact gulch
#

what PR?

lost inlet
#

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

merry hemlock
#

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?

thin stratus
#

No

#

UI is not even meant for holding Data

#

It's only there to display Data

hasty adder
#

Anyone have experience with gamelift?

lost inlet
#

i do recall it's a pretty expensive service

#

even more so than provisioning the equilvilent servers through EC2

hasty adder
#

I pay 50 bucks a month for a vps and can probably host 5 servers on it running 24/7

thin stratus
#

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

twin juniper
#

Is there a massive number of actors we can have on a map at a time

hasty adder
#

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"

thin stratus
#

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

hasty adder
#

Right on. It's like free 125 hours or something

#

Not sure what that means ec2 live time maybe.

twin juniper
#

@thin stratus whats the largest number of replicated actors you have had on a map

hasty adder
#

Probably totally up to server resources

final thicket
#

P.S its fine on client while still (or atleast appears so)

hasty adder
#

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

final thicket
#

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%

hasty adder
#

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

final thicket
#

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 ?

hasty adder
#

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

next falcon
#

Is there anybody who is german and knows a lot about replication to help me with a big problem ?

polar bridge
#

@thin stratus just saw your messages. Copied those binaries over and it seems to work. Thanks

small temple
#

anyone know why a listen server pawn might return as not locally controlled after being destroyed and respawned?

twin juniper
#

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

twin juniper
#

does anyone know if i can pass variable to a dedicated server executable through a command line?

thin stratus
#

@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
hasty adder
#

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

twin juniper
#

@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!

small temple
#

heck, my stuff broke inexplicably out of nowhere and i can't figure out why

twin juniper
#

fucking no

#

god damn

small temple
#

even restoring backups doesn't help

#

exactly @twin juniper

twin juniper
#

I'm starting to get really agitated tbh

small temple
#

gamedev is a masochistic job

twin juniper
#

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

small temple
#

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

small temple
#

๐Ÿคฆ

small temple
#

oh my god

#

i think i found it

lost inlet
#

well it's even more masochistic if you don't use source control

heady delta
#

@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

small temple
#

@lost inlet lol, too early to bother for me

lost inlet
#

clearly from what you've been saying it isn't

small temple
#

well, what am i supposed to do?

#

i'm not going to pay for source control at this point in my project

lost inlet
#

learn git or perforce?

heady delta
#

@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

hasty adder
#

Ok test ec2 Linux box is up. Now compiling Linux server in front end. Lets see if I can figure this out ...

lapis brook
#

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?

hasty adder
#

Like real sessions made with steam enabled true?

lapis brook
#

Sorry. A listen server on 4.18

hasty adder
#

Steam will use its 20115 or whatever ports to tunnel through steam.

lapis brook
#

Not dedicated.

hasty adder
#

Here's the catch is this your appid?

lapis brook
#

No appid. Really early stages atm.

#

Was going to use spacewar

hasty adder
#

Right. That'll work

lapis brook
#

but with steam direct, didn't know if thats stopped working.

hasty adder
#

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

lapis brook
#

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.

hasty adder
#

The blueprint thing for a lobby and junk?

lapis brook
#

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. ๐Ÿ˜ƒ

hasty adder
#

Gah Linux server doesn want to run

hasty adder
#

Ok got info all good

regal narwhal
#

Hello, Why I cant get custom player controller in GameMode?

twin juniper
#

What do you mean?

regal narwhal
#

I cant cast another custom player controller

#

I tried with get all actors of class node but its not working

twin juniper
#

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?

regal narwhal
#

I want use 2 player controller for my multiplayer game

#

I created 2 different player controller

#

but in gamemode I cant change it

twin juniper
#

I'll pm you

regal narwhal
#

Does somebody know why I cant cast 2 player controller in GameMode

hazy haven
#

because you are doing something wrong. paste us what you have @regal narwhal

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

hazy haven
#

paste your blueprint, you can certainly cast to many player controllers from gamemode.

regal narwhal
#

its not working after red circle

hazy haven
#

can you open up that Mouse Controller blueprint while running in editor, click Debug Filter and see if any instances of that exist

regal narwhal
#

current value= none

#

and no exist eny instance

thin stratus
#

You can't have different playercontroller classes

#

You need to use different Pawn/Character classes

regal narwhal
#

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?

thin stratus
#

You can't use different controller classes

#

If you have different logic for players, it needs to be in the pawn class

regal narwhal
#

but I cant add movement component to pawn class

thin stratus
#

VR Doesn't need that?

#

Neither would a world creator

regal narwhal
#

VR Pawn might need movement

thin stratus
#

I never used a component for that

regal narwhal
#

@thin stratus thanks for anwser. I will try find another way ๐Ÿ˜ฆ

burnt meteor
#

Why should I buy UWorks?

#

@thin stratus

thin stratus
#

Cause it properly bypasses the missing features that epic probably won't implement.

burnt meteor
#

Like?

#

Advanced sessions is also good

#

So why UWORKS?

thin stratus
#

Afaik, AdvSessions isn't offering all features as it still works along the subsystem

burnt meteor
#

Still not convinced me

#

Why should I spent 110$?

thin stratus
#

I don't need to convince you. Not my plugins

#

Do whatever you want

burnt meteor
#

But u tell everyone to use it

thin stratus
#

Yeah, as I know that it completely exposes all Steam functionality

burnt meteor
#

Ok

#

Thanks

lost inlet
#

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

thin stratus
#

To be fair. The parts that the subsystem interface offers are being worked on

lost inlet
#

so other than "it has missing features" your sales pitch is pretty thin

thin stratus
#

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

burnt meteor
#

I want steam

#

I have an appid

heady epoch
#

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?

thin stratus
#

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

heady epoch
#

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.

burnt meteor
#

@heady epoch should you explain our send a pic please?

#

I am also having the Dave problem

#

Same not dave

heady epoch
#

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

thin stratus
#

Why not just doing it in the PlayerController

#

On BeginPlay

#

Limited to the Client

#

Not need to use an RPC for that

lapis brook
#

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.

burnt meteor
#

Thanks @heady epoch

heady epoch
#

@thin stratus Possibly could do that, their input is delayed due to a countdown timer

short whale
#

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?

small temple
short whale
#

oh

small temple
#

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

short whale
#

@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...

small temple
#

@short whale great!

#

remember it can mess up if it happens right after beginplay without a short delay first

small temple
#

hey guys, do event dispatchers only fire server-side or something?

thin stratus
#

Nope

#

They fire where you call them

small temple
#

hmm, i'm calling mine in a custom actor, from a non-replicated event

twin juniper
#

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?

small temple
#

why not try it @twin juniper ?

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

small temple
#

lol the avatar change

twin juniper
#

xd

#

I like this one better.

small temple
#

me too

thin stratus
#

Despite the Actor only existing on it, no

small temple
#

nah it exists on both

#

damn...

merry hemlock
#

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

thin stratus
#

No biggie (:

small temple
#

lol i'm a fucking idiot, it was only triggering on the server... because i was flying through it with the server

twin juniper
#

@small temple are u running on dedi mode btw

#

i always have that on so i know it will be running how i expect

small temple
#

nope

#

gotta make sure listen servers work for my game

#

so i test with listen servers

pallid mesa
#

Is just adding a lil bit more to the code

verbal slate
#

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

small temple
#

@manic pine you there?

manic pine
#

yep

small temple
#

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

manic pine
#

just a regular client rpc will do

small temple
#

client rpc being a run on owning client sort of thing?

manic pine
#

where are you detecting checkpoint triggers on server?

small temple
#

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

manic pine
#

right, the event contains a reference to the character who triggered it then

small temple
#

well it sure can yeah

manic pine
#

can? it must, how else are you planning on identifying who passed the checkpoint?

small temple
#

...magic?

manic pine
#

eh he he

small temple
#

ehe

#

i still can't wrap my head around this networking stuff ๐Ÿ™„

manic pine
#

this is not networking though

#

not this particular part

small temple
#

multiplayer stuff then

#

i would probably be fine if i were just doing traditional stuff like an fps or whatever

manic pine
#

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

small temple
#

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

manic pine
#

the local player?

#

i thought you wree doing this on the server

small temple
#

no i'm considering doing it on the server

#

still, yeah

#

had other stuff to deal with

manic pine
#

ah, right

#

how are you using gamemode on client?

#

^________^

small temple
#

i'm not

#

would be having an easier time if i could ๐Ÿ˜›

manic pine
#

yeah you mentioned you were sending an event to gamemode from checkpoint, or was that just how you intended to do it

small temple
#

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

manic pine
#

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

small temple
#

a client rpc being what exactly?

#

you mean i run an event on the server that runs an event on the target controller

manic pine
#

a client rpc is just a function that's only called on the object's owner's computer

small temple
#

ok yeah

#

blueprints don't use the term rpc so i had to make sure

manic pine
#

ah, yeah

small temple
#

it would honestly be clearer if they did

manic pine
#

what is it called?

small temple
#

you set an event to "run on owning client"

manic pine
#

ah so its all events

small temple
#

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

manic pine
#

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

small temple
#

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

manic pine
#

yeah, good luck

#

ill try to make my AI fire something other than invisible projectiles meanwhile ^___^

small temple
#

lol

#

i got there with an FPS game once

#

that was a pain in the ass too

manic pine
#

everything is at times

small temple
#

but not @merry hemlock !

#

he's a swell guy

#

damnit i scared him off

merry hemlock
#

Lol what

small temple
#

speak of the devil

merry hemlock
#

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

small temple
#

and did they?

merry hemlock
#

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?

small temple
#

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

manic pine
#

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

small temple
#

@manic pine were you implying i'd have to go cp > gamemode > CONTROLLER > cp?

#

emphasis on going through the controller to reach the cp

manic pine
#

why do you need to reach the cp again?

small temple
#

to deactivate it

manic pine
#

ah right

small temple
#

or activate...

manic pine
#

you can choose any number of classes to handle your Client RPC... the character, the controller, the playerstate

small temple
#

yeah but only ones that are actually owned by a playercontroller as such

#

so not a random checkpoint actor in the world?

manic pine
#

right, for which that specific client is the 'net owner'

small temple
#

hmmm

manic pine
#

actually im a bit unsure about playerstate

#

havent used it

small temple
#

yeah i'm pretty sure it works

#

gamestate too, no?

manic pine
#

no, gamestate is owned by server and replicated to everyone

small temple
#

ah

#

this seems like an awful lot of steps to go through

#

compared to just running stuff locally

manic pine
#

nonsense, setting this up in blueprint would take you like 5-10 minutes when youve decided how to handle the ClientRpc

small temple
#

even if that stuff is harder to access from outside

#

and yeah it's not necessarily a lot of work

manic pine
#

a lot of thinking eh?

small temple
#

ehhh more like bad design?

#

why go through so many steps if i can go through fewer all the same?

manic pine
#

you can do fewer

small temple
#

why go cp > gamemode > controller (which has no business in this btw) > cp if i can just go cp > special actor > cp

manic pine
#

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

small temple
#

hmm

manic pine
#

the reason you might wanna do controller instead

#

is because character can die

small temple
#

yeah i feel like this is none of the character's business

manic pine
#

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...

small temple
#

right

manic pine
#

it wont necessarily cause problems mind you, but its one of those potential gotchas

small temple
#

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

manic pine
#

you have some sort of overlap thing now on the checkpoints right

small temple
#

mhm

manic pine
#

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

small temple
#

i'd rather do it one of the other ways then, lol

manic pine
#

what are you worried about?

small temple
#

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

manic pine
#

arent you already doing the overlap test in character?

#

or is that on the actual checkpoint

small temple
#

on the checkpoint of course

manic pine
#

ah well its simple then

#

in checkpoint class, get character get controller get playerstate?

small temple
#

i wish

manic pine
#

you never even leave the checkpoint function

small temple
#

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

manic pine
#

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

small temple
#

what do you mean?

#

i mean, i get how it works but i'm not sure what you're saying

manic pine
#

well youre keeping track of everything on the client right

#

from movement to time and whatnot

#

which checkpoints have been passed, etc.

small temple
#

well, only movement really, the rest is up for debate

manic pine
#

right, well you need to decide

#

because that in turn decides whether stuff should be in gamemode or on a client class

small temple
#

right

manic pine
#

you cant have it both ways, or at least it'll get messy if you try

small temple
#

that's my problem right now ๐Ÿ˜›

manic pine
#

design is always the problem

#

implementation is just grunt work

small temple
#

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

manic pine
#

i do think you should try to use the existing system; it's really quite decent

small temple
#

right

manic pine
#

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

small temple
#

wish i could spawn checkpoints for each player ๐Ÿ˜ข

manic pine
#

you want different maps for each?

#

routes*

small temple
#

no no lol

manic pine
#

oh just the same ones

small temple
#

'twas but a joke

manic pine
#

each client can change their local version of the checkpoints without it affecting the other clients' checkpoints

small temple
#

yeah i know

#

but the gamemode can't do anything with those client checkpoints

#

not separately

manic pine
#

it can do anything you want

small temple
#

if i go through a bunch of hoops first, yeah

manic pine
#

one client function is pretty much all you need

small temple
#

but it can't be in the gamemode

manic pine
#

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

small temple
#

mhm

small temple
#

@manic pine do you reckon i could also use net relevancy for this?

#

wait no that wouldn't solve anything would it...

twin juniper
#

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?

gleaming vector
#

for development, you probably want something simple like ubuntu

blissful thorn
#

Anyone have any experience with getting the File Descriptor of a FSocket?

gleaming vector
#

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

blissful thorn
#

@twin juniper I agree with Ubuntu, especially if you are unfamiliar with linux

small temple
#

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

small temple
#

@manic pine i think it works ๐Ÿ˜ฌ

merry hemlock
#

So how should setup my blueprints I have a regular client access a widget that has persistent variables?

small temple
#

you mean "to have a regular client..."?

merry hemlock
#

Not the server

#

It'd two players period, the listen client and the 2nd client

#

But isn't the listen client ALSO the server?

small temple
#

yep

merry hemlock
#

I swear that's what the network compendium said

small temple
#

it's true, struggling with it myself right now

#

for starters, you'll want to store the variables somewhere else

cerulean rapids
#

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. โค

blissful thorn
#

@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?

small temple
#

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

cerulean rapids
#

@blissful thorn yes the players will always be together, in the same arena so to speak, they will move between levels together.

small temple
#

same effect anyways

cerulean rapids
blissful thorn
#

Thats a rather small area, so you could stream the next level when its close to switching

cerulean rapids
#

note that test level will have a lot of detail in it, but its roughly that size ๐Ÿ˜ƒ

acoustic aspen
#

How do I have the same gun attached to the first person camera and the thrid person model?

blissful thorn
#

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

cerulean rapids
#

now thats the second time you mentioned streaming, is it similar to seamless travel?

blissful thorn
#

its a way to load levels without needing to stop gameplay

cerulean rapids
#

huh

#

so do i stream another maps content into this map?

#

or just load it inthe background ready for a quick travel

blissful thorn
#

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

small temple
#

also you can just make your levels and set this up later, right? @blissful thorn

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)

cerulean rapids
#

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?

blissful thorn
#

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
#

sorry for my awfull paint

small temple
#

@cerulean rapids you WOULD build each level in a new unreal map though, so you can decide later how you want to load them

cerulean rapids
#

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?

blissful thorn
#

What determines moving to the next level? when all the enemies are dead?

cerulean rapids
#

something to that extent, there will be a clear trigger, such as all players standing in the "victory" square

small temple
#

you could start loading the second map at the start of the first one too

blissful thorn
#

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

cerulean rapids
#

aye

blissful thorn
#

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

cerulean rapids
#

my levels are designed to be quick, perhaps less than a minute, so i could just always be streaming the next level?

blissful thorn
#

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)

cerulean rapids
#

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?

blissful thorn
#

the lag wont be from the network, it would be from cpu/gpu/memory lag

cerulean rapids
#

perfect.

blissful thorn
#

server just sends the commands to load the levels, it doesnt actually stream the levels down to the players

cerulean rapids
#

my game is very gpu/cpu friendly

blissful thorn
#

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

cerulean rapids
#

perfect.

blissful thorn
#

so its completely isolated to the client!

cerulean rapids
#

also, as we are technically changing maps right

blissful thorn
#

yes

cerulean rapids
#

will i have the issue of players being re given new controllers?

blissful thorn
#

in the terms of UE4, you are changing the map currently in charge

#

You have full control of how player controllers persist

cerulean rapids
#

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

blissful thorn
#

Unfortunately I'm inexperienced with replication as I do all my netcode in house so I cannot say

cerulean rapids
#

im somewhat new to unreal and networking as a whole. :p

#

its been a struggle :p

blissful thorn
#

thats par for the course

cerulean rapids
#

well i will definately look into streaming

#

and i appreciate your time, kind person. ๐Ÿ˜ƒ

blissful thorn
#

good luck, and keep at it. Developing isn't hard, just time consuming

small temple
#

never before have i wanted so badly to make a simple singleplayer game as i do right now

#

god damn

trail bloom
#

Hi guys, anyone experienced with CharacterMovementComponent and has some time to save me from a couple of doubts?

hazy haven
#

@trail bloom sure, whats the question?

elder sable
#

i have an actor who has child actor components, how can i link the netrelevancy from the childs to the parent ?

trail bloom
halcyon abyss
#

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

cursive shard
#

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?

jolly siren
#

@cursive shard Look at the Role of the Actor your breakpoint is within

#

bp or c++?

cursive shard
#

C++

jolly siren
#

yeah that's easy then

cursive shard
jolly siren
#

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?

cursive shard
#

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.

jolly siren
#

@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.

cursive shard
#

So my number of players is 1

cursive shard
#

Thank you very much for the link. I'll have a look and see if I can figure it out.

elder sable
#

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

trail bloom
#

@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

cursive shard
#

Thank you very much @trail bloom I seem to get clear about the Role sutff. ๐Ÿ™‚

trail bloom
#

@cursive shard you're very welcome

elder sable
#

@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 ?

trail bloom
#

@elder sable Depends on what the array is.

elder sable
#

it s a list of objects in my ship

#

when i load my ship interface, i load objects in my widget

trail bloom
#

@elder sable Are those objects replicated too?

elder sable
#

yep

#

(i m using the child actor component, i replicate actors and i store ship objects in my ship)

trail bloom
#

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

elder sable
#

client side ?

trail bloom
#

client side yes

#

unless if you dont do anything weird like manually destroying a replicated actor client side and maintaining references to it

elder sable
#
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

trail bloom
#

A null pointer is a valid pointer, just null.

elder sable
#

but the object is not replicated yet

trail bloom
#

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

elder sable
#

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 ?

trail bloom
#

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)

elder sable
#

so i should loop in the array until all pointers != null then fill my widgets ?

trail bloom
#

You could go like this when the property is replicated:

Widgets.RemoveAll()
For each Elem in Array
{
if (Elem != nullptr)
{
AddWidget(Elem)
}
}

elder sable
#

ok, is it better to use RPC maybe ?

trail bloom
#

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

elder sable
#

ok, optimisation stuffs

trail bloom
#

If objects dont change often and they are lightweight maybe it's better to just do an RPC and send them over.

#

Exactly

elder sable
#

ok i see, thanks for your time !

trail bloom
#

You're welcome!

hidden thorn
#

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.

twin juniper
#

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

twin juniper
#

ok fixed it

worthy wasp
#

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);
    }

}
twin juniper
#

Idk about c++ but in BP I would use multicast

worthy wasp
#

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);
    }
wary wyvern
#

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

worthy wasp
#

@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

cedar galleon
#

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?

wary wyvern
#

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

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.

wary wyvern
#

@worthy wasp Like

UPROPERTY(Replicated)
TAssetPtr<UMyDataAsset> DataAssetPtr;
worthy wasp
#

@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.

cedar galleon
#

@worthy wasp I don't have understand the system when logout...for reconnect I use possess but for logout I don't have solution

worthy wasp
#

@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

wary wyvern
#

@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..

worthy wasp
#

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

cedar galleon
#

@worthy wasp not is possible with BP?

worthy wasp
#


    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 ๐Ÿ˜ƒ

cedar galleon
#

@worthy wasp ๐Ÿ˜‚ ๐Ÿ˜‚

wary wyvern
#

It's okay if C++. Just tried to replicete UDataAsset and TAssetPtr<UDataAsset>. No luck..

#

Load asset uses TAssetPtr, wich is also not replicating..

worthy wasp
#

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)"

cedar galleon
#

@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?

wary wyvern
#

@worthy wasp The question was about "How to tell client, what asset to use"

#

But I got your idea. Thank you!

small temple
#

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?

jolly siren
#

You could ID the checkpoints and rep an array of IDs

small temple
#

@jolly siren i ended up setting the order in the gamemode and passing the result to the clients through their playerstate

jolly siren
#

ahh okay cool

raven viper
#

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.

icy nacelle
#

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!

twin juniper
#

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.

icy nacelle
#

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?

twin juniper
#

Pretty much. The server handles almost everything in Unreal

icy nacelle
#

Appreciate the help so far, does this look right?

#

(dedicated server)

twin juniper
#

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

icy nacelle
#

Damn I'm pretty confused

#

Its 4am here, gonna call it a night and pick it up again tomorrow. Thanks for the help friend!

twin juniper
#

pm me tomorrow if you want

tawny parcel
#

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?

twin juniper
#

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

tawny parcel
#

Yea, that sounds exactly it, hmmm

thin stratus
#

@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 (:

twin juniper
#

if you look in the outliner though it usually shows a camera

thin stratus
#

It does, but that's just because we humans can better work with thinking about the camera

twin juniper
#

what?

#

Its the class Camera

#

its an actor yes

#

but

thin stratus
#

The Cameras in UE4 aren't actually Cameras that records the scene :P

twin juniper
#

I know its a viewport

#

ofc

#

๐Ÿ˜„

thin stratus
#

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

twin juniper
#

The engine spawns a default camera aswell

#

look in the outliner

thin stratus
#

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

twin juniper
#

@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

thin stratus
#

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

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

thin stratus
#

Shouldn't be that hard? Idk, never done it

twin juniper
#

failing that I can integrate a third party lib I suppose. As I am not gaining anything using replication

zenith yarrow
#

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 ?

zenith yarrow
#

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);
pallid mesa
#

@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

twin juniper
#

@pallid mesa ???

pallid mesa
#

Akin to what cedric said of movement replication interpolation on clients

#

But you have 0 interp on clients afaik

twin juniper
#

@pallid mesa I have an actor that is basically my "AI" already rotating and moving alone using custom pathfinding.

pallid mesa
#

Is that actor a pawn?

twin juniper
#

It can be

pallid mesa
#

Or a character?

twin juniper
#

It doesnt have to be either

#

its just a box

#

but I can derive from pawn

pallid mesa
#

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

twin juniper
#

Its a tank

#

or soldier

#

like RTS

pallid mesa
#

Soldier -> character

twin juniper
#

nah

pallid mesa
#

Tank -> pawn

twin juniper
#

Im using custom pathfinding

#

I dont need to use Character

pallid mesa
#

Then youll need to handle collisions by yourself

twin juniper
#

Its written in C++ yes

#

I dont care about collisions

pallid mesa
#

Then discard character

twin juniper
#

right but if I want to replicate the actors movement

pallid mesa
#

Easy, read the link i sent

twin juniper
#

@pallid mesa Thanks, theres some useful stuff in that link

pallid mesa
#

:) also check in AActor the NetUpdate keyword in the engine's code, maybe you are able to find something helpful

twin juniper
#

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

ripe raptor
#

So

#

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

brittle sinew
#

I see the .dll in my client folder on my end...why do you say the define is wrong?

ripe raptor
#

Because that file doesn't exist for me

brittle sinew
#

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

ripe raptor
#

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.

long wharf
unborn nimbus
#

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?

stark dome
#

You could sort them by something that would be the same on both client and server

#

@unborn nimbus

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?

raven viper
#

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.

worthy wasp
#

@raven viper - how are you testing? Standalone or PIE?

raven viper
#

Packaged version + Standalone as well, same issue

worthy wasp
#

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?

raven viper
#

As in for a picture?

#

Or get rid of it somehow?

twin juniper
#

I vaguely remember that the default port was changed in 4.18. The new one is "77777" instead of "7777" right?

small temple
#

@twin juniper 17777 for me

brittle sinew
#

77777 isn't a valid port

#

;p

twin juniper
#

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

small temple
#

@twin juniper Editor Preferences > Level Editor > Play?

#

under Multiplayer Options

#

but that's for PIE i suppose

twin juniper
#

@small temple Thanks!

#

I searched for "port" but couldn't find it

small temple
#

heh yeah np but it's for PIE though

twin juniper
#

@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

small temple
#

ah

#

weird, should be in a better place then

twin juniper
#

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

small temple
#

mhm

#

any of you good with replication by any chance?

twin juniper
#

sure

#

it's easier if you post the question though :b

small temple
#

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

twin juniper
#

doesn't seem to be anything wrong there

small temple
#

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

twin juniper
#

are you printing the values of "currentRacespanServer"

#

or how do you know it's "not working"

small temple
#

no i'm printing the server values

#

they just stay at 0

twin juniper
#

and you're sure the owning client is firing the timer?

small temple
#

yep

#

wait i might need an authority switch here

#

although tbh i doubt that it's

twin juniper
#

that shouldn't matter

small temple
#

yeah that's not it

twin juniper
#

if it's non owning it just won't do the RPC

small temple
#

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

twin juniper
#

that is better anyway

small temple
#

yeah it's complicated in my game @twin juniper

twin juniper
#

it always is ๐Ÿ˜‰

small temple
#

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

twin juniper
#

can the variable be different for different clients?

#

or is it one global timer for all?

#

if so, you should do it GameState

small temple
#

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

twin juniper
#

just make sure that the server sets the variable, and it should work

small temple
#

yeah i was about to say, i guess it's because i'm setting it on tick?

twin juniper
#

make sure that you're using the server side tick

small temple
#

ohhhh there are separate ones?

#

hmmm no

twin juniper
#

it's the same "tick" node

#

but if the class exists on server and client, then the tick will run once on the client, and once on the server

#

thats when you want to use "has auth" or "is server"

small temple
#

right

#

who actually has authority over a playerstate btw?

#

client or server?

twin juniper
#

server

#

server is always auth