#multiplayer

1 messages · Page 185 of 1

latent heart
#

A complete guide to Iris.

#

Setting it up, replicating your first property.

#

Integrating it with cmc and mover

fossil veldt
#

It's honestly barely different until you get to the lower level stuff like serializers and filters

fossil veldt
#

good joke

#

In CMC it just works

latent heart
#

You know I think very highly of you and your ability to do this!

fossil veldt
#

hahah why

#

There's actually also a way way bigger difference than this they aren't mentioning here btw

#

In Iris they made RPCs to become partial net blobs so you can send an absolutely ridiculously sized RPC and it will work fine

#

cos it just chops it up into little bits, streams it over and pieces the call back together on the other side

#

One thing I was utilizing to much enjoyment with Iris is sending my voxel chunk updates all as one RPC with a TArray ~16MB in size on average and it just works fine

latent heart
#

Incoming 200gb map transfer rpc

fossil veldt
#

Lol

#

empty executable with 1 RPC

#

server RPC's you the rest of the executable

latent heart
#

Heh

fossil veldt
#

yeah it is actually really cool tho, I didn't benchmark the limits of it so I have absolutely no idea where it becomes too ridiculous, but I didn't hit a limit on it with a fair amount of data

#

the only thing that sucks about it is that if you want to utilize that feature ur basically on the spot opting out of being able to swap back to the original replication system :(

latent heart
#

Is it much work to add everything to iris?

#

Or has epic done that already with the major gameplay classes?

valid bough
#

Hi, im trying to add foot steps to my game. Im doing the whole 9, using an anim notify, added a physical material to my layer info's , line tracing to get the Surface type... all works.

However, im getting a no owning connection for (player) so "ServerPlayFootStep" will not run.. my players are all connected. The only issue I can see is that the other client doesn't know about the footstep since AnimNotifies arent replicated so that would make sense. But im calling the footstep sounds and RPC functions on the player. So that doesn't make any sense either...

queen mortar
#

whats node should I use instead of get player character if even get owner isn't working?

valid bough
#

or get pawn

queen mortar
#

and owning pawn has something to do with hud idk

valid bough
#

Pretty sure pawn can achieve the same thing you're tryig to do

#

If you're trying to get the client, you can use the pawn to grab the client of the game.

queen mortar
#

I guess I have to make a work around

valid bough
#

I mean doesnt hurt to just try it. If it fails, it fails.

queen mortar
#

yeah Ive tried already

valid bough
#

You should prob set the owner of the grabable object to the character holding it

#

if you are not already

#

so you can just cast the grabable object->GetOwner()

#

Because logically, when you pick up the object, the player is now the owner of that object.

queen mortar
#

oh I should mention Im doing it in blueprints

valid bough
#

A little different but the logic should be the same imo

#

I would

set the owner of the grabbed object once picked up by the player to the player
use the owner of the grabbed object to cast to the player
do whatever you want after that

queen mortar
#

yeah I ment that when I said a workaround

#

thanks for help though

rain condor
ruby lodge
#

I feel like I am having a mistake in the way I am thinking of dedicated servers.

Do I even need to setup the dedicated server with steam if my game is on steam? I mean, I don't want the server to show up in a server list, it should just be available in-game for people to join matches etc.

fossil veldt
#

just not NPP

latent heart
#

Ah ha!

#

I guess I can see examples if I look for the NetSerialize thing?

fossil veldt
#

Ya

#

You're going to cry if you look at the net serializers

#

i hate iris net serializers so fucking much

latent heart
#

Lol

#

I bet you can macro them real good.

#

My project manager just sneezed. He hates macros with a passion 😄

ruby lodge
#

I followed this tutorial here from epic regarding setting up a dedicated server. Only difference is I am using my game instead haha.

When starting the server, everything looks fine in the logs. Now when trying to connect with clients, it shows me this and then proceeds to open the level locally so it doesn't connect to the server. Anyone has an idea what could be the issue?

What I tried:

  • Changing the levels being run by both.
  • deactivating firewall
fossil veldt
#

I hate macros too

latent heart
#

They have their uses.

#

If I can do it with a template or something, sure.

fossil veldt
#

I agree but i still avoid them like the plague

latent heart
#

But If I have to create a crap ton of boilerplate that isn't templateable, I'm not gunna.

fossil veldt
#

I don't mind em for #if UE_BUILD_SHIPPING kinda thing

#

or just disabling blocks of code

#

but I hate stuff like UE_KINDA_SMALL_NUMBER

#

using it for constants is lame

vapid fog
#

Unless you have super specific edge case needs, you can just have a bool that is open or closed and let the clients animate them.

odd hamlet
#

So i keep struggling, basically I need on each widget of my players to get a struct variable, but I cant set it via event construct, do you have any advice? Basically my blueprint generates a map and creates a struct with a lot of information, and sometimes the struct doeesnt reach the client, how could I work this arround, any help would be really usefull

fossil veldt
#

literally got bad juju'd from dissing on macros

timid fox
#

Heyo, weird issue here: I have a replicated actor placed in the level. When I start the game with 2 players as listen server in PIE windows, the actor has authority in BeginPlay on the client. I guess that has something to do with BeginPlay being called on the client before it properly connects or something? Anyone knows what I'm missing here?

lament flax
#

If it's placed in world the server has authority on the actor

maiden flame
nimble laurel
#

Hi you can make one game in multiplayer pm game Metin2 server windows and apk

#

I want to make a Metin2 server you can do that? On your computer and on your phone

thin stratus
#

Or literally a Server for the Game Metin2?

nimble laurel
thin stratus
#

If Metin2 uses UE (which I'm sure it doesn't?), then you'd still need the code to actually build the Server.
You can't just make a random Server for Metin2 with UE.

#

So my answer would be: No.

nimble laurel
#

who can make a metin2 server to run on the computer and on the phone

thin stratus
#

The Developers of Metin2?

ruby lodge
#

I used these commands

twin juniper
mystic estuary
# twin juniper would work better for my situation: replicate the door + door movement (so I ca...

You don't need to replicate the door movement and rotation. Once the client knows that the door is open, you can play the animation locally. To avoid some late joiners edge cases, you could replicate last state change time, and compare the time since that to the animation duration, and if it's less than the time since that, you can avoid playing any animation, and snap the door rotation. Make sure to replicate that time on actor creation only using InitialOnly in the RepNotify

maiden flame
twin juniper
ruby lodge
#

not trying to connect via steam as in creating an advanced session or so

#

shall I ?

maiden flame
#

Oh. I saw it failed to load the Steam subsystem, but it might not interfere with the local connection attempt afterwards.

ruby lodge
#

maybe the problem is that I am not creating a session 🫠

#

I thought I wouldn't need to because the dedicated server running is basically a session or isn't it

maiden flame
#

I don't remember if you need to create a session for the loopback address, sorry. I think the Unreal Engine documentation should be enough.

#

Meaning you don't need to do anything else to connect with your client, other than what it says.

ruby lodge
#

Idk if they create a session in some other way there

maiden flame
#

That is true. I can't remember if I got it to work or not from the base template, or if I created sessions using Advanced Sessions.

#

Either way, you could just try using Advanced Sessions if you would like to. They have an option for LAN, so it should work for local play if you want that option.

ruby lodge
#

I tried this as well that I open the client in main menu like it should be and then on a button press join the server. There it said it can't find main menu after clicking the button although the server isn't in main menu lol

ruby lodge
maiden flame
#

Yeah, it works for sure. I can help you with the configuration if needed. Sorry for not being much help regarding local play.

ruby lodge
#

My goal is not local play, don'T get me wrong haha

#

I want to have it on steam

maiden flame
ruby lodge
#

I just thought I would follow the docs for now to test it out locally first

maiden flame
#

Understandable

ruby lodge
#

that's why I would think that the open level with the ip adress as the level name is a better method for that

#

and not connecting on launch

maiden flame
#

For sure, and it's not really secure once you're playing over the internet. It's better to allow Steam's backend to handle the IP address stuff.

ruby lodge
#

If I knew how lol!

#

didn't yet get to the steam dedicated server part

maiden flame
#

I can help you with Advanced Sessions if that's the plugin you want to use. There's other options too.

ruby lodge
#

found some info in their docs but really little

ruby lodge
#

My game was listen server first but switching it to dedicated

maiden flame
#

Cool. There's basically nothing you need to do with the dedicated server besides setting it up following the Unreal docs.

#

Everything else can be handled with the plugin, and just making sure open the right ports.

ruby lodge
#

from what I have understood the 7777 port is the default one and should be open?

twin juniper
#

opening a port could be dangerous

ruby lodge
#

the docs didn't talk about opening it

#

they assumed it's open I guess

#

Look, usually I created sessions when I pressed on create match in the main menu

maiden flame
#

I believe you don't need to open Unreal's default port, but you will have to open some ports for Steam.

ruby lodge
#

now how am I supposed to do this for a dedicated server if he initially is in the game level only

maiden flame
#

It will open the level when you use the Join Session node.

ruby lodge
#

put the create advanced session node at the end of the game mode and test for if it's the dedicated server before that?

maiden flame
#

You just have to find the session first.

ruby lodge
#

I have to create it first

maiden flame
#

You can create dedicated sessions, and look for dedicated sessions.

ruby lodge
#

but where shall I create dedicated sessions I mean

maiden flame
#

That's up to you. I put it inside my Game Instance, but it might not be the best place for it.

ruby lodge
#

The server now doesn't go the old listen server route of opening it up with a button press in main menu. They initially are on the game level and because only server shall create sessions no one does atm

#

I would then put it at the end of my game mode i guess

maiden flame
#

You can open a level on the server directly after creating the session.

ruby lodge
#

But if he isn't on any level he can't run code. So first server needs to open a level and then create a session, no?

maiden flame
#

The server loads a default level first, yes.

ruby lodge
#

or do you mean using something like a intro level where the server chills and then creates a session from there and opens the game level

maiden flame
#

Basically

ruby lodge
maiden flame
#

Correct

ruby lodge
#

Look maybe I need to approach it differently. I have a main menu where you shall be able to invite friends and start matches together if you want. Does this already need to happen on a dedicated server or should only the actual game level be on a dedicated server?

#

otherwise I would handle it for the main menu and then create a session or so maybe

#

or join

maiden flame
#

Well, as you know, the dedicated server has no GUI.

#

It doesn't mean you can't launch a dedicated server via. the client though.

ruby lodge
#

correct, but via a button press you could call an event on the pc or so and that then can call the server event that creates the session

maiden flame
#

Which is one way to indirectly create a UI for the creating servers.

ruby lodge
#

I don't want UI for the servers, the clients handle all this part. That's not a problem

maiden flame
#

You could invite friends to a lobby level, which is already hosted by the dedicated server.

ruby lodge
#

just the logic of it isn't yet that fixed in my brain how dedicates servers work haha. If they were on a dedicated server already in the main menu then they can't join a game mode like Team Deathmatch for example and instead have to create a session with their dedicated server

ruby lodge
#

like fortnite menu screen where the characters stand there

maiden flame
#

Sure, that is offline though, I assume. Then you press a button, like "create session".

#

It is up to you if that session should have a lobby too, or start immediately.

ruby lodge
#

Ohhhh

maiden flame
#

It needs to be online if players should connect before the match begins obviously.

ruby lodge
#

now I see what you mean

#

that the server chills in a lobby level until it filled up

maiden flame
#

That is a common way, yeah.

ruby lodge
#

and then takes all players and creates an advanced session with them

maiden flame
#

Well, they're already inside the Advanced Session, but they will travel to the game map together.

ruby lodge
#

now look here. This is my main menu. When inviting friends they need to be able to join here in the main menu. I assume this can be seen as somehow a lobby, no?

#

otherwise I could do the route we just discussed if this is too complex

maiden flame
#

This can be your server lobby for sure.

#

You need to create the session and make your server go there too.

#

And then connect your players.

ruby lodge
#

but in games like this usually there are two lobbies. One like this I just screenshotted and the second where you are with your friends + the other players waiting for the start of the game

twin juniper
#

components should be set to VisibleAnywhere and which other one?

maiden flame
#

Then you can travel to a new map, and handle any game settings in the game mode, determined by what you select in the lobby.

maiden flame
#

Sorry, didn't see the layout properly yet.

ruby lodge
#

if it was offline, you wouldn't be able to invite your friends here, would you?

maiden flame
#

If you want to view your friends without having joined a server, I guess you could load their Steam IDs as long as you're connected to Steam, without being in a server yet.

#

Inviting your friends would require you to be connected to an actual server.

ruby lodge
#

So start as listen servers and then go over to dedicated?

maiden flame
#

Haven't tried that before though.

ruby lodge
#

hmm, yea then the main menu already needs to be on a dedicated server. But how would you then connect the players to a game lobby?

The following is where I don't understand fully how dedicated servers work:

Let's take for 3 friend groups. Each of them are in one of such main menu lobbies on a dedicated server.

Now group 1 starts a match and get's connected to a game lobby waiting for others to join. Now, first, is this on THEIR dedicated server or is it like another one and the initial one from the main menu just sent them there?

Also when the 2nd and 3rd group join the first, do they change dedicated server?

maiden flame
#

You're confusing me too xD

sinful tree
#

Beacons.

ruby lodge
#

hahah sorry, it's my 2nd day working on dedicated servers. Before I just read some basic stuff apparently but these questions were never answered xD

maiden flame
ruby lodge
#

beacons? What are those

maiden flame
#

Either way, I think we should clarify some stuff about the connection flow though.

ruby lodge
#

Alright I will write the steps rq, give ma 2 min

maiden flame
#

Actually, beacons might make it easier to achieve what you want. I'll just let Datura take it from here lol

#

I don't use beacons personally.

#

But it can make sense for your lobby system.

#

Just to clarify one thing though, if you're already connected to a server, you don't need to connect to another one. You could, but it is not necessary.

ruby lodge
#
  1. Open game
  2. Spawn in main menu where you shall be able to invite friends
  3. You can create private custom matches via listen server with friends only or you can join multiplayer vs strangers
  4. Upon doing the 2nd option in step 3, you get sent to a lobby before starting the match
  5. upon match start all players in that lobby get sent to a match
  6. after the match the players land in a lobby again and steps 4 to 6 repeat.
  7. If you leave with your friends or without you land in main menu again
#

I got the custom listen server thing in step 3 already finished basically besides the inviting friends part xD

#

like I have said my game was listen server only before

maiden flame
#

All of that is the same, except I think you would need to create the session before inviting your friends.

twin juniper
#

are you using listen server or dedicated server? :3

maiden flame
#

He is trying to setup dedicated servers now.

ruby lodge
#

working on dedicated server now

#

first I need to have the flow set on paper before coding it

#

I need to know where and when who connectes to what server etc.

sinful tree
#

I would avoid connecting to any dedicated game servers at all until you're actually ready to play the game. They're expensive to run, and you don't need the same level of processing power or engine capabiltiies if you're just trying to get players together before launching the game. You shouldn't need to have a player act as a host before either as you're not really "playing the game".

You likely want to have some kind of backend service that does matchmaking for you, that is event based, essentially, not an actual server server that is running, but instead a system that can communicate data between different players. Epic Online Services for example has a "Lobby" system that you can utilize to help join players together.
https://dev.epicgames.com/documentation/en-us/unreal-engine/lobbies-interface-in-unreal-engine?application_version=5.1

Once you have your "players joined up" together in your Lobby, you'd want to send a request from the lobby "leader" to your backend that manages your dedicated servers, spin one up for you with the desired map & settings and reports it back to your lobby system which then causes your "clients" (currently they're all just standalone instance games) to join to that server.

