#multiplayer

1 messages ยท Page 537 of 1

peak star
#

So after my client joins a session, how do I get them into the same level that the listen Server is on?

#

On my other project it just automatically joined into the server's level but on my newest one it just sits there in the starting menu level after joining session. What do I do?

#

Does anyone know?

steep cipher
#

sounds like it doesn't join the session correctly

peak star
#

Ok I am using find sessions node and using a session object from there on the join session node. Do i need to do something else?

#

(After find session success of course)

#

In between i am storing each Session object found from the array into a button in a vertical box widget so the user can click the one it wants to join, then it uses that stored session object the button widget has to run the Join Session node

#

On my older project where it works, I just go straight from the find session node to the Joint session node using the first one in the array instead of copying them to widgets. I wonder if that's why that one works and my new one doesn't

#

Btw the one with the problem works perfectly when testing in editor using New Window with 2 or 3 players

#

The session name is my pc's name.with a bunch of letters and numbers after it

#

When testing built app on android mobile devices over wifi, the session appears in the list after creating on the host device, but its name is localhost with some stuff after that. Does that have anything to do with it not opening tbe level when it joins?

elfin cliff
#

@peak star Thanks a lot man. You fixed my issue. Found it at BaseGame.ini. Apparently overriding this does nothing.

ocean geyser
#

before i test and see how much pain is endured from falling off the roof of my house, can someone that has any ideas give me suggestions
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1750620-how-to-set-lobbybeaconstate

dark edge
#

Anyone here have a quick elevator pitch for how Unreal Tournament does its projectiles? Specifically, how it replaces the clientside projectile with the server's version when it replicates back.

thin stratus
#

@dark edge Can't you just read through their code?

naive locust
#

Is there any prevention of replicating variables through a delegate event?

#

prior to this, i had issues replicating a struct through a playerstate under normal circumstances. Now I can't replicate a text or string variable (repnotify is not called on the client at all) but this happens to be in a delegate (a timer) on the gamemode calling out to the [serverside] playercontroller to set this var which is set to repnotify

sterile wharf
#

I was just starting to try multiplayer today, I set up a little lobby system, and that's all working. There is really no game or anything up to this point. All I set up was some retargeting, Mixamo animations, and sprinting. So the issue is that when I test the clients, all the animations are super sped up and glitchy for them, but the other animations they see on other people aren't glitchy or fast at all. I looked to other videos on multiplayer and none of them showed any sign of the problem I was having. I'm pretty new to this kind of stuff, so, if anybody knows a possible solution, that would be great.

cedar finch
#

@sterile wharf This may help you if it's a replication issue. https://youtu.be/whow14uFWtw?list=PLemTaQ_N519DocM4AqiK08GfsUSnxRPdv&t=1

BRY

๐ŸŽฎ Unreal Engine Replication Series - Part 2: Game Instances

In part 2 of our replication tutorial series, we are introduced to the idea of game instances - not to be confused with the "Game Instance" class that's built in Unreal but the idea of multiple instances of the game ...

โ–ถ Play video
dark edge
#

@sterile wharf Is the actual movement of the capsule correct?

sterile wharf
#

ytes

#

speed is the same

#

just animations are messed up

dark edge
#

You aren't trying to replicate animation state are you?

cedar finch
#

@sterile wharf Type this into the console while in game just to make sure p.NetShowCorrections 1

dark edge
#

Like you're only replicating the stuff that's DRIVING the animation, not the animation itself

#

Also are you saying it's glitchy when sprinting?

sterile wharf
#

Yes but I know that's a replication issue

#

It's just base movement

dark edge
#

You're probably trying to set run speed from client which is being overwritten by the server

#

Show how you're handling sprinting

sterile wharf
#

It's not really about the sprinting it's before the sprinting actually happens that it's all sped up for the client

dark edge
#

Just show it in action.

sterile wharf
#

ok

cedar finch
#

If you see a bunch of red and green spheres when you type this in then it's a replication issue. If not then it's an animation issue like you said. I'm just trying to double check which one it is: p.NetShowCorrections 1

sterile wharf
#

its all sped up

#

also the command isnt working

dark edge
#

show your anim bp

cedar finch
#

So I have a weird problem with 4.24. When a player joins/loads into a level the gamemode executes the "Event Handle Starting New Player" which takes that players' player controller and then stores it in an array I call "AllPlayerControllers". I can then use that array later to get every player in the game and do things with it. What I do is create score widgets for each of my players and I simply pass along their playerstate as a reference value to the score widgets, that way Each widget on my screen can be tied to the corresponding players playerstate and It can receive updates on what that players points are. It works fine in 4.23 but my issue is that in 4.24 it is as if I have the player controller but the playerstate isn't loaded in yet or something. It creates the score widgets on my screen but there are no point values and I get the error "Accessed None" for my playerstate reference value I passed along, meaning there was no playerstate. The only way I can "hack" this to fix it is by putting a long delay before creating the widgets but that just seems wrong. Any ideas on how I can setup a check to know if all players are loaded in with their playerstates yet? Or is this just an editor issue? I havent tested 4.24 packaged yet.

sterile wharf
#

And im assuming an is valid check wouldnt work?

cedar finch
#

It passes the is valid. I did some reworking of how I set it up and I believe that it may just be 4.24. Everything works but If I set it to 4 players on dedicated server, it is really laggy and sometimes the points don't sync. I think it's just the engine version. I'll keep testing and see what I can come up with

naive locust
#

@cedar finch keep in mind that events are not guaranteed to take place in any specific order with respect to onpostlogin / onplayecontrollerswap / beginplay, among other things. One thing newcomers to multiplayer seem to have trouble with is how to handle such a sort of, asynchronous operation; meaning, it gets there when it gets there, or, it happens when it happens, no guarantees. Unlike single player experiences, development and code running are rather procedural, but multiplayer must be looked at through the lens of nothing is guaranteed to be there at a certain time in multiplayer. Initial loads are the biggest pain in the arse because as players load in, you have to handle them in such a way that you should run each newcomer through a process that involves back and forth between server and client to ensure they have gone through all the proper initialization before moving forward. Usually people put delays in thinking that a delay solves the problem. it is only a bandaid. Again, with multiplayer, nothing can be taken for granted. Always code for nothing being there and use callbacks appropriately

#

believe it or not, onpostlogin actually takes place in singleplayer too and usually seems to happen before beginplay, but not guaranteed

cedar finch
#

@naive locust Thanks, that has been my problem for a while. From my testing it seems like sometimes it works, and sometimes it doesn't. Just like you said, things seem to run in various orders for multiplayer so it's hard to know exactly when to do things when everyone isn't in the game yet. So my question is, how or where can I call my logic to set players initial score and anything else other players need to see right at the start of the game? I've tried things such as Begin Play, On Possessed, etc. But none of those seem to ever do the trick. If I can find a place that would execute once it's 100% sure the player is loaded into the game. It would send out the info to everyone, Then each time a player joined the game, no matter if it was 5 seconds late, or 5 minute late, that event would execute and let everyone know his info.

peak star
#

@elfin cliff so were you able to make it work with over 16 players per server?

naive locust
#

believe it or not, onpossessed only runs on the server, the client does not get a run at that. if you're using blueprints, one way to be notified that the pawn has been mounted by a playercontroller is to have a reference to the pawn as a variable on the PC set to RepNotify, then when OnPossess runs on the server, you set the pawn variable with the input of the OnPossess event (obviously casting it as necessary) then the client will get a OnRep_Notify function call and you can handle stuff there

cedar finch
#

That's actually pretty genius lol

naive locust
#

there is also an event you can get called OnRep_Pawn in C++ that will run when the pawn is mounted by a PC among other things

#

nothing genius there.. there's infinitely many ways of doing things.. it's all about understanding how to handle the things you need in some sort of order without relying on anything, other than what you can safely expect

#

OnRep runs on server/client btw keep that in mind.

#

you can check if it is server by using IsServer node through a T/F node

#

BIG SHOUTOUT TO @pure frigate

#

Freaking love that guy

#

so in short, your loading/initialization for MP should be a back and forth between server and client to ensure that the server side, and client side components are all loaded and initialized. One way to do this is with a timer using a delegate. Going back to the pawn thing... say you had 10 players; 9 and a server, and you wanted to start by loading a pawn for everyone to mount. You could set up the way I explained with OnRep, and create a timer with a delegate to run say every second. Then loop through all playercontrollers, and for each, first ensure the server (the one in your array on the gamemode) version has mounted a pawn, then call an event to its client equivalent (Run On Owning Client) and see if the pawn variable replicated, let the result (a bool for instance)it bubble back up to the server. You can keep a secondary array as a copy of the playercontroller array and remove elements that meet the criteria until no more elements, or, time expires and you kick the players that still haven't replicated for whatever reason.

#

something like that, then when done, remove the timer handle, then, move onto the next loading phase... rinse and repeat. Its work up front that pays HUGE dividends in the end and you'll be very happy you set it up this way becuase it makes no assumptions and it is very flexible

cedar finch
#

I kind of understand what you mean. But do you have to already know the amount of players that are connecting? Or are you just using the array and then waiting for them all to get removed or time run out?

naive locust
#

that is up to you. you're the one in charge... thats why lobbys work well because you control how many can log into the lobby (controlled by the querying client where you set up that the session result does not return if the lobby is full, and you dictate that number), then they all travel together to the new map. Alternatively, some games want dynamic login to a particular playable level as its running.

cedar finch
#

I have the lobby system where they all travel together so I know I could do the number of players that way but I'm not sure about in-editor testing. That's what always gives me the problems.

naive locust
#

my suggestion is jsut to start very small. Take a sample project, see how it works. dissect it to your hearts content. Seat time is good for you (if you don't abuse it ๐Ÿ™‚ )

cedar finch
#

I appreciate your help. Thank you ๐Ÿ™‚

naive locust
#

anytime. I'm sure others are mad that i clogged the channel, but i don't know if i'm supposed to take things offline or leave them in here for others to see

cedar finch
#

I'm sure it's fine. Lol People can learn from what you've been typing

naive locust
#

i'm sure there are errors in there somewhere, but the gist is solid

cedar finch
#

I get what you were saying. :)Now I just have to figure out how I want my system to work lol. But you gave me some good ideas to go on

twin juniper
#

Hello everybody, i'v a rookie question. I built a character with animations etc.. When i'm on the server point of view, annimations are working well. But When i'm on client, they dosnt work as expected. I know its about replication, so my question is : What's the "best" (i belive there is no best solutions) but still do you have suggestion on how should it work to be the cleanest way to make annimations runs on clients

#

?

naive locust
#

what is its base class?

tropic sandal
#

Hi so I wanted to ask if there was a good tutorial to learning on how to create a multiplayer game like apex legends or fortnite

stray gull
#

ive got a replicated playerlist setup for my game, using steam. but sometimes the client doesnt see the playerlist because the gamestate is not loaded in time, here are my logs and my blueprints

naive locust
#

@tropic sandal you can take some multiplayer informative videos and documentation out there to learn how to build upon them to build your MP game

tropic sandal
#

Ok thank you ๐Ÿ™‚

naive locust
#

I mean, doesn't sound like much help, but there really aren't any tutorials that just show you how to make that kind of game... it's a culmination of experiences ot make that stuff

keen thorn
#

@ocean geyser cool so in theory i could use them to transfer data between servers using UDP right

plush lagoon
#

Has anyone had to deal with: BroadcastNetworkFailure? Is there a way to bind too this Event?

winged badger
#

