#multiplayer

1 messages · Page 329 of 1

wary willow
#

@crisp maple ?

#

How are you doing it?

crisp maple
#

Ive tried begin play from the character, a custom event in the game instance, and begin play from the level

wary willow
#

heh

crisp maple
#

I guess basically I've been trying to trigger an event on the creation of something (like a character or map) and that does multiples for each player

wary willow
#

Why don't you just ask the server then?

#

Since it's already keeping tabs on stuff

crisp maple
#

Do you mean a get player array from gamestate?

wary willow
#

So, do you know exactly how many "multiples" of each character are occuring?

#

If you only ask from the server, it will only count the server PCs currently connected

#

Also, let me check, pretty sure there's even a simple GetConnectedPlayers

#

Or GetNumPlayers

#

that's it

#

That should be in GameMode

#

Had to look at my project real quick

crisp maple
#

Its a summation kindof. I can't think of a proper mathematical term for it... but if I had three players it always gets triggered once for the current player, twice for the next player loaded on the client, and three times for the third player loading in. If that makes sense, lol

#

Each time a player loads it redoes all of the code, lol

wary willow
#

Sort of, there are technically multiples of each actors in the game

#

One for the server, one for the client

#

each client

twin juniper
#

@wary willow GetCurrentPlayers() is broken

wary willow
#

@twin juniper Are you sure? Pretty sure I used it in 4.14 and it worked

twin juniper
wary willow
#

Or else my whole logic would have failed

#

Hmmmmmmmmmmmmm

twin juniper
#

it always returns 0

wary willow
#

Oh

#

Yeah, that one is

#

Not the one I just said though

hasty adder
#

Weesley

#

@crisp maple can you show the code

#

And where is it which bp class

crisp maple
#

Honestly I've tried a bunch of things and its a huge mess. I'm going to just clean it up and work it out on paper to see if I can learn what I'm missing here

hasty adder
#

Depending on what your goal is. There are likely options. So context would help :9

crisp maple
#

True, the goal is to make a health bar for each member of the party, similar to dragon age. I really just need to figure out how to reference each players name and health, then create and update the widgets associated with their health bars

hasty adder
#

So the widget will add and update the panel for each party member when it's created

crisp maple
#

yep

hasty adder
#

Each panel should be linked to each player. I would approach this much like you would a score board

#

So let's see where your at. Do you have a separate widget for the single player That'l be added to the scroll box or whatever of another widget?

crisp maple
#

Yep, I have seperate widgets that get added into a vertical box

hasty adder
#

Ok so the problem is purely you want it to create the widgets and add children just once

crisp maple
#

Yeah, basically

hasty adder
#

But your getting multiples.

crisp maple
#

yep.

hasty adder
#

Ok this sounds like how and where the widgets are born

crisp maple
#

Yeah, I dont think I understand when and where I should be calling whatever creates these widgets

hasty adder
#

Because rl realistically it should all be on the controller as it can request the playerer array and then iterate on that

#

And t stays local to that player and doesn't tell other players to update there widget because he is so to speak

#

If that is fine and dandy here is one thing I always forgot to do. If I'm building a list of widgets to add as children clear children and arrays before running your logic

#

So it rebuilds with current

#

I dunno if this will be helpful but I have a old old video of sorting scores which involves building arrays from such info

crisp maple
#

I'll give it a try. I definitly agree, I'm just missing something basic here. I don't know what I'm missing, so I can't explain it well.

twin juniper
#

why is it that when i send a UInstancedStaticMeshComponent* to a ClientRPC it becomes nullptr

#

i even tested it

#

if(mycomponent != nullptr)

brittle sinew
#

The component still needs to exist on the client at the time you send it; passing it as a parameter simply allows you to refer to the same object on both settings

#

If it doesn't exist in both settings, you'll get a nullptr

#

And from a quick search online, it appears ISMC doesn't support replication

twin juniper
#

yea

#

but ive seen people be able to call UpdateInstanceTransform()

#

and set the scale to 0

#

on a per instance basis

#

so what do you propose they did?

#

Basically, how can I update the scale of the instance for all clients if i am unable to access the ismc

brittle sinew
#

If the components are on a replicated actor, you could use the actor as an intermediary to have them access their local components

slim holly
#

I actually got around that by replicating the actor with ISMCs, but instead of replicating I use RPC trough controller(which has reference to said ism actor) to drive the transforms

#

but then again I have a system in place where server controls the local ISM actors anyway

plain flume
#

Does this mean that everything in GameState is automatically replicated? Even variables?

hasty adder
#

If an item is set in gamestate to replicate I believe it replicates to clients unlike a character where that means it's replicated to server

#

Check exi guide it's pinned to chan

slim holly
#

only default variables, you need to set custom variables replicated too

#

^ exi's guide will probably answer 99% of your questions

plain flume
#

thanks

twin juniper
#

Hi everyone... Are there any "best practices" on how to do multiplayer? Any resources for that?

severe widget
#
  1. Check the pinned messages.
  2. Do it from the start if you can, try and get things working with a dedicated server in PIE even if you're going to use listen servers.
twin juniper
#

Ok, will look into that, but there aren't any example cases like "how to replicate a widget" or "how to replicate a animation" or "how to replicate a actor with child actors" and stuff?

severe widget
#

@hasty adder variables are only ever replicated down. You have to use RPCs to send info to the server

#

@twin juniper if you replicate state and then base your anims/widget off the state, then you have "replicated a widget"

#

As for the child actor thing.... depends on if those are just part of the actor or attached later.

twin juniper
#

Well I do replicate the state of the anim, but sometimes it replicates the anim and sometimes it doesn't and this is very very confusing

#

I can debug and fix singleplayer-issues pretty fast after 1 year of experience, but multiplayer is really something you have your wrap your head around

severe widget
#

Yeah. All I'm saying though is that you can't really directly replicate those.

#

So its a lot easier to just replicate the state which you can derive the clientside stuff from. I guess anims aren't fully clientside, but still. Replication of actor state should solve that.

#

So if you never see, say, walk backwards anim on simulated proxies, then that means that you're not replicating some bit of state that the animBP uses to play that anim

#

If you're looking at adding MP to a project, I recommend making a practice project

twin juniper
#

I have issues with my motion controller grabbing animBP and this only depends on one state, the "grip state". I don't know if motion controller replication is also troublesome with their animations, because I know that you have to replicate the motion controllers manually which I did.

severe widget
#

Can you post some screenshots/snippets?

twin juniper
#

I guess I can't and that's the bad thing =/ My boss wouldn't like me to show snippets of our current project, because it will be part of an expo soon (and no, I didn't sign any NDA, but I can see his point)

#

Singleplayer-wise everything works fine. I guess I have to study all those multiplayer-related stuff again and restructure the things that do not fit right now

wary willow
#

SO you didn't build teh game from the ground up with Multiplayer in mind?

severe widget
#

Well if you've got the grip state set to replicate, try having a function that runs on server that the owning client calls when they grip or release, then set the variable both on the OC and the server.

#

If you haven't already.

twin juniper
#

@wary willow well my boss did not tell me that it will have multiplayer in it, so I did not have multiplayer in mind when I started it

severe widget
#

You can, of course, just set that server-side... but if you don't want ping to factor in you should set it on both.

twin juniper
#

If I had known, then I would have build it from the ground up with MP in mind

#

Currently it's 01:34 at my place and I don't have VR at home, so I can not try and test things. But I would like to read up some stuff, like those "best practices" to evaluate on how to restructure my mistakes

twin juniper
#

Just to make things clear again, because I'm a bit confused:
"Replicated" Variables and "(Component) Replicates" are used to transfer information from the server towards the client and not vice versa?
If the client wants to send it's information towards the server it needs to use a RPC. Is that correct?

severe widget
#

Component and actor replication flags, AFAIK, just allow for the properties of those to be replicated- each var needs to also be marked for replication. At that point, its sever -> client (always)

plain flume
#

Hmm. Anybody used RestartPlayer in gamemode? I try to do this

#

But nothing happens. I read that it should destroy pawn and spawn a new one like the fresh start

hasty adder
#

I user ResetPlayers bp node

rare cloud
#

@plain flume, it's a single player game ? why use PlayerCharacter 0 ?

#

I mean your function is ok for player 0 but only this one x)

#

make sure you call it server side

#

GM only exist on server side

plain flume
#

hmm, isn't PlayerCharacter 0 always the default one unless it's a local multiplayer game

#

in Multiplayer everybody is player 0

#

and it is a multiplayer 😃

woeful garden
#

Should Multicast go throught one function, like Shoot() which will lead to another functions, or should each function be multicasted on its way?

stone lintel
#

@woeful garden One function is enough

twin juniper
#

So If I have a turn-based multiplayer setup and I want to tell the next client that it's his round (via a custom reliable event run on the server inside of my gamestate), then I can set some custom "my turn" boolean-variable which is replicated and inside of my pawn/player controller to "true", because the clients will get the replicated data anyway. I don't need to multicast this, do I?

brittle sinew
#

@plain flume No, you have no guarantees of a certain pawn being index 0, you're probably thinking of player controllers on clients

#

Is this function on the client or server?

#

