#multiplayer

1 messages Β· Page 15 of 1

sinful tree
#

Unless one of your players has been set to the owner of the item, that RPC wouldn't even fire. I also think the destroy would probably take precedent over the RPC if it's done in the same frame. What is it you're trying to tell the client to do with that RPC?

pure trellis
#

Yea, the player is the owner of BP_ItemDrop.
Client presses Interact key, client sends ServerInteract(), Server adds item to player inventory, then informs client about success (show notification), then destroys.

sinful tree
#

Testing with a bit of lag and packetloss, it looks like the RPC always goes through.

pure trellis
#

I'm guessing (I don't really know) if it happens in the same frame, it ends up being written sequentially to the same send buffer / packet.
And that same packet would be processed sequentially on the client. In the editor it seems to work 100%.

thin stratus
#

Then there is enough time for the client to handle rpcs etc

#

You can also look into TearOff and TornOff if you have CPP access

pure trellis
#

What's interesting here, a "safety delay" ironically makes it more susceptible to races, since it's now 2 different packets out there in the internet (instead of 1).

#

The "solution" I guess is to give up on separation of concerns and just make an RPC on the PlayerController.

thin stratus
#

It doesn't matter though

#

Everything after 3 seconds is not interesting anymore

#

If you take 3 seconds to receive a package then you probably have other issues

#

If you want a cleaner solution then look into tearing off the actor

#

That lets the client handle the destruction

pure trellis
#

That's very true, but real world connections can be unpredictable from time to time

thin stratus
#

Yeah but you still have to see that whatever you are doing in that rpc is only relevant for that frame

#

If the client doesn't get it within 3 seconds then we typically don't care about it

#

It's not important RPCs that are send here

#

If you need to send an important rpc then move it to the controller as you said

#

The rpcs we send in that situation is for example to trigger some explosion effect or so

pure trellis
#

Yea I was just curious about the inner workings, the RPC isn't important enough for me to deal with the 0.001% edge case. Still worth looking into the topic, just for education : )

grand kestrel
#

Seems like an oversight rather than a limitation

thin stratus
#

You can TearOff I think, but not sure TornOff exists

pure trellis
#

That's neat, didn't know about this - thanks! πŸ‘Œ

pure trellis
#

I'm guessing Destroy should better be in TornOff if it's async

#

that's something for a nativization day then : )

dire dagger
#

Hey guys, I'm wondering how it would be possible to replicate all until this moment spawned actors on join. I want to attach a BP_Weapon to my Player on BeginPlay as a default weapon but when the Client joins, the client does not know about the weapon and so does not see it.

fathom aspen
#

It's as easy as replicating the weapon actor and attaching it to the player pawn server-side

dire dagger
#

Okay thank you, let me try and I'll update

#

So, first of all, it works ~~almost ~~perfect, thank you for that easy solution! :D

Edit: Yeah, now everything is literally perfect, amazing. Never expected the engine to send this stuff after join. Smart devs indeed.

winter marten
#

I'm trying to extend the movement component's Saved Move to include an additional float value and I'm running into an issue with the Serialize function, any ideas on what I'm doing wrong here?

#

basing my implementation off of the ALS refactored movement component, which extends SavedMove with gameplay tag data and appears to work fine:

dire dagger
#

maybe people in #cpp would be better suited for this

winter marten
#

will ask there, thanks πŸ˜„

split siren
#

Does anyone have a link or a code snippet on how to create variables with client-sided prediction? Ammo while firing gun, stamina when running, this sort of things... I feel like I am re-inventing wheel

worthy magnet
#

Is it possible/realistic to develop multiplayer in blueprints? Or should I switch to C++?

worthy magnet
#

Gotcha haha. Any tips on introducing C++ to an existing blueprint project?

kindred widget
#

Part of the issue is that you lose out on a ton of tools. Very simple and basic games can be done.

dark edge
#

Valorant or Fortnite in BP only? Fat chance.
Civ or Among Us? Much more likely.

#

Basically it comes down to if you need fancy stuff and prediction.

#

If you're ok with ping delay before doing anything and aren't doing anything too crazy, it's doable.

dark edge
violet sentinel
#

is there a simple solution for sending a generic payload over the network?
The question is I got a "messaging " system that needs to send or multicast a pair of { Recepient, Data } from server to client where data is a native or blueprint struct with usualy actor pointers, ints etc.

#

it was not a multiplayer before, but now it needs to be so can not just scrap the thing

worthy magnet
dark edge
#

yeah

worthy magnet
#

It's a simple top down survival crafter, ideally an MMO on release

#

I've been doing blueprints so far because of how easy it is, but I can do C++. Not sure how adding C++ to a blueprint project works though

dark edge
#

yeah nah prolly. I mean you can certainly get the mechanics working with a couple people hanging around, but the persistence and backend will have to have a good bit of C++ involved. If it's dummy simple core mechanics like Rimworld it might be doable. Not as MMO tho, no way.

dark edge
#

I did BP only for years before taking the plunge and it was pretty hard at first but I'm pretty comfy now.

worthy magnet
#

Alright cool, thank you! I’ll start screwing around :)

quasi tide
dark edge
worthy magnet
#

Hehe I’ll keep it in mind. Thanks

kindred widget
#

And while amazing, Valheim was still very sparse on release. πŸ˜„

violet sentinel
dark edge
#

Killer feel tho, I've never played a game with such a cool style and feel to it.

violet sentinel
#

actor pointers?

dark edge
violet sentinel
#

"simply adding multiplayer" to existing system that never knew about it.
as i said - there is a FName and UScriptStruct input and need to do netmulticast the duo preserving data ofc

dark edge
#

I had to do something somewhat similar for my vehicle project (VehiclePartSettings), I just made a generic struct with arrays of ints, floats, bools, and let each consumer handle it in their own custom way.

last jewel
#

Have anyone had a problem where the landscape crashes the game? When I host as server the game runs fine. But as soon as the client joins i crashes. And only when there's a landscape... 😐

solar stirrup
#

A world's TimeSeconds is kept after a seamless travel right?

fathom aspen
#

Yeah iirc

fathom aspen
solar stirrup
#

Reset for non-seamless, got it

#

Guess I'll go with a UWorldSubsystem

#

Need to find out where they're initialized and if they're ported over in a seamless travel

fathom aspen
#

I'm pretty sure they are, not sure where they initialized though

solar stirrup
#

Doesn't seem like they're ported over no

fathom aspen
split siren
#

I am using stamina in my CMC and I am sending the current stamina from client to server to check if all is good. Exactly the same way as the final location is handled. If the delta between whatever client sent and server value is too big, trigger client error (bAckGoodMove = false) and send adjustment. So far so good.
The problem is with extending adjustment. Is there any way to extend FClientAdjustment which is used in ServerData->PendingAdjustment ? It seems very much hardcoded into the CMC

thin stratus
split siren
# thin stratus You are meant to inherit from that container struct and then filling that before...

Thanks for the response!!! Really appreciate any help. I have subclassed FCharacterMoveResponseDataContainer but annoyingly the default ServerFillResponseData(const UCharacterMovementComponent& CharacterMovement, const FClientAdjustment& PendingAdjustment) just copies the PendingAdjustment (which is MyClientAdjustment class) to internal ClientAdjustment variable which then is used Serialize().

Which means in that ClientAdjustment = PendingAdjustment; call in FCharacterMoveResponseDataContainer::ServerFillResponseData I loose any extra data and from MyClientAdjustment becomes only ClientAdjustment.

thin stratus
#

Isn't it enough to just put that extra data into the container?

#

Instead of the client adjustment?

thin stratus
split siren
thin stratus
#

Client already replays moves

#

Theoretically if you just override the stamina and replay the moves it should work just fine. Don't even think you need to have your own saved move

#

The code for moving will just work based off of the new stamina value

#

Basically similar to how velocity works

#

It's just overridden from the correction and then all newer moves are played again based off of the new velocity

#

If that make sense :P

split siren
#

Oh sweet, I thought that would be much more painful! So in theory something like this?

thin stratus
#

Yeah I think so

split siren
#

Btw, since I see you are available for contract work via Salty Panda, would a code review after I am done with this CMC be possible?

#

Paid of course

thin stratus
#

Theoretically. But you'll have to contact us via email cause I don't manage our resources

split siren
#

Sure, will do. Thanks!

thin stratus
#

Cheers

#

The comment a out thinking it replays moves

#

What happens is that the client will set a boolean

#

Something like bUpdateClient or so

#

There is a function that gets called if that is true

#

Which is called something like UpdateClientAfterServerUpdate

#

Or so

#

Weird name

#

In there it replays the moves

#

In case you want to learn where that happens and how that works

#

If you scan the CMC for the saved moves array you will find the function I mean.

split siren
#

Oh right, I was looking into the source and was super confused when the replay actually happens, because it goes from
ClientHandleMoveResponse -> ClientAdjustPosition_Implementation but I didn't find any replaying there.

#

But I need to dig into the CMC a bit more

winter marten
#

simulating average connection here, doesn't happen all the time but often enough that it's likely that i'm doing something wrong

#

this is my movement component class for reference: https://pastebin.com/V4J7pUeC (.h) https://pastebin.com/1DRtB7Sp (.cpp)

split siren
split siren
kind falcon
#

anyone have a way around this? trying to make a health bar that works on multiplayer.

split siren
kind falcon
split siren
#

The Networking series on youtube by Epic themselves is a good for networking beginners

kind falcon
#

ive got all my health working, both players take damage seperate its just the health bar isnt workin πŸ˜›

raven tangle
#

My dedicated server doesn't like metahumans. πŸ˜•

When the client is trying to connect to it, I get errors like:

