#multiplayer

1 messages · Page 622 of 1

eternal canyon
#

and connect through ip

plain torrent
#

our host only supports linux servers though

eternal canyon
#

than do a linux server

plain torrent
#

gotcha I think

eternal canyon
#

u could even run in standalone to test so you dont have to package a client

plain torrent
#

that's what we're doing

eternal canyon
#

can u connect?

plain torrent
#

but i have to use the UE source build to compile the linux servers, where as the others are using the standard launcher

#

I can connect, but they cant

eternal canyon
#

well than thats ur problem

#

they need to get source

plain torrent
#

and there's no way around that?

eternal canyon
#

as they are than on different versions

plain torrent
#

seems arbitrary as long as we have the same files no?

eternal canyon
#

or package

#

a client

#

like I said before

#

🙃

plain torrent
#

can't be simple can it

#

Thanks!

wheat magnet
#

can anyone help me to port forward

#

my isp doesn't allow port forward

#

i need alternative solution, so i can test my multiplayer game

bitter oriole
#

Use Steam or implement your own NAT punch

wheat magnet
#

can you provide me steam tutorials or documentation

#

or can you explain more about steam, how it should work

#

which is the best way

#

@bitter oriole

bitter oriole
#

Go straight to "Configuring your Application's Settings"

#

Or "Finished Settings"

#

And use something like Advanced Sessions if you don't want to write C++ for your sessions system

wheat magnet
#

does it support matchmaking

#

and if i doesn't have access to steam developers ( i don't have steam app id ), does it still works?

bitter oriole
#

Yes, yes

wheat magnet
#

@bitter oriole, i need your suggestion

#

is this fine for implementing multiplayer games?

#

because i don't want to build dedicated server and complex stuff

kindred widget
#

If you don't want to bother with dedicated, why not just do a simple listen server setup on steam?

bitter oriole
#

Not bothering with dedicated servers is a wise decision

eternal canyon
#

there not that hard

bitter oriole
#

Not bothering with Photon or non-UE4 stuff is even wiser

#

Just stick to simple listen servers

eternal canyon
#

also ue4 replication system is very good

bitter oriole
#

Use Steam for matchmaking, NAT punch, etc, and don't bother

eternal canyon
#

@bitter oriole thats only for small casual games realistically

#

u can learn how to build a dedicated server in 10 mins

#

max

tranquil yoke
#

hey, how do you optimize your Vectors, that you send over network, continously, Can i use int16 ?

bitter oriole
#

Learning how to use dedicated servers is easy, learning not to use them is harder. Dedicated servers aren't viable or useful for small indies.

eternal canyon
#

for me they are

bitter oriole
#

Good for you and your multi-million-dollar budget.

eternal canyon
#

its not a multi-million dollar budget😅

#

its just playfab

#

is pretty cheap

#

and u get around 750 hours per month

#

free

bitter oriole
#

Almost one full-time server, amazing

#

Anyway, not getting into debates here, I've used dedicated servers with Unreal a decade ago, I know about them - just think anyone who's not in a huge team should stick to "small casual games".

dark edge
bitter oriole
#

Customer self hosting of dedicated servers is not going to work in 2021 imho

eternal canyon
#

depends on the game type

#

if its a co-op survival sandbox

#

than yes

#

it would prob work

dark edge
#

I mean it's working for valheim and it's worked for Gary's mod for the last 10 years. If you have a game that works well for community servers, it's perfectly viable.

eternal canyon
#

it really depends

dark edge
#

Could probably include Minecraft in that mix

eternal canyon
#

as if its a csgo tac shooter and ur playing comp a ton

#

than u need dedi

dark edge
#

Yeah if it's competitive at all or if cheating is even a question, well, I hope you have money

bitter oriole
#

These games are still mostly hosted by the developer

#

Or a third party

#

And if you're doing a competitive shooter as an indie, I'm sorry but you're mad

dark edge
#

Maybe Minecraft is at this juncture but Garry's mod and valheim are just hosted by kids with AWS instances. there are companies that do it for you but it's the same model for the developer, just provide the dedicated server binary and call it a day

eternal canyon
#

basically my logic is that 750 hours plus maybe some more hours that would havbe to play for is good for a small player base as u dont really need a ton of hours on playfab. Tho if ur game starts to pickup than u should prob be making money anyway from that to pay for more servers

#

thats why I like playfab so much

#

plus the 750 hours are FREE

dark edge
#

We are going with a design that is listen server only and not touching dedi

bitter oriole
#

Playfab is free for one server

#

If you ever need a second one, there goes the money

eternal canyon
#

no

#

u have up to 24 cores spread across all servers

bitter oriole
#

It's still one server in one region

#

And it's "750 core hours"

#

So I suspect that your dedicated server can't even actually run full time for a month on the free plan

#

Not to mention anyone buying the game in the US - if you're in the EU - or vice versa means they get 200 ping until you pay up

#

But hey, it's free

#

Until it's not 😉

open wadi
#

I am attempting to get steam overlay to work with 4.26 following tutorials from several years ago.
I have Advanced Sessions, Advanced Steam Sessions, Online Subsystem, Online System Steam plugins enabled.

I have added the required lines to my DefaultEngine.ini file.

I am testing game as Standalone but no Steam Overlay.

Anyone willing to help me?

Edit: Also, yes, i have steam client started as well.

open wadi
# open wadi I am attempting to get steam overlay to work with 4.26 following tutorials from ...

Hey there, Luthervian. I'll help you and anyone else that has this issue:
Launching from Editor using Play Standalone doesn't work in 4.26. Workaround is to create a .bat file that launches your game following Rama's method here:

https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1476-launch-a-standalone-game-without-the-editor-via-a-batch-file

twilit halo
#

Hey guys, I was wondering if this is a known problem: I want call my ChangeTeam method on PostLogin, but it seems like the server just ignores it.

However, if I add a small delay before the casts, it works. Should OnPostLogin assure me that I can start manipulating the PlayerState? If not, at what point can I consider it "safe" to do so?

kindred widget
twilit halo
#

I added a breakpoint and stepped through it, it's not null but I'm unaware if needs to be "initialized" or "registered" with networking in some way

kindred widget
#

It's likely that this is done on the same execution line that it's created then. So the rpc might happen before it's resolved on the client. You should consider a rep notify instead.

#

Replication would serve you better with team assignment anyhow. Late joiners and disconnected players can be updated as well without another rpc

desert scarab
#

Is it generally acceptable in multiplayer to have a player action go through a Client->Server RPC then Replication in terms of visible latency?

#

(action to distinguish it from something people are more sensitive to, such as movement, etc.)

potent cradle
desert scarab
#

Fair

#

Is there some existing tools/utilities/architecture to make that kind of simulation easier?

hollow eagle
#

It's generally in the area of "client prediction". There's no single tool you'd use for it - for a simple example akin to what you asked about initially, you would set the replicated value on the client itself and also send an RPC to the server. If the server agrees, it just ends up setting things to the same value and no more action is required.

#

If the server disagrees, it can set the value to something else and the client will update its own value accordingly when it receives the new value via replication.

primal isle
#

is there somewhere a tutorial on doing a complete player character movement (crouch jump animations and all that) ? im finding multiple tutorials that work partially or not at all

desert scarab
#

As a related question, what about things where the state is a bit hard to represent with normal replication?

#

For instance, say you have multiple discrete states you want something to be in, with different implementations

hollow eagle
#

like replicating a state machine?

desert scarab
#

To be replicated, you'd have a UObject* that would point to a state of that object (assumedly replicated as a subobject)

hollow eagle
#

depends

#

most of the time, clients should already know what various states are available, right?

desert scarab
#

But my understanding is that you can't be guaranteed that the objects will be replicated at the same time

hollow eagle
#

if there's only a certain set of states that are possible

desert scarab
#

I'm thinking of the standard State design pattern

#

Having a bunch of objects that implement the same interface

#

And some current-state field representing which is current

#

The issue, as I understand it, is there's possible desync between syncing object pointers, and whether or not that object has been spawned/replicated on the client

#

So you could be put in invalid states, where the state pointer goes to nullptr (and later recovers)

#

(Sorry for the wall of text)

kindred widget
#

@primal isle ACharacter already has all of that in the UCharacterMovementComponent. The crouching and jumping can just be calls in ACharacter. As far as the animation goes, you should check out the AnimStarterPack. It's free. It has a full AnimBlueprint for simple crouch and jump movement by default, and also includes a lot of basic animations besides those.

twilit halo
desert scarab
#

To ask a simpler question: What are the invariants about consistency of fields (both value and pointer/ref) during replication?

#

e.g. is it possible that two fields that are updated to be equal at the same time on the server are ever seen as different on the client?

#

And is it possible for a UObject* field to show up as nullptr on the client when it's never nullptr on the server?

kindred widget
#

By fields, do you mean properties? And UObjects don't replicate by default. Only Actors, or ActorComponents on replicating Actors.

desert scarab
#

Yes, properties

#

Assume that you've done the appropriate logic to make the server UObjects subobjects, etc.

kindred widget
#

If you put two properties in a struct, it will replicate at the same time. If you have two loose properties, there is a small chance that they can replicate individually.

desert scarab
#

Loose properties?

#

Do you mean in separate objects?

kindred widget
#

Two properties not in a struct.

desert scarab
#

I see, sorry

#

And do you know the situation about the nullptr thing?

