#multiplayer
1 messages Β· Page 608 of 1
if I need 4 clients I just run a client test .bat file 4 times
(by "clients" I mean processes since I don't really have clients per se)
your C# class LargeFleetTest sets up the ClientRole / Config for how to run your game build and then Gauntlet spawns the Horu.exe then when the exe exits Gauntlet collects the results
but how does the game instance actually know it is supposed to be running a test?
sorry I know I'm not explaining this well!
like, running this spawns an instance of my game via Gauntlet, but it just sits there not doing anything until I exit
RunUAT.bat RunUnreal -project="MyProject.uproject" -build=local -test=DefaultTest -numclients=1
I mean you have a gauntlet controller and you set which gauntlet ctrl you want via your automation.cs
if that's what you're asking
ah... I see
hmh did you go through my gauntlet tutorial?
yes.. but I can't use source build so I get stuck at the bit where I need to create a custom C# class
I was actually going to ask how you've managed to use gauntlet in a launcher build
there's a built in DefaultClass which almost works
it spawns game instances, passes cmd line through etc
but I cannot specify a custom controller
what ctrl is it trying to use
it doesn't set one, so whatever the default is
where's this class
Engine\Source\Programs\AutomationTool\Gauntlet\Unreal\Game\UE4Game.DefaultNode.cs
Yo just curious do any of you guys know any services that I can host a dedicated server on Iβve tried listen servers and steam and for whatever reason clients canβt connect to each other via steam and it makes it hard for me to develop and fix bugs in my game any suggestions?
AWS works ok, but any cloud host should be fine
as far as I can tell you're out of luck since ugauntlettestcontroller leaves its virtual void OnInit() {} empty
so you can't tell the base class what to do since you can't override its oninit
defaultnode.cs must be spawning this ctrl since I can't find anything else
ah you've led me onto somethjing here...
This is from the top of GauntletTestController.h
* Base class for games to implement test controllers that use the Gauntlet native
* framework. This is a very thin class that is created automatically based on
* command line params (-gauntlet=MyControllerName) and provides easily overridden
* functions that represent state changes and ticking
so maybe I can override the controller via cmd line
yeah but the key there is overriden
well yes, but the engine won't find your ctrl class unless it's in the engine :)
unless you maybe symlink it or something...
you could try that
iirc that's the reason you need engine source
the C++ side is fine - it's the C# bit you need the engine source for I think
try it, let me know if it works
I will, thanks for your help π
I was about to go to bed but now I need to know π
hehe
sweet - it totally works π
well launching my game with -gauntlet=MyController argument works... not sure how to make Gauntlet actually pass that through though...
one step forward anyway
only 99 more to go
Do games with dedicated servers get away with not ticking or refreshing anim bones on dedicated server? I'm finding that this is hard to do, since anim bone data sometimes used for positional stuff, ie where bullets fire from
for fastarray replication, if i change two properties of one of the item structs, will both properties guaranteed be changed when PostReplicatedChange fires on the client? or does it fire per property?
i assume it just fires after the whole struct is updated because that makes sense in my head but i wanted to double check, its been a while since i worked on my game
Riot games has an article partially about this for valorant, actually. They do run animation fully on the dedicated server (since it's required for accurate hit detection), but they turn it off at specific points during the game when it doesn't matter (before/after rounds).
Doesn't help with a single instance, but it does help in their case where they run multiple instances per server (so amortized performance cost is way better, even if it doesn't help in a single game)
There are some details here: https://technology.riotgames.com/news/valorants-128-tick-servers
Thanks siliex, yeah, hoping to do multiple instance servers..just scared of the costs
Definitely take a look at what they've done then. Valorant is a good example of scaling with a game that has very high server performance requirements.
yea looks like a great article, man 128 tick is fasttt
iirc one thing to note is that they avoid using replicated variables because they're more expensive than manually calling an RPC (the engine has to scan for changes to replicated variables, which gets expensive in a game running that fast)... except when they built valorant the newer push model for replicated variables didn't exist, so using RPCs for everything isn't really necessary anymore.
ah, I didn't even realize valorant was built off unreal
Yeah use Push Model if you can.
The great thing about Push Model is its completely opt in.
You can convert to Push Model over time as well.
One property at a time lol
If you want
@cosmic trail fortnite on the other hand run no animations on the server
and get hit data for weapons from client
and server does some verifications
Some interesting choices in there. Particularly using RPC's instead of properties for state replication.
Something they only had to do because push model didn't exist at the time π
I'd rather invent it I think π
But, I guess since they have an incredibly tight set of rules and handling of players for the game, it's easier for them to handle edge cases
is push model need 4.25?
I think that's when it was added, yeah
ah shoot ok, I will have to update, it's a further upgrade to using the replication graph that fortnite was using?
Also lol:
ShooterGameServer
they're distinct things, you can use both
Telling yah, every UE4 FPS is powered by that template
pretty sure valorant's client executable is ShooterGame.exe or something
they never renamed the project lol
Haha even we renamed ours π
lol
Always funny to see though
That article was nice, even talked about cores and caching, which seemed to affect performance a ton
yeah, it's a great article. Though you don't need to pay attention to everything because most games aren't running 128 tick at that scale
It's an interesting glimpse into their approach, though I don't think their solutions are widely applicable
But if you're building something with a very well-defined loop like that game has, it's probably ok
@meager spade because most things are behavior driven in my game(RTS), and behaviors actually only run on the server, don't think I'll be able to take the same approach as fortnite
Once you scale up to RTS/Fortnite numbers you've got to strip back everything you can. Running animations server-side is a fruitless effort at that stage
tell me... I'm digging to find a pair-to-pair update frequency solution
without doing weird stuff
it's just intuitive, but not there
@chrome bay Ok, there's probably stuff I can do, like have the client take ownership of where a particle spawns instead of the server to eliminate animations, and making line of sight not use animation data
sounds like in the end we shouldn't do server animations as much as possible, and any trade off would be worth.
for a rts? you should absolutely not!
@pallid mesa Since it's an RTS I can force things, LOS is mostly used for target acquisition and whether or not they can be fired upon from cover
must not server animate right?
Yeah LOS isn't worth it IMO, causes more problems than it solves.
Plus since LOS changes so often, it can end up costing more as you open/close actor channels more frequently
I do use precomputed visbility net culling for my racing game, but it's very contextual
Using stuff like replication graph is where you'll start to claw back server CPU time
Combine with the newer push-model stuff (which could be better but it's a start), and you're away
yeah I've enabled that, helped a bit(rep graph). My LOS has been modified a lot to be pretty loose
one thing that possibly might work if you do want LOS culling is leaving some room outside the LOS area where pawns are still relevant
like a grid
but still... if you can move the camera fast... not a very good idea
ah are you talking about a fog of war line of sight? I'm talking about shooting line of sight sorry
oh I thought you were speaking about the literal frustrum
my bad then, you might need to explain what shooting means in your context
My fog of war line of sight is grid based, well the RTS LOS would be about what units you have out there able to see what other units
For shooting LOS it's really not worth it
^
You should profile it ofc, but 8/10 times, we found it increased bandwidth not decreased
That's in the context of an FPS
Yeah
Actually James, do you know if there is any way to do pair-to-pair net update frequency adjustments?
Not sure what you mean by that?
the same way that IsNetRelevantFor exists where you can adjust relevancy between a pair of actors
Oh I see, no there's no way to do with with frequency
I would like to adjust the netupdatefrequency between a pair of actors
But also if you're using replication graph, frequency can't be changed at runtime anyway
with the "standard" net driver you can just have a manager object that sets frequencies arbitrarily
But to be honest aside from pawns and vehicles, all the actors in our game have an update frequency of 1hz
And we just call ForceNetUpdate() when we change properties
this is for vehicles
I would like distant ones from the viewer to run at a reduced frequency
while I keep them relevant
Oh well rep graph will sort of do that anyway
If you're starting to saturate, actors that are closer will have higher starvation priority
will take a look! thanks!
@chrome bay So the way the cover system works is there are 4 shooting spots(lean left, right, pop up, straight). Before a weapon burst, just ray cast to see which ones can hit the target, then play the appropriate lean/pop out anims to shoot. Not using it every repeated fire, just the first part of a weapon burst. I'm not going to calculate shooting LOS for each actual tracer/bullet. So it comes down to 4 ray casts to determine if the target is still valid for this burst, I can replicate that the burst can proceed, and do the projectile start on the client(for it to spawn on the gun muzzle), with the projectile end being replicated down. That's kind of the idea right now, don't think that's too intensive?
I would test it in a "real world" environment with the right number of players and some variable packet loss/latency between them
The real issue is with pop-in
But also, in something like an FPS, if a player is occluded they might still be relevant to the player, e.g. footstep sounds, interacting with something else etc.
maybe some way to interpolate it more client side during the initial life of the projectile while lerping it more server after?
It becomes a bit of a minefield
I haven't been following along tbh so it's hard to say
oh ok no I think u mean pop in fog of war?
Oh well in a fog of war scenario it probably makes sense yeah
I've got that part solved with a grid based system, not actual Los to collision boxes for that
It's also a good anti-cheat, in that if an object concealed by fog-of-war isn't being replicated to a client, then they can't use a client-side hack that reveals it
But yeah in a fog-of-war like setting, then network culling does make some sense
But obviously you'll want some buffer room to allow for latency and avoid things popping in too late.
Yeah, can't quite make it anti map hack proof but it'll be better than replicating everything performance wise or hack wise
yeap for fow is a great idea
for frustrum view not so great, but yeah the buffering is relevant
yeah I was thinking in context of a frustrum/FPS game or something
now the LOS issue with the traces - I didnt really understand it, what do you want to do exactly?
ah it's like in company of heroes, you can take cover. But they don't actually calculate LOS for if they can hit the enemy. I am because if I don't, sometimes they will shoot through walls, I have to make sure they shoot from the correct side of a wall(left side or right side) if they're behind a wall
Think of it like a cover based FPS game, where ur moving ur infantry from cover to cover, but it's an RTS and you're controlling these units and which cover point they move to
mhm... okay
so right now I have the animation determine where to shoot from, so it syncs up, but I think I'm going to make it just fixed points relative to the cover normal direction
that way I don't have to calculate animations
but I still have to lerp the client side projectile spawn on the gun muzzle with the target end point, instead of a server side projectile spawn location(which will not look visually correct since I won't be calculating animation)
well
yeah all of that can run solely in the client
the server doesnt have to simulate the projectile
some projectiles are actual balls u can avoid though π
it's just the spawn point won't be good if server spawns it not on the gun's muzzle
yeah, so will probably just spawn it on client initially and then let replication do its thing after
oh I see what you are saying
hahaha yeah... well this is a tricky one
so you can have the projectiles spawn somewhere not depending on the weapon anim, but have the visuals in the client to convey
yeah, has to be a lerp while it's not fully synced
but I can manage that, vs. what you guys are saying it's not a good idea to run anims on the server at scale
yes the visuals will need to lerp wherever the real projectile is at
its tricky, however, it's been done before
overwatch and (iirc) UT among others
however context is different
(prediction!)
ah I see, yeah
thanks for all your inputs, learned a lot more about the networking stuff today
Hey all. Was trying to figure something out. So I have a character class and I want only the server to execute some function that takes the characters current position as a parameter when that property is replicated. How do I go about doing that?
Right now, I'm trying to call that function in an override GetLifeTimeReplicatedProps() for the character class. Is that the right place to do so?
Replicated properties can define an "OnRep" function to be called when their value changes.
It can be declared as such
UPROPERTY(ReplicatedUsing = "OnRep_MyReplicatedFloat")
float MyReplicatedFloat;
UFUNCTION()
void OnRep_MyReplicatedFloat();
When the value of MyReplicatedFloat changes, the OnRep_MyReplicatedFloat() function will be called on Clients automatically for you.
GetLifetimeReplicatedProps() is not meant to contain code other than DOREPLIFETIME() macros
Ahh ok. Thanks!! That makes sense! Didn't realize its just for DOREPLIFETIME() macros.
how would I designate a Replicated property if its an inherited value though? Like in my case I want to do it when the character has moved.
Location (especially for Characters) is updated pretty much every frame, so you can assume whatever value you get on any given frame is the most up to date.
There are functions for this however.
AActor::PostNetReceiveLocationAndRotation()
AActor::PostNetReceiveVelocity(const FVector& NewVelocity)
These can be overridden
They are called when their values change.
They are only called on the Client though.
Ok perfect! I think I figured out what I can do now. Thanks so much!
π
Could I call a override client function like AActor::PostNetReceiveLocationAndRotation() that calls a server RPC to make the server execute the function it needs to?
You dont call PostNetReceiveLocationAndRotation yourself, its called by the Engine.
You can do whatever you like.
If you want to call an RPC inside that function sure, go for it.
But keep in mind, that function maybe called every frame, you may not want to call the RPC every frame.
Makes sense. Thanks.
Had another question..so I have a UGameInstanceSubsystem that loads a resource during initialization. Is it possible to have a subsystem that only initializes on the server? Only the server will need the resource
has anyone been experimenting with the network prediction plugin? if so, how are you finding it?
How would i setup the C++ EOS Free Plugin i have the steps and the documentation but it seems like the C++ classes are not getting recognized even after succesfully renaming them
and if i do have to pay for it to get it working are there any other free solutions for hosting my game online for players around the world to join for testing reasons only i find it pretty hard to fix the replication issues when i only have one desktop to test on
EOS doesn't give you servers, you can have p2p connections but that's it
also since this is a third party plugin you would have to reach out to the author
ok that leads to my second question is there any other services aka online subsystems out there other than steam that people can join each other with to test
with OnlineSubsystemNull you can just use direct IP connection anyway
because atm with steam you cant even find valid sessions half the time due to the fact that spacewar steam id is region locked from what i heard
Anybody knows how to create multiplayer swimming?
@summer tide It should pretty much work the same way as walking?
Oh yeah, what really is the NULL OSS? I know it has basic support for local matchmaking, but I'm not really sure what else and why
it doesn't do matchmaking
@kindred widget I did it this way. It works but when multiplayer are swimming the water volume leaves the other players. https://gyazo.com/d849c91a44a5836baaedb402ffcfd918
it's not an online service, thus "NULL"
Oh, that was a misunderstanding then
@summer tide What I mean is, is that the movement modes and animations should all switch per instance, per machine without any extra networking. A client runs off a cliff, they fall into a water volume. This happens a little slower on client2 due to lag. Client 1 hits water, starts playing swimming animation locally and switches it's movement mode to swimming. Client2 sees client1's character hit water, client2 starts playing swimming animations for client1's character locally based on locally attained values and switches it's movement mode locally in that character's local CMC. This should all be driven off of the CMC's movement mode rather than overlaps. It's designed to recognize the character being in a physics volume meant for water and switch to swimming when it's deep enough in that voume.
@kindred widget Sorry I forgot to mention that I don't want to place physics volume in my level, since I've river and ocean. That's why I was using char movement's physics volume.
You could likely set the river spline up to attach physics volumes to it, the ocean could be blocked out easily. But beyond that you'd just do it the same way. Each client just simulates where the character is on their own. At most you might create a replicated enum for SkipOwner and force other clients other than the owner to set the character's movement as that when it replicates and replicate it when the server changes, but that could also get messy since CMC is supposed to largely simulate locally. So if Client1 moves into something and triggers it's overlap, it should end up doing the exact same thing on client2 just with a slight lag.
IMO, it sounds more like a level design consideration more than a gameplay programming one. Since the work for swimming is already done, seems odd to override it when the tools are already there.
anyone know why my players are teleported when the game feels like it? sometimes they teleport sometimes they do not and im unsure why lol
it never tells me the cast failed so im assuming it doesnt fail it also doesnt return true or false or teleport the player either so im a bit stumped as to why when a player doesnt teleport it doesnt say anything and just removes the widget
@cold chasm Is this for letting a client click a button to teleport their character?
yeah, it works a majority of the time but other times not
all standalone connecting to the host
Kind of an odd way to go about it. Why not just get the local character, and call the RPC on that? You don't need the inputs for the RPC either, since that information is easily available on the server from the same character via self and GetController->CastToPlayerController
PlayerArray has no guarantee of order whatsoever
its not replicated, so PlayerStates will be in order in which PlayerState Actors replicated to client
idk this is my first multiplayer project and so its all really new to me xD
but ill take a look thanks π
How can I replicate this jump? https://gyazo.com/890163ecb854faed5a048cca480e71f0
Is there function to kick player via UniqueNetId during AGameMode::PreLoggin? The KickPlayer function in GameSession requires APlayerController.
Make a reliable server RPC if you need jum z vel to change, and Jump can be call normally without Server RPC
THis is in my horse BP which is controlled by the player. So I do server event from player to riding component. From riding comp use an interface to horse BP.
If I add that piece of code to a server event., Server sees the horse jump but client doesn't
Jumping is already replicated, check if replicates movement is set on horse, also set ownership,
well the horse jumps and everybody sees the horse jump but the clients don't see the anims
Anims StateMachine can use replicated variable to appear on client, or in this case you can use isFalling to drive the anim, is the jump anim montage or state machine?
Out of curiosity, why aren't you just possessing the horse for the player, and attaching their normal pawn to the horse, and then repossessing the normal pawn when leaving the horse?
This would allow you to call server RPCs and use input directly in the horse without any extra complexity from rerouting the input from their character to the horse.
I fixed it. It was working before. Thanks to git.
if I place a replicated BP Actor in the level and set its bNetLoadOnClient to false. when the actor becomes relevant it will be spawned for the client yea ?
and the default CDO will be the one placed on level not the BP yea ? I mean location should not be replicated right ?
I feel some lag since I changed my door, lootbox, .. to bNetLoadOnClient false
location will match as instructions to spawn an actor include a transform
and it will be of the same class as the actor on the server, and definitely won't be the CDO
so it wont be like normal ->SpawnActor ?
if properties are equal with the one I placed in level they wont replicate ?
it will be, but all replicated members will be set before BeginPlay
to match the servers
damn that sucks, its statically placed why it should replicate transform and lots of other properties
Because it's a new actor
there is no benefit to replicated and NetLoadOnClient being false
quite the opposite, if you leave its relevancy and return it will be spawned anew
Hi! Dynamic material instances are local, right? Should I be creating them on the clients for every material that needs it?
They are local only yeah
Anyone here successfully done server side RVO avoidance?
l want when my player press ready button add +1 and when he preess it again to remove -1 how can l cast it to gamemode and when it reach 5 with ready teleport
failed at hiding your among us code π
What would be the high level implementation of multiplayer level design that could be saved and played?
Well mostly you need save data that's a nice USTRUCT you can copy around
I c just like saving and loading struct data
you mean like user generated levels? players placing buildings etc?
Good morning. I'm looking for advice on replicating attachments.
I'd like to spawn an actor which itself will spawn an actor on BeginPlay. I want to immediately attach the second actor to the first and have this replicate properly.
Is this a difficult arrangement to accomplish and are there any pitfalls I could avoid?
Cheers.
@silent valley Yes small levels
there's nothing built in but there's a few plugins that offer this kind of system
the devil is in the details though, does it need to support multiplayer, durability, do you have a resource system it needs to hook into, etcetc
@waxen socket All you need to do is call attachement on the server, assuming that both of these objects are replicated, it will update that on all clients.
Thanks for your reply. There's isn't a race condition I need to be wary of?
Both actors are replicated, and you're spawning them both on the server to replicate to clients?
Yes, but one is spawning the other and then attaching it to itself. I thought that might cause a race condition if say, the second actor hasn't had time to replicate by the time it's told to attach.
As long as you're doing it all on the server, there's no race condition to be worried about.
Make sure the actor that is being attached replicates movement
Just sounds too good to be true... but I trust you guys. I'll give it a whirl.
It's because it's driven through RepNotify callbacks
Do you have to replicate it's movement? I thought attaching it to the other actor would use that other actor's hierarchy for movement?
Attachment replication is done via replicated movement
Oh actually, looks like it replicates attachments regardless
So you don't even need that
See AActor::GatherCurrentMovement()
I was about to go looking at my weapons again, I didn't remember setting replicates movement on them, haha.
Well weapons I attach locally personally but yeah, you don't need to check it for that by the looks of it
The actor type that I'm attaching has replicated movement enabled by default. Should I bother to turn it off in this case?
If the actor never moves then you can disable it yeah
Replication conditions happen on the CDO, right? And it's more or less not possible to change that for say a single instance of something. So the only way to change a replication condition is a subclass of the object?
You can use DOREPLIFETIME_CONDITION_NOTIFY to dynamically adjust replication conditions per instance
I think... something like that anyway
we do it in our code but I can't find it right now...!
I'm not finding much on that, but that looks like a specifier for whether or not to call a notify function?
Conditions are always from the CDO
To be more clear, I'm trying to redo my inventory system. I have this on a component, and it feels odd to create an entire subclass over something as simple as setting it to replicate to all, or replicate to only the client owner.
No choice unfortunately
Moo.
You can disable/enable a property at runtime with PreReplication but that's all you get at runtime
GetLifetimeReplicatedProps is only ever called on the class-default object
I'll just subclass it, thankfully it's only for one class but I'll worry about that a little later. That actually does remind me though. Do FastArrays replication follow the same protocol for replication conditions? Such as setting it for owner only, I just specify that in the same way I would a normal TArray?
yeah
I believe you have to add a definition to the build.cs like WITH_PUSH_MODEL 1 or something
Otherwise it's disabled. But it might require a source build to use... I can't remember
Ah that was it
Add "NetCore" to your build.cs
and add bWithPushModel = true to your Target.cs
tbh though Epic says it only provides "marginal benefit at best" so... y'know π
orly
Hi Guys is anyone working with Playfab i have a question for him ?
Client can request spawning of some actor on the server.
Can I use const TSoftClassPtr<AActor>& spawnClass to indicate what Actor client wants to spawn? The server can reject it, so I thought TSoftClassPtr would be better than straight out UClass* to prevent it being loaded into memory if not needed
UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation) void SpawnActorServer(const TSoftClassPtr<ABuildingPartBase>& spawnClass);
Yep that's fine
Just bear in mind it will pass the full path of the class everytime
If the class is already loaded and has been used over the network, it might already have a NetGUID assigned
to save the bandwidth, you could pass uint8 and do branching on server...
or you could have different function for different spawn class type
@odd iron I have explored a bit.
Last Devil have you tried to Use A RegisterGame and Try to make the players joining ? @rich ridge
i want the BuildId of the Server and i dont know how to integrate the GSDK its have alot of Errors while compiling\
nope, i didn't go in session side of playfab.
how far you went
GSDK-> Gamelift SDK?
GSDK of Playfab
i only explored leaderboard, player auth, achievements
ah nice
its cool btw
i want to make a server that all platforms can join
Dedicated one
i would have explored more, but in free tier they only allowed to run 20 hours of dedicated server, so after knowing that I stopped
i can't test my game in 20 hours per month limit
Host the Server on any machine and use node " Register Game "
Yes i read about that but idk
for example in free tier you can max have 300 leaderboards
there is no friend invite system in playfab
Interesting, so it might be less bandwidth intensive to use just UClass* ? TSoftClassPtr can be quite lenghty
Party ?
i dont know about that
Yes you have that Service you Can use Party or Group system but party have Voice and Chat ability
@split siren yeah it depends, soft class ptr will always serialize to the path name
Whereas an already-acked UClass will serialize to a netguid
(path name until acked)
But like LAST_DEVIL says if you have a fixed list of objects that can be passed to that function, you could ID them some other way using an array index into a data LUT or something
@odd iron Playfab trying to replicate the features from GameSparks
but its cheap i think @rich ridge
Gamesaprks also used to be damm cheap and feature rich before amazon ruined it
@chrome bay True, table is the way to go, I was mainly curious how bad of an idea would it be to pass soft ptr. Thank you ALL!
amazon trying to introduce per MAU billing model in Gamesparks
yes 0.008$ i think for Standard Plan
and after increasing the pricing they have put throttling limit on resources like cloud-code (10 second execution limit)
eh i dont like it
so i m completely relying on Epic for my backend
they told me but there is not BP Plugin i think
the plugin work is in under development, but they didn't decline they wont add bp support, but they didn't confirm either
as per my understanding bp support will require OSS re-write
and I don't think epic will do that
well my knowledge in this subject is limited
but if found a solution for the Playfab i will use it till Epic Do something
OSS classes are neither UStructs nor UObject
There's already an OSS plugin for EOS services
that's not official right?
and there is indeed a plugin with BP support on marketplace
It's not official
Plugin support BP for EOS ?
that plugin is not specific to EOS, it is for OSS
wait, there is EOS plugin as well
no they made quite a progress
even they added support for consoles in that EOS plugin
but advanced session can't be used for mobile or Consoles right ?
if i can i will end the problem of Playfab
AS simply exposes OSS to Blueprint.
Whatever OSS you are using on mobile and console, if any, should work
yes it can
That's completely irrelevant to advanced sessions really
then i can register an Advanced Session into the Playfab Legacy Servers
but EOS plugin from master branch require some extra effort to make it work on Android
I have EOS-Samples ported to Android and it works
so i didn't had to write much code
I will see advanced session after dinner
In multiplayer, prior loading a level, should I create the loading widget in controller? I've tried that but the timing is different, i see the server loading screen on time but the client sees the level for a few seconds then the loading screen appears which is wrong. Also the remove all widget works fine in server to remove the menus but client still sees them until the level is loaded. What's wrong?
I've been trying to make my replicated FloatingPawnMovement work, but for some reason CubicInterp is not working as intended. I've managed to store "old" and "new" data between server updates and looking for alternatives to CubicInterp to "smooth" the movement. Any ideas?
FMath::Lerp also not working very well, it hitches/jitters a lot
Is anyone working on a multiplayer game using the Steam subsystem? Can anyone confirm that adding a custom session setting makes the session invisible for searches? (which means that the Steam OSS is broken)
I'm using a blueprint session based listen server looking for the best way to completely shutdown session for all players, simply destroying session and opening new level doesn't seem to do the trick, is there a way to this w/ out c++
Question about FastArrays, how does sorting them on client side work? Will this affect the array's ability to update? I know that indexes are not guaranteed to be in the same order on all machines, so I assume that changing their order on each machine shouldn't have any impact. What about changing a value locally? How does that affect anything? More or less trying to understand how a client updates it's local array with the delta sent from the server so I can avoid breaking it.
@kindred widget Ideally I won't mutate any replicatable variable.. I would make a shallow copy of that array and then mutate it
Hmm. I suppose I can. I try to avoid copying data where I can. But eh.
this is kind of a generic question, but is it typically better to have a bunch of replicated UObjects managed by a component (i need the component as a central place to find these objects), or to have a FastArray in the component that contains the data needed to independently spawn those UObjects (non-replicated) on the client and update them?
the second one is less intuitive but i don't know if it makes a difference in terms of networking load or anything
I found this message through a search for "turn in place jitter". I'm curious if you are having the same issue as me.
When my character's yaw changes during TIP, his hands and weapons jitter left and right. I haven't been able to figure out why
It's a slight jitter, but very annoying. My TIP system uses root bone rotation
Turning place should be completely client-side right?
Yeah
The jitter occurs offline as well
I store the yaw offest every frame by the difference in actor rotation change, and I use that yawoffest for rotating the root bone and rotating the player spine (instead of using an aim offset)
I have a feeling that the issue is relating to using the spine rotation instead of an aim offset
It only jitters during the actual TIP though
i have not looked into it for a while
but we use it in TRS2, and we don't have that jitter
@lucid vault https://www.thegames.dev/snaps/sQHvIIffgU.mp4
Is that using spine rotation?
Yeah, that's what I am doing as well
I was more so talking about the way in which you rotate the upper body
Notice the minor stutter at the end. That's a listen server
The same variable that I use to rotate the root bone (YawOffset) is used to rotate my spine horizontally
I'm curious as to whether converting my animBP to c++ may help the issue. I've tried pretty much every option except that
I have a strange problem, I'm not sure specific to multiplayer / steam, but I create a game w/ MenuMode & MenuPlayerController. When I start a game, I go to GameplayMode & GameplayController. For start I dropped my menu create/display into MenuPlayerController EventBeginPlay, but when I create a hosted game, that menu is being re-created. I put string prints into the EventBeginPlay of MenuPlayerController & GameplayController, and when I create a game and load a map set to GameplayMode, both are firing. Any possible explanation why two controllers would be firing?
Anyone that is using 4.25 having trouble with level transfer on multiplayer?
I am getting the following error:
[2021.01.12-21.21.44:287][844]LogWindows: Error: === Critical error: ===
[2021.01.12-21.21.44:288][844]LogWindows: Error:
[2021.01.12-21.21.44:288][844]LogWindows: Error: Fatal error!
[2021.01.12-21.21.44:288][844]LogWindows: Error:
[2021.01.12-21.21.44:288][844]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x1023bb00
[2021.01.12-21.21.44:288][844]LogWindows: Error:
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x000001be1023bb00 UnknownFunction []
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x00007ffda3f76347 UE4Editor-OnlineSubsystemUtils.dll!UIpNetDriver::~UIpNetDriver() []
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x00007ffda3e0ce0b UE4Editor-OnlineSubsystemEpic.dll!UNetDriverEOS::`vector deleting destructor'() []
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x00007ffdc34788da UE4Editor-CoreUObject.dll!FAsyncPurge::TickDestroyObjects() [D:\Github\UnrealEngine-Custom\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:308]
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x00007ffdc34374dd UE4Editor-CoreUObject.dll!IncrementalDestroyGarbage() [D:\Github\UnrealEngine-Custom\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:1689]
[2021.01.12-21.21.44:288][844]LogWindows: Error: [Callstack] 0x00007ffdc3437a33 UE4Editor-CoreUObject.dll!IncrementalPurgeGarbage()
Hello ! I'm new to multiplayer and I have an issue :
- I'm trying to make an RTS, I have my a RTS_PlayerController controlling a RTS_CameraPawn
- I try to make multiplayer with 1 client 1 listenserver (I assumed that was how to do hosting (?))
- What happen is, server start, spawn a controller, possess the pawn every cool
- Then the client join, the server spawn a controller, a pawn, but he does not possess it because, ON SERVER, when I do GetControlledPawn so set a variable, it returns null
- It generate some error because I trying to use this pawn in my movements
- Then after a second or two, the client spawn his controller and pawn, he does possess it, and error stops (why ?? the server variable is still set to null so .. ? maybe has to do with input not called ?)
Does anyone know why ? I struggling a bit finding on google wtf is going on and / or a good tutorial on playerController and networking in general
Thanks
Hi all! I am currently trying to get my university team projects game working with steam and dedicated servers, however for whatever reason, when testing it on my pc, the join node returns success but it doesnt seem to even join the session, furthermore, my server wont show up in steams server internet tab, even though my ports are forwarded.
Any idea on why this is? any help greatly appreciated!
hey @lilac raven are you sure it's not joining, or is it that your editor menu isn't updating?
well, I dont have a server search like many tutorials show, im simply grabbing the first server and connecting, it does load my ui as its on join node success but the level doesnt change it just stays the same. But even with multiple players it wont show the other player, I even have a check network players to load game with more than one player, but it doesnt even load suggesting no players are connected. Previously I used open IP and it worked fine.
It joins (or so it says) then soon after it reloads the game for clients
server log shows nothing
But you in editor mode or standalone?
ah right. Yeah I had dramas with that too
My advice is do a server build that you can run locally
Test it that way. It's a pain but you'll get proper behaviour IMO
Yeah, my issue came up when doing a playtest day yesterday for my uni, I had to basically hard code it to connect to the server hosted on my second machine. Ideally id use sessions system for better features and have them use some sort of account (steam in this case) and its corresponding matchmaking service. Heavily considering purchasing the EOS Core plugin and using EOS as i have it set up on my account
Biggest ballache of my life tbh π
Yeah I hear horror stories
I'm a web dev though so maybe it's not so bad for the online service shit
but that whole steam thing seems like a farce
I'll be leaning hard into plugins me thinks
Yeah I just bought the eos core plugin, it worked right off the bat
should be perfect for me and my team!
Hey all. Is it possible to have a Game Instance Subsystem that only initializes on the server?
ya
override virtual bool ShouldCreateSubsystem(UObject* Outer) const { return true; } and do bool UMySubsystem::ShouldCreateSubsystem(UObject* Outer) { #if WITH_SERVER_CODE return true; #endif return false; }
something like that
only for dedicated servers tho
wow. Thanks! If its only for dedicated, would I still be able to test if I play as Listen Server?
ok sounds good. Thanks so much for the help!
a pretty noob question but I forgot on this one: when playing PIE in Multiplayer mode with editor as listen server, the client pawn doesn't get a controller. Does anyone know why?
If I turn debugger on, it says that the pawn has no controller
but the world outliner shows both pawns and both ctlrs
WITH_SERVER_CODE includes a game (not client) target
you can use UE_SERVER for actually a dedicated server
you can even do stuff like game modules that only get compiled into the dedicated server too
cc above
I'm trying to place a loading screen during multiplayer level loading
Where should the code go?
might want to be more specific, are you using the movie player for loading screens like shootergame does?
No just a widget
I'm using the loading screen plugin as well. But I have a voxel world so I've to wait until the world is loaded.
SO I use combination of both.
The plugin handles the loading of one level to another and the custom widget is when the voxel world is being loaded.
If I create the widget in my controller which is for server and owning client, it works but the client doesn't see the loading screen on time or with delay
which plugin? the one by nick darnell?
Async loading free one
I need a link or anything
but if this allows you to pick a UMG widget, expect loading crashes
It works well but in my case I need more then that
if it's support with a specific plugin then you should ask the author
never mind that - let's say when a level is opened where should I create the widget so that all players see the loading screen on time.
however, loading in MP shouldn't be any different from local. however if you need a fake loading screen to cover up more stuff happening post load, then that might be specific to the plugin
Let's say I don't use the plugin. I'm only talking about after the level is loaded and I want to wait some other things to load.
@lost inlet ANy advise
like I said, recreate the widget, add it to viewport
we do a fake loading screen after the main loading screen while stuff is streaming
If I create the widget in my controller's begin play I don't see it appear on clients screen
then that's probably to do with how you're creating it, which isn't to do with MP
My point is from my lobby When I click on start new game which will take me to the gameplay level. ISince the server starts the game, I want to remove all the players lobby menu and show them the same loading screen. This is what I'm trying to achieve
any help, on open level, is there any reason my old player controller would fire EventBeginPlay on the new level load, before changing controllers to the one set by game mode??
Are you using the same player ctrl on both levels? If you are using the same game mode then most likely you are using the same ctrl
No, i'm changing, I think this may be steam related though as it doesn't happen in the emulator
is there a best practice for loading main menu, and then removing it, i followed the wes multiplayer tutorial which uses two player controllers
Load the main menu from your level BP. When you go from level to level you can remove all widget prior creating new ones.
@summer tide so on level load call my menu creation script on MenuPlayerController? I think one thing that throws me off is putting my menu creation in controller feels so bad.
No - Create Widget in your Level blueprint class. You can also create them in your game instance. Then call the events or function from your level blueprint.
@summer tide ok will do, secondly, I read the network compandium and they talk a lot about who runs what like game mode on server only, player controller server/client, umg client only, but what about maps?
Widgets are owning clients only
Every player loads the level so whatever widgets you create in the level BP will load to every player.
ok, thanks, a lot of stuff to try now π
Honestly. Don't use the LevelBP. Having a MenuPlayerController and using IsLocallyControlled on BeginPlay is cleaner
I died inside when reading that
@bitter oriole Advanced Session Worked Crossplatform Thanks now i have to configure it perfectly
Haven't read all the posts above. But the LevelBP is just Garbage for that
ok, I tried both in player controller and in map blueprint, I cannot for the life of me understand my issue, when I use open level, I see the map change to the desired default third person map, and then my Menu is recreated as if my MenuController beginplay is fired again, new Gameplay controller is indeed loaded b/c I see a string printed from it! With print string, I see both my MenuController and GameplayController fire from BeginPlay when hosting a session! Can my project have become corrupted so its just buggy. Secondly, i've been using launch as standalone and right click launch on project.uproject, should both these work? I'm using steam so I wonder if there is some specific detail i'm missing >< - advanced session controller to be exact
@digital blaze Wait, you see both controllers run their beginplay after the open level call, after the new level is open and loaded?
I'm strangling to use ClientTravel in didactited server, it seem no session
It possible to make multiple session in didactited server?
@kindred widget yes i'm so confused as to why, I"m just working off a example project but I think maybe I should just start a new project since I can't understand reasoning for this behavior
So you get the menu controller's beginplay, twice. Once at menu load, and once in the game load? If that
If that's the case, your game controller doesn't inherit from your menu controller does it?
could there be an error in starting a game w/ steam which would bounce me back to the prevoius map?
mmm, i read somewhere to put a sound file so you can tell if you're still on map, I should try that
I haven't personally seen anything odd like that when using steam. Technically steam shouldn't affect your game like that.
But does the menu controller beginplay run twice?
Ah ok, I think my map is being instantly re-changed to main menu level, so i was looking at the wrong issue!
like i see my new correct map flash for a second and then the menu would appear
you can make multiple sessions, but why you need more than one sessions ?
you need to understand why a session is required,
Creating a session means, the dedicated server broadcasts its IP and PORT and joining pre-requisites to the public (means to your players).
So now think how creating more than one sessions on server will solve your problem?
In multiplayer my SAVED game loads properly, until I close the game windows. Any way to debug that? WHen I restart the game windows, I get the default players as if I started the game new.
What do you mean by Game Windows? Cause that makes it sound like you're expecting it to load after closing the game. O.o
The executable file. Not executable I mean when run the project by right clicking the project file.
How are you saving it?
it works fine in single player mode, in all conditions.
I'm using the default save system
Odd that it works in single player and not multi. The saving is all done on the server machine?
I'm running it on the same computer.
I mean coding wise. How are you saving? Is it all done server side and replicated on load and client join, or do clients save stuff locally and upload to the server?
In my controller I call the server RPC which saves the game including char meshes and location.
WHen I load both players join the lobby then who has the auth loads the game.
I know game instance gets destroyed/created when you restart the game/project.
Hopefully it has nothing to do with that
I should test it on diff pc prior debugging.
I might know why. I am using the player name to save and the name changes every time you restart.
you should save the world to a world savegame, and player specific data to player savegames
e.g.
FString saveName(TEXT("WorldSave"));
saveName.Append("-");
saveName.Append(World->GetMapName());
yes, by default player name is random each time, you can override it via AGameModeBase::Login()
playerController->SetName(playerName)
how you make a reliable player name is a bit tricky though π
how to set view target with blend in client side? mean replicated
Why would you need to replicate that?
the set view target with blend only works for player controller
with index 0
how to at client side
ohh you're not doing this from PC?
because when i try to do this in client side, it set the view target of server, not client
mean RPC?
set view target with blend client multiplayer replicate
how to set view target with blend client multiplayer replicate****
?
Sorry I'm not understanding.
set view target with blend isn't working on client side
how to replicate set view target with blend node
Don't replicate that, replicate the state change that should trigger it.
what mean by state change trigger?
i mean where should i find state
you mean game state?
or player state?
what triggers set view target on the server?
something needs to happen for set view target to be called
replicate whatever it is that needs to happen instead, and then on the client, that code leads to set view target getting called
No it's not fine. What is the original thing that triggers all this? What are you trying to do.
here is the original interact
when i press middle mouse
it call server, and then multicast
Is this just for general interaction?
Set the view Target on the client. The server should not really even have any idea of what a view target is.
should i run on owning client?
No, just on the client side of whatever you are doing, do the view Target blend.
Your interaction setup is way over complicated. it should just be the client telling the server that it wants to interact with whatever object and then the server does whatever with it. There should be no need to multicast
^
my interact system is: Client interacts -> Tells server. Client then does any local interaction stuff, Server does its interaction stuff. i use 0 multicasts. Only time a multicast is used is from server on successful interaction if needed to spawn some one off particles.
Hey everyone, do you know how can I handle getting ping while using Steam? I am getting 9999 all the time.
you mean FOnlineSessionSearchResult::PingInMs ?
this has always worked ok for me searching for sessions in the front end - but I'm not sure about the ingame ping after connecting
in game ping you do PlayerState->Ping * 4
Yes I need to get servers ping. @meager spade
idk, sorry it always just worked for me
Is there anything to do extra? I create a basic create session, find session project. I'm using my own Steam id and testing via steam with 2 different pc and 2 different net.
Tested with unreal default steam os and advanced session.
I use native Steam OS and mostly use C++, and it worked ok for me.
I don't know if it's important but in FindSessions in C++ I set PingBucketSize=50 (doesn't seem to be a param in the BP screenshot you posted)
Thanks for the advice, I will check that.
am I the only one who gets rubberbanding when using custom movement character movement component on bsps?
works fine on other things
like a landscape
why PlayerState->Ping x 4 π€
Actually I am trying to listing sessions according to low ping. That's why I need server ping.
@dry zodiac You can't get ping to a lobby in Steam, not accurate in-game ping anyway for a session.
You can ping the ip address manually in C++ and get a very estimated ping from that
@winged badger
i tried the way you suggested of having a slot type in the fast array to handle everything in one actor component
but what if the inventory is on an actor(box) in game world ?
i have an rpc to put the item in actor's inventory which takes (UInventoryComp* ptr, int32 slot)
which can be called on a player
this time the object is rooted but still null when moved like wtf?
a single actor with just one fastarray can handle your entire world's inventory really
@twin juniper other players can interact with that box too ?
yes they can
@winged badger if you have sometime can you explain?
i would like to know how to handle that in one component too
is that item struct or uobject?
its a struct for fastarray which contains item uobject and int for number of items
in an actor com
with each actor managing its own inventory
complication comes from you having to change which actor replicates the UObject
simpler of the 2 approaches is to instantiate a new one on server once you transfer
other includes synchronizing Rename to change its outer
its known inventory on player owner is playercontroller
in the game world is the actor
this is how im doing it
const FSlot CurrentSlot = GetSlot(SlotIndex);
const FSlot OtherSlot = OtherInventory->
GetSlot(OtherSlotIndex);
if (CurrentSlot.IsEmpty()) return;
if (!OtherSlot.IsEmpty()) return;
const TWeakObjectPtr<UItem> ItemCopy =
DuplicateObject(CurrentSlot.Item.Get(), GetOwner());
if (!ItemCopy.IsValid() || ItemCopy->IsPendingKillOrUnreachable() ||
!ItemCopy->IsValidLowLevel()) return;
ItemCopy->AddToRoot();
// move item to the other inventory
OtherInventory->Slots.Array[OtherSlotIndex].Item = ItemCopy;
OtherInventory->Slots.Array[OtherSlotIndex].Quantity =
SourceSlot.Quantity;
OtherInventory->Slots.MarkItemDirty(Slots.Array[OtherSlotIndex]);
// remove item from the current inventory
Slots.Array[SlotIndex].Item->RemoveFromRoot();
Slots.Array[SlotIndex].Item->MarkPendingKill();
Slots.Array[SlotIndex].Item.Reset();
Slots.Array[SlotIndex].Quantity = 0;
Slots.MarkItemDirty(Slots.Array[SlotIndex]);
the way i'd do it, and it would help performance along the way
is put the fast array into an InventoryManager
and have all inventory from all players and other actors in the world in it
replicated via its fastarray
might remove the need to actually replicate lootboxes and such at all
in that scenario, your fastarrayitem would also need a poitner to the inventory component its in at the moment
is it worth it to make a custom movement component for a small dash? i got it working already but i was wondering if going to the trouble of making it replicate properly is going to be worth the additional work
maybe some one with some experience in that area could tell me if it is something easy todo or if it is hard task
Hi, how can i persist player state data across map travel ?
You mean like a sprint ability?
the way i am doing it right now is with interpolation
i interpolate the player position quite fast in the server and the client at the same time
it works
but i am quite sure that it is not the right way to do it
I'm using player state class but i can't find a way to persist data, i found many different answers but i don't know what s is the good way to do. (I just want to select some player choice in a lobby map then travel to the game map and keep those datas)
I noticed that in 4.26 you now have this mechanism that looks easier than overriding CMC
https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/FCharacterNetworkMoveData/index.html
Client to Server movement data.
but I've not used it myself
Can someone maybe help me with the following problem (stuck since over a week):
I have set up a multiplayer system with the advanced session plugin, where Players join a lobby and then the host starts the game.
But only the host then gets possessed ingame and the client wont receive any inputs.
what about game state?
It will be the same problem no ?
thats why to open ended to know whats causing the issue mate
thats a good question, i dont know but i am sure one of those classes should work
@limber gyro i can send you screenshots in your dms if you want
Yes but automatically or i have to copy data manually ? i saw some answers where they talk about CopyProperties
that would require me to take a look at the code/bp's and honestly i dont feel like it today
try to narrow it down a bit
what happens to the client in game?
do they spawn at all?
@limber gyro it not a lot of code but i'll try to explain.
Yes the client spawns but does not get possessed
only the host (im using listen servers)
if you are using a costume character you might have to posses manualy
what do you mean by that? can you explain?
well the game will spawn a character that is specified in your game mode class
you mean the default pawn class?
if you are trying to to posses something else
it needs logic for that
if you didnt change anything then yes
the default pawn class is none.
I am then spawning an actor at a random player start and let the player controller possess it
but is it the default pawn? or is it something else?
It works for the host, but the client only gets his camera set but cant move or receive other input
the character i am spawning for the pawn is a custom character i made
ok so i am guessing the issue is on ur posses function
ima copy paste my function for possesing here
alright thanks
take a look and see if u see anything off wiht urs
i think the gamemode just does not get the right player controller to possess the character
gimme a sec
yeah no problem
void AArenaGameMode::SwapCharacter_Implementation(APlayerController * controller, TSubclassOf<APawn> character, AProjectArenaPlayerState* state)
{
FTransform transform;
FName teamNameToName = FName(*FString::FromInt(state->team));
if (controller->GetPawn())
{
//later chane to a proper neutraltransform
transform = controller->GetPawn()->GetTransform();
controller->GetPawn()->Destroy();
}
FActorSpawnParameters ActorSpawnParams;
ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
APawn* spawnedObject = GetWorld()->SpawnActor<APawn>(character, transform, ActorSpawnParams); //character n ta a passar na blueprint da umg
//set the location the player spawned
AProjectArenaPlayerState* playerState = controller->GetPlayerState<AProjectArenaPlayerState>();
playerState->start = spawnedObject->GetActorLocation();
if(spawnedObject)
{
controller->Possess(spawnedObject);
}
}
```
this is a server reliable blueprintCallable function
i then call it on the player controler
with the class of character that i want and the controler that i want aswell
i am using blueprints so i cant use that function but i'll try to understand it and maybe implement it in BP
just take the names of functions
and see if you are calling everything that needs to be called
you should also override ur "onPossesed" method to see if the character is being possesed at all
This is my implementation. The event gets called from the player controller
looks pretty similar to your C++ implementation
at least i think
its in the gamemode so yes
i thought every event in the gamemode gets called on the server because only the server has the gamemodee
but the player spawning should be handled in the gamemode right?
it can be handled anywhere
you gotta spawn things in the server if you want them to replicate
so those functions have to have the server property
which means it will execute on the server
so replicate and execute on server?
the event gets called from an Event in the PC after the player chose a class
And that event in the Player Controller runs on the server
When the event CopyProperties from player state is called ?
tried it and still not working
I spawn an actor that has the following property.
TArray<AActor*> AttachedItems;
given the assumption some of the items are not relevant to client or not arrived yet (pointer cant be resolved)
would the length of array be the same with server side ?
override the possesed function to see if it is actualy possesing
alright wait
if that doenst work, spawn a default pawn and posses it to see if that works
just to see if the issue is in the replication or in ur custom character
@limber gyro so for two players it gets fired 2 times but the client cannot move or do anything else+
i will try that later
that is actualy a very good question, i am not sure many here will be able to answer, maybe slo or chaos
also not sure if its a good idea to replicate arrays
might be a bit hard on the network
its just one time . InitialOnly.
class ABatchItemDropper : public AActor
{
UPROPERTY(Transient, Replicated)
TArray<AActor*> AttachedItems;
UPROPERTY(Transient, Replicated)
uint8 RandSeed;
}
I use it as item dropper
theres probably a better way to do that
@limber gyro i will stop now and continue later - can i dm you then?
yea but it worked and I am ok with that
sure
@limber gyro thanks man - really appreciate your help
hello im having a little issue with replication in a storage container
So the storage inventory slot value is replicated, and when i click on the widget button to take that item. if its the server it works fine and clears that slot for everyone. if its the client, i cant figure out how to clear it for everyone as well. i even checked for authority and run it on server, nothing works
if pics are needed i could post if its not fully clear
it will only replicate if its spawned on the server i think
is that chest spawned by the server?
ok so hold up ill show you in pics, and nah i just have in already placed in the level
if its an actor placed in the level it should be owned by the server
have you ticked the replicate box in the actor?
so when i hit the take this item button in the widget
these are the custom events in the storage bp
and yes the storage actor is replicated and so is the vairable
if i take it on server, it empties that slot for everyone, if i do it on client it doesnt even empty on that clients side either
well if it is taking the above path it shouldnt work
with the bottom one it should i think
a replicated variable means that the value from the server flows to the client
if the one who clicked the button is server it goes top
if it was a client it goes down
i think that authority check doesnt make sense
it works,
with a client you want to empty it aswell right?
so the idea there is a storage container
everyone can see in it, grab from it and drop items in it, like minecraft
i need it to where if the client changes the slots in the chest, everyone else will see that
rpc setting?
whats rpc
remote procedure call
its a function that executes on the server
you already have it
i think u just need to remove that check
you are probably confusing things
i see, so u think if button is pressed, just make it go down the bottom path of running on server?
without check
didnt work
why would you want to know if its the server taking a thing or not?
are u using an enum?
i am not sure how enums work with replication
should work the same as any other variable, works the same in other coding i have
are u sure thats not working? can u do a print on tick to see if the state of the variable is changing?
sure ill print
That's not going to work unless the Client owns the 'Storage Container"
You can't call a Server RPC on something you aren't the owner of
oh so thats what i was missing
The output log will warn you about that
ok so how would i do so?
To interact with objects that you don't own (e.g, a chest that multiple players can use), you usually have to go via another actor you do own
Such as a Player Controller, or the Pawn
so i need to feed it to the player?
oh ok,
When you have lots of different objects, it can cause a lot of bloat, which is why refactoring things into a more generic "interaction" system is quite common
how would that look like in code?
so i should get the widget that contains the inventory, then when i click on the take button, tell the player thats server that it needs to change this variable in this actor.
Basically that "Empty Through Server" function needs to be in your player controller
Then the player controller calls the actual empty function on the target chest
got yah
If you don't "Own" an actor, the server/client will ignore Server RPC's
ok ill try that,
so it needs to be done through like a raycast or at least a proximity check
so that you can actualy interact with the object
Well how you call the RPC doesn't matter
it's more about what object you route the RPC through
well u still need the reference
yeah
thats why i am saying
ok i got it, let me try it
You need to let the server know which chest you're using ofc
yeah ill feed the actor through with the custom event
But this kind of thing is exactly why you usually end up making a generic "interaction" system to avoid bloating your player controller with specific functionality
Β΄my game doesnt have interactable objects like that
whats that mean
Well for example, you might have a "Door" object that clients can close
means ur gonna need to have all interactable objects derived from one object
Instead of having different RPC's and different functions for Doors, Chests, etc.. you build a system they can all use
Not necessarily one base class, interfaces are a good use-case
oh yeah like bp interface
There's probably a lot of content on building stuff like that out there
Is very common
ive been working with ue4 for like 5 years and havent used an interface once lol
ok kool, let me try this and ill be back on if it works
@limber gyro wtf? lol
very very useful, gets rid of a lot of needing cast to (thing)
i havent had the need
well hey, as long as its getting done, id say good job
always worked with casts i guess
its the main way to do multiple inheritance in Unreal C++
thats how they do things in the basic tutorials and i never bothered to explore other options
basically, interfaces are good for if you want a lot of different items you can pick up
but they all use the same interface
The real issue becomes when you need two completely unrelated classes to have common functionality
E.g, Actor and Pawn
you can't always have a shared base class though
indeed, ive never ran into that tho
brb gonna try this
i always sorta make the architecture in my head before and i guess since i dont use interfaces ever i always arranjge thing in a way to not need them
i know its lousy haha
Just as an example, a "Team Interface" is a really common one
Loads of different totally unrelated objects might have a "Team" of some kind
Using an interface keeps that much cleaner
im just using an int for that
Right, but say you have a Pawn, a weapon, a Player state etc that all have a team
And you want to access that in a common way
makes sense
well currently i only have 3 object types with team
and they all have a variable
for the team
Even two is enough for me to use an IFace π
well i wouldnt go that far with 2 but i can see how that can come in handy
It's get necessary as the project grows
You don't want to add a team to something, then have to updated lots of other places in code to account for that new object etc
@chrome bay I got it to work
Thanks so much for that, that was the block that stopped me from setting up everything else i needed
We have only 2 Interfaces in our game.
IUsable which is an item a player can equip and that 'does stuff'. Like weapon or a tool. They don't share common base class so interface makes sense.
I also have an interface that is only used to find specific components for automatically saving - it has no functions but if a component derives from it then it will get saved automatically.
back to work
how does that saving work? u check if it has the interface implemented and simply do an if?
yeah exactly
no, I think there's a fn to get components with an interface...
lol actually I'm wrong - I've not got round to that bit yet!
there is one function on the interface which gets called automatically in certain conditions
ok that makes sense
my plan is to change the Actor component save code to check for interface - not done it yet tho
Is there any way to prevent a true first person camera from clipping through walls when the characters looks down against a wall, without increasing the capsule size?
I want to keep my characters nimble and able to enter tight spaces, but they can see through walls when looking down against a wall because the camera isn't within the capsule once the character has bent his spine
The only solution that I can think of is somehow blacking out the players screen, to prevent cheating
i dont know of any way
you could possibly add a camera boom slightly back
and have it shorten when hitting a camera(i think it might do this by default)
hittin a wall''''
@lucid vault try to play with camera collision, by default camera collision is ON and behaves odd.
Hmm. I'll toy around with that. Another possible solution is to have two capsules. One wide capsule for walls, and a skinnier capsule for everything else
Although, I'm not even sure how I can use multiple capsules. If I remember correctly, only the root capsule is considered for collision
And I don't want to just change the radius if the user is near a wall, as that might cause him to get stuck in other actors in certain situations
I don't think child collision capsules are considered in the CMC
Hey there
I've got a really weird issue
I'm making a couch co-op
and each player can shoot etc.
any spawned playerController and pawn cannot spawn projectiles, for some reason
oh shit really? π
you cant call rpc's on actors that you dont won
own''
so if ur trying to spawn something through an rpc
hmm
and u dont own the actor which you call the rpc from
no RPCs or replication involved. Offline couch co-op
Is it possible to have more than one advanced session on a dedicated server ?
and is it possible to launch a dedicated server when the session is full ?
are fast arrays considered bIsPushBased or not?
Why you want to have multiple sessions on one server?
I was thinking if the session is full where the other players will go
You have wrong idea of maintaining dedicated server...
Usually you maintain pool of servers and when let's say 90% of pool is occupied then you increase the pool size by spawning more servers...
And when you have less than 90% servers you shutdown few servers to lower down cost
You have wrong understanding of servers
Yes because im still learning thats why its wrong
Lets consider fortnite battle royale example..
In one match 100 players play, so for epic maintains for example 1000 dedicated servers in advance and every set of 100 players takes one server from 1000 pool
So how can we maintain this Pool how can we increase and decrease the servers automatically
And if at any point of time 900 servers are filled, they spin more servers to meet the realtime demand quickly
You can design such system
Or use Gamelift
ok got it
Gamelift is costly
yea sure its a service
And on the pricing page of gamelift the pricing which you see is for 15 days..
Be careful
Consider how many dedicated servers you will actually need, for 95% of indies, that's just one. Do the math on your projected sales and concurrent players.
I was looking to a thing Execute an .exe dedicated server so i can design something handle this
i can learn it first and when the time coming i can see the Gamelift or dedicated hosting
or using the playfab service
Stranger i tried the Advanced session it worked thanks
If you go for playfab, then it's very tight coupling of OSS and cloud server in your game.
yes
i found in google a plugin called Victory24
i think i can execute a file outside the ue4
Yeah no
.Executables are meant to get executed
Look - do the math on how many dedis you will need concurrently. If you're sure you'll need more than 4-5, then investigate a way to spin them up or down
If not, then don't bother
is it yeah or no haha
ah manually
Just execute your server on Linux or windows VM. You could use linode or digital ocean
well it will be on steam and google if i'm lucky enough
That's not a sales projection
i misunderstand i think
Being on Steam gets you 500 sales on average for 1 online player on average
Assuming you have an average game
So you would need one dedicated server for that one guy
yea but the game wont work until one 2 teams are ready to match
Do you mean 500$?
500 copy
No I mean 500 sales, that's kind of the average these days
Ohh
The point is, your server architecture should reflect how many players you expect
got it
Sure if i got a high average i will start using the Servers of Playfab
i can create standby and max number and create a server automatically when the players joining more
For example we never had more than 20 online players with about 12,000 sales lifetime, so in our case, we would only have needed one dedicated server, if it was a multiplayer game
Consider that the game may never be played then
These are really demotivational numbers
Just saying
at least 4 players 2 - 2
4 players does not need dedicated servers
p2p session
yes listen servers
Then why are we talking about dedicated servers at all
because i will make it just dedicated server
i wont a listen server hosted on one player's pc
Why would you do that for 4 players ?
Okay, look, I'm sure you know what you're doing here. Just consider not using dedicated servers
i will see and sure i will need your information everytime xD dont be angry
Hey, I have a question about multiplayer. In my GameMode::InitGame() I'd like to block for a HTTP request.
If I don't have that data for PreLogin() and InitNewPlayer(), I won't know how to configure the player.
I'd like to avoid creating a spectator pawn and doing double initialization.
Question: If I start failing connections in PreLogin() what are my options to reconnect?
Question on Array Serializers. After I Mark ArrayDirty/Item Dirty, what should happen?
This is my setup; FNetObjectIDTransform inherits from FFastArraySerializerItem
I have Logs on the Pre Replicated / Post Replicated functions but none of them are getting ran.
My array in question UPROPERTY(Replicated) FNetObjectIDTransformArray TransformArray_1; and void AMyActor::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const { Super::GetLifetimeReplicatedProps(OutLifetimeProps); DOREPLIFETIME(AMyActor, TransformArray_1);
when you say block, do you mean block the main thread?
Well, yes if it's easy.
I was thinking I could also reject the requests on PreLogin until the config was ready.
The client should keep reconnecting. I wrote it up in Blueprints to start so I'm not sure what happens if PreLogin() rejects the connection.
@green spoke why not accept them but keep them in loading phase until you are ready ?
That sounds like it could work. I don't know about "loading phase"
show a screen to clients, says loading or something and when you are ready then move them to a new map / move them to new location
Got it. Yeah, I could do that, I was just hoping I wouldn't have to make a temporary setup.
Awesome! @tranquil yoke @stoic ore and @dull lance I see a path to the finish. Thanks for the help!
@green spoke have you heard about beacons?
Beacons was designed by epic for such use cases.
Beacons let client to only load if the server accepts the connect request.
Does unreal change the Local Role of a pawn when it gets possessed?
No
is there a way to change the local role? I have searched a little but haven't found anything
Why do you need to change the local role?
I possess a pawn that already exists in the world. That pawn cannot call a Server function, to my knowledge, since it wasn't owned when it was possessed
that's not how it works