GameInstance has it bound already

#

HandleNetworkFailure

plush lagoon
#

I'm running into a issue where I try to disconnect the player either in the GameMode or inside of the GameSession during the PreLogin or ValidatePlayer Stages, and it ends up causing the whole game to crash

#
[2020.04.26-07.34.55:593][ 12]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = FailureReceived, ErrorString = Missing SessionKey, Driver = GameNetDriver IpNetDriver_0
[2020.04.26-07.34.55:600][ 12]LogNet: Warning: Network Failure: GameNetDriver[FailureReceived]: Missing SessionKey
[2020.04.26-07.34.55:601][ 12]LogNet: NetworkFailure: FailureReceived, Error: 'Missing SessionKey'
[2020.04.26-07.34.55:701][ 12]LogPackageName: SearchForPackageOnDisk took   0.100s to resolve MainMenu.umap.
[2020.04.26-07.34.55:702][ 12]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 192.168.1.5:7777, Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: NULL:MSI-3273B30C41052A45E169CB80775D84F1, Channels: 2, Time: 2020.04.26-07.34.55
[2020.04.26-07.34.55:708][ 12]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 192.168.1.5:7777, Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: NULL:MSI-3273B30C41052A45E169CB80775D84F1
[2020.04.26-07.34.55:709][ 12]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = GameNetDriver IpNetDriver_0
winged badger
#

and the callstack?

plush lagoon
#

Thats the error, which is a proper Error. But for some reason on the Client side, I cannot for the love of god figure out how to make the client go back to mainmenu if they receive a error like that.

#

I'll run it again 1 moment

winged badger
#

yikes

#

the crash in engine code is always annoying

#

to answer the original question

#
        GEngine->OnTravelFailure().AddUObject(this, &UGameViewportClient::PeekTravelFailureMessages);
    GEngine->OnNetworkFailure().AddUObject(this, &UGameViewportClient::PeekNetworkFailureMessages);
#

this is how you bind to those

#

@plush lagoon

plush lagoon
#

๐Ÿ˜ฎ

buoyant wedge
#

hello guys.
After i make a game state, player controller and game mode i have error when i set a mesh component " only owner see" any one know why?

real vector
#

Hi all,

I'm playing around with a multiplayer game where the host gets to play as well.
I've made functions to let my character take damage and if health is <= zero they die.

This works fine on the clients, but the server character doesn't die for some reason and I can't figure out why..
Any idea's?

Thanks!

#

Also, I see him die on my client window, but still looks the same on the server side.
It's quite funny as the server character can move around and shoot while looking dead on the client.. but it's not really what I'm looking for ๐Ÿ˜†

elfin cliff
#

@elfin cliff so were you able to make it work with over 16 players per server?
@peak star Yup. BaseGame.ini

kindred widget
#

@real vector You would need to show how you're handling damage to the characters. Somewhere you're excluding the server from it most likely.

real vector
#

I was playing around with breakpoints a bit and saw that it's not doing that when the client is calling it.

#

But I feel like I need some more checks to see what's being handled on the server ๐Ÿ˜…

kindred widget
#

@real vector First of all, I'm semi sure I'm reading this right but you're asking if the health-damage being passed into that function is greaterthan or equal to 0 and then doing nothing if it's negative, not even setting the variable that you're then asking if it's below zero. That shouldn't ever actually be able to go below zero if I'm reading that right.

real vector
#

That's right yea, it was to prevent the bullets from doing damage to a character that was 'dieing' triggering another 'die' function.

#

maybe not the best way, still a bit new to all this ๐Ÿ˜„

kindred widget
#

No, I mean before that. I get that last branch. I mean the very first one in your SetHealth function.

real vector
#

It will only give damage if the character's health is above zero, that's what it does basically

#

or only set health.. hmm i see it's a bit weird maybe. ๐Ÿ˜„

kindred widget
#

No, that's the branch before you call SetHealth.

#

The branch before you call it is If Health > 0 THEN call SetHealth

#

The first one in it is If (CurrentHealth - Damage) is >= 0 THEN Set new health

#

That should mean that no amount of damage would ever drop it below 0?

real vector
#

It could, but it won't give any damage to the character if the health is already below zero.

#

But looking at it, i think i could take the whole check out of there.

#

I see what you mean..... you're right ๐Ÿ˜„

kindred widget
#

For example. You have 20 health and bullets deal 15 damage each. You get shot twice. One hits for 15, your formula says (20-15) >= 0 == TRUE, so set health to 5. Second bullet hits, health is now 5. New formula is (5-15) >= 0 == FALSE Do nothing.

real vector
#

I get it now, I didn't have that because i set them to deal 10 now... but you're right indeed

#

thx ๐Ÿ˜„

kindred widget
#

But yeah, that wouldn't stop server stuff. Sooo, where are you calling these functions?

real vector
#

Ok so, there's a projectile that registers if it's overlapping a Character, if so I call the TakeDamage functions on the character

#

The projectile is replicating, but when I shoot it from my client the server won't do anything with it

#

I can see them fly etc. on the server character

#

well, i used to.. Not anymore now... wtf... ๐Ÿ˜ต I'm so confused ๐Ÿ˜„

kindred widget
#

Working now?

real vector
#

No.. I need to figure out what broke the replication of my projectile/gun

#

๐Ÿ˜ฆ

ebon plover
#

Hey mark you sound having replication issue, client apply damage (so he kill the server) but server didn't recieve the damage

kindred widget
#

In general, I'd strongly recommend switching to using the internal damage interface instead of relying on casting and your own functions.

real vector
#

Yea I think that's it, I just cant figure out where. ๐Ÿ˜„ It's probably simple if you know where to lookat ๐Ÿ™‚

ebon plover
#

internal damage is allway playing on the server

kindred widget
#

Using ApplyDamage and Event AnyDamage would simplify your workflow a ton.

ebon plover
#

if you want your own you have to do it from custom event with server only and reliable checked

#

client have to call server event to apply damage and this event should replicate the life or call multicast event to replicate to all

real vector
kindred widget
#

Yep.

real vector
#

I've been following a tutorial where they did it like this, probably found a bad one then. ๐Ÿ˜ฌ

kindred widget
#

Bear in mind that's a server function. It'll only ever work on the server. You'd then rely on the hit actor to replicate it's stats to let clients know it's been hit.

#

You can either call it like you are, which relies on server hit detection, which is fine if you're not running a dedicated server since the server is still running the same animations and stuff generally. If you were running a dedicated server, a lot of animations and the like are usually disabled so you'd write a few simple checks and rely on the client telling the server that it hit something which is sometimes risky but workable.

real vector
#

this seems to be a lot cleaner indeed, now i need to fix my replication issue with the projectiles. Had that working but i probably messed it up playing around with this..

#

Thanks guys ๐Ÿ™‚

kindred widget
#

@real vector Here is a small example of something you might use in the actor being damaged.

real vector
#

no ambitions to run it dedicated so far.. it already got a bit out of hand because my initial goal was just to make it reaaally simple to play with a friend.. ๐Ÿ˜‚

kindred widget
#

Note that the Multicast isn't actually necessary. You could also do that stuff on RepNotify with the health variable too.

real vector
#

In that example, where would you do the "Die" check?

#

I made a functin to set the health so there's only one place where it's manipulated.

kindred widget
#

After the health set probably, before the multicast.

real vector
#

Is the multicast a default function?

#

It's a custom thing right? Already made it. ๐Ÿ˜„

kindred widget
#

It's an event. The mutlicast is calling the event on the top.

real vector
#

I ment event indeed.. ๐Ÿ˜‡

kindred widget
#

But yeah, just a normal custom event. Click on it and change the Replicates value to Multicast. Since new health is updated often it probably doesn't need to be reliable.

#

How well do you know how RPCs work?

real vector
#

I know how it works etc

#

But I'm not sure what ue already does under the hood, also there's quite a few checkboxes for the replication.

One thing I was wondering about is that when you have an actor, like this one for example.
Would you then need to replicate all of the childs? Or would it be enough to do the toplevel? I'd say the last but it's surprising me that the childs don't show as 'replicated' because the parent already is.

kindred widget
#

Usually you'd just need to replicate the base. There are exceptions to that though. Sometimes you don't even want to replicate the actor. A lot of times you'll just tell each client to fire a bullet from a specific world location in a multicast with a given rotation. They won't be perfectly identical, but close.

real vector
#

hmm, that's interesting. You'd make an event like the earlier multicast and spawn and actor (Bullet in this case) from there?

kindred widget
#

Just depends on how you want to handle it and what else you're replicating that you can make use of. the problem with replicating most projectiles is that they move very fast and the default movement.. uhh.. Fix radius? Can't remember the term right now. The correction distance from the server's actor location. It's not that far, so you'd get a lot of jitterying on the client. That's why some effects like fast dashes or similar actor movements need to temporarily turn that off for a short time.

real vector
#

hmm ok, I get it yea.

#

So I made this earlier and modified it a bit. The internal function is to set a specific bullet type depending on the weapon we have (this class is the parent of a specific weapon type). The internal function calls the MulticastFireWeapon. Would this then mean that the other clients should spawn an actor on that location? Or do i need something else for that?

#

Sorry for all the questions ๐Ÿ˜„ I'm trying to understand how others are doing this.

kindred widget
#

All good. Ask away.

#

I see what you're doing and I know why, cause I had a bit of an issue with it myself.

#

The better thing to do is actually to give the weapon an owner. My weapon classes are set to be owned by the pawn holding them. That lets them call server RPCs for themselves

real vector
#

I gave the character an activeweapon, it would then call fire if the activeweapon is a valid one.

#

It's frustrating because it works perfectly from the server when looking as client, but it's not when im trying the other way around. ๐Ÿ˜„

kindred widget
#

Here. Let me show you a simplified version of how I'm handling this. Screenshot spam for a moment.

#

Pawn first.

#

Inputaction Fire is my left mouse.

#

Still not sure what I'm doing with those, but that's how I have it set up at the moment with it working.

#

Next is in the weapon.

#

First I'm telling the server to make sure the weapon is spawned and the reference variable is replicated correctly and the owner is set. Then the client's input action is calling an event in the client version of the weapon, which then calls an event in the server version of the weapon. That calls a multicast telling the server and all clients to fire the weapon.

real vector
#

Hmm ok, it looks pretty similar however you have a lot more replication on the events. Might need to play with that then?

kindred widget
#

If your server isn't seeing your clients shoot, it's most likely because you're not RPCing to the server to tell it that you're shooting.

#

What's in your FireWeaponInternal?

real vector
#

I've made it so that characters can pick up guns that lie around, a gun can't do anything without a character holding it so I think the way I have it right now (characters owns a gun) might be more suitable. Otherwise there might be 10 guns owned by the same player (If you forget to get rid of the owner)

#

It's just a function that sets the bullet type, my idea was I could set different amounts of damage etc based on the type of gun.

#

It calls the multicast fire weapon again

kindred widget
#

That's your dead link. That'll never RPC to the server.

real vector
#

So I could easily make a base class weapon and override it in the custom types.

#

hmm, it won't?

kindred widget
#

It runs on the server character and looks good on clients when the server does it because it's the server, it doesn't need to RPC, it can always multicast. You need to use an Event that's set to RPC to the server that'll call your weapon's multicast.

#

You can never RPC from client to Multicast. It'll just run on the client alone.

real vector
#

Hm ok, I'll take it out.

kindred widget
#

