#multiplayer

1 messages ยท Page 504 of 1

zealous saffron
#

the gamestate is created in InitGameState()

#

but that's on the server because it's in the gamemode class

flint rose
#

Unfortunately, that tells me when it's created in the server.

zealous saffron
#

yeah :/

ancient root
#

Can you not use on rep notify ? Also widgets only exist on the client side

flint rose
#

Where would I put this rep notify?

ancient root
#

C++ or BP

flint rose
#

On what object?

zealous saffron
#

I honestly don't know why there isn't one

#

but you also shouldn't be getting a nullptr to game state either

#

oh wait

#

@flint rose

#

are you doing this in the constructor?

flint rose
#

OnInitialized

#

In the widget.

gritty lodge
#

Well, my game has a bunch of different classes, and they all have their own pawn classes. So basically, when i load into a map, i check each connecting player's GI for their class selection (and talents, items, etc) and then create their pawn from GameModeBase and then possess it.

flint rose
#

I'm trying to do this all in the WaitingForMatchToStart state

zealous saffron
#

override GetDefaultPawnClassForController() @gritty lodge

#

in gamemode

twin vault
#

@gritty lodge have you tried ForceNetUpdate

zealous saffron
#

all you need to do is override that function and return the pawn class based on the player's class/role/items/etc

gritty lodge
#

Thanks, I will look into both suggestions

flint rose
#

Okay. I think I figured out my issue with some delegate magic

#
void ABaseGameState::PostInitializeComponents()
{
    Super::PostInitializeComponents();
    USwordfightingGameInstance* GameInstance = GetGameInstance<USwordfightingGameInstance>();
    if (GameInstance) {
        GameInstance->OnGameStateReady.Broadcast();
    }
    else {
        UE_LOG(LogTemp, Warning, TEXT("There is no game instance..."));
    }
}

    DECLARE_DYNAMIC_MULTICAST_DELEGATE(FGameInstanceGameStateReadyDelegate);


    UPROPERTY(BlueprintAssignable)
        FGameInstanceGameStateReadyDelegate OnGameStateReady;
meager spade
#

@flint rose there is always a GameInstance ๐Ÿ˜„

flint rose
#

That's why I used it.

meager spade
#

and you cast should never fail

#

unless you didn't set it up in the project settings

#

so the if check is pointless ๐Ÿ˜„

flint rose
#

It's just what BP defaults to.

meager spade
#

eh?