LogStreaming: Warning: Missing script import 0x7FE0EC0166871CD for package /Game/MetaHumans/Vivian/FemaleHair/Hair/Peachfuzz_M_Thin
LogStreaming: Warning: Missing Dependency
LogStreaming: Error: CreateExport: /Game/MetaHumans/Vivian/FemaleHair/Hair/Peachfuzz_M_Thin (0x1589B7F9E39136F2) /Game/MetaHumans/Vivian/FemaleHair/Hair/Peachfuzz_M_Thin (0x1589B7F9E39136F2) - Could not find class object for Peachfuzz_M_Thin```

This repeats for `Peachfuzz_M_Thin`, `Eyelashes_L_ThickCurl`, `Eyebrows_M_Messy`, `Hair_M_SideSweptFringe`, `Hair_M_SideSweptFringe_m_head_Archetype_Binding`, etc.

Anyone seen this?
fathom aspen
#

Found in this channel πŸ“Œ

#

That error is telling you that widgets only exist at the local controller level

#

You are assigning the 2nd controller which has the local controller on client (non listen-sever player) a widget on the server

kind falcon
fathom aspen
#

Yeah that's intentional

#

That means I want you to check all pins

#

Not just the one you're looking for

kind falcon
#

yea i just realized im sorry

winter marten
winter marten
faint eagle
#

is it legal to send an array of actor pointers to client by a client rpc?

split siren
#

Aka, why do you need them?

split siren
faint eagle
#

they are. also would it work with an array of TScriptInterface where the objects are replicated actors or with replicated actor components?

split siren
winter marten
split siren
#

You should never trust client. If the curve slows the movement speed over time, the client can just say the time is 0.0f indefinitely

winter marten
winter marten
#

^again testing with emulated average connection, maybe those corrections are fine and i'm worrying over nothing? ideally it shouldn't be that frequent i'd imagine

eternal canyon
#

Just remember they have to also exist on the sever

#

Since it’s sending GUIDs

faint eagle
winter marten
eternal canyon
#

As long as it exists on the client

#

Yea

split siren
winter marten
split siren
# winter marten will give this a try - appreciate the help πŸ˜„

https://youtu.be/DoZyH86n_gs This is a great video with explanation

Higher playback speed recommended. It makes those moments of dead air where I am figuring out what the hell I wrote more palatable. Also the mumbling.

Table of Contents
2:12 Sprinting
26:14 Jetpacking
55:02 Gliding
1:26:02 Networking

This project: https://github.com/HarryPearce/JetpackTutorial

Advanced Movement Component: https://github.com/...

β–Ά Play video
winter marten
# split siren Ok looking at your code there are few things. I think PawnOwner->GetActorForward...

after making those changes i'm still encountering compounding corrections when turning just the right (wrong) way - https://gyazo.com/5712ced90b51b8243b383b0f8024c0eb

here's my updated movement component for reference: https://pastebin.com/TVQe24ji https://pastebin.com/ipz4BNgL

fluid summit
#

Hi everybody!
My project is single player / multipler with listen server.

I'm working on the chat, and i was wondering if anyone knows some free services for multiplayer chat that works on an Api basis?

My desired behavior is to have both Local multiplayer chat and Global multiplayer chat (same across all sessions)

Local is really easy, i was wondering if there's some free service for the global chat.

latent heart
#

Some sort of irc chat server would probably work (for both local and global)

short siren
#

Just started dipping my toes in creating multiplayer in UE5, utilizing the blueprint system.
I found a pretty cool guide from Ryan Laley around this subject. He describes Relevancy in such a way that if i choose to make an object "Always Relevant", it should replicate the object position and all that, in both client and server and owner.
However, when i made two cubes. One of which is ticked as "Always relevant", and another "Only relevant to owner". They both seem to behave in the same way. As in, if i run into the cube(simulating physics) it will move in a direction. But both the Always Relevant and the Only relevant to owner, end up in different positions when comparing client vs server.

Anyone able to point me in a direction of something i missed, or i could take a look at?

graceful flame
latent heart
#

First off, nothing replicates from the client to the server. So your first sentence should read "it should replicate object position and all that from the srever to the client."

#

If you run into the cube on the client and move it, the server won't know about that.

#

(the always relevant one)

#

And if your other cube's owner is the server, not the client, than running into it on the server won't tell the client what is going on.

#

Therein, both your cubes will end up in different positions on each instance.

latent heart
short siren
#

What desides the owner of the cube then?

quasi tide
#

Refer to the network bible

short siren
#

The goal for me here, is to have a cube that is replicated and relevant for all clients. And one that is not. From this point, i can scale it up. Make sure that only relevant objects are shown. Supposedly this is important, since making everything relevant will strain a server?

#

Trying to access that, returns a "Database Error". Cant seem to get access to this "Bible" πŸ˜„

#

I got access to the PDF slide thingy. Seems his main link is broken or something.

quasi tide
#

Your site is down again 😭

latent heart
#

Does it cover GAS MP stuff? Is that even a thing (not in gas tutorials)? I really need to start looking into GAS.

quasi tide
#

No, it doesn't.

#

Cedric's pdf is more for getting your feet wet with networking in UE overall.

latent heart
#

Oh nice!

#

We need that useful link channel, stat!

quasi tide
short siren
#

Well, thats perfect for me. Im starting from nothing here. @quasi tide πŸ˜„

#

Interesting read so far

latent heart
#

Yeah, I guess.

#

It'd still be nice, though!

#

You might find other useful things while searching too!

short siren
#

Damn, reading the intro to tranek's GAS bible, i definitely need that in my next steps.
I aim to be a game designer. I already got my game designed, hard part is actually making it now πŸ˜„
My designed game, definitely needs the stuff from tranek as well. Thank you for that.

latent heart
#

I'm going to have to implement GAS in my l ittle side scrolling shoot 'em up (shmup!)

short siren
#

I will get there. Making a multiplayer game is definitely a motivation.

quasi tide
#

I wouldn't recommend a networking beginner to use GAS

#

Not for awhile

latent heart
#

Never seen a networked multiplayer shmup before. Could be fun.

dark edge
short siren
#

I guess i will find out once i get into it. I tend to go big. Takes more work, but learn more while doing it.

dark edge
#

@short sirenHonestly you won't really appreciate what GAS gives you until you've attempted to make your own framework. GAS is great but it's BIG.
What kind of design are you doing? Does it need tons of prediction etc?

latent heart
#

(I have never played invoker)

short siren
#

I start simple. So for now, it will be an arena with AI going at the players. The players obviously have to deal with that by destroying the AI. AI will over time get more abilities. Players will over time get more abilities. In the future i aim to add a talent system outside the game, for players to affect their characters.
Explaining a full game design is a bit much in a message, but thats the simplest i can put it down to.

#

Think sorta Vampire Survivors. But in a 3D environment.

latent heart
#

I'd fucking love more orcs must die type games

short siren
#

The CO-OP is a big seller for making this game. For sure.

dark edge
#

Glad it's not a 100% dragon science based mmo

short siren
#

"Yet" kappa_ross

short siren
#

I was under the assumption that the best practice when you want to make a MP game. Is to build it as an MP game from the start. Is this a correct assumption? Is it harder to convert a fully build SP game into an MP game?

dark edge
#

Unless you wanna make 3 games

short siren
#

πŸ’ͺ πŸ‘

dark edge
#

The 3 games being
The game you're making already.
The game you make when you try to make it multiplayer and go "WTF Why doesn't this work" and refactor the whole damn thing.
The game you make when you realize how bad you did at the refactor and have to refactor again. This step can happen multiple times.

twin juniper
#

like my dumbass thought that it's going to be so easy to just add server client architecture later and I'll just make the systems working first with my online database

#

then I learnt about object replication

#

everything changed

twin juniper
split siren
#

So something like MMO on Stadia?

#

Do I understand it correctly that a game studio would still create an MMO, but the client instances would run on game studio side (locally or cloud), be rendered and video streamed to clients, right?

#

A very high-level design

#

Cool idea, thanks for explaining it! I wish you best of luck and I am looking forward to seeing it implemented in some modern engine!

#

For this, some compression and decompression techniques are used together with intelligent rescaling, ultra, high latency, so that the perceived response time is mitigated, you can call it negative latency kappa

#

Just out of curiosity, since you are in testing phase already, do you have any early metrics? How does it compare to Stadia and other streaming services?

#

My apologies for my ignorance, but where does the performance boost come from? Other than the previously mentioned that because it is 100% new, it does not have legacy components.

split siren
# winter marten after making those changes i'm still encountering compounding corrections when t...

Hey again. I re-created a POC of the system that was lagging for you (aka, server corrections). I have found that using curve for the movement prediction causes the server corrections.
When I set the value to a constant 2000.0f, no more server corrections. I guess it has to do with the different client and server tickrate, but I have not tested it fully nor did I find a proper fix. But hopefully this will help

winter marten
# split siren Hey again. I re-created a POC of the system that was lagging for you (aka, serve...

thanks for taking the time to try and figure this out, been trying different solutions all day with not much luck, i'm starting to think it's almost time to ditch the curves in order to move on πŸ˜„ you're right that the issue stems from a desync between the client and server tickrates as that's ultimately what's driving the curve time - I've tried messing with some ping compensation or even using move timestamps to drive it instead, it's a tough challenge to solve

split siren
winter marten
rocky kestrel
#

Hi. I’m making 50 - 100 player ”mmo” survival game with dedicated server. Atm server is working nicely with players but I we don’t have any data saving system. So what could be best way to save data(inventory)? Database or ? We want that every server you start playing you start fresh.

#

And should we implement custom login or use steam?

vagrant grail
#

Somehow doing the day night cycle system like this still create the sun position not being synced between the client and the server. What could be the reason ? πŸ€” Ping me if any answer please πŸ™‚

sinful tree
sinful tree
# vagrant grail yes it is

There's no need to have the Day / Night cycle set up as a "Run On Server" event - your Has Authority check makes sure that only the server would execute the next bit.
Make sure the actor is set as replicated.
Rather than constantly replicating the value, you could have it so the client starts their own timer for doing the position, with an infrequent update from the server.
Finally, you're probably not getting any change on your end as you're multiplying "Sun Speed" by 1 and feedind that into the rotation, which you're setting, so it's likely always teh same value going into your Set Actor Rotation node.

vagrant grail
# sinful tree There's no need to have the Day / Night cycle set up as a "Run On Server" event ...

I did that because there are possibilities that the day / night cycle may change during the game.
The actor contains all of the game settings, I'm not sure if it's secured to set it to replicated πŸ€”
Right now I multiplied by 1 because I tried multiplying be 10 and it went to fast so I will later tweak it to be the right speed I want. But yeah good catch I forgot to add the amount to the local rotation. Let me try that

sinful tree
#

If you intend to use replicated variables to communicate things to clients, then you have to mark the actor as replicated.

#

If you don't then the clients don't get any of the updates and won't do the things that you're expecting them to do, like the OnRep function.

vagrant grail
sinful tree
#

Get rid of the Set Actor Rotation from the Start Timer event. It's not necessary as the server should also trigger the OnRep. Your timer is also too fast - timers can't actually fire faster than tick but the timer will execute the number of times it should have executed in a single frame - so really you're asking the timer to fire a little over 100 times per frame (based on 60FPS). If you need it firing every frame, then perhaps consider using event tick instead, otherwise if you're wanting to control the timer later on, perhaps lower the interval to 0.016 which is equivalent to about 60 times per second (which would match with FPS)

#

Also if I recall correctly some rotations won't work passed 90, you have to interpret them different past that value as they then need to go to -180? I can't recall exactly at the moment.

dark edge
#

that's one way

#

yaw can loop and maybe roll can but pitch can't

vagrant grail
dark edge
sinful tree
#

And rotate it so that you're spinning Roll or Pitch instead, right?

dark edge
#

yes

#

not pitch

sinful tree
#

err roll or yaw

#

XD

dark edge
#

yaw works

#

i dont recall if roll does

#

pitch does not

#

just orient the component such that yaw makes it spin the way you want and you're in business

vagrant grail
#

I'm rotating on the pitch right now ,so I should switch to Yaw or Roll ?

#

the value doesn't go up somehow

#

it stays stuck at 180

#

wait

#

nevermind

dark edge
#

Funny thing is your approach could work if you set it up right. You can ADD rotation and make it loop in any axis

vagrant grail
#

somehow my directional light object is set to none πŸ€”

dark edge
#

you just can't SET rotation changing pitch and expect it to loop

#

Set is better for syncing, just have it like this.
OnRep_TimeVariable -> Set Sun rotation as function of time -> ??? -> Profit.

#

Otherwise you'll end up with clients seeing the sun at different angles

vagrant grail
dark edge
#

Exactly what it sounds like

#

Time is the input, rotation is an output

vagrant grail
#

but I don't see how to fit it with my current setup πŸ€”

dark edge
#

do math to make it work.

Something like
SunRotation = (90, 0, Time * 360)

If Time is meant to go from 0-1 in one day.

vagrant grail
#

Oh so Time will be replaced with how many second I want a 24h in game day to be

dark edge
#

I'd just update Time at whatever rate you want

#

What do you want Time = 0.5 to mean?
Does it mean 12:30 AM?
Does it mean Noon?
It's up to you to determine what you want it to mean. I'd either do 1.0 = one day or 24 = 1 day or whatever you want.

vagrant grail
#

I see

dark edge
#

Then just have the variable live on GameState, replicate it, update it at whatever rate you wish (tick, timer, whatever), and use repnotify to have it do things clientside

#

assuming other systems care about time. If not, it can just live in some EnvironmentActor

vagrant grail
#

my other question is why my "Directional Light" variable is set to None even if I used "Get All Actors from class" node and getting the first element, otherwise print an error

dark edge
#

SpawnMonster -> if Time < 6 OR Time > 18 -> Spawn Night Mobs, else spawn day mobs, etc

dark edge
#

Ours also handles latitude and longitude since our game involves flying around the planet but same idea. One actor that handles all the large scale environmental stuff

#

Sort of like the old classic BP_SkySphere

vagrant grail
#

You have a directional light integrated in your actor ?

dark edge
#

yeah it's just a component

#

directional light, skylight, atmosphere, giant earth mesh, post process stuff, lots of things.

vagrant grail
#

Somehow I added a skylight + Directional light components to my actor but now my sky is kinda dark and red

finite goblet
#

push model!

does it needs a master switch to be enabled somewhere in UE5?

pallid mesa
#

no, you simply need yo add netcore in the build.cs of your project and the appropriate headers in the source files

#
  • in your lifetimereplicated props use shared params with the pushmodel enabled
finite goblet
#

what about the ini thing you had to do earlier

finite goblet
thin stratus
#

Just look for that variable in the engine code and check it it's still used

finite goblet
#

it is

#

also default is false

#

so you do need to set it

pallid mesa
#

ah x'D probably something i've set a while ago and then forget

#

my apologies! @finite goblet

twin juniper
#

Anyone happen to know what actually causes the cmc to be so heavy? Prediction? I wonder what kinda of savings would occur if it was all converted into mass

bitter oriole
#

It's not even that heavy, it's just that there's one per character so even at 300Β΅s per frame it's out of budget with 30 pawns

#

And hell, 30 moving objects that are skeletal meshes on top is already not particularly cheap

harsh ice
#

I have created a dedicated server but it's not opening when i use 127.0.0.1 on another PC. I found it i need a local server IP address but don't know how to find it

steel fractal
#

Hi everyone, im pretty stumped on this. I had this RPC working and I cant figure out why it wont now suddenly. Everything works in singleplayer so its all hooked up correctly, its just that i cant get the RPC_StartShooting to work when in client 2 player

#

im trying to debug it but it wont show me the glowing lines when i select the server type in the debug menu

#

what would prevent an RPC from running on server>

#

also i did a print string on get owner,and its showing the owner is my player character. Does that mean I have to call it from the character because its the "owning client"

sinful tree
steel fractal
#

so it seems i own the weapon properly, its just ignoring the server RPC when i play online

sinful tree
#

Are you perhaps spawning the weapon locally? Fast easy check would be to put a print string on Begin Play which should then show you Server: Print and Client: Print

#

Is the weapon actor marked as replicated?

steel fractal
#

replicates is checked off in the details panel

sinful tree
#

Ok, so the breakpoints bit again...Put them on the branch and on the cast you have on the interface call. Also if you are selecting an instance, don't bother, leave it as none selected and let the engine just break on any instance.

solar halo
#

Anyone know why crash dumps wouldn't be generating on windows server or linux server no matter the build configuration?

sinful tree
#

So it didin't stop at all?

steel fractal
#

nope fully executed

sinful tree
#

If it doesn't stop, that means it didn't execute.

steel fractal
#

i wanted to see the step by step and each node executed normal

sinful tree
#

Gotcha

#

Ok here's a test we can try... You have a ref to the weapon in your character I imagine, that you're using to call this interface, yes?

steel fractal
#

yes

sinful tree
#

Create a "Run On Server" event in your character that passes along an actor reference, and pass the weapon through the RPC. While running on the server, print out the display name of the actor.

#

Call the RPC using an input of some kind.

steel fractal
#

like thjat i assume

sinful tree
#

Dang... Ok so this is what you're using when calling your interface too?

steel fractal
#

could that cause the problem

sinful tree
#

No that should be ok.

steel fractal
#

okay good

#

im really stumped onthis one

#

is it possible that i have to set the item in hand variable to replicated?

#

nope that wasnt it

sinful tree
#

You're running UE5 too right?

steel fractal
#

yes ue5

sinful tree
#

There appears to be some issue with placed actors. If I spawn a replicated actor and change ownership, I can call the RPC no problem. If I use the same replicated actor but placed in the level, I can still change ownership, but RPCs run on it won't go through.

steel fractal
#

hm weird, i can try it, how should i spawn them, in my character or can i spawn them by making a spawner bp

sinful tree
#

Make a spawner BP, it shouldn't need to replicate at all itself.

#

Just make sure you set it up so it only spawns the stuff on the server (Has authority or Is Server branches!)

steel fractal
#

yes just did this

#

nothin

#

wait a minute

#

when i run set owner, do i have to do that on server

steel fractal
#

holy shit

#

i moved the set owner code and i mustve moved it from a place that had a server RPC

sinful tree
#

The set owner on the client is redundant, but even still, there's that strange issue with placed actors and even with their ownship changed, the RPCs don't fire on them.

#

I'm trying to look through the channel history see if anyone else spotted this kind of behavior.

steel fractal
sinful tree
#

Interesting... Placed actors don't get destroyed by relevancy.... So there's definitely some weird network behavior with them.

fathom aspen
#

Yeah they don't. I vaguely remember this behavior a few months back, but I would debug CallRemoteFunction and GetFunctionCallspace to figure things out

#

UE5 is full of landmines, so could be another one

#

I believe any replicated actor owned by the client must be able to fire RPCs just fine

steel fractal
#

lol i got 1 more quesiton if thats okay

#

I got this running to a server rpc SV Kill player

#

essentially the multicast only works for ragdoll in offline. It does not work online. But i do also notice that when i set component replicates on the mesh, it doesnt rag doll, but it moves around like its ragdolling, i rotates and falls to its side like a stiff ragdoll

cold moat
#

If my game is online should everything be done with events?

#

For example my character dashes on input, the input should call the event that calls the dash instead of calling the dash function directly?

steel fractal
#

Here is my shooting code, you can see i get the input from my client, then I call SV_ Start shooting to make the shooting happen on the server

cold moat
#

It is so nice of you to show code, I'm always lost on how people do these things

steel fractal
#

it took me a while to get a grip on it so dont be discouraged

#

even now, as you can see by my questions, im not perfect either

cold moat
#

thank you so much, I wish I had more time to watch and read some good tutorials, I'll keep learning as much as I can

steel fractal
#

youre very welcome, glad I could help

fathom aspen
#

Apart from what @steel fractal said, it's better to separate your code into functions, so your code is better managed.

steel fractal
#

ya true half the stuff i couldve organized my screen shot better as well lol

fathom aspen
#

You use OnRep in such case

#

Ragdoll will look a bit different on each client, as they are simulating that on their end

#

But it's ok

steel fractal
#

probably better practice to move it to an on rep, but in this istance, its not an issue of the branch returning false

#

unless theres more to it than that

fathom aspen
#

The best best practice is to have a synced network clock involved

steel fractal
#

thats a good idea, ill definitely keep it in mind for the future

#

i moved them to onrep and same issue, simulate physics gets called but no dice

#

so the ragdoll is happening some where, just not on everyones client

#

if i uncheck component replicates nothing happens to ragdoll at all

steel fractal
static sable
#

hi, imagine in APAWN::IsNetRelevantFor you want to send APawn instance to enemy player controller, but not full APawn, so it looks like an anonymous enemy object. Would you send just any of the object's components, or what would you send?

split siren
# thin stratus The comment a out thinking it replays moves

Hi again, remember this code? It should adjust values on client based on an adjustment that came from server.
I ran into an issue when the client is replaying moves. If the server adjusts stamina (aka BoostChannelPoints) from 10 to 20, client sets that in ClientHandleMoveResponse as per the last image. So far so good.
But when it starts replaying moves on the next tick, loads the oldest move in which the stamina was 10. Thus completely ignoring the adjustment from the server.

#

Where I set the stamina on client

thin stratus
#

Why would your move load the Stamina back in though

split siren
thin stratus
#

The question remains though, why do you do that

#

What's the idea behind restoring the Stamina from a SavedMove

#

Have a look at the Parent Class. Is it restoring Velocity?

#

And then ask yourself when are the SavedMoves even used.

split siren
#

Right, it doesn't restore velocity or position etc. Just client input.

thin stratus
#

Correct, why do you think they aren't restoring Velocity

split siren
#

Because if it receives a correction, it just sets it. No reason to rewind in time velocity because that is just calculated from the user input

#

Userinput = unpredictable, so we need to save it
velocity = predictable/calculable

thin stratus
#

Yus, the Velocity of the Server is the new truth, and based on the saved inputs the player can now get back to it's latest predicted move, with a slightly different velocity at the end, but usually not much

#

Same goes for your Stamina

split siren
#

Right, man, I owe you a beer!

thin stratus
#

Of course, it throws away every saved move that is older than the corrected one.

#

(just to make sure that's clear :D)

split siren
#

Yep, I just didn't fully realised the idea behind saved moves, I treated them like a time-travel machine to rewind time on client. Now I know, thanks again

thin stratus
#

No worries!

twilit radish
#

β€œThat will be 50 dollars + a week vacation then” πŸ˜›

elfin lintel
#

I know FFastArraySerializer doesn't guarantee order is maintained, is there a way to manually maintain order?

latent heart
#

You could add your own order value to each element and sort it onrep? Shrug

twilit radish
#

Or if you have something in the data already that you can sort by.

split siren
# thin stratus No worries!

Oh lord, I am dumb.. Can I have one more question?
How do I send the current stamina level of client to the server when I remove it from saved move?
I was using ClientFillNetworkMoveData to send the stamina to server, check if it's "about right" and send adjustment if needed. But that is based on the saved moves.

Or should I still keep stamina in saved move, but don't restore it in PrepMoveFor?

thin stratus
#

Is the Client sending the Velocity to the Server?

#

:P

#

If they have different values and those different values end up causing a correction, the Stamina will be synced again

#

There is no need to send it

#

You only ever need to send UserInput and the EndLocation

#

Which is what UE already does

twilit radish
#

Doesn't it also send the delta time?

thin stratus
#

Yeah maybe

#

That's a bit more complicated anyway

twilit radish
#

yes

#

πŸ˜‚

thin stratus
#

The sole idea of having some state and performing movement on it, it's not really needed

#

There are also quite some bigger things to solve with the CMC, if you for example stun someone :D

split siren
#

I think I am trying to slightly abuse the CMC prediction system.
I was hoping I can use it to create a Rocket League style boost pickup. When client picks up boost it goes from 50% to 60% and use it right away.
If the pickup did not happen on the server, it would correct it back to 50%. Since the "stamina/boost" is just a CMC variable like velocity or position, I thought I can just hook it up to the system.

thin stratus
#

Cause the CMC doesn't take care of that by default. You have to somewhat update the SavedMoves so that the Client is aware of being stunned. Otherwise it replays the moves without being stunned and just gets another correct at the end. Not really smooth.

thin stratus
twilit radish
#

But being stunned is going to end up not nice anyway because you can't possibly predict a server side correction on the client.

thin stratus
#

The Server can never know if it's an honest prediction or cheating

thin stratus
#

But the replaying of the moves can be updated to account for being stunned

#

Cause the client recorded those NOT being stunned

twilit radish
#

Well fair enough πŸ˜›

split siren
thin stratus
#

The only way to line that up is to either update the moves, where you then need to know how many of them (how long is the stun?) or to ensure that some outside state (Am I stunned?) is in sync with the correction, so that the client can check that. But predicting removal of that is a whole nother story

thin stratus
#

The goal of predicting is to not get a correction

twilit radish
#

Btw, Rocket League does not predict their boost pads etc. I'm pretty sure.

#

https://youtu.be/raXX9i145-Y?t=59 Here look at the big boost, they drive over it and it doesn't instantly fill up the bar.

I've been having crazy lag and/or Latency issues at EVERY kick off for months, I've finally figured out how to fix it instantly and I also have some tips for anyone having issues with latency while streaming on PC too.

I really hope this helps some people! There really are hundreds of ways to fix latency but I've never seen anyone talk about th...

β–Ά Play video
split siren
#

My apologies, I didn't mean the replaying moves. (wrong terminology on my end)
The car will go over the boost on both client and server.
Client thinks it went over the boost correctly, so it adds 10 boost and continues boosting.
Car goes over the boost on server but (for whatever reason) the server says it doesn't count and no boost is added.

This is when the server receives the boost level from client and sees the boost is higher than it should be, so it corrects it.
Client then replays all moves since the pickup without any additional boost from that pickup.

Hope I am explaining that correctly

thin stratus
#

But something like picking up a boost doesn't need to be networked at all

#

Keep in mind that your movement is in sync (in the best case)

#

On Timestamp 1000, Server and Client, both will touch the Pickup.

#

So if they add the Stamina from it, it will just work

#

That's also why you don't need to network Jumppad boosts

#

Cause you step on it at the same time

#

"time" being the timestamp

split siren
#

Right, but someone else could have taken the boost already. The fact the client sees it there at client time doesn't mean it will be there at server time

twilit radish
#

In Rocket League's case it's a little more difficult thought as this "boost" can only be picked up once every so often by one player. So it does need to be networked. It's not a jump pad where you stand on and the client predicts the movement.

thin stratus
#

They are fully simulated, so that time difference is simply unsolvable in theory

#

If someone drives over the Pickup, it is gone on the serverb efore you see it

#

But the time diff is so low, that you will probably ram them

twilit radish
#

Which I'm still curious about btw. The video pinned in here with the person talking claims to predict vehicles... Which seems like black magic to me lol.

thin stratus
#

They can't predict

#

They can extrapolate

split siren
#

But in 99% of the cases I can assume client is correct and adjust and replay his moves if the server disagrees. I can totally predict that

twilit radish
#

But then again, you don't need to network that boost in the prediction like Cedric said too.

twilit radish
thin stratus
#

I'm not sure what you are trying to solve here actually.
If the Server has Energy to Boost and the Client doesn't, it will correct.
If the Server has no Energy to Boost and the Client does, it will correct.
If they both have or not have Energy to Boost, it is fine.

If you pick up a boost, both will pick it up in the same theoretical Timestamp, so no correction.
Boosting happens based on Input, so that is predicted and fine.

The only case you can have is when the Pickup is gone on the Server but not on the Client, as in someone drove over it that you only see the simulated ghost of.

#

At that point, if you send the Server the Stamina, it would tell it a value that is fake, which you can correct for visual corrections, but you gotta keep in mind that you are causing a full on movement correction because you want to fix a visual bug.

#

The visual bug being that the client thinks they have more stamina than they should have

#

Which shouldn't happen very often if at all

#

I believe if your game has car collision, the time diff is so minimal that you would need to intersect the other player to get that to happen, or have a super high ping, at which point it's tricky to solve aynway

#

man, I can't type

split siren
#

First of all, thank you for the explanation, I owe you several beers now.
Gears are turning in my head trying to process it all..

twilit radish
#

I think I see what your issue is you are trying to explain Pav. You're worried about the boost bar getting out of sync right?

#

Like not on the server, but rather when corrected on the client's side?

#

Or stamina.. Whatever you want to call it xD

split siren
#

Exactly, if the client adds 10 boost because it thinks it went over the boost, server will correct it ONLY when CMC "final position" is out of sync and at that point it will send an adjustment.

#

But client can be on 20% while server thinks its 10% for a while. It only corrects it when it goes to boost, but server says your velocity/final position is too much. Here fix yourself

#

Damn, why I am so ****** at explaining things

thin stratus
#

Yeah I understood that. I'm mainly saying you might not want to worry about that

twilit radish
#

I think it's a valid concern though.

thin stratus
#

50/50. if it happens, sure. But I'm not convinced this will happen often

#

But sure, let's assume it happens often and we want to fix it. Probably good to have that written here once or so

#

I don't think this should cause a full correction

twilit radish
#

Correct me if I'm wrong Cedric. But lets say you pick up 10 boost and had 10 boost but the server disagrees with the client picking up that 10 boost. Then the client gets corrected but will still think it had 10 extra boost and will from that point forever be in that +10 boost state.

thin stratus
#

But one can start with that of course

thin stratus
#

But only if the Movement is actually wrong cause of it

#

Which only happens around the 0 value I assume

#

So if you have 60 on client and 50 on the server, and you don't boost, it will do nothing

#

as in, it won't correct itself until the Server hits 0 while the Client doesn't.

twilit radish
#

Then I'm not sure what the concern is. If the server tells the boost value from a certain correction point then the client should reset the state for all steps before that correction move and set that to the new truth and then loop through the other new moves to catch up like it normally would.

thin stratus
#

The concern is that the UI shows a wrong state until that correct happens

#

A more extreme thing would be that both are on 50% and the Client then picks up 50% locally, showing a 100% bar while it#s actually 50

split siren
#

Worse case would be if the client thinks it DIDN'T pick it up but server thinks it picked it up
So on client is 10% and server is 20%. Client cannot ever boost down to (servers) 0%. It will never get corrected, as it seems that client just stopped boosting at 10%

twilit radish
#

That's impossible to fix I would say then. You can't possibly predict a wrong value before a correct happened because your client thinks it was "right".

thin stratus
#

Which will drain down to 50 and then gets correct to 0

thin stratus
#

Cause the Client will not boost while the server boosts

#

Then it gets corrected back to whatever the server has left

#

Doesn't matter if Client > Server or Server > Client in terms of boost value

#

Just not on pickup

thin stratus
#

Which is what they want to do

split siren
#

But when the client reaches 0 boost, it turns off the bWantsToBoost boolean

twilit radish
#

No it doesn't correct. I see the issue. If my client thinks it has 0 boost while on the server I have 10 boost left then it won't roll back because that's completely valid behaviour from the client.

split siren
#

So it looks like it just decided to stop boosting

#

I see

thin stratus
#

bWantsToBoost is the Input Flag

#

Not the bCanBoost

#

You need to diff between that

#

bWantsToBoost can be true while bCanBoost is false

#

The Client always tells the Server I WANT TO BOOST if the key is down

split siren
#

That does make sense...

thin stratus
#

But that will never result in a boost if the conditions aren't met

#

Which is fine

#

So yeah, back to the issue at hand: Correcting the Boost Value without waiting for a natural CMC Correction

#

You can add the BoostValues matching as a condition to that CMC Correction

#

But that means you are "correcting" movement even though the movement was okay, just the float was not

#

You could send a flag in the ClientCorrection Data, that it's just a Boost Correction and not a Movement one

#

Or just check if the change in Value actually matters for movement

#

Probably a few solutions

split siren
#

Which would require treating the BoostValue same way as the FinalLocation and sending it from client to the server, right?

#

Just a sanity check

thin stratus
#

Yeah

split siren
#

I think that is exactly the solution from the start of the conversation, just need to avoid "loading" the old BoostValue during replay moves.

#

Thank you both guys! Do you have a Paypal, I would love to send you a beer for your patience with my slow-ass brain

thin stratus
#

You need the Boost Value in the SavedMove to pass it into the MoveData, or what's the idea?

split siren
thin stratus
#

What keeps you from just taking it directly from the CMC?

split siren
#

Great question, I have no idea how to access the CMC from FCharacterNetworkMoveData::ClientFillNetworkMoveData

thin stratus
#

ClientMove.CharacterOwner->GetCharacterMovement()?

#

Not sure that works

#

But worth a try

#

Yeah that should work

#

Native does that too

#

const FVector SendLocation = bDynamicBase ? ClientMove.SavedRelativeLocation : FRepMovement::RebaseOntoZeroOrigin(ClientMove.SavedLocation, ClientMove.CharacterOwner->GetCharacterMovement());

split siren
#

Oh right!

twilit radish
#

Why can't MP just be easy πŸ₯²

#

xD

latent heart
#

MP is easy! Just have everyone do their own thing! πŸ˜„

thin stratus
#

Just act like all the lag is part of the game

split siren
#

HAZAAAAAA, IT WORKS!

twilit radish
#

Lol.

split siren
#

A bit hacky, but it treats the BoostValue as the FinalLocation and corrects the whole thing if incorrect. I am gonna add the optimisation about just boost value incorrect

latent heart
#

It's superhot, but instead of stopping time, people move about in time. Time jumps are simulated by lag.

twilit radish
#

Also this conversation actually cleared up a flaw in my understanding of CMC. I thought it always send a location in the client ack regardless of being a valid or invalid move, which it does not.

#

(Unless being corrected)

split siren
#

I think I learned about CMC in the last 20 minutes more than in the last 4 weeks reading the code

#

Again, thanks guys

thin stratus
#

Just build a game around the flaw of peeker's advantage

twilit radish
#

πŸ˜›

split siren
#

cough source2 cough

thin stratus
#

Or turn it into peeker's disadvantage. If you peek, you die

twilit radish
#

I probably won't be making an Unreal game any time soon, although my job uses Unity lol.

#

Don't question me being here πŸ˜›

twilit radish
#

Nope.

#

I don't think Google would hire me 🀣

thin stratus
#

You are here cause you know that UE > Unity.

split siren
#

Technology and community!

thin stratus
#

Let's just ignore 2D though.

twilit radish
#

πŸ˜‰

split siren
#

2D is an old forbidden knowledge, we don't talk about it here

twilit radish
#

Just make a 3D game with 2D art like Cult of the Lamb did for example.

quasi tide
twilit radish
#

Btw. Does anyone have some ideas for a fun 1-2 days multiplayer challenge? πŸ‘€

split siren
# twilit radish Btw. Does anyone have some ideas for a fun 1-2 days multiplayer challenge? πŸ‘€

If you are looking for a challenge, try recreating a spinning cylinder with obstacles in UE.
https://www.youtube.com/watch?v=q-u87nhT5wk
This is in my opinion really challenging task, but might be fun for a day or two

Subscribe so you never miss a new level of Fall Guys. NO Spam, NO phony tips or tricks, ALL gameplay, ONLY Fall Guys.

All Season 4 Levels - https://www.youtube.com/watch?v=W35WkaStKFA&list=PLTgZDuddvpcPA6pMAg8McbxYvOL-nz0Db

All Season 3 Levels - https://www.youtube.com/watch?v=laEaMIgxyDQ&list=PLTgZDuddvpcM9JIY42hbwayDoUc4kvzyd

All Season 2 L...

β–Ά Play video
dark edge
#

I really wish I had a good turn-based idea

thin stratus
#

Stuff like Gloomhaven is pretty cool

#

Relatively close to D&D, yet playable as a boardgame/pc game

#

:P maybe that helps with your good idea hunting

short arrow
#

But they ruined their game by swearing it was p2p material

#

Like imagine league of legends or smite came out with a $30.00usd price tag 🀑

#

Then they realized no one would buy it for free. So 2 years later when everyone forgot the game existed... they made it free but you had to grind for a month to unlock 1 champion, unless you paid for the $30.00 champion pack troll_face

#

The game died and they shut it down

tight crow
#

Which BP would be the best to keep things like passwords or variables that I can control for ALL players? TIA

latent heart
#

That you can control for all players?

tight crow
#

Yea, for example, I want to have a specific enemy be chosen at random upon game start, the variable that controls the enemy would need to be the same for both players. If I set this variable on the character or controller, it could be set to different values.

#

Maybe im overthinking this lol but im not sure which BP would allow me to access the SAME value inside that variable.

latent heart
#

Put it on a game state class.

#

Game states are replicated to everyone and everoyne has the same one.

tight crow
#

Thank you!!

static sable
#

hi, how would you send an anonymous actor in multiplayer to enemy player? Eg. you have actors types A, B, C; but for a brief period you don't want client to know what type it is - client's only supposed to know that it is an enemy actor

sinful tree
#

What info is it that you want to send about said anonymous actor?

sinful tree
#

You'd probably have to spawn some other replicated actor that the server then updates as necessary with whatever information you want replicated. You'd probably want to override the netrelevancy of the actual player's actor to only be relevant when you want and then do the same for the other actor to be relevant only to enemy players.

static sable
#

thanks, I thought of something similar, I hoped there is an easier way.. something like replicating child actor only, where child actor would be the anonymous actor

twilit radish
# split siren If you are looking for a challenge, try recreating a spinning cylinder with obst...

I think I can do it non-authoritative which is pretty much what fall guys seems to do. Players bumping into each other causes no corrections whatsoever along with that there are some pretty bad movement cheats out there according to YouTube lol. But full authoritative behaviour I'm not sure about, the issue I feel like is that the client needs to predict the start of when those cylinders should spin. If there were no obstacles it was easy but because of the obstacles it needs to be perfectly aligned or you will constantly get corrected if you bump into anything whatsoever. I'm honestly not sure how to make it so perfectly aligned with each other that I can get it to not correct πŸ€”

split siren
# twilit radish I think I can do it non-authoritative which is pretty much what fall guys seems ...

I spent couple of days on the no-obstacle version, and it wasn't as straight forward as I thought. I learned a lot about base-movement in CMC and the fact it absolutely hates rotation. It is fine with movement though, just the rotation (even on a simple spinning plate) causes constant corrections from server. It was very much interesting problem for me personally, so I thought you might enjoy it.

twilit radish
#

I think I can get that to work, just not sure about obstacles.

#

For rotation it doesn't matter at what time frame you enter it as long as you rotate around with it, if it rotates constantly then you don't have to care about it being exactly predicted as long as the client does predict that it rotates.

#

But obstacles will absolutely correct you if you bump into them if they aren't exactly synced.

#

Let me see if I can get rotation to work first I suppose πŸ˜›

split siren
#

Best of luck! I hope you have fun as I had, but with a lot more success πŸ˜„

twilit radish
#

πŸ˜‚

#

But Fall Guys definitely took the easy way out lol.

split siren
#

If you manage to get it to work, I would be happy to buy you couple of beers to know how you achieved it. As I mentioned, I tried and failed miserably

thin stratus
#

Local person goes broke over buying random peeps too much beer.

split siren
#

I feel like I owe you guys for saving weeks of debugging, but happy to drink the beer myself.

#

Need to get used to the fact that good advice is sometimes free, because people just want to help

#

Quick question, what method is a good candidate where to check if user should be boosting?
the typical if(WantsToBoost() && CanBoost() && !IsBoosting()) { StartBoosting(); }
I am doing it in UpdateCharacterStateBeforeMovement but that does not feel right

civic seal
#

Any clue why TMap doesn't support replication?

#

Or TSet for that matter

#

Like, is it a conscious design choice or?

winged badger
#

how would you guarantee that keys stay unique on clients?

candid gale
#

I have a question, does replication only kick off on possessed actors? I don't think that makes much sense but I think I'm facing that issue with an actor I just spawn in and pass it some data to an UObject property which is replicated. The data isn't reflected on any client BUT the one who called the server RPC to spawn the actor

winged badger
#

it does not, what data?

#

if its a pointer to an object using another actor channel, that actor has to be replicated to other clients as well, on its own

candid gale
#

yeah it's a pointer

#

I'm working under the 3rd person template, I would assume that actor is fully replicated isn't it?

#

also, wouldn't be that a problem if said player disconnects from the server?

#

so how can I reliably replicate data on a random actor without any dependence on player actors?

#

now that I rememberw

#

the networking project has that chest example

candid gale
#

for context, this is what happens, you can see client one dropping it sees Apple x2, but client two sees Apple x1, it doesn't affect the pickup as it actually gives the client two the 2 apples

#

and these snippets of what I have

#

Nevermind!

#

leaving this here for the record, but the issue was that I set a condition to the Quantity property of the item

DOREPLIFETIME_CONDITION(UItemBase, Quantity, COND_OwnerOnly);

I had this added recently which was causing the issue

#

apologies

split siren
#

Glad you figured it out

odd ruin
#

Hi, how do i most bandwith efficient replicate my Gamecontroller stick inputs. I have a scene component which rotates around my character using the right stick. I am able to sent this FVector via an OnRep to the client. But whats a good way to get this from a client to the server? RPCs in the tick sounds very bandwith heavy...

quasi tide
#

That's what you pretty much have to do. Make it unreliable though. That's pretty much what happens under the hood anyway for movement.

fossil spoke
#

No point sending a full FVector to represent 2 axis for example.

#

FVector2D would be better.

#

Also their quantized counterparts are even more efficient.

#

FVector2D_NetQuantize

odd ruin
#

alright, thanks for the infos. I will go ahead and continue with RPCs and NetQuantize Vectors

odd ruin
# fossil spoke Its not unusual to RPC inputs to the Server. You can apply optimizations to them...

Maybe i am not smart enough...do i have to replicate my input values? I save the Values of the right stick X and Y axis in Variables and use these in a function to calculate a location. This function calls a serverRPC and pasing in the Stick values. The Values itself are replicated but i am still unable to change the location from the client. Do i need to call Server RPC for the Input itself? (binding the input to a function and call the server rpc in this function)?

fossil spoke
#

Replication only occurs from Server to Client.

#

RPCs are the only way for a Client to tell the Server about something.

#

What exactly are you doing?

#

Why do you want the Server to know the Inputs?

odd ruin
# fossil spoke Replication only occurs from Server to Client.

i am working on a TwinStick shooter. For this the controlrotation is quite useless. My character has a scene component attached to it. This component is used to aim at and rotate the mesh towrads to. Its also used as the direction for my Gun Bullets. With the right stick i am setting the location of this scene.

#

so i guess all that the server needs to know is the location of the scene?

dark edge
#

Tick -> Calculate AimYaw -> RPC to server

#

Either that or
Tick -> Calculate AimPoint -> RPC to Server

#

depends on if you only have an aim direction or an aim point

pure trellis
#

if you wanna be fancy, short/16-bit is most likely enough for a direction

dark edge
#

Just think like "What is the minimum amount of data to sync to make the server and other clients know what they need to know?"

dark edge
#

Whether or not you want to just depends really

#

For a twin stick without rotation I'd just send over the AimPosition tho

odd ruin
dark edge
#

Yeah later in tick the character aims towards AimPoint

#

You'll have to do some shenanigans to make aiming NOT be delayed by ping, stuff that's handled under the hood for you when you use ControlRotation

#

using Skip Owner on the replication condition on AimPoint will let you use it locally without being clobbered by updates from the server (ping delayed)

#

Also tick will want to gate by Locally Controlled for calculating aim point, don't want remote clients to try looking for mouse inputs etc

#

so
Tick -> LocallyControlled? -> True -> Set AimPoint -> RPC to Server -> Update Aim
-> False -> Update Aim

RPC -> Set AimPoint

odd ruin
#

the only reason i do not use controlRotation is the fact, that the simulated proxy doesnt has a PlayerController...which i need to use the ControlRotation. I thank you very much for this detailed answer. I will use the next two hours trying to get it work πŸ™‚

pure trellis
latent heart
#

You'd probably use an unreliable every tick rpc for tbr client to server stuff.

#

Specifically for that situation.

short arrow
#

make sure it's not any replicated variables, I'd probably only use Multicasts for that

#

replicated variables are reliable iirc

odd ruin
short arrow
#

you can onrep

latent heart
#

Onreps don't really get involved with server to client stuff. They are a response to the server replicating a variable.

odd ruin
#

make sense since i can not pass variables into OnRep's. Unreal was not confusing enough for me...thats why i thought "why not implementing multiplayer πŸ₯Ή

latent heart
#

Lol

pure trellis
#

I've had a couple Unity projects in the past where we had to basically custom implement replication because they change their engine network solution every two Saturdays it feels like...not very pleasant to work with.

latent heart
#

Unreal is heading that way with Iris.

quasi tide
#

Ehh - we won't really get much with Iris for years and years I believe. UE's standard networking solution is going to be around for a very long time.

pure trellis
fossil spoke
#

So id expect for the everyday developer it would appear business as usual.

quasi tide
#

idk enough to say. But that would be nice if it were the case.

#

I just imagine it'd be like a different framework that you have to route stuff through.

fossil spoke
#

Yeah I only looked at it briefly

#

But I doubt they would introduce any major fundamental shift in how a developer would manage replication.

#

Whos to say though

#

🀷

#

Iris seems quite far off.

quasi tide
#

Yup, agreed.

noble isle
#

Hello!

I am trying to make a 3D Multiplayer FPS game with UE5, i was wondering if i should start with tutorials fit for the type of game im making, or tutorials for UE5 all together. If anyone is able to help just respond to this message or send me a DM. Any tutorials that you guys rate would help! Thanks

fossil spoke
#

Ask yourself, can you build a working, playable, relatively bug free and complete Single Player game?

#

If the answer is no then dont start trying to make a Multiplayer game.

#

Learn how to build something simple first.

#

Learn how to use the Editor properly.

noble isle
plucky prawn
#

Also learning the architecture of the engine is something I dismissed because I have a decent background in programming. Boy was I wrong and didn't realise that the engine comes with its own ways of achieving things so you don't have to reinvent the wheel.

proven grove
#

Hello everyone. Can someone tell me if I can download and import assets from the marketplace on Unreal build from source?

proven grove
#

Being an indie doesn't allow me to make my own assets haha, the marketplace is literally essential to me and my projets. 🀧

eternal canyon
little pumice
#

Hi, how to handle seamless travel for GameModes with different PlayerController classes? Game throws error "Cast of A to B"

woven sinew
#

hi, anyone know how to increase 2 client framerate in the editor ? it's basically unplayable for me

little pumice
woven sinew
#

where do you lock it ?

#

I mean it works fine with two clients outside the editor

little pumice
#

Not sure about 2 clients, but for main one you can tweak fps in Project settings -> search "framerate"

#

also there is cmd launch options

bitter oriole
#

But do get two machines at some point

woven sinew
#

thanks

twin juniper
#

Why it's not possible to open a listen level for a specific port?

split siren
twin juniper
#

I want the option to change the listen port in my game menu

little pumice
twin juniper
#

ah thank you!

clever fjord
#

Hello everybody. I need help with technical implementation of a multiplayer "instance" like game.

I want to implement this on a single server to avoid complex instancing logic (don't want to run instances on individual servers).

I want to make a game where players build their own "cities" but each player is isolated in his city and they only share "shipping lanes" (city = instance).

  • You are able to switch your view to the neighboring cities (You can see and interact with only one instance at a time).
  • The individual city instances are supposed to be as big as possible (possibly spanning the whole world space).

I figured I would just "overlay" the actors in the world space on the server and each client would only see the actors that he can interact with.

This approach has issues, you only have limited number of collision and ray cast channels and thus you are limited to the number of overlaying actors you can have while also having UE handle 3D collisions and etc.

I also could "stack" the city instances vertically (set a max height an actor can reach i a city/instance) and move the other instances on the Z axis on the server. But this feels even more hacky πŸ˜„ πŸ˜„

NOTE: The server tick rate and bandwidth is not an issue as the city building is very simple and has no "mass AI" or anything like that.

Is there a UE native way of how to handle this type of game? Or am I just thinking about this all wrong and this is a bad technical design to begin with?

Thank you for any help. Every opinion is welcome!

dark edge
#

You won't be making AAA quality stuff as a one man show, but you can make some decent assets with a little bit of work.

fathom aspen
dark edge
little pumice
shut gyro
#

Gamelift local is not working for me. I am getting this error when trying to run it: ```
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @270421f5

