#multiplayer

1 messages ยท Page 308 of 1

brittle sinew
ocean dust
#

I need a different PlayerController in the new level

brittle sinew
#

Then that won't be something you want to use seamless travel for ๐Ÿ˜›

ocean dust
#

Wait wait wait

#

so I can't use Steam multiplayer without seamless travel

#

but seamless travel doesn't swap out PlayerControllers when travelling?

brittle sinew
#

I'm not really sure about Steam and non-seamless travel, but it is intended functionality for the PlayerControllers to persist

#

Does using ClientTravel not work with Steam? I haven't tried integrating it, I have no idea

obtuse zinc
#
// // This is when I spawn it and activate the projectile on the client
Print("CLIENT ROTATION:   " + ShootDirection.ToString());
Rocket->LaunchProjectile(ShootDirection);
Print("CLIENT SPAWN:   " + Rocket->GetVelocity().ToString());
...
// This is when I spawn it and activate the projectile on the server
Print("SERVER ROTATION:   " + ShootDirection.ToString());
Rocket->LaunchProjectile(ShootDirection);
UGameplayStatics::FinishSpawningActor(Rocket, ProjectileTransform);
Print("SERVER SPAWN:   " + Rocket->GetVelocity().ToString());

So shootdirection is the same, but once I spawn and activate them, the GetVelocity is a different value

ocean dust
#

I've made some changes (disabling seamless travel) and will report back on results

#

I'm pretty stunned tho: isn't Epic supposedly creating Unreal Tournament and Fortnight and all that?

brittle sinew
#

Well, not supposedly ๐Ÿ˜›

ocean dust
#

I swear those games are online and multiplayer

#

They need to move been levels, right?

#

I just don't understand why this seems so fragile and unsupported

brittle sinew
#

You could always see how UT does it then ๐Ÿ˜›

ocean dust
#

Good point

#

I'd bet my left kidney that's all in C++ tho

#

and they will just say "BLueprint is for noooobz"

brittle sinew
#

I mean, when you're working on a project of that scale I just think BP isn't realistic to use

#

But either way, yeah, it's probably mostly in C++

#

@obtuse zinc is there any particular reason you're doing that two part spawning? I haven't used it myself, so I don't know if there's something weird with it

ocean dust
#

Well, when distributed version control hasn't worked with the engine for 14 major updates, yeah Blueprints is difficult to collaborate in

brittle sinew
#

