#multiplayer

1 messages ยท Page 551 of 1

unkempt tiger
#

what should I abandon? UCLASSes?

chrome bay
#

sort of thankful Epic has tried it to some extent with the gameplay abilities

unkempt tiger
#

im fine C++'ing up all my game if that's what it takes

clear copper
#

Does every player get their own copy of the GameInstance or is it just the host's copy that everyone gets?

chrome bay
#

their own copy

#

no networking for game instance

clear copper
#

ty

thick jungle
#

probly a really simple solution, but I kinda lack the knowledge...
how can I intercept this message on the server? All I wanna do is call "Quit Game" when receiving it

#

(basically just gotta know when someone leaves. It's a 1-v-1 game type and the overarching server will work perfectly if I can just shut the game down automatically)

glad wharf
#

I think the OnDestroyed method of the PlayerController on the server should be called after a player disconnect, maybe there is a more "direct" function

thick jungle
#

just bind a new event to the OnDestroyed thing?

glad wharf
#

in C++ or BP you can override the "OnDestroyed" (in BP it may be OnEndPlay)

#

well yes it should work

#

actually, it assumes that you never destroy player controllers in any other way so probably not the best solution

thick jungle
#

well, the game is 99% functional ๐Ÿ˜› I quite literally just need this to work whenever ANY player leaves

#

max player count is 2 per server anyway

glad wharf
#

I mean, depending on how you change maps, PlayerController could be destroyed

thick jungle
#

ah...

#

any other moment??

#

cus server-side I never switch maps

glad wharf
#

I mean I'm not I know every way a PlayerController could be destroyed, so maybe you would have some suprises along the way x)

thick jungle
#

can't wait! ;-;

#

isn't there a OnPlayerLeave kind of event or something??

glad wharf
#

Actually looking in the code:

void APlayerController::Destroyed()
{
    if (GetPawn() != NULL)
    {
        // Handle players leaving the game
        if (Player == NULL && GetLocalRole() == ROLE_Authority)
        {
            PawnLeavingGame();
        }
        else
        {
            UnPossess();
        }
#

so PawnLeavingGame() in APlayerController seems to be when you can be sure it's actually your player leaving the game

#

if you can't access it in Blueprint, just doing the check they do should do the trick, if the comment is correct

thick jungle
#

sounds like I've got a solution. Thanks ๐Ÿ˜„

thick jungle
#

@glad wharf nope ๐Ÿ˜ฆ didn't work

#

can anyone help?? how can I intercept this message on the server? All I wanna do is call "Quit Game" when receiving it

#

I've currently got it bound to: PlayerController's Event Destroyed and Event End Play
as well as GameMode's Event OnLogout

empty matrix
#

How can I replicate a timeline?

cosmic trail
#

Does a Projectile as an AActor sound like a bad idea? How else would be an optimal way to do it, where the unit firing isn't responsible for the projectile(unit dies, but projectiles continue) but the replication is efficient?

#

Also since I'm doing an RTS with 200+ units, I expect there to be a ton of projectiles..hence why I don't think the AActor way makes sense

empty matrix
#

How can I replicate a timeline?

twin juniper
#

I dont think you can

#

nor you should

#

what do you want to do @empty matrix \

#

@cosmic trail dont replicate your projectiles

#

just fire them both on client and the server at the same time

#

but check for hits on server

cosmic trail
#

@twin juniper hmm so replicate the firing portion through the firing unit maybe, but spawn them separate but can be aactors still

twin juniper
#

yeah only let the both client and server know the direction

#

not necessary to replicate and its bad for fast things to replicate

#

it will definitely lag if you with replication

cosmic trail
#

ok that sounds good. Thanks @twin juniper will try that.

empty matrix
#

I'm making a skill system for each character, and I made an ability for a character and made a very smooth disintegration effect

twin juniper
#

well then fire it on client

#

why replicate if its cosmetic

empty matrix
#

I did not understand

twin juniper
#

is disintegration effect has any functionality regarding gameplay ?

empty matrix
#

Yes, I did to balance the skill, as the other players need to see the disintegration working

twin juniper
#

well than go with multicast

#

timeline uses tick

#

Multicast is heavy too but better than replicating the timeline

#

Im not exactly sure what you are trying to achieve

#

but still timelines shouldnt be replicated

#

and I dont think they can be

empty matrix
#

Im not exactly sure what you are trying to achieve
@twin juniper I'm doing an invisibility stealth system

twin juniper
#

so is this effect for going in - out of invisibility ?

empty matrix
#

Then I put this effect to make a skill balance.

#

so is this effect for going in - out of invisibility ?
@twin juniper Exact

#

I'll send a video

twin juniper
#

you can use multicast for the effect

#

instead of firing the effect on only server and replicating it

#

you tell everyone to play effect on this player

empty matrix
#

It worked, but then when I click the "Z" key it doesn't work again

twin juniper
#

what do you mean Z ?

empty matrix
#

It doesn't actually perform the effect, but invisibility works

#

what do you mean Z ?
@twin juniper Z key on keyboard

twin juniper
#

yeah whats the Z used for

#

is it for invisiblity ?

empty matrix
#

Yes

twin juniper
#

cant say much without seeing the code

#

at this point

empty matrix
#

cant say much without seeing the code
@twin juniper Copy and paste in some project, for you to understand

twin juniper
#

how did you manage the skill ending

empty matrix
twin juniper
#

@empty matrix shouldn't you use multicast/repnotify for such an ability

#

this is a problem

#

so you don't fall out of sync with the server

empty matrix
#

@empty matrix shouldn't you use multicast/repnotify for such an ability
@twin juniper Why?

twin juniper
#

there us too much delay node

empty matrix
#

so you don't fall out of sync with the server
@twin juniper Why?

#

there us too much delay node
@twin juniper So what do I do?

twin juniper
#

this effect wont fire until initial timeline`s stop + 6.5 seconds

#

from my knowledge if other actors aren't relevent when you go invisible they can fall out of sync with server

#

use timers

#

timehandles

#

if they are always relevent shouldn't be a problem i guess i'm new to networking though

#

Fire Go Invis effect on timerstart

#

leave invis after timer ends

#

dont use delays

#

they are bad practice on multiplayer

empty matrix
#

How do I use this?

#

this is a problem
@twin juniper Why?

twin juniper
#

I am not really sure but someone else told me so I am a liar of someone else

#

anyways

#

what you can do is something like that

#

since those render in main pass and all those things need to be fired on every client

#

there is no need for server other than inital calling and setting the variables\

#

on server go multicast to go invis

#

Timeline for "Start" effect

#

and continue from Finished

#

sure use 6.5 delay

empty matrix
#

I dont understand

twin juniper
#

and put in the stop

empty matrix
#

Can you make this and shere to me?

#

Please

#

I really need this

empty matrix
#

and put in the stop
@twin juniper Please... I really need this

gusty slate
#

Hello,
I assume that because Widgets are client only, using GetController with index 0 will return the local controller?

twin juniper
#

all clients are index 0 usually

thick jungle
#

3rd time I'ma ask this here today... cus I really need a solution ;_;
How do I close the game when there's no players in it? Or when a player leaves? or just generally ANY way for me to shut down an abandoned instance??

cursive mortar
#

Hello all,
I always get: "LogNetPlayerMovement: Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)"
It works perfectly when dedicated server is run in Editor, but it doesn't work when I try to move on external hosted dedicated server.
I used "AddMovementInput" to move the character.

Everything else works: effects, items, players. I can connect but I get this error and do not know how to solve it.
For some reason the server is not getting / processing the SavedMoves

If someone can help me, I would be so happy.

thick jungle
#

@cursive mortar
you're probably not timing out when in-editor cus of no latency. Though I have no clue what the thing is you're actually using or whatevs

cursive mortar
#

@thick jungle It's been already 2 days I am trying this on my own. Also tried to get some help and tried some tutorials, and it doesn't seem to work.

thick jungle
#

try sending it 20 times per second instead of every frame?

#

movement packets are usually not sent 96 times within the timespan of 90ms ping ;p

#

I don't suppose you've got any ideas for my issue right above yours??

cursive mortar
#

@thick jungle Sorry Joey, can't help you. I also am not sending anything, or set the amount to send, I just use AddMovementInput on tick().

#

I really do not know where to search anymore...

hazy siren
#

@thick jungle when a player leaves, check how many players are left and call QuitGame if its's 0

thick jungle
#

@cursive mortar then you're sending it every tick ;)
set a timer on 0.05 second and send the packet in there

#

@hazy siren yeah, that's the theory... Where do I actually build that? Cus so far the 3 spots that I've found aren't doing that

hazy siren
#

what doesn't it do

thick jungle
#

I'm currently running build #6 of today having added this... I'm starting to lose hope..

#

shut the server down. I go into the game, get waiting on player 2, and press alt f4

#

the server then receives a "player left" log message, but none of this code is triggered

cursive mortar
#

@thick jungle I will try with a timer, thanks ๐Ÿ˜„

thick jungle
#

@cursive mortar happy to help where I can ๐Ÿ™‚

cursive mortar
#

I hope it works XD

hazy siren
#

literally none of it?

#

add some log calls in there and figure out what's not matching

thick jungle
#

@hazy siren every build takes me like well over an hour ๐Ÿ˜ฆ any other suggestions?

hazy siren
#

Why would that be? You're not rebuilding anything

thick jungle
#

cus it's the dedicated server that needs to shut down.. so I need to package it into something that I can then upload to SVN, download it onto the server, and try again

hazy siren
#

you can invoke a dedicated server right out of the editor

thick jungle
#

and it will override the join ip address command to localhost??

#

(I did NOT know that btw)

hazy siren
#

I'm not sure what you mean

#

go to play->advanced settings

#

then look here

thick jungle
#

gonna try it out once this build is done running ๐Ÿ™‚

#

if this actually works for testing... it should make it soooo much easier

cursive mortar
#

@thick jungle I tried to move the character with timer, but it doesn't move at all anymore. XD I have no idea what happens....

cursive mortar
#

@thick jungle It seems that as long as I have a timer in my Character, it can not move at all for some reason :/. Curiously the game runs at 400 fps when connected to the dedicated server. Maybe that is why I get ""LogNetPlayerMovement: Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)"

cursive mortar
#

I think I found the solution. Actually I am more than sure I found the solution. I will test tomorrow more and post it here for eveyrone else.

versed ocean
#

Anything special I need in terms of the code, etc when attempting to build the dedicated server?. I made a new Targets file.. rebuild the project files.. went in to build the "Development Server" and get: "Server targets are not currently supported from this engine distribution." I'm on 4.25.1

shrewd tinsel
#

how does one kill and respawn a bot and keep its playerstate?

versed ocean
#

apparently i needed the full server code from github. Sometimes just asking the questions lights enough of a fire, eh?

still cape
#

So, reliable RPCs will block other reliable RPCs right

#

is this true across actors?

versed socket
#

If I'm a remote client, I don't have any knowledge of the NavMesh data. So, if I want to know whether I'm able to issue an order to an AI Character to move to a location... it seems like the only way is to ask the server to perform that check and get back to me.

Obviously, that doesn't scale at all because for every remote client on the server you'll have frame-by-frame queries going back and forth as people move their mouse around the world. So, surely there must be an alternative... right?

#

I hope there's something I'm just not aware of yet to help deal with that use case. At the moment, it seems like I would have to fake the navigation query for the remote client by just allowing the player to "think" that they can order the AI Character if they're just looking at any Static mesh in the World, so that the navigation check only happens when an order is actually issued, at which point we can tell the remote client that it's not doable.

twin juniper
#

league does something similiar i guess

#

you click it draws the second u click

#

and.gets fixed later on

still cape
#

Has anyone here messed around with making their own "components" like UCharacterMovement and replicating those?

somber glade
#

When you find sessions, should it be returning full sessions by default? I'm currently using advanced sessions, which seems like it should return full sessions by default, but it isn't. If I set max 2 players and host, then join, and use a second client to search that session isn't returned.

thick jungle
#

@cursive mortar yeah. Probably.. ๐Ÿ˜‚ youโ€™re sending 400 movement packets over every second ๐Ÿ˜‚

cursive mortar
#

@thick jungle Yeah :))) I found now try 3 solutions for this, but need to work on the 3rd one which might be the best

thick jungle
#

@cursive mortar good luck! Iโ€™m still stuck on shutting down the server when a player leaves :(
... ffs... I need to go live tomorrow and I need that thing resolved or I canโ€™t ๐Ÿ˜ญ

cursive mortar
#

@thick jungle I hope you will solve it! best of luck to you! ๐Ÿ˜„

glad wharf
#

@thick jungle I don't understand, yesterday I totally forgot about GameMode::OnLogout, this one is not triggered on the server?

thick jungle
#

nope... none of the 4 methods I'm using are working... lemme re-send screenshots

glad wharf
#

(btw it's also based on the PlayerController being destroyed)

#

did you manage to run a dedicated server through the editor? It will indeed reduce significantly your iteration time

thick jungle
#

trying to get that dedicated server up through the editor atm. It's 8:30am and I just started 10 seconds ago

glad wharf
#

If you put a Print String right after the "OnLogout" (with the "log" option checked as it's in dedicated), is it displayed when a player leaves?

#
"D:\Engines\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\MyGame\MyGame.uproject" /Game/MyGame/Maps/MyMap -server -log -port=8003

Replace the paths and put this line in a server.bat and it will fire up a dedicated server on port 8003

#

(the port option is, well, optional)

#

"D:\Engines\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\MyGame\MyGame.uproject" -game 127.0.0.1:8003 -log -ResX=800 -ResY=600 -WINDOWED
And this line in a client.bat you can fire after the server started

#

you can of course use the editor interface but sometimes I find the .bat solution more straightforward and less buggy

thick jungle
glad wharf
#

your screen is too low res, what is in the Quit Game node?

thick jungle
#

default options. Quit and boolean disabled for Ignore Platform Restrictions

glad wharf
#

So, while testing in editor, try with also EndMap

thick jungle
#

that thread does tell me that QuitGame should work, which is at least good to know ๐Ÿ™‚ but the actual solution it offers isn't useful in my situation ๐Ÿ˜ฆ can't rely on a "proper shutdown"

glad wharf
#

I don't know if using the editor to launch a dedicated server means QuitGame won't work. I seem to remember that in PIE that's the case, you have to call EndMap or something like that.
But in packaged it should not make a difference

#

If you can go to C++, you could test this brute force:

#if WITH_EDITOR
        GUnrealEd->EndPlayMap();
#else
        FGenericPlatformMisc::RequestExit(false);
#endif
thick jungle
glad wharf
#

Well, it may be only available in C++

#

but just the RequestExit should be enough. It's not exposed to BP but it's easy to do

#

is your project BP only?

thick jungle
#

I'll try that C++ bit ๐Ÿ˜„

#

nah, I've got stuff like RakNet implemented

glad wharf
#

just use like UBlueprintFunctionLibrary exposing to BP the RequestExist

#

ok cool

#

Before that, you could also just put a DoOnce before your ApplicationQuit. Not sure the engine likes to be asked to quit each tick

#

so, it may be another reason the exit does not work (beside the fact that your OnLogout seems not to be called)

thick jungle
#

I've currently put that bit of code into a function, followed by "exit(0);"
compiling now and hoping lol

#

that should avoid that DoOnce issue as well I'm guessing?

glad wharf
#

don't know ๐Ÿ˜„

#

but we would need to be 100% sure the OnLogout is not fired on the dedicated. That's nearly impossible that it's not, the bug must be somewhere else

#

I would also try to disable all the calls to QuitGame in your code, and in the GameMode begin play, put a delay like 10 seconds and then call ExitGame. Just to be sure the node works / does not work, even without any player connected

thick jungle
#

I've got a launch date tomorrow, kinda don't wanna risk turning stuff off I don't need to ;p

#

but I'll give that second option a shot ๐Ÿ™‚

glad wharf
#

I meant just for testing, and isolating the problem ๐Ÿ™‚

#

because right now it's not very clear (at least from my pov) what's working and what's not

thick jungle
#

hahaha, yeah same sentiment exactly ;p

#

I'd be happy to give you TeamViewer control if you want to, but I'm also very happy with the help I'm getting just now

glad wharf
#

haha I'm also working in // so not very practical for me ๐Ÿ˜‰ (and actually I have no other idea right now ๐Ÿ˜ฎ )

thick jungle
#

yeah figured as much ๐Ÿ˜‰ Just wanted to offer it just in case

warped stream
#

but I'll give that second option a shot ๐Ÿ™‚
@thick jungle
Since you are a very very responsible project manager, that backups his work using source control, you can just not commit your changes :P

glad wharf
#

well, the exit(0) may be a bit dangerous (I don't know tbh) but if indeed this is called and does not do anything, that would be really surprising

thick jungle
#

@warped stream just stressed out man. My mental state of the code is too important right now. You're right though and that is a valid option that I was aware of ;p

warped stream
#

I was just joking :D

#

Enjoy your lunch..eh I mean launch

thick jungle
#

hahaha thanks ๐Ÿ˜‰

#

@glad wharf where did you get that GUnrealEd variable from? I know it's the editor, but don't know how to access it

#

(15 years of C++ experience.... 3 months of UE4 lol)

glad wharf
#
#if WITH_EDITOR
#include "Editor/UnrealEd/Classes/Editor/UnrealEdEngine.h"
#endif```
Sorry forgot
#

not sure it this one

#

if you want to be sure:

#include "Editor/UnrealEd/Classes/Editor/EditorEngine.h"
#include "Editor.h"
#include "Editor/UnrealEd/Public/UnrealEdGlobals.h"```
#

also, I just found that QuitGame is for players only apparently

#

so, if it's that, seems logical it does not work in dedicated

#

checking

thick jungle
#

thanks โค๏ธ

glad wharf
#

the includes are from an older version of Unreal, so they may be wrong :/

#

QuitGame actually executes a console command: quit/quit background/quit force
So indeed, RequestExist seems more sure

thick jungle
#

got a linker error on the GUnrealEd after I'd changed the includes to

#if WITH_EDITOR
#include "Editor/UnrealEd/Classes/Editor/EditorEngine.h"
#include "Editor.h"
#include "Editor/UnrealEd/Classes/Editor/UnrealEdEngine.h"
#include "Editor/UnrealEd/Public/UnrealEdGlobals.h"
#endif

#

but the exit(0); does work when I call it on boot ๐Ÿ™‚

#

unfortunately my code doesn't let me connect to the server while it's in editor for some reason ๐Ÿ˜ฆ but I'm certainly a step closer now!!

glad wharf
#

mmm, you can remove the Editor part, it was just to be sure

#

you mean launching server.bat, waiting for it to be ready, and then launching client.bat won't work?

thick jungle
#

lemme try that ๐Ÿ˜› Like I said, not used to UE4 at allllll

#

client one is just without the -server -log -port?

#

nope.. that boots up the editor hahah

brittle tulip
#

Can anyone tell me when i should use RPC and when i should RepNotify?

glad wharf
#

"D:\Engines\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\MyGame\MyGame.uproject" -game 127.0.0.1:8003 -log -ResX=800 -ResY=600 -WINDOWED
And this line in a client.bat you can fire after the server startet

#

you need -game and your local IP

#

(with port)

#

@brittle tulip RPC are for fire and forget events from server to clients, and the only way for clients to send data to the server. RepNotify works only Server->client and is the way to go when you modify the state and want your clients to react to it

#

(for instance, imagine that a player "late joining" some time after a RPC has been fired, won't ever know the RPC has been fired, whereas they would receive the RepNotify)

thick jungle
#

@glad wharf you're being a hero <3
Almost there with booting it up... getting an error on the map

glad wharf
#

ah

#

that's because you put the "real" path

#

you need to use the "Unreal" path

thick jungle
#

had the fake path (the one you gave) there first and that gave the same error. sec

glad wharf
#

mmm, /Game == content folder

#

Can you show the tree view of your content browser?

brittle tulip
#

I see, so for something like the depletion of player stamina whilst running i just use an RPC?

thick jungle
glad wharf
#

/Game/Maps/ExampleArenas/Arena_CR

#

Unreal has kind of a virtual file system with /Game pointing to your project content folder

thick jungle
#

โค๏ธ

glad wharf
#

๐Ÿ‘

thick jungle
#

IT WORKS ๐Ÿ˜„

#

the server shuts down now when I leave

glad wharf
#

yeay!

thick jungle
#

thank freaking christ

glad wharf
#

haha no problem, glad I could help

thick jungle
#

you're a life safer man

glad wharf
#

if it's meant to run in prod though, I would test without the exit(0)

thick jungle
#

why?

glad wharf
#

well, the "proper multiplatform way" is through "FGenericPlatformMisc::RequestExit(bool)"

#

but well, if exit works...

#

however it's not good practice

thick jungle
#

yeah, I'll give that other one a shot. It shouldn't trigger the WITH_EDITOR through those .bats right?

glad wharf
#

mmm I think they would but actually I'm not sure

#

I mean, it's not PIE but it's still the editor exe

thick jungle
#

#if WITH_EDITOR
//GUnrealEd->EndPlayMap( );
exit( 0 );
#else
FGenericPlatformMisc::RequestExit( false );
#endif

giving this a shot just now

glad wharf
#

@brittle tulip that's a special case and I'm not sure. Because you don't want to flood the network with stamina update but at the same time it's kind of part of the state.

#

ok, then you can try to build the server and check locally (you mentioned having to push to SVN for that but I don't understand why)

#

@brittle tulip so maybe a mix of the two where you tell the client it's starting to loose stamina so it can simulate the loosing, and when the action is finished, the server updates the stamina variable to be sure it's in sync with client

thick jungle
#

the client is hard-wired to that IP address. If I'm running it through a packaged build, I am forced to connect to the C++ queue server that I built that then connects me to a game instance on the specified port

glad wharf
#

ah, there is no way to build a test client with another IP? For instance in development mode you can use the console and "open IP:port"

thick jungle
#

I can whatnow!?!

#

I can run a development build and open the console window?

glad wharf
#

yes, when you package, you can choose between Debug/Development/Shipping

#

in development, you can toggle the console and run a lot of stuff

#

(on an AZERTY it's the ยฒ key, on qwerty I believe its ~)

thick jungle
#

yeah, so far we're forced to use Development mode since the Accessibility features for screen readers (we've supported play for the visually impaired) doesn't work on shipping build :(

which is reallllyyyy obnoxious.. but don't know how to resolve it lol

#

THANKS!

glad wharf
#

uh, strange, don't know anything about accessibility features in Unreal but indeed strange if they don't work in shipping builds

thick jungle
glad wharf
#

thx

thick jungle
#

it's not something you'd normally try and do ;p

#

took us 2 months of a single programmer to get implemented, on a game that happened to have a design that fit it perfectly

glad wharf
#

ok so it's not that built-in ^^

thick jungle
#

that feature is about 25 lines of code inside the UE4 engine itself :P
it literally just reads out the bit of text that is underneath your mouse...

#

oh, now I've got someone with experience on the other end anyway... have you ever had to have multiple game instances running?

glad wharf
#

what do you mean by multiple game instances running?

thick jungle
#

like, say you have games of 10 players max. And you've got 100 players all wanting to play at the same time

brittle tulip
#

I see, thank you for the help, gave me a little more insight into how this multiplayer thing works lol. @glad wharf ๐Ÿ‘

glad wharf
#

From what I know (but never dealt with that), you need one exe running per game, each one on its own port. Then you will have a matchmaking service wiring players to the correct server

thick jungle
#

right, then I did go for the right path ;p

#

ended up writing a custom matchmaking server lol

glad wharf
#

Unreal has a OnlineSubsystem interface, with implementations for Steam

#

(at least) and you can write your own

thick jungle
#

yeaaaah.......... it wasn't released at the point we started ;_;

#

it got released like 2 months ago or so

glad wharf
#

arf

#

in any case, their OnlineSubsystem interface seems to be cool, but not easy to grasp when you need to write your own. But the advantage is that then your game/application can support any online platform the engine already supports "natively" or through a vendor plugin

thick jungle
#

yeah.. it really does sound like a good system. It doesn't support cross-platform just yet, but I'm sure that'll come soon

#

(currently I do have cross-platform working ๐Ÿ™‚ just requires the RakNet plugin)

#

I'll probly use their OnlineSubsystem on my next game

glad wharf
#

it does not? I thought that was the point

#

you can override the Online Subystem used in the xxxPlatform.ini

#

from what I understand at least, I may be wrong

#

but they indeed started to change how multi-platform is handled one or two versions ago

thick jungle
#

I can't seem to find the launch page from that anymore, but I quite clearly remember that it got delayed by a year, launched bout 2 months ago, and was so bare-bone that it didn't have cross-platform

we might be talking about something different?

#

those online subsystems seem to be really quite useful though for stuff like friends list and achievements ๐Ÿ˜ฎ

#

saved that link ๐Ÿ˜„

glad wharf
#

I don't know if we are talking about the same thing indeed ๐Ÿ˜„ I was talking about the switcheable nature of the Online Subsystems, so you can easily use Steam, or PSN... only by changing a line in an ini file or specifying it for each platform

thick jungle
#

yeah, it's actually really quite good! :D
I still need to get used to the fact that not everything needs to be custom-coded, lol

#

been working on a custom engine for 4 years which we've now switched over to server-side only and using UE4 for client-side

glad wharf
#

aaah that's why Raknet

thick jungle
#

yep ;)
I already had the code lying about anyway ^^
Just needed to get UE4 to work with it and I had a working connection to a working server ๐Ÿ™‚

glad wharf
#

but in this project you are using unreal for server right? because if not, none of the GameMode stuff etc would apply

thick jungle
#

I'm using RakNet to create a connection to that C++ queue server, which boots up game instances of Unreal servers and sends the port back to the client

#

the queue server expects the game to be shut down when it's done, and it goes wrong if it doesn't since there's no communication between the 2 servers

#

so yes ;p

glad wharf
#

ah ok I see

cursive mortar
#

@thick jungle I manage to make the movement in a thread, limiting the time thus also the sending of the packages. It is still more fluid if done in Tick() but I have to limit the FPS to 90 in order for AddMovementInput() not to overflow the SavedMoves

thick jungle
#

thanks so much again for the help man ๐Ÿ˜„

#

I wouldn't risk it at 90 pal. If they'd get a higher latency than you do atm it'll still cause overflows

#

glad to hear the issue is resolved though ๐Ÿ˜„

cursive mortar
#

Should I limit the FPS then?
It seems that both clients running on the Dedicated server run smooth with 90 fps. That is the max limit. Otherwise I could change the SavedMoves from 96 to a higher one. Everything replicated, cost about 80kb/s upload.
I am really open to other ideas ๐Ÿ˜„

#

I am glad you solved that @thick jungle

thick jungle
#

I'm not sure about your actual implementation ;)
But I'd say give the thing about 100ms delay and make sure it still works in that case.
Or better yet, record the ping and use that to modify the thread speed?

If it works with 90 for now, you might also just keep it at 90 until you're getting the error again

chrome bay
#

Be aware character movement already does a lot of work to stop that happening

#

CombineSavedMoves is what you should look at, that's supposed to prevent you outright overflowing the move buffer

cursive mortar
#

I will try with some delay @thick jungle , But I have no Idea how to modify the thread speed. you mean the processors Thread speed?

#

@chrome bay . I use only AddMovementInput() which is run in Tick(). AddMovementInput() only adds a FVector based on the key W/S/A/D I pressed. For higher frames, it goes in overflow, with more than 96 SavedMoves. I tried to use AddMovementInput() inside a custom Timer, which is limited at 90 times / s

chrome bay
#

Also - you can make that move buffer bigger

#

Yes but the moves you do will be combined into one move up to a maximum delta time. So long as the input isn't changing every single frame, the moves will be combined and sent to the server in brief batches

cursive mortar
#

I was thinking of making the move buffer bigger, but I need to figure how

chrome bay
#

FNetworkPredictionData_Client_Character

cursive mortar
#

I know it is that one, but do not know how to add it to the CMC

chrome bay
#

You can either mod the engine to change the value, or you create your own child-class of CMC which creates your own child of FNetworkPredictionData_Client_Character for the network prediction data

#

but tbh - even at 90fps you shouldn't be running into that move buffer because the moves should be combining

cursive mortar
#

Ok, That is a great idea.

#

I am running that when i have 400 fps :)))

chrome bay
#

Yeah well 400 FPS will definitely cause problems

cursive mortar
#

when I do not limit the game's FPS, it happens

chrome bay
#

But nobody in their right mind is running a network game at 400 FPS

cursive mortar
#

But I was thinking of capping it maybe at 144, in case someone would be able to achieve that

chrome bay
#

You'd be hammering the Server with packets

#

And vice-versa

#

There's a good chance it just won't be able to keep up

thick jungle
#

hence why I suggested sending movement packets once every 0.05 seconds (20 times per sec)

chrome bay
#

Character Movement already does that, that's what I'm saying

thick jungle
#

then how does it get flooded, ever?

chrome bay
#

UCharacterMovementComponent::GetPredictionData_Client_Character() is the function you need to override btw to change what prediction data is created.

#

Usually because people have customised character movement in such a way where moves can't be combined, so it breaks

#

Or the input can't be easily combined because it's variable

#

I.e. changing direction every frame, or input not being very binary etc.

thick jungle
#

like sending over a float instead of an int?

cursive mortar
#

@thick jungle It is not getting flooded when I send the Movement inside a Timer, but it is not as fluid as using Tick()

chrome bay
#

It'll break if you send it via a timer

#

Have a look at UCharacterMovementComponent::ReplicateMoveToServer() and FSavedMove_Character::CanCombineWith

#

If you are failing to combine moves each frame, that's where the problem starts

#

Because then it has to send every frames move individually

cursive mortar
#

@chrome bay I try combining when WS + AD are pressed, but AddMovementInput() is doing the rest.

chrome bay
#

It can't combine them into batches

cursive mortar
#

Thanks a lot!! ๐Ÿ˜„ I will have a loot at those

chrome bay
#

TL;DR, you don't need to do anything manually

#

CMC has all the tools to do all this for you

#

All you need to do is hook AddMovementInput() up to the input bindings

#

And it just worksTM

#

But I would start by checking that moves are combining. 144 FPS is a very high rate for char movement to be running at

cursive mortar
#

@chrome bay Thank you a lot! ๐Ÿ˜„ I will look at all those ๐Ÿ˜„

chrome bay
#

They should really implement a min tick time for CMC

#

So you can limit it to 60 FPS or something

cursive mortar
#

You need to limit the FPS of the game XD

#

Or, make a timer

#

that also works

#

but not as fluid as with Tick()

chrome bay
#

Best way would be to add a delta time accumulator in UCharacterMovementComponent::TickComponent

#

Yeah well, char movement is very finicky about delta times

glad wharf
#

what I don't understand is why you call AddMovementInput() in Tick, I thought it was designed to be called in an input callback?

chrome bay
#

It is yeah

cursive mortar
#

I tried to combine them, from WASD, and make a Nomalize() when they are combined

chrome bay
#

You don't need to

#

Plus it won't work anyway

#

AddMovementInput() adds all the input you give to it into an accumulator

#

that accumulator is then "consumed" by the character each frame and passed to movement

#

Moving at angles is already normalized by the movement component internally

#

You're normalizing is 100% what's breaking it most likely, thinking about it

#

Because those normalised inputs will be difficult to combine

cursive mortar
#

@chrome bay , I tried with and without normalizing. It works the same, but smoother with Normalize, since a diagonal vector would be in size 0.07. Non-Normalized, would be 0.1

chrome bay
#

the input vector doesn't matter to char movement

#
                Acceleration = ScaleInputAcceleration(ConstrainInputAcceleration(InputVector));
                AnalogInputModifier = ComputeAnalogInputModifier();```
#

It already does what you're doing

#

also bear in mind the input "vector" to char movement isn't strictly a vector

#

at least it's not treated that way

#

It's a dumb naming convention unfortunately

cursive mortar
#

I will keep that in mind ๐Ÿ˜„ Now I have "homework" to do. Thank you a lot guys!! ๐Ÿ˜„

chrome bay
#

Basically, UE already did all the hard work for you ๐Ÿ˜„

#

Just copy-pasta what they did in the sample projects and all should be good

thick jungle
#

@cursive mortar is that what they call it these days? ๐Ÿ˜›

cursive mortar
#

@chrome bay I used some other tutorials for this XD maybe I should learn from their official templates.

#

@thick jungle or home-office-work :))

chrome bay
#

yeah be wary of third-party tutorials - especially multiplayer ones

#

80% of what I've seen is total nonsense

thick jungle
#

@glad wharf FIXED! ๐Ÿ˜„

glad wharf
#

awesome!

cursive mortar
#

@chrome bay I added AddMovementInput() inside the Callback, but the movement is so jitterish ๐Ÿ˜ฆ

chrome bay
#

hmm I guess it depends if you've added anything else there

cursive mortar
#

I only have and If (!HasAuthority() && AxisValue != 0) { AddMovementInput(FVector(0.1f, 0.0f, 0.0f) * AxisValue, PlayerMovementSpeed);}

chrome bay
#

Are you moving with a gamepad or WASD?

cursive mortar
#

WASD

chrome bay
#

Here's an excerpt from ShooterGame:

#
{
    check(PlayerInputComponent);
    PlayerInputComponent->BindAxis("MoveForward", this, &AShooterCharacter::MoveForward);
}

void AShooterCharacter::MoveForward(float Val)
{
    if (Controller && Val != 0.f)
    {
        // Limit pitch when walking or falling
        const bool bLimitRotation = (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling());
        const FRotator Rotation = bLimitRotation ? GetActorRotation() : Controller->GetControlRotation();
        const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
        AddMovementInput(Direction, Val);
    }
}```
#

Shouldn't need the 0.1 vector btw

#

just pass "Val" straight in

#

Movement speed should be set in the character movement comp

#

MoveRight is even simpler:

{
    if (Val != 0.f)
    {
        const FQuat Rotation = GetActorQuat();
        const FVector Direction = FQuatRotationMatrix(Rotation).GetScaledAxis(EAxis::Y);
        AddMovementInput(Direction, Val);
    }
}
cursive mortar
#

The "Val" is my "CharachterMovementSpeed"

chrome bay
#

Yeah that's where it's going wrong

#

You want the val to be the literal input from the binding

#

The movement speed and other params are determined by the movement component

#

Example:

{
    float MaxSpeed = Super::GetMaxSpeed();

    const AShooterCharacter* ShooterCharacterOwner = Cast<AShooterCharacter>(PawnOwner);
    if (ShooterCharacterOwner)
    {
        if (ShooterCharacterOwner->IsTargeting())
        {
            MaxSpeed *= ShooterCharacterOwner->GetTargetingSpeedModifier();
        }
        if (ShooterCharacterOwner->IsRunning())
        {
            MaxSpeed *= ShooterCharacterOwner->GetRunningSpeedModifier();
        }
    }

    return MaxSpeed;
}
#

The server and client need to be able to independently and deterministically determine the MaxSpeed at anytime for replaying moves etc.

cursive mortar
#

Ok, ok. I get now what you mean ๐Ÿ˜„ I hope

chrome bay
#

check out the shootergame sample

#

it covers a lot of this stuff

cursive mortar
#

Only with AddMovementInput(Direction, Val); it moves really really slow. But I will pass in the MaxWalkSpeed for this

#

ok, thanks a lot for the tip and help! ๐Ÿ˜„

chrome bay
#

Yeah you probably need to tweak the movement comps' params

#

np's. Not sure what tutorial you were following but don't do it again ๐Ÿ˜„

cursive mortar
#

I did about 8-9 tutorials. And this with AddMovementInput() seemed the nicest to use. Other were using CharacterLocation and Making special list of SavedMoves and Intepolations to run on server.

chrome bay
#

sighs

#

People like to make life hard for themselves ๐Ÿ˜„

cursive mortar
#

I know, that's why I like this more XD Except these minor setbacks.

brittle tulip
#

If i have a setter for a replicated property do i need to do it like this?

void UPlayerStatComponent::SetCurrentStamina(float StaminaValue)
{    
    if (GetOwnerRole() == ROLE_Authority)
    {
        CurrentStamina = FMath::Clamp(StaminaValue, 0.f, MaxStamina);
        FString staminaMessage = FString::Printf(TEXT("%s - Current Stamina: %f"), *GetOwner()->GetFName().ToString(), CurrentStamina);
        GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, staminaMessage);
    }
        
}```
chrome bay
#

Looks okay yeah

brittle tulip
#

sorry im just trying to get my head around this replication stuff, somehow it is boggling my mind lol

#

What i don't understand is that if i took the ROLE_Authority part out it seems to work fine

chrome bay
#

Well the important thing is that function as-is will only do anything if you call it on the Server.

#

(Assuming the owning actor was spawned by the Server, that is)

brittle tulip
#

okay thank you

void pasture
#

Hello! I'm trying to have an ACharacter movement being completely controlled on the server - that works well for everyone but the owning player (third person; character won't rotate and movement stutters). I suspect that the client tries to use the local movement data to interpolate, but causing these effects due to no local movement happening. Any hints on where to look would be highly appreciated!

chrome bay
#

My advice would be not possessing the character

#

The Character systems is specifically designed so that the owning player can move it without latency.

void pasture
#

thanks - I've considered that as a work-around (not tried it yet, though), but this might cause me issues with other parts that I do want to be locally controlled (e.g. rotation while not moving)

#

btw, as that character is currently the default pawn, is there a typical way to still spawn it, but prevent it from being possessed automatically?

dry turret
#

i need urgent help with the following error: NotifyAcceptingConnection: Server (levelname) refused - it occurs randomly and causes PostLogin to fire, attempting to do Steam authentication all over again, and no matter what i try i can't make it acknowledge that the player was already authed, like all variables are getting reset. can anyone suggest a good way to see if the player is authenticated via Steam?

hazy siren
#

@jfaw while you still want the server to handle the actual moves, you can turn on client-side navmesh generation in your project settings and use it for client side pre-checks

brittle tulip
#

Hey, i have a problem i just setup a way for players to sprint which changes the players speed, this works, and on another client the player looks as though he is running. However, on the client running the animation seems to stutter. Anyone know why this could be happening?

void pasture
#

@brittle tulip looks like this might be exactly the same issue I'm having (and didn't solve yet)

brittle tulip
#

@void pasture I just fixed it by doing setting the MaxWalkSpeed on the client side

hazy siren
#

it might because the replication of the flag that sets the max speed, and the replication of the movement using the max speed, are out of sync conversation about that above

brittle tulip
#

What do you mean - replication of the flag?

#

also is there any way to sync them up?

void pasture
#

@brittle tulip sounds like it's not the same issue than (although somehow related) - so won't help me ๐Ÿ˜ฆ but thx!

brittle tulip
#

Ah sorry about that

#

Is it actually okay to do something like this or is it going to bring up problems later?

void UPlayerStatComponent::SetMaxWalkSpeed(class UCharacterMovementComponent* CharacterMovementComponent, EMovementSpeed MovementSpeed)
{
    if (GetOwnerRole() < ROLE_Authority)
    {
        CharacterMovementComponent->MaxWalkSpeed = GetMovementSpeedByEnum(MovementSpeed);
        ServerSetMaxWalkSpeed(CharacterMovementComponent, MovementSpeed);
    }
    else if (GetOwnerRole() == ROLE_Authority)
    {
        CharacterMovementComponent->MaxWalkSpeed = GetMovementSpeedByEnum(MovementSpeed);
    }
}```
glad wharf
#