I know that a lot of people say that the local pawn is index 0 or something similar, but that's not true. Usually that'll be true for 99% of the time before pawns are reset, but that's just due to a timing thing, there's no guarantee of that.

#

Additionally, since you're already in the character, why not use this? Or is this a static function? It can't be static, you're using this on the first line :p

twin juniper
#

Hmm but you could get the local player controller index 0 and then get the controlled pawn. So you will always get the desired local pawn, don't you?

brittle sinew
#

If you're on the client, yes

#

But I'm confused as to why any of this is necessary since we're already in the character 😄

twin juniper
#

What might be the reason, that my client is able to "click" a button via widget interaction and show the "pressed"-state but not actually firing the connected event?

bitter radish
#

Hey guys who is really interested in multiplayer blueprint?

twin juniper
#

I guess I am xD

hasty adder
#

Spawn widgets to the character owner controller so it is nice and local to them like it should be 😃

twin juniper
#

Hmm can you reassign the owner of a 3D widget?

#

Because I would like to have one 3D widget in world space which shows the players current data (which works, but it doesn't receive input)

wary willow
#

@twin juniper ?

#

I think I know what you mean

#

And if so, just use a collision overlap?

#

which will get the reference, and in turn the controller for that player

#

I did something similar in my 1v1 VR game

twin juniper
#

@wary willow yeah, sounds reasonable. But doesn't that also override the owner if both players overlap the collision? Or can you sort it out by checking for locally controlled?

wary willow
#

@twin juniper Well, you didn't say two players could overlap it

#

but, I am sure you could figure out the logic

twin juniper
#

Well they can 😅 they are free to move around

#

Sorry for not mentioning it

#

I will look into the ownership then :) thanks

hasty adder
#

Oh 3D widget

twin vault
#

normally the dedicated server and the clients will be the same project?

#

the same game

brittle sinew
#

Yep, if you need to insert special things into the server only you can check for UE_SERVER I believe, or you can separate it out into modules

#

Having separate projects just leads to versioning hell though

twin vault
#

great

#

thanks

stone lintel
#

Do we have some kind of debug to view NetCullDistance in level?

#

Right now i'm only guessing, test and retest and retest ☹

twin juniper
#

so when u set a component to replicate

#

what exactly is it replicating

#

or enabling

tough gyro
#

don't replicated primitive values (integers, floats, bools etc) replicate just fine without any authority checking or RPCs?

twin juniper
#

@tough gyro when you run stuff as a server and have values replicated, then they will get send to the clients. If you run stuff as a client you will need RPCs to bring the desired values/information to the server so the server can replicate them

#

nothing will replicate by itself

tough gyro
#

right, I remembered wrong then 😄

#

cheers

twin juniper
#

@twin juniper Well your actor needs to have "replicated" checked as well as your components. If you do not replicate components, then the changes made on the server side will not be visible for the clients, because the server determines who sees and knows what. Sure the clients will also load the actors and components, but if you shoot a box which is not checked as replicating, then the box will for example fly away on the server but the server will not tell the clients that the box got shoot and hence moved

#

i know that

#

but what exactly does component replication do

#

it replicates the specific component when the actor is also set to "replicated"

#

if your actor is replicating but one component is not, then the changes of this non-replicating component will not reach the clients

#

@twin juniper or what do you want to know?

#

yeah i know all of that xd

#

how is component replication diff from actor replication

#

why would u do it on a component instead of the base actor

#

to keep things modular and to only replicate the things which you want to have replicated. Maybe you have an actor with many components and you don't need every component to be replicated. Every replicated information is netload and the less netload the better the performance

#

If your actor is not that complex and you need the components to replicate, then just check everything as replicated ^^

#

@stone lintel You can just apply a collision sphere to your actors that has netculldistance/2 set to radius for the spheres

#

Hey how do multicast functions work with network relavancy? Is it actually for ALL connected users? Or only connected users which are also relavant?

brittle sinew
#

The latter

twin juniper
#

that's what i thought.

#

so really, we only want to use multicast functions in very specific situations and limit their use as much as possible.

brittle sinew
#

I guess you could say that, but I mean it's not like they have a direct alternative (replicated variables with RepNotifys can sometimes serve the same purpose, but not always)

twin juniper
#

nvm lul

#

i read that wrong, man sometimes i make myself look like an idiot

plain flume
#

Any idea why all the clients just freeze when i add this to code? If i remove the function, everything works.

#

the bAreWeDead works if i force the boolean to change. But the characters ain't doing anything, except the server 😃

elder ravine
#

anyone here know how i can properly replicate this? It works now on the server, and the server sees the client rotate, but the client doesnt see itself rotate

twin juniper
#

@elder ravine I guess your pawn has "replicates" checked? You run the second event on the server but maybe you have to multicast it from the server to the/all client(s) to get it to work?

elder ravine
#

You mean i need to Check the Replicate on my Bp_PlayerCharacter? which is my pawn

#

i think its not checked atm

twin juniper
#

yes. I guess pawns/charakters are replicated by default but checking those checkboxes is always a good idea

elder ravine
#

okay ima try that right now

#

and everytime i try to multicast the second event, then the Client Camera glitches into the map

#

even with Reliable unchecked

brittle sinew
#

Remember that talk we had about multicasting on the PlayerController?

#

😄

elder ravine
#

ohh hey Lethalclips

#

ye i remmeber that, but i didnt understand it

twin juniper
#

Multicasting inside of the pawn is better I guess

#

Never did a multicast inside of a PC, I think

brittle sinew
#

TLDR: don't do it

elder ravine
#

@twin juniper so i need to move all of this logic in my BP_PlayerCharacter, which is the pawn

proud hemlock
#

whats the issue multicasting in PlayerController?

brittle sinew
#

The PlayerController only exists on the server and the relevant client, not all clients

#

When you multicast on it, best case scenario is only one client receives the RPC.

elder ravine
#

LethalClips, if i send you my project, in a zip via Dropbox

#

could you fix it for me?

brittle sinew
#

What usually happens is the controller freaks out and depossesses its pawn

elder ravine
#

I'll compensate you for it ofcourse

brittle sinew
#

"Fix" the project is pretty open-ended 😄

twin juniper
#

xDDDD

elder ravine
#

well i mean like, just get the replication to work xD

#

currently the server sees everything

#

but client wont see own rotation

twin juniper
#

@elder ravine I know that multiplayer-stuff is tedious, but I would recommend you to wrap your head around those topics ^^

elder ravine
#

@twin juniper ye im trying xD

brittle sinew
#

Just curious, I see your pawn is a character in the top tab, why not use the CharacterMovementComponent?

#

It does all this stuff automatically

twin juniper
#

I don't know multiplayer-stuff that good as well, but I'm also trying ^^ Learning by doing and fail faster to learn from your mistakes 😉

elder ravine
#

what could the CharacterMovementComponent solve for me in this instance? What im trying to build is a topdown shooter, in which you control the character with WSDA, and the player always looks at the mouse position

#

How could i fix this with CharacterMovementComponent?

twin juniper
#

@elder ravine I guess the CharacterMovementComponent handles most of the replication by itself

elder ravine
#

thanks for the advice @twin juniper

brittle sinew
#

Yeah, it handles pretty much all of the replication for you

elder ravine
#

mhh but i dont really get it

#

can i just call that?

twin juniper
#

@elder ravine It's a component

#

you have to add it to your pawn

elder ravine
#

ohhh

brittle sinew
#

It should already be there since you have a character :p

#

Unless you named something that wasn't a character a character

elder ravine
#

no i didnt do that

#

ye i see the componnent here, and i clicked it

#

this is where i can change stuff liek movement speed n things

#

i dont see anything in the CharacterMovementComponent that makes the player always look at the mouse location

brittle sinew
#

Well no, it won't fix everything for you instantly

#

But making use of it will be much easier

#

IIRC you can just set your controller's rotation on the client and have the change propagate to all clients, since you have a proxy on the pawn

#

You can keep all of your current look at logic, you just need to use the CMC to do the actual movement and replication

#

Well, you don't need to, but it would help 😄

#

I know you've been on it a while—if you really try and can't get it, feel free to send the project over and I'll give you a little direction, don't worry about paying or anything

warm pagoda
#

Not even C++. 😉

#

C#

#

*.cs files are C#

#

Unreal's UBT, the Unreal Build Tool, reads C# files that describe modules of code.

#

Targets, too.

#

Which are different.

#

You have some *.target.cs file that is using the older SetupBinaries method

#

You should open the file and look at the SetupBinaries method.

#

See what it's doing in there.

#

That will help to inform what you need to instead add to the ExtraModuleNames array.

viral mason
#

ShooterGame is ark survival evolved's game name

warm pagoda
#

There you go. Remove that whole method, and just do ExtraModuleNames.Add("FinalShooter");.

#

In the constructor.

#

That's what it's telling you to do.

#

Replace that whole method with doing the equivalent, in the constructor, using ExtraModuleNames.

#

The whole SetupBinaries method needs to be removed.

#

The whole entire method.

#

The whole thing is deprecated.

#

S'alright. This is C# but it should look very, very similar to C++.

#

And a lot of knowledge transfers.

#

Yes, that's right.

#

Your formatting is all over the damn place, but otherwise, that's right.

#

NP

native moth
#

When the server fires Client_AddItem it all works

#