(and I was under the assumption that that Spawn log was location, not velocity, and those two velocities aren't parallel or even close to it, odd)

obtuse zinc
#

the only reason why i have the spawning on the client is because i am just testing to see if i can figure out why its not shooting in the right spot lol

#

i took it out when i made the server one, but it back in for testing

ripe cypress
#

anyone have an easy way or just a way to set playername and access it anytime anywhere ?

ocean dust
#

From other clients?

#

@ripe cypress ^

ripe cypress
#

for a kill feed and display above head and for saving

brittle sinew
#

@obtuse zinc I meant the Begin and Finish spawning, I haven't seen that used for a particular reason before really

ocean dust
#

PlayerState seems like a good place to put that kind of data

#

@ripe cypress PlayerState is replicated to all Clients

ripe folio
#

Quick Q for the networking eggheads - how have/would you typically handle having a 'game lobby' like a classic RTS? Just a pre-match state in your server's code or some other networking layer? I am doing the server outside of UE4 but thought some similar logic would apply ๐Ÿ˜ƒ

brittle sinew
#

@obtuse zinc you're launching and then finishing spawn, which changes its position

#

I wouldn't really mess with that, you can just set the MovementComponent to not auto activate

obtuse zinc
#

Yeah I do have that set. Okay ill try spawning and then activating the movement component and see what happens

brittle sinew
#

Yeah, I would just try it with SpawnActor

#

That still wouldn't explain the discrepancy in X/Y velocities between server and client though, that's really weird

obtuse zinc
#

thats what the client demo one i have uses, and im actually not sure why i didnt do that for the server

#

UGameplayStatics::BeginDeferredActorSpawnFromClass

#

im using that

#

i couldnt find documentation on it anywhere

brittle sinew
#

Why?

obtuse zinc
#

just that its in shootergame

#

how they spawn their rockets

ocean dust
#

Negative: ServerTravel <Mapname> is not working for my tests with seamless travel OFF

brittle sinew
#

@obtuse zinc what does LaunchProjectile do by the way?

#

And are you overriding PostNetReceiveVelocity like the SG example?

#

@ocean dust are you having the clients travel to the new server URL manually? I believe they need to do that

ocean dust
#

I don't understand what that means

#

I am using the Create Session and Join Session nodes to connect the two players

#

ServerTravel <Mapname> on the listen-server does not load the new map for both players

brittle sinew
#

Yes, and I don't think it's supposed to with sessions

ocean dust
#

Oh

brittle sinew
#

You have to tell the clients to call a method to go to the new server session

ocean dust
#

Then how do I change maps for both players?

gaunt kestrel
#

I think part of our plugin broke cause I can't find out why client can't move

ocean dust
obtuse zinc
#

@brittle sinew yeah I'm overriding it like in the example.
This is my launch function

void ARocket::LaunchProjectile(FVector ShootDirection)
{
    MovementComp->Velocity = ShootDirection * MovementComp->InitialSpeed;
    MovementComp->Activate();
}
ocean dust
#

OK

#

So I got it to work

#

Somehow

#

I prayed to Gabe Newell

#

and it worked

swift plover
#

๐Ÿ™Œ

obtuse zinc
#

@brittle sinew FYI, switching over to SpawnActor worked. Not sure why the other one wasnt working. thanks for your help man.

brittle sinew
#

@obtuse zinc hey sorry I just kinda bailed haha, but good to hear it works! I'm not sure why Epic uses that two part spawning to be honest

thin stratus
#
Deferred Spawn

An Actor can be Deferred Spawned by having any properties set to "Expose on Spawn."

- SpawnActorDeferred - meant to spawn procedural Actors, allows additional setup before Blueprint construction script
- Everything in SpawnActor occurs, but after PostActorCreated the following occurs:
-- Do setup / call various "initialization functions" with a valid but incomplete Actor instance
-- FinishSpawningActor - called to Finalize the Actor, picks up at ExecuteConstruction in the Spawn Actor line.
brittle sinew
#

Yeah, I mean I know generally what it does, I just don't know why they needed to use it when the only thing they were really doing was setting the velocity, when the movement component could just be set to not autoactivate

#

At the same time though, I don't know why it would break it

#

So ยฏ_(ใƒ„)_/ยฏ

versed socket
#

@ripe folio that's a nice-looking UI, my man. I recommend making all of the important buttons use that faded green color so that they stand out more and are more obvious to the player.

fresh saddle
#

@ripe folio try using Networking Beacons. That's what's used in UT

red ledge
#

what's is the best way to make a little round shop in multiplayer?

#

I have a struct with all the stuff you can buy

#

the problem is that the shop is placed in the level so the player doesn't own it

#

so my idea is to have a function on the shop with Buy(APawn* Buyer, FItemStruct Item) and make that call something like Buyer->AddItem(FItemStruct Item)

#

so is that enough?

fresh saddle
#

Best to have items stored as an enum

#

The shop would have a struct for its data, so like the struct has the item type, amount it costs, how many it owns etc

red ledge
#

yeah but I'm generally asking about the best way to handle this in a multiplayer setting

#

like would I take the money on the shop or the player?

#

it logically should be on the shop but I remember having funky behaviour with level actors since no player owns them

fresh saddle
#

Well the server owns them. The server should take the cash from the player

untold cipher
#

When setting 2 players in the Unreal Editor and launching it. Should they have separate controller ID numbers?

obtuse zinc
#

Thanks @thin stratus

#

Would anyone know why my characters cant jump when im running on a dedicated server? lol. Listen server it works fine

#

Nvm no it doesnt, only listen server player can

worthy wasp
#

how are you jumping?

#

@obtuse zinc

obtuse zinc
#
GetCharacterMovement()->AddImpulse(GetActorUpVector() * JumpForce, true);
#

Should I be moving the jumping to the server?

worthy wasp
#

why not use the Jump command?

#

attached to input

obtuse zinc
#

Because I have a lot of logic in my jump function. Basically my jump button also controls sprint

worthy wasp
#

well that doesnt make sense

#

how can you have sprint + jump tied together?

obtuse zinc
#

You cant sprint without jumping first

nova wasp
#

Nothing stopping you from having conditions on whatever input triggers them

worthy wasp
#

either way - i know the CharacterMovementComponent is replicated by deafult

#

so NATIVE fucntions inside this component = replicated

#

IE: Jump is one of those

#

now... because you've circumvented the MovementComponent....

#

you need to add in your own replication

#

Character->Jump()->ServerRequestJump()

obtuse zinc
#

Ok ill work on that, thanks

nova wasp
#

And it has a OnLanded function so you might be able to see if they can sprint after that?

worthy wasp
#

i would highly suggest usin the JUMP() method in CharacterMovement - you can add any code you want inside of it

#

sipmly put: You're then relying ont he NATIVE REPLICATION that happens inside the component that is replicated by deafult

#

you'll probably have easier code + easier time replicating it.... not that it would be hard anyways

obtuse zinc
#

Ah I see what you're saying

#

I'll give it a shot

#

Yeah, so switching to the default jump works, now I just have to do it for my walljumping

#

Thans

#

Thanks*

worthy wasp
#

Hey all - i'm having an issue with a FPS Template Project (4.14) - sipmly put when i spawn my character after EventPostLogin (shown below) it is non-reactive to input. I've done some print strings on the function - i know its firing locally.... and is locally controlled (TRUE). But it is not able to receive input - all help greatly appreciated! The mix of MultiplayerShootout & GenericShooter is being used for pawn management.

http://puu.sh/tw40S/17998a461b.jpg

hallow shore
#

server travel with steam subsystem doesnt work, as far as i can see

worthy wasp
#

again anything ENTRY LEVEL UI (IE: - Main Menu - where you choose Single/Multi player modes) should be done as FALSE.... because your NOT CONNECTED TO ANY OTHER PLAYERS OR OSS (Online SubSystem)

hallow shore
#

i though it checked it out ๐Ÿคฆ
i forget not all game modes inherit from one.

#

@worthy wasp it worked!
but ui left, i need to clear up? ๐Ÿ˜ฆ

worthy wasp
#

can you be more specific?

hallow shore
#

all ui before servertravel is left on screen

#

i traveled into blank map without any custom code

worthy wasp
hallow shore
#

so you just open level with seamless enabled?

worthy wasp
#

your not understanding

#

the LEVEL MAP is assigned a GAME MODE

#

inside that game mode - is seamlessTravel()

#

by the way this is from CREATESESSION()

#

IE: Hosting the game

hallow shore
#

so its man in a middle type of thing

#

it generate world save stuff there and reload new level

worthy wasp
hallow shore
#

im not joining session

#

we arleady session

#

we migrate

#

from one level to another

worthy wasp
#

ok

#

FUNCTION CALL() -> RemoveAllWidgets() -> OpenLevel()

hallow shore
#

via esecute console command -> seamsless travel MAPNAME

worthy wasp
#

hopefully you have coded things right so when you open level - you redraw your HUD

hallow shore
#

its ez stuff.

#

seamsless travel copy properties even between classes?/

worthy wasp
#

so the CONTROLLER PERSISTS they say

#

you need to print string (FROM CONTROLLER CLASS) BegiunPlay()->PrintString(BLAH) to see if it refires

#

i cant confirm that atm

#

but if you have issues....

#

write out to GameInstance variables

hallow shore
#

im doing it right now

#

i guess since its working right now, dont touch it.

worthy wasp
#

CONTROLLER CLASS: OnBeginPlaye()->GetGameInstance()->Cast->GetVariables

hallow shore
#

the stuff was designed to have game instance as storage and for complete reset of everything

worthy wasp
#

any server map change SEAMLESS OR NOT - i always write to game instance

hallow shore
#

someone really need to dig into subsystem.steam and find why basic server travel doesnt work ๐Ÿ˜

worthy wasp
#

i dont have ANY problem with it - i dont know how you are

regal hazel
#

Anyone got some good recommendations for dedicated server hosts?
I was just going to go with amazon ec2 instance but thought i'd shop around first

polar bridge
#

digital ocean is not bad from what ive heard

#

AWS, google cloud service, azure are all not bad

#

amazon has an amazing feature set, but not sure how much use you'll make of that with a UE4 server

regal hazel
#

Thanks @polar bridge!

#

I shall look into google cloud service, forgot that was a thing

polar bridge
#

welcome ๐Ÿ˜ƒ

ripe folio
#

@versed socket Oh I wish it was my UI! That's just an example from Planetary Annihliation in-case people forgot what game lobbies look like ๐Ÿ˜›

thorn merlin
#

@regal hazel amazons are OK it really depends on how much CPU you need - the t2 medium is probably the minimum I'd go (its dual core) the m4.large I think would be ideal for my game but the price is pretty high

regal hazel
#

Having looked at google cloud service its actually looking fantastic

thorn merlin
#

@regal hazel I also rented a dedicated from https://eoreality.net/ for a while, it was very powerful

regal hazel
#

Unfortunately no sydney instances.. yet

#

they are coming soon apparently

thorn merlin
#

i had a credit from google this time last year and tried them, i recall it being ok

#

back then it was really hard to find out the cpu power you were getting, hopefully its improved

#

microsoft azure gives you some free credit for trying it out too but I didnt really like it

#

plus I get free credit from my msdn subscription.. still tho, for the money its amazing how much better amazon is vs msft

#

you can save too if you are good at linux too

regal hazel
#

Yeah I got the free credit as well, I just found

  1. its more expensive then other solutions
  2. the interface is all over the place
thorn merlin
#

oh god i hate azures interface

regal hazel
#

Hah athe old interface was ok..

#

the new one

#

my god

thorn merlin
#

yea, a mild nightmare

regal hazel
#

Do you like horizontal scrolling cause I put scrolling within the scrolling so you can scroll more when you want to scroll

thorn merlin
#

yo dawg lol

#

i dont need UI innovation in my cloud management UI

#

but anyway, if you use vehicles, make sure you get enough CPU

#

if your server pins the cpu, the client experience goes to pooh real fast

regal hazel
#

I can imagine! But luckily we don't so that should be all good

fresh saddle
#

@regal hazel Azure is free for Indie devs earning less than $120k I believe

regal hazel
#

Its free in the sense you get credit

#

Unfortunately its quite pricey outside of that so for scaling later down the line going to hurt the ol wallet a bit :(

fresh saddle
#

Yeah I agree ๐Ÿ˜‚

wary path
thin stratus
#

@wary path What exactly do they do?

#

They seamless travel from MainMenu to Lobby?

#

How are they doing that, OpenLevel node?

#

GameMode set to SeamlessTravel?

wary path
#

@cedric_exi from lobby to the selected game level using console command servertravel, and "Use Seamless Travel" in game mode

#

If I do it the same, I have problems setting the camera in the level blueprint, timing is broken

#

so not sure whether this is the correct way...

grizzled loom
#

I have a problem with spawning an actor on the server, it's not showing up on the client

#

I've checked the usual suspects, is replicating, owner is set, etc

#

any possible culprits which might prevent it from showing up on the client?

#

ALifeBuoy* buoy = GetWorld()->SpawnActor<ALifeBuoy>(GetClass(), Parameters);

#

this is how i spawn it

#

Parameters is set on start to:
FActorSpawnParameters Parameters;
Parameters.Template = this;
Parameters.Owner = this->GetOwner();

red ledge
#

for a shop in a round based game, I don't think I need to make the items array replicated right?

#

since it really doesn't change at all

#

and it's only for the local player

brittle sinew
#

@grizzled loom where are you spawning this? GetClass() would spawn an actor of whatever class you're calling it from

#

If you have a class parameter, the template is just for the pointer output. I know that there's some sort of check for if the class is a child of the template class, but I forgot what it does, and am on mobile ๐Ÿ˜›

grizzled loom
#

yea thats intended, im copying the object

#

its working perfectly on the server, just not showing up on the client

#

basically there's a single copy of the object in the initial level, everyone connects, everyone sees that object

#

and when you pick it up, a new copy of that object spawns in the original place

#

but only the server sees that copy

#

@brittle sinew and everything on the copy is set to replicate
bReplicates = true;
bReplicateMovement = true;
bAlwaysRelevant = true;

#

(same as the original one which works fine, only difference being it already exists in the level and is not spawned)

grizzled loom
#

Ok managed to find a debug log on the client, which reads:
serializenewactor: static actor failed to load

#

googling that people point to a server/client version mismatch, but both are running latest file versions and all caches deleted

brittle sinew
#

You're running it packaged?

#

That's really weird, not entirely sure ๐Ÿ˜ฎ

grizzled loom
#

no running unpackaged

#

i tried packaging the server and connecting the client through the PIE, but same error

#

packaging both the client and server could be an option, but even if thats a fix, thats horrible for developing ๐Ÿ˜ฆ

thin stratus
#

@wary path Weird. Yeah you shouldn't use Seamless Travel from MainMenu to Lobby

#

The Multiplayer Tutorial on Youtube by Epic Games isn't that good

#

I posted a bigger thread on the feedback forum a while ago

wary path
#

@thin stratus Yeah I read that. Was still unsure about the specific issue.

#

Thanks

thin stratus
#

They teach a lot of things where they didn't know if it's correct or not. They just went with "it's working so don't touch it"

wary path
#

๐Ÿ˜•

ripe folio
red ledge
#

how would I handle buying from a shop in multiplayer?

#

basically I have an actr place in the level that acts as the shop

#

it shows a UI with all the items avaliable

#

Items in the shop are basically just a struct with the info and the class of the actual item

#

when the player buys an item, I take from the gold on the player state and create an object of that class then add it to a replicated array of items that user has

#

my question is what part of this should be a RPC?

#

I think becaause the shop actor is placed on the level it already belongs to the server?

#

so the calls from it will always be authority?

hallow shore
#

in my implementation, pcon would have component with all required rpc events from client to server, like "player ATTEMPT to buy item" "player ATTEMPT to sell item", etc.
Current items, if they should be client/server only, would be saved there as well.

#

@red ledge

polar bridge
#

@red ledge typically you would make an RPC to the server asking it to buy the item, in something like the controller. then the item would be added on the server and replicated to the client. that's how i do it, any other way i think has cheating potential.

#

in general, should i be able to connect to a listen server on my LAN through steam? i have everything setup, i can see it pop up my list of sessions, then when i connect it just hangs and eventually drops the connection. i'm just using the 480 test app id.

#

on my listen server, i don't see anything in the logs about someone trying to connect whatsoever

hallow shore
#

i had problems of lan working with steam before, didnt bothered to find out why, i dont see how lan matters.

polar bridge
#

just for testing. when i tried over the internet it had the exact same issue

hallow shore
#

over internet is by IP ?

#

or using steam master server sdk?

polar bridge
#

steam master server

#

registered the session on the master server, which seems to work fine, go to connect and it just hangs

hallow shore
#

your session level was open with "listen"

#

?

polar bridge
#

yessir

#

register the session, once it's registered open a level with the listen option

hallow shore
#

how you testing?
i mean ps setup

polar bridge
#

not sure i understand. i had it working fine with null subsystem, so i'm pretty sure my logic there is fine

hallow shore
#

you test play in editor mode?

polar bridge
#

no

#

packaged build running on two separate PCs/steam accounts

hallow shore
#

config is correct?

#

there are bunch of new lines from null to steam

polar bridge
#

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

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

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

hallow shore
#

if your build is small enough, i could try to host in it
it does work for me, if it would works, something wrong with ports and stuff.

polar bridge
#

i've even grabbed the pull request for fixing steam authentication

#

it's pretty big, i have a feeling it's something i'm missing

#

i tried completely disabling my firewall even

hallow shore
#

join session successful?

polar bridge
#

yes, actually, that's the odd part

#

says it joins fine, then just hangs on connecting

#

rather the callback is successful

hallow shore
#

ยฏ_(ใƒ„)_/ยฏ

polar bridge
#

lol the only thing i can think is i'm sort of mixing C++ and BP, not sure if that would cause any issues?

hallow shore
#

bp is c++

#

so idk how it can cause any issues

polar bridge
#

neither, but i did see exi post saying that it doesn't work well

#

that was back in 4.9, though

hallow shore
#

really weird statement

polar bridge
#

just also struck me as odd because like you say it's just calling c++ in the backend

hallow shore
#

maybe he meant something like "session works just fine, so dont touch it cos you would screw up"

#

@thin stratus summon

#

did you try connecting by IP ?

polar bridge
#

no, i was under the impression you can't do that with steam

hallow shore
#

turn off steam and try

#

to test ports

polar bridge
#

that works fine

#

been using it that way for a while now, but trying to move to steam

hallow shore
#

you using advanced session?

polar bridge
#

no, prefer to write my own BP functions

#

but i'm using exi's tutorial as a guideline

hallow shore
#

try advanced session plugin, its like 10 min to implement

#

maybe you the one who screwed up

polar bridge
#

lol that's very possible, i'll give it a try

hallow shore
#

its like one node for host which you need for testing

#

and there are a lot of stuff to turn on and off on it

#

so maybe you missed something

polar bridge
#

that's what i'm thinking too, so that sounds like a good idea! thanks!

hallow shore
#

have zero idea what half of those do

polar bridge
#

lol, yeah i've noticed once i turn presence off i don't even see the session anymore

red ledge
#

Thanks. I thought that it would be better to have the buy function on the shop, so I should move it to the player and make it check authority etc?

rare cloud
#

@red ledge, create an RPC with an id to the item to buy as arg

#

the player click to buy, the client send the id of the item, the server get the id, get informations of this item, get its price

#

get the player gold inside his playerstate

#

remove money and add the item to the player inventory

#

if he has enough money

#

you can check client side if he has enough money

#

to reduce sended message

#

but you must check server side too

red ledge
#

thanks, will test that

#

is it better to have the player or character have the buying RPC ?

hallow shore
#

doesnt really matter, depends on presistance of player character in a game, but anyway i would pack it into a component.

rare cloud
#

@red ledge, I guess your inventory component is on your PlayerState and the gold amout of the player too

#

well the more logic place to declare this RPC is the PlayerState ๐Ÿ˜„

red ledge
#

hmmm

#

so the player calls shop

#

the shop opens UMG menu with all items

#

the player chooses the item he wants "a struct"

#

and then UMG calls the player state from the owning client to buy the item?

rare cloud
#

@red ledge, the player open the shop menu, he choose an item to buy, check if player has enough money client side to reduce sended message, and finally call an RPC with the id of the item (Client -> Server).
Once the information is server side, you get PlayerState and check if he has enough money, if yes remove the money, and add item to the inventory

red ledge
#

I won't enable the button on UMG unless the player has enough money to by that item so yeah I think that's client side checking

polar bridge
#

i would argue the controller is a better spot, player state is typically meant for replicating to everyone in the game where as controller is only relevant to the owner

red ledge
#

what I really want to know is where to send this message with the id

#

or from where

polar bridge
#

either player state, shop or controller all would work theoretically

red ledge
#

I can think of many places

#

the problem is that the shop is placed in the level

#

so it's always server side i think

polar bridge
#

yeah i'm actually not sure how that would work

red ledge
#

I remember having replication problems with actors placed in the level before

polar bridge
#

if it was me i would do the controller. in fact that's how my shop works. in my controller i pass the class of the item they want to buy into a server RPC which checks to make sure they have money, then it spawns an actor on the server which replicates to all clients

#

take my advice with a salt of course, but i would even move cash to the controller. replicating it in the state will replicate to everyone. controller will only replicate to the owner, because controllers aren't replicated to everyone

#

unless of course other players need to see their cash

red ledge
#

nah, they don't really need to see their cash, just that i'm trying to follow the practice of putting stuff like score and gold on the PlayerState

polar bridge
#

yeah score should definitely be in the PlayerState. i think typically if it's only relevant to the owner, controller, if everyone needs to see it, PlayerState

#

i think even if you do a client RPC from the PlayerState it will send it to everyone, i could be wrong on that one though

#

but i do know for sure if you do it from the controller, only the owner will see it, because the replicated clients don't have controllers of other players

rare cloud
#

@polar bridge, Simply set COND_OwnerOnly when you declare the replication of your variable on the PlayerState

#

and it will be replicate only to the Owner

polar bridge
#

yes that's also an option

#

which for me, has never really worked properly honestly

#

though that could have been an ownership issue. if you do it your PlayerState, i definitely recommend only replicating to the owner. a tech savvy user could start pulling cash from other players etc

#

and it's a waste of network bandwidth, more importantly ๐Ÿ˜„

wheat breach
#

hey ho ๐Ÿ˜ƒ

#

I use world composition and loaded in 4by4 tiles each 2017x2017 i enabled client side level streaming however when i spawn in 4 players on different parts of the map the ones that spawn far away from the listen server just fall through the map, anyone experiencing this? They load the terrain though, they just dont have collision on it.

polar bridge
#

have you tried spawning one as a server to see if the terrain loads fine?

wheat breach
#

What do you mean?

polar bridge
#

so when you do a play in editor, the first client is always acting as the server

wheat breach
#

yeah

polar bridge
#

fly around with him and see if the terrain is loading fine everywhere

wheat breach
#

The viewport in my case.

#

Okay ill check

polar bridge
#

ive never done level streaming, but the first thing that comes to mind is the server isn't loading it correctly

wheat breach
#

yeah

#

Well the viewport doesnt load them.

#

But shouldnt the listen server in the background load them nevertheless?

polar bridge
#

are you running a dedicated server when you're doing that? if so uncheck it just so you can see it visually

wheat breach
#

No tried listen server on a client first lemme try dedicated.

#

When i try dedicated it works. Which confuses me.

#

I thought non dedicated emulates the dedicated.

polar bridge
#

no, not really

#

yes and no lol, i don't fully understand it myself but one is a listen server one is a dedicated server

#

there are some slight differences

wheat breach
#

So i guess World Composition doesnt work non dedicated.

polar bridge
#

that wouldn't surprise me

#

i think even with ark it actually runs a dedicated server in the background

wheat breach
#

You mean when you host a game on ark?

polar bridge
#

yeah, could be wrong there mind you

#

because i know for certain they heavily utilize level streaming

wheat breach
#

They have to.

#

Did you actually check how many meshes they spawn ๐Ÿ˜ฎ

polar bridge
#

yeah, i've worked on a couple mods

wheat breach
#

Oh :p

polar bridge
#

their editor is...intense lol

wheat breach
#

Is it heavily moddable?

#

Can you overwrite base functions?

polar bridge
#

yep, you can do total conversions which completely change the game

#

they maybe have added stuff for that now, it's been a while

#

but at the time, no

#

it was mostly just BP calls and variables they exposed

wheat breach
#

I see. Well thanks man. Helped me quite a lot, i wasnt even accounting listen vs. dedicated.

#

*accounting for

polar bridge
#

my pleasure, good luck!

wheat breach
#

thank you, first day in development :p

hallow shore
#

in game mode post login called before begin play but player state begin play called event before game mode post login ๐Ÿคฆ

wheat breach
#

That is a very complex sentence @hallow shore

hallow shore
#

@wheat breach
when level loaded, zero index player call post login BEFORE game mode begin play happens
when second player join session, begin play of his player session called BEFORE post login on game mode
judging by first row, i though post login is absolute first thing, since it happens even before game mode done.

#

uworld and his zero garantie in what order begin play called ๐Ÿ˜

polar bridge
#

don't you love networking? ๐Ÿ˜„

hallow shore
#

im ok with networking, i just want thing to be consistent ๐Ÿ˜ก

wary path
#

@hallow shore I've made the experience to be very careful about order of events. it seems that order is not always guaranteed. if you for example switch to seamless server travel, and relied on order before, all stuff will be messed up ๐Ÿ˜ฆ

#

for a lot of stuff, I now use lazy initialization and cache the references as soon as they are available

hallow shore
#

what is lazy initalization?

#

seamless travel doesnt work with PIE ๐Ÿ˜ก

red ledge
#

@rare cloud so should I use COND_OwnerOnly even if it's only on the player controller?

hallow shore
#

have to turn it off, fix stuff then turn it on and fix stuff using two PC ๐Ÿ˜

#

my life is pain...

wary path
#

@hallow shore you call a get-function to access a reference, instead of e.g. directly accessing playerstate. then you check if playerstate is valid, get the value you need, and cache it in a variable. if it is not yet valid, cache stays invalid. then check for cache validity, and skip if it is invalid

#

or something like this

hallow shore
#

problem is when to call get function

wary path
#

whenever you first need it

#

not in an event...

hallow shore
#

i mean i need array of players
and i need to know when new player join

wary path
#

I tend to do more polling now ๐Ÿ˜ฆ since using UE

hallow shore
#

polling?

wary path
#

new player join is post login event...

#

to access the corresponding player state, you can use lazy initialization

hallow shore
#

if i message that new player on post login a thing via rpc, on reciving end the new player may not even have game instance ready

wary path
#

yup

hallow shore
#

game state*

#

its like, UI element constructed, but game state is not valid

#

WTF UE4

wary path
#

sometimes it is ready, but you cannot cast it to your class or whatever

#

I know this really *****

hallow shore
#

its just nullptr

#

its as unready as it can be ๐Ÿ˜„

wary path
#

just don't rely on it to be ready

hallow shore
#

something need to be ready ๐Ÿ˜„

wary path
#

use player joined only to fill some list of controllers

#

and then use other events

hallow shore
#

giant mess

wary path
#

it's best to use an example as guidance, in my opinion, as it takes a lot of time to find all this out...

hallow shore
#

the issue is, i would manage everything
but project is for client and i cannot find safe ground to ship it.

#

safe and reliable ground

#

safe one is ok, but patters are all over the place

#

giant pile of exceptions

wary path
#

then look at some example, how it is done there, and copy the "pattern". for example @thin stratus has a great multiplayer lobby example in the store where you can see an order of events which work.

#

the problem is that for example in beginplay, stuff is initialized on the server, but in beginplay on client it is not initialized

#

you have to consider all this...

hallow shore
#

link to example

wary path
#

there are some free examples by epic, but the more verbose one is c++

hallow shore
#

k, ty.

wary path
#

@hallow shore but seamless travel does work with PIE, regarding your upper comment. just disable the automatic connect

#

@hallow shore citing from the forum: "Go to the "Advanved Options" of the Play settings (Arrow right to the Play button) and go to the "Multiplayer Settings" tab. Disable "Auto Connect To Server"."

#

however, this only works if you start session, not if you test without starting session

#

ok no you are right, not PIE, I use standalone game, sorry, mixed this up. PIE only works with normal servertravel

#

why ever ๐Ÿ˜ฆ

hallow shore
#

๐Ÿ˜ฆ

thin stratus
#

Probably because of Single Process?

wary path
#

"UWorld::ServerTravel: Seamless travel currently NOT supported in single process PIE."

bronze lava
#

Hello all, I have a weird problem. On repnotify health, if it gets to 0, character death is called. However, when death happens by gun, it works properly (player collision gets turned off and player is invisible), but when death happens by a grenade, only player's movement is disabled but nothing else happens. What could cause this?

hallow shore
#

@bronze lava grenade is overkilling and you check only == 0

bronze lava
#

I'll check, thanks.

hallow shore
#

it should always be less or equal for int and less for float.

bronze lava
#

I don't think that that's the case. It does deactivate player movement, so the notifyrep does execute

hallow shore
#

show your "is dead" check

bronze lava
#

Sorry for messy blueprint.

hallow shore
#

the code which calls this code

hallow shore
#

put breakpoint on granade "deal damage" and throw one

#

click on node you interested and press F9
when this node would be exectued with play in editor, game would pause and you would be able to do step by step

bronze lava
#

I put it on SET w/Notify health

#

and it paused

hallow shore
#

press F10

#

or button on panel

#

step somethin g

bronze lava
#

Alright, it highlighted my custom event

hallow shore
#

make it trigger ingame

#

use grenade or whatever

bronze lava
#

How do I unpause?

hallow shore
#

giant button PLAY

#

YES

#

it would pause every time

#

catch one you need and then go step by step on it and look variables values

#

some of them would be out of scope, some not.

bronze lava
#

But do you have any idea why the disabled input works correctly?

hallow shore
#

nope

#

maybe it kills twice or something like that

#

and screw up your delays

#

also player controller 0 is local player controller 0

bronze lava
#

Oh... it works with the gun, though

hallow shore
#

put breakpoint and test why it DOESNT work

bronze lava
#

Alright.

#

I can't find any reason for why it wouldn't work, when it works with the gun death...

hallow shore
#

go and check what are the difference between gun and other thing damage dealed

bronze lava
#

I made it so that when pressing "N", you'd automatically die. That doesn't work, either

#

I don't see any difference, both take the current health, substract the damage and apply it as the new health

#

Actually I do. The gun does everything on the server, while the grenade damage is multicast. This is because the grenade doesn't work when done on the server

hallow shore
#

it shouldnt multicast.

#

Make one function "Deal Damage"

#

and call it every time when target need to take damage

#

or use UE4 damage system

#

it should work as well

bronze lava
#

I'll try that. But when not using multicast for the grenade (server instead), it doesn't calculate the distance between the player and the grenade. Maybe I'm just doing everything wrong

#

This part doesn't work, if executed on server.

hallow shore
#

you doint it wrong

bronze lava
#

Thought so. What would I need to do then? :/

hallow shore
#

your damage its just distance between characters?

bronze lava
#

No, after getting the distance, the FirstPersonCharacter blueprint divides Grenade DMG with distance

hallow shore
#

in the thing which deal damage, lets talk about pistol, you have two characters, one which is source and one is target, because you figure out it on shoot

#

you should just call deal damage to target

#

when granade exploade, you get sphere of your granade radius and go one by one dealing damage

#

everything on server

#

everything on server!

#

type overlap actors

#

it would offer you nodes

#

there are box and sphere

bronze lava
#

Oh, found them. Thank you

hallow shore
#

for each loop sphere result

#

@bronze lava

bronze lava
#

Will try.

fossil spoke
#

Why not use a MultiSphereTracebyChannel?

bronze lava
#

You can't select a specific class filter with MultiSphere

fossil spoke
#

TracebyObject then

#

Just cast to the class you want to "filter" for after the trace...

brittle sinew
#

Don't see why that's any better than what they're doing now...

#

Their way should work, just looping through the results should be fine

fossil spoke
#

True

hallow shore
#

dude

#

you need to start thinking

#

really

#

I have to go, so last one.
Since hit results return you array of everything got hit, maybe you can CALCULATE DISTANCE BASED ON EACH RESULT?

#

im gone.

maiden saddle
#

Hey everyone, so I asked this in #lounge but was told to check this place out. So I am wanting to use PHP to create a login system for a C++ launcher I made. No idea where to start with PHP and server stuff that like, any insight would be kickass! Thanks in advance

fresh saddle
polar bridge
#

has anyone here ever actually managed to get steam to work with appid=480 ? either listen or dedicated server. i can't get either to work, and null subsystem works fine.

fossil spoke
#

Yeah works fine when i do Gamejams

polar bridge
#

you can create sessions, find them, and join them fine?

fossil spoke
#

Yep

polar bridge
#

guess i'll keep plugging away. been at it for a week or so now and still can't get it to work haha

fossil spoke
#

You need to make sure your in the same region as the Host

#

Steam has region lock

#

You wont find sessions in other regions

polar bridge
#

yeah i've read that before. will it work over LAN?

fossil spoke
#

LAN is different i think

#

In the way that Steam probably ignores region locks lol

polar bridge
#

how do you usually test, then?

#

i've been throwing my packaged build on another pc on the LAN, but no luck so far. was suggested i try the advanced session plugin and that actually made things worse lol. i had my session showing up before and couldn't join. now sessions just don't show up

fresh saddle
#

Have you added the necessary information to your DefaultEngine.ini?

polar bridge
#

as far as i know yeah

#
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

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

have the plugin enabled, etc etc. if i use the regular find sessions node intead of the advanced one my session shows up again. but when i join it tells me it joined fine, but in reality it just hangs with the server seeing no incoming connection

fresh saddle
#

Can you ping your other computer?

polar bridge
#

yeah, if i use null subsystem i can connect to it in fact

fresh saddle
#

And are you using the advanced create session?

#

With the correct bools set for lan?

polar bridge
#

i've used that, ive used the regular one, and i've created my own interface to try it. as far as i understand it, that doesn't work with steam

#

really i have no idea if steam will work with LAN, but i wouldn't see why not?

#

but i believe checking that box off makes it so it actually doens't use steam. could be wrong on that one tho

fresh saddle
#

I'm really not then sorry. I've never had issues with it :/

polar bridge
#

i'm sure i'll figure it out eventually ๐Ÿ˜ƒ thanks!

polar bridge
#

turns out my virtual box network adapter was fucking everything up....lol...

fresh saddle
#

VM's break everything

polar bridge
#

oh i wasn't even using a VM, just simply having the network adapter enabled on my PC screwed up the session mechanic

fresh saddle
#

I'm make note of that next time someone has the same issue. Thanks for letting me know!

polar bridge
#

of course, if i can save someome else the head ache...

fresh saddle
#

I might make a tutorial video and let people know that those issues may occur and I'll be sure to give you a shout out

orchid cairn
#

i've had a similar issue before on a system with 2 network adapters both plugged in as well just FYI

polar bridge
#

that turned out to only be one of my issues. other issue was using source built engine that has a pull request added to it. that PR is supposed to fix steam authentication, but seems to actually break it. at least for listen servers.

#

once i used the 4.14 launcher version of the engine, with that network adapter disabled, then i was able to connect through the LAN with steam

#

but, ideally i would also like to get dedicated servers working. which i'm not sure is possible without that pull request

hallow shore
#

what is the problem with steam auth?

polar bridge
#

from what i've heard the launcher version of the engine doesn't properly enable steam authentication, and won't work with dedicated servers

#

but, i'm going to test that out myself

hallow shore
#

so you got a fix for a problem which you not sure exist ๐Ÿ˜„

polar bridge
#

it's a little difficult to test at the moment because there's currently a bug in 4.14 which broke logging functionality from the gamesession class ๐Ÿ˜ฆ

hallow shore
#

4.14
what an unfortunate version you choose for your project

polar bridge
#

heh, i like to keep my engine up to date, so i upgrade it whenever a new one comes out.

#

started on 4.9 i think?

hallow shore
#

bald tactics, let's see if it pays out for him kappa

#

i have same project, started on 4.6

#

nothing ever breaks, proabably because full blueprint.

rough iron
#

@fossil spoke small correction about steams region lock, it's the developers decision to be multiregion or not. In case of the 480 id it is locked.

fossil spoke
#

Cheers, i was actually wondering about that

rough iron
#

same for PSN and XBox

#

When I request an id I go always region free

#

while you have to take that into account in your matchmaking algos xD

fossil spoke
#

Of course

rough iron
#

gaming between US and EU has a high ping

fossil spoke
#

Still, id prefer users/administrators contorl those options, not Steam :p

rough iron
#

yeah of course

fossil spoke
#

"You have exceeded the Maximum ping for this server" love those messages

rough iron
#

while it's just a simple shurtcut for devs

#

if you are a small dev and you do not want to worry about such things region lock gives you a smooth base player experience

potent prairie
#

is it a bad idea to put basic movement in a PlayerController since each of these would be stored on the server per player? Better to put movement input in the actual Character blueprint?

rare cloud
#

@red ledge, Normally you don't need to specify COND_OwnerOnly with Controller

red ledge
#

thanks

rare cloud
#

because it's only replicated with owning client

#

I will check some source code

#

yeah you don't need:

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

    DOREPLIFETIME( AController, PlayerState );
    DOREPLIFETIME( AController, Pawn );
}
red ledge
#

thanks, I'll only use it in hings replicated to more than the client then.

slim holly
#

AddMovementInput isn't replicated by default anymore?

hallow shore
#

update session doesnt work for me ๐Ÿ˜ฆ

#

i lied, i didnt had "allow join in progress" ๐Ÿ˜„

#

so, what is reasonable update delay?

fresh saddle
#

@hallow shore 30s

#

Or even 45. That's what alot of the major games do. Eg CS:GO

hallow shore
#

they have delay of 30 sec on server status update?

fresh saddle
#

45 seconds
You're talking about find sessions yeh?

hallow shore
#

find session 45sec forced delay is insane
im talking about updating current game mode on extra info for session and stuff

fresh saddle
#

Oh um then idk
But yeah cs has a 45 second delay. It's horrible

hallow shore
#

maybe because of scale..

#

i dont think for indie its consern

slim holly
#

any idea how do I use Radial force on dedicated server?

hallow shore
#

same as any other and test how it works?

slim holly
#

I use FireImpulse on hit event, but it's not doing anything

#

actually it's not giving any error

#

there's an option for "Enable physics on dedicated server" under the mesh, but it was already checked

#

and that's probably not what I'm looking

red ledge
#

probably a replication problem?

slim holly
#

not really, the force is spawned on server and works when client or server spawns it

hallow shore
#

dedicated servers doesnt simulate physics?

slim holly
#

afaik it does, but there are some elements it's unaware

#

like animations and stuff

#

as far as I can tell, the impulse fires but it's just a tiny nudge

#

on dedicated

#

on listen server, it throws the player like 5m into the air

red ledge
#

PUT IN MOAR POWAH

slim holly
#

I tried, does nothing

torn gust
#

Hey, how do i add a player / spawn a player over execute console command ? Google canยดt find what i am looking for but i remember that you could add players after you started multiplayer preview

#

Simliar to the addbots command

#

Nevermind found "create player" . Works now

polar bridge
#

anyone know if it's possible to get steam dedicated servers working with the launcher version of the engine? i tried with the pull request, but didn't work. in fact that even broke my listen server

hallow shore
#

there are launcher version of agame?
/nvm.

polar bridge
#

huh?

fossil spoke
#

No Rarp you need a code solution to be able to build a dedicated server

polar bridge
#

i realize that, i have it in code, i've overriden RegisterServer in a custom GameSession class, but it doesn't seem to work

#

doesn't seem to ever start the session. and 4.13-4.14 has a wonderufl bug where logging doesn't work in GameSession

hallow shore
#

what parts doesnt work?

polar bridge
#

in fact if i try connecting to it through the console/ip it doesn't work either

hallow shore
#

and i remember allar had something on steam dedicated servers

#

you followed that?

polar bridge
#

but didn't work

#

guessing it doesn't work with latest version of the engine ๐Ÿ˜ฆ

#

like i say, that actually breaks my listen server

hallow shore
polar bridge
#

will take a look at that, thanks

polar bridge
#

still no luck with that. ah well, i've spent enough time on this, will let epic hopefully solve the problem before i release haha.

#

pretty sure it's just a bug in the engine, hard to tell because i can't make any log calls inside any overridden functions on GameSession ๐Ÿ˜ก

hallow shore
#

why you cant?

slim holly
#

iirc 4.13 steam integration is bork

#

only works with dev builds

ripe raptor
#

Hey guys, anyone here ever used AddForce over the network?

#

Together with CharacterMovementComponent

#

I keep getting jittery movement at the start

hallow shore
#

?

#

i used 4.12

#

my one works ๐Ÿ˜„

polar bridge
#

4.13-4.14

#

maybe it's time to revert to 4.12 lol

nocturne copper
#

I have been stuck on this issue for a little while now and I am a bit stuck on trying to get the rest of these weapon parts to inherit a texture pattern that is first placed on the root componet of the weapon body and the attached parts are supposed to recive the same pattern. I can get color to work with no issue but as the weapons are built into different parts the clinet can only see the intial pattern show up on the weapon body but not the rest of the parts granted they are not all fully textured yet just the bodys and some barrels.

The left screen is the server and the right is the client

wary willow
#

Less wall of text, more use of paragraphs and spaces please

nocturne copper
#

and this is the OnRepNotify that is supposed to set the image that is a texture parameter in the same materail that is used on the weapon parts

#

ok thats all i got for that right now

verbal slate
#

I'm basically trying to add replication to rolling ball template

#

I'm doing addImpulse on left mouse button click

red ledge
#
verbal slate
#

Anything in C++? Sorry, I forgot to mention that.

slim holly
#

I'm trying to find child actor(component) forward vector

#

none of these values make sense

#

these are weapon actor forward vectors

#

Green ones are correct, and red ones are what server thinks

heady delta
#

Is that the vector for the hit or the actual object on your character

slim holly
#

no it's just forward vector of the weapon that character is holding

#

and the weapon is separate actor

heady delta
#

And its location is affected by your characters animation?

slim holly
#

attached to socket, yes

heady delta
#

Ok go into your character, select the mesh then go down to the skeletal mesh section on the right

#

make sure the mesh component update flag is set to always tick pose and refresh bones

slim holly
#

ahh I was looking for that option

#

earlier that is, but couldn't find it

heady delta
#

\ o /

slim holly
#

been a while since I did dedicated server stuff

#

back in, 4.5 maybe

heady delta
#

That's a long time lol

slim holly
#

it was a checkbox back then iirc

heady delta
#

Probably the whole layout looked much simpler then

slim holly
#

number of options has been steadily going up for sure

#

welp, that concludes my day, all bugs fixed

heady delta
#

I'm jelous lol

slim holly
#

don't worry, I need to start on session management tomorrow

#

and interface for server lists and stuff

bronze lava
#

Is there a way to change the max view distance of pawns? When player2 moves too far away, it turns invisible.

red ledge
#

NetCullDistance or AlwaysRelevnt?

bronze lava
#

Thanks, that was it.

sly kernel
#

is there a guide how to run headless dedicated server of stock UE4 on Linux ?

regal hazel
cyan bane
#

Anyone have any experience in making physics work in multiplayer?

gray crag
#

Hey guys I'm trying to get multiplayer up and running with OnlineSubsystemNull just testing on one computer. I've coded it up and both the creation of the session and the finding sessions behavior finishes correctly, but when it won't actually find any sessions. I have one created for another instance of the game, so I'm wondering what I'm doing wrong

#

I can post code if you'd like me to as well as my ini file info

humble zealot
#

Is it possible to do real render distance like h1z1 does? blocks out

fresh saddle
#

@gray crag one thing to check is if you have a network adapter conflicting with your subsystem. Check that your only have your required network adapter enabled and the rest disabled

#

Also send a log of both server and client. Would help in investigsting the issue

ripe cypress
#

anyone know if the on destroyed event is already multicast run on server or what ?

fossil spoke
#

If an Actor is destroyed on the Server then all clients will also destroy that Actor, if an client destroys an Actor, only that clients Actor is destroyed.

dawn glen
#

anyone know why a replicated var wouldnr replicate?

http://prntscr.com/e0vjw3

its setting on the server right but on client it is staying 0.0

Lightshot

Captured with Lightshot

fossil spoke
#

Are you sure your running on Authority?

dawn glen
#

the game is set to 1 player with dedicated server

#

Other variables are replicating

#

jus tnot htis one

gray crag
#

@fresh saddle I also don't understand what you mean by network adapter. Like hardware wise or something in code?

fresh saddle
#

Its not a literal network adapter

gray crag
#

Oh ok. I guess I wouldnt' know where to find that information

ripe cypress
#

I have a multiplayer shooter if I want to show a widget to just the one that did the kill server or client how do i go about that ?

fossil spoke
#

I usually send a ServerToClient RPC that tells that client to show whatever kill screen needs to appear.

potent prairie
#

I can't find any good tutorials online showing how to set up a simple healthbar that updates on the client when taking damage. Can someone point me in the right direction? Been stuck on this for over a week now

wary willow
#

?

#

@potent prairie you are not looking hard enough

#

There's literally a whole newbie networking official guide

#

And the last of it has damage replications

#

Let Me Google That For You

#

pretty sure that's where it starts off

#

with what you are looking for

potent prairie
#

okay thanks bro

potent prairie
#

Okay that helps, turns out my character were taking damage this whole time, lol. I've narrowed the problem being that my UMG widget script is bad somewhere, not able to update the actual progress bars on the screen

night jay
#

Anyone having luck with smooth vehicle replication?

#

It can be jittery for me sometimes

fresh saddle
#

@potent prairie pretty sure the progress bar is a float between 0 and 1

#

So take that into consideration

potent prairie
#

@fresh saddle yeah i think that's where I'm stuck at the moment

#

it works if i have 0-100hp

fresh saddle
#

And how is it not working?

potent prairie
#

because if I have a boss with 1000hp or something

#

dividing 1000/100 still gives me above 100%

fresh saddle
#

You know you can just do
(Health/MaxHealth)*100 and it'll give you the correct percentage right?

potent prairie
#

Welp I didn't have a MaxHealth variable so I'll get to work on that xD

fresh saddle
#

You can just get the default of the health

#

But meh

potent prairie
#

so i dont need a currenthealth and maxhealth variable?

#

aww wait. i cant have health above 100 if im using floats right? I think that was the issue

fresh saddle
#

Floats go way beyond 100 haha

#

Just have two variables
One of your current health
One of your max health
And do the math i said before

#

Don't worry about what i said about getting the defaults. One thing at a time

potent prairie
#

okay yeah it works now

#

lmao

#

just took me a long time to wrap my head around that logic lmao

fresh saddle
#

Allgood! Glad it's workin

potent prairie
#

working on server and client woo! thanks buddy

fresh saddle
#

Welcome

wise depot
#

do OnRep events happen on a server?

fresh saddle
#

Server to client

wise depot
#

i mean do they trigger on a server

#

the replay system relies on replicated values to work

#

RPC's don't trigger in replays but OnRep functions do

#

which is fine for clients recording replay data but if the server doesn't trigger onRep events then it'll never (maybe?) record the event?

fresh saddle
#

I believe they're client only

#

It just notifies the client when a new value has came thru afaik

#

They are client-sided events called by the server

#

But then again its easy to test

#

Just put a print string

wise depot
#

yeah that's true

#

just waiting 12 decades for git to catch up

agile lotus
#

I'm having an issue where the client can see both players with animations but the listenserver/host player can only see their own animations

fresh saddle
#

how are you setting the variables? @agile lotus

agile lotus
#

Oh do you mean isCrouching and all that etc

fresh saddle
#

just whatever animations are playing the way they're supposed to

agile lotus
#

Thats how I tell an animation to play. it checks the true or false of a boolean

#

The booleans are replicated

silk snow
fierce birch
#

@silk snow you had to mod the engine for that didn't you?

#

doen't the default splitscreen hardcode how the windows are split?

silk snow
#

well, i done it in game code part, not engine code ๐Ÿ˜„ and you can even do it with blueprints

#

it is basically 4 cameras render to UMG. You can ahve 1 camera, and you do split the image, but then it requires a little HUGE image res

#

so, i decided to go with 4 small ones, instead of huge one

#

specially because the game design was pushing me more in that direction

#

and as the nvironment won't be super visibale, i managed to remove lots of meshes, vigitation and added fog, which amde it run smoothly 60 fps as the rest of the game

wary willow
#

hmmm

#

@silk snow Regardless it's still rendering 4x times

#

no matter if you use default or the way your're doing it right

#

The thing is... those camera renders are probably quite costly

silk snow
#

yes, rendering several times costing, but depends on what actually getting rendered ๐Ÿ˜‰

#

camera and players have base of my occlusion system, it hides and shows things based on their location, quite primitive, but got the job done, and kept the game eprformance nice

#

my first attempt, grass killed the eprformance, specially because it moves

#

Also forward rendering is better than defferd in terms of speed. so, it's trade of, and what ur game requires

wary willow
#

Heh, I just lost 6 hours of work

#

I should have committed more ๐Ÿ˜ฆ

#

Trying to get playerstate to get HMD info

#

And spawn players accordingly in gamemode

#

To their appropriate pawns (VR and Non-VR)

#

and bam

#

I found the fucking problem

#

Doesn't like playerstate

fierce birch
#

I thought the official splitscreen did that somehow more efficiently

#

I mean, they literally had to disable some PP as it was treated as single view at some stage

#

so bloom etc would leak from one view into another

#

if you just do scenecaptures, you could keep that stuff enabled

rain coral
#

hey (unreal n00b here). I've set up a default pawn in my game mode and have made a blueprint character thingy. it has its own camera attached as a child which is set to activate for player 0.
so when I start my game with 2 players, one spawns like it should, and the other gets a random camera that is added for some reason.

#

it seems to add one additional camera for each connected player to the scene

#

what's the correct way to deal with player cameras, since this is happening?

agile lotus
#

Are you trying to do a shared camera?

rain coral
#

nope, nothing special, just a player camera. but I've just come over from Unity

dense rose
#

It shutters a lot on both sides ( pawn and rigid body)

#

It gets worse with higher ping

#

at 100 ms its nearly unplayably , you can see it at the end of the video.

fierce birch
#

that's expected

#

if MP physics were easy, there would be a lot more MP physics games

dawn glen
#

Dunno if this is a multi-player, blueprint or c++ question but wondering why I would be having issues with variable replication. I have an ai base class in c++. I then have a derived BP base class from that c++ class. I do all my basic logic in the ai base BP to be used in all children. The issue is variables replicated inside the c++ class work exactly as expected however variables created in the BP and set to replicate and edited only on server it won't replicate. Server sets it and I can see that but in the client version it stays at 0. If I then delete the variable from BP and put it in the c++ base class it replicates fine with the exact same BP setup. Is this a common problem?

wary willow
#

I mean spawn*

#

That's in GameMode

#

The first one is from PlayerController

#

I had hoped that since I had put all the playercontrollers in an array

#

I could just get the value from each playercontroller

#

But each and everytime it wants to spawn the VR pawn

#

So, obviously my logic/line of thinking is wrong

#

Is there a way to get a variable to stay with the player when they go from "Main menu" (non-MP) mode to "Gameplay (MP-mode)" ?

#

Because it works just fine in SP obviously.

thin stratus
#

GameInstance or SaveGame

wary willow
#

Was my way of thinking wrong because when the players login they get "new player controllers" from the server?

thin stratus
#

Eehm

#

I think the problem is about the "IsHMDEnabled" thing

wary willow
#

I know it is lol

thin stratus
#

I had trouble getting that to actually return true on the first tick

wary willow
#

Oh, how did you fix it?

thin stratus
#

Not use it but rather start my VR Client directly with -VR

wary willow
#

Hmm, but what if I want to make a game that allows both?

thin stratus
#

Hm

wary willow
#

This is the problem

thin stratus
#

The way I solved it, but that was a special case

#

is only spawning the first one as a normal player

wary willow
#

This is mainly for debugging btw

#

But I still need it

thin stratus
#

What you could try is

#

Spawning a Non VR pawn for everyone

#

and then, in the non VR one

#

checking the boolean on tick

#

and if ti's true you destroy the non vr one and repossess a VR one

#

that should work around it

wary willow
#

Hmm, that's an interesting approach, I'll try it, thanks.

rain coral
#

trying to run my game with two players, but half of the time, the second client just sees total black and only 1 player gets spawned

#

got 2 "PlayerStart" spawn points

#

I have a lot of questions, but does anyone know what might be going on?
my player is based on Pawn, and it's set as the default player, so I start the scene with no players, then it adds one (always), and if I'm lucky, the next one too

thin stratus
#

Could be that it uses the same SpawnPoint for both and they get spawned in each other

#

and sometimes he decides to just don't spawn it cause of collision

#

You might want to get more control by setting the Default Pawn to NONE

#

and then use the GameMode and its "OnPostLogin" function

#

That gets called for each player connecting

#

And gives you their playercontroller

#

So you can simply find a SpawnPoint, spawn the Pawn and possess it via the passed PlayerController

rain coral
#

both the spawn points are set to 'Always spawn, ignore collisions'.

#

I could maybe try something like that, though I want to learn Unreal from the ground up, as I've just got started with it. been watching tutorials for some days

#

I feel like something is wrong. there's a bunch of weird things happening apart from it not always spawning the second client. for example, it adds two random cameras in the scene when I try to play with 2 clients

#

if I 'detach' during Play more, my camera is inverted..

#

(alright, the fault was in the player blueprint's properties, not the spawn points, spawn settings at the bottom)

bronze lava
#

Probably a dumb question but how do I replicate a variable from UMG to Server? I want the player to choose a name and pass it to the server.

brittle sinew
#

You would most likely want to send the info through something that you can send a server RPC through, like your PlayerController

bronze lava
#

Hmm. I've tried PlayerController but the PlayerController's variable didn't change when I tried to set it to a variable stored on the Pawn

#

(both variables were set to replicate)

brittle sinew
#

You don't change replicated variables on the client unless you have it set up with a proxy (actually I don't think that this is even possible), the server has authority over them

#

You would probably just want to send an RPC with the info

bronze lava
#

Alright, I'll try. Thanks

#

Oh my, it worked. Thanks again :)

