{
Super::OnPossess(aPawn);
AHVS_Character* MyCharacter = Cast<AHVS_Character>(aPawn);
if (HasAuthority() && MyCharacter)
{
check(PlayerCharacter->HeroWeaponClass);
PlayerCharacter->CharacterWeapon = GetWorld()->SpawnActor<AWeaponBase>(PlayerCharacter->HeroWeaponClass, PlayerCharacter->GetActorLocation(), PlayerCharacter->GetActorRotation());
PlayerCharacter->CharacterWeapon->Character = PlayerCharacter;
PlayerCharacter->CharacterWeapon->AttachToPlayer();
}
if (MyCharacter)
{
Client_SpawnInGameUI(MyCharacter);
}
}```
#multiplayer
1 messages ยท Page 565 of 1
once i call Client_SpawnInGameUI()
MyCharacter is nullptr
in that rpc
any idea why?
@quick flint Not an expert, but initially the only reason I could see that it should be null in the client after that RPC, would be if it's somehow not replicated in the client yet. Or not replicated at all.
It might be likely that OnPossess on the server is called and that RPC sent before replication of the actor finishes on the client, thus is doesn't know what to point to yet.
that would be a pain in the ass
Can anyone please explain me how to assign team through Game Instance, and later spawn player based on that team after travelling to different map.
Hi. I have a custom struct which contains a field of type UTexture2D (the texture is generated on the client) and I want to be able to call an RPC with that struct as an argument, so I need to serialize the struct. The problem is that I can't find a way to serialize UTexture2D . I tried to write a custom NetSerialize method for my struct, but the two approaches that I tried didn't work.
First I tried to just MyTexture->Serialize(Ar) (Ar is FArchive), but this spits out
Bad archive positions for bulkdata. StartPos=-1 EndPos=-1
Then I tried something like this
auto& textureBulkData = MyTexture->PlatformData->Mips[0].BulkData;
Ar.Serialize(textureBulkData.Lock(LOCK_READ_ONLY), textureBulkData.GetBulkDataSize());
textureBulkData.Unlock();
and got
LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=2097167, MaximumSize=65536
in return
What are my options? I would like to avoid using external services, like S3 or similar.
guys how are you? fast question, then I test my multiplayer (in engine) server spawns my player character how can i disable that?
@wide stream maybe you could take that bulk data (if I remember correctly this is actually an array of pixel rgba values) apply some compression algorithm and then try to send it?
@empty axle That's the next thing I was going to try if I couldn't find help here. I might as well try it in the meantime
Break it into chunks instead
Compression is fine until you get a random texture that doesn't compress small enough
That's a lotta data to send either way. What size is the texture?
512x512 RGBA, so it should be 512 * 512 * 4 = 1048576 so 1MB. Dunno why it says 2MB, as there is only one mip level.
Can you actually chunk data in NetSerialize?
I'll try to create an jpg from it or something and then send the data
@wide stream off topic, but is UTexture2D pretty easy to work with in C++ and does it have helper functions like getting color at coordinate etc? I have a custom struct representing my game map as a 2d array of enums but if Texture2D already is doing the work...
Like would you use UTexture2D for a tile map?
You can do this, but it doesn't have dedicated methods for accessing individual pixels. You'd have to get the raw data of one of the mip levels and work on this. To sum up - I'd stick with 2d array of enums in your case.
@dark edge from my experience it is not so easy to work with them as wookie said
does it make sense using reliable RPCs to tell when a weapon starts and stops firing?
it should be just 2 reliable RPCs per mouse press - worst case scenario is the user firing single rounds constantly (so 2 RPCs per bullet)
@unkempt tiger It depends. Many games use one per shot for low rate weapons and firing state for high rate ones
Yeah
What i'll do is for single firing mode, I'll use one RPC
and for auto and semi-auto, 2 RPCs, assuming players dont use them as single fire mode :)
i fire a RPC for every bullet ๐
we do, but we also have a FirearmState variable, that does stuff like looping audio which is kinda needed for full auto
yeah
thats the kind of solution I was aiming for
only a 'start' reliable RPC, and a 'stop' reliable RPC
throughout which the weapon simulates bullets at the correct timings with proper sounds etc
think i would take a variable with an OnRep over that approach though
why's that?
hmmm
if we ignore the original intent of replicated properties etc
is there any technical advantage to using replicated properties?
hey, so i'm looking at some voip stuff and in the mute/unmute functions there is a flag for "is system wide" or "global", does anybody know what this actually does?
no the voip stuff
also uhm, does anyone know how long it takes for a replicated variable to replicate an integer?
we've been using it for months and not seen any issues with it lagging servers
i turned it on, and it just lags
Here's a quick question: How does team matchmaking work? With a friend/lobby system?
When I start my Linux server (UE 4.25) on Debian 10, I get these errors:
all of the stack trace is in UE source code, so I'm not sure what to do here
would really appreciate a point in the right direction
i'd say second event call from your construction script in one of the actors calls a c++ function that dereferences a nullptr
which actor, it doesn't say
can you hook up a debugger to the server process @raw quarry ?
hmm @winged badger how would I hook a debugger up? This is running on a debian VM lol
idk, i don't use linux
dont think there's a good way without installing the editor on the same VM right?
I can check the construction scripts, but the weird thing is that it works fine when I build it for windows
it is a dedicated server build, yes?
yeah
any of them have CallMathFunction call on Construction?
nope
actually the name execCallMathFunction kinda gives the sound of being the C++ backing behind some math blueprint node
or that compact math node in BP?
compact math?
i can't recall what its called
but lets you enter several inputs and a full math expression
i find it needs way to many parenthesis for my taste so i don't use it
hmm don't recall having any of those
so ProcessUserConstructionScript
is where it enters your BP construction script
then it calls 2 events
then what seems to be a its member function
ah hmm I see
how many different actor classes are involved?
I mean I guess it's not terrible, but probably somewhere around 30 at level launch
and i am pretty sure it ends up calling a c++ BlueprintCallable function with a null target
in the end
where it crashes
this is definitely constructor, not beginplay right?
you can, for those that use construction scrip log the object name
it never got to BeginPlay
I rarely actually do stuff in constructors hmm
at least other than init'ing variables
with debugger attached it would be trivial to figure it out
hmmm
i do have an alternate idea
you do have the binaries + pdb of that server build, right?
if so you need to find the minidump file of that crash
and just open it with visual studio
err I mean for linux it's like .sym and .debug I think right?
I'm not very familiar with linux either
add the folder where that .pdb is in symbol paths
you need the non executable of the 2 binary files
that would let you load the callstack in the debugger, and you can just read what actor it was from locals/autos
ah, next to the binaries there's a new file called 'core' which might be the linux analog to a minidump..
now need to figure out what to do with this file...
no other build crashes?
windows dedi build should also go kaboom at the exact same point
windows works fine
ok I installed GDB on my Debian VM which is apparently for inspecting these core files
ahh looks like it's coming from my GameState class constructor
welp it's working now, thanks @winged badger
weird that it broke Debian but not Windows tho
Anyone in here do anything with steam rich presence?
yeah
if you have a very large struct set to Replicate but have a lot of members tagged as NotReplicated, do the NotReplicated properties create overhead when processing that variables' replication state?
no
they are just ignored by NetSerialize
i mean they do, but its negligable
more properties to iterate over and inspect
I did some testing and even though I only have around 8-9 properties replicating out of 25ish members, setting my struct to Replicate seems to really slow down clients
slow down, how?
fps is good. However, their movement doesn't quite update properly and rubber band a tad
rpcs pass through just fine though
They just feel really choppy
what are you replicating?
mostly data types, so bools, enumerators, and other structs; they themselves have most of their values as notreplicated too though
i mean that it affects movement
because choppy might not be due to replication if you rolled out a manual system for it
I did not
especially if physics is involved
I have a component that handles CMC but that's just about handling an internal touch on things (crouch/sprint/prone/jumping/vaulting/etc)
did you replicate a scene component in order to replicate the struct?
The component is uactorcomponent
then unless struct has movement related replicated properties, movement shouldn't be affected
I see. For now I'll just be stuck with an error I don't quite understand ๐
replicating scene components on the character
sending too many reliable RPCs
or doing something manually and non-predicted with movement speed
or physiocs
are most common causes
I'll check that out as well
example: predicted movement (CMC)
in the meantime, on my main class I still get this as soon as I go multiplayer
Assertion failed: ArrayNum < ShadowArrayNum || SharedParams.Cmds[CmdIndex + 1].Type == ERepLayoutCmdType::DynamicArray [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/RepLayout.cpp] [Line: 1187]
and you set speed on server first
and this is the callstack
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:455]
UE4Editor_Engine!CompareProperties_Array_r() [d:\build\++ue4\sync\engine\source\runtime\engine\private\replayout.cpp:1187]
UE4Editor_Engine!CompareProperties_r() [d:\build\++ue4\sync\engine\source\runtime\engine\private\replayout.cpp:1124]
UE4Editor_Engine!CompareParentProperties() [d:\build\++ue4\sync\engine\source\runtime\engine\private\replayout.cpp:1063]
UE4Editor_Engine!FRepLayout::CompareProperties() [d:\build\++ue4\sync\engine\source\runtime\engine\private\replayout.cpp:1238]
UE4Editor_Engine!FRepLayout::UpdateChangelistMgr() [d:\build\++ue4\sync\engine\source\runtime\engine\private\replayout.cpp:977]
UE4Editor_Engine!FObjectReplicator::ReplicateProperties() [d:\build\++ue4\sync\engine\source\runtime\engine\private\datareplication.cpp:1530]
UE4Editor_Engine!UActorChannel::ReplicateSubobject() [d:\build\++ue4\sync\engine\source\runtime\engine\private\datachannel.cpp:3931]
UE4Editor_Engine!AActor::ReplicateSubobjects() [d:\build\++ue4\sync\engine\source\runtime\engine\private\actorreplication.cpp:459]```
some support forums said it could be a property in a struct that was not tagged uproperty, checked but it isn't
will try that
good news is the fact i don't remember neams it was an easy fix
For Debugging with rider, I just have to run it as Debug or do I have to build the target for DebugGame?
debug = packaged
so I'm getting a nullptr on this. that seems gone for now
@winged badger that's the data I got, which is pretty much as helpful as the crash callstack?
Unless I'm missing smth
and the only thing I get for that function on google is this
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/36815-problem-with-replicated-array-of-custom-struct
Unreal Engine Forums
For gameplay programmers writing C++ code.
which I already check the struct; all parameters are uproperties
could it be because I have several empty ustructs? (I'm not replicating them nor are they part of the system, but... could it?)
and ... it wasn't either the struct parameters nor ustructs with no parameters
well it has to do with something you are replicating subobjects for, right?
can't you walk back in the callstack
and see what actor it is? ๐
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaghhhhhhhhhhhhhhhhasdfasdfkjh
it was the fucking blueprint
recreated the class
error is gone
epic why
Simple Physics replication component that syncs location, velocity and rotation. Might make a tutorial on it later...
Link to the plugin : https://drive.google.com/file/d/13lCTFmj7xEUvANfssSI0imEs628JcQ8o/view?usp=sharing
Also if you want a more professional way of doing thi...
physics replication plugin
Doesn't seem to work if you ask me, everything is in different positions
at first i thought he was asking for help making the plugin work, but then i realized it's a demo.
The ball spin bugged me. Looks derpy on the other client.
only thing that seems to work there is objects that haven't moved at all seem to still be in correct position
If it's one of those "the match is over here's all the info you need" kind of structs, then yeah RPC makes sense
@chrome bay
For information this important, it seems to me that a multicast might not be reliable though, no? I wouldn't be able to count on it coming through every time.
It really depends what it's for
At the end of the match in HLL we send out some reliable RPC's to tell players to progress through the UI, show scoreboard, show XP progress etc.
All of that info has to reach them before they can show the relevant UI pages
I need to display the final score, gold earned, objectives hit, etc.
Yeah, so that sounds like a use case for reliable RPC to me
"Game is over, show the finale screen" etc.
Okay, I think I'm on the right track then. I was going to have a timer in the game over screen widget checking bFilledOut before I display it.
That all goes via the player controller FYI in our case
I thought you once told me something like, "I've never found a use for Reliable."
Not at all, reliable we use all the time
Oh...
The end-of-match flow is pretty rigid, so our game mode manages a sequence of states and updates the controllers with the relevant info at each phase
E.g "show scoreboard", then 30-seconds later, "show XP progression" etc.
But it would make no sense to use replicated properties for handling that
i just reliable Client RPC every controller for our equivalent of that
Because the overhead of checking replicated properties all match is undesirable. I understand.
Well that and it's also just easier to send an RPC
Why not a multicast, Zlo?
you could spawn AMatchSummaryActor at the end of it
Multicast makes no sense for player controllers
toss data into it
and let it replicate, Initial_Only
but its just simpler to iterate over all controllers and Client RPC each
defo
I see. Thanks for that tip.
And if a spectator joins during the game over screen I could... RPC them the data on PostLogin maybe?
in BP, you can just GetGameMode->GetNumPlayers-> for (0 to NumPlayers - 1)->GetPlayerController[Index]->CastToYourController->ClientRPC
one of rare uses GetPlayerController[index] that i approve of ๐
haha
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
Joys of CPP...
and the algorithm to match a controller to its index is just... ouch
then its incrementing the Index variable inside that loop until the controllers match
you could replace that with for (auto* Player : TActorRange<APlayerController>{ World }) ...
Doesn't that require going over all actors in the level though? IIRC the controller iterator is a separate list
yeah, this is not TActorIterator you replaced in that example
Yeah TActorRange is way nicer than TActorIterator just for syntax alone..
UWorld has PlayerControllerList and ControllerList though which are nice for convenience
They used to have a pawn one but i think it's gone now..
@chrome bay Heyo. You told me something quite a while ago about Arrays and replication. I can't remember exactly what it was called but it was a replication way to replicate arrays by index only, but out of order?
Yeah, look at FFastArraySerializer
All the relevant info is in NetSerialization.h
Essentially the data type should inherit FFastArraySerializerItem, then you create a wrapper struct for the array that inherits FFastArraySerializer
And implement the requires gubbins
Ah. Thank you! I'll look into that. Been learning C++ a lot lately, so I might actually understand half of it now.
@chrome bay, in relation to the endgame summary setup we were discussing, how do you handle different game over screens needing different information? Is there a way I could pass a different struct of information back through the RPC depending on the widget I need to show?
Certainly I wouldn't keep it all in one struct regardless of the needs of the widget in question, eh?
@waxen socket if you are sending struct in RPC then your RPC logic is not generic.
in this case you will end up having the exact number of RPC functions as that of number of different UMG
Yeah, that's what I'm afraid of.
so this is my generic implementation.
void ClientToServerRPCInternal(const ENotifyRPCType NotifyRPCType, const TArray<uint8>& AdditionalData);
based on enum type, I convert AdditionalData to my UObject
void ServerToClientRPCInternal(const ENotifyRPCType NotifyRPCType, const TArray<uint8>& AdditionalData);```
But you're only sending over ints?
yes, so I convert TArray<uint8> into FString and then parse it to respective class.
{
if (GetLocalRole() == ROLE_Authority)
{
if (NotifyRPCType == EnumType::ShowScore)
{
const UScoreModel* ScoreModel= UScoreModel::Get(AdditionalData);
//Additional Logic
}
else if (NotifyRPCType == EnumType::ShowScoreType2)
{
const UScoreModelType2* ScoreModelType2= UScoreModelType2::Get(AdditionalData);
//Additional Logic.
}
}
}```
I see. Thanks for sharing that.
any chance anyone can point me towards a good resource for making top down template work in multiplayer? ive seen a few options. i guess AI character?
launcher has an example of top-down sample
doesnt work in multiplayer, navmap of right click movement doesnt replicate
I saw a solution using a server side and client side controller for each player
just combine this with Shooter Game, and you have working Game with Top-Down and multiplayer.
@zenith wyvern But there's already a server side and client side controller for each player?
so.. an array inside a struct - if I have an array of those structs, is it expected that this array property won't replicate?
i guess the server side controller is supposed to be AI, and can do simple move to location via navmesh
and the client side controller sends inputs to server side, since it cant call simplemove itself
any chance anyone can point me towards a good resource for making top down template work in multiplayer? ive seen a few options. i guess AI character?
@zenith wyvern It's not trivial. You can tell the server where you want to go and let it move your character, but that's a very bad solution especially in high latency situations.
So what you want to do is implement a path traversing function on the client. Activate client nav data in the project settings. Then you can use the nav system to generate a path. You need to walk this path by code using input commands.
yeah ive seen complaints about a few solutions. so allow client side nav is a definite?
yes, thats how we do it
are there any good writeups? the custom pathing functions?
or let's say did, we switched to WASD later on but the click to move functinality is still in the game
there was one write up about it
can't find it anymore
maybe it was on the old wiki
void ALlGamePlayerController::MoveToClickedPoint()
{
ALlPlayerCharacter* Char = (ALlPlayerCharacter*)GetCharacter();
if (Char) {
FHitResult Hit;
GetHitResultUnderCursor(ECC_WorldStatic, false, Hit);
UNavigationPath* NavPath = UNavigationSystemV1::FindPathToLocationSynchronously(GetWorld(), Char->GetActorLocation(), Hit.Location);
SetPath(NavPath);
}
}
// Move to next point on client side path.
void ALlGamePlayerController::MoveToNextPathPoint()
{
if (CancelPathFinding == true) {
NavigationPath = nullptr;
CancelPathFinding = false;
return;
}
ALlPlayerCharacter* Char = (ALlPlayerCharacter*)GetCharacter();
if (Char) {
TArray<FVector> PathPoints = NavigationPath->PathPoints;
// End of path
if (PathPoints.Num() <= TargetPointIndex) {
NavigationPath = nullptr;
return;
}
FVector Dist = PathPoints[TargetPointIndex] - Char->GetActorLocation();
Dist.Z = 0.f;
FVector TargetDirection = Dist.GetSafeNormal(MoveTolerance);
if (TargetDirection.IsNearlyZero()) {
++TargetPointIndex;
// Recall itself to next step
MoveToNextPathPoint();
}
else {
Char->AddMovementInput(TargetDirection);
}
}
}
this two functions could help you
thanks!!
@wind garden @zenith wyvern predicted movement via CMC is possible, but requires an extensive override of the CMC
since its hardcoded to work with Character, PlayerController, and AutonomousProxy role
so basically you have to override every function in CMC + APlayerController::PlayerTick that have that coupling, if you wanted to use an AIController instead of PC for your player
@wind garden @zenith wyvern I think customizing CMC will be waste effort. You can expect NetworkPrediction soon.
soon = 6-9 months ๐
I think there is significant progress in dev-networking branch
expect it not to be usable in production code in its first, and possibly second version as well
few things are
I think its planned for mega Unreal Engine 5 release.
and if that is true, then Fortnite will battle test NetworkPrediction in UE5
it still won't work proper until they fix all the ways unreal devs manage to break it
true
well the two functions i posted take care of it
it's predicted as is uses movement inputs
it is
@wind garden Isn't thorium a radioactive element??
we rewrote our CMC to have its full functionality
instead of manually calculating inputs along the path
wasn't that bad
it was mostly a c/p of CMC function, do a couple of tweaks to strip hard dependencies
and don't call super
not having roles right has additional sideeffects
you won't spot them if you're using a dedicated server, but on listen...
when CMC ticks the client player skeletons twice
ouch
yeah, i also need to set roles and ownerships correctly, i neglected that most the time
for example currently you could steal another players item as the ownership isnt set to the player
minor exploits ๐
eventually you'll probably even want your instigators all connected properly
i don't think we even use a SpawnActor function if its not wrapped anywhere nowdays
yeah, makes sense
I do set the instigator for projectiles and such. For actors that actually come from other actors. But it's not set for character spawns and such.
is there anyone to send an unreliable RPC at a consistent rate outside of tick? I have it working inside tick but I'm wondering if there's a cleaner way to do it.
this works
you can run it on a timer if TIck is too much
you'll need to cache the WorldTimeSeconds as you send it, so you can provide DeltaTime on the next one
so general player inputs: you know walking, moving, aiming the mouse - should these be reliable RPCs?
Only sent when they change?
Most times I think that kind of stuff is handled via unreliable. Reliable is usually saved for more state change things. Telling a weapon actor that it's trigger is pressed for example. Movement usually just gets continually RPCed unreliably because it won't matter so much if a few miss with the way the movement component is set up.
what about single presses?
jumps for instance?
or tapping R to reload? or grenading?
Possibly reliable. Much like the trigger press, they're necessary actions that are required to happen. Movement input is handled by telling the server often enough what direction to move and it just keeps moving that way until it stops receiving a long enough vector for a long enough duration and slows down to a stop.
Are you using Characters?
Nope, I'm using my own class derived from pawn
I'd probably consider looking at how the character class's movement component works. That many reliable RPCs are likely to cause you problems if you put it on an axis input.
Oh yeah
I don't have continuous axis inputs though
It's just a binary 'moving forward' or not
I have a fairly big struct
With booleans 'is forward pressed, is backwards pressed, is primary fire pressed' etc
each serialized as a single bit
Hmm. If it's a simple one time act every so often, maybe? I don't see why that would hurt if it's just an input action and not an Axis.
Yeah true... hmm I DO have a rotation in there, so maybe if I carry over the rotation to an unreliable protocol and use the actual presses reliably
Hey @kindred widget , thanks for your input 
๐ฎ
Hi, i need help.
multi-user editing server loads RAM. In the task manager, you can see that the server running on the command line is loading the RAM. used with a colleague VPN for direct communication Hamachi. For a month we figured out how to set up joint development of a project, but the hard load on RAM, up to a blue screen or the departure of the project itself, interferes. Help me please!
Add more RAM to server! Also try change scalability settings (eg low view distance and low texture). set texture pooling size small.
Use level streaming, and load only what you are actually working on.
it is not the project simulation itself or the project itself that loads, but the window in the command line when the server starts. loads all 16 GB
16gb is not enough for desktop use, let alone small for a server. Go for 64gb ram by default. Or more if possible.
server for team development of a project of 2 people on 64 GB?
unreal use lots of meta data, needs lots of ram to store it somewhere
Why then did unreal not indicate in any documentation that this plugin requires 64 GB of RAM? Surely there is a catch in something that I did not take into account or that I forgot to indicate
Maybe there is a setting to reduce ram use, i'm not familiar with this solution.
It's horrible. 64 GB RAM is worth space money in my region
How much ram it uses with an empty project?
1 gb without "multi-user editing" plugin included
I ask, how much ram server will use with empty project when you enable Multi editing?
The project is almost empty.
I created locations in the world composition, but my colleague and I are working on only 1 location, which practically does not strain the PC. there are practically no objects at this location.
Well, it's weird that an empty project would use as much memory.
Initially, the server turns on, the command line opens, my colleague connects and for 2 minutes we can see each other. But as soon as we start doing something, a colleague, for example, imports 3D objects, I work on splines at the location, the load of RAM is increasing in the open command line, which opens when the multi-user editing server starts. then the computer is kept under such load for a couple of minutes and either a blue screen appears or the project crashes
i have estimated 64gb for 2x 32gb for two people but it's not too much anyways. 16gb however is not enough for many tasks in unreal.
import tasks for example use many ram
Exactly. can import not through multi-user editin, but through version control system? maybe this is the problem?
Yes this could reduce the ram use. But some work will always increase memory use, and eventually run out of ram anyways.
More precisely, not a problem, but a solution to the problem!
Try to setup alert tasks, and restart server when too much ram use. Maybe it avoid sytem crash.
could you tell me about alert tasks. Where are these settings?
Some alert in windows.
Can you delete widgets from all players at once?
Is there a way for a player (the host) to force everyone from the lobby to remove the widget (a menu from where players chose their team)? I tried making it so if the player with server authority presses a button it gets all widgets of that class and removes them from parent but it doesn't work.
well obviously it doesn't work
widgets are local
you need to communicate to other players that you want them to remove the widget
if that is part of the seamless travel to new level
can just override PreClientTravel in PC and do cleanup there
Hi. Yesterday I was asking how to serialize a texture to a FArchive. If someone is interested, then here is the code
https://answers.unrealengine.com/questions/981259/farchiveing-a-utexture2d.html?childToView=981633#answer-981633
thanks
tried to make a replicated variable change it
but it only works if i use a manual coundown
does anyone have idea about.. webbrowser, in multiplayer?
i want to change everyone's screen, when a player types new url or clicks on screen
ive tried with replication and multicast , first time trying this and it didnt workj
Guys, I'm trying to move object on client by navmesh. But nav mesh seems to be available on server-side only. Is it possible to make FindPath() work on client as well?
@wary wyvern Project Settings -> Allow Client Side Navigation
Hey everyone. We're new in networking and are doing an online prototype. Now we successfully replicated some gameplay in the same machine but we want to do a test for online multiplayer. However we couldn't find much information about this.
Anyone knows which would be the procedure? We launched the server I. Listen mode and come Ted from other pc using the open Up:7777. We also tried emulating a local network using Zero Tier and nothing. Any ideas or resources to follow?
@fossil zinc
thats the only good source for stuff like that, for other you will need experienced people
Thanks a lot!
Do you guys know if networking between the internet requires to have the unreal engine source code? or you can use the engine downloaded from epic's launcher
it doesn't for listen servers
it will require host to forward its ports, in its most basic form
open ip:port
SO basically if I'm running as the server will need to have the source code, right?
no
if you're running listen server, and you're not on the same subnet
only hurdle to connecting is your router is not expecting a package from the clients IP address
so it will choose to just discard it
thats where port forwarding comes in
Ok, got it. So the clients don't need the source code if we're not in a subnet?
if you package a game and distribute it that way
they only need .dlls
erm... binaries
doesn't matter if its same subnet or not
none of you require engine source
unless you're using dedicated servers
because those can't be packaged on vanilla engine
Ok. Another question, how do games usually handle the port forwarding? Do all games that work this way need to open router ports manually to work?
Or the only way to bypass that is using dedicated servers?
no decent game these days requires port forwarding
usually using a service that does NAT punchthrough for them, or using a public matchmaking server that implements it by hand
Like Steam?
So, technically. If it works LAN will probably work on steam?
The thing is that we're a remote team, trying to find a way to play test multiplayer. Would the only way to do that be port forwarding?
des anybody know how I can change hte voip volume? i've tried setting a sound class but if i change the volume property of that at runtime it doesn't affect it
if you don't have a steam ID
and are looking for fast solution
then port forwarding with open ip:port is the simplest one
as in, you can literally implement it in 10 minutes
I understand, if it works that way you thing will be easy to migrate to Steam once we have the ID? One of us is working on it, but we wan't to progress while he's at it.
then port forwarding with open ip:port is the simplest one
@winged badger
you just replace the temporary hack with somewhat more complex steam APi calls, and yes
isn't it possible to test with the spacewar id? I've never actually used the spacewar Id because i've always had app ids lol
i mean i'm sure with spacewar, you can test multiplayer, since it would be a shitty example if you cannot connect to anyone.
Does anyone know how to simulate lag in editor? Seems like the old commands don't work
the autocomplete doesn't work
the commands do
net pktlag=300
no spaces around =
thats the default one, yes
you also need to CreateSession, and OpenLevel with ?listen parameter on host
then others do open ip:port
and they hop in
@analog rover Ive noticed they are now moved to the Advanced Multiplayer section
You now have to enable a checkbox called EnableNetworkSimulation or something
Then you get access to change lag and packet loss etc
@winged badger Thanks a lot man, you're a life saver.
@fossil spoke it seems like the net pktlag=300 command is working, and there's a big ol' section in the Editor Preferences with all of the options you mentioned
Thats what i was talking about
Yup! Just in case anyone is being stupid like me and can't find it, that's where it is ๐
well it looks like the voip sound class setting in the project settings just doesn't work
Error MSB4057 : The target "Games\LMSServer" does not exist in the project.
How can I fix this error
Why doesn't switching to a server configuration in Visual Studio turn on the UE_SERVER macro so I can actually use intellisense on my code inside the macro if statement?
any ideas how I can make it do that?
it's set at compile time, not in the project afaik
like from ubt
so you'd either have to comment it out, or just stick #define UE_SERVER 1 temporarily (and don't forget to remove it!)
hmm there's gotta be a way to define a macro for specific configurations though somehow right?
well, you could modify the project in visual studio
since the project isn't used for compiling anyway
so it would stay there until it's regenerated.
yeah good point
oh maybe not. it has no actual rules
ahh
let me try something.
oh wait, i use VAX so i don't havet his problem.
there is an intellisense setting under the NMake property, which you may be able to throw UE_SERVER in there for t he serve config
What needs to be done to be able to join a game with incompatible_unique_net_id?
Problem is that the dedicated server doesn't necessarily need to use steam OSS, but our client does. And if the server doesn't have steam OSS enabled it won't allow clients to join
And the reason I don't want steam OSS on dedicated server is because it cannot be initialized on more than 1 instance per server
I'm following Virtus Tutorial on How to do Steam Multiplayer game, but I get an error when I try to test the network part using 2 players, any help please ?
If that blueprint runnin on the server? There might be no player controllers on the server if there is no players
The thing is the play menu to test your game isn't the same for the network part as the video
I have this
and he has this
he doesn't have the net mode thing
Yeah currently trying that ๐
const bool bUniqueIdCheckOk = (!UniqueId.IsValid() || (UniqueId.GetType() == UOnlineEngineInterface::Get()->GetDefaultOnlineSubsystemName()));
this line does it
and you can safely not do the second check
One thing I don't understand in that check is why there is ! before the UniqueId.IsValid()
If we want the bUniqueIdCheckOk to be true wouldn't we then want the UniqueId to be valid and not valid?
any help plz ?.
Try to play as offline or as listen server. Play as client is the same as "run dedicated server" checked on on the old version
uhh since when. I just loaded two dedicated servers from the same folder that is updated with steamcmd. the second one just changed the port with -port on the command line, they both connect to steam.
you just have to use different ports
ie: default is -port=7777 -queryport=27015
so second server is -port=7778 -queryport=27016
it's actually the same as like.. any game that i've ever ran dedicated servers for. you have to use different ports.
on the topic of ports, does anyone know how to pass those port parameters on a linux build with like c# or something?
would be cool if you could set those ports at runtime and not as launch args
@random nymph same problem
I have a question that I can't figure how to ask on Google. Assuming you're on a server, and you received a item from other player.
= How does that "item" object get transferred between players?
= Is there a standard way of defining an "item" per se such like 'food', 'armor', 'shoes', 'hat' etc ?
you gotta make a system for that
maybe an enum that defines an item type
and and "item" is a struct that has basic info
you could have an item base class and all other items could be child classes
so every item can be very different but still be stored as 1 array in an "inventory" variable
in a case the player received items from quests they completed. The items are supposed to be stored in a Database.
How does the data transfer? in term of data (enum like you say) or file transfer (.json, .xaml etc)
you could create a data table of items and the row name as the id (0-999) and when you get an item you just get the id
then tell the client to instantiate the item with the corresponding ID?
you dont really need file transfer, if both the client and server share the data you can just communicate items with their id's
ehh
idk what kind of system you wanna make
if you want to have like pickups then spawn the item actor on the server
thank you for responding, i'm just thinking of a standard/generic way
in my br game i have a pickup class that just shows a static mesh as a preview and a name
before i get into modify them
it contains an item variable that is set on the player when they pickup the item
PM me if u want, i can show my system
i'm trying to use OSS Null on dedicated server and OSS steam on client. When client connects to dedicated server the server crashes
You can't, at least not by default
I know there is more to it, but at the bottom there is a check on Login that checks if the UniqueNetId is the same class or format or so, and if that mismatches it will disconnect your client.
Your Server crashing is however something else.
Assertion failed: GetType() == FName(L"NULL")
I already overwrote the prelogin function to allow the login with incompatible net id
Yeah that looks like it's failing that sort of check
Well, the check is there for a reason, right :D
So what is the next place to overwrite ๐
It's pretty dumb that only one game instance can be running on one server instance if steam is used
Why do you even want to mix Subsystems?
Because if the server uses steam oss there can be only one server instance running on one server hardware
That's wrong
๐ค
You can lunch as many as you have resources for
(and ports for what it matters)
Server only needs the SteamDLLs
Not an account
I'm using gamelift and trying to get running multiple simultaneous processes working, haven't yet succeeded if steam oss is used but it works without steam oss
Well, let's put it like this:
UE4 + Steam + GameLift should work just fine. I set that up in the past, as well as for PlayFab.
You do need some extra code to go from IP+Port to the SteamID of the Server, but that's about it.
GameLift maybe offers enough tools to have the Server pass over the SteamID directly, sadly PlayFab didn't allow any extra data despite the IP+Port.
game joining is working currently through ipnetdriver and steamnetworking is disabled
I'm using gamelift and trying to get running multiple simultaneous processes working, haven't yet succeeded if steam oss is used but it works without steam oss
@random nymph i already showed you how to do multiple intances on one server.
scroll up, since I didn't tag you.
since your whole reason for trying to hack this is "[1:27 PM] Piilorasva: And the reason I don't want steam OSS on dedicated server is because it cannot be initialized on more than 1 instance per server"
when it absolutely totally can
and it's crazy to believe that it can't
how else would hosting companies be able to provide tons of servers
Ah sorry I missed that
never used gamelift, but surely you can pass launch options. so you just spawn a bunch of servers with incremental ports.
both the game port, and the query port.
Yeah I can pass launch parameters, but there is only one one place to pass them as I know and those parameters are passed for all of the concurrent processes ๐ค
either way, there must be a way to control the launch process, and it should be scriptable
Or the port is assigned automatically for each game session instance, but I don't know how to supply different queryport
eg, 8 years ago, i would have a script that could update and restart DS's on multiple bare metal machines. it would start at base port, and each machine would fork and increment the ports
Yeah. I'll try messing up with the gamelift server start process. Thanks ๐
Hi folks, I have a question. How does GameMode detect if a player died in the game? currently I'm checking each character health under Tick event to detect which one is dead and somehow I feel there should be a better way.
@vivid prawn why are you ticking every frame, it will eat up your performance.
It's the character who should broadcast to GameMode or whatever that he died.
but i thought client shouldn't/can't access to GameMode right
Inside your character class do this if(GetLocalRole() == ROLE_Authority){
GetyourGameMode
}
Sever also have a copy of your character class and it will have GameMode instance
No need to do RPC
it knows it's dead, when the pawn is detached from controller.
when controller has no more pawn.
by default.
though "dead" is not precise, in that instance
and the server can access gamemode, so the server can clearly tell the gamemode when the player has died, since the server is what should be dealing with takedamage and health.
@gleaming niche you mean I should Unpossess the controller from character? and what event does it trigger in the GameMode?
I'm doing it in BP ๐
Well the process is when player dies, to tear off, and then remove from controller pending destroy
I dunno what those are in BP though
I use a delegate to notify gamemode of death, which then also broadcasts death notice to everyone else, and handles anything special
Hi,
I can't see my CPP classes in my content browser. The project compiles and I have view options set to "View C++ classes". Are there any other issues that might cause this?
@woeful ferry is your class BlueprintType
@rich ridge It's just an empty c++ class, to push folders to SC.
UCLASS(BlueprintType)
class UMySimoleClass : public UObject ....
Cool
@gleaming niche I see... I think I got what you mean, basically once the character is dead (health == 0), I got to unpossess the controller and destroy the character, then in a custome event (replicate to the server) and tell the server "this character is dead".
You dont replicate to the servee
The server is who controls the state
All damage should be handled on server only.
Yeah, I have to rethink my current structure, thanks for the help ๐
Looks like I finally got multiple concurrent instances running on the gamelift. There was still initialization errors if I tried to start multiple processes by default, but by starting the other processes after the main server is spun up seems to work
congrats
Thanks for the help ๐
Has anyone had experience with programming "combos" in a multiplayer game?
Basically, if the player tries to attack again during a certain window of the attack animation they should play the next animation in the chain, but I'm not sure how to synchronize it, since the animation windows might not line up due to desync in locally applied hit slowdown effects, or just a bad connection
My current approach is to let a client request any move, and just have the server validate that it is somewhat reasonable, within a rough amount of time after the last animation started or ended
(For additional context, this is intended to be used in a co-op game with ~4 players max, so I'm not as worried about cheating as in a competitive game)
The multiplayer works perfectly fine in PIE but when i package the game the find sessions node always returns nothing. Does anyone know why?
Node setup and Engine.ini file for steam subsystem, the online and steam subsystems plugins are all turned on
make sure steam is running
you should be able to shift+tab and get the menu
if you cant, make sure there is an steam_appid.txt file next to the executable that contains the appid which in your case is 480
the steam overlay pops up when i run it
also i forgot to mention that im running 2 instances on 1 pc (the error that pops up isn't about the same machine issue but 0 sessions found)
You cant do two instances on one machine
Only one of them will actually authenticate with steam.
You cant do server and client on one machine either. You can do multiple servers, but not multiole clients.
If you want to test a listen server, you need two machines and 2 steam accounts.
@analog rover I think you should use GAS. GAS will eliminate the extra work of validating moves with server.
@rich ridge this is with GAS already ๐
@analog rover so even I have a combo with GAS, the way I implemented is
- Have one input press task.
- Have one Timertask
So whenever input is pressed and my ability is active and the timer task has not expired play montage.
Or whatever custom logic you have
And when the ability ends , end those tasks
And please don't override InputPressed function as it only runs at client side.
I was hoping for general multiplayer advice not specific to GAS, but I am already using the #gameplay-ability-system channel for specific stuff
Though I think my issue is not replicating the tags across the server and relying too much on local prediction
If you want to test a listen server, you need two machines and 2 steam accounts.
@gleaming niche That's good to know in advance, just about to test on steam - if you don't have 2 pcs, is it possible for a friend to test? Would I need to set up friend lists in order for this to work? Many thanks in advance.
Either add them to your steamworks, or just give them a key so they own it.
Its easier to just push a build
Tbh
And of course you can do debug if youre not sure, rather than shipping.
Its easier to just push a build
@gleaming niche Okay, thanks for your help. That sounds like a reasonable workflow.
One of these days i should publish my scripts/tools.
I jave a whole setup where i can build multiple configurations from one folder, where it replaces .ini and target contents, so i can just push a button and it goes straight to steam lol
Well, non beta branch needs to be manyally activated. But thats not an issue
Build ds, and client. Push all.
I jave a whole setup where i can build multiple configurations from one folder, where it replaces .ini and target contents, so i can just push a button and it goes straight to steam lol
@gleaming niche Awesome. I'm a total newbie to MP in Unreal, so baby steps right now. Just want to get a framework up so I can test basic movement, health, ammo, damage and have a simple create, find and join session working.
And of course you can do debug if youre not sure, rather than shipping.
@gleaming niche Out of interest, do you know if I can use a mac as a 2nd machine (as a client)? I have a mac and a pc, but not 2 pcs.
Compatible.
@gleaming niche Thanks again, much appreciated. Have a great weekend.
i need some help, im making the game where one player will have control over the world (enemies, traps etc) so i wanna give them a separate player controller because i think thats the way to go about it but im not sure how to assign player controllers to specific players
is multiplayer session and dedicated server completely different concept, or.. what are they?
@viral phoenix first off, use "start players as spectators" in your gamemode. There are two ways you can then go about this
A. have the server always be the controlling player and clients are subordinate
B. change who is the controlling player when the match starts or at random
the picture above represents the first method using "onpostlogin" in gamemode
this is method B (sorry for the spaghetti i had to whip this up quick)
oh, thank you :)
you might want to get the random integer immediately after get all actors of class since ive had instances where pulling from the same random int node will re-seed it
im using top one, since i want the server (host) to always be the one with most control
@rich hare is there a way to use all of the player controllers to check if they have a widget on and then delete it?
like a loop?
widgets (in the context for hud usage) is only stored on clients.
the best recommendation i can give is to have an event that executes only on client. call it using for each loop on all the actors and have each one get their controller. from there you have access to widgets in the viewport. this can be done by storing the widget as an object variable in the controller blueprint or using a more inefficient "get all widgets of class"
the way you do client actions is dependent on how you handle widgets in the first place
well i have a team select widget and i want the host to press launch after teams are balanced but if i use the has authority it only deletes on his screen
the team select widget (for now) "spawns" after you close another widget (as this problem is shared in 2 places)
anyone got any recommendations for a simple team system?
yeah, use tags
then when you fire a gun through a raycast you can check the tag i guess
tags?
it shouldnt be hard to make, i have one already but i have problems with the team select
or this
In this video we will see how to make a multiplayer game where we have players select and join a team, then see each other in the minimap either as friendlies or enemies based on the team they selected.
Get the minimap:
https://www.unrealengine.com/marketplace/en-US/slug/dyn...
thanks
I'm a new user of Unreal, and trying to figure out how to spawn an network player to a player start pawn. My question is: How do I get all the PlayerStarts, and the players too?
can get all the player starts with get all actors of class, players youll want to store as they connect
@zenith wyvern I have no idea how to get all the actors or players in c++. Is there a method I can use? i.e? GetAllPawns<PlayerState>()
GameState->PlayerArray
dont store the players yourself
PlayerArray contains ALL playerstates in the game.
to get PlayerStarts, use for (APlayerStart* PlayerStart : TActorRange<APlayerStart>(GetWorld()))
ahh, thanks @meager spade
Can anyone recommend a tutorial series (free or paid) for someone who's very experienced in blueprint but hasn't touched multiplayer to learn it?
I'm aware and have read the compendium, but I really learn from creating/watching examples of work - that's why I'm asking for tutorial series ๐
Hey guys I have been working on a local retro multiplayer game but now with COVID I have been finding it hard to actually figure out how to test
Online pretty hard, Parsec, does not see controllers, and same with remote play on steam
Has anybody else had this issue with remote play or parsec with your unreal project? Both of these systems seem to work fine except when you using my UE4 project
At this point I am willing to someone to fix this problem, but don't know if looking for talent section has something so specific to what looks like a bug fix
I have multiplayer setup, and I like to send private message when click to another player, so how I can get player name or playerstate when click event?
I'm aware and have read the compendium, but I really learn from creating/watching examples of work - that's why I'm asking for tutorial series ๐
@icy nacelle oi
i might have one
its C++ but not multiplayer
I MEAN ITS MULTIPLAYER, but only C++ and no blueprints
For this project I'm just looking at BP, thanks though ๐
I'm following Virtus Tutorial on How to do Steam Multiplayer game, but I get an error when I try to test the network part using 2 players, any help please ?
The thing is the play menu to test your game isn't the same for the network part as the video
I have this
and he has this
well it's the same thing as the one in the normal menu
so wich one is the equivalent of "dedicated server" ?
I have these errors when I try to host a server with 2 clients
play as client
is the equivelent of the DS check box
the 4.25 way screws up a bunch of things. I had to modify the engine and put some 8 year old code back in, so I could continue testing stuff in the editor.
@gleaming niche So do you have a solution for me please because when I try to host a game it crashes and give me the error above
i mean for one thing, you can fix your errors. but since you're using a DS from a main menu (even though it's also saying that the map doesn't exist that you'ret rying to travel to somewhere)
if you're using a DS, from a menu
it starst the DS on the menu.
what's DS ?
you can only really test with a DS like that if you start on a map directly
"play as client" is the same as the checkmark for "run dedicated server"
what's DS please ?
....... dedicated server
ah but the problem I tried with "play as client", "play as server" but same problem
and the error says "It couldn't find any player controller"
Hello guys, I'm trying to replicate a function that moves an actor following a lerp function, which I called from the Tick. However I'm getting an access violation error while I execute, any Ideas? I'm doing this in C++
My bad, this is how I call the function. Is inside an actor and basically I call SetActorLocation at the end of some calculations. When I call it says that there is acces violation in Get Actor Location. Used to work fine before I tried to replicate it.
Give me a sec I'll show you. But the crash happended in the get actor location.
Here is the crash
And is called from my code here
This is how Im doing the replication
And in the server call I only ask for authority
A previous function sets all the parameters and allows the function to be called on tick.
Just realized that variable is not being replicated
yes but MovementTarget is null
Yeah, I thinks thats why
also you not be moving a player with SetActorLocation
you will end up with corrections
the CMC will get thrown out of sync
Jmmm
I was fearing that since that was code I wrote before going to multiplayer
Any best ways to move actors?
actors or player?
actors are fine to move using SetActorLocation
character not so much
Its a Character. Its a function that moves a player to an specific point over time
A given time
i made a special component
on the player (just an actor component)
that does a RootMotion source movement
this is fully predicted with the CMC
you supply target location, time to get there
and player will move to it
And how do u move it? Are u allowed to use SetActorLocation in a component and then replicating?
Then how do you make a RootMotion Source Movement? Never done anything like that
MoveToActorForce->InstanceName = "MoveToActorForce";
MoveToActorForce->AccumulateMode = ERootMotionAccumulateMode::Override;
MoveToActorForce->Settings.SetFlag(ERootMotionSourceSettingsFlags::UseSensitiveLiftoffCheck);
MoveToActorForce->Priority = 900;
MoveToActorForce->InitialTargetLocation = TargetLocation;
MoveToActorForce->TargetLocation = TargetLocation;
MoveToActorForce->StartLocation = GetOwner()->GetActorLocation();
MoveToActorForce->Duration = FMath::Max(Duration, KINDA_SMALL_NUMBER);
MoveToActorForce->bRestrictSpeedToExpected = true;
RootMotionSourceID = MovementComponent->ApplyRootMotionSource(MoveToActorForce);```
something like that
we use the same for things like knockback, dashes etc
(different RootMotionSource
but the same principle
then you start the movement on client, then tell the server to start the movement
and it will be full replicated to all players
without correction using the CMC
not really beginner friendly
but it is a proper way to move the player
if the target is on the floor, you could do something even simpler
you can do something like this
Hero->GetCharacterMovement()->RequestPathMove(CurrentMoveInput);```
this only has to be done locally
on tick
ignore the name, tho, RequestPathMove, just calls Internal_AddMovementInput
and you can move the player all locally by sending CMC inputs
but this is not done over time
this will be moving the player as if he is applying movement input
RootMotionSource really makes sense if you need to do something over time
just ideas, ill leave you to think about if
it*, if you do decide to go SetActorLocation, just make sure you also multicast it, else simulated proxies will see the player jitter everywhere
Ok, can I ask how do u multi cast it? I've heard about it but we're still getting into all this Multiplayer stuff
Hey friends!
I'm looking to develop a game where sessions can be hosted or joined, meaning you may be a listen server or a client. I must be reading the wrong parts of the documentation, because while I have an understanding of the different netmodes, authority, role, etc., I don't quite know how to manage switching these models at runtime. What parts are responsible for that? How do I actually start as an offline client and then become a client or listen server afterwards? As far as I can tell, world travel is involved, but I just don't know what flips these specific switches.
Would appreciate a general direction / keyword / tutorial / document that I'm skipping over, etc. Seems like something that should be a bit more known, but I must be searching for the wrong things. Bonus points if whatever resource mentions local (non-splitscreen) multiplayer re: correct network config / management of playercontrollers
Thanks in advance for ... anything!
hold on i got a youtube link for you that's right on target for you i think
@loud jewel https://www.youtube.com/watch?v=XlqHG1egnn0
UE4 / Unreal Engine 4 Multiplayer Playlist:
In this collection of videos, we will cover setting up a project for both local and networked multiplayer projects.
This Video:
In this video, we get the project ready for all of our networked gameplay by adding the Steam Subsystem ...
this is part of a short tutorial series.. the videos before this he shows local multiplayer.. but this video and on are about how to get a game up and running for multiplayer.. hosting a level, using the game instance.. stuff like that
i've followed along with that tutorial and was able to build and play on steam vs my laptop on the other side of the room
This looks super helpful @strong vapor , will give the whole thing a run. Thank you so much!
right on! he also references a pdf file in that video by a dude named cedrik? if you've never gone through that piece of unofficial documentation its great
i would say its pretty official at this point ๐
[Help] using the network profiler.. what are some good numbers for the bytes per sec for like a shooter game with lots of Ai being replicated
PC build
maybe Xbox
Oh dang this PDF is good
This diagram. I drew it out for myself just to make sure I had my shit together when reading the documents. And here it is, but done way better ๐ฉ
@loud jewel if you get through that and you cant get a modern version of that plugin.. i think you can make your own modern build of it in your project.. if you have any trouble with that
just have the version of the engine thats the latest one you can get.. and then make a project.. put it in the project plugin folder, upgrade the project to the engine version you like.. and then it'll build the plugin for that engine.. you can take that version and copy it into any project you want
Yeah when I got around to it I figured I'd just read the source. Either way, sounds like a good one. Will try the newer Epic Online Services stuff alongside it but should still tell me the things I know as far as I can tell!
Does any 1 have the link to that ue4 doc that exaplains how to to replicate the look up angle with poses?
i cant seem to find it
i have the code in a project that im working on gimme a sec
here's a youtube search.. the top one looks ok
just skimmed through it
I think i just use a replicated variable.. float to represent the pitch
i managed to find it a few seconds after i asked
i was missing the "aim offset" so i was having a hard time finding it because i couldnt remember the term
So each of my characters is either an impostor or not an impostor (among us murder mystery game)
so that's a boolean
But for some reason, when a player dies and i have to check if its the impostor, i always get false
Which is odd.
I don't think I have to replicate these variables?
are you making sure to use Switch Has Authority?
sounds like something that you'd only need to know on the server?
[Help] whats a good bandwith kb/sec for a game with players and Ai.. kinda like Sea of Thieves scale.. not many clients.. but a fair amount of Ai stuff being replicated
should i use pawns instead of characters for my Ai? i've been thinking of trying to do that
they look like crap just having replicate movement on instead of having a character inventory component.. i know theres a lot of fancy replication stuff happening in there
any help please
whats your question?
check above please
4 hours ago
Please I'm stuck
Ican't move on my project if I don't find a solution
im not really great at navigating this stuff.. if you can repost the text or just re explain?
i dont even know if im at the right level to help you
im only about 2 years into Unreal
@vagrant grail I'll help if i can
ok so im slowly starting to lose my mind
or just put a print statement can help sometimse.. its werid
Why doesn't this shit delete the widget? ^
you might need an extra replicated event in there to mediate?
because of ownership?
im not sure
like.. you're calling a server event on something from a widget
have a server event on the pawn or something
cause the widget doesnt exist on teh server
whats the script that is doing the destroying and the all actors getting
is that the gamestate?
@strong vapor I'm following Virtus Tutorial on How to do Steam Multiplayer game, but I get an error when I try to test the network part using 2 players, any help please ?
yes,the gamestate
The thing is the play menu to test your game isn't the same for the network part as the video
I have this
and he has this
its listen server i think @vagrant grail
cause you dont have network ownership of that i dont think
i only want the "admin" to delete the widgets
call that event on the gamestate from the widgets pawn
you know, "start match after teams are balanced"
cause the pawn exists on the server and client.. so when you run Server events from it.. they actually get pushed to the server
you cant call server events from a widget
cause it doesnt exist on the server
so yea.. like a few mediating events on your character or pawn or whatever
one thats just a vanilla event that your widget click event will call... that will lead to a "server" rpc event that goes to yoru game state
that would mean : guy presses a button in widget -> cast to event in player character that casts in gamestate that does the interface?
but your gamestate also .. server doesnt know about widgets
yea.. but just leave the gamestate out of it
i dont know why that would be a thing with closing a widget
some guy told me to use gamestate half an hour ago
either your player controller or your pawn/character should probably own the widgets?
@plucky crow Aright but I keep getting the error anyway
im not a huge fan of virtus.. but he's probably way better than i am.. im only about 2 years in but i have thought that some of his stuff was a little barbaric lol
@strong vapor probably the pawn or character yaeh
the guy said "Yes.
You can do it in game state
Game state is replicated to all with server authority. So admin can call event that is multicasted to all and teigger once locally instead of watching a variable at tick"
end of quote
ya maybe do an "isvalid" on the widget before you try to do stuff on it.. that'll get rid of the error. but its doing htat cause its not valid.. on the server lol
huh..
so i know how to make the whole game
yea like i said im not a huge authority on this
even the fucking shop and the classes
but
the only thing that i cant make
its the fucking ui
i have some working ui in my rpg game im making
hmm
maybe i can jump everyone to a new map
after its loaded
(like after the admin presses the button)
i think thats how overwatch does it
and im pretty sure its like... i hit a button to interact with a guy... the guy sends my pawn some information about what he's got for sale... that gets passed into a widget thats created.. i click the one i want... it then sends that info back to my pawn.. which sends it ON THE SERVER to the gamemode.. where it sees if i has the money to pay for it
and then if i do.. it gives me the shit.. gives me a bool that says yes he got it
that the pawn receives from the gamemode on the server
and then the pawn sends info BACK to the widget on the client
and the client shuts the menu and sees the item added
ima try your idea with the pawn server thing
and if you're tryin to get stuff workin on steam theres another dude that does a really good one.. really consise.. let me get the link
UE4 / Unreal Engine 4 Multiplayer Playlist:
In this collection of videos, we will cover setting up a project for both local and networked multiplayer projects.
This Video:
In this video, we get the project ready for all of our networked gameplay by adding the Steam Subsystem ...
this guyyyyy
super concise.. doesnt waste your time AT ALL
i know him, i used some stuff from him for the join session
ya he's legit
i like him better than virtus.. but anyone who's puttin out mad free tutorials gets a like in my book
i really like the tomatoes guy.. lol
player controller is a better option maybe if you're doing this in a game menu
im just looking at my logic now and i do mine on the player controller.. but im look at like a shop keeper actor i have
is passing a pointer to an object from a RPC heavy? what exactly get sent?
@novel hemlock shouldnt be heavy, but i am pretty sure u are not suposed to do that
a pointer, points to memory in your machine, other machines wouldnt be able to use that pointer
depends what is being pointed to
if a netguid is already assigned to this object (i.e. because it's a replicated object, or the server has send a reference to it before), it will send the netguid (~2-3 bytes)
if not, it will send the full path to the object as a string
oh so ur not exactly sending the pointer, just something that will tell the server what to use
i didnt know that
still i never had to send a pointer
if a netguid is already assigned to this object (i.e. because it's a replicated object, or the server has send a reference to it before), it will send the netguid (~2-3 bytes)
@fleet raven thanks really interesting
Im trying to spawn a particle effect for all the players in the server, some tuts say that you have to use a multicast RPC which i did and i managed to spawn the effect in the server BUT the other players are not seeing it still
if i run without a dedicated server i can see it
ok so i just found out that if i tick the "replicate" box in the actor that it works but i still dont know why, can some one shed some light on this? whould't a multicas rpc replicate regardless?
rpcs can only be sent to clients the object is being replicated to
Is there anyway to test your multiplayer game on steam without joining steamworks and paying $100? Can I still use the Spacewar test if I'm just logged in as a client?
@limber gyro Actors are your basic networking class. What happens when you call a multicast RPC is that more or less your server version of the actor that the RPC is called on tries to tell every client version of itself to play that event. Thus, if your actor on the server and client is not replicated, you simply have a different actor for the server and client that have no identifying way to know that they're supposed to be the same. If it is replicated, they're still two different objects, one on each machine, but they know that they're supposed to be the same actor and that the server's version can send RPCs to the client through that actor. And if the client 'owns' the actor on the server's side, the client can also send server RPCs to the server through that actor.
Multicast can be called from a non replicted actor btw
replicated*
only Client/Server RPCs need to have a owning connection for that actor
@meager spade u could just spawn an actor on the client and then multicast it, even if its not replicated?
that sounds hacky
i spawned a actor on the server and then called a multicast, so i was under the impression that the multicast would still be called even when the replicated tick box wasnt ticked
i mean, a multicast is suposed to be sent to all player regardless right
i never said that
i said a an actor can send a multicast without being replicated
if its owned by the server
then again i think it has to exist on every client (loaded from the package)
i think that is the caveat
Is there a way to get a steam user's name from an ID that is NOT a friend
I see https://gamedev.stackexchange.com/questions/124303/getting-display-name-via-steam-id-for-non-friends which says to use GetFriendPersonaName
but that is returning Unknown for me from a steam user id that I put in that is NOT my friend
you can't get friendpersona name from a non friend
I would like to make a multiplayer game, that people can sit on a same room and watch videos together etc,
for that i want to use voicechat function, and also web browser, Video player.
what kind of session or service should i use? Amazon Game Lift? epic online service? i see many tutorials based on Steam but people who I will enjoy together will not have Steam account, so for best i would like to use Google account ffor this.
none want to help me ๐ฆ
I'm trying to do a dash through addimpulse and root motion source, clients other than the owning client are getting corrections (rubber banding) is there a way to debug this?
use one or the other not both.
I meant both individually
so i want to assign one character a role
or one player a role
random player
and the server would do that, right?
but the server would alwasy pick the listen server because if you cast to plkayecharacter as the game mode run by the serbver it always casts to the listen server?
:(
@meager spade so its not possible then?
doesn't make sense - other games do it
I found out the web api can be used to do http calls and you can access anybody's information through that if you have a web api key
so maybe that's how it is done
where a POST request is done and you get the data on callback
none want to help me ๐ฆ
@vagrant grail told you it should be in advanced session, its not about wanting to help , its about knowing shit about multiplayer
i barely made a widget work xd
@plucky crow what should be in advanced session ?
@plucky crow Did you get that Widget menu thing working?
[Help] I'm having a hard time getting these GameNetworkManager settings to come through.. I've tried restarting the editor and tried deleting binaries and re building.. and i still dont see an effect on my bandwidth.. im trying to lower it first to see if it works.. but i still see it going above my specified limit..
super concise.. doesnt waste your time AT ALL
@strong vapor Such a useful tutorial - got hosting, joining, steam subsystem and health replication all working this afternoon. Thanks for posting!
nice dude!
@plucky crow Did you get that Widget menu thing working?
@strong vapor yeah mate
some guy with 4 years of experience helped me
i had to do has authority in widget, go in game instance , make and call an interface there that calls a custom event multicasted on everyone's controller
now the menu works just as i wanted
will start making the elimination gamemode either today later or tommorow
@plucky crow what should be in advanced session ?
@vagrant grail just compare your settings or just download the copy of the guy's project from unreal
google it
google it
@plucky crow
Do you maybe have done voicechat? My voice Chat is Not working in Multiplayer Session (4.25)
i haven't and i don't think i will add one
there is a way tho
to use discord as your voice chat
Law Breakers did that
Hello guys. We're using the ability system in a multiplayer project and are moving some characters using the Move Component To on the Capsule component to move them around. They move as expected but the camera seems to be lagging a bit (from the players point of view) do I have to replicate any specific variable? We're already replicating movement, not sure if I'm missing something.
@harsh lintel dont use impulses, do a lerp for positions
im trying to spawn a niagara emiter with multicast, its a bullet trace thing, but it is spawning for all the players in the server
why ideas why this is happening?
Can anyone help me get a server set up to receive connections from the internet?
I have the server all good to go but I can't get any ports forwarded properly. I used to do it for minecraft servers n what not but I must be missing something
can you connect remotely to your server? just to make sure its a port issue
I can connect locally
I've just been hosting on my PC for testing purposes
like I was able to get 2 builds going and connected, and could see either client moving around on the other
yeah ik but as far as the server communication with a client it's all clear
and we already tried
can't get a connection externally
so it must be a port issue then
if it is indeed a port issue, you are probably better of searching in google
yeah, I've forwarded several ports and checked with this https://www.yougetsignal.com/tools/open-ports/
The port forwarding tester is a utility used to identify your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall.
and every one has shown as closed
well then, you got ur problem then
yeah, I'm at a loss rn
I think it might just be fkn xfinity bs. They changed the tools so now it directs you to their webpage instead of the standard router page
[Help] Anyone know anything about setting network bandwidth limits? from GameplayNetworkManager thingy in some Ini file? some people say its your engine.ini.. some people say its your Game.Ini... it hasnt worked for me so far.. im first trying to just restrict it just to see if i can get it working
and also if anyone has a good idea for what i should set those that would also be helpful... im doing a medieval game with like a dozen or less clients but with Ai in the world who's actions would need to be replicated in certain cases obviously
hoping to get 100 character scripts with Ability System Components going at once
able to use abilities and stuff and replicate movement
sort of a multiplayer skyrimmy kinda game.. stylized.. really basic stripped down.. but it does function.. im optimizing it right now and its not terribile. but im just tryin to look at everything i can
@strong vapor optimization comes after implementing the game
and unless you do something crazy, you won't need optimizations until you hit 40ish AI and 8 or so players
which is about the time you need to start making them
premature optimization is death
we haven't touched our global network settings until we had over 150 AI running around, and the game runs fine with 16 players
@jagged olive any troubleshooting of connection issues begins with reading server and client logs
so your server opened the level in ?listen mode and never received a connection request
and your client timed out
It's port shit
No the client presses connect and no logs happen on either side, but local connections work
also, when it logs the entering listen mode
"listening on port XXXX"
in the logs
that port has to be forwarded to the PC hosting the game on your router
I tried
doesn't matter if clients port forward or not
so you logged into the router via its web API from your PC
yep
you pulled the PCs local IP address
but xfinity changed their portforwarding tools
so it brings you to their webpage and it's dumbed down
and forwarded the TCP/UDP port the server is listening on to servers IP address?
