#multiplayer

1 messages ยท Page 377 of 1

full bane
#

regardless

magic crest
#

but this is !

#

aha.. indeed

#

you're right

#

yeah, i guess you MUST have an instigator information via which you'd filter

full bane
#

ya, that was my initial impulse

#

to just send the netId or the pawn reference

magic crest
#

This is purely logical, as I really don't have more knowledge on multicast. There is this dude on facebook, that says 'dont use multicast for anything'

full bane
#

but that didn't feel like the best practice

#

no multicast for anything? ๐Ÿ˜„

magic crest
#

something has to be sent over the network

#

at least one bit ๐Ÿ˜ƒ

#

SO, if you'd have 2 emotes. you'd use another event or feed the event with value?

full bane
#

I am sending an ID

magic crest
#

Yeah, sounds correct that you send the ID of the sender as well

full bane
#

not sure about NetId though

#

never used it in this context

magic crest
#

hey. i have an idea ๐Ÿ˜ƒ

#

the if above..

full bane
#

actually

#

the IsLocallyControlled could actually work

magic crest
#

or ignore it if it is autonomous_proxy

full bane
#

ya, that could do the trick too

magic crest
#

well, that's basically locally controlled, but then the server player would have a bug coz his char is authority

#

yeah, LocallyControlled sounds right

full bane
#

it basically checks if the pawn has a controller

#

and in networked games they don't have it

#

unless it's your own

#

so that could just do the trick

#

alright

#

I think I will go with that

#

thanks for your help

magic crest
#

No problem.

indigo root
#

So I'm trying to change a player from spectator to possessing a normal pawn. For some reason it doesn't work, and one of the people here mentioned something about a boolean that needs to be reset in order for possessing to be allowed. Does anyone know how to access that boolean? (using blueprints)

indigo root
#

to get around that issue I removed the "start players as spectators" tick and changed the default pawn to be SpectatorPawn. This is my code that spawns the player:
https://owo.whats-th.is/aa93c2.png

#

note that if I do run the Destroy Actor node after detaching, it complains about None being accessed

#

what happens is that the player is unpossessed (can no longer move like a spectator) but doesn't possess the new spawned pawn

#

all that tested with dedicated server, however if I untick "dedicated server" everything works fine

zinc crater
#

Hello Everyone!

We are having a weird issue. We were working a a ThirdPerson project and starting to work with the multiplayer and it was working so so. But, now when we changed the computer in which we were developing to a different one (a new more beefy one) the clients are completely frozen. Only server works. If we run Dedicated Server all clients are frozen. Any Ideas ?

thin stratus
#

I was the one saying that the Boolean will block it

#
void AHLPlayerController::K2_ChangeStateToPlaying()
{
    if (GetStateName() == NAME_Spectating)
    {
        AGameMode* GameMode = Cast<AGameMode>(UGameplayStatics::GetGameMode(this));
        GameMode->NumSpectators--;
        GameMode->NumPlayers++;
        ChangeState(NAME_Playing);
        PlayerState->bOnlySpectator = false;
        bPlayerIsWaiting = true;
    }
}
#

PlayerState->bOnlySpectator = false;

#

That's the bad one

#

That gets set if you do "StartPlayersAsSpectators"

#

And epic doesn't set it back to false

#

So when you try to possess

#

It tests if that is true or false and won't posses the new pawn if it's true

#

I'm calling above function to reset the Player from being a Spectator

#

Changing the PlayerCount properly

#

And resetting the booleans

#

That's nothing yo ucan do via BP only

#

And I don#t know if there is a plugin for that (i doubt it)

#

@SuperCuber#7818 @worn nymph

#

@zinc crater Sounds like you didn't push last changes

#

Or didn't copy all files

#

Check if the Input settings are still working

#

So check if they are still listed

#

and then print the AxisValue of your move axis

#

And see what happens

mellow cipher
#

My problem is setting the sprint locally causes the client to sprint before the server

indigo root
#

@PrintStringFTW#6597 yes, when I tried using unpossess it didnt work either

#

@worn nymph

mellow cipher
#

4.18 project to show my sprinting problem

#

Remove if not aloud to post files

thin stratus
#

Not that it's not allowed

#

But no one has time to download that

#

Make a video or so

#

@indigo root I wrote you why it's not working

#

Even with code you could use

indigo root
#

@thin stratus as I mentioned, I changed it from being "start as spectator" to being normal, except that normal pawn is actually of type SpectatorPawn. Shouldn't that work?

#

Maybe I should make another type of pawn called ICantDoAnythingPawn and start the player as that..?

thin stratus
#

That should work

#

You also only need to call Possess

#

Cuase that calls Unpossess internally

indigo root
#

ok, time to hack around ue's dumb choices ยฏ_(ใƒ„)_/ยฏ

twin juniper
#

@thin stratus hey cedric, question about what u have used in your projects database wise.

#

What have you been using?

#

MSSQL, Oracle, MySql, Postgres..etc

thin stratus
#

Actually what ever fitted the project

twin juniper
#

Or some sort of no-sql solution like mongo?

thin stratus
#

I used MongoDB for a few things

twin juniper
#

Yeah I was just wondering because lots of people on here are trying to get me to NOT use SQLite in production. However, I'm not really convinced that SQLite is NOT a good solution for my game lol

#

Obviously in a large web site it wouldn't work

#

Thanks for the info though!

indigo root
#

@thin stratus I created a pawn that does nothing and set it as default pawn in my Game thing, but it's still the same

#

like, the pawn is a data only blueprint with parent class Pawn

#

and as I said before, it works when I untick "dedicated server"

#

but I need it to work in multiplayer so that's not really an option

mellow cipher
#

Something is wrong with SQLite?

twin juniper
#

@mellow cipher i dont thik so

#

the only issues i have been told is concurrent connections

#

like related to that

mellow cipher
#

Oh

#

My setup only has the server connected so that might be why

twin juniper
#

@mellow cipher im not so convinced though

#

there is a feature in sqlite where if the "concurrent" buffer is overflowed

#

it dumps the extra stuff to a separate file

#

and periodically merges it

#

with the main db

#

man i worry im fucking up

#

lel

quartz vector
#

Why exactly would a Server spawned actor fail to replicate unless "Always Relevant" is checked?

#

pretty simple setup... does not replicate to client unless I check "Always Relevant" but doesn't seem like the actor itself should always be relevant, but maybe i dont understand exactly how relevancy works

zinc crater
#

@thin stratus Thanks, will try. But already checked the copy and the originals. Will get back to you. ๐Ÿ˜ƒ

gloomy tiger
#

Hey guys,

thin stratus
#

binaries folder iirc

gloomy tiger
#

Thank you, @thin stratus. ๐Ÿ˜ƒ

cyan bane
#

Is anyone here familiar with Snapshot Interpolation? UE doesn't use it, but I implemented my own system in UE for physics objects and am having some issues with how clients see themselves interacting with objects that are ~100ms in the past for them.

night jay
#

Anyone know why this is happening. I get these logs randomly so it seems
LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor [ACTOR NAME]. Function [FUNCTION NAME] will not be processed.

winged badger
#

it means you tried a server RPC from an actor that is not owned by the clients PlayerController

#

for example: looting a Chest from a client

#

if you were to call Chest->Loot(Replicated to Server) you would get that message because your PlayerController does not own that chest

#

