#multiplayer

1 messages Β· Page 49 of 1

real ridge
#

and I can t solve it

#

so i need use laptop with windows 10

#

weird

#

*I cannot

high ibex
#

oh, with windows 11, we can't join ? create session is always happening right , but join session is giving trouble

#

i'm also on Win 10

real ridge
#

i don't know bro there is no logic explanation why I have problem now so I am using win 10

#

instead

#

hah

#

there is no many informations about

#

or examples

high ibex
#

hmm.. yes that's the problem

#

wonder how many may come when we start testing with actual servers

real ridge
#

@high ibex so these are my EOS settings and I am just changing Default artifact name when packaking Client/server

verbal tendon
#

Sorry I have no experience using EOS for dedicated servers

#

@real ridge try using the same tokens for both and see if the problem persists

#

Because if it doesn't then there's a problem with the permissions you setup in the backend

#

Some of them are required to join games successfully even if the name doesn't make it obvious. I don't recall exactly what I had that with when I first started using it years ago. I just copy the same setups from game to game

#

Check with a token that has all permissions enabled, or one that already works for you, to make sure it's not a permission problem

#

I do know the execution flow for dedicated servers is different from EOS; it doesn't quite work the same as for p2p clients

high ibex
verbal tendon
#

but I don't know the details because I've never implemented it. I do remember seeing documentation about it

#

so if you are just using the same execution flow for p2p and dedi, there might be a problem

#

Aha right. Port forwarding. The dedicated server usage will probably assume that you have forwarded ports, whereas p2p usage will not have that problem. Likely candidate

high ibex
#

my doubt is that , in the PC where i running dedicated server build, do i have to do any outbound rules ? or inbound rules on other pc where client build runs is enough ?

verbal tendon
#

For a number of reasons, you would need to look at the code, the dedi version may only use your public IP address instead of being able to loopback internally inside your LAN

real ridge
verbal tendon
#

Create another token with full permissions without that

real ridge
#
  • it's working on win 10 and not win 11
verbal tendon
#

Oh

#

lol πŸ˜„

real ridge
#

so propably firewall problem

#

which I can't solve

verbal tendon
#

I missed that, many messages and I'm busy

#

sure you can

real ridge
#

most of time there is 7777

#

my tip is that u have non public ip not all providers offer it

#

this is my nat settings in router then I have also set virtual server for same IP and port

#

this is ip of machine where server is running

#

u Can find that IP by typing ipconfig in CMD in machine where u want have server

high ibex
#

okay, got the point ..

tawdry ermine
#

Hey, I am trying to pass a client variable to the server, when the client connect to a listen server. As example, the player starts his game and can set a PlayerName in the mainmenu. Then once he connects to a server I need to pass this variable to the server.

By googleing I ouly fould suggestion of using GameInstance or RPCs. Any suggestions how to approach this?

plucky prawn
real ridge
#

Guys can someone give me a tip? How to make this I want 2 bases on the map lets say 2 cubes one will be base for team Red one for Team Blue how I can make it? and I will be able to attack it and then I will be also able to destroy and if someone will destroy enemy base he will win πŸ˜„ i know how to attack and destroy but how to make base logic

#

and say which is whom base

#

Can I use only 1 object for it or better use 2?

#

now I started with 1

thin stratus
#

You usually make one Blueprint and give it a Team Property

#

This assumes that you have such a property setup, but if you have a team game then you should have something that identifies teams

#

Then you can mark that property as Instance Editable

#

Place two instances of it like you already have and change the value on each to the correct team

#

Or you make 2 child BP of it and change the values there and place one of each into the level

tawdry ermine
plucky prawn
#

you could probably get away with storing it on the game instance of your local player then retrieving it once the player has loaded in and RPC to the server with the name

tawdry ermine
plucky prawn
#

what do you mean that you cant access it?

tawdry ermine
#

never mind, it was just me being stupid again. Thanks for the help I figured it out

#

I tried to access it via the game mode... stupid me

twin juniper
#

Hello. I would like to create a passion project, a multiplayer pokemon game. The problem is that the interactions between the client and the server are very confusing to me πŸ˜”, so I would like someone to hold my hand while I do the combat system from scratch.
Somebody please help

I don't have much but I could pay someone to mentor me. I want to see my project become a reality

verbal tendon
twin juniper
plucky prawn
# twin juniper why?

do you like legal headaches and burnout? because thats how you get a bad case of both

twin juniper
#

I won't get any of those because I won't be that stupid to release it under my name πŸ˜†
I will release it anonymously

#

just a random link on mediafire from a disposable twitter account

dark edge
#

Nobody worth anything is going to help with a fan game.

twin juniper
plucky prawn
#

if you never release it and never show it or use it as a show case piece (eg for your portfolio) and use it purely as a learning experience you could probably get away with it but then whats the point

#

you would be way better off with a really small original piece

twin juniper
#

The thing is I really love pokemon and I love playing pokemon fan games. So I would like to make my own for people to enjoy like I enjoy those other fan games

dark edge
#

You can make a critter collectothon / battler

plucky prawn
#

dont do it though

dark edge
#

just can't use their IP

plucky prawn
#

my non legal non lawyer advice is to not even acknowledge pokemon as a source of inspiration or anything

dark edge
#

Pokemans? Never heard of them.

plucky prawn
#

call it man poke instead

twin juniper
#

I believe that with due caution and measures to avoid being caught, everything can be achieved.
Lots of fan games are still up, just a handfull of them got taken down.
I just see that there is a huge stigma against fangames here :3

plucky prawn
#

you can believe what you want and noone is saying they are bad, but they are a bad idea particularly with very strong franchises like pokemon. if you want to make it go ahead but you need to be aware about what you are getting in to and that possibly noone is going to want to help you in any official capacity

twin juniper
#

nah, Im just going to save a bunch of money to pay for a mentor to instruct me on the stuff I don't know

plucky prawn
#

you can ask in this server for free

twin juniper
#

but you said no one is going to help me

plucky prawn
#

if you ask can someone help me remake pokemon noone will help you

#

but if you lay down some ground work and ask about specific functionalities like how do i capture these creatures i made when the ball hits them then someone is likely to help you with that specific thing

real ridge
#

guys for some reason I am getting kicked short time ago from server when I play with 2 players

#

how I can find out why?

#

happening also when testing as client 2x and server is editor

#

I am still on map but one player will lost me and I am lkke on separate map but kicked

#

now I am tehre shooting each other

#

but I cant show log uh

verbal tendon
#

Especially not in a mentor-style relationship where the implications are quite severe due to the affiliation with you and the project

twin juniper
verbal tendon
# twin juniper Illegal is a strong word

It's not a strong word, it's a basic requirement. And even if something is legal, doesn't make it ethical. Something illegal is not going to pass my ethical check anyway.
It's the reason why I have never and will never work on for example a gambling project.

#

A basic requirement at least for some of us

dark edge
twin juniper
dark edge
#

I need help incorporating ads.

sacred kraken
#

What are the naming conventions for c++ replication functions? I've seen OnRep_FieldName quite a lot now, that seems fine. But what about RPCs? I feel tempted to use Server_Method or Client_Method for that, but I've also seen ServerMethod.

#

I prefer Server_Method because it seems more in line with the OnRep_ style. But maybe it's already a convention

chrome quest
#

I use Server_

#

Client_

sacred kraken
#

Is there some reason why movement to my client is not being replicated to the owning client? Is that because it's an autonomous proxy?

#

Maybe it should move itself, which would make sense. But then how do I know I don't go out of sync with the server? There are platforms that move and I could miss them if there's a high ping

thin stratus
#

CharacterMovementComponent should handle this all for you

native vector
#

question about physics sync
i have to many problem so replicate movement sets transform directly which is not ideal for physics object and what I am doing
but some times physics objects gets out of sync a lot
there is some moment component for it ?
or i need to make one ?
(yes it is the same cube)

thin stratus
#

So, I still haven't looked at Chaos and how well this works, but before Chaos at least, Physics in Multiplayer is if at best only of cosmetic nature

#

There was nothing build in to sync them and Movement was 100% not supporting Physics

#

CMC even turns itself off for most of its part

native vector
#

