#multiplayer

1 messages · Page 96 of 1

peak latch
#

I'm trying to get a simple multiplayer demo working with Steam. I follow that tutorial and everything seem to work fine where I can join friend's session but not the otherway around, i.e. I can't create a session and have friend join it. I did my build with UE5.2.1 all in blueprint since I do not need a dedicated server (no C++ build). Anyone face that issue with Steam ? any good tutorial to help troubleshooting Steam with Unreal ? https://youtu.be/Kwbtcp6WHnI

Hello! And if you're new, welcome to the channel - its a pleasure to have you here!

In todays video, we will be making a Multiplayer, well, the word 'game' dont feel right - we are making a Creating Lobby Session, Populating a Server List, setting up what we need in order to get this onto our steamworks site, then finally, going through the pro...

▶ Play video
thin stratus
# peak latch I'm trying to get a simple multiplayer demo working with Steam. I follow that tu...

I can't comment on your actual issue, cause you'd need to share some more info. Best in form of logs for both server and client.

However I just wanted to clarify that you don't need a C++ build for Dedicated Servers.
You need a SOURCE Build, which is the Engine downloaded from GitHub and compiled.
As opposed to the LAUNCHER Build, that you download via the Launcher/Epic Games Store thingy. Your project having C++ or not doesn't matter.

icy jetty
nocturne quail
#

printed all variables and everything is fine with variables

thin stratus
#

Hm, not sure then atm

nocturne quail
#

the speed increased to 600 on all clients

peak latch
wooden abyss
#

Hello everyone, I have an issue with some replication stuff in my game. It's a basic tower defense game. The map consists of Nodes which can each hold a Tower Actor. Both the Node and Tower Actor are set to replicate. The Node has a Reference for a Tower and its set to RepNotify. When I delete the tower the RepNotify function on my Node Actor triggers for all the clients. When I create a new Tower and set the Reference on the Node the RepNotify triggers as well. Now I have implemented an Upgrade System for the Tower Actor. The actual reference doesnt change when the Tower is upgraded. On the Upgrade Event (called by the GameMode) I manually call the Set w/ Notify function but the RepNotify actually only triggers on the Server but not on the clients. The values actually replicate but I do have some stuff that triggers in the RepNotify to update the UI.

peak latch
# thin stratus Yeah

So if I do not want a dedicated server, is using UE from the Epic Launcher is fine ?

thin stratus
#

Yes

wooden abyss
#

Tl:dr the SET w/ Notify doesnt trigger the RepNotify method on my clients but it does on the Server client

#

Is there any way I can force the RepNotify to trigger? I though the SET w/ Notify would be enough or is there a specific reason why it doesnt get triggered on the clients?

peak latch
#

If I want to test my multiplayer game in Steam but without another physical PC, is anyone has a suggestion ? I was thinking of using that service: https://shadow.tech/

nocturne quail
thin stratus
thin stratus
#

It should only call on change

#

Which is what it does (in BPs it's actually a change notifier, in C++ it's the correct Notify for Clients only, fyi)

#

if you want to run code based on an upgrade, you'll want to have some sort of indicator for the upgrade (e.g. a level) and have that RepNotify

wooden abyss
#

Alright thank you very much. That definitly clarifies the RepNotify for me 😄

#

So on Destroy Actor it works because the actual Reference changes

thin stratus
#

Yep

#

To nullptr

wooden abyss
#

But a change in the Tower actor itself doesnt trigger because the TowerReference doesnt change

thin stratus
#

(htat's also not a reference but just a pointer, idk why epic calls them references in BP)

thin stratus
wooden abyss
#

Alright gotcha

thin stratus
#

If you have other data that should cause a change then that has to be repnotify as well

wooden abyss
#

Thanks a lot!

nocturne quail
#

if I use 2D Blend space it only works if I use Server Movement flags

cursive crest
#

Hey everyone! I'm trying to do line trace on server (event run on server), when I take forward vector of an object that not on server character vision (simply looking in other way) it returns wrong value and not changing at all until I look at the object on server. Does anyone know what might be the problem? Always replicates is on as well as just replicates.

nocturne quail
#

is there another way to use 2D blend space for sprinting?

chrome whale
#

Wait, what? I was telling if it’s because it’s 2 game using the the eos on the same computer that’s slowing it down when one or the windows is out of focus

thin stratus
#

Like the weapon?

nocturne quail
#

can we have a template function for AuthorityCheck?

CheckHasAuthorityTemplate(LocalFunction, MulticastFunction, ServerFunction, bConditionFunction);
strange geode
#

im trying to connect to a listen server as a client like this:

void UFurAndFangGameInstance::JoinServer(int32 ServerNumber)
{
    IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
    IOnlineIdentityPtr IdentityInterface = OnlineSub->GetIdentityInterface();
    TSharedPtr<const FUniqueNetId> UserId;
    if (IdentityInterface.IsValid())
    {
        UserId = IdentityInterface->GetUniquePlayerId(0);
    }

    SessionInterface->JoinSession(*UserId, SESSION_NAME, SessionSearch->SearchResults[ServerNumber]);

    FString Messaage = FString::Printf(TEXT("Joining Session %s"), *SessionSearch->SearchResults[ServerNumber].GetSessionIdStr());
    GetEngine()->AddOnScreenDebugMessage(0, 2, FColor::Green, Messaage);
}

delegate:


void UFurAndFangGameInstance::OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
{
    if (Result == EOnJoinSessionCompleteResult::Success)
    {
        GetEngine()->AddOnScreenDebugMessage(6845, 10, FColor::Red, TEXT("Successfuly Joined Session"));

        FString Address;
        if (!SessionInterface->GetResolvedConnectString(SessionName, Address)) {
            GetEngine()->AddOnScreenDebugMessage(63451, 5, FColor::Green, TEXT("Could not get connect string."));
            return;
        }


        APlayerController* PlayerController = GetFirstLocalPlayerController();
        //if (!ensure(PlayerController != nullptr)) return;

        GetEngine()->AddOnScreenDebugMessage(63451, 5, FColor::Green, FString::Printf(TEXT("Loading Map for %s"), *Address));

        PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);

    }
    else
    {
        GetEngine()->AddOnScreenDebugMessage(6845, 10, FColor::Red, TEXT("Failed to Join session "));
    }
}

I do get the "Successfuly Joined Session" debug messages etc, But the client wont load into the same map as the server and will stay in the main menu,ive made sure this line:

PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);

is executed

does anyone know possible reasons as to why this isnt working properly ?

hollow eagle
#

Probably has to happen only once both sides have finished the movement, though that seems a bit dangerous.

thin stratus
#

You can try to set the location of the character to the same end location and call "FlushServerMove"

#

Might help, but not entirely sure

#

We did that somewhere for throwing a player on my last client's project

thin stratus
#

Also what's the address here?

#

Are you sure that's correct?

#

Cause Session and Server join are two different things

#

And you might not need the identity interface for the Id. The PlayerController's LocalPlayer should have access to that

cursive crest
# thin stratus Is that object something attached to the client?

yeah, kind of, it's weapon that client possesses to via controller. I actually found out the reason behind all of it.
I set rotation of skeletal mesh part in anim blueprint via node - transfrom (modify) Bone, and my scene component, from which I get forward vector, attached to this bone. So when client is not on server view, rotation of bones from anim blueprint not replicates to server. But I'm still don't know hot to get it replicated.

thin stratus
#

One of the main cause of "Server isn't looking and things break." bugs

cursive crest
thin stratus
#

We flush server moves for RootMotionSources

#

Have to even

#

No

#

Before executing it

#

Also we don't even set ignore client corrections

#

But we also use RootMotionSources

#

CMC should sync RootMotion though anyway

strange geode
# thin stratus And you might not need the identity interface for the Id. The PlayerController's...

can the param in the delegate be == EOnJoinSessionCompleteResult::Success even if i didnt connect to the correct adress?

im assuming thats the case because i found this in the logs

[2023.06.23-20.02.22:376][599]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.01, Real: 20.01, Good: 20.01, DriverTime: 20.03, Threshold: 20.00, [UNetConnection] RemoteAddr: 10.2.0.2:7777, Name: SteamNetConnection_0, Driver: PendingNetDriver SteamNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Driver = PendingNetDriver SteamNetDriver_0

and 10.2.0.2:7777 isnt the correct adress

thin stratus
#

Session is not equal server

#

Session is a backend data structure

#

Server is the actual game you join

strange geode
#

ok ty

thin stratus
#

and 10.2.0.2:7777 isnt the correct adress
Aren't you using steam?

#

Ah no

#

Are you using any Subsystem?

strange geode
#

I am using the steam subsystem, I enabled the plugin and put this in the Engine.ini

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

nimble snow
#

Hello, I have a problem about multiplayer anim montages. I have 4 characters which are children of one base character class. I'm casting the character as it's shown in the first image. And the second image is inside my player controller, and here is the codes for playing the anim montage. The issue is, when the 'Tank_EnemyApplyDamage' event runs, server and client both can play the montage. But when server plays clients can't see it, when the clients play server can see it. What can be the problem here?

keen hound
#

Why is my dedicated server opening and closing?
it shows no logs

#

I built it in-editor

#

this is on a windows vps

sinful tree
keen hound
#

on my regular computer it just opens but no logs or anything

nimble snow
sinful tree
nimble snow
stoic acorn
#

Evening. I'm getting an error when a widget button click to create session -> Open Level (by Name). It flashes up the level it's trying to load then shuts down with this message Error 'Failed to load package '/Game/Maps/House01''. Exiting.
Any ideas why this might be happening?

keen hound
sinful tree
# keen hound Why is my dedicated server opening and closing? it shows no logs

Without logs, one can only assume one of two things:

  1. You have done something that's causing it to crash.
  2. You are missing something that it needs in order to run correctly.

