#multiplayer

1 messages ยท Page 330 of 1

twin juniper
#

this 4.16 ?

twin sorrel
#

4.15

#

aussie net... takes a bit to update... been putting it off

twin juniper
#

well they never touch the flying project ever ๐Ÿ˜› ill check it out

twin sorrel
#

well, i was thinking of a procedural racer

#

but i have had like 20 ccorrupted projects due to splines

#

when trying to gen a proedural spline

twin juniper
#

do both of your players spawn in at same time? or couple miloseconds till 2nd one spawns in ?

twin sorrel
#

i think its delayed

#

not sure

twin juniper
#

idk hit play a bunch of times not getting the problem......... however if i turn dedicatedsrv on i get the problem 100% of the time

twin sorrel
#

yes!

#

thats my problem

#

i remember i changed something

#

then it spawned a few times

#

actually

#

idk

twin juniper
#

u make sure to delete the pawn the level comes with?

twin sorrel
#

no...?

#

i haven't hanged anything except for replicate a few variables

#

ooh

#

and

twin juniper
#

for multiplayer its best to delete that pawn, so the player start takes over

twin sorrel
#

ive networked movement

#

oh

#

no i did

#

yeah soz

#

thought u meant the blueprint sorry

#

this has happened with all of my networked projects

#

any ideas?

#

are you still there?

twin juniper
#

ASKIN THE LORD TO FORGIVE ME I SHAT MYSELF AND COULD NOT SOLVE THE PROBLEM

twin sorrel
#

oh

#

ok

#

so.. should i not do it or something

#

idk how to do it

glad sedge
#

Do I need an OnRep if I'm already calling a function with RPC

fossil spoke
#

OnRep is for Variables @glad sedge not sure what your on about

twin sorrel
#

@fossil spoke do you know how to fix one of my players spawnign at 0,0,0

#

it's a new project, 2 player starts.. when i set it to dedicated server it happens, not on non-dedicated

fossil spoke
#

Is it trying to be spawned inside Geometry and it cant resolve it?

twin sorrel
#

umm... i have the player start set to adjust location

#

it happens half the time

fossil spoke
#

They arent overlapping any solid geometry

twin sorrel
#

the player starts aren't

#

they are well up in the air

fossil spoke
#

Does the character fall to the ground or does it remain in the air?

glad sedge
#

@fossil spoke ah I mean OnRep_..

twin sorrel
#

it's the flying project

#

and if you are asking if they are in a collider or something, no they aren't

fossil spoke
#

Does it happen in an blank level with just an single PlayerStart?

#

Does the pawn have an SpringArm?

twin sorrel
#

i believe so

#

^^ does have spring arm

fossil spoke
#

Disable the Springarm and see if that changes anything.

twin sorrel
#

ok will getbakc to you

fossil spoke
#

@glad sedge If you dont include an OnRep_ as required you usually get an UHT error in VS im pretty sure.

#

So if its still compiling you may not need one.

glad sedge
#

hrmm

twin sorrel
#

oh wow

#

devils

#

it worked

#

idk why

glad sedge
#

I'm still strugging with the architecture

twin sorrel
#

but they spawn very close when it seems it "wouldn't work"

fossil spoke
#

Ive had issues in the past with MP and Springarms. I cant remember how i fixed it though

twin sorrel
#

damn

#

whatcan i do

#

is there a way to assign one player to each start?

#

i thought thats how it worked initially

fossil spoke
#

You can override a couple of functions on the GameMode that control spawning behaviour. I usually just roll my own custom solution to player spawning though.

twin sorrel
#

yeah, that requires c++ tho

fossil spoke
#

No it doesnt.

#

There should be 2 functions you can override

#

Hover next to the Function category and an "Override" button will appear with a list of functions you can override

#

FindPlayerStart i think is the one you want to override.

#

Theres another one though

#

Cant remember its name

twin sorrel
#

waaattttt

#

u can use bp?

fossil spoke
#

Yes

twin sorrel
#

for mp spawning

fossil spoke
#

Yes

glad sedge
#

@fossil spoke I'm moving an actor with my character's PhysicsHandler - how does that work? I call OnServer on PhysicsHandler on tick?

twin sorrel
#

after you help brent, where is this function category

glad sedge
#

nah help Vectorz first - i'm jumping ahead of the queue

twin sorrel
#

ty :0

fossil spoke
#

Where you add functions

twin sorrel
#

like where is this inside?

fossil spoke
#

Where your function list is

twin sorrel
#

player bp??

#

like

fossil spoke
#

Ohh in the GameMode class

twin sorrel
#

yeah ok

#

so, if im not wrong.. the place you set the default pawn HUD class etc.?

fossil spoke
#

Yes the GameMode controls the default classes for a few things. You will need to have an custom GameMode class in order to override the function.

twin sorrel
#

i cant use the default one?

fossil spoke
#

@glad sedge Networking Physics movement isnt super easy lol

twin sorrel
#

already done ๐Ÿ˜ƒ

#

cuz ive gota custom "physics movement"

glad sedge
#

welllllllllllllllllll shit

fossil spoke
#

What type of movement is it? An thruster or something

glad sedge
#

Handler

#

Not overly complex - just a transform update

twin sorrel
#

yeah

#

but i have made it more complex

#

i networked physiccs based movement here tho

#

cuz i added thrust

#

to "aerial"

fossil spoke
#

Im not an huge fan of Physics networking. I usually avoid it if i can.

twin sorrel
#

lol

#

yeah

#

it sure is iffy

glad sedge
#

Hrmm

#

Yeah, look I can probably just get away with a standard transform

fossil spoke
#

Im probably the wrong person to ask tbh. More experienced guys on here that have tackled it.

#

If you let the server run the simulation and just push an transform update to the client that might be sufficient?

glad sedge
#

yeah I think that's the way to go

#

I'll treat physics as sugar

fossil spoke
#

It gets complicated when you let the clients simulate it as well.

twin sorrel
#

oh yeah

#

screw that haha

fossil spoke
#

I love physics as far as cosmetics goes. But networked physics to me is to much hassle for what you get. You can easily fake "physics" more cheaply.

twin sorrel
#

yeah

#

was about to say

#

faking physics is best of both worlds

glad sedge
#

I've done the classic mistake of starting my project and going 'Oh I'll make it multi

#

I've only been at it for a day so it's starting to make a little more sense

fossil spoke
#

Multiplayer is not something easily tacked onto an existing project.

glad sedge
#

Ah fortunately I can (and will) discard it

twin sorrel
#

lol

#

legit

#

same exact thing i did

#

i love the project

#

just cant network it

fossil spoke
#

Its all experience. These mistakes and pitfalls make you an better developer/programmer at the end of the day anyway so when you think about it your not really losing anything.

#

Only time really.

glad sedge
#

heh yeah it's really how I learn

twin sorrel
#

yeah, most devs are pretty old

glad sedge
#

make, break, learn move on

#

how the hell is Rama not employed by Epic

fossil spoke
#

As long as you understand where and why you went wrong you will come out better for it

twin sorrel
#

how long have you been doing ue4

#

or ue

fossil spoke
#

Rama is an great community member. I wouldnt hire him though lol

#

Awesome guy

glad sedge
#

why is that?

fossil spoke
#

His code is messy as shit though lol

glad sedge
#

o rly? lol

fossil spoke
#

3+ years UE4 i came from Unity and XNA back in the day.

#

Originally an C# dev

twin sorrel
#

yes

#

same

#