#

Command to run is
java -jar GameliftLocal.jar -p 9080

#

ok, figured it out

#

Need to run
java --add-opens java.base/java.lang=ALL-UNNAMED -jar GameLiftLocal.jar

worthy magnet
#

How would I go through my project and make sure everything works for multiplayer? I started fairly recently but pretty much from scratch. I’ve read the documentation but it just says to β€œplan for multiplayer”. Any good starting places to learn?

sinful tree
worthy magnet
zenith wyvern
#

How does UE handle client/asset updates? If I have a client/server and change anything, does a player need an entirely full new client?

bitter oriole
#

That would normally make sense yeah

zenith wyvern
#

Thanks. Classic ue documentation

#

'Once you have released your project, you will probably make updates to it after the initial release. This process is known as patching.

#

πŸ˜„

#

<doc ends here>

bitter oriole
#

Yeah I would stay away from that doc

#

Just use Steam, Itch.io, GOG, EGS, any normal platform

#

You'll get way smaller patches in any scenario barring use of encrypted pak files which don't do anything anyway

woeful ferry
#

If I replicate a subobject, will all the variables in the subobject replicate aswell, that are set to be replicated?

woeful ferry
kindred widget
#

They will. Once you set it as a replicated uobject of the ActorComponent or Actor, it'll function just like any other replicated object. But you have to do the SupportedForNetworking, and.. the other function I don't remember offhand.