First thing that came to my mind is you need to specify in the project settings in the editor the levels to include in a packaged build (can be found by searching for "List of maps" in the project settings).

keen hound
#

I have these two maps in the list already

sinful tree
#

There's a specific field called "List of maps to include in packaged build" or something like that.

keen hound
#

yeah, I have both those maps there

keen hound
halcyon totem
#

when using unreal insights what port do I need to use to connect?

#

its not connecting, to the dedicated server to test

#

do I need to open ports?

keen hound
#

that's where it crashes

#

on my regular pc it stays open

#

but it does nothing

stoic acorn
#

#multiplayer message Anyone know why this might be happening?
Weirdly, it only happens if it's the listen server that creates the session first. If a client creates a session then the server can also create one.

halcyon totem
#

my player starts on my server is causing lags, what can I change my net freqency to?

boreal bison
#

How do I make a multiplayer UI that shows every player's name in a different spot but always has the local player at the bottom? I'm making a board game and want the names to go around the board, where the local player is at the bottom and every other player is around the cardinal directions of the table

sinful tree
boreal bison
#

Right, makes sense thanks!

oak pond
#

is there a specific method to do "ghost" multiplayer like how a lot of racing games do? so like you can see the other players, but cant interact with them in any way. it doesnt even matter how laggy you are because it wont affect gameplay since all youre seeing is just where the other players moved around the map, it can even be delayed without causing any problems

#

and Im wondering if theres any other ways I can minimise what needs to be replicated as much as possible

errant mulch
#

hello, is this the right place to ask for help?

#

i cant seem to find a help channel

sinful tree
errant mulch
#

multiplayer coding

#

introduction stuff, rpc, replication...

sinful tree
errant mulch
#

well, im basically trying to replicate in the clients the ball that you shoot when you pick up the weapon from the floor in ue5

#

but i have this error, ive been finding things online about ownership, netconnection, but i cant seem to understand the error, let alone fix it

#
    void Fire();
    UFUNCTION(BlueprintCallable, Category = "Weapon", Server, reliable,WithValidation)
    void Server_fire(FVector Location, FRotator Rotation);
    bool Server_fire_Validate(FVector Location, FRotator Rotation);
    void Server_fire_Implementation(FVector Location, FRotator Rotation);