kindred widget
#

It possible. I would assume based on relevancy. I don't know how the UObject replication works, haven't needed it so I've avoided doing those steps. If it's anything like a Component, it should rely on the replicating Actor and it's relevancy. So if the actor replicating the uobject isn't relevant to the client, the uobject should be destroyed on the client and the pointer to it should be invalid.

desert scarab
#

Hmmm. I wonder about if it is relevant if there are any equivalent guarantees

#

Still, thanks for the help!

kindred widget
#

You can rule that out quickly by making the replicating actor AlwaysRelevant.

desert scarab
#

I'm coming from a more traditional style of programming, and I tend to depend heavily about consistency guarantees, so I'm just trying to understand which there are in the replication engine

#

I know that things are a bit looser when it comes to much of the UE4 model, but it's hard for me to understand what things I can rely on

kindred widget
#

I think it's best to rely on there being defaults. Treat the client as a dummy that is just told information and it has to paint the picture itself based on the most abstract data you can manage to replicate.

desert scarab
#

So, kind of as a view?

#

I just wish I could know if object graphs (i.e. the set of objects that are transitively pointed to by a single uobject) were replicated consistently, or at least know what guarantees I can depend on

#

Some things are hard to model as flat data structures

primal isle
#

its verry wobbly

#

i set a disable input on begin play and the client doesnt care about that, im not sure i cant find where the problem is i looked everywhere

kindred widget
#

The replication should be fine. Are you using the Ue4ASPCharacter?

primal isle
#

yes

kindred widget
#

Oh. Ugh. I didn't notice that about the AnimStarterPack, one sec.

primal isle
#

i was using the normal bp first but somehow overnight my animbp got corupted and i just changed it mid project iwth the ue4asp one and thigs are not pretty now

#

and i cant really start the project from scratch now xD

kindred widget
#

Yeah, I assumed the Ue4ASP animgraph was better put together. The animations in the pack aren't terrible but.. that animbp.

primal isle
#

you think its because of the anim bp?

#

playercharacter is what i renamed the ue4longuselessnameblueprint

kindred widget
#

If you.. Use the third person character, with the third person animbp. There are a couple of small changes to the animbp you need to make to make it work well. It has Jumping already. So all you need to do is add crouching. If you want other animations like sidestepping, you'll need to make yourself a blendspace from the animstarterpack stuff.

#

@primal isle If you make your AnimBP graph look like this, you can use those four variables for a lot, and all of it should work easily with replication.

primal isle
#

well the thing is i can see the jumping, i added crouching but it seems like the server can see the client but the client cannot see the server crouching or himself crouching, this was working fine before i changed to the animpack blueprints

#

and the main problem is the client dont consider any of the things i setup before like the disable input at begin play

kindred widget
#

IsCrouching and IsFalling should both work for crouching and jumping with default networking and nothing more than the Jump/Crouch calls in Character.

primal isle
#

where is that "isvalid" from? cant find the same

kindred widget
#

Just drag off of the TryGetPawnOwner and type, IsValid. There's two. One is that macro.

#

But with that animgraph and these controls, crouching and jumping should be replicated fine.

#

As long as you set up the state machine anyhow.

primal isle
#

i did it like in your screens and i can jump but i cant crouch at all, this is how i setup the animbp transitions for going out from crouch to idle and from idle to crouch without "not"

#

@kindred widget

#

the thing is if i check the tickbox in preview in teh anim bp it crouches

#

i am lost rn 😆

kindred widget
#

@primal isle Ohhh. FM. Right. The CMC doesn't allow that by default. You need to check that.

primal isle
#

what do you mean?

kindred widget
#

Open up your Character blueprint and click on your CharacterMovementComponent, and look for this.

#

CanCrouch isn't enabled by default.

primal isle
#

idk if i should laugh or cry about this

#

nice now crouching works, but i still cant find why the client runs wobbly or doesnt respond to disable input

kindred widget
#

Where is the DisableInput ran from?

primal isle
#

gamefile begin play

kindred widget
#

It needs to be ran on the client on that character.

primal isle
#

this is the posses part when you enter the gamemode

#

and yeah my bad, the disable input is on the playercharacter bp

#

he gets a random color and can see it replicated right but no disalbed input

#

nvm, i connected the remote too from switch directly to the disable input and now he is disabled

#

now i just have to figure it out why the clients movement is wobbly

#

and i found it, the ue4asp blueprint from the animpack has orient rotation to movement checked, unchecking this fixes it

#

back on track now 🙏

naive dome
#

If anyone is interested I made this easy tutorial that sums up Animation Replication for UE4.

UE4 Animation Replication Tutorial | Multiplayer - Client-Server | Blueprints | UE4.26.1
https://youtu.be/4jXUxn6D24s

In this tutorial I teach you how to replicate animations in Unreal Engine using a simple example of switching the idle animation to a thinking animation when the character is standing still.

The example blueprint code/logic that I show can be copied, and used to replicate virtually any animation.

Feel free to leave us a comment for any questio...

▶ Play video
primal isle
#

do you have on on how to replicate the pivot?

#

i managed to make it show on the sever screen when the client does it but i cant seem to make it show on the client screen when teh server does it

kindred widget
#

@primal isle Which pivot?

primal isle
#

looking up and down

kindred widget
#

Ah. Use GetBaseAimRotation's Pitch.

primal isle
#

never used that

#

where exactly would you set it?

kindred widget
#

AnimBP EventGraph. You use it with 1D AimOffsets usually.

primal isle
#

i dont use an aim offset i just setup the transform modify bone in the animbp

#

i replaced get control rotation with get base aim rotation now it works ty

buoyant crag
#

hey, Im wondering how to get the player's external ip address when he joins my server, is that possible via blueprints?

stable basin
buoyant crag
stable basin
rich ridge
#

@buoyant crag do you mind telling me what you will do with the ip once u registered in db?

rich ridge
ancient bramble
#

Hey guys, i was making a simple auto login feature using VaREST, and it works in in single player but as soon as i add more than 1 client, it doesnt work

rich ridge
#

Do you mean in editor?

ancient bramble
#

and shows a blueprint error about blueprint runtime error: "Blueprint Runtime Error: "Accessed None trying to read property CallFunc_ApplyURL_Result_1". Blueprint: LoadingScreen Function: Execute Ubergraph Loading Screen Graph: EventGraph Node: Branch

rich ridge
#

It is null

ancient bramble
#

that branch gets activated once the request gets completed, and should change the level to Lobby, but it doesnt

buoyant crag
buoyant crag
silent valley
#

do you know the players IP is liable to change frequently?

rich ridge
#

@buoyant crag i think what you want is device login or guest login, and there are multiple ways to do this

#

you can use device machine address.. and machine addresses are unique

buoyant crag
buoyant crag
rich ridge
#

ipconfig

buoyant crag
#

are you sure its unique for each device?

rich ridge
#

this will do

buoyant crag
#

hmmm could you explain a bit? I dont know pretty much anything about cpp haha

rich ridge
#

this is fairly simple...
for android or ios it may return IMEI with permission is there. for windows, linux, or mac it will return machine address or device id

#

and they all are unique regardless of any platform

buoyant crag
#

I see, could i turn it into a blueprint node?

rich ridge
#

yes why not

#

these are stateless static functions

#

i think bp should be already there for device id

buoyant crag
#

Ill open up my project and see

rich ridge
#

but I have a question for you.

buoyant crag
#

thank you so much dude, I appreciate your help

#

yeah go on

rich ridge
#

how will you send the device id to your dedicated server?

buoyant crag
#

I want it to register on my database

rich ridge
#

so you would be registering in database on server side.

#

but how would you send to server.

buoyant crag
#

there's a plugin called varest, pretty sure it handles that

#

it sends the variables to the database

rich ridge
#

ohh i see now.

what i initially thought is when player starts multiplayer match that time you would register in database

#

i think you will register on game launch, is it?

buoyant crag
#

yeah sure

#

I want something to identify them, for example device ID or IP, and then if it finds a row for them, itll access the rest of the variables

rich ridge
#

got it, if you don't want the user to login via username or password, then silent device login is your best choice

buoyant crag
#

awesome!

#

should be this one, right?

rich ridge
#

yes

buoyant crag
#

great, thank you man

rich ridge
#

welcome brother

buoyant crag
#

have a good day, take care

rich ridge
buoyant crag
#

what do you mean by that?

rich ridge
#

Name | IP | Balance | InventoryId | VehicleId | ApartmentId | Password

#

and separate tables for Inventory, Vehicle and Apartment

buoyant crag
#

ohhh thats true thats a good idea, thanks

rich ridge
#

this way your queries will be faster

buoyant crag
#

mhm

#

for some reason when I do that it gives me an Infinite Error, even if i use DoOnce

#

is there a better way to do it?

rich ridge
#

ohh man

#

GetDeviceID

#

you are recursively calling the same function

#

you created function Device ID

#

and you called that same function Device ID

buoyant crag
#

ohhh haha yeah now it works thanks

mortal crater
#

Anyone here know if it's possible to do multi-player Play-In-Editor (PIE) over Unreal Multi-User Server?

graceful loom
#

why does my server have 6 instances of playerstate when I connect 2 clients?

#

4 of them are empty

winged badger
#

and how are you counting them @graceful loom ?

#

because dedicated server with 2 clients - there are total of 6 player states

#

2 on each machine

graceful loom
#