brittle sinew
#

Good to hear ๐Ÿ˜ƒ

twin juniper
#

hello every1

#

AKorePlayerState* KorePlayerState = Cast<AKorePlayerState>(ShooterHero->PlayerState);
//KorePlayerState->Inventory.Add(theInventoryItemToAddToInventoryArray);
KorePlayerState->Inventory.AddUnique(theInventoryItemToAddToInventoryArray);
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, TEXT("Added bandage to players inventory!"));

    //theInventoryItemToAddToInventoryArray->Destroy();
#

i have this code where i add an item to my players inventory and then i want to destroy it from the world

#

but the problem is that if u destroy it on the server

#

theres some sort of lag time between the deletion and adding it to the players inventory

#

so i commented out the "theiventoryitemtoaddtoinventoryarray->Destroy();"

#

and it works fine when i commented that out

#

so i know it has to do with the fact that the Engine has a lag time between adding something to an array and destroying it from the world

#

it seems like what ends up happening is it destroys it from the world before adding it to the array

#

only on the client tho

#

because on the server it works fine

#

i feel like im super close, been working on this for a week or so now lol

vivid siren
#

So I made a small multiplayer template game and then packaged it, changed some stuff, and packaged the new version as well

#

and I can have players connect to each other despite using different versions

#

How far can this be taken? Can two completely different games connect? Obviously things won't work right, but I have ideas