If you haven't looked at them, check out this page and scroll down to the RPC Invoked from Client and Server graph. It has a listing of where each RPC type will go depending on where they're executed from and by what actor owner type. It's good to reference for a while when thinking your logic through. https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html

Designating function replication across the network

#

Take note that there's only a single place where the client's interactions aren't dropped or ran on itself alone, and that's through a Server RPC.

real vector
#

Ok, I'm still struggling with replication of the actual weapon but this already looks better indeed.

kindred widget
#

Is your server able to see the client fire?

real vector
#

no..

#

This might be what im missing.

If the RPC is being called from client to be executed on the server, the client must own the Actor that the RPC is being called on.
kindred widget
#

Quite likely, but if you don't want to... Oh, I missed that.

#

So, you don't want to let the pawn own the weapon, right?

real vector
#

I think I had something different in mind by 'owning'... ill play around with this. I've got to go do some some stuff in the house but ill send you a message later if that's ok ๐Ÿ˜„

#

actually want to finish this but duty calls ๐Ÿ˜‚

kindred widget
#

Go for it! Ownership isn't that hard to deal with in regards to this stuff.

stray gull
#

ive got a replicated playerlist setup for my game, using steam. but sometimes the client doesnt see the playerlist because the gamestate is not loaded in time, here are my logs and my blueprints

tender sinew
#

I have an array of X : public FFastArraySerializerItem objects which call some stuff in PostReplicatedAdd. That stuff looks at a property of X, which is a uobject with custom OnRep_ used for an int inside of it. For some reason, this stuff observes that int as already being updated via replication, but the respective OnRep_ gets called AFTER PostReplicatedAdd. Am I misunderstanding something or is this behavior completely wrong? The PostReplicatedAdd function should only get called after this object's replication successfully completed, including all OnReps of subobjects, no?

meager spade
#

@real vector also be careful of multicast abuse

#

Fire Weapon should NOT be a multicast

#

@tender sinew a fastarray can replicate before Subobject's replicate

#

so never assume order.

#

your code should handle either case

tender sinew
#

The problem is that the fastarray code isn't mine and I really need that order ๐Ÿ˜ฆ

meager spade
#

its not the fast array code

#

its because the array can replicate before a Subobject can replicate to the client

#

there is NO way to control that.

#

i mean there might be, you could try force replication on the uobject and wait a frame or two before updating your array.

meager spade
#

right?

tender sinew
#

OnGiveAbility assumes that "this" is already fully replicated

meager spade
#

does it?

tender sinew
#

Well

#

hm

meager spade
#

this is the struct

#

which is replicated

#

InArraySerializer.Owner->OnGiveAbility(*this); this here is FGameplayAbilitySpec

tender sinew
#

The FGameplayAbilitySpec

#

Yep

meager spade
#

and that is replicated

#

PostReplicatedAdd will not be called on client if that item didn't exist

#

doesn't mean the UObject references inside it are valid at the time

tender sinew
#

And it does exist, but an element of "ReplicatedInstances" seems to be in a "partially replicated" state

#

The values are already set

meager spade
#

ofc

tender sinew
#

But the respective OnRep functions didn't get called

meager spade
#

the client also sets them iirc right?

tender sinew
#

No, it shouldn't

meager spade
#

oh you mean the ReplicatedInstances inside the AbilitySpec

tender sinew
#

Yep

meager spade
#

what you mean partial state?

#

PostReplicatedChange will get called

#

when that element gets updated

#

ie more instances are added

#

which clearly they don't care about

#

they just care about the Item

#

not if anything in that item changes

#

so only way if you need it to fire

#

is to add PostReplicatedChange

#

to the engine

#

and handle your case there

#

is there a reason you need all those instances

#

could you not just query all the instances when you need them?

tender sinew
#

i'm lost ๐Ÿ˜ญ

#

Okay, so an FGameplayAbilitySpec gets added to the array and then immediately changed

meager spade
#

its possible sure

#

depends on delays between abilities being activated

tender sinew
#

No, that's what I'm doing with a hacked CreateNewInstanceOfAbility

#

Calling Super::CreateNewInstanceOfAbility and then changing the ability object a lil bit

#

And this stuff happens on the server

#

Then the instance gets sent to the client

#

And I'm expecting that an OnRep function in that ability object will get fired first

#

And only then will the PostReplicatedChange get called

#

But they get called in the wrong order

#

And I fail to see why it works like this

#

Are there any advanced articles on how the replication system works?

#

Seems like I won't be able to solve my problem without getting an in-depth understanding of this stuff

real vector
#

@meager spade I broke a lot of the things i had playing around this afternoon.. ๐Ÿ˜‚ guess ill check all of the settings from the beginning again

#

cant get it to work as it should yet.. but thx for the warning

warm wolf
#

Anyone know of a good MP FPS tutorial? Just something to get a good understanding of setting up a dedicated server with clients that can connect to it. (C++ preferred)

ocean geyser
#

@warm wolf i have a tutorial that covers sessions, working on another series that goes into hosting your own without sessions by setting up a database and web api that UE4 interacts with for hosting/finding servers. all my tutorials are done in c++, is that what your after?

warm wolf
#