this is the declaration of the functions (i found the rest of the functions in a tutorial for ue4

#

should note that the weapon does fire the proyectile if playing on server

sinful tree
#

This would have an additional caveat that if players are able to drop weapons, you would also want to remove their ownership when it gets dropped.

errant mulch
#

huh, i though the pickupcomponent would assign an owner to the one who picked up

errant mulch
#

i know in bps that when you spawn an actor, you can assign an owner

#

is there a function for setting owner?

#

huh, i see now

#

i can get the owner

#

but i cant set it

#

atleast not in c++

hollow eagle
#

What do you mean you can't?

errant mulch
#

GetOwner()->AttachToComponent(Character->GetMesh1P(),AttachmentRules, FName(TEXT("GripPoint")));

#

this is the function unreal has on the weaponcomponent to attach it to the character

#

it has a getowner, but intelissense dosent recognise anything like a SetOwner()

#

in c++ atleast

hollow eagle
#

all actors have SetOwner

errant mulch
#

but it does have one in blueprint

hollow eagle
#

yes, because all actors have a SetOwner function. It's part of AActor.

#

Intellisense is frequently wrong. Using it to assume anything about what functions are available is just going to get you in trouble.

errant mulch
#

maybe im typping it on the wrong place

errant mulch
#

and if i cant rely on intelisense, well, i might go a little harder on the blueprint part

hollow eagle
#

R#, Rider, and Visual Assist all work much better if you can either pay for them or if you're a student (in which case R# and Rider are free).

errant mulch
#

oh

#

ill check them out

#

that actually sounds neat

#

maybe not live solving

#

but neat

#

ill keep looking for myself stuff before coming here

#

thanks anyway siliex

#

and datura

keen hound
boreal bison
oak pond
#

damn immediately 43 messages right after my question, didn’t expect any activity here until tomorrow afternoon

keen hound
#

@sinful tree what other ideas do you have on what could cause this?

sinful tree
# boreal bison What's the most efficient way to assign the actual names in the array to the slo...

Each "slot" could be part of an array. You can keep track of an index that you increment each time you assign a player to a slot.
So first non-local player in the player array is say at index 0, so they get assigned to slot your tracker index which is 0. Increment your tracker index (now at 1).
Your local player is at index 1, so you just assign that to the "local player" slot, don't increment your index.
Second non-local player in the player array is at index 2, so they get assigned to your tracker index 1. Increment your index.

Etc.

boreal bison
sinful tree
sinful tree
#

That will always be the local player controller and their local playerstate.

boreal bison
#

I only use that to check if it's the local playerstate

sinful tree
#

You're using it here.

boreal bison
#

Yeah it works there

#

It just updates the clients view of their own inventory

sinful tree
#

Oh ok

boreal bison
#

the for loop is where I'm trying to get the player array from the gamestate

#

and then I have an array of the slots that aren't the local players slot

#

but none of this seems to work

sinful tree
#

Well this all seems ok. You're setting a text within that slot - what do you do with the text from there?

#

Are you perhaps also constructing this widget on begin play when the playerstates may not necessarily be ready?

boreal bison
#

But it all runs after a 0.2 second delay

#

the text from there, I don't think I do anything with it

sinful tree
#

Well if all you're doing is assigning text to something like that, how do you get it displayed?

#

Normally to display a text widget you'd do something like SetText or what have you.

boreal bison
#

changed it but no change

sinful tree
boreal bison
#

Getting a whole lot of nothing

#

from the server nor the client

#

I can't remember where I set the player name in the first place

#

let me dig a little

#

I deleted my call to my event that updated the players name at some point -.-

#

currently works for the remote client but not the host

boreal bison
boreal bison
#

weirdly, players 2 and 4 can both see player 1's name, but player's 1 and 3 can only see their own name

boreal bison
#

sometimes

clever hound
#

Im calling this dash on multicast but when playing IN CLIENT MODE it stutters and has rubberbanding and does not move the amount it would on standalone. Is that function really too much for the servers to handle?

kindred widget
# clever hound Im calling this dash on multicast but when playing IN CLIENT MODE it stutters an...

There are settings in the CMC that dictate how far a client can be from server corrections when server replicates where it thinks the client should be. Your client is probably locally leaving this area immediately as it will simulate before the server knows the client is moving. Then server simulates, replicates back, but by that time client has simulated again and is way out of this zone, so it resets back. Repeat, repeat, repeat, view as stuttering movement.

Can't remember the names off hand but check in the character's character movement component for those.

pallid gorge
#

Hi.

I was following this tutorial:
https://youtu.be/9-sp2qCTAK0

But I have to change it, I would like to destroy actor only if the player talked to an npc, which is a boolean. But how can I check if the boolean is true or false? If it's true then it should destroy the actor, otherwise not.

pallid gorge
#

Anyone knows?

unkempt tiger
#

How do TSubClassOf types get sent across the network? Is it the name of the class itself that gets serialized as a sequence of characters? Or is there some kind of optimization involved?

dark parcel
#

You need to get reference of your player character and get the boolean has talked to npc

pallid gorge
#

OK sorry

#

I'll ask it thete

#

There

river dome
#

Hey guys

#

Each my levels has a camera. I want to use the same camera for all players is that possible? or do i need to spawn in a camera for each individual player? The map is a static map shown from above

icy jetty
nimble snow
#

Hello, I have a problem. I want my character to rotate towards the direction where its skill is aimed. I am using the "Set Rotation" node and calling it in a multicast event. It works on the server side, but on the client side, it's not working as shown in the video. The server can see that the client is rotating in the correct direction, but it's not visible on the client side. What could be the problem?

crystal crag
#

I wonder how many companies manage player parties through web services and have the game servers communicate through those.

#

Since all of the player invites are done through the client if you go through the online subsystem

#

the server has no knowledge of it. So if you want to track player parties as the players are joining the server, that's the first idea that came to mind on how you could manage that.

peak latch
#

I try to get logs to debug my create session in Steam by activation the following lines into the DefaultEngine.ini "[Core.log]
LogOnline=All" Unfortunately I do not get any logs file, any suggestion on how to enable all log for a Package Project ?

crystal crag
#

This is why the C++ channel gets tons of non-c++ questions. No other channel ever gets any answers to questions.

peak latch
oak pond
#

yeah almost all the channels here are just questions stacked on top of questions because no one can answer them. reddit is sometimes better though

crystal crag
#

They can answer them most of the time. There are many people here that have real gaming industry jobs and have seen a lot of stuff, but they just choose not to. But it is what it is.

peak latch
#

I will answer my own question than: after adding the lines [Core.log] LogOnline=All, the log file was actually generated but I was looking under the wrong folder! 😉

thin stratus
#

Cause Shipping Builds have no log files by default

#

Or any logging fwiw

#

Ah, I should ahve scrolled

#

NVM

thin stratus
thin stratus
#

Same for other Subsystems

thin stratus
#

You might want to call the SetRotation locally instantly though, and filter it in the Multicast, to only affect Simulated Clients (and the Server fwiw), so you don't have to wait for the Rotation to replicate for the local client.

carmine ember
#

What determines whether an actor can be used as an argument in an RPC?

I have a Multicast that i am calling from the server (GameMode to be specific)
When it is invoked on the server, the pointer is valid
When it is invoked on the client, it is nullptr

stoic acorn
#

Hey guys. I kind of have main menu (host/join sessions) working.
SUCCESS: If I set net mode to play as client it all works (any client can host a game, and all other clients can join.
FAILS: Unfortunately when I try to run it as Play as Listen Server, and the Server hosts the game and creates the session, as soon as it's created and travels to the desired level, all of the clients are loaded into the level at the same time (No need for finding and joining a session).

Any clues as to why this is happening would be appreciated

sinful tree
#

Because playing in the editor is a bit of a different beast than what you would be doing with an actual game.
PIE with a listen server means all the PIE clients are connecting to the listen server when they start up, so that means they're technically already joined to the game.

It'd be better to test session functionality using standalone rather than playing in editor.

stoic acorn
#

ah, thanks Datura. Didn't know that

#

That might explain some other weird behaviour I've been noticing

#

It's a shame standalone takes so long to load up

fossil spoke
#

Take a look at that post.

stoic acorn
nimble snow
#

any ideas for that?

carmine ember
cobalt gorge
#

Anyone have any tips for someone trying to learn the concepts of multiplayer but not quite grasping it? Anyone encounter the same issue for a while? What was the best way for you to learn? I'm taking the GameDev.tv course but starting to struggle and fall behind a bit

nocturne quail
#

I am having this issue now for few hours, anyone know to deal with it?

nocturne quail
#

here is the call stack

[Inline Frame] UE4Editor-Engine.dll!USceneComponent::DetachFromComponent::__l11::<lambda_57f87ec6a2d98a550c8cad679ff8837c>::operator()() Line 2174    C++
UE4Editor-Engine.dll!USceneComponent::DetachFromComponent(const FDetachmentTransformRules & DetachmentRules) Line 2174    C++
UE4Editor-Engine.dll!USceneComponent::AttachToComponent(USceneComponent * Parent, const FAttachmentTransformRules & AttachmentRules, FName SocketName) Line 1932    C++
UE4Editor-Engine.dll!AActor::AttachToComponent(USceneComponent * Parent, const FAttachmentTransformRules & AttachmentRules, FName SocketName) Line 1777    C++
UE4Editor-ARMA.dll!AARMACharacterBase::Attach(AItemBase * NewItem, FName NewSocket) Line 1301    C++
#
void AARMACharacterBase::Attach(AItemBase* NewItem, FName NewSocket)
{
    if (GetThirdPersonSKM() && NewItem && !NewSocket.IsNone())
    {
        NewItem->SetActorTransform(GetThirdPersonSKM()->GetSocketTransform(NewSocket, ERelativeTransformSpace::RTS_World), false, false);
        NewItem->AttachToComponent(GetThirdPersonSKM(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::KeepWorld, EAttachmentRule::KeepRelative, true), NewSocket);
    }
}
chrome whale
#

So, i'm having this issue when I have 2 standalone windows open, when I focus on one, it makes the other really buggy, but when I unfocus from both windows, they both work perfectly fine. Anyone know why?

nocturne quail
chrome whale
#

Laggy, sorry

nocturne quail
# chrome whale Laggy, sorry

this can be solved by doing two things,
1: Write optimized code and avoid using ticks and loops where possible
or
2: get some more RAM

#

like 64 gb

chrome whale
#

And both windows are fine when you click off of them both

nocturne quail
nocturne quail
chrome whale
nocturne quail
#

open task manager and investigate

chrome whale
#

ik

nocturne quail
#

how much memory is used when you click and unclick in the window

chrome whale
#

42% When clicked on and not clicked on

#

It's hardly using the CPU

nocturne quail
#

its mean the code is not written for low end pc

chrome whale
nocturne quail
chrome whale
#

2 Weeks

nocturne quail
#

6core processor?

chrome whale
#

8 core

nocturne quail
#

and gpu?

chrome whale
#

RTX 4080

#

Basically 16gbs

nocturne quail
#

in this case your pc is not the problem, the problem is the hard disk maybe if you are not using ssd

chrome whale
#

2Tb M.2 ssd

nocturne quail
#

fine, how many slots of RAM you are using? and what is the speed of each slot?

chrome whale
#

2

#

For Dual channe;

nocturne quail
#

16x2 ?

chrome whale
#

Yes

nocturne quail
#

bad idea

#

update mother board if it is not supporting 4 channels

#

and do 8x4

#

16x2 gives performance like 16 gb, because they hardly heat up

chrome whale
#

I was also told by someone who has a masters in Computer Science to do 2x16 and not 4x8

nocturne quail
chrome whale
nocturne quail
#

using 4 slots of same brand chips is ideal

nocturne quail
chrome whale
#

Ok now we’re getting off topic

nocturne quail
crystal crag
#

Is passing in a valid UWorld* necessary when calling Online::GetSubsystem()? I'm writing a custom plugin that will handle interactions with the online subsystem. Normally I write this in something like a UGameInstanceSubsystem, so getting the world isn't an issue. But with this custom plugin, I have a TSharedFromThis<> implementation, and I am not quite sure how I would go about passing in the world if it ends up being required.

chrome whale
#

@nocturne quail In the bios it can read both slots and see that there’s not in the other two

#

Now what?

nocturne quail
nocturne quail
chrome whale
#

4

nocturne quail
#

read the docs of the mother board

chrome whale
#

Yes. Only 2 are active

nocturne quail
#

its mean you can use only 2 at a time, upgrade MB

chrome whale
#

No, I can use all 4. I’m just not

#

Anyways I don't think it's the ram because the memory usage doesn't increase or decrease when you click on one of the windows

chrome whale
nocturne quail
nocturne quail
chrome whale
nocturne quail
#

disable antivirus completely, and try again

chrome whale
#

Basically, what it looks like is happening is if you click on one of the standalone windows, kills off CPU usage to all other applications running, including discord

chrome whale
nocturne quail
#

try play in one process, it will save performance

nocturne quail
#

last option to clean up the disk

#

you may have some bad blocks, transfering data slowly with laggs

chrome whale
nocturne quail
chrome whale
#

You can see when I click off and when and which one I click onto one of the UE Standalone windows and when I click off of both

nocturne quail
#

it could be opera browser

#

close it and test it again

chrome whale
#

And I've even tried closing everything

last grail
#

I may be overthinking this, should I handle match-state code in the gamestate because everyone can see it? So when I want to end my game that is where I run the code for showing all the end game widgets and such?

last grail
#

I was more asking whether the gamemode should be handling the logic of fetching all players and running the end game code on their characters such as disabling movement and spawning widgets. It just doesnt seem like something the game state should do as it should just be monitoring the state of the game and relaying data between users.

last grail
#

Once again, I understand the replication rules between the two. I'll just ask reddit.

icy jetty
last grail
nocturne quail
keen hound
#

has anyone else had a issue of a dedicated server opening, then closing?

#

on the -log command it shows nothing

nocturne quail
#

running something on multicast needs variables to be replicated?

wispy iron
#

Hi guys.
Having problem with FFastArraySerializer
On how network system works - It doesn't allow to send more than ~2000 items or 64kb of data in one array delta update
The main issue is when someone join game late, and there are many items in array...
I`m thinking of some sort of load array in some other way, and then swap it with replicated one, having replication turned off, but having no success yet

nocturne quail
wispy iron
wispy iron
silent valley
wispy iron
silent valley
#

It would be better to break the array up imo

wispy iron
#

It is tricky with FFastArraySerializer

#

Your FFastArraySerializer must not be nested in a static array.

#

Something like ??

struct FNestedArray : public FFastArraySerializer
{
}

USTRUCT()
struct MyArrayOfFastArrays
{
    UPROPERTY(Replicated)
    FNestedArray Array;
};

UPROPERTY(Replicated)
TArray<MyArrayOfFastArrays> NestedArray;```
silent valley
#

Break it across multiple actors I mean.

keen hound
wispy iron
silent valley
wispy iron
#

It`s global object, like market orders that are synced with server when I open market tab

#

thinking about other ways, but fast array could be very handy if not that issue

silent valley
#

Maybe sending all data to all clients is not the right approach?

wispy iron
#

I send on demand when client needs that

silent valley
#

So you don't need a fast array. If the client wants the top 100 results just send those.

wispy iron
#

yes I think I would change approach, thanks

silent valley
nocturne quail
#

I am calling this on a NetMulticast in MyController.cpp, and the animation is not updating if I am not replicating the variable bHoldGun , any idea why this heapon?
but if I call the same function in MyCharacter.cpp the animation to hold weapon replicates correctly even if I not set the bHoldGun to be replicated

if (AItemWeapon* NewWeaponItem = GetWorld()->SpawnActor<AItemWeapon>(ItemWeaponClass, location, SpawnParams))
{
    NewWeaponItem->ID_in_datatable = FName(TEXT("62"));
    NewWeaponItem->SerialNumber = "1000";
    NewWeaponItem->Quantity = 1;
    NewWeaponItem->PositionWep = EWeaponPosition::E_Left;
    NewWeaponItem->FinishSpawning(loc);
    CharacterRef->SetIsHoldWeapon(true);
    MyPlayerStateRef->bHoldGun = true;
}
covert igloo
#

when i multicast an event. does it play only on all clients. or does the server also play the event

keen hound
#

It just opens and closes

thin stratus
#

Only server and local client have the Controller.

#

No other client will get that call

#

And about the bHoldGun boolean; no idea what this does but Multicasts don't require any replicated variables

covert igloo
keen hound
#

okay so I got the whole no log issue fixed

#

but idk what's causing it to close now

#

on my pc it works fine

#

but on the vps it gives this error

stoic acorn
#

I want to have a player be able to possess a pawn (in this case a suit of armour) that would act as a one shot protection against an enemy attack, my thought process is this.

  1. Create an interface to detect whether the player is on the relevant team
  2. If the player is on a valid team -> destroy the character pawn -> Possess the armour pawn with the player controller as reference

My question is this.. I want to have all sorts of items and things that the player can pick up and use as armour. What would be the best way of handling that in terms of recognising armour protection etc?
I want to be able to scale this accordingly i.e. keep adding to the armour items that the players can pick up, maybe give them different protection properties etc

thin stratus
#

@peak lintel honestly that's unrelated to UE. You should probably ask that on the Gamelift forums or so

nocturne quail
naive ore
naive ore
#

Lol. Just noticed this resource is already pinned :/ 🙂

real ridge
thin stratus
#

The Multicast can't reach all clients if done in a Controller

nocturne quail
unique cloak
#

I want to set the location of an actor on the server (which is probably normal) and the thing is when I set its location its being set to the wrong location when called on the server, when Its on all of the machines its fine but the actor's rotation is a bot off (you can see in the image that I moved the commented line to the top of the function and then the transformation was better), does anyone has any idea why?

elder lynx
#

I have one question, When we play as listen server on Unreal Editor then what will be executed first among NPCAIController Begin Play or GameState BeginPlay?

quasi tide
#

No guarantee

shrewd tinsel
#

hi guys

#

how does one do "enter a vehicle" functionality?

#

and exit

#

do i have to unpossess and then possess?

#

for some reason when im exiting a vehicle my character gets destroyed

#

what would be the 'go-to' solution?

real ridge
#

guys once I hear here that using widgets in games also in MP games in unreal engine is not good approach that it is supposed to be for VR it is true?

#

what else then we should use

oak prawn
#

When I do animation blueprint (Root motion Mode = Root Motion From Everything ), the other player cannot see my character moving, how can I replicate it?

real ridge
oak prawn
keen hound
untold rose
#

I have an array that set to replicate (Owner Only) but the data is only on the client side and not on the server. Why would this be? I've done it for other arrays and the data is still on the server side. I just can't pin point where I've gone wrong so if anyone could point me in the right direction, that would be amazing.

NM: Just realized I've not got the add to array logic set to run on the server. 🤦

real ridge
#

btw guys I am not able cast to player state in actor begin play because its not exist yet but I except delay node is not solution however it works with it any tips?

#

:

#

😦

#

also I tried function which I want to execute from begin play of player state by casting inside my actor but same .... idk what to do

graceful flame
#

Since a delay is a fixed amount of time it might load quicker or slower than the delay. Try instead setting a timer by event and have it keep looping until the PlayerState is valid then make sure to clear the timer. #blueprint message

real ridge
#

any other good solution?

#

its basic problem in ue 5 multiplayer that all begin plays are loading /earlier or later

#

controler, player state also actor....

#

like its not sorted

graceful flame
#

which actor doesn't have the playerstate? is it a possessed character?

real ridge
#

yes,but why u asking this I am just telling that not all things like controller, player state etc are already loaded on begin play

graceful flame
#

When the character spawns its event begin play runs, but it hasn't been possessed yet because that happens in a separate node right? So of course it doesn't have any PlayerState because there's no PlayerController controlling it yet.

#

So that's why I have used the looping events by timer which stop looping in the next frame or however long it takes.

real ridge
keen hound
graceful flame
#

That's the same thing it just lets you type the name instead of draggin the red line to the red box.

graceful flame
keen hound
#

Anyways, the problem is something related to the crash report client

#

It failed to start it

graceful flame
#

ok ill download it

keen hound
#

Wdym?

#

Oh

real ridge
#

whaaat

graceful flame
real ridge
#

weird I had to use smaller time for refresh

#

and it works

#

it is healthy have this small number there ?

#

or even smaller

graceful flame
graceful flame
graceful flame
#

You don't need the boolean obvously, but everything else

real ridge
#

sure but check mine

graceful flame
#

Yes that's just like using a delay of 0.05

#

But since the amount of time is unknown because of loading it might take longer or less

real ridge
#

I forgot tick looping

real ridge
#

so it is looping until it is valid

graceful flame
#

You can still set a very short time sure, but if it should be looping and then you clear and invlidate the timer so it doesn't keep running for ever.

graceful flame
# keen hound

Also transition map for when you travel between levels

real ridge
#

it is neccessary?

graceful flame
#

because it loops forever....

#

My character EventBeginPlay looks like this:

real ridge
#

I just made this upgrade

#

lol you have it for whole begin play

#

nice I should refactor it too

#

I am gonna test now

graceful flame
#

and the very last one on the sequence clears the timer

real ridge
#

worked , jarka and fero are there

#

great

#

thanks !

#

for now mine looks like this

#

timer just for this one

#

but then I Will update like your

real ridge
graceful flame
#

They're offset from other characters so that not everything runs at the same frame. Also adding the variance helps with that for characters of the same type.

#

Imagine spawning like 100 characters at once, they'd all be running the logic on the same frame. So this way it spreads it out over different frames and doesn't cause the game to hitch.

keen hound
#

@graceful flamehow do I add the crash report client to the server

graceful flame
#

The crash report is when you send the info to Epic. I don't think you need that when you're debugging your game and can see the log file.

keen hound
#

I think it's something with the vps

#

are there specific settings on the firewall needed for ue5 dedicated servers?

graceful flame
#

The part that says [ 0] means its happening on the first frame. So that means it's likely what I suggeted earlier when it can't load the level Temp/Untitled_0

nocturne quail
#

is this a good idea of using ReplicatedUsing = OnRep_MyFunction on dedicated server?

keen hound
#

this is so strange

graceful flame
#

How are you generating the log? Is it a testing build?

keen hound
graceful flame
#

You've setup a separate dedicated server target in VS code right?

#

or is this going to be listen hosted?

graceful flame
#

okay

keen hound
#

the engine

graceful flame
#

yeah I dunno, that's about as far as I've managed to get with my game too. I haven't begun testing on a real server yet. But what I do know is that [ 0] in the log means first frame. So that's a clue at least. Something fails right away, not after lots of other stuff has loaded.

keen hound
#

is that the server

#

runs fine on my pc

#

so it HAS to be the vps

sinful tree
real ridge
#

I can create custom c++ event?

sinful tree
#

Yep. You can have OnRep_Playerstate() call an event if you want to implement it in blueprint.

#

You can use an event dispatcher too if you want.

floral elbow
#

How would I go about having my two separate sessions have different spawn points for units in multiplayer?

#

I simply want player 1 to spawn units on the left side of the map and player 2 to spawn units on the right

#

Is there some sort of hook to get into the session or would I have to loop over players and set actor based on the index?

icy jetty
#

I would have a way to track what team the player is on, and feed it the corresponding array of potential spawn points it can use, based on what team is spawning the units

timber frigate
#

I am trying to have an option to select a game mode before hosting a game before hopping into the lobby level which will determine how many players are allowed into the lobby but im unsure how to tell the lobby level which gamemode option i selected from the datatable

#

i have 1v1, 2v2s, and infected but i cant have 8 players join a 1v1. only a max of 2

icy jetty
nocturne quail
#

Why UE_LOG(LogTemp, Warning, TEXT("Status value is: %d"), GetIsCrouching()); never gets printed

void StartCrouch();

UFUNCTION(Server, WithValidation)
void ServerStartCrouch();

UPROPERTY(ReplicatedUsing = OnRep_CrouchPressed)
bool bCrouchPressed = false;

UFUNCTION()
void OnRep_CrouchPressed();
void AARMACharacterBase::StartCrouch()
{
    if (!HasAuthority()) { ServerStartCrouch(); }
    else { SetIsCrouchPressed(true); }
}

void AARMACharacterBase::ServerStartCrouch_Implementation()
{
    StartCrouch();
}

void AARMACharacterBase::OnRep_CrouchPressed()
{
    UE_LOG(LogTemp, Warning, TEXT("Status value is: %d"), GetIsCrouching());
}
sinful tree
nocturne quail
sinful tree
#

Did you add the DOREPLIFETIME_CONDITION_NOTIFY macro for the boolean in the GetLifetimeReplicatedProps?

sinful tree
#

Yep

timber frigate
icy jetty
sinful tree
# nocturne quail nope

Should look like this

void AARMACharacterBase::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME_CONDITION_NOTIFY(AARMACharacterBase, bCrouchPressed, COND_None, REPNOTIFY_Always);
}
#

And this in the .h

    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
timber frigate
icy jetty
nocturne quail
nocturne quail
timber frigate
#

game mode switcher is this right here on the widget

nocturne quail
sinful tree
icy jetty
#

what does the Set Selected Game Mode event look like?

nocturne quail
#

I am just new to rep-notify

icy jetty
#

prly because your selected option pin is not plugged into the variable

icy jetty
#

What? no lol

#

The selected option output pin should be plugged into the SET node's input pin, because that's a temporary variable that you're using further down in the code. It seems you are using pre-built functionality with very little understanding of how things work under the hood. I'd recommend learning some blueprint basics before you start trying to make a multiplayer game, because multiplayer is a whole 'nother beast on its own, so if you don't have a decent foundation, you will be perpetually lost.

timber frigate
icy jetty
#

well that part is right anyways, but idk how that guy's custom asset is meant to work to begin with, never used it myself. If he has some sort of tutorial for it you've been following, I'd suggest reading/watching it again from the top, to make sure you didn't miss anything.

timber frigate
quartz iris
#

I need a system where when a player spawns in, a random house BP is given to them, but i'm not sure how I can do this because I only need to do it once when the player has joined
My idea is that the player will spawn whereever their house is- and not in a space where there's already a house from another player

timber frigate
sinful tree
quartz iris
#

Something like this right?

icy jetty
#

not rly, you need an array of spawn points from which you remove the one that was used already

sinful tree
# quartz iris

Probably not - you wouldn't want players to be able to call into the server to ask the server to spawn a house for them - it's something that should be handled by the server when the player is joining, like in the game mode OnPostLogin.

What you would likely want to do is make a function that can get a reference to all the "houses" and loop through them (sort of what you're doing) but have it return a reference to the first house that doesn't have a player assigned to it. That would be the house reference you'd want to assign to that player.

#

If you want to incorporate spawning the player in the same location, I believe you need to use the HandleStartingNewPlayer event in game mode and handle spawning of the player in the desired location yourself.

icy jetty
#

that's part of what I have

quartz iris
icy jetty
#

where SelectedPlayerStartCamp is an object ref to spawn points I placed in the world and PlayerStartCamps is an array encompassing them

quartz iris
icy jetty
#

it's a GameModeBase function

quartz iris
#

Is there a way to get the player character from the controller?

#

To set the variables within the player

icy jetty
#

you know, some of your questions can be answered my right clicking inside your bp and typing what you're looking for

quartz iris
#

This spawns two houses though so I did something wrong

#

This is the house bp

sinful tree
# quartz iris

Don't use delay on this type of event. If two players happen to join within that same 0.2 seconds, you'll end up overriding the first one's execution with the second's which will cause issues.
What you appear to be doing right now is just looping through all the houses and set them all to the player joining.

Here's what you can do if you know there is always going to be a set number of houses and want to choose from them randomly.

  1. Create a function specifically for finding houses that are available. It should consist of GetAllActorsOfClass, and looping through the provided array checking if "Player Who Owns House" is valid, if it is not valid, add it to a local array of type House_BP. After the loop is completed, add a return node and return the local array as "Available Houses". This function now gives you an array of available houses based on no player being assigned to them.

  2. Create another function for assigning a house that takes the player controller as input. When you want to grant a player a random house, you can use the function created above to get the array of available houses and pull off of its output and do a "Random". This will give you a random array element from the available houses - promote that into a local variable called "Selected House". Check if Selected House is valid! If so, you can proceed with assigning the "Player Who Owns House". If it is not valid, then you've likely ended up in a condition where there are no more houses available.

  3. Call the assign house function on your OnPostLogin.

sinful tree
# quartz iris

Your Find Available Houses should be returning an array not a single object.

#

You're also setting "Selected House" to nothing by the time you're trying to assign it to the player. You want to assign the player to the house.

quartz iris
sinful tree
# quartz iris

Create a local variable of House BP and make it an array. If "Player Who Owns House" is not valid, add the Array Element into the House BP array. On Completed, return the array.

sinful tree
# quartz iris

You still have a "Set Selected House" immediately after the IsValid check, get rid of it as you're effectively setting it to none.

nocturne quail
#

is it a good idea to use RepNotify for changing the character speed, like if I am running at speed of 600 and pressed ctrl and the character starts walking slowly

#

I tried it now, the character glitches

#

doing it on server->multicast, works fine and smoothly

sonic jasper
#

replication question - i have a UGameStateComponent that exists on both server and client with a replicated value
when a client connects should an OnRep fire, does that replicated value get replicated on the client connecting

seem to be getting different results for game state components on this, possibly missing it be forced replicated from somewhere else?

sinful tree
# quartz iris

You're trying to do multiplayer but haven't worked with arrays much? You're gunna have a rough time.

When you are using a For Each Loop, you plug in an array, which is a list of objects.
The "Loop Body" path is called for each entry in that input array.
The "Array Element" object is what is contained at the array index of the current loop iteration, and the "Array Index" is that index. On the first Loop Body, you'll be accessing the value at the first spot in the array which is index 0. So if you have an array of houses, the first time the Loop Body is called, it is accessing the first house in the array. The second time, it'll be getting the second house in the array, and so on. What the code I've suggested to do is testing each of the houses to see if you've set a player as the owner, and if not, you want to add that house to a new array so you end up building an array of houses that do not have a player assigned to them.

Using "make array" and plugging in a value that has nothing that you've actually assigned (as far as I can see) and then setting that into an array is basically like assigning the array variable to have 1 element, and that 1 element is empty. "Setting" an array is like setting any other object variable - you are declaring everything it contains. Arrays have additional functions you need to call to manipulate them and you need a reference to the array you're trying to modify to call them.

You need to add the "Array Element" from the loop into the "House BP Array". You are not "setting" the array, you want to get the array, drag off from it and type "Add" this then allows you to add elements into the array.

"House BP Array" should definitely be a local variable and you probably don't want any of these variables as class variables, local only.

Plug in the "House BP Array" into the Return Node and remove the "Available House List Array". This will then return the array from the function which you can then use outside of the function.

sinful tree
sonic jasper
#

yeah ok thats what i thought, got one that calls onrep and one that doesnt

sinful tree
#

"House BP Array" needs to be an array variable.

#

Get rid of "Make Array"

quartz iris
#

I see

#

Bool array?

#

oh wait

#

nvm

#

I see how it works now i'm adding it to a new local array from the looped houses that dont have a player who owns it

#

Before I was trying to set it like you said

#

Thank you man it works 🙂

drifting quail
#

Hi I'm trying to make a mod for Deep Rock Galactic which has mod support. In the game if you press C it calls a robot to your location. I want the robot to go where my laser pointer is pointing when I press C. It works, but only for host. How would I make this work for client? Here's the bp. it's in an actor called InitCave idk if that helps https://blueprintue.com/blueprint/-0ub354u/

#

Asking here because the only person in the DRG modding community who might know is too busy to help. figure there's a lot of smart people here

nocturne quail
#

Why I can't move my character on the ground?

void AARMACharacterBase::MoveForward(float AxisValue)
{
    bool validController = GetController(); if(!validController) { return; }
    if (!HasAuthority())
    {
        ServerMoveForward(AxisValue);
    }
    else
    {
        if (!(GetParachuteOpened() || GetIsFlying()))
        {
            MoveOnTheGround(/*speed value*/AxisValue, /*Ground Movement*/true);
        }
        else
        {
            FlyInOpenSky(/*speed value*/AxisValue, /*Ground Movement*/false, /*Air Friction*/CalculateFriction());
        }
    }
}

void AARMACharacterBase::OnRep_MoveForwardAxis()
{
    log("Move Forward Replicates", 30.0f, FColor::Red);
}

void AARMACharacterBase::ServerMoveForward_Implementation(float AxisValue)
{
    MoveForward(AxisValue);
}
#

log("Move Forward Replicates", 30.0f, FColor::Red); is printing fine so the forwardAxis variable is replicating fine

#

only the server can move

#

by doing multicast I can fix it, but I want to do it using OnRep

nocturne quail
#

Fixed it:
It was needed to be called first on local client, and then by server so it can be replicated to everyone 🥳
Still I don't know if this is the correct way, but it works ... fix me if I am doing it not the right way )

void AARMACharacterBase::MoveForward(float AxisValue)
{
    bool validController = GetController(); if(!validController) { return; }
    if (!HasAuthority())
    {
        if (!(GetParachuteOpened() || GetIsFlying()))
        {
            MoveOnTheGround(/*speed value*/AxisValue, /*Ground Movement*/true);
        }
        else
        {
            FlyInOpenSky(/*speed value*/AxisValue, /*Ground Movement*/false, /*Air Friction*/CalculateFriction());
        }
        ServerMoveForward(AxisValue);
    }
    else
    {
        if (!(GetParachuteOpened() || GetIsFlying()))
        {
            MoveOnTheGround(/*speed value*/AxisValue, /*Ground Movement*/true);
        }
        else
        {
            FlyInOpenSky(/*speed value*/AxisValue, /*Ground Movement*/false, /*Air Friction*/CalculateFriction());
        }
    }
}

void AARMACharacterBase::OnRep_MoveForwardAxis()
{
    log("Move Forward Replicates", 30.0f, FColor::Red);
}

void AARMACharacterBase::ServerMoveForward_Implementation(float AxisValue)
{
    MoveForward(AxisValue);
}
keen hound
#

what is this error in the dedicated server?

plush wave
#

Where is the PlayerState created?

thin stratus
#

Somewhere in the PlayerController iirc

thin stratus
elder lynx
#

What is the difference between Start Play and Begin Play inside Game Mode ?

bold dagger
#

I want to set up a game that uses P2P server hosting, where anyone can start a server in a ‘hub’ world that anyone can join. My goal is to have things set up where anyone in this hub world can create create a challenge that anyone else can accept. Only the selected players would be transported to a selected map or level, battle, then return to the hub world. Very similar to Monster Hunter World game sessions.

#

What would be a good way to go about this? I have considered level streaming, but if the host leaves the hub world it would disconnect everyone else. Level instancing leads to issues where multiple parties could interfere with eachother if they want to play on the same map.
I have the advanced sessions plugin, if that helps find a solution at all

grand kestrel
#

Monster Hunter games had the same issue, I haven't played the recent ones though

#

Host migration isn't complex in most cases, but you need to build everything with it in mind. Basically, all players store the state of the world, like saving/loading a game, and the host will maintain a list of replicated priorities for host migrations (i.e the next best player to migrate to, which could factor latency and hardware specs, etc). Send a timestamp along with the priority list so you don't take one that is too new, in case not all players got the update. When the host leaves, the next priority will start their own session/whatever, and load the game state from that, and the other players all connect to that one. So at the very least, a loading screen when the host leaves is inevitable.

It can become a lot of work if you want to be able to restore in-progress combat etc., so just pick your battles

quartz iris
# quartz iris

With the house house system I was making with @sinful tree yesterday, how can I show the owning player's name of the house to the other clients via set text or a widget?

#

I was thinking when the player is nearby a players house it shows the icon for a house as well as the owning player's display name

hot pebble
#

Hello! I just posted this in the blueprint channel without realizing there was a multiplayer channel too. I'm working on a multiplayer game, I have set up a main menu where a host can create a server, and clients can join, then a UI menu pops up with a character selection, which then spawns their player. All of this works great up to this point but I'm having trouble with the host, the clients are all able to move the camera and move around but the host cant move the camera or move their player at all. Has anyone encountered this before? I can send screenshots if needed.

outer sphinx
#

Hello how are you? One question, does anyone here use the "Mysql Connect" plugin?

thin stratus
#

Anyone ran into UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings before?
Seems to happen on multiple of those _Generated_ maps. Causes a crash eventually in Assertion failed: WorldSettings != nullptr [File:D:\UE52RELEASE\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 3115]

#

Every time I read that message I get flashbacks to the PackageMap bug

marsh sand
#

i am having an issue my server runs good but my clients have an issue my first client when joins the world map would been seen all okay but when the other client joins the black screen appears after 1 second of map load as a blink as it shows that it is in that level of map i tried it by getting actor location and
level name ......If anyone of you could help

thin stratus
mellow drift
mellow drift
keen hound
#

not sure if it's project specific

mellow drift
keen hound
#

this is so weird

mellow drift
#

try packaging it under another build configuration

keen hound
#

like the executable

#

no logs

#

no nothing

#

just opens then closes

#

would test configuration work

mellow drift
#

yeah try debuggame

faint parcel
#

I want to broadcast an event form c++ when equipment is added or removed to/from InventoryComponent.
On the server I just call OnEquipmentAdded(InEquipment) which calls the .broadcast on the client I wait for OnRep_Equipments(TArray<AEquipment*> OldEquipments). Is there a simple or reused way to check what was added and what was removed and then call OnEquipmentAdded(InEquipment) and OnEquipmentRemoved(InEquipment) for them?

#

Do I have to loop through the arrays or are there any methods I can use to simplify?

keen hound
#

turns out after doing some reading

#

that wasn't the issue

#

it isn't displaying the error tho

#

Unhandled exception at 0x00007FFF18FFEF5C (KERNELBASE.dll) in UEMinidump.dmp: 0x00004000 (parameters: 0x000000AEF6B79AF0).
idk what this is

#

the error only happens in my vps

#

not in my computer

#

so I don't know how to debug it

outer sphinx
#

Hello how are you? One question, does anyone here use the "Mysql Connect" plugin?

magic vessel
faint parcel
oak pond
#

whats it called in multiplayer games where your game plays like normal, but other players are like "simulated" on your end? kinda like a ghost system that racing games have, its just that I want to make it so my game plays the same in multiplayer but fakes the other player the best it can without affecting their gameplay

#

is that even possible

#

because events dont seem to let you even do them clientside if theyre not fully replicated I dont get it

oak pond
#

I dont think so, I mean like youd still be playing in the same server but your play sessions arent dependent on each other in any way, and on your end the game just tries its best to show the player accurately but it doesnt matter too much

graceful flame
#

So just regular multiplayer but the other characters don't have collision with your character?

oak pond
#

no because that still requires everything to be fully replicated to the server and back for you to be able to do anything

graceful flame
#

So which parts wouldn't be replicated?

oak pond
#

basically I want the players gameplay to be entirely clientside controlled, not reliant on sending anything to the server, just play the game as normal, but all itd do is try to replicate your position and everything on other players games

hot pebble
graceful flame
oak pond
#

I didnt say that

#

I said not reliant on sending anything

#

idk how else to explain this

graceful flame
#

So they play offline, but somehow their movement is still being replicated?

oak pond
#

maybe what Im trying to describe is already what unreal does in some way I dont know

graceful flame
#

Does this already exist in someother game that you know of?

oak pond
#

you can see when a player activates a bridge to come down or something, itll only happen on their end so theyll appear to phase through it, while it doesnt move on your end

graceful flame
#

So that sounds like a level placed actor is not being replicated then.

#

wait no

oak pond
#

no if you did this with the regular multiplayer setup the player would just get stuck behind it

#

and desync

graceful flame
#

How can you see when a player activates the bridge but you don't see the bridge move?

#

How would you know it moved?

oak pond
#

what you see is the player phasing through it

quasi tide
#

Pretty much will just need to replicate the position of the player and have it be client auth.

#

Can't have any of the conventional collision stuff on the server

keen hound
#

how would I debug a dump from the vps?

oak pond
graceful flame
#

Right so that's just a level placed actor (the bridge) that doesn't replicate because like what Duroxxigar said the client has authority over those situations so there's no rubberbanding desync as the server doesn't care if the bridge is up or down.

#

The problem with client auth is that it opens the door wide for cheaters 😆

oak pond
#

pretty much yeah, I just need to know how to work with clientside events because whats the method for that? I thought Run On Owning Client was to do with that but it didnt help

graceful flame
#

Why bother spending time finding the key to unlock the bridge when a cheater can just manipulate memory and force the bridge to move?

latent heart
#

It's possible that the server is simulating it differently for each player. Or they simply have a bridge with a bool per player.

#

If the bool is false, the player dies. If it's true, they don't.

quasi tide
oak pond
#

yeah of course its still replicating what it needs to but what Im saying is the player wouldnt depend on that to play

graceful flame
#

Also riders republic has mostly bots biking and skiing around you the player.

#

Are you sure it was a real player you saw?

oak pond
#

there are multiplayer matches

oak pond
#

Ive interacted with people there, there are multiplayer races, sometimes the other players look really laggy but your game is unaffected

graceful flame
#

I think the open world is client auth and the matches are server auth which is why they have a separate loading screen because you're travelling to a different server to play the race.

quasi tide
#

If Client A is supposed to be able to see Client B phase through a bridge, Client B must be replicating position. It doesn't matter the engine or framework you use.

#

I'm not saying it is required for Client A to even play the game

latent heart
#

It's possible they just don't replicate stuff quick enough and/or that their interpolation is awful.

oak pond
#

ok yeah what Im trying to say is all the player needs to do is send his info and recieve info about other players. you dont need to recieve any server info to play

graceful flame
#

So p2p?

oak pond
#

isnt p2p a different subject

#

I dont know, it would be p2p anyway its not like I can have dedicated server

graceful flame
#

If you don't receive any server info to play then why would you even need a server in the first place?

oak pond
#

you recieve the info of the other players robert

quasi tide
#

If you're doing P2P, that's custom networking. Unreal doesn't support it out of the box.

graceful flame
oak pond
#

sure

graceful flame
#

That's a seriously difficult challenge with UE

oak pond
#

as far as I was aware p2p is what everyone does in the first place

quasi tide
#

It's not

oak pond
#

oh listen server is that what Im thinking of

graceful flame
#

yeah

quasi tide
#

P2P is still used these days mind you

graceful flame
#

I'd say most indie UE multiplayer games like coop horror or whatever are listen hosted, then the only other option really is dedicated. I don't know of any p2p UE games.

quasi tide
#

It's not an unviable architecture

graceful flame
#

I'm sure some exist though.

oak pond
#

yeah I was wondering if its not usually done this way

#

it seems the most logical for games that dont depend on other players though

quasi tide
#

A listen server setup is probably the more popular architecture. Highly confused with P2P.

#

Especially with gamers themselves.

graceful flame
#

If you can successfully pull off a P2P game you'd save a lot of money not having to pay for dedicated hosting.

quasi tide
#

General advice is if it is co-op, listen server is fine. PvP, dedicated is pretty much mandatory.

graceful flame
#

or design your game in a way that the community can host their own dedicated servers

oak pond
#

yeah Id be happy with co op, but can listen servers do what Im wanting or does the player rely on the server to actually play

quasi tide
#

Unreal is a server-auth architecture.

hearty turret
#

just wanted to quickly check that the exi compendium's NULL system guide is still valid? its a couple years old now afaik and epic change stuff quite a lot so i wanted to double check :]

quasi tide
#

You will have to either fandangle stuff to suit your goals or do some custom stuff.

oak pond
#

well, the reason I wanted to go for this approach is my custom movement Ive set up on the player which I know is already gonna make it impossible to replicate the usual way

#

how does anyone do this man trollshock

quasi tide
#

One step at a time.

#

And breaking the problem down to more manageble chunks

graceful flame
#

Also coffee, lots and lots of coffee.

oak pond
#

its just that it seems like theres a lot of problems that are simply just unable to be fixed unless youre a huge triple a company

quasi tide
#

I mean, if you actually understand how networking works - what you want is achievable by a solo as well.

graceful flame
#

It's all c++ and its all source available.

#

But yea there's a reason why AAA's have an army of devs working on their games.

#

Making games is tough.

quasi tide
#

Because the world needs Call of Duty obviously

oak pond
#

yeah I dont think its realistic to think I can do this myself

#

I got quite far with multiplayer in another project using default charactermovementcomponent

graceful flame
#

Best part of being an indie dev is that you can adjust the scope of your project whenever you want and there's no staff meeting to deal with where you have to convince others why this change is good.

oak pond
#

its just that I know this game would be great fun with multiplayer and anyone who actually plays would likely want it too

#

but this damn thing is already taking long enough as it is

untold rose
#

Would anyone know how I would go about replicating events triggered by enhanced inputs on an actor that I enable input on for a player?

I know I need to effectively run the events on the server but I'm struggling to get it from client side back to the server.

graceful flame
keen hound
graceful flame
#

Just have to make sure the player owns the actor too.

untold rose
# graceful flame Wouldn't a regular RPC be what you need to use?

I'm working on a door and this is what I have so far.

I've gotten the initial grab to work and replicate accordingly as it's called from a component on the player character. I'm able to enable inputs on the client side so the input event triggers but the 'Call on Server' event doesn't seem to call.

quasi tide
#

This is weird. Not gonna lie.

#

What's the mechanic with the door that requires you to give the player input over it?

keen hound
untold rose
graceful flame
quasi tide
keen hound
#

i'll just wait

graceful flame
keen hound
#

aint no way A BOT

untold rose
oak pond
keen hound
quasi tide
#

Still think you shouldn't be mucking with it this way, much more messy imo.

#

Just do some generic interaction system.

untold rose
untold rose
dark edge
hoary lark
# oak pond

i don't know why nobody understands what you want lol. the big thing is going to be exactly what do you (not) want to get replicated. in this picture, the bridge, should it be completely independet for every player? should every player be in their own completely enclosed sandbox world and all they do is have a viisble ghost of others? are some world objects replicated and some aren't?

oak pond
#

yeah pretty much I was just thinking you can play however you want but you see the ghost players, but Im not sure its possible

hoary lark
#

sure it is. i can't say exactly how to set it up off the top of my head as i've never done it, but you would just... not replicate anything

#

it would have to be client auth like duroxx said, so cheating will be possible

#

the only way around that would be to duplicate the entire level for every ongoing player

#

and the ghost players would somehow need to just be simulated locally on every client using data sent to the client from the server

oak pond
#

so I think for a start I need to work out how to use truly clientside events. using my custom movement already makes it more difficult since I cant even walk without replicating it, but I want it to be clientside then tell the other player where you are

sinful tree
# oak pond you can see when a player activates a bridge to come down or something, itll onl...

What you are describing here is not really multiplayer. What is happening in these styles of games is that a server is providing the single player client with path/event data and replaying it, allowing you to see how other players progressed. This doesn't require a player to "connect" to a server to play the game, but it does require them to retrieve that path/event data from somewhere, whether it be through a REST API or some other method, and also allowing the client to upload their own path data when they finish the level.

dark edge
#

Are the ghost players live or just recordings?

oak pond
#

well it is the same kinda thing as ghost replays but in this case youre seeing it live, like in Riders Republic. the main benefit is you could have bad connection and everything could be delayed by a whole second but it wouldnt actually impact your gameplay

dark edge
#

I'd go for something akin to just playing back replays, you could pretty trivially extend it to include playing back replays only 1 or 2 seconds behind when they're being ran

quasi tide
dark edge
#

That'd be a LOT simpler, it wouldn't even be a multiplayer project at all

oak pond
#

hmm that sounds interesting

#

but then how would replays be accessed

dark edge
#

however you want

#

Bittorrent

graceful flame
#

Essentially you'd record all of their movement inputs into some kind of datastream and it would be uploaded to a server somewhere once the race is over or whatever event you want then it can be downloaded via REST API at the begin of another race for someother player.

dark edge
#

SMS

sinful tree
#

USB key

hoary lark
#

you would have to build a completely separate unique MP system like Datura described, conneting to an alternative server that is given and shares the data. might be a good project for a well funded company, dunno if i'd want to try it as a solo or small indie

sinful tree
#

Snail mail!

dark edge
#

What's the game flow?

#

Why do I see ghosts, am I in a race with other people I know or just randomly?

hoary lark
quasi tide
#

I was wondering the same

#

You must be awfully bored

dark edge
#

It'd be the same idea, but you could have an actual multiplayer game but with very minimal replication. Basically the only thing a client gets from the server / other clients is their move list / path

#

On my machine, your car is a ghost car that's lerping through data points provided by the race on your machine

#

basically a real-time replay

oak pond
#

yeah thats pretty much what I meant

dark edge
#

I'd just spam structs at the server and have it spam them out and have it pieced together into a timeline on everyones machine that your car on their machine animates through, basically

#

Just a bunch of
Timestamp
Location
Rotation
Velocity

hoary lark
#

clients can spawn actors and move them around locally however they want. the server doesn't need to know. your only challenge in this is if you want to prevent cheating. if every client controls the bridge locally without the server knowing, then the server can't check if this client is hitting the bridge. the server cannot maintain a separate world for each client with their own unique bridge state. the server only has one bridge.

(well, technically this engine is supposed to support multiple simultaneous worlds but i don't know if anyone has ever pushed it into actually doing it)

dark edge
#

Yeah there's really no way to prevent cheating with everone seeing a different world

#

without some fancy stuff

hoary lark
#

the only easy way to "fix" that would be to, as i said before, duplicate the entire level per player and have each player running in their own arena (offset from each other). and then the server would just tell the other clients where the other players are, each client spawns and controls their own ghosts with the position shifted into their arena.

dark edge
#

You probably coudl do some stuff with the servers world being in a superposition with the bridge being up and down, with collision channel hacks or whatever

#

yeah that too

#

not to mention even doing serverside vehicle movement without ping lag

#

how the hell are you doing that?

oak pond
#

luckily I dont think anyone will be too competitive for a game like mine, its a pretty casual silly thing

dark edge
#

Then just wing it and do clientside authoritative and use the server to say what map you're on and to shuffle data around

#

I'm doing a MP vehicle game but I'm very much NOT using prediction so everyone sees the same world at all times, just with 1/2 ping time offsets

hoary lark
dark edge
#

Good luck lol

hoary lark
#

it's only nearly ™️ impossible if you want accurate physics 😄

dark edge
#

yeah I have no clue how racing games do it

#

seems hard

hoary lark
#

gross simplification brings things down to the realm of possibility. that and superhuman intelligence.

dark edge
#

if only ping was 1ms

#

itd be so easy

hoary lark
#

stupid einstein... he should have made the speed of light faster

oak pond
#

advanced locomotion system actually has a method for it, I worked it out from there

keen hound
#

azure time- nevermind

cursive crest
thin stratus
#

Still on the SkeletalMeshComponent

clever hound
#

When calling something from tick. Does it automatically have Authority and will be called on the server?

cursive crest
clever hound
#

I have been doing networking for a while now but never acutally noticed that and just want to confirmation that im not just me

cursive crest
thin stratus
#

Tick is network irrelevant

#

It calls on every Instance that has Tick enabled

#

If the Actor is replicated and spawned on everyone through the Server, then all of those might call Tick.
Individual instances can turn off or on Tick fwiw.

#

Non replicated actors that are placed into the scene or spawned individually on everyone or some, also all call Tick

clever hound
#

So it should be fine calling damage functions from the tick, stopped with bools most of the time ofc

thin stratus
#

Well

#

Yeah sure

#

But Tick for dealing damage is also not necessarily the best approach

#

Do you really need to damage something EVERY frame?

#

Most of the time, damage over time is done via Timers for example

#

That just loop every .1 oder so

#

Tick is usually used for stuff where you really have to do something every frame

#

Like interpolating something visual

clever hound
#

I mean like Its like this

    {
        if (bEnemyInRange)
        {
            FVector CurrentPosition = GetActorLocation();
            if (!PreviousPosition.IsZero())
            {
                FVector Displacement = CurrentPosition - PreviousPosition;
                SwordSpeed = Displacement.Size() / DeltaTime;
            }
            PreviousPosition = CurrentPosition;
            if (SwordSpeed >= MinSwordSpeed)
            {
                MeleeAttack();
            }
        }
    }```
#

in tick

thin stratus
#

I mean sure, I don't know your game. Might just be fine

#

It calls on the Server

#

make sure to limit it to that though

#

Cause again, it also calls on Client instances if those exist

clever hound
#

Yeah it checks the bools so it should be fine

nocturne quail
thin stratus
#

Cause you need no RPCs for movement in that case

#

Adding MovementInput locally is enough

nocturne quail
thin stratus
#

Again

#

If that is an ACharacter child class

#

That is redundant

nocturne quail
#

yeah this is a character child class

thin stratus
#

You just call AddMovementInput locally

#

The whole class is coded around prediction

nocturne quail
#

so I just need to do it locally, and it will replicated to all clients , right?

thin stratus
#

Basic movement that the CMC supports, yes

#

Everything else has to be coded into the CMC if you need more

#

But there is no need for additional RPCs

#

For movement with the Character and CMC

#

At least in most cases

nocturne quail
#

I use my custom CMC

#

totally independent

thin stratus
#

Yeah but Character + CMC is about locally predicted movement through the CMC

nocturne quail
#

yeah my CMC is the child of already existing UE4 CMC

#

@thin stratus
basically first we should check for serverauth or controller?

if (AARMAPlayerController* PC = Cast<AARMAPlayerController>(GetController()))
{
    if (!HasAuthority())
    {
    
    }
}
thin stratus
#

No?

#

Input is already locally

#

Just call the AddMovementInput event

#

There are a gazillion examples for simple movement code :D

nocturne quail
#

yeah I already that problem thanks, this question is general where I want to access functions from controller class

#

I will use the ponter PC to access other functions which is only related to local client

#

like the player crouch, and the camera should update its height for the local character

#

this kind of functions are located in PC

thin stratus
#

I mean, crouching should already do the height stuff

#

You can do IsLocallyControlled

#

if you want to limit it to the local player

nocturne quail
#

I implemented my own timeline float animaiton to animate camera

thin stratus
#

The height of the character should be changed on everyone though

#

So you still want to tie that to CMC functions

#

Even if you do your own stuff on top

#

The Server at least also needs the update

#

Otherwise collision when walking would be buggy

nocturne quail
#

only I can see my viewpont

thin stratus
#

Not cam

#

Character

#

Oh you only meant Camera?

#

Sorry, then that's local, yes

nocturne quail
#

yeah I am about only cam

nocturne quail
# thin stratus Oh you only meant Camera?

This is the function

void AARMACharacterBase::ToggleProne()
{
    if (AARMAPlayerControllerBase* PC = Cast<AARMAPlayerControllerBase>(GetController()))
    {
        if (!HasAuthority())
        {
            SetIsAiming(false);
            if (!GetIsProne())
            {
                SetIsProne(true);
                SetIsCrouching(false);
            }
            else
            {
                if (GetIsProne())
                {
                    SetIsProne(false);
                }
            }
            PC->UpdateCameraHeight();
        }
        else
        {

        }
    }
}
thin stratus
#

Just do IsLocallyControlled

#

Also is TroggleProne not called via Input anyway?

nocturne quail
thin stratus
#

Yeah so it's already local

#

Not need to guard it then

nocturne quail
#

just need to check if controller is valid, right?

thin stratus
#

Yeah

#

Well

nocturne quail
#

just to avoid any crash

thin stratus
#

You could argue that a Character that receives input should have a controller

nocturne quail
thin stratus
#

and thus the check is wrong

#

I usually checkf stuff that should not be invalid

#

"should" as in, really shouldn't be possbile and if invalid, something is really wrong

nocturne quail
#

early return , right?

thin stratus
#

checkf is fatal

nocturne quail
#

hmm Ok

thin stratus
#
void AARMACharacterBase::ToggleProne()
{
   AARMAPlayerControllerBase* PC = Cast<AARMAPlayerControllerBase>(GetController()))
   checkf(IsValid(PC), TEXT("[%s] Invalid PlayerController."), *FString(__FUNCTION__));

    SetIsAiming(false);
    if (!GetIsProne())
    {
        SetIsProne(true);
        SetIsCrouching(false);
    }
    else
    {
        if (GetIsProne())
        {
             SetIsProne(false);
        }
    }
    PC->UpdateCameraHeight();
}
#

Something like that

#

Cause in theory, if you don't expect the player to call this without a PlayerController

#

Then you should also handle it that way

#

If you fail that silently, with an early return or simple if (), then you'd not know if it broke and your game would continue in a broken state

nocturne quail
#

Thank You very much for this precious information and correcting me, really appreciated

thin stratus
#

There are of course cases where checkf might crash cause you aren't sure if something is valid, so don't use it everywhere

nocturne quail
#

Ok gotcha

thin stratus
#

fyi the code i wrote above might have typos

#

I think the checkf is missing a closing bracket

nocturne quail
nocturne quail
#

@thin stratus sorry for lots of questions, please tell me returning false means if the player reach this place he will be kicked or removed?

bool AARMACharacterBase::ServerToggleProne_Validate()
{
    return false;
}
thin stratus
#

I think so. I honestly never use that and always return true

nocturne quail
#

I just returned false to see what will happened, and the client was removed and possessed another existing local client

#

I start with 4 players

nocturne quail
latent heart
#

Failing to validate means they are kicked, yeah.

#

Validate is kind of cheat protection really.

nocturne quail
#

amazing

#

so only return true if some condition is true

#

else kick the hacker

latent heart
#

You might return false if a player has tried to call an admin command without being an admin, for instance.

#

Never return false for things that might be network based race conditions.

nocturne quail
#

this will need a long sheet to see what are admin commands

latent heart
#

Valid means it could happen, not that it can happen.

#

E.g. 1+2=5 is valid, but not correct.

nocturne quail
#

nice example

latent heart
#

1+4^=epic is not valid.

nocturne quail
#

I will use this to protect inventory items

#

return false if a player want to have a weapon using some command which is not spawned by server I think

latent heart
#

Be careful with it.

#

E.g. some client picks up a weapon and says, "Hey, I'll equip that now!"

#

So they press the button.

#

You say, "you don't have that weapon, naughty hacker" and kick them.

nocturne quail
#

yep absolutely naughty

latent heart
#

Because there was a slight desync and they pressed the button "too early" according to the server.

#

That is not a good idea.

nocturne quail
#

I will have a hard time to deal with these issues 😄

sinful tree
#

If anything, it's probably best to think of the validate function being meant to prevent something that should under normal circumstances not happen.
Eg. A player is attempting to call an RPC that they should only ever be able to call a single time right at the beginning of the game and you have properly coded your game so that the client should only ever call that RPC that single time. If you happen to get a second call to that RPC and it's mid game, then you know that person is mucking about and attempting some kind of cheat, in which case, it's time to give them the boot.

#

It can also be used for validating values that a client may be sending through RPC. If you know that you are expecting a value between x and y, but client sends something way out of range, then they must be attempting to cheat somehow.

pallid gorge
#

Hi, I am trying to use widget in multiplayer and I am using this blueprint. If "Add Widget on Client" is on Multicast, it does show the widget for everyone, but I would like to show the widget only to the player who interact. If I set "Add Widget on Client" on Run on owning Client, then it doesn't work at all. It doesn't show the widget. Why?

oak pond
#

does this definitely need to replicate

#

if only one player sees

pallid gorge
#

With 'run on owning client' it doesn't work

#

I don't want it to be shown to all players, but only to the ones who interact

oak pond
#

then maybe it doesnt need replicating at all

pallid gorge
#

How can I fix it?

limber gyro
#

I saw a forum post of how to connect to a server as a spectator with a command options, does any 1 have that link at hand?

oak pond
#

viewport is always just your actual game screen, so if it does that on all the players then it adds to all their screens

pallid gorge
#

I was following this tutorial

#

I don't know what I did wrong lol

#

The error is
PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Create_ReturnValue". Node: Add to Viewport Graph: EventGraph Function: Execute Ubergraph BP NPC Blueprint: BP_NPC
But only if "Add Widget on Client" is on Run on owning Client

nocturne quail
sinful tree
sinful tree
pallid gorge
#

I need to move Add widget on server and client to player's ch aracter?

sinful tree
#

And that's what I was saying earlier. Client presses E > RPC To server with actor they want to interact with > Server performs interaction interface, validates player can interact and interface returns interaction data, sends RPC back to character that started the interaction > client displays widget based on data from server.

pallid gorge
#

Like t his?

#

and this on player character?

#

It is working but is it correct?

pallid gorge
sinful tree
#

No.
Event Interact should already be happening when running on the server.
Client Presses E > Does Line Trace to get actor reference > Calls RPC to server to interact passing the actor.

When running on the server from that interaction RPC:
Server calls Interact interface > Actor executes implementation.

From there, you have to go back to the client somehow, but you want to pass along what needs to happen.
Call "Run On Client" event on the player's character passing along necessary interaction data > Client adds widget to screen based on the data passed through the RPC.

naive crater
#

Hey did you solve this? If not, try calling Cache Initial Mesh Offset, after that set your relative location. This is of course, assuming i understand the issue you're having.

pallid gorge
pallid gorge
sinful tree
#

You're calling a "Run on Server" event from the NPC. You can't do that. You need to be executing on the server before calling your interact interface.

pallid gorge
#

Not from npc

sinful tree
#

This is in your NPC, right?

pallid gorge
#

Yes

sinful tree
#

That needs to be called while running on the server.
You are calling a run on server event from that NPC. That's not necessary.

pallid mesa
sinful tree
#

You call the run on server event before you call the interact.

pallid mesa
#

whatever i did wasnt as streamlined as setting a ret loc in the mesh of the sim proxy

pallid gorge
#

When someone interact with the npc, with event interact, it add widget on the server who add the widget in the client

sinful tree
#

Well, I didn't watch the full video.
I'm telling you though, you want to:

  1. Have your player press a button to interact
  2. Determine an actor for your player to interact with.
  3. Send that actor to the server (Run On Server!) this event should likely be on your character.
  4. While running on the server you perform your interact interface.
  5. The interact interface should be set up to either A) Return data so you can handle that data in the character, or B) directly call a run on client event back on the character that passes back some data. (Not recommended as you're giving an actor too much control vs. having your character handling what the interface allows)

6A) If you went with the interface returning the data, then you call your Run On Client event on your character, likely passing through the required data & actor reference.
7A) Your client now creates your widget with the data sent through the RPC, referencing the actor and the data you passed through the RPC.