in the editor with view options set to server

#

I assumed it would only show me objects on the dedicated server

#

running with a listen server and view options set to the client's world I can still see 6 player states

#

view options set to server I see four player pawns

#

for one client and one listen server

#

I guess each one has both, but why more player states then?

#

and it's not super clear what the view option is actually filtering

#

if I choose the client world then I only see one player pawn instead of four

kindred widget
#

@graceful loom I would stray away from relying on editor stuff for multiplayer debugging. Printing will return much better results in that regard because it can only print stuff that the machine you're running the code on has access to. So in this case, a keyboard button in the pawn with a GetAllActorsOfClass would tell you the correct amount of things that are on the machine that pressed the button. Editor stuff can get convoluted in that regard because it needs access to everything to debug everything.

tribal elk
#

Hey is there an easy way to find the hosts pawn when using a Listen Server?

I tried to use "Is Server" and check if Player Controller 0 = the controller of the pawn
This works kinda on the server, however would not work on the Clients, as "Is server" would fail 🤔

Note: I just started tinkering around with multiplayer so maybe iam missing some core concept here

#

Basically what I want to do is give the Host a special Indicator (like an extra mesh) to it's character that all the other clients also see (like a crown)

kindred widget
#

@tribal elk I don't think there's a default way to do that on clients. On server all you need to do is what you already did, just GetPlayerCharacter0. For clients, they cannot get any other pawn or controller than 0, because all of those checks rely on the controller being present and they only have their own controller. What you could possibly do though, is add a replicated bool to your PlayerStates, and mark one of the states as the server's Playerstate. Then you could get the hosts pawn that way through PawnPrivate through the Playerstate.

tribal elk
#

Ah ok so a replicated bool and set that for the host, yeah makes sense 🤔 kinda like the chest example in the contentexamples

kindred widget
#

Not sure I've seen that one. My thinking was just that Playerstates are easy to get through the GameState. And if you put the bool there, you don't even have to think about it later if you're constantly killing off the pawn and that state is always linked to their currently controlled pawn.

tribal elk
#

yeah I will just add a replicated bool "Is Host"

#

will try later, currently starting a playtest for our primary game 😄

#

Thanks for the tip though!

weary badge
#

Hello, I managed to create a replicated timer by using the game state, but for some reason the client and the server are seperated by 1 second.
Does anyone know why that happens ?

kindred widget
#

Not sure without seeing it. How did you make it? Client and server have a replicated time thing that you could use if you're not. You could just send a simple float from the server of CurrentTime+TimerLength. Start the timer on the server. Then on client, when it gets that RPC or repnotify, it can either immediately fire the timer if the sent float >= CurrentTime. Else set timer for DesiredTime-CurrentTime.

#

Won't be perfect, but it should end up relatively in sync.

weary badge
#

I used the elapsed time inside the game state, which is replicated by default
I create the widget by button press
The widget has a function bound to the text that gets the value from the GS. The GS is saved as a variable after casting inside the widget.

kindred widget
#

Hmm. Try something different. Just a sec.

weary badge
#

I tried a couple times

#

sometimes they are synced and somtimes the value is off by 1

kindred widget
#

@weary badge This is to count the amount of time that's elapsed since the timer was started, right? Not a countdown timer?

weary badge
#

this is the values discription.
I thought it would show the time since the game was started by the server

#

or did I misunderstand and it shows the time for each client when it starts up ?

kindred widget
#

Ah. My bad, I was under a slightly different timer impression. Actually all you need to do is replace your binding with...

weary badge
#

oh !

#

I'll try that real quick !

kindred widget
#

That should be a replicated time, for when the server first started it's world.

weary badge
#

NICE !

#

Thanks a lot Authaer

#

there is also 1 tiny question that I have been wondering about

kindred widget
#

What's that?

weary badge
#

I mean, between just casting or saving it as a variable

#

is there some form of difference ?

kindred widget
#

That is a complex question. In execution, there's very little difference. The casting has a validity check in it that takes a very very small amount of processing. But it takes hundreds of thousands of these in a single moment to really hurt, nothing you should worry about. The casting itself is often the problem, but not for performance in the standard way. When you cast to something, you're saying that the backend code needs to have that object loaded to check against. So.. If you have an ability in your character that casts to a specific boss that is in level 3, and that boss casts to a throwable rock actor, and that rock actor happens to cast to soemthing else.. etc. If you load up NOTHING except just your singular character with their ability, then in the background, the Boss, The Rock, and whatever the rock casts to, also get loaded up, along with their meshes and everything into memory. And while this doesn't affect your in game performance, if your project gets too large, your application will be forced to put stuff on disk to avoid overflowing RAM, and that leads to bad compute times, etc. and it just becomes a mess.

#

But as far as your exact question, there's no difference really. Cause having a hard pointer to something is the same as casting to it.

weary badge
#

Alrighty !
That was very clear, thank you !

mighty schooner
#

Anyone interested? I created the Network Profiler from UE4 in WPF with better and responsive UI.

rich ridge
#

@mighty schooner why don't u PR it?

#

It would awesome to see it in UE5

mighty schooner
#

Pretty sure it will be rejected 😆

rich ridge
#

Do you have it as a plugin?

#

Then sell on marketplace or share on GitHub.

rich ridge
kindred widget
#

Even if it does get rejected, you might get a reason why. Improvement critique is always good.

mighty schooner
#

I'll submit a pull request after I upload it to GitHub.

mighty schooner
tribal elk
#

@kindred widget Ok got it to work - thanks for the help 🙂

kindred widget
#

Nice!

tribal elk
#

had to call the "Show" once on begin play additionally as the rep value did not get replicated properly if no change happened I guess 🤔

#

and so the repnotify didn't fire

kindred widget
#

Hmm, yeah at the beginning of game in pie it might pose a problem. Theoretically in a normal game, the server would have ran beginplay and set that before a client ever connected. But then you can't promise replication order. So it might be wise to run that check on both beginplay in the Pawn and in the repnotify of the value. Then it wouldn't matter which hit first, the other would correct it.

tribal elk
#

yeah that's what i did now

#

or atleast run the "show / hide crown" on both, repnotify and beginplay - so by default it is off, then when the "Is Host" replicated variable updates, it will show the crown

#

thats how i understand it so far, as BeginPlay (Client) also is mostly not the same as OnPossessed which will happen on Server as far as i know

kindred widget
#

Beginplay is the best place, since that's going to run a lot more often between pawn respawn and relevancy. But yeah, if you ever ran into an issue where the pawn ran that first, it whouldn't show if the playerstate replicated second somehow. So the repnotify is kind of needed I suppose.

tribal elk
#

Oh currently it is a variable on the character itself, didn't mess to much with PlayerState - never had to (so far i just worked on singleplayer / local multiplayer stuff)so had to look how to use it once i get into respawning for stuff like that, also like PlayerColor probably
Is there a way to mutate PlayerState on Connect - probably there is 🤔 like have a list of colors and 3rd PlayerState picks Color[2] etc.

kindred widget
#

Probably. GameMode could likely handle that in HandleStartingNewPlayer. PlayerState seems to be valid and created and set on the controller by then. You could make a color array in the game mode and just populate the Playerstate from a Select node.

potent cradle
peak sentinel
lament sinew
potent cradle
#

Can't you attach Unreal Insights to a dedicated server process?

#

I'm really not trying to knock the app, it looks neat

#

Just wonder how the two compare and what the usecase would be relative to one another

bitter oriole
#

Since you'll be making bank

#

Yeah, this tells me you have never shipped a game before

#

No offense

#

It's just the most common fear of new game devs

#

The truth is that no one cares about your idea - everyone's got loads of them. Convincing people to join your idea usually works through $$$

potent cradle
#

Then why don't you just do it?

#

Replication is totally doable to learn

rapid bronze
#

Do the learn

bitter oriole
#

Repeat after me : ideas in gamedev are worthless

#

Execution of ideas has value

#

Battle Royale was an idea implemented in like 3 full games by the PUBG guy before PUBG and no one gave a shit, and then it was the world's only game genre for what felt like a decade

#

The idea didn't change

#

The execution did

#

You misunderstand my point : I have no opinion of whether it will flop or not

#

My point is that no one cares about your idea until you've made bank with it

dark edge
#

@twin juniper Ideas are cheap, execution is expensive.

bitter oriole
#

Here's the gist of it : people don't care, so you need to pay them

#

I mean, assuming your idea actually is awesome and it's the next Fortnite - do you think the experienced developers working with you for free will just let you, the idea guy, keep the project ?

#

So do a vertical slice of your game, put it on Youtube, make millions of views and you'll have a much easier time finding people than with "secret project I cannot talk about but I swear is the best in the world also I never shipped a game before"

#

Because the latter is frankly just every new game dev

#

Again, no offense

#

No one's gonna DM you for your idea

rapid bronze
#

What's the point then in not telling, they could approach you just to steal the amazing idea

#

Create a prototype, present it and if it's that good then you have a bright future ahead of you

bitter oriole
#

Here's step one on recruiting for a game project :

  • do a prototype that sells the idea of the game, runs on the target platform and just needs lots of art and polish
  • put it on the Web for everyone to see (also neatly solves idea stealing - everyone knows you now)
  • profit
#

Pretty much what Iannis just said

#

I've actually done this once before myself and it did work out

#

Twice really

potent cradle
#

What did you make, Stranger?

