#multiplayer

1 messages ยท Page 653 of 1

stray crescent
#

is it basically like this?

#

and EOS just start more dedicated servers as needed?

bitter oriole
#

EOS does shit all

#

YOU start servers

fading birch
#

No gamelift would do that based on your scaling rules. It essentially checks how many servers are full and spins up new ones to keep X amount ready for players. It scales down as well.

#

Generally if you're using Gamelift, you'll use Flexmatch, which is gamelifts matchmaking.

stray crescent
#

is it better than AWS + EOS?

fading birch
#

Gamelift = AWS

#

i've worked with Gamelift in a shipped game, it's decent, but can quickly get expensive.

#

and we were running 10 game servers per EC2 instance.

vague fractal
#

How bad is it to send 80 bytes to a RPC while i may only use 4 bytes in worst case ?
I'm still having a hard time to decide such things.
I know you shouldn't really send unneeded bytes, but on the other hand it would really improve the code workflow(even though that shouldn't be the most important thing)

fading birch
#

depends on what you're sending and why.

#

you may want to approach the problem differently

vague fractal
#

It's basically the equipment bonus you get for wearing it.
The struct i'd send contains all kind of bonus types

fading birch
#

does the client not have that information already?

vague fractal
#

So it's only a 1 time send for equipping/un-equipping it

fading birch
#

ie, what the equipment does?

vague fractal
fading birch
#

you could just pass a bool then

#

bIsEquipped

vague fractal
#

This might work for e.g. the additional defence stats, but i think this wouldn't really work for stuff like Current/Max Health

kindred widget
#

In general, I found it easier to just send desired equipment IDs with equip or unequip commands. Server does equipping, sets new values, values get replicated. Client can have access to same functions and data for UI display. So in the end your only data sent is what you want to equip, and then the return replicated values of anything changed.

#

But realistically, you don't equip things that often. So I don't think that send size is really going to matter much. It's not like you're doing it 10+ times a second all game long.

fading birch
#

yeah, if it's only once in awhile, it's fine

stray crescent
#

@meager spade@fading birch do u have a doc or something that explains all of it in details?
I still dont understand how to approach it from the game side of things...
like what does the dedicated server(the server version of the game) suppose to do and stuff

fading birch
#

the dedicated (game) server just handles gameplay stuff

#

matchmaking, launching servers, etc that's on you to implement outside of the engine

stray crescent
#

and what about sessions?

fading birch
#

Sessions can be used for matchmaking, but that depends on the Online Subsystem

stray crescent
#

so basically the dedicated server start a game on a lobby map, it wait for players to join and then load the game map when ready, and when it finish it return to the lobby map and wait for the next players to join?

fading birch
#

generally sessions are the servers way of telling an Online Subsystem they're available for players to join, as well as set parameters of what that game server is doing. Ie playing Free For All, Team Death Match, etc.

stray crescent
#

or does it need to load directly to the actual game map?

fading birch
#

you can set it up to have Lobby -> Game Map

#

You can also set it up to have a dedicated server lobby, then travel all players to a different server for the actual match

#

i've done it both ways

stray crescent
#

and which subsystem is most suited for unreal games?

#

EOS?

#

and easiest to use

#

with the most support and stuff

fading birch
#

Arguably, Steam.

stray crescent
#

and to use the subsystem in general do I use the built in session class?

vague fractal
#

Do RPC's really need the full definition for parameters ?
As in you can't forward declare a struct which you use as parameter ?

fading birch
#

you should be able to do void foo(struct FStructFoo& StuctFoo);

vague fractal
#

Think it also have to be const since a async RPC shouldn't be able to modify it.
But yeah, that's what i'm doing and it doesn't work :S
"'Blah' - type must be a UCLASS, USTRUCT or UENUM".

#

(Also is a USTRUCT)

fading birch
#

const would be fine too

#

that was just an example

#

you may not be able to forward declare it if it's a UFUNCTION, in that case I would move your struct to somewhere a little more global to avoid circular dependencies and just import that into your header

vague fractal
#

Well yeah. Since it's a RPC it has to be a UFUNCTION >_<

fading birch
#

yeah

#

I would just move your struct definition then

#

It's annoying, but such is programming

lost dune
#

Has a replicated variable value to be changed in a server event to be replicated to all other clients ?

fading birch
#

Can you restate that question please, I don't understand what you're asking.

lost dune
#

When a variable is setted to replicated ( or repnotify) , have i to change its value in a server event? or multicast event? for the replication to work ?

#

sorry for the bad question before

fading birch
#

Ok, let me see if I understand

vague fractal
#

Yes, you have to change the value on the server.
Otherwise it will only be a local change which will quickly sync up with the value of the server

fading birch
#

You have a variable, which is marked to be replicated. You're changing the variable from where?

#

If you're changing it on the server, you won't need to do anything else, it'll replicate on it's own

lost dune
#

from the client ( a simple custom event)

fading birch
#

Yes, you'll need to call a Server RPC

#

the server is the only one that should be changing variables

lost dune
#

so i need always variable repicated + server event?

vague fractal
#

Not always, but basically yes.
The server will e.g. also tick. So you can do if(HasAuthority) { Change the value } inside of the tick

lost dune
#

ok

#

my case is special because the variable change is triggered by a keybaord input event

#

so always client side , if i understand well

#

so it will never have authority no?

fading birch
#

Most replication changes are driven by player input, this is no different

#

when you want to fire a weapon, you press the "fire" button on your mouse. Then you call a function to fire your weapon. That function checks if you're the authority, if not, it calls the server version of the function.

meager spade
#

Replication is Server -> Client, never Client -> Client or Client -> Server

crisp sable
#

Is there an easy way ( ie console command) that will display the hitboxes of a character?

#

in play mode

bitter oriole
#

show collision ?

crisp sable
#

ah lemme check

#

awesome! you're the best

#

that works ๐Ÿ™‚

kind ember
#

on AWS make a secured Api Gateway http endpoint that runs a lambda function when invoked, the function just write to a data table.
And unreal would just make a https request to that endpoint.

blazing spruce
#

Hi, does anyone know how to setup the network profiler tool?

dull lance
#

quick question

#

when GameMode::PostLogin() runs, does the Controller already have a valid Player State?

graceful flame
#

If a multiplayer game uses sessions, is it possible for players to determine the IP address of all other players in the match?

#

I want my game to be a success, but I'm struggling with the decision of using host sessions vs dedicated servers because I know streamers avoid playing games that leak their IP at all costs, and using dedicated servers costs money.

bitter oriole
#

Sessions are used with listen servers or dedicated servers

#

The IP issue is an issue regardless of whether you do use sessions at all

graceful flame
#

Thanks for the correction, I'm still learning all the proper terms and lingo. I meant to say a listen session.

bitter oriole
#

And yes, most listen server setups do expose the IP, session or not

#

The only way to prevent that is to have your own network layer, like Steam does with their net driver, by having the IP address as a concept removed from the board

graceful flame
#

Most or all?

bitter oriole
#

Destiny moved to that last year to cut down on players DDOS'ing themselves

graceful flame
#

So if I'm using steam integration the IP addresses are hidden?

bitter oriole
#

Not just Steam integration, the Steam net driver that goes through their own servers for the entire networking

graceful flame
#

I'm using that, playing as standalone, then "hosting" or "finding a match". Would connecting clients be able to determine the IP address of other players and/or the host?

bitter oriole
#

By default you're using regular IP networking so yes, every client knows the server's IP and the server knows every client's IP

#

This is what you want instead

graceful flame
#

So would Client-A be able to read the IP of Client-B given they are both connecting to HostPlayer-C

dull lance
#

ooooor you can use a steam plugin from the marketplace to handle a decent amount of things for you

dull lance
#

Wdym? There're several options

graceful flame
#

Any recommendations?

dull lance
#

the basics are covered with Advanced Sessions Plugin (Free I think).

I'm personally using SteamCore right now; the docs are kinda lacking but the author is incredibly responsive.

graceful flame
#

"P2P listen servers always use Steam's communication network regardless of this setting." ๐Ÿ‘€ That sounds about right....

bitter oriole
#

Just a simple Blueprint layer

dull lance
#

Ah I see. I haven't really used it for a full project; just remember checking the basics of it back in the day

fading birch
#

the IP is still exposed when the client connects via the network driver, not much you can do about it.

graceful flame
#

So for a game like VRChat does that leak IP to all connecting players?

fading birch
#

"leak"

#

if you are allowing your players to host, it's a risk regardless

graceful flame
#

I find it odd how some streamers are very concerned about hiding their IP from potentially malicious players in the same match, but others aren't concerned at all.

#

So one work around without having to use dedicated servers is to allow for private sessions between trusted friends. Correct?

fading birch
#

With a listen server style setup, that's nearly impossible

graceful flame
#

So if I used the free advanced sessions plugin I could set it up so that players can host a game and others can connect via friends list, but im not seeing anything about setting up a password.

fading birch
#

that's a completely different type of thing

#

you'll need to read up on online subsystems

graceful flame
#

I have been lol

fading birch
#

if you're talking about password protecting servers, that's something a bit different

graceful flame
#

Yes I'm talking about them all because I want to weigh my options

#

Sorry for the confusion

#

What would you recommend for a 5vs5 game. I want to allow for private friends / password based matches but also just standard host a public game and join a game via matchmaking.

#

All while avoiding dedicated servers if possible.

fading birch
#

I would use dedicated servers tbh

graceful flame
#

If dedicated wasn't an option?

#

Am I describing an impossible scenario?

fading birch
#

it's not impossible

#

and certainly doable with listen servers

graceful flame
#

Do you think performance is likely to be significantly impacted with 9 other players all connecting to a host player's PC?