vivid seal
#

GetLifetimeReplicatedProps πŸ™‚

kindred widget
#

No, the UObject one. You run it on the object's outer.

#

ReplicateSubobjects I think

vivid seal
#

ReplicateSubobjects?

#

Yeah

woeful ferry
#

yea, it works πŸ˜›

mortal oracle
#

Hello, i have a preblem where when i open play as listen server and client when the hosts hunger gets to 0 both the client and the host get the death screen even though the clients health is not 0, but when the client has hunger 0 and the host still doesnt only client gets the death screen.

kindred widget
# mortal oracle

For starters. If you're calling a client event named Death, you shouldn't be checking client's Hunger state. Server has dictated that that character is dead. Client shouldn't care why. That and you're setting state on a Client event which means that you're not really sure what you're doing with your state. Any and all gameplay state should be set on server and client can use OnRep or RepNotify functions to handle that state changing. When server tells clients that they need to be in a state like death, don't let the client question it.

dark edge
#

Also death should be a repnotify imo

split siren
#

Question about replicated physics:
Imagine football scenario and when ball touches character, it should add impulse to the ball (aka kick it).

I am running into problem where I cannot execute client-side physics on a replicated ball.
If I run this on a client, it does nothing.
BallActor->GetBallMesh()->AddImpulse(FVector(1000.0f, 0.0f, 0.0f), NAME_None, true);
The ball mesh is the root and only component etc. If it gets executed on server it works as expected.