but when a client fires Client_AddItem, Server_AddItem is never executed

#

the actor is set to replicate and the Client_AddItem is requested from a widget

native moth
#

Got the issue! appearently the blueprint didnt recieve the correct owner

night jay
#

Anyone tried netprofiling their game?

#

mine's pretty bad

#

The spikes are random actors replicating random variables that have nothing to do with the actor that's replicated

#

For example the player controller is replicating the weapon spread when it's not referencing it in any way..

#

I have no idea why

plain flume
#

@inner iris i think some of the server tutorial is old now

#

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class ScoreboardServerTarget : TargetRules
{

public ScoreboardServerTarget(TargetInfo Target)

   {

 Type = TargetType.Server;

  bUsesSteam = true;

   }

    //
    // TargetRules interface.
    //
        public override void SetupBinaries
        (
         TargetInfo Target,
         ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
         ref List<string> OutExtraModuleNames
         )
           {
            OutExtraModuleNames.Add("Scoreboard");
           }

}

#

Not sure if your had this one, but this works now. Just change the Scoreboard to something you have

inner iris
#

Thanks @plain flume

The person who wrote the guide originally was kind enough to help me out- needed a delete / refresh and also was able to replace the Server.target.cs with the one from the updated 4.16 ShooterGame and it all worked nicely

#

The final script looks like this:

 using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class FinalShooterServerTarget : TargetRules
{
 
    public FinalShooterServerTarget(TargetInfo Target) : base(Target)

    {

        Type = TargetType.Server;

        bUsesSteam = false;

        ExtraModuleNames.Add("FinalShooter");

    }


}
#

Anyway all working on an Amazon EC2 instance- small victory but feels great!

plain flume
#

Aah good thing you got it working :).

#

I asked this yesterday, but there was no answers. I try to use variable replication in C++, but when ever i type the GetLifeTimeReplicatedProps() function and set my replicated variables to there, all characters are just staying in one place. Even the server. Here you can see that spawned client ain't dropping down, it just floats. In Blueprints, everything works. Any idea what to do?

brittle sinew
#

Try calling Super::GetLifetimeReplicatedProps

#

When you're overriding an engine function, 95% of the time you'll want to call the parent function or stuff will go awry quickly

plain flume
#

Aah. Right. Thanks! That did the trick.

woeful garden
#

My function is being looped by multicast, which is called on PlayerInput IE_Pressed, should Inputs be replicated?

twin vault
#

i managed to get the server working

#

but i cant connect with a client

#

following a wiki tutorial

#

is using open level still the way to do it

#

nothing happens

#

trying from the standalone

warm pagoda
#

Using an address as the level name seems super sketch.

#

But I am not familiar.

#

Though I'd believe it - that's probably ancient sacred and inviolable legacy from the earliest days of Unreal.

#

So... I can't answer you but I'd be suspicious of arbitrarly passing anything other than a path to a level asset to "level name".

#

(While also not at all being surprised if passing things that are not, in fact, the names of levels to "level name" is actually allowed.)

twin vault
#

yeah

#

tried with console command > open too

twin juniper
#

how can i set a timer on the server, to do something on clients. For some reason, when I make a change to a instance static mesh, and make changes to an instance (for example, set scale to 0,0,0), the client will update collision. However, the mesh itself will not change on clients. Second, if I try to do a multicast and pass the component as a param, it returns nullptr. Lastly, if I do it as a Client RPC then it works fine and removes the instance on the client (but only if its removed on the server first). My last issue is that after removing it I need to be able to change the scale back to 1,1,1 after X time. Any ideas? Help would be greatly appreciated. I have been dealing with this issue for about 2 weeks now. 😦

hasty adder
#

ok

#

I'm back lol so much for brb this morning at like 10am

gaunt kestrel
#

gah dang netowrking is hard

#

so satisfying tho

zinc loom
#

@twin vault - a few things - open level isn't the way to do it with onlinesubsystemsteam - you can do it with open using onlinesubsystemnull tho

#

if you're testing steam you have to have seperate computers for sever and client

twin vault
#

oh

zinc loom
#

to do it with steam, you have to auth it against steam, and register a session, then that will let you search it out on the client, and join the session to connect

#

not sure if i'm misinterpreting this wiki, but im also not sure if its possible to do dedicated steam servers 100% in blueprints

fringe dove
twin vault
#

No problem

#

gonna try it tomorrow

#

thanks for the help

fringe dove
#

(attachment sets ownership automatically too)

night jay
#

@fringe dove I'll look into it, thanks!

twin juniper
#
void UVeritexFoliageInstance::Client_DespawnFoliage_Implementation(int32 Item)
{
    
    FTransform OutTransform;
    GetInstanceTransform(Item, OutTransform);

    FVector Location = OutTransform.GetLocation();
    FQuat Rotation = OutTransform.GetRotation();
    FVector Scale = FVector(0, 0, 0);

    FTransform NewTransform = FTransform(Rotation, Location, Scale);

    UpdateInstanceTransform(Item, NewTransform, false, true, true);

}

bool UVeritexFoliageInstance::Client_DespawnFoliage_Validate(int32 Item)
{
    return true;
}```
#

why does this work

#

but not this

#
void UVeritexFoliageInstance::Client_RespawnFoliage_Implementation(int32 Item)
{

    FTransform OutTransform;
    GetInstanceTransform(Item, OutTransform);

    FVector Location = OutTransform.GetLocation();
    FQuat Rotation = OutTransform.GetRotation();
    FVector Scale = FVector(1, 1, 1);

    FTransform NewTransform = FTransform(Rotation, Location, Scale);

    UpdateInstanceTransform(Item, NewTransform, false, true, true);

}

bool UVeritexFoliageInstance::Client_RespawnFoliage_Validate(int32 Item)
{
    return true;
}```
#

It can scale down, but not up?

fallen goblet
#

How does UE4 handle IPV6 addresses? When executing the console command Open "some ipv6 address" it gives the following error: "Name may not contain the following characters: :" seems kind of weird as ':' is required for any Ipv6 address?

#

I did find in UE's source code that they want to list ipv6 addresses surrounded by square bracks like [ipv6-address], but then I still get a host name resolution failed error (code 48) and the following reported remote address: "Sending hello. [UNetConnection] RemoteAddr: 0.0.0.0:7777, Name: IpConnection_4, " suggesting it still uses ipv4

twin juniper
#

i dont think it has support for ipv4 addresses

#

lol

fallen goblet
#

ipv4 or ipv6?

#

I looked at some patch notes and they do mention ipv6 multiple times

twin juniper
#

it might be possible

#

i dont see why u would want to do it that way though

#

unless u are running a strictly ipv6 network

#

because as far as i understand, ipv6 is still not the standard.

#

It's just a secondary alternative.

fallen goblet
#

hmm, still; quite a few people will have ipv6 so it feels weird to not include them in the final product. I've been assigned an ipv6 address myself as well, which makes testing kind of annoying if it doesn't support it 😛

twin juniper
#

yeah

#

u should be able to do it locally though

#

like if u have a local copy of your project

#

just use your local computers setup

#

and setup ipv4 on lan

#

lol

fallen goblet
#

yeah, but I want it to work on external machines 😃

#

everything works locally

twin juniper
#

if u are using OnlineSubsystemNull its setup to only work on LAN

fallen goblet
#

wait, no way xD

#

that would explain some other issues as well

twin juniper
#

Lol.

#

@brittle sinew So good news by the way

#

I've been able to fully replicate the instance component

#

IT ALL WORKS

#

HOLLLY CRAP

sweet spire
#

How do u smooth nrotation over a network

#

its not like velocity witch can be predicted is it

viral mason
#

"witch"

twin juniper
#

so when trying to replicate an animation

#

what should i be replicating

hasty adder
#

Whatever drives it if it's in the anim bp. But if it's a one off I think your executing on server the animation. I drive all mine with bools anyway so not sure about the others ways

#

I like to think everyone has the copy of your anim bp. And will know if your walking or is falling etc... So if I'm replicating a change in a bool then there copy of my animBP will change its state accordingly on there side so as long as I replicate the bool change right

unreal bison
#

Anyone can point me in the direction where i can get info on how to allow player transitions between say map1 and map2 and map2 is a dungeon instance sort of thing? But still allow players to stay on map1 who dont want to goto map2

stone lintel
#

@unreal bison Haven't used it but try take a look at AGameMode::SendPlayer

#

Maybe it's what you're looking for,, maybe 😃

#

It turns out it's deprecated on 4.14,, u must use ClientTravel directly

unreal bison
#

Ok im not the best coder but ill take a gander at that

mellow cipher
#

Can the server run multiple maps though?

twin juniper
#

Afaik no?

#

I believe you need to open a new session

mellow cipher
#

Unless you stream the maps and have 1 persistant world

#

Thats what I would do

twin juniper
#

I don't think level streaming works over steam, but correct me if I'm wrong

mellow cipher
#

It works everywhere?

twin juniper
#

Only streaming levels for certain clients

mellow cipher
#

You would need to stream it as the server too

twin juniper
#

Yes, and I guess that's fine if it's dedicated

mellow cipher
#

Yea you would have to use a dedicated server

#

Just like how world comp works

#

If the host leaves a map bad stuff happens

warm pagoda
#