#

That's probably why dedicated would be better ya?

fading birch
#

well, there's a few reasons why I wouldn't use listen servers, ever if I can avoid it

#

the main one is you have to trust your clients

#

which means they can hack

#

bandwidth and stability is also an issue

#

if the host lags, everyone lags

graceful flame
#

Ahh okay

fading birch
#

if your doing a game like VR chat, then that doesn't really matter

graceful flame
#

So then I guess the question becomes barrier to entry vs multiplayer experience. hmmmm

fading birch
#

as there's no real gameplay going on

graceful flame
#

Most of my gameplay is movement based, but there's some collision and hit detection RPC

dark edge
#

Having to do 10 times the CPU work will always take longer than not, whether or not that's a big deal depends on how much work it is to begin with.

peak star
#

Ih wait actually a log after the putItem call does appear. So I guess the callback just never happens

kind ember
#

var ec2Instances = await ec2.describeInstances(EC2Scan).promise();

peak star
#

My config timed out at 1 minute if I make it not async

#

I will try the promise thing

kind ember
#

Btw what langauge are you using?

peak star
# kind ember Check your Lambda configuration, by default it can run up to 3 sec, I change it ...

nodejs 14.x

It still times out at 60 sec.

I'm sure I just misunderstand something very basic about Lambda functions.

const dynamo = new AWS.DynamoDB({apiVersion: '2012-08-10'});

exports.handler = async (event) => {
//exports.handler = function(event, context){
    
    const response = {
        statusCode: 200,
        body: JSON.stringify('Hello from Lambda!'),
    };
    
    var putItemParams = {
        TableName: "UnrealServers",
        ReturnConsumedCapacity: "TOTAL",
        Item: {
            ServerName: {S: "MyServer"},
            NumPlayers: {N: "5"},
            MaxPlayers: {N: "16"},
            GameMode: {S: "Impostors"},
            GameStatus: {S: "Lobby"}
        }
    };
    
    console.log("about to putItem", putItemParams);
    var putAttempt = await dynamo.putItem(putItemParams, function(err, data) {
        console.log("callback reached.");
        
        if (err){
            console.log(err, err.stack); // an error occurred
        }else{
            console.log(data);           // successful response
        }
    }).promise();
};```
#

Im just hardcoding it in for now until I can get it to work, then I'll have it take HTTP request params.

kind ember
#

'use strict'
const AWS = require('aws-sdk');

AWS.config.update({ region: "us-west-1"});

exports.handler = async (event, context) => {
  const documentClient = new AWS.DynamoDB.DocumentClient({ region: "us-west-1"});
  
  const {table_name, server_name, current_players, max_players, region, isacceptingplayers, ip_address, isliveserver, isqatestserver, accepting_matchmaker} = JSON.parse(event.body);
  
  var d = new Date();
  var currentMinute = d.getMinutes();

  const Putparams = {
    TableName: table_name,
    Item: {
      Name: server_name,
      current_players: current_players,
      max_players: max_players,
      region: region,
      isacceptingplayers : isacceptingplayers,
      lastupdate: currentMinute,
      ip_address: ip_address,
      isliveserver: isliveserver,
      isqatestserver: isqatestserver,
      accepting_matchmaker: accepting_matchmaker
    }
  };

  var data = await documentClient.put(Putparams).promise();
  
  var response = {
      statusCode: 200,
      body: "Ok"
  };
  
  return response;
};
peak star
#

(yes I made an Among Us clone, but I won't be distributing it to the public - I made it to teach myself what I would need to make a game with similar movement and user interface and networking, but the final product will have very different rules and gameplay and of course, art)

kind ember
#

Try that, you don't need to catch error since it is just updating server, for me at least every 30 secs

peak star
#

OK, thanks

peak star
#

still timed out though when I did yours

#

Maybe it's a permission problem?

#

By the way, thank you so much for taking the time to help me out

kind ember
#

Could be, make sure its the right region too.
And check the error log.

peak star
#

I would think the logs would tell me if it's a permission problem. But it just looks like this in the Test tab on the Lambda page:

END RequestId: 2c4802bb-34e6-4590-8c02-c6edfcc468db
REPORT RequestId: 2c4802bb-34e6-4590-8c02-c6edfcc468db    Duration: 60034.31 ms    Billed Duration: 60000 ms    Memory Size: 128 MB    Max Memory Used: 88 MB    Init Duration: 383.82 ms    
2021-07-30T23:31:56.983Z 2c4802bb-34e6-4590-8c02-c6edfcc468db Task timed out after 60.03 seconds

#

oh yeah, region is us-west-2. I thought it was us-west-1.

#

(on my side too, not just in your code example)

kind ember
#

The code works for me, been using it for months for testing our game.
Btw const {table_name, server_name, current_players, max_players, region, isacceptingplayers, ip_address, isliveserver, isqatestserver, accepting_matchmaker} = JSON.parse(event.body);

This only works if you call from api gateway test. Or make up the variable.

peak star
#

I know. I just put strings into the Item object for now to test from the Lambda function page

#
const AWS = require('aws-sdk');

AWS.config.update({ region: "us-west-2"});

exports.handler = async (event, context) => {
  const documentClient = new AWS.DynamoDB.DocumentClient({ region: "us-west-2"});
  
  //const {table_name, server_name, current_players, max_players, region, isacceptingplayers, ip_address, isliveserver, isqatestserver, accepting_matchmaker} = JSON.parse(event.body);
  
  var d = new Date();
  var currentMinute = d.getMinutes();

  const Putparams = {
    TableName: "UnrealServers",
    Item: {
      ServerName: "MyServer",
      current_players: "5",
      max_players: "16",
      region: "us-west-2",
      isacceptingplayers : "true",
      lastupdate: currentMinute,
      ip_address: "5.12.34.567",
      isliveserver: "true",
      isqatestserver: "false",
      accepting_matchmaker: "false",
    }
  };

  var data = await documentClient.put(Putparams).promise();
  
  var response = {
      statusCode: 200,
      body: "Ok"
  };
  
  return response;
};```
#

but it still results in a timeout with the same very short logs - no errors other than the timeout after 60 s

kind ember
#

Yea that should work, even if permission is wrong it would give error and not timeout.
Maybe AWS having issue with that region or try create a new lambda.

peak star
#

hm had the same problem yesterday and the day before

#

Does VPC settings matter for just testing within the Lambda page?

kind ember
peak star
#

oh this is interesting. I turned off VPC and now I'm getting some useful errors:

  "errorType": "AccessDeniedException",
  "errorMessage": "User: arn:aws:sts::854977663781:assumed-role/unreal-listinstances-role/UpdateUnrealServerInfo is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-west-2:854977663781:table/UnrealServers",
  "trace": [
    "AccessDeniedException: User: arn:aws:sts::854977663781:assumed-role/unreal-listinstances-role/UpdateUnrealServerInfo is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-west-2:854977663781:table/UnrealServers",
    "    at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)",
    "    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
    "    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
    "    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)",
    "    at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
    "    at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
    "    at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
    "    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
    "    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:690:12)",
    "    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18)"
  ]
}```
#

So putting it on that VPC was probably what was blocking it from even making it this far.

#

woohoo! It works now. I just attached the dynamoDBFullAccess managed policy to the Lambda's role

#

Thanks very much for all your help!

kind ember
#

Nice!
And what did you need VPC for?

peak star
#

Well I thought my Lambda could only see my EC2 instances if it was on the same VPC as they are.

#

And I wanted to gather a list of all the IP addresses so the client can pull that list up inside their game and choose a server to join

#

and then the game would just "open 123.456.78.910"

#

whatever IP address was on the server they choose from the list.

#

so I still need to figure out how to find out the IP address to set on that dynamoDB table.

#

Anyway maybe my EC2 instances don't need a VPC either? I just put in what sounded like they needed when I was setting it up

#

Interesting. Lambda VPC turned off can still see my instances that are on a VPC, at least when I run it from within the Lambda console.

#

(I got my describeInstances lambda function working too ๐Ÿ™‚ )

#

And it looks like it is using the elastic ip associated to the ec2 instance as that instance's Public IP, so that's good. Now I just need a way to match the ec2 instance's public IP to the database entries being generated/updated by my dedicated servers.

#

@kind ember I have this C++ function in my game instance class:

{
    TSharedPtr<class FInternetAddr> HostAddr;

    bool canBindAll;
    HostAddr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->GetLocalHostAddr(*GLog, canBindAll);

    UEngine* DasEngine = GetEngine();
    if (!ensure(DasEngine != nullptr)) return FString("ShowMyNetInfo could not get Engine");

    //DasEngine->AddOnScreenDebugMessage(0, 5, FColor(255, 255, 255, 255), HostAddr->ToString(true), true);

    return HostAddr->ToString(false);
}```
But I think that will only get the private IP address and not the public one.
kind ember
#

I will definitely need to set up VPC later as well.

kind ember
# peak star <@!517782178059517976> I have this C++ function in my game instance class: ```FS...
peak star
#

Okay thanks

fair lantern
#

Hi Guys xoxoxoxo, having a bit of trouble setting my equipped weapon on the client. The server receives the correct weapon but the client receives null and idk why :S

#

I set the equipped weapon on begin play and it is not replicated so idk how the server knows and the client doesnt

#

im new btw dun bully me ๐Ÿ˜ฆ

#

wait does beginplay always play on the server? that probably explains it

#

if thats the case tho, how do I set it for the client? :S

peak star
fair lantern
peak star
#

OK I see. So it works correctly on the listen server's player, right?

#

If that's the case then the problem is that the effect is not replicating to the connected clients.

#