#

In particular, I'd like to have a simplified html5 version of a game where a player can connect and play in a sort of "top-down" perspective

#

While the desktop version is first person and contains the real and true gameplay

fresh saddle
#

@vivid siren usually just if the player characters and maps are different they cant connect

#

So basically anything that's doing proper replication

#

With your question about crossplatform

#

The engine doesnt support it out of the box but you can change it to

vivid siren
#

@fresh saddle In my test, I had changed the layout of the map and the two players could connect still, though it would act weird when they tried walking on the updated areas, as expected

fresh saddle
#

@vivid siren not sure whats happened to allow you connect but they shouldn't be able to

vivid siren
#

So it's probably just a lucky test? I wouldn't want to spend a lot of time making something based on something that doesn't always work, lol

#

Do you have an alternative idea? I basically just need a top-down in-browser player who can watch a desktop version of the game and use minimal interactions

vivid siren
#

Would the Socket Connection plugin be of use here? I'm unfamiliar with server stuff so I have no clue

fresh saddle
#

@vivid siren yes it would

#

Or you could just remove every check the server does but I'm not sure how well that'd work with browser

#

But yeah websockets are the way to go

vivid siren
#

Ideally, I'd like the website user to have a minimap view of the desktop gameworld with simple interactions like changing light colors and such