@twin juniper Level streaming has nothing to do with Steam.

twin juniper
#

I actually came here to talk about dedicated because of the redundancy I have to write because of a client running the server

#

@warm pagoda No you're right, I was thinking of something else

warm pagoda
#

Maybe client travel to different servers? Maybe that doesn't behave well with Steam server browser stuff?

twin juniper
#

No you can't find other sessions when you're connected to one

#

And it always seems to take a good while before a player has registered as "not in session" with steam

warm pagoda
#

(I didn't mean server browser, but the joining a friend's server via Steam interface thing.)

mellow cipher
#

UE4 steam online subsystem sucks #UseUWorks

warm pagoda
#

Ah

twin juniper
#

Oh, yeah no that only works if you're not in a session already

#

But I got the invitation to work

#

And you can invite while you're in a session

lost inlet
#

uworks is ok if your game only needs steam and never anything else

#

since the point of an online subsystem is to abstract out the platform specifics

#

i ended up just modifying the existing steam OSS a bunch

#

like removing the P2P for dedicated because that's a thing for some reason

glad sedge
#

newbie question

#

Is OnTick automatically replicated?

fossil spoke
#

Tick is called on every instance of an Actor regardless of network authority

glad sedge
#

cool thanks

#

diving into some multi

glad sedge
#

Ah what's a good place to start with C++ and networking? Most of the tuts I see are from way earlier versions

stone lintel
#

@glad sedge Shooter game is the best example for C++ networking, and for a start maybe Exi's compendium can help you, it's a pinned message you should check it out

glad sedge
#

oh that's what that is.

#

Ah cool. Okay thanks

glad sedge
#

@stone lintel the FPS or the twin stick ?

stone lintel
#

@glad sedge The FPS

glad sedge
#

I don't see much in the way of C++ implementation - must just be with BPs? Though it's not overly complex.

dapper galleon
#

@glad sedge Do you understand Blueprints and networking? There's nothing more to find out with C++ about networking, at least the simple part of networking

glad sedge
#

Well I understand BPs, but networking is new to me.

dapper galleon
#

I would recommend understanding network using Blueprints, at least at the beginning

#

if that's your case

glad sedge
#

and I'm working within C++ so I was wondering if there's any big differences.

#

Yeah might be an idea

dapper galleon
#

I like the GenericShooter project, take a look

glad sedge
#

kk thanks

dapper galleon
#

Oh, now I'm not sure. GenericShooter is at $65 now, so see if that's worth for you. 😛

glad sedge
#

ugh

#

I'l lsee if it comes to that - some very good tuts are out there

dapper galleon
#

Definitely start with the compendium, you shouldn't have to use C++ to understand UE4 networking. Good luck =}

glad sedge
#

oh wow, this is great

dapper galleon
#

you should be able to do every basic networking stuff inside BP, even create and find Steam sessions. But you'll find the need of C++ when you feel limited about what's available to you in BP. At this point, you should be familiar with UE4 networking.

mental glacier
#

hey guys i've wasted too much time trying to learn how to implement Voice chats in ue4 made games >>> do u have any tutorials that can help me ?

twin juniper
#

How reliable is multiplayer-testing in the editor compared to "real" testing with a packaged version and locally connected pcs, assuming that the clients always finds the server? Which information are reliable from the editor multiplayer and which information are not? Are there any experiences?

#

@mental glacier look up proteus multiplayer template. He has voip implemented and you can look into the project files to understand how it works

twin juniper
#

Does nobody know the answer to my question? =/

pearl pollen
#

From what I saw, there can be a lot of differences between a dedicated server and a server hosted on a client

#

So it depends on the way you're testing your multiplayer

#

The whole replication thing is kinda tricky and works differently (assuming it works at all) in both scenarios

hasty adder
#

Don't trust in editor. Least build it out to test internally

timid pendant
#

Has anybody here created a node.js master server so that the player can request a server list from it. Im learning how to do this with the VA Rest plugin

brittle sinew
#

I've done simple webdev stuff like that, setting up a basic REST API shouldn't be that difficult

hasty adder
#

I've done that using php

#

And MySQL

brittle sinew
#

Yeah, you could do it any number of ways really

hasty adder
#

Tho "real" programmers would scoff at how I report my heartbeats 😃

#

Url embedded parameters lol

brittle sinew
#

I like Sails, it even has blueprints kappa

hasty adder
#

Reminds me is there a way in blueprint to get the port the null oss has picked if the default is taken?

#

I try to avoid unneeded plugins 😃

sweet spire
#

hmmm whats the process for replicating projectiles?

#

U spawn them on the server obviously, but then how to u handle clients seeing it?

brittle sinew
#

If it's a replicated actor, you're pretty much done

#

Other than prediction and smoothing if that's something you want to implement

#

Make sure the relevant components are replicated as well

sweet spire
#

Hmmm

#

I cant get it to smooth on the clients

#

Second i get homing target it gets jottery af

#

hmm

#

jittery*

#

Okay i am an idiot

#

I forgot to replicate the target

#

So the missle was trying to go one way on the client and another way on the server

#

lmao

wet lion
#

Hi, does anyone know if in general it'd be better to use multicast rpcs or repnotify with a min and net freq of 20?

#

(for cases where either way would work of course)

stone lintel
#

@wet lion we use multicast if we want replicate something which is not persistent through game for example in a case like visual effects this (animation, particles, etc) because it's only affect clients who are network relevant at the moment multicast is broadcasted. On the other hand use RepNotify if the replicated variable is persistent through game, so if there's a client who's not in network relevant at the moment, he will get the replicated variable later if he becomes relevant again through RepNotify. For example you could use this for a variable like bIsDoorOpen

wet lion
#

so a pickup should still be repnotify right? cause if not an actor not net relevant would otherwise then see the pick up

#

if it had previously been picked up by someone else

#

Meaning, even though once picked up the pickup goes away, it might need a repnotify picked up to then destroy itself

#

assume a unique not respawning pickup

stone lintel
#

AFAIK if you destroy the pickup actor in server with bForceNetUpdate = true it will get destroyed on client as well if server is the owner of that pickup actor

wet lion
#

@stone lintel I'm trying to figure out the best approach for a scenario in whic a pawn can pick up an object.
But the object takes time to pick up (i.e. pick up button held for x seconds) and picking up can be aborted.
While a player is interacting with the object, no other player can interact with it.

#

I can think of this approach:

A: Start Interaction:
1- local controller, on some key press, calls "StartInteraction" on local pawn. This is an RPC->Server.
2- server pawn checks if an internal var "OverlappingObject" is valid.
3- if it is, it sets a repnotify "InteractorID" in the server version of the object being interacted with. [see note]
4- all versions of the object (server and client) do something based on the event.

B: End Interaction:
1- If local controller releases the key, it calls "EndInteraction" on local pawn. This is an RPC->Server.
2- server pawn sets a repnotify "InteractorID" in the server version of the object being interacted with to a sentinel meaning "none".[see note]
3- all versions of the object (server and client) do something based on the event.

C: Interaction Complete:
1- If x time goes by in the server from when Start Interaction happened, server version of the object sends Multicast RPC
2- all verions of the object (server and client) do something based on event, followed by destroying themselves.

[NOTE] I would set an int ID instead of the pawn itself. Then each client would iterate over GameState->PlayerArray to find the right PlayerState
based off the ID and from the PlayerState grab the right pawn (my player states have a local ref to their pawn and a custom ID).

This is cause otherwise I think sending a pawn ref over an rpc makes no sense. Since the pawn will not directly match a client's version of that
pawn.

My questions are:

1- Does this seem sensible? Or am I overengineering? Or getting something wrong?
2- Would it make sense to replace A.3 and B.2 with multicasts plus each version of the object having it's own local bool "IsBeingInteractedWith"
so as to prevent another player interacting with it while another player is already interacting?

#

disregard the bold. it is cause in A.3 and B.2 I put a "***" to mark the note below

#

There

stone lintel
#

wait give me time to read, i'll try to help

wet lion
#

yeah yeah no problem. Thanks!

stone lintel
#

ow this is the exact same method of interaction which i'm creating right now

#

however the way i do it, PlayerPressAndHold->Set bInteracting is true -> Server will calculate the progress as long as it's not EndInteraction same like you it's RPC. The calculation progress is inside Tick() but on server side,, if it's done.. destroy the actor.. and replicate new item for that client

#

i will assume you have some kind of replicated inventory right?

wet lion
#

as of now not, but most probably yes at some point

#

So in this case would you do multicast or repnotify for steps A.3 and B.2?

stone lintel
#

i prefer server use bIsBeingInteractedWith to prevent other interact the same object.. since you;re already checking it in A.2

#

no need to replicate who's interacting the current object.. server simply reject that client can't interact with this actor because APickupActor::bIsBeingInteractedWith is true

#

the moment client call StartInteraction, server simply check if this client can interact? if not reject

viral mason
#

Btw 0XFEDE, make sure you set the variable beinginteractedwith when you check it

stone lintel
#

at least that's how i handle it,, but i'm not sure if it's your intention

viral mason
#

So when it's false, it turns to true

#

And if true, cancels

wet lion
#

I did not get that last part. You mean the InteractorID? it's a repnotify so in StartInteraction(int PawnID) the code would do IntreactorID = PawnID followed by OnRep_InteractorID()

