#multiplayer
1 messages ยท Page 543 of 1
I am only respecting valve more and more the more I try to recreate what they did
Also, given that dedicated servers don't (and shouldn't) play animations, limbs are never in the same position there.
They can play animations, but they will never be in sync anyway - so it's pointless.
Welp, I was hoping to send some animation driving parameters and sort that out on the server
I have read that Unreal Tournament (which version?) is supposed to have a pretty good lag compensation system, and there was supposed to be some code to look at on a wiki, but the wiki seems to be gone.
@uncut pier The Epic Github has the source for UT
UT has a system yeah, it's pretty simple but works.
Its open for you to read.
nice, i'm gonna go check that out later
god, is this not just crazy limited? I honestly dont get it
It's just not neccesary
It means you arent stuck with an existing system.
You make the system yourself.
Flexibility.
UT and ShooterGame are both UE4 projects yes
how am I supposed to detect headshots then?
You can find the full UT source code on Epic's github for study, and ShooterGame is available through the launcher
Is it checking the height on the bounding box? Do I trust the client?
Trust the client to a limited extent. That's what we do on hell let loose, it works perfectly.
You can't accurate garauntee that the head is in exactly the same position on the server as it was on the clenet at any time. In a real-world scenario it's just not going to happen
Do you guys use a bounding box as well on HLL?
Nah, I switched everything to projectile weapons so we needed a full lag comp system to go with that.
Ah
The travel-time on weapons complicates things massively...
Yeah no doubt
long live hitscan ๐
Yeah love hitscan haha
:S
@unkempt tiger You can maintain the transform of each bone of each player's for the past second, on the server, and use that information to decide whether a client actually got the shot. But every shooter today gives large leeway to the client because literally no one wants shots that do not register because ping spiked by 10ms.
So what most shooters do is trust the client to some extent
Which can be a bounding box etc
If you're doing a competitive shooter you already want intense anticheat measures, player reporting, etc...
I can accep tthis, but what I dont understand is how this scales if you say, have a monster character that's huge, and the differences between hitting an arm or a head are massive
Or was it never meant to scale?
It's this constant sense of doubt that I have with every line of code I write and it's agonizing
You need to use the tool that best suites the job.
The other thing to consider is that usually servers are single-threaded because reasons, and evaluating animations on the servers main thread can dramatically reduce it's performance.
You want it doing the bare minimum possible.
Is ShooterGame a simplified example project for learning, or is it good enough to use the way they do things there in a real project? Am I overcomplicating things thinking about lag compensation with rewinding?
Since cheat proxies bypass anticheats
@unkempt tiger The system I described is not hard, really. You'll have what, 10 collision boxes ? Maybe 10 frames worth storing data for ? When a client shot comes in, do the weapon hitscan for <ping time / 2> ago in that stored data, and check that the claimed hit is close enough to your own simulation.
Do montages (and their contained notifies) run on the client for simulated proxies?
@uncut pier we used shooter-games built in system for about a year in a live game, no troubles.
Hell Ark, PubG and Lawbreakers all used it as a template, so do we
Okay, what am I even doing here? LET'S GO
๐
No, seriously though, thanks ๐
Thank Epic ๐
I pinged Vioxtar but it was for Endre I think ? Anyway
Thanks @bitter oriole I'll look into that
It's an old sample, but still has a lot of great use
yes ๐
Feel free to do it if it brings real value to your title, but otherwise...
Fair warning, SG sucks
Coding style wise
Of course it depends, nowadays some folks are moving to Gameplay Abilities which is a newer way of doing things.
Haha that is true also
Yeah GAS is another ballgame entirely...
Oh no, this is supposed to be simple, guys. I can't have conflicting information
My advice, since I garauntee you'll reinvent your project at least twice anyway - have a look at shootergame for inspiration.
Multiplayer games take a short eternity to make, and it does have a lot of useful stuff.
Thanks for the advice. What about the coding style is problematic?
My biggest complaint is that the UI is all done in Slate, since it pre-dates UMG.
It's basically made for 2013 UE4, with updates to compile on 2020 UE4
Yeah ๐
And beginners still come here with compiling issues with it
You can throw away all of the UI and sessions and probably some other stuff..
But, it has working shooting mechanics, so
Yeah, I think it's useful for grasping the concepts at least.
Wonder if we'll get some sweeeet new samples for UE5.
here's the entire paragon and fornite source code bye
UT is very much an abomination of a codebase, since it's entirely tailored to that game, but still has some cool stuff. Shame it's basically dead now.
is it still sensible at all to expect to achieve snapshot interpolation for networked physics? this is the real question
never in a million years
yeah, this does look very simple.. it just provided an FVector as a result
jambax what's the main prevention in your opinion?
@chrome bay People really want the Paragon sources and I'd love to see that tbh, but...
@unkempt tiger It's just a huge can of worms.. hard to nail it to one specific thing.
I wasted years trying to get networked physics to work nicely, learned the hard way.
has anyone ever seen a codebase that is not an abomination? serious question ๐
It only really works when you have a very specific setup, like Rocket League
and you can afford to rewind the entire physics scene at your whim
no no no no 
are you saying that if I intended my game to have physics actors just like in Source 1 by Valve, I should quit and move to another engine?
Chaos has a rewind API now, and Epic are exploring an integration with that and the network prediction stuff but no ETA or defined goals for it yet.
I wouldn't expect to see anything for a while, maybe not until UE5 even.
so do I abandon UE4?
Nice, i was looking at that new prediction plugin, but it scares me.
It's what character movement should have been
The prediction plugin will probably ship with UE5 i reckon
oh totally
Im looking forward to it haha
or do I try and handle that huge can of worms
I hope UE5 ditches CMC entirely but I expect they'll keep it to let people update easier
Yeah i think it will remain
yeah, it's current state is not ideal; but it says it needs to be optimized.
yeah, lots of work to do yet
Someone said that it was hinted on UDN that CMC was going
But i highly doubt that
If anything it will just be deprecated and never removed.
Yeah
Considering they want UE5 to be as easy as possible to migrate to.
CMC will still exist.
They also claimed that AActor will no longer exist, which was madness...
Haha.. hey you never know.
how i can activate the "Run Dedicated Server" option?
pretty sure its play as client
but thats me guessing
it makes sense since there is also a play as listen server
in which case youre also playing as the client
i was seeing a tutorial, and he got this
that image is from the unreal enigne documentation
@hybrid zodiac a while you helped me use anim montages in a replicated field. I put the montages in a mutlicast, which I played on server, but the animations are sometimes jittery on the client, this isn't a problem for the server tho. Do you have any idea why?
that image is from the unreal enigne documentation
@zealous delta
You use the Client thing
Your checkbox is outdated
Iยดll try
Where does SteamUser() come from?
The Steam OSS/ Steam SDK?
hi guys, what is the default port for my multiplayer game when I package it?
is it 17777 like in the editor or is it something else?
Just going over the Steam OSS code... is it like not finished?
Its barebones. Thats why that UWorks plugin thing exists, because the Steam OSS doesnt expose enough.
I think I have three separate questions. I've seen a bit of struct nesting lately Like.. Having six total variables in your main struct that makes up the array, but four of those might be hidden inside of a second struct that's within the first. I've been needing to reorganize my inventory system for a better layout so that I have less hassle with designing around it. Right now, It's extremely simple a class(TSubclassOf) and an integer for the count of items. I was getting some stuff from the Class Default Object to populate the other stuff such as the name of the Item, Texture for the inventory. So..
- Why do people nest Structs? Is there any backend gain for this or is this just for broad organizational purposes?
- Should I keep getting certain things from the CDO like it's name/texture that I don't need to alter? I did this because I assumed that it would be cleaner to transfer just a class variable over network rather then pulling all of those variables out just to place in a struct to transfer. This way the client handles that stuff, less stuff to send I figured.
3.More of an extremely specific question, but say I end up with a struct of... One Class(TSubclassOf), One Integer, A Float. I feel like that's all I'll need to be able to determine everything if I rely on the DFO to gather the rest of the information... How bandwidth heavy is a TArray of those structs? Say... Max two hundred of them? I'd need to update them semi regularly I think which means replication back to the owner. So I'm wondering how heavy one array of those might be per Fifty on bandwidth usage.
HI there, I'm using a projectile in a multiplayer project, and the projectile is jittering on the client. Even using the double decimal rounding in the replication parameters. So, I unticked replication movement and did it myself using the tick event to store transform when actor has authority, and update the transform when actor is remote. Everything is smooth but I know it's a bad idea to heavily use Tick event and this could lead to network issue. What is the best solution for projectile movement replication ?
How fast of a projectile is it?
If we're talking like slow homing missile, then replicating is okay, but for general fast moving bullets people don't usually replicate it from what I've seen. In fact there's even a setting to disable the client correction temporarily when dealing with fast objects to keep it from looking jittery.
Fast as fire projectile from a wizard hand lol. So if they don't use replication, what are they using ? tick event as I did ?
Things like bullets rely on being spawned in the same place in the same way on all machines. If you want a good feel for the client, most people seem to.. On mouse button down, RPC to server, tell server you want to cast fireball, server makes sure character has the mana or ability ready and if so, multicasts to all clients to cast a fireball at a given location with a given direction. Then it'll rely on the client to tell the server that it hit something but only from the client that casted the fireball initially. On all other clients it'll just hit something and play explosiony stuff, the end. Cosmetics. But the client that originally created the fireball would tell the server what it saw the fireball hit. The server would do some checks. Maybe ask if the fireball 's vectoring was possibly close enough to have hit this target etc. If yes, call the server event apply damage on the server version of the damaged actor and let it handle itself being damaged. Done correctly, most clients will see pretty much the same thing in the end.
Ok, I'm gonna save this whole answer in a sticky note ๐ thanks. I'm using the GameplayAbilitySystem so things like mana check etc are already implemented. This whole process is doable for simple projectile, but what about projectile simulating physics ? I saw that physics simulation can be dramatically different between clients even if force / rotation / location are the same. I'm asking cause I do have a Rolling stone ball as one of my spell and so far it's not looking good (and I had to turn off physics simulation)
@kindred widget If an array of structs is something that needs to change often, then you should use FFastArraySerializer. By default when a TArray<> changes (or any of it's inner properties), the entire array is replicated.
The caveat of FFastArraySerializer is that order is not preserved.
So if order is important, you need to add an index property to the struct as well.
TSubclassOf is replicated by the classes full path name until a NetGUID is acked for it, so the first time it's replicated it will be costly, after that it'll be cheaper.
@unkempt tiger Idk what you mean by scale, the usuall thing in the case of hit detection per bone./body part/whatever is to trust client
Nobody is really complicating it more beyond this point
client shoots, and send result to server (which is accurate) because server do not update skeletons (I for example strip animations assets from server entirely).
then server do some base verifications (were you here, cloud you rotate so fast, cloud trace hit capsule)
since server have pretty limited view of what happen it does limited verification and either accept client result or rejects it entirely
in most cases anti cheats will handle most wannabe cheater
the cheating problem is vastly overexaggerted by internet biasa
bias*
Personally I use UObjects for my inventory slots on one project
But only because the project in question requires complex subclasses of them.
@chrome bay I'm not sure if I care about order. At least not right now. Out of curiosity. This.. basically sends the client changes to make to the array instead of copying the entire array?
Yeah you can do that too
@kindred widget FFastArraySerializer only sends the changed items yes
But importantly - it sends the entire item each time
I have done it, and I don't recomened it, unless you have really heavy inventory
When using a USTRUCT() in an array, you lose the per-property replication.
I turns out custom NetSerialization cannot handle acks/nacks
But, if you need an array, you can't do much about that ๐
that's non issue
you can serialize bits indicating what changed
or use NetDetalserialize and go this way (;
Yeah you could do, get's more complicated though
The TL;DR of this is there's lots of ways to approach it ๐
I had problem with lost packets ๐
once bit for delta serialize was written (and didn't get lost), I cloud not resend missing properties because I didn't know if entire struct was acked
Ahh yeah makes sense
that information is accessible in engine, and cloud be passed to NEtSerialize.. but it is not ;s
I'm sure I'll get around to some serious optimizationing at some point. Right now, I'm just trying to make it work without making it a complete shitstorm. Pretty much all of this is above my head at the moment. I get the concepts, but the specifics still look like hieroglyphics.
At the veyr least if you don't care that much about order, or if the array is large and changing often, use FFastArraySerializer
Setting that up is pretty straightforward.
I'll do that. Order doesn't matter since I'm probably not allowing individual slot placement anyhow. Just a simple.. This component has these items, this component has these items, player wants to move this amount of these items into this container, move the items on the server and replicate the changes, update the UI from new info. I've written a few different sort types already. Might even make tabs for different item types. Not really concerned with having a complex inventory beyond maybe weight management.
Hmm. Also just got the idea to add a favorite Items type array to move items to the top of the inventory.
Our of interest, what is the float and integer property for?
Integer is item count. Float was going to be a durability setting for items that have durability. IE not items used for crafting or consumables.
Ok so you can probably move the float onto the item itself right?
Assuming the items are objects themselves and not structs
Only when it's spawned. The float was to keep it updated when not using the actual actor, since the inventory is based off classes.
Right kk
You can make big savings by using smaller data-types is basiclaly my point. So if the stack can never be larger than say 255, you can use a uint8 instead of an int32 etc.
Or if durability is a range from 0-100%, you can quantize the float into a byte, or perhaps even smaller. Really depends.
I want to make a multiplayer on a huge map with potential of thousands players joining (even though it wont happen ever, i'd love to entertain the possibility). I've read that built in UE multiplayer is no fit to this task, but someone on forums said that in past years this improved a lot and now its not an issue anymore.
Anyways, my current approach is an external server using Java that can handle all the server side logic, send updates to players etc. But it has a huge downside: I somehow need to use navigation data from UE and I dont know if its even possible to export this ๐ฆ also, the movement handling is crap, i have to do all predictions and stuff. This whole idea sounds like a reinvention of a wheel to me tbh.
What do you think, should I try to extract the navigation data or it is better to scrap my idea and just use the built in UE multiplayer?
That is fair. I didn't consider that I don't really need anything bigger than a byte for a lot of that.
@chrome bay Also, what is smaller than a uint8?
Nothing :D, but you can pack stuff into bits too remember
@wintry bobcat 1000's of players is not happening in UE4.
The huge-player-counts-ideas come up here all the time and you'll find nothing but discouragement here tbh. Nobody advises it.
Maybe like.. 100 players on a server, and then a third party solution to connect dozens of servers. But you're looking at some severe work even with that kind of style.
100 is pretty much the limit for stock UE4 - and that in itself is a huge challenge.
Thankfully, Fortnite was popular and Epic did a lot of optimisation work to hit 100.
I was hoping to avoid using sockets :/
Sockets isn't really your issue here.
Games that require 1000's of online players usually have to build their own bespoke engine - and you can't have the same quality you get in a game with fewer players.
I only see the problem in server's ability to hold players and manage packets
That's not the problem
The problem is executing gameplay code for all those players, and clients doing the same.
Put 50 characters into a map for example, and watch your framerate die.
Without any networking.
I'm sure this is the fourth time this week a huge player count idea game has come up here
I'm fairly sure you can place 50 characters and not update them every frame
Typical problems of >20 players games :
- client performance is a huge problem
- server performance is a huge problem
- network performance is a huge problem
- need to have massive commercial success to have one server full at all times
I'll just say it, if you want to make an MMO, do not look to Unreal.
You will need bespoke tools and architecture to support it.
You can actually get up to like 200characters with the default mannequin in a level with okay fps... As long as you nuke their Movement Component and Mesh Component tick rate. Then they just look like little picture flipbooks.
That's the default mannequin in an empty level. Add all your other gameplay code on top too...
And then your art assets...
And complex animations. It adds up quickly.
Well, even before that, they look like little twitchy flipbooks. So, still not really a solve. XD
how can you even make a simple single player experience in unreal then, if it cant render even 20 character models without fps dying?
And a single player game rarely crams more than 20 fully animated characters on screen
it's not the rendering that's the issue here
what is the issue then.
I really had no problem in culling distant players in my java draft so it wont be thousand on a screen ever (even if that many people will join)
cant unreal do the same?
Unreal does the same
But if your current prototype supports 1000 fully animated characters with actual players using them and it all goes well, I'd suggest using that tech instead of UE4
It's quite well documented that the best UE4 developers struggle to ship 100 players games
If your business has such a massive success, your own engine will be cheaper than the 5% royalties after the first million dollar
maybe the issue lies in update rates? i dont need nearly as much as fortnite has.
haha no it will never be a commercial success i dont think so :)
i think there will be 100 players tops but as i said before, i'd like to think that it can hold much more
Well 1000 players would put you in the top 0.5% of Steam games
So basically a million sales, something like $10M net gross
So surely you plan for that
The 100 players threshold is something like the top 4%, IIRC ?
I look at indie mmo with 1500 online and i dont think those guys have $10M :/
If they have a Steam page it's easy to check !
no they are no steam
Wow, 1500 players, so probably 500,000 sales, without Steam, that's impressive
its freemium tho
well, I deceived you, its actually 1300 max
they got a population tracker
1300 online players is still 100x the average commercial game though
Anyway, UE4 won't work for 1000 players, that's for sure. A few very experienced UE4 devs who did ship 100 titles have said as much in the past, including Epic who struggled to reach 100 at all
Basically 100 players is already something you need to very carefuly engineer over the years
I'm just wondering why there is so much of a struggle. Obviously it must be related to complex simulations, precision, tick rate etc. Can't you just disable most of those things if you dont need them?
well
once you remove animations
and basically leave moving capsule
you end up on transform eating cpu time on cache misses
no why, animations are client side
Typical problems of >20 players games :
- client performance is a huge problem
- server performance is a huge problem
- network performance is a huge problem
- need to have massive commercial success to have one server full at all times
last time i run profiler
on mp server
i actually check archives
wait second
single CMC took 9.7 micro seconds
that was on map with nothing but 70 randomly moving AIs
consisting of capsule two boxes and two bones
add to it some real AI
projectiles
player which are usually far more complex
and at that point server performance is not even an issue
you can really cut corners on what is on server
but clients will show wave white flag at this point
@bitter oriole yes I just dont know why server performance need to be such a huge problem, when there are simple games can have up to 1000 players with no lag
@eternal anchor my server on java has no such term as animation so it wastes 0% cpu time on it ๐ฎ
oo looking ad insights data again
I shouyld have disabled tick on skinned meshes on server
@wintry bobcat Maybe they have no lag because they are simple. Like I said, if you want 1000 players, you need a different tech than UE4.
of course they are simple
I actually never tested like 1000 CMC os moving capsules
i mean... cant you make a simple game with unreal?
Sure
but I don't think it will as much as performance issue
But then don't use the character class
as simply unreal networking won't handle it
Push Model make it somewhat better b
but Unreal NEtworking was optimized for sending data fast not lot
Anyway, I've said what I needed to say - 100 is already very hard to reach for real games, 1000 is not possible. You don't have to believe me, feel free to do whatever you like
Well, I get it. Unreal networking is still not fit for anything thats not shooter game.
Exactly ! It's terrible. You shouldn't use UE4.
@wintry bobcat It's not about being for a shooter game. Even in a lot of games where there's thousands of players online, a lot of that is broken up into different instances. A lot of big MMOs even break up stuff like stores. You might have 5 instances of a small store level with 50 players max in each. Each of them is a server executable running. They're all the same level, just that players don't see the players in the other four stores because they're not technically on the same server. Ark sort of did something similar with it's uh... whatever it's called, server clusters or whatever. Allowing travel to specific servers within a cluster that are all ran on the same machine, but different executables running for each map. It's not that it's not possible, just that the engine really wasn't designed for it and it doesn't work out of the box. By the time you strip enough away and handle adding the extra architecture around it to make it all work, you may well find a better solution.
@kindred widget yes i know of channel/instancing/zoning tech. I dislike this approach tho.
I'll continue improving my solution but I still need to overcome some challenges such as getting navigation data from unreal so i can use it on my server :/
SpatialOS
If you really want your company to go under
Worlds Adrift was SpatialOS's showcase game, went under last year with 100,000 sales because SpatialOS was too expensive and a technological nightmare
guys I'm stuck at FP spectator. how should I implement it properly ? ๐ฆ
do I need Replay system ?
Just give the player a spectator pawn?
There's a function in the gamemode to set a client to a spectating state
They just spawn a pawn locally.
what's a good method for networking timestamps? 
my inner dumbass is telling me to use floats or doubles but surely theres a better way
I mean a real FP spectator for watching teammate or enemy. that default spectator is not enough alone.
we wrote a basic one but it had lots of problem.
the first problem is I cant tell the UE4 replication system to replicate something if the client is spectating the specified pawn. things like COND_SKipOwner, ..
for instance. in my AWeapon I have a replicated BulletCount with COND_OwnerOnly.
beause other clients don't need to know how many bullet I have in my weapon.
but the client who is spectating me should know that .
I dunno how to say but something like COND_SpectatorsOnly could help alot ๐
Well there's nothing you can do about that, if the property only replicates to the owner the other client will never know about it
The alternative is to not make the properly Owner only.
You can't change property replication conditions at runtime
They are defined per-class.
If a client spawns an actor on their own, it will have the local role authority. But can it possibly get the remote role SimulatedProxy? Not making sense of an error I get
I would expect that if a client spawns a local object for themselves, the RemoteRole would be ROLE_None, but it seems to be ROLE_SimulatedProxy
If so, how can I tell if an actor is spawned by the client or the server?
Hmm I guess you could do IsNetMode(NM_Client) && HasAuthority()
Ahh, I forget that this IsNetMode exists, thanks
Hi can anyone tell me please why replicating this on tick doesn't work? it prints 1 on tick but neither 2 nor 3. (Btw it is activated through a switch not running all the time)
Hi Guys anyone got an issue with 4.25 when he trying to create a session or lobby ?
my engine crashing instantly when i create a session
@shut loom I'm no professional, or even elite at it, but as someone who's only been playing around with game design for about seven months I recommend just doing. I spent a couple weeks when I first started following a semi bad tutorial series on making a city builder. Then I spent even longer going back over what I made to try and understand why it all worked. I think that's an important step, going back over it to actually understand it instead of just following the tutorial. As far as Multiplayer specifically, I really urge you to learn the basic single player aspects first. Learning multiplayer really breaks down into three major aspects. Variable replication, RPCs, and understanding the Server/Client dynamic. All three of those are interconnected and requires forethought into implementing ideas over just doing it in a singleplayer game. But back to the original point of just doing, I strongly recommend it. Just recreate some of your favorite game things. You know how they should look, so make them yourself and try to not rely on tutorials too often. Get used to looking up what you need through the API. First make a single player version of it, and then if you're so inclined break it apart and make it work in multiplayer. Do very small simple things first. Then take that experience and start making a small game. I made a little store game where I had to place tables, and then order items to place them on the tables, and flying ships would spawn in and fly to landing pads and land then spawn AI that'll come to the store, browse over stuff and sometimes buy an item. Once all of the AI from a ship returned, it would fly away for another ship to show up. It was a very small game and had no real graphics implemented, but a small personal project like that might help a lot.
That your own physics ? ๐
just interpolate, it will be fine. ๐
gotta find how to increase the replication frequency
So here's a thing, never call SetReplicates() in a constructor...
As of 4.24 it's SetIsReplicatedByDefault or something
o, you recognized the delay?
When you spawn an actor, SetReplicates() will successfully make a call to UWorld::AddNetworkActor(), and it'll be added to replication graph with it's parent classes settings.
I was wondering why my actors were being added to rep graph without the right dormancy setting... now I know why
i still dont know what dormancy is 
: Super(OI)
{
SetReplicates(true);
NetDormancy = ENetDormancy::DORM_Initial;
}```
Rep Graph ends up adding the actor before any serialized properties have been loaded or defaults set... blergh
SetIsReplicatedByDefault only exists on components I think... but I can just set bReplicates = true; directly.
What a funky bug/non-bug that was
is UCharacterMovementComponent the only model or are there other ones? (other than the Prediction plugin)
I didnt understand 90% of what you just said jambax 
Haha, just sharing. This has bugged me for months.
I think it's responsible for a few issues in this project.. Starting to amek sense now
these actors are replicating like, every half a second
Net update frequency
The value is number of times per second
Default is 100 which is mental.
I'm perfomring replication on a component attached to these spheres, do I set the net update frequency on the sphere or on the component?
You can only set it on an actor
oh
I wonder if I can do that through Component code
GetOwner()->SetNetUpdateFrequency etc
ima try
You can if you aren't using rep graph, but it sprobably best to just set a default on the actor
ya it doesnt work
@chrome bay oh thank you! I had SetReplicates in my Weapon constructor...
Yeah same ๐ฉ going to see if epic will warn you when you do it in future. Seems like an oversight
i assume just using bReplicates is the way to go? i couldnt find a SetReplicatesByDefault, or anything similar
Yeah it looks that way for the meantime. I was having issues with actors being added to rep graph in the wrong order too, even though one was spawned before the other. Very odd.
omg... that must be why i was having that same bug, holy shit i had to do some wierd workaround for it too
The weapon was spawning for the character, before the character was spawning
yeap same. I had overriden OnRep_Instigator, and make sure they would sync after the other loaded
Blaah. >.< Why is Int16 not exposed to blueprints.. I don't really want to combine bytes in blueprint. Hey @chrome bay going on my earlier inventory issue, I decided I probably want more than 255 items in a slot. But definitely less than 65000. Would I be better off using two byte values in my struct to send over a int32? Like one byte as a multiplier. Multiply it by 255 and anything over my multiple of 255 spills into the second byte. So.. 260 items would be first byte value 1 second byte value 5?
If it's less than 65,000 just a uint16 will do it
Problem is that I can't use uint16 in blueprints so I can't add it to my Struct that I'm using to implement the UI.
kk this is my plan for carrying out my second attempt at replicating a lot of physical actors at once, Ima lay this out for own book keeping but I'll be glad for any input/feedback/ideas:
-
Every client has a ReplicatorDummy actor 'attached' to his view, which belongs to the client
-
On the server, the ReplicatorDummy will collect all close enough physical actors' transforms into SubObjects stored in a TArray - this will be done by every ReplicatorDummy (that is, for every client)
-
Every network update interval, the ReplicatorDummy will send out a Client RPC with the stored TArray (whose data will be compressed/quantized) (which again contains all relevant physical actors' transforms needed for interpolation) to its own owning client - that is a single RPC to every client. Additionally the RPC will also include a timestamp or a deltatime number which the client will be able to use for interpolation. Finally the RPC is unreliable!
-
Upon receival, the client will store this snapshot in a snapshot history buffer, and every tick he'll blend snapshots - and use the resulting blended snapshot to teleport all actors to their corresponding positions etc etc
Gonna start implementing this today and finish it tomorrow, and HOPEFULLY get good results
vioxtar, ionno if you've seen this but it was suggested to me the other day...
https://docs.unrealengine.com/en-US/Engine/Networking/ReplicationGraph/index.html
Overview of the Replication Graph feature and Replication Graph Nodes.
thanks though the replication graph only solves one problem which is to determine networking relevancy
i dunno much about it, the overview of the plugin seems to fit ๐
which is only a part of my solution - which also targets handling lots of data, compressed, at once
gotcha
what the replication graph does is it determines which actors are relevant to each client in a faster algorithm than a N*K sized loop
just to save server CPU time
oh interesting, thanks for explaining that!
How do I smooth the LaunchCharacter movement on the Client side?
The CharacterMovementComponent Documentation suggest using RootMotionSource. "Refer to AbilityTask_ApplyRootMotionMoveToForce for a basic example" and I did. The Class uses the struct
FRootMotionSource_MoveToForce : public FRootMotionSource
for that, but I don't want to edit Engine code and create my FRootMotionSource_LaunchForce struct for that LaunchCharacter smooth problem.
Does somebody know an easy solution to that?
The Character should be able to move freely in the air and be effected by gravity, because I heard that RootMotion puts the pawn into a Flying state where he can't change the direction and where gravity is deactivated for that motion.
this is probably an easy one. Is it bad form to make RPC calls client to server inside of GameInstance? i need to trigger some GameSession functionality and assumed this was an acceptable pattern.
GI is not replicated
can I declare/implement/invoke a RPC from an ActorComponent?
nvm
literally says they gotta be called from actors 
@unkempt tiger They can be used in Components. The component must be set to replicate and it's owner must be set to replicate and the owner must be owned by the client. Can confirm, am doing it myself.
Oh sweet
lol uedocs
@kindred widget we're not talking about multicast RPCs right?
(since the wiki says those are within an exception)
I am interested in non-multicast RPCs
yes you should be able to call any RPC from an actor component subject to any regular rules
@unkempt tiger What Hojo said. Mine aren't even multicasts. Client to Server RPCs are what I'm using.
sick
GI is not replicated
@bitter oriole solves that
is there any networked ID for actors I can use?
so that if replicated, a receiving client knows to reference a prop with said ID?
I found FNetworkGUID
But I'm failing to include it and this gets me thinking that this may be a more internal thing
oh, thanks
yeah I ended up using straight up Actor* for now
probably not very bandwidth friendly but that'll come later
How can we tell when initial replication is first completed? When connecting to the game, I'd like a black screen until everything is replicated before revealing things. Otherwise things seem to pop
you will have to delay it yourself
we call begin play on stuff, and hold the loading screen till everything is done
we also randomizer
there is no "proper way" @cosmic trail we just issue beginplay, and delay removing loading screen for a second or so
haven't found a nice way to do
Ok gotcha thanks Spectrum ๐
we do randomly generated levels
so we actually wait till those have finished, then we issue beginplay via the gamemode, then we have to generate the map snapshot for minimap, all this gets hidden behind the loading screen, and only once everything is done, the loading screen gets removed
but clients also generate the same random map using a seed, so we actually wait on the server till all clients are done, before we move on
quite a complex system but it works
@mystic hull i would ask the question and those that can help and see the question may responed
okay.
i was following along Tom Looman's tutorials for multiplayer in Unreal while adding some of own scripting to the side.
so to get the general idea,
each player pawn has a health component and some weapons.
the weapons has a fire fn which is only called by the server, when the cliens wants to fire , it calls server_fire() which does the firing itself.
finally, each player's health component has a fn that will resond to its owner taking any damage ,
MyOwner->OnTakeAnyDamage.AddDynamic(this, &UHealthComponent::TakeAnyDamage);
,
and this binidng is only added if the Role is the server
which is all good so far
my problem is, if we are running the dedicated server approach
the server itself isn't a pawn, so why does the health get updated for the 2 clients
i set the health component for the pawns to be replicated, same for the float health
i am not sure what you are getting at
you mean shooting one player, affects both players health/
yes
so what actually happens
it prints Called once twice?
the big question is, do you have the pawn in the level (not being spawned but pre-placed in the level)
cause that would make sense
no i mean does your player exist in the level
not player starts
and it would be called twice, once for each client
no i don't have any pawns except for the 2 players starts
and you have 2 clients right?
yes
to answer the "the server itself isn't a pawn, so why does the health get updated for the 2 clients?"
the server is actually playing the game. clients are watching and providing input. Replication is for when data needs to exist on both client/server. The server should make the changes and send info to client through "Replication" and how you set it to send.
i am sorry if it's kinda dumb , but i guess i don't really get replication correctly.
my issue is that, why does the server call the begin play of something it doesn't own
because i set the health component to be replicated
server owns all replicated actors
okay
its a little difficult to get your head around it at first, i would watch a couple tutorials that explain and break down replication to help
thank you both so much for helping me
in a nutshell tho, only server can replicate stuff,
what you all said helped so much , and i will do the read book
when you start a game, the server spawns the Players Pawn
client send inputs and request to server
this is replicated to the client, and becomes an Autonomous proxy on the controlling client, and simulated proxy on non controlled clients.
at first its daunting, but once you grasp it, it is easy
server takes the inputs and validates them. runs methods with data, and broadcast back to all clients that need the info to change to new data
Gah, am I doing something wrong? Every time I try and call an RPC I get this error Failed to find function None in PhysicsReplicator
movement component (CMC), works a tad different, as clients move locally, and send the stuff to server, and server validates and either accepts the move as succesful, or rejects it which causes the player to revert back (rubber banding as most people call it).
okay i will ask a small question to see if i got it correctly (again thank you so much for answering)
if for a stupid reason , i decided to make the health component NOT replicated
and a client starts the fire fn, which calls the server_fire()
then health would never replicate, and no client would know its health value
i would make the Health variable Replicated
which applies the damage to the actor
it would still work from a server perspective, but the client would not know what health he has (for things like health bars, etc)
this won't make any effect to the helath, according to the above code snippet , right?
but why would you not replicate it?
it seems like it should replicate
and Health should be replicated
yes yes , i am just trying to break it so i can understand it better
thank you again, i will read the book you provided
thanks @sterile oriole and @meager spade
once you get your head around it, it will make sense
don't expect to learn it in a week tho
there is a lot to understand
(Replication race's, that kinda stuff :D)
hahahhaha true, i now have unlimted respect to all the games with netcode
even if it's shitty hhahaha
Unity netcode is worst
CryEngine is ok, tho that engine just makes me want to Cry. I think unreal has one of the easiest to understand netcode for an available to general public engine
i wrote a python script once to be the server for a unity game once, it was extremely awful expereince ahhha
yeah unreal's is clean, but the problem is it's kinda black box-y
which sometimes isn't the best thing
i would also recommend downloading the ShooterGame example
as it shows some replication stuff there
im looking for the video ue put out that helps explain it really well and helped me at one point
Creating a networked multiplayer game isn't easy, but Unreal Engine's gameplay framework is designed to set you up for success. On this episode of Inside Unreal, Technical Writer Michael Prinke will cover fundamentals such as the server-client model, various features of replic...
its more of the concept that helped me XD
i remember seeing one where they had replication inside a UMG widget
its their more recent one

no this one is where they show the hitching in networking if you do replication wrong
i think
ive been sitting here scrolling through my youtube history looking for it this whole time from when the original quest was asked XD. had to go all the way back to feb. way to much time spent on youtube
thank you so much though <#
this will come in handy with the book
then i will go complete the course, because honestly there is alot unexplained
Ive been learning by just diving in hard and debugging and pestering kaos every now and then what id mess up XD
anyone know the updated commands for the ` console Open/Connect commands?
says they are not recognized
Can anyone help me understand this. Have a dedicated server with world composition. I'm trying to replicate removing foliage. I have it replicated with OnRep. The foliage removes fine. If i disconnect and reconnect it is still gone. But if i leave the tile and come back it is respawns. Can anyone explain what is going on here?
would anyone know why the camera is shaking while playing multiplayer with real players?
this doesn't occur in simulation
Hi there, I'm working on an advanced spectator system (network camera smoothing, specific replication code, UI). I've seen there's no such thing in the marketplace. On what templates do you want to make it work with? Doing it for third person at the moment.
Trying to get a server to client RPC to work, and it does if the RPC doesn't take any arguments just fine
But it crashes as soon as I pass a even just a float
With this crash message
Am I doing something wrong? This is the declaration
And the implementation
And I call it on the server just like so
All of this on an actor class
Is there anything missing?
looks like you called it on a null PC
your playercontroller (i assume that is) was null
when you called a function on its ref
there is nothing wrong with the RPC itself
Oh.. hmm
Where do you think the call on the nulled ref was?
Was it on the receiving side, or the sending side?
This also makes me question why it worked without an argument, what was different?
printfloat is i assume a function on the PC?
its a macro elsewhere
To add an on screen message
#define printfloat(variable) if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 1.5f, clientservercolor(), FString::Printf(TEXT(#variable ": %f"), variable), false)
when you call a function on a nullpointer
function will work just fine
unless it tries to dereference this
then it crashes
I dont know where it would try to dereference this 
accessing any member, variable or function
clientservercolor() requires GetNetMode() or GetLocalRole()
i assume
It... uh
Yes...
Yes mhmmrmh
thinking intensifies
But this is confusing because
I was calling clientservercolor before when I didnt pass any arguments, for example
i also assume you called this very early
I did, it was about 200 ticks from the start of the connection
I called this
And it worked just fine with
(Clientservercolor was used there as well)
compile DebugGameEditor binaries
start the game from VS
make it crash
then check your Locals window
Alright, let me just find out how to do each one of those steps :D
To compile the DebugGameEditor binaries, do I just build the solution with this configuration?
K I'm on it.... building / launching is taking a while
@winged badger I just rebuilt the solution with the DebugGameEditor configuration and launched through VS, tried to make the game crash (by sending an argument as described) and it WORKED
So...
ยฏ_(ใ)_/ยฏ
in your Locals window, whats the value of this?
Ugh let me check
FUCK I just used Alt+F4 isntead of Alt+4
am I retarded
i'll relaunch ๐ I want to die, help, this is taking way too long to relaunch, and load all symbols, please dont go ๐, its launching, aaah, now I get why people said C++ dev is slow
4.25, 3 Players, PlayAsListenServer: All 3 Windows show "<ProjectTitle> Preview [NetMode: Server] (64-bit/Windows)"
It doesn't say Client0 and Client1 anymore. Can I change that somewhere?
Zlo, I'll admit I'm not exactly sure how to use the Locals window
It's empty :D and this is my first time tryina use it
Should I select some variable of interest in a certain way?
Did you already hit a breakpoint?
Oh I got it, yeah I did
I was just being retarded
This is what this references
I can't seem to crash it because, well the problem is seemingly gone now
at least in this build
If I breakpoint on ReceivePhysicsSnapshot_Implementation, this references
(which is marked red for some reason?)
Oh that means the value changed
.. I guess I'll just try to rebuild the entire solution again in the normal configuration and hopefully the problem will continue to be resolved
Conclusion, magically resolved after building the solution itself (rather than just the game project...)
Can I cast an actor to an interface and pass it over the network? I remember having problems with that, but it doesnt make sense
can't you send the actor and then use the interface?
I have to redesign stuff then. (Edit: Yes I can. Just feels wrong to pass an actor parent ref and cast inside the other method)
So theres no way as it looks. The actor cast fails after passing it over the net
Like passing 2 objects to a sum method and casting to and integer inside the function
Yeah you should just pass the object reference, then have the receiver cast / get the interface at the other end.
Casting to an interface doesn't work if you implemented the interface in Blueprint. You have to use Implements<>
Yes. I fixed it that way^. Thanks
I guess internally UE does a network ID lookup to get the right object on the other side, that information gets lost using an interface
Yeah, UObjects are the only things which support replication.
TScriptInterface<T> just silently fails, if you try to replicate it
no warning, no anything, just a null on the other end
โค๏ธ unreal
Ah yeah.. that figures ๐
Was that a design decision or a C++ limitation?
i imagine there is an entry in some drawer in epic with TODO: make TScriptInterface replicate
it does have an object pointer inside of it, so i imagine it wouldn't be all that hard to do
Something has to implement that interface. I don't exactly how all the UE parenting is done, but UObject sounds pretty high up, atleast above Actor. Atleast it would be possible to cast to an actor. And if that's possible you can pass an interface to an RPC, which internally does a cast and retrieves the information if possible.
@chrome bay finally got around to implementing NetworkManagers with FastArrays for replicating Actors that no longer need to replicate themselves. Works like a charm ๐
i imagine there is an entry in some drawer in epic with TODO: make TScriptInterface replicate
@winged badger That sounded more like you making fun of me ๐ฆ
i wasn't, epic has a huge backlog
I know I'm joking :3
I don't think that they will implement something like that soon unfortunately.
I now have 16 NetworkManager Actors managing the replication for about 1600 NetAddressable non-replicated Actors
@winged badger That's awesome. So the intermediatte actor reps the information for the others?
Is this for the procedural generation?
yeah, syncs them via callbacks, and its procedural
nice
prefab buildings randomly placed on slots
does sound useful, even if just to avoid masses of actor channels all being opened at once...
our bottleneck was the CPU time to evaluate actors for replication
Yeah that makes sense.. wonder if Push model would have helped there too
for this, not really, as this is push by design
fastarrays won't replicate unless explicitly told to
took some lying to the engine to get the actors net addressable when procedurally spawned
as we let clients spawn the same level with the same seed
setting NetStartupActor to true manually and such
added preloading of level assets in the lobby
takes about 10 seconds to fully generate a 1km squared map over network now
That's pretty good tbh.. I'm pooling a bunch of actors for my projectiles atm, they start out dormant which helps a bit but there's still a big spike when they initially get spawned.. slows stuff down a lot.
you could have a pool of them saved with the level
makes them automatically netaddressable, by being loaded from package
Ah that wouldn't work for this case, but having some way to spawn actors independently then have them link up automagically would be handy
we use PreSave a lot
to hook up links, setup on level references, turn the editor only marker actors into structs with just data...
every time you hit a save on the level, it executes
you can spawn them independently as long as you have exact same names on every machine
and convince the engine they were are level actors
in that case, a static NetGUID is assigned (last bit of the GUID)
and when clients receive a static NetGUID, they know they should resolve the NEtGUID, rather then spawn it
Nice.. that's good info. I might see if I can trim some fat off of it at some point..
Greetings. I have a noob question about User initiated multicast.
How this should be implemented (c++) ?
I just need a proper chain of function calls.
What would that be ?
@bitter oriole you asking about the specifics?
it's a bone simulation switching, that should be visible to all players
Generally multicast is not a great idea
How about a client to server RPC and then a simple replicated state?
by state you mean repnotify for a property?
will OnRep_ function will be triggered on all clients when they are relevant?
i.e. to update the state
i'm new to network programming, i've read only about those methods
The important thing is to consider events, vs state
Multicasts are used to send one time-sensitive information that needs to be sent to all currently connected players, regardless of how far they are ; they won't be sent to a player connecting 2 seconds later
Replication is used to ensure the current state will be copied to other players eventually - new player or not. Maybe one minute later if the player is super far away or the bandwidth is low and this actor not super relevant for him.
OnRep is basically just a nice helper to tell the client "new replicated value ready", but it's perfectly possible for the server to set BoolValue from false to true, then from true to false a second later, and the client might never get any onrep
hm...i think onrep will work, as i don't need to know if it was in that state, i just need the current state
i havent read the above, but if you just need to know the state of a variable just replicate it?
Basically my point is that most of the time you should use replication
You can use OnRep if you don't have a tick
jss...i thought OnRep is mandatory for replication -_-
Nope
yep, i've checked the ACharacter source...as i have no other examples
It's just a way to call code when the value has changed
all replicated variables MUST be set on server only?
i.e. i need to call Server_ RPC and let it set the variable?
Yes
I use OnRep all over the place personally ๐
OnRep is called on clients or on server?
Clients
When they receive a value and it's different to what they currently have.
You can flag the property to call the OnRep whenever it's received though too, even if it matches the clients value.
how?
DOREPLIFETIME_CONDITION_NOTIFY(AHT_Ordnance, ReplicatedOrdnanceState, COND_None, REPNOTIFY_Always);
The server will still not send the property if it thinks the client already has that value though.
It's mainly useful when you might have a client messing with a replicated property too.
(Which you shouldn't really do most of the time)
thank you, i've used your example and found a docs page...
i managed to make my server visible to clients, but when i try to connect via open this message is logged - LogNet: UChannel::CleanUp: ChIndex == 0. Closing connection. [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: (ip):7777, Name: SteamNetConnection_11, Driver: PendingNetDriver SteamNetDriver_11, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID what does that mean?
i see it's making a reference to SteamNetDriver which i was told to disable with "bUseSteamNetworking=false" in DefaultEngine.ini in order to be able to connect to the server
Would anyone here have an idea why HasAuthority() is throwing an unhandled exception for me? It's happening in a common function that is called many times. For context, I'm trying to drop an item from inventory and have it spawn in the world as a new pickup. During the beginPlay phase this function gets called a lot, but only when I go to drop the item does this happen:
You called it on nullptr.
hi there. looking for some example code for using UListView from C++. if anyone is aware of a good example id be happy to learn of it.
@flint beacon in #multiplayer ?
thanks. my brain is just constantly in the MP space.
@bitter oriole you're right, I figured it out a few minutes later
I know root motion replication isn't officially supported, but can it be done? I've seen conflicting answers across the internet.
what's the best way to display the network's current bandwidth traffic in kbps?
I found these counters in stat net but I'm not sure how to interpret them
Hey does anyone have the Vivox sample project for the plugin? For some reason their samples are dead on their developer portal, and the documentation on Unreal is not very specific on any actual code implementation.
Yesterday I said that I'm making my own server on Java that can handle many players and I'm basically using UE4 as front-end. My only challenge was that I dont have the navigation data in my app, that I need for things such as AI movement and player position validation.
So I came up with a ridiculous idea: what if I run my whole map renderless on a server machine and connect it with my java app via tcp, then java app tells this program to spawn empty actors and move them around using navigation mesh? Voila, I now know all the places where bots can go, I can even skip the pathfinding.
What do you guys think about this idea? Is this valid plan or stupid, I want to hear honest opinion
skimming it, the whole thing in its entirety sounds like you're trying to save $1 by spending $2 to me, but that's about as much intelligent input as i've got
Why tho? Basically I only add a single socket connection to a ue4 project and in return i dont have to:
- think of a way to extract the navigation data
- implement pathfinding algorithm
@warped stream on reps do not get called on the server.
Oh, interesting. Okey thanks.
Anyone have a AI wander algorithm that doesn't look horrible? I'm debating on using steering behaviors for it, but haven't worked out the wall avoidance yet that will still support walking up ramps.
a good AI wandering approach is to go to places that are far away from the current position, preferably ones that the actor didnt visit before
you can do that by keeping a last-positions buffer, or better yet keep just the last position and use that to calculate a velocity
give preference to new positions that are aligned with the velocity normal
yeah the main issue I'm trying to solve right now is them wandering back and forth in corners or near doorways. And also not making drastic changes in direction very often.
hi can anyone tell me why my variable "PlayerOwnerRef" is null for all clients except server? Vector/Rotator/Struct passes by successfully. thanks
@unkempt tiger Would you use something other than GetRandomReachablePointInRadius then?
does gamemode own playercontroller?
oh that makes sense!!!
yeah it's a handy diagram
bookmarked
@jolly siren what are those black arrows?
Just standard pointers
why can't i pass a reference to pawn through multicast?
only server has the reference
to pawn actor
i might need to put in more thinking into how i do this
i feel it might be because im doing it via player controller
but references are local entities, isnt it?
You have a multicast on a PC?
oh they are arent they?
That alone doesn't make any sense
pc?
playercontroller
the networking of ue4 hasn't clicked for me yet
im trying to spawn a projectile for everyone and then delete it for the person who spawned it
PlayerController only exists on the server and the owning client
So a multicast on a PC doesn't make sense
ok, i get that now
the event wont fire for all clients except one and server
how can i determine which pawn is which over network?
will passing ref like that work?
is it true that when actors become non-net relevant, they basically destroy, and are recreated when becoming relevant again?
or is that not accurate
hmm okay, it's a little confusing to me because i can still see their character meshes when they become non-relevant
and when becoming relevant again they basically warp to their actual server location
just figured out my issue thanks to this reddit thread: https://www.reddit.com/r/unrealengine/comments/ajihnj/best_practise_for_replicated_actor_movement_with/
7 votes and 9 comments so far on Reddit
culprit was the "Net Load on Client" bool which is set to true by default for characters
trying to run the editor and in debug I get
[2020.05.23-01.56.32:250][ 0]LogAudioMixer: Display: Initializing Sound Submixes...
[2020.05.23-01.56.32:251][ 0]LogUObjectGlobals: BeginLoad(/Engine/EngineSounds/Submixes/MasterSubmixDefault) is flushing async loading
[2020.05.23-01.56.32:251][ 0]LogStreaming: Display: Flushing async loaders.
why would submixers be flushing?
If I remove my asset manager from the ini file
it runs
I get this
[2020.05.23-01.35.58:681][ 0]LogAudioMixer: Display: Initializing Sound Submixes...
[2020.05.23-01.35.58:683][ 0]LogAudioMixer: Display: Creating Master Submix 'MasterSubmixDefault'
[2020.05.23-01.35.58:683][ 0]LogAudioMixer: Display: Creating Master Submix 'MasterReverbSubmixDefault'
[2020.05.23-01.35.58:683][ 0]LogAudioMixer: Display: Creating Master Submix 'MasterEQSubmixDefault'
I dont understand why it would stall
@shrewd tinsel Typically the practice for creating projectiles is to make the weapon that's firing them do it. You do this by spawning a replicated weapon actor on the server and give it's ownership to a specific client. Because it's replicated, spawning it on the server will create it on all clients but only the client who owns it can call RPCs from it. This allows you to tell the client's version of that weapon that the player wants to fire. The client version of the weapon RPCs to the server version and the server version does checks to make sure it's able to fire, if can fire, multicast spawn projectile.
https://i.imgur.com/rCKgVrX.png
@shrewd tinsel Why do you have such nice edges there ? ๐ฎ
@warped stream Editor preferences, or plugins.
Hello guys. For widgets is better set it on the HUD or in the player controller with bool "is player local controlled!?".
@buoyant wedge Not really sure what you're asking. You... want to keep a bool somewhere that tells if the.. player? Is locally controlled? and use it in a widget?
@kindred widget no. I wanna know for display a widget to all player is better e to set the event on the HUD or in the player controller. I wanna just know the better implementation ๐
Ohhj thanks
Morning ๐ How do you guys handle loading screens? I feel like I'm hacking it right now - creating the screen on the 'BeginPlay' of the map I'm loading, which seems a bit dumb. But I don't know which other class to put the create and destroy widget on.
@warped stream ElectronicNodes plugin
@kindred widget thanks for explanation. doesn't that mean that player fires bullet after some milisecond delay after getting confirmation from the server?
Yeah it will be based on their ping
You can also predict the shot on the local client and only use the multicast for the remote clients
But it all needs some fixing at some point, cause your projectiles will never be aligned this way
It might be the easiest to spawn a replicated projectile on the server and let the projectile movement Component do the rest
In cpp you could set the Interpolated component of the movement component to the mesh of the projectile, then it should look smooth even when being correctly slightly
I'm having an issue with creating a session after you've been kicked from one (server disconnects). It works it the client leaves manually because I can run Destroy Session. But how do I handle being kicked? Where can I place the Destroy Session node?
@thin stratus do you think spawning an unreplicated visual representation of projectile for everyone locally is a bad idea?
i noticed replicated projectile movement is jerky
ummm what did the devs think when they changed the launching method in 4.25?? How am i now supposed to debug and see how server and client react to things
@shrewd tinsel it is jerky if you dont set the Interpolated component
@fleet viper ?
if i want to start the game i can only start on one side, only on server or client but not both at the same time or am i missing something?
@thin stratus
The settings support the same they did before
Offline starts every player disconnected
ListenServer makes rhe first player the host and the rest the clients
Dedicated server makes everyone a client and starts a dedicated server.
@thin stratus not on my machine
That is displaying wrong. That's all
ok good
anyone know whats a best-practice way of creating actors for each player controller, and set their owners to that of the player controller?
Creating said actor inside the construction script of a custom player controller class is optional, but feels cheesy
@unkempt tiger, is this for local co-op or network multiplayer?
network multiplayer
is there any way to give the client total authoritative control over my player's character movement? I want to put less priority on position hack prevention and not have the server freak out every time my player is like 1 inch off of where it's supposed to be. I just want to have smooth movement on the client without having to deal with prediction etc and have the server just accept my client's position.
@versed bear ClientAuthorativePosition = true with a high MaxPositionErrorSquared
hey guys there is possible to fire a function when a variable is changed? (without replication)
Call the function when you change the value of the variable? Not sure what you are getting at
@bronze arch Please only post the same question in one channel. And Zlo is correct, this isn't relevant to #multiplayer
I posted 20 min ago and none replied. so I thought it is not related for blueprint channel. thats why I also posted on here.
im not spammer so
about the question, i wanted to do like how does work onrep variable in multiplayer.
but the actor is not replicated so its authorized by owner
you make a Setter function for the variable
you set the value only from inside the setter
and call any additional logic you need
then you wrap the Arrays Add function in your custom Add
and do the exact same thing
or SetArrayElemeent in your custom Set
same principle applies, always
you also turn the array private so it errors out when you start adding stuff to it bypassing your function
Guys my "AddForceAtLocation" is not replicating, it is set as a function on the event tick
I have multicasted my move forward events too
and even set all variables to replicate and tested, but nope
its not making my car go forward on other clients
hey guys, new here, hopefully posting in the right category, do you guys have any good tutorial for dedicated servers in UE 4.25 ? It doesnt matter if it involves C++ or not
EDIT: Found some tutorials online, but they are for older versions and since i didnt keep up with the updates i'm going to assume they've changed some things.
Creating a Dedicated Server for Unreal Engine 4
Engine used: Unreal Engine 4.16.3
Simplest method :-)
Commands used:
Client
$UE4_ROOT/Engine/Build/BatchFiles/RunUAT.bat BuildCookRun -project="$GAME_UPROJECT" -nop4 -build -cook -compressed -stage -platform=Win64 -clientconfi...
and if you need the latest server target file, you can take it from Epic Games Shooter Game
Awesome, i'll take a look, thanks a lot ^_^.
Hi guys, testing default movement replication and you can cheat in it just by pressing "enable speedhack" in cheat engine. Whole system itself looks fine, but there are no client input checks and i cant understand where to add them. Maybe anyone done this before? Would appreciate help
You should take a look at how the cheat works, so that you can work on adding countermeasures
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor WB_GameState_C_2147481944 Does this make sense to anyone? I threw some logic onto the gamestate so it properly replicates, but now I'm getting "no owning connection" for my GameState. Am I doing something wrong?
Yeah it makes sense
You likely tried to call a RPC on server from the client, on an object not owned by that client
Which is not possible
So the game state exists on the clients, but is owned by the server
so I can't actually call an RPC on the game state from the client?
Well, for cheatengine's exact speedhack comparing severtime and clienttime would work, it wont help against clients that sending higher movementvalue than they should, so i must check that on the server every time they send it, but i cant find part where Value is transformed to the FVector_NetQuantize10, which is ServerMove() parameter
@unreal pine Correct, you need to call RPCs on player controller, player state, or pawn
Even from the pawn, I've got the same issue though. I've got an RPC set to execute on server only, but when I call it I get LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor OneShotCharacter_C_2147481033
(client-side)
Sounds like the character is not currently possessed
Word, appreciate the response. I'll make sure the character is possessed, and continue to run these warnings down ๐
I checked replicate movement, and still the add force at location isnt replicating to other clients
@bitter oriole What? are you sure?
The physics engine is not deterministic, so applying forces on clients is just going to make you end up with completely different scenes.
Checking "replicate movement" means the object will teleport to the server location a few times per second
None of this is going to give you a playable multiplayer vehicle. You need something more advanced than that
Thats really sad to know, I wish they could add such a simple feature.
Nothing simple about it really
such a basic necessity
Either check out one of the multiplayer vehicle kits on the marketplace, or take a look at this course here https://www.udemy.com/course/unrealmultiplayer/ that explains in depth how you'd create a basic vehicle movement.
This stuff is just not easy at all. The character movement component in UE4 is like 30,000 lines of C++, and a multiplayer vehicle is not that different. It's worse really since the velocities are so high.
If Unreal's Wheeled vehicle could have basic stuff like, surface detection etc, things would be so much better
but Nah
Find a game engine that has multiplayer vehicles, I guess. I don't know one, but....
I have to create a raycast vehicle from scratch, and i need to network replicate it
find another engine? aint nobody got time for that
Gotta do things the hard primal way here
...like making a car from scratch
Udemy course it is, then !
It'll explain how to add multiplayer to a game vehicle from scratch
I did that myself, though nowhere near as complex as a wheeled vehicle. Took a few months and it's working well now
wow these courses seems way overpriced. it's like $250 in my local currency. I guess knowledge is power...
They are 90% off half the time
... though honestly the course is very much worth that kind of money
that's good to hear, I'll bookmark this course in case I want to try it out.
hey guys, does anyone know if there is documentation on how Sets, Arrays, and Maps are replicated? (Are they copied over entirely when replicated or is it by key, index, etc.?)
@bitter oriole Torque is also a force movement of physics actors right?
@worthy knot Yes
Yeah so that can be replicated
force can be replicated
Syncs transforms Smoothly across the network.
Smooth Sync for Unreal: https://www.unrealengine.com/marketplace/smooth-sync
Great games that use Smooth Sync:
Ultimate Chicken Horse: https://www.cleverendeavourgames.com/ultimate-chicken-horse/
We Need to Go Deeper: http://www...
Check this
The rolling ball template used physics forces, and in the end of the video they showed that they smooth synced the template for MP
Well, go try it
@warped stream on reps do not get called on the server.
@chrome bay How do you explain this?
Maybe thats a blueprint thing
Yes, Blueprint fires OnRep on server too IIRC, contrary to C++ OnRep.
Well. Thank you
Do you put the creation of HUD and widgets onto the PlayerController?
Put it on HUD
still can't connect to my server. if anybody would like to help, pm me so i can link you the logs. it seems like the last thing i need to sort out before the game is shippable so i'd really appreciate it
I have been trying for months to get a multiplayer working on my VPS. :-(. At last I have found a start for a solution, so I decided to write a post about it. My experience is that there is a lot of info on multiplayer, but almost no info on how to get it working on a VPS? It looks like there is a big difference between a listenserver and a dedicated server. https://unreal.fluiddynamics.eu/multiplayer-on-windows-vps/
@bitter oriole so If I get this correctly. I'd create a HUD class and put any replicated BP code in there, that will tell each client to create any User Widgets. Is this correct?
@brazen wigeon Maybe my previous post is something for you
@stoic acorn HUD is not replicated, and only exists on the client. You should not try to replicate UI.
Not replicate HUD but to control what appears on the HUD. Where do you put that info?
If its pawn information like health etc, it's fine on the pawn
However, you have to make sure that you only update the HUD if its YOUR pawn
Blueprint is different and for some reason treats the OnRep callbacks differently to C++
Thanks yeah. I already got told that
Don't really know why they decided to do that tbh, I only ever use CPP for MP
@chrome bay Don't think you can manually call OnRep functions in BP. So they probably just made it simpler for BP peeps by just calling it for Server too.
@steady dirge thanks, but does VS2019 actually work? I've tried using it with the launcher build of UE (C++ Classes) and damn....it has a lot of errors that dont let me build
i'm assuming its gonna work for the source version but wanted to check
any custom settings tho' ?
Nope
for me it gives a lot of errors, works fine with 2017 tho
I use Visual Assist for the highlights, but there is no reason for compilation to fail
yep, installed that one as well
ive tried following some tutorials and i cant even #include from "Classes/etc", i need to include starting with "Engine/Classes/etc"
probably just missing the module dependency in your build cs
@woven lava send me a pm with your mail and ill send you the sample project
Has anybody found that actors that are marked as "Always Relevant" do not stay relevant for clients when they have a low net update frequency?
This only occurs with replication graph
Legacy driver doesn't have the issue. Even stranger, the actor replicates when I move near the world origin.. even though it's position is nowhere near the origin.
If the net update freq is 50Hz or higher, it works fine. Lower than that it stops working.
Rep graph is costing me hair lately..
"Legacy driver" ๐
I've been having weird issues with rep graph too, just turned it off until I can figure it out a bit better later on.
Messed up how my weapons replicate their states for reasons unknown
I've run into a lot of interesting edge cases it's not happy about lately.
Yeah, it seems fiddly.
Like you can add a 'Dependant' actor listing between a parent and child, but if the parent is added to the graph after the child, it silently fails to replicate because it doesn't setup the dependency properly
It's a pain in the arse when spawning one actor in the BeginPlay() of another
I'm dreading having to dive into the backend code to modify spatialisation eventually (need a 3D spatialisation scheme)
Because the child actors end up being added to rep graph before the parent because of the way SpawnActor() works.
That's good info to know tho! I feel like that one took some searching to figure out
You have no idea ๐
Learning a fair bit about how sensitive it is to spawn orders and stuff this week
And the dangers of calling SetReplicates() in a constructor
Legacy doesn't have an issue but Rep Graph is no happy
๐ฎ maybe that's my exact issue with the weapons
Yeah, whatever you do don't do it
Just set bReplicates= true; directly
does that still work in 4.24+? I had the compiler yelling at me about calling it directly when I upgraded
It does yeah (for actors anyway)
But if you call SetReplicates(), it successfully calls AddNetworkActor() in the constructor and routes it through rep graph before any of the serialized properties have been set
So it ends up being initialized with whatever the parent classes settings are
Think Epic are gonna add a warning for it now, though they should just skip AddNetworkActor() if it's running at construction time
May do a few PR's if they don't
Is there any way to find out a list of players on a world comp tile? Or do I need to implement a system? I was thinking a trigger box and an array of PC's but is there a built in system that I am overlooking?
How do I return ownership to server?
I can just clear the ownership? With set owner to null or so? (Because server can do stuff on it, I just want to clear the ownership from the client)
@brazen wigeon VS2019 and UE4.25.0 no problem at all.
When searching for sessions with QuerySettings such as SessionSearch->QuerySettings.Set(SETTING_GAMEMODE, InGM, EOnlineComparisonOp::Equals);
Does the SearchResults returned filter out any sessions that don't meet that QuerySetting? So in this case only a specific gamemode would return
It doesn't look like it filters by default and instead you must do something like:
FString QueryGM;
SessionSearch->QuerySettings.Get(SETTING_GAMEMODE, QueryGM);
FString FoundGM;
CurrentSearchResult.Session.SessionSettings.Get(SETTING_GAMEMODE, FoundGM);
FString QueryCustomCondition;
if (QueryGM == FoundGM)
{
// Join session
}
Though I'm probably doing something wrong as it seems it really should filter as otherwise you could get 20 garbage search results that are on the wrong GM and you couldn't join even if there were valid games elsewhere
Maybe this is because I'm using the null subsystem and testing on my local machine with multiple instances?
Otherwise you'd always get 20 random results that could have terrible ping, the wrong GM and more which would defeat the purpose of setting the queries in the first place
For a replicated array, when the server makes a change that affects just a single element in the array (such as modifying, adding, removing), what gets sent over the network? (a) just that single affected element, or (b) the entire array?
What is the correct way to change a material instance being used in a cascade emitter so that all clients will see it, without a warning?
attached to actor's begin play
the update
the warning
it does work, but I know im doing something wrong due to the warning
Anyone know if it's possible to replicate a timer handle without just calling a second timer with another new variable?
Initial function is called on server.
Tried doing this.
Did not replicate to client properly. Timer was basically null
To those saying physics cant be replicated, the rolling ball template uses AddTorqueInRadians and it certainly got replicated with the SmoothSyncPlugin
Not sure why anyone would say physics can't be replicated?
@foggy hinge Exactly like what even? I mean i tried to use AddForce at location to test in multiplayer that didnt work, but I am testing the AddTorqueInRadians on the rolling template and its most certainly working
^ At this point im not even sure if this is a hoax or truth, need some admins to answer this for me
Guess that person is wrong.
there were like 3 people telling me this
So the nuance is that ideally what you do is simulate the physics on the server and then replicate the results to the client.
