#multiplayer

1 messages · Page 686 of 1

bitter oriole
#

Without source code in project, which is mostly true ; not without source engine (unless you somehow need dedicated servers), nor without engine changes (unless UE5, probably)

grim delta
#

Was hoping for shortest route to simple login and 3 or 4 ppl in a walk around and chat server, no crazy physics or rapid update required, other than chat.

#

Hosted either at home/work box or AWS if that would be easier

bitter oriole
#

Dedicated server with a simple fps template and chat is quite easy, just need to rpc a text to the server and multicast it back

grim delta
bitter oriole
#

Just because it exists

grim delta
#

ah ok, so 3rd person also good

#

Because network sync performance is not so critical for me (i hope) as its walk around and chat, im thinking of just buying a template UE4 and see if it works. Plan B is do more tutorials.

#

I looked at Cognito and OWS2 but i think they are still above my skill level

bitter oriole
#

Just need two rpcs here

grim delta
#

How many hours would it take and experienced dev to put together, Login, chat, server/client, Load Menu if i try find and pay for a dev

bitter oriole
grim delta
#

Whats easier, specific IP im guessing?

bitter oriole
#

Steam

grim delta
#

Steam is easiest? But can i publish tiny demo to steam. Sounds hard

bitter oriole
#

Don't need to publish it really

boreal crag
#

hey

grim delta
#

Ok thanks i found a Devaddict tutorial in UE4 for steam, ill give it a go. You have been real helpful.

boreal crag
#

so i need some advice

#

I'm not new to unreal but I'm super new to multiplayer

#

so where should i start from

kindred widget
#

@boreal crag Learn the difference between Replication and an RPC. Learn the difference between what RPCs can be sent from which machine and how they're sent/dropped/ranlocally (Learning this requires understanding ownership on clients). Learn the game framework from a multiplayer perspective (GameMode/GameState/PlayerState/PlayerController). Once you get a decent grasp on these core things, the rest is largely just tools and deeper learning.

boreal crag
twin juniper
#

hi hi 😄

#

how can i make an online dedicated server game without losing money on the servers ? ps i want the game to be free 🙂

#

i hate microtransaction

#

and dlcs

#

just want my game to be played by thousend of people

#

no child has to feel the abuse of the big moneymilking industry

chrome bay
#

Don't use dedicated servers is the answer really and/or distribute your server binaries and have players host them themselves. Lots of arguments for not doing that though.

twin juniper
#

and bring your acc with it afcourse xD

chrome bay
#

If you want dedicated servers you will have to host some official ones yourself, which will cost you money - and a fair bit of it. The trick is to make enough money from the game to pay for it (which most people will never be able to achieve)

twin juniper
#

thats why i learnt epic xD

twin juniper
chrome bay
#

The best multiplayer advice you can get is, make a singleplayer game.

kindred widget
twin juniper
#

bud... when i dont listen and think like what the heck i just do it, what or how will you do it ?

#

its kinda like the game that i can play day in day out and for that i am willing to pay even 150 euro per month for servers , also is it okay to ask this here? im not that clever and almost always get banned for asking the wrong questions

chrome bay
#

MP on any real scale is impossible without time, money and an experienced team behind it.

twin juniper
#

u're not hosting a minecraft server

twin juniper
#

okay so its going to be hard to make it all happen,, can i get some more info please? 😄 just give me the hard reallity, no matter what i have to do it no matter the milestones and mountains i have to climb

rich locust
#

you will hit a bump with character movements looking not great

kindred widget
#

Really with Jambax on the scope though. Seriously. Unless you have a few dozen grand laying around to start putting a small team together for a few months or to hire a freelance studio, you're really better off starting singleplayer. You can't just make a multiplayer game. You really have to understand the engine inside and out. You have to know it's limitations and implementations. And that's just for a small 2-8 player game. You are not going to make a multi-world game on your own. At least not with enough lifespan or sanity left to enjoy it.

twin juniper
#

i get it a little bit now,

#

even when i do it on my own then, the assets of mine will be outdated only the new type of game im thinkig of will be new

#

thanks for the reality check

#

gone think of what i really want then

sullen steppe
#

I'm having trouble getting a dedicated server running. My game is working as a listen server on LAN and online and the dedicated server only let players join from local machine when using shipping build, switched to development build config so it shows the log now but can't connect at all anymore

twin juniper
#

okey know i know what you all mean xD sory laran wish i could help

sinful marlin
#

So it turns out the animation was 'playing' on the server, but not actually animating the skeleton it seems? My AnimNotify State's were still firing on the server, but the skeleton just wouldn't animate. Skeleton Mesh > Optimization > Visibility Based Anim Tick Option > Always Tick Pose and Refresh has it animate properly

#

But the AnimNotify State's don't seem to fire on the client 🤔 nvm

rich locust
#

its not a replicated component

#

how would a client know if it is triggered if it is triggered on server

#

if it is not replicated

chrome bay
# sinful marlin So it turns out the animation was 'playing' on the server, but not actually anim...

When animations are playing, some notifies are still triggered - but no bones are actually moved. Computing final bone transforms and skinned vertex positions is the expensive part of animation, which is why generally you don't do it for something not "on screen" or "rendered". Also since dedicated servers are usually single-threaded, you don't want to slow down your game/network logic by computing that.

sinful marlin
#

Oooo makes sense. Nice to know 👍

glacial stump
#

hey guys, i'm just learning multiplayer shenanigans and I'm not sure I understand completely the Client->Server RPCs

I have a pickup in my world and I would like that when my Client overlaps it, the server sets some flag inside the Client and the Client then can react to this change
(Basically Client overlap pickup -> Server receives event, set flag on Client -> Client reacts to change)
My client is a ACharacter
I did read Cedric's PDF but something didnt click I guess

meager spade
#

@sinful marlin a lot of animations that require say bone positions actually use a fake position

#

so server knows what position without needing to animate

#

just need to do tricks, to get perforamance and functionality

glacial stump
meager spade
#

WithValidation is no longer needed unless you are doing validation checks

glacial stump
#

so im correct in assuming this is a ServerRPC ?

sinful marlin
meager spade
#

@sinful marlin you define the position, rotation is normally determinstic (ie actor forward)

#

or control rotation forward

#

@glacial stump that is a server rpc yes

#

overlaps run on both server and client (unless you gated it)

#

you just want a client rpc from the server to do something