fresh saddle
agile lotus
#

So my pawn isn't detecting input axis MoveRight at all when online

red ledge
#

any idea why a controller is never the local controller in this?

  • Pawn calles LevelActor->Use on server and passes a refrence to self
  • the level actor gets controller from the pawn and calls a method to create a widget on it passing the widget class and checks if the controller is local create the widget
#

in C++ btw

#

or at least it works with the sever but never with the clients

#

tried it in both editor and standalone using sessions ans without

brittle sinew
#

Is that method you're talking about a client RPC? @red ledge

#

Because if it only executes on the server, it'll never be locally controlled except for the server obviously

red ledge
#

the Use is an RPC

#

so I should make the widget creation replicated on client?

#

the method to create a widget is not an RPC

brittle sinew
#

You would have to to create a widget and/or have it return locally controlled true

#

Yeah, if it's only executing on the server you're never going to get it locally controlled...it's executing on the server ๐Ÿ˜›

red ledge
#

so I would make the widget called from the actor Use server RPC to create the widget a Client RPC?

brittle sinew
#

Yes, I believe that would work

#

Are you sure your server RPC is ever making it to the server either way though?

#

Because you can't call server RPCs on objects you don't own, so unless the use actor's owner is your PC or your pawn, it won't be called

red ledge
#