Epic Developer Community

A lobby is a group of players in a client application with some shared state. The Online Services Lobbies Interface provides an API for creating and man...

#

I mispoke with Beacons, as those are mostly useful for communicating with a server that is already running.

maiden flame
#

Oh, didn't know Epic has a lobby system like that.

twin juniper
#

that's just Online Subsystems and Epic Online Services

ruby lodge
#

Steam has Online Subsystems

#

My game already has an appID on steam

ruby lodge
#

just not published yet

sinful tree
#

They too have a lobby system.

maiden flame
#

:0 nice

#

Peer-to-peer lobby

ruby lodge
#

peer-to-peer is listen server based, no?

twin juniper
maiden flame
#

Don't know how you would integrate that with the engine though. Like displaying game settings and all that. Definetely a C++ thing.

sinful tree
ruby lodge
ruby lodge
ruby lodge
sinful tree
#

Peer-to-Peer is a very specific communication model whereby everyone is responsible for their own state of replicated systems.
A listen server is still a client-server model where the server is the one responsible for the state of replicated systems.

maiden flame
ruby lodge
#

oh awesome

maiden flame
#

Without creating a dedicated server first. It's just a peer-to-peer system.

#

Apparently it's more lightweight like Datura recommended.

ruby lodge
#

i am indeed an indie developer so if that minimizes cost it's in my interest xD

maiden flame
#

The way you created the layout, your main menu and lobby is kind of one and the same.

twin juniper
#

there's no P2P in unreal

maiden flame
#

It's outside of Unreal, Cat. It's Steam's backend.

twin juniper
#

same

maiden flame
#

🤷‍♂️

sinful tree
#

You don't really get a choice in the matter unless you're designing your own server system.
You want to utilize Lobby systems to not have the requirement of running a server that is the "host" of the game before the game is actually being played.
If you were to say have a dedicated server launched and had 4 players sitting around waiting on it for hours just chatting for whatever reason, it's a big drain on your money for 0 benefit.
If you were to have one client act as a listen server host to act as your lobby system, every time the leader hops out you get that fun time of "host left the game..." scenario where all the players would be disconnected and have to search for more lobbies, even though they may have had a full one and just the host dropped.
The only solution then is to have a system in which the clients don't technically connect to a server, but just broadcast to a system like Steam saying they want to join a game, and allow Steam to pair up the players and send the messaging indicating who has joined, who left, what the settings for the game are, etc.

maiden flame
#

Dedicated servers are expensive either way, so it's not a bad idea to consider relying on your community to host servers. Doesn't mean using Steam's matchmaking is a bad idea though.

ruby lodge
#

if no one is playing, you pay 0

#

if 1000 play you should hopefully earn the money to pay the fees and get yourself a coffee

maiden flame
#

If you plan to pay for servers I would definitely look into Steam's matchmaking, like Datura recommends.

#

I don't have any extra resources for that, so I just want my players to host xD

ruby lodge
maiden flame
#

You don't need a listen server lobby either way though.

#

Just forget about that lol

#

Well it's an option, but yeah

ruby lodge
sinful tree
#

There's been plenty of games that do that - have the one host act as the listen server that you connect to... But yea, as soon as the host leaves it kicks everyone out before even starting the game. Super annoying. >_<

maiden flame
ruby lodge
ruby lodge
#

pain.

ruby lodge
#

awesome

sinful tree
#

Yes.

ruby lodge
#

One last question. Where shall the creation of the session happen in the code @sinful tree ? Before with listen servers I did it when pressing on a button that says something like "create match". Then others join by selecting a lobby and press "join match" . Now the dedicated server doesn't have that step though so shall I put the "create advanced session" node at the end of the game mode begin play?

twin juniper
#

I have a component attached to an actor, the actor relative transform changes, but the component shouldn't move, how?

sinful tree
#

Create Match / Join Match buttons > Communicate to Steam Lobby system to either create a lobby or find one.

sinful tree
ruby lodge
twin juniper
maiden flame
#

The dedicated server should create a session automatically on launch, but I'm not sure how it can take settings from somewhere. Does the matchmaking system allow you to configure a server, or simply find an appropriate one?

twin juniper
#

so the relative rotation changes of the door, but the box collision shouldn't

ruby lodge
#

if there is no session creation node I don't think it works

maiden flame
#

Yeah it needs to create a session of course, for playing online.

#

Also the lobby is handled before you join a session, if you use Steam's matchmaking.

ruby lodge
maiden flame
#

You could probably use the matchmaking system or even beacons to configure server settings though.

#

Before connecting anyone.

sinful tree
ruby lodge
#

that works so far already. Just besides the inviting friends part, rn they have to find the lobby and join it in the panel

#

dedicated to online where you also get level XP etc. . So competitive is only dedicated

#

I know many of my audience will use the private lobby part so I have to do it too

sinful tree
#

Ok, so then again, you'd "Create" a game, you could specify Open (joins a dedicated server) or Private (they'll be the listen server). In both instances, you can still utilize the Lobby system to pair up players.

#

When "Joining" you'd have the same thing - either Open or Private.

#

You'd report to the lobby system which kind of game you're wanting to join - private I'm not sure how you'd filter this.