Unity [js > c#] > UE4 [BP > i want to move toc++]

fossil spoke
#

There is an learning curve to UE4 C++ but it is definitely something all blueprinters should try and learn.

#

My workflow generally involves prototyping in BP and then moving everything to C++

glad sedge
#

I'll do that once I'm more experienced with C++

#

Right now the journey is its own reward etc

twin sorrel
#

yeah

#

well, i cant really get irl help for it

fossil spoke
#

Porting BPs to C++ is an great way to learn it

glad sedge
#

I'm glad I got a reasonable amount of exp with BPs

twin sorrel
#

still in high school

zinc loom
#

I think I may owe @heady merlin a beer for writing the advanced sessions plugin...

glad sedge
#

What is that for? Web sutff?

zinc loom
#

Steam

glad sedge
#

oooh

twin sorrel
#

oh

glad sedge
#

Yeah I hear steam stuff is a right pain

fossil spoke
#

Yeah its pretty good

glad sedge
#

I look forward to being crippled by it eventually

twin sorrel
#

^^

fossil spoke
#

The Steam OSS needs an update haha

zinc loom
#

im feeling so jubilated that my linux dedicated servers aren't crashing or failing to regognise steam ๐Ÿ˜„

twin sorrel
#

Hey @fossil spoke ive looked at the override stuff but lol.. idk where to start omg

fossil spoke
#

Just write your own spawning system.

twin sorrel
#

and was the other one 'choose playerstart'

fossil spoke
#

Ah yeah thats the one

zinc loom
#

ive got a bp spawning system, but it needs a lot more work

twin sorrel
#

yeah

fossil spoke
#

I usually just reserve PlayerStarts for Spectators and write my own spawning solution for Players

glad sedge
#

man isn't debugging code on C++ easier

fossil spoke
#

Depends on what the bug is ๐Ÿ˜›

glad sedge
#

heh

#

yeah true

twin sorrel
#

do you guys know where i could find some example bp spawning systems

#

because i'm either thinking the wrong way aobut it or

#

im confused

fossil spoke
#

I have an MarketPlace package thats an spawning system ๐Ÿ˜ƒ

#

It should be on sale at the moment i think

#

Did the summer sale start yet?

glad sedge
#

Just enter your cc into chat..

twin sorrel
#

what's cc?

glad sedge
#

creditcard - just a joke

twin sorrel
#

ohhh

#

haha ywah

#

soz i wont buy the asset devil

#

im a high school student, i aint got monay fo dat

fossil spoke
#

Its $5 ๐Ÿ˜ƒ

twin sorrel
#

yeah

#

cbf tbh

fossil spoke
#

All good mate haha

glad sedge
#

lol

#

He's not made of money!

twin sorrel
#

๐Ÿ˜ƒ ^^

fossil spoke
#

well he should be ๐Ÿ˜พ

#

๐Ÿ˜›

twin sorrel
#

well, technically i am

#

my organs are worth alot

#

probs JUST enough to scrape that asset

fossil spoke
#

Just mail me your Kidney

twin sorrel
#

ill sell em

#

๐Ÿ˜ƒ

fossil spoke
#

Hehe

twin sorrel
#

but, like is it hard to make something really basic.. like each player takes 1 of the playerstarts

#

as long as i have the same amount of starts?

#

ik why u made the asset, theres fkin nothing on the internet about it

glad sedge
#

API ?

fossil spoke
#

Just OnPostLogin assign an player an number 1 to n based on Player count

#

Then use that to assign them to an spawn point

glad sedge
#

foreach players as p
playerArray[i] = p

#

that sort of shit

twin sorrel
#

wow, this override thing opens up so much networkign stuff

#

i didnt even notice it before

zinc loom
#

mines a bit crude

fossil spoke
#

If you havent already you may also want to familiarize yourself with the GameState and PlayerState classes and their importance in the networking architecture

twin sorrel
#

yeah

#

lol

#

ik this isn't about networking, however do you guys know why my procedural spline doesn't work

#

like, i want to make a spline with x points

#

and i do a for loop

#

and use add point

#

and add 100 to the X position of the last point for the next point

#

and even thatcrashes the project

#

and i can't open it again

fossil spoke
#

You didnt accidentally create an infinite loop?

glad sedge
#

Should I have any issues with passing an actor via reference should I ?

twin sorrel
#

well, i did a for loop and set the max to the variable 'points'

#

and points was on 10

glad sedge
#

To another actor &SomeActor

#

Or should they always be pointer?

fossil spoke
#

You shouldnt really need to pass an actor as an ref. The pointer is pointing to the object ref anyway

glad sedge
#

yeah, guess I shouldn't buck the trend.

twin sorrel
#

Hey, devils

#

and it's saying it can't find a start

#

ohwait

glad sedge
#

damn it - for multi - logic inside the PC or the Pawn?

#

Singular pawn.

#

ACharacter

fossil spoke
#

What logic do you want for it though?

glad sedge
#

Basic stuff - PC - click on Actor - check if actor is of certain class / type - tell AChar to "hold" said item

#

Right now my PC is passing through to the char the actor to pick up

fossil spoke
#

Do the pickups only persist as long as the player character is alove or are they like bind on account or something.

#

If they persist as long as the character. Just put it on the character.

glad sedge
#

ok

#

It's bound to a singular character

#

So just an avatar of the player, basically.

twin sorrel
#

argh

fossil spoke
#

There is usually alot of differing opinions on where player input should be handled PC or Char. I usually subscribe the idea that the character should own its input controls. Others think the PC should

glad sedge
#

I think dividing it between the will vs the physical implementation makes sense

twin sorrel
#

one of em are spawning in the ground

glad sedge
#

well

#

Where's the array loop?

fossil spoke
#

What is GetPlayerControllerID

glad sedge
#

You're telling that BP to put all the actors inside an array

#

Shouldn't you get an array of all the player Controller IDs?

fossil spoke
#

Postlogin returns the most recently connected player

twin sorrel
#

yeah, i thought it triggered every time someone joined

#

and set the position, possessed it

fossil spoke
#

@twin sorrel You may need to Delay an slight fraction.

twin sorrel
#

but, is the rest of the logic right?

glad sedge
#

Wouldn't you be getting the same value for spawning zone each time ?

twin sorrel
#

but, isnt the id different

fossil spoke
#

OnPostLogin is called as soon as an PlayerController is spawned and assigned to an Player. Some other classes may not be setup yet at that point.

glad sedge
#

Cause you're returning the total size of that int as a result index, no?

fossil spoke
#

Im actually laying in bed right now. If i was at an PC id do you up an example system

#

Lol

twin sorrel
#

lol dw

#

its just

#

do i have the logic right?

#

like player 1 will have id of 0

#

so it gets 1st "spawning zone"

#

and it spawns a player at that

#

and possesses it

fossil spoke
#

Not sure what GetControllerID is actually returning though. What you should do is create an Array of Players and each time OnPostLogin is called. Add the new player to that array and use the array index they are assigned to as their ID

twin sorrel
#

get ontroller id returns 0 or 1 if u have 2 players

#

oh well

fossil spoke
#

You would then have to maintain the other end of that though as well. OnLogout you would need to remove the exiting Controller from that array

twin sorrel
#

yeah, ill try that

#

humm

#

yeah

#

well

#

cclearly this is too advanced for me ๐Ÿ˜

#

i might just give up

#

lol

#

fuark

#

cya guys

#

ty for help

#

@fossil spoke appreciate help, just donmt understnad

glad sedge
#

throw some debug code and see what you're getting

fossil spoke
#

No worries. Try tackling it another time.

twin vault
#

Did anyone try clothing with a multiplayer game? client's clothes stutter on the server, but server's clothes seens fine on client

#

im using the in engine clothing

glad sedge
#

Sorry Takain, haven't tried it.

hasty adder
#

Sounds like it's becatuddering on other clients. If whatever your doing is replicating to the server its updates won't be as smooth and instant as local client

viral mason
#

Does UE4 dedicated servers have to be on Windows?

#

Or does Linux work?

#

I'll need a dedicated server for a client to server concept

viral mason
#

Ok

#

Why do I need the source of unreal engine

tiny coyote
#

To build it for Linux

viral mason
#

The guide has untill facepalm

twin vault
#

thats not that bad

#

it has a lot of youre tho

#

lmao

languid harness
#

Has anyone here gotten multiplayer working with vr and non vr players? I had it work momentarily for a second and then it crashed and no longer allows the vr client to connect to the non vr clients

regal junco
#

Hello people! What's the best way to sync physics or at least simulated physics?
I have this item that players should be able to throw, where I'm using AddImpulse. However, this means that I'm multicasting from the server, so each client calculates the impulse and makes the throw, therefor unsynced.
What's the best approach to this?

tiny coyote
#

If you check Replicate Physics it will be in sync, at least with small diferences due to replication rate

#

You can check PrimitiveComponentPhysics.cpp ConditionalApplyRigidBodyState - its where implimentation of rigid body interpolation lays

regal junco
#

Replicate Physics meaning Replicate Movement? @tiny coyote

tiny coyote
#

yeah, sorry, my mistake

regal junco
#

But when I spawn it on the server, addImpulse, the clients only see the object where it's spawned, even though ReplicateMovement is on @tiny coyote

tiny coyote
#

have you checked Replicated in spawned actor?

regal junco
#

Yup

tiny coyote
#

have you assigned RootComponent? does it have SimulatePhysics checked?

#

is RootComponent registered?

#

you can check AActor::GatherCurrentMovement, place there breakpoint and see why replication code is not reaching

void canopy
#

Guys I have a scenario. I want to spawn a AI on server to follow one of my player. I send a RPC 'Server Call' from playercontroller to spawn AI. When I have 2 clients on server, it spawns the same ai two times. When there is only 1 client on the server it spawns 1 AI. What could be the problem here ?

tiny coyote
#

in first case there is two playercontrollers on server, for two clients, thats why it creates ai two times

twin juniper
#

hi
help me
I have a problem with my game online ๐Ÿ˜ฆ
I using Steam multiplayer and LAN:
when I want join to a lan game
I can't join, because the game say error :(, idk why
I think best I send screenshot
HELP D:

tough gyro
#

I don't think a screenshot of your game menu will help us at all

twin juniper
#

what do you need ๐Ÿ˜ฆ

solar stirrup
#

Is multiplayer in UE that easy

twin juniper
#

but where is the problem on my project ๐Ÿ˜ฆ

solar stirrup
#

Wait for somebody to answer, spamming won't help ๐Ÿ˜›

twin juniper
#

xd

regal junco
#

@tiny coyote If the root component is registed? What do you mean by that?

#

I have setup all the components to use the same root

void canopy
#

@tiny coyote I call a server function from one client, why it will replicate on another client ? As I call spawning AI from one of the controllers on the server. How to avoid such situation

#

@tiny coyote Server call for spawning AI is triigered from Input by one of the client. And I do not want this fucntion to replicate on each client, logically a server call is made from one of the client on the server , as only one of them receives input.

twin juniper
#

lol

#

nobody know how to fix my problem ๐Ÿ˜ฆ

solar stirrup
#

be patient plz

hasty adder
#

You trying to join a steam session from the same computer as the one that spawned it on same steam account?

#

@twin juniper

twin juniper
#

No, I maked on LAN

#

@hasty adder

hasty adder
#

Couldn't say off hand. There is sometimes problems connecting to your ow up address through steam so if the results are you able to connect to it through console open ip ?

sweet spire
#

kinda a UMG question but, can someone give me the basics of making all UMG widget components face the player

#

Just so i dont do this and set it for single player oops

twin vault
#

god

#

spent the whole day trying to figure why cloth simulation was so bad on multiplayer

#

turns out its only bad on the editor

#

on the actual game its fine

#

ยฏ_(ใƒ„)_/ยฏ

sweet spire
#

oh? ๐Ÿ˜ฎ

#

that should be stickied

#

lmao

#

thats pretty good to know tbh

native moth
#

@brittle sinew got it working! ๐Ÿ˜ƒ Guess I was just too tired and grumpy yesterday ๐Ÿ˜„

gaunt kestrel
#

I'm having a hard time getting my Child Actor Components to replicate properly

regal junco
#

via c++? @gaunt kestrel

gaunt kestrel
#

Ah no via BPs

#

I'm assuming construction script doesnt replicate by default?

twin juniper
#

i have a UPROPERTY variable stored in a Character that's a pointer to another object in the world UPROPERTY(Replicated) ASpecialThing* Thing; . ASpecialThing has a very short network relevancy range (about 5meters). You can see how the problem starts, if some players are not in range of this actor it will NEVER be relevant to them, unless they get in range! However on the Character it is set on Thing is always relevant to that player which makes sense.

How to make Thing network relevant to anyone near the player that has it set to begin with?

buoyant hollow
#

Does anyone have an example project with a lobby function that works with steam? Basically, want to have a lobby to invite friends where everyone can configure their weapons, etc.. and then have the host pick the map and launch the game. I've seen the multiplayer examples, but nothing with a lobby that works with steam.

twin sorrel
#

Does anyone here know about custom spawning in BP?

#

Thatcould help me

#

does the 1stplayer controllerID return 0 or -1

zinc loom
#

0

#

If called from the server

twin sorrel
#

yeah

#

cuz when i printed it onpostlogin it returned -1 and 0

#

and it fixed my spawn system by adding 1

zinc loom
#

On postlogin you'd want to add the connecting controller to an array, and then on match start or whenever you want to do your spawn in just iterate thru the array and do the spawns

twin sorrel
#

yeah

#

ik this is multiplayer section but

#

do you know whats wrong with this

zinc loom
#

Just to confuse matters further, player controller 0 on each client is the clients pc

twin sorrel
#

oh lol

#

this isnt networking

#

its just idk what is wrongwith it

zinc loom
#

So it running set spline points on the array, and then adding another point to the array?

twin sorrel
#

yeah, im makinga procedural spline generator

#

for my racing game

zinc loom
#

I know nothing about splines sorry :(

twin sorrel
#

yeah

#

its something worngwith my math tho

#

i think

twin juniper
#

Anybody else using GameSparks?

#

Is it me or does replication/movement/everything else seem extremely convoluted compared to UE's networking layer?

eternal anchor
#

it's easy

#

at least the part about coding

twin juniper
#
Using binned2.
Increasing per-process limit of core file size to infinity.
Fatal error: [File:D:\Epic Games\UnrealEngine\Engine\Source\Runtime\Core\Private\Linux\LinuxPlatformMisc.cpp] [Line: 642]
Error Presenting MessageBox: No message system available

Signal 11 caught.
Malloc Size=131076 LargeMemoryPoolOffset=131092
CommonLinuxCrashHandler: Signal=11
Malloc Size=65535 LargeMemoryPoolOffset=196655
Engine crash handling finished; re-raising signal 11 for the default handler. Good bye.
Segmentation fault```
#

trying to run my server on linux.. any ideas?

vagrant drum
#

Hi guys, this is probably a very dummy question, but relating to networking all ive been able to do is build a dedicated server, host it on azure and have a couple of friends connect.
Where in the middle of all this comes Photon for example?
In what scenarios should we consider using something like Photon?
Do we still use the dedicated server?
A general overview with some detail if anyone has time for that

sweet spire
#

pretty sure its an SDK u intergrate in to the engine

#

i think

brittle sinew
#

@twin juniper it crashes so politely ๐Ÿ˜ฎ

#

Do you have any logs?

twin juniper
#

@brittle sinew Nope, it didn't even generate a Saved folder

#

im so close, i can feel it

#

lol

brittle sinew
#

Just curious, how did you get around the SQLite thing?

twin juniper
#

@brittle sinew Instead of building from pre-compiled libraries for windows, I just compiled the SQL (C files) source code specifically for linux

#

this allows me to build SQLite for any platform.

brittle sinew
#

Ah okay, yeah

#

Without logs though, I don't really know what to say on the current issue

twin juniper
#

same

brittle sinew
#

Maybe try a memtest if it only crashes on Linux? Dunno

#

Or is this a VPS?

sweet spire
#

Question for you lethal, just a quick one, if i want to make an event thats client sided that goes off when server does any damage event

#

Do i just set it to replicate from server to client

brittle sinew
#

If you only want it to go off on the owning client, yes

#

If you want it to go off on all clients, it should be multicast

sweet spire
#

yeah, alright thank you

#

Just to get the HUD's to update thats all

twin juniper
#

@brittle sinew It's a VM, im going to try and mess with the permissions

#

this really sucks if i cant get it to work

#

because Windows servers are expensive

brittle sinew
#

I would make sure you have a pagefile running

#

I've had issues with that running high-ram applications in VPSs before

#

It might be setup by default there, I know on DigitalOcean it isn't

#

I guess it's probably what you set it to in the initial setup, haha ยฏ_(ใƒ„)_/ยฏ

twin juniper
#

Yeah, mine didn't even have a firewall

#

xD

#

Well it has iptables

#

but i dont like iptables lol

#

so I installed UFW

#

(UFW is basically the same thing, just its a lot easier to use than iptables, I think its still just using the iptables built in stuff though)

#

heyyy

#

i got it

#

And then it crashed

brittle sinew
#

๐Ÿ˜„

twin juniper
#

got some logs tho

#

o

#

i know why

#

i forgot to add my db

sweet spire
#

Anyone got any advice on storing a health value before it gets updated by replication?

#

I feel like this is a stupid way

#

I need 1 to run before health gets replicated and one to run after it does

brittle sinew
#

You have no guarantee of replication order when intertwining RPCs and RepNotifies; I know in C++ you can set up the RepNotify to send the old value

sweet spire
#

Ahh okay ๐Ÿ˜ฎ

brittle sinew
#

Or possibly just send it via a parameter in the first RPC?

sweet spire
#

hmmm good idea

twin juniper
#

@brittle sinew Hey so I got my server to run on my vm

#

However, i cant seem to get it to show up on steam O_o

#

these are the ports i opened ```
54244
8766
27015
7777
27016

hasty adder
#

Just to ask again. Anyone know how to get the port null online subsystem has picked for dedicated server after its launched?

jagged knot
#

I think the port is accessible via GetAdressURL when using c++

hasty adder
#

Yeah I saw something on that I'm using bp so might have to make something to expose it ehh

#

GetWorld()->URL.Port

#

Wonder if I can just tack this code in my own game instance class and rep aren't my bp with that child of game I just want it exposed to get when a ded spawns so I don't have to rely k. A user to configure an I I correctly lol

#

Ini

native moth
#

Question: Are event dispatcher calls replicated by default or does that depend on what event that calls its?

sweet spire
#

There not replicated by default

regal junco
#

@hasty adder isnt it defined in one of the ini files?

#

7777 per default

hasty adder
#

Yes and no. The problem I am trying to solve if it's already using 7777 it will increment and I want to be able to get the currently used one so my heartbeat to a custom master will be correct ๐Ÿ˜ƒ

regal junco
#

Ahhhh, I see I see

hasty adder
#

I'm not much a c++ coder but see what I can do to expose that GetWorld url

#

Not high on priority that's expecting users will want to host multiple servers on the same box ๐Ÿ˜‰

#

Hard enough time getting someone to test multiplayer with me hahaha

ripe cypress
#

Anyone know righ toff hand why ping always says 9999 using steam subsystem if that matters

brittle sinew
regal hazel
brittle sinew
#

Look at the dev notes there

#

^^ ๐Ÿ˜ƒ

vernal plank
#

can someone help with databases?

brittle sinew
#

If it's "how do I expose it globally" you already know what we're going to say

#

:p

ripe cypress
#

@brittle sinew , @regal hazel Thank you for the ping issue cleared up ๐Ÿ˜ƒ

twin sorrel
#

Anyone here thatcould help me with spline meshes?

hoary flint
#

I know this is a common problem

#

but does anyone have any ideas about tracking physics objects accurately on a client?

#

besides the slightly hacky "just keep resetting the position"

cloud sky
#

Help me please. I use this script to make pawn moves for every player. It works but pawn moves smoothly on server and on owning client but laggy for all other clients... Why? Btw, I have tons of this message in log, what's this means?
LogNet:Warning: UIpNetDriver::ProcesRemoteFunction: No owning connection for actor 0_Ship_C_1. Function MoveShip_Server will not be processed

brittle sinew
#

It means you're trying to call a server RPC on an object you don't ownโ€”that's not allowed

#

Take a look at the table on that page

cloud sky
#

@brittle sinew dah, I cannot understand something... log says No owning connection for actor but I have client who controlls that pawn normally...

brittle sinew
#

Yes, but each pawn on each client is trying to call that server RPC

#

It'll work fine for the owning client, but on all other clients it will throw that error

#

It's not only the owning client trying to call it :p

cloud sky
#

Well.. I can understand now a bit more... But how can I fix that in my script, for example?

sick cedar
#

Hi. does anyone have this issue ot a similar one?

Im using steam OSS but sometimes it just fails. Steam says im in the game but if i get the playername i just get the "desktop.....". Sometimes it just works and i get my steam name. I have not had this issue before 4.16.

low sonnet
#

Hey folks. I'm in quite the pickle at the moment. All I want to do is replicate an int between players. I spent most of last year working on a networked game but for the life of me I cannot get this simple integer to replicate. So below is my set up - press 1 to print the 'ReplicatedInt' variable which is default 0, press 2 to set it to 1 on the server. I'd like to think I'm just missing something obvious right under my nose, but I'm honestly at a complete loss over why this doesn't work.

brittle sinew
#

You're going to have to give a little more info than it "doesn't work" :p

low sonnet
#

ah, sorry - what I mean to say is that no replication appears to happen whatsoever. When the host presses 2, the client's ReplicatedInt does not change and when the client presses 2, the host's does not change either

brittle sinew
#

Okay. I see you're doing this on the ThirdPersonCharacterโ€”I assume the host and client each have their own pawn?

#

So there are two total pawns present on both the host and client?

low sonnet
#

yes, I belive so

brittle sinew
#

Okay.

#

I think I see the issue here, haha

#

Are you expecting the host's pawn's value to change when you call the function on the client's pawn?

low sonnet
#

Heh, i sorta was

brittle sinew
#

Well, that might be the issue ๐Ÿ˜„

hasty adder
#

Press button - run on server- get actors of class for each set value :0

brittle sinew
#

Each pawn exists on both the server and the client, but those pawns are separate from each other. Even if you call a function on the client's pawn (I mean the client version of the client pawn) that replicates to the server version of the client pawn, that won't affect the server pawn

low sonnet
#

oooooooooohhhhhh

#

yeah. I see. I remember something about this from the past. Alright, so am I to understand the host and pawn should be separate blueprints or something. Apparently I'm not too familiar with this side of things.

brittle sinew
#

Well, the "host" isn't a blueprint or even an object in a physical sense.

#

All replicated actors exist in multiple settings, and they're tied together via the network (magic UE4 resolution stuff if that's how you prefer to think of it for now).

#

So if you have an actor A that's replicated, you can refer to actor A as actor A on another client via an RPC.

#

But that doesn't mean an actor of the same type as actor A will be the same actor.

low sonnet
#

okay, I think I'm with you ๐Ÿ˜›

hasty adder
#

Host is a client but is authority and is the server. Unless dedicated server which is a host without a client

#

Every client has there own local version of the world

low sonnet
#

alrighty, thanks guys, that's cleared up a lot. Okay, so is there a proper way you can recommend to share this infomation?

hasty adder
#

Can you give a context of its end use?

low sonnet
#

i mean, share variable infomation between instances beyond local representations of those instances

hasty adder
#

So not just to server but other clients?

#

Let's take player name for example... Maybe this is an easy context to follow

low sonnet
#

sure!

hasty adder
#

You run a function to make your name bob by pressing 1

#

Nothing replicated... So only you as a client see bob

#

One sec call

low sonnet
#

(I'll brb in a sec as well)

#

sorry, im back

#

Acutally, based to what you guys have said, I think I might understand a little better what I need to do. So the context is that one player starts a 'Virus' (timer that counts to 100 on the server) and then both players can see the virus counter go up. Originally, I had it on the understanding that if both player's printed their own replicated VirusProgress variables, it would work. But I now release why that doesn't work. So instead, would it be better to not replicate the variable, but instead get the server to count and then pass the value of VirusProgress back to client using an RPC?

hasty adder
#

Uhg at work good times

low sonnet
#

welcome back, you're working late ๐Ÿ˜ƒ

hasty adder
#

Yeah ๐Ÿ˜ฆ

brittle sinew
#

The thing with that is an RPC still would need to be called for every individual client, you can't just broadcast one to a bunch of objects (dispatchers kinda work like that, but those are beside the point)

#

In your original example, that value you replicated actually still exists on the server.

#

It's just not on the server's own pawn

#

It's on the server version of the client pawn

#

Which means if you have one object that all clients can access, you just replicate the value on that.

#

The clients wouldn't access their own pawn/whatever, but they would access that communal actor replicated by the server

low sonnet
#

hmm, i see, so that one object could be 'The Host Player' in a LAN system for example?

brittle sinew
#

No, again the "host" isn't an object itself.

low sonnet
#

sorry, i mean, the first player in the game

brittle sinew
#

Well, I wouldn't design it like that, but feasibly it could work

#

There exists an object called the GameState...I would look at it as what you might want.

#

It exists on all clients and can be accessed via the world

low sonnet
#

ooh, yes, I've read a little about that. I can quite see how that would be useful in this case

brittle sinew
#

If you set a replicated variable on the server version of the GameState, that change will be propagated to all clients

hasty adder
#

If you want to see a project with some replicated stuff I have an example for download on my drop box I started a ctf example project

low sonnet
#

alright, I'll give that some research but that sounds like a good plan. I can't thank you guys enough for the help!

#

oh, wow, that would be super useful if it's no trouble. Thanks

low sonnet
#

cheers, i found it!

hasty adder
#

Most recent link some vids of what to expect I didn't tutorialize it but tried to make blue prints read easy

low sonnet
#

okay, well, that's fantastic. Thank you, I'll take a fresh look from tomorrow.

#

Well, I can't thank you guys enough, but you guys are the best! Thanks and bye for now

twin juniper
#

hey guys

#

so i have an ip of a server i want to join (without using sessions)

#

why does Open "IP_HERE" only work for 127.0.0.1

#

yet its still showing up on steam master server

#

yet i cant join via IP

#

Is OSSNull only LAN?

hasty adder
#

Port issue?

twin juniper
#

not even lol

warm pagoda
#

OSSNull. In other words... online subsystem nothing.

#

You might have issues doing online stuff when you have no online subsystem. A thought.

twin juniper
#

The thing is

#

im able to connect using 127.0.0.1

#

with steam overlay

#

and not using OSSteam

#

but the thing is

#

my web browser can go to MY IP

#

lol

#

it should be the most basic functionality

#

Connect to an IP, get that shit, load it up

hasty adder
#

Ossnulll works. But the firewall needs to be open. Some ISPs will not let you connect to your own router back to yourself. I know from testing my dedicated servers if I wanted to connect to it I had to from another network if I was using my public ip

#

Otherwise I had to use the lan address 10.0.0.x etc

twin juniper
#

my game is on steam master server

#

so i know its not the firewall

#

also

#

im not using steam OSS

#

i dont get why OSSNull is only able to connect to LAN

#

why cant it treat remote servers

#

the same way

#

i feel like the only diff is "AM I DOWNLOADING THIS DATA LOCALLY?" NO? "DOWNLOAD IT FROM IP"

#

it doesnt seem like it should be more complicated than that

hasty adder
#

Well again. The computer that's trying to connect to the server where is it network wise?

#

Same network?

twin juniper
#

yea

#

but even when i had someone try to connect

#

from outside the network

#

it did the same

#

like, the client sends a connection request, but the server just does not reply

#

lol

hasty adder
#

127.0.0.1 is loop back that will always work

#

Your connecting to yourself

#

What about your local up which would be something like 192.0.0.x or 10.0.0.x

twin juniper
#

Could I do PlayerController->ClientTravel(FString("MyIP/Game/Maps/MyMap"), ETravelType::ABSOLUTE);

#

or something like that lol

hasty adder
#

From the server computer

twin juniper
#

I know it works, i tested all my ports using nmap

hasty adder
#

Ports are forwarded on router to the server computer?

twin juniper
#

yea

hasty adder
#

Do an ipconfig on the server computer and try from another open that IP address

twin juniper
#

gonna just have to mess with it

#

i know OSSNull can do LAN and Remote IP connections, just there is no subsystem stuff like FriendsInterface, Chat, Voice, etc

#

but it should still have BASIC functionality

twin sorrel
#

does anyone know how to simulate one of the players leaving without it closing everything

twin juniper
#

@twin sorrel OPEN MAPNAME

twin sorrel
#

ahh thanks!

glad sedge
#

er newb question

#

hmm I don't even know how to ask it.

#

if I invoke a function using UFUNCTION(Server, reliable, WithValidation) - does that mean everything under that gets called depending on whether it's on the server or client?

#

side question - does PIE multi tests always look like laggy?

warm pagoda
#

When you invoke that function, it will be sent to the server, if the client has the authority for that object (IE: Owns that object)

#

If it's on the server, I believe it'll just execute.

glad sedge
#

ok

glad sedge
#

weird - my server stuff runs, but the client doesnt

warm pagoda
#

Clarify?

glad sedge
#

one sec, I'll paste some codes

warm pagoda
#

What is "server stuff"

glad sedge
#

as in role < ROLE_authority

#

ok so I have this .h
'''UFUNCTION(Server, reliable, WithValidation)
void Server_SecondaryActionPressed();'''

#

dang. how do I paste code ?

#
        void Server_SecondaryActionPressed();```
#

there we go

warm pagoda
#

```

glad sedge
#
    UFUNCTION(Server, reliable, WithValidation)
        void Server_SecondaryActionPressed();
    bool Server_SecondaryActionPressed_Validate();
    void Server_SecondaryActionPressed_Implementation();```
#
    if (Role < ROLE_Authority) {
        GEngine->AddOnScreenDebugMessage(634, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON SERVER")));
        Server_SecondaryActionPressed();
    }
    else {
        GEngine->AddOnScreenDebugMessage(622, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON CLIENT")));
        InvokeSecondaryAction();
    }
}```
#

and ```void ACastleKeepersPlayerController::Server_SecondaryActionPressed_Implementation() {

    InvokeSecondaryAction();

}
bool ACastleKeepersPlayerController::Server_SecondaryActionPressed_Validate() {

return true;

}```

warm pagoda
#

I forget what the story is with PCs/Pawns specifically about role.

regal hazel
#

Client won't run that function, it will be sent to the server and invoked there

warm pagoda
#

They're... autonomous proxies versus authority on one versus the other.

regal hazel
warm pagoda
#

Yeah, SecondaryActionPressed will never run on a client.

#

Er, excuse me.

glad sedge
#

ah ok

warm pagoda
#

It may.

#

I was mixing up your names.

#

SecondaryActionPressed, which is not an RPC, calls Server_SecondaryActionPressed which is an RPC that will run on the server.

regal hazel
#

Ohh sorry as was I

#

Hard to follow haha

glad sedge
#

sorry 8\

warm pagoda
#

No stress.

#

Why not log the role?

glad sedge
#

I am.

#

oh you mean the actual role itself?

warm pagoda
#

I mean, you can just put a breakpoint in either branch.

#

And look at the value of Role.

glad sedge
#

sorry not following why I'd need to do that?

warm pagoda
#

weird - my server stuff runs, but the client doesnt

#

So your InvokeSecondaryAction is only running on the server, but not the client?

glad sedge
#

Yeah

#

Is it because I don't have a RPC call for the client?

warm pagoda
#
        GEngine->AddOnScreenDebugMessage(634, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON SERVER")));
        Server_SecondaryActionPressed();
    }
    else {
        GEngine->AddOnScreenDebugMessage(622, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON CLIENT")));
        InvokeSecondaryAction();
    }```
#

In one case, you will tell the server to run it. In the other, you will just run it.

glad sedge
#

yeah that's what I was thinking

warm pagoda
#

Which means that if your role comparison is correct... and the client is asking the server to run it... the client is never even trying to run it locally.

#

You should probably always call InvokeSecondaryAction.

#

But only ever call the RPC if you're not the server.

glad sedge
#

Is ROLE_Authority not the server?

#

I mean, what I thought I was checking is "If the PC is not the Role_Authority, run it on the server"

warm pagoda
#

It's kind of dangerous to mix role with server vs client.

glad sedge
#

hrmm I was following a tut that was doing that.

warm pagoda
#

I mean, don't confuse a role with meaning that you're on the server or client.

glad sedge
#

oh

warm pagoda
#

Typically it may mean something, but it isn't inherently true.

glad sedge
#

yeah, good point

warm pagoda
#

ROLE_Authority doesn't mean you're on the server.

glad sedge
#

Is there something more verbose?

warm pagoda
#

ROLE_Authority just means you've got authority to do whatever you want with this thing and anyone else (if anyone) should accept it.

#

I suppose for this case, since you're explicitly dealing with server/client, it would makes sense to actually check if you're on the server or client.

glad sedge
#

Unless there's some other way I should be approaching this

warm pagoda
#

Not my area of expertise. I'm working from UE3 memory here.

glad sedge
#

heh

warm pagoda
#

But I think it's appropriate to explicitly check server/client since you're dealing with a server/client RPC.

#

Not a matter of authority.

glad sedge
#
        GEngine->AddOnScreenDebugMessage(634, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON SERVER")));
        Server_SecondaryActionPressed();
    }
    if (UWorld->IsClient()) {
        GEngine->AddOnScreenDebugMessage(622, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON CLIENT")));
        InvokeSecondaryAction();
    }```
warm pagoda
#

That seems backwards.

#

If you're on the server, why would you try to send an RPC to the server?

glad sedge
#

oh because I don't know what I'm doing.

warm pagoda
#

Server_SecondaryActionPressed() is a call to a method that'll dispatch a message to the server to run... or shortcut and just run the _Implementation version since you're already on the server.

#

You only want to send the RPC to the server if you're not on the server.

#

And regardless, you want to InvokeSecondaryAction();

#

Because if you're the server, we don't need the RPC and don't want it, or we'll just end up calling InvokeSecondaryAction twice, once from the RPC running immediately locally and again later in this function.

#

And if you're the client, you want to call the RPC so the server will get to call InvokeSecondaryAction, but we also want to do it ourselves right now, locally.

glad sedge
#

okay, so am I determining that at the right time? What I'm strugging with is when to invoke a RPC call to the server and why

warm pagoda
#
        GEngine->AddOnScreenDebugMessage(634, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON SERVER")));
        Server_SecondaryActionPressed();
    }
    GEngine->AddOnScreenDebugMessage(622, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION LOCALLY")));
    InvokeSecondaryAction();```
#

Is what you want

#

Not sure how else to explain RPCs. :/

#

Imagine that every call to a function that has UFUNCTION(Server) on it replaced with...

#
{
    Function_Implementation();
}
else if (IsObjectOwnedByPlayer)
{
    // Send a message to the server, which will call Function_Implementation();
}```
#

A function marked with Server will NOT run on the client. Period.

#

A function marked with Client will NOT run on the server. Period.

#

The _Implementation version of the function will run whever it's supposed to run (owning client for client, server for server, all clients for multicast).

glad sedge
#

So if a function runs on the server, does it then get reflected to all other clients? I mean, usually speaking - netcull aside?

warm pagoda
#

Absolutely not.

#

Where some code executes has no bearing on it running on anywhere else.

#

If you run a function on the server that happens to make client or multicast calls, then obviously that'll happen.

#

If you run a function on the server that happens to set some values on replicated properties, obviously those change will get replicated.

#

But all of that is secondary, separate, consequential to specifically what the code that's running on the server is doing, and not inherent to having made an RPC to the server.

glad sedge
#

okay, that makes a little more sense but I think I need to re-read the documentation. I'm incorrect on how the structure works and why / when you need to invoke what calls to keep everything going.

#

I found a great 5 or 6 part overview from the epic guys about replication and stuff but for the life of me I can't find it again

warm pagoda
#

It's relatively straight forward, the RPC stuff.

glad sedge
#

I want to think so, but something just isn't clicking

warm pagoda
#

If it's Server_, it's going to run on the server one way or another, be it because you are the server or because it'll send a message to do so.

#

Same with Client_.

#

With obligatory caveats of the system telling you to go to hell if you have no right to make those calls.

#

It might help you to try diagramming it out.

#

With vertical space being time

glad sedge
#

or seeing a diagram

warm pagoda
#

Hmmm...

#

What the hell is that kind of graph called...

glad sedge
#

flowchart

#

?

warm pagoda
#

Not quite.

glad sedge
#

heh

warm pagoda
#

So, you'd draw a box for client and for server.

#

Then a line going down.

#

Going down is time.

#

So you'd write next to a point on the client "Server_Foo" and an arrow pointing to the right over to the server's line and write "Received Server_Foo"

#

Then slightly further down the line "Server_Foo_Implementation".

#

Let me see...

glad sedge
#

heh

warm pagoda
#

I need to just start using my damn cheap tablet as a digital whiteboard.

glad sedge
#

I just realised the Networking and Multiplayer part isn't in order

warm pagoda
#

... how can I just take a photo with my webcam? Bollocks.

#

My phone is dead, can't use it take a photo.

glad sedge
#

regarding RPCs, if a client performs a RPC to the server, say to change their name, does the server have to a RPC to all the clients with the updated name?

#

as in, are the calls one way? Client - > Server / Server -> Client?

warm pagoda
#

Phone had just enough battery for it.

#

Calls are all one way.

#

So if you want anything to get back, it either needs to be another RPC OR replicated via variables.

glad sedge
#

righ

#

t

warm pagoda
#

Does that graph make any more sense?

glad sedge
#

Yeah it does

#

ah.. what does the last client part say?

warm pagoda
#

Sorry, shit had writing on a whiteboard, tiny space

glad sedge
#

Cticky_foo_implement?

warm pagoda
#
Call
Client_Foo_Impl```
glad sedge
#

ah

#

yeah that makes sense

warm pagoda
#

Bleh, messing with formatting so it would appear right.

glad sedge
#

that actually does make a lot of sense

warm pagoda
#

It's just messages between server and client.

glad sedge
#

Yeah

warm pagoda
#

Clent sends RPC to server, server receives and runs the appropriate function.

glad sedge
#

I think my issue is that the "server" can also be a PC and a character etc.

warm pagoda
#

And vice versa.

#

Well, server/client is the process.

glad sedge
#

Because then Server and Client become somewhat abstract

warm pagoda
#

Don't think of the server or client as objects in the world at all. They're entire copies of the world running in separate processes.

glad sedge
#

process. yeah taht's a better way to think about it.

#

yes

warm pagoda
#

(Maybe not entire copies... partial copies.)

#

Networking is a giant delusion.

glad sedge
#

Well, I know what you mean and that makes way more sense

#

And you're right, I've been trying to tie to some tangible thing

warm pagoda
#

You've just got lots of things in multiple different places all partaking in the illusion of being the same as something elsewhere.

#

Anyways, I need to eat food. After making it.

glad sedge
#

okay. Thanks @warm pagoda

warm pagoda
#

Eventually I'll remember what this kind of graph is called... Message graph?

glad sedge
#

..ah yeah, sure

glad sedge
#

do actors that are set to replicate and their movement still need calls to the server?

glad sedge
#

@warm pagoda ah sorry bout this but my client still isn't updating and i'm not sure why

glad sedge
#

god damn.

#

For the life of me I cannot get the server to recognise my client moving an object

zinc loom
#

Woooooo!!!!!

glad sedge
#

nice

zinc loom
#

Waiting for that email was more stressful than a job application

glad sedge
#

I don't call _implementation direct, do I? ?

zinc loom
#

brentwallac: the server needs to initiate actual movement. The client can call an event that calls the server RPC to do the move

glad sedge
#

yeah that's what I have

#

though I'm starting to think my UFUNCTS aren't working at all

#

for some reason

#

if I call a UFUNCTION(Server.. ) and that leads to other UFUNCTION calls, do I have to also define those as Server?

#

So my PC->callsInput->InputDeterminesRoleAuth->InvokesFunctionUFUNC(Server)->GetPawn->GetCursorCoords->UpdateMovementofActorSelected

#

Works fine being server, but when the client does it, the server doesn't see it.

zinc loom
#

client initiates, but runs the server rpc, and then the server runs the multicast rpc to actually perform the move

keen basalt
#

how to make splitscreen?

sweet spire
#

silly question but just to double check, event rep does not cost anymore bandwidth right

glad sedge
#

whoa, wait.

#

the server initiates the multi?

glad sedge
#

@zinc loom hmm that didn't seem to do it.

twin juniper
#

you bought steamworks?

#

me too xd rip my 100 euros

sweet spire
#

Does anyone have an idea how u could pawn a particle effect just on the client before the server destroys the actor with out having to multi cast?

cyan bane
#

Anyone have any experience with replicating skeletal meshes in multiplayer? Such as cars?

sweet spire
#

I replicate flying ships

#

if that counts

#

there skeletal meshes

#

@cyan bane ask away im heading out soon

cyan bane
#

So I'm trying to replicate spheres that im allowing players attach to boxes using contraints.

#

They replicate just fine, they attach, they spin (they're supposed to function like wheels)

#

But they get out of sync super easily, especially for players who join mid-game

#

Are constraints not similar to the way skeletal meshes work? Like how does a multiplayer racing game work?

#

**And that's server and client(s) on the same machine, or a different machine on a local network.

#

I thought i understood why constraints get out of sync, given that physx runs at a different rate on different machines or w/e, therefore producing different results when it simulates physics inbetween replication updates.

#

But Actors don't get oos.

#

So I'm ultra confused.

wary willow
#

@cyan bane actors don't get oooos?

cyan bane
#

Not to the same extent, no

wary willow
#

Also, not entirely too sure how others do their MP racing games...but I would probably cheat and use character class

cyan bane
#

But how would you deal with the physics of tire friction and etc?

wary willow
#

Also, what type of physics are we talking about here?

#

Hardcore sim? Or arcade game?

#

I would probably again cheat

#

With friction

#

Creating my own custom solution

#

Because unreal physics is op

#

And even more so when dealing with replication

cyan bane
#

For the sake of argument lets go with hardcore and difficult to cheat.

wary willow
#

So you really want to do this the super hard way

cyan bane
#

Well I was hoping to use whatever it is multiplayer racing games use for clients, but if they cheat then I'm out of luck there.

#

I have an idea on how to minimize oos issues with constraints, but it won't be good enough.

wary willow
#

Take a look at this site

#

Take a look at this site

#

Take a look at this site

cyan bane
#

I've read it

#

All of it, UE4 uses the 3rd solution according to him.

#

It seems like between the 3 he lists that state-sync is the more superior to snapshot interpolation, and in the comments he says that "Yes the halo engine uses state synchronization, as does Unreal engine."

wary willow
#

You are saying that incoming players are 'out of sync" when they join a game already in progress I assume?

cyan bane
#

I'd say about 20% of the time a couple of objects will be out of place. But they will become out of sync during gameplay as well.

#

And then pop into place

#

It's a hard issue to debug because I can't get it to go out of sync on demand.

wary willow
#

@cyan bane are they always relevant?

cyan bane
#

For the sake of debug, yes

#

I feel like part of the issue is constraints are, on occasion, flexible. I don't want them to be but that's just how they work.

wary willow
#

As long as they are always relevant and replicated correctly. Probably more an issue with Physics itself.

#

UE4 phyics engine

cyan bane
#

PhysX

wary willow
#

Yeah

#

All physics stuff.

cyan bane
#

I just need to minimize how quickly the physics simulation between the server and clients diverge. I'm not trying to fix it.

wary willow
#

Hmm

#

Fake it?

#

Simulate it on client

cyan bane
#

So that when it is time to update stuff the pop isn't jarringly noticable.

wary willow
#

Aye so fake it

cyan bane
#

It is simulated on client

wary willow
#

Hmm

#

On all clients?

cyan bane
#

Yes.

#

They all diverge in different ways.

#

Some don't

wary willow
#

Ah, that makes sense

#

Yeah, f**" physics

#

Do you have a gif

#

Or video

#

Showing what you're trying to do?

#

Might make it easier to come up with a solution or work around

cyan bane
#

I'll make one, it'll take me a little bit.

wary willow
#

Kk, I am sure with everyone here, we can come up with something.

gaunt kestrel
#

Hey is anyone around to help me squash this bug?

#

I'm spawning a child actor component on my players, but when I try to pick up the child actor to use it it grabs the server copy of the child actor component

glad sedge
#

post your bp?

#

not that I can be much help, I'm struggling to get the basics going

#

Is there a way to determine an actor's ownership?

brittle sinew
#

Do you mean as in GetOwner?

glad sedge
#

yeah

#

kinda.

brittle sinew
#

Kinda?

#

:p

glad sedge
#

heh

#

I'm hungover

#

what's a good way to record my ingame stuff? I need to show someone a clip of what's going on with this game.

brittle sinew
#

As in a built-in UE4 recorder or just any screen capture type program? If the latter, I would suggest Shadowplay if you're team green or OBS

glad sedge
#

cool getting OBS now

glad sedge
#

oops -

brittle sinew
#

AFAIK GetHitResultUnderCursor won't work in a setting where the PC is being controlled in a different setting

#

I would maybe pass the hit result to the server and go from there?

#

It would open yourself up to some client-authoritative issues, but some things just really can't be fully server-authoritative

#

Do yourself a favor and do some debugging.

#

When you call the function on the server from the client, do you get a valid hit result?

glad sedge
#

hrmm ok

#

Yeah, both are working

brittle sinew
#

If not, that's a big clue.

#

Okay, so you successfully receive the RPC on the server and get a successful trace?

glad sedge
#

I mean, both the server and client work with the moving of the box.

brittle sinew
#

That's not quite what I mean

glad sedge
#

dang.

#

I thinkI know what you mean

#

not sure how I'd test that differently then what I've got at the moment?

brittle sinew
#

Yeah, unless I'm unaware of some magic behind the scenes I don't see getting the mouse cursor on the server version of the client's PC working

glad sedge
#

Would you suggest creating a rep for the location? or even the hit result of the trace?

brittle sinew
#

Just a question, what triggers "ONPICKUP SET"?

#

I don't see it in any of the code here

glad sedge
#

oh that's on the box

#

I've used a custom component called Upickupable

#
    if (MyStaticMeshComponent) {
        GEngine->AddOnScreenDebugMessage(884, 1.0, FColor::Green, FString(TEXT("ONPICKUP SET")));
        //MyStaticMeshComponent->SetCollisionProfileName(TEXT("IgnoreOnlyPawn"));
        MyStaticMeshComponent->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
        MyStaticMeshComponent->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
        MyStaticMeshComponent->SetSimulatePhysics(false);
    }
    else {
        GEngine->AddOnScreenDebugMessage(222, 1.0, FColor::Green, FString(TEXT("STATICMESH COMPONENT NOT SET")));
    }
    
    //LockPosition();

}```
#

It really doesn't do much other than change the collision response channel and turn off physics.

brittle sinew
#

Okay, that's fine, yeah

#

It looks like I could be wrong, haha

glad sedge
#

about the hit result?

brittle sinew
#

Because that log occurs on the server, and the only time that's called is if you get a successful hit

#

Yeah

glad sedge
#

I really have no idea at this point.

#

and this is somewhat basic, well - so I'm told.

brittle sinew
#

Wait.

#

I have somewhat of a theory, hear me out, I could be completely wrong.

glad sedge
#

lol

#

ok lay it on me.

brittle sinew
#

Actually your check for the PickupableComponents array proves me wrong ๐Ÿคฆ

glad sedge
#

yay ๐Ÿ˜ฆ

brittle sinew
#

Hmm, that is quite odd. I was going to say since the actual log occurs on the character, you could be tracing at a default location on the server and just hitting something to go into the if

#

But, you made sure the actor you hit has a pickupable component

glad sedge
#

Yeah it checks for it - kinda like an interface check I guess.

#

Well it's a substitute of that anyway.

brittle sinew
#

I would log out what object you get inside of the hit

#

If it's the same on the client and server, good

#

If not, good I guess, because you have a lead

glad sedge
#

ok

brittle sinew
#

:p

glad sedge
#

heh

#

Yeah I'm desperate for someting at this point

brittle sinew
#

And I assume the cubes are replicated?

glad sedge
#

Yeah

#

That being said, it IS a BP SM

brittle sinew
#

Nah that's probably fine, was just confirming

glad sedge
#

just in case

brittle sinew
#

Looks good ๐Ÿ‘

glad sedge
#

damn it. I gotta jet

#

Would Actor GetName() be sufficient to test what I'm getting via hit?

brittle sinew
#

Probably, it'll give you an indication of if you're hitting the right thing at all

regal junco
#

I've got a flashlight in my multiplayer game, how do I sync up the position of the point light to where the camera is looking on all clients? It is a parent of the camera, but that's not enough haha

glad sedge
#

well I tested it and I'm getting consistent messages

#

It's also possible that maybe the client doesn't own the actor, and therefore cannot call make the Server call

#

But that would also mean nearly every interaction of a client to a server-owned actor would be done via an interface (or something similar)

fossil spoke
#

Whats the problem @glad sedge ?

glad sedge
#

ah god damn near everything

#

But you're smarter than me so maybe you can help

#

and a video

#

it shows that I can move a box as server and it'll update on the client fine. But if I do it as the client, I can move the box but doesn't update to the server.

#

And I don't know why.

#

The only thing I can think of is the actor I'm picking and moving isn't owned by the client. And therefore the RPC would not trigger. But it does trigger cause I can see it via the logs and what-have-you. So I dunno.

fossil spoke
#

Your only moving the Clients version of the Box Actor.

glad sedge
#

        GEngine->AddOnScreenDebugMessage(622, 1.0, FColor::Green, FString(TEXT("INVOKING SECONDARY ACTION ON SERVER FROM CLIENT")));
        Server_SecondaryActionPressed();
    }
    InitiateSecondaryAction();```
#

Doesn't that "InitiateSecondaryAction()" mean it'd be firing on the server version?

fossil spoke
#
    GetHitResultUnderCursor(ECC_Visibility, false, TraceResult);

    if (TraceResult.GetActor() != nullptr && TraceResult.bBlockingHit) {
#

So

#

When your client tells the server to InitiateSecondaryAction

#

GetHitResultUnderCursor will most likely not be returning what you expect

#

The Server doesnt know what your clients version of that is

#

You never told it

#

So for all it knows its cursor could be anywhere

#

You would have to perform the HitResultUnderCursor on the client, then send that to the server so that the server knows what your client wants to pickup from its persepctive

#

The client understands whats under its cursor, but the server doesnt understand whats under the clients cursor

#

Does that make sense?

glad sedge
#

Yeah I think so

#

First, is there a way I can test what the server sees under my client's cursor?

fossil spoke
#

Yeah verify that if (TraceResult.GetActor() != nullptr && TraceResult.bBlockingHit) is even being reached on the Server when the Client goes to pick something up first of all

#

TraceResult.GetActor() will most likely be null for the Server

glad sedge
#

let me test that

fossil spoke
#

Make sure that its the Actor you want, otherwise if it isnt null it could be some random Actor

#

It could assume that the Cursor is at 0,0 and just get whatever Actor is under that coord

glad sedge
#

But then I do a test for whether it has a component?

fossil spoke
#

Or just print the name of the actor

#

Whatever works for you

#

PrintString is your friend lol

#

Your also going to run into an second issue, you will also need to send the position of the mouse or at least the new position of where the Client has moved the box to back to the Server so that it can update it for everyone else as well. Since the Client only knows where hes moving the box you need to make sure the Server also knows that information (either on tick or an lower interval, usually an lower poll rate or only when the box moves significantly enough in order to snap to an new grid position)

glad sedge
#

Should I use multinet cast for that?

#

Well, hang on. First I believe I understand what you're saying. I'm calling the function that does the hit before the Server knows anything about the client.

fossil spoke
#

As long as RepMovement is on and the Server is updating the new position all Clients should get the updated position without an Multicastt

glad sedge
#

ok

#

if I do move the box though, and replicatemovement is on those actors, wouldn't that update all the clients?

fossil spoke
#

Yes thats what i just said above

glad sedge
#

yeah

fossil spoke
#

But only if the Server is the one whos doing the movement update

glad sedge
#

oh

#

ah yeah that makes sense

fossil spoke
#

Remember variables are only replicated from the Server to Client

#

Not from Client to Server to Client

#

If an Client modifies an Rep Var its only modifying it for itself

glad sedge
#

So should I tell the server by way of a FVector that updates the position?

fossil spoke
#

Yeah or if you want to optimize further there is an FNetQuantizeVector i think as well

glad sedge
#

oh, that's what that is for?