if you instead did LootChest(Replicated to Server) inside your Pawn or PlayerController then from there (once your execution is on server's copy of your Pawn/PC) you could do Chest->Loot(no need to replicate now)

night jay
#

I see

winged badger
#

because then you tell the server's copy of your Pawn to loot the chest, and its ok for server's version of it to interact with other server owned actors

#

anything attached to your PlayerController will work - Pawn, HUD, PlayerState, Pawn's components, actors attached to your Pawn

night jay
#

I see

#

Yeah I see the issue happening with stuff spawning in the world with no clear owner

#

Like a weapon or powerup

#

Thanks

graceful cave
#

is it possible to get reference to inactive player states through blueprint?

wary willow
#

Other than Gamesparks, what's a good matchmaking cloud service out there that easily supports UE4? Or what are some other options to be had?

grand kestrel
#

Heh Gamesparks is now a "prime" example of why building your game around third party tools is bad

wary willow
#

@grand kestrel Huh? Why's that?

grand kestrel
#

Acquired by amazon

wary willow
#

Ah, good joke actually, damn my sleepiness for not getting it

#

But, I don't know. Might not be a terrible thing

#

MSFT bought out Playfab

#

So it's not very surprising

#

What I am surprised about is there is not 3rd option

#

Not one that I know of off the top of my head though

placid vale
#

hey guys, is there a way to hide actors only for the client as and when the client toggles it?

thin stratus
#

@placid vale Well yeah, only call the hide stuff locally?

#

@wary willow I think steam has matchmaking too

#

Given that CSGO has it and there should be docs about it

fleet sluice
#

@thin stratus @wary willow It does have matchmaking. In short, it's about setting a player's stat or a lobby's key with a value that represents the skill level (or whatever) and other clients search for lobbies near that value or iterate through lobby members for their stat.

thin stratus
#

Is it just manipulating the existing session stuff to have matchmaking?

#

Or is there actually an automatic search on steam's end?

placid vale
#

@thin stratus thanks! I have a replicated actors whose visibility I want to toggle

#

I ended up switching the mesh components visibility off

fleet sluice
#

The lobby is search is sort of automatic. You can add a key/value filter and then search for lobbies and it will only return those which have the key/value (or just the key; or a smaller/larger value; the filtering system is quite versatile). And each lobby can have up to 20 custom keys or something.

#

But then you need some form of connecting to that lobby (i.e. owner's SteamID + Steam sockets / owner or server's IP:port)

#

I've added some prototype script in the latest UWorks involving a rough filtering and connection to sessions, but needs more work and will be moved in .cpp soon

thin stratus
#

Yeah okay, but that's all kinda doable via the Session Settings

fleet sluice
#

I could never get that working when I tried. Haven't touched OSSteam since, though

severe badger
#

Hello guys :)
I have a stange problem with a blueprint node in multiplayer. I try to get the bounds of an instancied mesh component to set a collision box origin/extent. However on a dedicated server the bounds extent is always 0 while on the clients the value is correct (!=0). And if I run the game with a player as host (not dedicated server), the server's bounds extent become correct.
Is it because the server doesn't really simulate every graphical part?
How can I fix the problem?
(I run UE4 v4.15.3)

magic crest
#

In a child class, I'm trying to set replication of a variable that's been declared in the parent class. I'm getting an error
'ACharacterBase::bDied': cannot access protected member declared in class 'ACharacterBase'