Btw, that was the use-case for the custom physics contact modifier I was asking about ( @dark edge ).

pulsar river
#

Does unreal let you call a multicast RPC to specific clients.
-Edit- nvm unreal does not.

dark edge
#

really really hard if you need prediction

#

only kinda hard if you don't

split siren
dark edge
#

I'm doing a physics game but we're just routing input to server and letting it play out. Works because it's a vehicle game, who cares if it takes 30ms to start your tank turning

split siren
dark edge
#

So what happens if 2 clients each think they kicked the ball?

#

since they're both in the future on their screen

split siren
split siren
#

done

#

Whoever kicked the ball last (on server), take that direction/input

dark edge
#

So what path does the ball take? They each see it go one way for ping ms then it just goes another way?

split siren
dark edge
#

I think physics gets a lot tricker because you have 2 agents disagreeing on an event that neither one "owns"

#

in a shooter you just favor the shooter, easy peasy

#

That's why I'm glad we just went with routing input to server for gameplay purposes, there's no disagreement. I sure as hell wouldn't want to be trying to predict the motion of player-made vehicles

split siren
#

The approach, "just take the latest one" should work, it's not gonna look great but I hope it's gonna be good enough.
The problem is that the client cannot effect the ball physics.. No matter what I call, I cannot make the ball go anywhere on client. (With 1000 ms ping I would expect the ball to go whoosh and then teleport back as it is corrected by the server)

