#multiplayer

1 messages ยท Page 536 of 1

peak star
#

@queen flower I think I'm narrowing the problem down a little further. If I just Create a Session in PIE and open a level with the "?listen" option (or "listen" without the "?") then within that level if on the same device I Find Sessions, it succeeds with 0 results. It can't find its own Session it created!

#

Where did it go?

#

(This is on my project)

queen flower
#

you can only test LAN in standlone i believe

#

unless youre using the build..

#

package

#

which i guess for mobile you would have to

#

brb dinner

peak star
#

Ah ok. Maybe that's why it still comes up 0 sessions found right after creating one, even if I don't open a level

#

Huh. comes up zero in standalone mode too

#

I'll try the same on your project

#

Oh poo. I can't get it to save my changes to the UI blueprint

#

Okay I saved it

#

@queen flower I get 0 sessions found right after creating one, in standalone mode on your project.

#

I am not running Steam. Just setting up for LAN so Steam is not even logged in or running at all right now

#

My projects don't even have a Steam option. One used to work with LAN, and doesn't in Shipping build (maybe broke in dev build too? I'll have to check), and the new one I started (both 4.23) can't find sessions. I'm beginning to think maybe it's failing to create them?

queen flower
#

My project is 4.24

#

If in the engine make sure you set the number of players to more than 1 in the play drop down.

#

Make sure you're following the readme

peak star
#

yep it's at 4 players

#

I added the AdvancedSessions plugin

#

Steam doesn't matter because I'm not using that, and I confirm it's falling back to NULL online subsystem in the logs when I run it

#

(steam OSS shuts down on launch, probably because I'm not using Steam on that device)

#

Ah okay if I do New Editor window then one of the windows can make see the new session.

#

okay yeah it works on same machine.

#

Okay works the same on my project ๐Ÿ™‚ good. Interesting fact: Find Sessions seems like it cannot see the one created by the device that's already hosting the session. At least the behavior is 0 sessions found when Find sessions is run on the host, 1 Session found when run on the joined client (after creating and joining)

peak star
#

Okay I put the win64 build on two computers on the same Wifi and the 2nd computer cant find session @queen flower

#

Nope doesnt find it when I reverse who the host is. Itnworks great from editor on same.device. does not work from.built.app on separate devices over wifi

#

Session = true and LAN = true

#

In all tests

#

So i guess something must be wrong with my Wi-Fi then or with built app. Gotta figure out how to tell which one

queen flower
#

Did you set your IP to static?

peak star
#

No, I never had to do that before on my other projects before to get it working

#

If you mean configuring my router.

#

The reason for this was I wanted to create a user-friendly experience where they don't have to have any technical skills to play over their own WiFi

#

Other people playtesting at their houses didn't have to do anything to their router either; it would just work.

#

but if I did set it to static then maybe we could use that to eliminate whether it's a router problem or a build problem ๐Ÿ™‚ I'll have to learn how to do that

peak star
#

@queen flower not sure that will help: I tried specifically executing command "open 192.168.50.49" which is the ip address currently of the host, and nothing happens.

#

at least not from my android device

#

I checked host machine's firewall and set everything related to UE4 to be enabled, public AND private

#

Would having WPS on my router cause any problem?

#

@queen flower I can get to it via direct IP console command from PC joining Android host, but it doesn't find session.

#

And only if I do it on my 5G part of my WiFi router.

#

So weird

#

well I gotta go to sleep thanks for the help so far

queen flower
#

Super weird. Sorry I couldn't help more. Your issues sound pretty unique.

#

I could have time Thursday morning to help.
It's 11:17pm for me now so let me know if you'd like to spend time before noon testing some stuff

#

Maybe I can open the PC version here and host so you can join on your end?

kindred widget
#

Just being absolutely sure I read documentation correctly. I'm updating a float on tick in the client's player character. At a regular interval I have an RPC to server to set this same float variable. The variable is set to ReplicationCondition Skip Owner. This means that the server replication will NEVER overwrite what the original client's float value, right? Just the server and any other version of this character on other clients besides the one that replicated it to server.

winged badger
#

yes

scarlet cypress
#

@scarlet cypress How are you setting visibility?
@kindred widget Just normal in the Character blueprint "Event Hit" -> "Set visibility" and its replicated on the Server and on the Client.. ??

kindred widget
#

Uhh. With visibility I'm not sure? I had some issues with the character movement component over something similar. I was trying to set a variable and replicate it across all versions of that actor. I ended up having to make a reliable rpc to the server to set the variable and repnotify set the movement component's variable. If it doesn't replicate correctly for you, you may need to do that same thing.

orchid cargo
#

Trying to replicate a dash mechanic on a custom CharacterMovementComponent (c++):

I've created a custom CharacterMovementComponent so that i could do custom movements like dashing and wall running. I understand how i would do it offline but the replication part is killing me.
I cant just lerp the player location using an rpc, I really dont want to use Launch like previous examples ive seen. The last thing i tried was manually setting velocity since setting the character location over the network directly didnt work. I just cant seem to figure this out lol.

royal isle
#

Hello, what is the correct way to destroy all sessions on the client side upon loading the main menu?

woeful ferry
orchid cargo
#

previous question answered

hybrid crown
#

Hello boys, little ask :

Actually, i spawn my pawn in game mode, on a post login event. The fact is i would like to fire an event on my Pawn to initialise some usefull data, like the model should be view by other player, and the visibility for the local controller player.
The fact is i visibily can fire an event from my game mode, to this pawn, more "strange", if i fire an event from game mode, to gamestate, to my pawn, it's working 50% of the time. Any clue ?

#

okay, i finally found it, this is not replicated due to delay.

#

if i do this :

#

it's ugly, but it's working fine, i will try with a kind of ping pong event, but if anybody have a clue to manage this properly instead of putting a delay

hybrid crown
#

At least, if no one have any solution, can someone answer why in game mode, if i list all my playercontroller, their id are all -1 ?

winged badger
#

that screen is in terrible resolution

#

you should use HandleStartingNewPlayer, not PostLogin

#

unlike PostLogin, it works for SeamlessTravel as well

#

also, all your code from GameMode runs only on Server

#

i can't tell what you did in GameState with the delay, since i can't read any of that

#

@hybrid crown

oak pond
#

hey I was wondering, and is it best to make multiplayer first or later in a project? like as in start by doing the multiplayer as the first thing you do in the project or make all the other gameplay first then multiplayer

#

Ill admit I dont know anything about mp aside from tutorials and from what Ive seen its really complicated

kindred widget
#

Unless the other things you're doing are just maps and visual stuff, I'd say just start with multiplayer coding. There's too much interconnectivity between the clients and server, You'll have much cleaner coding and a lot less hassle doing it from the beginning.

oak pond
#

ah ok thanks

kindred widget
#

@oak pond Also, it's really not that complicated at first. If you want to get used to it, just learn about replicating variables properly, and RPCs, which are just normal events that execute on the same actor in different machines.

#

You'll go a really long way just knowing those.

oak pond
#

oh thanks, good to know

#

I hope to someday make a multiplayer fps

kindred widget
#

Also, for simplicity, start with a dedicated server setup first. It'll be less complicated to learn. In Dedicated, the server is a separate instance, in non-dedicated the first client and the server are the same machine and it gets a little confusing at first when feeling it out.

oak pond
#

dont you need to pay for dedicated servers?

kindred widget
#

It's a setting in Unreal.

oak pond
#

wait what

kindred widget
oak pond
#

oh wow

kindred widget
#

You can pay and host the dedicated server for your final product to let people play on better performant server machines, but that's release talk. For development it's just a setting.

#

Like I said, with it off, Client0 is also the server. So you can't just treat all clients differently than the server, since one of them is the server. It's difficult to learn around. So like I said, start with that on so that the server is a separate instance and it won't make your results weird for your first client vs the others.

oak pond
#

so wheres the dedicated server located? and what happens if you try to use that in a packaged project?

kindred widget
#

What do you mean by located? And I'm not sure how to package it. Looked it up once, but I don't remember. I haven't had a need to and probably won't for months.

oak pond
#

I mean like how does the dedicated server exist, Im not really sure how to say it but dont you have to pay if you want to use it in final like you said

kindred widget
#

When you're developing?

#

Oh, when you use it in final.

#

Yes/No. I mean that's up to you and how you want to release. Most games hire servers for it, sure. But take for instance ARK. You're free to put a dedicated server anywhere you want if you want your own little multiplayer world. I ran mine on a laptop for a few months and my wife and I played on our PCs.

oak pond
#

oohh so if I remember rightly there are free ones and paid ones

#

but Im just wondering how its set up in unreal by default and if you packaged it if it would still work

kindred widget
#

It's entirely up to you. You can release your server files and let players run their own, or keep it all official and don't show server files.

rich hare
#

hey this is kind of a weird thing i'm having for my game
here's the scenario
player 1 hosts
player 2 joins
player 1 ends the match early with a "destroy session" node (i used print string as a sanity check) around a minute after p2 joins
both are back at the title screen
player 2 cannot join or host matches
ping me if one of you knows the solution

oak pond
#

so surely players running their own wouldnt be dedicated? Im not entirely sure what you mean by showing the server files

kindred widget
#

It would be a dedicated server if you let them set up their own dedicated server. Dedicated server has nothing to do with who hosts it or where, Dedicated server just means that none of the player's clients is also the server. It's a "dedicated" process being ran somewhere other than the main player's game process.

oak pond
#

so still using their connection to host it? damn I dont know as much as I thought lol

kindred widget
#

Dunno. Haven't complicated my system with that yet. I need to at some point, but as far as learning how to generally program multiplayer, anything other than setting the play button to more than one player is unnecessary. Possibly distracting too.

oak pond
#

oh wow is that really it?

#

as long as that works once packaged, thatd be awesome

kindred widget
#

To do packaged stuff, you need to learn about creating sessions. And for that I recommend not using a dedicated server unless you want to learn how to package one. Just went looking again. There's a few videos on it. I went with the other option of just learning how it works and sticking with non dedicated. Easier on players that way anyhow, usually.

stoic pebble
#

Heyy, I've got another question about the World Outliner ๐Ÿ˜„ Is there any way to test ServerTravel in PIE Mode or have the World Outliner work atleast for the Server World in Standalone Game Mode?

buoyant wedge
#

Hello, I have problem to set a multiplayer linetrace in a multiplayer FPS. How can set when hit player, the player hit lost health? The server hit player but client to client i don't know ho set.

bitter oriole
#

Clients can't interact with other clients directly, you have to go through the server

buoyant wedge
#

Ok

#

I had try to set the line tracer function on server... But didn't work ๐Ÿ˜…

kindred widget
#

Generally the way to handle that is to rpc from the client saying they hit something with the line trace, to the server. Then the server confirms it in whatever checks you want to run and if true call a multicast that plays the 'damage' event on all clients and the server.

peak star
#

@buoyant wedge easiest way is to use ApplyDamage event. It knows for itself to only run on server already, then on the receiving end you can define what happens when it gets there.

kindred widget
#

True that. Hadn't considered that was a server function. Still playing around with spawning projectiles and haven't quite gotten to damage applications in multiplayer.

void nest
#

And if it's multiplying by 4, then why is it divided by 4 in the first place?

#

it doesn't make sense to me at all o_O

buoyant wedge
#

I have set the apply damage. But now when I hit a character all character (server and client) take damage

oak pond
#

wait so does a normal line trace and then cast to itself not work?

kindred widget
#

@oak pond What do you mean by cast to itself?

oak pond
#

like for example if its third person and then you do line trace -> hit actor cast to third person -> * damage script * would that still work

#

for if theres multiple of the same actor in the map

#

as far as I know that works for most things

kindred widget
#

Sure, that should work. You'll have a much easier time using the damage interface already built in though. No need to care about what you hit, just apply damage to the actor variable from the line trace without casting, and handle that on each class differently.

final thicket
#

Hmm so because UE4 TCP is essentially UDP with TCP characteristics, is it really slower?

#

does it depend on network volume?

bitter oriole
#

It is 100% UDP, not TCP or UE4 TCP

#

"reliable" RPCs implement some features of TCP sockets

#

So yes, reliable RPCs are slower when network congestion drops packets

kindred widget
#

@buoyant wedge If you're still having trouble, you'll have to show us what you're doing that's causing it to affect more than the intended target.

buoyant wedge
oak pond
#

Ive never actually used the damage stuff, can you use it to decrease health and stuff? theres an OnTakeDamage node if I remember rightly right? thanks for reminding me it sounds useful

buoyant wedge
oak pond
#

now that I think about it its hella useful, Ive been using casts to every single actor that you could shoot lmao ๐Ÿคฆโ€โ™‚๏ธ

buoyant wedge
#

on server the disply damage on client work. But don't work client to client. I see the blood but in the character to do the shot and not the receiver

#

the line trace on a weapon and not into a character can be the problem?

cosmic trail
#

Hi guys, I'm new to UE4's replication so maybe you guys can easily answer this. I have looked around a lot so far with no answers. I'm using conditional replication, with COND_OwnerOnly on a property of a component. But it won't replicate when I do this. Without conditional rep it works. I've set the owner of the component's owning Actor to the Player Controller(although the Actor's controller is an AI controller) to the correct player controller. I'm not sure where I'm going wrong or if I'm missing the concept of OwnerOnly. Any help appreciated.

quaint coyote
#

im having trouble with my packaged mulitplayer project in that when I try to use an open level command with ?listen option it wont open the level. It works in editor mode and when I dont have the ?listen option in the open level node but I need to have the map in listen so that other people can join the session. Any reason why im having this bug

peak star
#

Hey everybody, I decided that since my Wifi router hates Sessions, I'm going to just get the Android device's IP address so people in the same room can type/paste in the host's IP

#

BUT I'm having trouble finding a way to detect the Android device's own IP address so it can be shared with the other players

#

whatismyip.com charges for API use now, and limits web site requests to 5 / day

#

I tried Android Goodies plugin but it doesn't seem to have anything that looks up the device's IP address

#

How can I get my device's IP address from my Unreal app at runtime?

bitter oriole
#

Host your own service that clients connect to, and you return their IP address to them

#

It's literally one line of PHP

#

like print $IP_ADDR or something

graceful cave
#

what happened to the netpktlag console command in 4.24

#

weird it works now

#

still doesnt auto complete in the console though

peak star
#

@bitter oriole Is there a way to do that locally on the android device without internet?

#

That way I don't make the app dependent on my hosting or the internet in order to set up LAN games

#

I'm considering using a bluetooth plugin instead, since I don't need realtime replication, and it's just turn-based

bitter oriole
#

No, there is not

#

Public IP address simply isn't something you can physically know from the device

#

But... you don't want the public IP here ?

#

Just the local one

#

If it's LAN

grizzled stirrup
#

Calling GetMesh()->SetRelativeLocation() on a character mesh on both client and server, although it logs out as having the new relative location on the client, the mesh is still at 0,0,0 visibly, on the server it is correct

#

Any ideas on why this is?

#

Solution in case anyone else needs it

#
Any relative location set on the character mesh which will not have a lasting effect because the client-side prediction of the CharacterMovementComponent overwrites the relative location every frame. The intended way to specify a relative offset for the client-side mesh in this case is to set the value of the Character's BaseTranslationOffset FVector value. For the server you can still use AddRelativeOffset.
keen surge
#

Hi folks, i have just read https://forums.unrealengine.com/development-discussion/c-gameplay-programming/43920-how-do-you-replicate-an-actor-pointer
and i am not clear what mean "Actually as long as your actor has bReplicates set to true, then you can pass pointers across server functions directly or as USTRUCTS and UE4 will find the LOCAL version of that same actor!"
It's it mean if I have AActor* ActorExample as replicated variable, and set it as server version of that actor, somthing like this: if(HasAuthority()) { SomeOtherActor->ActorExample = this; } i will on client version of SomeOtherActor get client (the LOCAL version from above) version of ActorExample ?

#

in my example, I have weakspots on enemies, so i want when two players attack in "same" time same enemy and each of them attach on enemy's weakspot their combat pet, i need to count pets and do instant kill o enemy. Each weakspot has OwningEnemy which is replicated AActor* and is set on server, so all pets should be on end attached on one instance of enemy (server), but that doesn't happenes. Despite OwningEnemy replicated, server version of Weakspot has server version of Enemy and cleint version of weakspot has client version of enemy, so i can't count and onstant kill...please help or give me some explanation, I have spend whole day on this problem

winged badger
#

there is a concept called NetAddressable

#

it works for all Replicated Actors, all Actors loaded from Package, as well as any stably named Actors, and all components that are default subobjects of those Actors

#

for those Actors/Components, a NetGUID is created, which matches on the client and server

#

it is the NetGUID thats sent over the network, not an actual memory address

#

and that can be resolved on the other side

#

@keen surge

#

so if you have a non-replicated Cube on the level, for example

#

a client can send a server RPC with a pointer to Cube telling the server to destroy it

#

and it will work

#

because its on the level (loaded from package), it has guaranteed same name on all clients + server, and that can be used to make a NetGUID

#

(it can be uniquely identified across all the machines)

slender yarrow
#

still not sure about this: for an FPS game. Is it better to have the actual visualization of the gun recoil done through animations or through code?

ocean geyser
#

@slender yarrow id use an animation montage. thats what im doing currently, going to try to have 2-3 different recoil animations for the weapon (just subtle differences) so its not repeating and randomly select which one to play when shooting

slender yarrow
#

yeah thats what I have as well. Ive just always wondered how COD handles it, or any of the AAA fps'

ocean geyser
slender yarrow
#

ive actually watched this in the past. I guess it didnt register with me that the actually firing recoil was an animation. Wasnt thinking lol

ocean geyser
#

yea, just the way he talks about it kind of opens your mind up a bit when thinking about how to go about doing something related to weapon animations lol

karmic briar
#

hi anyone here know any documetation other than epic one to learn more on CMC?

keen surge
#

@Zlo thank you very much on answer. So I should get NetGUID and using it to totalize number of pets on both sides?

final thicket
#

Why can't you send RPC's to specific clients, like replicated variables

#

Net multicast seems wasteful, and sometimes client is not enough,

#

What if you wanted to send something to everyone with a condition like COND_SimulatedOnly only?

#

So everyone but the client

stray gull
#

when creating a session, i have an open level on success but when someone creates one. it sends them to the level and then seconds later sends them back to the main menu

#

only in standalone and packaged

final thicket
#

Well that's interesting when a client disconnects they open a copy of the current level to my knowledge, so take a look at what logic you have to send them to the main menu, and remember in a real networked scenario the client may send and get networked variables and RPC significantly slower than in editor

#

So if you're depending on a replicated variable or the client is kicked out to the menu, that would make a lot of sense

#

That all being said I could be wrong, check what calls the code to open the main menu level and work back from there IMO

stray gull
#

My steam game isnt working when packaged, ive heard something about steam_appid as a .txt in the folder but mine still wont work with id 480

bitter oriole
#

Launch the game from Steam if you want to be sure

robust wind
#

@stray gull depends on where you put the file, BTW is it working in the engine when using play in standalone game

stray gull
#

yea its working in standalone and i have "480" in the file

bitter oriole
#

Where's the file ?

stray gull
#

in the directory with the .exe

#

WindowsNoEditor folder

bitter oriole
#

None of this is necessary if you run from Steam

stray gull
#

how do i run from steam

bitter oriole
#

Well, I take it you are shipping the game for Steam ?

stray gull
#

not atm i just want to use the friend system / invite system

bitter oriole
#

Alright

#

the appid should be under WindowsNoEditor\projectnamefolder\Binaries\Win64

#

Keep in mind "shipping" is for well, shipping your game. No logs, no console, etc. Development is what I'd package with for testing

stray gull
#

im packaging with Development

#

i might of found the issue, just testing now

#

Yep i fixed it... previously i tried upgrading the steamworks version but it didnt work and i didnt change the steamworks.build.cs file back, so it was looking for a different version of steamworks

tawny raven
#

hello friends! can anyone tell me the best way to go about having the actor of the same type multiple times in a game and that actor has a progress bar but i don't want it to affect any of the other progress bars?

#

think: generators from dead by daylight if you've played it before

robust wind
#

Just spawn each actor in the level or place them in there. The progressbar an actor has will always belong to that actor

tawny raven
#

ah if that's the case then how would i send information from a playercharacter to that actor?

robust wind
#

Depending on how you want to do that and what you want to do

tawny raven
#

cause this is more than obviously not the best way as i'm trying to cast to that actor, but it's affecting everything else then

robust wind
#

If you only want to get a reference to it when you are in a specific distance around you can use an overlap box

#

Also is it multi-player based?

tawny raven
#

yes of course

robust wind
#

Okay.
So what I would do is adding an overlap box to the actor you have then when event begun overlap of the box is fired you can cast to the player character using the other actor pin

#

You can then perform the code you want

#

Or set a reference to the actor inside the player and when end overlap is called resetting the variable to null using a cast again

#

As I said depends on what you want to do then

tawny raven
#

ah okay, i was able to get that part down. cause i show some widgets to the player whenever they get into that range but now what im trying to do is have our player hold down a key and i'm trying to cast to that specific actor to increase progress

robust wind
#

As I said using the reference you can just go into the player an then performing the hold function using the input key and a gate function then for the first input of the gate you can check if the reference is valid

#

If it is valid it means you are near your generator

#

Perform your code then

#

If it is not valid you are out of range

#

I would make the reference to that actor replicated and set it with a server event of the character to self inside the generator when begun overlap, and reset it to null on event end overlap

tawny raven
#

hmm alrighty. i'lll see what i can come up with and come back if i can't get it again :D thanks a lot!

tawny raven
#

okay so it did kind of work for me! i casted a reference of the actor to the character and that works, but now the other actors i copied don't allow me to interact with it? LOL

robust wind
#

Show me how you have setted it up

#

@tawny raven

woeful ferry
#

Any tips?

tawny raven
#

so whenever they would step into the box collision, i would go ahead and set a variable that my player can then reference to try to get access to(then i'd some some arbitrary text and a progress bar that is associated with a float variable) then set a boolean that allows me to know in the code if the player is in the radius. when they step out i undo all of that

#

then with that boolean i set i then stop the player from being able to move(cause i don't want that) then i sent a boolean that is based in the actor and can trigger the float progress to be increased

#

the way i explained it is probably terrible and i understand that

chrome bay
#

@woeful ferry There will always be a delay. The higher the latency the more delay you'll have.

tawny raven
#

see, i would set the float back to 0, but i feel that would have unforeseen consequences such as if other players were on another actor

woeful ferry
#

@chrome bay I'm aware of that, but got any tips on how to do it in any other way?

chrome bay
#

Not really no. The Server inevitably has to set your "exit" position, you just have to live with it

robust wind
#

I will be home in around 2 and a half to 3 hours, if you still struggle with it then I can help you but I don't have a pc with me atm to show you how to set it up @tawny raven

chrome bay
#

I assume the server is the one that removes you from the vehicle? The client doesn't remove themselves?

#

Hard to really suggest to be honest without knowing the full extent of the vehicle occupancy system.

robust wind
#

A delay will always be there between server and receiving others you can't do much about it, instead of setting the location you can use a Montage using root motion for the character

tawny raven
#

That'd be really helpful Luis! In the meantime, I'll try to see if I can fix this! Thanks a lot

woeful ferry
#

@chrome bay I'll screenshot in a sec.

chrome bay
#

There's nothing you can do about the delay for other clients

twin juniper
#

if i want to have replication on something that can be controlled by a player (for example a vehicle), i need client prediction if i want it to be server authorative right? i assume this is quite hard to program?

#

trying to find out the best approach

#

(before i start)

chrome bay
#

If you're using physics you can't really do client prediction / server-authoritative.

#

The best approach is to use client-auth, then do a lot of validation and checks / anti-cheat server side.

twin juniper
#

so if any type of physics is involved it needs to be client authoritive?

chrome bay
#

yeah, pretty much. It depends. If you have a simple enough game where you can rewind and replay the whole physics scene, you can use server-auth.

#

Rocket League has a good talk on the subject, but it only works for a game of that scale.

twin juniper
#

on the plus side client authoritive is pretty easy to setup right?

chrome bay
#

Yes indeed. Almost as simple as a few checkboxes (so long as the vehicle is a pawn)

twin juniper
#

the default vehicles are not though right?

chrome bay
#

Default ones are pawns I believe

twin juniper
#

i was looking for a good vehicle system that does not use the default vehicle system (since it really sucks imho)

chrome bay
#

Yeah, I did my own

twin juniper
#

found one but it does not replicate by default

#

other then that it looks to be almost exactly what i want though

chrome bay
#

All the marketplace ones I've seen have a completely appalling network implementation. totally unuseable.

twin juniper
#

this one does not have any replpication, so i figured i might be able to just add it

chrome bay
#

The TL;DR version is that you uncheck "Replicate Physics To Autonomous Proxy" on the vehicles skeletal mesh, then the client sends unreliable RPC's on tick to the Server with Input and physics state.

#

Ideally, you do what you can to compress those RPC's and reduce the number you send

#

The Server updates itself with the clients physics state, and continuous to run the physics sim with the last-received inputs between updates.

#

I also advise replicating the input to clients along with the normal replicated movement, so that clients can extrapolate between updates too

#

Tis what I do anyway

twin juniper
#

i'm confused by that

#

replicating input from clients to other clients via the server or what do you mean?

chrome bay
#

yep

#

The server is already replicating the physics state via replicated movement.

twin juniper
#

or smoothsync ๐Ÿ™‚

#

(i picked it up in january when it was free for the month)

chrome bay
#

Meh, smoothsync is a workaround for not doing it properly

twin juniper
#

it just interpolates?

#

dont see the downside of that tbh

#

doing it properly would be server authoritive with client prediction imho

chrome bay
#

The clients are still all simulating the physics scene and the vehicle simulation between updates form the Server. If you don't provide them the input to simulate with, they will continously snap.

#

Server auth physics is impossible, at least on a "general" scale.

twin juniper
#

yeah you said that

#

so the only way to do it properly is reprogram something that does not use physics

#

so client authoritive is the way to go for me i guess

#

what does this do though? "Replicate Physics To Autonomous Proxy"

chrome bay
#

SmoothSync does indeed "interpolate" the transforms - but constantly reinjecting transforms into the physics scene is terrible for performance, and it's not really "true" physics then.

#

Well, the engine already does physics smoothing between replication updates (you can tune it in project settings to make it more specific to your project). Unchecking that box basically means the locla client will ignore authoritative updates to the transform.

#

Otherwise it would move forward, but then be constantly snapped back by the servers' update.

twin juniper
#

ah nice i didn't know there was such a setting to tune

chrome bay
#

Unchecking that means the client won't apply the servers' physics update if they are autonomous proxy (aka possessed pawn)

twin juniper
#

so untick that, tick replication and movement replication, done?

#

(then optimizing optionally)

chrome bay
#

You also need to send the input and physics state from client->server via unreliable RPC.

#

I suggest throttling the send rate and compressing where possible.

#

Also, make sure you call those RPC's after physics scene has ticked.

twin juniper
#

just wanna make it work first and then try to optimize

#

is there any decent tutorials about this stuff? it seems really hard to find anything thats good

chrome bay
#

Not atm as far as I know, I've got endless threads on the forum about it since this is basically "my jam".

#

Otherwise am planning to put an article together about it, since I end up going through this at least once a week ๐Ÿ˜„

twin juniper
#

lol, well don't feel obligated but it definitely feels like a hole in the market so to speak

chrome bay
#

Yeah very much so

twin juniper
#

i'll look on the forum specifically too

chrome bay
#

If it's any consolation, Fortnite uses client-auth vehicles.

#

So if they can do it... etc.

#

Epic are apparently "investigating deeper integration with physics" for their new network prediction system, but no timeline on that atm.

#

Or what that really means..

twin juniper
#

yeah seems fine for my needs

#

i'm thinking about this though, and if the server just receives the location / rotation data, does it still need the client input? ๐Ÿ˜’

#

seems like that is enough to replicate it?

chrome bay
#

Yeah as in-between updates from the client, the server is still simulating the physics sim.

#

So you want it to ideally simulate with the clients input, as the results will be closer-matching when it gets the next client update.

twin juniper
#

aha, so without the client input it would just be choppy without interpolation?

chrome bay
#

Yeah pretty much. I mean it will still be smooth-ish, but if the client has the accelerator pressed for example, you want to assume they still do between updates.

#

For analog-style inputs like steering, I have the server/clients slowly round them back to zero between updates too. Really have to tune it but can help a little.

chilly mason
#

finally finished implementing deterministic lockstep p2p multiplayer in ue4

#

@bitter oriole I did end up using FSocket only from UE4

bitter oriole
#

Cool

chrome bay
#

for an RTS?

chilly mason
#

so if anyone is wondering, determinism and lockstep are possible w/ ue4

#

you just have to throw most of it out the door :)

#

@chrome bay yes, RTS

twin juniper
#

@chrome bay i think i will start by just adding replication on its own then, and when that is working add the input, does that make sense / sound like a good plan?

#

wanna divide it into little steps

chrome bay
#

yeah, is pretty straightforward to send the input next to the phys state.

chilly mason
#

also also... for the doubters, determinism works across any combination of amd, intel, windows, linux, msvc, clang

twin juniper
#

@chrome bay i never even used an RPC before lol.....

chilly mason
#

just wanted to put this out there because some people seem to think floating-point determinism is some sort of wacko nonsense from the nineties or something

twin juniper
#

90s stuff can be pretty good, in some ways we have been devolving imho

chrome bay
#

Something I suggest is grabbing this little utility, and running it with a bit of lag and packet loss when playing in PIE. Helps to see where things can fall apart in multiplayer.
https://github.com/jagt/clumsy

chilly mason
#

I love clumsy too!

chrome bay
#

Yeah it's great. A lot easier to use than the engines built-in simulation stuff too.

chilly mason
#

didn't even know it had one

twin juniper
#

i didn't know about clumsy seems handy

chrome bay
#

^ link about engine built-in stuff

robust wind
#

Yeah it has one but it's pretty hidden and not that nice to read, you can see how many packets of what goes out because of which rpc though.
Setting lag has to be made during game play and you have to "record game play" to analyze it afterwards using the ue4 tool

chrome bay
#

Just some console commands to persuade the net driver what to do with the packets etc.

#

I prefer clumsy though tbh

#

Although I do forget to disable it now and again and wonder why webpages take so long to respond

chilly mason
#

I can't use ue4's built in things as I'm not using its net driver but it could be nice for people that are

tawny raven
#

@robust wind I'm gonna be heading to bed, but feel free to DM me with the solution as I've yet to find my own! Cheers and thanks again!

oak pond
#

hey so Im trying some simple things in multiplayer, so far Im just trying two players in a map and they can click to line trace, and if they hit the other player that player dies, but the weird thing is it only works when the server player does it, yet everythings replicated

#

the client still recieves the death event so thats good I guess, but they cant activate the server players death

#

and something else Id like to know is how to accurately replicate ragdoll positions

kindred widget
#

How are you calling the kill function from the client to server?

oak pond
#

so its all in the same actor

#

idk if thats a bad thing

kindred widget
#

@oak pond First issue is that Apply damage is a server only function. I presume you're in the player's character which is owned by the client. That's why it works on the server character and not the remote client. You need to create an RPC event to call. Pass the stuff you need through the event like the hit actor and call apply damage on the server after the RPC

oak pond
#

oohh ok

#

thanks

#

so I must admit that I dont actually know about rpc

kindred widget
#

Generally, just think of them as the way that the different instances of an actor talks to each other. The client version of the pawn can talk to the server version with a Run on Server RPC, the server can talk to all instances of the pawn with a Multicast RPC

oak pond
#

yeah I think I understand what they are but not how to set it up, never actually seen it in blueprints

kindred widget
#

Just a sec, I can give an example with your line trace.

#

@oak pond Try this out.

oak pond
#

oh thanks

kindred widget
#

It'll line trace on the client, then tell the server version of this actor to call it's event and apply damage. Since apply damage only works on the server, it'll already be on the server and we call a multicast. That multicast would set the health and stuff of all of the actors so that all instances stay synced.

oak pond
#

ah so it kinda has to apply damage to itself? sort of

#

and I assume ServerDamage is Run on server and Multicast is of course Multicast

#

or are they both multicast

kindred widget
#

ServerDamage is server only.

oak pond
#

awesome, they can both kill each other now thanks

#

so youd use this technique for all other player interactions I assume?

kindred widget
#

The best way to explain it is that there are actually four actors. You have two players. Server and Client1. Server has two pawns, one on Server and one on Client1, Client1 has two pawns, one on Server and one on Client1. If Client1 wants to do something, they need to use their version of their pawn, the Pawn OF Client1, on Client1 to call the Client1 pawn on the Server. The server version of Client1s pawn will then have the authority to tell all other instances of that pawn to do something with the multicast.

oak pond
#

I was actually just watching a video just know where he said that lol

#

*now

kindred widget
oak pond
#

I dont want to risk speaking too soon, but maybe this isnt as horribly complicated as I always thought (๐Ÿคž)

#

how would you accurately replicate stuff like ragdolls and other physics objects though?

kindred widget
#

Hard to say. There's some methods, but most are pretty heavy. Ragdolls are hard because there's so many moving parts and you'd need to replicate their bone translations. Normal physics actors are a little easier with only one transform, but stuff like that is generally ignored in most games. It's usually not gameplay relevant to care how someone's body drops after they're dead, or where the prop flew off to when you shot it. The exception might be if you can loot corpses. Some games even cheat that by spawning death bag at the death spot then letting clients handle physics on the body, since translating one death bag is a LOT less expensive. One example of this might be something similar to Apex Legends if you've played it, deathboxes. They need to be in the right spot for players so that the server knows the player is close enough to it to interact with it. Another example is Overwatch, dead bodies and props aren't replicated, each client sees things just a little differently since it's not gameplay relevent.

#

I'm sure there may be a way to handle it in Ue4 with skeletons, but it'll definitely take a chunk out of your network bandwidth.

oak pond
#

yeah I was thinking that would be the case

#

what if maybe there was one physics object that the ragdoll was attached to, and that physics object was reliable so the ragdoll would be in pretty much the same place for both players but just a different pose?

#

I wanted to involve quite a bit of physics but maybe I should try to avoid it a bit, I heard projectile movement is more reliable though?

kindred widget
#

Could maybe work. Definitely don't do reliable though. You'll be replicating the variable enough that even unreliable will be enough. Making it reliable will stagger your network as well. Be careful with reliable replication. Just use it for extremely important things like state changes. I reliably replicate boolean state changes to the server so that it can set the right state. But that's one button press every so often, not up to 120 times a second.

#

Couple of case points are things like saying a character is crouched, or aiming down sights.

oak pond
#

oh I didnt mean the reliable flag itself I meant literally reliable

#

but yeah I think I could try to avoid physics where possible in multiplayer

kindred widget
#

Ahh. yeah. It should be at least close as long as the server is replicating it. You might even be able to get away with just location instead of a full transform.

oak pond
#

yeah thatd be pretty good

#

should I try something like constantly checking the ragdolls location on the server and setting that location on the client, or would that be really costly as Id assume?

kindred widget
#

Hard to say. You could soften that up a lot with some parameters. If velocity > someamount, replicate variable. Else it's probably not moving enough to bother. You 'might' even be able to get away with lowering the amount to 20-30 times a second. Attach the body to the object with a constraint and make it follow the set object.

oak pond
#

oh single physics objects like cubes seems to replicate very accurately just with slight lag

kindred widget
#

Bear in mind, I have no idea if there is an internal way to handle stuff like that. There may be a smooth way to handle skeleton replication that's in C++ that'll be a lot better than any blueprint solution.

oak pond
#

I have to admit I know hardly anything about c++ but I think blueprints are capable of most of what I need

kindred widget
#

I have yet to find anything I can't do in blueprints. I'm very well aware that C++ implementations are faster, but blueprints have apparently come quite a long ways, since people are still in the mindset that you can only implement very basic game functions in them.

bitter oriole
#

Blueprint are extremely useful and not to be ignored. C++ is faster, and more importantly, easier to work with for source control, but it's not nearly as fast to work with.

oak pond
#

yeah thats good to hear because Ive been learning blueprints for a long time and its the only way I can make game projects really

bitter oriole
#

Then roll with it. You'll have time to learn C++ later on and then use it for UE4 if you like it.

kindred widget
#

@oak pond Couple of random quick tips that I've been learning over the past few weeks. First of all, use Validated Gets instead of getting a variable and using an Isvalid node. Only use IsValid when you're getting the variable from somewhere like a function. The ValidatedGet is anywhere from seventeen to twenty percent faster, and it looks neater.

#

Second, functions are actually slow. Anything that you don't plan on using from another actor and you're only going to use inside of that specific actor but you want to hide it away in it's own little function, use macros.

oak pond
#

oh ok, do they work in the same way as functions though?

kindred widget
#

Mostly. Macros have a couple of extra things inside of them, but they're basically just hidden away graph nodes.

#

@oak pond Probably should be talking about this in blueprint, but since no one else is talking here much, this was what I meant. The Pure getter function is INCREDIBLY slow. These all do the exact same thing. Get Bool2 and set bool1 based on it 15,000 times.

fiery geyser
#

Do you guys know of a way of replicating TArrays of a fixed size? Ex: TArray<int32, TFixedAllocator<static_cast<uint32>(MAX_NUM)>> MemberSize;

oak pond
#

oh wow

kindred widget
#

@fiery geyser Not sure about C++, but at least in blueprints, Arrays set by the server and set to replicate are replicated automatically.

#

Not seeing a way to set the max size in blueprints though, so no way to test if it's any different there.

chrome bay
#

@fiery geyser use FFastArraySerializer. It doesn't preserve order though.

#

Oh wait nvm, you can't use the non-default allocator.

#

May be able to wrap it in a helper struct.

fiery geyser
#

Yea, that's what I thought too, but I might have to replicate the size as a member in that wrapper struct to achieve that.

chrome bay
#

You might as well just replicate it normally then. TArray replication already replicates the number of elements, as well as the elements themselves.

#

You can't use UPROPERTY() with anything but the normal allocator IIRC, so you would have to define a custom NetSerialize() function the for struct anyway.

#

Seems like overkill for something like that tbh, and probably prone to error anyway

fiery geyser
#

yep.

twin juniper
#

@chrome bay i would need a listen server correct?

#

or dedicated?

chrome bay
#

either

twin juniper
#

the more i look into this stuff the more confused i get

burnt copper
#

Hi everyone ! I have a little question for you all. I would like to know where is the best location to save variables (global ones) on the server-side and how can I make my clients ask for one of them ? I have read that I have to do that in the game instance, game mode, player state but nobody seems sure...

nocturne sinew
#

Hi, I've got a question about actors moving on the server which are not players. I've got a few actors rotating and moving on the server, and whenever a client's position gets pushed by these, it creates a very stuttery repositioning on the client. Because the server is trying to handle the client's 'faulty' position and keeps sending corrections to the client. Should the client have predictive data of the actors moving on the server or how should one go about solving this? Does this make any sense? alex Anyway Would greatly appreciate any help, I know it's confusing lol. thx!

kindred widget
#

@burnt copper What are the variables being used for?

burnt copper
#

@kindred widget, I want to make procedurally generated levels : I need the server to set the "originSeed" and the clients request it to generate on the client-side all that doesn't have to be replicated.

twin juniper
#

(april 2014)

burnt copper
#

@twin juniper I'll take a look right now

twin juniper
#

@burnt copper thanks, just asking since its pretty old

#

don't wanna confuse myself more by learning stuff that no longer works lol

burnt copper
#

I have started watching this tutos a while ago but i have not watched all of these.

twin juniper
#

but nothing major changed since then networking wise?

burnt copper
#

I don't really know it is my first multiplayer game :/ I will check that again ๐Ÿ˜‰

twin juniper
#

i'll just check em out then, unless someone tells me in the meantime that its no longer relevant

burnt copper
#

Ah one more thing ! my server is a dedicated one, I don't know if it change something about the way of doing things

kindred widget
#

@burnt copper Hard to say. But I'd probably say GameState for something of that sort initially. Not familiar with procedural loading though, but every client should have access to see the gamestate and it.. kinda pertains to the game rules. So.. I'd say there.

buoyant wedge
#

@kindred widget i can set the line trace on the weapon bp or i need to set into the character BP?.

kindred widget
#

@buoyant wedge Still learning that stuff myself. I'm not quite familiar with how to give ownership of a non possessed actor to a client. Before, I did all of that stuff in the Pawn since it's already owned by the client controller, but I'd have to get back to you on that once I know how to handle that unless someone else knows.

burnt copper
#

@kindred widget, @twin juniper thanks for your time, I will look the tutorials and look on how do the GameState works with multiplayer and networking and I will see if I can go ahead with this ! I'll write a message if I find a solution. Thanks again

buoyant wedge
#

@kindred widget there is the possibilty if i set on the player... the people can try to hack the game easy?

twin juniper
#

@burnt copper euh you helped me lol, you might have highlighted the wrong guy

burnt copper
#

@twin juniper yeah sorry XD @kindred widget The GameState was indeed the solution ! Thanks !

shut gyro
#

For me, it dces me when trying to travel the clients with the server

#

throwing this log: [2020.04.19-23.16.16:960][371]LogSteamSocketsAPI: Verbose: SteamSockets API: Log [#334320325 P2P steamid:_] problem detected locally (5003): Timed out attempting to negotiate rendezvous

oak pond
#

I have a weird problem, when Im using my own mesh and ragdoll, its stuck in t pose for the client, except when I did the same thing with default mannequin it ragdolled fine

#

my physics asset is set up fine

#

wait hang on

#

ok dont worry my fault

oak pond
#

ok so I still dont get how to have a key press and then make something happen for which player pressed it for example pressing tab kills the player (for testing of course) but of course I can only get that working for the server not client

kindred widget
#

@oak pond The client needs to RPC to the server from an actor that it owns. This is usually the controller or Pawn. The server can then destroy the actor.

oak pond
#

yeah I dont know how to get the right pawn controller though how to detect which one pressed it

#

I think I know what to do for other things now though thanks to your help earlier but not sure with inputs

kindred widget
#

The one with the input did. You program it the same. Input only happens on the client that did it.

#

Are you trying to kill the player's own actor when that player hits tab?

oak pond
#

yeah

#

also trying for a respawn function

kindred widget
oak pond
kindred widget
#

This will destroy the actor at least. I haven't gotten to respawn stuff myself yet so can't help much there.

oak pond
#

respawn works for server right now so the actual respawn function itself is done

kindred widget
#

Yeah, that won't work because it's a multicast. Multicasts can ONLY ever work from the Server. To do a multicast, you need to first run a server event, and make that server event call the multicast.

oak pond
#

oh yeah I was trying another way with server

#

but doesnt everything that all players will see have to be multicast?

kindred widget
#

Most things. But I think Destroy Actor is automatically replicated to all. Let me check.

#

I mean if you're simulating physics and all of that stuff, you need to call a multicast I think.

#

So yeah, you'd need to buffer what you have there with a Server event that calls your multicast event.

oak pond
#

ok what really confuses me is I already have this death function working with both players but I cant make client activate it on themselves

#

of course that tab will only be from the server not client

kindred widget
#

That all looks right, but you need to plug a Self reference into the ServerDamage on the tab event.

oak pond
#

oh is that it? I think I tried self for respawning but it didnt work, Ill try it with this

#

oh wow that really was it thanks lol

#

youve been a great help so far, most of this seems like it should be obvious but I guess this is how to learn it to start with

kindred widget
#

A lot of this is fresh. I'm not too far ahead of you.

#

Case and point, I'm trying to understand how to set actor ownership to call RPC from a weapon instead of the character. Aaaaand, it's just not working no matter what I do.

oak pond
#

YES I got respawning working

#

its so exciting when things work lol

meager spade
#

you should really use the GameMode for respawn

#

that seems pretty hacky

oak pond
#

ah shit

#

how do I do that then

meager spade
#

i just call GameMode's Restart Player function

#

from a server RPC, but your way is fine

#

it works, and does the jobn

oak pond
#

damn I didnt know that existed lol ๐Ÿคฆโ€โ™‚๏ธ

#

mesh is constrained to the capsule

#

its often very obvious to see where its being pulled around by the capsule though

#

hrm anyone got any ideas how to make it look better?

#

I really wonder how games get this working with accurate ragdoll replication

frank portal
#

why would that be accurate? the bones still get simulated differently on clients and there is no guarantee that they will be on the same position (unless I missed smth)

oak pond
#

by accurate I only mean to the root bone, so the location of the ragdoll is perfect but the pose its in will be different between server and client

#

pose isnt too important but as long as at least one bone is where it should be thatd work fine, idk if this is the best idea though cus it looks wonkey and weird

frank portal
#

yea replicating the root position is what probably most games do for ragdolls, but normally you wont move in ragdoll ^^

oak pond
#

oh yeah dont worry that was just me messing around with it

#

so how would I go about accurately replicating the root position without it looking wonky?

frank portal
#

when I implemented ragdoll I overrode a lot of functions in cpp (was a lot of stuff as I also wanted to change the capsule rotation, size, etc to fit when in ragdoll), but in BPs not sure just try to debug if its also wonky when you kill someone as many things can cause it especially when you move in ragdoll

oak pond
#

well currently using constraints Im not sure if its possible to make it look nice with the constraints you can always see how the ragdoll is being pulled by one bone

naive locust
#

Hello, I have been developing a MP environment; I can get into lobby, travel to map, swap PC data, no problem; both local (Editor Standalone Game x2) and remote machines (through steam). PlayerState derived class has a struct set to RepNotify, Rep Condition = None. However, it appears clients do not have OnRep_var being called, but the server side does for its own PlayerState struct var. The stranger thing is, it appears the PlayerState as a whole is not replicating at all on the client side. Is someone able to assist?

peak star
#

@naive locust is your playerstate class selected on the GameMode that is being used on that level?

naive locust
kindred widget
#

@naive locust How are you setting those variables?

naive locust
#

Hi @kindred widget, is it normal to take discussion out, or stay in here to discuss? By the way, thank you for trying to help me

#

I'm new here which is why I ask. Some discords like to have people go to DM so channels aren't flooded with one topic, some would rather just keep it in the server.

kindred widget
#

I don't think it matters much. No one's really talking in here, and I find forum/public problem solving helpful.

naive locust
#

I agree on both fronts. OK, I am in a derivative of GameStateBase, I take the PlayerArray (a default var) loop through it, for each element, cast to my PSBasicPlayerState, set it to a TEMP var, use Make structvar node, connect values, then use Set Member in Struct node, and then on my TEMP var, I set that struct var with return of Set Members

#

so the end looks like this

#

the server side gets the REP_NOTIFY, the client does not

#

and so, I put some debugging on client to see if their playerstate ever updates, at least with regard to this struct. It does not.

#

On the server, I can even see that the server copy of the client playerstate does have the right data

#

only me man, only me. I seem to run into the most obscure problems leaving people scratching their heads... this is no different.

kindred widget
#

If your repnotify isn't firing, then that means you're not setting that variable on the server. Only the server can multicast or replicate variables.

#

Where is that execution line coming from? Where are you calling it?

naive locust
#

GameMode event calls Event on GameStateBase, then from that event, I call what you see: which is a function. So, here are the images in order of execution

kindred widget
#

Sec, let me replicate and see what happens.

naive locust
#

Trust me, it will work for you ๐Ÿ™‚

waxen quartz
#

Does anyone recommend any specific services for (cross-platform) skill-based matchmaking? I've been looking at GameSparks and Playfab but just wondering if anyone recommends any alternatives. Is the Epic Games one working yet? Thanks in advance.

kindred widget
#

@naive locust Okay, now that I know that's all working, next question is when are you calling that function in the gamemode?

naive locust
#

During an initial load for a game. So, the player has already traveled, and their playerstate is created before this function runs (i get the count of the playerarray length as shown and it matches the number of players each time).

#

I mean, the server copy of the client's playerstate has the data, I can output that from the server, but the client's version of the playerstate sits at its default data

#

I've even run ForceNetUpdate at the end of the first image on the PlayerState, nothing

#

I am thinking that you are thinking the playerstate hasn't yet been created on the client side when this code is running. This is possible, I will definitely check that. I can run a timed looping mechanism to check if the client's playerstate is there before proceeding, do you think I should go down that road?

#

These are the replication settings on the PlayerState. I have also tried it with Net Load On Client.

#

i also want to say that the playerstate, for the serverside replication (the onrep notify that runs for the player on the server) runs at least every second. I never get a single replication event on the client, so if the playerstate happened to not be on the client during the time of that set, the playerstate should appear at some point and I should get replication events happening, right? but I don't which is the weird thing

kindred widget
#

@naive locust On the server, you can see client's stats just fine from their player state? Cause my last thing to question was where you were setting the tempref var for the playerstate.

#

I even made a little test struct and added all of the switch has authority stuff and I'm getting little hellos from the repnotify function.

naive locust
#

yes, so on_rep notify runs on both server and client, at least that's how I understand it. So, inside the onrep function, i output whether it is the server or client, and what the values of the struct are. And, the correct values print out for who would be the client. They are different from the player on the server also

kindred widget
#

Oh. Interesting.

#

I actually didn't have one thing set up like yours which I just switched. Pretty sure I found your issue.

naive locust
#

i'll spin 'er up and try your suggestion

kindred widget
#

I'm FAIRLY sure that the notify doesn't know how to call the repnotify function when it's not in the same blueprint. Since you're setting the struct in the gamestate, it has no clue what it should call. Pass the struct through a function or event into the playerstate and make the playerstate set it's own variable with notify.

#

Cause, I just set that up to do the same thing in the Gamestate and it broke everything that I just had working.

naive locust
#

no, f'ing, way

#

i am going to try that (it's 4:18am here) may I ask what time it is by you? I am trying to finish up a final exam (at home b/c of covid 19) and i'm going to do this tomorrow and I would love to let you know the outcome. I do have another on_rep that does work. This is a pawn reference on the playercontroller. When ONPossess runs, I set the reference to the returned pawn in OnPossess input. Then, the OnRep function for the pawn runs for both client and player on server. but perhaps playerstate has some limitation from gamestate?

#

Computer Graphics final ๐Ÿ™‚ I look like crap

#

@kindred widget so, trying to set playerstate from gamestate broke onrep from variable on playerstate?

kindred widget
#

Lemme show quick.

naive locust
#

go4it

kindred widget
#

Ah. Nope. Nevermind. That was my dumb. Helps to connect all the right lines. That theory went out.

#

Honestly, I'd consider deleting the variable and renaming it, setting it back up and seeing if you get the same thing. Maybe it's just a bug.

#

It is worth mentioning that when I was setting it on Gamestate that I wasn't actually setting anything, and it was calling repnotify on the server, but not on the clients.

naive locust
#

i'm nto sure i follow

kindred widget
#

This is in gamestate, I forgot to plug in the SetMembers to the SetVar

#

It still called Repnotify on the server but not on the clients.

naive locust
#

right

#

i see

kindred widget
#

If I plug just that in, it starts working on the clients as well. So, that's all I got, but I'm setting it the same way you are.

naive locust
#

right, did you check to see if my class settings and replication settings for the struct var are the same?

#

I'm wondering if i have something set incorrectly on a class that playerstate depends on, incorrectly, perhaps playercontroller or something

#

would you mind posting in a DM to me your Pawn, GameMode, GameState, PlayerController, and Playerstate Class settings for replication?

#

at least then I can compare with someone who works

kindred widget
#

I haven't changed any of those settings. All of my settings for all of those are default at the moment.

naive locust
#

gotcha

#

thank you for your help Authaer. I will try checking all my settings on all my classes and then delete and recreate teh var to see if tha tworks.

kindred widget
#

Just curious. What do you have in your notify function?

naive locust
#

it first tests if not the server, or if the server if it is a local controller, and sets Widget values (a HUD, but not using hud class)

#

but i also have logging now to see if things are transacting

kindred widget
#

Can you put a print at the beginning of it and see where it's printing? If your clients ever print.

naive locust
#

the client never prints

kindred widget
#

But server does?

naive locust
#

tht's what i was trying ot say earlier

#

yes

#

the server's local player

#

and the server version of the client (through rep_notify)

kindred widget
#

I'd seriously look at that struct. Maybe try setting it differently. I don't know. That's the only way I could get it to not repnotify on clients.

naive locust
#

i believe it ๐Ÿ™‚ its just me man

#

i'm hot garbage

#

always run into these obscure things

kindred widget
#

Nah. People notoriously have issues with structs.

#

For a start, what happens if you take out the SetMembers part and plug the make directly into the set node?

naive locust
#

i was thinking ot try different methods of what i am already doing there as a test

#

i've been on this for 3 days mate ๐Ÿ˜ฆ

kindred widget
#

I wonder..

#

Can you give me a screenshot of your struct default values from the playerstate?

naive locust
#

sure

kindred widget
#

Those two blue references going into the Make on the struct, are they actually valid?

#

Because if they're not valid, you're not actually changing anything, therefor the server has nothing to tell the clients to change.

naive locust
#

they're definitely valid. this works fine on single player and the server gets the data. Also, there is a byte value (total laps) getting passed in

#

i'm telling ya man

#

its a bit of crap luck. i'm going to try the things you suggested

#

try this

#

nvm

#

you already trid it

#

time for me to get to sleep

kindred widget
#

Still incredibly sure that it's just the struct. If the notify is running on the server and not the client, then the variable hasn't changed.

naive locust
#

i will give it a go. Thank you so much for trying to help me Authaer

kindred widget
#

Anytime. Always up for a good puzzle.

naive locust
#

๐Ÿ™‚

unkempt tiger
#

Hey, tried an extremely basic built-in ACharacter replication in-editor test with network emulation with upload/download times of between 30-40 ms each, and I am getting some extremely jittery results https://gfycat.com/CaringUniqueKissingbug

#

the motion blur inconsistency makes it extremely obvious incase the fps is too low on that capture

#

It seems like ping fluctuations are causing the character to jitter (low ms results in a closer-to-server approximation while high ms results in a further-from-server approximation) resulting in jittering (that is my theory at least)

#

I was wondering if anyone here can confirm this is indeed the case, and perhaps share some insights for what it takes to create a more fluid character replication

#

I'm down for implementing my own Pawn replication from scratch if that's what it takes

gritty pelican
#

Hello everyone. Very urgently need help finding servers in Steam. Who can help?

kindred widget
#

So I have a weapon that is spawned by the playercharacter as a separate actor and then attached to socket of a mesh component. Typical weapon spawn. I have the self reference of the character fed into the weapon's spawn. I ALSO have tried to setowner on the weapon to both the playercharacter and the playercontroller. Weapon actor is set to replicate. However, no matter what I do, I cannot seem to get this weapon to call a server rpc on itself. I'm trying to call left click in the playercharacter and have that call a client event in the weapon, which calls the serverRPC in the same weapon. Server RPC never fires when used from a client. I'm led to believe that SetOwner was also the NetOwner for this object. Any actor that has an owner that is owned by the client should be able to call server RPCs. Or so I've read. And yet I can't get it to work no matter how I spawn the weapon or set the owner. I'm either trying to do something dumb or really not understanding this.

kindred widget
#

I should come on here and leave long paragraphs more often. I always figure it out fifteen minutes later. Didn't replicate the variable to the client for it to use to call the right event.

royal isle
#

Hey, I have created a server list where you click on the server you want to connect to to actually connect. This works fine the first time but if you return to the main menu and click on a different server it takes you back to the one you already connected to, any ideas?

fading birch
#

how are you traveling to the server?

royal isle
#

with ClientTravel

#

Could this be an issue with using NAME_GameSession for hosting and joining sessions?

fading birch
#

yeah likely

twin juniper
#

Hello everyone,

Iam currently creating an AnimBP and iam trying to replicate my AimOffset. It works fine when my characters are near eachother, but as soon as they are like 5 Meters apart from each other, it stops replicating.

I would be grateful, if anyone could help me.

kindred widget
#

@twin juniper Have you changed any default settings for LOD or relevancy? That doesn't happen by default.

twin juniper
#

I think I changed something with the LOD, iam looking into that, thank you for the quick reply!

kindred widget
#

I know AimOffsets in the animgraph have an LOD setting. Should be default to -1 though.

twin juniper
#

Yeah, I had it at 0, but when I change it to -1 it gives me a warning "AimOffset 'Hip_AimOffset' contains no LOD Threshold", do you know why that happens? (sorry if iam stupid, never really used animations that much before xD)

kindred widget
#

Mine is a 1d offset, but that LOD setting at the top is what you changed and it gave you a warning?

twin juniper
kindred widget
#

Does your mesh have any extra LOD settings?

twin juniper
#

Its the default mannequin, but no extra LOD settings

kindred widget
#

I doubt that it's that then. The -1 warning is probably just a warning for 2d offsets since they take more performance than a 1d. The -1 should still work though. Even your 0 should work.

#

When you get out of range, does the other player's pawn recenter their offset or does it stay where it was at. If you change it and then reenter the 5meter area, does it change to the new oriented offset?

twin juniper
#

same with 1D, the 0 wont give an Warning, but if its 0 then it stops working after the 5 meter radius

#

it recenters

kindred widget
#

Hmm Sec

#

How are you setting that Aimpitch in the last photo?

twin juniper
kindred widget
#

Hmm. I am setting mine a little differently. In the Animblueprint it's the exact same, but in the Pawn, I'm setting the Pitch on tick, but I'm only replicating it to the server 45 times a second to have it replicate to every other client that isn't the owner of the pawn.

#

Timer started on beginplay

#

Collapsed graph being ran on tick behind a Remote side of SwitchHasAuthority.

twin juniper
#

Thats a way more effecient way, thank you :D
But about the warning, should I just ignore it?cause it is still happening

kindred widget
#

@twin juniper I mean, setting it to 0 is the same thing as -1. I think it's just a performance warning so that you don't render an actor WAAAY in the distance, and still needlessly update the facing when they're just a tiny dot on the map.

twin juniper
#

somehow it isnt, when i set it to -1 the aimoffset works all the time, when i set it to 0 it only replicates in the radius

fast arrow
#

Hello guys, i've been working on the multiplayer project and for now i've created a dedicated server, but for some reasons, i can't see info about it, but i still see him in server list(it;s just empty line with 0/0 players. more over i cant join it. joining session function return fail. i checked my logs and found this line : Warning: OSS: Invalid session info for session GameSession in GetResolvedConnectString(). Do you have any idea what's wrong and how to fix it?

narrow prairie
#

did anyone ever tried making a real time strategy? and successfully have 100's of units?

kindred widget
#

@narrow prairie Having 100s of units is not really that bad. You just need some optimization. A HUUUGE one for characters is turning the tick rate of their movement component down. I did that once as a test and my FPS nearly doubled with about 120 characters on screen with two player viewports up.

#

Animations and movement will tank FPS if left uncapped. It's really important to focus there on projects with character classes for some seriously easy optimization.

narrow prairie
#

im not rlly that familiar with tickrate on movement component, mind shed a light on that where to find?

#

i mean, at 100 units not moving at all. i get these fps

#

i disabled almost everything inside the character movement component

meager spade
#

you want to also use Animation Sharing

#

if all units have the same movement and stuff

narrow prairie
#

i was experimenting

meager spade
#

so only one skeleton updates

#

the rest just copy the pose

narrow prairie
#

the documentation of animation sharing is rlly rare

meager spade
#

yup

narrow prairie
#

or hard to find

meager spade
#

im gonna be using it soon

#

but the docs are shobby

narrow prairie
#

i coudnt understand it

meager spade
#

same as assetmanager, etc

narrow prairie
#

๐Ÿ˜›

#

i cannot even find a proper tutorial on animation sharing ๐Ÿ˜ฆ

odd iron
#

Goodday Guys

#

its just adding point for server ( Host )

#

i've tried to change it many time to run owning client or on server to test same

narrow prairie
#

@meager spade i downloaded a skeleton from mixamo with only 25 bones, that also saved a ton on performance

meager spade
#

yeah skeleton updates are expensive

narrow prairie
#

im pumping out 50 more units

#

so im at 150 now

#

with 45 fps

#

in pie

#

so thats getting somewhere

rotund sapphire
#

check stat rhi and draw calls, maybe you render too much. artists for example setup characters with insane amounts of materials. also triangle count can be an issue. cloth sim is a big issue (may spawn characters very slow actually)

narrow prairie
#

seems indeed i have insane draw calls going on

#

im not rlly sure what "normal" is

#

but over 5k with 100 units

rotund sapphire
#

change on scene lighting, eg disable shadow it will drop the calls to the third

#

i prefer characters with least amount of individual materials

naive locust
#

are you using LOD's on your meshes and MIPMAPS for textures?

rotund sapphire
#

lod can help indeed, but your lod model should use less materials, preferably 1 or 2 at tops

naive locust
#

@rotund sapphire that is definitely something i remember the Unreal expert on optimization had on his livestream about optimization

#

2 tops, maybe 3 pushing it

#

good call ๐Ÿ™‚

narrow prairie
#

i have lods aswell, ye only 3 of em

#

im not sure if the textures are handled in some sort of way

naive locust
#

i mean, its dependent on game, but i think the optimization video had 5/6, not sure.

#

mipmaps?

narrow prairie
#

at least its almost at 200 units

#

thx for advice given so far

naive locust
#

that is the course where you'll find a TON of performance optimization techniques on the Unreal Engine website online learning section

#

Suggestion: Get into the habit of using software like OneNote or Johplin to build a notebook of Unreal Engine stuff you learn along the way. Never memorize things that are lower than surface level, always document

#

Big Shoutout to Victor Lerp. I love it when this guy hosts livestreams. Far better than Alex Paschall who just talked over everyone all the time and felt the need to finish their sentences.

narrow prairie
#

allright, thx for the tips.

naive locust
#

question

narrow prairie
#

this is running much better then where i started today

naive locust
#

are you using material instances for all those soldiers?

narrow prairie
#

no

naive locust
#

ok

narrow prairie
#

i dont think so atm

#

would that also help?

#

the advise u gave about textures rlly increased a lot of fps

#

its having like 6 mat id's atm

#

i should prolly use a 3d application and try to confine it into one

naive locust
#

I cannot comment on that. that info i gave you earlier talks about master material and material instances

#

6??? jeez man

narrow prairie
#

srry i did not see any link

naive locust
#

the learning path

#

I would absolutely spend a few hours and understand the optimization techniques there and how you can apply them to your setup and see how much more performance you can gain. Do you have a lot of printing to a log going on as well in tick?

narrow prairie
#

allright found it

#

nothing on ticks

naive locust
#

lotta mercy

narrow prairie
#

again, thx for advise rlly helped me out a lot

fast arrow
#

do somebody know, what argument should i pass to ue_log() to show the name of the session. i mean i dont know the type that this macro accept

bitter oriole
#

UE_LOG(..., "%s", *FStringtype);

fast arrow
#

i've tried but it stats invalid arg

#

nevermind i missed * ) ty. im new to c++ )

naive locust
#

@fast arrow the question is, do you understand why you need the asterisk there?

fast arrow
#

because it is pointer? or not?

#

not sure, to be honest)

naive locust
#

in there, kind of hidden, you will find your answer

fast arrow
#

Thank you)

#

But this was only part of my problem. i've created dedicated server and session but i cant join it, though i can see it in server list (but the name of server is empty and it has 0/0 players). there is this line in my logs and i cant figure out how to fix it "OSS: Invalid session info for session GameSession in GetResolvedConnectString()"

naive locust
#

that part i will not be able to assist. So something in the call to GetResolvedConnectString is bombing the OSS

fast arrow
#

i just dont know hot to debug it correctly, because i use blueprint for join part, and function join session return false and it seems like blueprint search result is empty.

rotund sapphire
#

you can take a look at shootergame example from epic has setup for oss and just works

limber gyro
#

it seems EPIC launched some new stuff about the online services

#

was this announced somewhere?

rotund sapphire
#

barely

limber gyro
#

is this new or i just didnt notice

bitter oriole
#

Interesting

#

Looks like they have matchmaking now

limber gyro
#

ye, i was actualy trying to find something on ranked matchmaking using their services

polar wing
#

whaat, that's awesome. I was super curious when more would be revealed about the SDK.

meager spade
#

been thyere for a while @limber gyro

#

they have updated tho

#

which is nice

oblique mountain
#

is there any difference between the sessions nodes and the "open ip" command? Oc there are more features for the session nodes but I mean an advantage like a more stable multiplayer experience or something?

bitter oriole
#

sessions allow you to get the ip in the first place

#

Or to not have any at all

#

using Steam net

winged badger
#

once you connect there is no difference how you did it on the network performance

oblique mountain
#

Ok, thanks!

jolly siren
#

Is ServerNotifyLoadedWorld called when the client has finished loading the map? Or when they start loading the new map?

fleet raven
#

looks like it runs twice? once when they loaded and initialized the transition world, and once when they loaded and initialized the target

jolly siren
#

ah hmm I'm trying to call something server-side when the client has finished loading the map. Looks like ServerNotifyLoadedWorld is a sealed event

#

Hm maybe I can still override the _Implementation

fleet raven
#

looks like the whole point of sealed event is to make it not virtual

#

bit weird that that even exists

jolly siren
#

yeah ServerNotifyLoadedWorld is sealed though. I wonder if I can still override ServerNotifyLoadedWorld_Implementation

#

nope, didn't work :/

#

There are literally 8 sealed events in the entire engine

fleet raven
#

implementing that feature was definitely worth it

jolly siren
#

lol

meager spade
#

@jolly siren GM has a client side callback

#

er

#

GS

#

me and zlo was looking through this the other day

#

i actually think we ended up giving up

#

cause we hit the same shit you did

jolly siren
#

Looks like ServerNotifyLoadedWorld has always been sealed. Sealed by Tim himself

meager spade
#

but why seal it tho?

#

its like the perfect RPC to do additional stuff

jolly siren
#

Right, that's why I was going back in history to check if there was a reason stated

meager spade
#

looks like your only way is another RPC inside NotifyLoadedWorld

#

which stinks.

jolly siren
#

yeah I think I'm just either going to unseal it or add a virtual callback

meager spade
#

but honestly, 2 days ago me and zlo both saw that

#

and was like WTF..

jolly siren
#

lol ๐Ÿคฆโ€โ™‚๏ธ

meager spade
#

we were looking for a nice callback to do stuff when all clients have finished loading the level, just a simple thing

#

ended up making another RPC

#

cause we dont use source engine

jolly siren
#

Right, yeah I'm just hooking up EAC authentication. But want to do it after they finish loading the map so slow machines don't timeout

fleet raven
#

how do you get access to EAC? br_thinking

meager spade
#

he has his fingers in the correct pies?

#

o_0

jolly siren
#

๐Ÿง 

gritty pelican
#

how to call replicating using on server side?

#

DOREPLIFETIME_CONDITION(ACPP_DesertCharacter, bIsPlayerMoveForward, );

jolly siren
#

Just call the function on the server when you change the value

#
bIsPlayerMoveForward = true;
OnRep_IsPlayerMoveForward();
solar stirrup
#

I'd probably make a setter for that too, and have it call the OnRep if the value changes

fading birch
#

iirc OnRep is called everytime the value is updated. Even if it doesn't change.

naive locust
#

Oftentimes, it is desired to execute some logic in response to the value of a replicated variable changing. Variables that are marked RepNotify, have a special function called automatically any time the value is changed, on both Network Authority and Remote Machines.

#

I think the oversight is: if the value of some replicated var (int) is 100, and you overwrite it with 100 (with a set) I would think RepNotify would run

#

I mean, right now, I'm having some issues with replicating structs and onrep notify is NOT running on the client

fading birch
#

we've run into the issue where the server is executing the rep notify before the client is even ready for replication. It's a difficult problem to solve.

meager spade
#

Onrep wont call everytime its changed

#

Only if the value is different

#

In c++ there is way to set it as repnotify always

#

Not sure that's possible in bp

stray gull
#

im having some trouble displaying the player list in the lobby, i followed this tutorial but the client doesnt see anything

stray gull
#

if i print something in the event that adds the player to the list it only prints on the server, so the client must not be running the event although they are replicated 'run on owning client'

twin juniper
#

here is the thing "Run on owning client" is not equal to "run on client"

#

if its owner is not client

#

then yep it wont

#

and you dont need to manually add players to a list

stray gull
#

i know that there is a list in gamestate

twin juniper
#

you can access playerlist made of playerstates from gamestate

stray gull
#

i was gonna fix it up when i got it working correctly

naive locust
#

you guys are funny ๐Ÿ™‚ I love the popcorn image

twin juniper
#

cant read

#

need a higher res

stray gull
#

rip, is it higher if you open the image from imgur

twin juniper
#

oh

#

mb

#

anyways

#

what is this bluepritn

#

where is it located

stray gull
#

that is the gamemode bp

twin juniper
#

that is your reason

#

gamemode doesnt exist on clients

#

therefore its owner is server

#

put that client function where a client can access

stray gull
#

that event is run on server then replicated to clients

naive locust
#

one of the safest place, i feel, to do client calls is playercontroller... the client owns the playercontroller; just a statement, not in response to anything

stray gull
#

the add player event is in the player controller

twin juniper
#

here is the thing

#

it is not replicating to clients

#

as I said

#

Run on owning Client != Run on client

naive locust
#

in the large image, it appears he's using playercontroller to run an event that is marked for run on owning client; why wouldn't that run?

twin juniper
#

ooh

naive locust
#

PCLobby is a playercontroller, the client owns the playercontroller

twin juniper
#

I didnt see the target

#

lol mb

stray gull
#

alg lmao

naive locust
#

help, someone get this guy a drink

#

although resdun, why do you have the actual event on the gamemode marked as run on server?

#

cautiousness?

stray gull
#

idk just followed the tutorial

twin juniper
#

why deal with this

#

if you can use the playerlist on gamestate

stray gull
#

i tried that yesterday and failed it just wont replicate to clients

twin juniper
#

how lol

#

I did make a scoreboard using the playerlist in State

stray gull
#

should i put everything in the gamemode bp into gamestate

twin juniper
#

also crazy theory but still

#

sometimes when I Call a "Server" function

#

on my widgets

#

it wont get called

#

unless I chain it to some actor with replication

#

it might be because

#

server doesnt recognize the widgets

#

it might be the same with gamemode

#

clients dont have it

#

there fore maybe not able to reach there

#

try printing something

#

from within that function

#

and see if it reaches

stray gull
#

the gamemode function

twin juniper
#

nah

#

client function

#

add player one

stray gull
twin juniper
#

then it doesnt reach client

stray gull
#

client doesnt print anything

#

yea

twin juniper
#

yep

#

try to move your code

#

or you can create a chain

#

that was stupid

#

it works for the client one

#

but might not in serverside

#

just go to some actor

#

that is both on the server and client

#

and call it from there

#

for example

#

instead of moving your functions

#

make a caller function

#

in idk gamestate

#

and call the caller function in game mode

#

idk if that made sense

stray gull
#

yea, ill give it a go

twin juniper
#

dont make the caller function client

stray gull
#

ok

#

same thing happened

twin juniper
#

well u know the problem

#

fixing is the easier part lol

#

finding is kind of annoying tho

stray gull
#

so whats happening is that the gamemode is messing everything up

#

or the widgets

twin juniper
#

I personally dont work too much with gamemode

#

didnt really need it but would be happy to know its exact purposes

stray gull
#

the gamemode is where you keep like scores and such

#

so people clients cant change scores etc

#

i thin

twin juniper
#

clients still cant change score

#

if you wont allow it

naive locust
#

@kindred widget to get around this struct business, I am doing a manual transmission by way of calling an event on the PC from the GameState (which is where all of the manipulation of playerstate occurs), I check if the current struct = new struct, and if it does (meaning, no data changed, for instance, I run a job every second (I know it's cheesy but whatever) on the GS every second that updates the position of each player in the race, if the position didn't change, and nothing else in the struct changed, then no need to call the client, so it is somewhat more efficient than making constant reliable calls to client

#

I honestly believe something is wrong in blueprints when it comes to struct usage, replication, and onrep for the client

stray gull
#

i know how to do replication like in characters - all in the same bp but i cant get my head around replication and sharing info through multiple bps

naive locust
#

@stray gull map it out on paper. Most people when they see the mountain to climb to see if something will work, they either procrastinate and/or just don't do it and figure out another way (sometimes better, or nothing at all)

#

One way around that is to get your brain to secrete constant dopamine and trick it. to do this, do what [good] workhorse developers do (not rockstars); write one atomic piece of the puzzle, test, SUCCESS = dopamine, go to next one

#

This is why SQL rocks IMO because changing something in SQL takes almost no time to change, and you can make yourself very happy (and others) a hundred times a day. It takes very little effor to see things come to life in SQL.

stray gull
#

i dont even know the steps. so for firing a gun... you would have a multicast event and a run on server event, the server event would run the multicast and then run the fire function. and you would do a switch has authority to decide which player runs which set. like that, but i dont know if its the same steps or.....

naive locust
#

I don't understand the last part: "and you would do a switch has authority to decide which player runs which set"

#

where?

stray gull
#

unless ive been doing it entirely wrong this entire time

shy kelp
#

is there a way to use $_post with ue4 (PHP btw). Im making a login system, but im entering the credentials using the url or $_GET, and the security problems with that is pretty obvious lol. is there a way to use $_POST for it?

keen thorn
#

anyone tried using the OnlineBeacon classes? can it be used to low 2 servers talkt to eachother?

ocean geyser
#

@keen thorn i have and am currently using lobbybeacon classes as well. AFAIK if you wanted 2 servers to talk to each other you would need to make a client beacon on one of the servers and have them connect to your host beacon on the other server

barren warren
#

Is there a way out of the box to support 'instanced areas' in UE4? For example a player goes into a zone, potentially marked by a collision box and they can interact with the world but they and whatever they do is invisible to all other players on the server? For example placing down meshes with collision (so the server still needs to have knowledge of it but other clients don't get blocked by it).

thin stratus
#

Not really

#

@barren warren

#

You wouldn't use ue4s servers for that anyway

#

At least not only

heavy aurora
#

Could anyone point me in the direction of how i can make a server inside of a masterserver? Similar to the ark/rust type browser system

heavy aurora
#

Basically I donโ€™t want a create server button inside my game, I want to be able to make that elsewhere and my browser will listen for servers

naive locust
#

@heavy aurora If I understand this correctly: create a vertical box widget in your main window (in here, it appears you could use a horizontal box and inside that you're using vertical boxes), the middle window would be empty. Create a new widget for displaying the server data row. When the client polls to get a server list, they should get an array of some struct (the struct being the server row data), then the client iterates over its received struct array and for each one, creates the widget server data row from the struct, and adds them as children to the server list window

scarlet cypress
#

Why does the client see the weapon/item from the server, but the server doesnt see the one form the client? Thanks for any help!

winged badger
#

replication only works one way: from server to clients

#

your server has no idea what your equipped item is

#

and that design is non-viable

#

from unmaintainable, to that single blueprint causing half your game+ to get loaded at the same time

scarlet cypress
#

So how should i do it?

winged badger
scarlet cypress
#

Well that hurt me..

#

I have expirience with blueprint im just new to multiplayer

bitter oriole
#

Multiplayer is extremely hard, make sure you're ready to spend a large amount of time

scarlet cypress
#

I absolutly am

bitter oriole
scarlet cypress
#

Thanks

#

Why does the client see the weapon/item from the server, but the server doesnt see the one form the client? Thanks for any help!
@scarlet cypress Can you tell me what id have to do different here?

bitter oriole
#

Replication is only server to client

#

You can't create objects on the client, and have them exist on the server

scarlet cypress
#

so how would you do it?

kindred widget
#

Your issue is that you're not setting your variables on the server, so they're not getting replicated. So when you tell the server to multicast like that, it's still using default values and not the ones that the client changed.

scarlet cypress
#

Alright thanks!

#

So id have to make a event "set new value" (on server) passing the variables?

kindred widget
#

Remember that if you ever want to RPC to all, or update a variable on all other clients, you have to RPC to the server and set the variable there. Then it'll replicate correctly.

#

These may not be the greatest examples. Still learning myself, but here's how I'm handling state changes for my player character.

scarlet cypress
#

Yall could have told me id just need to pass the variables..

kindred widget
#

Passing them works too. Just depends on how you want to set it up. Just remember that if you want to replicate a variable, the set node has to be ran on the server's side.

scarlet cypress
#

Yeah i learnd that now thanks!

kindred widget
#

I had a huge issue learning networking stuff at first until I realized that an RPC was nothing more than a fancy way to say "Event that gets ran on a different machine"

scarlet cypress
#

In my case the server doesnt have to know about these variables until you switch weapon/item, so passing the should be fine.

naive locust
#

@scarlet cypress there are some things you have to keep in mind with multiplayer. #1, everyone has an instance of the game running on their machine (this is obvious but look at it deeper and it becomes wildly complex). #2, the server maintains copies of many actors that also exist on the client, including playercontroller, playerstate, gamestate. In some client instance, there exists only one playercontroller, the server has its own copy of all playercontrollers; the gamestate contains all of the playerstates, and because the gamestate is replicated to all clients, the playerstates for all players are also replicated to all clients. You as a client have your own playerstate that is updated through this replication mechanism. #3, the server is the entity that tells everyone elses game what to do so everyone is in coordination with each other. Without telling the server what it is you want to do (for example, move a pawn) and have the server replicate as needed, then only your game is updated with the delta.

I tell people to look at it this way: make believe you're playing a game of checkers with someone remotely over the phone, and you have a mediator in the middle who is keeping track of checker movement. So you want to move your piece; you tell the mediator to 'replicate' that delta to everyone, including you, to move the piece somewhere (including the mediator himself). After everyone has processed the command to move, everyone is now synchronized; you, your opponent, and the mediator all have your piece moved to exactly where you want it without you actually touching it

#

in the most perfect world, the only thing you are doing is providing input, that input is then only processed by the server to replicate out, and anything happening on the server is then replicated out. So, your machine, in a perfect world, is nothing more than a dumb terminal

scarlet cypress
#

Thanks a lot!

naive locust
#

obviously we don't live in a perfect world. Games are meant to be illusionary. Some things are done on the client only, for example, particle effects should only be done on the client side and not replicated out because usually particles do not affect the gameplay, they are only there for making people go ahhhhh, and hence no need to replicate something like that.

shy kelp
#

is there a way to use $_post with ue4 (PHP btw). Im making a login system, but im entering the credentials using the url or $_GET, and the security problems with that is pretty obvious lol. is there a way to use $_POST for it?

stoic acorn
#

Bit of a noob question here about multiplayer workflow. Do people tend to build a multiplayer game (that is intended for online play) with hosting LAN sessions? At what point do you test with say, the Steam Online Subsystem?

shy kelp
#

i never used LAN, i used IP to connect

#

then switched to Gamelift near the end of development

#

I would test with Steam near the end of development for logic

stoic acorn
#

and I'm getting this message in the log"Unable to create OnlineSubsystem module Steam"

#

Cannot for the life of me figure out why it's doing this and wondered if I can tackle the online part later and setup the game locally with LAN play

#

@shy kelp might look into what you mentioned instead if I need to test with remote players

naive locust
#

@stoic acorn It depends. each subsystem has their own niche requirements/setup/use cases. Steam has things that lan doesn't have. For example, achievements, a friend system, invites, etc. So, if your game is going to be on steam, then you should test it on steam, if you're going ot add additional components like i mentioned, or other steam subsystems, then you need to test those. I think working out the kinks of the base logic in LAN first is the first step; once the game 'works' as intended, then start moving to online subsystems

#

think of it as extra layers on top of the base multiplayer experience; get the base working, then add additional layers

stoic acorn
#

ok brilliant thanks guys. I'll test the majority of the work with LAN first. I have maybe one requirement from Steam and that would be Leaderboards

naive locust
#

ah, Wes Bunn, I love Wes Bunn's streams.

hasty orbit
#

Hello I have a problem I have a dedicated server but it detects me but does not make me join ideas?

[2020.04.25-12.21.50:306][791]LogNet: UNetDriver::TickDispatch: Very long time between ticks. DeltaTime: 679.83, Realtime: 679.83. IpNetDriver_2147482588
[2020.04.25-12.21.50:306][791]LogNet: NotifyAcceptingConnection accepted from: My ip
[2020.04.25-12.21.50:306][791]PacketHandlerLog: Error: PacketHandler parsing packet with zero's in last byte.
[2020.04.25-12.21.50:306][791]LogNet: NotifyAcceptingConnection accepted from: My Ip
[2020.04.25-12.21.50:308][791]PacketHandlerLog: Error: PacketHandler parsing packet with zero's in last byte.

stoic pebble
#

Hello, does anyone know a good way to replicate movement for ProjectileMovement Pawns? The default Replicate Movement option gets extremly choppy on the client when I spawn more than 20 of them.

naive locust
#

@stoic pebble what is a projectilemovement pawn? are you talking about a pawn with a projectile movement component?

stoic pebble
#

Yes, I want to visually replicate a pawn that is moving with the projectilemovement component on the server.

kindred widget
#

It's not really recommended to replicate fast moving objects. It's also generally a waste of network resources. This is why a lot of games multicast spawn the bullets in the same style and make it look as similar as possible.

elfin cliff
#

Anyone have a solution for this on null subsystem? Maxing out on 16 players over a dedicated server.

peak star
#

Well i got my sessions working over wifi now but no idea how. However, upon joining a session the client does not go to the server's level. What usually causes this problem?

elfin cliff
#

Im assuming 16 players is not a hard limit?

peak star
#

On the server side I just Open Level with "Listen" option. Do i need to do something more?

#

@elfin cliff I have read that 16 players is a hardcoded limit but can be changed if you alter the engine code and rebuild the engine

elfin cliff
#

@elfin cliff I have read that 16 players is a hardcoded limit but can be changed if you alter the engine code and rebuild the engine
@peak star Oh. Do you have any idea what i can change and where?

peak star
#

@elfin cliff sorry I don't remember which file it is

elfin cliff
#

Thanks for the direction though. Have been going insane since the morning.

meager spade
#

that should be an array :/

twin juniper
#

whats this

peak star
#

@elfin cliff I found it just by googling, and I think there are some answers on answerhun where I read that

#

Hey is there a way in blueprints to set the name of the session to something more friendly than the machine's name amd MAC address?

#

So when it shows up in a server list it can say "Bob's Game" for instance?

tawny parcel
#

For multiplayer are there best practices for keeping replicated variables to a minimum if you have a full set Resists, Stats (Str,Dex,Wis,ect), Regen Values, Multilpe Resources (Health, Mana, Energy), and Modifiers (Crit/Dodge/Block).

If all of those change consistently through the game, they need to be set to replicated correct?

I've tested keeping less-changed-often variables to change on the server but send a client event instead to update the stats. It works but I'm curious if there are any other techniques

elfin cliff
#

@peak star But im not using sessions at all. This is all in Null Subsystem. Found a config var MaxPlayers, but changing that does nothing.

winged badger
#

@tawny parcel anything but the variables that change constantly (health, mana, energy)

elfin cliff
#

Whats strange is, in the editor, if i set number of players to 17, and preview in new window, it still ends up with one that doesnt connect.
@peak star

winged badger
#

can be loaded from a data asset and have only the modifiers replicate, have each machine recalculate

peak star
#

Yeah i was asking people for help on a problem on my project.
For your problem I think the maxplayers doesmt do anything past the actual hard coded limit that you have to change in the engine source code

elfin cliff
#

Dont mind doing that. Am running on source anyway.

peak star
#

So you can make it lower than that amount (16) to have an effect, but no effect if higher than the hardcoded limit. That is what I have read anyway.

#

So the max players config is limited by the hardcoded limit

elfin cliff
#

Any idea how i can go about looking for this in the engine source?

tawny parcel
#

@winged badger Alright so the stats would be derivative from whatever gear buffs or w/e they have equipped type thing.

peak star
#

I just dont know which cpp or h file to change without searching the web again and I am babysitting right now

winged badger
#

pretty much, if you do have RPG like progression

elfin cliff
#

Haha! So am i!

winged badger
#

its fairly easy to sync the changes, as they happen rarely

elfin cliff
#

@peak star Thanks though. You pointed me in the right direction. (I hope)

winged badger
#

not replicating the same thing more then once is the important part

tawny parcel
#

Its more for my tool right now and I'm just thinking of optimization

winged badger
#

and while that helps bandwidth its not your main consideration, the more places you replicate the same data in, the greater the chance something goes out of sync

tawny parcel
#

gotcha good to know