ruby lodge
#

hmm i see, well for dedicated players shouldn't create either way and not have the option. It shall happen automatically if none are open though

#

but nevertheless, do dedicated servers need to create the session in the Project code as well or only in backend on gamelift etc.?

#

like do I need something like a create advanced session node in the game mode begin play?

sinful tree
#

You technically don't need any sessions. It all depends on your backend and how you want things to work.

ruby lodge
#

what would be the difference with and without? Right now I don'T create a session and it does not work with clients joining. But I don't also have a backend yet and only run the server locally from cmd

#

maybe I messed something else up in the process for why it does not work if that's supposed to work without creating sessions too, idk

sinful tree
#

Sessions is part of Online Subsystems, it's a means of communicating data about a game server without requiring you to actually connect to a server.

#

It's very much similar to a lobby, but for players to find active games.

#

Lobby = Players find Players
Session = Players find Games

ruby lodge
#

I see, so it's more a thing for listen server games only?

sinful tree
#

Not necessarily.

#

I can have a dedicated server running on my computer at home that players could join for example.

#

I may still want to use sessions for players to be able to find that active game.

ruby lodge
#

But that also means it should work without

sinful tree
#

It can, but it's usually a bit more difficult.

ruby lodge
#

I don't need players to find specific dedicated server active games

#

they should just randomly join some

sinful tree
#

Sessions typically handle NAT punchthrough for example... If you don't know how to set up your firewalls and route network traffic through your router, then you likely would have trouble getting players to connect.

ruby lodge
#

So that's maybe why locally it's not working for me

sinful tree
#

If you're connecting locally, like all on the same network, then you shouldn't even be using your external IP address.

ruby lodge
#

i deactivated my anti virus firewall for the test but didn't help

ruby lodge
#

and port 7777

sinful tree
#

And all running on the same computer?

ruby lodge
#

yes

#

just with my game and not lyra template

#

The server runs correctly from what I can tell via the logs

#

the client on the other hand cannot connect to the server. The server logs don't even notice the client trying to

#

that's the client logs. After that part he just give sup and opens an own local game

sinful tree
#

Should be working. Sessions doesn't really have much to do with it.

maiden flame
#

Connecting to the loopback address is different though.

sinful tree
maiden flame
#

Oh

#

But it's convenient when using Steam, it handles connection to the server for you.

sinful tree
#

Sessions handle some of the networking stuff that you don't necessarily need to anymore - knowing IP Addresses, ensuring networking is set up correctly, etc.
GameLift itself can handle it without creating sessions for example.

maiden flame
#

I see

#

As long as you're not directly connecting, and you're using authenticated users, it's secure enough.

#

So I guess sessions are convenient for that reason.

ruby lodge
#

So my problem lies somewhere else

#

great 🫠

#

I will try it out nevertheless and see if it fixes my problem

#

if so, then it doesn't have disadvantages using it I guess

ruby lodge
#

alright so creating a session did not solve it 😄

#

it might be that port 7777 is closed for me though now that I checked online

#

but this doesn't mean it wouldn't work if I try it with an external IP adress of a different pc, does it?

sinful tree
#

Port shouldn't matter if it's on the same PC, unless something else is running on 7777 on that same machine.

ancient adder
#

@ruby lodge The client is not able to connect to the dedicated server?

ruby lodge
#

What else could be the problem? :/

twin juniper
#

So I made a door, as a lot of you guys told me to do and for the multiplayer part, I didn't do anything and everything is replicated correctly, I would like to know how?

Here's my BP code for the timeline:

sinful tree
opaque tapir
#

Hello everyone. I'm trying to create, find and join sessions using OnlineSessionInterfaceNull (it's just to test stuff) and I can actually do that, everything seems to work, but I'm getting this weird warning and it sounds concerning:

LogOnlineSession: Warning: OSS: Player DESKTOP-7K12KN8-A7597F9A407475C5698866B32B34339F is not part of session (GameSession)

Strangely, if I try to do the same process in an empty project, the warning doesn't show up, but I can't figure out what may be the cause. Does anyone experienced this and can help me understand what's going on? I tried to look around, but there's not much on Google on the topic.

If you need any extra details on the matters, I'll be more than happy to provide them.

sinful tree
#

Then this isn't being replicated. What calls "Door Opens" and "Door Closes"?

sinful tree
#

Then it's happening locally on each client.

twin juniper
#

so this function is like replicating everything?

sinful tree
#

No

#

It's not replicating anything. It only happens if the local machine detects an overlap

twin juniper
sinful tree
#

The door isn't replicating.

#

You are moving your character to the door, the local machine detects that the character is there.

#

This means that it can be out of sync.

#

If you didn't detect the character at the door, then the local machine wouldn't open the door.

twin juniper
#

ohhh, that's just a character which is replicated hitting it, not replicated

#

Is that a good way of doing it?

sinful tree
#

No

twin juniper
#
void ADoor::NotifyActorBeginOverlap(AActor* OtherActor)
{
    Super::NotifyActorBeginOverlap(OtherActor);

    if(AGASTrainingCharacter* player = Cast<AGASTrainingCharacter>(OtherActor))
    {
        DoorOpens();
    }
}
```This is what I have rn, what's the correct way of doing it?
sinful tree
#

If you want the door to be properly replicated, and only when there is a character overlapping it, you would ensure that the overlap is handled only on the server. The server would set a bool that is set up with OnRep. The bool's OnRep when true can trigger the "Play" of the timeline. When set false can trigger the "Reverse" of the timeline.

twin juniper
#

I want it to work in between too

sinful tree
#

Then you may want to replicate the rotation value itself and have that OnRep set the rotation of the mesh.

twin juniper
#

wait so a Server RPC for the timeline? and a OnRep variable for the angle?

sinful tree
#

A server RPC only if you want the client to tell the server.

#

If you're using an overlap, the server itself should be able to detect it without a client telling it.

twin juniper
#

but I think it's from the client

#

I made this but unsure what to do:

    UPROPERTY(ReplicatedUsing=OnRep_Rotation)
    FRotator currentRelativeRotation{0,0,0};

    UFUNCTION()
    void OnRep_Rotation();
sinful tree
#

When you have replicated actors, like characters, they exist on the server and the client.

#

So when you move your character on your client, you're also telling the server where you want to move that actor, and that actor position is then replicated to all other clients.

#

So when you move your character to an overlap area, the server can detect that overlap automatically and replicate any results of that overlap to other clients without the client walking into the overlap telling the server that they walked into that overlap.

#

You can have things done on the client without the server doing it, but then you're running into a scenario where it can become desynchronized from what the server has.

twin juniper
#

Should the code in the NotifyActorEndOverlap change?

sinful tree
#

You can check HasAuthority().

twin juniper
#

I understand how the networking stuff works but not what the OnRep would do here

sinful tree
#

If so, then you are executing on the authority (which is usually the server) of replicated actors.

#

The OnRep is what tells other clients what to move the door to.

twin juniper
sinful tree
#

If you're replicating the rotation then there's not really a point to starting a timeline on the clients.

twin juniper
#

Something like this?

// Server
void ADoor::NotifyActorBeginOverlap(AActor* OtherActor)
{
    Super::NotifyActorBeginOverlap(OtherActor);

    AGASTrainingCharacter* player = Cast<AGASTrainingCharacter>(OtherActor);
    if(HasAuthority() && player != nullptr)
    {
        currentRelativeRotation = doorMesh->GetRelativeRotation();
        DoorOpens();
    }
}
void ADoor::NotifyActorEndOverlap(AActor* OtherActor)
{
    Super::NotifyActorEndOverlap(OtherActor);

    AGASTrainingCharacter* player = Cast<AGASTrainingCharacter>(OtherActor);
    if(HasAuthority() && player != nullptr)
    {
        currentRelativeRotation = doorMesh->GetRelativeRotation();
        DoorCloses();
    }
}

// Clients
void ADoor::OnRep_Rotation(bool entered)
{
    if(entered == true)
    {
        DoorOpens();
    }
    else
    {
        DoorCloses();
    }
}
```This is a listen server game so yes I want the door to animate on the server too
sinful tree
#

That looks a bit better, yea

twin juniper
#

it says that they first param must be FRotator

sinful tree
#

Likely because your variable "Rotation" isn't a bool.

twin juniper
#

if it would be a bool, then it wouldn't work for in between the start and the end of the timeline I think

sinful tree
#

If you want to replicate just the start and stop of a timeline, you can do this with a bool. When the bool goes true or false, the timeline can start locally on clients which can play the timeline to show the door being open or closed. It won't be 100% in sync, but the state and timeline woudl ensure that all clients will either see the door opened or closed by the time the timeline finishes playing.

If you want to replicate the position of the rotation, eg. lets say you have a slow moving door (takes like 5 seconds to open or something) and you want it to be more or less in sync on clients, even if they happen to get to the door a little bit later (eg. it entered relevancy later) then you'd need to replicate its rotation, and then have the client set the rotation based on the replicated variable, not use a timeline on the clients.

twin juniper
#

the timeline is about 0.8 sec

sinful tree
#

So then you're probably fine using just a bool and a timeline.

#

Overlap>
Has Authority? YES >>> Set Bool True >> DoorOpens()

However You trigger the close>
Has authority? YES>>> Set Bool False >> DoorCloses()

twin juniper
#

because the overlap happens on the server and client

sinful tree
#

No....

#

The overlap is happening on the server as you're gating the trigger of it using HasAuthority.

#

The server sets the bool.

#

The bool replicates to clients.

twin juniper
#

lets see if it works!

#

@sinful tree the server is the only one to see the door rotating...

sinful tree
#

Is your door set to replicate?

twin juniper
sinful tree
#

It would need to be in order to replicate properties.

twin juniper
#

so we basically fixed the issue that the door was not replicated, now, it is actually replicated!!!

#

so the actor has to be set to 'replicates'

#

Should I also check 'Replicate Movement' ? I dont understand this proprety

sinful tree
#

No you don't need to do that for this particular object.

#

Replicating movement means the server will tell the clients where that object is located in the world.

#

If it's just a placed object, and you don't expect it to move, no need to replicate movement.

twin juniper
#

@sinful tree Thanks a lot, I could not be more happy rn, you saved me a lot of time!!! Thanks ❤️ ❤️ ❤️

cyan peak
#

Hi! Is it better to replicate 1 variable (float) with the calculations made from the client, or is it better to get an already replicated variable and everyone does the calculations on their end?