6B) If you went with the interface calling the RPC, then you would then have your client create the widget referencing the data sent through the RPC.

oak pond
#

seems like every time I touch multiplayer I forget everything I know. hows the best way to detect if youre a controlled player again? like check if youre the one controlling or the one being replicated to your game by the other player

#

I cant just simply get the hang of clientside events and events only on the replicated player

oak pond
#

oh, I tried that

#

guess that wasnt even the problem then

#

I have no idea what Im doing, all I want is to let the player move on his own, then replicate his position and tell it to set that on the other guys game. Ive set it up but it either does nothing or locks them both in place

graceful flame
# oak pond I have no idea what Im doing, all I want is to let the player move on his own, t...

I find using breakpoints helps demystify things a lot of the time. It lets you know if the current process is running on the server or client and stepping through the nodes one by one also lets you check the results of variables along the way just by hovering the mouse over them. I've had so many moments where I realize why something wasn't working the way I thought it was setup because it wasn't even running on the server in the first place.

oak pond
#

I just use printstrings everywhere

#

I can see this thing is "working" but I just dont know what Im missing

graceful flame
#

I use them only when I need to check a variable that is changing frequently

oak pond
#

surely all I need is get actor location, then a multicast event to set actor location to that? I dont even know if its supposed to be multicast