I'm not sure the best way to do this but my inclination is to change CurrentlyEquipped's replication type to RepNotify, and in the repnotify function that is generated from choosing that, simply do exactly the same thing as you have for your beginplay.

#

Then instead of doing that in the Beginplay, set w/notify your CurrentlyEquipped variable

fading birch
#

the server should be the one equipping all players. You should do that via an RPC

#

in begin play you should try call a function that sets the variable. Check if they have authority, if they don't then set it as the server. Then call the RepNotify

peak star
#

Yes, @fading birch that is the other thing. @fair lantern nothing happens to the character across all the connected machines unless the server is the one doing it. So additionally you must create a Server RPC event (probably in your playercontroller), call that (blue node) with the Equip index you want to use, then have the red node part of the server RPC do all the stuff I said.

#

To keep things simple, I think you don't have to check for authority, because a server calling a server function on itself I think will just run the function normally won't it?

fading birch
#

the client will call it since the client also runs begin play

peak star
#

Oh I see. You want to prevent every machine from calling it for every pawn, and only do it for the pawn which the client machine is controlling. Correct?

thin stratus
#

Just a sidenote. If that would be the case then BeginPlay would be the wrong place

#

Because a pawn doesn't need to be possessed on BeginPlay, removing any chance of knowing who that pawn belongs.

#

Event Possessed (calling only server side) would be an easier place.

pearl moon
#

not seeing movement replicated across client1 > server > client2 for a custom pawn class that has bReplicates set to true...my question though, is do I need to calculate my non-physics based movement on the client or the server?

kind ember
pearl moon
#

I have a ton of functionality into these pawn classes already, so can't migrate at this point to a character class

#

thanks for the suggestion though

kind ember
#

You can re-parent the pawn to a character class.
Else you'll have to write client prediction movement system.

pearl moon
#

I should probably add that I will be putting in code for lag "compensation" to lerp and slerp location and rotation to where they are supposed to be as well, which i can do easily now, just need to figure out the fundamental reason why i'm not seeing the replication occur ... client prediction movement sounds exactly what i just mentioned ๐Ÿ˜›

and yes time consuming lol

kind ember
#

Are you using NetworkPrediction plugin?

pearl moon
#

I am not, that I know of...

#

what does the plugin do?

kind ember
#

Its a plugin for making writing network prediction somewhat easier.
It shipped with Unreal, but still in beta.
Its really nice, you should check it out.

pearl moon
#

i'll take a look, thnx

stray crescent
#

How does one create a session on a dedicated server that doesnt have a player controller because its a dedicated server?... ๐Ÿค”
keep getting errors that the player state is invalid because the player controller is invalid.........

pearl moon
#

I'd imagine you use the client's role to determine if it's a client (player) or a server, if server, don't create the PC, pawn, etc at beginplay

elder sable
#

Hi, i would like to generate my map in a multiplayer game, but i don' know where i should put the generation code, i thought about PostLogin but i'm not sure

chrome bay
stray crescent
peak star
chrome bay
stray crescent
#

u said that the dedicated server already creating the session for us

chrome bay
#

No you have to create the session yourself still

#

But it's usually done right at game startup

stray crescent
#

on the dedicated server, correct?

stray crescent
#

and I cant create a session on the dedicated server because it requires a player controller which a dedicated server doesnt have

chrome bay
#

Nothing creates a session by default - you have to setup logic to create it

#

You don't need a controller to create a session

stray crescent
#

which node or c++ function do i need to run to create a session?

#

CreateSession?

chrome bay
#

IOnlineSubsystem::Get()->GetSessionInterface()->CreateSession();

#

Suggest checking out the ShooterGame example project from Epic

#

If you're creating a game that requires dedicated servers you need C++ anyway.

stray crescent
#

CreateSession require a valid player controller which u dont have in a dedicated server

#

the ShooterGame example doesnt work on a dedicated server

chrome bay
#

You probably can't do it in Blueprint then

#

It does

stray crescent
#

no?

chrome bay
#

The function I showed above doesn't need a controller

#

Blueprint isn't very good when it comes to managing or dealing with sessions

#

It has very limited functionality

stray crescent
#

okay ill give it a try

summer tide
summer tide
#

Anybody knows how can I debug this if it works in standalone?

twilit stump
#

@summer tide AI is only simulated on authority

summer tide
summer tide
#

Ok thanks

kind ember
#

Does anyone know what server spec Fornite uses?

#

Specifically their server that host the 100 players battle royal, I am wondering what the cpu and ram is.

chrome bay
#

Not sure about Fortnite, but a 3rd-party 100-slot rental for us is about ยฃ40 GBP a month. Not cheap.

#

Don't know what sort of markups are on those though. Minimum specs is 3.8Ghz with 5GB RAM.

kind ember
chrome bay
#

Fairly sure that's the spec, we're not using AWS I know that much

#

Zeuz I think.

#

Plus some third-parties for communities

kind ember
#

Ok thxs!

peak star
# kind ember Ok thxs!

Hi. I've put VaRest on my dedicated server. if I cURL from the command line on that EC2 instance's Windows environment to my Lambda endpoint, it succeeds, but if I use vaRest, it says