bitter oriole
#

A really shitty competitive shooter with lots of art students first, and then Helium Rain, a space sim

potent cradle
#

Looks gorgeous, neat!

bitter oriole
#

I think you're slightly optimistic

#

Don't let met doubt you though, do one minigame and the lobby system and see how it goes

#

Good news, multiplayer support only makes each minigame 5x more work

#

And an art team, since art work is about 90% of a game

#

Game modelling is a very different job

#

But hey, just do it

#

You know a lot already, so you don't need my advice

#

Just do it

rapid bronze
#

Download more RAM

primal isle
#

can anyone find the flaw where my server player shoots straight but my client player shoots spread?

#

spread as in every ball is going a bit offset around the cursor

meager spade
#

your camera will not be facing the same way

#

on the server likely

#

as in it doesn't pitch

grizzled stirrup
#

When overriding virtual client RPCs in C++ should you override the _Implementation function?

#

AS in

UFUNCTION(Client, Reliable)
virtual void ClientDoSomething();

in the parent .h should become virtual void ClientDoSomething_Implementation() override; in the derived class?

#

Asking as virtual void ClientDoSomething() override; compiles, so I'm not sure which is the correct way

meager spade
#

implementatiion

grizzled stirrup
#

Ty!

#

Is it possible to get the owning player controller of a player state directly or do you need to go through GetPawn ?

meager spade
#

PS holds controller

#

the outer/owner of the PS is the controller

grizzled stirrup
#

Oh so GetOwner() is the controller and I can use that to cast?

meager spade
#

yes

grizzled stirrup
#

Perfect thanks

round star
#

A question about dedicated servers.... If I have a lot of timelines firing and lerps and math happening that would normally be too much for a computer to be the server and play the game (aka a listen server)...theoretically (unless I totally misunderstand) is it right to assume that a dedicated server can increase performance on clients by offloading all the lerps and math in actors becuse they are done on the server..when only the result of that math is what the clients see

graceful loom
graceful loom
#

how would you handle notification in the player controller when a member of the playerstate is replicated?

graceful loom
#

related to that, how do I set a property on a newly spawned actor before the actor is replicated? I'm setting something that causes a material to be applied, but it happens too long after the actors appear on clients and looks messy

#

I pulled the property out of the player state and it replicates much faster now, but I'm still curious

graceful loom
#

kind of related, my MP player starts at 0,0,0 even though the first thing I do when they join is spawn a camera and possess it. So there's always a flicker where they start in the ground and then appear in the right place. How do I make them just not have a camera until I give them one?

#

auto manage active camera is off

graceful loom
#

in playercontroller beginplay I get active camera iterator and setviewtarget on the first one and the player starts at 0,0,0

#

it doesn't matter what I do

naive sorrel
#

Hello! We're having trouble getting our game to connect over the internet to the dedicated server I'm hosting on my machine. I have the port (7777) open and am able to connect locally, but when I try by ip address nothing happens. Firewall is allowing both the server program and port through as well. Any ideas? We're currently just testing with the third person project before fully jumping ship to UE4 from Unity.

#

Also, once the server is started, this is what it has: "LogNet: Created socket for bind address: 0.0.0.0 on port 7777". Is that ip of 0.0.0.0 correct? Or does this need to be changed somewhere?

mighty schooner
silent valley
ivory umbra
naive sorrel
#

@silent valley Yeah I figured it out... I had everything port forwarded, but bridged the connection for my nintendo switch through my desktop, and instead of giving the switch a new IP, it took my desktops and gave my desktop a new IP. So the port was forwarded to the switch... Fixed it and connected without issue

#

Just bad timing wanting to download BotW again lol

twin juniper
#

i amtrying to spawn a block under the player in a multiplayer game, it only spawn under the server player charater, even if other players press to spawn the floor block thats supposed to spawn under themselfs, any idea what the issue might be? i am using blueprints.

bitter oriole
#

Is the block replicated ? Do other players use a server event to spawn the block on the server ?

twin juniper
#

block is replicated yes. yes other players use on server event to spawn block.

graceful loom
#

I spawn a player pawn and possess it in the gamemode (HandleStartingNewPlayer), but clients always join with their camera at 0,0,0 before it's changed to the player start where the pawn is spawned. How can I disable the camera until they're attached to the right one?

twin juniper
bitter oriole
#

@twin juniper Add some logs to confirm that the event does run on the server

twin juniper
#

how do i add logs?

thin stratus
#

GetPlayerCharacter0

#

Is 100% not what you want to use there

#

Because since that is executed on the Server, you are spawning them all at the Server's character.

#

You are inside of the Character BP already, so just get the actor location.

twin juniper
#

aahhhh thats makes a lot of sense. thank you ^^

#

and it works now.

#

how do i make the actor i spawn to appear under my player , currently it spawns at center of my player

graceful loom
#

is it rigged? you can get the foot socket location

#

or use GetActorBounds and subtract the Z value of the boxextents

twin juniper
#

its rigged

graceful loom
#

GetMesh()->GetBoneLocation(GroundLevelBoneName);

#

is what I'm using

#

and that's set toooooo

#

"ik_foot_root"

twin juniper
#

yes it worked thank you

graceful loom
#
ACharacter::BeginPlay() {
if(!HasAuthority()) {
    ServerOnCharacterReady();
  }
}
#

never runs

#

it calls it but the RPC doesn't run

#

the character replicates, its owner is set to the playercontroller when it's spawned on the server

#

its properties replicate

#

the RPC is declared UFUNCTION(Server, Reliable)

#

the character is spawned and its owner is set on the server

#

oh, despite setting an owner in SpawnActor, GetOwner returns null in beginplay

#

"Thus the server has to tell the client version of the actor that it now owned by the player." christ can this be more convoluted

#

so I need to call a client RPC and have it retrieve the local playercontroller on the client and not try to give it the playercontroller that's on the server?

#

i.e. owner isn't replicated?

#

nope, call client RPC, SetOwner(GetWorld()->GetFirstPlayerController()) runs, then in BeginPlayer GetOwner returns null

twin juniper
#

i am trying to spawn actors at where th players have their mouse. but this mouse in world thing wants player controller. if i use getplayercontroller0 i will get the issue of it only working on server. how can i make it so its getting the controller of the correct player?

graceful loom
#

99% sure if that runs on the client it will return the right playercontroller

twin juniper
#

if server does it, it works, if client does ut, nothing is happening as far as i can see, maybe it spawn it at a location i dont see

graceful loom
#

does it return anything? use isvalid

#

if it returns a player controller and it's on the client there is only one object that could be returned

#

it's not complaining about getting NONE so it can't be returning anything but the local controller

#