sinful tree
cyan peak
modest crater
pseudo wagon
sinful tree
# cyan peak That makes sense. But in terms of performance, it would have to be a trade off b...

Not really. Security is a bit more of a concern here as depending on what that value is used for, it could potentially break the game and plague it with cheating, thereby ruining the experience and then no one is playing your game. If it's nothing that alters the game at all, then it doesn't really matter if it's calculated on a client first and then sent to everyone else. In terms of trying to optimize it for the network or CPU usage, you'd need to profile first to determine if some performance could be gained, but it's better to first think about how that value interacts with systems to determine whether it should be executed on the client, the server or allow clients to handle the result themselves based on existing data.

cyan peak
cyan peak
half iris
#

Question about moving platforms that move from A to B, back to A again until the end of time. Do we do this movement only on the server, and replicate the transform to all clients (on tick)? Or do we just execute the movement on every client individually without replicating the resulting movements?

worthy knot
#

Is it better to use delays or timers in your blueprints when it comes to multiplayer?

woven basin
half iris
kindred widget
dark parcel
worthy knot
#

Are delays as bad as ticks ?

#

Or is it that in multiplayer the server delay is different from client delay

dark parcel
dark parcel
worthy knot
dark parcel
worthy knot
dark parcel
#

You seem to think that players somewhat share the same world or something.

Each player run their own instance of the game. Each executing instruction in their own machine.

Delay node or other nodes will just do its thing when executed in a machine

twin juniper
odd hamlet
#

I need some advice, basically on an actor I am generating the world on an event which is run on server, after it`s generation I want to send to all my players the struct with the generated map so it can create the minimap, but how can I achieve this?

thin stratus
#

But what is that world generation based on?

odd hamlet
#

its a procedural generation

thin stratus
#

In theory you should ensure that the Server only replicates the required info to generate the world locally.

#

Like, if it's all Seed based, just replicate the seed.

#

And Actors that require Replication can either be limited to spawn by the Server

odd hamlet
#

basically from the begin start of the actor, goes to an event which is run on server that generates the world, and after I would want to send to both players the struct

thin stratus
#

Or you check if you can hook them up by stably naming them. Not sure.

#

RunOnServer?

#

Like an RPC?

odd hamlet
#

only run on server, the actor is set to reeplicate and it apears to the client too

thin stratus
#

You didn't answer my question

#

Are you doing this with an RPC?

odd hamlet
#

nope

#

rpc means to have an event run on server and to call another event multicast, right?

thin stratus
#

RPC is one of three things. OwninClient to Server, Server to OwningClient or Server to Everyone (that are relevant).

#

If then yo uare just using HasAuthority on BeginPlay to limit it I guess

#

But the main answer remains: Replicate the data the client can use to build the world themselves.

#

And not the finished world

odd hamlet
#

hmm, okay

#

but why doesn`t it work to notify the second player from the game mode?

#

i try to use get player controller of index 1 and it fails when trying to cast to the player controller

thin stratus
#

Idk, timing maybe

#

The world is a State anyway

#

So I would have that Actor you have there that generates the world just have a OnRep_GenerationData

#

Where GenerationData is a Struct with the minimum data required to generate the world

#

Which would be set to RepNotify

#

And then use the OnRep to generate the world

#

And fwiw send an RPC to the Server via the PlayerController to notify when the World is done building.

summer orbit
#

Is there a way to “emulate” connected controllers without having to plug in physical controllers so that unreal engine can detect them?

ancient adder
#

Are there any minimal examples for structs NetDeltaSerialize around? I tried looking into FGameplayDebuggerNetPack::NetDeltaSerialize but it's a bit complicated.
Looking for simple examples such as replicating a single property

I recently implemented NetSerialize to replicate raw classes and I'm liking the control it gives, Then I read about NetDeltaSerialize which seems to be even better, Any help / notes / general info is appreciated!

rotund sail
#

does anyone know if the bp call return to main menu host is seamless or not?

vital furnace
#

Here is the situation: When a player joins the lobby of my multiplayer game, a team selection widget is displayed. I want to know how to update the session information for players who have not yet joined the session, so they can see the number of people in each team as clients, considering that clients do not have access to the Game Mode and certain classes in multiplayer.

grim rain
#

hi anyone know any tutorials for being able to drag other players bodies in a multiplayer system? Or how i can go about doing it?

fathom aspen
rotund sail
#

is there any way to seamless return to main menu? Im trying to preserve the playerstate (in this case a randomly generated name and bool on the playerstate) but it doesnt' carry over when the return to main menu is called

fathom aspen
#

Disconnections are a hard travel by definition, so no, it's impossible.

#

The Data is saved on the server's PlayerState, which is kept in the server. So as a client, that will be lost

#

Find a proper replacement, probably a gameinstance subsystem that manages your saves

fathom aspen
#

It has a lot of 101 on serialization and stuff

#

Also pinned in this channel is an article that goes over net serializing structs (atomic replication structs something)

ruby lodge
#

Also the server logs say something about a SteamNetDriver

#

Could it be that the clients can't connect to the dedicated server because of steam or so? Still just running both locally

maiden flame
#

Are you logged in to Steam while testing? You could try running Steam in offline mode. There's always the chance the SteamNetDriver is messing something up, so you could try using the default net driver and see if it works.

rotund sail
#

has anyone seen this while trying to destroy session on steam?

#

(as the host)

red stirrup
#

what is the simplest way to make a game playable through lan?

vital furnace
#

Here is the situation: When a player joins the lobby of my multiplayer game, a team selection widget is displayed. I want to know how to update the session information for players who have not yet joined the session, so they can see the number of people in each team as clients, considering that clients do not have access to the Game Mode and certain classes in multiplayer. How can i do it ?

kindred widget
#

I'm just wondering if you're trying to update literal session information. As in to display on a game search before a user actually joins the lobby or game at all.

If they are already connected and you just need to know how to get data to clients about teams, then you should put this state on the GameState or their PlayerControllers. They will have access to both as clients. Server can set this and let it replicate.

maiden flame
coral granite
#

i have a pickup in a multiplayer game , that i want when client picked it up it only removed from his world , so other clients can pick it up too, and my logic now i have the result of picking it up is marked as "run in owning client" and i get the resources from the pickup normally and i think this is not possible to destroy a replicated actor so i unticked also the replicate option , and also instead of destroying it i try to call hide actor but it wont get hidden , any advice and tips ? thanks in advance

dark edge
#

And do they respawn or go back to pickupable?

coral granite
#

yes i have a spawner that is on the place of the pickup and when it is picked up it waited 3 seconds then respawn again , but i am thinking to not respawn it to make things easier on replication

coral granite
dark edge
#

Start by not thinking about spawning and destroying as what should be done to this thing

#

if it's a replicated actor it has to stick around forever

#

I'd just have an array of playerstates or pawns on the thing which stores the players that have recently interacted with it

coral granite
dark edge
#

not hide actor even, just hide the visuals of it

#

but you need to store the state somewhere, I'd probably put it in the pickup

#

just give the pickup an array of pawns or playerstates that have interacted with it, and in the onrep, if LocalPlayerPawn is in the array, hide stuff

#

also on overlap, check vs the array to know if they should be able to pick it up or not, serverside

coral granite
dark edge
#

either that or deactivate it or whatever

#

there's something you can do

coral granite
#

i loved the idea of the Array seems to work fine with me , the last thing is just correctly hiding it , but thanks untill now it got way better thank i had it before

dark edge
#

but you need to have that logic like:

ListOfPlayersIShouldBeInvisibleTo updated -> is LocalPlayer in that list? -> yes -> make self invisible somehow

coral granite
#

okay i think i got the idea about this , thanks for helping me

nimble kelp
#

I'm new the replication, working on Wizardcell's Replication guide. I'm having troubles with saving variables from the game insance to the game state. For now, my game instance is setting a random float and my state is casting to the game instance to set the float. The way it currently is, my client will get the server's float when trying to access it from the Game State.

dark edge
#

gamestates float will be servers idea of it

#

Game state begin play will run on server and client

#

the servers value will override the clients

#

since it's replicated

nimble kelp
dark edge
#

What are you trying to do?

#

do you want servers version of RandomFloat to be what EVERYONE gets when they pull it off GameState?

#

If yes, then that's what you got.
If no, then make it not replicated.

nimble kelp
#

I'm just trying to put practice into what I read so far, so maybe I'm misunderstanding what the GS is for? I know the GI saves variables between levels. So I want the client and server's game state to just get a copy of their own.

dark edge
#

thats fine, just make the variable not replicated

#

replicated means everyone will eventually get the value that is set on the server

#

if you want the state of the game for everyone to be that random float is 0.5, then setting it on the server is enough

#

if you want everyones state of the game to have a different random float, then what you have will work if you make that float not replicated

nimble kelp
#

Oooh. I see. I think I misunderstood. GameState is replicated to everyone, but the variables itself does not need to be replicated\

nimble kelp
#

So if I want to print out everyone's random float, how would I access that? In here (called from the controller), I'm getting all player's, finding their state, and printing it. In a 2 person listen server, the client is just repeating their value twice, and the server is repeating their's twice.

nimble kelp
#

Oh god, my brain is so cooked. I've been saying game state, when I meant Player State. Sorry, I know why you're confused now. I want the Game Instance variables to be copied over to the PLAYER state because these are replicated to all clients (username, levels, w/e).

#

So right now I have the PLAYER state (via function on controller) get the float from the GI. Now I'm looping from the GAME State to read everyone's values, but they only can read their own. The other shows up as 0.0

ruby lodge
#

I cut this out of the DefaultEngine.ini now and did the steps again to build and cook a dedicated server but now it can't be created at all. The logs when trying are just visible for 1 sec and then many errors appear and it instantly shuts down. Don't even have enough time to screenshot it

#

I think it's a steam problem because the server is visible under lan servers on steam even but not locally

#

I tried Lyra and it worked completely fine so I assume it might be that steam handles matchmaking completely themselves and thus I can't join a dedicated server I started locally with the same device through the internal IP

#

to test this theory out I wanted to cut out the steam stuff out of the DefaultEngine.ini and test it out. It is supposed to work without I guess but maybe the DefaultEngine.ini is messed up without any OnlineSubsystem entry at all

#

although Lyra also doesn't have one

#

It's not saving the logs under saved -> logs otherwise I would share

sinful tree
# nimble kelp