ye but character movement component has interpolation and (i'm not sure about this) server only Physics with work very well
i can set the Physics to be server only but then i run in to snapping issue on clients

#

it is a good fake lul physics

thin stratus
#

Again, actual Physics with Movement is not a thing in UE atm at least

#

The Cube itself, if it's just cosmetic but not gameplay relevant, can have physics and you can code a bit of interpolation to make it smoother

#

And if it's only about picking it up and moving it somewhere then you can also get away with some gameplay elements

#

But not if it has to do with character movement

native vector
thin stratus
#

If the Cube is usable by multiple players at once, then your best bet is to have it Server Auth and smooth the location on the Client

native vector
#

ye but replicate movement sets transform directly unless i get the movement packed some how i cant use replicate movement with idk if can be a problem if replicate movement is false on root actor and or rest is true

cunning stirrup
#

Hello, I have an issue :
I have a struct with an array of references to components of other actors. Those other actors are set to use the owner's relevancy, owner being the main actor holding the struct.
That struct is set as replicated.
The issue that I'm facing is that sometimes, the main actor spawns on client before the other actors, causing some references in the struct to be null. I've tried with weakptr to see if maybe the references wouldn't be null, but no luck. Order of spawn seems to be random too.
Is there a way to fix that using the engine or do I have to code something custom ?

chrome bay
#

Nothing you can do about it, spawn order client-side will be random

#

So to solve it you would use an OnRep callback for the array, and check the contents each time it's called

thin stratus
#

Blueprints aren't cut for advanced stuff like this

native vector
thin stratus
#

Yeah the .h (:

#

Honestly, I don't have resources for that

#

You'll want to check what maybe the Character and the CMC are doing here

native vector
cunning stirrup
chrome bay
#

It'll change/be called everytime one of those properties is populated with a valid object

cunning stirrup
#

all my actors have spawned, the array is valid on server, and yet, there are still nullptr

blazing spruce
#

Hi, hoping someone can help with this problem im having with displaying and removing a loading screen.. the reason its a being a little bitch is because i have a Pre Lobby level which has its on pre lobby game mode, game state, player state and player controller.. the pre lobby player controller is the class that creates and stores the loading screen widget and then once the game is started the loading screen widget is displayed for all players and then it uses seamless travel to send all players over to the actual map

#

So, when they're sent to the actual map from the Pre Lobby the loading screen widget stays on the screen, but now because im on a different level i have a new game mode, game state, player state & player controller, so i cant access the stored loading screen widget on the pre lobby's player controller anymore to remove it from parent..

#

I tired making it persist over by making it so when i create the loading screen widget on the pre lobby player controller i also save a copy to the pre lobby player state, then used CopyProperties to send it over to the new player state when its created..

#

Then, when i try to remove it from parent from the new game mode once the map is loaded in, it is somewhat working but it only works for the server player while clients still have the loading screen widget on screen.. i tried having it remove from a client RPC & a rep notify called by the game mode but neither worked for the client only server

#

Any ideas how i can get this to work properly?

thin stratus
#

Store that Widget in the GameInstance

#

In C++ you usually don't even do it like that

#

You just ask the Movie Subsystem to play a Loading Screen, supplying it with a Widget

#

Which is usually done in the GameInstance as well

#

Also

#

The BeginPlay RPC to show your LoadingScreen is wrong

#

Just add a Branch with IsLocalPlayerController

#

The RPC is totally redundant

drowsy meteor
#

HI guys , im trying to replicate the movement of the player but it doesnt replicate the look up , i tried changing the remoteviewpitch and calculating the new rotation but i get this weird interaction after looking down few times, it rotates backwards opposite to the player

#

this is the code where i use the remoteview pitch

thin stratus
#

Is the already existing method for that

drowsy meteor
#

i tried overriding it but it didnt work

thin stratus
#

Why overriding it though?

#

Also isn't BaseAimRotation world space?

#

You are setting relative

drowsy meteor
#

wait can you please give me a sample code on how to use it cause all i did was take the return of the function and assign it to the relative location

#

nvm , i got it πŸ˜„ thank you very much i was too focused on working with the remoteviewpitch

real ridge
#

it is good logic to use same game mode for my dedicated server and same game mode for my PLayers? But when I change game mode I have no idea how I can separate for these two and run session on dedicated server

#

wdym guys πŸ˜„

#

maybe bit confusing question

#

hope someone will get it

#

because in current game mode i Have this

#

and there I handle session creation πŸ˜„

sinful tree
#

Whether or not you can reuse the game mode for both situations is dependent upon what your game mode is doing.

real ridge
verbal tendon
#

Any learnings come at a price

#

πŸ˜„

real ridge
#

so I have it set right way then I dont see any option how to use different game mode for server and for player πŸ˜„

#

I need use this because I am making session on server

sinful tree
real ridge
native vector
verbal tendon
# drowsy meteor

Not sure why you're doing this. Rather you want to take the rotation inside of the ABP, apply transformations you need to do there

real ridge
#

ah okay let it be no need to answer me seems I am confused and I have no idea what to ask

#

kekw

#

next time I will think twice

drowsy meteor
quasi tide
#

Correct

#

Animations are driven from the values of the actor the ABP is attached to.

#

The data in that actor is replicated.

verbal tendon
#

Rather than forcing values inside of the character/controller, generally speaking

#

because they're supposed to be input driven

drowsy meteor
sacred kraken
chrome bay
#

Hard Mode = On

sacred kraken
#

My steps are tile based. One tile is 100cm, and there's no diagonal movement. But I solved it by using a multicast that sends out the locations and the clients just process them in order

thin stratus
#

That's not the solution theoretically but sure

#

CMC is the only client predictive movement you have without coding it fully yourself

#

And that's not done with a multicast :D

serene furnace
#

https://prnt.sc/i1tL7QGtFLoP

https://prnt.sc/BRjqfMuwLkR5

Heyy ! I got an issue with some rep notify I'm using into a code, So it's actually working on the clients and stuff but only once, and then when a client triggers this code again it stopped running on client and only the server runs it πŸ€” any ideas ?

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

sinful tree
serene furnace
#

Update Equipment slots into the rep notify (first image) is the one changing the gear, and the integer in getting changed by an input action that is triggering S_EquipMainWeapon @sinful tree

sinful tree
#

How would the server know that the equip integer is changed?

serene furnace
#

nothing too complicated on that one

#

I guess this integer need to be replicated ? as well ? or rep notify ?

sinful tree
#

All this would only ever happen client side.

#

If you need to tell the server the value, then you'd need to send it with the RPC.

serene furnace
#

yeah I see it now, your right this is client side only

#

should I rep notify both ? and into the rep notify of the integer, trigger the S-EquiMainWeapon ?

sinful tree
#

Does the client need to know the equip integer at all? Like, is that integer even needed?
You could RPC to the server the enum of the weapon you want to switch to.
In the RPC you can validate if the switch should occur, then you set the Equipped Enum to indicate to the client the swap should proceed with the OnRep.

#

(you'd do some checks in the RPC before setting of course)

serene furnace
#

yeah after reading 4-5 times I get what you mean passing the into directly into the server I did not think about that before x)

#

previious haha typical me typing

#

Now I'm trying to find a way with the "previously equip" that needs to be set before editing the next weapon switch ^^

#

This Enum on the left needs to be set before the New set happens and needs to be replicated since it is using this data into the "stow previious weapon" checks

real ridge
#

Guys I need tip I have 2 teams Red and Blue and I have 2 bases on the map I want on begin play put them in the team πŸ˜„ one to red and second to blue but how I can know to which team put them its one blueprint

#

any tips

#

?

dark edge
#

give the bases on the map and your pawn classes a variable of that enum type

#

that's how you match them up

quasi tide
#

Something something GameplayTags

real ridge
# dark edge Make an enum, give it Red and Blue options

now I am doing it via player state for players there is no problem because I have lobby and my own database where I am telling them which team they are and via varest I am getting their team and then store it in player state

#

but for base i dont know if second base is not same team already

#

i can make this but then both will be red

real ridge
#

it will automatically make them different?

#

i thought is best to store in playerstate

dark edge
#

It'll make it not depend on spelling and you can do switch on logic

real ridge
#

not to red

#

wdym?

#

like this array of pawn

real ridge
#

one red and one both

dark edge
real ridge
#

HMM I did cast to playerstate but it is always failling idk why πŸ˜„ but maybe because I cant use get player state because I am in game as player and it will get my player state

#

but this is base on the map so idk

dark edge
#

You should be doing this all in gamemode

#

Gamemode gives a player a team, then spawns their pawn at the right base

real ridge
#

it is game state for this

real ridge
#

i have 4

#

and this cubes are already spawned

#

inside map

real ridge
dark edge
#

The game mode is who spawns the pawn for the player. You want the pawn to spawn at their team's base right?

real ridge
#

right

#

I will use on post login function

#

and make array of players

graceful flame
#

Well you need player starts so when the possession of a pawn takes place it can start somewhere. I placed my player starts in the level and gave them different tags to separate the teams. Then when I'm spawning and possessing the pawns I have an array of all player starts and it randomly chooses one depending on the tag. The team is assigned to the player on the GameMode.

dark edge
#

You can make it use YourBaseActor instead of PlayerStartActor

graceful flame
#

Can also just pass in any vector as the starting location, I find it easer to use player starts and tags so I can just move them around the level while testing.

real ridge
#

okay

#

i am just refactoring

#

it to game mode

#

πŸ˜„

graceful flame
#

GameMode is the most appropriate place yeah. There's TDM, CTF, King of the Hill....etc all classic examples of GameModes all using teams.

real ridge
#

i am just watching example of it on youtube

#

so i can also delete playerstarts from map?

#

when I will spawn them

#

Do I need also posses them?

#
  • additional question what with my base? it is big cube on map I need also spawn it there because I need give it a team but I cant possess it it is just in the air
#

my base

#

it is pawn same as my plane which I am playing with

graceful flame
#

The player start is just like a built in actor that has an arrow component and a capsule component. It gives you in editor feedback if its likely to have a collision problem before running your game and the arrow shows you which direction it faces. Its main purpose is just to store a location. When you spawn in an actor one of the required inputs is a transform. The transform is a location, scale and rotation.

real ridge
#

so i can delete them

#

if I choose random spawn locations

#

for every joined

graceful flame
#

For my game I loop through all of the player starts, check to see if its of a certain tag, then randomly select one from the list and use its transform directly into the Spawn Actor's transform input. Like this:

#

There's extra lines because I just dragged it out of the way for the screenshot, but you get the idea.

graceful flame
real ridge
real ridge
graceful flame
#

You tagged your player starts too right?

real ridge
#

yes from 0 to 3

#

0 1 2 3

#

4playerstarts

graceful flame
#

Ahh okay

real ridge
#

good?

graceful flame
#

Oh wait maybe it’s not Player Start Tag, I’m not sure if it’s that one or generic actor tag

real ridge
#

okay so i found first problem

#

I am spawning twice now

#

one is spawned by game mode

#

and one by playerstart propably

#

also dont I need make server spawn via RPC?

#

ah shit I am now spawing 2x on every client

#

this is how I am doing it and it spawning twice i dont understand

#

tried also use switch has authority

#

did not help fuck:D

#

it is caused because i am spawning them on player starts?

pliant hinge
#

My first instinct is yes, don't remember. For your custom BP, I would offset them by some random transform.

#

If they both have the same transform, the issue is on your side

#

If one has the random transform and the other doesn't, then the PlayerStart spawn is being handled automatically and you'd need to find where

real ridge
#

OK deleted player starts

#

will work with random tranforms

#

now its ok

#

how it is possible that when I am doing spawn like this I will always spawn both at same location just minimum change?

#

its random lol

#

i tried make it like this via target points even i did this I am spawning at same location kekw

verbal tendon
#

Any of those nullptr entries in your array are actors that exist on the server but haven't been fully replicated to the client yet, so at the client side it cannot properly assign them when it's getting the references over the network

#

There is an easy hacky way of solving your problem in combination with a config for RPCs, and I forgot the name because I never use it, but if set, all RPCs will not be called on the client unless all parameters of the RPCs have been resolved locally.

So you could call a RPC with all actors you need to have on the client, and it'll be called at the right time.

#

There are a variety of other ways to tackle the issue though

cunning stirrup
real ridge
#

hooow it is possible that my pawns are spawning twice on map ahh

#

i dont understand

graceful flame
real ridge
quasi tide
#

Why are you not using player starts? lol. This is exactly what they're in the engine for.

graceful flame
#

Maybe try moving the Remove node further down the execution chain.

real ridge
graceful flame
#

You're removing the item from the array and then trying to use its transform right after

real ridge
#

but they were not the problem

quasi tide
#

They aren't the thing that does the actual spawning. GameMode does

graceful flame
#

Also I have a node called "Set Local Player Controller ID". I don't remember setting it but I think it was from a tutorial I watched a while back.

graceful flame
#

also check this, how many players are you spawning?

real ridge
#

when i spawn 2

#

i get 4

#

and so on

graceful flame
#

So something is running twice...hmm

real ridge
#

but i can posses only 1 and then only 2

#

I cant posses those duplicates

graceful flame
#

Well breakpoints could help you figure out why that happens

real ridge
#

I tried move remove

graceful flame
#

If you want to make this debugging process a whole lot easier just use breakpoints and step through the nodes one by one checking the inputs and outputs with your mouse to see exactly what data is flowing and where the execution path goes. https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Debugging/#:~:text=modes are active.-,Breakpoints,the Blueprint Editor's graph view.

Pause execution using Breakpoints to inspect graphs and the values of variables.

real ridge
#

but there is weird thing even I set clients to 2 and run 2 instances it will choose just 1 target point to spawn both and make between them small difference should not they be on different locations?

#

sorry I am talking too much today will take break and take a look on it tommorow

#

will have much clearer mind

graceful flame
#

It could be that when you use GetAllActors of Class and then assign the results to the array it didn't have any results yet because it can sometimes take a while to run depending on how many other actors you have in your level, so maybe adding a IsValid check to make sure there are results to process in the first place might help.

#

or set a timer by event with a short delay to keep looping until it has found the results then you can clear the timer and process the data

real ridge
#

i will keep this in mind ant check tommorow thanks

#

I was firstly following turtorial he had almost same blueprints as me but for him it was working hah

#

weird

graceful flame
#

All it takes is one missing checkbox or something to skew the results from your expectations.

real ridge
verbal tendon
#

and i'm not sure if it's limited to reliable RPCs only or not, I only ever glanced at it when I stumbled across it. Better would be to solve your problem a more traditional way

#

You can check the values OnRep, you could change the design of your logic so you don't rely on timing. basically the problem you are experiencing is one small subset of potential problems you can experience

#

I assume here you have a bunch of logic in BeginPlay for various different actors. Right now its that not everything is replicated to the clients, later it'll be harder to trace down timing problems between different BeginPlay logic running

#

You can chose a method to communicate when everyone is ready and fully loaded, you could make your various actors less tightly coupled to others so that they don't need to reference one another on clients when not all of them may be completely replicated, etc.... various solutions based on your unique problemset

cunning stirrup
verbal tendon
cunning stirrup
#

Raw UDP/TCP ?

verbal tendon
#

That's working against the engine, and that's a mistake you make in the early day with UE, especially when coming from somewhere else

verbal tendon
# cunning stirrup Raw UDP/TCP ?

Yes. I'd strongly recommend sticking with the engine's design and learning the patterns, rather than trying to enforce your own

verbal tendon
cunning stirrup
verbal tendon
#

You probably want to load the UGC from the client

#

rather than fromthe server to serve it to the client

#

I mean tons of assumptions here from my side, no idea what the requirements and constraints of your project are

cunning stirrup
#

Someone has to send the data to the client though ? Things made by other players

#

Think robocraft

verbal tendon
#

I dont know that game

cunning stirrup
#

but with more data

#

Minecraft ?

verbal tendon
#

I'm not the youngest generation

#

Anyway. Assume you have a set of UGC server decides to play with

#

it publishes that to the clients in the lobby, clients load it through some web api

#

you offload the networking load to clients rather than CDN -> server -> clients

#

you just do CDN -> clients

cunning stirrup
#

I was considering doing client -> server (caches and stores) -> client

verbal tendon
#

if your UGC is just like skins, all the server needs to know is the ID to share it with all clients

#

the clients download and load the data

#

There's a way to simplify UE's networking model with custom net serialization

pallid mesa
#

it is also possible to stream big quantities of data in chunks from the server to clients using default Unreal's networking in a sequential and ordered way while checking against the reliable buffer.. if you only need to do one big stream on join then that might be sufficient, the rest are just deltas

cunning stirrup
#

Yours is smarter but it requires another server, and another codebase to interact with it, which basically comes back to UDP and TCP messaging.
It's more complicated that just skins, it's 3D models

verbal tendon
#

Do what's easiest for you

#

I gotta grab some sleep now

cunning stirrup
verbal tendon
#

As long as the 3D models respect the same bounds, collision, etc... as the original

#

and introducing them wouldn't affect gameplay other than visuals

#

again, can all be loaded on the client

#

πŸ’€

cunning stirrup
#

The 3D models are the gameplay. In my game, people are creating 3D models to make vehicles

verbal tendon
#

Then you want to design that part really carefully πŸ˜„

pallid mesa
#

then, you can also consider what I said

cunning stirrup
#

That's the reason i'm asking, I want to do it right

#

but wouldn't RPC add a lot of overhead ?

#

when we're talking megabytes ?

pallid mesa
#

you'd be streaming it in manageable chunks in reliable RPCs

#

meaning that your data will be sent over time to the target

#

and you ensure you are in budget by looking at the reliable buffer and the packet size

#

I have to write an article about that, cause its a pretty useful pattern

cunning stirrup
#

If I have multiple players, loading things at the same time, the reliable queue could overflow...

pallid mesa
#

that's the trick

#

you check against the reliable buffer

#

and send stuff whenever there's space for it

#

I usually check by buffersize/2

cunning stirrup
#

Wouldn't that bog down the game ?

pallid mesa
#

that way there's leeway for other data

#

your budget is up to you

cunning stirrup
#

there's no priority for RPCs afaik

pallid mesa
#

I leave half the buffer for the rest of reliable events

#

you could even do a quarter

cunning stirrup
#

Ok, so how can I check the queue?

pallid mesa
#

I have to check cause I dont remember the syntax rn, but its easy

#

let me check

#

@cunning stirrup cannot send you much code cause im in the phone and its tricky, but look for NumOutRec

cunning stirrup
#

in UChannel ?

lucid viper
#

Hello!

Working a simple ping system for my multiplayer game. Currently using a line trace and creating a temporary actor to display the way point.
Trying to wrap my head on how I should go about replicating the actor only to team players.
I was thinking to replicate the temporary actor to all clients and make it visible only to those in the same team but wondering if there's a better way to go about this to reduce unnecessary replications.

#

My next thought would be to use DOREPLIFETIME_CONDITION but not any specific condition for what i'm trying to achieve. Would anyone have any tips?

twin juniper
#

Hey everyone. I was wondering if anyone had any knowledge in where to start implementing fog of war in a team based multiplayer game? I've seen that implementing some type of grid system that tracks what units are in each square is a way to go. How would I go about setting that up, and where should this state be stored (on the game state?)

pliant hinge
#

Has anyone tried implementing a custom way to determine server authority? As an example, make a specific player authority over a sub level they are nearest to, or authority over another player? I'm looking into p2p alternative networking for unreal. Was thinking that if you could adjust who is considered server authority you could still maintain the basic networking framework

dark edge
woven basin
prisma snow
prisma snow
twin juniper
#

@prisma snow do you know the specific plugin?

prisma snow
sacred kraken
#

When loading a new map, what's the appropriate place to assign players to a pawn? I would use player start, except there are fixed locations (and pawns) based on the role of the player (gunner and driver for example)

thin stratus
#

And you can override more functions on the GameMode to provide the pawn and spawnlocation for them if the default behavior is not enough

sacred kraken
#

to provide the pawn and spawnlocation...
This is the part I meant, sorry. Which method would this be?

thin stratus
#

Check the Overrides of the GameMode

#

I'm sure you'll find something matching those terms (:

sacred kraken
#

Choose Player Start sounds good πŸ˜„ FindPlayerStart seems even better

twin juniper
#

That looks interesting @prisma snow , ill definitely have a look at that. TY

glossy kettle
#

@pallid mesa you ascended to a custom io_uring based netdriver yet?

#

or even better: raw frames

pallid mesa
#

stop the bullying x'D

glossy kettle
#

πŸ˜”

glossy kettle
robust oriole
#

I want to set an actors location in c++ in a multiplayer game. The SetActorLocation call is made via a reliable Server function, and i can see via some debug draws on the client side that the server side actor moved, but the client actor didnt. Does anyone know what the possible cause for this could be?
these actors to have character movement components too, i feel like that might somehow interfere

manic wave
#

Hi all. Please help me I have a problem. I have billiard balls replicated, in the server they are the correct size, and in the clients some randomly become small. What am I doing wrong
https://prnt.sc/FgLvnqwBJDDW

Lightshot

Captured with Lightshot

jolly siren
#

@robust oriole The internet doesn't send data fast enough for a completely smooth experience. That's why interpolation/extrapolation are used.

robust oriole
#

aye, i just ended up letting an ai controller control the pawn and used MoveToLocation

jolly siren
#

okay cool, yeah if you were setting the location of the pawn directly that wasn't going to work πŸ˜›

#

If your AI is a character, CMC will handle the smoothing for you

winged badger
#

but not predictive movement, its too tightly coupled with PlayerController for that

#

meaning you will see yourself start moving after server starts replicating movement that happened server side

robust oriole
#

thats fine, its a tactics game anyway so quick reaction time wont be a big issue PikaThink

#

Another question aimed at replication and in conjunction with the gameplay ability system, I give my pawns abilities on the server, but they only replicate to the clients that possess these pawns. The list of all abilities the pawn has (or at least certain ones that can be executed by a player not owning said pawn) should also replicate over. Is it possible to set it up this way?

#

⬆️ images show (in order) how the abilities are given, the initialization and lifetime props of the pawn, the function i use to see how many abilities are reigstered on each client and the output. BP_PlayerUnitCharacter_C_0 is the Character possessed by Client1

outer sphinx
#

Hello guys how are you doing? One question, I have to save the "character experience" data and I can't think of an idea to do it. because I think that making queries so that it updates every time it adds 1 or 2 points is going to make the performance bad, how would you do it? thanks guys

quasi tide
#

I think that making queries so that it updates every time it adds 1 or 2 points is going to make the performance bad
Measure it. Don't guess.

#

That said, you could attempt to save at certain points or save when someone logs out.

pliant hinge
#

Dedicated server isn't an option I'm interested in

graceful flame
quasi tide
#

...these are your only two choices though

#

p2p isn't something you use for anything that is large.

graceful flame
#

p2p could work for a UI based game of some sort.

quasi tide
#

p2p also introduces everyone being responsible for all the game logic.

pliant hinge
#

Outriders is p2p out of UE

quasi tide
#

So instead of one place of authority, you have X

prisma snow
#

Idk about non-lockstep p2p, but since the number of connections grows exponentially I wouldn't use such models for more than 4-8 players

quasi tide
pliant hinge
#

But I'm also not exactly going for p2p. I was curious if the server authority could be chosen for each player, Like A is authority of B and vice versa, mainly so that B could be authority of sublevel B and A is authority of sublevel A, rather than A is authority over B, sublevel A and sublevel B

prisma snow
pliant hinge
frigid ledge
#

What is computational- and networking-wise more heavy, using a multicast or setting the component to replicated and do it once on the server?

pliant hinge
graceful flame
pliant hinge
graceful flame
#

But what would be the point in changing host?

pliant hinge
#

I'm not even trying yet. I was just curious

prisma snow
quasi tide
#

I don't think they use rpcs, I think they're just packets.

#

(I know everything is packets at the end of the day, but you know what I mean)

prisma snow
pliant hinge
quasi tide
graceful flame
#

That's the standard way of doing things

#

Can only join one session at a time

prisma snow
graceful flame
#

Player A is listen host for their session, and Player B is listen host for their session. Two separate sessions.

pliant hinge
# prisma snow What kind of game are you working on?

To clarify I'm making a VR version of Warzone's DMZ. My main concern is the drop-out of players at anytime. I have no idea how host migration affects a session, but I assume it would result in some sort of hitch

graceful flame
#

If the listen host leaves the session or quits, it disconnects all connected clients. It's like shutting down a dedicated server.

graceful flame
#

Not if they suddenly quit, power outage, internet outage...etc

#

Only if they run the logic in your game that handles host migration.

#

Clicking on the main menu quit game button for example.

pliant hinge
graceful flame
#

Maybe there's an unexpected shutdown function you can override? I dunno

pliant hinge
quasi tide
#

Have you done a multiplayer game before? If not, godspeed.

pliant hinge
real ridge
#

guys I need help sometimes joining to my session on dedicated server which is on different network and machine works and sometimes I cant join because I will get this error any ideas how to fix it ?

#
[2023.01.05-20.58.10:201][598]LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.00, Real: 20.00, Good: 20.00, DriverTime: 20.01, Threshold: 20.00, [UNetConnection] RemoteAddr: 87.197.157.225:7777, Name: IpConnection_2147482458, Driver: PendingNetDriver NetDriverEOS_2147482459, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
[2023.01.05-20.58.10:207][598]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.00, Real: 20.00, Good: 20.00, DriverTime: 20.01, Threshold: 20.00, [UNetConnection] RemoteAddr: 87.197.157.225:7777, Name: IpConnection_2147482458, Driver: PendingNetDriver NetDriverEOS_2147482459, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Driver = PendingNetDriver NetDriverEOS_2147482459
[2023.01.05-20.58.10:210][598]LogNet: Warning: Network Failure: PendingNetDriver[ConnectionTimeout]: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.00, Real: 20.00, Good: 20.00, DriverTime: 20.01, Threshold: 20.00, [UNetConnection] RemoteAddr: 87.197.157.225:7777, Name: IpConnection_2147482458, Driver: PendingNetDriver NetDriverEOS_2147482459, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
native vector
#

i'm trying to fix this but MARK_PROPERTY_DIRTY_FROM_NAME(AActor, AttachmentReplication, this); throws error LNK2001: unrecognized external symbol
what i need to include or add to .build?

plucky prawn
#
How to set up PushModel. First of all, in Build.cs, you need to add to exclude compilation problems
PublicDependencyModuleNames.AddRange(new string[]  {"NetCore"});```
rough jolt
#

I have a question
If I have a widget and I want some players to see it and other players to not see it, what's the best way to do so?

quiet fjord
#

Guys I have a dilemma in latency optimization in animations. I am running my animation on my machine first and then do the replication for all clients except me this is correct for better performance on animation replications to avoid lag

#

that is my code

woven basin
# pliant hinge Ah, see host migration isn't something I'm familiar with. I've just started plan...

Sorry - I'm just going to come out and say it;

If you have no experience in Unreal multiplayer, there is no point trying to create a p2p listen server failover solution or the 'each person is their own server' thing you described.

Focus on making a game that works with multiplayer first. That alone is likely to be difficult enough for you with all the resources that you have on this channel and the internet. If you go to try to modify the Unreal networking at such a low level, then every single time you run into an issue you wont know if its "you" or the code.

You also mention how a listen server gives the server person an advantage, but you then say a dedicated server is out of the question. That's exactly what dedicated servers exist, to even the playing field in competitive games. In a P2P game you still have the issue that each person can 'cheat' their local client if they are in control of it.

Modify the networking engine to the level you describe would realistically require a deep understanding of how it works, or a team of people and time to invest. It's the type of thing that I would assume Wizard, eXi, Zlo etc could undertake.

Unless there is a plugin that handles it all for you, I feel that your going to set yourself up for failure.

fathom aspen
fathom aspen
fathom aspen
#

I'm a hatless wizard now πŸ₯²

#

Would you forgive me for taking the hat off?

#

I'll take it since you're πŸ₯΅ now

native vector
#

AttachmentReplication is broken ?

#

this is runs on server

for (size_t i = 0; i < parts.Num(); i++)
{
parts[i]->AttachToActor(Group, FAttachmentTransformRules(EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, true));
}
twin juniper
#

Is it a good or bad practice to override RPCs in child classes?

#

Because doing this seems redundant. While my child classes need to have the local call.

quasi tide
#

@worn wagon πŸ‘†

worn wagon
#

Changing a 0 to a 1 πŸ’€

#

I hope that actually fixes it, I have that convar set and still have issues in shipping

quasi tide
#

What if the convar isn't saved or some weird shenanigans in shipping?

#

Β―_(ツ)_/Β―

worn wagon
#

I hope that's the case πŸ˜„

#

Thanks for letting me know about this

dry pebble
woven basin
rose egret
#

I need synced clock for my buildings that produce item. I found something interesting. GS->GetServerWorldTimeSeconds() has totally different tone in comparison with TimerManager.SetTimer

    ReplicatedProductionStartTime = GetWorld()->GetGameState()->GetServerWorldTimeSeconds();
    GetWorldTimerManager().SetTimer(THWork, this, &ATDFactory::OnBuildFinished, 30, false);

ReplicatedProductionStartTime reaches the target time 3 seconds sooner lol

#

any idea ?

thin stratus
#

ServerWorldTimeSeconds are kinda a mess

#

They are averaged over x packages and then even reset once in a while

#

It's usually best if you code your own with a simple Server/ClientRPC setup

#

I have that in a Component on my PlayerController

#

Just sends an RPC to the Server and back with a Timestamp (both direction) so Server and Client know RTT/Latency and have a synced clock @rose egret

pallid mesa
pallid mesa
#

Thing with this cvar is that it didnt trigger - any - anim notify in the server when you are an autonomous proxy

#

There's another issue which is anim notifies on root motion montages

#

usually used in anim montages in gameplay

#

in such case queued events can get skipped in the server when you are an autonomous proxy

there are two solutions for this:

  • set anim notifies to branching point: Not ideal and not always possible since you cannot have two notifies happeninh at the same time
  • and the second solution is fix the cmc in MoveAutonomous

since it only evaluates non root motion animations

rose egret
#

@thin stratus I don't need much accuracy so GetServerWorldTimeSeconds was enough for me but what I found is they use different delta.
you can see when windows loses focus or FPS is low TimeManager tick slowly

elfin atlas
#

How to Reaplicate Tracks in Level Sequence ?

The sequences are not played together, but the Transform of the actors in the sequence being played on client 1 must be visible on the player camera on client 2.
Also, the tracks in the sequence are spawnable.

torpid girder
#

hello, I am looking to test multiplayer locally, I want to start up a dedicated server so i can test out my server browser, i ticked the launcher separate server, i am sure that in UE4 i used to get a separate window open

serene furnace
#

I got 1 listen server and two other windows clients with this settings

thin stratus
#

Pretty sure they are talking about a window that shows the Dedicated Server

#

might need the -log as an argument somewhere

#

I never tried that in PIE though

torpid girder
thin stratus
#

No, that's a ListenServer

serene furnace
torpid girder
#

yeah the dedicated server isn't starting, firstly i never see the separate window openeing

serene furnace
#

Listen server is a client hosting a game

torpid girder
#

also it never hits the breakpoint in the GM for a dedicated server

thin stratus
#

I have never used the Separated server option

#

If you start with "Play as Client" it should start a DedicatedServer

torpid girder
#

if i play as a client, that simulates a client connected to the server, i am trying to simulate a stand alone client trying to find a server to connect to

thin stratus
torpid girder
#

i did it before in like 2018 πŸ™‚

thin stratus
#

command line for that would be something like:

<path to Editor.exe> <path to .uproject> -server -log

thin stratus
#

Never used that

serene furnace
#

this code stops be replicated under certain condition, it all triggers on a rep notify after I press an input to switch weapons, but if I press the same input the rep notify fires properly, but does not replicate

thin stratus
#

Setting a RepNotify variable to the same value won't replicate it

#

Cause it's not "dirty"

thin stratus
# torpid girder i did it before in like 2018 πŸ™‚
    /**
    * This is a rarely used option that will launch a separate server (possibly hidden in-process depending on RunUnderOneProcess) 
    * even if the net mode does not require a server (such as Standalone). If the net mode requires a server (such as Client) a 
    * server will be launched for you (regardless of this setting). This allows you to test offline -> server workflows by connecting
    * ("open 127.0.0.1:<ServerPort>") from the offline game.
    */
    UPROPERTY(config, EditAnywhere, Category="Multiplayer Options")
    bool bLaunchSeparateServer;
#

So the Server will not trigger any Breakpoint I guess

serene furnace
#

thats what I though Rep notify would do I needed confirm ^^ Ty

So what would be my best option to press the same button to go back to melee ? πŸ€”

since I need it to dont change the value x)

torpid girder
#

its this

thin stratus
#

If you disable that then it's gonna be a new process, yeah

torpid girder
#

perfect

thin stratus
#

Is it like "Unequip"?

#

If you want to go back to Melee when you are e.g. MainWeapon, then simply check that

#

Where you do your Input

#

When sending the RPC

#

Send either MainWeapon or Fist

#

Based on the Enum being MainWeapon or not

#

same for the other inputs

serene furnace
#

yeah what I'm trying to do is "If you press the same short cut that is already equipped, then you go back to melee"

So if 1 (main weapon) is already equipped then swap to melee

verbal tendon
#

But also all your equip logic can run through that check abort early and revert to melee if the weapon is already equipped

#

That's trivial

serene furnace
#

Hmm How would you do that ?

verbal tendon
#

Make a Macro/Function that takes an enum of your weapontype

#

Inside this you compared it to the currently equipped type, if it is the same -> handle melee logic, return false/exit macro
If it's not the same, it returns true or your macro continues execution through its exit node where you continue the rest of the function, something something

#

The important part here being that the logic sits in one place, rather than you copy pasting the different BP nodes to the different input handles in your eventgraph

serene furnace
#

well I guess in all cases your copy pasting the macro on each input node ?
I'm curious how is it making a difference, exept for the part where it's cleaner, like is it actually sparing resources ?

#

ty for the tips tho I'm getting on it soon soon ^^

verbal tendon
#

Well since time is the most scarce and precious resource that we usually have. If you have 5 of those weapons

#

cleaner and simpler to maintain. Less time spend duplicating any change to all the inputs, one place to fix a bug

#

it also makes it easier in a team for anyone else to come in and do something with the logic

#

One of the most important principles as an engineer is to keep your work clean and simple. Even if you are just alone

#

@serene furnace . Tag, forgot to reply to a message

serene furnace
vocal cargo
#

PlayerState has "CopyProperties", used to copy replicated variables to the new player state when traveling. What if I'm replicating variables inside an ActorComponent of PlayerState? Will those be automatically replicated to the new player state?

fathom aspen
#

Nothing happens auto, you have to specify the properties that you want to copy to the new PS

#

With the exception of very few properties that Epic handled/specified for you

dull thistle
#

Hello, why is that sound on Map only playing on Server but not on Client?

#

Its an Actor placed in map and thats the BP

verbal tendon
#

Or wherever it runs, it's not properly setup for networking

#

RPCs need to go through a client-owned actor

dull thistle
#

So.. if the Actor replicates its not enough?

strong edge
#

Hiya! Quick question for people using GameLift for hosting a dedicated server: were you able to have a crash report from AWS instance ? Since even building a server with crash reporter flag it does not seems to work for me. Minidumps are 0 bytes which is not helpful at all. Any pointers ?

slender mortar
#

Happy new year all! I have a bit of a generic question.
What is the best way to handle multiplayer character selection?
A newbie guess from me would be, to have a custom server hosted that would handle a player's character selection, (after they login and all), whereas after they join a map, the server gets to know which character they wanted to play by fetching that Server.
Another guess is, somehow having a Websocket kind of P2P logic where players that are in, let's say a lobby, they can see other players' changing selection like Fortnite for example, before they enter the queue to join the game, and again the server gets to know how to spawn it.
Or, which seems the easiest but not that secure, is to have the selection to be local and saved in the GameInstanced then fetched again by the client and RPCed to the game server to spawn that character by ID/Key.
Or even have the whole lobby and character selection after players join the game server, sort of a pre-match state where they choose the characters in the game server, and then the play.
This is a bit of a thinking out-loud here, but I found this is the best way to put the confusing ideas about how to go about this.

I am wondering if EOS+GameLift for dedicated servers can handle all of this.

Thank you so much for helping! I am sure this would be helpful for the masses in here.

dull thistle
digital marten
# slender mortar Happy new year all! I have a bit of a generic question. What is the best way to ...

There is nothing wrong with having character selection on the local machine and then making an RPC request to the server.

If you need rules for character selection then have the server send a response RPC to the player after they have sent an RPC request with their preferred character. This response will be used to either confirm their request so the player no their pick was successful, or fail telling the player to pick another character.

Then for making sure someone doesn't hold a lobby hostage you could either have a default character that the server selects if the player fails to choose in X seconds, or you reset the lobby because not everyone has picked a character.

There is nothing insecure about processing client side, the problem is who has authority? The client can tell the server what to do, but ultimately the server should have final say and should check the request input of the player against its criteria.

#

Ideally you'd have inputs connected to events that would make an RPC request to the server, and then if valid the server would perform the players request and create the player character, assign the player control of it, and replicate the players character.

digital marten
slender mortar
#

@digital marten thank you so much for your input! I understand that this is completely doable, but only if the character selection is about to be done once you join the game server.
I was thinkings omething similar to LoL, where you hit a queue, and then you join a 'Lobby' (not sure the lobby here refers to players joining a game server that handles all the character selection logic and then travels everyone to the game map) or if it is completely P2P (websockets for example) so that players can see in real time other players' character selections and such.
Also, do you think EOS can help with any thing of this regard?

verbal tendon
digital marten
#

No clue, haven't used EOS.

verbal tendon
#

Like before my recommendation is to read the documentation, through the link provided, try around a little bit, come here again if you're stuck

dull thistle
vocal cargo
dull thistle
fathom aspen
#

It's also good to note that it's even used to preserve the PS when disconnections happen (either a hard travel or a disconnect due to a failing internet) though there are caveats you have to be aware of

#

The compendium in the latest pinned message goes over that in depth

vocal cargo
#

yeah, you're right, seems like the smartest way to do this is to just use CopyProperties. I wanted to keep my ActorComponent modular but I guess it'll need some integration with the PlayerState.
Anyways, thanks for the help

verbal tendon
dull thistle
fathom aspen
vocal cargo
#

Almost fine is concerning. Are Actor Components that bad?

#

Probably seamless travel, yeah.

fathom aspen
#

Nah, it's just that I haven't faced any bugs so far

#

Landmines are everywhere

#

Would be very bold to say "always fine"

quasi tide
#

Just do what you think is right, then when you inevitably step on a UE mine, ask if someone else has stepped on it before. Most likely, someone has.

vocal cargo
#

fair enough.

loud cove
#

What's the difference here between the two net modes: standalone and "listen server". I thought those two are the same.

the hint reads:

Play Standalone: Starts a standalone game. This will not create a dedicated server, nor automatically connect to one.

Play As Listen Server: Enables the Editor to act as both the server and the client. Additional clients can be opened depending on the number of clients.

prisma snow
#

listen server is a server that also plays as a client, opposed to a dedicated server, that would be a headless server

loud cove
#

I understand the dedicated server, but that isn't one of the options here.

loud cove
#

Should that bother me?

fathom aspen
#

Meaning you could still connect to one

#

In fact most if not all #multiplayer games start as standalone, and have times where NetMode is converted to standalone

loud cove
#

alright, that makes sense. so in practice, standalone means I have to navigate my in-game menu to start a multiplayer session. whereas listenserver already listens to some other listenserver and connects automatically.

fathom aspen
#

...listens to connections that want to connect to it
FTFY

tawdry ermine
#

Hey,

quick question: Is the Multicast quite delayed or is it more likely it is my hardware?

I set up a checkbox that all players on the server can see. Once it gets checked by a player, all players will update and also get the checkbox checked. But it appears that it takes around one second for clients to be updated, while the server (also via RPC) is almost instant.

graceful flame
# tawdry ermine Hey, quick question: Is the Multicast quite delayed or is it more likely it is ...

A multicast can get dropped as it traverses the network if it’s unreliable (default).
Are you emulating network lag?
What’s the FPS like?
If you change the value of a replicated boolean on the server then all clients will reliably receive the updated value eventually.

You could also try making the multicast reliable but know that it comes with a warning. Don’t make too many of them reliable because a client gets disconnected if it overflows the reliable buffer. But that’s like if they’re spamming a ton of inputs and they’re all connected to reliable network events.

tawdry ermine
graceful flame
#

Any variables setting shouldn’t be set with multicast though

#

Because if a client joins the session after the multicast they won’t receive the change. Use replicated variable and change on server instead.

tawdry ermine
#

Hey, thanks I am pretty new to multiplayer

graceful flame
#

or if they aren’t within the network relevancy as it changes same thing happens

young spoke
#

wanted to discuss some CMC internals...

when client gets their position corrected from server, they cycle through their SavedMoves buffer and replay all moves. As it replays... does it RESEND the moves to server?

graceful flame
#

The one about multicast rpcs vs OnReps

verbal tendon
graceful flame
verbal tendon
#

as long as you're being reasonable with RPC usage you will not have a problem

young spoke
verbal tendon
young spoke
#
  1. client receives rpc from server to correct their position
  2. on next tick, client will replay all saved moves buffer
  3. doesn't this instantly create another large location delta, which would trigger another position correction? whats the point of replaying
    @graceful flame
verbal tendon
fathom aspen
#

I'm in such one, take it back CatGun

verbal tendon
graceful flame
young spoke
#

thanks though

graceful flame
#

I’m not sure what the answer is

twin juniper
#

Is it good or bad practice to override parent RPC's?

weary mason
#

to trigger absolute server travel via console command should be like "servertravel MyLevel?bAbsolute=true" ?

quasi tide
#

(I don't have the kek laughing dog, that's the one that I really wanted to use 😭)

fathom aspen
fathom aspen
#

It's true by default afaik

twin juniper
sinful tree
surreal arrow
#

is it anymore difficult to setup multiplayer with IOS or Desktop? Or just minute changes?

fathom aspen
#

That's why you have the prefix

twin juniper
twin juniper
weary mason
#

@fathom aspen controllers are not receiving an end play event nor a reset event so i thought it cause it not an absolute travel

fathom aspen
#

That has nothing to do with absolute

#

That has to do though with seamless travel

#

Most probably they are persisting

weary mason
#

@fathom aspen so if i want relative or absolute server travel via console command how do it do it ?

#

servertravel somelevel?absolute and servertravel some level?relative ?

robust oriole
#

Hello #multiplayer , it is i again. Today i have come to converse about level management in multiplayer. I would like my game to support a multiplayer mode, where one player acts as the remote host in "listen server" mode (probably). I would like players to be able to be in separate maps, like one player being in a town, the other leaves town and goes to the forest. now one is in the town map and the other in the forest map.

From my understanding, in order to implement this, the host player would need to have a persistent level loaded to which both the local host client and remote client connect. It would then load the sub-levels into the world far enough from one another so players dont see the other maps. Is that correct?

#

If one player would hit a level transition trigger, that trigger would then have to call to the server via an RPC to tell it to load the new map, wait for that to happen and then move the player in question to the end point of said map

verbal tendon
#

or you can place them into enclosed cubes next to one another

#

In this modern day and age just place them all in one large map

#

World partition is your friend

valid bough
#

Question, can you attach a weapon client side to the camera but server side attach a weapon to the player? (FPS game) is that how it works?

verbal tendon
#

You use the visibility bools on the separate actors

#

Hide the 3rd person weapon locally for the owning client

#

Only spawn the 1st person weapon for the owning client, or hide it for everyone else with OnlyOwnerSee

#

Or you simply let the ABP do the work for ya with one actor

#

There is also the third option where your camera follows the 3rd person mesh and you don't have a FPS camera per say

valid bough
verbal tendon
#

I don't recall the titles, but a few games have done this

fathom aspen
# weary mason <@393501253184913418> so if i want relative or absolute server travel via consol...

You can't (and you don't need to), not even that you do in BP. But again the reason is that you are seamless travelling and you have similar classes of PlayerController in the old and new level's GameModes. If you say, force the seamless travel to be absolute then there's a high chance of having a failing travel, because an absolute travel flushes the whole URL and seamless travels occur for the same connected server.

TLDR: either change the new GameMode's PC class so it's different than the old's, that way PC doesn't persist, or just hard travel.
P.S: read the latest pinned message/article to get the full context

verbal tendon
#

It gets complex because you need to manage the reference to the actor

#

as everyone else needs to see projectiles and VFX spawn from the 3rd person weapon, but owning clients on their FPS one

#

It is however the approach that is most easily implementable with limited resources, it only takes your time

valid bough
#

I see, because I know that the templates and stuff or the UE4 multiplayer shooter i think uses one player and then just replicates or uses a weapon mesh on the character and updates it accordingly for the client

#

I just dont wanna do that I'd rather just use the weapon in game and attach it to my player

verbal tendon
#

The Lyra project shows the third option

#

But I don't suggest building anything on top of Lyra

valid bough
#

Okay I will look at that as a reference

twin juniper
native vector
#

can some one explane me why this is working ? but if i remove delay and spawn actor on the same frame and try to attatch actor to it its just fails to do it ?
code:

#define Delay(seconds, ...) \
    FTimerHandle __tempTimerHandle; \
    GetWorldTimerManager().SetTimer(__tempTimerHandle, FTimerDelegate().CreateLambda(__VA_ARGS__), seconds, false);
....
Delay(1, [=]()
APartGrupe* G = GetWorld()->SpawnActor<APartGrupe>(partGroups[0][0]->GetActorLocation(), partGroups[0][0]->GetActorRotation());
UKismetSystemLibrary::PrintString(GetWorld(), "BuildPartGrupes Log: Attach loop started | parts count in Groupe =" + FString::FromInt(partGroups[0].Num()) + " |");
    Delay(1, [=](){
        for (size_t i = 0; i < partGroups[0].Num(); i++)
        {
            partGroups[0][i]->AttachToActor(G, FAttachmentTransformRules(EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, true));
            //partGroups[0][i]->SendAttachToActor(this, G);
        }
    }
)```
#

i have feeling i'm working around a bug for some reason idk

verbal tendon
native vector
#

server

#

only

#

and runs 5s after start of the server

verbal tendon
#

Again.. not where it is being called

#

Where is the code that calls this?

#

and 5s after start of servers seems like an arbitrary time, chosen for the same reasons? Delay to hide the problem instead of fixing it

#

Assuming here, cos lack of context

graceful flame
#

Instead of using a fixed delay to wait for stuff to load its better to set a timer by event with a short looping duration then clear the timer once the thing you're waiting for is ready.

verbal tendon
graceful flame
#

Since the amount of time it takes waiting for something varies

verbal tendon
#

In most cases people don't know what they are waiting for, but just observe that a delay "makes things work"

#

Figuring out why something isn't working is the crucial part, proper diagnostics

native vector
#

@verbal tendon more context ok

verbal tendon
#

Can you copy paste the text please? The screnshot font is too small to read for me

quasi tide
verbal tendon
#

gonna be back in 30 and look at this again, the more context the bettter @native vector

native vector
#

ok calling ForceNetUpdate(); on part(actor with will be attached) look like it fixed the AttachToActor issue

verbal tendon
#

I'll code review later

#

the most improtant problems

native vector
robust oriole
#

I've got a gameplay ability that runs server side, and interacts with some actor components. The ability tells the component to do some stuff server sides and waits for it to finish. In the run of that, the component changes some actor references up that i need replicated to the client's version of that component. I'd like the ability to wait for the replication to the client to finish before it continues. How would i go about doing that?

#

tl;dr "how do i wait for replication of an object to finish in blueprint"

#

does this function do that? if so does it do it for the object its being called on, or in general?

#

nvm that node doesnt do what i am looking for Sad_bread

verbal tendon
loud cove
#

There is PostNetInit:

Always called immediately after spawning and reading in replicated properties

Can someone confirm my suspicion that PostNetInit is only called on clients?

verbal tendon
# native vector press on image and open original<:lul:311580125487693825>

A - return; no need for else. You want to avoid indentation to keep code readable
B - size_t is unsigned. If the if logic is executed when i==0 all other elements in the array get skipped. Hard problem.

  • Assuming order is not important, use RemoveAtSwap or whatever it is called, it swaps to the last position and simply shrinks the array, rather than reordering all elements
    C - unneeded if, you literally removed those in B
    orange C - shoulda been D, hidden, can't review

Your function is way too long and indentend and it even continues, you need to split your code up better so it becomes more readable and maintainable. Use comments. That's the quick glance things.

shy gust
#

https://www.youtube.com/watch?v=26qWNLrRfn8 this is the only thing i could find , i have no idea if it still works but im actually looking around for information on the same thing

Simple Physics replication component that syncs location, velocity and rotation. Might make a tutorial on it later...

Link to the plugin : https://drive.google.com/file/d/13lCTFmj7xEUvANfssSI0imEs628JcQ8o/view?usp=sharing

Also if you want a more professional way of doing this use SmoothSync from the unreal marketplace, its made in c++ and has ...

β–Ά Play video
#

ive made a Raycast physics based character controller, but i dont need complex physics interactions between other vehicles , its more so just to view the physics and movements of other players, so im assuming its possible to disable physics on anyone that isnt the local player and just send the transforms for everyone elses vehicles. but i havent actually tried it in Unreal , this method works in Unity tho

dark edge
#

The hard part is when I say I hit the ball, you say you hit the ball, who really hit the ball?

#

It's all easy UNTIL you need interaction/collisions between player-driven things, then it shits the bed. Go ram another moving vehicle in PUBG for instance.

shy gust
#

couldnt you have a client send the collision info for validation to the server , then the server read the connecting clients collision info and if it doesnt receive it , kick from server? or something along those lines,

real ridge
#

guuuys I have hilarious problem XDD I refactored my code so my plane after joining session is spawning by this blueprint in GAMEMODE after on post login but when I spawn my player like this I dont see each other in game can be problem in that that I am not doing RPC on that spawn?

#

thanks

dark edge
#

Send the client input too

#

I only send input, then simulate locally, and simulate on server. Server is authoritative over the general movement of the vehicle but doesn't replicate little stuff (wheels etc)

#

So I simulate everywhere, but server's version is what you see reflected in the actual movement

#

Built in replication but tuned to be less strict

#

still strict enough but I don't care about 1cm error when my vehicles are the size of tanks

shy gust
#

I hope smooth sync is enough to keep fast moving vehicles in check, im trying to make an arcade racer with physics based raycast vehicles

split siren
#

Any tips on creating CIV style movement pawn? Basically just hovering and dragging yourself across a map.
I would normally not replicate the movement, but since using Replication Graph, the position of the camera/pawn is quite important to cull stuff outside of the vision.
Since there is no way to cheat with the pawn location, I have CMC set to client-authority mode.

I dunno if I am approaching this problem from a correct perspective. Maybe not using CMC and just sending periodically the location from client->server would be enough. What do you guys think?

verbal tendon
#

you go from hex to hex, you set the target hex, you let the animation do the rest. Sounds like a lot of overcomplication thinking

#

You can go as simple as interpolating to target position

#

make sure your logic is in a class that handles the hex-movement, forget world position

#

that's all fluff

#

you only care about your hex movement, you get a world position from the logic that drives your hex-based world

#

and simple use that for displaying visual stuff

split siren
verbal tendon
#

Or it might be unclear what you actually want

verbal tendon
#

I haven't checked it out myself, but looks like it might have some goodies

split siren
verbal tendon
#

Camera's on the list in that github, I'd be surprised if it wasn't covered properly

split siren
#

True, because I actually have it as flying character. I understand pawn would be much better, but there were some legacy reasons

verbal tendon
#

I'd imagine it just uses the mouse input and translates it into movement

#

There's nothing too fancy about that

split siren
#

I still need to keep the server informed about the location of the camera though.

verbal tendon
#

Why?

split siren
#

For network culling

verbal tendon
#

Only if it's actually a performance problem, wouldn't you just use relevancy?

split siren
#

As mentioned, I am using Repl Graph to heavily cull the units that are on the map. If they are not even in the cone of vision, I need to discard that

verbal tendon
#

ah right sorry I skipped that

split siren
#

I am spending 80% of the tick just handling networking

verbal tendon
#

πŸ€”

split siren
#

Even with Rep graph fast path

verbal tendon
#

Is this with minimal, normal or stresstesting max units on the map load?

split siren
#

I would say normal, as this load is expected. +- 250 players

verbal tendon
#

That's a lot of players for an RTS game πŸ˜„

split siren
#

Basically 99% of them are on ground, and few have CIV/Starcraft view of the map giving commands.

#

But that is a lot of data to send/process without heavy culling

verbal tendon
#

Ah there we go more clarity πŸ˜„

#

sounds like that FPS where there's one commander that plays an RTS-like game with a bunch of grunts shooting on the map on the ground FPS

#

So the trick here is

#

that you don't need real-time replicated data from all the grunts

#

you can have periodic lower-frequency updates from them

split siren
#

It's not turn based

verbal tendon
#

I understand

#

instead of getting immediate replicated positions from all 250 players that are fighting on the ground

#

they give you lower frequency updates with their positions, to update the commander map

#

they simply ping their location every now and then, much less traffic than with replicated movement

#

but still enough to have fluid movement for eye perception for the people in the command chair

dark edge
#

just make a pawn with a camera on it

split siren
#

Maybe for a very far zoom, but in most cases I want to use the replicated movement and standard replication for the characters on the ground

split siren
#

For network culling?

dark edge
#

network culling should have zero to do with the camera location

#

if you're talking fog of war

olive crow
#

if a variable is set to repnotify and it is changed on the client does it call the onrep_variable() on the server/other clients or does repnotify only get called from the server if the variable is changed on the server?

dark edge
olive crow
#

ah that's good to hear thanks

dark edge
#

if it's a BP repnotify it'll fire because BP repnotifies are really OnChanged callbacks

split siren
dark edge
#

The only way the server knows anything is from a client-> server rpc

split siren
olive crow
#

so changing a variable on a client should not be replicated to the server if the variable is repnotify then right?

dark edge
#

You'd only wanna cull for cheating

#

and that'd be done vs fog of war

dark edge
split siren
#

I dont' have a turn based game though, it's more of a Fortnite with few commanders that see the whole map

olive crow
#

ok thank you

dark edge
#

In that case then yeah you'd probably think about that.

real ridge
#

guys I am having problem I dont see this log printing anywhere I need check what team does player have but I cant because when I am setting their teams and spawns its not working correctly idk why

#

its in game mode

split siren
dark edge
#

Are you talking about moving the commander's viewpoint or the things they are commanding?

#

If it's their viewpoint I'd just tell the server where you are and what your view frustum is

split siren
#

Commanders viewpoint, aka the human player in Starcraft.

dark edge
#

the server can optionally say "nope" if it's in an area not allowed like fog of war

split siren
#

No fog of war

#

No way to cheat with just movement

dark edge
#

Yeah then just spam at the server "Hey I'm here looking this direction at this zoom"

#

But this sorta smells like premature optimization

verbal tendon
split siren
#

They could get to ground level

verbal tendon
#

Usually commanders have a far-removed long-range view over the entire map, rather than a close look

#

So their altitude can change and this changes their zoom level?

split siren
#

Yes, the closer they get the higher update rate will the units have, but the fewer units should be replicating at that point, because the commander is zoomed in, thus smaller area to view

verbal tendon
#

is their viewport static? can they change the angle or do they always look down on the units unless they're on the ground?

split siren
#

I was thinking very much a CIV style zoom. Mostly static angle with a bit more tilt towards the ground

verbal tendon
#

I don't zoom too much, I'm always zoomed out so I don't know how it changes when you zoom closer

#

but I get it from what you're saying

#

again unless you can actually zoom in close enough to see the units's individual limbs move, there's a lot of optimization potential

#

I wouldn't fuss about the commander movement, I'd put my time into getting the network culling right

#

as that's where your bottleneck will be

real ridge
#

Guys I am saving my team in menu where I have same game mode as game mode in map and I have same player state there but immediatelly when I join session this information is getting deleted in new map? why when I am with same pplayer state etc

split siren
verbal tendon
#

The concept you're describing is quite unique

real ridge
#

i am using exactly same game mode and player state also player pawn but its getting like deleted when I join session

#

what can be problem

#

i thought its good way to store variables in player state as they are replicated

verbal tendon
#

Personally I'd put in restrictions that'd make my life easier, but then again, I'm acting on limited information, so to be taken with a grain of salt

verbal tendon
#

So that makes commanders not a problem for scalability anymore, and you only worry about getting the culling right for players on the ground

real ridge
#

okay I will try find solution somehow by myself then πŸ˜„

split siren
real ridge
split siren
verbal tendon
#

πŸ˜‚

split siren
verbal tendon
#

Real world example: we burn garbage to generate energy

#

use the newly gained energy to do it right πŸ˜„

real ridge
#

but I can use game instance instead of player state

#

it persist always

#

and it will be solved.

#

...

split siren
verbal tendon
#

I gotta grab some sleep, it's almost midnight here πŸ’€

split siren
verbal tendon
real ridge
#

idk why its getting deleted

#

I have same game mode for menu map and for session map too

#

currently I tried use GameInstance instead of player state

#

for storing this

#

we will see

#

now I am in lobby u can see on the left team is blue

#

going to join game

split siren
#

But player states or even game state is not persistent when you travel on server. The new game mode just creates new player states AFAIK

real ridge
#

okay It persisted till session with game instance

#

okay so I will use game instance for these stuff

#

sad I thought when I have same game mode it will persist

#

its quite uselles then

#

thank god for game instance

split siren
#

You could store stuff in game instance, but please make sure you are doing that on the server side.
Secondly, creating a subsystem would be a cleaner solution

real ridge
#

I need store team for player for him

#

to know

#

also I am using eos what subsystem do you mean

split siren
#

Your own subsystem

real ridge
#

why I should do it kekw

split siren
#

As mentioned, it is a cleaner way to separate your code. If you put everything into Game instance, it will be a mess.
Why server side? Server side needs to keep track to which team it assigned the player. Otherwise the player can just lie about which team it was assigned to. Never trust the client

#

kekw

real ridge
#

okay but i cant store it before game starts as you can see because I get deleted player state and even game state

#

so every player need know what team he belongs to

#

and then I can store it in session to player state or game state

#

but I need pass it via game instance

split siren
#

The game instance is persistent on the server too. The server has it's own game instance, so you can store the teams there. And you know you can trust it, because it was created on the server.

real ridge
#

ah okay I got it

#

but when I want use it on server game instance I need use custom event with call on server

#

?

#

or ?

split siren
#

Use what?

real ridge
#

if i want store those informations in game instance on server I need call it via custom event called on server ?

#

sorry its midnight here maybe I am already dumb

split siren
#

Server should store the data there, not the clients. NEVER the clients.
Server generates who belongs to which team and stores that in a TMap or TArray on server.

real ridge
#

I understand you

#

but how store it on the server is my question...

#

if I need call rpc or what

split siren
#

No

real ridge
#

or how to store it on "server" game instance

split siren
#

On server, you call write stuff into a variable (which is in GameInstance).
Cast<MyGameInst>(UGameplayStatics::GetGameInstance(this))->Teams.Add(TeamID, Player)

#

On server, just grab the game instance

#

and write to a variable there

real ridge
#

and via blueprints its available too?

split siren
#

Yes, but if you are dealing with networking I would recommend C++

real ridge
#

i am using it 50/50

#

sessions login etc is in c++

#

and easy stuff in BP

#

and I dont need code storing variables via c++

#

no reason

split siren
#

That means you will never be able to get the player teams on CPP end though ...

#

Anyhow, I think you got the idea about storing data on the server.. GL

real ridge
#

but I dont need this in c++ for now

split siren
#

Unless you do some hacky CPP getters, you cannot use variable declared in BP in CPP. It's a one way street

real ridge
#

dont worry πŸ˜„

hushed rain
#

Problem: Need to remove UI element on [Event AnyDamage] on ONLY client, but since AnyDamage runs on server it removes the server's UI element when the client takes damage.

How do I remove the UI on only the damage receiving client's UI? I've tried has authority/run on client but it still removes on server O_o

plucky prawn
hushed rain
#

nvm got it

dense forum
#

When a client is connected to a dedicated server and want's to leave to a random single player map via a widget button on a menu by OpenLevel(By Name) Node, How come it works in StandAlone but when the client is connected to the server and tries to use it, it simply rejoins the dedicated server it's already on?
I think maybe i'm not destroying the session??

obsidian basin
#

I have a general RPC question I've been curious about. So let's say I code up a damage function. My character shoots your character. My character, on hitting tells the server "Hey, I shot this guy."

Server takes the target, figures out the damage (based on my stats or weapon or whatever) and assigns it.

How does the Server know it's valid? In other words, how does it know I really DID hit it.

formal path
#

what do you mean with know it's valid? are you relying on unreal's network validation or do you want to write you own additional validation

obsidian basin
#

I'm not sure - this part of MP is still sort of nebulous to me. I know that on my character, if I call an Event on the server - I can put something like "Damage Targetted Actor" but I don't know how the server knows I'm not trying to cheat. It seems like there's no safeguards, but maybe my understanding of UE server is still limited.

formal path
#

nobody is going to hack your personal project, so theres no real reason to worry about security πŸ˜„

obsidian basin
#

That's not why I'm curious, I'm curious because I want to understand the systems better.

#

Like, it seems to me it would be more secure that when you press 'fire' - it actually runs the raytrace on the server, rather than running it locally and saying "I hit x"

formal path
#

that would mean replicating all the actors across the servers

#

so you would have a client with a player but on the server a replication of that player actor would also fire

obsidian basin
#

So the validation is basically the sever doing exactly what the player just did and then verifying it's right?

#

In laymens terms

latent heart
#

Pretty much.

formal path
#

you wouldn't send a hit event from the client

#

you would calculate it on the server

#

cause its easier then doing time warping calculations to account for latency

latent heart
#

Yeah, it's earlier in the chain. Both the client and the server would "fire", but only the server's one would actually do anything. The client would just simulate it, expecting a similar/successful return from the srever.

obsidian basin
#

I think I see what you mean.

formal path
#

have a look at how they network the physics in rocket league

obsidian basin
#

Thanks, I'll take a look at this later this evening.

#

I feel like I'm getting a grasp on 'how to do X' but I'm interested to know 'why is x done this way' to better improve myself.

formal path
#

unreal might not be the best example in many cases, it can be very hard to understand what is going on, writing your own stuff from scratch is great for learning

obsidian basin
#

Also 20 years in AAA sort of has me wanting to make stuff as tight as possible lol. I know no one will hack my side projects, but it's just behaviour ingrained in my head now.

formal path
#

how much are you getting after 20 years πŸ˜‚

obsidian basin
#

Well it's 20 years of working on a proprietary engine so this is like starting from scratch πŸ˜„

formal path
#

hahaha i meant in forms of compensation for working on it

obsidian basin
#

Oh nothing, this is purely my own interest. Again, 20 years of proprietary means if I ever need to move to a new studio, I'd like to be up to date with one of the biggest engines.

Plus I just like making my own stuff on the side. Lets me build things I can't otherwise.

raw umbra
#

/portfolio freelance

torpid girder
#

oh boo! LogProperty: Error: Replicated TMaps are not supported.

plucky prawn
#

Make an RPC that takes the key and value instead then in the implementation set those on your map

runic sage
#

I am missing Development Server as a build target, any ideas?

torpid girder
plucky prawn
#

you also need a source build of unreal to use it if you didnt already know

torpid girder
plucky prawn
torpid girder
plucky prawn
runic sage
#

@torpid girder @plucky prawn thanks for responding, yes I have the source and I have a server target

torpid girder
#

glad i was right πŸ™‚ makes me feel better, πŸ˜„

plucky prawn
runic sage
#

you mean regerenerate visual strudio solution?

#

yes

#

AH damn, i found the problem

#

the code is broke

torpid girder
#

oops

runic sage
#

Thank you ❀️

torpid girder
#

you know, if you are working alone, being able to ask a question here has been invaluable

proud gust
#

Hello
When a Client connects to the Server, ”AgameMode::PreLogin” will be called and this will give the GameMode a chance to reject the connection.
If accepted, the Server will then call β€œAgameMode::Login” and so on

How can I decide whether the connection is accepted or not???

I want the player to be able to join only if certain requirements are met. Thank You πŸ™‚

fathom aspen
#

What decides is the ErrorMessage param. If empty then connection accepted, if not then rejected.

glass vector
#

If I use an RPC call, RPC server call for example, and one of the inputs is an actor class, if the actor class has lots of variables etc, will it take up more bandwith space when sending the RPC call?

weak linden
digital marten
# weak linden I presume what you really mean is an *"instance"* of an actor? But either way, n...

Expanding on what Kamik said: variables only take up bandwidth if they're replicated. Sending a pointer to an actor over RPC does literally what it says. The RPC sends a pointer which is essentially a memory address to a thing in memory. In your case it's an actor.

I haven't done enough myself yet to know how everything in unreal works, but I wouldn't send a pointer of an Actor via RPC because it's a memory address on a local machine. If another machine receives that pointer and tries to read it, it'll point to something different in memory.

woven basin
#

its basically passing a 'reference' to the actor, not the full actor itself