dark edge
#

Tune your physics replication settings

#

you're constantly getting state from the server

split siren
quasi tide
#

So - I thought pitch was something you had to do manually. I have Use Pawn Control Rotation checked in the CameraBoom. I haven't handled any replication yet with GetControlRotation() and all that jazz. However, the pitch does appear to be replicating and then it also does this...I haven't been able to track it down just yet. Anyone have any ideas on where I might be able to look?

quasi tide
#

Actually, I guess I do. Hmm - could've sworn this was what you were supposed to do anyway. Welp, time to do the ol' debugger stuff

#

Huh - that's quite interesting. The first screenshot shows the client's pitch when pointing down. The second screenshot shows the server's pitch when pointing down. Now, the server printing is the expected value. If I point down on the client and am printing that value on the client (so locally), it shows the same value (-60-ish). But when that gets replicated to others, it's like it just can't be a negative number πŸ€”

#

So when printing the value locally, it shows the correct expected value (-60). But when printing the received value from the client, it is incorrect and can't go below 0. Very strange indeed πŸ€”

#

Yup. Looks like it's intended.

#

Well - poop

worthy magnet
#

Can anyone explain playerstate to me? For example if I want my players to have health (which is checked out by the server) I would store it in their playerstate? Can I then access the health directly from their playerstate?