Base

    /* Pawn died previously */
    UPROPERTY(Replicated, BlueprintReadOnly, Category = "Character")
    bool bDied;```

Child
```void AHeatCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    ACharacter::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(AHeatCharacter, CurrentWeapon);
    DOREPLIFETIME(AHeatCharacter, bIsJumping);
    DOREPLIFETIME(AHeatCharacter, bIsSprinting);
    DOREPLIFETIME(AHeatCharacter, bIsIronsight);
    DOREPLIFETIME(ACharacterBase, bDied);
    DOREPLIFETIME(AHeatCharacter, bIsInVan);
}```
#

why isn't a protected member accessible here?

#

or should I just put this replication in base?

#

Sure enough, it worked. Anyone care to explain why? Thnx

surreal prism
#

Wow...
Why it's not fixed yet?

#

Someone know reasons why this happens?

thin stratus
#

@severe badger Hm, strange. Are you sure that you aren't simply filtering the DedicatedServer somewhere when the actual meshes get spawned?

#

Have you checked if the DediServer actually has InstanceMeshes spawned?

#

@magic crest Can't really tell why. Might be that the Macro is accessing it from the outside, so it would need to be public.
The replication should be handled in the base class anywhere though

#

Also UE4 uses "Super" for the parent class

#

So you should do Super::GetLifetimeReplicatedProps(OutLifetimeProps);

magic crest
#

Yeah, I did. Aah, the macro thing. I thought I was calling it from the child class, so protected would be ok. Doesn't matter tho, got it fixed. I just followed the pattern from ACharacter

severe badger
#

@thin stratus Every event is called from the server and well synchronized with clients so I don't think it's filtered. If I try to catch collision directly from the instanced static mesh component, everything works well... ๐Ÿค”

twin juniper
#

Asking this question from #cpp here too because it's relevant to mp stuff

FVector UStrafejumpMovementComponent::GetFallingLateralAcceleration(float DeltaTime)
{
    // Why does this only work when player is the server?
    FVector InputDir = GetLastInputVector();
    
    // bound acceleration, falling object has minimal ability to impact acceleration
    if (!HasAnimRootMotion() && FallAcceleration.SizeSquared2D() > 0.f)
    {
        // Do strafejump bullshit here
        // .....
    }
}

as mentioned in block
how to i get the last and/or consumed input direction when overriding GetFallingLateralAcceleration in CharacterMovementComponent?

graceful cave
#

not sure about the question posted but i know how to fix "// Why does this only work when player is the server?"

#

only the server can change variables related to the movement component but setting them on the client and then sending an RPC to the server will create the illusion on the client of smooth acceleration

#

same thing applies to launching characters

#

but the server will try to adjust the location of the client if it doesnt think the client should be there which is exactly what happened when i tried to implement strafe jumping

#

if ping is too high, its unplayable and the client will warp constantly

#

only solution is probably to modify the source to give client the authority to change their move speed

twin juniper
#

what im trying to replicate is that

#

in Quake, you gain in air acceleration if you hold the strafe keys and have you character at an angle to your current movement direction

#

i already get the math behind it and have a blueprint only version working but it's hacky af

#

basically in the line

 // Why does this only work when player is the server?
FVector InputDir = GetLastInputVector();
#

how do i get whatever input vector the server has been sent is?

#

AirControl uses the last input sent to the sever and substuting that line with

#
FVector InputDir = GetAirControl(float DeltaTime, float TickAirControl, const FVector& FallAcceleration)
#

works on both the client and sever but I wanna get more direct because GetAirControl just returns the lateral acceleration]

#

which is more or less the input vector when normalized IF there are no other things causing the character to accelerate

#

when i get back to my desktop I'll post the full function

quartz vector
#

How does a player interact with an unowned actor in scene to call Server RPCs through UMG

#

Like for example, a player opens a treasure chest and changes the contents

fossil spoke
#

The Player must be the one to call RPCs. The Player rearanges the chest contents, not the chest.

quartz vector
#

Why is that?

winged badger
#

the server version of your character can freely interact with server objects

#

local one can't

quartz vector
#

Oh

winged badger
#

and requirement to send a RPC is that the object you are sending it from is owned by your PlayerController

quartz vector
#

So player would need to have a component or something that you call some RPC on

#

That takes the target actor as param

winged badger
#

PlayerController, Character, HUD, PlayerState, attached component, attached actor

#

all works

#

other requirement would be the actor you want to affect is replicated

quartz vector
#

Ah I was trying to reference a component on the Actor through my character

winged badger
#

because if it doesn't have the same GUID on client and the server it will disconnect you when you send the RPC

quartz vector
#

And call RPC on the Actor component

#

Ok I got it then. Looks like my inventory component will need to manage box contents through its own rpcs

winged badger
#

depending on the setup you can get away with as little as 1 replicated array of structs and 3 server RPCs

quartz vector
#

Thanks

#

Items are all held on itemcontainercomponents

#

And containers are referenced by inventorymanager

cerulean rapids
#

x post from blueprint, im not rly sure where to post. - Hey guys, any1 have a lot of experience with multiplayer level streaming that i could bounce a few questions off of?

winged badger
#

ask your questions, its what the channel is for ๐Ÿ˜ƒ

graceful cave
#

any idea why my custom jump pads wont work on a dedicated server but work fine for clients in the editor?

#

it runs everything up to the RPC

brittle sinew
#

Are you trying to call a server RPC directly on that jump pad?

#

(the log should tip you off to an unowned-actor RPC call)

graceful cave
#

its called on the jump pad but it has worked up until this point

#

clients on listen servers never had issues

brittle sinew
#

By "listen servers" do you mean in-editor?

graceful cave
#

actual listen servers with other players/computers

brittle sinew
#

Hmm, I can't tell you exactly what's going on then, but you can't call a server RPC on an unowned actor.

#

Even on listen servers, that's just how it works.

graceful cave
#

i tried setting the rpc to reliable so ill see how that goes next time i package

brittle sinew
#

Is this jump pad in the level or is it spawned (and, thus, possibly owned) by the players?

#

If it's present in the level and you don't change its owner, that won't have any effect.

graceful cave
#

placed in the level by default

winged badger
#

if it worked on listen server its not an improper RPC

graceful cave
#

im assuming that reliable will fix it but its hard to believe there was any network stress considering it was a 30 tick dedicated server running on my own machine

winged badger
#

does it working depend on ticking?

graceful cave
#

how can i change that?

#

id like it to be 60

winged badger
#

there is a bAllowTickOnDedicated server

#

that is false by default

#

with information you provided, its my only guess

graceful cave
#

i checked the blueprint for the jumppad actor and that is checked

cerulean rapids
#

https://www.youtube.com/watch?v=3EgdGWJMWE4&feature=youtu.be

here is footage of my issue, initially the game is being run singleplayer with just the Open Level command, and in the second half, the game level is being opened with level streaming for multiplayer and everything breaks. It has worked before with level streaming so this is a recent break, just wondering if any1 has had something similar before and knows of a fix or even a possible cause. Please PM me if you need any more information, any response is more than appreciated.

graceful cave
#

i think i might have found the cause

#

i have another map that has a jump pad but it was made before i made the actor for it

#

so its just a trigger box that runs in the level blueprint

#

same exact script

#

except

#

my actor has a "launch target" actor to generate the launch velocity instead of a raw value like the one in the level blueprint

#

might not be replicating that

versed socket
#

Has anyone ever seen a tutorial where you take a basic project and then add the necessary multiplayer stuff so that you can package the project for you and your friend and have them connect to your server (whether it's listen or dedicated)? Because I have a thing and want to actually make it work for multiplayer testing with a friend or two.

winged badger
#

@versed socket check the pinned resources in this channel

versed socket
#

I did, actually, before asking. I'm not sure if any address that, though. Maybe I'm just blind.

winged badger
#

Cedric's compendium is an okay place to start with networking

#

video tutorials tend to just tell you "how" and forget to explain "why"

versed socket
#

Well yeah I've actually read Cedric_exi's thing a while back. I don't think it covered how to get a project ready to send over to your friend so he can install and connect to your thing where you can play together to test stuff.

night nebula
#

I completed that course and it has everything you need to know to start making multiplayer games.

versed socket
#

I already know about the RPCs and whatnot and I know how to implement them in C++ as well... I'm actually asking about something different here: what do I actually need to do so that my friends can download my packaged project and hop into a [listen/dedicated] server that I'm somehow hosting? How do I figure out what ports need to be opened for hosting with my thing? Is it just a simple "Open session" and then either creating a UI to input the connection details or adding the appropriate connection details to the command line?

thin stratus
#

Depends

#

Let's say you aren't using any Subsystem

#

For Internet Connection via Sessions (ServerList etc.), you are out of luck then. You'd need to fake LAN via Hamachi or so.

#

You can however connect directly via IP

#

That requires the host to open the specific port. Default is 7777

#

If you package your game as Development

#

You can still access the Console. So all you need to do is bind a console key (can be done in the Input section of the settings at the bottom)

#

The ListenServer then types "open MapName?listen"

#

While the Client does "open IP-ADDRESS"

#

That's all

#

If you however use a Subsystem like Steam, with or without own AppID (480 could lead to not finding each other!), you'd simply need one person to call "CreateSession" with a follow up of the "OpenLevel" node and also the "listen" option again.
While the client simply calls "FindSession", lists them and joins them, or blindly tries to join the first result in the array that comes back.

#

A DedicatedServer is a bit of another story. If we ignore that you'd need to build it via Source and then copy/paste the binaries to your packaged project, it's still a bit mรคh to get it working.
No Subsystem is still direct IP connection, so that is the same as above.
With a Subsystem, you'd probably need to setup a Session for him (in C++ it's with RegisterServer function), that does not use PRESENCE (as that server doesn't have a n account) etc.

#

There are tutorials/docs on that by users

finite bison
#

do you know of any OSS matchmaking server implementations? even if they are just proof-of-concept?

versed socket
#

Thanks for that @thin stratus!

So just to make sure I understand you right, if I wanted to take a ThirdPersonExample tutorial project but with some basic replication stuff set up properly, then I could make this happen by:

  • Package the project and share a copy of the game folder with my friend(s)
  • Make sure port 7777 is open for whoever wants to host
  • Whoever hosts goes into the console and types "open MapName?listen"
  • Everybody else does "open IP-ADDRESS:7777" in the console

And that's the bare minimum we have to do to setup online multiplayer via direct connecting!

thin stratus
#

Correct.

signal sand
thin stratus
#

That's normal afaik

#

Cause Epic doesn't have the IP/Port stuff in the Session info

#

They only have the p2p stuff setup

signal sand
#

ah ok

versed socket
#

@thin stratus Follow-up question: if I'm the listen server host and I have friends connected and playing with me... then if I do Open OtherMapName?listen, will they automatically follow me and load into that new map with me?

thin stratus
#

No

#

Use ServerTravel MapName

versed socket
#

You are the sexiest person I have ever met in my life, @thin stratus

thin stratus
#

:P

indigo root
#

so in my code, I use a server event on the playercontroller to spawn an actor and make the player possess it, then destroy the old actor, however when I call "get player's pawn" on the client side after that it still gives me the previous actor even though it's destroyed?
I thought playercontrollers were replicated?
Maybe my issue is that I am calling "get owning player's pawn" on a widget which is not replicated?

kind bay
#

Quick question guys, is there another online subsystem for Matchmaking and NAT punch-through that works with a blueprint only project other than steam?
(preferably that works with UE4 online subsystem blueprint nodes)

slate veldt
#

I just noticed that Seamless travel is disabled in PIE, anyone know any work arounds?

thin stratus
#

Launch Standalone

#

(Right click uproject file -> Launch Game)

#

@kind bay You can look up all Subsystems by just browsing the Source Code

#

They are in Plugin Formit and are all called OnlineSubsystemXYZ

#

You can also check which parts of the subsystems they implement

#

So I would say no

spark linden
#

why would my project that isnt MP not build if I disable all the MP related plugins?

#

or it builds but crashes on run

thin stratus
#

@indigo root No, you are simply ignoring the existence of ping

indigo root
#

hm?

thin stratus
#

You call the ServerRPC, which already takes time to reach the Server

indigo root
#

doesnt the "create widget" node run after the rpc completes?

thin stratus
#

Then the Spawning + Replication done to the Client also takes time

#

No

indigo root
#

oh.

thin stratus
#

It runs after you issued the RPC

#

Everything else is happening async from that point

indigo root
#

so I'd need to rpc back?

thin stratus
#

Correct

indigo root
#

but widgets don't replicate right?

thin stratus
#

Correct

indigo root
#

hm

thin stratus
#

ClientRPC in the PlayerController

#

But even that might not work

#

As the replication of the Pawn variable could take longer

#

than the ClientRPC

#

You should go to your Pawn

indigo root
#

is there a "wait for everything to be replicated" node GWjustinHyperThink

thin stratus
#

And in the "OnPossessed " event

#

You do a ClientRPC

#

Nope there isn't

indigo root
#

is the onpossessed event guaranteed to be called after replicaiton?

#

or any events for that matter

thin stratus
#

It's called after the Pawn is possessed

#

And the ClientRPc you call there will call in the Pawn itself

#

So that's kinda guaranteed to be properly timed :P

graceful cave
#

is there a good tutorial for setting up a steam dedicated server via blueprint?
ive built the server and it can be connected to via ip and works as expected but i want to do things like set a name for the server that shows up in my ingame server browser

#

currently it shows the default "9xxxxxxxxxx" name with 0/0 players and cant be joined by pressing the join button

#

but can be joined via ip

hasty adder
#

Anyone know the right command to make a dedicated server restart for multiplayer if no one is on it? i found my setup is bugged if the match ends and it goes to serve rtravel with no one on it doesnt execute and then is stuck in limbo

#

Blueprint if possible.

#

i think i tried it already but for kicks doing it again with just game modes restart game node

next falcon
#

Guys i have a problem..
How can i get the player data ?
like i want a player list with the Player State Data and Character Data but i can only get all actors of class of state Or Character how do i like connect them ?
or how do i know what character is for what state ?

hasty adder
#

yup that did the trick

#

do you mean character class? what state is currently using it?

#

I always on possess of a character set a reference to its player state from the incoming controller thats possessing it in blueprint i use the on possess node and get playerstate and cast to the ps class and set a variable.

next falcon
#

Oh jeah that might help thanks ๐Ÿ˜„

graceful cave
#

is it possible to avoid showing the user as playing spacewar while still using the steam subsystem?

bitter oriole
#

Yes

#

Register the game on Steam and use the appid Valve gives you

#

Obviously it's $100 but you'll need that at some point anyway

graceful cave
#

ah i guess its not possible for me with this project then because it started as my "learn ue4" project so the models are imported from other games

#

intent is just something fun to play with friends but itd be nice to not be showing spacewar

night nebula
#

Anyone knows why AGameModeBase::GetNetMode() returns NM_Standalone when it should be NM_ListenServer? If I use GetWorld()->GetNetMode() it does return as listen server.

#

That seems to only happen in AGameModeBase::PostLogin. If I check it in AGameModeBase::BeginPlay I do get NM_ListenServer.

cerulean rapids
twin juniper
#

why is my server loading staticmeshes?

#

even tho im packaging with "Server" config

#

using project launcher

gloomy tiger
#

@cerulean rapids this seems to be very related to replication settings. ๐Ÿค” can't say anything else because we'd need more instruction about the details of your problem.

cerulean rapids
#

yeh it's a difficult to express im sorry. replication being the issue even if the listen server has the problem too?

next falcon
#

Guys i use foliage in my multiplayer game and i need to remove and add instances for all players
how can i do that?
my idea was to remove it on server and multicast it to all clients to remove the instance id But i don't know how to get the instanced foliage ref..
some idea how i can do that or other ways ?

thin stratus
#

Save them in an array or so

#

So that the Index on all players is the same

#

Would be one Idea

winged badger
#

multicast would result in inaccurate state for players that join after the multicast, as well as players that were outside the NetCulling distance, or not NetRelevant for any other reason @next falcon

#

by default that would be farther then 15k UU

next falcon
#

jeah i also thaught of that problem but i don't know any other way.. ๐Ÿ˜ฆ

gentle stratus
#

Hey not entirely sure of this goes here. But does anyone know if there's a way for post processing effects to only affect one play screen in a split screen scenario?
My camera has a post processing component attached to it and right now if I enable it on one player screen it gets on both.
Any suggestions?

lusty dust
#

Hey fam, how do you join a game and start as spectator? Do you have to set the default pawn class to your spectator pawn or how can you utilize the pawn you selected for Spectator Class?

fossil spoke
#

@lusty dust The GameMode has an checkbox that enables Start as Spectator

lusty dust
#

Yep, exactly where it normally is...right in front of me ๐Ÿ˜„ Thank you, sir!

high heart
#

was just digging through the leftover ShooterGame code in my game to implement InformAboutKill properly and found that it just calls this function on the local controller:

void OnKill() {
                ...
                FOnlineEventParms Params;

                Params.Add(TEXT("SectionId"), FVariantData((int32)0)); // unused
                Params.Add(TEXT("GameplayModeId"), FVariantData((int32)1)); // @todo determine game mode (ffa v tdm)
                Params.Add(TEXT("DifficultyLevelId"), FVariantData((int32)0)); // unused

                Params.Add(TEXT("PlayerRoleId"), FVariantData((int32)0)); // unused
                                                                          //Params.Add(TEXT("PlayerWeaponId"), FVariantData((int32)WeaponType));
                Params.Add(TEXT("EnemyRoleId"), FVariantData((int32)0)); // unused
                Params.Add(TEXT("EnemyWeaponId"), FVariantData((int32)0)); // untracked            
                Params.Add(TEXT("KillTypeId"), FVariantData((int32)0)); // unused
                Params.Add(TEXT("LocationX"), FVariantData(Location.X));
                Params.Add(TEXT("LocationY"), FVariantData(Location.Y));
                Params.Add(TEXT("LocationZ"), FVariantData(Location.Z));

                Events->TriggerEvent(*UniqueID, TEXT("KillOponent"), Params);
                ...
}

Can anybody @here tell me what the actual point of this is? Why would I want to trigger an event through the online subsystem?

#

docs pages for IOnlineEvents seems to have disappeared for some reason

glacial hamlet
#

So the reason for this is multiple: 1) Technical requirements for online play when using Xbox Live Online Subsystem . This is the Sectionid, GameplayModeId and others. It is a requirement because of how things get displayed in the OS outside of the game that is driven by these analytical events. 2) Events here must be associated to the correct player to do this, and thus you can ensure log-in & online play requirements by having the interface go through the OSS. The subsystem events effective go through gated authentication via user accounts to do this logging. 3) a good example of how to do data logging for your title. you could easily turn this data into a heatmap and analyze weak / hot spots of gameplay through a method as such

high heart
#

@glacial hamlet That all makes sense, but where would I actually receive this information? For example through steam. Hard to know anything without any docs

glacial hamlet
#

oh sure, so that'll come down to your OSS implementation. Basically you need to look toward a different method to get analytics I think than this. In this specific instance its to meet some xbox technical needs.

#

its uhh, kinda strange since you'd expect it to be part of the OSS (and it may interface with it) but they are sort of tangential...

#

i'm not 100% sure as I haven't done google analytics or other services yet myself

#

I can tell you with a platform like xbox it gets consumed by their APIs and you may be able to get that data through a backend website access but in general its consumed sort of into a black box for display to the OS.

bitter oriole
#

Steam does have an event system IIRC

#

Look to the achievements settings on the partner Steamworks site

glacial hamlet
#

cool, makes sense, its gonna vary per-platform but sounds like steam gives you decent access then

high heart
#

hmm, thanks for the tips guys

glacial hamlet
#

however it looks like almost every platform doesn't even implement the IOnlineEvents interface as part of the online subsystem :\

#

steam returns nullptr, so its gonna go through a different interface

high heart
#

๐Ÿค”

glacial hamlet
#

feels pretty specific to xbox in this regard from my knowledge

#

however, thats kinda good news because its free for you to implement lol in some form or another

#

for what its worth ยฏ_(ใƒ„)_/ยฏ

bitter oriole
#

Basically @high heart why do you want this for ? This is used to, for example, know players on your game do 123 kill on average, etc

#

If you want this kind of stuff you can implement it with your own service so that you don't have any constraints

#

It's just possibly not accepted on XBox etc

glacial hamlet
#

right

high heart
#

I just wanted to add a little kill logger but can't use the slate one because i'm in VR. Already mostly rigged up a UMG widget for it. Was just curious about what this code was supposed to be for

#

seemed suspiciously useless

glacial hamlet
#

ah okay, so you could just pipe that structure into whatever you've worked out to display via a widget component with your UMG setup, regardless of what the interface calls are doing

bitter oriole
#

ShooterGame is pretty strange overall, it does lots of stuff in really weird ways

#

I think it's because it's so old and no one cleaned it up since like 2014

glacial hamlet
#

hehe yes. we keep coming to that answer as we dive through it in certain ways, since it is still a strong basis for a project.

bitter oriole
#

I'd stay away from it as a basis, more like a database of stuff that might be helpful

high heart
#

lol i've noticed. starting a VR project with it was a ridiculous mistake but at this point I'm in wayy too deep

bitter oriole
#

The session stuff is horror

glacial hamlet
#

yea but it is tech requirement complete

#

and yea, that is one of the painful parts but easy to clean-up

high heart
#

I've definitely noticed some weirdness with the sessions... most notably that playercount is always 1. I've probably resolved the rest of it at this point

#

still, a huge pain in the ass. Is there a better sample to work off of?

glacial hamlet
#

not sure, there might be. their session usage is very idealized to the old school FPS style of server with drop-in / out, so late join is non-issue and no lobby

#

Might do better by yourself to truly understand what each piece of the mechanisms the engine provides via the session interface and then gut out their game-level logic. It's still hard to grasp what certain classes that do session work are truly meant for since there are multiple higher level wrappers around the ISessionInterface directly, some are for clients, some are for servers, etc.

high heart
#

Like i said I'm in pretty deep at this point with a released game. Already hacked in a VR lobby with seamless travel and additional session params and such, it's technically working... just a little quirky ๐Ÿ˜›

#

that old school style actually works pretty well for VR. just jump in, say hi, and wait for the host to setup/start the match

#

my issues with it are generally pretty obscure. most annoying is that occasionally your session will just fail to be advertised

#

i've looked into the advanced sessions plugin but from the looks of it it's just wrapping functionality for blueprints

#

(mostly)

heavy marlin
#

is FUniqueNetIdRepl persistant across disconnects?

thin stratus
#

If you have a subsystem active, yes

#

Well depending on the subsystems

#

Steam for example yes

#

That would be the SteamID of the player

copper sparrow
#

Hi,
For a game like BattleGround (Last Standing) we must use a dedicated server or is it possible to run game as listen server also we should change Onlinesubsystem to steam?

Actually, I would like to know who makes a Session in Battleground game mode?
I mean when a client makes a session and others join it so if server owner exit all game will be destroyed.

brittle sinew
#

It should be technically possible to use a listen server, but I'm not sure of its feasibility on a performance level

#

I can't imagine a 100+ player server is a negligible thing to host, so dedicated servers are probably your best course of action

#

(especially with typical home upload speeds being abhorrent)

bitter oriole
#

Online Subsystem isn't related to hosting, either

#

It's about matchmaking, not game hosting

#

Set it to Steam if you intend to use Steam, set it to something else if you want something else

copper sparrow
#

Thank you guys so much.
Gamesparks is a dedicated server?
What help can it do for us?

bitter oriole
#

It's a platform that does hosting, server-side software, also matchmaking IIRC

#

No idea how it meshes with UE4

thin stratus
#

Gamesparks doesn't host any servers

#

It's a data backend

#

For BR games you'll have to use Dedicated Servers

#

And probably cloud based hosting using Gamelift or so

#

Using steam or not isn't Important for that

worn nymph
#

Not entirely true gamesparks can host server instances but only if you use the realtime api and don't use unreal replication . Supports up to 50 people per instance. Not sure on scalability though or how many of these instances they allow you to use. Would have to contact support

Someone made a kit on marketplace doing just this

https://www.unrealengine.com/marketplace/fps-battle-royale-template

bitter oriole
#

For real-life indie projects that aren't backed by large teams, I'd recommend simple setups like renting your own VPS and using the Steam OSS with a regular UE4 dedicated server

#

It's not like your average indie project is going to need 10 servers

#

You should probably have a plan for that if it needs be, but unless you have an editor, your Steam game is probably looking at one server's worth of players

thin stratus
#

@worn nymph You sure? I never saw any point where I could upload actual servers

#

Also kinda sure now that amazon bought them it will try to Integrate into gamelift

worn nymph
#

You don't upload the server . You use their api . Players make a matchmaking request then it spins up the server instance for you and connects your players together . Think its Kinda like p2p hosting but with like a socket server in the middle handling player packets back and forth

thin stratus
#

But that has nothing to do with the act of hosting

#

You are not spinning up a server instance on their servers

#

So you still need to host your server somewhere

#

Also i haven't seen any server spin up code in their sdk

#

Matchmaking is just backend data. I used these functions together with gamelift often enough now

cerulean rapids
twin juniper
#

Friends Steam Dedicated Server seems to be on the stem servers but I want to connect as ip but it is not connected to the game IP is connected to the IP when the steam is activated when the system is disabled,
I just connect to Steama but I want to use it as IP

worn nymph
#

@thin stratus not really sure why your still arguing to be honest . you made an incorrect statement . i was just pointing out that it is indeed possible to the original poster and even showed a project that does exactly that . yet just because you cant find it in the SDK or havnt done it yourself you keep saying its not . guess you cant take being wrong . you dont host a server somewhere else gamesparks hosts it for you

#

" Host Server Support

A dedicated host server for handling communications between players in the selected game region supports higher player numbers than traditional PvP models."

thin stratus
#

I can't take being wrong? :D wth got into you

finite bison
#

i think you guys are talking past each other: yes, gamesparks hosts dedicated servers for you, but they are not a dedicated UE4 servers

thin stratus
#

Exactly my point

finite bison
#

though they are dedicated servers, just using gamesparks' own (non UE4) server software

thin stratus
#

Of course if you want to, you can use their Dedicated Servers and completely not use the ones form UE4

finite bison
#

though if it makes sense with networking built into the engine/framework is the other thing...

thin stratus
#

With 4.19 we should get a lot of cool extras that help DedicatedServers to allow 100 players

#

So I doubt that it's really needed

#

@worn nymph Since we kinda talked past each other, I'm sorry for spreading half info there.
However I would love you not to instantly attack a person. I love learning new things and it's not that I can't take being wrong. It's simply that my point was right.
We just didn't mean the same thing.

worn nymph
#

lol how did i instantly attack you . i said at least twice that they do host servers and you kept arguing/insisting otherwise just because you couldn't find it or didnt understand it .

"Gamesparks doesn't host any servers"
your exact words how is your point right ??

you didnt say gamesparks doesnt host dedicated servers but offers a cloud based solution you said ANY servers which is not true .

and then when i explained again you still insisted oh you must have to host somewhere else . thats not the reply of someone who loves learning new things .

or you would just been like oh cool i didnt know that thanks for sharing instead you wanted to keep arguing the point posting multiple times about it

thin stratus
#

Welp, you are right :P

worn nymph
#

and sorry if my replies are coming across snappy im tired and not feeling well lol

#

its not intentional to attack you. and we were both just trying to help . anyways sorry .

thin stratus
#

It's fine. You are right. I put all DedicatedServers under one word.
That's why my point is actualy not right.

#

"Love to learn" just means that I'm not against being proven wrong. That's why I ask if you are sure. :P

#

Anyway. Dinnertime!

winter gale
#

Hi I am new and I have a doubt. Can anyone help me?

pallid mesa
#

just write it

winter gale
#

I am trying to create a multiplayer game but when I find the session and open the level of the game my players doesn't replicates, I can only see the client player

#

I also don't know if my client joins to the host's game

#

And sorry for my english

thin stratus
#

Find Session should be followed by "JoinSession"

#

Otherwise you are probably not joining the session properly

#

That will already open the host map

winter gale
#

Yes it is but it doesn't seems to work

#

@thin stratus

thin stratus
#

Don't open the level

#

JoinSession does that already for you

winter gale
#

it doesn't load the map

#

@thin stratus

thin stratus
#

Try to check if the Lenght of the session array is > 0

#

And if yes

#

try to get 0 from that array and join that

#

I think your ForEachLoop stuff is wrong

#

Cause you never check if there are actually session

winter gale
#

I think that what you are saying is in the branch with the conditional "Session Found?"

#

@thin stratus

thin stratus
#

You are looping over the array

#

So you are grapping the last session in that array

#

If it's only one, then it's fine

#

But despite that

#

This here is enough

#

You don't have to do "OpenLevel" when you join

#

JoinSession already does that

winter gale
#

so i have to delete the foreachloopwithbreak?

thin stratus
#

Ah nvm. :D I'm half gaming while helping you

#

Brain ignored the break

winter gale
#

hahah

thin stratus
#

Loop is fine then

#

But as said, remove the OpenLevel

winter gale
#

I did

#

But when I play the game it doesn't load the map

winter gale
#

@thin stratus

winged badger
#

@winter gale whe troubleshooting network connection logs help more then anything else

winter gale
#

how i get them

winged badger
#

the stuff that prints in the Output window

#

also gets saved in Saved/Logs folder by default

winter gale
#

ok

#

there are a lot. which i get?

#

@winged badger

winged badger
#

the most recent one by date is the last one^^

versed socket
#

@thin stratus I just want to thank you again. My biggest motivation over the years with making mods and dumb scenarios in other games has always been the knowledge that I could show the dumb stuff I make to friends or others whenever I want. I just tried out that advice you gave me the other day and it worked perfectly. Knowing that I can make incremental improvements and then turn around to share it with friends and play multiplayer with them has re-invigorated my motivation and has given me extra inspiration to continue with my current project. THANK YOU

muted sigil
#

So I'm using blueprint and I want my player model to be different from everyone else's to signify that I'm a developer. What's the best way to do this? From what I've seen, there's no way to check IP/PC user name/etc. in blueprint so I'm about out of ideas.

fossil spoke
#

@muted sigil If your using Steam you can grab the Advanced Sessions Plugin and use your SteamID to identify you.

thin stratus
#

@versed socket Naaaw. (: Happy to help!

pallid mesa
#

XD

past urchin
#

Im not sure why but my Clients cant see what the server does or what they see between them when they attack. Ive implemented it so they could but it does seem like its running. Any thoughts

winged badger
#

can't really see much of anything off a single .cpp file

#

in any case, considering your Fire is a toggle

#

i'd wire the user input to send a ServerRPC to set some enumeration representing the firing mode on the server

#

then replicate that state and make clients match with OnRep function

#

that way you don't have to send a ServerRPC and notifications back to clients every firing interval, but only when the firing state changes

#

@past urchin

#

then your Tick can just decrement the FiringCooldown by DeltaTime and call Fire() + reset it if its < 0 , so you don't have to mess with timers either

pine forge
#

Anyone know what decent solutions exist out there for load-balancing a single playable "world" in unreal engine, if any? Obviously I can't vertically scale forever, so I'm trying to learn if there are ways to horizontally scale the server-side aspect that are well documented etc?

thin stratus
#
[2018.03.10-20.52.16:698][  0]LogOnline: Verbose: STEAM: Initializing Steam Game Server IP: 0x00000000 Port: 7777 SteamPort: 7778 QueryPort: 27015
[2018.03.10-20.52.16:731][  0]LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
[2018.03.10-20.52.16:731][  0]LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
[2018.03.10-20.52.16:732][  0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2018.03.10-20.52.16:732][  0]LogOnline: Warning: STEAM: Steam API failed to initialize!
[2018.03.10-20.52.16:732][  0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
#

Anyone an idea why this would happen? Steam binaries are copied from Engine to server binaries folder

#

It's the only server we start

thin stratus
#

nvm

#

Steamappid file was missing

#

I thought that gets auto generated in dev builds

#

Doesn't seem to apply to DediServers

#

Guess I forgot that >.>

hidden thorn
#

He says further down where the answer is marked -> "it seems to be happening becouse i use the function "set master pose component" on the server. (so fair it didn't fix the issue in my real project)."

#

I did comment out my SetMasterPoseComponent from BeginPlay and I do now have that issue anymore.

#

Is this normal?

#

Should this only be called on the client?

winged badger
#

dedicated server?

#

if so, there is little point in running an animation on it

hidden thorn
#

ListenServer

#

If that's what is called?

plush bluff
#

@ruby epoch - Did you ever figure out what caused your client spectating another client stutter / lag? Or anyone else know?

ruby epoch
#

Yep

#

I kinda fix it

#

with manually rotation

#

or kinda that

#

I can show you how a bit later

graceful cave
#

what are some good options for hosting services to host single instance sessions with 10-12 players?

ripe cypress
hidden thorn
#

@winged badger What I have is a clothing system (like), I have a hat, top, bottoms and footwear. They all work when I set the mesh and material except the top and I am changing them in the order that I listed them above.

#

If I comment out the top mesh and material the game doesn't crash if I put it back in it does

plush bluff
#

@ruby epoch That would be great. I'm experimenting with solutions and google hasn't been of help. After you said manual rotation, i tried to apply event tick -> applying rotation via server and multicast which didn't help. Seems like that would be costly as well.

vivid socket
#

hey everyone

#

i wanted some info on MP in UE4

#

the CCU and all that stuff

twin juniper
#

does anyone know what would happen if to one player (the host) would connect 50 players (clients)? would host crash or have bad performance or something of that sort?

cunning stirrup
#

Hello

#

Does anyone know how to make a replicated pawn movement for a Floating Pawn possessed by a player ?

#

because if I add network latency then it ends up moving in a loop because of the server displacing the player even though I set replicate movement off

winged badger
#

@twin juniper depends on how well you did your networking

#

i had no problem with 8 players and 100ish monsters combined with a host on 500kbps connection

cunning stirrup
#

the problem is the way to handle that

#

how do you replicate the movement from the client to the server and then to the other clients without moving the base client

winged badger
#

you don't, server is the authority here

#

and clients should be synced

cunning stirrup
#

yes

#

bot how do you make it so that clients can move with a prediction and that the server doesn't always correct them when they are possessing a pawn, not a character ?

winged badger
#

pawn or character doesn't make much of a difference

cunning stirrup
#

don't characters have that built-in ?

winged badger
#

character just has a more complex movement component

#

allowing you to jump, crouch, swim... etc

cunning stirrup
#

ok

twin juniper
#

well you got it with 8 players

#

but with 50 players

winged badger
#

2 things that can knock you on your arse: bendwidth and reliable buffer overflow

#

epic seems to have doone ok with >50 players

twin juniper
#

but if its not dedicated, but player is a host?

cunning stirrup
#

so, how would you go about networking pawns' location possessed by players

twin juniper
#

will that one host player's game die?

cunning stirrup
#

Right now i'm using a RPC that runs on server

winged badger
#

as long as you have the bandwidth to keep clients up to date, don't use RPCs when you don't have to and the host has the CPU to run all that

#

you would be fine

#

risky setup tho, if host loses connection, there is no way to recover the game

twin juniper
#

so if i do shooting, then i have to do it on client not server and then replicate to server?

winged badger
#

for example

#

if your fire is a toggle (like automatic weapon)

#

your InputActionFire would send a Server RPC that would set the state EFiringState::Firing

#

server would replicate that enumeration variable

twin juniper
#

i do it with gate and then a replicate to server for Open and Close

winged badger
#

and OnRep clients would start simulating the fire

#

and your InputActionFire released would send a Server RPC to set EFiringState::Idle

#

for example

twin juniper
#

ok

winged badger
#

that way you'd send single RPC when firing state changes

#

instead of one for every bullet

#

@cunning stirrup i'd set bReplicatesMovement = true;

cunning stirrup
#

ok but then how do I send the movement from the player to the server ?

winged badger
#

pawn or character, their movement should be replicated, no matter if they are possessed or not

#

that it does for you

cunning stirrup
#

ok so the owner hs the authority ?

winged badger
#

i believe ConsumeInputVector() is a Server function

#

can't say i read the MovementComponent's code recently

twin juniper
winged badger
#

first bit yes

twin juniper
#

oh i see now

#

it will do gate on server

winged badger
#

it is on server

#

but with this setup you have say FiringCooldown = 2sec

#

you decrement it on Tick

twin juniper
#

and then add a timer that loops that will shoot if firing

winged badger
#

and if your FiringState == Firing, your FiringCooldown < 0 then you call Fire() and reset the Cooldown

twin juniper
#

hmm

winged badger
#

and as Tick executes on both clients and server

cunning stirrup
#

ok it works thanks a lot

twin juniper
#

so i have to do firing logic from event tick?

winged badger
#

all the clients will automatically Fire at the cost of 1 byte replicated variable

#

with this setup yes, you need to check the cooldown there, and call Fire(0 if its ready

twin juniper
winged badger
#

(you decrement the cooldown by DeltaTime ofc)

#

ok, now you just need to implement the cooldown, and you're set

twin juniper
#

should i do it in a function instead of custom event?

cunning stirrup
#

Can the owner of a pawn change a OnRep variable ?

winged badger
#

or it will fire every tick

twin juniper
#

i will add cooldown

winged badger
#

that you do however you feel like its more readable

twin juniper
#

k

#

function then

cunning stirrup
#

tbh I'do the firing using a Delay node

winged badger
#

with just a delay here, it would fire every tick

twin juniper
#

oh does the local variable stay the same on the next call of function or it resets?

winged badger
#

just with a delay from when he presses the button

#

resets

cunning stirrup
#

no, using a delay loop and a gate that is opened/ entered and closed using RPC

winged badger
#

but you can use a global one

#

ah

twin juniper
#

oke

winged badger
#

when your ammo hits 0 for example

#

you can set FiringMode::Reloading

#

(its why i suggested an enumeration)

twin juniper
winged badger
#

then OnRep_FiringState you could trigger an animation for reload

#

on the clients

twin juniper
#

so i need to do the firing, reloading logic in OnRep?

winged badger
#

its one path to take

#

out of many

twin juniper
#

and onrep will trigger only when variable is changed?

#

or it will trigger every tick

cunning stirrup
#

I have a problem : When using Replicate Movement, the player can move but his movements aren't being sent to the server

twin juniper
#

or make enum with OnRep that will change "Firing" and "Reloading" booleans depending on state

cunning stirrup
#

so the others don't see him move

winged badger
#

only when its changed

twin juniper
#

okay

#

then i will change booleans inside that OnRep

cunning stirrup
#

I'm using AddMovementInput to move the pawn btw

twin juniper
#

Enum and Byte take up same space?

cunning stirrup
#

an Enum is a byte

twin juniper
#

k thanks

cunning stirrup
#

you can use == for your enums

#

so you don't have to do it blindly

twin juniper
#

i used byte

cunning stirrup
#

you don't have to

twin juniper
#

because im lazy to make enum

#

xd

#

and its easy for me to remember

#

0 = idle

#

1 = fire

#

2 = reload

#

by logic

cunning stirrup
#

you won't remember that the next time you work on it

twin juniper
#

i can add a comment on there

winged badger
#

it takes you a minute to make a blueprint enum

twin juniper
#

i already made it like i want

#

with byte

#

๐Ÿ˜›

winged badger
#

fair enough

twin juniper
#

but everything else is fine?

winged badger
#

well, test it, see if it works, if it doesn't, try to find a problem, and if you can't ask here

twin juniper
#

k

#

thanks for help

twin juniper
#

@winged badger that works, atleast shooting works

#

thanks

graceful cave
#

anyone know why i cant connect to my steam dedicated server running on a vps while the vps has steam running?

#

closing steam on it allows me to connect via ip

#

but i get a connection timeout if its running

#

if i host it on my own machine, my friends can connect + see it in the ingame server browser while i have steam running

quick sigil
#

hello, someone one have some knoledge in c++/network here ? a problem will make me crazy af

#

i want the player to spawn a projectile and everyone one should see it

#

if the server fire, it's fine, client and server see it

#

but is client fire

#

only the client see the projectile

#

feel free to ping me if you get the solution ๐Ÿ˜ฆ

thin stratus
#

You should only spawn on the server

#

Otherwise you'll duplicate the projectile on the local client anyway

vivid socket
#

how many concurrently connected users can UE4 MP have?

#

the free one

#

what is the maximum limit

#

can it host more than 1 server?

hidden thorn
#

@vivid socket "concurrently connected users" I don't think there is a limit, pubg has 100 and that's that. More than that would mean more resources.

#

I am not sure what you are asking here: "can it host more than 1 server?"

vivid socket
#

i mean can i have multiple servers running with around 10-12 connections?

#

like csgo

#

for ex.

#

and how much does it cost

#

im pretty sure it isnt free

brittle sinew
#

Hosting is completely up to you.

#

There's nothing that inherently costs money in UE4.

vivid socket
#

oh

brittle sinew
#

You can host it on a null subsystem on your computer and that'd be free, but that's probably not your best option.

vivid socket
#

just the 5% revenue right?

#

how powerful is the built in networking

brittle sinew
#

If you want some sort of matchmaking, you'll either need to use a third-party service (money) or write your own, which would need to be hosted on a server (money)

vivid socket
#

hmm

brittle sinew
#

Yeah, there is the 5% cut of revenue, but that's not related to MP, that's sales.

vivid socket
#

ok

#

so what to do if im indie

#

i dont have enuf to pay 60-70$ every month

brittle sinew
#

To be completely honest, in that type of situation I would suggest a listen server model.

vivid socket
#

what does that mean?

brittle sinew
#

You would have users host the server when they play, rather than having dedicated servers that you run

vivid socket
#

yea how to implement that

brittle sinew
#

There's a lot less backend infrastructure involved with it

vivid socket
#

yea ik about it

#

but how to implement it

#

this is how community servers work in csgo

brittle sinew
#

Not really, no.

#

In CS:GO, you have people host servers, but they are still dedicated servers (for the most part)

vivid socket
#

oh

#

myb

brittle sinew
#

In a listen server model, you have one player act as the server, to whom the other players connect

vivid socket
#

i see

#

so when i press create, i become a server

#

when i press join

#

i join some1 else

brittle sinew
#

Yeah.

vivid socket
#

but are there tuts to help doing this?

brittle sinew
#

You would still probably want some type of matchmaking service, whether it's in-house or third-party, so people don't have to manually forward ports and trade IPs and stuff

#

UE4 supports it out of the box; look for some basic MP tutorials.

vivid socket
#

o nice

#

is the matchmaking good?

#

i'll take care of that later

#

thanks for your help

#

:)

#

is there a steam SDK for matchmaking?

#

i heard of it once

brittle sinew
#

Yes, you can use Steamworks if you plan on releasing on Steam, which features matchmaking

vivid socket
#

yea ofc we'll release on steam

#

is it paid?

hidden thorn
#

You can also have dedicated servers but have the users pay for them, in that situation you can't really have matchmaking but it obviously depends on the type of game you are making.

raven rapids
#

I have a project where I need to share character data between servers. What's the best way to set that up in UE4?

hidden thorn
#

I want to say MySQL but not sure since I am not sure what sort of data you want to share

#

But anything that is servers can connect to and upload/update/get data from should be good

raven rapids
#

Basic list sof inventory items, xp, that kidn of thing. Numerical data, essentially.

hidden thorn
#

I think that could be ok

raven rapids
#

So from a blueprint perspective, is there some kind of MySQL node or something that I can plug an address etc in to send and receive the data?

#

Or maybe a higher level interface?

hidden thorn
#

I don't think there is anything MySQL related but more like connect to a host, login info, and so on, I might be wrong. Just google ue4 connect to mysql blueprint

west rapids
#

i think there's a LowEntry BP set on the marketplace for databases

raven rapids
#

So really I'm a C/C++ programmer, and I know how to write a network interface of my own. If I can do that outside of ue4 is it going to be pretty simple to write my own rather than pay for one?

#

We're talking about like 20 lines of C++ here.

#

Or is there some more convoluted step that's going to make that not worth my effort?

hidden thorn
#

Maybe security issues

raven rapids
#

Okay, thanks.

gleaming bobcat
#

How often are you using "unreliable" ?

#

I don;t have much things happening in the game but If I want to play animation to all other clients via NetMulticast it's called only on server side but not to other clients

#

I thought that "unreliable" means that's is not guaranteed only if not overhaul or something.

thin stratus
#

That's correct

#

Reliable tries to make sure that the call really arrives

gleaming bobcat
#

alright so for playing animations I should set reliable then

#

otherwise it looks weird

fathom ibex
#

Hi! We're making a multiplayer game where you can throw props around and are getting latency / lag transmitting all the prop positions (e.g: X, Y, Z) to players. What's the best way to deal with this?

thin stratus
#

Prediction

#

Keep moving the object based on the previous sent data

twin juniper
#

hey guys

#

I recently updated my project from 4.15 to 4.18 and my steam dedicated server does not work properly

#

I copied the needed files for steam from steamworks and steam folder, the ones that need to go into Win64 folder in dedicated server

#

and when I want to start the server it gives me this error

#

I just click OK or X and it just closes this window and work normally

#

but I need to do something so this windows does not pop up

#

window*

winged badger
#

that folder looks suspicious

#

4.15/...

faint fjord
#

Okay so i have an issue where the event is called, but when it actually runs the event, it doesnt run it. So it calls Client Destroy Battery, but when it actually runs Client Destroy Battery, it doesnt run Destroy Battery

winged badger
#

anything like "no owning connection for..." in your output logs when it happens?

magic helm
#

Maybe call destroy actor, AFTER setting the battery capsule's visibility as well...

#

Also try calling destroy actor from the server, it should destroy it

winged badger
#

it also needs to be done in an object owned by the player controller

#

and replicated actors destroyed on server will get destroyed on clients, no need to do it separately

#

and multicasts for this are just... bad

weary axle
#

any way to check a replicated event which player index sent it without explicitly adding it as an argument (that might be altered by malicious players)

high heart
#

just implemented replays in my game based on the tutorial and on playback i just get this warning and a frozen game:

LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date DemoNetDriver: DemoNetDriver

what is the meaning of this? anybody @here know?

peak idol
#

Guys please tell me what you think

vivid socket
#

@peak idol looks pretty nice

#

the animations and movement looks properly synced

peak idol
#

@vivid socket thanks a lot ๐Ÿ˜ƒ

vivid socket
#

:)

#

np

indigo root
#

im not sure whether i am identifying the bug right, is it possible for the "add to viewport" node to add the widget to the wrong viewport? (running 2 instances on same machine)

glacial hamlet
#

possible but very unlikely due to how widgets get the local player owner

#

can confirm that by running as seperate processes

#

(via editor advanced play options)

indigo root
#

untick "run in single process"?

glacial hamlet
#

yup

#

and then bump player count

indigo root
#

that removes the player count box...

glacial hamlet
#

hmmm? thats odd, i do that everyday

indigo root
glacial hamlet
#

oh, do selected viewport instead of new PIE window

#

should give it back

#

the other way to confirm would be using the widget reflector, but in all likelihood its not being sent to the wrong viewport

indigo root
#

same

#

no option o.o

#

ohh im stupid

#

it was set "play offline"

glacial hamlet
#

o haha ๐Ÿ˜ƒ

#

good luck! i'm out for the nite

indigo root
#

actually ill just use "launch game"

worn nymph
#

@peak idol looks cool . love the painball splatter effect. how is the mulitplayer hosted ?

peak idol
#

@worn nymph host and client you can go dedicated too

real olive
#

if I have a replicated TArray<FSomeStruct> and I change a member of one of the structs, will that be replicated? Or only if I modify the array?

ancient ruin
#

heho ^^ just a quick question regarding steam , is it possible to test Steam sessions in editor ? When starting a Standalone window in editor Steam pops up and the overlay works also in my lobby i get the correct Steam name + image ... but for some reason i can't connect . Join Session reports success but no map change and the server does not report a joined player

cunning stirrup
#

How can we replicate the movement of a pawn from a client to the server ? The pawn is possessed by the client. I've got Replicate Movement and Actor Replicates set to true.

twin juniper
#

how to replicate a variable from gamemode to UserWidget or Character BP

cunning stirrup
#

Only the server has the Gamemode

#

you need to get that variable from the server using the server's representation of your Character BP then pass it to a replicated var

twin juniper
#

so i have to do the timer in character BP and with Time value set to replicated?

cunning stirrup
#

yes

#

in server-side

twin juniper
#

oh it works

#

thanks

cunning stirrup
#

you're welcome

twin juniper
#

what is then gamemode made for may i ask

cunning stirrup
#

uh

#

Global variables

#

Spawning players

#

and overarching rules

twin juniper
#

ok i will need player spawning, will ask that later when i need it

icy nacelle
#

Created a system for nameplates above the player's heads. Trying to make it that they'll update when a player changes their title on the nameplate. Its not updating for other clients for some reason. I'm guessing I'm just doing something wrong. I'm casting to all the players in the server and trying to run a function on each client in the server. Is this the wrong way of doing it? Here's what I've got so far.....

cunning stirrup
#

@icy nacelle Use a replicated OnRep variable for the tag on the nameplate and use a RPC to send the updated name to the server so it can change the variable. Then, on the OnRep, update the nameplate

icy nacelle
#

Ah thanks bud

#

How would I send it to the server?

#

I think thats the part that confuses me .

cunning stirrup
#

using a replicated event

#

RPC

#

creatre a custom event and set it to run on server

#

reliable

#

also if you want to check if you're the player that controls the pawn, there's the IsLocallyControlled node

#

@icy nacelle Did that work out ?

high heart
#

hey, I'm running into a weird problem where IsLocalController() returns false on clients during pawn possession. It seems to only happen on the first spawn. From what I've seen it seems like this is happening because NetMode doesn't get set until a few ms later. Does anybody @here know how to trigger something when it does get set?

winged badger
#

GameMode::PostLogin is okay for calling RPCs on the PC

#

if you want to be sure Pawn is ready, try OnPossess(ed)

icy nacelle
#

Thanks @cunning stirrup ill give it a go after I finish dinner :)

high heart
#

@winged badger I am using OnPossess(ed). The problem is that IsLocalController is wrong on the first possession. Do pawns get spawned before PostLogin for some reason?

winged badger
#

you also have a GameMode::HandlePlayerStart you can override

#

and on clients Controller[0] will always be local, as its the only one

#

on listen server, i am not sure that is the case

#

on dedicated ofc, there is no local controller

high heart
#

I'm talking clients. but how would I even detect whether or not I'm a client at that point? Role != ROLE_Authority doesn't even work like it usually does

cunning stirrup
#

@high heart OnPossess is only triggered on the server if i'm right

winged badger
#

as for pawns, they can be there before the PostLogin if they are not spawned by the controller

#

but pre-placed in a level, for example

#

pretty sure GameMode::HandlePlayerStart is where their creation starts if they are spawned by their controllers

high heart
#

@cunning stirrup OnPossess is definitely happening on my clients

#

๐Ÿค”

#

thanks guys

cunning stirrup
#

Then the pawn is not fully possessed by the client when the event is triggered

high heart
#

what do you mean by that?

graceful cave
#

how can get an event in blueprint like PostLogin in the gamemode that runs when the client loads the new map with seamless travel?

winged badger
#

there is NotifyServerWorldLoaded

#

in controller i think

graceful cave
#

doesnt seem to return anything

high heart
#

@graceful cave I think the C++ function you're looking for is PostSeamlessTravel in the PlayerController. I'm not aware of any blueprint hooks into that however

graceful cave
#

how can i create a C++ class that works with my current player controller blueprint?

winter plover
#

You can expose properties and funcs with the UPROPERTY and UFUNCTION macros

#

that makes them visible to blueprint stuff

graceful cave
#

is there a tutorial on that

#

ive done 0 c++ in ue4

#

except copying and pasting to get a dedicated server working

winter plover
#

just two basic google searches

graceful cave
#

but how can i create a c++ player controller class that interacts with my current blueprint playercontroller parent class?

winter plover
#

well you gotta generate it first from within the editor

#

then you can make your blueprints parent class the c++ one

#

and it inherits whatever you put into it

graceful cave
#

ill give that a try

#

thanks

winter plover
#

as far as I know its not possible to make blueprint classes parents to C++ ones tho

high heart
#

@graceful cave what you're going to want to do (I think) is to override PostSeamlessTravel in a C++ class, then in your overriding function call your own UFUNCTION marked with BlueprintImplementableEvent

#

then in BP you can just implement the function and you're golden

graceful cave
#

trying to figure that out now but i have no idea what to actual put in this c++ class

high heart
#

Something like this:

void ASatansPlayerController::PostSeamlessTravel() {
    Super::PostSeamlessTravel();
    BP_PostSeamlessTravel();
}
#

then in SatansPlayerController.h

    /**
    * Called after this player controller has transitioned through seamless travel, but before that player is initialized
    * This is called both when a new player controller is created, and when it is maintained
    */
    virtual void PostSeamlessTravel() override;

    UFUNCTION(BlueprintImplementableEvent, Category = Travel)
        void BP_PostSeamlessTravel();
winter plover
#

are you manually making new cpp files?

graceful cave
#

yeah

winter plover
#

because you prolly shouldnt

#

let UE4 do that for you

graceful cave
#

well i generated it from the content browser

#

a player controller class

high heart
#

that should be correct

winter plover
#

okay nvm then

high heart
#

^^^see code. that should do everything you need

graceful cave
#

thats the whole thing atm

high heart
#

oh, those go in the .h file

graceful cave
#

ohhh i see

high heart
#

then the first thing i posted goes in the cpp

winged badger
#

generated.h include is missing

graceful cave
#

so the second part that goes in the header

high heart
#

@winged badger that's a cpp file

graceful cave
#

does that go where GeneratedBody() is?

high heart
#

generated.h should not be in your cpp file

winged badger
#

ah, didn't look like it ๐Ÿ˜ƒ

#

with declarations

high heart
#

@graceful cave yes it should go under the GENERATED_BODY() line. I'd also recommend adding public: just to be safe

GENERATED_BODY()

public:
#

then the .h code

winter plover
#

So I also actually have a problem to solve atm

#

in my FPS project I have some functionality to carry around physics props

#

it used to work fine until I decided to simulate some lag

#

now the local simulation and the serverside replication clash alot when moving stuff around

#

I have since tried to find a way to disable the movement replication for this specific prop for the duration it's being held

#

ie. the server and the client moving it independently

#

I have tried overriding IsNetRelevantFor(...) although with no success

#

SetReplicateMovement(...) had no effect either

#

or not the desired one atleast

high heart
#

been there, it's a pain in the ass. presumably you're using a physics constraint or something?

winter plover
#

yea the physics handle

high heart
#

is this a VR project?

winter plover
#

nah just plain FPS

#

so I cant use attachments

#

because I wanna keep collisions

#

atleast not for the first person view

high heart
#

It's written with VR motion controllers in mind but the nitty gritty stuff should be more or less the same

graceful cave
winter plover
#

mhmm k cheers

#

ill be checking it out

graceful cave
#

im assuming it will be fine once it is overridden in the blueprint?

winter plover
#

yea

#

you dont needa define BlueprintImplementables

graceful cave
#

going through with the potential fixes just generates a function in the cpp

winter plover
#

VS just spits out a warning

#

because it is expecting stuff there

#

but the macro will take care of that

high heart
#

yeah VS doesn't know what it's talking about. shouldn't be a real issue

winter plover
#

in general take VS warnings with a grain of salt

graceful cave
#

got it

#

thanks for all the help

winter plover
#

as long as it compiles it shouldnt matter too much

high heart
#

๐Ÿ‘

#

good to hear, good luck with your day

valid talon
#

not sure if here is the right place but i am having and issue in custom event spawning in an actor and setting a variable on mycontroller. but when i get the variable after i call the custom even it is none but when it triggers again i get the first variable. Ie spawn actor A then get it i get none then spawn actor B i get Actor A on the second time.

winter plover
#

Okay so I decided to disable replication entirely on my phys props for experimentation purposes

#

and for soooome reason the physics handles still jitter on movement

#

clientside

#

theoretically there shouldn't be any latency involved anymore right?

high heart
#

@winter plover theoretically, i'd think

#

i have noticed though when using those GripMotionControllers in keyboard/mouse mode i also see that jitter. maybe an artifact of the way mouse movement is

#

no jitter when tracking motion controllers though. perhaps @heady merlin could offer some insight here

#

wait, @winter plover do you get the jitter in offline mode?

solar halo
#

I feel like the satan guy is trolling. ๐Ÿค”

heady delta
#

1 john 3:8 I feel like the satan guy is trolling

twin juniper
#

how to set player name in widget BP?

magic crest
#

Hey. Is there an event or notification that happens on the client which says the connection is ready to be used?

#

I'm trying to make an RPC call as soon as the object spawns, and calling it in beginPlay throws a warning that no owning connection on object. If I make a small delay, i avoid the warning. I'd like to know the specific moment this happens, not trying to 'guess' with a timer.

twin juniper
#

How can i make a score system like - if projectile hits something, player state of player who spawned the projectile gets +1 score?

#

I already have AddScore function that adds score, but i need to get the player state from projectile BP

pallid mesa
#

The Projectile should have a weapon as an owner, and said weapon should have a pawn as an owner @twin juniper

twin juniper
#

but i dont have weapons

#

i have just 1 type of shooting

pallid mesa
#

Then the projectile owner

twin juniper
#

and 1 projectile

winter plover
#

@high heart I dont get any jitter on a listen server

#

But I do when I disable replication entirely for my props

#

@twin juniper track the score in the playerstate

#

any damage that is inflicted you wanna keep track of which character did it

#

then +1 the score field in their playerstate, which you will have to subclass

pallid mesa
#

Thats what he said

#

He just needs the owner of the projectile, and from said owner, he should get the PS, would be ideal to cache it as a good practice.

winter plover
#

yea I dont think theres any other way really

#

either cache the owner or the weapon itself

#

which should also have an owner reference ideally

twin juniper
#

but how to get the character from the projectile

#

owner?

winter plover
#

you will have to manually cache it

#

ie. when you shoot it, tell it who shot it

#

so that when it hits something you can score properly

twin juniper
#

so add a variable expose on spawn with which character spawned it and set it to self on spawnactorfromclass?

pallid mesa
#

You need to set the owner on the projectile when you spawn it

winter plover
#

something like that yea

pallid mesa
#

You dont need to add any variable

#

It is already one that will make it for you

#

If you use the node "SpawnActorFromClass"

twin juniper
#

i use that node yeah

pallid mesa
#

You will see an input put that says "owner"

twin juniper
#

yes

pallid mesa
#

Just set the owner there

twin juniper
#

to character

#

"self"

pallid mesa
#

Yeah, and now when you get the owner on an outer

#

Will be set to that