Hmm, maybe? I was using a udemy course that went through creating a coop game. But I was struggling on converting that into a dedicated server (that didn't have a client running on it.)I think I'm just missing something fundamental in the design. I'll keep digging.

ocean geyser
#

you would be doing some checks to determine if a server is dedicated or not, that would be for things related to creating widgets or restricting code using #if blocks. its not to hard to compile a dedicated server its just time consuming

warm wolf
#

(I'm not trying to do anything overly complicated I don't think) Just trying to put 4 people in a server and have them shoot each other.

#

Making sure they all see the exact same thing and that the server is authoritative

ocean geyser
#

then you should just be able to have the dedi server launch that map and have other clients connect to its IP. if going the session route in the start of the game state have the dedi server create a session and server travel to it, then other clients should be able to find the session

#

i cover doing what you said here for replication while making the server authoritive to prevent cheating and such
https://www.youtube.com/watch?v=CfCq_pK78yw&list=PLnHeglBaPYu_aUsm78py_O_OENKhdCGZS

I apologize for my mic, in the beginning it has some static and is picking up every sound, int he second half the mic is not sensitive enough either. I'm trying to find a good middle ground with my mic.

How to setup a dedicated server:
https://www.youtube.com/watch?v=_XW9oI36kTE

โ–ถ Play video
warm wolf
#

@ocean geyser Ack, thanks. I'll play around with it.

karmic venture
#

Getting 'identifier "DOREPLIFETIME" is undefined' and my google fu is failing me

#

I've added include "Net/UnrealNetwork.h" to my project header, and "OnlineSubsystem" to my PrivateDependencyModules but doesn't seem to be playing ball

arctic olive
#

is there a guide that i could follow to create a dedicated server and client with ue4.24?

winged badger
#

you just need #include "UnrealNetwork.h" in the .cpp file that uses DOREPLIFETIMEs @karmic venture

karmic venture
#

Yeah, that was a dumb one, I've been looking at this screen too long

warm wolf
#

@ocean geyser Nailed it, thank you.

quiet fjord
#

how can make grind in mesh like a wall

#

'

#

?

twin juniper
#

what do you mean by grind

#

and what it has to do w/ multiplayer

cedar finch
#

What is the proper way to shoot projectiles in multiplayer? I handle my linetrace in my character when I shoot and then spawn the projectile at my weapon muzzle, Then make it move towards where the line trace hit. But I do all of my damage and FX logic inside the projectile. Is this a good way?

civic mirage
#

hey , i'm trying to replicate something, but when i pick up my object it show the hud on the client and the server ..

#

when i pick my object on server, it only show HUD in server, but when i pick the key on clien it show HUD on client and server

#

can anyone help me please ?

brittle sedge
#

What is the proper way to shoot projectiles in multiplayer? I handle my linetrace in my character when I shoot and then spawn the projectile at my weapon muzzle, Then make it move towards where the line trace hit. But I do all of my damage and FX logic inside the projectile. Is this a good way?
@cedar finch If the projectile is predictable I would only replicate a "Shoot" event with the position and velocity and then spawn the projectile client side. No need to keep replicating the movement if it's predictable on the client.

cedar finch
#

@brittle sedge So I don't have to spawn my projectile OnServer? The way I do it now is by spawning it OnServer and I have "Replicate Movement" checked in the projectile. I'm real interested in doing it the way you mention because that sounds more optimized than the way I'm doing it

brittle sedge
#

Yes just Multicast the Spawn projectile event.

civic mirage
#

can anyone tell why why its putting hud in the server too ๐Ÿ˜ฆ

ocean geyser
#

not until you show us how you have it setup

civic mirage
#

sorry ! i show you right now

#

but its a long blueprint i do my best

#

"pickmulti" is multicasted

#

"pickserver" is run on server

#

also i replicated where it add to viewport

ocean geyser
#

its running on all clients because your multicasting the add to viewport and such

civic mirage
#

but when i did not it was replicated on all client too

ocean geyser
#

it shouldnt, your going from client to server and then multicasting which is running it on all clients and the server

#

you only want it to run on the client that did the action

civic mirage
#

yes its true, hmmmm

#

oh

#

maybe because it go to play animation

#

play animation is replicated

#

how can i play all my bp replicated but just remove animation that is in middle of it ?

ocean geyser
#

remove it from the BP and just perform it on the client

civic mirage
#

ill try that, im so new in ue ahah

ocean geyser
#

all good lol

civic mirage
#

ok so my animation is played on mouseclick, if i remove it i cant set it again i think

ocean geyser
#

explain what your trying to do exactly

civic mirage
#

actually i just removed the animations to test but it still show the hud on the client and server

merry pebble
civic mirage
#

okay, so, when i pick a key , an HUD display, and when i pick this key on client the HUD display on the server too

ocean geyser
#

on the client, use your line trace or whatever you were using to pickup the key. make a RPC call to the server, have the server check and see if your within X distance of the key (to prevent cheating), if your within X distance of the key, make a Client RPC call back to that client and have that funtion spawn the HUD

civic mirage
#

hum that a great idea, by RCP call what do you mean ?

ocean geyser
#

just like how you make those functions Server and Multicast. those are RPC calls

civic mirage
#

ok thanks you i will do my best !

merry pebble
#

Anyone able to help?

civic mirage
#

ommg @ocean geyser i just did a random thing and it work !

#

look

#

sorry Idealist i'm new i can't

#

so just before i add it to viewport, i changed the autority

#

i set "viewportmulti" on Run on owning client

#

and "viewportserver" Not replicated

#

does it work good like that ?

ocean geyser
#

looks good

civic mirage
#

thanks you ! as i understand , we can start replicate and stop everytime we want ?

#

by adding this

ocean geyser
#

its not really replicating to other clients its just the server telling the client that he can go ahead and do stuff with the key

civic mirage
#

ohh i see, replicating is more the visual

#

sorry bad english ^^

merry pebble
#

Dang lol

thin jacinth
#

Hey any1 know how to implement a system that from a certain people 1 becomes a monster, like friday the 13th?

warm wolf
#

Was watching a tutorial and he did this:

#

if (GetOwnerRole() < ROLE_Authority)
{
ServerControlSprintingTimer(IsSprinting);
return;
}
else if (GetOwnerRole() == ROLE_Authority)
{
if (IsSprinting)
{
GetWorld()->GetTimerManager().PauseTimer(StaminaHandle);
}
else
{
GetWorld()->GetTimerManager().UnPauseTimer(StaminaHandle);
}
}

#

wouldn't this be more efficient?

#

if (GetOwnerRole() == ROLE_Authority)
{
if (IsSprinting)
GetWorld()->GetTimerManager().PauseTimer(StaminaHandle);
else
GetWorld()->GetTimerManager().UnPauseTimer(StaminaHandle);
}
else
{
ServerControlSprintingTimer(IsSprinting);
}

#

or is there something about ROLE_Authority I don't know

#

Checking the variable twice seems like it would use extra cycles?

fleet raven
#

there is no need for the second if

warm wolf
#

@fleet raven So the second code segment would work? Thanks. New to C++ and Unreal both. Wasn't sure if there was somehting I was missing.

ocean geyser
#

@warm wolf that looks like my tutorial and you are correct, i goofed on that one.

warm wolf
#

Thanks Cody. It is, and I'm just making sure MY logic is correct. ๐Ÿ™‚

#

Your tutorials are great. You've helped me solve a couple problems I've been banging my head against the wall on for days.

ocean geyser
#

your right, glad to hear. the next series will be greatly improved from the current crapshow XD

warm wolf
#

I figure as soon as I'm done with the tutorials I'll go through and refactor all my code as another exercise.

ocean geyser
#

that would be good practice

warm wolf
#

I -am- trying to figure out why you put the stamina regen timer in SurvivalCharacter instead of all packaged inside of PlayerStatComponent like Hunger/Thirst? Would seem to be better to keep all the stats together?

ocean geyser
#

if i recall i think i end up moving it over but im not 100% sure. like i said its a crap show XD

civic mirage
#

Cody, i have problem... my object collision is disabled but my linetrace on my client still detect collision

#

i used set enable collision and unchecked it

ocean geyser
#

you have to set it on both the client and the server

#

if you set it just on the client the server will try to block it and vise versa

civic mirage
#

i have multicast and run on server, then after that i have disabled collision

agile lotus
#

I noticed in laggier scenarios release inputs are sent before pressed

#

is there a way to prevent this

ocean geyser
#

make sure your disabling collision on client AND server, such as doing it in the multicast

civic mirage
#

hmm, i just did that before but redonne it like this but dont work look

#

shoudn't be okay ?

ocean geyser
#

that should work, its firing right?

civic mirage
#

hmm its hitting on client yes

#

isnt that strange that the line is red but he still pick it up ?

ocean geyser
#

is it a stuttery collison? like after its disabled when you walk into it its glitchy?

civic mirage
#

you mean after i enable collision is it glitchy ?

ocean geyser
#

after you disable it, after the multicast ran

civic mirage
#

hmm no it just go trough

ocean geyser
#

isnt that what you wanted?

civic mirage
#

in the object, pawn collision is set to false too

ocean geyser
#

oh wait derp the line trace detects it, i misread

#

i thought you meant general collision

civic mirage
#

nope, i mean the linetrace yes ^^

#

i can pick it up but linetrace dont go green

ocean geyser
#

you would need to either edit its collision channel or add a boolean on the key indicating that its been picked up

civic mirage
#

i have a boolean on the key

#

and if its picked up, it should not linetrace

ocean geyser
#

when you try to pick it up, check if the boolean is true/false

civic mirage
#

how can i check while in game *?

ocean geyser
#

is the boolean replicated? you will be better off honestly using OnRep events for this in my opinion for picking stuff up

#

i mean when you pick it up, if the boolean is true (meaning its been picked up) then do nothing, else continue

civic mirage
#

the boolean is not replicated, hmmmm its getting hard ..

ocean geyser
#

would you want me to help you 1 on 1 and we can start from scratch with it and i can explain stuff and set it up to use OnRep events. might make it easier and you can learn from it

civic mirage
#

i would love that ! ^^

ocean geyser
#

how late will you be on?

civic mirage
#

until i find out the problem xD like yesteraday i was up until 7 am ..

ocean geyser
#

damn, well i guess i dont have to worrya bout you going to bed

civic mirage
#

haha but you can go if you are tired man

ocean geyser
#

just doing school work. once my assignment is done ill let you know and we can get started

civic mirage
#

yep thanks and take your time !

civic mirage
#

ok so i can make it work by exchanging multicasting and run on server but then my viewport wont work

#

or it will be show on server too

civic mirage
#

ok so actually i did a strange thing but it workl

#

so

#

i made a box collision and when i pick the key, the key go in the box collision so i cant pick it xD

#

and when i drop key i disable collision

#

and if i put visibility collision only so it will only collide with linetrace

civic mirage
#

Im gonna stay with that for now, it seems to work good, thanks you Cody have good night

merry pebble
#

Anyone able to help?

stray gull
#

im trying to load steam avatars from the client. i have a function that does it when the gamestate begins... so i can get the player array but the playerstate loads after the gamestate so my function accesses none, how do i fix this

bitter oriole
#

Well, don't do it in gamestate

stray gull
#

ok, i want it to run everytime a user joins so where would i do it?

bitter oriole
#

You want to run what ? Loading the Steam avatar ? Obviously that's something that relates to the player, so player state ?

stray gull
#

ok ill go try something

agile lotus
#

how do you get IP from steam session that is listen server

#

if possible

thorn spade
#

How can I play a sound but all the players can hear it because only the one who plays the sound can hear it but the others can't hear anything?

kindred widget
#

@thorn spade What kind of sound is it? What is making the sound?

thorn spade
#

I have an A.I. and it's the one that makes the sound

kindred widget
#

@thorn spade Haven't gotten to AI stuff yet, but generally I think you need to call a multicast from a server event and play the sound there.

thorn spade
#

All right, I'll try. Thank you

heady tangle
#

I've been working for about 4 months trying to replicate a simple melee combo system. I can get it to play and work without replication the moment I add replication the animations do not play on the client or server does anyone know of a tutorial to watch or would anyone be willing to help

#

Solve the problem

kindred widget
#

I'm not 100% certain on this, but you shouldn't be doing any replicating in animations. Animations should always be handled solely on the client. It's okay to get replicated variables from your pawn and let the client use them in the animation to do stuff like state changes. What you should be trying to do is replicate states across all versions of the Pawn, tell each version what it should be doing at that moment and let the client do the actual animation work.

heady tangle
#

@kindred widget I actually have everything set up in the actor and character not in the animation blueprint

#

The only thing I have setup in the animation blueprint is is for controlling the montage to chain the attack combo or reset the combo or stop the montage from continuing to play

kindred widget
#

@heady tangle So far you're only calling a Multicast from a bunch of non replicated events. If these run on a client, they'll multicast from the client, which will never leave the client. Clients cannot multicast.

heady tangle
#

@kindred widget where should o begin

kindred widget
civic mirage
bitter oriole
#

Sounds expected. Only create widgets on clients

civic mirage
#

so i did set visibility to false, and on begin play i set visibility "only run on owning client" but it dont work

#

i do not have a "create widget" because my widget is already attached to my player

heady tangle
kindred widget
#

@bitter oriole Actually hey, while you're here. I had a question regarding widgets and such myself. I was testing out ways to remove and display widgets based on when a character possesses a pawn. The first possesses actually seem to happen before the client can process them, tested this by making the function delay for three seconds. But I did manage to get it working well with a replicated bool and a repnotify. Do you know of a better way to handle stuff like that in general or should I stick with the repnotify method?

bitter oriole
#

I usually try to work with an observer-type pattern, where I monitor the state of something (is a pawn possessed) and the current state of the UI (not visible) to change the UI if needed (become visible)

#

Events are tricky once you have many of them because it's hard to control the order

royal isle
#

If I set a replicated property to COND_InitialOnly, is it certain that it would replicate or might it fail completely if the channel is overwhelmed?

civic mirage
faint lintel
#

I have a problem with c++ multiplayer client side prediction. Using listen server.
I use NetPktLag=1000 to simulate lag of 1 second.
On server all works well, but on client I have some problems.
I have a method that teleports my character from place A to place B, and I also have a debug console logging in the same method.
When I press a button that activates the method logging appears right away, but with character one of the following thing is going to happen:

  • teleported right away
  • teleported after delay
    -teleported for a millisecond then back, and after delay teleported to the location

to teleport character I am using SetActorLocation(NewLocationVector);
Any Ideas why client side teleportation doesnt happen right away always?

twin juniper
#

because simulating lag is both for out and inside data

#

so 1 second delay might be also applied to coming back from the server

faint lintel
#

I commented out the part where I also send the locally simulated teleporting to server and seems like I can not teleport anymore at all

heady tangle
#

Still looking to see if anyone has any clue on how to replicate a combo system

faint lintel
#

I set NetPktLag=1000 on both client and server side and my character will be teleported and then set back to previous place, because I do not send the update to server.
It seems like my problem comes from server being too fast and when I teleport then server goes to correct it. That seems to cause teleporting for a millisecond and then back and then to destination

civic mirage
kindred widget
#

@civic mirage Are you replicating components?

civic mirage
#

yes imm replicating my whole game haha

#

i just find out why

#

i unchecked "replicate" on almost everything on my character and it works

kindred widget
#

It's because your client always exists slightly behind your server. Your server sends updates to the client and the client is in a different point, so the server's replication overrides it and make the client reset it's position over and over. Don't replicate anything at all unless you need to.

civic mirage
#

yes thanks you @kindred widget for your explaination !

round roost
#

I have a weird problem, that my variable of a replicating actor is replicated, but RepNotify is never called ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

#

Hmm it's called on the client - as it should, but not on the listen server

kindred widget
#

@round roost Then you're not setting your variable on the server for it to actually be replicated, it's being set on the client.

full sapphire
#

seemingly simple question: I have local split-screen multiplayer, and 2 Xbox controllers connected, both working with the editor camera, so their connection is ok. However my only my second player controller receives input from the second xbox controller, created from blueprint, my first player controller created by the engine by default doesn't receive xbox input. Where should I look to fix this?

#

I'm a seasoned developer and it's so frustrating to run into these shits with UE4

atomic pelican
#

So it seems that character movement rotation cant give any kind of smooth results, so I decided to to do simple Rinterp for player rotation. Now I'm just wondering if there's any good way to replicate this. Of course I could just replicate yaw value for clients but then there would be no predicate. Any ideas?

full sapphire
#

(solved my problem, Controller ID's start from 1, not 0, jeeez forfucksake)

surreal idol
#

Hey guys, quick question. Has anyone achieved satisfying results (in that no jitter or weird desync), when an autonomous proxy controls physics objects through a physics handle (especially while moving himself)?

kindred widget
#

@atomic pelican Wait, what's wrong with character movement's rotate? I've never had an issue with it by using Add Controller Yaw Input.

atomic pelican
#

well, when you put rotation rate to 180, it rotates really slowly, then if you put 180.001 it will be instant

#

and if I use add controller yaw input, no matter what value I put in rotation rate, it's always instant

hybrid zodiac
#

HI everyone, is there a way when play testing a game to simulate a client joining a game in progress? Currently the clients and server all start at once, so I can't simulate what happens if someone joins a game that is already in progress. I ask this because I encounter a few bugs and crashes that only occur in those circumstances

atomic pelican
#

well solved my issue by unlinking camera boom from controller rotation, doing camera rotation manually and then just smoothly add yaw input :/

twin juniper
#

Editor Preferences > Play > Untick use single process @hybrid zodiac

#

then choose play as offline

#

and after initializes

#

open up the console and join via code

#

open ip

#

is it dedicated ?

hybrid zodiac
#

Yeah it's dedicated

#

Thanks, I'll give that a try!

#

@twin juniper Ok so I unticked use single process, chose play as offline but it just opens a window as standalone, and run dedicated server is greyed out

twin juniper
#

ooh

#

hold on then

#

play as standalone with server

hybrid zodiac
#

Ah brilliant

twin juniper
#

its also better to test your multiplayer features

#

by not using single process

#

because both the server and the client acts as its using the same computer

#

if single process is used

#

so if you try get player controller

#

and 0 index

#

it will always get the server

#

unless u untick single process

#

It takes longer but more reliable

#

although not using get player controller 0 is better in mp imho

#

Is a game that updates/syncs to the server every 2000-3000ms more hackable than one that syncs every 100ms? If they are practically the same, is there any extra measure I might take anyway?

hybrid zodiac
#

@twin juniper Thanks ๐Ÿ™‚ If I want to open the ip to join the server, would that be the usual 127.0.0.1?

#

I'm trying open but it's not working, but my game has Steam integration so it might be because of that

twin juniper
#

uuhh

#

no

#

I think its your local ip

#

I believe

#

try out some

#

you will find

hybrid zodiac
#

Thanks ๐Ÿ™‚

hybrid zodiac
#

Another question: I have an issue where players can build constructions which can either be in a "destroyed" or "complete" state. I have a boolean "bDestroyed" which is replicated and has an onrep function assigned. The onrep function sets the construction's mesh (and collision) to the destroyed or completed state accordingly

#

I've noticed that although the bDestroyed boolean is replicated to clients who join the server mid-session, the OnRep function doesn't seem to be called: the constructions are all stuck in the "destroyed" state

#

There are no conditoins on the replicated boolean

#

Is OnRep only called if the client detects a change and not on the initial bunch?

civic mirage
#

hey guys i would like some help for a basic thing

#

i would like to replicate my door

#

i open it on server it works but when client open it server dont see

#

i already did multicast and run on server but server still cant see

meager spade
#

@hybrid zodiac OnRep is called if the clients value is different to the server

#

so if server has bDestroyed to true, and client has it to false, the onrep will call when server sends the initial bunch

gritty pelican
#

Hello, how to disable NetCullDistanceSquare? I want the object to always replicate

meager spade
#

or does it.. i cant actually remember, you might need to do your own checking in BeginPlay

#

@gritty pelican a google search would answer that

#

tick AlwaysRelevant

gritty pelican
#

thanks

late bluff
#

The "IsNetRelevantFor" function is only called on the server, or am I mistaken?

peak star
#

Hm that's weird. My.last message didnt arrive

#

I set up a google cloud function to store the ip address of the user who is hosting a game. It does this by reading the headers of a simple http request from that user. However, this request shows the public IP address of the router, not the hosting device that is behind the router. If other users want to join the game at that IP, how can they tell it to connect to that device and not just the router?

#

Would it be enough to add the correct port number e.g. 123.456.78.910:7777 ?

#

When the client executes open command e.g. open 123.456.78.910:7777 ?

#

Or do I need to find a wayfor the host to send its local IP address out instead so when potential clients are looking for a game they can see that too, assuming they are all on the same LAN?

dull island
#

Hey folks, so it looks like ChoosePlayerStart is called before the player controller is assigned NetController - and that ChoosePlayerStart happens before OnPostLogin

#

Does anyone know how to get the network connection (or at least the remote address) during ChoosePlayerStart?

#

I need the network connection information of the controller to correctly choose the player location

twin mortar
#

im kinda new to the whole "multiplayer" side of unreal I have a few questions if anyone can answer them

#

can i make a online multiplayer with just blueprints?

ocean geyser
#

@twin mortar yes, sessions however are not the greatest with just blueprints unless you use advanced sessions plugin

twin mortar
#

hmm ok thanks for letting me know

naive locust
#

@peak star i'm not sure if it will work, but unless the connection coming in is broadcast (like a video), you're going to have to portforward 7777 or wahtever port you're using to the specific machine hosting. port forwarding is found on the router every router is different on how to do it (menus, creating an entry, etc.).

peak star
#

@naive locust Thanks. It sounds like the user would have to configure their router for that to work. That's not gonna work for me, since I need my app to be playable without people fiddling with their wifi routers.

I did find a way to determine the device's IP address by wrapping a C++ function call into a blueprint node, which works great on Windows but on Android returns 127.0.0.1 which if someone connects to it will obviously not go where they want to.

Someone wrote an article about that problem. Does anyone know if there are plans to fix this in future versions of Unreal? I have 4.23.1.

https://blog.squareys.de/ue4-android-windows-lan-multiplayer/

bitter oriole
#

You avoid port forwarding by setting up NAT punch like Steam does for you

#

But this isn't a port issue

peak star
#

Right I want to not require the users to have Steam

#

And you're right about the port for LAN purposes anyway, since I never had to put in the port # before when this used to work.

#

I found out Hamachi had been turned on at some point and got that turned off, but now I can't even connect via command "open 123.456.78.910"

#

(except multiple instances of the game on the same PC)

naive locust
#

When you're on LAN, you're all on the same local area network

#

there is no need for port forwarding, every machine will multicast out to find the one who accepts the port number.

#

if you're behind a router, the only way you're getting someone to access your game is with port forwarding. The router has zero idea of where to route that traffic, unless it is broadcast like video when it comes into the LAN, I don't think it will work

bitter oriole
#

This is not the issue

naive locust
#

if this is not the issue, i would liek to learn more please

#

what is the issue

bitter oriole
#

The issue here is apparently UDP broadcasting disabled on Wifi by some phones

naive locust
#

I have never seen that in my life.

#

UDP is a protocol standard used everywhere

#

expecially in publish subscribe models

#

i mean DNS uses UDP and TCP for crying out loud

bitter oriole
#

Okay none of this is relevant tlo the issue at hand

#

@peak star Can you refresh me on how your system is supposed to work ? Phones connect to a PC on the same local network right ?

naive locust
#

can you show me one router that blocks UDP by default, without configuration please?

#

just one

bitter oriole
#

Phones, not routers

#

UDP broadcast, not UDP

#

Just read the link shared earlier before you comment on it please

naive locust
#

is he not trying to go from outside to inside someone's lan? I'm confused, the other day he was talking about trying something remotely where he was in one place, and another machine was somewhere else behind another network. In his latest entries, he suggests in one area that he is doing outside in, but in another entry, he said as in a LAN setup, so I'm not sure. Hopefully its LAN, and your article can help him

bitter oriole
#

It's not even my article

#

He linked it ๐Ÿคทโ€โ™‚๏ธ

rich ridge
#

When I load a new map with other GameMode, is there a way to load this new GameMode with some data from old GameMode

naive locust
#

i guess thats what you get for being up at 3am, isn't it?

#

+1

#

@rich ridge unless you store it in gameinstance so its persistent through traveling to the new map, yes

#

then you can set the data in the new gamemode... i've never tried that in blueprints, i don't think you can do that, but i'm not 100% sure. You can absolutely do that in C++

rich ridge
#

I know I can do that, I thought GameMode has an API which I m not aware 0f.

naive locust
#

gamemode is destroyed afaik like everything else except traveling playercontrollers and gameinstance, but hey, i'm not perfect ๐Ÿ™‚

rich ridge
#

ok so what happens to this call.

#

does it also get called in new GameMode

#

since all my players logged in old GameMode

#

since you said PlayerCOntrollers are not destroyed, but above function creates PlayerCOntroller

#

so in new GameMode PlayerController is again created or not?

naive locust
#

when you travel, you can (at least in blueprints) handle the event OnPlayerControllerSwap

rich ridge
#

oh thats new

naive locust
#

so what is running that code? I take it GM.

rich ridge
#

yes GM

naive locust
#

so, i guess the question is, what exactly do you need from the old gamemode?

rich ridge
#

like draft picked data.

#

spawn points, selected skins

naive locust
#

all of that you can just hold in the server's gameinstance, then take it back down after successfully traveling ot the new map

#

or

#

if it is playerspecific stuff that you want in the playercontroller for simplicity (just keep in mind of potential issues) you can keep it in the old playercontroller, and in the new, you can swap the data

rich ridge
#

The problem is I have DraftManager, SpawnManager, etc and I want them to exist on server only.

naive locust
#

i mean, i'm not exactly keen on your game, but if you're loadin ga new map, and you're keeping spawnpoints, i'm not sure references will work

#

well, from the gamemode (server only) you can copy the data to the gameinstance (server's gameinstance) then when server successfully travels to new map, it takes it down and sets data. I just don't know if previous data from a level can be used as references in a new level, never tried that before

#

if that does not work, you can have metadata (like properties that uniquely identify some control object for example) and then set vars in the gameinstance to be equal to the values of that metadata, then in the new level, you can use that data to search for those items

rich ridge
#

previous data from a level can be used as references in a new level, we shuld not do this as it will hold reference of level in memory and cause leaks

naive locust
#

i am saying i am not sure of that, i do not know. I know I probably wouldn't do it even if it did work. I wouldn't want to take a chance whre something blows up b/c of a null pointer

rich ridge
#

good idea though, thanks mate

naive locust
#

let me know how that works out for you

rich ridge
#

sure

winged badger
#

i use an Actor persisting through SeamlessTravel to transfer data between my levels

#

writing then reading from GI always seemed inelegant

royal isle
#

Hey people, is there a config value I can use to change my server's tick rate?

bitter oriole
#

Tick rate is a performance metric

fleet raven
#

not completely, by default dedicated servers won't tick faster than 30 hz

bitter oriole
#

Ah, right

chrome bay
#

AFAIK this works.

MaxNetTickRate=60
NetServerMaxTickRate=60```
#

@royal isle

bitter oriole
#

Though it's still only the maximum tick rate, as the name suggests

royal isle
#

Thanks guys ๐Ÿ™‚

kindred widget
#

So I've been playing around with the Widget Interaction component. I've gotten it to work perfectly if I just set IDs based off of the player's playerstate id. I was really hoping to just bypass this entirely by only spawning the component on the client that owns the actor. I managed this, but for some reason it still seems to act like there's more than one widget interaction component with the same ID even though there's only one on the client and one on the listenserver. I've tested to make sure there's only one by getting all actors of class for the actor that spawns them, and getting all components by class for the widget interaction component. One WidgetInteraction component prints per window. None of this is replicated since I was hoping to leave all of this down to each client yet it's acting like it can still somehow see the other widget interaction components. So am I stuck just using random IDs for this?

atomic wing
#

Could anyone point me in a direction of an example on a function running on a client but it's actually authenticated by the server? I've been doing a couple multiplayer tutorials and this is one of the few things I'm a bit confused about

kindred widget
#

@atomic wing I could probably help with that. What are you trying to have the server authenticate?

atomic wing
#

Just looking for an example where the client is trying to do something and the server should really be an authority, so say player movement or shooting

#

I understand the theory, but I was wondering if there was a good example anywhere

kindred widget
#

Just curious, are you running CPP or blueprint?

#

@atomic wing If you're running blueprints I can give you an example of something like that.

rain coral
#

Does anyone know anything about ServerVerifyViewTarget and ServerUpdateCamera? RPCs that seem to run frequently but should have no relevancy for my game

chrome bay
#

Yeah that's part of PlayerCameraManager

#

I literally have no idea why that behaviour is the default, you can disable it. Lemme check a sec

#

Set bUseClientSideCameraUpdates = false; in your projects PlayerCameraManager

#

You'll have to sub-class it and set that as the one to use in your player controller class.

rain coral
#

Ah cool, yeah now it's set to 'None', and Auto Manage Active Camera Target is false

chrome bay
#

Ah if it's set to none it'll use the default

peak star
#

@bitter oriole and @naive locust thank you both for being willing to help me figure this out. Sorry for the confusion. This was largely because I have been trying many different approaches when I run into a dead end with one, I try another, then come back to the 1st one when I get an idea how to move past the roadblock, and so forth.

chrome bay
#

There's always a camera manager

rain coral
#

I see, thanks, will subclass it then

peak star
#

@bitter oriole and @naive locust Let's focus on the idea I started with which was to just get Android phones talking to each other, able to join each other's game when they are on the same LAN

#

According to the article i linked earlier, I apparently have to alter the Engine to make this happen. However, I did not have to do that when I was building another game using 4.23, as long as I built it using Development build and not Shipping (no idea why that makes a difference). Another thing that changed is my home WiFi used to have 5G but we turned that off and only use 2.4G now but I didn't think that would make a difference. If I get some time I will try changing those things around again and see if they make a difference.

bitter oriole
#

Alright, so port forwarding, NAT punch, ports, have nothing to do with this, which is good news

#

You need to focus on getting the NULL OSS working

peak star
#

Ah I think I forgot to include that in my newest attempt at the project (though it IS in there in the previous attempt. Looks like this in DefaultEngine.ini):

#

I'll go ahead and add that. Maybe this time...

#

Here is my newest attempt's HotPotatoes.Build.cs file:


using UnrealBuildTool;

public class HotPotatoes : ModuleRules
{
    public HotPotatoes(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

        PrivateDependencyModuleNames.AddRange(new string[] {  });

        // Uncomment if you are using Slate UI
        // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
        
        // Uncomment if you are using online features
         PrivateDependencyModuleNames.Add("OnlineSubsystem");
         
         PublicDependencyModuleNames.AddRange(new string[] { /*Some more stuff*/ "Sockets" });

        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
    }
}
#

Should I have left "OnlineSubsystem" dependency commented out?

bitter oriole
#

The dependency allows you to use C++ functions from the OnlineSubsystem in your own C++ code

#

If it doesn't compile without it, you need it

#

Functionality of OnlineSubsystem is unrelated

#

Not to mention Null OSS is the default, so there should be no need to enable it

peak star
#

@bitter oriole Okay that explains how I was able to succeed with LAN-only in my other project, at least in Development builds

#

when I didn't alter the Build.cs

#

(using Session nodes in BP)

atomic wing
#

@kindred widget got pulled away, I try to be the C++ side of things but I'd be happy to learn in BP

peak star
#

It seems like something must have changed on my end, not Unreal's, since I'm using the same engine version for the projects that USED to work as I am for the new ones that don't, and also my older ones don't work anymore

#

I'm not sure what it is though.

bitter oriole
#

@peak star At this point, the best option might to be to investigate with Wireshark to check how stuff goes

#

Null OSS on Android is likely to be something no one ever uses

peak star
#

OK. It's just that it worked perfectly before :\

#

Maybe that router firmware update screwed everything up....

bitter oriole
#

Or your phone update did

peak star
#

Maybe

#

So my workaround right now is to just connect by open 123.456.78.910 directly to the IP address, no sessions.

#

But that results in a few seconds delay and then a "connection lost" error

bitter oriole
#

Read the logs

peak star
#

OK I'll try that monitor app I found in NVPACK

#

Thanks for helping. I need to get to my day job now

civic mirage
#

hey, i would like the client to controll another character than the server when he connect, how can i do that please ? ๐Ÿ˜„

civic mirage
#

anyone please ? ๐Ÿ˜„

civic mirage
#

ok so i just put auto possed player 1 and player 2 for other character it work well

fossil stratus
#

Hey there,
does anyone has an idea of how to setup a local couch co op with multiple gamepads? I know this section is probably for network based projects but I'm really stuck with this. I didn't found a way to assign them properly all gamepads take the same player controller. Pls help finding nothing helpfull on the net. is it even possible with blueprint?
thanks and cheers

dark edge
#

@fossil stratus You'll want to start with the node Create Player

fossil stratus
#

@dark edge this is my current spawn players setup with the create player the function gets called on the begin play in my gamemode.
It works with keyboard + mouse and gamepad with the skip assigning gamepad to player 1, both inputs posses different players and controllers but as soon as i start plugin in 2 gamepads they always take the same playercontroller.

I tried also tried to assign them with the OnPostLogin and Handle Starting New Player nodes but they only gave out 1 player controller

civic mirage
#

soo

#

anyone know how can i make client spawn point with a different character please ?

sullen kernel
#

Question about ShooterGame: how does it handle the weapon state getting out of sync between client and server? For example.. the client thinks he can reload and starts executing reload logic/animations but the server says it can't reload (say the server stills sees the weapon in the Equipping state). So the animation plays but the ammo stays at 0 after the client watches himself reload.

peak star
#

@fossil stratus I've found through trial and error that the best approach is to first of all, before anything else happens, run the Create Player node 3 times to bring the total number of players to 4.
From there, Unreal will map the additional gamepads to those players' inputs.

#

But don't spawn anything yet

#

Now that you have all the players you need,
Spawn pawns for all 4 players and Possess them with the appropriate player (0, 1, 2, and 3).

Now that you have 4 gamepads accepting input, you can use your own PlayerController class to watch for mapped InputAction events like pressing the A button (usually the bottom face button since there's usually 4 face buttons arranged in a diamond) or start button on the gamepad, and use that to:

  1. Enable collisions on the Pawn.
  2. Make the Pawn visible (they can start out Hidden in Game) by setting their Hidden in Game to false.
  3. Enable Input (you can start them out ignoring the input).
  4. Set Character Movement Type to Walking.
#

They can all start out with Collisions disabled, be invisible, use Movement Type = None, and input disabled (or even better, set input mode to UI only so they can still access menus in UMG)

#

Now you have a lobby where players can join or leave by pressing buttons on their gamepad. Probably should include a bool for each player in your GameInstance (or use an array of bools) to keep track of who is joined and who is quit

#

So that when you open another level it can decide whether to show/enable each player based on that

#

I've done this a couple of different ways and this is much easier than trying to create and destroy, and if the players don't exist then they don't take input from their gamepad, so they have to exist FIRST.

#

If you want to do splitscreen, but not have it turned on all the time, then you'll need to use a C++ function call to do that, since project settings only allow it to be on all the time or off all the time (generates another viewport for each additional player)

fossil stratus
#

@peak star Thank you soo much! I will try it out right now, also the join and leave function sounds awesome! ๐Ÿ‘

peak star
#

I was playing Totally Reliable Delivery Service and set up my own project exactly as I described, to make it work like that game works.

#

(for the local couch co-op anyway)

#

Just have something that, whenever a level begins, if the pawns automatically spawn into the level, initializes the pawns to be visible/colliding/walking/inputmode=game, or invisible/not colliding/movementmode=none/inputmode=UI only, depending on their joined bool. If they don't automatically spawn into the level, just do this right when they spawn.

Then instead of creating or destroying the pawns throughout the gameplay, flag them as Dead or not, and treat them similarly, just change their settings and location when you "kill" or "respawn" them, and you won't have to fiddle with a lot of spawning, possessing, etc. problems.

fossil stratus
#

thanks for the tip I will keep that in mind ๐Ÿ™‚

#

@peak star can i add u on discord, if i have any questions related to that topic? its my first couch coop ๐Ÿ™‚

peak star
#

yes you may ๐Ÿ™‚

#

Oh another thing: for UMG widgets, there's always two steps, right? First create the widget, then add to viewport.

#

You have a second option: instead of add to viewport, you can add to a specific player's screen instead, using a different BP node.

#

I think it comes off the PlayerController

fossil stratus
#

That sounds interesting too๐Ÿค” but in my case its handled on one screen since its an asymetrical 3vs1

peak star
#

OKay then no problem ๐Ÿ™‚

#

I think it would be better as a static function library, but implementing it as an Actor with a static function works just fine, too.

fossil stratus
#

Sounds great i will definetly save it for later use

civic mirage
#

hey guys

#

do i have to replicate sound on animBP ? i think i dont hear it from other player

warm wolf
#

Stupid question: I'm just learning the basics of replication and ROLE_Authority etc. DO i need to set role authority for movement? Or do the built in move functions that Unreal has manage that all? e.g. if I use PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); Will that automatically use the server as authoritative?

#

Example: A player presses jump and the client jumps but it verifies with that server that it was actually allowed to jump in that location and then replicates that to all the clients?

#

I don't want someone to change their client and be able to move someplace they shouldn't be able to

naive locust
#

@sullen kernel I'm not keen on the setup here, sometimes animations have special network handling than traditional mechanics handling. Nevertheless, the server should be the authority before anything is done. So, when player input occurs (to reload by pressing R lets say), there should be a call to the server first so it can verify that you can reload by running through whatever validations are put in place, then, if can reload, call back to the owning client (or if your setup calls for it, do a multicast for animation, whatever) to reload

peak star
#

Charactermovement component handles replication and network smoothing and prediction for certain actions and anything you use the Add Movement Input node for

#

But everything else you have to program the replication

naive locust
#

@peak star i'd like to mention on top of that, the charactermovementcomponent is replicated, and to someone who isn't versed, it seemingly 'replicates' from client to server back to client. I'm not entirely sure if this is the intended setup, but it does work this way. Based on the movement type and data, the server (in this setup) is the one who adjusts as necessary if the player is doing something strange.

peak star
#

That was to answer @warm wolf

#

Yes @naive locust exactly. It makes things waaaaay easier because you dont have to set up those server authoritative calls for movement

warm wolf
#

@peak star Thanks, I was hoping that was the case.

naive locust
#

when i found that out, i was baffled because it appeared to break traditional means, or so i thought. I haven't read the sourcecode, but i would think what it's doing is allowing the client to make the move, doing a traditional reliable server call, then server runs through validations, then traditionally multicasts back out. I can't wait to read what its doing. I saw that the code is miles long ๐Ÿ™‚ It also has some optimization built in for faster communication.

gleaming vector
#

@chrome bay chaos physics rewinding??!?!?!?!

#

i saw your convo with dave ratti

#

holy shit

chrome bay
#

Yeah, looks like they're investigating/integrating it. Will be awesome

gleaming vector
#

hell yeah it will be

#

i can finally do boats

#

and good helos

#

and good 4-wheeled

chrome bay
#

Will no doubt be a while before there's anything solid there but... hells yeah

gleaming vector
#

oh god so many good vehicle sims

#

frankly, i hate physx vehicles

#

i am going to day 1 adopt this

#

even if it changes radically and I have to deal with updating APIs

naive locust
#

the man = dave ratti (had to reverse it)

fleet raven
#

physics rewind is very cool but chaos sim performance sucks compared to physx br_egg

gleaming vector
#

yeah, Net Prediction is going to take incredible leaps in the next year

chilly mason
#

@fleet raven without having access to chaos yet - have you checked if it's using the correct ISA

sullen kernel
#

@naive locust I see, so for a reload the client calls a client -> server RPC. Then if the server says its ok to reload it calls a server -> client RPC to tell the client it can start reloading and playing the animation. But then the client will notice a small delay waiting to hear back from the server right. I think that in the ShooterGame they have the client immediately start playing the reload animation but then there is the risk I described before where the client plays reload animation when server says no. So you have to choose between responsiveness and correctness basically.

fleet raven
#

I've not done anything besides enable chaos and simulate a big pile of cubes lol

#

it runs an entire order of magnitude slower than physx processing the same sim

chilly mason
#

it's built w/ ispc which you should make sure is using AVX2

fleet raven
#

it should not need ispc here

chilly mason
#

isn't the whole thing built on ispc?...

fleet raven
#

physx does not use ispc either

chilly mason
#

physx of course not

#

I'm talking about chaos

fleet raven
#

if chaos needs ispc to get remotely close to physx, which is not using ispc, there is a huge bottleneck elsewhere that needs fixing

chilly mason
#

which is why I'm saying you should check if ispc (which chaos is running on) is using the correct ISA

#

if it's doing SSE2 then it's not going to be able to take advantage of more recent archs

fleet raven
#

but physx wouldn't be doing that either

chilly mason
#

sure, but they've never said they're competing w/ physx on sse2

#

in other words, chaos might be less optimized than physx but it's able to take advantage of more recent simd isas, therefore doing everything faster

#

and that might just weigh out physx's more optimized and mature algorithms

chrome bay
#

Hopefully it'll catchup eventually. I'm just looking forward to having more overall control over the sim

chilly mason
#

ispc can get tricky

#

I've had this experiment where I took UE4's matrix-vector multiplication code that was written w/ explicit SSE2

#

and asked an Intel engineer to optimize it in ISPC

#

the guy who's the ISPC expert at Intel

#

and after a couple of tries we've got to something that was kind of on par

#

w/ hand-made sse2

#

then I took the code and asked a guy who's great w/ AVX to write an AVX version

#

took it back to Intel

#

asked to do the same in ispc

#

and after a couple of days (weeks?), the hand-tuned AVX code was beating ispc by about 10-15%

#

the ispc program consisted of about 120 lines of code

#

the AVX version - 15-20

fleet raven
#

sounds like ispc is not that good

chilly mason
#

too early to jump to conclusions

#

there aren't any experts yet

#

just a couple of guys at Intel

fleet raven
#

if you have to be an expert you might aswell just write the intrinsics

chilly mason
#

ha

fleet raven
#

I thought the whole point was to make it easier

chilly mason
#

have you ever written AVX code?

#

explicit AVX

fleet raven
#

no, the most I made is optimize something with sse2

chilly mason
#

whole different can of worms

fleet raven
#

oof

chilly mason
#

SSE2 was seemingly made for 4 floats (128 bits)

#

AVX gives you at least twice that many bits

fleet raven
#

or 4 ints

chilly mason
#

so how you treat vectors becomes tricky

#

do you pack 2 into the same AVX register or not

#

do you do per-component processing or not

#

etc

fleet raven
#

but if you still have to think about this and then write over engineered code to guide ispc to do the right thing

chilly mason
#

it took multiple tries from someone I consider to be a real programming expert to get an optimized AVX version out

fleet raven
#

then what is the point

chilly mason
#

no my point is that you have to think about it above SSE2 anyways

naive locust
#

@sullen kernel that's why i said that there are special circumstances for things (ex: animations) for network play over using traditional client - server -> client (or multi) methods. The delay for client -> server -> client (or multi) RPC call is minimal (with good network pings) and I honestly feel some people think using RPC is antiquated and slow (for general setup, i'm not talking about 20 players or, fortnite like size, where serious optimizations need to occur) without any real evidence to back that up.

RPC's aren't slow, it's really about figuring out how to optimize code (call count for short burst time). For example: if an airplane is moved using 3 defined axis and a throttle axis, that is 4 inputs right there. We could send the raw input data directly to the server from input calls (from what i understand, faster than what tick runs at) which, if my () is right, then that increases the number of calls in short burst time. Now multiply that by 4 because all of those inputs are running and calling. What you could do instead (as an example) is create a Vector 4 var on the PlayerController, set the values from the input to be mapped to one of the four nodes on the vec4. Then in tick, you make one server call and send that vec4 over, it does the work, then it makes one rpc (or one multicast) for the final offset (if you choose to use add offset from throttling) and rotation. If you didn't do that, then you'd have each axis making four separate calls to the server and the server multicasts out two calls to client (or per multicast). See the optimization right there?

chilly mason
#

...so ispc just makes things more frameworky

fleet raven
#

anyway

#

ispc working right or not surely wouldn't result in a > 10x difference

chilly mason
#

true

fleet raven
#

that is a difference in total frame time btw

naive locust
#

@sullen kernel example of how we are handling input from four axis into one var on the playercontroller:

fleet raven
#

my editor runs at 150 fps with physx and 15 with chaos

#

maybe it would have been better for epic to collaborate on adding new features to physx..

chilly mason
naive locust
#

off with ya ๐Ÿ™‚

chilly mason
#

yes, sorry

naive locust
#

no need to be sorry, happens all the time

fleet raven
#

I don't think I've ever visited that channel before

chilly mason
#

(poor man's version of a ban hammer)

fleet raven
#

you need some better emoji br_boi br_ban_hammer

sullen kernel
#

Thanks @naive locust I understand what you mean about optimizing the RPC calls. I didn't mean to say one way was better than the other, I was just making sure I understand the options that are available. ๐Ÿ‘

naive locust
#

@sullen kernel nah dude, its all good. what i'm trying to convey is: i think RPC calls get a bad rep without any real evidence or hard testing. I think they get a bad rep because people don't realize how fast network travel really is (again, reliable network with good bandwidth availability). Look at it this way, if you don't already know, this will really cook your noodle: do you know what runs through the wires of networks and how wireless receives data, its an easy answer, don't overthink the answer

fleet raven
#

rpcs is the only thing you can actually send to the server unless you use a custom network channel, what is this even about?

#

you can't exactly not use rpcs

naive locust
#

@fleet raven a few posts up from murk, you will find your answer

#

i mean, i can think of a way not to use RPC's but i'm reaching into the twilight zone. You can have your machine vpn'd into some hardware server that reads input from your controller, and the return is just a screen image refresh

#

no?

sullen kernel
#

Well, it was just about the way I was using the RPCs. Because after studying ShooterGame they send a client -> server RPC to start the reload, but dont wait for approval to continue. Basically "we told the server" and then just start playing the animation instead of waiting.

fleet raven
#

that's one way to do it

naive locust
#

yea, i mean, it really just depends on what the designer wants, right? I mean, for me, i wouldn't want someone playing some animation making it look like they reloaded, when they didn't reload anything

fleet raven
#

but client prediction without reconciliation is mehh

#

would be better to not predict it then

#

otherwise someone might think they reloaded when the server actually rejected it

sullen kernel
#

yeah, thats actually what happened to me. i reloaded and ammo stayed at 0 which was a bad feeling

naive locust
#

that's why the playerstate is a good thing to use. that hs a local copy and is replicated. You could check playerstate, if bullets >0, animate, call the server to say (reload), then the data replicates to give a new bullet count. Now, there could be instances where just at the right time you run out of ammo, it isn't replicated in time, you hit reload and because your local PS copy has bullets >0 you play the animation but you really don't have anymore as far as the authoritative PS goes on the server

fleet raven
#

the correct solution is a proper prediction/reconciliation framework

#

like the network prediction plugin will hopefully become

naive locust
#

how?

#

i can understand movement, but action?

fleet raven
#

you'll have to make everything you want to be predicted part of the sim

naive locust
#

i mean, where its used properly, prediction works pretty good, but it's not an end all be all

#

tbh, there really is no perfect solution to any of this client server stuff.. its about what you feel is acceptable

#

also remembe,r the server always has an inherent advantage as a listen server

#

that can also be mitigated by using the average ping of the group to delay the internal working somehow (speaking of the server's own client side, not anyone else work being done on the server)

#

or median would probably be better

floral umbra
#

Having some trouble replicating that when an item is picked up that is only goes to that players inventory right now the issue im having is that if one person picks up an item everyone gets that item. I want it so that when one player picks up that item it will give that player that item and delete it for all other players. If you do respond please ping me ๐Ÿ™‚

#

I am following a combo of Ue4s multiplayer & Unrealgamies Slot based Inventory youtube tutorials if that helps

stoic acorn
#

been watching the official Blueprint Multiplayer tutorial series https://youtu.be/abmzWUWxy1U and the whole thing is just broken. What a waste of time.

In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some serv...

โ–ถ Play video
#

Does anyone have a good recommendation to learn how to set up a multiplayer game using Blueprint, that is up to date?

naive locust
#

the tutorial series with Wes Bunn using 4.11 is very up to date with what blueprint has to offer

#

there are a couple of videos, where, in the comments you will find fixes to things that don't work in modern versions or better ways to do something

stoic acorn
#

There are so many little things that don't work, particularly around the Lobby menu portion of the series. Also, the whole structure is pretty terrible... just reading step by step from his incomplete notes doesn't really teach me about the why's of setting this up.. So if a mistake is made, you have to go back through every step to check that you didn't forget to convert to purecast or to replicate or not. There also seems to be a ton of mistakes with replication

naive locust
#

hang on

stoic acorn
#

I'm thinking to step away from this and attempt to build it step by step on my own to get a better understanding of why I'm doing each step

naive locust
#

what doesn't work? are you absolutely sure you did it correctly?

#

rpc calls don't change from version to version

#

did you make the calls reliable?

stoic acorn
#

I've gone through each step many times now. checking and double checking that I'd copied his steps correctly

naive locust
#

i can help you, how close is your project setup to his

stoic acorn
#

yep.. everything that he'd set to be reliable I also did

#

I've set it up exactly the same as his. Was going to use this as a base for creating my own game but I think I need to simplify it

#

I actually learnt a lot more from UE4WithCasey tbh

naive locust
#

troubleshooting could take a while depending on what the issue is and if you're willing ot share your screen or not. I am doing school work atm but i can help tomorrow if you want. others may be able to chime in and help you.

stoic acorn
#

small exercises and constant running and checking is a much better way to learn

naive locust
#

i think the videoseries could use a bit more checking tbh

#

i agree

#

so i can help tomorrow most likely if no one else tries to help or can't help

stoic acorn
#

Well for instance, one thing that was just not working properly was the Start Session being greyed out

naive locust
#

server or client

stoic acorn
#

ok man, I appreciate your willing to help.

naive locust
#

the dependency for the client to be able to click it is different than the server's dependency

stoic acorn
#

another thing that completely threw me off was that running standalone was throwing up errors to do with the Steam Online subsystem

naive locust
#

so with steam, you also need the Steam OSS plugin enabled, and you also need files in your steam plugin folder located in the engine source binary folder for 3rd party plugins in steam

#

i think that part did change

stoic acorn
#

yeah I had checked that that was enabled

#

oh.. I might need to check that last part that you mentioned

naive locust
#

here

#

don't look at that freeze up... just read it slowly

#

that will tell you what files you need and where you can find them and where they need to go

#

btw, its that time: BIG SHOUTOUT TO @pure frigate

#

but this wont solve the problems obviously with your button

stoic acorn
#

Thanks man. I think that at this stage involving the OSS might be overkill. I think I'm just going to keep things simple and work on the core gameplay loop and get that working properly

naive locust
#

no

#

that's bad

#

i'll tell you why

stoic acorn
#

please do

naive locust
#

if you make a game with only single player in mind, you will find yourself wishing you went back in time to make the game multiplayer ready, and the only way you're making a game multiplayer ready is if you can test multiplayer capabilities when you need to

#

trying to convert a game to multiplayer after only making it single player is a nightmare

stoic acorn
#

ah no, you misunderstood. I'm talking about creating the core gameplay loop with replication etc in mind

naive locust
#

ok, much better, but you should still be able to test things reasonably right? and if you can't troubleshoot this issue in the lobby, then you will probably find yourself having issues in the game loop as well. TBH, that lobby really works no different than stuff you'd find in an MP game

#

and that is not meant to chop you down, its meant to help undrstand that the two are very analogous

#

you will need to Troubleshoot your implementation of Gameplay systems, we know this. so why not troubleshoot this lobby you created to see if you can get it working? that will only help you

stoic acorn
#

absolutely, but my main issue with following those tutorials is that blindly following a step by step set of instructions without any explaining has left me none the wiser as to why he is doing the things he's doing.

naive locust
#

that is fair

stoic acorn
#

I learnt more in a 30min video from a guy who was building the replication example up step by step.. running the game and explaining 'why' it wasn't working properly, then fixing it

sullen kernel
#

Should SetOwner() only be called by the server? Or its ok if both the server and client call it?

stoic acorn
#

admittedly I did do the Wes Bunn tutorials about a year ago, then the birth of our child occurred and the project was put on hold for a year.

#

so trying to debug this spaghetti code is giving me a headache

naive locust
#

i will not argue with your points. I do feel that yes, the Wes Bunn tutorial could explain some things that are not so easily demystified. I'm just giving my advice on how to proceed with building your game with MP. You will always need to troubleshoot in anything you make. Multiplayer is far more complicated (virtually every time) to troubleshoot

stoic acorn
#

agreed, I built the core gameplay loop very quickly while not considering MP at all.

#

@naive locust Cheers for the advice, it's very much appreciated.

naive locust
#

i know i come off rough, but sometimes, its what works

#

coddling never helped anyone ๐Ÿ™‚

#

it only helped millennials stay in mommy's basement past 30

#

@sullen kernel ok, just gonna delete that post

#

i obviously didn't read it clearly

sullen kernel
#

the owner is used to determine if you are allowed to make RPC calls on an actor right? So for example if you want to call a client -> server RPC.. your connection has to be the owner. if i understand correctly

naive locust
#

Server is usually the owner, so if it is selected to be owner, use server to call set owner. If client is to be the owner of something that server is aware of, then use server, if client has something server isn't aware of, i would (test) use rpc to have client set owner

#

be explicit

floral umbra
#

Anyone know anything about making an inventory system work in multiplayer?

naive locust
#

nothing wrong with being explicit, but you have everything wrong with being implicit, right? You have everything to gain with explicit natured code and headaches with implicit natured code

cerulean escarp
#

hey y'all I've got an issue where I have a non-physics helicopter which a player can possess and fly, and for some reason only the players not possessing the helicopter can see it move around. I'm running the game on a dedicated server, any ideas?

#

also when the possessing player exits the helicopter and re-possesses their fps character, the helicopter updates to its current position for that player

blissful rain
silent phoenix
#

What is the weight of a replicated variable? What would be considered a large amount of replicated variables for an actor? Any insight of reading material is much appreciated

raven moss
#

I'm trying the sample, and I can connect two instances on the same computer. But I can't connect two PCs to the same instance.

#

I tried a standalone build, no luck. Trying regular LAN.

#

I saw it in the UE4 learn section.

#

When connecting to another computer, the session list is empty.

#

I disabled firewalls no luck

#

Computers are on the same network

merry pebble
raven moss
#

That's a handy site. I've been doing screenshots for blueprint docs, and that seems more interactive.

#

Is BlueprintUE an epic thing that lasts forever?

#

Unofficial tool hmmm

peak star
#

@naive locust @bitter oriole I turned my 5g radio back on for my Wi-Fi last night.
This enabled Androids to find sessions of my game hosted on Windows if they are on the same 5g router. For some reason they can't when using the 2g radio. Only 5g. But it works and the game plays and replicates great after joining.
Androids still can't find each other's sessions hosted by android though at least not on the hot potato project. Gonna test older project where it used to work tomorrow

#

Weird that it works differently with 5g. Anyone know why?

bitter oriole
#

No idea, but at this point it's probably phone related

#

What do you mean by 5G Wi-Fi ?

#

5GHZ ?

#

It's possible that either the phone, or the router, does not process UDP multicast in 2.4GHz ; like your link yesterday said

naive locust
#

the router will definitely process UDP

#

you can remove that from possibles

lapis breach
#

ports?

bitter oriole
#

No one said the router would not process UDP

#

What was said was that some phones disable UDP Multicast specifically

#

It's possible that the router does it too

naive locust
#

didn't you say the router?

#

no

#

no router on this planet blocks UDP unless specifically told to do so by some network engineer

bitter oriole
#

UDP MULTICAST

#

Not UDP

#

No one ever talked about blocking all UDP

naive locust
#

I seriously doubt that, and you need to chill with yoru caps

#

its 3am man, cut me some slack

bitter oriole
#

It's the third time since yesterday that you tell me it is impossible to block UDP

#

Yes, I am aware

#

I am not talking about blocking UDP

#

I have not been talking about blocking UDP

#

I will not be talking about blocking UDP

lapis breach
#

be happy man

#

we can work it out

bitter oriole
#

What I did say was "It's possible that either the phone, or the router, does not process UDP multicast in 2.4GHz"

#

The phone is more likely

#

Hence why I put it first

#

But it's "possible" that the router does it

naive locust
#

not processing something is either by choice (block) or because it isn't handling it. On routers, we can safely say that routers are not configured to not handle UDP multicast traffic, so it would be a block if anything. Did the article supplied yesterday hint at that at all? If not, and even if it did, I ask kindly to try and find some supporting evidence that some routers do not process / block UDP multicasting.

bitter oriole
#

I'm pretty sure many routers can and do disable UDP multicast

#

Or don't implement it in extreme cases

naive locust
#

honestly, i'm going to be straight, I was in networking for some time about 15 years ago. I personally never ran into, or heard any of my colleagues run into issues with routers not processing UDP multicasting. Now this does seem to be an extreme case where for general work purposes, that wasn't a problem (thats more likely) but even in reading tons of shit on networking, i have never seen or heard of that

bitter oriole
#

We're talking home routers here

naive locust
#

makes me wonder if its not done by design but some side effect

#

i know

#

home routers work pretty much the same as industry routers, they just go a bit deeper

#

Its weird, i just can't see a home router doing that by default. And this person is not a network guy, but i guess routers can have a setting for that, and perhaps this guy's family member turned it off (i mean if he did, he would know, right?).

bitter oriole
#

Like I said, the phone is the most obvious target, but routers definitely might also cause it

naive locust
#

from inside?

#

i gotta read up on that

#

doing that tomorrow,d efinitely

bitter oriole
#

I mean client isolation is a thing

naive locust
#

but that's forceful, i mean, that's something you see on devices with discovery options to allow the device to be discovered (windows OS for example)

#

but hey

#

you're right

#

anything is possible, and perhaps standards are changing

bitter oriole
#

All I'm saying is it's technically possible, though not likely

naive locust
#

totally agree

bitter oriole
#

I would still check the phone first

gritty pelican
#

Does anyone have any suggestions for optimizing Character? when 1 player is on the server, ping = 30-40. If 15 people enter, then ping is about 80. Maybe something should be turned off?

#

Or maybe ping during the game is displayed incorrectly?

lapis breach
#

what type of server is it?

stoic acorn
#

I need to create two sets of rules for my game, depending on which team you are part of. Would you do that using PlayerState as a base Blueprint?

kindred widget
#

@gritty pelican Are you using a Dedicated or Listenserver?

gritty pelican
#

Dedicate

#

d

#

@kindred widget

#

8 RAM, 4 GPU

kindred widget
#

@gritty pelican I'd probably start by lowering the tick rate of all character movement components. Set a cap at like 30 for a start bump it up if it looks too jittery. You can also try and make sure that server versions of pawns aren't playing animations. I find that lowering the tick rate of the character's mesh is a nice performance increase but turning off animations on the server where they're not even seen is better. Don't replicate any more than you absolutely need. I was replicating a player's pitch variable on tick for a bit. Moved it to a 45 times a second timer and it still looks the same going from 120 to 45.

lapis breach
#

@gritty pelican where are you hosting?

#

animations wont get played on a dedicated server

#

it doesnt have a visual element to to the game

gritty pelican
#

I do not call animations on the server

#

Hosting in Russia and Europe

meager spade
#

well if the ping is going up then your server's in/out speed could be too low. if its a cheap VPS then that is likely the issue.

#

VPS's have limits on resources

lapis breach
#

ive used the aws gamelift for my dedicated server

#

its a really good standard of Ec2 instance

random nymph
#

I'm trying to use NavMesh walking as movement mode for my AI, but when that is used the Skeletal mesh of the character constantly dips below landscape. The capsule of the character doesn't have any problem. Any idea on how to fix this?

meager spade
#

turn on projection

#

not really a multiplayer question tho is it ๐Ÿค”

random nymph
#

Well it is multiplayer game and actors having these problems are replicated so yes and no

#

Ok I checked that tickbox and now the characters don't move at all ๐Ÿ˜„

#

Ok got the moving by changing some parameters in the character movement component. Thanks ๐Ÿ‘

#

Sweep While Nav Walking turned on caused the characters not to move

quartz panther
#

would ryzen 7 3900x with 64 GB of ram be sufficient for running 16 dedicated server instances (up to 16 players per instance) of a relatively simple multiplayer game? And what kind of network bandwidth could i expect from communicating with 256 players at the time?

narrow prairie
#

@meager spade ive seen u mention adjust tickrate on movement component, is there any screen u can share how to set this up?

#

nvm ive found it

peak star
#

@bitter oriole and @naive locust thank you. It makes sense to look into the phone first because Pc with android phone works but android phone with android phone does not (they are both LG ThinQ V30 phones), and in the past I had to turn the phone's wifi off and then back on again while the game is running to be able to find sessions on the LAN, but my beta testers did not have to do this. I never found out if they would have different results using my Wi-Fi vs theirs though. But i think I did change to a different router in the meantime and had same behavior so it is probably the phone

bitter oriole
#

It would make the most sense

#

As to how to fix that, well... I don't know much about this. Maybe when sessions aren't found, get your local address IP and try to iterate from A.B.C.0 to A.B.C.255

#

On most home networks you'll find the server in about 10 tries, and you can memorize that to ping that server first the next time

peak star
#

That's the result of running it on my phone

#

192.168.50.1 is the Wi-Fi router and 192.168.50.49 is my windows 8 pc

#

Not sure what device has 192.168.50.135 though

#

But it is not my phone. My phone is 192.168.50.128

#

Could be the other phome or the tablet maybe. We have at least 4 other devices in the house with Wi-Fi connectivity

#

I am starting to consider using a Bluetooth plugin for LAN style multiplayer but that might be more work than figuring this out since I first have to learn how bluetooth works

bitter oriole
#

Don't. Bluetooth is way worse than not having multicast. Modify the Null OSS to add the functionality I described and it should work fine

#

I worked with Bluetooth for years, it's the worse thing in the world in terms of compatibility. Every phone works differently.

fading birch
#

That and connectivity stability is crap half the time.

#

It works fine for small bits of data

#

But what you're proposing would not be small

twin juniper
#

Is anyway to spawn actor on client only? Instead of server where control all actors by structure data only, without spawn actor method.

bitter oriole
#

SpawnActor called on the client ?

raven moss
#

What implementation are people using for multiplayer?

#

I tried the multiplayer shoot tutorial but it didn't work on multiple computers

bitter oriole
#

Which tutorial is that ?

raven moss
#

This is the one from UE4 learn