stone lintel
#

CMIIW you use InteractorID to prevent other interacting with same actor, is that right?

wet lion
#

yeah, but also cause the local version of the object will trigger an event on the local version of the pawn interacting too. That is why I use an id as opposed to a bool

#

to know specifically which pawn

stone lintel
#

does the event only affect the client who's doing the interaction or every client needs to know?

wet lion
#

every

#

cause I have a progress bar that shows up above the player doing the interaction

#

what I mentioned in my explanation works so far... but I was just wondering if it made sense

#

or if I overcomplicated it or missed something

stone lintel
#

Okey if it's already working then there's no problem 😃

#

However if you're wondering ..

#

about how other people would do

wet lion
#

right but maybe I was supposed to use an multicast instead... I don't know. All I read is that RPC is more expensive than repnotify. But then I also tested and to get a good response time with repnotify, the minum net freq and min net freq has to be 20 at least in my project

#

and also with rpc that it can be missed due to net culling distance, relevance etc.

#

but yeah I'm interested in how others would do it 😃

stone lintel
#

i only need this replicated variables, [(Replicated)CurrentProgress this is on actor, (ReplicatedUsing = OnRep_Interacting)bInteracting this is on pawn]

#

that's how i would do because it's the exact same interaction method which i'm creating right now, and there' progress bar as well

wet lion
#

right so you show the bar to everyone onrep_isbeingInteractedWith right?

stone lintel
#

not with bInteract

#

but with CurrentProgress it's not OnRep

#

bInteracting is for playing the animation

#

for the progress bar, a replicated variable AInteractionActor::CurrentProgress is enough

wet lion
#

right

#

in my case, each client does the progress on their own. The server only says when the interaction starts and when it ends. So the computing of time is local for the bar, for cosmetic reasons and to save bandwidth. But it is still authoritative cause the server says when x seconds finally are up.

stone lintel
#

oh i see

wet lion
#

yeah cause I was first repnotifying the progress and noticed depending on ping times and whatnot it wasn't very smooth sometimes

#

I guess I could also try doing local passage of time but based off the gameState's server time

#

but either way, just on local tick with delta time works well for me. But like I said, regardless of the local time, the server does tell the thing when the time is up

stone lintel
#

then yes, if it's working no problem then i thought you're still trying to figure it out

wet lion
#

not as in figuring out cause it did not work. But more as in, to learn more and make sure I am doing it in a sensible way.

glad sedge
#

hey I'm like half way through compendium and I have a small q

#

is a lot of network functions based inside GameState ?

wet lion
#

what is the question?

#

if you should put net functions inside game state?

#