Rather than using "Get PlayerState by Index" the controller should have a PlayerState variable you can directly use to feed into your cast.
When you want to transfer the value, you'll need to RPC to the Server and have an input on that RPC for the value from Game Instance that you want to send to the server.
On the server RPC event, you'd set a replicated variable to the value passed into the RPC.
If you do not mark the variable as replicated, the the value will only be stored on the server. If you mark it as replicated, then all clients will receive the value set by the server.
To read the value, you can get reference to the playerstate and then read the value, but it must be done so after the value has been set.

nimble kelp
#

@sinful tree , Thanks for the tip!! RPCs sound like they make sense in your head when you read about them but in practice... Right now, on the client, doesn't set the variable. I'm assuming beacuse I'm doing the RPC wrong?

sinful tree
#

This "Random Float" is the thing you want to send in the RPC.

nimble kelp
#

Oooooh haha. Before asking this question, that is what I've been doing, but I just assumed it was a hacky way of doing it

#

Is this the best way of passing on variables to the Game State? Using the controller as the middle man?

#

palyer state***

sinful tree
#

You can use the playerstate itself and not involve the controller at all. What is important is that in order to communicate anything from a client to the server is that you need to use a Run On Server event on a replicated actor that is owned by that client, such as their controller, playerstate, controlled pawn, or any other actor you've created that the client would own, or a replicated component attached to one of these actors. If you need to pass data from the client to the server then you need to include an input on the RPC.

nimble kelp
#

Oooo I understand. So in order for this to work on the client's playerstate itself, it should be like this

dark parcel
#

And each machine executing it, will grab their GI to pass the value

nimble kelp
#

Yeah I noticed it ran mulitple times haha. I'm just praticing theory is all. But I guess I was imagining passing on a custom username or their level

dark parcel
#

If you want to pass client value to server with Gi then filter it so only that player that own the player state to set the value on server

#

Begin play, add a branch, is locally controller, server rpc send the float

nimble kelp
twin juniper
dark parcel
sinful tree
# nimble kelp

As ColdSummer pointed out, it would be executed on both the server and client as Begin Play can fire on both. You can use something like this to ensure only the local client or host is executing.

nimble kelp
#

Thanks guys! I think it will take some time to really wrap my head around it, but at the moment, I think I get it now LMAO. '

twin juniper
#

Is this too much replicated variables? Will my game be buggy when it's going to be bigger size-wise?

    // Variables for rotation
    UPROPERTY(Replicated, BlueprintReadOnly)
    float maxRelativeRotationAngle = 115.f;
    
    UPROPERTY(ReplicatedUsing=OnRep_Rotation)
    bool hasEntered = false;

    UPROPERTY(Replicated)
    int8 numberPlayer = 0;
    
    UFUNCTION()
    void OnRep_Rotation();
#

Btw, the way my door works is that there are 2 components each sides, to easily determine which way to open the door, I also check to see if there's already a player touching the component, if yes then nothing happens, if no then a timeline triggers

Is that a good thing, or could / should it be better? (if yes, any idea?)

ruby lodge
#

logs show no error unlike my project in the message I replied to.

#

so: Lyra worked completely fine like the docs showed and the default template as well

ruby lodge
sinful tree
# twin juniper Is this too much replicated variables? Will my game be buggy when it's going to ...

numberPlayer is kind of useless. You're better off referring to players by their PlayerState.
Things won't be buggy due to the number of replicated variables. The problems usually with replication come in with how often they're being updated and how many of them exist in total.
For example, if you had 500 doors in your level, and that one float variable is 4 bytes, if you happened to update all your doors rotation on the same frame, about 2KB of data would need to be sent in that one instant. Not guaranteed to be a problem, but if you happened to be changing the variable 60 times a second (ie. at frame rate) on every single door, then all of a sudden you're trying to send through 120KB/s just for those 500 doors. This is an exaggerated case, as I don't think you'd have 500 doors in your level, nor having them all replicating their data 60 times a second at once, but it's where problems can start to arise with replication if you're going out of bounds of how much data the engine wants to send and receive per second, and then having to manage all the CPU time to handle all that replication as well.

You also do not need to replicate everything. The maxRelativeRotationAngle seems like something that just needs to be set on the door, not replicated. If clients swing their doors wider than what you're expecting, then they'd only be breaking their game as you would only allow the door to be opened to the max on the server.

amber vale
#

Does anyone know if Unreal waits until all connected players have loaded into the map before exiting the transition level? E.g. in Valorant, you sit in the transition level until all 10 players have loaded into the map, so every player is ready when you actually go to the map.

quick musk
amber vale
quick musk
amber vale
# quick musk Well Valorant would keep the loading screen up purely based on if someone is sti...

Valorant keeps all players in the loading screen until everyone else has loaded the map and initialized their game. Sometimes everyone gets stuck in the loading screen, waiting for the last person to load the map, but it ensures that everyone's characters can be initialized together when they finally leave the loading screen. Otherwise, you'd have some players sitting in spawn, waiting for everyone else to load in.

hollow eagle
#

Err, not really.

#

They're just going to keep the loading screen up while still fully loaded into the new level

quick musk
#

^

hollow eagle
#

nothing says you have to pull the loading screen down once you're loaded in. Nor is there anything that says you have to spawn a character immediately.

quick musk
#

which is what i said

#

😭

hollow eagle
#

Sometimes ya just gotta say the same thing twice

#

in two different ways

amber vale
hollow eagle
#

I'm aware of what you are talking about.

amber vale
#

Does Unreal not unload the transition level automatically when the map is loaded locally?

hollow eagle
#

Sure.

#

And nothing says you have to do anything specific like spawning a player once you've loaded into the new level.

#

You're free to wait on everyone at that point.

#

And valorant was a bad example because they're not using seamless travel either. They use hard loads from matchmaking into a server and back because there's no other possible way to connect to a server.

amber vale
#

Are transition levels only used for seamless travel?

hollow eagle
#

Yes.

#

Transition levels are not loading screens.

#

that's the whole point

amber vale
#

Gotcha, thanks!

vital furnace
# kindred widget This statement is confusing. What exactly do you mean when you say " I want to k...

To join a server, you need to find a session and enter it. Sessions are displayed as cards with information such as the name, playground, and number of players. To display this information on the cards, we retrieve the available sessions and read the information in each session to update the default values of the cards. I want to know how to allow someone who hasn't joined a session to perform a find session and get up-to-date information on the extra settings.

subtle kernel
#

Hey guys, can somebody help me to understand nature of some strange, very consistent crash I experience. I have some things set in my Gamemode which is derived from AGameModeBase. Things like:

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Default Effects")
    TSubclassOf<UGameplayEffect> AdrenalineRushEffect;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Default Effects")
    TSubclassOf<UGameplayEffect> RegenHealthEffect;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Default Effects")
    TSubclassOf<UGameplayEffect> RegenManaEffect;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Default Effects")
    TSubclassOf<UGameplayEffect> RegenMovementsEffect;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Default Abilities")
    TArray<TSubclassOf<UCOR_GameplayAbility>> DefaultGameplayAbilities;

during the first run in editor, everything is always fine.

but if I run POE second time it always crashes on trying to access items in those properties.

And debugger shows some really strange stuff like in screenshots I attached. What can be the nature of this failure? What am I doing so wrong? 🙂

nova wasp
#

the static is only executed once, don't do that

#

you are setting this once and never again, each new game is a new world

#

if you are really terrified of running getworld twice I suggest profiling it or caching it

subtle kernel
#

oh wow

#

how the heck it got there..

#

ah, I guess I wanted to write const lol

nova wasp
#

what does static have to do with that?

#

just const_cast

subtle kernel
#

nono, I used static instead of const. prolly was drunk 🙂

nova wasp
#

ooh, you mean the word not writing a const, I get you

subtle kernel
#

so bad I spent years programming in javascript 😢

nova wasp
#

static means different things in different contexts, in general you had better know what you are doing when storing uobject anything in a static and cleaning it up accordingly

#

there are some things that are nice to store in there that are application-level like cvars though

subtle kernel
#

yeah, okay. thanks 🙂

nova wasp
#

a static function means it doesn't need a this pointer (it is called just by itself and not on an instance of the class etc)

torpid crest
#

Hey guys 👋

do we have to multicast destroying of actor on server?

I can see actor being destroyed on listen server however it doesn't propagate to clients 🤔

thin stratus
#

Also you seem to use A LOT of RPCs

torpid crest
#

Server on right 😄

thin stratus
#

Is the Arrow a replicated Actor?

torpid crest
#

let me check

thin stratus
#

SetBowStateOnServer is already a ServerRPC, and then in the Interface call "DestroyArrow" you are also performing another ServerRPC.

torpid crest
#

*cries in pain 😄

thin stratus
#

You are using too many RPCs

#

Why is SetBowStartOnServer an RPC anyway? Is that something coming from a KeyPress of the Player?

torpid crest
#

yes it's changing animation blueprint for bow

#

on key input

thin stratus
#

Okay, but "IsNotAiming" is a state, right?

#

Why is that a Multicast then? State should be communicated via RepNotify Variables.

#

And the DestroyArrow call is a Interface why exactly? Is there anything despite the Bow Class that would implement this?

#

Just generally checking your code a bit, you can ignore it if you don't mind. Just seeing some stuff that doesn't necessarily make sense from a coding standpoint.

torpid crest
#

Thanks for feedback 🙂 I will look into it 🙂 I’m beginner with MP in unreal 🙂

kindred widget
# vital furnace To join a server, you need to find a session and enter it. Sessions are displaye...

The only way to do this normally is simply to set data in the session arguments. You can't put a lot of data here though so you either need it very packed or not a lot.

The only other way is with beacons. Which require the possible client to request a beacon with the server. Which allows a very basic networking setup without a map travel in which you cannot replicate data, but you can RPC through the beacon itself. And on connection the server's beacon could send the info. You can do this if you need slightly more realtime, or much larger data sets. IE you can't fit it in the session data or sessions update too slow.

odd hamlet
#

Can I access the players Hud from the Player controller ? I try to acces a refrence from the players hud but it doesnt let me, any ideea why?

kindred widget
#

Which event are you trying to access it on?

odd hamlet
#

randoom event ?

#

I tried all of them

kindred widget
#

I'm asking because it's important to know how you're trying to access it. An AHUD is created for each local player with a player controller on a machine. And only that machine can access it. Which means that if you're on a Listenserver with two players. If you try to access Player2's HUD on the server, it won't have one. They don't have a local player on the server.