quasi tide
#

You can, sure. But it depends on your game honestly.

#

Playerstate is pawn independent. So you put things in there that you want to remain upon a pawn respawn.

fossil spoke
worthy magnet
quasi tide
#

Yeah

fossil spoke
#

Sure, but probably not.

#

Usually Health is intrinsic to the Pawn (player visual representation)

#

So you would want that on the Pawn.

#

In some form.

sinful tree
#

Playerstate is for things that should persist beyond the player's controlled character.... For example, a Player's score in a match.

quasi tide
#

Easy way to think about it.

Think an inventory.
Do you want the inventory to be destroyed if the player dies? Put it on Pawn
Want it to persist through multiple pawn spawns? Playerstate

worthy magnet
#

Ohhhh

#

Okay

#

For example number of kills would be through playerstate

#

Like total

fossil spoke
#

Score is potentially a value you want other Players to know about. Score has nothing to do with Pawns.

worthy magnet
#

Hmm

quasi tide
#

But also like DevilsD said, other players have access to the playerstate if stuff is replicated.

worthy magnet
#

Hmm. So for example if I wanted to display my health to other players, what would I use?

fossil spoke
#

I would use the Pawn for that.

quasi tide
#

I would put that on pawn, then in an OnRep variable, update the widget component.

worthy magnet
#

Dope. Thank you for the answers guys

fossil spoke
#

Pawn has a lifecycle, PlayerState does not.

worthy magnet
#

Having a hard time wrapping my head around the multiplayer and replication system

fossil spoke
#

Health is tied to the lifecycle of a Pawn, hence you would not have it on the PlayerState.

quasi tide
#

And of course - always refer to the network compendium

worthy magnet
candid gale
#

hello, how can I run code only on the client?
I tried

if (GetLocalRole() != ROLE_Authority)

but that doesn't seem to work and it basically performs the stuff on all the clients?

#

nvm, found that I also have to compare the actor this code is being executed on against GetWorld()->GetGameInstance()->GetFirstLocalPlayerController()->GetPawn() to see if this is the actor my client possesses

#

a lot to learn still!

fossil spoke
#

@candid gale GetNetMode() is also one to look at.

#

IsNetMode() is also useful.

candid gale
#

gotcha, appreciate it

#

IsLocallyControlled() is also better than my longer solution

dark edge
#

feels weirdman

fossil spoke
winged badger
#

one could justify health on PS in a very specific game, too

#

multiple Pawns with shared HP

fossil spoke
#

Of course, its unlikely that was the type of game they are working on though πŸ˜› Best keep it simple really

iron crest
#

Hello, I have a small problem, I am trying to make the player use different anim bs based on a variable through the anim bp, the problem is, this variable is for some reason being updated for all clients (Making all players use the different anim bs) is there just some variable replication setting im missing?

winged badger
#

you'll need to show how are you assigning and replicating that

#