hey, does anyone know how I can persist a USTRUCT owned by the GameState when seamless traveling?

mystic pilot
#

Can you move it to a third party actor that can be duplicated similar to playerstates?

chrome bay
#

GameState is kept with seamless travel isn't it?

#

Override void AGameModeBase::PostSeamlessTravel() and handle it there

glad wharf
#

so you mean that this struct should be already kept as is?

#

because it does not seem so ๐Ÿค”

#

@mystic pilot I suppose I could, I thought being in GameState was already a good thing but maybe not

chrome bay
#

The GameState will be kept for seamless travel, then destroyed afterwards

#

But you can write your own functionality to propagate it to the new gamestate

glad wharf
#

aaah ok I see, will check that, thanks!

chrome bay
#

Check out AGameModeBase::GetSeamlessTravelActorList()

mystic pilot
#

^ that.

chrome bay
#

(by default gamestate is included)

glad wharf
#

well I tried to override it but just adding the GameState seems to crash the game (or the crash comes from somewhere else, don't know with this 4.25 + Oculus Quest nightmare x) )

#

ah, I missed that

#

but if it's included, why the need to propagate?

chrome bay
#

Because the original actor will be destroyed

#

Seamless travel doesn't technically keep the old actor, it just brings it along, then destroys/replaces it in the new world.

glad wharf
#

ah, without copying it's old values

chrome bay
#

Yeah, PlayerStates have some built-in functionality for doing it, but nothing else AFAIK

glad wharf
#

ok, that's not very clear in the doc! Thanks a lot you saved me a lot of troubles ๐Ÿ™‚

chrome bay
#

np's. Actually a bit surprised the game state doesn't also have that functionality, would be useful

glad wharf
#

PlayerState seems to have void APlayerState::SeamlessTravelTo(APlayerState* NewPlayerState)

mystic pilot
#

It mentions various things in World.h

* GameModeBase::PostSeamlessTravel(), and/or GameModeBase::HandleSeamlessTravelPlayer() to handle preserving any information
* that should be maintained (player teams, etc)
* This codepath is designed for worlds that use little or no level streaming and GameModes where the game state
* is reset/reloaded when transitioning. (like UT)
#

Funny it mentions UT there... as last I checked, it didn't use seamless travel.

chrome bay
#

probably an ancient comment ๐Ÿ˜„

glad wharf
#

thanks! so the Gamestate is meant to be reset, I will override GameModeBase::PostSeamlessTravel and try to see if I can grab the old one and the new one to do some copy/paste

mystic pilot
#

๐Ÿ‘

glad wharf
#

mmm, it seems to be the responsibility of UWorld::CopyGameState ๐Ÿค”

mystic pilot
#

Hmm... just when I thought I was doing alright with SteamSockets and such, it starts up again.
sigh

glad wharf
#

in fact PostSeamlessTravel seems to be too late, and the UWorld methods are not virtual so I can't override them, so it seems that...I'm screwed xD

mystic pilot
#

Make a new actor then.

#

Make sure to include it in the GameModeBase::GetSeamlessTravelActorList().

glad wharf
#

the thing that puzzled me is that I see how the PlayerController get back its saved actor list (in HandleSeamlessTravelPlayer), but for the GameMode I don't see where

chrome bay
#

Oh.. hahah yeah that's pretty annoying

glad wharf
#

oh maybe I just need to get the game state, and it will be the old one...

chrome bay
#

I wonder if you can override AGameStateBase::PostInitializeComponents() and copy the properties there before it calls SetGameState();

#

Certainly don't make it easy...

glad wharf
#

the thing is, the GameState is set through UWorld, not the GameMode

#

through CopyGameState

chrome bay
#

It looks like they set it in a few places

#

World->SetGameState() is called all over the place by the looks of it

glad wharf
#

in SeamlessTravelHandler::Tick it does CopyGameState which calls SetGameState yes

#

but as @mystic pilot suggest, I could just use another Actor, but I don't know how to get it back

chrome bay
#

Yeah I see calls in AGameModeBase::PreInitializeComponents() and GameStateBase::PostInitializeComponents() too

#

If in doubt, dump it in the game instance

#

then copy back

glad wharf
#

or I just take the first player controller and use its own mechanism to get it back mmm

#

ah yes indeed should work

chrome bay
#

So long as that player isn't lost during travel ๐Ÿ˜„

glad wharf
#

it's a struct with a TArray, just copying the struct pointer should work shouldn't it?

#

haha yes indeed

chrome bay
#

would have to copy the data itself

#

pointer would become stale once the game state is GC'd

glad wharf
#

ah yes indeed

#

thanks a lot will try that

chrome bay
#

(Y)

mystic pilot
#

TheActor->bActorSeamlessTraveled = true;

#

So I guess push comes to shove, get all the actors of such and such a class and look for that value.

glad wharf
#

something like for (TActorIterator<MyActorClassWIthTheSavedStruct>) { It->GetTheData(); and then actually copying the data to the game state

#

well, with just a check for bActorSeamlessTraveled before

#

well, actually the GameMode seems to persist and not being destroyed/respawned, so that may be the easiest solution

chrome bay
#

Yeah that's fine so long as you aren't changing to a different gamemode IIRC

glad wharf
#

yes I'm not

#

thanks for your help @chrome bay and @mystic pilot ๐Ÿ˜„

drowsy belfry
#

Hi! Noob question about sessions, how do i change/load a map taking all of my players? I created a session and players were able to join to a "Menu level", now I want to load the "Match level" and take all the players on the session to that level. How do I do this?

I've seen something about executing console commands but im not sure if this is still done like this as the most recent answers are form 2015

mystic pilot
#

ServerTravel

glad wharf
#

and the easiest way to do this in BP AFAIK is "Execute console command" with ServerTravel MapName as argument

drowsy belfry
#

Okay its what i saw, just wanted to be sure that that was still the correct way

#

Thanks!

glad wharf
#

just to be sure, it's impossible to test server travel in editor? You have to package right?

fleet raven
#

yes

glad wharf
#

thanks ๐Ÿ™‚

untold swift
#

Did anyone have issues with Oculus online subsystem with UE 4.24.3?
Find session always return On fail

glad wharf
#

I think 4.25 is my worst nightmare, never had so much crashes so often everyday. last mystical crash: a ProcessEvent wrongfully called on a PrecomputedVisibilityVolume instead of the Pawn after a ServerTravel ๐Ÿ˜ฑ (well, the event should not have even fired in the first place)

polar lotus
#

@chrome bay might you know why this always returns 0

chrome bay
#

Not sure, possibly not a replicated actor?

#

Or no valid network connection at the time you call it etc

polar lotus
#

It surely is

#

I tried even launching the game and creating a session

chrome bay
#

If it's something like an actor placed in the world, I'm pretty certain it won't have a network GUID until it's actually referenced at least once via the network.

polar lotus
#

It is spawned by the GameMode

chrome bay
#

I.e. pre-placed objects will resolve via their full path name until it later acks a net guid

#

Right, and it's a replicated actor?

polar lotus
#

yes

chrome bay
#

Hmm no idea then

#

You'll have to look through I guess

polar lotus
#

ok

chrome bay
#

Thing is, GUID's are unique for each connection - so since the server has no connection to itself, if you call that function server-side I can sort of see why that would be the case.

brittle tulip
#

Can anyone help me, on the right hand side when the player sprints the character glitches out hoever on the other players screen it does not. Anyone know how to fix this?

#

(sorry for low quality)

kindred widget
#

@brittle tulip Judging by the fact that it seems to go away when the character slows, my first guess would be that you're setting a movement speed somewhere for like a sprint effect, but you're somehow not setting it correctly for both client and server.

polar lotus
#

@chrome bay is it maybe because i'm in the editor

brittle tulip
#
void UPlayerStatComponent::SetMaxWalkSpeed(class UCharacterMovementComponent* CharacterMovementComponent, EMovementSpeed MovementSpeed)
{
    if (GetOwnerRole() < ROLE_Authority)
    {
        ServerSetMaxWalkSpeed(CharacterMovementComponent, MovementSpeed);
    }
    else if (GetOwnerRole() == ROLE_Authority)
    {
        CharacterMovementComponent->MaxWalkSpeed = GetMovementSpeedByEnum(MovementSpeed);
    }
}

bool UPlayerStatComponent::ServerSetMaxWalkSpeed_Validate(UCharacterMovementComponent* CharacterMovementComponent, EMovementSpeed MovementSpeed)
{
    return true;
}

void UPlayerStatComponent::ServerSetMaxWalkSpeed_Implementation(UCharacterMovementComponent* CharacterMovementComponent, EMovementSpeed MovementSpeed)
{
    if (GetOwnerRole() == ROLE_Authority)
    {
        CharacterMovementComponent->MaxWalkSpeed = GetMovementSpeedByEnum(MovementSpeed);
    }
}
#

this is how im setting it

kindred widget
#

I'm not familiar enough with C++ to comment on it. I'm used to doing stuff like this in Blueprints. All I do for that is have a bool that is replicated to all, on button press or release, make an RPC to server with a bool input. Use that input to change the replicated bool on the server. On Repnotify set the player's movement speed to normal or sprint based on the bool. In C++ you'd also have to call the same function for the repnotify manually on the server. But basically your server version and all client versions need to have their movement speed set at the same time. If one is moving at different speeds it'll cause that sort of jittering.

chrome bay
#

@polar lotus wouldn't think so, most of the underlying networking is the same

brittle tulip
#

Ahh i see maybe i should do the bool instead

#

thank you @kindred widget

mystic pilot
#

The problem is that your sending in object via the RPC.

#

Make it simpler, it'll be faster.

brittle tulip
#

oh okay

mystic pilot
#

@brittle tulip override this in your own custom movement component instead:

    UFUNCTION(BlueprintCallable, Category="Components|Movement")
    virtual float GetMaxSpeed() const;
#

e.g.

{
    switch(MovementMode)
    {
    case MOVE_Walking:
        if (IsProne())
        {
            return WantsToRun() ? MaxRunSpeedProne : MaxWalkSpeedProne;
        }
        else if (WantsToLean())
        {
            return GetMaxWalkingSpeed();
        }
        else if (WantsToSprint() && !PauseSprinting() && (FMath::Abs(GetMovementDirection()) < 85.0f))
        {
            return IsCrouching() ? MaxSprintSpeedCrouched : MaxSprintSpeed;
        }```
brittle tulip
#

are you saying to do that in my UPlayerStatComponent or make another component derived from the CharacterMovementComponent

mystic pilot
#

Another component derived from the CharacterMovementComponent.

drowsy belfry
#

Hello again, I am testing the Create Session / Join Session workflow in a build, I'm using steam subsystem for this (I don't know if this is relevant) and I have a bug on which players who join cant control their character, I think that its the controller that doesn't auto-posses the character it creates when joining the session but I'm not sure, does anybody now what may be causing this and how to fix it?

brittle tulip
#

Thank you @mystic pilot

still cape
#

Are there any good examples of how to implement networking for components?

#

I understand how to set it up, but I'm more asking for "practical" examples of it being used

#

just trying to get a feel for how I should design things

thick jungle
#

WTH!?! Code that is behind an "Is Dedicated Server" branch check is executed on P1 client-side?????

unique jungle
#

has anyone else experienced issues with seamless travel? Iโ€™ve had things like player meshes not loading, cameras not properly respecting spring arm length, and even client-side crashes at times

willow hemlock
#

Hey everyone. In my UE4.24.3 I have set number of players to 2 and I moved PlayerNetworkStart to be next to the 'original' player. However, when I start the game, I can't see the other player on any 'client'. What might be causing it?

#

However, it just is rendering - physics (collision) works fine.

#

Nvm, fixed the problem. ๐Ÿ™‚

lost inlet
#

@polar lotus hijacking an earlier conversation, but are you having issues with an actor not spawning because an asset's network GUID is invalid?

#

we had that, got worse in 4.23+

#

this would randomly happen after a seamless travel, seemingly affecting the same actors each time

mystic pilot
#

@unique jungle Plenty over the years.
Been using a fix for the following issue for years that helped until UE4.23, where I started getting different issues (NetGUID related).
Switched to non-seamless travel for a bit.
Recently sat down in another attempt to fix the issues and what do you know, there were small changes to the fix along with a single addition.
That single addition seems to have sorted out the issue UE4.23 added.
We are currently using UE4.25.1 with this PR mentioned in this issue and seamless travel seems "fine" thus far.
I only say "fine" because I am paranoid it'll break when its goes out to the wild :(
https://issues.unrealengine.com/issue/UE-24280

@lost inlet See above

#

If you want this fix, you will need to manually patch it into a source build version of the engine, as it is not due to be included until UE4.26.

fossil spoke
#

Jesus really. That would actually explain an issue im having as well with missing meshes...

lost inlet
#

for non-UDN, this was resetting the Ack'd GUIDs in UNetDriver::CleanPackageMaps

#

which involves resetting AckState on each connection's PackageMapClient

#

our issue was: client seamless travels, server doesn't send GUIDs because they haven't timed out yet, a gameplay critical actor doesn't spawn because it's waiting for the GUID for an asset

#

actors not replicating in a sublevel was another issue we had a long time ago and managed to fix

mystic pilot
#

Seems I may need udn access then ๐Ÿ˜›

#

(If just to read suggestions)

#

are you having issues with an actor not spawning because an asset's network GUID is invalid?
@lost inlet What was the error message/warning?

lost inlet
#

Warning: UActorChannel::ReceivedBunch: Received a MustBeMappedGUID that is not registered.

mystic pilot
#

Damn, not the same as the one we were getting.
Thought we might have some common ground ๐Ÿ˜›

#

UPackageMapClient::SerializeNewActor Unable to read Archetype for NetGUID bla / bla

#

After seamless travel only though.
Non-seamless, all good.

winged badger
#

the actors not replicating on a sublevel was fixed in 4.25, no?

#

the issue where the level visibility for clients is wrong

mystic pilot
winged badger
#

never saw the above error

mystic pilot
#

Apologies - don't mean to be spamming that one link.

winged badger
#

is the asset not loaded?

#

seems more plausible then invalid NetGUID

mystic pilot
#

In our case, the assets would load, but not be synced between server/client.

#

Oh, the UPackageMapClient::SerializeNewActor() warning? Only started happening in ... 4.22/23??

#

For us anyway.

winged badger
#

i had that when the actors were allowed to replicate before world's beginplay, while spawning

#

procedurally generated map

#

after we noticed it affects only actors near player starts, we overrode IsNetRelevantFor to return false if the server is still spawning prefabs

#

after that didn't have a single incident

#

we do spawn the entire level separately on clients/server, with same names, and lie to the engine so it treats those actors as loaded from package

#

note: the actors that weren't replicating were still net addressable just fine, you could loot a broken locker and get the loot, just not get any feedback on the locker that you did

lost inlet
#

in our case, the asset IS loaded, it's not getting the GUID. so the "fix" was the just reset the acknowledged GUID list when doing a travel

mystic pilot
#

reset the acknowledged GUID list
Guess that is what non-seamless travel does by default?

winged badger
#

non seamless is hard travel, server is basically seeing the clients for the first time, as far as it knows

mystic pilot
#

Yeah, I kinda phrased that wrong.

gleaming vector
#

non seamless basically kicks all the clients

mystic pilot
#

While seamless maintains the same connection and carries them and other actors with it.

dry turret
#

how normal is it for clients to get randomly disconnected during seamless travel causing logout and login events to be fired again?

polar lotus
#

Ok so

#

I have a super weird issue with my TPS
When my player aims, he puts the gun up to his face
But, if a client aims, the other clients only see the world location change if they can see the player (if it is rendered)

thin stratus
#

There should be some settings on the MeshComponent to tick while out of view or so

polar lotus
#

Ok that seemed to fix it

#

I never knew about that setting

#

is there a way to just update the pose once when my player aims so that the server processes the weapon shot properly

hazy siren
#

there is a way to manually tick the pose, but it'd probably be tricky to get correct since you'd need to know how many frames to do it for and track all that

polar lotus
#

the whole problem is only when I shoot

unique jungle
#

@mystic pilot thanks for the response! I guess Iโ€™ll stick to non-seamless for now, travels arenโ€™t happening often anyway

winged badger
#

@unique jungle hard travel doesn't do too well with steam sockets, if thats a consideration

#

if you have a lobby + game level

unique jungle
#

Ah ok thanks for the info. That probably wonโ€™t be relevant for this project but who knows, definitely something to keep in consideration

winged badger
#

first connect to the server is always hard travel

#

after that, if server changes map you have a choice between seamless and hard

empty vigil
#

Hello guys i have a problem with my find sessions advanced, when i am looking for online session it also displays LAN sessions why ? (please @)

dusty brook
#

I made this video to learn how to use PhotonCloud plugin to add online multiplayer to the 3rd Person Template coming in Unreal 4.25 https://www.youtube.com/watch?v=7oHQl0lxeH8

A briefly intro of howto add online to a thirdperson template with the integration of character replication, translation, rotation, and animation blueprint.

Plugin:
https://www.unrealengine.com/marketplace/en-US/product/76bee07c672c4dbba14df190d82f7f33

Source code of the tem...

โ–ถ Play video
brittle tulip
#

Hey ive just tried to add the function in and use it but im now getting some stuttering? any reason why?

float UMOWCharacterMovementComponent::GetMaxSpeed() const
{
    switch (MovementMode)
    {
    case MOVE_Walking:
        return WantsToSprint() ? MaxSprintSpeed : MaxWalkingSpeed;
    default:
        return WantsToSprint() ? MaxSprintSpeed : MaxWalkingSpeed;
    }
}```
This is where im using it:
```cpp
void AMOWPlayerCharacter::StartSprint()
{
    GetMOWMovementComponent()->bWantsToSprint = true;
    GetMOWMovementComponent()->SetMaxWalkSpeed(GetMOWMovementComponent()->GetMaxSpeed());
}

void AMOWPlayerCharacter::EndSprint()
{
    GetMOWMovementComponent()->bWantsToSprint = false;
    GetMOWMovementComponent()->SetMaxWalkSpeed(GetMOWMovementComponent()->GetMaxSpeed());
}```
When i was just using `GetMOWMovementComponent()->SetMaxWalkSpeed(300.f);` this was working fine
meager spade
#

you need to set the walk speed on client and server, also you should send sprint through the saved moves

brittle tulip
meager spade
#

i mean the only thing i can see that would cause it, would be client/server having wrong MaxSprintSpeed/MaxWalkingSpeed

brittle tulip
#

I have the set max walk speed like that too

meager spade
#

WantsToSprint should be sent in saved moves

#
{
    if (!CharacterOwner)
    {
        return;
    }

    Super::UpdateFromCompressedFlags(Flags);

    bWantsToSprint = ((Flags & FSavedMove_Character::FLAG_Custom_0) != 0);
}```
#

like this

brittle tulip
#

ahhh

#

okay thanks

sweet flint
#

Hi, if I change some replicated varaibles in BeginPlay are they replicated to the client ? or does this change is not taken into account because the replication process is not yet started?

drowsy belfry
#

Hi @sweet flint as far as I know if the client hasn't initialized yet (the server initializes first) and you do things in server they don't get replicated to client because the client is technically not there yet

#

So you have to either do the changes in server a bit later (with a delay or something) which is the bad way of doing it because you cant know for sure how much time it will take the client to load or you can send an RPC from the client saying when they are ready and then when the server receives it it sends the data/changes to the client

sweet flint
#

For me begin play is called on both side so I can load static data without involving network.
I was just worrying to see my static data replicated for nothing as they will be loaded on the client side also ๐Ÿ‘

drowsy belfry
#

If you have data created in begin play on server and client and that data is replicated the server will try to replicate and if the client is ready it will "replicate for nothing" in a sense because the server doesn't know if the data is being initialized on client. Anyway, if you are initializing the data on begin play and it doesn't change anywhere else and it is static as you say I think you dont need to replicate that data

#

And well, changing of topic, I have a question myself channel:

The problem:
I have made a game using sessions with steam subsystem, right now I have a really simple menu with 2 buttons "HOST" and "JOIN". "HOST" creates a session and opens a level with listen as option and "JOIN" joins the first session it finds.
The player who hosts can host perfectly fine, the level opens and they can move around but the players who join can't move, they can see the host moving but they can't move, attack or do anything that requires any input.

What I have tried:
I read that some people had this issue because they were using GameModeBase instead of GameMode and I actually was doing that so I changed my custom game mode class parent to GameMode from GamemodeBase but nothing.
I thought that maybe the player controller was not possesing the player correctly but I print the controlled pawn on the controller and it actually prints it.

So any idea of why joining clients can't control their pawn?
Thanks in advance ๐Ÿ‘

Edit: Formatting

vagrant fjord
#

How is this used?

#

I have tried to search from the shootergame project and scoured the internet but I can't find how it works

#

there's nothing that uses these strings

still cape
#

where does that code come from @vagrant fjord ?

vagrant fjord
#

shooter game

shrewd tinsel
#

why cant i find any steam sessions for my game?

#

im using 2 pcs on the same network, i can host and join in editor and standalone

#

only in the packaged game i cannot find any sessions

crude coral
#

hi freinds! about dedicated game server.. for my multiplayer android game project i need build the server with win64 option or with android options? i talk about the server side and not the client side...thank you

lost inlet
#

does the OSS you use even implement IOnlineEvents?

#

it looks like only xbox live has this implemented in UE4, unless you have a custom OSS that implements this interface but by that point you should know what it does

sullen kernel
#

What do I set as the owner for an enemy actor spawned using SpawnActorDeferred ? I have to set an Owner and Instigator for an enemy spawned on the server.

#

Do I just leave them as null or can I set the server as the owner of the enemy?

lost inlet
#

an owner or instigator is not necessary for a replicated actor to spawn

#

the only time you'll really need it in a networked context is if you have client RPCs you want to call on that actor

thin stratus
#

You can leave them null I guess. You could set the Owner or Instigator to the Spawner/Manager that spawns them if you have one.

#

But ultimately, it's not so important if you spawn a Server Owned AI.

#

At least in "most" cases.

sullen kernel
#

ok thanks. they are being spawned by a function in my GameMode class

shrewd tinsel
#

why doesnt my game open up 7777 port when i host a session / run listen server?

#

its clearly forwarded on my end

shrewd tinsel
#

[2020.06.27-22.27.25:483][515]LogNet: Created socket for bind address: 0.0.0.0 on port 7777

#

does this seem ok?

#

[2020.06.27-22.27.25:483][515]LogNet: GameNetDriver IpNetDriver_2147481850 IpNetDriver listening on port 7778

#

neither 7777 or 7778 are open during session

#

why doesnt it open the ports?

jovial stream
#

How would I go about handling different game modes (deathmatch, team deathmatch, ect.)

lost inlet
#

there's probably a million ways of doing that lol

#

if you have a separate GameMode classes, when you load a map you can override a gamemode by setting ?Game=/Path/To/Gamemode on the travel URL

#

our game uses a scenario system which allows you to enable certain sublevels depending on the game mode

jovial stream
#

alright i'll try that

#

thanks

green delta
#

@thin stratus Thanks for your comments and compendium on the 2018 UE4 multiplayer blueprint comments; I had to refactor that entire project and I am taking into account all your inputs. Thanks again, you're a life save

mystic pilot
#

@shrewd tinselIt isn't designed to open the ports for you - just listen to them.
The ports have to opened elsewhere.

thin stratus
#

@jovial stream In addition to that, you can also setup GameMode ShortCodes in your Project Settings under Maps and Modes. So you can basically link the shortcode "DM" to the gamemode asset and just do "?game=DM".

Can't remember what the exact setting was called but it's somewhere in maps and modes.

#

Makes it a lot easier to work with

shrewd tinsel
#

@mystic pilot if i make a listen server, shouldnt the port open so i can find it?

#

i made a http server on 7777 port, that opened the port

mystic pilot
#

Was that via SteamSockets/SteamNet?

shrewd tinsel
#

no its basic unreal session

#

im using advanced sessions plugin

mystic pilot
#

My bad, you mentioned as much above.

#

No expert when it comes to what a router will/won't allow through.
Could be as simple as being ok with what ever traffic HTTP likes, but not what the server does.
๐Ÿคทโ€โ™‚๏ธ

shrewd tinsel
#

aight

#

any way to check?

#

where its being blocked?

#

if i use steam online subsystem do i have to launch game through steam? do i need to forward ports that way?

mystic pilot
#

While using the Steam sub system with a listen server with Steam running, you're all good.
As a dedicated server, no, need ports opened.

fleet viper
meager spade
#

what bp is that in?

#

cause you cant call Server RPC's from a non owning actor

#

if that actor is something in the level, then it would never work

#

it has to be owned by an actor with a player controller.

quaint viper
#

Can someone help me: I have a strange issue and need a tip to avoid it. how to spawn two Character in one world at the same location. I use Spawn actor from class an gave them the same location, but they spawn in different locations

fleet raven
#

make sure they don't collide with each other

quaint viper
#

they donยดt

#

Also I want to spawn them on different player starts: I have one with the tag 1 and one with tag 2. If I now want to let spawn all at start 1 the client just spawns at start 2 most time. I gave the spawn a bit randomnis so they should spawn on a bit different location, but nothing helps

still cape
#

Is there a way to send "diffs" to a client instead of replicating an entire variable

#

or does that mostly need to be done through RPCs

fleet raven
#

depends how much effort you are planning to invest here

still cape
#

probably not a lot, I'll probably end up just not caring because the size of the replication will only be somewhere around 1kb for something that wont change that often

#

just wondering if there is a somewhat simple way to do diff-ing

meager spade
#

use FFastArraySerializer

#

if you want an array

shrewd tinsel
#

@fleet viper yo what are those red things?

fleet viper
#

@shrewd tinsel breakpoints

#

@meager spade it's a normal replicated actor, but it's owned by a player controller

meager spade
#

then it should work as long as it is owned

shrewd tinsel
#

when is spawn ship event excencuted?

meager spade
#

BeginPlay is too early btw

shrewd tinsel
#

@meager spade what is the best way to do multiplayer? online subsystems? custom solution? amazon?

meager spade
#

i have only done steamm

#

so we use Steam subsystem

shrewd tinsel
#

do u use advanced steam sessions?

meager spade
#

no

shrewd tinsel
#

listen servers?

meager spade
#

ys

#

yes

shrewd tinsel
#

port forwarding requried?

meager spade
#

no we use steams nat punch through

shrewd tinsel
#

oooh

#

right

#

custom cpp solution?

#

steam works?

meager spade
#

4.24+ has a steam subsystem that works

shrewd tinsel
#

is it reliable?

#

do you just create session in bp ?

meager spade
#

no all c++

shrewd tinsel
#

but you use unreals create session?

meager spade
#

i didn't originally

#

i used UWorks

#

but ended up changing it a week ago to use the UE4 session system

shrewd tinsel
#

gotcha

meager spade
#

still use UWorks for most of the steam stuff tho

#

as its handy and has nice BP exposed stuff

shrewd tinsel
#

in my end i cant find any sessions in packaged game, not sure whats the issue

meager spade
#

listen server?

shrewd tinsel
#

can it be 480 app id region?

#

yeah

meager spade
#

we have our own app id

#

never used the generic 480 testing one

shrewd tinsel
#

i have a suspicion thats the issue for me

#

cuz checked everything, but still no sessions found in packaged

meager spade
#

its $99 for a app id right?

shrewd tinsel
#

yea

#

im still waiting my first 99 to pay off

#

i tried opening ports and creating session through epics online subsystem, but port checkers say port is closed when the server is running

#

do you know if it should be open for a listen server?

meager spade
#

its 7777 normally

shrewd tinsel
#

yeah

meager spade
#

make sure your windows firewall isnt blocking it

#

and your router firewall

shrewd tinsel
#

made that sure bunch of times

meager spade
#

also sessions should come through

#

without portforwarding

#

when you create a steam lobby

shrewd tinsel
#

i know

meager spade
#

that is searchable

#

when you join it, you join using the steam.OwnersSteamID command

shrewd tinsel
#

is there a separate function to create a lobby ?

#

or are you talking listen server

meager spade
#

you have to create a lobby

#

for it to show up

shrewd tinsel
#

if it does show up in standalone, means im doing it right, right?

meager spade
#

your probably creating it on LAN

#

not via steam

shrewd tinsel
#

why would that be?

#

automatic failsave mechanism or something>?

#

cuz im definately checked lan false

gusty slate
#

Fax, you have steam open when testing packaged yes?

mellow haven
#

Hello, could you please help me with a validation question I have?
Can I somehow react to server validation returning false on client side?

twin juniper
#

Hi trying to make a chat system, following this tutorial series https://www.youtube.com/watch?v=08q0vJ7GzDA&list=PLnHeglBaPYu_aUsm78py_O_OENKhdCGZS&index=60

Though I am getting an error trying to compile it, and I do not understand much of it unfortunately.

https://pastebin.com/ujs39945 ChatComp.h
https://pastebin.com/ReVv9DML ChatComp.cpp

Sorry for taking up so much space - any help will be appreciated.

In this video we create our chat component class along with some basic functions that we will use for our chat system.

โ–ถ Play video
mellow haven
#

@twin juniper What does the compiler say?

twin juniper
mellow haven
#

I think you have to mark the parameters const in your cpp file as well

#

you have
bool Server_SendMessage_Validate(const FString& Message); in your h file
but
bool UChatComp::Server_SendMessage_Validate(FString& Message) in your cpp file
and I think it should be
bool UChatComp::Server_SendMessage_Validate(const FString& Message) in your cpp file

twin juniper
#

Yes true

#

thanks

#

now it tells me

Severity    Code    Description    Project    File    Line    Suppression State
Error    C4717    'UChatComp::Server_SendMessage': recursive on all control paths, function will cause runtime stack overflow    chattest    C:\Users\malth\Desktop\chattest\chattest\Source\chattest\Private\Components\ChatComp.cpp    29    
#

Guess it's in a loop

mellow haven
#

Is your current implementation of that function in that pastebin above?

twin juniper
#

No sorry

#

void UChatComp::Server_SendMessage(const FString& Message)
{
    Server_SendMessage(Message);
}

In ChatComp.cpp

mellow haven
#

Well, you can't have that, because now the function calls itself. + You should not even have this implementation in you cpp file.

#

you can delete this whole method

#

and keep only _validation and _implementation in your cpp file

#

in your header file you have to keep all 3 of them

twin juniper
#

ahh jesus christ I understand

#

Thanks again, I will rewatch the tutorial heh

mellow haven
#

np, you are welcome

meager spade
#

WithValidation is not required anymore

#

if you are just going to return true

#
void Server_SendMessage(const FString& Message);``` is all you need in the  header
#

in cpp, you have void AMyClass::Server_SendMessage_Implementation(const FString& Message) { //Do Something here }

rugged sandal
#

Hey guys, a question regarding network relevancy. Is there a way to set actor component to be always relevant, regardless of parent actor relevancy?

meager spade
#

nope

#

All components replicate through the actor function ReplicateSubobjects

#

On clients, when the actor is out of relevancy its destroyed

#

meaning there is no components on it

#

as there is no actor.

rugged sandal
#

Destroyed?

meager spade
#

yes destroyed

rugged sandal
#

Wow

#

I was thinking that when actor goes out of relevancy, it just stops receiving updates

meager spade
#

no its destroyed on clients

rugged sandal
#

That's new for me

#

Thanks

meager spade
#

if you want to stop it from recieving updates

#

set it Dormant

#

this won't destroy it client side

#

but it won't recieve updates.

rugged sandal
#

So, make it always relevant, but go dormant?

meager spade
#

yes

rugged sandal
#

Gotcha, thanks a lot

meager spade
#

if you want to send a single update

#

and go dormant again after, use FlushNetDormancy

rugged sandal
#

ForceNetUpdate

meager spade
#

FlushNetDormancy calls ForceNetUpdate aswell

rugged sandal
#

Oh

meager spade
#

AActor::FlushNetDormancyForces dormant actor to replicate but doesn't change NetDormancy state (i.e., they will go dormant again if left dormant)

rugged sandal
#

Ok

#

Thanks, this is very helpful

meager spade
#

np

rugged sandal
#

And I guess there is no way to do that in blueprints, right?

#

By default

#

Unless I expose it

#

Not that I should do that anyways, managing network relevancy in Blueprints is kinda bad idea anyways, lol

meager spade
#

there is

#

SetNetDormancy node

rugged sandal
#

Oh, didn't see that

meager spade
#

and FlushNetDormancy

#

is also a node

rugged sandal
#

Ok, big thanks

clear copper
#

Does the host have access to everyone's HUD?

fleet raven
#

no

clear copper
#

D:

#

ok thaks

#

thanks

meager spade
#

HUD/Widgets are all local

#

and should always be local

clear copper
#

yeah i put a function to show the loading screen in the HUD, but realized i can't tell the player's to call it because i can't get to their hud

#

so gotta move it out

twin juniper
#

WithValidation is not required anymore
@meager spade
Thank you - did not know that ๐Ÿ™‚

meager spade
#

you can client RPC to ask client to show it

clear copper
#

client RPC?

tranquil yoke
#

Hey, Guys what are the best Hosting services that i can use to use as a server ?

swift cargo
#

Hey, when using advanced sessions plugin, do i have to port forward?

#

if so what port? and is there anyway to negate having to port forward for each person wanting to host?

#

@clear copper "remote procedure call" he just basically said Client tells himself to add it.

clear copper
#

Hmm ill look it up

fleet viper
meager spade
#

you cant call SetOwner on the client

#

and expect it to allow an RPC

fleet viper
#

ohh shoot

#

yeah right

#

wait but if i have to set the owner on all (multicast) how do i do that? because i can only replicate things if the owner is set

meager spade
#

when you spawn the actor

#

you set the owner

#

on the server

#

why not just move that server rpc to the player controller

#

and call that function pass in the ReplicationActor

#

and job done

fleet viper
#

problem is that the actor was already dropped in the level

#

i figured it out now, but the problem is that the actor should spawn another actor and im now thinking of moving the spawn part in the player controller who ordered it

#

but that would allow cheating

lost juniper
#

Is there a way to update a variable based on change in another variable?

twilit patrol
#

Anyone Familier with replicating could help me with a issue with a ladder. DM me if at all possible. Thanks.

fossil spoke
#

Ask your question here. Its much easier.

#

Others may also learn something.

lavish cypress
glad lintel
#

I am confused here. I'm just trying to figure out which one is the server and which one is the client by printing the role of the locally controlled character on the screen. I expect one window to be the server and show "Role: ROLE_Authority" and the other window to be on client and show "Role: ROLE_AutonomousProxy". Instead both of these lines print to the same window.

Also why do both windows show [NetMode: Server] on the top bar? Should one be NetMode: Client? Is this related? In the editor options I selected "play as listen server".

chrome bay
#

Yeah that's mine @lavish cypress

twilit patrol
#

I'm running into a issue with a ladder.. Serversgoes up fine, client however does not.. and im not sure why?

chrome bay
#

@glad lintel If you're on 4.25, the windows names are broken. Someone submitted a PR but it hasn't been taken yet IIRC

lavish cypress
#

I assume you were able to use the Sparse Grid plugin on HLL as well, right? Did you create any other tech to make that project happen? Do you write about major engineering problems you solved for the project anywhere?

chrome bay
#

We're not using it on HLL no, and I haven't done any writing for HLL

lavish cypress
#

Were your requirements simpler than what the plugin offers?

chrome bay
#

We just don't need it. It solves a very specific problem

#

If you need objects querying the position of lots of other objects often, that's what it's for

lavish cypress
#

I see, thanks

chrome bay
#

@twilit patrol That looks like an issue completely specific to your game. Best guess is that you are receiving corrections from the Server which are snapping you to the floor because the ladder movement has not been built into the C++ prediction side of character movement.

#

Explains the jitter, especially in editor where you are probably getting corrections / network info at a high rate. In packaged/real-world connection it'll probably look like constant rubber banding.

#

The Server probably works because it can do whatever it wants with it's pawn.

twilit patrol
#

well, ive ended up fixing the jitter.. to where the client can go up.. but now the server, doesnt actually see him go up on the screen. and it's starts to do this crazy desync.

glad lintel
#

Ah so the window names are just bugged. Any reason why the server is getting both debug messages when I am only printing it for IsLocallyControlled()?

twilit patrol
#

it's something to with replication i assume, and im not that good on replication stuff yet i guess lol

glad lintel
#

Yeah, as Jambax said, it sounds like whatever code is moving the client up the ladder is not being run on the server.

nimble basin
#

but this documentation is from 4.14

#

hoping to find something a little more recent

#

I will probably also need to learn to cross compile for linux as I want to use it on AWS. If anyone has any tips, would be much appreciated.

soft shell
#

Got a quick question; if I'm holding a player controller as an object; when the player leaves this object becomes invalid (i.e. "is valid" test can be done?)

thin stratus
#

The controller will be destroyed, so yeah

soft shell
#

Thanks

gusty slate
#

Hello everyone,
Cooldown timers for example, should those be run and processed by the Server?

manic pine
#

depends on how much security you want... a client can technically just bypass it if it's local

#

on the other hand, if cheating's not gonna be a problem at all then you can save yourself a bit of work by doing it local only

nimble basin
gusty slate
#

How easy is it to cheat? for the average person

manic pine
#

for the average person it usually amounts to visiting some website to download a hack created by someone not average

gusty slate
#

I see

#

For an arcade game that is meant to generally be played with friends. I think for now I will have a moderate/high amount of security in mind.

#

Setting up a timer on server isn't hard so I'll go with that for the time being

#

Even though it might be annoying for UI

#

to track that timer

manic pine
#

well, you can always keep two timers, one local and one on authority

#

the client one just for visuals

gusty slate
#

True

manic pine
#

doesnt have to be an actual timer either mind you, it could just be something like MinimumWorldTimeNextExecution that you set when you fire this thing whatever it is

nimble basin
#

Anyone know how to make an installed build of custom engine that will work for building dedicated server targets? My "rocket" or installed build is giving me this error: UnrealBuildTool : error : Server targets are not currently supported from this engine distribution.

gusty slate
#

Thanks raap

gusty slate
#

Is the PlayerID inside the PlayerState a reliable value to identify client proxies on server RPCs?

misty flower
#

yes

humble zealot
light fog
#

Any simple ideas on making a rank systems and gold system for buying items ?? For ranks I'm thinking of using the epic leaderboard but not too sure for gold. If I save players gold amount locally can they change it and cheat ??

#

This gold will be used to buy skins and will be the main income for my game so it's very important that people cannot some how change this

chrome bay
#

If any stat manipulation is done client-side then yes they can cheat

#

Only way to ensure they can't is have a dedicated server managing it.

light fog
#

damn, im using listen servers for my game (advance steam sessions)

#

any work around?

chrome bay
#

nope

#

Also worth pointing out that if someone knows the App ID for your game, and their Steam ID, there's nothing stopping them writing whatever values they want to leaderboards with the Steam SDK

#

They don't even need to be in game.

light fog
#

fuck

chrome bay
#

Any code running on a players' machine is subject to cheating/hacking

#

Steam has one method of securely uploading stats which is it's "Official Server Stats" system, where you give it a bunch of IP addresses and it will only accept values changes to those stats from those IP's

light fog
#

i mean still cant think of how that would help

chrome bay
#

In our case we whitelisted the subnets of our server provider

#

With listen servers it won't help, it'll only help with dedicated servers where you know that the players don't have access to it.

#

I wish steam used a certificate system instead at the very least, whitelisting IP addresses is a bit 2010, but that's Steam for ya

light fog
#

well i fucked then hahaha. I guess will have to charge for the initial purchase of the game (but this is a problem since if there are no active users people will be paying for the game and not be able to play it) I was planning on making the game free and charging for in game currency which they could buy skins with :/

chrome bay
#

Just do it via regular in-app purchases.

#

eeeeeven then though, it's not entirely secure.

#

If a player really wanted to they could probably do a bit of mem-hacking to unlock all the items locally anyway.

#

We verify client unlocks server-side to help with that. At least that way, they can see what they've done locally, but everyone else just sees them as defaults.

light fog
#

I think im going to make it "hackable" for the time being and not charge for anything and if the game gets a bit of popularity, then introduce in game currency and try hire a professional to come up with and implement a solution

chrome bay
#

Any solution where players can "unlock" stuff via a listen server or a client machine is fundamentally unsecure

#

(if any professional tells you otherwise they are full of shit)

#

You might at best be able to write your own backend system which you host and it manages and checks for obvious spoofing, but ultimately the most secure way is a box running code that nobody has access to

light fog
#

wdym box running code?

chrome bay
#

Not to mention the cost of building infrastructure like that is pretty high

#

Like a dedicated server, running on machines that players can't access.

#

AKA "rentable" servers

#

or similar

light fog
#

ahhh

#

well thank you for the help ๐Ÿ™‚ Guess i have a lot of work to do :/

chrome bay
#

At least you found out before launching ๐Ÿ˜„

#

But yeah, been through the pain already.

winged badger
#

so i have some replicated UObject - they replicate just fine, as long as any replicated variables are in c++

#

if i add a replicated variable in a BP derived from that c++ base, that variable doesn't replicate, or call BP OnReps for clients

chrome bay
#

Ah yeah

#

One sec

#
    if (const UBlueprintGeneratedClass* BPClass = Cast<UBlueprintGeneratedClass>(GetClass()))
    {
        BPClass->GetLifetimeBlueprintReplicationList(OutLifetimeProps);
    }```
#

Add that to GetLifetimeReplicatedProps

jovial stream
#

Is it possible to make an AI that takes control of a player (The AI can simulate button inputs, register as a connected player in the session, ect.)

mellow haven
#

Hello, does RPC_Validation just end one RPC call, or does it disconnect player completely?

rotund granite
#

Hi there, I'm trying to find more information about how UE4 handle server -> client assets. Such as a map. If we have a map that is only on the server, would it be downloaded by the client when opening, or is this functionality something we need to develop ourselves?

meager spade
#

the map is packaged with the clients build

#

the client simply loads there own map when told too by the server via seamless travel

#

so if you need a map from the server only, you would need to somehow send the map to clients

#

and make sure they can load it

fathom dust
#

Is there a diagram someplace of all the events in the various multiplayer classes (e.g. OnPostLogin, BeginPlay) and they order they'll be executed?

#

I'm trying to build a mental model and the documentation does not seem to want me to do this.

rotund granite
#

thanks @meager spade !

meager spade
#

@fathom dust I was in the same boat as you till I actually read through GameMode and it becomes clear

#

Not seen any diagram anywhere tho

fathom dust
#

it seems like reading the source is the move here yeah?

#

I'm currently wiring up every event available in the GameMode BP to Print String lol

#

if I make the diagram I'll post it here ๐Ÿ˜›

fathom dust
#
[JanKenGameMode_BP_C_0] Server: Initialize HUDFor Player(JankenPlayerController_BP)
[JanKenGameMode_BP_C_0] Server: OnPostLogin(JankenPlayerController_BP)
[JanKenGameMode_BP_C_0] Server: Handle Starting New Player(JankenPlayerController_BP)
[JanKenGameMode_BP_C_0] Server: BeginPlay()
[JankenPlayerController_BP_C_0] Server: In Game
[JanKenGameMode_BP_C_0] Server: OnChangeName(JankenPlayerController_BP1, MSI-3A1C8DE84895A766, false)
[JanKenGameMode_BP_C_0] Server: Initialize HUDFor Player(JankenPlayerController_BP1)
[JanKenGameMode_BP_C_0] Server: OnPostLogin(JankenPlayerController_BP1)
[JanKenGameMode_BP_C_0] Server: Handle Starting New Player(JankenPlayerController_BP1)
[JankenPlayerController_BP_C_0] Client 0: In Game
[JanKenGameMode_BP_C_0] Server: OnLogout(JankenPlayerController_BP)
[JanKenGameMode_BP_C_0] Server: End Play(End Play in Editor)
[JanKenGameMode_BP_C_0] Server: OnLogout(JankenPlayerController_BP1)
#

this is for sure not the order I expected lol

meager spade
#

i wouldn't be trusting BP order