odd hamlet
#

yeah still, I tried on the hud to create the widget blueprint, and with an get owner player controller to store in there its own widget blueprint, it doesnt find it, I don`t know why

#

Accesed nonee trying to read property, but If i print it in hud it will print the name

thin stratus
#

You'd need to share the code

odd hamlet
#

here in the player controller when I try to call this function to make it visible it tells me that it canno`t acces that variable

#

Access none when trying to read property WB_Minimap Node : Set visibility

#

and it won`t even print the name of the WB_minimap

#

oh apparently idk how the hud get assignated much later, I had to delay it in order to work, I will work this stuff out

thin stratus
#

Delays are always bad

#

You should figure out an even that is clearly calling at the right time

ancient adder
#

Is there a method to tell if the struct is doing initial replication in NetSerialize or do I have to create my own?
I have a code that needs to run if the struct is replicating for the first time to the target connection

woven basin
neon summit
#

is the late join option a reliable way to test late joiners?

ancient adder
ancient adder
neon summit
#

just confused cause I use just a multicast to open and close the door but when I add another client they see the correct state

ancient adder
#

Hmm weird, I believe you have a replicated variable

neon summit
#

i mean yeah but no repnotify

ancient adder
#

Do you have anything on beginplay? Maybe you're checking the variable there on client side

neon summit
#

thats all i have for the door

ancient adder
#

I don't think you should replicate the mesh, It could be the reason

neon summit
#

it still works if i dont replicate mesh

#

its the timeline

#

cause its replicated

ancient adder
#

Timeline is replicated? 😮

neon summit
#

yeah

#

anyone im gonna make this work with repnotify was just curious

#

im not sure how I should do it with repnotify tho

ancient adder
#

I never used timelines, thanks for the info

neon summit
#

theres a option when you open the timeline for it to replicate

ancient adder
neon summit
#

I made this door when was a noob so coming back to it lol

#

so when i join it wouldnt instantly be open but it opens when joins?

ancient adder
#

It wont instantly open for anyone

#

I'm not sure how timelines replicate, But I'd keep it if it's doing the job

neon summit
#

im not sure either lol I did this door awhile back. im guessing since its running on multicast and running on server too it gets replicated

lament flax
#

If i predict item changes in hand, how should i do this ?
initially, i was spawning the actor on server, since im predicting now i should spawn it on client, but how should i replicate on server afterwards ?

#

should i create a fake item on client, then when server creats it, destory it ?

neon summit
#

probably should just use a bool

dark parcel
#

Only things that replicate are variable and RPC

#

Nodes or timeline don't replicate, I believe that's one hell of confusion

neon summit
#

idk theres a replicate option in timeline

dark parcel
#

Not sure, but that's very strange

#

Well I guess I might be wrong but I don't see how that work

neon summit
#

I always wondered about it but never knew how it works or what it replicates

#

maybe it replicates the value?

dark parcel
#

I don't know but for your door, you don't want to multicast at all

neon summit
#

im not anymore

dark parcel
#

Assuming you want all players to see the same state of the door

neon summit
#

i was confused because having the timeline replicated allowed new players to see correct state of door

worthy oak
#

so if you wanted everyone to see the same state of a door that’s a way you could do it 🤷‍♂️

neon summit
#

I guess but repnotify would still probably be better bandwidth wise etc.

#

right?

worthy oak
#

The docs do seem to suggest just cause you can do it doesn’t mean you should

#

So I would say yeah that’s probably better

ancient adder
neon summit
#

if i just use a lerp how would I determine which way it should go

#

cause this really doesnt make sense

#

if I switch this to the logical way it doesnt work

#

seems it doesn't replicate fast enough

#

should just use bool?

dark parcel
#

That's what been done for control rotation, aiming, movement etc

neon summit
#

the door status variable in the rep function. I have to switch if its status closed call close door, if status open call open door

dark parcel
#

I actually haven't worked on a door before (for mp). Would you guys just make it a server authoritative process?

#

That's kinda my plan

#

So for clients, I just need to replicate the door rotation instead simulating timeline on their own end.

twin juniper
twin juniper
#

see here

#
void ADoor::OnFirstComponentBeginOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, 
                  UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
                  bool bFromSweep, const FHitResult &SweepResult)
{
    OverlappingServer(OtherActor, true, defaultRelativeRotation);
}
// ---
void ADoor::OnFirstComponentEndOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, 
                           UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
    OverlappingServer(OtherActor, false);
}
// ---
void ADoor::OnSecondComponentBeginOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, 
                  UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, 
                  bool bFromSweep, const FHitResult &SweepResult)
{
    OverlappingServer(OtherActor, true, -defaultRelativeRotation);
}
// ---
void ADoor::OnSecondComponentEndOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, 
                           UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
    OverlappingServer(OtherActor, false);
}
#
// --- SERVER Side Logic --- //
void ADoor::OverlappingServer(AActor* OtherActor, bool hasJustBeginOverlapped, float relativeRotationAngle)
{
    AGASTrainingCharacter* player = Cast<AGASTrainingCharacter>(OtherActor);
    if(HasAuthority() && player != nullptr)
    {
        // Making the door rotate the right way
        if(relativeRotationAngle != 0 && numberPlayer <= 0)
        {
            maxRelativeRotationAngle = relativeRotationAngle;
        }
        
        if(hasJustBeginOverlapped)
        {
            numberPlayer++;
            if(numberPlayer == 1)  // Making sure there's no multiple player in the box collision...
            {
                hasEntered = true;
                DoorOpens();
            }
        }
        else
        {
            numberPlayer--;
            if(numberPlayer <= 0)  // Making sure there's not a player in the box collision...
            {
                hasEntered = false;
                DoorCloses();
            }
        }
    }
    
}

/*
 **        Client Logic for Overlapping
*/
void ADoor::OnRep_Rotation()
{
    hasEntered ? DoorOpens() : DoorCloses();
}
thin stratus
#

@twin juniper Random suggestion: please use IsValid to check UObject pointers.

#

They can be != Nullptr, yet cause a crash if they are pending kill.

#

IsValid checks against both.

twin juniper
thin stratus
#

For example yes

twin juniper
#

mhm i see

pearl walrus
#

@thin stratus Here are hte screenshots, 1st shows the onrep function + variable being repnotify, 2nd shows part of update lobby ui event and shows playr controller being replicated (it doesnt get to this part it just never calls onrep, 3rd shows where the variable is being changed in 1st place in my gamemode, 4th shows lobby being opened as a listen, 5th shows gamestate rep

#

lmk if u need any other screenshots

#

or if anyone wants to help its just repnotify not being called

twin juniper
#

for sounds, does it matter to call it on the server / clients? Should it just be replicated to all clients AND the server (when using listen server mode)

lament flax
#

idk if playing sound on server plays it on clients

#

might use multicast

twin juniper
lament flax
#

mostly yes

twin juniper
#

second question, when spawning an actor, should it always spawn on the server first and then replicate? (if not, explain )

limber gyro
#

I got a dash in the CMC that i am doing like this "Velocity = direction * 10000;", this is not frame rate independent what would be my best option here to achieve the same thing and have it be frame rate independent?

limber gyro
twin juniper
#

I would like to know more about Client Prediction, what would happen if someone shoot a bullet on the client? Spawn a dummy one not replicated on the client and then spawn the real one on the server and replicate it the fastest you can to ensure that the shot was real? The client who shot will then see 2 bullets...

lament flax
limber gyro
lament flax
#

you are running on tick this code ?

limber gyro
#

im running on "OnMovementUpdated" of the CMC

mental star
#

In the Unreal Engine design style.
Does it make sense for the PlayerController to directly access the player?
Like if the player has a collider that will tell the controller if it can turn left or right?
Or what's the best way to pass updates about the player's state to the player controller?

gaunt cypress
#

why is the ui shown on start of the game, when i have the UI shown only with colission with a capsule

pearl walrus
silver totem
#

How do I handle any kind of resource collection over multiplayer with client prediction? So say a player has insane ping, collects 4 coins, updates coin counter locally. The server then registers all that and sends confirmations to the client with their current coin sounter value. So now the player sees their counte go to 4, then to 0, then slowly to 4 again. Should I instead just return a boolean from the server indicating whether the player successfully collected the thing and if no, just deduct it back on the client instead of sending the entire state?

hushed sigil
tiny saddle
#

Has anyone had an issue with PIE with 2 standalone players where player 1 enhanced input action events don't fire? Problem occurs in 5.3.2 and 5.4.1. The input mapping context is being assigned in the player controller begin play

silver totem
#

I think

hushed sigil
thin stratus
#

@Cedric 'eXi' Neukirchen Here are hte

hushed sigil
#

Does anyone know if it's ok to make a static mesh actor start replicating mid gameplay?

#

Like is unreal engine able to link up the previously unreplicated client instances?

twin juniper
#

I would like to know more about Client Prediction, what would happen if someone shoot a bullet on the client? Spawn a dummy one not replicated on the client and then spawn the real one on the server and replicate it the fastest you can to ensure that the shot was real? The client who shot will then see 2 bullets...

turbid cloud
#

regarding VEHICLES:
Is possesion what I'm looking for in terms of best practice, or is there some other solution for multiplayer.
ie. what's the best practice to have a character enter / exit vehicles?

pure tulip
#

can some body help me with a media sound for media player when i try to put that in multiplayer game listen server it doent actualy play it for every body but playing it only for the host or only one person. can somebody tell me how to fix that? thanks

normal viper
worthy oak
#

You also probably wouldn’t check this. You would check can the player fire, and then what did they hit and handle that server side

boreal apex
#

does anyone know why this happens? my server doesnt allow me to take control of the viewport, the input debug window shows that my viewport client mouse capture mode and louse lock mode show up different between the server and client windows, if i try setting input mode as game only then i cant take control of either of my viewports. I am setting the input config on begin play of my character. If i just plugin the Player Controller for the enhanced local input config instead of Controller and casting to Player controller than its the opposite where my server can take control but my client cannot, ive been stuck on this for two weeks and this is the only project this happens in

also learnt. if i click on the server window before the client fully spawns in, then it kicks me out of control for my server window, and allows me to control my client window, could this have something to do with how im spawning my characters in? Or how i am setting my input mapping context? ive tried many methods for initially setting those things and different methods of spawning my players in, which have all worked for me in the past, and i am stumped as to why its not working. Im happy to share some code, hop in a chat, whatevers needed. I just want to figure this out so i can move onto cooler things!

grizzled stirrup
thin stratus
#

You should use IsValid with UObject Pointers.

#

The BP node does the same too.

#

If you didn't run into any crashes yet then you are maybe lucky or you are cleaning up your pointer variables properly.

#

But any Pointer to a UObject that is marked for Pending Kill but not yet GCd would crash if accessed.

ruby lodge
sinful tree
# twin juniper The maxRelativeRotationAngle is actually to determine the side of the door to ro...

My point with the rotation value is that it doesn't necessarily need to be replicated unless you're dynamically spawning doors. When you place a door in the level you can set that value and not have to replicate it as clients and server would have the same value for that particular door and you shouldn't need to set it dynamically when the overlap occurs as a "swinging" style door should have one of three states: Closed. Open inward. Open Outward. Closed = Rotation 0. Outward = rotation 90 Inward = InwardRotation*-1 as examples --- all this can be pre-defined on the door and you'd use an enumerator to drive the state.

numberPlayer also shouldn't need to be replicated based on the code you've shown. What use is it to replicate that to players if only the server uses it?

ruby lodge
#

and @sinful tree I managed to make sure that steam is the problem here haha. Apparently many people experienced this, it needs a more heavy setup than without

grizzled stirrup
thin stratus
#

But this is 4 years old. I wouldn't really bet on that being up to date anymore.

grizzled stirrup
# thin stratus You should use IsValid with UObject Pointers.

Also just in case I'm misunderstanding, something like this in the Lyra sample would be better to be replaced with IsValid?

        if (ALyraPlayerController* LyraPC = GetController<ALyraPlayerController>())
        {
            if (Pawn->InputComponent != nullptr)
            {
                InitializePlayerInput(Pawn->InputComponent);
            }
        }
#

Or would it be more for pointers that aren't getting created that same frame

thin stratus
#

Both of those checks are not taking IsPendingKill into account.

#

And there are times where that is totally fine fwiw.

#

But you gotta be sure that the UObject really can't be pending kill at that time.

#

It's safer to just check for it fwiw

grizzled stirrup
#

Yeah no harm done

thin stratus
#

The code isn't really accessing either of the pointers

#

And I assume that InitializePlayerInput might have a chance to check for the flag

grizzled stirrup
#

I do love the nice clean one liners like

if (AMyThing* Thing = GetMyThing())
{
  Thing->DoSomething();
}

but I guess that just changes to

if (AMyThing* Thing = GetMyThing())
{
  if (Thing->IsValid())
  {
      Thing->DoSomething();
  }
}
#

Or whatever the IsValid syntax is (will look it up)

thin stratus
#

I mean

#

That's not the right way haha

#
AMyThing* const Thing = GetMyThing();
if (IsValid(Thing))
{
  Thing->DoSomething();
}
grizzled stirrup
#

Much cleaner ty!

#

And I guess I can do the first option with correct IsValid syntax if wanting to keep the pointer in the scope of the brackets

#

Which is partly why I love that way of checking pointers (as you could accidentally use the pointer later on in the func without checking if valid etc.)

thin stratus
#

I would just not put the pointer into the brackets tbh

#

You can do that for non-UObject types fwiw

grizzled stirrup
#

Only time I can think of that is for interfaces but maybe blanking on more types

thin stratus
#

If you use Thing without checking that it's valid, then that's up to you, as the programmer, to simply fix

grizzled stirrup
#

Yeah true

thin stratus
grizzled stirrup
#

Mmmm interesting, haven't dabbled with struct pointers before

thin stratus
#

TMap generally returns a pointer when calling find, cause it need a way to return a default value for not finding something

#
TMap<FSomeKey, AActor*> SomeMap;
AActor** FoundActorPtr = SomeMap.Find(SomeKey);
#

:P

grizzled stirrup
#

Oooh so you need to dereference the pointer to get a regular pointer there? 👀

#

pointer to a pointer

thin stratus
#

Yeah, I imagine peeps that didn't have C in school or at uni or similar wouldn't expect that

#

But you can endlessly chain pointers fwiw

grizzled stirrup
#

I did not know this 😄

thin stratus
#

You can imagine a Pointer being an int Variable.

#

It has an address in the memory, like any other.

#

And the value of it is the address of another variable.

#

So you can point to a pointer that points to a pointer

#

etc.

#

There are also some fun little things that you might never have thought about due to TArrays and not using native arrays.

E.g. MyArray[0] is the same as *MyArray.
And MyArray[5] is the same as *(MyArray + 5).

#

(unless I typod stuff now)

grizzled stirrup
#

Oh that's really interesting actually

thin stratus
#

Yeah at Uni we had a task where we had some fake small RAM address table and some fake pointers that were doing stuff like:

ppptr*** = 20;

*(ppptr) + 20;
*(ppptr + 5) - 10;

#

Etc.

#

And you had to figure out what cell updates to what.

grizzled stirrup
#

whenever I feel like I'm actually learning C++ by using Unreal I see something like that 😄

#

and remember that I'm just doing high level gameplay code

thin stratus
#

This is actually C even

#

But doesn't change for C++ fwiw

#

And yes, UE++ shields you from a lot of stuff

#

But at the same time, you could do all of that as long as it doesn't have to reach BPs :D

grizzled stirrup
#

😄 yeah I like that you get as much of both worlds as you want

bleak lily
#

Hey so I'm having issues properly replicating a crouch, so for the most part it works but in some off cases when I am testing with network emulation it will freak out. By that I mean it rubber bands. Not too sure how to fix it since my other movement works like alt walking and jumping. If I get rid of the capsule height setter it will work fine. So I think it might have to do with the capsule component of my character?

#

I know I should probably just do repnotify instead of multicast for the crouch but wanted to just figure this issue first

thin stratus
#

Why exactly are you not just using the Character's build in crouch?

#

You can still animate the camera to properly interpolate down to the right eye height over time fwiw

#

Changing the capsule height like this in BP won't ever be rubber band free

bleak lily
#

That is def the best move sorry for the dumb question lol

#

I usually do something similar to this for a smooth camera feel when i have done small stuff before but only single player

thin stratus
#

Yeah that's not gonna do it in BPs for Movement

#

In C++ you could maybe drive some transitional stance state through the CMCs Tick

#

But here you are better off just using what CMC offers you and hiding the instant capsule change with the CameraManager

bleak lily
#

Sounds good then, thanks!

#

I'll try using the character movement crouch

#

oh also how would i prevent the camera from being kind of snappy at first since its parented to the capsule?

#

since its an instant crouch

#

I have the relative location for the stand and crouch and interpolate but from starting the crouch or uncrouch it kind of snaps with the capsule at first

thin stratus
#

I assume you'll want to create a PlayerCameraManager class

#

You can set that on your PlayerController

#

In there you will find an UpdateCamera (or similar) function you can override

#

That will allow you to return the Rotation, Location and FOV of the Camera.

#

By default I would assume you will want to return the CharacterLocation (ViewTarget is usually your character, so you can just use that) and then offset it height-wise by some eye height for standing.

#

Here you'd also add any kind of transition between eye heights.

#

But that's a bit more involved so I won't be writing that out here.

#

It would give you full control over the camera though fwiw

bleak lily
#

oh i see thanks!

turbid cloud
neon summit
turbid cloud
neon summit
#

but to use the input actions on the vehicle youd need to possess. Possess is just telling your player controller to possess the vehicle instead of your humanoid player

turbid cloud
#

I gotcha. I've been overwhelmed with tutorials as it seems there's a number of ways to do it and I'm not sure which is best for multiplayer.
Do you think an approach like this: https://www.youtube.com/watch?v=NbAkRI5EztM is reasonable?
He uses a 'blue print interface' for possession.

Or do you have some other dev you recommend for multiplayer dev?

Hey guys, in today's video, I'm going to be showing you how to enter and exit a car as well as being able to control and drive said car.

Blueprint Interfaces Tutorial: https://youtu.be/m90ZkbtPA9s

#Ue4 #UnrealEngine4 #Ue4Tutorial


00:00 - Intro
00:28 - Overview
01:03 - ...

▶ Play video
neon summit
#

multiplayer will make it alittle different. I assume you understand multiplayer a bit at least?

#

the possess node only works on server

turbid cloud
#

I understand the basics. Just looking for keywords to research

#

Like even a few bullet points of best practice

neon summit
#

for my setup I have a base vehicle class and the mesh and vehicle movement component settings are setup on a child class of the base class. All the code is in the base class and child class just for adding different vehicles

#

i use a bp interface that is run on server to interact with the vehicle passing in the character interacting

turbid cloud
#

Thanks for this overview I appreciate it

neon summit
#

id just start with getting it to possess the vehicle and move it around first

#

its not that hard you just have to possess on the server

candid tinsel
#

I have a simple ragdoll system in my character but on the client side its very laggy and doesnt predict well, obviously i need to implement a network prediction system but i did some research found that i either use gas or mover 2.0 with npp

#

what would be considered better for latency for this

neon summit
#

where do call the function? you'll need to replicate it correctly

grim prism
#

Hey, I'm trying to make a power up that when picked up by one client it changes material, yet this should not happen on the other clients which it currently does, any idea how to do this?

sinful tree
#

You could use a replicated array of characters or playerstates that have picked up the item. In the OnRep, you'd loop through the array, get their controller from the pawn/character/playerstate reference and check if the controller is valid, if so, check if the controller is locally controlled, if true, then you can change the material as you know that this character is the one being locally controlled, and then break the loop as you shouldn't need to check any more. This array can also be used by the server to know who has or has not picked up the item.

grim prism
sinful tree
#

You can't RPC to the "owning client" as no client should own this actor.

grim prism
grim prism
sinful tree
#

You want to gate the Overlap with a HasAuthority as well so only the server is the one handling the overlap and replicating the results out, otherwise each client is also handling everything when the overlap occurs on their own end (not replicated, just every client sees and executes the overlap)

grim prism
sinful tree
#

Check the pins of this channel. There's the network compendium and a few videos in there that can teach about replication and authority.

dark parcel
pure tulip
grim prism
gaunt cypress
#

how can i make that his only happens when the player is overlappin aka in the capsule?
because when i start the game it shows the widget or prints the string

mystic estuary
#

Is there any client-side prediction in AI movement? Is there any important reason to use CMC for AI characters specifically?

ruby lodge
#

Is packaging for the server or for the client inside the editor not the same as building the solution in the IDE and then cooking in the editor seperately?

#

or does it make a difference to the server/client?

worthy portal
#

hello guys, where's the best place to keep an array of created teams for the multiplayer match? i'm kinda stuck with this, since i need players to know information about teams, so i've put it into the game state and set it to be replicated, but i've seen some games, like UT have the same array but in game mode, and it's not replicated (there is a team array in game state too, but it's also not replicated)

limpid anchor
#

Im kinda new to this but i would need some help about adding multiplayer feature to my game.Do i need some kind of plugin or some actual code? (C++ or Blueprint).if anyone has like link for some actual good tutorial that they reccommend on how to add multiplayer and how it works would be perfect.

neon summit
worthy portal
bleak lily
#

I don't necessarily want the camera to be affected by the capsule height when it crouches so that I can smoothly transition it separately

#

I think it has to do with crouching affecting the Z location

thin stratus
#

Then you math is wrong though

#

Assume you have a CharacterLocation and a HalfCapsuleHeight, your EyeHeight will be:

float EyeHeight = CharacterLocation.Z - HalfCapsuleHeight + StandingEyeHeight;

#

Where StandingEyeHeight is the Distance from the Ground to the Eyes.

#

Given that your CharacterLocation.Z is always HalfCapsuleHeight away from the floor, it shouldn't matter if you crouch or not.

twin juniper
#

Could someone please tell me why this is executing only on the server despite being marked to execute on all?

#

This is insanity, if something its marked to execute on all, isn't it supposed to run on the clients as well?

pure tulip
#

about that i tryed that and it did not work i think that i need that to play the media sound that coms uot of the stream media and make that to play in any of the places like every player i can fro some reson to put the sound to play it in a multicast player can you mabey show me how it should look

bleak lily
#

also for an FPS camera should i use control rotation for update camera

#

or the world rotation of it

runic pelican
#

Hello, I am trying to implement a "GameplayAbility". For this, I have done some tests, but I find myself at an impasse. I have my "Bp_thirdPersonCharacter" that calls a "bp_GameplayAbility", which in turn calls a "spawn system attached (Niagara)" from the "Bp_GameplayAbilityFire" which is a "child" of the "Bp_GameplayAbility". The problem is that when I have to specify the "mesh" of the "attachcomponent" in the "bp_gameplayAbilityFire" (see the screenshot "BP_GameplayAbilityFire.png"), it makes the "systemTemplate" pop on the client if it comes from the server, and vice versa. I found a solution, which is by passing the "mesh" as input in my "custom event" to directly call it in my logic at the level of the "BP_ThirdP". But I would like not to have to specify it. Do you have any solutions? Sorry for long post =/ Thx!

ruby lodge
#

Does the dedicated server need to be registered on a steam master server for a steam game? I don't want the servers to appear in the server browser on steam but I need the peer-to-peer functionality, matchmaking etc.

wraith cargo
#

Hi, I am trying to make a multiplayer (Local Host) open world survival game. How do I go about saving the game? I'm not sure how I should approach saving and loading when it comes to multiple players. How do I save a users data and how do I load the correct data for each specific user during the next session? (Unreal Engine 5)

timid breach
#

Hello!
Got everybody bug, when MovementState sometime does not replicate correctly with WorldPartition?

twin juniper
twin juniper
worthy oak
#

Again unless your trying to do what battlefield does, visible bullets are really only a visual effect not determining damage

twin juniper
worthy oak
twin juniper
#

that was my question at first

worthy oak
#

I mean if your going with some of the popular FPS they don’t even show bullets except for sniper trails

#

Lot of the times a simple hit scan does the job. Then play whatever flashy effects on the gun you want

twin juniper
worthy oak
#

you see a visual effect of the gun going off

#

The trace is not what’s doing damage

twin juniper
#

but that's still a multicast from the server

worthy oak
#

well yeah

#

But it’s not a BPBulletActor

twin juniper
#

so everything yhappens on the server

worthy oak
#

no

#

Most things do

#

Especially in an FPS you don’t want everything server side

#

But stuff like a visual effect, yes the server tells all clients to play the visual effect

#

But it’s up to the clients to do it assuming that even gets to the clients

#

and if it doesn’t reach the client oh well

twin juniper
#

people were talking about smt dummy on the client and then checking if the bullet was real on the server, but that's not what you said

worthy oak
#

the server spawns an invisible trace that detects what it hit, damage ext

twin juniper
worthy oak
sinful tree
#

There's so many different ways to handle projectiles in multiplayer.
The end result is you always want the server being the authority of what is happening or at the very least checking to see if what is happening is ok.
A projectile spawning on the client first is a way to do client prediction so that it feels responsive, otherwise the player has to wait their ping*2 to actually see anything happening, and if you have 100 ping, that can feel pretty slow.

If you want to have a visual effect only play on the client and then have the server actually handle a trace to determine who you hit, that's another way of making it feel responsive without letting the client say that they're hitting someone.

worthy oak
#

any effects are multicast

twin juniper
worthy oak
twin juniper
worthy oak
#

You need to balance responsivness and server authority

dark edge
worthy oak
sinful tree
maiden flame
dark edge
#

My general idea is that you have no drag, so you can have an exact projectile path solution. The only thing replicated around in the barest sense are the initial conditions (projectile start transform, start velocity) and it simulates the same on all machines. If the firing client gets a hit, they tell the server, which does a sanity check before doing gameplay-important stuff. The impacts and such happen locally wherever. The only thing crossing the network is the initial projectile conditions.

supple vapor
#

has anyone networked the visual logger? Trying to follow the sea of thieves method of using visual logger but it doesn't seem to be registering both server/client characters

twin juniper
#

like this:

void ADoor::OnRep_Rotation()
{
    switch(doorState)
    {
    case EDoorState::Closed:
        DoorCloses();
        break;
        
    case EDoorState::OpenInward:
    case EDoorState::OpenOutward:
        DoorOpens(doorState);
        break;
    }
}
sinful tree
#

State allows you to determine what the target rotation should be without having to replicate the rotation.

twin juniper
#

the only problem is that the minus thing must be done in BP

#

--
That's what the BP now looks like... Is there a way to now use some of these nodes? (btw, now there's only 1 variable replicated, the state!) @sinful tree

dark edge
#

it'll snap to open normal then close

#

just use the enum to select 1 or -1 for max rotation angle

twin juniper
dark edge
#

and you can get current door state, don't need to pass it

#

I would just have 1 event, DoDoorThing
DoDoorThing -> switch on enum -> play or reverse -> select on enum to choose the max angle -> set relative rotation

twin juniper
#

Does enabling Replicates mean that replicating variables with this function: GetLifetimeReplicatedProps is possible?
Is that what it means and allow?

#

Replicates just means that it CAN be replicated, right? but doesn't mean it is replicated...

twin juniper
twin juniper
#

any help would really help me, I'm so confused rn..

#

this is what I currently have

candid tinsel
#

this what i use for mp opening and closing doors

#

it might help you

twin juniper
#

for me, the angle could be 110 or -110 ...

worthy oak
#

It’s similar to what your doing using less nodes as suggested above

#

You might still wanna include a state though as new players joining/reconnecting won’t see the correct state of the door

worthy oak
#

Right so you should combine the two examples given

#

And use state that way everyone knows what the state of the door is regardless when they enter the game

twin juniper
#

my question here is how to make it work better

worthy oak
#

See what Adriel posted

twin juniper
worthy oak
#

1 node, that grabs your enum, switches on it

#

And based on the switch either plays or reverses

twin juniper
#

that's my current code:

// --- SERVER Side Logic --- //
void ADoor::OverlappingServer(AActor* OtherActor, bool hasJustBeginOverlapped, bool isInward)
{
    AGASTrainingCharacter* player = Cast<AGASTrainingCharacter>(OtherActor);
    if(HasAuthority() && player != nullptr)
    {
        if(hasJustBeginOverlapped) // Entering an Overlap Component
        {
            numberPlayer++;
            if(numberPlayer == 1)  // Making sure there's no multiple player in the box collision...
            {
                doorState = isInward ? EDoorState::OpenInward : EDoorState::OpenOutward;
                DoorOpens();
            }
        }
        else // Leaving an Overlap Component
        {
            numberPlayer--;
            if(numberPlayer <= 0)  // Making sure there's not a player in the box collision...
            {
                doorState = EDoorState::Closed;
                DoorCloses();
            }
        }
    }
    
}

/*
 **        Client Logic for Overlapping
*/
void ADoor::OnRep_Rotation()
{
    switch(doorState)
    {
    case EDoorState::Closed:
        DoorCloses();
        break;
        
    case EDoorState::OpenInward:
    case EDoorState::OpenOutward:
        DoorOpens();
        break;
    }
}
twin juniper
worthy oak
#

Id get it working in blueprint first

#

Then convert to C++ if you really want

worthy oak
#

Your rotation nodes are identical

#

Oh I see your -

#

I guess you could also replicate an angle 🤷‍♂️

twin juniper
worthy oak
#

I’m sure it is

#

I Mean you could do an enum check to see if it’s the other angle, then a select to multiple it 🤷‍♂️

#

Then you don’t need to replicate it

twin juniper
#

maybe I'd create 1 mroe var that's not replicated, it would be the default rotation angle

worthy oak
#

Why?

#

I don’t think you need another variable here

twin juniper
#
UPROPERTY(BlueprintReadWrite)
float maxRelativeRotationAngle = 115.f; // to be set to - or not
const float defaultMaxRelativeRotationAngle = maxRelativeRotationAngle; // default value
```like this
worthy oak
#

I mean I guess

#

But why not just a select on your enum

#

To determine if you need the extra multiply

twin juniper
worthy oak
#

As an input for your Z rotation

twin juniper
#

I dont understand what would that do?

worthy oak
#

A select node selects a variable based on its inputs

#

So pull off door state and type select

#

And for the one you need to be -1 just for -1 there

twin juniper
worthy oak
#

Yep there ya go

#

Now the other inputs in your case would be int

#

So you could just use a “make literal int” node

#

And plug those into your three options

#

Sorry float

#

Not int

twin juniper
#

doesn't work

worthy oak
#

Pic?

twin juniper
worthy oak
#

No

#

You use the return on that as what your multiplying by

worthy oak
#

Then you just need a single instance of that set rotation