JSON(
{"message":"Not Found"}
)JSON```
kind ember
peak star
#

ok

crisp sable
#

C++ Client RPC function question:
I want my function "ClientPlayReload" to be called from the server and run on the client.. but for some reason, I can't get it to work.
As you can see from my breakpoint/callstack.
ClientPlayReload_Implementation is only being executed on the server! Shouldn't it only be executed on the client?
Is there something wrong with how I'm calling it? declaring it?

peak star
kind ember
scarlet cipher
#

Hi iโ€™m trying to setup a self hosted server with photon server, i need to make a crossplatform game, someone have already setup this ?

peak star
kind ember
peak star
#

Does it cost different than rolling my own the same?

kind ember
#

It uses same EC2 rates, but there matchmaking system might cause money, i don't remember.

obsidian basin
#

Hey all, trying to wrap my head around something; I have a hypothetical question.

Imagine if you developed an MMO in Unreal - so you have a server somewhere running the server and everyone connects as a client. In that situation, every player would have their own controller, right?

#

If that's the case, would that mean it would be safe to run logic on the controller? Or in an MP environment is it generally better to keep all logic on the pawn?

fading birch
#

Controllers exist on the server too. You just run that functionality as the server.

obsidian basin
#

So are there generally things you should do or not do when developing in an environment like that vs a couch coop where everyone's using one controller?

#

Obviously not looking for a list if that's the case, but just a general should I be aware.

shut compass
#

Hi I have a question

#

I have a WebSocket / SocketIO server connection in Game Instance I wanted to pass it to other Objects , But I can't make it BlueprintCallable

peak star
shut compass
#

Unable to use UPROPERTY

#

Gives me error. ๐Ÿ˜ฆ

peak star
slate basin
#

hey, is there a way to make an actor replicate to only non-owners? other than overriding is IsNetRelevantFor(..)?

kind ember
#

Nvm

#

IsReplicationPauseForConnection() maybe

slate basin
#

I'll just use IsNetRelevantFor, I thought there might be a variable like ReplicateOwnerOnly

kind ember
#

OwnerOnly is just for variable

slate basin
#

bOnlyRelevantToOwner

shut compass
peak star
# shut compass

Can you show the part of the .h file that's from? this might be more of a #cpp question.

shut compass
peak star
# shut compass

That's interesting because it's fine with the FString below it, which is not one of those 3 things.

#

Maybe what it doesn't recognize the type of is the FSocketIONative

#

Did you #include the needed .h files about sockets in the .h file that declares that UPROPERTY?

#

And if you open up the .h for FSocketIONative, is it a UObject, AActor, USTRUCT or UENUM?

#

I might not be much help since I'm new to UE's C++ types myself

#

It really does seem more of a #cpp question and maybe someone there knows what is wrong.

shut compass
#

Yea I did.

shut compass
#

Anyone worked with WebSockets here?

chrome quest
#

You can't expose a TSharedPtr to blueprints

#

@shut compass

shut compass
#

I see will switch to websockets then

#

Instead of using SocketIO

#

Or just recode it to UObject -> to be callable

chrome quest
#

Yeah. Only types that can be exposed to blueprints are unreal primitives, classes, structs and enums tagged with UCLASS(), USTRUCT() and UENUM() respectively

spark owl
#

does anyone know if the advanced sessions plugin has a discord?

mint grail
#

<@&213101288538374145>

nimble parcelBOT
#

:no_entry_sign: Linda#6766 was banned.

elder sable
#

Hi, i would like to handle global events in a multiplayers game, what's the good way to handle the synchronisation ?

#

Maybe running one timer on the server then using rpc ?

void summit
elder sable
#

Ok, how can i run the timer server side only ?

void summit
#

Ok maybe this is not the best solution but I normally just do it in the GameMode since it only exists server side. I'm still new to UE so maybe this is not the best solution.

#

It works though ;-)

#

It also depends on your use case

elder sable
#

I have an event every X seconds and i want to notify the clients

void summit
#

Then it seems ok to me to do it in the GameMode

elder sable
#

Ok i will try with that thanks :p

void summit
#

You can call your Multicast from the GameMode, but don't declare it your Multicast event in the GameMode though, since it only exists server side. One solution is to declare the Multicast event in the Game state.

#

But still call it from the GameMode obviously.

elder sable
#

Ok thanks !

void summit
#

Yw :) hit me if you still have issues

forest delta
#

Hey everyone! Has anyone tried making an online multiplayer game using pixel streaming?

spark owl
#

can a dedicated server use the save system of ue4 to for example save a level name so it know what to load when the server starts? I'm wanting to release the dedicated server files for my game to my community. I want them to be able to choose what level the server is on but now sure how I can do that. Would need to set a variable on runtime that the gamemode blueprint can load

rose prawn
#

Quick question, imagine a survival game like multiplayer Forest, or Minecraft. Which cases I should use Player State?

thin stratus
#

For the State of the Player PE_PandaSippysip

thin stratus
spark owl
#

and then also is there a way to edit the save file manually so it can be changed before starting the server?

twin juniper
#

how can I make online matchmaking where multiple players can play

twilit stump
spark owl
twilit stump
#

Yeppers!

#

Open Level is already a command line function

#

So thatโ€™s going to be your best bet

thin stratus
#

Pretty sure google is your friend here

#

Savegames are not how to do this

spark owl
steel fox
#

Any tip on how to replicate physic simulated objects properly? I'm trying out the Wheeled vehicles but after a bunch of collisions I have different positions in the level for the owning client, the non owning clients and the server

twin juniper
#

Are there any good starter templates / blank projects that just have basic networking? Trying to make a quick prototype but now I'm realizing I'll have to implement a bunch of connection stuff...

#

I can't find any on github or on google searches :\

#

I'm looking for a blank project that just has a simple menu for connecting to internet servers

lost inlet
#

what are you expecting?

#

just being able to connect to a server? if you build a dedicated server you can join it by IP with the null OSS

twin juniper
#

I'm trying to have a rapid prototype where I can distribute builds on itch to playtesters and have them connect to each other

#

so non-lan enabled multiplayer out of the box template

#

with all the boilerplate for multiplayer

#

well, session connection boilerplate

lost inlet
#

well if the IP address of the server is known, well you can do that pretty easily. but since you're not using an online service, then it'll be an uphill battle since itch.io doesn't provide very much

#

maybe you can use EOS with itch? that has p2p connections

empty bluff
#

As a client i want to interact with a chest. I only want to allow one client to interact with a chest at a time. So since rpcโ€™s cant return a value, and the server should do the occupy check. What is the preferred way to solve this?

#

Also, rpcโ€™s that are marked as reliable. Are they guaranteed to arrive and always in order? So if two reliable rpcโ€™s are made, will they always execute in the order they was called?

kindred widget
#

999999 out of 1000000 times, they'll probably arrive in order. But you shouldn't count on it.

vivid seal
#

wait what

#

i thought the point of reliable rpcs is that they arrive in order

kindred widget
#

As far as I'm aware, reliable simply tries to send the rpc constantly until it's received.

vivid seal
#

i thought reliable rpcs were held when received if the previous rpc hadn't been received so they could be executed in order

#

im gonna google now

kindred widget
#

Ah. Yeah, they are supposed to be executed in order as long as they're done on the same actor.

vivid seal
#

according to a random answerhub answer, they are guaranteed order on an actor basis

#

thats a relief i was about to have to check a bunch of rpcs to make sure i wasn't depending on ordering lol

chrome bay
#

reliables are only in order if called from same actor

#

between different actors, no order is garaunteed

vivid seal
#

yup

chrome bay
#

Only realllllly garaunteed for non-multicast too, as if the actor isn't relevant they may not receive a multicast

vivid seal
#

what situations would you want a reliable multicast anyway

chrome bay
#

Rarely tbh, I've only needed them a couple of times

#

One nice use-case is sending a bunch of "death" data before destroying an actor, as you know it'll arrive before the call to destroy - whereas properties may not.

elder sable
chrome bay
#

Wish the engine supported sending an arbitrary data packet with the "destroy" packet to make that cleaner, but alas.

lost dune
#

Hello, are the properties of type BP object reference replicable?

chrome bay
#

If you mean a blueprint class variable, yes you can replicate that

lost dune
#

I want to replicate the BP actor referenced by the variable

#

It's the armor of the character and the character change is armor

chrome bay
#

That's fine so long as the BP actor itself is also replicated, or part of the map.

obsidian basin
#

Hey, I'm having some problems with something.

I'm trying to test my game using the Play As Client, just 2 players for now.

When the game loads up, I get two characters, but only one controller - this is a problem because I have logic on my controller and that means that only one of those players is 'working'. How does one ensure a controller is spawned for each instance of a player to test it out?

peak star
#

I think you can do it several ways. Probably the simplest is if the pawn is placed in the map.you can set auto possess player to player 0 for the first one and player1 for the second

#

Or if you are using player starts then you can spawn a controller and a pawn and then possess the latter with the former

#

@kind ember.I heard someone on here was running multiple dedicated servers off one AWS EC2 instance. I want to try that because 20 EC2 instances costs about $165/mo

I wonder if I can do that by setting port numbers differently for each dedicated server that is executing on the same ec2 instance and just making sure to include that in the info on the server list.

But how are port numbers set for straight up IP connection like that? Is it in a .ini file?

lost inlet
#

Whatโ€™s with the tag?

peak star
#

Sorry.

obsidian basin
elder sable
#

Hi, i call broadcast() in my gamemode from a multicast delegate stored in gamestate, i bind a function with addDynamic but the function is called only on server

hollow eagle
#

yes, because you didn't replicate it anywhere

elder sable
#

The gamestate is not replicated ?

hollow eagle
#

it is

#

function calls are done via RPCs, though, not delegates.

#

If you want clients to broadcast that delegate too, you need to call a netmulticast RPC that calls broadcast on the delegate

elder sable
#

No i want server to broadcast

hollow eagle
#

yes, so you call a NetMulticast function that makes clients call the broadcast

kind ember
hollow eagle
#

delegates are not replicated. If you want the server to trigger a function on all clients, you use a NetMulticast RPC. If you have a multicast delegate that needs to be triggered by the server on all clients, you call a NetMulticast RPC which then triggers the delegate.

elder sable
#

Hum i got 2 different solutions so what s the good one ? :p

#

Well i will try stuffs, thanks

peak star
peak star
elder sable
#

Ok it works if i make the call from gamestate and not gamemode

kind ember
kind ember
peak star
#

@kind ember thank you. I'll try that and see how many I can run before it starts overloading

#

(With player activity)

fluid summit
#

Hi! does anyone know about resources to learn how to implement NFT on UE4? (want to make some NFT items for my game)

lost inlet
#

lol

kindred widget
#

Discord rule 7, please.

fluid summit
#

sorry, not sure on wich channel that should be : (

kindred widget
#

Dunno. but it's highly frowned on to spam messages in multiple channels.

kind ember
peak star
#

If it were easy then would it be worth so much?

kind ember
#

Idk, hard work = reward, lol

lost inlet
#

Buy in game items that require the entire annual power consumption of a small nation to process

kind ember
hollow stirrup
#

Hey all. I'm developing a top down game where the player aims at the mouse position. This is how I am handling that logic:

// this is located in the Tick of the Character

FVector MouseLoc;
FVector MouseDir;
if (PC->DeprojectMousePositionToWorld(MouseLoc, MouseDir))
{
    FVector Intersection;
    float T;
    UKismetMathLibrary::LinePlaneIntersection_OriginNormal(MouseLoc, MouseLoc + (5000.f * MouseDir),
                                                           GetActorLocation(), FVector(0.f, 0.f, 500000.f), T,
                                                           Intersection);
    FRotator Rot = UKismetMathLibrary::FindLookAtRotation(GetActorLocation(), Intersection);
    Rot.Pitch = 0.f;
    Rot.Roll = 0.f;
    GetBulletSpawnPoint()->SetWorldRotation(Rot);
}

This works great on the client because that is being executed locally. When the player fires a projectile the client version goes where the player is aiming because it is using the client's spawn point transform. However the server projectile does not. The problem is the server's aim isn't synced with the clients aim.

How would I go about solving this problem? I don't want the server to do the actual aim updating because then clients will feel laggy, but I also obviously cannot have an RPC every frame to update the server.

Any suggestions on ways to tackle this would be much appreciated.

Here is the GAS logic that is spawning the actual projectiles:

empty bluff
#

@kindred widget thx for the reply. So as to my 1st question. Do you happen to have an advice for that? I mean, my own idea would be to make a rpc call to server to occupy the chest and from the server make a rpc owning client call to tell the client if it was successfull and also send content of the chest in some kind of array, so it can be pressented in an inventory hud. Plus multicast a timeline to animate the chest opening.
Does that sound right?

kindred widget
#

Chest opening should be state based. Set replicated state for that. If you open the chest and then someone wanders into range afterwards, they'll still see the chest closed. As far as the usability, that's difficult. I haven't tested enough, but I wonder if setting a value to replicate to owner only would work when switching owners. Cause if that works I'd just set the chest's replication timer to something very high, like only try refreshing every few minutes. Then you can trace, RPC to server, server sets owner, calls force net update, and then the OnRep could open the inventory. If someone else comes along and tries to use it, ignore it if there's a valid owner. Make sure to call forcenetupdate when changing items, then remove owner as an RPC when exitting the chest with some serverside checks on a semi often timer while Owner is valid for like distance or whatever to make sure the owner gets removed if the old owner fails to notify, etc.

empty bluff
#

Hmm interresting approach.. iโ€™ll tinker around with that. Thanks for the detailed description. I may try out a few options though to see what is most reliable and easy to implement. But like the idea of setting the ownership. Not sure why i didnt consider that. Iโ€™ll post when i come to a preliminary result.

kindred widget
#

Would be interesting to know. Alternatively, I don't know how much networking code is available, but ARK does the same thing, and a lot of their game code is available in their editor. May or may not be something there, but that is a massive download. ๐Ÿ˜„

stone vault
#

Hey guys, can I get some advice on something? I'm trying to learn replication, just basics for the most part. In my project, there is a procedurally generated, endless voxel terrain. Chunks are spawned around the player as they move and then despawned as they get outside the render radius/distance. This works fine. But if I wanted to make this multiplayer-- I'm thinking listen server, rather than the tediousness of a dedicated one-- would I do the spawning ON the player controller and have it replicate, or should I run all spawning through something like the Game Mode?

#

I did try and test it via gamemode but it was really wonky. There's a little bit of lag which is making the chunks spawn deformed or with holes.

#

Currently it runs on a tick (I promise it's the only tick in the game) in the player controller, just checking if they moved.

#

I was thinking something like having a master timer function where the Game Mode gets every player in a player array and runs the Moving check, but I'm not sure how taxing that'd be or how efficient. I think it'd cause a lot of lag problems.

#

I could spawn from the player controller and then replicate but I'm really fuzzy on the safety of that.

thin stratus
#

Do the chunks need to be replicated actors?

#

Because the maybe better way is to only replicate the required information to generate the chunk and let the client figure it out locally

#

Usually only requirement is a single seed

thin stratus
#

You want to use listen servers. You have no safety :P

steel fox
#

Hi, I need to replicate a struct periodically, I swear that calling an RPC in event Tick is not a good idea so how can I do it?

#

Maybe, but how can I send client data to be replicated like location and rotation? I'm trying to do some physics simulations adjustments(idk why but It doesn't replicate well by default) and I was thinking of using timers or just send player input directly to the server, the problem Is that I'm not sure how good this solutions could be

tender badger
#

fatal error C1083: Cannot open include file: 'OnlineIdentityInterface.h': No such file or directory

#

{
"Name": "OnlineSubsystem",
"Enabled": true
},
{
"Name": "OnlineSubsystemUtils",
"Enabled": true
},

#

why cannot i include 'OnlineIdentityInterface.h'?

sterile wharf
#

Hi Awesome UE community !
I'm quite new to multiplayer, trying to figure things out.

I've an actor placed in world, which is accepting input. On pressing 'Spacebar' key, it will spawn an actor.
Actor that is supposed to be spawned has 'replicates' tick marked.

if I spawn from server, it works fine on both (client n server)
but if i spawn from client, it only spawn locally but not on server.
and not even on other clients. (tried multicast and run on server both.)

is my approach correct ?
any idea/suggestion would be really helpfull.
thanks in advance ๐Ÿ™‚

empty axle
#

you should RPC to the server(through some other owned actor like character/pawn/controller) and server should spawn your desired actor

sterile wharf
spark owl
#

do you guys have any issues with OnPostLogin? It seems to just not fire sometimes for my game

lost dune
#

I need help i can't pass a BP object reference to the server

#

when i print it its null

empty axle
lost dune
#

oh thank you its spawned client side

grizzled flicker
#

How do you ensure something is spawned server side? What if itโ€™s just placed in the world. Is ticking replicated good enough?

empty axle
grizzled flicker
#

I think this was an issue for one of my objects only working on server and not client, I donโ€™t believe I ticked replicated. Basically I try to spawn an emitter and for some reason the emitter works on server but not client itโ€™s bizarre

#

I did server -> multicast and still nothing , itโ€™s weird just a sound and emitter on collision..

stray crescent
#

on a dedicated server all players sync their game state with the server game state?

#

or is it like any other actor that replicate?

#

lets say that I chance how many kills a player did, and I'm calling it from the game mode it will update for all of the players, correct?

#

I mean there is no need for replicated variables or repnotifiers or RPC to do that since its always syncing

#

or does it count as an RPC call because it coming from the game mode?

marble saddle
#

Not directly related to ue, but do you know any resources for creating matchmaking system for a multiplayer game? A matchmaking where player joins a queue and when he finds an opponent a new server is started

stray crescent
#

Better suited for #online-subsystems
It depends on ur subsystem, some already have a built in matchmaking system some doesn't

true stream
#

When dealing with a RTS's resources, the resources belong to the player, but should be dictated by the game mode somehow?, not up to the player how the resources work (let say you have a income)

viscid silo
#

Anybody know how to recreate an online mutliplayer( or allow player connect to another player's map by lan or not) for existed game but servers was shutdown, if u have any real info which could help ping me plz

empty axle
true stream
#

mmhh I see, in the end the UI is the one that should react to the server dictating the resources

#

example, some units/buildings to buy should be grayed out if the resources are not enough

#

but they should become available to buy once they do.

obsidian basin
#

Is a scene capture component a bad idea for minimap rendering in an mp environment?

#

I assume it's going to get expensive.

lost dune
#

Can someone link me the Multiplayer ue compendium please?

#

pdf

#

Found

fluid summit
fading birch
#

@lost dunefor the future, it's in the pins.

stone vault
#

So let one of them generate the chunk client-side and then have that replicated to the other players when in range?

#

That's kind of how it is currently, but I just wasn't sure what method was best. I've made open world MUDs before but this is quite different, lol.

knotty frost
#

I believe the most common way to tackle that kind of thing is seed-based deterministic generation + a replicated authoritative random seed?

stone vault
#

Could you uh, break that down a little? Sorry, I'm not sure what you mean.

#

The chunks are currently generated using seeds with perlin noise, though

knotty frost
#

It's been some time since I've had to tackle something like this - but the idea would be that the seed used to generate things in a deterministic way (reproducible) would be controlled by the authority, whether that's a listen server host or a dedicated server, and replicated to the clients - who would then handle generating based on that seed, so it's consistent across clients despite generation happening locally, requiring perlin noise on the clients might complicate it and it's likely very use-case dependent

stone vault
#

Ah okay. Well it is reproducible, so I've got it that far at least. So... okay, I think I understand. The server sends the seed, the client generates their own chunks from the seed. So then the only real hardship after that is determining how to store the updated chunk whenever a block is removed. Which I'm thinking, get that specific chunk vertices and store them in an array, then as each chunk is loaded, check if the position is in the area and load the edited chunk instead?

thin stratus
#

That one can cheat

#

Also all the mining is happening on the Server side

#

it doesn't matter if the client can change the way the map looks

knotty frost
#

that one is more of a math and efficiency question, hopefully someone else has good advice

stone vault
#

That's true. I'm just not sure if I understand enough about dedicated servers to manage it properly, you know? It's really hard to find information on saving changes. I have read a lot and have a big ol' library full of documents, links, videos on multiplayer and replication, but saving the data via a dedicated server is confusing.

knotty frost
#

also yeah, if theres a client that's the authority it'll always be vulnerable to exploitation

thin stratus
#

Dedicated Servers aren't safer

#

saver, safer? Man

knotty frost
#

if they're distributed to players to run def not

thin stratus
#

You know what I mean

stone vault
#

When I had my MUD it was a big openworld MMO, and I integrated it with Django to save data. But this is really different.

thin stratus
#

Here is the thing

#

You'd need to host the Dedicated Servers of all your Players

#

Because if they host them, they can cheat.

#

That means you have to pay all the hosting costs

#

With maybe never getting enough players to even pay that

#

It's not worth the effort

knotty frost
#

it's not cheap and especially when you start needing DDoS protection

stone vault
#

I get that, I just don't know how to pass information from an online server. I have a server through aws that hosted my MUD, and I still could use it, but doing it with something like this is so different that I don't know where to start.

#

I'm pretty sure you'd need sql or json files or something like that?

#

I know you can't use Save Game

thin stratus
#

You mean for a persistent database?

stone vault
#

Yeah, because I'm pretty sure that'd be needed.

thin stratus
#

Depends

stone vault
#

To save terrain altered by players as well as player data

thin stratus
#

You can use savegames too if the Server a player joins is the only one needing the info

stone vault
#

Really?

#

Huh, that could make a big difference.

thin stratus
#

Yeah, you'd probably need to send some data from Server to Client

knotty frost
#

i think there's a SQLite implementation in the engine that isn't totally busted you can use too but don't quote me on it

fading birch
#

you could have the server save data per client locally. If you're doing something along the lines of a Valheim server, the server would just need to send the player the latest saved data for the world.

stone vault
#

I've always been told to avoid using SQL stuff because of the way queues work

thin stratus
#

It might also be helpful to maybe to split the code into landscape and dynamic actors

#

The landscape can be generated on the clients

#

the dynamic actors spawned replicated by the server

#

That way the server can load their state

stone vault
#

isn't it super bad to save anything client-side though?

fading birch
#

I'm not sure how that would work with a Voxel landscape

thin stratus
#

Yeah landscape changes are probably not so straight forward

fading birch
#

You're not really saving it client-side, you're caching it

#

the server maintains the authority

#

and you can check it periodically to ensure the client isn't trying anything funky

stone vault
#

What I was going to do was just save the coordinates of any changed chunk in one array, and the chunk vertices in another array, and then whenever a location is checked to load a chunk, if that chunk coords exist in the coords array, load the edited chunk instead.

fading birch
#

that sounds like a decent way to do it

#

you don't necessarily need to update it either if the client isn't in the area

stone vault
#

Yeah exactly

fading birch
#

would be a waste of resources otherwise

#

as for how to do that

#

gl

#

above my head lol

stone vault
#

the only chunks that ever 'exist' are within the range of the client currently.

#

So it gives really decent performance

fading birch
#

I would load them a bit past the client

stone vault
#

And since it's based on a simplex perlin noise it's always consistent. So if you leave, the chunk is destroyed, if you come back, the chunk is recreated and has the same vertices

#

same shape as before

fading birch
#

so they don't run into a weird area where something is different on the client than the server because the server hasn't sent them the update for that chunk yet.

stone vault
#

Well the range is currently set to a variable so it's very easy to adjust. I was going to attach that to client settings.

#

So if they need lower settings the range is small, if they have higher settings, it's larger

fading birch
#

i'm not talking about their visibility

stone vault
#

Each block is 100 unreal units, each chunk is 100 blocks, range is currently x6, so 6x6 chunks around player.

fading birch
#

i'm talking about their network culling

stone vault
#

Ohh

fading birch
#

that should be further than the max visual

#

regardless of specs

stone vault
#

Yeah, it's currently the defaults. I haven't even messed with it yet.

#

Which come to think of it probably explains the flickering of chunks in the distance.

rose raft
#

Hi, I'm a beginner to multiplayer stuff in Unreal and I would appreciate any help!

I'd like to start with making a game with listen server support, and I created a prototype pawn.

I found that there are three aspects I want to retain: 1) the pawn has a custom box-like collider. 2) The pawn can collider with other objects and simulates gravity. 3) From my understanding, the pawn should use a movement component in order for AI support to possible in the future.

I've created a demo project with a Character which supports movement replication as its built right into the CharacterMovementComponent. It works great, however its specifically made for humanoid characters with skeletal meshes. I can't use Characters as they are very restrictive and can only use capsule collision.

To isolate this specific task, I've created a simply project: A custom pawn blueprint, with a box-like collider, a static mesh, and a FloatingPawnMovement component. Now, I am unsure of where I should go from here. FloatingPawnMovement doesn't have (good) movement replication built-in and I want to create a system where both the client and server simulate the movement, the client simulating for responsiveness, and the server simulating for authority.

I'm open to exploring other possibilities like creating my own movement component, and I have intermediate understanding of C++. I'm just not sure where to start!

tldr: I want to create a custom pawn that does not use CMC and replicates movement, with the movement being simulated both client and server side and the server being authoritative. I'm not sure where to start.

lost dune
#

How to get the pawn controlled by the current client?

#

this get player controller ask for the player number

#

i want to get directly the pawn controlled by the current client

lost inlet
#

in what context?

winged badger
#

@rose raft start by shamlessly ripping off parts of the CMC you need, or alternatively look for epic's network prediction plugin on github and start from there

#

if you're planning on mixing physics with movement though, you're in for a world of hurt

rose raft
#

Thank you!

lost dune
#

Structs variables are not replicated? ( i have an array of struct setted to replicated but it don't replicate)

rose raft
twin juniper
#

let's say the player controls a pawn, and I call "SetReplicates(false)" on the pawn, does the player lose ownership of the pawn immediately if it stops being replicated?

vital bough
#

Hey guys, I'm trying to replicate this custom event but it is not working.

#

I have this set for the custom event

strong vapor
#

@vital bough are you making sure to run the multicast off the server? if you try to fire a multicast from a client, nothing happens.. you have to already be on the server

#

that function image looks fine, as long as what's calling that event is ON the server

obsidian basin
vital bough
#

From each player

strong vapor
#

then it needs to be rigged to a client->server event first...

#

and then the server fires a multicast for everybody

#

think of client machines as little kids at a firework show.. they arent allowed to light any of the fireworks.. they have to hand it to an adult

#

or.. idk, whatever lol

vital bough
jolly crag
#

Make a custom event run on server, that calls that event multicast...have whatever is spawning it call the server rpc

vital bough
tender badger
#

ShooterGame, why cannot find Server between 2 cellphone

jolly crag
#

Yes then the server calls that multicasted event you pictured above...

#

Particles, sounds, and root animations all require that extra effort since they are not replicated at all

#

Server event-->multicast event...multicast event--->your code.

vital bough
#

was what I set to multicasted before

jolly crag
#

Yeah that was fine...

#

But you still need the server to call it

#

So your npc or whatever calls the server event you create, which then calls that multicasted event

#

Why on earth multicast node doesnt automatically run the code on server by default is still a mystery to me...but it doesnt...it only multicast it if the server is the one calling it....so 2 extra nodes every single damn time you want to multicast....

#

Wait till you try replicating particle template that changes on a projectile with multiple templates, such as elemental magic spells....that will have ripping you hair out. Stupidest thing ive had to deal with so far with ue4 replication.

vital bough
#

ServerCall on server than multicast for Explode

jolly crag
#

But beginplay should be calling server call...not the multicast after that delay

#

Its literally monkey in the middle...

#

Beginplay calls server call which calls explode

vital bough
#

Oh ok

jolly crag
#

Understand what I mean by 2 extra nodes every time

#

You would think just calling multicast that ue4 would default to running on server with it

#

But it doesn't

vital bough
#

Begin Play calls server

#

then server calls explode

jolly crag
#

Yeah that should do it

vital bough
#

It doesnt work lol

#

Im prob doing something wrog

jolly crag
#

Do a print screen after explode

#

Sorry print string

#

It should write out to server and clients

vital bough
#

What

#

It prints screen for the specific client

#

but the explosion or projectiles dont spawn

jolly crag
#

Where's it pulling location from?

vital bough
jolly crag
#

The print string should go right before the particle spawn

#

After the red explode event

vital bough
#

I put it there and it works the same way

jolly crag
#

If it said server:hello ...client:hello...client:hello... Then it's correctly multicasted

#

That code above will only say server: hello

vital bough
#

it says Client:Hello

#

Client 1:Hello

#

Client 2:Hello

#

Whichever player fires it

jolly crag
#

It should say server:hello...client: hello...<--client that fires it

#

Otherwise it's not replicating

#

It's the actor set to replicate?

vital bough
jolly crag
#

Yeah that's not replicated....

vital bough
#

I set it to replicates on the Details window

jolly crag
#

Move that delay to before the particle spawn

vital bough
#

Ok

#

I did that

jolly crag
#

I hate for it to sound like "did you turn it off and on again"... But try closing and reopening your project

vital bough
#

Sure Ill try that

jolly crag
#

There's no reason i can immediately think of that the above code isn't calling the servers "hello"

#

It's the server spawning the projectile or whatever that is?

#

The server should be the one spawning them

#

Not the clients

#

If they're set to replicate they'll automatically spawn for the clients

#

That's the only thing i can think of that would make it only print to the owning clients

vital bough
#

Umm

#

Let me show you the C++ code as well

#

Turning it off and on again didnt work

jolly crag
#

Aside from the particle are the actual projectiles spawned for everyone?

#

You can see them in server and other clients?

vital bough
#

No

#

This tutorial project has a line trace that is spawned on both clients

#

I cant get the rocket launcher projects to work tho

jolly crag
#

Can you show me the input code on the character for firing the weapon

vital bough
#

Sure

#

Its quite a lot of code sorry lol

jolly crag
#

This looks fine, i mean the on button pressed input on your character for firing the weapon or did you handle that all in c++

vital bough
#

The tutorial handled it in C++

#

I tried to do the implemenation and validation thing

#

but it didnt work

fading birch
#

is that the tom looman tut?

vital bough
#

^ Yes

#

Did you go over that tutorial as well?

jolly crag
#

Yeah just a lot harder to follow in c++, not that i can't but i gave up coding in c++ in ue4 when they announced blueprint nativasation produce code that was just as fast as projects written purely in c++

fading birch
#

i'm happy to help, just show me the code from your input component

vital bough
fading birch
#

no

#

in your player controller or pawn

#

the binding where you setup what "Fire" does from your inputs

jolly crag
#

The input binding, the code that when you press a button it calls the fire()

vital bough
#

This is visual studio right?

#

Just making sure

fading birch
#

yes

#

it should be code

vital bough
fading birch
#

it's where you setup stuff like movement, button things

#

not that

#

1s

#

something like:

PlayerInputComponent->BindAction("TogglePerspective", IE_Pressed, this, &AExcursionCharacter::TogglePerspective);```
vital bough
#