(most likely you used a GetPlayerController/Character/Pawn[0] connected to a Server RPC

#

or a Multicast

iron crest
#

Im doing it so that if a button is pressed, it will set the variable to true, once the variable is true, it will switch to the anim bs state

winged badger
#

what is As KLS Anim Char?

iron crest
#

its a cast to my character blueprint

#

the variables are in my characters bp

winged badger
#

got RepNotifys?

#

also, screen the BlueprintUpdateAnimation

iron crest
#

uh yes the variables are replicated to owner only, and here is what the anim bp looks like the blue lines are just connected to a pure cast of my character

winged badger
#

need to see how you fetch the character reference

iron crest
sinful tree
#

Anim BP

winged badger
#

odds are you are fetching the wrong character at some point, which is causing your problem

iron crest
winged badger
#

this is fine

#

now characters don't usually have button click handlers in them, so what calls those events?

#

ah, nvm that was the widget screenshot

iron crest
#

Yea

winged badger
#

how does the widget set the character?

iron crest
#

I cast to it on event construct

winged badger
#

you cast what ref?

iron crest
winged badger
#

that should be fine because the widgets are local only

#

i strongly recommend against using the GetPlayerCharacter[0] thingy, its not safe most of the time

iron crest
#

should I use get owner

winged badger
#

is that a widget on widget component?

#

or in viewport?

iron crest
#

Im just adding it to viewport once its created

winged badger
#

how is the widget created and added to screen?

#

and do you have any OnReps for those variables?

iron crest
#

I just have the variabled replicated and the option is owner only

winged badger
#

that shouldn't do anything replication wise

#

as the widget sets the variable on owner only, as only owner has the widget

#

and you're not using RPCs to propagate them to server

iron crest
#

so should I replicate the variables inside of the widget ?

winged badger
#

you cant

#

widgets dont replicate

#

and it wouldnt change anything

#

nothing is actually replicating there as is

#

except the hosts player in case of listen server

#

but with owner onlt, not even that

grand kestrel
#

@iron crest Missing a lot of core knowledge, checked Cedric's compendium?

#

Some truly fantastic pins on this channel too

plucky prawn
bitter oriole
#

Correct

#

If you have say, a time counter since the start of match - player joining immediately will have 0, player joining mid match will have 10 minutes, and so on, never getting any update ever

past totem
#

how to make launch character smooth in multiplayer

#

I'm running it on the server

#

and it looks so weird on the client

#

like it just teleports

#

also play montage with root motion is not smooth

#

I mean with Network Emulation on.

winged badger
#

GameplayTask + root motion anim

past totem
#

do I need to do that in cpp?

#

isn't there a simple way to do it

winged badger
#

not sure, i did not implement that system in our game, but the approach does work smoothly

quasi tide
#

Always comes back to GAS πŸ˜…

past totem
#

u'd think they would have come up with something more bp friendly for something as basic as this by now

past totem
#

I'm guessing just using it to play a montage won't be complicated... right? πŸ˜…

fathom aspen
#

The bottom one right

#

GAS is overwhelming if you have no prior experience with it

past totem
#

I just want to play a montage and launch the character smoothly 😭

winged badger
#

you don't need GAS to use GameplayTasks

past totem
fathom aspen
#

Have you checked valley of the ancient sample?

#

IIRC they launch their character

#

Not sure with the specifics

winged badger
#

we do use GameplayTasks without GAS

fathom aspen
#

They are not part of the GAS plugin?

#

Heck

past totem
#

I just want access to this node thinkDerp

#

but I don't have it.. lol

fathom aspen
#

Bring it over

past totem
#

wdym bring it over?

fathom aspen
#

That is part of GAS if not a custom one

past totem
#

I found it when going to create a new c++ class, I guess I will create it and see if it lets me use it then lol

quasi tide
#

I honestly didn't know you could only use GE in isolation.

#

Wonder how useful that actually would be πŸ€”

#

Like, doesn't GE rely on abilities themselves?

fathom aspen
#

To me they come in one pack. Would be mind-blown to discover otherwise

past totem
#

Idk, it won't even work, it just created an empty class that gives errors when I try to compile lol

fathom aspen
#

Promising start

past totem
#

I wish

#

Idk what to do. I just want to play a root motion montage smoothly on multiplayer, it can't be that complicated.. can it? or should I just remove root motion montages from my game Idk

vast scroll
#

Does World Partition work with UE5 multiplayer?

past totem
twin juniper
#

If I set a replicated variable's value in the PlayerState on a client will that change be updated for everyone else or do I need to set it on the server?

quasi tide
#

Set it on the server, server will then replicate it to everyone, including the owning client (assuming you don't have any special conditions set)

twin juniper
#

Thank you

compact lynx
#

Has anybody managed to setup a custom, non static data channel? Similar to Actor Channel but with it's own serialize\deserialize? I can setup a static channel easily, and indeed a non static one, but sending bunches doesn't look like it works ... they never make it through to the server ...

past totem
#

hi, how did you do it?

#

hi, have you managed to fix this root motion on MP issue?

vague fractal
#

Yet, i'm not a pro. So maybe i'm just doing it wrong

past totem
vague fractal
# past totem Okay, just so you know, I am looking into a solution for my own project, and I f...

This video here made it a lot better, but as said, also not perfect πŸ˜…
https://youtu.be/zD8sfoJqr14

Programas Usados:

  • Cinema 4D
  • Quixel
  • Unreal Engine
  • Blender 3D
  • Davinci Resolve
  • Affinity Photo
  • Net Telgo delicia fibra optica, mandei a OI a merda

Contatos:
GitHub
https://github.com/nathanmiguel123?tab=repositories

Twitter
https://twitter.com/Cm77Cmtan

Facebook
Em breve

Intagran
https://www.instagram.com/homi_p...

β–Ά Play video
past totem
#

oh, that's an interesting way to do it.

#

thanks

winged badger
#

same deal for GameplayTags

past totem
#

actually .. I just realized that I was playing the montage on the client at a different playrate than the server. and now, without all the workarounds I'v added, it kinda plays smoothly I think. so maybe it worked all along?

#

I don't even know.

ashen stone
past totem
ashen stone
#

I do but idk where xD

#

it is on some git

#

What are u doing?

past totem
#

I'm trying to play a root motion montage on multiplayer smoothly

ashen stone
#

with GAS?

#

i did it using gameplay ability system

past totem
ashen stone
#

not so much

#

This is the only way i know to do it smoothly

#

It will play on both and sync for you

past totem
ashen stone
#

It is not hard and i`m not using unreal anymore

past totem
#

but if you have the code already?

#

πŸ˜…

ashen stone
#

This part is blueprint. I don`t have unreal installed nor the project

past totem
#

:/

ashen stone
past totem
dense forum
#

Hey Multiplayer Channel,
If i'm making a Desktop/VR Game and I want the Desktop Users to Load 1 environment with different lighting, and ExponentialHeightFog, etc while the VR user has a more basic environment but they are still "overlapping" how can i do that?
For example, the desktop user skybox and lighting is night while the vr user skybox and lighting is day but they are in the same multiplayer session.

crystal crag
#

Is there any guidance on how to generate session names for listen servers?

#

Not asking about how to create sessions, I already know how to do that. So far the session name has always been hardcoded and obviously that won't work in PRD

dark edge
crystal crag
#

Oh really? I don't know. I haven't seen a production game's source code manage the names before and I didn't think you could have spaces or special characters

#

That's simple enough if you can just plug in the username

dark edge
#

You'd probably want a unique session name under the hood and then some display name

crystal crag
#

Right, my question was more about how to generate the unique name rather than worry about the display name so much at this point

#

Display name can just be a string attribute on the session

#

I could just use a random generator to generate strings I suppose

regal geyser
#

Is it safe to use PlayerState=>PlayerId as a unique identification that remains persistent after server travel? Because when using non seamless travel the PlayerId always changes, but with seamless travel it seems to be the same.
How else could I get unique identification for client that would remain consistent with servertravel? (In lobby, client gets a role assigned, and after travelling to match I need to see what role he got assigned)

crystal crag
#

Yeah I was wondering if there was a more ue defined approach. But certainly an FGuid would do the trick

crystal crag
#

Please tell me that I am missing something with this method signature. This is by far the most stupid design I have seen to date while looking at the online subsystem

#
DEFINE_ONLINE_DELEGATE_FOUR_PARAM(OnSessionUserInviteAccepted, const bool /*bWasSuccessful*/, const int32 /*ControllerId*/, FUniqueNetIdPtr /*UserId*/, const FOnlineSessionSearchResult& /*InviteResult*/);
#

UserId is the same user that accepted the session invite... not the ID of the friend that sent said invite

#

it's retarded

#

Its like a mailman delivers a letter that you are supposed to reply to, responding back to the person who sent it, and all you get is the company address. Ok great, so whom do I address this letter to? Oh I don't know, because there is no name listed here. Fantastic!

steel fractal
#

i think i mightve made a mistake in my replication if anyone can help. My code works fine in multiplayer and it subtracts a bullet, but in single player offline, it subtracts two. I think its related to having two RPCs doing the same thing, but how would I replicate to the client as well if i dont have both rpcs

sinful tree
#

Flow should be along the lines of:
Client Pushes Input > RPC to Server > Server Fires Bullet, Fire Subtracts Bullet

steel fractal
#

thats how i originally had it, but because my UI is local or something it wouldnt update

#

unless i have to use a server rpc to get it

sinful tree
#

Variables just don't update UI unless you have a UI binding. Otherwise, you need to call the UI to update itself somehow.

steel fractal
#

i just have it bound on tick

#

it works fine when i replicate to owning client

#

but it doesnt work when i do just server

sinful tree
#

Then you may not have something replicating properly. Perhaps your inventory component?

steel fractal
#

hmm

#

possibly ill look

steel fractal
sinful tree
#

Even your weapon. If you want it to replicate values, it needs to be a replicated actor that was spawned by the server.

steel fractal
#

or havinbg the correct rpcs

steel fractal
#

so i basivally have to rid of owning client then figure out how to update my UI from the server

sinful tree
#

If what you say is true, in that on tick within your widget you're calling the "Ammo Message" code, then all that should be necessary is updating the ammo count while running on the server.

#

Again Input from player to shoot > RPC To server > Server Handles shooting the bullet & subtracting the ammo.

#

There is no need to have additional "Run On Server" or "Run on Client" calls to handle firing a weapon and updating an ammo count anywhere so long as everything is properly marked to replicate.

steel fractal
sinful tree
#

A replicated variable means the value gets sent from the server to the client.

#

So if you set the variable on the server, it will propagate to the client(s).

steel fractal
#

ohhhhhh so thats what the two replication balls are for

#

so if i enable that on a variable i set on the server, it will always get it from the server

sinful tree
#

No

#

It's not about "getting" from the server. The server will attempt to replicate it, in other words, if it's available, and is pertinent for replication, and the client actually receives it, then the value of that variable on the client would be set to the same thing as what is on the server. One can still manipulate variables that are marked as replicated on the client without the server knowing about it, and it's not about the client making a request to the server to receive the value.

steel fractal
sinful tree
#

Yes. It's marking a variable to indicate that if the value gets changed on the server, client(s) would receive the server value of that variable and have it set in their copy.

steel fractal
#

OHHHHHHh

#

i get it now

#

damn ya the way im doing it is way wrong