so I set the owner to the playercontroller when I spawn the character on the server; I set the owner explicitly on the server; I call a client RPC that sets the owner on the client (runs, but owner doesn't get set); I set the owner again in beginplay on the client (does get set); server RPC will never run

steep flame
#

How do you net serialize primitive types like floats in your custom Struct?

#

The websites mentions:
Unreal Engine implements a generic data serialization for atomic properties of an Actor like ints, floats, objects*
But how do I use it?

graceful loom
#

lmfao okay

#

now I'm calling the RPC from the playercontroller itself

#

doesn't run

#

I give up, goodnight

steep flame
peak sentinel
#

Isn't ServerHitScanHit something very important? Why its Unreliable in UT's source code?

chrome bay
#

Speeds sake

#

Unreliable's are generally faster

#

And if you drop a reliable, all other reliables get backed up. In a twitchy shooter like UT it wants to be as responsive as possible

#

(Asked the same question to one of their engineers way back when)

peak sentinel
#

I see, thank you Jambax

light plover
#

How do i make reverb for my weapons so it doesnt sound like it comes from the same pawn?

light plover
#

or am i doing something wrong?

lament sinew
#

@graceful loom i think it requires validation now
you didn't get any warnings when compiling that rpc without a validation function?

lusty sky
#

@light plover i think it should be in #audio probably someone can help u there

light plover
#

Ill do thanks anyways 🙂

weary badge
#

@kindred widget Are you there ?
I managed to set up that timer on a separate project, but for some reason the setup doesn't work inside the project im working on

kindred widget
#

For the gamestate time?

weary badge
#

yeah

kindred widget
#

What are you currently doing in your non working project?

weary badge
#

it doesn't work for the client for some reason

#

ill open it real quick

lament sinew
#

i don't think sound cues should be replicated Trold 😮

weary badge
#

@kindred widget

kindred widget
#

@weary badge What was the end goal with this? Is this like starting the countdown to a match start?

weary badge
#

yes

kindred widget
#

I would just replicate a single float that is the CurrentServerTime+Countdowntime.

#

On repnotify, if that replicated value is more than current server time, show the widget. In the widget binding, you can countdown via replicated time - servertime = duration remaining

clear salmon
#

Can a variable in a non replicated component be replicated or must the parent also too replicate.

silver stump
#

When I crank up the packet loss of my network emulator, and a variable is replicated in my GameState, sometimes the pawn attached to my PlayerController (GetPlayerPawn function) is SpectatorPawn and sometimes it is my Default Pawn Class from my GameMode. My GameMode is not set to start players as spectators, so I am wondering where this SpectatorPawn is coming from, because it is messing with my OnRep Notify casting logic (casting the player pawn to my specific pawn), because sometimes it will work (if the player pawn is correct) and sometimes it won't (if the player pawn is SpectatorPawn). Any ideas of how to fix this?

winged badger
#

@clear salmon for a variable to replicate in a component both the Component and Actor the component is on have to be replicated

#

@tulip ferry anything not serializable will get lost during the RPC

#

along with pointers to non-net addressable objects

#

but that is usually easy to work around, for example you can't do

#
UFUNCTION(Server, Reliable) 
void ServerPlayMontage(UAnimInstance* AnimInstance, UAnimMontage* MontageAsset)
{
  AnimInstance->PlayMontage(MontageAsset):
}
#

as that will crash the server, without exception

#

you can however do

#
UFUNCTION(Server, Reliable) 
void ServerPlayMontage(USkeletalMesh* Skeleton, UAnimMontage* MontageAsset)
{
  Skeleton->GetAnimInstance()->PlayMontage(MontageAsset):
}
#

as the SkeletalMesh tends to be net addressable, and has a 1:1 relationship with the anim instance

graceful loom
winged badger
#

@graceful loom can't make assumptions in which order the Characters, Controllers and PlayerStates will replicate over to client

#

i'd move that to APlayerController::SetPawn override

eager pine
#

any idea how to smooth characters out on rotating platforms? Players above like 50+ ping end up getting corrected pretty often and it's ugly

clever fjord
#

Hey guys, I need some multiplayer FPS concept advice. I am looking for your subjective opinions here...

I am creating a FPS multiplayer game and I was contemplating the shooting origin and destination.
I am trying to decide between two aiming systems, I would like the game to feel reasonably real.

  1. My first idea was to drive the shooting origin and direction by the actual weapon rotation and transform (shooting in the direction the weapon is actually facing) but this would mean that the hit location would be driven by the currently running animation which translates the weapon actor and I don't find this very reliable (animation sync across clients) and it would basically mean that the shooting is driven by aesthetics.
  2. The second option is to have two deterministic points, one in the center of the screen or some offset based on the current character state and one at the approximate location of the weapon nozzle (shooting origin).

I just need some opinions on this matter, do you think that the first (more accurate) option is reasonable or is just too much of a hassle and would feel weird and I should go for the second option?

lost inlet
#

FPSes that depend on what's happening in 3rd person always feel clunky

kindred widget
#

I feel like 1 would be fine if you're going for semi realism. It's also not that bad when you consider the animation sync. That won't matter in most networking because the client does most of the shooting and checking and server/otherclients only approximate, and server does relative cheat detection checks only when the client claims they hit something.

lost inlet
#

the first person part of our game is really just a floating camera, where the weapon is in 3P doesn't affect anything really

#

though we do have freeaim but that's using the location of the 1P mesh

#

which is a mesh at a fixed FOV too

#

if you do something like arma's "first person third person" system, all the animations will end up feeling stiff and it just feels clunky

clever fjord
kindred widget
#

I think it just comes down to how it feels. You'd be putting a lot on your animations. It 'could' work very well. From a more gameplay designer's standpoint. I'm more likely to rely on modifying a point around the center of the screen based on movement or other factors to simulate a moving weapon's inability to aim.

#

It'd be much easier to do that and make the animation point the weapon in that direction, than to solve potentially annoying animation problems.

clever fjord
#

Yep I am logically gravitating to the second solution of having some deterministic point in the "center" of the screen, driven by gameplay logic too, thanks for the input 🙂 it is much appreciated

kindred widget
#

Structs are allowed through RPCs, as long as their properties are UPROPERTY marked. Fairly certain even if one isn't, it'd just get zerofilled on the client after the struct passed.

kind ember
#

Can UObject use server rpc?

eager pine
#

when the host crashes, players get sent back to the main menu. But the session isn't being destroyed even though I call Destroy Session when the player hits the main menu. Any idea how to solve this? Players have to restart the client to play again

kindred widget
#

@kind ember Not by default I don't believe. AFAIK the only two objects that can RPC are Actors or ActorComponents

kindred widget
#

@tulip ferry Are you using Blueprint or C++?

kind ember
#

Ok thxs.

kindred widget
#

It should work fine. Just be certain that your struct is a USTRUCT() and that all properties in it are marked UPROPERTY(). Which in Unreal is good practice anyhow.

#

Hmm. Fair question. I'm uncertain about if there's a size limit for the whole RPC. I know that by default at least, most Arrays should be limited to 2048 entries.

#

One thing to do for a testing environment, if you have not already, is to add this to your project's DefaultEngine.ini. It's overkill, it's 1Mbit per second, but it'll make sure you don't hit that at least.

[/Script/Engine.Player]
ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000
#

I think Jambax said that in 4.26 they upped it to like 100,000 or something. Before that it was 10,000.

#

Bits.

#

The 10,000 in UE4 4.25 and older was like a fifth of an old dial up connection.

graceful loom
#

the setting ownership?

#

I don't really understand what's complicated about what I'm doing when all of the blueprint tutorials are so straightforward; a player connects and I spawn them a pawn and possess it and can't get RPCs to work, but that's exactly what every tutorial does and it just works

winged badger
#

in blueprints

#

on server

#

Character doesn't have Controller on BeginPlay

#

on clients

#

it does

#

and blueprint networking tutorials are abhorrent

#

so good luck with that 😄

graceful loom
#

lol

#

ok so I copied the rpc into my player pawn and it works, so the problem is definitely that the spawned actor isn't getting the networked player controller as its owner

#

so calling possess on the server DOES replicate the owner to the client, but setting the owner for a different actor on the server, or on the client, does not establish the right ownership

#

what am I missing here?

#

I'm setting the actor's owner to the player controller in the spawnactor parameter, with character->setowner, by calling a client RPC with the player controller as a parameter where I then call setowner on the client, and on the client by getting the first player controller and setting owner to that; none of that allows the actor to use RPCs

#

it's set to replicate and set to always relevant in the constructor of the base class and in the derived blueprint

#

it does replicate with properties to all clients and I can call client RPCs on it

#

I even get the player controller and pass the actor to it, then call the RPC on the actor from the player controller; doesn't work. If I copy the RPC to the player controller it works

#

so which is it, owned or possessed?

lost inlet
#

both

graceful loom
#

and or or

#

?

lost inlet
#

though in a more accurate way, the ability to call RPCs on an actor depends on ownership

graceful loom
#

it literally can't get more ownership than that

lost inlet
#

ownership is server authoritative

graceful loom
#

it literally can't get more ownership than that

#

that's in the game mode

#

the only thing I can infer from that is that beginplay runs on the client before the owner passed in the spawn parameter is replicated

#

the server does call all of those setters and FinishSpawn before any client runs beginplay

#

in beginplay GetOwner returns null

halcyon pilot
#

Help me out guys just want to make sure I am understanding correctly. Montages require an RPC with multicast to replicate properly. Animations on the other hand come from the AnimBP and only need to be run on the server without the Multicast. Correct?

hollow eagle
#

Sort of. AnimBPs don't only run on the server, they run everywhere. They don't need to be networked because they're running the same logic everywhere, though if there's some event or some value that they change their animations based on that value should probably be networked somehow.

#

The reason they usually "just work" without any special replication is because you usually have the settings for an AnimBP already baked into whatever assets are relevant

#

A montage on the other hand is usually started in response to an event. If that event only happens on the server, or on a single client, you need some way to tell other clients/the server that said event happened so they can trigger a montage as well

graceful loom
#

so the client actor does GetOwner()->GetServerNetworkAddress and gets the correct value, then calls a server RPC and nothing happens

#

ok so the actor's owner is nulled between setting it and beginplay

#

ClientSetOwner is NOT setting the owner btw; it's just being called from the server

#

it successfully reports having an owner that was set during spawn by the server, but the actor that runs BeginPlay is either not the same actor as this one or gets nulled out before starting

#

this is beyond frustrating, I'm like 10 hours into this now

halcyon pilot
#

@hollow eagle Thank you, I have noticed that the animations from the AnimBP don't always replicate unless the variable I use to call them is replicated as well.

kindred widget
#

@graceful loom Are you trying to do like controlling AI pawns through RPC from the client?

winged badger
#

@graceful loom APlayerController::SetPawn

#

is the best place to link stuff between your Character and the PC

shy flicker
#

Hi everyone, I'm trying to do some level travelling for the first time. I'm trying to execute the following code. I have as well my transition map set on the project settings and the bUseSeamlessTravel activated on the GameMode. What could I be missing? 😕 THanks!

graceful loom
winged badger
#

and its set during that functions exec

graceful loom
#

otherwise the client sees them pop in

winged badger
#

the idea is not to call it

graceful loom
#

so the actors are calling back to the server to announce themselves

winged badger
#

but to override it

graceful loom
#

these actors are unrelated to the player's pawn

winged badger
#

in other words, inventing hot water 😄

graceful loom
#

hm?

graceful loom
#

The main thing is I'm trying to believe that I don't have to proxy every single RPC call in the entire game through one class like the player controller, because jesus

winged badger
#

i have about 7-8 Actors owned by the PC, plus dozens of components that can RPC

muted perch
#

Can somebody help me with something?

winged badger
#

but most of reduction in RPCs in PlayerController did not come by adding more classes to spread them thin

muted perch
#

My player states aren't accessible to the player controllers.

winged badger
#

it was done by making a few interfaces the player interacts with the world through

#

and leaving it to the Actors implementing the interface to understand what the player action was meant to be

#

@muted perch that is impossible, except on clients on very start of the game

muted perch
#

Can widgets access player states?

winged badger
#

yes

muted perch
#

sweet

winged badger
#

GetOwningPlayer->PlayerState, pretty much

#

assuming you bothered to plug the owner node when constructing widgets

#

and that is local PlayerState then

muted perch
#

So player controllers CAN access player states?

winged badger
#

for others need to be a little more creative

#

player controller instantiates the playerstate in its PosInitializeComponents function

#

and keeps a reference to it during its entire lifetime

#

its just that PlayerState is a separate Actor

#

that replicates separately, via its own ActorChannel

muted perch
#

that's weird because I tried to get the player state and I checked if it was valid, and it said it wasnt valid.

winged badger
#

and having a default NetPrirority of 1, while Pawns and Controllers have 3

#

it usually arrives few frames to few seconds in on clients

#

depending on how much there is to replicate

#

so by default, at BeginPlay, for example

#

Pawn and PlayerController have the valid NetGUID for the PlayerState

#

but since PlayerState Actor hasn't replicated yet

#

it is not yet resolved, so its a nullptr

muted perch
#

ahhh ok

winged badger
#

so its best to wire that kind of logic info OnRep_PlayerState that both Pawn and Controllers have

muted perch
#

I was trying to keep track of what team the player is on in the player state

winged badger
#

in c++

muted perch
#

no, in BP

winged badger
#

that is unfortunate

muted perch
#

I like the ease of use :/

winged badger
#

for networking, you have zero tools to do anything but the very basics

#

in blueprints

#

they literally have less then 10% network functionality exposed

muted perch
#

I like the challenge tho. And anything I don't have access to that I need, I'll just expose it to BP

#

but haven't encountered that problem yet.

winged badger
#

in that case

#

override both APawn and APlayerController::OnRep_PlayerState

#

call Super

#

and shoot yourself a BlueprintImplementableEvent from there

#

it will make your life easier for this scenario

muted perch
#

I got my problem sorted out, but thanks for the tip

#

I just grabbed the player state from the widget and set it to a bind function.

graceful loom
winged badger
#

with a 80 line function in GameMode

#

that just spawns everything and constructs the entire object graph

#

in override of HandleStartingNewPlayer

graceful loom
#

So exactly what I'm doing lol

#

What am I missing 😭

winged badger
#

not trying to solve more then 2 objects at a time?

#

if you're waiting for 3+ objects to be valid and are not happy running a looping timer until everything is valid

#

you'll fail

#

you have to set up the OnReps for each pair of objects that depend on each other

graceful loom
#

That doesn't make sense

winged badger
#

separately

graceful loom
#

There are no dependencies

#

The player controller works, it's pawn works, the gamemode works

#

The only thing that doesn't work is callbacks from actors that aren't the player pawn

winged badger
#

we can't finish setting up a character without a PlayerState being there

#

for example

graceful loom
#

The player state works

winged badger
#

what callbacks?

graceful loom
#

The gamemode spawns actors, they replicate to the client, run beginplay, and at this point they should be able to run server rpcs

winged badger
#

not always

graceful loom
#

They're spawned with the player controller as their owner on the server, the player controller is on the client at this point and is running code already

winged badger
#

unless BeginPlay has been delayed

#

so

graceful loom
#

The debug statements from them are the last things that show up in the console

#

Everything is set up

winged badger
#

the OwnedActor and PC have same NetPriority

#

OwnedActor replicates first

graceful loom
#

Beginplay is defined as "when the actor is completely initialized" in the docs

winged badger
#

NetGUID to Owner can't be resolved

#

= fail

graceful loom
#

Oh?

winged badger
#

and if you're chaining owners

#

it can get even worse then that

#

since all actors in the chain would have to had replicated already

#

before you can send a RPC

#
bool USolsticeObjectLibrary::IsLocallyControlled(AActor* ActorToQuery)
{
    if (!ActorToQuery)
    {
        return false;
    }

    AActor* TopOwner;

    for (TopOwner = ActorToQuery; TopOwner->GetOwner(); TopOwner = TopOwner->GetOwner())
    {
         
    }

    APlayerController* Controller = Cast<APlayerController>(TopOwner);
    return Controller && Controller->IsLocalPlayerController();
}
#

this is basically a check

#

that if it returns true

#

you can send a RPC

#

you don't have to be owned directly by the player controller

#

can be any number of owners in between

graceful loom
#

so you're saying the actors are being replicated and started before the underlying network infrastructure has registered the player controller fully?

#

so it may be true that its their owner, and that it's running code on the client, but that doesn't mean it's ready to network?

winged badger
#

registering PC != registering NetConnection

graceful loom
#

ok gotcha

#

bizarre that it can replicate without having a connection but

#

I'll bite

winged badger
#

basically

#

there is no reason to setup

#

so you need to send RPCs immediately when the game starts

#

from client

#

we do send a few, but in lobby

graceful loom
#

so the PC should call to the server, then tell these actors that they're ok to send RPCs?

winged badger
#

and we don't care if they are a few seconds late

graceful loom
#

but the PC needs to complete an RPC before they try to?

winged badger
#

no

#

but all NetGUIDs involved

#

need to be resolved

graceful loom
#

I do have the server calling an RPC on the actors that can't call back

winged badger
#

and that can take a few frames

#

so setting up to depend on first Tick RPCs

#

is not ideal

graceful loom
#

ok I'm trying it ontick now and it never runs

#

getowner() is never nonnull

#

and the rpc never calls

winged badger
#

i have a PC that owns an AIController that owns a Character that owns its Weapons

#

and weapons can RPC just fine

#

but i don't try it on Tick 1

#

or BeginPlay

graceful loom
#

I'm trying it every tick

winged badger
#

you probably broke something trying to fix it then

graceful loom
#

so I'm getting it to spawn the actor with the PC's pawn as the instigator, the PC as the owner, and then I'm setting the owner explicitly to the player on the server

winged badger
#

btw

#

the GameplayStatic deferred spawn

#

so uncivilized

#

😄

graceful loom
#

if I don't do that then they spawn with a property not replicated and there's popin when it replicates and changes their material

#

this way they spawn with the right properties set already and there's no popin

winged badger
#

not talking about deferred spawn in general

#

just that particular function

graceful loom
#

there's another deferredspawn?

#

oh spawnactordeferred

#

lmao

#

ok

winged badger
#

no

#
    FActorSpawnParameters HeroSpawnInfo;
    HeroSpawnInfo.bDeferConstruction = true;
    HeroSpawnInfo.Owner = PC;
    HeroSpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

    const FVector SpawnLocation = SpawnTransform.GetLocation();
    FRotator SpawnRotation = SpawnTransform.GetRotation().Rotator();
       
    AHeroCharacterBase* Hero = GetWorld()->SpawnActor<AHeroCharacterBase>(CharacterData.PlayerClass, SpawnLocation, SpawnRotation, HeroSpawnInfo);```
#

that is also a deferred spawn

graceful loom
#

oh UWorld::SpawnActorDeferred just does exactly that

winged badger
#

it doesn't, or it didn't have all the overloads that SpawnActor does

#

or wasn't templated

graceful loom
winged badger
#

there was a reason i went for this approach

#

just not sure if its still relevant

#

been doing it since 4.9 i think

graceful loom
#

I'll try this

#

you don't set the instigator right?

winged badger
#

i do on stuff spawned from/for hero

#

as he be the instigator

graceful loom
#

and then you still have to use gameplaystatics::finish or there's another finish?

winged badger
#

Hero->FionishSpawning(AdjustedSpawnTranform);

graceful loom
#

still null owner

#

😦

#

Thanks very much for your help I don't have any other leads

#

I'll look more into the netguid stuff and wrap my head around how that's all getting set up

winged badger
#

if you're still at null owner

#

im wondering what your test case is

#

as bugs in debug tools are fun thing to have

graceful loom
#

I'm just running two clients from the editor and using ue_log, what else do you mean?

graceful loom
#

hahahahahaha

graceful loom
#

I didn't implement the AI...but I did enable it

#

two days on this

#

❤️

graceful loom
graceful loom
#

so does AIController ever create a net connection usable for server RPC?

lost inlet
#

why would it?

#

you don't know about other controllers as a client and something local to the server doesn't need a net channel at all

winged badger
#

AIControllers are not replicated by default

upper moat
#

if i make a local dedicated server do i need to open a port on my router for it so my friend from another country can join??

rocky night
#

Hi there, what makes less data usage when a plaer player dies. Ragdoll or a Deathanimation?

graceful loom
#

with hosting anything behind a nat

upper moat
limpid cedar
#

Anyone experienced with World Composition and streaming world tiles from a server? I was told perhaps this channel could provide some insight. Not actually looking for multiplayer functionality, but the ability to stream heightmaps from a server, and create terrain on the fly.

kindred widget
#

@limpid cedar I think that really depends on how you're getting the Heightmaps in the first place. Are they generated on the server?

limpid cedar
kindred widget
#

What is the resolution of the tiff files?

limpid cedar
#

Not sure yet, I believe they're sorted as tiles within tiles. To be honest we'd know more if we'd go forward with trying to clone the database.

kindred widget
#

My initial thought is just that it'd be fairly easy to compress the data into arrays by compressing them to shorts. You might not even need to do that. The max TArray limit is 2048 as far as I know, but I wonder if you can get around that by making arrays of arrays. Like a 2D array of shorts. I wonder what the max RPC size limit is? My knowledge is limited to RPC and replication but there is also the tcp route, but that's an outside solution that would need it's own implementation.

#

Very used to images being packed with the game files.

#

Someone like Jambax, Kaos, or Zlo could probably help you more with the engine limits.

rich ridge
#

if you host yourself , then you need to do load balancing, etc.

rich ridge
twilit sage
#

LogLoad: Warning: GameMode::GameModeClassAliases are deprecated, move to GameMapsSettings Hi guys, Does anyone have any idea how to resolve this? It happened after a project upgrade using generic shooter as a base. Google hasnt given me any ideas yet

rich ridge
#

go to maps and mode settings and check there.

twilit sage
#

Ok.. not sure whats going to be there to change tho

#

the only thing there is class aliases and game mode map prefixes

rich ridge
#

yes that one only

#

I don't have access to my UE, so can't tell exact stuff

twilit sage
#

Damn, well, filling out the aliases didnt do anything, it just stopped the erro message coming up lol.. game mode didnt stick in the url string for the level open node

grave notch
#

can you run dedicated server out of editor? When i compile it and run by myself it works but if i use netmode "play as client" in editor (to run dedicated server), im getting Warning: OSS: No game present to join for session (GameSession)
and nothing happens

ancient bramble
#

Hey guys is it possible to create a GET Request in Varest with just header and no body?

gaunt fractal
#

what's the difference between mp and EOS

rich ridge
#

@ancient bramble get request has no body. This is the standard.

rich ridge
gaunt fractal
bitter oriole
#

Unreal does the MP part

#

And you don't need EOS, you need EOS or Steam or GOG or your own service

gaunt fractal
#

you just told me I dont need EOS but i need

#

it

bitter oriole
#

EOS is just one of many online services

#

You need one

gaunt fractal
#

oh is it the best one

bitter oriole
#

Usually you use the one provided by the platform you sell on

gaunt fractal
#

ok so I'm using Steam

bitter oriole
#

Like on Steam you'd generally use Steam to avoid telling your players to register on EOS before they can play

gaunt fractal
#

ok

#

thx

#

would you recommend learning from websites or videos about how to use ue4 mp?

pseudo gull
#

i¨m using this values for default on my engine.ini and as far as i know this values are pretty old that come in Unreal template for a long time now....

#

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=15000
MaxInternetClientRate=150000

[/Script/Engine.Player]
ConfiguredInternetSpeed=15000
ConfiguredLanSpeed=20000

#

so does anybody know which would be a new standard for those?

#

or best method to adjust them? i´m using aws dedicated servers, and clients would be using standard internet connections

kindred widget
#

@gaunt fractal Realistically you should learn single player stuff inside and out. If you can't make a small game in single player, Multiplayer is going to be brutal. But in the end, you can get extremely far in multiplayer by just realizing the difference between an RPC and Replication, and the basics like server vs clients, abstracting your code to run on different machines, and knowing what can and cannot RPC/replicate to what.

#

@pseudo gull Can be whatever you want or need. The default before 4.26 was 10,000 on each of those. I think that 4.26 upped it to 100,000. For testing purposes I just leave mine at 1,000,000. A megabit per second is a little overkill. Or way overkill. But that can always be lowered easily later.

pseudo gull
#

so @kindred widget what you suggest is to multiply *10 at least? thanks in advance

chrome bay
#

In 4.26 the defaults are 100,000

kindred widget
#

1,000,000 is just my development default. I'd rather be able to just do things, and then optimize them later.

#

Hey Jambax, that does remind. What is the max current RPC size? I read Arrays was 2048 entries, but is there a bit/byte max?

chrome bay
#

Not sure off the top of my head tbh

#

There is a max RPC size, and a max partial bunch size somewhere

#

Most likely NetDriver or somewhere similar

kindred widget
#

Thanks! I'll go digging there after this mess of arrays of vectors.

#

Lol. I thought I'd skim really quick. I might need to take an evening to actually read through NetDriver. That is a ton of data.

primal isle
#

can anyone inspire me how can i connect team a to set red character color and team b to set blue character color? i tried multiple times and every time i only made the server red

severe widget
#

@primal isle store the teams as arrays of player states...

#

you wanna use another select node to also set the color

primal isle
#

thats how they are stored

severe widget
#

They're arrays of strings

#

Are you going to iterate over Players to compare names in order to get a player from TeamA ?

#

While we're here - don't do

primal isle
#

then its casted to playerstate bp and they go inside the string var in there

severe widget
#

You have the player state reference right there. Call PlayerState -> GetPawn

primal isle
#

i just fallowed a tutorial on doing the teams and im trying to assing colors, im a bit lost

severe widget
#

Follow the tut if you want

primal isle
#

the tut stops there

severe widget
#

what's the tut?

primal isle
#

and i cant find any better one on how to make the teams not shoot eachother

#

and how to add colors

severe widget
#

link?

primal isle
#

i tried getting the player character from each team's add index but it doesnt work

severe widget
#

Hrm. Okay, check the channel pins in this discord channel

#

There's some useful things to familiarize yourself with. Try making the changes I've suggested, see where you get stuck. I'll check back in, but I can't open the editor rn to give you a screenshot

severe widget
primal isle
#

im not really sure how to do that

#

i just started using this a month ago and trying to learn

#

i was stupid enough to say ill make my final year project multiplayer

severe widget
#

mmm

#

Okay so how did you spawn the select node for the string?

#

YOu wanna do that, but for CharacterColor

#

And you can get the pawn directly from the player state that you're setting Team on

#

GetPawn is the function name.

#

In multiplayer, it's a bad idea to use GetPlayerCharacter(0) or GetPlayerController(0)

primal isle
#

from the playerstate cast i can get get pawn private

#

this is whats in front of that

#

the gamestate

severe widget
primal isle
#

in my playerstate tehre is nothing but the team string var

severe widget
severe widget
#

Also further discussion on learning BP is likely more suited in #blueprint

kindred widget
#

@chrome bay I can't be certain, but I'm fairly certain that the max RPC size is a little over half of a megabit. At least in 4.26. I couldn't find the actual setting, but I did some fast testing with RPCing very large arrays of properties. All of the following array sizes send, one number up won't receive on server from a client through ServerRPC. Given that there's likely some slight overhead from the RPC itself and the array container, they're all close enough I'd assume that 65535 bytes is the max size.

int32
16,382 array size
65,528 bytes

FVector
5,460 array size
65,520 bytes

FVector2D
8,190 array size
65,520 bytes```
jolly siren
#

I'm running a test to see how many instances of our game we can fit on our dedicated servers. For some reason, it is reaching 100% cpu usage at around 13 games but I can continue adding games until 32 where it crashes from being out of memory. But even at 32 games the frame rate of our servers is still very good (58+). We are running 60hz servers. Does anyone know why this might be?

primal isle
#

i found a way to make it work

#

it looks like its working

pallid mesa
jolly siren
#

yes

pallid mesa
#

if you have full monitoring capabilities and your game is somehow very scoped within the resources of the server, might be the case that it's just convenient

#

but in these cases you better trust in monitoring values

jolly siren
#

We are using two different monitoring techniques. One is on AWS directly and the other is a node library. And they are both reporting the same results.

#

What could explain the reason that the servers don't dip further in frame rate if the cpu is already at 100% at 13 games?

pallid mesa
#

where are you getting that percentage?

#

from aws or node?

#

how are you retrieving the percentage in the node app? how is it calculated, is it something the OS provides or is it calculated by the provider?

#

because in our case we saw degradation when we started pouring servers into our nitrado instance

#

maybe the CPU % you are retrieving is incorrect?

jolly siren
#

So yes, it grabs it directly from the OS

#

os-utils (the node library) is saying it rises and then tops out at 100%. AWS and DO are both saying it rises and tops out at 90%

pallid mesa
#

I see, interesting

jolly siren
#

It's strange though because it tops out at 13 games but we don't really see any server degradation all the way to 32 servers where then instances just start crashing because of no memory left.

pallid mesa
#

yes I mean a 100% doesn't means you'll feel any degradation instantly

#

100% means that the CPU is busy most of the time (sys/user/kernel) time

#

so yeah in a way you'll find more context switches and slow downs that maybe aren't noticeable to a point that matters to you

#

however a 100% throttled CPU might cause issues with IO operations when required

#

you'd need a more granular monitor level to research these points

#

my recommendation is to keep the number as far to the 100% as possible

#

because that number doesn't for sure represent the full capabilities of your CPU

#

however it is what the vendor recommends to have a sane interaction with your system

jolly siren
#

As far away from 100%? There is a huge buffer between 13 and 32. So we could potentially be wasting a lot of money

pallid mesa
#

as far as possible to the 100% to keep a 100% sane interaction with your system

#

it would just be a matter to test empirically checking monitors how much can it really handle if you want mostly save money

#

and you don't focus too much in the system integrity

#

so ensuring that your server time doesn't drop your acceptance levels

#

and you don't have any memory error or IO stall might suffice in your case

#

with hw is just about test-test-test-test hahaha

winged badger
#

if your memory use grows as the game goes on though

#

starting 32 != running 32

jolly siren
#

True, yeah we have been running longer tests

pallid mesa
#

yeah, assuming server refresh and whatnot

jolly siren
#

Our games are only 8 minutes long

pallid mesa
#

but yeah not only hardware degradation, software degradation is a thing

#

hahaha

#

UE4 is kind of funny in some aspects of it

pallid mesa
jolly siren
#

I'm still not sure what you mean by this "as far as possible to the 100%"

#

Do you mean keep cpu usage as low as possible

pallid mesa
#

yes 🙂

#

that's an obvious thing to say anyways

jolly siren
#

okay, well yeah that would be nice but we are running these tests to try and squeeze more out of the servers

pallid mesa
#

and instrument your code

#

something you guys are probably already doing

#

it would just be a matter to check the timestamp delta to ensure that the reported server time is right!

jolly siren
#

Right, yeah we are doing all of that. Just wanted a sanity check on why server fps wouldn't degrade after reaching 100% and piling more instances on

#

Because I think our metrics and everything are correct

pallid mesa
#

mhm, but yeah, you guys are more than aware of the issues that might arise when handling a system that is running at 100% CPU usage

#

you can tweak the knob until you find that sweet spot for your game

#

and always, remember to leave some leeway

#

I don't remember the specs of our servers, god damn it 😄 , I would share with you the data, but can't find it

tranquil yoke
#

How would we handle case, where clients has bad Internet, which is causing , sudden disconnects from server.
Is there any way to make it more resilient ?

royal sigil
#

Hey guys!
Help pls, already fighting with one issue for a few days. My android muliplayer app has few maps. Each map after few minutes GM calls servertravel to another one and so on (map pool is looped). It worked for a while, but now somehow game on client always crashes when travelling between certain 2 maps. It does not show any error in logs and can connect afterwise.
P.S. Maps are added to cook in ini files. I've also tried to "Async loaaad asset" on start of the map to prepare client to travel for next map, but it does not help.

potent cradle
#

I seem to be having a case where I spawn an actor, pipe a reference to that actor down through a repnotify, and then find the reference to be empty. Is this some sort of timing issue, perhaps?

#

Hmm, yes. That's exactly it. Putting a timer in front fixes it, though that's dirty as heck of course.

#

I guess the only logical thing to do would be to have the newly spawned actor call the actor that is dependant on it, when it actually finishes spawning.

graceful loom
#

what's the naming convention for a function that's only relevant on the server, but isn't intended to be an RPC? Still prefix it Server, or should that only imply RPC?

dark edge
graceful loom
#

that's a good idea thanks

#

I'm pretty scatterbrained so every cue helps

dark edge
#

I think about it I think I actually prefixed mine as local.

limber gyro
#

does any 1 have experience with steam? im trying to open a overlay window directly in the market but i cant find any documentation for it

vocal cargo
#

Hey folks, can someone help me here?
I have a pawn that has custom movement that's being smoothed out so it looks good even when updated only once a second. This is very similar to the KrazyKarts projects if you know it.

My problem is when I try to stand on top of that pawn as a character, even if I'm attached to it.
The character only seems to update position as often as the pawn is updated, which results in very visible jitter.

What can I do here? Smoothing the character with similar code as the pawn might not work properly since it already has Unreal's own CharacterMovement replication. Is there another way to go about it?

graceful loom
#

this is only running on the client associated with the playercontroller I call it on; what else do I need to do to get all clients to run it when I call from server?

#

I'm calling it from gamemode so the call context must be correct

#

it's a member of playercontroller, I'm calling it by getting any arbitrary player and that's the only player who runs it

dark edge
#

@vocal cargo how exactly are you smoothing it? Like what is being set once a second and what is being set every frame?

graceful loom
#

maybe I'm misunderstanding; does netmulticast on an object only multicast to clients to whom an object is replicated?

#

so calling netmulticast on a player controller would never work

hollow eagle
#

correct

hollow eagle
#

well, it'd send to the client that owns that controller if it's different from the server

graceful loom
#

at least in 4.7 there was a bug related to multicast on playercontrollers, so it seems to have been possible

#

"Running a Multicast on a PlayerController causes bad things to happen because you're telling all clients to run a function on something that technically doesn't exist. Only the Server is aware of all PlayerControllers."

#

oh well there is that comment

#

so multicast is still an object instanced function and not a class function

#

makes sense to me

vocal cargo
#

it works great even when updating only a couple times a second, which is great since there might be hundreds of these pawns running

#

Getting this to work with the regular Character just seems impossible

dark edge
#

@vocal cargo is the movement smoothed on the server as well?

#

i'm failing to see how the CMC sees anything other than the smoothed movement

vocal cargo
#

I don't think so?

#

Only the mesh and everything "below" it, is smoothed

#

the collision box only updates as much as the NetUpdateFrequency (3 times a second at the moment)

#

But even attaching the player to that mesh doesn't seem to do it

gritty pelican
#

Hi, i have bug with DestructibleComponent, when i start play as client, my destructibleComp invisible, but collision worked, why?

#

also i can't find Fracture panel

#

for chaos

jovial dawn
#

Hello everyone, I wonder for a top mmo game with unreal server on a dictated server how many players it can handle.

#

it's there a way to test maxium capacity ?

fossil spoke
#

That would depend entirely on the game and what type of hardware you decide to run it on.

#

Ideally you would choose a baseline hardware configuration and then profile the performance of the Server with different Player counts to arrive at the optimal population for that hardware.

#

However this should be an ongoing endeavor as population and hardware configurations would change as the game evolves and/or you make optimizations that would affect the outcome of this process.

jovial dawn
#

for a top view game, the rendering should be fine for most pc, since it render only what the cam see

fossil spoke
#

A Dedicated Server does not do the same rendering as a Client. You asked specifically about Dedicated Servers.

#

Their requirements are entirely different.

jovial dawn
#

thank you for the info, some said that with a good server it can handle over 100 players

fossil spoke
#

Again, that depends entirely on the game, how well its optimized and the Hardware its running on.

#

If anyone throws a number at you without qualifying those points, the number is entirely worthless.

jovial dawn
#

Agree, it's the client that render the graph not the server, the server purpose is only to tunnel data across the player

fossil spoke
#

As an example, Fortnite has 100 Players, however it is extremely optimized (i would imagine) and it would be running on decent Hardware.

jovial dawn
#

depend of the game too... like I said topview won't render poly as much third view game , yes optimisation is important.

#

topview game does't need LOD

bitter oriole
#

Polygons aren't really the main thing to optimize in this decade

#

Graphics aren't the main concern with many players, really

kindred widget
#

I wish some people would use more polygons sometimes, instead of thinking they need a 16k normal maps. :/ Optimizing in the wrong direction.

thin stratus
#

Seems like people quickly forget that a 100 players also have to be supported by bandwidth. So you won't be able to do that without utilizing the replication graph anyway.

#

Most optimization I had to look at lately was pure code. As soon as you do "a lot" of something in UE4, it goes to sh*t.

bitter oriole
#

Honestly my main concern is always "but where are the players coming from"

#

If you think you'll be able to matchmake more than 100 players you are being very optimistic about your sales

thin stratus
#

Totally, but the ones who think it's doable will not listen to that argument anyway :P

bitter oriole
#

Literally top 0.5% of Steam kind of stuff here

kindred widget
#

I don't think I'd ever enjoy that kind of success. You become a business manager that has to handle multiple teams supporting one game rather than someone making games.

potent cradle
#

It sort of also depends what type of game. For games with longer continuous playsessions (so not really matchmaking), 100 seems plenty doable

#

I can see why matchmaking would be problematic (finding 100 people to go at any instant), but survival games easily pull that number as players trickle into a server over time

#

Now, stability on those servers is another matter entirely...

bitter oriole
#

If your game doesn't have a concept of matches and you can join in any time anywhere, sure, but this is not exactly common

potent cradle
#

Right, but "common" makes a lot more sense when you include the context of the genre

#

It's the defacto model in survival games

bitter oriole
#

In any case, even 100 players is laughably out of reach of small teams

#

Small as in, 2-3 people team

kindred widget
#

Anything that requires a dedicated server is out of reach for small teams.

potent cradle
#

Why?

kindred widget
#

Note, I said requires, not can use.

#

Because there's two requirements at the end of the day for dedicated servers. The first is cheating. The second is needing a server that can handle so much that it needs it's own application.

#

If you're worried about cheating, you need anticheat stuff. That requires either a lot of money, or a separate team(also more money). If you require the second, you also need a lot of money and support staff for your big ass game.

#

Either way, it's pointless for smaller groups to focus on that necessity unless you have a lot of capital to back it up later.

bitter oriole
#

More practically, dedicated servers aren't great value for games with 5 players in each session, and if you plan on having more than 5 players online as a small indie, you've got issues

rich ridge
#

From my experience you can avoid the need of anticheat framework, if you maintain clean code and person writing code has in depth knowledge of UE4

potent cradle
#

The first is cheating.
Hasn't stopped many survival games from exploding, even when cheat protection isn't really a thing. Rust (while it does have anti-cheat) has rampant cheating. Arguably, this is more important for some games than others, but it certainly hasn't stopped the genre I care about (survival) from exploding.

The second is needing a server that can handle so much that it needs it's own application.
Cost wise? Survival communities are chock-full of cummunity servers, clearly it doesn't seem to be that expensive.

potent cradle
#

(Really not trying to argue, but it conflicts heavily with the situation on the ground for various communities I'm part of)

bitter oriole
#

Clean code doesn't help you much against wall hacks and triggers

rich ridge