I dont see something like that in the character

#

character class

#

Trying to find out where he put it

#

Wait

fading birch
#

bingo

#

what does StartFire do?

vital bough
#

It basically calls this

fading birch
#

hmm

#

it's very strange that the server call isn't happening

#

i would remove the delay, it's not really needed.

#

since the server is the one creating the shot, the server call shouldn't be necessary either.

#

The server is spawning the projectile correct?

vital bough
#

Each client

#

is spawning it on their own side

#

but its not spawning on each others sides

#

if that makes sense

fading birch
#

it does, that means it's spawning local client only

vital bough
#

Yeah

fading birch
#

how familiar are you with C++?

#

at least in terms of UE4

vital bough
fading birch
#

ah ok

#

what I would try to do is have the projectile actor class be a variable in your weapon, such as:

UPROPERTY(EditDefaultsOnly)
TSubclassOf<ASProjectile> ProjectileClass;

class ASProjectile* SpawnedProjectile;

You would then spawn it like:

// Fire code above
SpawnedProjectile = GetWorld()->SpawnActor(blah blah, ProjectileClass);
SpawnedProjectile->Multicast_ProjectileEffects();```

Notice how i used `ASProjectile`. I would also make a C++ base class for your projectile. In that class I would make your NetMulticast call, Multicast_ProjectileEffects in this case, and do what you were doing in BP there.
#

TSubclass allows you to assign a blueprint that inherits from that class. SpawnActor takes a class object variable, which a TSubclass is.

vital bough
#

Let me try that

vital bough
fading birch
#

do you have a server running?

#

open 127.0.0.1 would do that.

#

what level does your server have open?

#

how are you trying to test this?

#

in PIE?

#

i'm not sure if null works in an exported project ๐Ÿค”

#

is your session actually getting created?

#

it could be that you're server never actually opens the map

#

I would also launch your client and server with -log

#

so you can read what's happening

#

ok, so that's that solved.

#

and on the client?

#

that's really strange

#

you're not using a custom net driver are you?

obsidian basin
#

Hey, does anyone have the command lines for a listen serer and client?

#

I built a package and my server has ?listen -server. My client has server-127.0.0.1 -game

fading birch
#

@granite badgeso you packaged the server and the client?

#

Are you using dedicated servers?

#

Give me a second need to open my p2p project.

obsidian basin
#

Anyone?

#

nm, figured it out

#

Syntax was messed up on the client one

fading birch
#

@granite badgeok, so after my session stuff is done i'm doing this:

#

try that

#

you may need to start it

#

but honestly

#

for now, remove the create session stuff entirely

#

and just flat out open the level

#

like you can bypass all of that

#

and just do open MainMap?listen from the console on the client you want to host

tropic mulch
#

Hi , hope everyone Have a good day ๐Ÿ™‚

I will try to explaing my question as simple as possible :

I have pawn already spawned on server and have rutime added component .

but when client join to the map , it sees pawn with that component but not the value setted on component .

what is weird here is :

  • if its not replicated , so why client have that component ๐Ÿ˜„

  • if its why it dosent have that values I set on server ๐Ÿ˜ซ

Will apperciate any answer , thanks

fading birch
#

idk then. It should just work. What engine version are you on?

tropic mulch
#

Would you explain it more please?

#

you mean construction called seperatly on devices , I got this but it should be replicated after , am I wrong?

granite badge
#

yea construction is called on all devices. if you want something to only happen on the server, you should use the node "Has authority"

tropic mulch
#

btw , I can set it with RPC in development stage just for test , but with production it isnt possible @granite badge help please ๐Ÿ˜„

fading birch
#

Umm. That's the same?

#

weird

#

didn't even think that would matter xD

placid mountain
#

i just wanted to ask that which dedicated server will be best

strong sail
#

Hey guys I have a cube that is being spawned on the server what is the best way to change the properties from a pawn that will update the cube on the server?

thin stratus
thin stratus
strong sail
thin stratus
#

What is this based on? Key Inputs of the user?

strong sail
thin stratus
#

Then you usally need a place for your RPCs

strong sail
#

On the pawn?

thin stratus
#

May it be the Pawn itself (if possessed), the PlayerController or PlayerState

#

Or a component on those to keep code clean

strong sail
#

Okay cool

#

how would I then get input from widget

thin stratus
#

wdym

strong sail
#

to edit the cube

thin stratus
#

Well, I assume you have some buttons in there?

strong sail
#

Yeah and a slider

thin stratus
#

Yeah then when those get clicked, get your PlayerController or Pawn and call the RPC on it with the new data

strong sail
#

Brill will give it ago

thin stratus
#

The part that is lacking is how to get the data to the Cube

#

But if you have UI up, you should already have a reference to the Cube

#

At least if that's your order

#

If you don't, then you need to use a LineTrace or overlap etc to get one

strong sail
#

Nice one ta

scenic turtle
#

Hi All, I would like to know if I can store a value in game state and forward that to the dedicated server? Do I have to use RPCs to do it or because game state exists both on server and client it will get replicated from client side? Thank you all.

thin stratus
#

Replication is ALWAYS Server -> Client

#

NEVER Client -> Server

#

You always need an RPC in a Client owned Actor to go from Client to Server

scenic turtle
#

Thank you for the reply so I guess I will have to implement the RPC then. Cheers

lost dune
#

I have a problem ; my character 's inventory have a array of struct , but it doesn't get replicated.

marble gazelle
spark owl
#

does anyone know about eventpostlogin in blueprints? It seems to just not fire sometimes when a player joins the server. It's causing issues related to initialization.

lost dune
#

I just modify the array server side like that

#

with set array elem

#

The array is replicated

#

but when i print the array's all elements , they are all null (client side)

#

replication dosen't occure

#

i have verified the array is correctly modified server side

#

on the net some says an array is optimized and not all elements are replicated

#

some says its a problem with structs variables not replicated

marble gazelle
#

well your actor also needs to be replicated

chrome quest
#

If all those are in a component. Make sure the component is replicated also.

lost dune
#

The actor is replicated , and the character who have the inventory itself (its a BP) is replicated , and the inventory object reference is replicated also

marble gazelle
#

just to be sure, what do you want to show in the second image?

lost dune
#

i show that i am selecting the whole actor giving this details (showing setted to replicated)

marble gazelle
#

I see, ok

lost dune
#

Arrays elements are not all replicated when one of them change OR there is a problem with structs replication

#

I have noticed a lot of other problemes with structs in UE

#

i'm thinking about reimplementing everything without using structs

chrome quest
#

I still don't think it's an issue with struct replication. I had a similar setup for one of the earlier iterations of my inventory system and structs, with their contents replicated just fine

lost dune
#

its is the server who call the addItem function of the inventory

#

the item is spawned server side

#

maybe doing a multicast should be a good perpective? but not good for the security

lusty sky
#

If the actor is replicated it should be spawned on client after it gets spawned on the server.

tranquil eagle
#

Are there any downsides to having a TMap replicated via reliable RPCs for adding/removing elements vs using a TArray of (Index, Value) pairs?

kindred widget
#

@tranquil eagle Can you even send TMaps over RPCs? I know they're not replicatable.

tranquil eagle
#

I am not sure about the whole map as an argument, but what about just sending individual elements when change occurs? If the map can't be sent as is, maybe it can be turned into an array before sending and put back into a map after receiving it?

chrome bay
#

Can't replicate TMap/TSet, or send them via RPC

twin juniper
#

Hello, is anyone familiar familiar scene capture 2d for scopes In a multiplayer game ?

lost dune
#

I confirm , arrays of struct are not replicated , i have just tried to use an array of BP objects instead and it works fine

hardy valve
#

Hello! how do i go about to profile what the MP is doing so i can optimize it? ๐Ÿ˜„

#

i just want to see what actors use most network

lusty sky
lapis zinc
#

Why does my weapon drop keep duplicating in this setup for the client

#

if its set up for owning client the server player cant pick it up

lost inlet
#

Not really showing a lot there

#

If itโ€™s got a spawn actor node, then itโ€™s spawning a client side actor

#

Ah, net code in BP

obsidian basin
#

Hoping someone can help with this. I made a minimap on my character by adding a scene render component to the class and then outputting that to a material which then outputs to the HUD. However, when I start a multiplayer game on a listen server with two players, the minimap on each actually is displaying the render target from the other. I can't figure out why.

#

If I close the client, the server's hud goes back to normal.

#

I'm reading that scene capture component maybe doesn't work in a Multiplayer environment?

lost inlet
#

Didnโ€™t we have this conversation before?

obsidian basin
#

I was having another issue related to this, but no nott his exact issue.

lost inlet
#

Scene captures will obviously work but writing to the same render target in PIE might not give you an accurate representation

obsidian basin
#

Yeah, if I add more clients it seems everyone starts using the latest client'

#

SCC

lost inlet
#

But I still think itโ€™s a bad way of implementing a minimap

obsidian basin
#

I'm starting to see that now.

#

I figured at the very least performance would get worse anyway

neon mango
#

Is it possible to have a server client connection but have the server be on a different map than the client ?

obsidian basin
#

I'll try the alternative method - output an image and then display that based on coordinates.

#

Thanks for your help

lost inlet
#

Thatโ€™s what we do, pre-rendered map images and icons

lapis zinc
# lost inlet ^

well the way my weapon drop is setup is using stored integers and adding and subtracting them. Somehow the client and server is counting the same integers

lost inlet
#

Yeah because youโ€™re using a multicast or whatever the BP equivalent terminology is

#

If theyโ€™re replicated vars then they get touched by both

lapis zinc
#

is there a way to find out which player is dropping the weapon?

lost inlet
#

Well since you can only do client to server RPCs if you own the actorโ€ฆ the owner will tell you

tender badger
#

this added skeletalMesh with IK is invisible by other Player while MultiPlayer, do you know what reason might it because? Thanks!
VR player can see the PC player's skeletalMesh, but PC cannot see VR, and VR cannot see other VR
by default, the SkeletalMesh with IK is visible by other player while MultiPlayer?

#

not set Only Owner See...
by default, this new added IK SkeletalMesh should also be visible by other Player while multi-player ?
should i Enable the Component Replicates for the IK SkeletalMesh? but now the Component Replicates is also unchecked in the Text but it's visible by other.

dire cradle
#

I'm having some trouble getting the print string to work on all clients, it only shows up on the server

#

"CheckIfEveryoneAccepted" runs on both client and the server at the same time but I only want the server to execute it, then notify other players

#

Any idea why this isn't working?

crisp sable
#

So what is the "best" way to do hit detection in a multiplayer game. As far as I know, by default the server and client animations are NOT in sync, so when a character is running, the location of the head will be different on the client vs the server. I'm told there's two ways of handling this

  1. Run a traceline on the client to detect which body part the player hit. If there has been a hit, then send a message to the server telling him that the client hit somebody. The server then runs a verification traceline to determine that the player did indeed hit the other player's collision capsule. The server cannot 100% verify which body part the client hit because the animations are not in sync, so the best that the server can do is say, "Yea the player did indeed hit the other player's capsue". Apparently, this is how PUBG does it.

  2. Through some heavy modifications, ensure that the server and client animations are in sync and only do the traceline checks on the server. Apparently this is how Valorant does it (and I'm told it's not an easy feat to accomplish this ).

Solution 1) seems the easiest to implement but is hella prone to cheating.

Do you guys know of any other methods to handle this situation ?

#

I'm coming from the Source engine where solution 2) is the standard way of handling things but because the animation in Source is much much simpler than UE4, it was far easier to keep the client/server animations in sync

fading birch
#

Generally when I run into this problem I use an anim notify. That then triggers an event on the server to run the trace from the location of the animation at the time stamp on the animation. Attempting to keep everything 100% in sync is nearly impossible afaik.

crisp sable
#

ahh cool, I'll look into that

#

so basically.. Trust the client, but verify on the server

#

Solution 1)

#

The challenge is my animation blueprint is pretty complex. There is a lot of variables that go into the Final pose.. So I may have to send an RPC to the server with quite a few variables

#

everytime I do a hit check

fading birch
#

Well sort of. The animation start should be coming from a server event. You can keep track of an animation state with a custom enum and check that on the server.

Ie:

ServerStaftMeleeAttack()
{
  SetAnimationState(EMeleeState::Attacking);
}

//then function that responds to notify

void DoMeleeTrace()
{
  If(MeleeState != EMeleeState::Attacking)
{
  return;
}
crisp sable
#

i see.. I'll look into this, thank you

kind ember
crisp sable
lost inlet
#

we use CSHD with validation

#

it was a bit easier in source since the animation state was simpler and had a lag compensation system

crisp sable
#

yea, tell me about it

#

no wonder people always hold the source engin eas a gold standard for hit detection

#

but their animaton system was primitive as fuck

#

compared to the UE4

#

what's CSHD ?

#

ClientSide hit detection?

lost inlet
#

yeah

#

the validation is the verifying the client input on the server#

#

just keep a ring buffer of player positions for that

kind ember
lost inlet
#

I believe they did something similar for hitscan weapons in UT

#

the shootergame sample uses CSHD but is validated on the principle that you're looking vaguely in the direction of the victim

kind ember
lost inlet
#

also doesn't help that you're referring to a web page without a URL

kind ember
crisp sable
#

cheers, thanks guys. I'll look into it some more

#

Do you know if Fortnite uses CSHD ?

kind ember
fading birch
#

It's speculated Fortnite does everything client side and uses a heavy amount of anti cheat detection.

crisp sable
#

no, it's instnat

#

hitscan weapons

kind ember
kind ember
# crisp sable hitscan weapons

At the very basic.
You can server rpc shot location and direction.
Have the server do the trace and look back in time of the other player past position based on ping.

fading birch
#

other than UT, is there a way to see an implementation of that? I've always done it a bit differently, so curious how that looks

crisp sable
kind ember
crisp sable
#

what's ECS?

kind ember
fading birch
#

oh hey, that's my coworker xD

nova wasp
#

we tried to create a custom datachannel to serialize entities

#

based on a component that stores a network ID to sync them

crisp sable
#

ah cheers thanks

crisp sable
#

I should look at the UT code

nova wasp
#

well, not entirely my work but I tried to help

#

yes?

kind ember
nova wasp
#

we decided to shelve it because progress was slow

#

nothing cool to show off yet

kind ember
#

Ok

fading birch
#

Oh you know mazy @nova wasp ?

nova wasp
#

nope, I think I watched this at some point though

#

I made a plugin that uses FLECS as the ECS lib

#

it's very simple to integrate

#

but serialization is up to you

fading birch
#

ah ok

#

Mazy did a custom implementation on his own @kind ember

nova wasp
#

there is also a marketplace plugin called apparatus

#

that even has blueprint support which is cool

kind ember
nova wasp
#

haven't used it much yet

#

the editor integration is the main draw

#

but I doubt it's as fancy as the popular C++/C ecs libraries

kind ember
#

Cool

nova wasp
#

I would say it's probably most effective to just keep data oriented design in mind and just make stuff instead of going crazy about ECS workflows

#

it really is the future but it's kind of a big task for a solo dev to basically reinvent the wheel here

#

if I hadn't gotten obsessed with this stuff I would be a lot further along towards finishing something

fading birch
#

i think the big difficulty comes from reinventing your mindset of programming. Especially if you're used to OOP principals

nova wasp
#

the biggest thing for me is how to define "one off" events that happen in the same frame

#

weird to think about

#

I did "hit" events as a component that gets added

#

but depending on your ECS style the component add might be deferred to the next frame!

#

I was going nuts seeing bullets pass through stuff for one frame until I realized

kind ember
#

Yea I like to learn new things.

Btw how do I go about replicating ECS Entity? Off of AACtor?

nova wasp
#

custom udatachannel

#

(in our case)

#

you need to figure out how to serialize the entity and send it over the network

#

lots of questions like if you can get away with syncing the entity IDs directly or if you have a component network id

#

if we ever get it working well I'll let you know I guess but we are probably shelving it

kind ember
#

Hm ok.
So ECS System reading AActor replicated data would defeat the purpose of ECS? I am thinking to just use Unreal replication system for the sake of easy-ness.

Are there good articles on custom UDataChannel?

nova wasp
#

nope, we are literally aping engine code

#

I imagine if you just had the ECS read the actor data you could just replicate the actors normally

#

but that's kind of a glorified ticking manager

kind ember
#

Ok gonna see how it goes.

queen flower
#

Is it possibly to do local multiplayer splitscreen with both players using mouse and keyboard?

#

I know keyboard and mouse are default player 1. Plugging in a 2nd keyboard wasd still controls player 1. Any way to redirect a 2nd source of input to the 2nd player?

#

It's already being done somewhere by default for 2nd controller going to player 2, 3rd controller going to player 3.. but not designing a game where 2 players have different controls. Want them both to be on mouse and keyboard.

#

Please @ me if anyone has things to try or has got this working thank you!

tender badger
#

not set Only Owner See...
by default, this new added IK SkeletalMesh should also be visible by other Player while multi-player ?
should i Enable the Component Replicates for the IK SkeletalMesh? but now the Component Replicates is also unchecked in the Text but it's visible by other.

#

i did more test and find the Head&text rotation, Z(stand/squat) & leg IK, Hands movement are OK.
BUT the whole body location, the Gun attached to the Hands are not OK...these are only goes into the Right state from own View; from other player's view, these are not changed...
eg. Gun is not visible from other's view; when the HMD movement value is larger than threshold, the SkeletalMesh's position will move, BUT from other's view my SkeletalMesh is still at that position & seems like the HMD(head) is trying to move to that new position BUT the other parts of body are just infulenced by the full body IK BUT not moved to the new position.

low niche
#

does multicast events only multicast the trigger of the event or with the whole code attached to the multicast event? nvm, tested it out and is only multicasting the trigger of the event

tender badger
#

multiplayer sync to server problem...

class UIKBodyComponent : public UActorComponent
{
UPROPERTY(EditAnywhere, Replicated, Category = "IKBody")
FVector BodyCurrentLocation = FVector();
}

void UIKBodyComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{...
USkeletalMeshComponent* Body->SetWorldLocation(BodyCurrentLocation);
...}

i SetWorldLocation in TickComponent, now found the location is not update in other player's view while multiplayer, seems also not update in server. Using DedicatedServer from unreal tutorial.

thin stratus
#

Where are you updating that variable though

#

And is that component replicated

tender badger
#

in TickComponent, just before SetWorldLocation

#

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "IKBody")
USkeletalMeshComponent* Body = nullptr;

#

not yet

#

UPROPERTY(EditAnywhere, BlueprintReadOnly, Replicated, Category = "IKBody")
USkeletalMeshComponent* Body = nullptr;

#

should i change to this?

thin stratus
#

No

#

The UIKBodyComponent class itself has to be set to replicate.

thin stratus
#

And i also assume you added the vector via DOREPLIFETIME macro in the GetLifetimeReplicatedProps function

#

You might want to give us more code

#

Too much guess work required

tender badger
#

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class UNREALBODY_API UIKBodyComponent : public UActorComponent
{

#

this?

#

all the variables that Replicated must DOREPLIFETIME ?

#

DOREPLIFETIME(UIKBodyComponent, USkeletalMeshComponent * );
DOREPLIFETIME(UIKBodyComponent, UPrimitiveComponent * );
DOREPLIFETIME(UIKBodyComponent, UCameraComponent * );

#

these ptr also need to DOREPLIFETIME?

chrome quest
tender badger
#

ok

#

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class UNREALBODY_API UIKBodyComponent : public UActorComponent
{
GENERATED_BODY()

public:

#

is this need to modify ?

#

and i found the Gun attached to the Hand, the pickable cude, these are still keep the original position and state in other player's view...seems also not sync their state to the Server, even to the other player.

chrome quest
#
class YOURMODULE_API UHInventoryManager : public UActorComponent
{
    GENERATED_BODY()
public:
    UPROPERTY(Instanced, BlueprintReadWrite,EditDefaultsOnly, Category = "Container Structure", Replicated)
    TArray<UContainer*> ContainerStructure;

protected:
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;```
#

an example of how you would do it.

#

in your header file

#
void UHInventoryManager::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    DOREPLIFETIME(UHInventoryManager, ContainerStructure);
}```
#

in your .cpp file.

#

@tender badger

hollow saffron
#

Are actors the only type you can control net relevancy for? Anyone know if there is a way to control relevancy for sub objects of an actor shared via ReplicateSubobjects ?

chrome bay
#

Just actors

#

subobjects piggyback off of the actors' channel.

wheat magnet
#

slice procedural mesh is not working in multiplayer

wheat magnet
#

i mean the slice cutting is not showing in mutiplayer

spark owl
#

Does anyone know about setting up microtransactions with inventory?

#

like where would I get started if I wanted to know about that

#

particulary, transactions using steam wallet

chrome quest
vague fractal
#

I kinda wonder.
If you are doing smth like this here

Server_DoSomething();

Where the definition looks like here

void Blah::Server_DoSomething()
{
  Server_DoAnotherThing();
}

Will the Server_DoAnotherThing(); call be another RPC or will it avoid it since it knows it's already the server ?

wheat magnet
#

screenshot 1

#

screenshot 2

#

i'm already doing RPC, this is running on event tick