#multiplayer

1 messages · Page 654 of 1

wheat magnet
#

when server slice, client doesn't see @chrome quest

blazing socket
#

Hi all, what's a reasonable way of broadcasting kill messages? Should I have the gamemode iterate across all playerstates to tell their respective controllers to update their HUD? Or is there a way to listen to a multicast event within the HUD blueprint itself?

pale hazel
#

Hi, can anyone tell me a possible reason why Actors are not replicated and only execute NetMulticasts on the server? I have bReplicates and SetReplicatingMovement() both set to true, and every component has ComponentReplicates set to true.

When a PlayerCharacter walks over them they are supposed to attach themselves to it and detach themselves when the Character dies, this works fine on the server, but they don't do anything on the clients.

I've tried using NetMulticasts to get them to attach & detach, but the NetMulticasts only get executed on the Server. I've made sure that the Server is the one calling the NetMulticasts. Any ideas on this? I'm stumped.

pale hazel
#

I think I've made some progress on this. Something that I should have added is I'm streaming the Actors in with a Level using ULevelStreamingDynamic::LoadLevelInstance()
And according to this thread: https://forums.unrealengine.com/t/dynamic-level-streaming-with-multiplayer-support/79517/23 there seems to be a problem with replication using dynamic level streaming. the thread is old but since I'm having the same problems I assume it's not fixed. I'll try another way and see if that works I guess.

pale hazel
#

Yup. For anyone who stumbles upon this having the same problem: using UGameplayStatics::LoadStreamLevel() instead of ULevelStreamingDynamic::LoadLevelInstance() doesnt break replication. The drawback is that I have to add the levels I want to stream as sublevels instead of doing it dynamically but I can work with this.

kindred widget
#

@blazing socket Is this for like a kill reel?

blazing socket
#

I haven't heard of that term, but I think so

kindred widget
#

Like the little pop ups that show someone died, and how in the corner of the screen.

blazing socket
#

yup!

kindred widget
#

Depends on your game style. Either the dying pawn can do that locally via GetFirstLocalController->GetHUD->IAmDead

#

May have issues with relevancy there though.

#

So the other way is likely to use GameState. Do a Multicast, on the recieving side of it, call a delegate. Bind that Delegate in the local HUD's Beginplay or something from GetGameState. Or even in the Widget itself and cut the HUD out entirely.

#

Then server death code can eventually run that multicast.

winged crypt
#

Hi guys I just started with multiplayer and I am noticing BoxTraceMultiForObjects called on Server doesn't tick as fast as in the client resulting in inaccurate hits for my melee system, any idea how collisions should be treated?

blazing socket
#

Would it work using PlayerState instead of GameState?

kindred widget
#

Possibly. Just depends on how you want to set it up.

thin stratus
winged crypt
thin stratus
#

Hm what executes the trace

winged crypt
#

I have a component that starts the trace

#

Thx for helping out btw

thin stratus
#

What is doing the trace though

#

Timer?

#

Tick?

winged crypt
#

tick

thin stratus
#

You can check the delta time of both ticks and see if they are similar. Idk how you test it but if the other player has low fps it would cause this

#

Might happen cause one window is not foreground maybe?

#

Either way shouldn't matter much as client should only use it for visual effects and server should be the one dealing damage

winged crypt
#

It happens when simulating local network too, also the problem is exactly the damage, I actually found out about this because the damage was being applied only some times

#

I will check the delta time on both ticks, that sounds like a good idea thanks

blazing socket
#

Are there any good sample projects (that are not ShooterGame) that have examples of scoreboard and tracking stuff like kills/deaths through UI?

meager spade
#

you just track that stuff in GameState and PlayerState

#

very simple really, someone gets killed, server increments the score on the game state (which is replicated)

#

scoreboard just reads this value

#

or server increments it on the killers playerstate

#