#
void ClientSetOverlapFlag(bool bFlag);``` for example
#

server will run that on the overlapping character

#

but be warned, RPCs like Server and Client can only be done on a an actor owned by the player issuing the rpc.

glacial stump
#

I see!

meager spade
#

if you dont care for the server, why can the client not set the flag themselves?

#

as overlaps can run on client and server

glacial stump
#

well the overlap thing was just for the example

#

what I want to do actually is set the flag from the client's HUD

#

I thought overlap would be the same as interacting with a button on the HUD

#

in fact, I just wanted the server to react to a client event (button click, overlap on pickup) and the server to do something to the client

#

and the flag in that example would be changing some damage stats inside the client's gameplay ability

#

perhaps i failed in trying to simplify my use case

dense sundial
#

When trying to simulate a dedicated server I have things setup as shown below, and the number of players set to 2 but I see the 2 clients, each with there 2 windows, and then, what I assume is the server, who has no associated play window. How can I fix this so that server doesn't act as a player and just acts as a dedicated server?

dark edge
dark edge
glacial stump
#

thanks a lot !!

tired sequoia
tired sequoia
dense sundial
tired sequoia
dire holly
#

Hey! Just quick check - if using ReplicatedUsing then Replicated is no more needed, right?

chrome bay
#

correcto

#

ReplicatedUsing is a bit misleading really

#

but meh.. legacy

#

shame we don't have a big shiny new engine version coming soon that could have fixed some of these things 👀

bitter oriole
#

lmao

chrome bay
#

Looking at you APawn::PawnStartFire()

grizzled stirrup
#

StartFire as in shoot weapon?

#

Damn that's some legacy code 😄

chrome bay
#

oh yeee

dire holly
#

thanks 🙂

frank birch
#

I think I know the answer to this but I want some experienced developer backing me up:
Is it better to plan multiplayer from the start? or to try to finish the game and then slap multiplayer on? 🤔

meager spade
#

always from the start.

lost inlet
#

when has it ever been a good idea to add MP later

#

especially if you mean online MP

verbal tendon
lost inlet
#

maybe late gen5/early gen6, I think people should know better now

verbal tendon
#

The fact that engines have Multiplayer capability integrated from the getgo, rather than having your own inhouse engine that would either get Multiplayer capability towards the very end of the development cycle, or integrating something external like Gamespy, meant that Multiplayer was never a forethought and always an afterthought.

With it being readily available from day0, and also the evolution in how games are made means it is now much easier for it to be a forethought.

frank birch
#

Yep, what I expected and the same as google said. Just wanted to cover all my bases ❤️

west basalt
#

Is there a good spot for UI to be notified when the local player is created / exists in a networked game? I can setup a delegate that would work fine if the UI comes up before the player is replicated, but that can fail if the UI tries to come up after that event

#

I could always check for the existence of the player, was just trying to create something a bit more centralized across the UI rather then haveing to write the logic in each section

kindred widget
#

UI for what? Also what is player in this context? Controller or Pawn?

chrome bay
#

The actual ULocalPlayer always exists

#

If that's what you mean?

#

Or do you mean Pawn/Controller?

west basalt
#

main hud UI, with elements split off into sub UI, like a Quests lists, player health, etc, and Pawn

chrome bay
#

it depends is the go-to answer

west basalt
#

I could also be over thinking it all

#

heh for sure

chrome bay
#

Generally to avoid a race condition in the UI, you push out some global/easy-to-access event when those objects are created (e.g, BeginPlay, or PostInitComponents)

#

And the UI checks for the objects it needs at initialization time. If they aren't found, bind to that event.

#

But Pawns in particular can change often in an MP game

kindred widget
#

I also very strongly recommend you take a look into the AHUD class. It's a fantastic client only class that is created and maintained by the PlayerController.

chrome bay
#

AHUD is a very sensible place to manage all of your UI content, treating it as a manager of sorts.

#

And it's also very easy to access from classes like the player controller

west basalt
#

good advice! I may be off kilter because somebody else on this project started setting up their own kind of UIManager and Im stuck trying to work with it

chrome bay
#

The HUD IMO is the best place. You have a valid controller to handle proper ownership of widgets as a bonus, and it's very easy to access

#

The HUD itself can't exist without it's owning controller, since it lives there - so initializing your widgets from it means a) they have proper player ownership and b) the controller is garaunteed to exist at that time.

#

Can also specify different HUD classes for different game modes, so it becomes easy to change UI to match different game types etc.

kindred widget
#

Also. It's a little out of place I feel. But GameInstance has a delegate that runs after a pawn is possessed. OnPawnControllerChangedDelegates. I've never tried using that though. I dropped a simple delegate into SetPawn override in the Controller class and have it bound in my HUD to update pawn possessions.

west basalt
#

hmmm yeah digging around in this code some more, since they did not use AHUD as the base class (for reasons Im sure) they throw the HUD up too early (i.e. before PlayerController has SetPawn called on it)

#

should be easy enough to clean up and erase the edge case

chrome bay
#

Why on earth would they put it there...

kindred widget
#

First guess is ancient code. But I don't know anything past 4.24 😄

slim mist
#

Hi all, I'm getting a success on "join session", but the client isn't actually loading the new host level. Does anyone have an idea as to what is going on?

#

It is working on a new project I just made, but when I integrate it into a project I've been working on for a year this is happening lol

#

world composition is not checked

#

Nevermind, I got it working. Forgot to open the level as a host with listen in the options 🙂

verbal tendon
twin juniper
#

ON multiplayer basis how can i fix this ? XD

#

first of all i got like 80 buildings loading

#

i can make this what shall i click and what shall i do as settings ?

bitter oriole
twin juniper
bitter oriole
#

Depends on the scene, most large projects need to increase the defaults

lost inlet
#

how's that MP related?

twin juniper
#

ow wrong chat already asked here

drowsy pumice
#

Hey guys! I'm not entirely sure if this is the right channel to ask about this, since it falls under multiple categories, but here goes nothing.

I'm looking at the first person character template and cannot for the life of me find where/if the character system stores input. I noticed that the template has built in ClientsidePrediction and Reconsiliation, but cannot find how its being implemented. The only thing I've found is where the Pawn Sets the controller state apon receiving a replication(Screenshot). But this doesn't explain how in the case of mispredicting, the player reacts fine to the input that's still in transit to the server. Does anyone here have a good understanding of how this whole system works, cause any help would be greatly appreciated.

meager spade
#

it doesnt store input

#

client sends the data via the CMC (which is done on tick), via the move autonomous function

#

server uses the data and move itself and then sends to others for simulation

#

if server does not agree, it sends a client correct back, again throigh the cmc

grizzled stirrup
#

If a property in a struct is marked as NotReplicated but a copy of the struct is sent to the client via an RPC, is there actually any bandwidth savings going on there or will it still send the amount of bytes that property takes up in it's default state as part of the full struct being sent?

fossil spoke
drowsy pumice
grizzled stirrup
# fossil spoke Only Replicated properties are sent.

Interesting so the server sends a fresh copy of the struct but strips out NonReplicated properties entirely, saving bandwidth? I had thought it works this way for a regular replicated struct but didn't think client RPCs would work this way too

fossil spoke
#

You can further implement your own optimizations by setting up the struct with a NetSerialize function.

#

Take a look at FHitResult for example.

#

Or FVector_NetQuantize

grizzled stirrup
#

Thank you will do

#

How does it even work when the struct is sent in a client RPC, does the client re-create the NotReplicated vars locally to their default values somehow?

fossil spoke
#

Their values will be default initialized when the Struct is created

grizzled stirrup
#

So the client would create their own full copy of the struct and only the replicated props are copied in from the RPC behind the scenes?

#

Meaning there's not loads of bandwidth wasted sending the entire struct?

fossil spoke
#

More or less.

grizzled stirrup
#

That's greatl

#

Hugely useful when you have data that is much more easily sent as one package

#

But has some server only properties that don't need to make it down to the client

#

No need to make separate structs etc.

#

Keeps it nice and clean

slim mist
#

Does SetOwner not work for ACharacter? Is the only way to set ownership of an ACharacter is by possessing it?

#

To clarify: I need to perform an action on my ACharacter class, but only for 1 particular client in the server. This client does NOT possess the ACharacter. I thought I could do this by setting ownership of the ACharacter to the client.

#

For context, the ACharacter is a mech and the client is a different pawn inside of it

winged badger
#

it works just fine

slim mist
#

For whatever reason, Replication via Run on owning Client just does not execute

#

I've verified via a print string that the owner is the pawn that I am controlling

winged badger
#

you need to set owner server side

#

and for server/client RPCs doesn't even matter who the owner is, as long as top owner is the player controller

slim mist
#

Thanks @winged badger. AFAIK I am doing it server side, but no dice.

upbeat basin
#

Please let me know if I'm asking the question on a wrong channel or if I shouldn't send log files here. I'm overriding a blueprint RPC event that set as run on server from a child blueprint class. As soon as my code reaches to the RPC call node the editor crashes with the log below. It doesn't seem like it's happening on an empty project. Is there a way to debug/resolve the issue?

slim mist
oak oracle
#

Hey guys . I am currently making a game on Steam Online SubSystem ,A game is kind of an Business app , where people intteract, talk and exchange some job infos . And each player got some data like : email, phone number , company name etc. which they will enter during gameplay , and other players can see this info . So the question is , where to store this data online ? Do i need to integrate an external Data Base , or Steam got one ?

bitter oriole
#

You need your own database

oak oracle
#

By the way is there a way to do this project without Subsystems like Steam,Xbox etc . So Basically you just run your game and just play online , without any additional Steam or other softwares downloaded ? hope you got the point

bitter oriole
#

Sure

#

Though usually people download your game with Steam

oak oracle
#

my project is designed for office worker , and they dont really know what steam is , so they just download a packaged file from web site , install and starts to play .without any other extra soft downloaded . If answer is " YES , YOU CAN DO " . so how to do this ? by public IP addreses ?

bitter oriole
#

If you have an online database for details it sounds like that should also handle matchmaking etc

pearl moon
#

are player controllers (of type APlayerController or a derived class) replicated by default, or do I need to add bReplicated = true to the constructor of my custom PC class?

chrome bay
#

replicated by default

pearl moon
#

thanks! seemed silly to add it if i didnt need to 😛

quasi delta
#

Guys, When I travel between maps, the client cannot complete the travel process. is there anyone who can help?

verbal tendon
quasi delta
#

can u help me if u want

pulsar roost
#

I followed this ip based dedicated server example, and while I can connect via local ip, i can't for the life of me get it to work over the internet. I believe I have my 7777 port forward correctly, and have tried to connect from outside my network, but no go.. no registration of the connection at all in the server log. Anyone have any tips/pointers for getting this simple ip based dedicated server example to work over the internet: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/DedicatedServers/

How to set up and package a dedicated server for your project.

verbal tendon
quasi delta
#

ı wrote servertravel. Should ı write ServerTravel

#

I made like this it doesnt work for client

#

its working server

#

but not working client

#

@verbal tendon

pulsar roost
#

Can anyone recommend fastest/easiest way to make sure your 7777 port is forwarded properly. If i spin up my dedicated server and it says it is listening on port 7777, and I check here, it tells me it's closed. I've added windows firewall rule for udp for 7777 to always be open. I've port forwarded internal and external ports for both udp/tcp.. i have port forwarding software that tells me 7777 is open, but sites like this tell me it is closed: https://www.yougetsignal.com/tools/open-ports/

verbal tendon
# quasi delta

The client needs to be connected to the server first, and only the server does the level loading, it'll take all clients with it

quasi delta
#

It used to work but now it doesn't work so I don't think there will be a problem with the size of the map.

verbal tendon
pulsar roost
#

I want to use AWS only @verbal tendon

verbal tendon
pulsar roost
#

I am just trying to get it working locally on a static IP first, before the linux cross compile / docker stuff

verbal tendon
#

If you just need to test that your Multiplayer logic works, you can have the game running twice on your computer ( assuming you're doing manual connection, and not using Steam ), your computer's IP is 127.0.0.1 for connecting two instances that you run on the same machine

pulsar roost
#

The AWS stuff is honestly a whole nother layer i need to learn so hoping to park it here for the moment, and learn that later.

#

Yes the localhost with local ip connection with 127.0.0.1 does work

verbal tendon
quasi delta
#

ı rendering now an then ı will answer u but ı think mine 25+

pulsar roost
#

@verbal tendon I'm working with a few others on this project scattered across the globe

#

Just starting it though.

verbal tendon
pulsar roost
#

No, I have used steam before with multiplayer setups an steam pipe, and know my way around with multiplayer from the blueprint side.

#

Just can't get connected with this dedicated server so i can be on my way.

#

Is there a good list somewhere to check through for port forwarding issues?

verbal tendon
#

It's a thing of the past. If you absolutely need to use Steam you're going to need two computers on two separate networks. If you want to easily test on one computer you can look into setting up EOS: https://dev.epicgames.com/docs/services/en-US/GameServices/Overview/index.html which is cross platform

Epic Online Services (EOS) are free, cross-platform services created to enable fast, easy, and dependable high-quality game launching, operation, and scaling.

pulsar roost
#

But they all cost money? I guess i can move to AWS sooner. Would you recommend any online subsystems for use with AWS?

verbal tendon
#

There's no money involved, EOS is free to use

#

AWS will cost you though

pulsar roost
#

ok, i'll have a look at EOS.

#

Thanks for your help/suggestions.

#

@verbal tendon is there a blueprint ready implimentation of EOS?

bitter oriole
#

There's a plugin for that

#

But frankly dedicated server + blueprint only is just weird

pulsar roost
#

Understand. Then are there any good guides on getting the basic setup going with C++ available? I'm still beginner there so need guides..

bitter oriole
#

There's that plugin I mentioned, and the API doc

#

"beginner" and "AWS dedicated servers with EOS" are two foreign concepts

verbal tendon
#

Make a fun singleplayer game first using Unreal Engine

#

Learn C++ independently of UE

#

Once you have experience with both of these indepdently, start combining them. Then once you've had some time combining them, add a third element like Multiplayer

grizzled stirrup
#

Eh I learned C++ independently and forgot absolutely everything when returning to UE, it's easier imo to learn while doing in UE so translating BPs and stuff

#

But agreed that singleplayer + learning to code separate from multiplayer for sure

#

And learning the engine

#

There's a whole lot to it

verbal tendon
verbal tendon
grizzled stirrup
#

Basically learning loads of pure C++ tutorials kind of rolled off me, it was a lot of theory and not much practice and I was not motivated to make a compiler print out numbers and text. Learning it and making cool gameplay stuff happen in UE just was a much more visual way for it to stick with me, not to mention I already had a good foundation and games made with BP, so there was a lot of Aha moments when translating BP's that I already had working to C++

#

As I actually cared and practiced far more

#

Now I love learning about it much more

#

But I wouldn't have stuck with it otherwise

bitter oriole
#

Two things you really need to have a good grasp onto in C++:

  • pointers, specifically lifetime management / dangling pointers which is difficult to debug
  • using a debugger (which is surprisingly not common in tutorials despite being the way you normally work)
#

Rest is optional

#

Well, the rest just comes naturally

#

Lifetimes and scopes are probably another one but if you've got pointers down you probably got that too

#

Multiplayer code is a shitton more difficult than run-of-the-mill Unreal C++ code

grizzled stirrup
#

Interestingly I still rarely use the debugger even though I sort of know how it works. I find printing easier even though it's kind of dumb. I'm sure I'll run into problems where I need to inspect vars and step around but so far I haven't been hit with such a problem

bitter oriole
#

Printing is very fine and very relevant, but I don't remember when I last ran C++ outside a debugger

grizzled stirrup
#

I'm just not used to launching with the debugger at all, I always launch with Ctrl + F5

bitter oriole
#

That's just weird, you could press one key less and have the ability to inspect anything, get the full state immediately when you have a crash, etc

grizzled stirrup
#

Yeah I suppose I didn't like the idea of the debugger whirring and doing stuff in the background while I work on level design or whatever

#

It makes sense though

bitter oriole
#

In my experience debuggers are as much a rarity in gamedev land than they are "how you run a program" in the software industry

#

It's really weird

grizzled stirrup
#

Seems a lot of people rely on the print method for gamedev too I'm not sure why

#

I need to just get more comfortable with them

bitter oriole
#

Prints and debugger aren't exclusive at all, I have loads of logging in my game, and I routinely use logs for debugging - they complement the debugger nicely to get a history of what happened since the debugger doesn't have more than a snapshot

#

And hell, once you ship a game you become very familiar with debugging anyway since you only get core dumps back

verbal tendon
#

Printing information to screen is usually for issues that you are actively trying to track down. The debugger helps you in cases where you run into unexpected problems, and it lets you inspect the callstack and local variables when shit hits the fan. It's an invaluable tool.

shadow aurora
#

Is there any way for me to have a client RPC that doesn't execute in single-player haha? I only want it to send from server to client in the context of multiplayer

kindred widget
shadow aurora
#

Hard to explain over chat, but it's working the way I expected. Except for the fact that I really don't need/want the client RPC to be executed on a single player game due to some stuff that happens in the function.

kindred widget
#

Mmm. I mean you could just do a simple check in the function to not run if it reports as IsServer. Assuming that you don't need it for a Listenserver player either. Though there's also a straight Standalone check.

shadow aurora
#

Ahhh gotcha, I will look into that

#

Thanks dude

lament cloak
#

Seems like NetDeltaSerialize is being called every frame, this seems not right, right?

#

on a fast array

#

Searching for it here Jamblax says its called every time its considered for replication so maybe it's fine

sinful marlin
kindred widget
sinful tree
#

^ I heard that emote.

sinful marlin
#

I wish my college would teach Unreal, or at the very least, C++. It only teaches Unity and Java/C# 😦

kindred widget
#

Unreal is a little slow in that regard since it hasn't been community free for too long. Much less interest in it before a couple of years after UE4's 4.0 release.

sterile bridge
#

nt

slim mist
#

I set up a super simple version of ownership change that I am trying to replicate, but cant seem to get it to the owning client. Happy to screenshare it in VOIP if anyone has the time 😄

#
  1. Client on dedicated server interacts with button. Button grabs some arbitrary other actor along with the PC of the interacting client.
  2. Button sends reference of client PC to the arbitrary other actor
#
  1. arbitrary other actor verifies through print string that the PC is the client PC. It changes the owner. but doesnt get called locally on the client
stray badger
#

So when I start my dedicated server and have my friend successfully join. They cannot call any RPC's but I can. I don't understand why?

slim mist
#

My above example works when the arbitrary actor is a regular actor, but does NOT work when it is a character

#

it seems to require possession

#

is there any way around this?

sinful marlin
stray badger
#

Rpc is definitely being called on the server.

sinful marlin
#

What do you mean by "They cannot call any RPC's" then?

quartz iris
#

Hi guys, im trying to create a health system which works online. How could I replicate this code?

sinful marlin
#

Mark Health as a replicated variable. Then any time it changes on the server, it will automatically replicate the value for you

quartz iris
#

I have done that but the damage effects all of the players

sinful marlin
#

? If you marked your health variable to replicate, it will only replicate to the client instances of that object. I.e. if you got char A and char B, (and they're replicated) and Char B health is reduced to 80 on server, If it's marked replicated, it will make char B health 80 on all the clients.

quartz iris
#

Does the float variable need something to make it not be the same across all the clients

#

Or am I meant to cast to player 1 or something?

sinful marlin
#

a single characters should be the same across all clients, no..? Or are all characters healths being set to the same value?

#

Try checking if you are on the server at the beginning of that event.

quartz iris
#

I think they might be all set to the same value

#

I think it's detecting one player is in the box collision then setting all players hp

#

not sure how to fix

sinful marlin
#

Well I'm guessing that code's being run on all clients whenever that event is triggered (idk how you're triggering it), and so they're all reducing their health because get player character is returning the one they are controlling (i assume)

quartz iris
#

I think i understand

sinful marlin
#

Try throwing this at the beginning of your event:

quartz iris
#

Ok

sinful marlin
#

the is server and branch nodes. then have the rest of your code branching off the true output

quartz iris
#

is server checks if it's the client

#

?

sinful marlin
#

Judging by the name of the node, I assume it checks whether you're on the server or not? True means you are on the server, false means you are on the client?

quartz iris
#

I suppose

mellow umbra
#

Hey I was wondering how I can get the server to destroy the actor upon touched. Attached is my current bp. Someone said that I would need to get the server to destroy it for every client.

sinful marlin
#

Once you destroy a replicated actor on the server, it will destroy it on clients. So you should only need to call DieOnServer

mellow umbra
#

like the player who touched another player

sinful marlin
#

It doesn't matter, if an actor is destroyed on the server, it will be destroyed on all the clients it is replicated too.

mellow umbra
#

but what if this is running on a client

sinful marlin
#

If you call DieOnServer from a replicated actor that the client owns, it will run that on the server.

#

So if player a calls DieOnServer, it will make an rpc to the server, where it will run DieOnServer, destroy itself on the server, then destroy it on all clients.

mellow umbra
#

well this doesn't work on the client

sinful marlin
#

Because you are calling Die Client first. It's destroying itself before it ever make the call to the server

mellow umbra
#

after I remove it, it still doesn't work

sinful marlin
#

If DieOnServer isn't being called, then either the actor isn't replicated or the client doesn't own the actor making the call.

mellow umbra
sinful marlin
#

What is DieOnServer being called from in those snippets? Are you calling it from the character the controller is possessing?

mellow umbra
#

mhm

sinful marlin
#

and DieOnServer isn't being called at all? You're not seeing that print statement in the log at all?

mellow umbra
#

I see the print

#

not the die on server

gentle lion
#

put a PrintString inside the Die on Server event just to make sure the Server is getting it

mellow umbra
#

I did

sinful marlin
mellow umbra
#

it isn't printing

#

no

gentle lion
#

o i missed that

sinful marlin
#

🤔 where is this blueprint code sitting. Is this on your character?

mellow umbra
#

yes

#

the actor

sinful marlin
#

Show me what your plugging into the target for DieOnServer

mellow umbra
sinful marlin
#

What is the input object of that cast coming from?

mellow umbra
sinful marlin
#

Because if that object is not an object owned by the client, the server RPC won't go through

gentle lion
#

yeah thats a Simulated Proxy

#

im assuming thats the Character that you touched

mellow umbra
#

so what should I do

gentle lion
#

ideally code like this should run on the Server and the Server could just destroy the Actor no problem

#

does the hit event you are using also run on the Server?

mellow umbra
#

do

#

no

#

how should I run it on the server?

#

custom event?

gentle lion
#

you could but that is a huge security problem lol

mellow umbra
#

true

gentle lion
#

but if you dont care about that for this game you could do it

mellow umbra
#

how should I handle it?

sinful marlin
#

What you can do for now, is change your DieOnServer event to take an actor for input. Then pass the actor from your cast into that

#

and leave the target as self

mellow umbra
#

well he said it was a security issue

#

thats what I am concerned about

sinful marlin
#

Yeah, because what ever you are doing to "hit" the other players is done locally

mellow umbra
#

so how could I make it better?

#

its a LineTrace

#

so

gentle lion
#

you could do an Overlap event instead of a Hit event

#

as a weird solution

#

i think that runs on Server too

mellow umbra
#

LineTrace

#

runs on server?

gentle lion
#

wanna go in voice chat?

sinful marlin
#

oops its cutoff.

mellow umbra
#

yea that seems like a good bet

#

it runs on the server so

sinful marlin
#

You can just move whatever logic you are doing to do the hit into a server rpc.

mellow umbra
#

let me try it

sinful marlin
#

Player presses input -> Makes server rpc to do the "hit" -> Server does the hit -> destroys object hit

mellow umbra
#

it works!

#

thanks yall

#

multiplayer takes a bit to understand lol

gentle lion
#

ebic

sinful marlin
#

🥳

gentle lion
#

also the CapsuleOverlapActors node would work more closely as the hit event did

mellow umbra
#

another question

#

for ragdolling

#

only the server can see it and the client cant

#

can you create a custom event for ragdolling and have it run on the client and have it be secure?

gentle lion
#

absolutely there shouldnt be many security concerns RPC-ing from Server to Client

mellow umbra
#

gotcha

#

its me again

#

having another multiplayer issue

#

with my rotating heads

#

it works on the client

#

and shows to the server

#

but when the server rotates, the client doesn't update properly

#

that is all running on tick

#

and it is updated in the anim bp

gentle lion
#

i dont think you have any replication there

mellow umbra
#

I tried all the replications

gentle lion
#

the Server can see the Clients' because the Server is running this for each character

#

try it with 2 clients and check if they can see each other's properly

mellow umbra
#

no the other client is the same way

#

so the server and that client are the only people who see it

gentle lion
#

that makes sense

#

but yeah the engine already replicates the look direction in GetBaseAimRotation()

#

but yeah that would require some restructuring

mellow umbra
#

so how should I?

fluid summit
#

Hi! what do you all people think of abstract classes?.

I want to move some of my actors to just "Structs" of data and use an abstract class reference to process that data in diferent ways depending on wich subclass it's on.
ForExample: Struct with ref to class BaseClass. I can take the data struct into the abstract class and get some result.
Other class can be child of that baseClass and process the data with a diferent result.

I'm mainly trying to avoid having to spawn the actors in the game, but still rip the benefits of here inheritance

Do you think it's a good way to do something like that or do you know of some better?

gentle lion
#

here is an example

#

but only the Pitch is replicated

#

if you need Roll or Yaw then you will need to replicate those yourself (ideally by overriding GetBaseAimRotation() if youre using cpp)

gentle lion
mellow umbra
#

I need the Yaw

#

wait nvm

dark edge
gentle lion
#

Yeah it uses that but if the Pawn has no Controller (ie. it is a Simulated Proxy) then it uses the replicated pitch

grizzled stirrup
#

Is there any reason to use seamless travel instead of loading / unloading sublevels and have your multiplayer maps each be a sublevel in one persistent level if you don't need to change the GM or other properties when traveling?

ashen bay
#

Currently this implementation works to replicate Attach Actor to Component but would this be a good or bad way of doing it?

peak sentinel
#

You are sending too much data

ashen bay
#

That's what I figured

#

Any suggestions on what would be better, it's currently for showing the player's gun, which is a child actor component.

toxic lion
#

Odd bug on a Listen Server
I have two player starts located on the map
When I press play with 2 players, the server and client starting point is always random (not intentional, this is just what always happens)
It seems that if my client starts in the 'wrong' one certain functions aren't replicated
Anyone experience something like this?

glass vector
#

if i call get game instance from a client, will it get the clients game instance or the server's game instnace?

kindred widget
glass vector
#

does the player controller get destroyed when starting a new level? ie, opening a new level with a listen option

bitter oriole
#

Yes

peak sentinel
#

I remember someone said loading sub-levels on a client will cause loading that level on everyone, is that true?

gleaming kite
#

Does anyone know if setting an array element causes a rep notify?

pearl fog
#

Hey! Is there a way to uniquely replicate a variable to some specific connections? Like a way to do DOREPLIFETIME_ACTIVE_OVERRIDE but also taking into account each connection

kindred widget
kindred widget
pearl fog
#

i can't :/ for some context i'm using the gameplay ability system and in our game you can using a skill see other players health, so for now health is only OwnerOnly, but ideally I wanted to control replication based on which skill you have, but it may be a bad idea because it adds some dependency to the skill manager..

#

I think i'm gonna just use COND_None ^^

empty vigil
#

why is my camera component Z axis not replicated ?

twin juniper
#

Hello. I have some questions about 'onrep' variables. When is the 'onrep' function called? If I change an 'onrep' variable on server, will the 'onrep' function only trigger on server, or on server and all clients? If I change the 'onrep' variable on a client, do I assume 'onrep' to be literally 'on replication' and since there is no replication, it will only trigger on client?

bitter oriole
#

In Blueprint it's both

twin juniper
#

Different?

bitter oriole
#

Not equal to the previous one

#

And changing a value on server doesn't always lead to OnRep calls - if you change an int to 1, 2, 3 over a second, you will likely see 1 and 3 on clients

twin juniper
#

Why? Because it is slow?

bitter oriole
#

Because fast changes cannot be properly replicated in real world conditions and so they're dropped

rain quest
#

So im using BP and for some reason my player 2+ doesnt look around all of a sudden, can only move camera while either left or right mouse is held down, though the WASD does work. Anyone know what could be causing this???

Side note its not showing cursor, which is the first thing i thought it could be.

#

Solution: There wasnt a "set input mode game only" after closing lobby. Dunno why player 1 didnt need that nor why it was working before but its fixed now!

molten matrix
#

It seems like my OnComponentHit delegate is only getting called on the server when I expected it to run on both server and client. Any idea why? This is how I set it up in my constructor:

    StaticMeshComponent->OnComponentHit.AddDynamic(MovementComponent, &UMyMovementComponent::OnCollision);

Is it because I'm passing in a method of one of my components rather than on my actor? I thought that would be a nicer way to separate some of the movement related things into that component rather than the actor itself.

molten matrix
#

For your first question, I think you can put this in DefaultEngine.ini in Your Project/Config/DefaultEngine.ini:

[Core.Log]
LogNetPlayerMovement=Verbose

That worked for me for some other log categories.

toxic lion
#

I am still super confused here
When playing as a client, sometimes certain actions don't seem to propagate correctly, or certain variables don't seem to correctly replicate

for instance inventory. I press play, pickup an item, and I see that my inventory count is 1
I exit and press play again, pickup item, and see that although item is correctly attached to the player in the server and client world outliner, the inventory count is 0

The only correlation I've found so far is that it seems to depend on whether the player randomly spawns on one of the two NetworkPlayerStart points in the world (If starting on left one, everything replicates correctly, if starting on right one, issues arise)
But even this isn't consistent. Once I restart the editor, the 'bad' spawn point may now be the left one instead of the right one

#

Has anyone experienced something like this?

Edit: I think I've narrowed my issue down to a couple actors having some sort of blueprint corruption
These actors don't seem like they should be related (just random actors in the scene) but deleting them seems to stop this issue from happening. Placing any of them back in the scene leads to this issue happening again.

rain quest
#

Ok this is way to advanced for me to understand. But im doing a tutorial for Advanced Session. It doesnt say a version hust its 4.13 and beyond. So i put it in my 4.26 game, then it came up with not the right version, tried rebuilding but failed.

Anyone has a solution?

thick olive
#

What kind of tech stacks do MUD type games use, or the generic "non-realtime" multiplayer mobile game. You'd only be sending requests from each player like every few seconds. Would it be some kind of simple WebSockets server, or literally just firing off API requests straight from the engine and awaiting responses?

#

I imagine you'd use a BaaS like PlayFab in there somewhere

hollow eagle
#

I have no idea why you'd want to involve something like playfab in a MUD. At most you'd need a decent webserver, maybe a realtime websocket api like socket.io or signalr
But this is so far removed from unreal I'm not sure why you're asking it here.

thick olive
#

Because I'd probably build it in unreal. MUD was an example of non-realtime multiplayer... I don't know what term to use to describe it. PlayFab for user authentication, data etc.

hollow eagle
#

Ok, playfab's non-multiplayer services make more sense.

#

For non-realtime multiplayer the easiest way to go is probably something web-based for the server but tbh it doesn't really matter that much because it isn't realtime.

#

Websockets are a good way to deal with persistent connections in that way, like you said, and you could optionally use a library on top of it like I mentioned (socket.io or signalr) which provides a nicer api at least on the server side. For the client in unreal you'd be a bit on your own unless you can find a C++ implementation of their protocols (or roll your own websocket-based protocol entirely).

thick olive
#

Yeah checking out Socket.Io now, it looks nice. I also have no idea, but I am really interested in learning.

#

More research ahead 😅

meager spade
#

you could use steam p2p sockets

#

those are simple

thick olive
#

Yeah? Checking them out now

thick olive
#

Ah yeah cool. I'd want to send the packets to a server rather than a SteamID, wouldn't I?

meager spade
#

it depends on how you want to set it up

#

if you want dedicated servers, your own socket api will be needed

#

if you want to just communicate between clients, p2p is good

thick olive
#

Would be minimal client-to-client comms.

#

Its so simple that its almost like using UE as a web frontend, haha

stray badger
#

So I made system where a line trace kills a player, then the player respawns. This is all fully replicated and working great but I have one bug. If I kill player A then I kill player B before player A respawns, player A never finishes its respawn code so he just lays on the ground but player B respawns just fine. Maybe I could get some help?

eternal canyon
stray badger
#

True

#

I wish i could show somebody the pipeline. Its not complicated at all

#

Take 5 min

#

Im going straight from the player character to the gamemode

#

The code gets terminated as soon as the same procedure gets called on another character

heady python
stray badger
#

^^^^^ This is what's in the game mode

#

This is the player character^^^^

kindred widget
#

This needs to be a timer in the server version of the PlayerController.

stray badger
#

Can you call replicated events from the player controller?

#

Server version of player controller?

kindred widget
#

Why does it need to be a replicated event? This is all server authoritive spawning logic.

stray badger
#

fuck me

#

im dumb

heady python
#

oh yhea. delays are working against you here. if you have a delay running, then you cant call the event again, itll get clogged. so whats happening is the first execution is going through then the second execution is getting blocked because you already have the delay running.

#

if you put the respawn logic in the character/PC then you can have multiple delays running, 1 per character. The reason it cant be in the gamemode is because theres 1 gamemode so it cant run multiple delays without extra complications.

kindred widget
#

Yeah. Only way GameMode could handle this alone is with an map of controllers/deathtime that have pawns that are killed off, and checking it on tick or similar. Bit hacky though. Realistically this just needs to be a timer in the PlayerController. GameMode registers that a pawn was killed, gets the controller, calls an event on it that starts the timer. On Timer end, you can have that controller ask GameMode to restart it's character.

#

Best part is. If you do this in controller, you have an easy way to replicate a simple float of server time for death in the controller to the owning player. Easy way to display a time til respawn widget too.

stray badger
#

Thank you! @kindred widget I'll get to work

#

and @heady python

#

This is located in the playercontroller^^

kindred widget
#

Why are you sending the controller to itself? O.o

sinful tree
#

Respawn Player should have a "Is Server" branch check on it - you don't want players firing it.
The cast to player controller is completely unnecessary if you're already in the player controller.
The unposses target should just be a reference to "Self"
The "Get All Actors of Class" output you can just use a "Random" node pulled off from the output to get a random start spot.
You only need to get the game mode, you don't need to cast it.

stray badger
#

Cause i need the specific player controller of the person who i shot, not my own.

#

If i did what you just said it would kill and respawn me when i shoot somebody else

sinful tree
#

You should be calling this function on the player controller you're wanting to restart, not on the player controller that defeated it, and that should be done while on the server end.
ie. My client presses shoot button > RPC to Server target hit (depending on the type of weapon) > Bullet Hits Target Character > Server Subtracts Health from Target Character > Character's health is below 0, they are now dead > Server Gets Controller of dead character > Calls Respawn Player on player controller that is dead.

stray badger
#

Ahhhhhhh

#

Let me see what i can do

kindred widget
#

If I had to go to the front desk to inform them that someone I shot in laser tag arena was dead, there would be a lot of players never getting reset.

sinful tree
#

lol

stray badger
#

For some reason thats how my brain works

#

its a curse

kindred widget
#

You'll get used to it. 😄 Give it time and it just kinda starts to all fit into place.

stray badger
#

I built everything else from the ground up though lol

#

Alright its been fixed haha

#

You guys just taught me something so important

#

I feel like something just clicked

kindred widget
#

It's a good pillar of OOP to keep in mind. Don't make classes, or even instances do things that are better handled by something else.

stray badger
#

This feels so powerful

#

Never saw it like this really

quartz iris
#

@sinful marlin If the code is setup with the is server condition it only damages one player and the other cant take damage, whereas I need it to damage the player standing on the box collision

wanton shadow
#

hi

#

i need to connect dedicated server to database

#

what is the best solution for this

#

connect server directly to database

bitter oriole
#

No, you need a Web server that verifies connections come from a real dedicated server (to avoid third parties sending requests) and processes DB requests, probably through a simple json API

wanton shadow
#

or comunicate from unreal server to other server which is connected to database (node server for example)

wanton shadow
#

unreal not supporting connecting to database natively?

bitter oriole
#

Do you want your database to be publicly accessible on the Internet?

#

Do you want to write SQL queries in Unreal Engine - and push dedicated server updates any time you need to fix a query?

#

Do you want a dedicated server, when hacked by a cheater, to have full control over your entire player data?

#

Are you okay with players being only able to see their player data once they're connected to a dedicated server - after your main menu etc?

wanton shadow
#

i got the point

bitter oriole
#

All of these are likely "no" and are solved with an intermediate server that's read-only for clients with a verified API for trusted servers

wanton shadow
#

now another question

#

to comunicate with u server and let's say node server

#

what is the best model

#

http request or websocket connection

bitter oriole
#

Depends on your server tech I guess

wanton shadow
#

or other mq tools

#

like rabbitmq

bitter oriole
#

I'd go for https since that's like 5 lines in Unreal

wanton shadow
bitter oriole
#

Whichever tech you like more I guess, it probably won't matter much

wanton shadow
#

i need to ask onother question

bitter oriole
#

Depends on traffic of course, though for the average successful indie you're looking at a few requests per second

wanton shadow
#

now i had 2 levels world and city and i need chat to be available in both levels

#

if player A in city level and player B in world level how can they xan chat with each other

sinful marlin
# quartz iris <@!236695517600546817> If the code is setup with the is server condition it only...

At what point in that snippet is damage being applied? Also that Get Player Controller node will return the first player controller on the server. Idk if that's what you're going for or not, but if you are running a listen-server, that'll get the pc of the host, dedicated it will be the first player that connected (i think, i havent tested myself).

Also you shouldn't really be doing widget related stuff on the server. You want to do that stuff client-side.

wanton shadow
#

the problem not in chat

#

the chat will not in unreal seever??

sinful marlin
wanton shadow
#

i was having prblem with node server sending http req to the same server to be exec in php

#

and guss what this was making high traffic problem in server

bitter oriole
#

Servers can bulk the requests together, and it gets reasonable

wanton shadow
#

i have experience in web in general but have no experience in unreal

#

so i have some questions to start designing my network model

#

now, do i need to make chat server in node js or i can make it with unreal?

#

if unreal can handel the feature it will be good to use it

#

but i still can't figure out how the players from different world have chat

#

text or voice chat

#

not only chat many real time feature

bitter oriole
#

These aren't Unreal questions

bitter oriole
#

These are online architecture questions, really, ones that hint at a game with a team of 50

#

Lorash's got you a hint toward XMPP but then you probably want to prototype stuff to see if that's what you need

wanton shadow
#

ok i will read the network documents for unreal

#

thanks for helping 👍

bitter oriole
#

Seriously, this isn't Unreal stuff here

#

Unreal's networking support is for client-to-server and doesn't support chat or database servers directly - you need to build upon sockets, http, plugins

sinful marlin
#

Also, if you are talking voice chat there's a bunch of legal concerns/mandates surrounding that.

peak sentinel
#

What is the proper way for playing anim sequences in multiplayer? Can UE handle late joiners on its own while playing a runtime cinematic?

#

And how much data it's sending from server to clients? If I have too much objects changing their states in the sequence, wouldn't it bloat the bandwith?

mighty acorn
pure vigil
#

My brain is kinda going down a spiral and I need a sanity check. I have a lobby where players load in and select a character. I am using ServerTravel to transition to another map.

When the players travel, their GameState is re-used but the properties are lost unless I override CopyProperties, which is fine.

But in this scenario, where does it make sense to store the character each player selected? Should it be done in the playerstate with CopyProperties or should it be done in the server's gameinstance?

waxen socket
#

I have a question about replication efficiency.

Would it be worthwhile to replicate a GUID for lookup in an unreplicated array of actor references, rather than replicate the actor references directly?

Any advice would be appreciated.

Cheers.

bitter oriole
waxen socket
#

Really!?

#

I never would have guessed actor references were cheaper than GUIDs.

#

And if I could use an integer instead of an actor reference again for lookup, would that save me much bandwidth or is it acceptable to replicate actor references?

#

Huh, and I've been using replicated GUIDs to avoid replicating my projectiles (which number in the dozens).

sinful marlin
bitter oriole
waxen socket
#

Thanks again, Stranger.

dire pendant
#

Hello, I'm looking for examples of a seamless transition. It will help me a lot

peak sentinel
bitter oriole
#

Isn't it 32b?

peak sentinel
#

Sorry, FNetworkGUID

bitter oriole
#

Yes

#

Thought that was a 32b type

peak sentinel
#

Yeah, you're right

#

I was mistaken

lost inlet
#

so there's 2 similar named types which are differently sized GUIDs?

#

what an engine

bitter oriole
#

Yeah, same with FVector

#

Having network dedicated types isn't that weird tbh

kindred cypress
#

Hello, I'm working on rounds based game where players gets some points on each level

Each round have a different map, my logic where I keep the points is in GameMode.

But if I change the level the data will be reseted, where should I store it?
I tried seamless travel but the data in gamemode still resets

bitter oriole
#

Failing that, GameInstance on the server should store the data

kindred cypress
bitter oriole
#

No main menu there

#

If you're working off player data - the player data can be kept on PlayerState

#

GameMode, GameState are reset

kindred cypress
bitter oriole
#

If ti's player data

pure vigil
#

Does PostLogin get called when doing a ServerTravel? And if not, is there a similar function that can be used to determine when a player completes the travel?

#

Nvm, found it: PostSeamlessTravel

dire pendant
#

Seamless travel meaning any black blinking?

#

I don't understand seamless travel mechanic. I try to use it. But player respawns at start point as usual 😦

pure vigil
#

"black blinking"?

dire pendant
#

Loading screen

#

For example. Can I use some caVe as transition level. And reconnect to another server without any visible issues?

pure vigil
#

It's all the same server, I think SeamlessTravel just refers to the server transitioning maps and pulling all the currently connected players along with it

dire pendant
#

A lot of questions. From other side I read documentation. From another any tutorial or example 😦

pure vigil
#

I think the "transitionlevel" isn't supposed to be an actual level with content, it's just an empty area to temporarily store players while the first level is unloaded and the new level is loaded.

dire pendant
#

Example a real seamless transition to another server (i mean)

#

Hmmmm

pure vigil
#

Hm, no idea how it is handled between servers. I would think an external connection would be needed to bridge that gap.

#

but I've never done it so I have no real idea

dire pendant
#

I assumed its a real small level as Gateway

#

mysterious feature for me....

#

So why exists NON seamless trevel mode? If in both cases seam exists. Just not to destroy all players?

dire pendant
#

Ok. I found that transition does not work for two different servers. Thanks, this question solved.

bitter oriole
pallid mesa
#

ahh the joy of server travelling 😄

twin juniper
#

Multicast called off begin play execute on both server and client
But when called after 55s out of event tick execute only on server any idea why ?

mellow umbra
#

getting this error when hosting a session

#

works in editor not when packaged

#

using epic online services btw

bitter oriole
#

Debug it

mellow umbra
bitter oriole
#

In Visual

#

Start the game, attach VS to the process, reproduce crash

#

Fix the bug

mellow umbra
#

blueprints

#

tho

bitter oriole
#

If you can't do the debugging you'll have to ask whoever wrote the EOS support

floral spade
bitter oriole
floral spade
#

Im on a remote Linux server

bitter oriole
#

Usually you compile from Windows

floral spade
#

I'm trying to set up a the CICD workflow for the builds

#

I'm a DevOps guy I just don't know how to work with Unreal yet

#

I'm finding all sorts of documentation about being able to compile just fine on Linux

#

But not a complete example of showing how to set up the target.cs file

bitter oriole
#

Gotta have to check the Linux build instructions, yeah

floral spade
#

They all reference to using visual studio and building the project from there

#

Everything seems to go back to that doc I posted the link to a few minutes ago

#

They all say open up the solutions file in visual studio, to generate the product files for the server build

bitter oriole
hollow eagle
#

That's just if you want to cross-compile from windows.

#

Unreal's build tools don't rely on project files whatsoever. If you want to use VS to build, then you generate project files for VS.

floral spade
floral spade
hollow eagle
#

I believe the default on linux (without cross-compiling) is to generate a makefile. But pretty much all of unreal's supported project formats just forward commands to UnrealBuildTool which is the "real" thing that does the building.

#

You can either go the makefile route like in that doc page or call UBT directly (or call UBT via automation tool).

#

makefile is probably the best if you're actively doing development yourself, UBT/AutomationTool are best for CI setups.

lament cloak
#

Does anyone know if there's any significant differences between calling a Client RPC on every PlayerController vs calling a Multicast RPC on PlayerController?

#

in terms of network traffic and what not

hollow eagle
#

Yes, player controllers only exist on the owning client and the server. A multicast will only end up called on that owning client.

lament cloak
#

ok player controller was a bad example, Pawn

#

that doesn't make sense either, maybe im overthinking it

hollow eagle
#

In terms of network traffic it should be minimally different. Just use multicast if you know everything needs the call.

#

Nah, pawn makes sense

#

that should exist on all clients

lament cloak
#

yeah but a Client RPC on a pawn will only go to one client

#

anyway ok thank you

floral spade
#

now i Just need to translate this over into docker

#

ue4-docker's docs are not being helpful

bitter oriole
#

Probably want to try it yourself first since compiling will take like 4 hours

floral spade
#

well I already built the docker images

#

only took 3 😉

bitter oriole
#

🥲

floral spade
#

okay cool, I think I got it, now I gotta fix these build errors - thanks again @bitter oriole and @hollow eagle

dark edge
gleaming kite
#

just dont forget linux is useless for building windows clients

floral spade
floral spade
gleaming kite
# floral spade Ah thanks ! I think I got everything else going, excited to get this automated ...

good luck! if you ever need it, i recently also wrote a python bot for building using the UE4 CLI and then uploading those compressed builds to google cloud, allowing the users to generate secure links with a discord button to download. I also have an option for uploading the builds to AWS and deploying them as a gamelift fleet. The code is kinda rough as I wrote it in 2 days but I can make the repo public and send it if you want!

sinful marlin
#

Regarding pointers, how are they translated over the network? I have this method on my player controller:

    UFUNCTION(Server, Reliable)
    virtual void SetStartingKit_Server(class UMYStartingKitBaseDA* InStartingKit);

UMYStartingKitBaseDA IsA DataAsset. That is called from a helper method from a wbp (as seen in attached image) but I'm curious how that pointer translates to anything useful on the server 🤔. It works, it sets that on the server, but, how? Correct me if I'm wrong, but aren't I just passing in a memory address to the RPC?

#

From https://nerivec.github.io/old-ue4-wiki/pages/replication.html#Basic_Actor_Replication:
"Another part of the puzzle here is network GUIDs. Unreal generates a GUID for an instance of an object and stores objects in a replication map based on GUID. Objects are sent with a GUID identifier over the network. When Unreal replicates the value of a UPROPERTY that is a UObject* it is really replicating the GUID of that object, not the pointer address."

I'm assuming it's doing a similar thing for the argument then? I assume the reason it doesn't resolve to nullptr is because it's an asset, and not something created during play like an Actor?

meager spade
#

DataAssets can be found using the exact path

#

transient created stuff does not actually exist via a path

floral spade
gleaming kite
sinful marlin
fading birch
ocean geyser
#

question, lets say i have a replicated component and a replicated actor, then my own character. the replicated actor has this replicated component on it. if i set my character to be the owner of the replicated actor, can i make RPC calls on that replicated component? im a tad confused since the replicated actor would still be the owner of the component but i would then be the owner of the replicated actor that ownes the component

#

im assuming yes but am not far enough along yet to test it

sinful tree
plush otter
#

Is this node safe to use? I have trouble getting server initiated movements smoothly replicated to the owning client.

#

like a knockback from another player

sinful tree
#

If temporary for fast movements, yes. If you leave it enabled, then malicious clients could make their characters teleport wherever they want.

plush otter
#

I enable it before applying a force and disable it afterwards.

#

but what's the best practice to smoothly replicate character movement from server to the autonomous client?

sinful tree
#

I believe it's a matter of building the movement into the character movement component which requires some decent understanding of C++ and how the component works.

#

But even I'm not 100% on that.

#

It even says this on that node:

#

So, if you're having to move something fast, this may be the only way to reliably do it, regardless if it is built into the CMC.

plush otter
#

yeah I believe this is only used for fast movement

#

There should be a way to safely do it for non extreme cases.

#

I'm just starting to learn to add some custom movement mode to the movement component, but haven't seen reverse examples yet

twin juniper
#

How do you guys designing your interaction system ?? Actually I’m just sending the client interacted actor to the server and verifying if distance are matching etc but I doesn’t feel confident about this way

#

Someone could just send a cheated actor to the server

#

And i can’t trace from the server cause we designed interactable items a bit weird

kindred widget
peak sentinel
#

Does CPU overhead of replicating variables increase by the size of the data or is it a constant value per replicated property?

twin juniper
#

Client trace -> hits an item -> send it to the server with a rpc -> server doing checks

#

The server actually has the client actor not the server version of it

kindred widget
#

It doesn't matter. If the Server says an actor is at location 2000,0,0. And a Client says it's at 1000,0,0, and you send that actor through an RPC to server. That actor is at location 2000,0,0.

twin juniper
#

So I can easily cheat an actor on my client and it will be send to the server

kindred widget
#

You cannot cheat that unless you allow the client to send vector data. If you're just sending a pointer, they cannot cheat that.

twin juniper
#

Are you sure of that.. ? Is that not like server holds the real version of the actor and the client the simulated one (if the actor is replicated)

#

So actually I’m sending the simulated version of the actor to the server

kindred widget
#

What you're sending is a lookup ID basically. Client gets a local pointer, sends RPC. That code resolves that pointer into a lookup ID. When RPC arrives on server, it turns that ID back into a pointer, pointing at the actor that is on server.

twin juniper
#

So sending pointer is the best way to avoid cheating (for replicated actor.)

#

« a network ID is established for the object, which creates a mapping between server and client. This is then used by the latter process - a pointer is mapped to an ID, the ID is passed over the network, the receiving machine looks up the ID and locates its copy of the object in memory. »

sinful tree
# twin juniper So sending pointer is the best way to avoid cheating (for replicated actor.)

Trust only what you must from the client and minimize what they're directly allowed to do. Eg. If you were making a shop where a player could buy items from, you wouldn't let the client tell the server "Buy Item of class XYZ for 1 gold" but instead you would only let them say "Buy the item in slot X" and the server would then figure out what it is they wanted to buy and for how much.

twin juniper
sinful tree
#

Absolutely

twin juniper
#

🤨

twin juniper
#

Also can cheaters call RPC ?

kindred widget
#

Not sure what the classification of a cheater is? A client has one single networking tool available to them, and that is a ServerRPC. A ServerRPC can only ever be called from an actor that the server has allowed the client to own. The defaults for this is a client's Controller, it's PlayerState and any possessed Pawn. Client has no ability to replicate anything, and no ability to communicate with other clients.

twin juniper
kindred widget
#

I mean, they could call it, sure.

#

What it does depends on your server code though.

twin juniper
#

I was just talking about calling a rpc from hand in an external program (a cheat) not manipulating data

#

And things like AHK is nearly impossible to detect without an anti cheat software

#

Depends on anti cheat. Battle Eye has one Server lib and a client one, server one is for the game backend, client one for the player

#

Same for Vanguard (Valo anti cheat) that is runned out of the game

hollow eagle
#

That's not the same thing that lorash is talking about.

#

Lorash is talking about not trusting the client.

#

The primary way you protect against cheating is simply by not trusting what the client sends.

hollow eagle
#

Frankly you can.

bitter oriole
#

Client side anticheat is essentially about slowing down the cheat development, making it more expensive, and limiting how many groups can engage in it. You still need to have security on the server, but some classes of cheats are literally impossible to prevent server-side only, so you have to do more

hollow eagle
#

Most clientside anti-cheat is about preventing things that aren't possible to detect serverside.

#

Wallhacks, memory manipulation, aimbot, etc.

bitter oriole
#

Not trusting the client is all and good until you get triggerbots

#

Then what?

twin juniper
bitter oriole
#

Wallhacks can be limited in multiple ways but you can't prevent clicks

hollow eagle
#

Then you didn't read what I said - the primary way you protect, not the only way.

twin juniper
#

But it wasnt detected in games a few years ago..

peak sentinel
#

Last year someone developed an AI that analyzses the screen and rotates the mouse towards the humanoid shapes. None of the games or companies able to detect or stop that.

hollow eagle
#

To answer the original question more directly, RPCs can be fudged the same way any data coming from a client can be fudged. The solution to that is simple - don't assume what the client sends is correct.
If a client fires a weapon, don't design your "fire" rpc such that the client says "I shot the other player!". Do design it such that the client says "I want to shoot this weapon", and the server decides on its own whether it actually hit something.

twin juniper
hollow eagle
#

As for anti-cheat, there is no singular anti-cheat, no single set of technology, and anti-cheat tech is kept very secret due to it being a game of information. And even "generic" ones like EAC can't be entirely generic for them to be truly useful.

#

General methods are known, but very little is willingly shared.

twin juniper
hollow eagle
#

And that's been answered.

peak sentinel
twin juniper
peak sentinel
#

Yeah

twin juniper
#

It’s been shutdown in a few weeks

#

It was a PoC, never released but Activision messaged the creator and you know what followed

peak sentinel
#

I haven't followed the issue, I heard Activision was on the case though

#

So in the end Activision couldn't prevent the cheat but warned the creator?

twin juniper
#

Yeah the creator got afraid and quickly made a message on twitter lol

twin juniper
#

They said they could sue him etc so he ended all of that

#

And said on twitter « it was just a PoC blah blah im not a cheater »

peak sentinel
#

That's even worse

#

It's not guaranteed someone else will not develop another one

twin juniper
#

As of Ricochet (new COD anti cheat) someone know if it’s already been broke ?

peak sentinel
#

Just show a moving humanoid target and it will press the button virtually

twin juniper
#

I don’t know anything about « laws » about cheaters

#

Fortnite and PUBG already sued people for that if I’m not wrong

peak sentinel
#

Yeah, law is more strong compared to anti-cheat softwares

#

But in the end, someday it will appear again in the deepness of cheat forums and everyone will start to use it 🤷‍♂️ There are closed forums especially created for that

#

I'm just wondering how they are going to prevent this

twin juniper
#

But still, why they doesn’t sue cheat « company »

#

Like EO

#

Or so

#

Activision know that EO is creating cheats, they make people pay for it so what don’t sue them, they can but they don’t do anything 🤨

twin juniper
#

You can’t detect a trigger bot except by detecting the software itself

#

The thing showed in the video was running on PC ? (the ai software)

#

The game was running on console

#

On next gen console

#

That’s why it’s powerful I guess

#

That’s literally not the same.

meager spade
twin juniper
#

It’s an AI

#

Not something you injecting into a game

#

It’s an AI that scans your screen

#

It doesn’t read or write the game data it doesn’t even have access to it cause it’s on console

#

So literally not the same tbh

twin juniper
meager spade
#

ofc, i do a lot of sanity checks

#

Fire Rate, Yaw Angle, etc

twin juniper
#

Yaw angle ?

#

So Rotation ?

meager spade
#

angle between player and the damage (ie player has to be looking roughly at the damaged target)

#

for shooting weapons, etc

meager spade
#

yeah cause you can't be super precise

twin juniper
#

Like 10cm around the damage point

#

So you checking that player yaw is around target damage

#

But what if it changed since it shoot

meager spade
#

it won't, the server is always behind the client

#

when the server gets the RPC, it would have been in (roughly) the correct rotation

#

hence why you have a fudge factor

twin juniper
#

Yeah but imagine I have a lot of ping, between the time I shoot and the server gets the rpc called, i could changed my rotation

kindred widget
#

The point is just to stop 180 noscope 5km headshots.

meager spade
#

or blatant shooting backwards, etc

#

but the server is always behind though, and it works well

#

even under 500ping with 5percent packet loss

#

if your lagging that hard, expect things to miss or shots not to register

twin juniper
meager spade
#

you just need to make it work the best for about 200ms ping

#

100ms it should be playable

twin juniper
#

to check the yaw angle

#

you just tracing from player rotation to the target

#

on the server

meager spade
#

no

kindred widget
#

No need for a trace.

twin juniper
#

how then ? 🤔

kindred widget
#

IsNearlyEqual(PlayerRotation.Yaw, (TargetPoint-StartPoint).Normalize.Rotator.Yaw) Or anything similar.

meager spade
#
const FVector ViewDir = (Impact.Location - Origin).GetSafeNormal();
const float DotHitDir = FVector::DotProduct(GetInstigator()->GetViewRotation().Vector(), ViewDir);
if (DotHitDir < MaxYaw)
.... 
twin juniper
#

What is MaxYaw in this context ?

#

yaw tolerance ?

meager spade
#

this is from shootergame (won't show my code, cause you know... anti cheat), but it was to give an example

peak sentinel
meager spade
#

ShooterWeapon_Instant

#

but mine is very similar

#

but a bit more involved

twin juniper
kindred widget
peak sentinel
#

It's same as FRotationMatrix::MakeFromX().Rotator().Vector() then 🤔

#

Just asked because what I wrote above is ugly

#

Might use (vec1 - vec2).getsafenormal() next time

twin juniper
meager spade
#

FRotationMatrix::MakeFromX().Rotator().Vector() < is not the same though?

#

i use this for hitscan only

twin juniper
#

You got no checks for projectile weapons ? (even if they are handled only on server)

#

i'm sure UT4 has something about that but i don't remember lol

meager spade
#

not for the yaw angle

chrome bay
#

UT4's solution is really convoluted but it kind of has to be because of the nature of the game

hollow eagle
#

fwiw, more competitive action games (think something like CS) tend not to use the above method and instead have a much more complicated process that involves rolling back the state of the world to compensate for lag. There may still be some allowed deviation but it needs to be much less. The downside is it's much more complicated to build and has more performance implications.

#

UT probably does something like this ^

chrome bay
#

^ that's what we do btw

#

But only because we have no real choice

hollow eagle
#

Pretty much any competitive FPS has to do rollbacks

meager spade
#

lag comp only matters if server decides who is auth

#

err who is hit*

#

Fortnite for example trusts the client on who they hit

meager spade
#

server just does validity checks

peak sentinel
#

Second page, not the one I linked

twin juniper
hollow eagle
twin juniper
#

from what dave ratti said, it just "basic checks"

meager spade
#

its cheaper than storing lots of replay positions

#

for replaying

peak sentinel
meager spade
#

especially in a 100 player battle royale

twin juniper
meager spade
#

the less work the server has to do, the better

peak sentinel
#

They might fire a hitscan too if distance is close

#

Squad (milsim game made with UE4) doesnt fire a projectile if target is too close

twin juniper
#

Hell let loose

#

smth like that

meager spade
#

firing a projectile if too close is a waste of resources

peak sentinel
hollow eagle
#

Halo is a good example of having almost no hitscan. Though at least in H3 they also fallback to hitscan if there's a hit in a very short range (which resulted in an interesting bug related to FPS in the MCC release of H3).

peak sentinel
#

They do what ARMA 3 doing, firing fake pooled projectiles on client

twin juniper
meager spade
#

i only fire projectiles from Sniper or explosive type weapons (RPGs/Grenade launchers)

twin juniper
#

so they don't use hitscan for close range ?? @peak sentinel

peak sentinel
#

I don't know?? I'm not a developer of HLL 😄

#

From what I heard from Jambax they only use projectiles

meager spade
#

i think they use a special projectile system

#

based on structs

peak sentinel
twin juniper
meager spade
#

instead of full blown actor with projectile movement comp

#

no, i fire hitscan at point blank

peak sentinel
#

I wonder how HLL handle projectile spawning on a veeery close range

#

My projectiles spawn behind the enemy or go another direction

meager spade
#

they use a special struct

#

not the typical Actor + Projectile movement comp

#

afaik

peak sentinel
#

Yeah but still they do line traces

#

And update the delta position

#

They just have a niagara comp that can live in the world, stored inside the struct

#

And some basic functions to update the world position based on velocity

meager spade
#

which is what we do in RS2 with projectiles

#

we fake them a lot

#

weapon shots look like projectiles, but they are not

#

they still have travel time, etc

chrome bay
chrome bay
#

But yeah not using actors for anything other than big projectiles that have big explosions radii etc.

twin juniper
#

or custom projectile

chrome bay
#

Custom data projectile

#

Not using actors, way too expensive

#

100 players walking around with machine guns is bad enough 😄

meager spade
#

similar to how we do it in RS2

#

custom data projectiles for fast firing guns

twin juniper
#

before deciding if you have to hitscan or launch a projectile

meager spade
#

not in RS2 no

twin juniper
#

on your personal project

meager spade
#

yes

#

but only for snipers

#

normal guns are all hitscan

twin juniper
#

so tracing decisions on client, sending the FHitResult to server and let him decide if hitscan or projectile ?

meager spade
#

for snipers, yes

twin juniper
meager spade
#

client has a rough idea if its going to be a projectile shot

#

and does not store the unconfirmed hit data

chrome bay
#

bit of both really

#

depends how often your comparing it (but the push model can assist there too), and how complex the comparison is

meager spade
#

doesn't it do hash checks to see if its changed?

#

(been a while since i read it)

twin juniper
chrome bay
#

I think it eventually calls to do IsIdentical() or something

#

It's in RepLayout somewhere

#

CompareProperties_R or some weird name

peak sentinel
#

I thought sending them over the network was expensive

#

Rather than comparision

chrome bay
#

Oh well, both are

#

potentially

#

comparing two floats is nothing

#

comparing two arrays less so

#

you alleviate a lot of performance cost server-side by reducing the amount of comparisons and checks you need to do, e.g. lowering update frequency, avoiding having to serialize multiple times for each connection etc.

#

That's what Rep Graph + Push Model are for

peak sentinel
#

I haven't used Rep Graph yet, tbh I dont even know what its for

#

But literally almost everyhing is push model

chrome bay
#

lots of actors + lots of connections RE rep graph

#

Not really worth it for most projects

peak sentinel
#

We have ~100 moving pawns like RS2

#

But only 4 connections

#

There isnt any spawning cost too, thanks to pooling

#

Should I consider it?

chrome bay
#

Only if the server is spending too much time checking actors, then maybe worth investigating

#

But it's not super straightforward to switch to generally

#

And has some fun "gotchas"

peak sentinel
#

Uh, I can imagine 😅 Thanks for letting me know

twin juniper
#

An actor with DORM_DormantAll can't detect overlaps on server ?

grizzled stirrup
#

So I've moved from using Seamless travel to instead just use level streaming to load in different levels and so far it's working great for MP since only 1 level needs to be loaded for all players at the same time. Are there any downsides to this approach or can I safely do it for all levels in my game?

#

It removes many of the downsides of traveling (having to wait for clients to reconnect, longer load times between levels, no need to worry about CopyProperties or other persisting of data, not having to deal with dangling UI pointers in the PC etc.)

#

They can't move individually, the maps are small and travel is often so all players need to move to the next map together. This is where seamless really started slowing matches down

#

Yeah luckily they are all centered around the origin

#

Max bounds are 30K units from the origin

#

Good to know that it's a viable approach in that case

#

Now I'm just looking for some hidden sublevel limit or something as I have a lot of levels but for 30-40 it's fine so far

#

I'll need to go over 100 eventually

#

Another nice perk is that I can travel quickly to any level in PIE (using this level streaming method) without having to launch a standalone game since seamless travel doesn't work in editor

sinful marlin
twin juniper
#

but thx

gleaming kite
gleaming kite
#

Well I know it has a lot but I just didn’t think anyone still used power shell scripting for “programs”. I feel like you’re just shooting your self in the foot not using typescript or python. I felt silly writing a bash script the other day because i was too lazy to setup python properly on centos, guess it’s more normal than I thought!

#

Now I’m curious to see how people make this stuff in PowerShell, off to YouTube :)

hexed thunder
#

Does the RepNotify event only trigger for the server? thought it would trigger for clients too

#

but i guess it makes sense because it would be inefficient to fire back to all clients, so people can choose to implement if they wanna rebroadcast to clients on an event

sinful tree
kindred widget
#

Also RepNotifies have no actual networking in them. They are nothing more than a function that is called after a value arrives on a client. So there is no broadcasting or anything with them besides the value being replicated as usual.

hexed thunder
#

Im doing it on a random actor that ive created that does replicates

kindred widget
#

And They're also not called on server by default. Blueprint Setter nodes actually call the OnRep directly. On C++, you have to call that manually if you want it to run on the server. Fun fact, making a replicated integer, and doing a ++ does not fire the OnRep.

hexed thunder
#

I'm doing on blueprints

kindred widget
#

Check AlwaysRelevent setting. If your object is replicated and not running client onreps.

hexed thunder
#

should it be alwaysrelevant?