pretty sure the server RPC reaches, I can see the debug string on both the server and the client when I use from the client

brittle sinew
#

Oh, are you calling the actual RPC on the pawn? Think I misunderstood

#

Either way, you'll need a client RPC to spawn the widget

fresh saddle
#

Is setting an actors default to replicates required if you use server sided RPC's?

#

Like can you call a server sided event if the actor is not set to replicating?

red ledge
#

@brittle sinew yeah that was it thanks needed the Client RPC

thin stratus
#

@Kanga RPCs go from Server to Client, Client to Server or Server to all. They all require an instance of the Actor to be on the Client/s, so setting them to replicate is needed

#

@fresh saddle

#

You could technically spawn it on all of them by hand without setting it to replicate, but then the connection is missing between them

sturdy urchin
#

Hello, can anyone help me with HTC Vive multiplayer?

bronze lava
#

How do I replicate AddActorWorldOffset? It only changes position on owning client

#

If I execute the change on server, nothing happens

#

Nevermind I fixed it by doing an RPC to the server

twin juniper
#

@sturdy urchin It's better to type out your issue, and wait for someone who might know the answer

#

I'm assuming you are having issues with replicating a head attached to the camera component, as well as motioncontrollers

#

There are currently two ways to do it: Get motioncontroller transform and replicate to all (this breaks late update for the client, but you can hack it and have "dummy components" that gets replicated, and set them to "Owner No See"

#

The second one is to use mordentrals VRExpansionPlugin, which comes with a custom motioncontroller and camera component

sturdy urchin
#

Yeah, i have issues with motion controller and HMD model replication

#

May case:

One player launch Standalone game with server role in VR
Another player launch Standalone game with client role
Each game works on differnt PCs in local network (-lanplay)

I have custom pawn with HMD model wich spawns Weapons for each hand. Weapon is custom AActor class with bReplicates=true.
I want to both server and client can see transforms changes on HMD and both Weapons.
How can i do this? How i need write replication for this case?

#

github link

fossil spoke
#

@sturdy urchin ask @wary willow i know that he recently got replication for HMDs working.

#

You could ask him for advice

wary willow
#

Shoot, or more headaches

sturdy urchin
#

@wary willow Hello, what about your motion controllers?

twin juniper
#

@sturdy urchin Vic is using VRExpansionPlugin afaik. I did mention how you could do it without it though

#

Or just look at GripMotionController.cpp in VRExpansionPlugin and borrow the replication piece

sturdy urchin
#

Thanks all

ocean forge
#

Hello all. For the past two agonizing days, I've searched everywhere, including the forums and youtube... Maybe Im not using the right terminiology, but in a multiplayer game (not LAN) how do I display the name/nameplate/gamertag above each player? Is there a tutorial for this; or can someone point me in the right direction?

native axle
#

@ocean forge what part exactly are you stuck on? Getting the Name, Making the widget or Replicating the name across server / clients?

ocean forge
#

I can get the steam name to show above the host. But when other players join they only display the host's name above thier head aswell. @native axle

#

I've tried to give each player a unique ID to reference the player controller but nothing works.

agile lotus
#

Can a server detect all the playercontrollers
and cast to them
I have some input axis stuff tied to my player controllers
wondering if I should RPC the input axis events

fresh saddle
#

@ocean forge get player state and then get display name

#

Player state has everything set up

ocean forge
#

When I get home from work, I'll try to post the blueprint I have

ocean forge
#

@fresh saddle Thank you

verbal slate
#

Any idea why would my client player is not spawning all the time in my multiplayer project? It works like 1 out of 5 times. I have 2 spawn points set up but most of the time only server player will spawn

#

And sometimes when I click to window with client player, ball just respawns and actually disappears from world objects

verbal slate
#

These are the 2 errors I got in output log LogSpawn:Warning: SpawnActor failed because of collision at the spawn location [X=300.000 Y=-1770.000 Z=230.000] for [BP_MinigolfBall_Pawn_C]
LogGameMode:Warning: Couldn't spawn Pawn of type BP_MinigolfBall_Pawn_C at Rotation: 0.000000 -0.000000 0.707104 0.707110

#

I'm 100% sure that there are no collisions

#

When the spawning fails, ball is spawned on 0,0,0 coordinates

fossil spoke
#

The issue is collision. Most of the time when you have spawning issues like this it is due to collision problems.

#

Make sure that your not trying to spawn actors inside another actor by accident.

#

Change the spawn collision type to always spawn

verbal slate
#

I tried putting spawn points up in the air and that didn't work out

fossil spoke
#

If the players are spawning at the same point they maybe colliding

verbal slate
#

So there's a possibility that UE chooses same spawn point for both players?

#

Tried setting spawn collisions to always spawn, ignore collisions but still getting the error

bronze lava
#

Doing an RPC to "Set Throttle Input" doesn't seem to work? :/

heady delta
#

@bronze lava If you're using the default wheeled vehicle, if you set the vehicle to replicate, throttling is replicated by default, keep in mind that it has to be done be the owning controller since it is a pawn

bronze lava
#

Yeah I got it to work, thanks anyway :)