#
if (GameInstance) {```
#

this should never fail

flint rose
#

Ah, I thought you meant in the BP.

meager spade
#

so no pointing check if its valid

#

๐Ÿ˜„

flint rose
#

I get nullptr on it sometimes.

meager spade
#

not possible

flint rose
#

Tis so.

meager spade
#

GameInstance exists from game start to game end

flint rose
#

But what's getting the reference to it might not have it.

meager spade
#

thats the world, but that should be set way before postinitalize is called

#

so unless you are doing something funky, shrug

#

either way, if it does return nullptr there

#

then i would move it

flint rose
#

Just calling get game instance from a game state that's pretty much empty except for that.

meager spade
#

as it would kinda break the idea of it

flint rose
#

It works for non spectators

#

And I don't care about those losers anyway.

meager spade
#

spectators don't get a gamestate?

#

cause spectators do have a gameinstance..

flint rose
#

It works for the purpose I need it to.

#

Some of this gets called from widgets, which has funky world context objects, which may be the reason.

#

But they don't get the UI anyway.

meager spade
#

yeah, but still i find that strange, i mean it doesnt hurt

#

just was curious

flint rose
#

So if for some reason, I accidentally change something, and they accidentally get it, I don't want VS to crash.

#

Now that I got this hard part over, now to master the easy part... UI! As if. ๐Ÿ˜ฆ

silent birch
#

Sorry, but it not works @naive crater

silent birch
#

Please. I might cry because I tried all that I know, all this when the proposed but I still have this problem with the server travel

split drum
#

Anyone know how to go about getting a reference to the 'local' player's character (from a simulated proxy character)?

silver lotus
#

@split drum Could you not use the player controller ?

#

and get controlled pawn or similar

split drum
#

i think those return null from a simulated proxy

silver lotus
#

I haven't worked with those so I'm not too sure sorry ๐Ÿ˜ฆ

split drum
#

all good. I think i'm missing something obvious? I would expect there to be some static function somewhere like "GetMe()", Me being the local controller or the currently possessed character

split drum
#

Figured it out, for anyone curious: If there is ever only one local player (no split screening), it seems safe to use UGameplayStatics::GetPlayerController(GetWorld(), 0), or, if paranoid, all controllers can be looped through using:

#
uint32 Index = 0;
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
    if (Iterator->IsValid())
    {
        UE_LOG(LogTemp, Error, TEXT("%hs | %s | %s : %s | I got a controller at index %d with character name %s"), __func__, *Util::AmIServerOrClient(GetWorld()), *Util::WhatRoleAmI(this), *GetNetOwner()->GetName(), Index, *Iterator->Get()->GetCharacter()->GetName());
    }    

    Index++;
}
flint rose
#

I'm not quite sure I understand how to use FUniqueNetIdRepl. How do I change the users unique id in GameMode::PreLogin?

hybrid orbit
#

Has anyone used the MP System pack on the marketplace for online multiplayer?
If so can I use the same player controller and character bp for multiple characters or do I need to duplicate them?
I'm new to ue4 so forgive if this is a noob question

lyric mural
#

Can anyone experienced with replication dm me? I need some help with a few big issues Im having. I cant control the server window when testing for one

twin juniper
fringe matrix
#

@twin juniper I'm pretty sure that keypress events don't run on the server, so you need to create an event that is a server message where you call your teleport event. I think what you're seeing is the calling client doing a teleport and then correction moving it back.

celest mural
#

๐Ÿ‘† I believe this sir is correct

zealous saffron
#

Input is local

#

You will need to have a server RPC call

ocean geyser
#

@twin juniper depending on how your detecting whether or not your in the zone or facing the door/whatever, on key press make a call on the server to literally just run whats above (do checks though on the server to make sure the client is infront of the door)

upper moat
#

Need a server for a moble fps help or tutorial dm

silent birch
#

Hi

#

How are you?

viscid bronze
#

I am testing using UE4 editor, simulated, listen server with 2 clients.
When the host client uses LAN in create session, no matter if I Find Session using LAN or not in second client, it will always find the LAN server. Is this normal

tardy nimbus
#

Are both clients on the same network ?

pastel thunder
#

Guys, Give me brief introduction about Quixel...

viscid bronze
#

if i launch project from editor as standalone, and run a packaged project from the same computer, would that acheive the effect of running it from 2 computers?

balmy kindle
#

Hey, if i have a function on tick with a gate on my BasePlayerClass, do i even get the "normal" tick without this gate function in a child BP of this class?

upper moat
#

@pastel thunder are you serius or no its a megascan lybret with 8k textures decals 3d models

pastel thunder
#

I don't have little bit of knowledge about Quixel... Dude

balmy kindle
#

... why don't you look it up then? Google, Youtube?

pastel thunder
#

I am searching on YouTube but there showing only tutorials...

#

Then I must show some video then my doubts will clear..m

#

It's better to ask anyone

chrome bay
#

Completely wrong channel for Quixel. Try #graphics

balmy kindle
#

If you do dedicated server testing inside the editor, do multiple clients share one PlayerController? For example HUDs of differnt players get all loaded, and values in the player controller are getting overwritten by the last loaded client it seems...

winged badger
#

they do not

balmy kindle
#

hm, ok

winged badger
#

unless you screwed up the logic

#

common mistake is using GetPlayerController/Character[0] from the RPC

#

or on dedicated server side

silent birch
#

What's this RPC?

balmy kindle
#

@winged badger okok, but i have the correct reference when setting this inside the CharacterBaseClass on begin play, right? Or do i have to set the reference from the Controller inside the PlayerCharacter?

#

RPC = RemoteProcedureCall, is i understand it so far, is calling a function inside a different machine, like the server would call function in clients^^

silent birch
#

OK thanks

balmy kindle
#

but i would recommend that a "Multiplayer-Pro" around here checks this statement ๐Ÿ˜… Honestly i am still not fully grabbing it, even though i read Exis Network Compedium the third time i guess ๐Ÿ˜‚

silent birch
#

OK๐Ÿ˜…๐Ÿ˜ข

winged badger
#

i have no idea where that code runs from that screenshot @balmy kindle

#

as a rule tho: if you called GetPlayerController[0] on the dedicated server, you almost certainly screwed up

balmy kindle
#

In the CharacterBaseClass

winged badger
#

as there is exactly one use of that function that actually works on dedi

balmy kindle
#

ok, how do i get a working PlayerController Reference then?

winged badger
#

GetController

#

GetOwningPlayerController or soemthing like that from HUD

#

GetOwningPlayer from Widgets

#

(provided you connected the owner pin when creating them)\

#

GetOwner from PlayerState

#

(the GetOwner from PS gives an Actor reference, GetController from Pawn gives AController reference, so it has to be Cast into PC, rest need a Cast only if you need data/functionality from your custom PC class)

#

the static access is rarely useful

#

we don't have a single GetPlayerController[0] in the game

meager spade
#

many people use GetPlayerController[0], works ok in single player, should not be trusted in multiplayer

winged badger
#

the only good use for it from BP is

#

GetGameMode->GetNumPlayers->For (i = 0 to NumPlayers - 1)->GetPlayerController[i], server side

#

iterating over all player controllers

balmy kindle
#

Nice, thank you. I'll copy all the stuff you writing in a Text Document. I'll need some time to look over all that info ๐Ÿ˜… ๐Ÿ‘Œ

chrome bay
#

for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)

#

There is that too

winged badger
#

not from BP tho

chrome bay
#

Although I think it might have been removed along with PawnIterator in 4.24..

#

Ahhh of course

meager spade
#

has it gone?

chrome bay
#

PawnIterator has

#

Well, is deprecated

#

For some reason they want you to use actor iterator now instead...

winged badger
#

they use the controller iterator in game framework quite a bit

meager spade
#

you can still do for (APawn* Pawn : TActorRange<APawn>(GetWorld()))

#

so its fine

chrome bay
#

Oooo that's nicer than TActorIterator... might use that

meager spade
#

yeah

chrome bay
#

But yeah, I guess they aren't keeping a dedicated list of pawns now

meager spade
#

oh well, tbh i never used PawnIterator anyway

#

we used ActorIterator

chrome bay
#

yeah, I used controller iterator quite a lot though.. that must still be there. didn't get any warnings about that

#

4.24 CuttingEdge(TM)

meager spade
#

i cant see controller iterator getting taken out

#

its used quite a lot

chrome bay
#

yeah

balmy kindle
#

@winged badger That's awesome! I used the Controller Reference thats set in the CharacterBaseClass in a lot functions with HUD and some other stuff. And simply changing to "GetController" made them work instantly correct! ๐Ÿ˜€ Thank you! ๐Ÿ˜… ๐Ÿ‘

lyric mural
#

Does anyone know why Im not able to control the server window when testing? Working on replicating DCS

lyric mural
#

pretty sure its something to do with the character

grizzled stirrup
#

Does ACharacter::Restart() get called on all clients (remote and local) on possession, or just the local character that you have possessed?

#

I am fetching replicated skin and emote properties from the playerstate on restart and want to show the correct cosmetics for all remote clients, not just the owning client

#

Looks like it's only called on the local owning client, not all

split drum
#

BeginPlay?

rare cloud
#

Hello there, I got this warning "FNetGUIDCache::SupportsObject: %s NOT Supported." when I spawn the exact same collision in runtime on client and server BUT without replication. My actor is placed on the map but component is created at runtime.

#

Is there a way to avoid this warning, since I got some issue with CMC and especially ClientAdjustPosition which rollback my character location

winged badger
#

makign it NetAddressable would do the trick

#

but for that it has to have exact same name on clients and server

#

you can't reuse names in repeated spawning

#

and if they mismatch at any point, client gets booted

#

note: NetAddressable != Replicated, just that a pointer to it can be resolved over network

rare cloud
#

@winged badger the name is the name passed on the constructor with NewObject ?

winged badger
#

yes

rare cloud
#

ok thanks I will try ๐Ÿ˜„

winged badger
#

if you're only spawning it once, it should be easy

ebon bramble
#

So all of a sudden now when my character is 'casting a spell' while walking, the client thinks the pawn shouldn't be moving during that but the server thinks it should, so the client sees the pawn get 'rubberbanded' forwards every network tick

#

๐Ÿ™„ weird. Should be simple enough for me to debug though because it only happens when 'casting a spell' so it has to be related to something that happens then

split drum
#

you could stop all movement on client and server before beginning the spell. Something like character->GetCharacterMovement()->StopMovementImmediately();

bitter oriole
#

@ebon bramble basically your movement needs to be stopped in a network-friendly way

#

Simplest would be to prevent player input

#

Otherwise you have to dive into the character movement component and work with prediction

silent birch
#

The travel server does not work in game testing in the editor, does it? Only in the already packaged version and in standalone game, is not it?

bitter oriole
#

No need for packaging, but yes it needs to be standalone

silent birch
#

So why with this code it does not work?

#

Even that's checked

bitter oriole
#

@silent birch Do you want seamless travel or regular travel ?

silent birch
#

Server travel

ocean geyser
#

thats not what he asked, google seamless travel for unreal engine and it will explain

silent birch
#

have already tried and here I use what I have learned and here is the result is (the level does not even open)

bitter oriole
#

๐Ÿคท

#

Make sure you test in standalone, and that you understand the difference between hard & seamless

silent birch
#

So nothing happens

ocean geyser
#

then your console command is done did messed erp. also ^

silent birch
#

Yeah I tested well in standalone but nothing

bitter oriole
#

So - stop with seamless

#

Get it working first as hard travel

ocean geyser
#

your server travel command is messed up. idk what its suppose to be in blueprint but im willing to bet thats the case as why its flat out doing literally nothing. if you use seamless in the editor it should still display an error or something right Stranger?

silent birch
#

When I open my level should I also put the following text :? listen

ocean geyser
#

paste whats in your server travel string

silent birch
#

So no append node?

#

@ocean geyser

ocean geyser
#

post whats in it so we can see it

silent birch
#

There is open MAIN_MENU? Listen

ocean geyser
#

what is your entire string
ServerTravel *********************

ebon bramble
#

Well no I want them to be able move while casting !! Lol

silent birch
#

For this to work, do I do that: platform service = NULL?

#

That's my question

#

I do not understand your question @ocean geyser

ocean geyser
#

im trying to help you figure out your servertravel issue but you are making it difficult here. your append string, what all does it say? part A says ServerTravel, what does part B say?

silent birch
#

Part B says : open MAIN_MENU? Listen

ocean geyser
#

try just this and see if it loads you to your level

ServerTravel MAIN_MENU
silent birch
#

OK I go try

#

Test in standalone game?

ocean geyser
#

editor will be fine as long as its not seamless

silent birch
#

For this to work, do I do that: platform service = NULL?

#

So I'm checking out seamless travel?

ocean geyser
#

uncheck seamless travel, platform service shouldnt matter right now (someone correct me if im wrong for testing) so it can be null

silent birch
#

OK

#

Because it's a guy who told me to do it

silent birch
#

Server travel MAIN MENU or server travel open MAIN_MENU?

ocean geyser
#

ServerTravel MAP_NAME_HERE

silent birch
#

OK

#

Thanks I go Try tomorrow

dark edge
#

Do you guys know if replicate movement is smart enough to not continuously replicate the position of something that is attached to a parent?

#

I know that replicate movement will replicate the attachment, but I'm not sure if it's going to be flooding the pipe full of transforms that are not necessary.

chrome bay
#

It replicates separately

#

as the AttachmentReplication struct

#

ReplicatedMovement doesn't replicate while attached to something.

harsh lintel
#

What can I do to turn replication of an actor on and off for a specified client? I couldn't find anything in the AActor class

winged badger
#

IsNetRelevantFor

harsh lintel
#

The description sounds like it just checks if it's relevant, not that it makes it relevant

winged badger
#

and if its overriden to return false in some situations

#

its no longer relevant in those

#

so you override, add your condition ontop, then call super if your condition doesn't return false

fluid flower
#

hey all, does anyone know how to cancel a join. Say I clicked to join someone, but want to cancel it.

#

using steam sessions

harsh lintel
#

Nice thanks Zlo

meager spade
#

you can also use Dormancy

#

but that is more for actors than clients

split drum
#

So for an invisibility mechanic, if you wanted the character to be truly invisible to another client, you could use IsNetRelevantFor then?

#

looking at the docs it seems possible, but are there any other good approaches?

humble zealot
rich ridge
#

Is there a way so that I can override the default socket which is used for replication and other stuff

#

Or I can tell the engine instead of default engine socket use my own socket which I have as a plugin

flint rose
#

Does anyone have a link to a good tutorial to start integrating Steam?

rich ridge
#

@flint rose thanks it helps

#

So if I write my own online subsystem then it is doable

flint rose
#

I'm asking my own question.

rich ridge
#

@flint rose but your question answered my question

flint rose
#

Well, cheers.

#

I do what I can.

rich ridge
#

@flint rose you are a funny guy

gritty lodge
#

Does anyone know how setting characters to PlayerStarts on Restart Player at Player Start works? I created a few PlayerStarts and added them to the map, gave them tags. But when I use FindPlayerStart and plug in the tags, it always spawns them at 0,0,0?

rich ridge
#

@gritty lodge I believe what u need to do is .
Spawn character by giving the location of player start

#

Do find actor by class and get the reference of one the player starts and get location. Feed that location while u r spawning the character

silent birch
#

Thanks that worked by the text you gave me but I do not know yet if it will not affect the clients ๐Ÿค”๐Ÿ˜Š @ocean geyser

tribal shard
#

I'm having some issues with replication (I believe) and I'm not sure if this is possible
I have a MediaPlayer which uses a local StreamMediaSource: rtsp://127.0.0.1:8554
The output of that is applied as a Material to a MaterialBillboard which represents my FirstPersonCharacter
I'd need that Material to be replicated (I think) as each client is running their own local RTSP server
Right now what happens is every FirstPersonCharacter looks the same on one client (as it uses the output of the RTSP server that is running on that client) instead of replicating the Material from the respective clients
Is this possible to do?

winged badger
#

as long as you have a .uasset in the package with the material

#

it is

tribal shard
#

what is a .uasset?

winged badger
#

a material asset file

#

if its packaged, it can be referenced over network

#

and then the reference to it can be replicated

tribal shard
#

so I have to tell unreal to package the material as well?

winged badger
#

if anything in the game references the material directly

#

its already packaged

chrome bay
#

If you're trying to replicate the "appearance" of a material, that won't work (i.e, what the material looks like).

#

Not really 100% sure what the question is though.

tribal shard
#

thats exactly what I'm trying to do I think

winged badger
#

yeah, so do i

#

when unreal replicates something like a material

tribal shard
#

each client has a RTSP server running locally and the output of that should be the appearance of each player

winged badger
#

first time around, it sends a full path to it

chrome bay
#

Yeah that won't work

winged badger
#

then the path is assigned a 4 byte NetGUID

chrome bay
#

You'll need each player to be able to discern other players' appearance somehow from something simple, like a unique identifier of some kind.

winged badger
#

and afterwards that NetGUID can be resolved into an asset reference

#

without the path (asset in your content folder, and something either referencing it or being manually added to the package)

#

replication won't work

tribal shard
#

is there any other way I could share it?

winged badger
#

provided the RTSP servers have the exact same content

tribal shard
#

they do not

winged badger
#

then no

chrome bay
#

Then no not really

#

What's the end goal exactly?

tribal shard
#

basically each player would be captured by a camera

#

and use that as appearance

chrome bay
#

Oh, yeah forget it

tribal shard
#

what if I made the RTSP servers available from outside?

chrome bay
#

Best you can probably do is one of those character-creation things, where you upload a bit of info to the server when someone joins and clients receive that. Still not exactly cheap though to send a texture across the network.

tribal shard
#

so each client accesses each players server?

winged badger
#

that would murder your bandwidth

chrome bay
#

Well I guess you could, but it'd be like creating Netflix 10 times over if you had 10 players. That's a lot of data to be streaming... Also sounds like a security nightmare.

tribal shard
#

thats perfectly fine

#

I dont need it to be practical

#

I just need to write a thesis

#

:^)

chrome bay
#

Well, in that case you need to give players an ID that other clients can use to find the info they need

#

Like a web address or something I guess

#

Although the conclusion of the thesis will be "fuck this it's impossible lol"

#

Character creators FTW

#

Sorry for the cringe

tribal shard
#

Havent seen that before

chrome bay
#

Sorry to be the one to introduce it to you ๐Ÿ˜„

tribal shard
#

:D

#

Don't I get each clients IP address when they connect?

chrome bay
#

Nah

winged badger
#

they don't normally communicate to each other directly

chrome bay
#

You could tell the Server, then replicate it to other clients - but generally speaking not a great idea.

tribal shard
#

as long as it works im happy

winged badger
#

so even if you did, the player's routers wouldn't expect incoming traffic from other players and would just ignore it

chrome bay
#

^ that is also a good point

tribal shard
#

well Im kinda screwed

rain coral
#

I have a case where when the listen server and client spawn, the client sees an incorrect state on the server pawn, until the server moves their hand and it is 'changed', so it gets replicated. But the code runs on tick and I don't see why the initial state isn't replicated at once.

I get that replication happens only when something changes, which is the case, but surely also it should provide incoming clients with the up-to-date replicated info, regardless of whether they're changing in the moment?

#

The OnRep function runs the moment I move the server pawn's arm, but not before, even though it runs the above code

chrome bay
#

The initial state should come down with the "opening" packet that creates the actor

#

Not 100% sure now but I'm sure that should fire an OnRep callbacks if the value differs from the constructor value.

#

You could change the RepNotify condition to "Always", so that the OnRep fires whenever the data is received, even if it hasn't changed

rain coral
#

I can try to give it a different value in the constructor, to force an update

chrome bay
#

DOREPLIFETIME_CONDITION_NOTIFY(Actor, Property, COND_None, REPNOTIFY_Always);

#

Will force the OnRep to be called whenever the property is received

rain coral
#

Aha, will try that for sure! Thanks

chrome bay
#

NP's

#

you can pass in the "previous" value as an optional param to compare for changes manually etc.

rain coral
#

O yeah, I'm aware of that trick. But I suppose there is a threshold for change then otherwise?

chrome bay
#

Well in that instance it's up to you to decide whether the continue the function or not

rain coral
#

Like it won't call OnRep unless a float has changed by more than 0.000x

chrome bay
#

It's just a mem compare IIRC

rain coral
#

Ah, okay

chrome bay
#

Old != New etc.

kind wave
#

Does anyone have some recommendations for realistic values that I could put into the packet simulation settings? Thank you!

[PacketSimulationSettings]
PktLag=100
PktLagVariance=0
PktLoss=0
PktOrder=0
PktDup=0
ocean geyser
#

@silent birch did it work with all your clients? a server travel should bring the clients with it

timber anchor
#

Hello guys this should be the way to change the Multiplayer Port right?

#

But why is 7777 translated to 17777?

digital barn
#

wrong video

#

this function is being called by anim notify. im having an issue where if multiple players are using the same character whenever the notify "reset" is called by one client it is called by all

#

does anyone know what im doing wrong

#

i cant figure out how to keep the functionality but also make sure the notify only fires for the character using it

silent birch
#

No server travel is working so that an action to open a level is executed only at the server @ocean geyser

ebon bramble
#

Okay so i did something ... I have a dedicated server and client setup. Before, when i spawned the unit for the client and possessed him on the server, the client would be able to 'move around' immediately like it would fully connect and rep the unit to the client within a second. I did -something?- and NOW, after possession the client is like locked into place and can spin but not walk. The client basically loses connection to the server for like 30 seconds (network freeze?) then the message 'WARNING createsavedmove hit limit of 96 saved moves' appears and the connection succeeds and then the client can move and everything fully starts repping

#

wtf is going on? is my server like trapped doing some crazy heavy loops ? why is the network connection freezing / not repping the unit stuff to the client for all that time? how can i profile it. I know how to profile the client but not a dedicated server (no console)

ocean geyser
#

actually a server travel will take the clients with it to the new level, guess its different when executing through blueprint

silent birch
#

But I want to do that when the server opens a level qure it does not affect the server, so how make ? @ocean geyser

ocean geyser
#

what do you mean

silent birch
#

Because when the server is open the level usually opens to all clients, so I want to prevent that when the server opens a level that this level does not open at the clients @ocean geyser

#

So how make?

ocean geyser
#

may i ask what your goal is with that?

#

if thats the case then you dont want to use server travel, however im not sure how exactly to make a server load a separate level while the clients remain on the same level unless you want to load the level on the server and force clients to do a client travel to a different level

silent birch
#

Open a level but it does not happen to clients

#

know a client is traveling to a different level

#

@ocean geyser

ocean geyser
#

read what i said above unless i missunderstood

silent birch
#

It is mandatory that when a server opens a level that it also produces at the clients?

ocean geyser
#

afaik server travel will always take clients with it, if you want a client to load a separate level you must use client travel

silent birch
#

So there is no solution @ocean geyser

ocean geyser
#

theres always a solution, just wait for someone else to suggest something

silent birch
#

OK

worthy perch
#

Is this normal for Seamless Travel?
When switching from one level to another, if there is only 1 player (listen server), AGameStateBase::AddPlayerState() will get called twice?
One gets called during SeamlessTravel FlushLevelStreaming and the last one gets called SeamlessTravel finished in 0.13 seconds.
Seems kind of tricky to understand and work with.
And also, the PlayerState from the old map will be passed in for the first AddPlayerState() call.

silent birch
#

So how make?

ocean geyser
#

that could be how its passing the previous player state to the new level?

worthy perch
#

Yeah, I assume it how the PlayerState does it's CopyProperties stuff, but still seems kind of wonky.

winged badger
#

don't assume, breakpoint it and examine the callstack

#

you can attach VS to a DevEditor standalone

#

not perfect, but good enough

silent birch
#

OK

winged badger
#

there is also a TravelMap along the way

worthy perch
#

Alright, Zlo. Let me just see if I can find the call hierarchy first.

silent birch
#

So a parameter in the player state that manages that?

ocean geyser
#

nathan their talking about something else

silent birch
#

Who? @ocean geyser

ocean geyser
#

their discussing floss's question

silent birch
#

Who was talking about something else?

ocean geyser
#

both Floss and Zlo

silent birch
#

OK

winged badger
#

as for your question, unreal does not support server and clients being on different persistent levels

#

only way you can have them on different levels is to not have them connected

silent birch
#

So there is no solution?

ocean geyser
#

think its possible with spatialOS?

bitter oriole
#

Or maybe you have the wrong problem

silent birch
#

My problem is really that I envy that when the character dies a level opens or a widget that creates

#

What is SPATIALOS @ocean geyser?

ocean geyser
#

he was trying to open a level called main menu earlier with his server travel, are you just trying to kick the client back to the main menu when they die?

winged badger
#

its middleware for distributed dedicated servers

bitter oriole
#

$$$$$$

winged badger
#

its neither free or even remotely easy to use, so you can scratch that off your list

digital barn
#

How would i set the player index for a dedicated server?

#

for local multiplayer im checking controller id and setting it based on that

#

but for online play im not sure how to check

winged badger
#

how to check what?

digital barn
#

player index for new players

ocean geyser
#

create another array on the game state, the game state already has a player array which holds a bunch of player states, have you looked into that

winged badger
#

using GetPlayerController[index] on dedicated server will almost certainly break things

silent birch
#

No if a player dies even if it is the server @ocean geyser

ocean geyser
#

or you can manually set it in PostLogin in the game mode or the handle new player whatever function

digital barn
#

i did this for local multiplayer

ocean geyser
#

@silent birch ok what exactly do you want to happen when a player dies, be specific

digital barn
#

what is that array called though

ocean geyser
#

player array

#

off game state

winged badger
#

that for PlayerStates, and its unordered

silent birch
#

Open level @ocean geyser

bitter oriole
#

@silent birch What you need to do is, learn how UE4 works, and then design your project based on that. There is always a solution, a trick, to get things to work like you want. The hard part is knowing how to trick the engine - this is why you should spend some time with simple projects first.

#

Multiplayer is to be avoided when beginning

#

Seriously

digital barn
#

im not beginning

#

not even close ๐Ÿ˜ฎ

winged badger
#

you'd need to do it from GameMode->GetNumPlayers->For(0 to NumPlayers - 1) if GetPlayerController[index] == ControllerForComparison -> SetPlayerIndex to Index

bitter oriole
#

@digital barn Not talking to you

digital barn
#

@bitter oriole ahh i got you

winged badger
#

note: any use of using PlayerController indices on dedicated server is a terrible idea

ocean geyser
#

@silent birch what level are you trying to open? previously you tried to make it load a level called MAIN_MENU, your not saying what exactly you want to happen, why do you want it to open a level, what is the level going to be for? we need information so we can suggest other options and how to go about doing them. but yes like Stranger said you may want to step back and learn more first

digital barn
#

@winged badger so for online play i shouldnt be using anim notifys to call functions on the character?

winged badger
#

you can, but that is tricky to sync properly

#

UAnimInstance is not supported for networking

silent birch
#

I just want to open a level when the character dies @ocean geyser

winged badger
#

best go with Montages for multiplayer

ocean geyser
#

then simply do
open LevelNameOrPath
in your execute console command node

digital barn
#

@winged badger i use montages that fire anim notifys

silent birch
#

But when the server dies then the level will open at everyone's home, which is bad

#

@ocean geyser

winged badger
#

as long as those montages are synced, it will work

bitter oriole
#

@silent birch You can't do that, so work around it

#

What's your level for ?

ocean geyser
#

@silent birch check if the player has authority(meaning it is the server), if that is false (meaning it is the client) then do Open LevelNameOrPath so only non server players will have a level opened

bitter oriole
#

What sense does it make to stay on the server with other players after dying and being in another level ?

#

Think about that

#

Is it a disconnection ? Then just go back offline

#

Is it a new server ?

#

Is it a new area of the same server ?

#

All of these work in UE4

silent birch
#

I did not understand the, what text put in the execution of the command @ocean geyser

bitter oriole
#

Stop thinking about nodes and think about the design of your game

silent birch
#

Not disconnecting from a session and opening a level

ocean geyser
#

what level

silent birch
#

Main menu

bitter oriole
#

Why would that be a level ?

#

It's a menu, right ?

silent birch
#

Yes

bitter oriole
#

Levels are everything in UE4, changing level is not to be done lightly

ocean geyser
#

......just disconnect the clients from a server when they die and use a dedicated server or check and see if the player is the server OR if the player is not the server then disconnect them when they die. if all the players are killed then make the server host open the main menu level since no clients remain.

#

literally can be done with a simple authority check

bitter oriole
#

You don't even need that ๐Ÿ˜

#

Just open the menu ?

#

Like, show it

silent birch
#

But when the server dies it is also necessary that the main menu opens.

ocean geyser
#

then dedicated server, or force only the server to open your main menu widget

#

and disable ingame controls and such

silent birch
#

So destroy session and execute command or open level?

bitter oriole
#

No

ebon bramble
#

Oh god... I figured out why my clients connection was lagging like hell for 30 seconds

bitter oriole
#

There is absolutely no need for any disconnection or level change

#

Just open the menu

#

On the same level

ebon bramble
#

I was repping a 100 element array with a giant struct inside

#

Giant struct meaning like structs inside of structs

zealous saffron
#

don't do that

silent birch
#

When I only created a widget at the death of the character, the level of the game is always displayed behind the widget

ebon bramble
#

Lol.....

ocean geyser
#

then show a black background or something. just think dude

ebon bramble
#

I refactored it to just a string and a bool like it was supposed to be now it's amazing

worthy perch
#

Should've used the netprofiler, for next time.

ebon bramble
#

The string is then looked up on the client to retrieve the struct in a table ... Derp

silent birch
#

@ocean geyser OK

chrome bay
#

Making a multiplayer game for your first use of UE4 is an uphill battle you definitely won't survive

silent birch
#

I go try @ocean geyser

ebon bramble
#

So far so good lol

#

I've made multiplayer games w jme3 programming the net code in Java from scratch basically

#

Been programming for a decade pretty hardcore , built a crypto mining pool and miner from scratch that ppl use all the time rn

chrome bay
#

That's mainly a comment for @silent birch - try something simpler first. Learn to crawl before facing off with usain bolt

silent birch
#

My first game was a labyrinth game but I did not finish it because my pc was wasting

#

With of the IA

bitter oriole
#

So, like.....

#

Finish a game

#

A simple one

#

Multiplayer is a tall order to even experienced game developers

ebon bramble
#

Yeah seems like the hardest part is really scaling up effectively to lots of ai NPCS and players at once. Staying extremely skinny and micromanaging network data like a fiend

#

Ppl are complaining that wow classic is too laggy lol

#

Just goes to show how hard it can be

bitter oriole
#

The hard part is getting any MP game working honestly

winged badger
#

especially if you get distracted with premature optimizations ๐Ÿ˜„

ebon bramble
#

Oh I got mine working! I have a lot of webdev experience so that helped.

#

And I even added client side prediction which was a real mind blower

#

The potential for bugs is insane

#

And race conditions lurk in eery corner

bitter oriole
#

My first game was an UDK multiplayer shooter

#

It worked, barely, after 18 months

digital barn
#

client side prediction is gonna be a struggle for me

#

have little to no knowledge with that

#

mostly done local multiplayer

ebon bramble
#

Yeah and then after it works barely you have the other 80 pct to go loll

digital barn
#

tbh thats a feature you could spare the money and hire somebody for

bitter oriole
#

Not really

ebon bramble
#

Basically my client side prediction is only on my spells system , for the most part. Item system waits for the server and shows the little spinny overlay like Rust

bitter oriole
#

Multiplayer creeps into the entire game, stuff like physics basically rule out MP, it's not something you just put back in

ebon bramble
#

And it's really no more complicated than ... The casting client runs a special method right away that spawns his spell actor for himself and he DOESNT spawn it when the server broadcasts that all clients should. But there's a lot more to it

timid moss
#

if u want easy prediction just use gameplay abilities system

worthy perch
#

Is that considered easy?

timid moss
#

easier than writing your own version

#

idk i feel its worth learning

ebon bramble
#

Yeah I bought an ability system from the store and heavily modded it . Like it's basically totally different lol but it was nice to have the beginning structure for sure

#

Its always easier to change something than to start from nothing

worthy perch
#

I believe Brian is talking about Epic's Gameplay Abilities System. In case you didn't know of it.

timid moss
#

yeah it provides client side prediction. they used it in paragon and fortnight so it's pretty solid

digital barn
#

link?

chrome bay
#

It's not particularly easy to adopt IMO, but it is useful if you're making a particular type of game.

timid moss
#

theres also a channel in this server where peple talk about it

digital barn
#

where do i get the plugin

timid moss
#

just follow this tutorial and itl teach u

chrome bay
#

It's in the engine, just need to enable it

timid moss
chrome bay
#

They have a whole content sample that uses it now (ActionRPG)

#

Not setup for Multiplayer though IIRC

#

Because of course it isn't

split drum
#

GAS is pretty great but I've observed it is somewhat c++ heavy. It is fairly well optimized in my testing and it has been available long enough for a good number of sample projects to become available

#

The devs are actually working on it a lot right now. It hasn't had very many changes for a while but they are working on improvements as well as incorporating it into their new NetworkPrediction plugin which will also eventually replace the prediction logic in CMC.

#

I'm working on a multiplayer game using GAS with a goal of supporting 200 players in one area. I've done some (limited) testing with AI controlled players and the biggest bottleneck so far has been on the client-side in the game thread. Specifically, the CMC and updating skeletal mesh components (animations mostly)

#

I took advantage of some of the optimizations in the mesh and was able to cut the FrameTime in half which is well within my target

#

What other performance issues have you all come across in multiplayer which I should look out for?

gleaming vector
#

the official docs kinda suck

#

there are a lot of resources there

#

also, the new network prediction plugin only handles the case where we are modifying movement with GAS

#

currently, CharacterMovementComponent fights with basically everything to do movement abilities, which is kinda gross and not idea

#

so they are fixing that

#

prediction and networking for literally everything else works fine out of the box

split drum
#

oh ok, there is a line in the link that says Long term we hope this replaces UCharacterMovementComponent and its networking system (ServerMove, ClientAck*, ClientAdjust*, etc) so I figured it would go beyond GAS

gleaming vector
#

it does

#

network prediction replaces the networking code in CMC

#

added bonus it lets you predict a lot more movement stuff

#

personally, i really hope it just works with root motion

split drum
#

same, been broken for a while now

gleaming vector
#

because root motion is so useful and the fact that CMC and root motion do not get along is annoying and not helpful

split drum
#

yea, i'm implementing a 'sprint' ability now using GAS with predicted stamina drain, using the GASDocumentation project you linked above as a key reference. It would be nice if I didn't have to fight CMC to make it work so I'm looking forward to this new plugin

tribal plover
#

has anyone else solved the issue of rotation lag/movement lag? the jitter..

silent birch
#

I don't understand @tribal plover

tribal plover
#

The rotation lag is awful.. Have tried all the different method implementations and cannot give rid of it

chrome bay
#

Shouldn't be any rotation lag with character movement, provided your using the built-in rotation options

#

I mean, it'll lag for third-party viewers, but it smooths out where possible.

silent birch
#

Clearly you say that for example when a character looks to the north the other players see him go looking south? @tribal plover

tribal plover
#

its more of a jitter

ocean geyser
#

are you just replicating movement/rotation?

tribal plover
#

yes

ocean geyser
#

what exactly are you trying to do with it? naturally that will appear laggy(the jitters you see) for clients. for example if you have a door open/close just by replicating its rotation, it will stutter as it opens/closes, but if you make a function that multicasts or is fired via OnRep that opens/closes the door so the function is running on the clients then it will be smooth as butter

tribal plover
#

we were doing it all through physics now went to the character blueprint because it had some automagical stuff but are seeing the same jittering

#

this is a hover tank game @ocean geyser

ocean geyser
#

so the tanks movement is what is jittery?

tribal plover
#

yep

chrome bay
#

If you are manually setting the rotation and not using control rotation or rotation follows velocity etc, then yeah it will jitter.

#

The built in prediction/replay doesn't really account for that

silent birch
#

I have this problem but only when the character is in the draw position

tribal plover
split drum
#

I've also noticed jitter if you set your tick rate too low

#

Sounds like there are a lot of potential causes though

reef tinsel
#

is it a bad idea to use rep notify object arrays?

#

I have an array that receives objects built from a class, but it takes time for the objects in the array to be valid

ocean geyser
#

would it be possible to make a copy of the array, add to it, do your valid checking, if its valid then change the original array?

cedar finch
#

When I'm making things I find that I'm always needing a replicated random integer. Where should I put the logic so that I can easily retrieve a replicated integer from any blueprint? Gamemode?

ocean geyser
#

@cedar finch gamestate would probably be best

cedar finch
#

@ocean geyser Ok cool. ๐Ÿ™‚ If this works it will save me so much time. I'm making puzzles and I always need random integers. Thanks

limpid agate
#

Noob question: Join session is firing successfully, no errors in output log, etc, but on my client, nothing happens, and no Login event fires on the server...

#

nevermind, issue was that i was not reloading the map after creating the session

reef tinsel
#

That's a great idea, actually. I'll give it a shot in the morning @ocean geyser

#

You meant setting the rep notify variable after it has been validated locally right?

ocean geyser
#

before altering the rep notify array, make a copy of it, do all your checking/altering on that copy to make sure its valid, if its valid then set your rep notify variable to equal the copy so when the clients receive it it is complete and valid

orchid ledge
#

I need help plz
I want to connect 2 android devices in the same WiFi router network
One device is host second is client
But can't join the host device
Any useful idea or tutorials
Thx

thin stratus
#

First off you should describe more detailed what you are doing and at which point it fails.

#

Second you should try to get access to the Log files of both Server and Client and check if they tell you anything.

flint rose
#

Is there any way to determine when any variable has been replicated from server on an actor? C++

#

I know I can use ReplicatedUsing, but hoping for a more global approach to the actor.

thin stratus
#

Well you can reuse ReplicatedUsing functions in C++

#

You don't have to make a new one for each

#

But despite that, there might be some Post Replication functions, but wouldn't know out of my head

silent birch
#

I can maybe do it in Blueprint, we use the node is replicated @flint rose

orchid ledge
#

@thin stratus do you know any tutorials about that

#

I mean the setup way

thin stratus
#

Not really

#

On another note: Anyone had incosistent results with Session Filters?
Filtering for GameModeName works, for MapName doesn't.
Both are setup the same way and I printed both Settings and Filters on Host and Client.
SessionSettings.Set(SETTING_MAPNAME, HostOptions.MapCycle[0].ToString(), EOnlineDataAdvertisementType::ViaOnlineService);
SearchObject->QuerySettings.Set(SETTING_MAPNAME, SessionFilters.Map, EOnlineComparisonOp::Equals);
This still returns a session even if SessionFilters.Map has a different Map in it than HostOptions.MapCycle[0]...

#

Will filter in the UI for now, but still kinda shit if you want 50 Level_XY results and you get 50 of all levels

winged badger
#

aren't those just strings stored in exact same way?

thin stratus
#

@winged badger Sorry?

winged badger
#

session data, isn't the way it stores the GameMode exactly the same as it stores any other session data

#

a string "GameMode" or "Map" paired with another string that identifies it

silent birch
#

When I was on two PCs, and one was creating the session, the other joined it. To create a session it works well but when a player looks for a session he can not find, but trying on the same pc it works very well

thin stratus
#

@winged badger Well yeah, it also works for the gamemode, just not for the map. It's both the same custom setting,just different keys and values

#

Filtered it locally now with the same stuff i send to steam, so something on steams end does shit

silent birch
#

My game does not use steam

bitter oriole
#

No steam = local-only sessions

#

If you want an online session system, the only one that's available is Steam

silent birch
#

Yes I used the plug-in online subsystem steam, how to use steam?

bitter oriole
#

So does your game use Steam or not ?

silent birch
#

Yes I used the plug-in online subsystem steam, how to use steam?

#

Is this the case on all game creation engines?

#

Yes I used the plug-in online subsystem steam, how to use steam?

#

When I test my game with a pc I do not use steam

#

And it works

bitter oriole
#

You need two Steam accounts on two PCs, both starting the game

silent birch
#

That's obligate on unreal engine 4 ?

bitter oriole
#

Look, I have no idea what you want to do

#

If you want to use Steam for sessions, on any game technology, you need to do this

#

Both accounts need to be paying accounts too, IIRC

#

Or at least to invite friends

silent birch
#

OK

bitter oriole
#

Again, multiplayer is hard

silent birch
#

OK I know

#

Someone told me that for an online game, we can do without steam but he does not know the other method @bitter oriole

bitter oriole
#

Of course you can do without Steam

#

You just need your own matchmaking service instead

#

It's not easier

silent birch
#

So I have to create it alone?

bitter oriole
#

No, you should use Steam

#

Creating your own matchmaking service is as much work as creating your game

silent birch
#

OK

#

So I'm going to use steam @bitter oriole

#

thanks

#

I never used steam, how do we use it?

#

Even in real life I have never used steam

bitter oriole
#

๐Ÿคท

silent birch
#

You do not know used steam?

#

@bitter oriole

bitter oriole
#

I have had a game on Steam for years

#

So I guess I do

silent birch
#

OK

#

Explain to me

#

@bitter oriole

bitter oriole
#

I can't explain years of work to you

#

And you don't need to tag me in every single question

#

Ask simple, clear questions and everyone can answer

#

For the record, again, you should focus on a simple single player game

silent birch
#

How do you play a game on steam, not your game

bitter oriole
#

You click "launch" ?

thin stratus
#

How about you take these questions to google

#

At this point we are talking about fundamentals

silent birch
#

OK

#

@thin stratus

thin stratus
silent birch
#

OK

viscid bronze
#

I have this multiplayer project that uses Find Session to find other people's listen servers. When I run it in PIE with 2 players and no dedicated server, I am able to find sessions. However, when I package it and play it from 2 different folders on the same PC, it will not find servers. How can I fix this?

jolly siren
#

What online subsystem are you using?

viscid bronze
#

@jolly siren hold on

#

I have Online Subsystem Steam in DefaultEngine.ini

#

Also OnlineSubsystemSteam is enable as plugin

#

@jolly siren

jolly siren
#

You need to use 2 different machines if you are using steam

#

As well as forward the appropriate ports

viscid bronze
#

But I am just following the blueprint multiplayer tutorial of unreal?
Does this affect finding seasons even if stream has nothing to do with the find session blueprint function?

bitter oriole
#

If you use Steam as OSS, you need two machines for sessions.

#

Also if this is a Shipping packaged build, you also need to launch from Steam

viscid bronze
#

So if I have the steam sub system plugin in enabled,I will always need 2 machines?

bitter oriole
#

Yes

#

Don't enable it for your daily development

viscid bronze
#

alright got it
do i have to delete the several lines of code in Default engine ini

bitter oriole
#

Ideally this would be source-control handled, like a branch or a stash or something like that.

#

So that you can easily switch

viscid bronze
#

yeah but my project is pure blueprint so do i have to delete the few line of Online Subsystem Steam

bitter oriole
#

Source control has not much to do with source code

#

Version control, if you like that term more

#

Same thing

viscid bronze
#

alright good thx
btw how do you turn on notifs on discord
i sometimes go to look at other stuff and miss peoples replies to questions

solar stirrup
ancient root
#

Hello any one had an issue with projectToNavMesh

#

when runnign on a server

digital barn
#

https://gyazo.com/f783dd43ccf050222af528d66325fc3c

charge attack for anyone who needs it
but
i want to replace this get player character node. i dont like to use those online make problems for dedicated server. anyone know what i could change this out with so the cast wont fail? its in an anim notify

flint rose
#

I'm trying to create a mock game mode that creates mock information for players. But it doesn't seem like a USTRUCT is replicating properly.
BasePlayerState.h


    UPROPERTY(replicated, Editanywhere, BlueprintReadWrite, ReplicatedUsing = OnRep)
        FCharacterModel CharacterData;

BaseMockedGameMode.cpp

void ABaseMockedGameMode::PostLogin(APlayerController* NewPlayer)
{
    Super::PostLogin(NewPlayer);
    CreateMockDataForPlayer_Implementation(NewPlayer);
}

void ABaseMockedGameMode::CreateMockDataForPlayer_Implementation(APlayerController* NewPlayer)
{
    ABasePlayerState* PlayerState = NewPlayer->GetPlayerState<ABasePlayerState>();
    if (PlayerState) {
        FCharacterModel CharacterModel;
        CharacterModel.id = "Mock_Character_" + FMath::RandRange(1, 9999999);
        CharacterModel.agility = 1;
        CharacterModel.level = FMath::RandRange(1, 5);
        CharacterModel.experience = FMath::RandRange(0, CharacterModel.level * 500);
        CharacterModel.maxExperience = FMath::RandRange(CharacterModel.level * 501, CharacterModel.level * 1000);
        CharacterModel.magic = 1;
        CharacterModel.name = "Character" + FMath::RandRange(1, 99999);
        CharacterModel.strength = 1;
        PlayerState->CharacterData = CharacterModel;
    }
}
#

BaseMockedGameMode.h


    UFUNCTION(reliable, Server)
    virtual void CreateMockDataForPlayer(APlayerController* NewPlayer);
shrewd tinsel
#

why cant i see the projectiles that are spawned from clients pawn?

#

if servers pawn spawns them, i can see them on clients but not the other way around

digital barn
#

make another function

#

make it cast from server

#

make reliable

#

run the multicast from the server function

flint rose
#

Only server needs to call it if actor is replicated

shrewd tinsel
#

projectile actor is not replicated

#

i want it to be spawned on all machines

flint rose
#

Then why not make it replicated? @.@

shrewd tinsel
#

cuz theres so many of them and they are choppy

digital barn
#

only way server will see them is if you replicate

shrewd tinsel
#

cant i just spawn them on all machines?

flint rose
#

You could, yes.

shrewd tinsel
#

how do i achieve that?

flint rose
#

It may be your collision override.

#

Since you're spawning it at actors location, it may not be spawning because it's blocked.

shrewd tinsel
#

that is not the case

flint rose
#

And you're sure this is being called?

#

I believe if a NetMulticast is called from client, it will only be called locally as well

#

Let me double check that.

tardy ivy
#

So I don't really want too make a specific game... I just want too mess around with databases and networking. Fundamentals like using the engine is something I already have. How do you securely connect to an external Database without using bp?

flint rose
#

There are several ways to do that, you can use an HTTP server, I believe Online Subsystems have something like this as well for storing data.

tardy ivy
#

What is most comonly used in the industry?

flint rose
#

For UE4?

#

Steamworks I believe.

tardy ivy
#

Yes, Ue

flint rose
#

Couldn't tell you what the industry uses since i'm not a part of it

tardy ivy
#

K

#

Does steam have a service for databases?

flint rose
#

Yes. You can store player data, inventory, etc.

#

There's also Epic Online Services

#

But it's still in the works.

rotund sapphire
#

I guess you need a unique steam app id to gain access that features.

tardy ivy
#

Oh okay, I didn't know that. I really need to look some stuff up about that then. You got a good link for me for Steam.

flint rose
#

It's a little difficult to find. I had to watch like 4 videos to get it successfully in my game lol

#

But then I decided to try and mock everything, and now I'm stuck lol

shrewd tinsel
#

@flint rose how would i spawn projectile actor for all players from client?

#

do i spawn it from gamemode?

flint rose
#

Spawn it only on the server, make it replicated

shrewd tinsel
#

but its choppy if its replicated

#

id like to spawn it on all machines (as a decoration)

flint rose
#

What's the difference between doing a multicast and replicating it? Either way a packet has to be sent from space to the other client.

shrewd tinsel
#

from what space?

#

cosmos?

rotund sapphire
#

RPC has overhead, and better to be avoided. Also RPC can be blocking (reliable) which may cause some net issues if a packet is stall or lost i think. Better to replicate values instead and use onrep events..

shrewd tinsel
#

what values for instance? bullet position in space?

flint rose
#

It has a Projectile Movement Component which also gets replicated.

#

And now you have the added effect of the server owning it, which is better for security

#

When it's replicated to clients, it will all of them this information

#

will give*

shrewd tinsel
#

i just want to spawn projectile from client, on all connected computers, as my projectile actor will not be replicated

#

do i have to multicast spawning from gamemode for it to work?

rotund sapphire
#

faxcorp you always spawn on server first, and allow the actor to replicate itself (auto spawn on clients). The projectile may not be a good idea to be replicate movement tho that can make it look choppy i guess. Better to allow run freely on all clients, but only consider Hit Events on server for health stuff. Clients can show particle effects / sound etc tho using hit events.

shrewd tinsel
#

thats what im trying to do

rotund sapphire
#

It's like a hybird method that allows certain autonomy for clients to do some visuals of that projectile, but server is the ultimate decision maker regarding player stats

shrewd tinsel
#

how do i spawn it from client on all machines?

#

multicast from client does not work

rotund sapphire
#

Create an onserver event in player controller, that the client will call. The method will spawn the projectile somewhere down the line (depends on your game design which class will actually spawn but you can add it to PC for testing just fine)

tardy ivy
flint rose
#

Have you tried spawning it on server and replicating it?

shrewd tinsel
#

yes

#

its choppy

flint rose
#

What do you mean by that?

shrewd tinsel
#

velocity of projectiles is too high to replicate efficiently

rotund sapphire
#

Dont replicate movement. You maybe have to disable the replication for the trajectory component too.

flint rose
#

I feel like it being "choppy" can be fixed easier then it not spawning at all.

rotund sapphire
#

It's called trajectory comp or something similar.

shrewd tinsel
#

i want to spawn projectile from client and then a projectile-effect on all machines connected

flint rose
#

Okay, well, I've given you my solution. Good luck.

shrewd tinsel
#

thank you

flint rose
#

Anyone have any idea why my USTRUCT isn't replicating? Code above

#

Hmm, actually the server doesn't have the values I'm setting either. That's very odd.

digital barn
#

https://gyazo.com/f783dd43ccf050222af528d66325fc3c

charge attack for anyone who needs it
but
i want to replace this get player character node. i dont like to use those online make problems for dedicated server. anyone know what i could change this out with so the cast wont fail? its in an anim notify

rotund sapphire
#

ustructs must define uproperty() for props that will be replicated, otherwise they wont

flint rose
#
USTRUCT(BlueprintType)
struct FCharacterModel {
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite) FString id;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) FString name;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) FString characterType;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) FString userId;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 level;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 strength;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 agility;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 magic;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 dexterity;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 experience;
    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 maxExperience;
};
worthy perch
#

You did put it in RepLifetimeProperties (or whatever it's called), yeah?

flint rose
#

Fuck...

#

Of course I forget the most obvious thing.

rotund sapphire
#

Hehe

flint rose
#

Thank you.

#

Sometimes I just need a mental checklist lol

hoary lark
#

i didn't read all of that convo because goddamn but @shrewd tinsel the local shooting client can spawn a decorative bullet locally, send a reliable RPC to the server to spawn an unreplicated but authoritative bullet (i.e. it actually can cause damage), and then the server runs an unreliably client RPC telling everyone to spawn local decorative bullets (the shooting client should ignore the RPC). this is what i'm doing. it works fantastic for low-RPM guns. for high-RPM guns (miniguns, MG42, etc) sending so many RPC's may be a bad idea, and you instead want to replicate/RPC whether or not the client "is shooting" and let that replicate across the network for everyone to spawn FX locally

worthy perch
#

It would have been nice if UBT warned you.

flint rose
#

I get so much in my output since I changed to engine source.

#

Every other console output is something about GIT

digital barn
#

nobody got any ideas?

rotund sapphire
#

grab owner. mesh owner is pawn you get the player that way too

#

the player index can be different for remote clients wont be 0

digital barn
#

yeah thats the problem im getting

#

i tried to get owner but it doesnt count as a mesh comp

rotund sapphire
#

use owner then, it will be the correct player who plays the anim

#

it doesnt count as a mesh comp what do you mean?

digital barn
#

it says

#

Skeletal mesh component object reference not compatible with actor

#

object reference

rotund sapphire
#

pull a wire from the mesh pin type in owner and that's it

#

you probably put there a get owner of actor which expect an actor input not component

rotund sapphire
#

yes the node says "target actor" but you need another version that target components instead

#

do as i say

digital barn
#

cant find a component that will work

#

nevermind

#

thank you ๐Ÿ˜„

rotund sapphire
#

Gud

digital barn
#

working beautifully on dedicated server

#

thanks man

rotund sapphire
#

Remember this and update rest of game code to rely on component->owner relationships for resolving character etc. This is better than asking for player by index. Same goes for PC.

digital barn
#

yeah ive been switching all the player character nodes out to get ready for online play

#

had no problems with local but first time making an online game

#

so just trouble shooting everything

#

next up is learning to replicate components outside the character BP

#

have some montages that fire off from component also my weapons equipping and all of that

#

its a process

edgy dagger
#

so i have been trying to make my own multiplayer game (MOBA) , i have set everything up and it work fines on multiple sessions connected together, i want to make a dedicated server with a small lobby and matchmaking and how i could make the whole thing run on a cloud service, does anyone here have any recommendation on where i could grab the necessary tutorials or guides on what routes to take, or someone who i could speak to regarding this

digital barn
#

amazon game lift

edgy dagger
#

without using any 3rd party solutions like amazon gamelift or SpatialOS?

#

i am planning more of a running the dedicated servers on an EC2 with multiple sessions?

bitter oriole
#

Then you'd need to do yourself your own management service to start ot stop dedicated servers and transfer sessions to them

digital barn
#

that sounds like a lot of work

bitter oriole
#

It is

#

Dedicated servers are a nightmare for indies

#

Best to nope the fuck out of them until you're a millionaire

#

Then you can hire the entwork team you need for that

digital barn
#

Amazon gamelift good enough for me haha

bitter oriole
#

Still a nightmare but well, if you can afford it

#

Just hope your game doesn't need one of the $0.5/hour servers

rotund sapphire
#

amazon (and probably most cloud services) has scripting option that can be used to fire/stop ec2 it should be rather basic with a nodejs instance managing. but there is more to it, amazon has all those fancy services for auto managing networks of nodes i think. hard to remember all those things, but everything costs more and more.

#

amazon probably not the best for startup games easy to run out of funds

bitter oriole
#

Using one of the decent servers on Amazon you'll shell out $0.1 per hour of play, so if every player has 16 hours on average and you have 8 players on each server, that's only about 0.2 dollar

thin stratus
#

None of the Cloud Hosting Services are cheap

#

None of the on-demand services are either

bitter oriole
#

Of course if your average player has 160 hours, that's $2 lifetime

#

In reality it's more expensive because it doesn't scale that well but basically calculate it

thin stratus
#

The problem is that a lot of people don't realize that:

  1. They might never have players for their game, yet they plan on having enough to finance servers and their rent.
  2. They probably don't have the money to finance the servers and game over multiple months before the game gets the amount of players, so back to 1.
rotund sapphire
#

every player has 16 hours on average i've seen people playing 24h on twitch but average should be less than that. Like a half or quarter of it i think.

bitter oriole
#

Average of a MP-only MOBA might be at around 20

worthy perch
#
  1. They probably don't need dedicated servers anyway.
bitter oriole
#

^ this is the real one

#

Why bother ?

thin stratus
#

That's the thing though, they cycle themselves into needing them

rotund sapphire
#

@thin stratus there is also a rather high chance that the players will play the game for a month or two (10ks) then they will be gone, so scaling down will be the solution. but the chance is really there to have players.

digital barn
#

if you build your game correctly by the time your game drops you should have a small playerbase day 1

thin stratus
#

Might not have enough players -> lets make game free for bigger playerbase -> we need to earn money, maybe customizations? -> then we need to stop players from cheating -> dedicated servers

#

"should"

digital barn
#

and also if you are dropping advertisements before you release

thin stratus
#

If everything would work that way, we would all be having a lot of money :D

bitter oriole
#

Generally though, I think it's a terrible idea to do a MP-only indie

thin stratus
#

Good chance your marketing will never reach the masses

#

it's not that easy

digital barn
#

well obviously

#

but you start local

thin stratus
#

You start not with a game that requires cloud servers

digital barn
#

you start with other game devs, your community, testers

#

etc

rotund sapphire
#

kickstarter is a good one for advertisement, tho not the only and not the best probably

bitter oriole
#

Plan for 500 sales and you have a 50% chance of not being disappointed

thin stratus
#

Make a game that runs offline or on listen servers. Sell it for a flat price. Forget about all the competitive stuff, the dedi servers, the microtransaction.

digital barn
#

been done

thin stratus
#

Will save you a lot of pain

digital barn
#

lel why does everyone on the multiplayer tab of this server just tell everyone not to do multiplayer

bitter oriole
#

Yup, completely agree with Cedric here.

#

We didn't tell you "no MP", either

thin stratus
#

Because we've done the multiplayer, we know the numbers, we know the shit show and that it's not worth it if you are small/indie studio.

#

I literally just had a client that went through this. I know the costs. It's bullshit. They never want to go that route again.

digital barn
#

the same game can be offline

#

and MP

#

MP released later

thin stratus
#

You can do Multiplayer, just not DedicatedServer -> OnDemand Cloud Host stuff.

digital barn
#

playerbase is already there

bitter oriole
#

Anyway, if you're smart, avoid dedicated servers

thin stratus
#

I mean you can even do that, we just warn.

bitter oriole
#

Mostly we just yell at people who know better than our dumb asses. What does Cedric know about multiplayer anyway.

thin stratus
#

Exactly. Luckily you never hear of all those smart people again.

#

Yet, look who's still here :D the dumb-asses

digital barn
#

lol not what im saying

thin stratus
#

Don't worry. It's been the 100time we talked about this. Just being tired of it.
It's not like we want to talk down other peoples ideas. Just help, but well.

bitter oriole
#

Honestly I do have little experience with MP, since I only shipped two multiplayer projects

#

Plenty of people here know much better

#

Just, like, my $0.02

split drum
#

I think it really comes down to skillset. It doesn't seem right to generalize saying no indie studio should do cloud / dedicated. If your team has cloud experience it is doable. It does seem like teams should be cautious if they have no experience in the space

bitter oriole
#

Let's just say if you haven't shipped it before, you probably should be poking the ground in front of you before running on it

digital barn
#

lol im not setting any of this up for a long time. i just want it to be working for when the time comes

#

and also to practice for the future

thin stratus
#

@split drum To be fair, would a team with cloud/dedi server experience come here and cuase this discussion? most likely not.

digital barn
#

the main focus is having code that works both on local multiplayer as well as dedicated server

split drum
#

I guess time will tell haha. I am solo working on a multiplayer game right now, but I have also architected and shipped large cloud projects. Maybe it is a bad idea, maybe not

#

I come and ask because i need the ue4 aspect

#

but for sure, it takes a long time to get that experience and be effective

thin stratus
#

If your game supports both without taking anything away from the player, then sure, go for it.

#

If you can make a local, listen, lan, online, dedicated server game, sure.

bitter oriole
#

I'm working on a multiplayer game right now, cooperative only and playable solo - think that's great value for players with much less risk and cost.

thin stratus
#

Most games that need DedicatedServers + Cloudhosting can't affort anything else, cause they do this to prevent cheating

digital barn
#

thats the goal of this project

#

might never release it online

#

but i still want to be able to do it

#

so practicing it doesnt hurt

#

and marketing it doesnt hurt either

thin stratus
#

Only thing I'm saying is: Don't plan on a game that solely uses Dedi/CloudHosting cause it costs money and might never work out.
And it's a shit show if you haven't done it before.

digital barn
#

Game is mainly story/local multiplayer. just interested in being able to network

thin stratus
#

Just general advice for peeps that get this random idea. Also don't do MMORPGs, thanks

split drum
#

all fair points

#

i can see it not working out most of the time without some kind of past experience. There is just too much to learn

thin stratus
#

@split drum But yes, I know we shouldn't technically talk down people, but they mostly also don't really see our point when we explain it.

digital barn
#

@split drum the same couldve been said about learning Ue4 in the first place though

#

if you want to learn it

#

failure is the building blocks

bitter oriole
#

More importantly and I think that's the most crippling mistake you can make : do not make a game that sucks when literally no one else is playing it. The rest is all fine.

#

Saying this because well, 50% of Steam games are just that.

split drum
#

@digital barn agreed, but i think that assumes an unlimited timeline. Have to cut scope if you have milestone targets

thin stratus
#

"Yeah I can do it. I know. I can pay that. Or I make my own. Easy peasy. Yeah I don't listen to your experience, I know it better."
That's the general answer you get if you tell a person that their idea might be too much.

digital barn
#

well this is a team project

#

granted we arent HUGE

thin stratus
#

:D don't take it personally then

digital barn
#

still looking into possibilitys

thin stratus
#

I also only really fell into this discussion today cause I'm not sure what I should play this evening.

split drum
#

i think it is fine to be ambitious, and with unlimited time I believe most things are possible, but if experienced people raise valid concerns about the feasibility of my project i'm definitely going to listen to what they have to say and adjust my expectations

digital barn
#

i mean we never really expected to drop a huge online game anyway. but if the game gets enough sales as is then why not

bitter oriole
#

It's important to be ambitious, but it's equally important to consider that any shred of over-ambition kills and maims game projects.

digital barn
#

anyway ill be back on later guys

split drum
#

my project is going to be pretty bloody then haha, but i've always been hard-headed

rotund sapphire
#

There are some non/marketplace stuff for mmorpg making, with tutorials to teach people about essential use etc, some goes much further. But it's teamwork and difficult stuff indeed, exi is right.

thin stratus
#

Our current internal project is pure singleplayer. Mainly cause I don't want the extra iteration time of multiplayer in it.

split drum
#

makes sense, iteration time is one of my biggest focuses

#

on all my past projects iteration time has been key to success

rotund sapphire
#

Exi play your internal project and mark bugs. Time well spent. :)

thin stratus
#

New office will have a gaming room just for that

split drum
#

you have an office? sounds like luxury

thin stratus
#

:P Well, companies tend to have that. Also this is turning offtopic now.

#

Go and call your rpcs reliable on tick or whatever nice things we all do

bitter oriole
#

I would never do t... shut up !

digital barn
#

for local multiplayer is client side prediction even needed

bitter oriole
#

Nope

#

There's no client so

digital barn
#

ive heard its useful but my last project was fine so i thought so

#

figured id ask anyway

rotund sapphire
#

for lan game you can mark your cmc to be client authorative and it wont predict

#

prediction is for online game rather, and you want them to be server authorative anyways

edgy dagger
#

@digital barn hows the pricing liek on Amazon gamelift

bitter oriole
#

Google it ๐Ÿ™‚

#

Wildly dependent on your game

#

Anywhere from $0.02 to $1.5 per hour

edgy dagger
#

i see alright

south ether
#

Simple question I'm probably just thinking of the wrong way; If you're using events like beginplay in the playercontroller, I noticed they fire on the server too. Does the copy of the PC on the server catch all events like that? And is there a better way of making sure its only running on the client than simply doing Role < ROLE_Authority?

rotund sapphire
#

PC only exists on server and autonomous player, you can check for role == role_autonomousproxy if that's what you mean. But either way beginplay of PC expected to run server too.

#

Mispelled :)

digital barn
#

how would i go about replicating my BPCs? or is it about replicating whats inside of them

rotund sapphire
#

You can enable replication for components, and you can either spawn them only on server (then wait on client until they replicate) or add them in editor and they will communicate just fine

south ether
#

Okay Robert, didnt know if there was a better way of doing it. Will the server catch other events too or do those only trigger on the owning PC?

#

Just wondering if I should be doing role checks all the time

rotund sapphire
#

Server version of PC running pretty much the same things, it is up to you to make distinctions between logic where expected to run.

#

Is that makes sense?

south ether
#

Yeah, I think so, thanks ๐Ÿ™‚

digital barn
#

Im having a weird issue with my equipment BPC and montage BPC that runs my AI'

#

s montages

#

i ticked " replicate component" but still the same thing

rotund sapphire
#

I also do many role checks its kinda expected to happen. But you can always make client only methods for wrapping up long function code etc. If that looks better for ya.

digital barn
#

are BPIs also replicated?

rotund sapphire
#

You can replicate them as properties, and perhaps add them to rpc too. Guess it makes little sense doing so, they are abstract stuff anyways. You can replicate the actor/component/uobject using it instead, that more useful i believe.

digital barn
#

hm well what do you think the first thing i should look at is if the component isnt replicating correctly

#

im out of ideas haha

#

looking for docs on it

rotund sapphire
#

Check the owning actor is also set to replicate

#

Maybe it is not

#

Replication direction is also a rather complex topic. You can most likely call multicast events in either case, but server rpcs require specific chain of setup, like pawn owned by pc and stuff like that which only happens for local player.

digital barn
#

yeah its set to replicate

rotund sapphire
#

You can try in actor pull a wire from component pin and enable with "set is replicated" node.

#

At beginplay or constructor whatever works

digital barn
#

still nothing

#

weird

gritty lodge
#

Is there a safe way to detect what number player a "Starting New Player" is to the server? Iterating an integer seems has edge cases where it doesn't work.

weak fog
#

on GameMode there is a getter called Get Num Players

#

that might do the trick, as it should increment every time a new player connects

#

if the edge cases also persist, you could probably throw every PlayerId from PlayerState into a set, which guarantees uniqueness, so its length should == number of connected players

gritty lodge
#

awesome, that seems to work much better, thanks!

safe holly
#

hi, how can i get other player stats in my ui?

#

how can i access other connected players class?

#

how do i get playerui class variable from player bp?

gritty lodge
#

The stats are given in a component?

safe holly
#

yes

#

i mean i hvae declared few stats like hp and mana

#

i kept it as replicated

#

but how can show that on ui of client player?

gritty lodge
#

You are trying to "inspect" other players stats?

#

Like, player A looking at player B's stats

safe holly
#

yes

#

T_T..

gritty lodge
#

If your gamemode is storing references to all your characters or controllers, you could probably just have the ui ask the gamemode for the "get component" on player B's pawn

#

I guess it depends on how your game needs the stats

#

If your game doesnt change the stats during play, you could just save them somewhere and access them whenever your UI needs them

safe holly
#

fcukk..

#

fixed it

#

i was doing like u said

#

turns out

#

i am setting visible state for the popup

#

i was just setting number T_T

gritty lodge
#

at least its working ๐Ÿ‘

safe holly
#

hhaha

#

i no..

#

wasted hours on it T_T

silent birch
#

How to do that when the server opens a level that this does not happen also at the client

#

?

bitter oriole
#

You can't

silent birch
#

It's impossible ?

bitter oriole
#

In UE4, when you are connected to a server, you are on the server's level.

#

That's it

silent birch
#

By using the destroy session node when a player dies, he will no longer be in the session. Because I'm scared if it's still and the server opens up a level

bitter oriole
#

You should open a new level on client when the session is destroyed (since you'll disconnect from the server)

silent birch
#

I am looking to play with someone online on steam, how to do?

#

Not on my game, but with a game that was not created by me but by someone

tribal shard
#

I have an Animation Blueprint with a variable play rate. I created an input action that lets players pause/resume the animation by setting the play rate. How would I get this to synchronize between players? I have set the variable to be replicated but that does not appear to do the trick

meager spade
#

animbp doesnt replicate

#

you need to maintain that on the player

trim kindle
#

Hey guys, what max lag or lag variance do you use to test your game in edge case network scenarios? Is it reasonable to test with 500ms ping and expect that at higher ping visual glitches like things popping/going thru walls can happen (without breaking the game)?

keen thorn
#

Hi anyone here have experience with multi session Dedicated server solutions? Currently ue4 dedicated servers only run single session (1 map/game at a time). Are there plugins or other solutions available to allow 1 dedicated server to host for multiple sessions of players?

digital barn
#

@tribal shard instead of changing anim play rate change custom time dialation for the player using the animation

#

0 the animation will completely stop i used the same method for charging attacks

tribal shard
digital barn
#

@tribal shard yes

tribal shard
#

Ill try it, thanks

digital barn
#

got a quick question also if anyone is around. regarding to BPCs

ebon bramble
#

@keen thorn you don't need a plugin , there's a guide

meager spade
#

what are the config options for network updates

#

or what file are they located in

digital barn
#

anyone have tips for Replicating blueprint interface functions?

silent phoenix
#

Hey Luck,

Im pretty new to UE but I didn't have many issues getting my interact system working multiplayer which uses an interface system. Which error are you having?

digital barn
#

My ai has montages that play from an interface event but i cant seem to get them to replicate on the client

silent phoenix
#

Interaction Event -> Server -> Multicast Play Montage not working?

digital barn
#

tried calling it this way

#

goes to montages right from here

silent phoenix
#

What is calling handle hit server