gamestate by default has an update frequency of 10 (a pawn has 100 for comparison and I've found that for smooth replication you need at least 20 in both net and min net)

#

so that is something to keep in mind for replicated vars. For RPCs I don't think it affects

#

@stone lintel btw do you know if ticking is a requirement for rpc and replication? Cause I made a class (another one, not the one we were talking about) and in the constructor I set canevertick to false. But if I make a BP subclass of the c++ class I see that in BP the "start with tick enabled" is true anyway. As if it didn't really care about the c++ constructor. And even if I turn off the checkbox in BP, at runtime the actor replicates just fine.

#

This is cause if ticking is not necessary I might as well turn it off

stone lintel
#

@wet lion yes if we don't need to use tick we should turn it off

#

for BP i'm not really sure

wet lion
#

but is ticking needed for replication?

#

Haven't figured that out from the source code yet

#

I think it might not be needed. That it uses a different timer and dispatcher for replication and rpcs

stone lintel
#

AFAIK tick is not required for replication, bCanEverTick is only for AActor::Tick() function to be called

wet lion
#

gotcha

stone lintel
#

i think based on this
/**
* Primary Actor tick function, which calls TickActor().
* Tick functions can be configured to control whether ticking is enabled, at what time during a frame the update occurs, and to set up tick dependencies.
* @see https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/FTickFunction/
* @see AddTickPrerequisiteActor(), AddTickPrerequisiteComponent()
*/
UPROPERTY(EditDefaultsOnly, Category="Tick")
struct FActorTickFunction PrimaryActorTick;

glad sedge
#

If it's a dedicated server, I don't have to worry about PC being server do I?

glad sedge
#

Ah do I have to declare _Implementation in my header or not? I'm getting two conflicting tuts here

stone lintel
#

@glad sedge if your function derived from parent, you declare FunctionName_Implementation in header, if not you only define in .cpp

glad sedge
#

So Character, for example, is derived from Actor and therefore would require it being in the header?

stone lintel
#

what i mean is if you have a RPC function which is something like UFUNCTION(Server, Reliable, WithValidation) virtual void ServerRPC(),, you define the ServerRPC_Implementation in .cpp.. but if the subclass wants to override you declare virtual void ServerRPC_Implementation in .h file and define in .cpp as well

glad sedge
#

ok I think I understand

stone lintel
#

Btw, anyone knows if there's any html code tag like [Code] blablba [/Code] in discord?

glad sedge
#

[code]My code[/code]

#

nah

rare cloud
#

@Skifferz#3154 , @glad sedge use 3 ` on both side of your code

glad sedge
#

coolioo

keen basalt
#

how do i make something splitscreen?

#

for mobile

night jay
#

So I have a different gamemode and playercontroller in my main menu and a different gamemode and playercontroller in my game

#

How do I make use of Seamless travel when these 2 are persisting during it

twin juniper
#

@hasty adder Yeah, I know that you shouldn't trust the editor with multiplayer, but it's so damn tedious to package the game, transfer it to another pc and then try to play and test stuff out parallel on your own.... That's why I want to know which information is reliable and which isn't

keen basalt
#

If an ios game had 2 player real time multiplayer would it lag?

twin juniper
#

@keen basalt depends on how many ressources are required and if your device is powerful enough for that

#

@keen basalt you would have to test it on the device you want to develop it for to know for sure. If it doesn't lag, then you can proceed and add stuff if you like. If it lags, then try to make things smarter so it doesn't require that many ressources. To test if 2 player realtime multiplayer doesn't lag you can just put these 2 players in a empty map with the minimal amount of interaction/input to evaluate it

keen basalt
#

what do u mean resources?

twin juniper
#

@keen basalt your software needs ressources to work. It need's cpu power, gpu power, disk space and RAM etc to work properly. If you create something which is very beatiful to say it bluntly then it will most likely use a lot of gpu power for all those textures and shaders. But if you have many things to process like many many AI-driven pawns, Logic or events, then your program will use a lot of cpu power, etc.

keen basalt
#

so u mean it depends on the whole size of the game right?

#

It's relatively small btw

tough gyro
#

no, it means on how you program it

keen basalt
#

Wait what?

twin juniper
#

@keen basalt it depends on how you program or structure it. A small size program can run like shit if you program it very very poorly. But a gigantic game can run like butter if you program and test it really really well

#

@keen basalt for example. Try to make a "small" 5 minutes game but only use texture with 4k resolution or with very very complex shaders and a lot of transparency ^^ Then your project/game is small but will most likely run like shit xD

keen basalt
#

Hmmm ever play the game glow hockey?

#

What about a multiplayer version of that?

twin juniper
#

@keen basalt "it depends on how you program/structure/do it"

#

@keen basalt just because your idea is "like something" doesn't mean that it will run similarly

#

it can run better, similar or worse

keen basalt
#

so how would I make it program to the best it can be?

twin juniper
#

@keen basalt create a good and solid multiplayer-system, replicate only the information which need to be replicated and test your game according to the ressources needed (cpu, gpu, ram, netload), so you know where you can improve the performance if you need a better performance or to make it more shiny if you still have performance. It depends on what you want to achieve

keen basalt
#

this is all new to me where would u suggest I start?

stone lintel
#

Netprofiler?

keen basalt
#

Would I have to get web hosting or some shit like that too?

#

Any tutorials?

stone lintel
twin juniper
#

@keen basalt How well do you know UE4 in general? I think it would be best for you to start creating a small singleplayer game and use a profiler to get to know which things require what ressources

keen basalt
#

yeah already done that of course

#

to me it sounds like the whole thing needs resources

stone lintel
#

@keen basalt welcome to digital era

keen basalt
#

Display menu, paddle movement, ball movement physics u name it

#

o joy

sweet spire
#

someone got the .3 release notes?

#

.2*

#

nvm got em

#

weird they didnt shop up at first

twin juniper
#

What are possible reasons that two connected PCs can ping each other but can not join a session today when it worked fine yesterday.... I didn't touch the session system at all... so wtf?

keen basalt
#

their internet crashed at the same time?

#

they both subscribed to the same network at the same time and it expired?

twin juniper
#

nothing crashes

#

otherwise I wouldn't be able to write here as well

keen basalt
#

then what?

twin juniper
#

I can ping the other PC but I can suddenly not find it's session which is wierd...

keen basalt
#

whys can't it find its session?

twin juniper
#

dunno... restarting all PCs...

keen basalt
#

so how does 1 simply make splitscreen on the same camera?

twin juniper
#

@keen basalt I never did something like this but you could place two cameras into your world each with their own render target and put those rendertarget into a widget which you can put onto your screen. Inside of the widget you can then decide where you want your splitscreen to be, like top and bottom or left and right

keen basalt
#

would this work like glow hockey?

twin juniper
#

.... "it depends on how you do it" ... like we already told you. You have to figure out how glow hockey does it so you can recreate it. There is no easy "Works Like XYZ"-Button in any engine

viral mason
#

Wtf is glow hockey

keen basalt
#

nvm that so what are all the tools I would need for online multiplayer so I can put it all together?

#

it's an ios app

viral mason
#

The blueprint editor and a brain

sweet spire
#

Question for you network guys

keen basalt
#

all this can be done in blueprint huh?

viral mason
#

Most of it should be able to

keen basalt
#

would I need to pay for Web hosting?

sweet spire
#

If your sticking too 10kb/sec per player, and u have a strong line of 100mb/sec up and down, what type of player connection do u recon u could hold with 10% veriance factor?

Just out of curiosity, the UNetDriver will not throttle as there is master server control

viral mason
#

I'd recommend following some multiplayer guides

twin juniper
#

@keen basalt very very very many things can be done in BP, but with C++ you have full control if you want to create your very own fancy stuff

keen basalt
#

I was afraid u were gonna say that morpho

#

C++ is way outta my league

viral mason
#

The whole point of the blueprint editor is so it's a visual experience making it seem easier

#

Its writing C++ for you.

keen basalt
#

That's why I like it so much

viral mason
#

In a sense

#

Then do it in that

keen basalt
#

do i need to spend money on anything or?

#

Cuz this is online multiplayer were talking about

viral mason
#

Uhm

#

Do you want a peer to peer server?

#

So one client runs the game

keen basalt
#

I guess

viral mason
#

If so, then you shouldn't need to spend money on hosting

keen basalt
#

oh thank god

viral mason
#

You will need to find a way to communicate with the other client

#

Maybe Bluetooth, or local connection within your Wi-Fi

keen basalt
#

bluetooth that I can do

#

But I'm striving for online multiplayer

#

Server to server

viral mason
#

Well

keen basalt
#

If that's what it is

#

American kid vs australian kid

viral mason
#

Server to server...

#

Oh uhm

keen basalt
#

idk

twin juniper
#

Server to server? what?

viral mason
#

Server morpho*

#

Its just client to server btw eckz

keen basalt
#

I mean

#

Oh

#

Of course

viral mason
#

Server is the base running everything.

#

The client interacts with the server

#

Saying "I fired" or something

#

Then it verifies you hit on server side

keen basalt
#

That means I'm gonna need hosting or base the whole connection of the host with the better internet?

viral mason
#

Yep

#

That's a problem with ONLINE multiplayer

keen basalt
#

Hmmm which one would i recommend to cause the least lag?

#

U

#

oops

viral mason
#

Uhm, depends

keen basalt
#

Stupid phone

viral mason
#

Well, since it's UE4 I've had issues running it on Linux-based operation systems like Ubuntu

keen basalt
#

what's linux

viral mason
#

🤦

keen basalt
#

I'm new to this

viral mason
#

Its widely used for server operation systems

keen basalt
#

Whyd you choose that?

viral mason
#

Because? Its free

#

And open source for some projects

twin juniper
#

How is it possible that "Find Session" gives you an empty Session and telling you it a "Success"?

keen basalt
#

is it the best?

viral mason
#

Nothing is "the best"

#

Its the advantages you see

keen basalt
#

I'll check it out

viral mason
#

You might need a Windows based server

keen basalt
#

What for an ios/android game?

#

srsly?

viral mason
#

I'd recommend using local multiplayer for now... And get better with everything

keen basalt
#

ye guess ur right

#

but the time will come and when it does

#

Will using Linux involve having to do coding?

viral mason
#

It really widely depends on what you want.

keen basalt
#

A basic 1v1 no lag real time multiplayer game

viral mason
#

Do you want a login server that verifies your connection and saves states?

keen basalt
#

Yep

viral mason
#

An online multiplayer is not basic

#

Then you'd need to make an authentication server, which I'm not sure is possible in blueprint editor

keen basalt
#

Oh no

#

Don't say that

#

That's not true

inner iris
#

You'll have to look at sending data to the authentication server which could possibly be done with the VaRest plugin or else using C++

keen basalt
#

let's pretend c++ doesn't exsist

#

There must be a way

viral mason
#

But it does.

keen basalt
#

Grrr

inner iris
#

It's pretty important for anything custom especially with multiplayer

viral mason
#

Just hope you can find a public plugin and a public authentication server

twin juniper
#

@keen basalt if c++ doesn't exist you would never have used soooo many programs including ue4... check your level of expectation

viral mason
#

But I doubt that exists

keen basalt
#

Fuck there is no hope

twin juniper
#

most likely the way is to learn the stuff and get to know how the system works

keen basalt
#

No no no

#

There is no learning code

viral mason
#

Yes yes yes

keen basalt
#

Only solutions

inner iris
#

Anything is learnable- you'll then have the benefit of fully understanding how it works

#

So you can change it later on

keen basalt
#

Uhhh learn

viral mason
#

You are learning to code using the blueprint editor

keen basalt
#

That word

viral mason
#

Minus the syntax

inner iris
#

We all want perfectly functional and networked games but it requires more than the stuff Epic has already set up

#

Which is a lot

keen basalt
#

No stop

#

Epic has it all

#

You just haven't found it yet

#

It's impossible

viral mason
#

Find it and stop complaining then

keen basalt
#

I can't I need ur big brains to guide me in the right direction

#

that doesn't involve code

viral mason
#

C++

#

Impossible

keen basalt
#

Nooo

twin juniper
viral mason
twin juniper
#

I restart my systems again.... I don't get why my sessions can not be found....

keen basalt
#

Screw online

#

Local will do

#

Morpho ur obvs missing a piece to ur puzzle

viral mason
#

Eckz ur missing a quadrant of your puzzle

keen basalt
#

not anymore

#

Online is out

#

Unless

#

How much are freelancers?

stone lintel
#

@keen basalt Noooo don't be like that,, don't give up.. go find plugin for blueprint

viral mason
#

Depends on experience and stuff

stone lintel
#

@keen basalt I'm rooting youuu

keen basalt
#

Marketplace?

#

100 bucks an hour for freelancers

#

Smh

stone lintel
#

😁

#

It's a start

#

😄

twin juniper
#

if 100 bucks per hour is a "normal" rate for freelancing I really should start doing that xD

keen basalt
#

they probs stall time to get their hours up so that's a no go

#

Morpho you'd be filthy stinkin rich

twin juniper
#

Ok... can now someone please help me with my session problem? I start getting mad here..... Why the hell does "Find Session" do the "On Success" route, giving me one Found Session which is empty and therefore can not be joined?!

stone lintel
#

@twin juniper Happened to me as well,, have u tried disable your firewall just for testing purpose. Is OSSNull or Steam?

twin juniper
#

Yesterday this did not happen... I have no firewall active and I didn't touch the session system in any way, so the OSS isn't null.

stone lintel
#

so you're using OnlineSubsystemSteam

keen basalt
#

Maybe u put your "on success" trigger set at the wrong time so when u start find session it sets it off automatically

#

This is just a suggestion for u to check if that's the case

twin juniper
#

@stone lintel indeed, it was set to steam... I changed it to LAN now and will rebuild it

#

@stone lintel but why wasn't that an issue yesterday? o.O

stone lintel
#

I will assume you're checking Success/Failure on delegate callback not on function return

#

it's happened to me once, but it turns out in my case the culprit is DefaultEngine.ini which i hv no idea why it was resetted

twin juniper
#

@stone lintel I use Proteus 2.3 Multiplayer Template and the "Find Session" is inside of a Macro

stone lintel
#

so every setting related to networking like NetDriver, OnlineSubsystem , etc disappeared

twin juniper
#

the DefaultEngine.ini is as it should be, nothing changed there

stone lintel
#

@twin juniper oh if you're using plugin i'm not sure i can help 😄 you should try contact the creator

twin juniper
#

that's no plugin

#

Just a template in BP

stone lintel
#

yes oke it's template but still you should try talk to the creator

twin juniper
#

Ok it works now after I set the OSS to LAN.... But what the fuck? Why did it work the days and weeks before when it was set to Steam?

#

There are so many things that I don't really get according to Multiplayer Development....

cloud sky
#

Heya! Please, tell me, why can I recieve this error when try to create multipayer session?
LogScriptCore:Warning: Script Msg: CreateSession - Invalid player state

inner iris
#

Is it necessary to compile a new dedicated server build on each client build update? I just packaged a new version of the client with updated settings but was still able to join and deal damage to another outdated client.

grim swan
#

Hi guys, i ask you because i try to recreate a lobby session like call of duty, the player press on a button and he search a lobby when he stay other players and after all conditions set on true, one guys host the game for all other players

#

i made a system with a menu and the players choose to host a session or find fessions, when he finds sessions he can join the ésevers", i have a idea but i'm not sure. Its possible to create a lobby with all players and i look who have the best ping and after that this choosen player host a sessions and all other players in the lobby autojoin the host but i'm not sure

native moth
#

Can anyone tell me why "Get controlled pawn" inside my playercontroller will return nothing when I run it on my client?

#

server returns pawn fine

#

event that is calling Get Controlled Pawn is "Run on Owner"

brittle sinew
#

Is it possible it's a timing issue?

native moth
#

I call the event after the pawn has been spawning and the controller posseses it

#

Can you somehow bind an event when a PC posseses something?

brittle sinew
#

That's still probably the issue; even if you call the RPC after you spawn the pawn on the server you have no guarantee it'll replicate to the client before the RPC reaches

#

OnRep_Pawn

#

Not available in BP though, unfortunately

native moth
#

damn

#

that sucks 😦

#

if I knew c++ I would just create my own binding

brittle sinew
#

You could always just have a BlueprintImplementableEvent that you call in a C++ version of it, little workaround

native moth
#

dont know enough c++ to do that I am afraid 😦

#

So far all my adventures into visual studio has ended up in errors and crashes 😛

brittle sinew
#

Well, if it's really something you need it's not that difficult 😄

#

Declaring a method and calling it from another one, I can show you if needed

high lotus
#

I installed visual studio, but it installed in chinese, and wouldn't give me language options 😦

#

so it can't be as hard as having half the messages / errors in chinese.

#

so you can do it!

native moth
#

would be awesome if you could 😃 Would appreciate some help. So far 85% of my problems seems to be that blueprints that needs to reference the pawn gets their references before its replicated, as you said

#

btw, does Visual Studio 2015 still work for 4.16?

brittle sinew
#

I believe so

native moth
#

Cool. In case you dont have time @brittle sinew do you have any tutorial/documentation for me to look at?

brittle sinew
native moth
#

My guess is that you extend the playercontroller and create a BP callable event when onrep_pawn functions

brittle sinew
#

If you're looking for general C++ intros, not super sure though

#

Correct

native moth
#

I have the Introduction to C++ in UE4 udemy/somethingsomething course

#

I just dont have the time to dive into a new programming language at this point in time

brittle sinew
#

Yeah, I get that

#

Basically what you'll do is make a C++ child of APlayerController and reparent your BP one to that

#

(make sure to back up/have source control before trying a reparent)

native moth
#

running the entire project in my dropbox, guess I will be fine 😃

#

worst case, my playercontroller have like.. 3 events with logic attached.. I will rebuild in case this goes wrong

high lotus
#

please get source control! 😃

brittle sinew
#

^

native moth
#

Yeah normally I would.. Had some very bad experience with last time though

#

was using GIT

#

restoring old points kept undeleting a large amount of files

#

that wasnt in the commits I was reverting to

#

so each time I had to revert back to an older commit, it also included 25 minutes of cleaning up the project

#

never understood why.. I have used GIT lots of times on other types of projects(like websites, rest api's etc.)

high lotus
#

perforce seems to be really fast and nice

native moth
#

so... Just spitballing before diving into this.. Would this be totally out of the water?
`.h:
UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "onPawnPossesed"))
void onPawnPossesed();

.cpp:
void MyCustomPlayerController::OnRep_Pawn()
{
Super::OnRep_Pawn();

//========================
//     BP Interface
    this->onPawnPossesed();
//========================

}`

plain flume
#

What would be the corrent way to get the PlayerName variable from different Player Controllers so it shows in every Character Properly? In PostLogin i set variable called PlayerName inside the joined Player Controller. In Player Character i now just simply have MyController->GetPlayerName() and set that as the name. But the problem is i think that it will always take the self controller so every person is named the same. I would somehow need to get the name from the client controller.

#

*other clients

native moth
#

Delicious, put that into playerstates as they are replicated on all clients

brittle sinew
#

@native moth that's...pretty much exactly how you would do it :p

native moth
#

player controllers are not

brittle sinew
#

Make sure to override the OnRep_Pawn though

native moth
#

Didnt I override it there? 😛

brittle sinew
#

In your header

#

I.e. virtual void OnRep_Pawn() override;

native moth
#

interesting..

#

Man... I just cant wrap my head around how/why you would need a header file ^^ I guess I am just a peasent web programmer 😄

brittle sinew
#

I'm with you somewhat, they make sense to me but then I realize that basically no other language has them

native moth
#

If I were to pass a reference to my pawn into the BP event, how would I go about that?

brittle sinew
#

I just can't stand duck typed languages (which is pretty much everything else major)

#

I believe you can just pass it as a parameter like normal

#
void onPawnPossesed(APawn* Pawn);```
#

this->onPawnPossesed(Pawn);

#

Not 100% what the pawn variable is called 😛

native moth
#

"AYourCharacter* Pawn = Cast(GetCharacter());

GetCharacter() not GetPawn(), it will work :)))"

#

guess GetCharacter() could return it

brittle sinew
#

If you have a character, yes

native moth
#

in this case I do, but would nice to make it return the parent class(pawn) instead

brittle sinew
#

GetPawn

#

😄

native moth
#

will try

#

thanks man

#

Lets see if I can figure out how to add my class first 😉

high lotus
#

@native moth I still need to learn networking, but you're getting out there and doin' this stuff! you're a hero!

native moth
#

Problem is, I teamed up with one my collegues who is a pretty bad-ass artist, saying I could easily match his tempo with the game logic

#

Then I started hitting how complicated replication can get 😦

high lotus
#

I want to make a great multiplayer game; I'm a looooooooooooooong way off

native moth
#

Same here man. Thank the heavens for people like Lethal and Cedric that can help us in the right direction 😃

plain flume
#

@native moth How would i change PlayerState, i can only Get stuff from it, but cannot put anything

#

i originally planned to put those in there

#

*set anything i mean

native moth
#

haha, gotta love C++. Added a C++ class and had to restart the project to build project files. Now I get build errors when I open it 😄

brittle sinew
#

D:

#

You added it through the editor wizard, right?

native moth
#

yep

brittle sinew
#

Wait, what did you do when you "built project files"?

native moth
#

Added an Player Controller c++ class with the wizard

#

Got an error saying "Couldnt generate project files"
Quick google said to close down project, right click on project files and press "Generate Visual Studio project files"

brittle sinew
#

Here, try this

#

Delete your Intermediate and Binaries folders, alongside the .sln file

#

Once you've done that, then try to generate VS files

native moth
#

UnrealBuildTool Exception: ERROR: Expecting at least one ProjectTarget to be associated with project 'D:\Apps\Dropbox\Public\3D\2_Work\TPS_Highrise\Intermediate\ProjectFiles\TPS_Highrise.vcxproj' in the TargetProjects list

brittle sinew
#

🤔

#

Never had anything like that happen to me before

#

I do that project clearing method regularly too

native moth
#

I just deleted the files that c++ wizard creates. Gonna try doing it again

#

Have some experience cleaning out C++ of projects because build errors was happening far to often

brittle sinew
#

Oh, did you delete the whole Source folder by chance?

native moth
#

nop

#

but it was empty 😛

brittle sinew
#

Well it shouldn't be empty 😮

native moth
#

guess that it was the source of the problem

brittle sinew
#

ba dum tiss

native moth
#

haha, didnt even see that one

#

😄

#

So yeah, now its compling

#

@plain flume give me a sec to have a look

#

So I can see you have the same problem as me

#

you can get the player name, but you cant set it

#

"playerController has a PlayerState which has a PlayerName. you can get the name in blueprint, but you cant set the name, because SetPlayerName() isn't exposed to blueprints.

you could make your own PlayerName string variable in a playerController blueprint, and set it to replicated or rep_notify."

#

alternatively, make a your own playerstate bp and make a new variable called "PlayerNickname" or something

#

and set that to replicated

#

@brittle sinew I have made a c++ class, got the code in. Do I do anything to compile it or get it ready to be extended in BP?

brittle sinew
#

Well you need to compile it, yes

#

Right clikc on your project on the right side and hit build

native moth
#

splat, so many errors 😄

brittle sinew
#

It doesn't seem wrong, what are you erroring out on?

#

You might need to forward declare APawn, but other than that I don't see anything

native moth
brittle sinew
#

Well, the one you have highlighted is pretty self-explanatory, put public: or protected: above the method

#

Public is accessible from anywhere, protected only from subclasses

#

The rest of your errors are in the .cpp, I'd have to see that

#

Well, some of them

#

😄

native moth
#

`// Fill out your copyright notice in the Description page of Project Settings.

#include "TPS_PlayerController.h"

void TPS_PlayerController::OnRep_Pawn()
{

Super::OnRep_Pawn();

//BP Interface
this->onPawnPossesed(GetPawn);

}`

brittle sinew
#

Forgot the A prefix on your class name

#

Additionally, stick an #include "GameFramework/Pawn.h" at the top of your cpp

native moth
#

Okay, so the only think left is "Argument type "APawn (AController::)() const" ins incompatiable with paramater of type "APawn"

#

and "A private function cannot be BlueprintImplementableEvent!", even though I have put public: infront of them

#

guess I dont need to reference the pawn anyways... Can just use "Get possed pawn" inside BP

brittle sinew
#

Yeah, that would work too

native moth
#

so only thing I didnt get it was you ment regarding to putting public infront of the method

brittle sinew
#

Could you show your header now?

native moth
#

`// Override OnRep_Pawn
virtual void OnRep_Pawn() override;

// Blueprint Interface
UFUNCTION(BlueprintImplementableEvent, meta = (FriendlyName = "onPawnPossesed"))
void onPawnPossesed();`
brittle sinew
#

Where did you put public?

native moth
#

tried public: UFUNCTION, got some errors. Guess that wasnt the method, so I tried infront of void onPawn, still got the error. Deleted it and started googling

brittle sinew
#

Try putting it on a new line before both of them (only one is needed, I meant one public: above the functions)

#

Shouldn't be giving you any errors

native moth
#

// Blueprint Interface public: UFUNCTION(BlueprintImplementableEvent, meta = (FriendlyName = "onPawnPossesed")) public: void onPawnPossesed();

Throws the error: Unrecognized type 'public' - type must be a UCLASS, USTRUCT or UENUM

#

arhh

#

new line..

#

same issue

brittle sinew
#

Could you take a full SS of the header now?

native moth
brittle sinew
#

Yeah, that's the issue

#

It's between the UFUNCTION and the function

#

You only need one

#

Anything below that will be public until you have another specifier

native moth
#

cool, got that stuff out of the way. Now I just get UnrealHeaderTool fail 😛

sweet spire
#

When it comes to destroying actors, is there specific way to handle it?

#

like anything extra that needs to go on except the sever destroying it

native moth
#

the actor youre destroying needs to be replicated for it to work on all clients

#

else the actor will only get destroyed server side

sweet spire
#

oh crap i was spawning them on both

#

oops

native moth
#

@brittle sinew this stuff is pulling my hair out... Guess I will to figure something else out

#

Appreciate the help 😃 Will stick to BP - c++ is just too time comsuning when I cant support it myself... yet!

sweet spire
#

Also thank you zpanzer

#

Im getting AI pawns popping in now hmm

#

guessing its net cull distance?

native moth
#

might be, not that experienced it networking yet

brittle sinew
#

@native moth sorry, was afk for a bit, though I've never really seen a UHT error like that :/

native moth
#

figured out it was because FriendlyName: is now DisplayName:

#

anyways - keeps throwing errors

#

so I will try something else inside BP. simply cannot wrap my head around C++ and how its supposed to work ^^ '

brittle sinew
#

Oh 😦

#

If you throw up a quick error log I might be able to see what's up, haha, but I get it's just a cycle either way

native moth
#

yeah problem is if I spend so much time getting this working and will have to extend it later on... I cannot do it my self

#

I will become way to dependent on people taking my hand and writing the code for me. Will slow me way to much down. Appreciate the help - I really do

brittle sinew
#

I understand that yeah, but everybody has to learn at some point, and I think it becomes much easier once you get to a certain point

#

I mean you don't have to learn, I get that also :p

#

BP works fine for most of the time

native moth
#

yeah, but I will have to do that in a seperate project where I dont have too much stuff I can fuck up 😛

#

Will try and clean my project from C++ stuff now so I dont get crazy errors later on

native moth
#

@brittle sinew couldnt leave it... Tried a completly blank C++ project. Same code

#

everything works

charred trail
#

in unity is there an easy way to get a reference to the local player?

#

i need to run commands from the player script, but if i'm the client and i'm the second player in the hierarchy, simply searching for gameobjects with player doesn't really work since it'll return the host's player prefab

brittle sinew
#

I think you might be in the wrong server...?

#

:p

charred trail
#

oh

#

right

grim swan
#

Hello guys ! one of you know how make a dedicated server browsers ?

glad sedge
#

@grim swan It's doable but apparently a massive pain in the butt

#

I was reading up on it. It's like something you'd use instead of the sub systems yeah?

grim swan
#

Yes

#

I want to create a dedicated server and players show a list servers and they can connect to them

#

If you know Minecraft, Half-life, Css, etc. I cant to recreate the system of server, because actually i have a system with a host players with the BPnode createSessions, and i show the list server with a BPnode Findsessions, but it's not good for my game lol, i want a dedicated server and players can connect to them by a server list, you know what i mean ? i'm sorry for my english i'm french

nova wasp
#

Is it even possible to implement non-rubberbandy movement without creating a custom character movement component?

#

I have to be missing something

#

AHA! server and client aren't doing the exact same move

twin juniper
#

hey so i know BeginPlay() is called every time a client makes that actor net relavent but what about

#

when they login/out does it get called every time they login?

nova wasp
#

Nevermind, still got work to do

gaunt kestrel
#

Can I use steams p2p for android and ios?

twin juniper
#

bRelaunchInSteam <= what does this actually do

#

lol

stone lintel
#

@twin juniper everytime they login to server for the first time,, YES, bRelaunchInSteam AFAIK only works in shipping build if you have ur own AppId

twin juniper
#

lol.

#

ok.

orchid cairn
#

hey all. been a while since i worked with sessions, having a weird issue. create session on one PC fine, find session on another PC, and join it. blueprint fires "joined successfully", but doesn't change maps to the server map, then times out after 60 seconds. tested with both onlinesubsystemSteamand Null. thinking it might be a port issue, but anyone have any ideas?

orchid cairn
#

Log files for issue i'm having above. created fresh project on 4.16.2 using twin stick shooter (c++) as a template. i'm using the advanced sessions plugin, but same issue using standard session nodes.
Also includes my DefaultEngine.ini, and Build/Target cs files to make sure i'm not derping completely and missing something. I have the steam OSS enabled in plugins as well

#

Server see's nothing at all when client connects, client sends "Hello" then times out a minute later... is this just some sort of funky port/network issue i'm having, or something else?

drowsy notch
#

Single process multiplayer PIE launches the client via the default map before it connects to the server, is there a way to check in the default map if it is en route to another map or server?

#

I mean non- single process actually

regal hazel
#

@orchid cairn Not sure if the same issue, but I had an issue where when creating a server it wasn't calling Listen(). But only if I created the server using ServerTravel, if I used Open it was fine (Both had ?listen parsed in to their URL). The "fix" was to call Listen directly after creating the session and all was well

#

I have no idea what the ramifications are of that but so far it appears to be working fine

orchid cairn
#

@regal hazel - cheers for the reply. did some more investigating and it looks like it might actually be an issue with VMware Workstation Pro 12's virtual network adapters... for some reason it doesn't play nice with UDP packets (although how i'm only noticing in this particular case is crazy all on its own)... since VMware likes to get into every nook and cranny on a system, i'm in the middle of formatting my dev box now (needed to do it anyway) to see how we go then. was able to get the exact same code working on different machines in the office, never thought my actual system would be the culprit.

the only other bug i had was the well known "OSS Steam doesn't like LAN Games" and "OSS Null doesn't like non LAN games", but we deal with that through UI 😃

twin juniper
#

i have a UPROPERTY variable stored in a Character that's a pointer to another object in the world UPROPERTY(Replicated) ASpecialThing* Thing;. ASpecialThing has a very short network relevancy range (about 5meters). You can see how the problem starts, if some players are not in range of this actor it will NEVER be relevant to them, unless they get in range! However on the Character it is set on Thing is always relevant to that player which makes sense.

How to make Thing network relevant to anyone near the player that has it set to begin with?

glad sedge
#

If I use a physics handler to move another actor, what should I use to update the actor's transform?

twin sorrel
#

Hey guys, would you guys know why one of my players sometimes spawns at 0,0,0? I am using blueprints.

twin juniper
#

one or more spawns blocked by something, or maybe not enough spawns ?

twin sorrel
#

b-b-but i set it to 'ignore collision, always spawn'

#

sorry if i sound thick

#

i'm only trying to spawn 2 players, and i have 2 player starts

#

they are well up in the air

#

most of the time it works

twin juniper
#

but your players have collision with eachother right?

#

so set it to adjust position but always spawn

#

that way when the stupid built in spawn selector decides its a good idea to put both players in the same spawn, they will be adjusted properly

#

one spawn can fit 5 adjusted players (with the 5th trapped inside the 4 surrounding players)

twin sorrel
#

ooh, is there a way i coculd set whicch one spawns where

#

rather than using this workaround?

twin juniper
#

u can fix the built in spawn selector function in gamemodeBase

#

ChoosePlayerStart

twin sorrel
#

does thatr equire c++?

twin juniper
#

has a stupid bug where it spawns the player in the same spawn even though there are plenty open ones, its c++

twin sorrel
#

ooh

#

dang

#

wish i could get ++ to work

#

well, i set ti to adjust position, always spawn

#

and no change

twin juniper
#

pooh 😦 must be something else then

twin sorrel
#

its a fresh project

#

argh

twin juniper
#

i was having the same problem u wer, and i spent almost 3 centuries trying to fix ChoosePlayerStart till i just gave up and set collision to adjust and it worked for me

#

if i had 6 players and only 1 spawn, the 6th player always spawned at 0,0,0

twin sorrel
#

ooh

#

i have 2 spawns 2 players

#

does that make a diff?

#

i thought it justassigned a player to one of them randomly

twin juniper
#

that should have 10 players spawn properly

#

with the 11th at 0,0,0

#

idk why it wont work for you

twin sorrel
#

would it help if i madea gif?

#

idk what to do

twin juniper
twin sorrel
#

lol

#

see what i mean?

twin juniper
#

o boi the flying project. i remember all the trouble i had with that

twin sorrel
#

well, ive made amazing stuf with it

#

until i get to the point where i cant network all of that spaghetti