agile lotus
#

I'm having trouble replicating my OnJumpApexReached
hang on I'll post a screenie
I bind the event on BeginPlay of the Pawn but for some reason it never gets called while online. I replaced my custom jump logic with the default Jump and it still wasn't called

#

Stop Jumping is also ignored by default jump on client

fresh saddle
#

@agile lotus is your character set to replicate?

sturdy urchin
#

Ok, i hacked Vive multiplayer via C++

wary willow
#

@sturdy urchin gj

sturdy urchin
#

Thanks

agile lotus
#

@fresh saddle yes everything else replicates, movement, jumping, attacking. but jump just never ends so the character flies up

smoky ore
#

My team and I are having an issue where a certain variable is not replicating properly. The server sees it it's supposed to be, but the client see it how it started, what would be the cause of that?

fringe dove
#

is multiplayer shootout supposed to pull up the steam overlay when you launch it standalone? I see it is configured for steam in the DefaultEngine.ini, but it doesn't seem to bring it up.

wary willow
#

@fringe dove makesure plugin is enabled if you are 4.13+

#

and/or not disabled in steam settings

agile lotus
#

I can't get Stop Jumping to call on a client

#

But it works fine on the server

fringe dove
#

@wary willow thanks, that was it, it is showing up now

wary willow
#

@fringe dove no prob

raven holly
#

Anyone know the default # of players on a server these days?

fresh saddle
#

@raven holly what do you mean? Like limits?

night jay
#

Question regarding Steam integration

raven holly
#

Yeah wasnt it 64?

#

Or something

night jay
#

Why does Epic not update the sdk version themselves? And are there any issues with using newer versions with UE4?

fresh saddle
#

@raven holly depends on implementation tbh

heady delta
#

I think you run into CPU problems before you run into network problems

raven holly
#

Ahh

#

CPU for each player or server CPU?

#

I guess both

heady delta
#

Everything, depending on how your animation blueprints are setup

raven holly
#

Animation BP affect performance? ๐Ÿ˜ฎ

heady delta
#

Yiss, I think at least with animations themselves that unreal automatically has a LOD for them, but you'd have to check that

raven holly
#

Ok

#

Player rendering will also come into play as well.