#

they just needs to not do it on themselves as well

oak pond
#

I think this shows that Im doing the right thing but it shouldnt be affecting the player on the right. I just added the 1 second delay to see this because otherwise he locks in place

pallid gorge
# sinful tree

Yeah, but I am using "Event Interact" on the NPC, because the NPC blueprint class, has the 'Interactable' interface, which has already inclued the "E" button and the mesh it setted to the NPC. It means that if I press E on the NPC, it will execute everything from 'Event Interact'. I have set all the dialogue on the "Player Character". It is working, and only the player who press E to the NPC will read the dialogue. I still think it's wrong because the dialogue shouldn't be on the Player Character

#

I am really sorry if I don't understand such things but I am still learning :/

sinful tree
#

The only thing the interface should be doing is retrieving data and then you can handle the data in the character as needed. My example is also not ideal as it's assuming you're returning a data table handle where you probably want some other custom structure with the data necessary to facilitate any kind of interaction if needed, like display a shop window, or start an event.

tepid lark
#

hey so I haven't been able to figure this out. I have a locally hosted multiplayer setup that crashes on the client when the ai spawns in. I get an error Assertion failed: InOwnerActor [File:D:/UnrealEngine-4.26/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayAbilityTypes.cpp] [Line: 16]

UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [D:\UnrealEngine-4.26\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:461]
UE4Editor_GameplayAbilities!FGameplayAbilityActorInfo::InitFromActor() [D:\UnrealEngine-4.26\Engine\Plugins\Runtime\GameplayAbilities\Source\GameplayAbilities\Private\GameplayAbilityTypes.cpp:16]
UE4Editor_KTBM!AKTBMCharacter::OnRep_PlayerState() [E:\KTBM\May_23\horde_mode\KTBM 4.26\Source\KTBM\KTBMCharacter.cpp:414]
...

Sorry for the wall of text but that's part of the crash report.

pallid gorge