your scoreboad just loops through all playerstates (which you can get from GameState->PlayerArray

#

and read the kill count, death count, etc

#

UT4 also has this stuff

inland pond
#

Hi, does anyone know how I can map a player state to a certain actor/pawn which is replicated? My intend is to create name plates above each player.
I have a player state which contains health and the player name. Inside the Nametag Widget (mounted on the character) I listen to an UpdateHealthEvent to update the current health in the widget. The problem ist that I cant call get player controller -> get player state on the replicated pawns. I know that there exists the Player State Array inside the Game State but how would I know which player state belongs to which replicated pawn?
Edit: In cedric's multiplayer compendium there is an example with a health variable on the pawn. Would be the solution to pass the pawn to each of the widgets ... hmm

fossil spoke
#

You can always access the PlayerState from a Pawn.

#

It is simply a variable.

#
private:
    /** If Pawn is possessed by a player, points to its Player State.  Needed for network play as controllers are not replicated to   clients. */
    UPROPERTY(replicatedUsing=OnRep_PlayerState, BlueprintReadOnly, Category=Pawn, meta=(AllowPrivateAccess="true"))
    APlayerState* PlayerState;
inland pond
#

Yes from a pawn which is from my understanding and testing also the replicated pawn but my problem was that I need to access the player state inside the UMG widget to bind my custom event. And I think from what I have seen is that if I put the player state into a variable the player state does not get replicated anymore? (the replication bloons dissapeared) So the solution could be to just pass the pawn reference which contains the player state and I then can bind to the custom event. I should have clarified my question a bit more :S On how I can access the player state on the UMG widget.

#

And thank you for answering my question 🙂 This makes clear that I need to pass the pawn to the umg widget.
Edit: Yes damn it was just the Pawn reference I needed inside the UMG widget.

tender badger
#

Thanks so much!

lost inlet
#

That’s pretty open ended, what’s the WebSocket for? You could do that a whole lot of different ways

#

You’re using websockets for that?

#

I’m not sure if it’s worth reinventing the Unreal networking stack for that

#

If it’s going to run on a game server exclusively, then yes

#

Or locally without a connection to an actual game server

#

Game modes don’t exist on clients

#

Yes

hollow eagle
#

Well... if you're not using unreal's multiplayer systems at all the usual advice doesn't really apply. Gamemode only exists on clients in a standard unreal client/server setup, but if you only ever run standalone (no server) from the perspective of unreal's networking then you'll still have a gamemode locally.

#

Still, it might be best to find somewhere else to put it that makes more sense than the gamemode. Other options include the game instance (if it needs to last across level transitions) or subsystems of various types (world subsystem and game instance subsystem are common).

#

GameInstance exists everywhere

#

I wouldn't throw all your networking stuff into it though, at least put it in a separate gameinstance subsystem to keep it separated from unrelated code.

fossil spoke
#

Use a GameInstanceSubsystem as has been mentioned before.

#

Dont use the GameInstance itself.

#

Sounds good, now convert it into a GameInstanceSubsystem instead.

velvet lintel
#

Hi, can I play multiplayer within the editor without packaging and create executable file?
I've tested to pop-up multiple client windows by increasing the value of the Number of Players option in play button in UE editor, but it seems to be emulating from within a local PC.
Actually, I wonder if other members can access my game on their PCs and play it together in PIE.

verbal gust
#

Does assigning the root component to the "Component to Attach to" in the make VoiceSettings for Voip cause issues?

tender badger
#

UCLASS(Blueprintable, BlueprintType)
class UNREALBODY_API UIKCharacterAnimInstance : public UAnimInstance
{
GENERATED_BODY()

#

is it able to use Replicated in UAnimInstance' childClass as same as in ActorComponent's childClass?

thin stratus
tender badger
#

i think it's not able to do that in UAnimInstance

thin stratus
#

By default most certainly not

thin stratus
#

You should not connect to each other through pie

#

If you want that you can start the game as standalone or package it

tender badger
#

so weird...i set all var Replicated in
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class UNREALBODY_API UIKBodyComponent : public UActorComponent

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

UPROPERTY(EditAnywhere, Replicated, Category = "IKBody")
FVector BodyCurrentLocation = FVector();

thin stratus
#

Can you please format your code snippets

#

Discord allows one line and block code formatting

#

```
Code
```

#

Same goes for one line if you only use one of the ` at the start and end

#

Also you can't just mark things replicated randomly.

#

SkeletalMeshComponents probably have nothing in them that replicates and aren't marked to replicate to begin with

#

You are only setting the variable as replicated. That doesn't mean the Component replicates

strong vapor
#

[Help] just a random question.. I'm about to add some text chat to my multiplayer game.. is there some special Unreal way of doing this? or do I just Server Function a String or text up to the server and then set a replicated variable on all the player controllers?

#

Cedric! what upp! you're the document guy!

#

sheeeeizz

lost inlet
#

Well you wouldn’t really use a variable for text chat, more a multicast RPC if all players are intended to see it

strong vapor
#

I feel like a variable would be a good optimization but maybe im wrong.. it just would be transient.. every time it replicates its going to load its value into the chat.. and then forget about itsself

#

a multicast is my first thought too

#

i just try to avoid them

hollow eagle
#

...why would you avoid multicasts?

strong vapor
#

because they're kind of heavy right? like.. replicated variables are a nice way of evening things out.. and since i dont care if the text is RIGHT THERE ON THEIR SCREEN RIGHT NOW

#

idk

hollow eagle
#

Replicating variables is much worse than sending a single multicast rpc. And by much worse I mean barely relevant because this is premature optimization.

strong vapor
#

i just go with that

#

oh alright, well if you say so

#

i dont know all the metrics of things i just know what i've seen from all the Ue4 optimization streams with wes bun and zach parish and stuff

#

im mis spelling their names probably

hollow eagle
#

Replicated variables means that the server needs to check every network tick for a change to the variable, which eats up CPU time. Multicast RPCs don't involve that and shouldn't have much (if any) overhead above what you have to send for a replicated variable anyway.

#

Which is all irrelevant, because unless you know your exact bandwidth and CPU targets this is entirely premature optimization

#

use the best tool for the job.

strong vapor
#

yep i guess there's that

#

so you wouldnt be able to tell me how to properly set my bandwidth values would you?

#

when I tried to do it i had no idea if it was working

#

i was going off of old material i think

#

i know there's stuff in the game.ini and engine.ini?

#

and then how do you know if its working?

#

stat.net is pretty overwhelming at first lol

#

im in 4.26

#

sorry I should have mentioned that

thin stratus
tender badger
#

DedicatedServer,
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class UNREALBODY_API UIKBodyComponent : public UActorComponent
{
GENERATED_BODY()
protected:
// Called when the game starts
virtual void BeginPlay() override;

public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

#

BeginPlay & TickComponent is called on both Server & Client ?

steel fox
#

Yes, BeginPlay() is called both on the server and the client, you can use 'PostInitializeComponents()' instead if you want to avoid this, about TickComponent I'm not sure

tender badger
#

ok. i update BodyCurrentLocation value in TickComponent, and i set these Replicated

#

UPROPERTY(EditAnywhere, Replicated, Category = "IKBody")
FVector BodyCurrentLocation = FVector();

#

like this

#

so i should only do the "BodyCurrentLocation =xx;" on Server, not on Client, right?

#

then because of Replicated, the value is updated automatically to the client

kindred widget
#

Tick is called on the client as well. If you want to avoid this, just do if (GetNetMode() < NM_Client)

tender badger
#

UActorComponent::TickComponent is called both on DedicatedServer and clients?

#

so for the Replicated VAR, i should only set the VAR value in the if (GetNetMode() < NM_Client), right?

#

it's not right to always set its value both on server and clients

chrome bay
#

Depends. Tick Functions have a bAllowTickOnDedicatedServer property.

#

By default, it's true IIRC.

#

You can check whether you can set a variable using GetOwner()->HasAuthority()

tender badger
#

if (GetOwner()->HasAuthority()) {set value for Replicated} ?

#

void UActorComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)

#

not Tick, but TickComponent

chrome bay
#

yep

tender badger
#

it doesnot have bAllowTickOnDedicatedServer

chrome bay
#

It's a property of FTickFunction

#

The component has a PrimaryComponentTick property

lapis zinc
#

Im trying to replicate my characters entering a vehicle and possessing it. My current setup only allows server to use a vehicle. any ideas?

rich locust
#

@lapis zinc are you running dedicated server ?

#

do not use get player controller

#

almost never in a networked game

#

u already have the player character

#

use that instead

#

also no need for multicast

#

possess should only be called on server client figures out the rest anyways

lapis zinc
#

also for the player controller what should I use for the target?

rich locust
#

Player Character > Get controller > cast to playercontroller

#

dont need to cast if it accepts it as target

#

also dont multicast

#

and only check for overlap on server

#

remove widget removing as well

#

do it somewhere else

lapis zinc
#

how would I only check the overlap on the server?

#

custom events and functions for run on server?

rich locust
#

Has authority

lapis zinc
#

could you by chance show an example of what blueprint would look like? unless you cant which is okie

rich locust
lapis zinc
#

thank you!

#

binding the interaction tho is a bit tricky

#

other than that it works great!

lapis zinc
# rich locust

would it be possible to bind the event as well or use some sort of over method?

lean socket
#

I'm trying to get an actor that the client has spawned. Is it possible to do GetAllActors and then destroy the actor the client spawned? Getting all actors and destroying it currently will destroy all of the actors, not only on one client, but all clients. Id like it to only destroy the actor that was spawned by that particular client.

thin stratus
#

No

#

Only the Client can destroy that actor

#

The only way you can do that is to use a ClientRPC that is only used to destroy that one specific actor

tender badger
#

how to make this Gun Replicated when MultiPlayer, it's just derived from StaticMeshActor. and already tried to set the Repilicates in details, but not work.

#

and the BP_PickupCube in the normal example also not Replicated, then how to make it Replicated?

upbeat estuary
#

Hey everyone, I think I'm being dense again but there's something basic I seem to have misunderstood about RPCs/Events:
On my Character, if I call a test event to run on the server via e.g. Spacebar, it happily fires on the server. When I run the same event from a Livelink update on the character, it fires only on the client.
Minimal example:

#

am I missing something completely obvious?

blazing socket
#

I have a very basic question - how can I send information from the GameMode to the GameState? I'd like to send info such as the time left in a match and when a round begins

old knot
#

i just applied point damage to enemy and it was successful but enemy cant get point damage. anyone know where is the problem?

blazing socket
# meager spade you just track that stuff in GameState and PlayerState

Hey just saw your replies. I guess for me the problem is updating the actual widget. I tried binding the widget BP to a delegate that listens to playerstate when a player dies. However, I realized the problem with this is that I'd need to iterate through the player list and bind to each player state, which I'm not even sure is possible, if it is even efficient.

The other thing I could which is a lot simpler is binding the widget text to a BP function that iterates through playerstates and gets the kill/death counts. But wouldn't this be pretty performance-heavy? Especially if, like in my case, I want to keep up the scores permanently on the HUD. So each player would be iterating through the playerstates on every tick.

I'm fine with using the latter, but I'm wondering if there's some efficient way of tracking scores and deaths amongst players that I haven't thought of..

fleet bear
#

Question: Can I get players playing together without actually being in the same world?

Context: I want to do client side level streaming for an open world co-op game. If a player isn't near the other player I don't want to update any net traffic or render anything that's not in the vicinity. I'm thinking, for example, they both share a session but only share information of player transforms and event calls.

The other "player" that the see would be a dummy that moves based on the location of the other player's transform information.

fleet bear
#

this sounds like a case for standard client server model, but in reality the host pc is doing all the work. I'd more or less like to keep them in sync, but who ever loaded an area first is sort of the host of that area.

Scenario: Player one walks into a room, enemies spawn etc. Player 2 later walks into that room, room spawns, gets a list of instantiated actors from player one, enemies load for player 2 and are synced. Player one walks out of the room and it unloads for them. Player 2 is now "host" of that room. Player one walks back into the room, gets list of instantiated actors from player 2, enemies load in.

#

Doesn't sound like this works with current client server model so really I think it ends up being something like they share a session ( they have a tunnel to pass info back and forth ) and everything else happens locally, get's current owner of the area for server checks

#

that gets a bit messy for handling the world state. Someone is always going to need to be server for that wouldn't they hmm

tardy glacier
#

Hey all - I'm having an issue that has cropped up recently in my project. I have an AI controlled pawn that activates it's Behavior Tree on BeginPlay.

Lately I've noticed that in a 2+ player game when I call from the client to the server to spawn this AI pawn, the pawn spawns and I do see them on the client but they just idle in place on the client. On the server they start charging to me and attack me. Only after they start or succeed in their attack do I see them in the correct spot on the client.

I've been debugging this and the most I can see is that the client side version of the pawn just isn't receiving any data from the server but I cannot pinpoint why. Unreal Network Insights isn't showing anything egregious (not that I'm terribly good at knowing what to look for).

spare mortar
#

I am extremely new to UE4, eventually i would like to add multiplayer, how would i go about doing this in blueprints?

rose raft
#

Hi, I'm currently trying to understand how CharacterMovementComponent works.

From my understanding, UCharacterMovementComponent::ClientUpdatePositionAfterServerUpdate is used when client and server moves diverge and a correction issued from the server is necessary. Here's my question: why is it that the character reproduces any moves sent from the server instead of the server simply directly updating the characters position, velocity, acceleration, movement state, etc.? Wouldn't this be a simpler solution or am I misunderstanding something?

Specifically, I'm interested about this part:

    // Replay moves that have not yet been acked.
    UE_LOG(LogNetPlayerMovement, Verbose, TEXT("ClientUpdatePositionAfterServerUpdate Replaying %d Moves, starting at Timestamp %f"), ClientData->SavedMoves.Num(), ClientData->SavedMoves[0]->TimeStamp);
    for (int32 i=0; i<ClientData->SavedMoves.Num(); i++)
    {
        FSavedMove_Character* const CurrentMove = ClientData->SavedMoves[i].Get();
        checkSlow(CurrentMove != nullptr);
        CurrentMove->PrepMoveFor(CharacterOwner);
        MoveAutonomous(CurrentMove->TimeStamp, CurrentMove->DeltaTime, CurrentMove->GetCompressedFlags(), CurrentMove->Acceleration);
        CurrentMove->PostUpdate(CharacterOwner, FSavedMove_Character::PostUpdate_Replay);
    }```
grizzled flicker
#

It’s going to take you at minimum a year to make a multiplayer game if you’re brand new

#

And that’s if you’re extremely dedicated and persistent . Good luck!

spare mortar
#

ok, thanks : ) good luck in whatever you are doing as well!

lost dune
#

On begin play , i make a switch has authority to create the UI widgets only i i am the a client:

#

but since i do that , there is no UI on the main menu

#

why?

chrome quest
#

You don't need a switch. The widgets won't be created on the server anyways

lost dune
#

Ok , but it displays red errors on the logs

chrome quest
#

Also, you need to add the widgets to viewport

#

Look for the node add to viewport and pass in each of the created widgets

lost dune
#

I'm doing that and it works well , but there is logs errors i want to remove

chrome quest
#

Show the log errors

lost dune
#

ok , i launch it

chrome quest
#

It seems that at the point when you are trying to set is focusable, the object references are not yet valid

#

But does it work properly?

lost dune
#

yes

chrome quest
#

Also, pass in owning player

lost dune
#

the main menu is showing well and works

#

ok

chrome quest
#

And you shouldn't really use the switch has authority

#

Also, you can add an is valid node before using the widget references OR use validated get node.

lost dune
#

it its not valid yet , the add to player screen will fail

#

and i'll have no menu UI ^^

chrome quest
chrome quest
lost dune
#

It works with is valid

#

it was because i used two clients in one instance of the game

#

for testing network

chrome quest
#

Oh? Okay.

lost dune
#

the first client , try to use the UIwidgets as they are not already crated in the main instance

chrome quest
#

Ah I see. But is it working now? Also, if it's for a multiplayer setting, I think you have to create the widgets separately for each player. In order words, either in the player controller class or in your character class

lost dune
#

Yes its working , For the moment there is a Game manager in my project owning the widgets ( that was a bad idea of someone in the discord ) , i will remove it and use gamestate , playerstate ... only

chrome quest
#

Okay

trim kindle
#

What is expected use of non-seamless server travel? I expected that it will travel my server, send some RPC to clients, clients will disconnect, travel and join again to the new map.
But the actual behavior is that only server travels and clients do nothing and get timeout when server is in the new map for some time.

#

It works if I do 'open 127.0.0.1' manually on the client when server is ready but is not the whole purpose of non-seamless server travel that it should do it for me?

#

Even docs say When a client executes a non-seamless travel, the client will disconnect from the server and then re-connect to the same server, which will have the new map ready to load.

#

ah, it seems server needs to run as Standalone Game, not running under single process is not enough. I read that seamless requires it but I did not hear that also the non seamless server travel does not work in PIE.

red sand
#

How to host a new instance of server for match automatically
like you know how it's in multiplayer games

like server automatically hosts instance of game for new match, if none are available.

hollow eagle
#

by writing a system yourself, or by using a service like gamelift or playfab.

lost inlet
#

Though there are other companies like Zeuz and Multiplay that do game server orchestration too, which is usually a hybrid of bare metal and cloud

#

Upfront costs can be scary though

gaunt umbra
#

can i get some input please?
Component System isn't good to execute server tasks as there is no switch has authority node. is that correct?
any known workaround or should i call everything within gamestate/playercontroller?

lament cloak
#

Is there a built in way to monitor the server's current tick rate?

Our server is decaying in performance over time, even a 12 hour old server feels really bad. And yet none of the resources it's using seems off. Unsure about servers that have had people in them for that long, but these typically are empty, is the engine trying to be smart with empty servers but failing to wake up properly when someone connects? It really feels like as if it's tick rate drops.

#

Have tried on multiple hardware and operating systems (Windows and Linux)

lost inlet
gaunt umbra
lost inlet
#

?

#

you check Role against ROLE_Authority

#

if the check passes, you're on the server

gaunt umbra
lost inlet
#

yes

gaunt umbra
#

ic, thx - big help

lapis zinc
#

so after possessing a vehicle my character gets trapped in the car essentially, how would I get the character reference for it?

lapis zinc
#

heres all the code if this helps

thin stratus
#

Save it before you posses?

thin stratus
#

Hm, yeah, that would be called a stale pointer. Basically pointing to something that is now reassigned

#

It's not null as far as I can see?

versed bear
#

On the server, my player spawns a sword in its BeginPlay() and attaches it to his hand like this:

if (HasAuthority())
{
    static FName weaponSocketName(TEXT("WeaponSocket"));

    FActorSpawnParameters spawnParams;
    spawnParams.Instigator = this;
    spawnParams.Owner = this;

    Weapon = Cast<AMyWeapon>(UGameplayStatics::BeginDeferredActorSpawnFromClass(this, WeaponClass, FTransform(), ESpawnActorCollisionHandlingMethod::AlwaysSpawn, this));

    if (Weapon)
    {
        Weapon->AttachToComponent(GetMesh(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, true), weaponSocketName);
        Weapon->SetOwnerCharacter(this);
        UGameplayStatics::FinishSpawningActor(Weapon, FTransform());
    }
}

Then in my sword's BeginPlay, I pass the sword's pointer to its parent so that the Client can access the sword and do stuff with it:

AActor* pParent = GetAttachParentActor();
if (pParent)
{
    SetOwnerPlayer(Cast<AMyPlayer>(pParent));

    if (GetOwnerPlayer())
    {
        GetOwnerPlayer()->SetWeapon(this);
    }
}

It seems like this doesn't always work, and sometimes the AttachParentActor is null.
Is there a better setup for what I'm trying to do here?

EDIT: nvm, there was also a sword being spawned to be shown in the UI and that's the one that isn't attached to anything.

lapis zinc
empty bluff
lapis zinc
#

would I just save it the same way?

empty bluff
#

i would say yes, since its the player char you want to re-possess

thin stratus
#

You literally cast to it in your overlap before you possess the car. You can save it in the car

empty bluff
#

right.. or in the car.. good point @thin stratus

lapis zinc
twin juniper
#

I was hoping to make a standalone C# server and connect to it with UE4, but not sure if blueprints support that and my c++ skills are non-existent

chrome bay
#

If you didn't think about multiplayer from the beginning, then it will likely be difficult.

twin juniper
#

I mean, all I did was done in 2 days

chrome bay
#

It's really a "how long is a piece of string" kind of question tbh, the answer is "it depends"

#

You won't know until you try it

twin juniper
#

Any good tutorials on connecting to external servers through blueprints?

chrome bay
#

C# server isn't how UE4 multiplayer works anyway, if you want a dedicated server you'll have to use C++ - but a listen server is hosted locally and you can support that "relatively" fine in BP

#

BP isn't great for MP in general though, it has limited support.

twin juniper
#

Wait, you can't make UE4 connect to external standalone server?...

chrome bay
#

Sure you can but "server" has many definitions

twin juniper
#

I mean an actual server processing and passing out player data

#

I know very little about game development, I work as a .NET backend dev for military defense systems

#

So was hoping that the knowledge of developing servers there would come in use here

chrome bay
#

Not so much unfortunately, there's multiple parts to it. I'd start by reading cedrics Network Compendium (check pins)

#

Seems to have been buried

twin juniper
#

This is for a match based multiplayer though, no?

#

Would it work similarly for an open world game?

chrome bay
#

The same principles apply on the game-code side

#

For UE4 you still need an actual game instance running on a server which handles game-level info.

#

How you would manage something like persistent data etc. is another area

twin juniper
#

Damn, exciting

#

Joined the TitanReach open alpha and got the urge to get into game development to make something similar 😅 Big goal and likely quite unrealistic alone, but excited to see where I can get

chrome bay
#

MP is definitely "indie hard mode", MMORPG probably borderline insanity 😄

twin juniper
#

I mean, I made MMORPG servers before

#

its not really difficult

#

no idea how it would work with UE4 though

kindred widget
#

@twin juniper If you've made MMORPG servers before, then all you really need to consider is that a UE4 server is a subserver. Your backend server holds all persistent data like where a player is located, a cache of their stats, etc. UE4 server is their current world level. UE4 cannot easilly support more than maybe 40 players without some serious optimization like Fortnite has done. A dungeon in this case might be one UE4 Server. City area might be another server. Both of which run off of data imported from your backend, and report back to the backend to update persistent stats.

But it's worth noting that this is impossible without C++. At a high level, it's an easy concept. but there are a lot of things to tie together and make work and that's before you even start considering basic gameplay elements or the idea of launching/debugging/polishing it. Not to mention it's highly untreaded territory. Most people won't be able to help.

twin juniper
violet sentinel
#

... along with redesigning 2/3 of systems as they require special handling in multiplayer

#

better off starting with simple multiplayer then, even listen server

#

there was a youtube series "lets make an mmo" i think showcasing world server and UE interaction

#

but it relies on that person's backend

#

worth as example but you will have to make own

brazen sluice
#

Hello I seem to be reaching a maximum length FString/Ftext can have as RPC arguemnt

#

Anyway to change that limit maybe?

violet sentinel
twin juniper
#

@violet sentinelPretty sure I'm way too bad with ue4 to get stuff like that done xD

brazen sluice
#

Really?? not even with MaxRepArrayMemory or something similar that would exist like MaxRepStringSizeMaybeIdontknow

#

that is an extreme bummer

violet sentinel
brazen sluice
#

No im sending a book that is generated based on data the client doesnt have

#

(Basically)

#

So it's like a text that's the book content

violet sentinel
#

you can break it into several rpcs

brazen sluice
#

I'd bascally be re-implementing TCP in RPC right that sounds cumbersome

violet sentinel
#

max array size is 2k, max rpc size is about 64kb

brazen sluice
#

yeah im at about 500kb

#

With a simple journal

#

hmm

twin juniper
violet sentinel
#

since designing arch for mmo is quite difficult topic

violet sentinel
brazen sluice
#

yeah for example one of them is the list of achievements that's in a journal with texts and images

#

the clients doesnt know what achievements it has accomplished and all

violet sentinel
#

can you send their identifiers instead?

#

achievement id to replace name and description
achievement image will be taken from data table or other thing based on id
achievement progress as two floats (current/needed)

brazen sluice
#

Yeah im going to have to rewrite my UI layer using data instead of content as a parameter, then some kind of template engine so that the client can generate the UI based on the data it received

#

That's going to be a pain in the ass but hey seems I have no choice 😄

violet sentinel
#

that would also save you on localization later

brazen sluice
#

I suppose you are right on that last point

brazen sluice
#

So I have to first create new functionalities in the modding SDK that allow the content to register templates, so the clients can consume them

violet sentinel
#

you can have data assets or uobjects and object library instead of data table

#

or a manager to manage library

#

to make it extendable

brazen sluice
#

Yeah yeah i have a manager but it's in another context so it's always a bit tricky to access it

#

from the UI you cannot actually access it directly

#

Anyway it's doable just a lot of pain

#

I guess one of my biggest issue is going to enable the client to generate thumbnail in the passive JS modding Context so I dont have to send base64s

#

Then create the template engine so I dont have to send the static text around the data

#

I guess im putting this off for the release: P2 cant open books for now 😄

young spoke
#

I have this thrust feature that just adds impulse to the character movement.

#

But for some reason it only works on the server
It does not replicate, clients cannot thrust.
Any ideas?

violet sentinel
#

MC_Thrust FX has to be called on server, you calling it on owning client

flint star
#

Hey, Acceleration on CharacterMovementComponent does not replicate properly to Non-Owning Clients.
It's normalized (instead of with magnitude as on Owning Client and Server)
And when the player is doing a RM animation, it doesn't replicate Acceleration until the player stops doing the RM for some reason.

#

Is there something I can do about it, or should I just replicate the real Acceleration value myself?

winged badger
#

you might get away with exponential interpolation on CMC

lean socket
#

When a client connect, I spawn a pawn for them to control and store a reference to that pawn "OldPawn"...I store the reference because the user can switch between two pawns...I'm having an issue, that every now and then, the reference to the "OldPawn" seems to get lost, or in other words changes.

#

In the above image, you can see the reference is there...however, after some time, when switching between pawns, this reference seems to get incremented. The ending would be something like _Pawn_C_3.

#

Almost like the original pawn gets destroyed, and a new one is created. However, i'm not destroying this pawn at all.

lean socket
#

I do notice this. Why would my pawn be "pending kill" ? I'm not destroying it anywhere in my code. I do destroy another pawn. Is this somehow trying to destroy this one? Is it a player controller issue since both are using the same player controller?

scenic turtle
#

Hi all, hope you are doing well I am trying to load a new stream level based on a overlap event. Since the new level is completely different than the current one, I am trying to teleport my player there, but when the stream level loads I teleport I have this strange shaky camera and if I try to move I fall through the floor or teleported back where the overlap event started. This is only when I am playing as a client, if I play as a listen server it is all working. Thanks for your help

red lark
#

hi guys, hope ur doing well. I've run into a problem with local multiplayer. How do I setup controls for a game where there are two keyboards and two players?

gaunt umbra
#

Any Opinion about the Verification Process? is it even needed? any tips for changes? appreciate any answer - thx in advance

fluid summit
#

Hi! any guide or info on how to implement a player login on a dedicated server? (want to do something like clash royale) where you can manage your city and explore the world and see other people cities.
Is there a standard way to implement something like this?

fluid summit
#

yeah, i'm looking tutorials for making a dedicated server and save player information on a database, but there's so litle

gaunt umbra
fluid summit
#

what about sql and something else for the apis?

gaunt umbra
#

yea lorash i just mean for basic testing

fluid summit
#

that's kind of what i'm trying to search. What are the available technologie sto implement something like that and than package it into some host (like aws, steam) and what are the betters.

gaunt umbra
#

ofc you wanna host database yourself with multiple copies/backups in best case

fluid summit
#

i'm gonna give it a try with firebase for the database and varest for the apis as you suggested, only for testing.

#

this, wich ones would you suggest? D:

#

aws is so freaking expensive and if posible, i want to have some host on the cloud to test things out from the start

#

what about steam dedicated servers? i'm looking into a tutorial to setup one of those, any review on that one?

#

i'm gonna take note and check that thing about hyper-v, thanks

#

i have no idea, i'm just following a video to get an idea of what it's.

#

oh, i tought it was a hosting service provided by steam

#

i'm gonna look on the options you guys listed

#

it doesn't look like it's what i'm looking for

gaunt umbra
fluid summit
#

@gaunt umbra by any chance do you know how to integrate firebase with ue4? i'm ok with varest to make the calls, but not sure wich app should i be adding in order to use with ue4

gaunt umbra
#

just api call firebase db

fluid summit
#

oh i was trying to use firebase auth feature integrated with UE4 to handle user logins.
You meant to just use the firebase DB to store info?

slow wing
#

Is there a particular reason player state has to always be relevant, or is it alright/possible to actually modify its relevancy through a replication graph? (Is it mainly a historical thing where something like a players score was maintained on the player state and opening a scoreboard had to show you the score of everybody, so player state was always relevant, or will some actual gameplay oriented thing break/be incorrect if relevancy is tampered with)

oblique prism
#

What could be the cause of this RPC not firing off on and triggering the second breakpoint here?

twin juniper
#

Hi, is APawn::OnRep_Controller happening on both server and client ? 🤔

elder sable
#

Hi, i would like to create X replicated actors when the game begin, so i spawn them in gamemode::beginplay, but sometimes, there is no actors on any clients when i start the game.

thin stratus
thin stratus
elder sable
#

Never i guess

thin stratus
#

That's indeed strange

#

Yoy don't happen to call some reliable rpc on tick somewhere or?

elder sable
#

In the spawned actors ?

thin stratus
#

In general

#

Cause that could cause other replication to just break

elder sable
#

Mhh i have a timer with reliable NetMulticast and i start this timer when the game start

#
    MakeMap(); // spawn actors
    GetWorldTimerManager().SetTimer(EventTimer, this, &APGameMode::OnEventTimer, 5.f, true, 5.f);

Something like that

#

I removed the timer to test and there is still one time the actors didn t spawn

thin stratus
#

Every x seconds is fine

#

Just not every frame

oblique prism
thin stratus
thin stratus
#

You need to perform the rpc elsewhere, like your own playercontroller, character or playerstate

#

Or generally a client owneder actor or component on a client owned actor

oblique prism
thin stratus
#

I would say yes

#

Is this a dedicated server?

oblique prism
#

yes

#

dedicated

elder sable
#

Can i call spawnactor from gamemode::beginplay ?

thin stratus
#

I would say yes

#

But you should check if the same happens with a new project and in ue4

#

UE5 is not ready for production so I would expect everything to be broken

elder sable
#

I added bAlwaysRelevant and it seems they are spawned every time (but sometimes they are not visible)

#

Oh ok, someone told be it was fine to use it :/

thin stratus
# oblique prism dedicated

I think your server isn't ticking the animations. I know there is something about tick pose and bones on the SkeletalMeshComponent. Try checking if that resolves. Otherwise check google for Dedicated server and ticking anims

thin stratus
#

UE5 should not be used until it is released

#

You are using an early access program that clearly tells you to not use it

elder sable
#

Well i will change to UE4 and see then thanks 🙂

oblique prism
thin stratus
#

Cheers

spark owl
#

if a physics object is teleporting/rubber banding/jittering around, how would I stop that? I'm making a sports game and the ball will sometimes jitter around

#

it's mostly accurate but still the slight teleporting can be annoying

young spoke
#

I have this code on the character which is supposed to create a hitmarker.
But it only works for the server but not clients.
Any ideas why?

spark owl
#

try taking the code you have sticking out from EventAnyDamage, put it into a custom event and run it on server reliable

#

then run it on EventAnyDamage

lean socket
#

When spawning a character, is there a limitation on height? The node on the bottom with Z value at 120 works. It replicates to all clients that the spawn took place. The node above with Z value at 20240 doesn't work. Well it does, it spawns the actor on client, however it does not get registered with server, and none of the clients can see it. Must be something with height?

young spoke
#

Could you please explain why that works and why mine doesn't?

spark owl
#

I'm not exactly sure how EventAnyDamage works, but the code wasn't running on the server which tells me EventAnyDamage doesn't fire on Server it fires on clients, so because of that you needed to make it a custom event that runs on server. it triggers on the client and then it tells the server to run the code, wheras without the custom event, it would just run on the client

#

@young spoke

elder sable
#

Where should i store server only data, can i store them in gamemode ?

lean socket
#

I did another basic test, with ThirdPerson template. I basically spawn the pawn at height of 20000. It does not get shows/displayed in WorldOutliner until the actor reaches height of around 13-14K. Is this some sort of world bounds issue? What if one wants to spawn an actor on top of a building, which is at height 20k?

elder sable
#

I launch my game in listen mode from the editor, and i see that InitNewPlayer is called before gamemode::beginplay, how could i separate the server code from the hosting client ?

urban cargo
#

hey guys so i wanted to make a like feedback for the player so when he kills the other player the cross-hair flickers red and its working as long as i call it from the inputs but when i call it from a custom event it just doesn't show the animation or run anything from there any idea why?

rose raft
shrewd mortar
#

Is there any way to merge sessions/have all players (including host) from one session join another? I’m using the DestroySession node for each player, but for some reason the host still fails to join the new session. Any help with this would be much appreciated.

versed socket
#

Crazy design idea about multiplayer performance:

I wonder if it'd be more performant to put all of an Actor's gameplay logic into ActorComponents and then only create those Components at runtime according to what's relevant to the ROLE. So if I'm a remote client, I won't even be aware of another Client's Input-related or UI-related components because they were only ever spawned locally on their machine as the Actor was being created.

Maybe the only dependency in the Actor would be a TArray<UActorComponent *> where that list is populated with different things depending on who's asking.

To know which Components to spawn, you'd have a Data Table with a column that is a List of ActorComponents, and the Actor is given the appropriate row's FName as one of their required input arguments for spawning.

#

It sounds like a weird form of Dependency Injection. I just wanted to throw out the idea and get shot down

#

I remember the AI guy saying that it's always preferable to use Tags whenever possible, yeah

undone vapor
#

Anyone have any good code for sever validation of weapon fire hits sent from the client?

undone vapor
#

🙏

summer tide
#

So I've two components and 1 parent character class with two children characters

#

Char 1 has Comp 1 and char 2 has comp 2.

#

From Comp 1 I set a value to the parent char class. Then I access it in the comp 2. How can I fix its replication?

versed socket
summer tide
#

UPROPERTY( ReplicatedUsing = LightTrigger) ???

grand lance
#

@summer tide UPROPERTY( ReplicatedUsing = OnRep_LightTrigger)

#

and create UFUNCTION() OnRep_LightTrigger()

#

What does this mean? Only happens when I have really fast rate of fire

summer tide
#

Ok thanks. I think that means that your are trying use a ref of an actor which is probably got destroyed or pending to be destroyed .

strong vapor
#

might not be the right channel but is there an implementation of some kind of profanity filter for online text chat?

#

i just implemented a text chat in my game and i dont wanna release it until i have that kinda

hollow silo
#

Does anyone have any resource that may help me do the Aim offset for multiplayer animations?

grand kestrel
#

I don't think I've ever before had a good reason to use a child actor component but... now I do. I've heard some horror stories with them in packaged builds and esp. related to multiplayer. Any experiences to share or light to shed?

strong vapor
#

@hollow silo Shooter game I believe does it

#

It's in the Learn tab

rich locust
#

just skip child actors overall, manually create them and use it that way

hollow silo
grand kestrel
steep garden
#

guys, im trying to make an fps, and wanted to know what I should do to make sure player is on the right viewmodel and that the gun change request reaches them

#

what's the best logical way

#

do I just repeatedly tell the player what to equip?

grand kestrel
#

That's been my understanding. Pretty easy to make one actor handle another anyway, I'll just keep doing what I've always done in this scenario

strong vapor
#

@hollow siloyou're just trying to do a simple replicated aim pitch offset right? Try youtube.. i think i learned how to do that on there

#

[Help] anyone know a quick way to get a profanity filter goin for text chat?

#

I just added text chat to my game and I don't really wanna push the changes to steam until there's a filter

elder sable
#

If i want to store server only data, should i use only gamemode or i can use gamestate without replicating those data ?

knotty relic
#

Probably game state, my understanding is its where you keep all your data for the game mode

elder sable
#

Ok thanks

vital karma
#

i placed a Sphere into my world, turned on simulate physics, set replicate physics, then i pres play with 2 players and my net mode as client
when i push the ball with one player it moves differently to how the other player sees it

#

what do i do?

#

is it possible to have replicated simulated physics?

thin stratus
#

Yeah, but it's most likely gonna be shit :P

#

You will need to add some sort of smoothing to it and should probably only really simulate the physics on the server

#

And player controlled physics (so a physics character you move for example) will be a lost case

#

Only thing you could do there is ignore authority and do things client authoritive or so

red salmon
#

What is a good long term player identification?

thin stratus
#

An ID of a Database Entry

red salmon
#

any tutorials or information on helping me with that?

twin juniper
lost inlet
#

On Steam, this will give you the 64 bit Steam ID of the player. If you’re dealing with multiple OSSes then you can distinguish further with .GetType() on the unique ID

#

And in case you’re wondering, this isn’t something readily exposed to BP

twin juniper
lost inlet
#

It’s also generally true on other platforms

granite nest
#

I build a dedicated server and a normal client build. When i type the command open 127.0.0.1 in the client while the server is running, this is what i get in the server log: . After that i get a popup on the client "fatal error". Any idea what it could be or where i could find more information about it?

#

oh nvm i see "client connecting with invalid version", weird

#

the server is build with engine from source and client is not

#

might that be a problem?

#

its 4.25 and 4.25 from source

rich locust
#

check logs

#

there usually is extra info about fatal error

silent valley
granite nest
#

i'll try to hack it 😄 because building the client with the source version uses 16gb+ ram while i only have 16 and crashes. The non engine version uses only 5

trim kindle
#

Is it expected that widgets persist the seamless travel and need to be manually removed in the new level?

lost inlet
#

yes even though this is more of a #umg question, it's also why we ended up having widget management as part of a AHUD subclass

trim kindle
#

That's what I usually do too. Do you do your own bookkeeping in HUD class or is there a way how let these widgets disappear automatically?

#

I think I will just remove all widgets in game instance subsystem which listens for FWorldDelegates::OnSeamlessTravelStart

lost inlet
#

HUD class does the bookkeeping

#

Since the viewport will keep a reference

trim kindle
#

okay, sounds good, thanks!

white smelt
#

yo can someone help me with animations

#

i cant get animations working when pressing a botton like right click to aim in

strong vapor
#

@white smelt might wanna ask in a different channel.. and that's also a very vague question.. I'm guessing you're talkin about like an Aim down sights mechanic.. I'd just look on youtube for a tutorial on that kind of thing.. it's definitely a popular one

raw quarry
#

I'm very confused.. all of a sudden I can't test with "play as client" net mode in the editor in 4.26:

#

it instantly kicks me back to my entry map

#

I can't think of what I could've changed that would cause this all of a sudden

#

where does this "server full" error come from?

summer tide
raw quarry
#

@summer tide what are you printing

summer tide
#

RiderAnimType

raw quarry
#

is RiderAnimType replicated?

summer tide
#

That variable is in AnimBP so notneeded but it getting the value from a replicated variable

raw quarry
#

either way, it's probably being set on the client when maybe you just meant for it to be set on the server and replicated down

#

well I mean "Riders Mounted Anim Type" :p

summer tide
#

I'm have this in the 3rdperson char' component if (Rider) Rider->SetRidersMountedAnimType(3);

raw quarry
#

there's still not nearly enough context here to see what's going on

summer tide
#

what do you want to know

#

So I'm trying to make that function a server rpc

raw quarry
#

which function?

summer tide
#

to see if that would work

#

SetRidersMountedAnimType

#

In that fn i've this: RidersMountedAnimType = Type;

raw quarry
#

do you want the variable to be set on the server and replicated to clients?

#

because clearly at the moment it's not

summer tide
#

RidersMountedAnimType is replicated in 3rdpersonchar class

raw quarry
#

then it must also be being set on the client

#

so when you set the variable, make sure you're on the server

#

you can add a "switch has authority" blueprint for example or in C++: "if (HasAuthority())"

#

even though a variable is marked as being replicated, it will still let you change it on the client and get it out of sync

summer tide
#

So this doesn't have to be a server rpc. in this funciton i can have HasAuth() to then use server if remote else use server

#

SetRidersMountedAnimType

#
void ARidableBaseCharacter::SetRidersMountedAnimType(int32 Type)
{
    if (HasAuthority())
    {
        MulticastSetRidersMountedAnimType(Type);
    }
    else
    {
        ServerSetRidersMountedAnimType(Type);
    }
}
void ARidableBaseCharacter::ServerSetRidersMountedAnimType_Implementation(int32 Type)
{
    MulticastSetRidersMountedAnimType(Type);
}
bool ARidableBaseCharacter::ServerSetRidersMountedAnimType_Validate(int32 Type)
{
    return true;
}
void ARidableBaseCharacter::MulticastSetRidersMountedAnimType_Implementation(int32 Type)
{
    RidersMountedAnimType = Type;
}
summer tide
raw quarry
#

is this how the code is after changing it? or is this how it was before

summer tide
#

I modified it based on what you said. Do you think this will work?

raw quarry
#

ah, yeah that seems right

#

assuming those RPCs are set up properly

#

I'm still not sure why you want the clients to set it, but I guess it depends what this variable is actually doing

summer tide
#

IDK whatever works

#

That variable in animbp selects a animsequence that's all

raw quarry
#

if you have RidersMountedAnimType as being replicated to begin with, though, you don't need MulticastSetRidersMountedAnimType

#

you just need to set it

summer tide
#
void ARidableBaseCharacter::SetRidersMountedAnimType(int32 Type)
{
    RidersMountedAnimType = Type;
}```
I had this before which doesn't work.
raw quarry
#

right but you can only set it on the server

summer tide
#

wdym -

raw quarry
#

otherwise they'll get out of sync

summer tide
#

That function is in the component of the 3rdpersonchar

raw quarry
#

what calls it?

#

server or client or both

summer tide
#

From the component of the 3rpersonchar if (Rider) Rider->SetRidersMountedAnimType(3);

#

just like that

raw quarry
#

"from the component" doesn't mean too much

#

it can still be either client or server or both

#

on tick?

summer tide
#

yea

#

so should I create a server rpc in the comp then call the function in the char's class

raw quarry
#

if you want both clients and server to be able to set it at any time, then something like:

void ARidableBaseCharacter::SetRidersMountedAnimType(int32 Type)
{
    if (HasAuthority())
    {
        RidersMountedAnimType = Type;
    }
    else
    {
        ServerSetRidersMountedAnimType(Type);
    }
}
void ARidableBaseCharacter::ServerSetRidersMountedAnimType_Implementation(int32 Type)
{
    RidersMountedAnimType = Type;
}
summer tide
#

doesn't work

slate basin
#

hey, is it possible to run a eqs query synchronously?

empty bluff
#

@kindred widget regarding that container stuff i talked about, a while ago, i ended up with this solution:

#

Base: Container

#

Child: Chest

#

I've got another question now though. I plan on making a setup where a player can start a game to host it. He and only he should be able to Save the gamestate. Similarly to how games like 7d2d and Valheim does. So my question is. How do i start up a game like that as a server, without having to render and know about each and every actor in the game? I mean, the clients only render whatever is in their relevancy, but the person hosting the game will act as the server, and as far as i can see, when starting the game as a listen server, ALL actors render for him, no matter their relevancy settings. So i guess my question is really how do i start up a game with a "hidden" server, that knows about ALL actors and at the same time show a Client game window where it only knows and renders whatever is relevant for it? Hope i manage to explain my question clearly.

hollow eagle
#

The answer to your question is... it doesn't make sense to do what you're asking. But you didn't really explain why you care about this:

  • Are you worried about performance? If so, it isn't rendering all actors, that's what occlusion culling is for. If you're worried about simulating the whole world, you need to look into ways of either "chunking" the world (at regular intervals for procgen like minecraft, or for a premade map by manually defining areas to load/unload) or simply turning off actors that are too far away.
  • Are you worried about the person acting as the server cheating? If people are hosting a server on their machine you can forget about any sort of security. I wouldn't even bother thinking about it - people will do what they want on their own machines, and you're not going to be able to stop them. The only reasonable fix is to host servers for players.
empty bluff
#

@hollow eagle good questions and suggestions... i'll ellaborate later... on the way to work now.

velvet lintel
#

Hi! I'm a designer and I'm learning blueprints. I'm quickly exploring all areas and now I'm learning multiplayer.

I currently have a hint that I can test multiplayer with the Listen server option in PIE and that other team members can access if I open the level using the command open ?listen. But all the resources I found through googling for a week seemed to be about emulating a network environment on a local PC. The server and client windows pop up, but they were actually controlling the two characters by themselves alone.

I wish I could actually learn from a tutorial on setting up the Listen server in PIE and dealing with the contents of the team members' connections. If someone has good resources, can you recommend it to me?

thin stratus
#

One of the reasons why you may not find anything about this is that PIE should only be tested on one PC.

#

You can start the game as Standalone (e.g. Rightclick uproject file and hit launch game) or package it.

#

By default it's NULL which only allows server lists through broadcast ip in your lan.
As well as the direct connection via IP.

#

Which requires the host to have port 7777 open

#

@velvet lintel

velvet lintel
#

Oh! Thank you. I got a lot more insights. So, depending on the size of the game, it can take a long time to package, so is it the best way to run the game as standalone mode for iteration for testing and modification?
(I think I misunderstood that the standalone option of the play button is a kind of PIE.)
@thin stratus

thin stratus
#

The standalone button should do the same. But i usually don't use it

#

Packaging takes long but should be what you should every bow and then test in

#

The ue4 project might behave very differently when packaged if you are unlucky

#

If you set up iterative cooking etc then only the first time should take long

velvet lintel
#

Oh, I see. I think I know. I had previously experienced building a light map, where I was supposed to rebuild all the lights on the map even with very small modifications. I was worried that the packaging would work similarly, but I'm glad it only takes time at first. (Cookies look important.)

summer tide
#

Do you need to put all the replicated variables in GetLifetimeReplicatedProps?

twin juniper
#

Non-replicated actors can't have RPC ?

thin stratus
wary wyvern
#

Guys, are variables replicating with an actor all the time, or just when they changed?

violet sentinel
#

I have bunch of replicated variables that affect a cached "computed" variable. When any of them change the computed variable has to be recalculated on demand later.
Currently each replicated variable has an OnRep that calls Invalidate(), is there any more generic way? Would PostRepNotifies or PostNetReceive work as a single point of calling Invalidate()

dire cradle
chrome bay
#

@wary wyvern They only get sent out when they are changed

#

But they are checked at the "Net Update Frequency" and sent out at that rate at maximum

#

The server keeps a record of what clients have what values. That's why you shouldn't change replicated data client-side, since server will not know about it.

wary wyvern
chrome bay
#

The client 'acks' received packets with the server yeah, so the server knows what values the client has.

#

And it will only send a property if it's changed from the last-acked/sent property

dire cradle
#

It would stop sending the value until it's changed again

wary wyvern
#

@chrome bay Thanks!

chrome bay
#

you can see this for yourself using the network profiler btw

#

It logs everything that is sent and how often etc.

dire cradle
#

I have a problem with relevancy. My actor only runs net notify functions to client when the player gets near it even though the actor is set to always relevant

#

Server can see the changes in variables immediately but on the client the actor waits until the player gets near

chrome bay
#

Sounds like it's not actually being made always relevant

#

Not using rep graph or anything?

dire cradle
#

I tried to use multicast instead of repnotify and but that time it never replicated unless the client is near the actor

#

With repnotify it updates when player gets near

chrome bay
#

Yeah it's a relevancy issue then

#

Sounds like it's just not being made always relevant

dire cradle
#

Is there any way to force it to be relevant?

chrome bay
#

Hmm why is Dormancy explicitly set to "Never"?

dire cradle
#

I tested if that would solve the issue

#

it didnt

chrome bay
#

Are you using replication graph?

dire cradle
#

im not sure what you mean by replication graph

chrome bay
#

Ah in which case almost definitely not 😄

dire cradle
#

What is it

chrome bay
#

It's a different way of doing replication but you have to opt into it and actually build one for the project

#

Try unchecking Net Load on Client

#

Is it an actor that's pre-placed in the map?

dire cradle
#

Nope it gets spawned on the server and gets replicated to the clients

chrome bay
#

Ah kk

#

In which case I'm not sure, I would just double-check to be certain that is the actor you're spawning

#

Otherwise no reason it shouldn't work

dire cradle
#

it is

#

Always relevant is working on the server side but somehow clients are not considering it relevant until they get close

chrome bay
#

Well relevancy is only determined server-side so it shouldn't matter

#

The only other thing I can think of, is the actor is being throttled by other actors that are closer and potentially hogging all the available bandwidth

#

But since they're closer, they're higher priority

#

Unlikely though

dire cradle
#

There isn't much of anything that can cause a throttle in the game though

#

I'll try making it higher priority to test

#

Didn't work, same thing happens

chrome bay
#

Yeah not sure then, if it's always relevant it should just replicate without any issue

#

Does the actor exist on the client? You say it's being spawned - so if you can see the actor on the client then it must be relevant

#

If it wasn't relevant the client wouldn't even be able to see it

dire cradle
#

When the client is near the actor it replicates without any problems and is synced with the server

#

Problem occurs when client is away

chrome bay
#

But is the actor still visible to the client?

#

If they are then it's not a relevancy issue, because runtime-spawned actors get destroyed on that client when they are no longer relevant.

dire cradle
#

the actor doesn't have a primitive component, only a world widget

#

would that be considered as invisible?

chrome bay
#

Ah well world widgets are primitive comps so that's fine, so long as the actor has a root component

rose egret
#

@dire cradle didnt u override IsNetReleventFor ?

chrome bay
#

Oh yeah, if you overrode that then it'll use whatever custom logic you set.

dire cradle
#

oh found it

#

--
Found the issue

#

it wasn't about relevancy at all

#

The value was updating

#

The world widget that showed the value wasn't

#

False alarm and a pointless headache lmao

dire cradle
#

the client ITSELF wasn't

#

so the client was going irrelevant not the actor

dire cradle
#

That was a rollercoaster

potent cradle
#

Possessing a new pawn while having the debugger attached seems to cause this ensure to hit for me in repgraph:

#

Should I maybe clean up something when the pawn switches?

#

UReplicationGraphNode_AlwaysRelevant_ForConnection::GatherActorListsForConnection ends up triggering the ensure when it runs UpdateActor:

#

For posterity:
In this instance I was also destroying the old pawn when I possessed the new one, which causes this issue. SetLifespan does not have this problem 🙂

austere sinew
#

Hi, when I try to compile the server in the visual studio, I get this error, what is it and how to defeat it?

#

No, I said, I start the server through the shortcut with -log and it gives this error, it was compiled in the visual studio and transferred to the notification folder

grim rain
#

Did you include the module code in your game uproject code?

spring geode
#

So…im kinda new to Unreal, and i’ve been doing only singleplayer games, can i do multiplayer games the same way as singleplayer or is it diffrent?

rough kestrel
#

hey guys I have a problem I want to get data from game mode but it shows null on client side. I even tried getting it from game state

rich locust
#

thats why its null

#

if you cant get the data from game state

#

you might be doing something wrong

#

are you trying to access gamestate on beginplay ?

rough kestrel
#

freaking out as boss is breathing on my neck ☹

rough kestrel
rich locust
#

I run into this issue as well

#

try putting a little bit of delay on begin play

#

sometimes it doesnt get spawned when you try to access it

#

gamemode is non-existent on clients

#

try moving your stuff to otherparts if you want to access it directly from client

rough kestrel
#

how do I get data like player id? I am storing an array of pawns and getting them by index from game mode

Game state doe return the class but the object is always null

rich locust
#

simple

#

you dont

#

or you make a bridge

#

on gamestate

#

to request the data from server

glad escarp
#

Hey guys. I haven't asked a question in here before and I've tried to browse previous posts to see if my answer is anywhere so forgive me if this is a repeat question but here goes:

I'm making a ship in my multiplayer (listen server) game that lets players walk around on the deck and interact with different stations. The interacting client takes ownership of the actor and then input from the client's player character fires server replicated events to make the ship move forward or rotate. I'm using a Rotating Movement component to simply achieve rotation but the problem I'm facing is that the rotation is very choppy in the client player windows but is smooth in the server window. I'm relatively new to network replication so I really have no idea why I'm getting stuttering on rotation. Any insight would be much appreciated!

chrome bay
#

PlayerID's are stored on the PlayerState's, you can access all player states from a convenient container via AGameStateBase::PlayerArray

rough kestrel
chrome bay
#

Should never really use the GetPawn / GetController by index functions, they're virtually useless for Multiplayer

#

You can't

#

GameMode doesn't exist on clients for one thing, but also whatever data you get would have to be replicated somehow anyway.

rough kestrel
chrome bay
#

You can't get that, but it's a bad way to deal with it anyway

#

Use the PlayerArray from game state, and use the GetPawn function from the player states within

rough kestrel
#

so I have a VR pickup which can only be picked up by a specific player. If I dont store it in game mode where do I put ir?

chrome bay
#

That should really be dealt with by the pickup itself

#

No sense in polluting your gamemode with details/code for another system

#

Data/code locality matters a lot more in MP, you have to think about architecture more

#

In SP you can pretty much do whatever

rich locust
#

well then store the "specific player"`s playerstate on the object, and check if owner when interacted

chrome bay
#

Yeah something like that

#

The object should determine who can pick it up, or the player state should determine what it can pick up (or a mix of both) - none of that is really relevant to the gamemode

#

More of a design thing really

rough kestrel
#

i am new to mp in ue4 ☹ sadly boss wants mp vr

#

so if I do get a player from game state, how are they stored? in order of which logged in first?

rich locust
#

Im not sure how

#

why is the order matters

chrome bay
#

Yeah order is not maintained IIRC

rough kestrel
#

or should I set some variable in the pawn itself on post login to crosscheck with. Like post login, the pawn has an int assigned unique to it. Like first user is 1 second is 2

rich locust
#

you dont need it

chrome bay
#

I would check out cedrics Network Compendium btw, it covers a lot of this starting out stuff

rich locust
#

unreal handles it by it self anyway

#

you can just go with playerstate = playerstate

#

they are instanced not just a library

rough kestrel
rich locust
#

just store the login time on server

#

to servers system time

#

then just order it

rough kestrel
#

another way of thinking. Say a user who joins is auto assigned to a team. How to store that? does that change stuff?

chrome bay
#

I would just assign each player their own ID that you manage, even if it's just a simple counter

#

If login order matters that is

chrome bay
#

Team you would usually assign to a PlayerState yeah

rough kestrel
#

how does one access that? controller?

chrome bay
#

Controller->PlayerState

#

Def read that compendium, it'll answer a lot of Q's about the overall framework

rich locust
#

you can also access it via pawn too

chrome bay
rough kestrel
#

bingo that could do it way cleaner. Gonna try that tomorrow and hope I dont get another yelling 😅

rough kestrel
chrome bay
#

If your boss doesn't know the challenge of Multiplayer they are in no position to be bossing anyone 😄

rough kestrel
chrome bay
#

🔫

rough kestrel
#

😭

#

will let you know if it worked

chrome bay
#

For MP resources look at the compendium + the ShooterGame template project from Epic

spring geode
#

So…im kinda new to Unreal, and i’ve been doing only singleplayer games, can i do multiplayer games the same way as singleplayer or is it diffrent?

chrome bay
#

Ignore anything you find on YouTube because 99% of it is either nonsense or bad practice

#

Multiplayer tbh can only be e x p e r i e n c e d

rich locust
#

In theory multiplayer is easy

rough kestrel
#

also, how would I get reference to a player pawn whose Index I set in player state

rich locust
#

the problem starts when you need to design it

#

because its not just replicated or not

#

3 extra function types

rough kestrel
rich locust
#

or tell the blueprint to replicate or not

#

but no

chrome bay
#

It's honestly quite easy once you get your head around replication but it generally requires more advance planning and more volume of code to get even simple things implemented.

spring geode
#

is that reply to mine or?

chrome bay
#

Once you've learnt the "oopsies" of replication (usually the hard way), it starts to fall into place.

#

@spring geode Just in general tbh 😄

spring geode
#

ok ok

rough kestrel
spring geode
#

well is it a special way of programing in multiplayer or id it like the same as singeplayer, like if i did singleplayer games is it going to be almost the same to do multiplayer or?

chrome bay
#

A lot of MP is all about writing code that safely handles all the obscure race-conditions you wouldn't normally deal with that only surface 1/100 times etc.

spring geode
#

sorry if my english is bad

rough kestrel
chrome bay
#

Definitely more volume of code, but Epic's ShooterGame resource is a great one (bit old), their YouTube tutorials not so much.

spring geode
#

okayy, so its similar right?

#

to making singleplayer

#

well i will try it out soon if i will be stuck i will come back

chrome bay
#

Shortlist:

* Locality of code and data, general code design matters a lot.
* Code needs to safely handle all kinds of race conditions. (actors not being available when you think, different order of ops etc.)
* Need at least some C++ knowledge, Blueprint MP hits a wall early on.
* State = Replicated Vars
* Events/Calls = RPC's, (but sometimes vars).```
spring geode
#

Thanks

chrome bay
#

But otherwise check the pins, lots of stuff there

#

Any YT series' pinned there are probably okay. Just be wary of YouTube Gurus who spend more time chasing clout than actually engineering or shipping games. The difference can be stark... TBH that applies to everything though not just Multiplayer 😄

violet sentinel
#

😄

fading birch
#

There's a lot of little bad practices there that have shot me in the foot down the road too. Granted, you don't know it's a bad practice until you run into a situation where you realize it is.

#

There's also several different ways to do one thing. Some better than others depending on the situation

glad escarp
# chrome bay Any YT series' pinned there are probably okay. Just be wary of YouTube `Gurus` w...

Easier said than done. 😉 Hard to tell which is which until you've watched some of their videos all the way through. And coming from a beginner/novice standpoint, it's hard to tell even after watching since you don't know how to judge it. lol. When I'm learning new stuff I find myself following tutorials and then coming to places like this to learn from real devs how to make my code the way it should have gone in the first place.

chrome bay
#

Yeah, I think it's why MP is so hard to teach - there's just too much situational stuff you don't really fully understand until you see it in context.

fading birch
#

Code needs to safely handle all kinds of race conditions. (actors not being available when you think, different order of ops etc.) is one of the hardest things to get right imo

#

and you'll end up chasing your tail for days

chrome bay
#

Yeah for sure, that's one of the more difficult parts to deal with and why it takes 3-4 times as much code volume sometimes to do simple things.

fading birch
#

just throw it in tick until it's valid Kappa

chrome bay
#

🔫

rough kestrel
fading birch
#

I reference that document very very often

chrome bay
#

Yeah it's a good resource, I'd definitely look at ShooterGame too though. It's a pretty vast resource and a bit old, but still worth looking at.

fading birch
#

it's a gold mind of info

#

You can also look at Unreal Tournament too

chrome bay
#

Yeah

fading birch
#

it has stuff like a replay system, hit detection, etc

#

it's quite old

#

but still holds up alright

chrome bay
#

Though beware with UT, it definitely has a few "this just works for UT" stuff going on

#

But the folks that wrote it are the old-school devs from Epic, they know their shiz

violet sentinel
#

i really wanted to make something with UT projectiles. having too many projectiles that may bounce and spawning them locally is a problem for me

#

but if spawning them on server - by time they appear on client they may be already out of bounds

#

if spawned locally - can not handle bounce and other effects

fading birch
#

@chrome bay I can't remember off the top of my head, but do you recall if it's Shooter Game or UT that does client side hit detection?

#

I want to say UT

chrome bay
#

both IIRC

fading birch
#

I thought Shooter Game used the rep graph for it

chrome bay
#

ShooterGame has some limited verification server-side

#

It's not great though

#

But will get you by for hitscan

#

Projectiles are fully server-side in ShooterGame

rough kestrel
#

I wonder how UT aligns the bullets to the muzzle cuz pannini deforms the mesh. I know a little out of place but yeah

chrome bay
#

In UT I think they do a funky mixture

fading birch
#

yeah, doing projectiles are annoying since you need to rely on physics, which while deterministic in unreal, is annoying to get in sync with clients.

violet sentinel
#

would it be fair to spawn a fake visual projectile that does nothing and invisible projectile on server to do actual hit / fly physics etc

chrome bay
#

tbh all our bullets are projectiles and they're just data

fading birch
#

I wouldn't go that route personally.

chrome bay
#

spawning actors is just way too costly for us at that level

fading birch
#

unless you're doing a bit of a rewind

#

yeah, we sort of fake the funk as well

chrome bay
#

So many ways to do it but it just really depends on what you need

fading birch
#

mmhmm

#

and scale

violet sentinel
#

real ballistic vs replication for multiplayer

fading birch
#

for HLL and BTW it's a bit rough to spawn actors all the time

#

as that's a lot of overhead

violet sentinel
fading birch
#

We use an actor pool for quite a few things and it does help

violet sentinel
#

50-100 proj actors in pool seemed enough

chrome bay
#

it's more a scaling issue for us, 100 players is a ballache

fading birch
#

agreed

chrome bay
#

So we just did something totally bespoke

violet sentinel
#

true

chrome bay
#

Works really well for us but has limited application outside of "bullet shooty weapons" I think

fading birch
#

We went for a different approach. Our deployable/emplaced weapons are technically single round rifles

#

with more boom

spring geode
#

Does anyone know how to make like “teams”, lets say if i make hide and seek how can i make that one player the seeker and the others hiders, how to make those roles?

violet sentinel
chrome bay
#

yeah pretty much exactly

#

And data assets for projectile properties, and a couple of virtual functions for creating/updating the data

fading birch
violet sentinel
#

i'm trying to convince to not use a blueprint for each projectile type and use data assets

#

but ppl for some reason keep doing that

fading birch
#

just mark it as replicated, and set it from gamemode

violet sentinel
#

every variation a separate bp class

fading birch
#

oO

chrome bay
#

haha

fading birch
#

That's literally a perfect reason to use data assets

violet sentinel
#

nearly 120 projectile blueprints and 120 data assets, could boil it down to just 1 bp and 120 assets

chrome bay
#

Most of the game is held together with tape ofc but this is one thing that's worked out really well 😄

violet sentinel
#

yeah

#

and glue

fading birch
#

and brute force

spring geode
#

i once tried to do multiplayer game but the other player couldnt see like bullets or flashlight, what was the problem if you guys maybe know?

fading birch
#

sounds like some variables weren't replicated

violet sentinel
#

or if you spawning them on server then most likely by time it gets chance to replicate to client it may be already outside of level

spring geode
#

if i was only working with blueprints and i dont know c++, should I even try to do multiplayer game?

violet sentinel
#

relatively simple should be doable

spring geode
#

Okay, i want to try to do like hide and seek do you think it will be hard to do?

violet sentinel
#

yeah

#

but still better learn c++ 😄 for lobbies and other stuff

spring geode
#

Oh, well if i will need some help with it or if i get stuck can i ask for help here?

spring geode
fading birch
#

anything worth doing is difficult.

spring geode
#

right…how old are you guys and when did you start doing unreal?

empty bluff
# hollow eagle The answer to your question is... it doesn't make sense to do what you're asking...

Back from work now. Reason i asked the question, was because i was looking at what Net Cull Distance Squared did, and how it culled out actors on the Client very nicely when the Character went out of the Distance of it. So i thought about how a Server could achieve the same culling.
I mainly thought of this because of performance considerations. And by performance i think of both physics simulation and ticking actors (which i ofc. know should be kept to a minimum)
Im not as such worried about server-cheating.

glad escarp
#

Anyone know why I might be getting stuttering on a replicated actor's rotation? It translates vertically and horizontally without any stutter and in the server viewport, it rotates smoothly as well. But in client windows (listen-server model) the rotation stutter steps. I'm running the rotation code from the actor itself using a server RPC that just changes the rotation rate on a Rotating Movement component.

hollow eagle
#

The most you could do is put an actor to "sleep" if it's too far away from all players. But you can't just have the server ignore actors that otherwise need to be active.

rough kestrel
#

One question will any custom variable added to player state be replicated?

violet sentinel
empty bluff
rough kestrel
violet sentinel
summer tide
#

So I have a replicated variable that I set from other character component to my player character then use that variable in animbp to select animations to play. But the clients won’t see the anim how to fix?

empty bluff
#

@summer tide as i understand it, whatever variable you use in an animbp, needs to replicate for it to work.

rough kestrel
summer tide
empty bluff
summer tide
#

The other clients don't see the animation

spring geode
#

I will maybe try to make a hide and seek type of game but i have no experience in mutliplayer, i will watch tutorials ofc but if i will have some issues or problems is this the right place to ask for help?

fading birch
#

Within reason.

#

Most stuff you should be able to solve on your own with some googling

#

if you get stuck there, we'll give you a nudge in the right direction

spring geode
#

Thanks a lot

empty bluff
#

@hollow eagle Clicking the Host button, I want to start a server on my machine. Is it an option to "spawn" a dedicated server and then connect to it when clicking it? (instead of starting a ListenServer)

hollow eagle
#

You could, but why would you want to?

#

You'd waste even more resources like that.

empty bluff
#

ok, so ListenServer is the way i suppose

violet sentinel
#

dedicated server is a thing on its own

#

only fully functioning LS can be properly ported to dedicated with influx of fresh authority bugs

#

😄

kindred widget
#

I don't really see a problem with using a dedicated server. Running it on separate cores than you're gaming on can help.

empty bluff
#

kk, roger that

kindred widget
#

Ram is cheap. CPUs aren't. 🤷‍♂️

hollow eagle
#

RAM isn't the only issue

#

You're duplicating all kinds of work by running a dedicated server in the background, and you get almost zero benefit.

empty bluff
#

well, lets say i want to go with a dedicated server, so all players are clients, even the one playing on the same pc which runs the server, does anyone know if there's a guide or example of such a setup?

violet sentinel
#

aside from making a Server target should be same

#

but adds more troubles, since everything is a client things like lobby have to be thought out

hollow eagle
#

And again, there is zero reason to run both a dedicated server and a client on the same machine.

#

you will not save resources, you will end up using more.

violet sentinel
#

^

empty bluff
#

hmm ok i think i understand... will see how it goes with a listen server then

hollow eagle
#

Certain systems need to run regardless of whether you're a server or a client. So now you're running two sets of those systems, loading assets into memory twice (and hitting the disk twice as hard), ticking a world twice as much (because there will be overlap in what happens in a tick between servers and clients). Any predicted actors will hurt performance even more since you're now simulating things on both the server and client.
All this to save on some nebulous rendering cost on a client... that didn't need saving in the first place because unreal doesn't just render all actors naively.

#

A server needs to know about all (networked) actors, that doesn't mean it has to render every single one if it's a listen server.

empty bluff
#

oh but wait... just so i understand... lets say, as a listenserver player i stand 5000km from a door, and some client opens that door, if i could see that door from the Server player, it means he would see the door open? regardless of any replication settings?

hollow eagle
#

if there's absolutely nothing blocking the way and your clip plane is set past 5000km, yes. Neither of which seems realistic.

empty bluff
#

well, but in theory he would see it open then

#

what clip plane are you talking about btw?

fading birch
#

the network culling one

#

and visual too i imagine

hollow eagle
#

I was talking about the camera frustum. We're talking about on a listen server

#

network culling doesn't apply there

fading birch
#

fair point

#

it does for other clients tho yeah?

hollow eagle
#

yes

fading birch
#

just not the host

#

since they need to know

hollow eagle
#

which shouldn't matter, because something 5k km away is probably too far away to render anyway

#

this is sounding a lot like premature optimization anyway

#

make something that actually has this as a problem and then you might have a reason to think about this

empty bluff
#

ah i didn't know the camera had a clipplane

#

the 5k was an example 😉

fading birch
#

5k is a very very long way away

#

a more realistic example would be someone on the other side of a wall

hollow eagle
#

even in that example they wouldn't render unless their bounds were sticking through the wall

fading birch
#

Yeah

hollow eagle
#

you can even see exactly what's being rendered by going into PIE (or standalone), hitting ;, then hitting f

#

it'll freeze rendering and give you a free-cam to see what's actually being rendered by the engine

fading birch
#

r.VisualizeOccludedPrimitives 1 is good to see what's being occluded as well

empty bluff
#

i may be missing it on that page, but i don't see a place where you can define how far a camera renders

fading birch
#

You don't set it in the camera afaik, you set it per actor

hollow eagle
#

There's that, but the camera itself should have a far clip plane. I don't know how (or if) its exposed though.

#

The point of that page was to point out that the engine already handles only rendering stuff that's visible.

empty bluff
#

doesn't seem to be exposed

#

gotcha

fading birch
#

Are you familiar with Levels of Detail (LOD)'s?

empty bluff
#

yeah

#

are you suggesting i could add a LOD with 0 geo?

fading birch
#

nono

empty bluff
#

okok

#

🙂

fading birch
#

just saying, that helps with render performance as well

#

if you're on UE5 and using static meshes, Nanite handles that for you quite nicely

#

if you're not, then LOD's are your best friend for reducing tri counts

empty bluff
#

jup, i've tried UE5 too just for fun

#

which mentions min and max draw distances in advanced rendering details, which was what you meant right @fading birch ?

fading birch
#

I was referring to

empty bluff
#

yeah, i believe that's what they mention too

#

hmm or actually reading it again, it's something else

#

again, that only show up for static mesh actors though, so i guess it will have to be set for each static mesh component in ie. a BP actor

viscid monolith
#

How would i replicate destruction of bush actor, if i don't need any accurate replication?

#

Each client should play animations and effects by themselves, server just should notify every client, that bush actor is destroyed

#

Project is open world survival game

viscid monolith
#

No

#

There are too much of them to replicate

#

So i turned off replication

rich locust
#

you are going to run into problems

#

trust me

#

if you have a large world

#

I had 5 trials about this

#

replicated or not

#

too many actors on map

#

will hurt

#

a lot

viscid monolith
#

I know, it's hardest part of networking

rich locust
#

I can help you if you want

#

We have it figured out and it works perfect

viscid monolith
#

Im working on it for learning networking, so yes, help would be nice

rich locust
#

come to programmer parlor

viscid monolith
#

What's it?

rich locust
#

its voice channel

#

so I can share my screen to talk you through our logic

viscid monolith
#

Ah, damn, im from phone

#

Ill be on pc tomorrow, i can dm you

rich locust
#

I will be off for about 2 days

#

if you can wait we can

#

im not here tomorrow

#

sory

viscid monolith
#

No problems, i can wait! Thanks in advance!

#

I'm not at home this week tho, having vacations after contracts...

empty bluff
#

Would using foliage instead and swapping out instances with actors based on distance work? So that actors would get destroyed?

rich locust
#

it wont

#

it works to some extend

#

but if you have 1M + foliage

#

try removing an instance

#

and you will see a very noticable freeze

#

There are posts about this

#

you cant make multiple foliage instances

#

so all instances are bound to one controller

empty bluff
#

Hmm.. strange is that freeze only happening for multiplayer?

rich locust
#

it doesnt matter if multiplayer or not

#

foliage instances are local anyways

#

so no

empty bluff
#

Coz i made an interactable foliage setup a while ago that seemed to work fine with no stutters, but didnt know anything about multiplayer back then, so only worked for standalone

rich locust
#

its no difference

#

depends on how dense you want it to be

#

we had too much resources

empty bluff
#

Think i had 900k instances in my test

rich locust
#

so we came to a point of freeze

#

bu

#

but

#

did you try to remove an instance ?

empty bluff
#

Yeah

rich locust
#

wow

#

thats interesting

#

I think we have much more than that then

empty bluff
#

I think atleast.. let me find the video i made

rich locust
#

because we tried it out in packaged build as well

empty bluff
#

Hmm i dont show that many foliages on this video.. but i had a shitload once

#

Anyway what approach did yo use?

rich locust
#

in a nutshell, object pooling

empty bluff
#

Sounds interresting.. would love to hear more details of that setup

tacit sage
fading birch
#

that's still the case. The steam online subsystem does not work in the editor, you'll need to launch via standalone game.

#

That said, if you're trying to test session functionality, it's fine to just use the null subsystem as it's functionality matches steam in that regard.

boreal geyser
#

Is there a way to create a server without opening a new level? I want to transition from my "host game" screen to my pre-game lobby where players can chat, which are both in the same level right now. Pretty much all examples I see have an OpenLevel node with the "?listen" option but I want to find a way to set the "?listen" option without the open level node. I am using the advanced sessions plugin. If its recommended that I just move the lobby to a new level, I can do it I was just wondering if its possible to connect to a server without changing levels.

halcyon totem
#

can someone help? I am having a weird issue, for some reason, my rotation gets messed up with this code, and it seperates the camera from the body it was working before I dont know why its acting like this