#multiplayer
1 messages · Page 430 of 1
let me ask yal 2 questions:
- i've seen a lot of example projects not use SWITCH HAS AUTHORITY , is that to make things faster?
- What kind of player code should always use SWITCH HAS AUTHORITY? for example can I exclude it from things like jumping, sprinting, shooting, etc... to make the logic on the client side faster
@copper grove SwitchHasAuthority has nothing to do with how fast the code runs. Its a node that helps you determine what Network context the code is being run on, typically either Server (Authority) or Client (Remote).
right but that in itself
that check
for something like sprinting or jumping
needs to go through all that process
and im wondering if that affects performance, client asks to jump, has to run that code on server, server does it, tells client to jump
That is a necessary part of networking in an Server Authoritative architecture. The Server determines the state of the game and the Clients simulate that state, one of the main benefits of that is that it stops many forms of cheating.
The Client tells the Server what inputs it wants to have processed in order for the Server to update the state of the game to reflect that Players choice of inputs.
I've heard recently that some games forego cheating prevention, in order to benefit performance, and I'm wondering if this would be useful in this case
Thats up to you.
It's less performance and more perceived latency handling
If you do something client authoratative you can do alot of FX and hit reactions immediately and dont need to wait for the server to confirm anything
it also opens up alot of exploits and general consistency issues
@copper grove
What you can do sometimes with server authoritative approaches is clientside prediction. The client basically executes things ahead of server confirmation, where the client basically assumes that they are okay to do something (judging by the world state they currently know), and the server corrects them on the off chance that they are wrong. You can do this for most movement stuff really and anything that requires some immediate feedback upon input.
That makes sense. Correcting them if they are wrong. Especially if it isnt score critical let them go ahead and execute and then correct if needed.
yea you basically have to consider for everything how important it is to keep it consistent vs. how quickly you want client feedback
In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking. Register for GDC: http://ubm.io/2gk5K...
this is a pretty long one, but it explains the mindset behind writing networked stuff pretty well
with a bunch of visual examples
Cheating asside if you don't do things right things get of sync real quick
my game is fine, dont get me wrong... i just wanted to see if there was instances where i could cut corners, for the sake of performance
im going to test nativizing just the player character (where most of the code is running from) to see how that affects network performance
it shouldnt really affect network performance all that much
it might make the class maybe run faster on the CPU, but you are still sending the same packets pretty much
Hello guys i am doing "get steam UID" if not working on pc "steam" not gave me "error" or "not login". so, when start game without steam, gets my local computer name. not get any error. Why?
installed advanced sessions
idk which topics for that, posted here.
The PlayerName on SubsystemNULL is the Computer Name
but subsystemNULL are disabled? or how perm disable it 
i have steam but without start gave local computer name i want to gave error if not work on pc steam
Then you need to check if the Subsystem is properly logging you in
I haven't touched that yet and i'm not sure if Advanced Sessions plugin has that feature
sad
Thanks then
ohhhh i did it nice clue
Thanks @thin stratus
how to: Just Disable it:
Sry for my bad mind
(Cuz its defaulty enabled)
Though this might be annoying for development & testing
The NULL OSS is pretty useful since you can work on a local network without Steam etc
no mate only i want work on steam.
then disabled it no longer get your computer name and gave "unlogged" error
i want to this anyway thanks
Now same getting this problem :c https://answers.unrealengine.com/questions/835661/connect-to-a-dedicated-server-using-steam.html
I am trying to connect directly to the dedicated server via the command "open 127.0.0.1", but if I am connected to the incentive, it is unsuccessful. If you disable steam, the connection is without problems. Tell me, please, what should I do?
You need to use Steam to connect
Which is why I suggested earlier that you keep the null OSS for development
Still disable Null OSS. But if steam force closed then opens both server and client and typed open 127.0.0.1 has connect without problem.

Either you use Steam for your online or not
If you use it, you need to connect with a steam handle
Not an IP
damn so cant fix it? need to connect server IP with steam UID
@bronze arch When Steam is the OSS, you need to use "open steam.<uid>"
@karmic briar If you need someone to make a tutorial just for you, then you should think about hiring an tutor instead.
Or just learning the stuff yourself.
Not everything has or will have a tutorial
I've been testing out our dedicated server with a few test sessions and it's been responding really well. So far though, the tests have been a single instance of the session and auto-directing our players into a single session. I know common practice would be to run multiple sessions per server, but any tips on how I would go about setting up single dedi-server that would create new sessions as needed?
if one is tied up with port 7777, will the next work over 7778, 7779, etc...?
I search a way to check if I'm client side without using HasAutority since this code should be executed inside UGameInstance::Init()
I can use a preprocessor but can create some bug with PIE :/
if (!IsRunningDedicatedServer())
{
}
did the trick 😄
@thin stratus i can find someone but i dont know who have try it
im willing to spend the money
but i look into the documentation nim confused af
What's your motive for spatialos ?
I mean I don't understand how people who're not building a MMO for a large company would need it
TBH, anyone (even solo) could do a SpatialOS project.
The problem lies...with their pricing
Customer Support could be better also
Everyone's first game is a MMO tbh
not sure where to ask this. anyone know how i can make an actor not net relevant for its owner so it doesnt replicate to the owner but still replicates to remote clients??
Curious if anyone has invented a solution to ping a dedicated server non steam when not connected for a browser for example
Both Linux and windows clients
Somtimes I wish I could Just search channel on here. I am certain my problem has come up before. G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(227) : error C2039: 'GetLifeTimeReplicatedProps': is not a member of 'ASCharacter' CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Public\Player\SCharacter.h(17): note: see declaration of 'ASCharacter' CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(228) : error C2270: 'GetLifeTimeReplicatedProps': modifiers not allowed on nonmember functions CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(229) : error C2653: 'Super': is not a class or namespace name CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(229) : error C2065: 'OutLifeTimeProperty': undeclared identifier CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(230) : error C3861: 'StaticClass': identifier not found CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Private\Player\SCharacter.cpp(230) : error C2248: 'ASCharacter::CurrentWeapon': cannot access protected member declared in class 'ASCharacter' CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Public\Player\SCharacter.h(78): note: see declaration of 'ASCharacter::CurrentWeapon' CompilerResultsLog: G:\Unreal Projects Backup\CoopProject\Source\CoopProject\Public\Player\SCharacter.h(17): note: see declaration of 'ASCharacter' So I have included Net/UnrealNetwork.h , but I am finding conflicting info as to whether or not it just UnrealNetwork.h or the way I have it.
{
Super::GetLifeTimeReplicatedProps(OutLifeTimeProperty);
DOREPLIFETIME(ASCharacter, CurrentWeapon);
}``` From My cpp
Prob need to see the .h lines
#include "SCharacter.h"
#include "Components/InputComponent.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "GameFramework/PawnMovementComponent.h"
#include "Components/CapsuleComponent.h"
#include "Core/Characters/Components/S_HealthComponent.h"
#include "CoopProject.h"
#include "Net/UnrealNetwork.h"
#include "SWeapon.h"
from the header file of my character /*The current weapon equipped*/ UPROPERTY(Replicated) ASWeapon* CurrentWeapon;
#include "UnrealNetwork.h"
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override; in header?
Why yes... Replication might need network libraries
from your error, i'd guess you're missing the const bit
hey guys can you tell me why the rotation is not replicating? If I stand still and rotate, the player moves really fast from one rotation to another and if I move, it always looks North, on all players (which makes no sense to me). I've had this problem for a long time and it's driving me crazy...
because it's a multicast
no wait
nonono I got it
my problem was I rotated the mesh and not the 'cylinder'
don't know why it makes such a mess bc my cylinder is a child of the mesh but ok
now I have another problem
on my client side, when I move it laggs/jitters
any idea?
because it tries to set the rotation based on delayed value from server
thus the "skip owner" I mentioned
How to skip it?
nevermind
somehow after some attempts it suddenly worked
probably a bug
hello guys, I'm a newbie in the world of unreal, I'm doing multiplayer by blueprints using the steam plugin the only thing I do not know, is that having 1 single character when another user enters uses that same character and the skills are superimposed, To say that I use skill 1 and without the other pressing it is activated. sorry for the English
For a multiplayer back-end (finding current sessions in p2p, storing player data, etc...) do you normally go the node.js route? Which database implementation do you use?
I used a python rest api with mysql on gcloud's compute engine
but in my case, requesting and saving data was uncommon
for something realtime i believe its something really different
Thank you @winged badger for the clarification. I ended up deleting the code and putting back in again. I think i had something misspelled somewhere.
@solar flower steam does all the matchmaking stuff for you and you could look into playfab for data and such
Steam doesn't handle cross-platform matchmaking does it?
oh cross platform I wouldn't think so
I believe MySQL has too many issues... Even the other database channel discourage people from ever talking about MySQL...
Steam used to do that for Portal 2, but not sure how that's handle...
What issues do people run into using it? And what do they go with instead?
I'm doing p2p matchmaking cross-platform so a phone could technically be the listen-server
they might have a way to find sessions on other platforms and route it to their servers
Not sure how dynamic IP comes into play when searching for the session
but I dont have any clue how you would do that
joseph you might be able to join via ip
but I dont know how you would find the actual server
My current thought is that i'd store the IP of the host in a database, then show a list of all IP hosts to the clients. When the clients pick one to join, they just join that IP and enter that session
I've got a mobile phone connecting to a PC and playing together real-time currently
But that's using a hard-coded IP
that would work on lan
but there would be no way to route the connections
over online
Why not?
can't client pc be used as a host? I remember back in the good ol' Xbox 360 days where we had host migration...
I'm not sure what its called but thats how it is so easy to connect over steam because you dont have to deal with port forwarding and what not
dedicated server?
VPN channel?
Steam does some trickery to allow them to punch through, if p2p doesn't work I'll just go dedicated. But it'd be cool to try
Just realize it still requires port forwarding...
lol
Joseph, when you install steam, steam basically opens the firewall for each and every games you install..
just fyi
ah
if you go to start -> run and type wf.msc
you'll see a whole list of steam games opened up based on application location.
Could i do that from a game install without using steam's onlinesubsystem for matchmaking?
That would solve the PC issue, assuming i could track down which port it opened
You'd have to tell the client to open firewall, or let the game do that for you. When you install games, firewall will typically ask you if you want to allow ports to be open regardless.
As if that's not the most standard way when you install games nowadays...
but theres still the issue of the router
the router has to open that port too
so I have no clue how steam bypasses that
can't imagine using https protocol...
When i port forward, that opens the port on the router?
pc firewall will open ports for the games you install, thus does not open port on your router.
You'd have to manually configure your router to open the ports, otherwise, some ports are already open on your router by factory recommendations.
Sounds like i don't need to worry about it if the PC ports are open
And that the PC ports are opened by installing the game through steam
some of those ports are often used for things like email (20), https (443), and ftp services (25)?
I think I got the ports wrong. Correct me if I did.
Yeah I did get that wrong.,.. port 20 is FTP, Email (SMTP) is 25...
So you guys don't do any back-end web services for your multiplayer?
Storing experience, leaderboards, custom matchmaking, etc
Or you pay playfab for it?
Seems like the quicker route
playfab is relatively easy
why is it that wehn i to get get player state from pawn its invalid but when i do get player pawn and then get player state its valid in basepawn in srv_death rpc
So I'm calling a interface on the server version of an object. that object is SUPPOSED to call the client side event, but it just runs it on the server instead. Any ideas why?
Well, is that actor owned by the client?
Cause otherwise a ClientRPC has no "owning client" it can call on
Anybody has a good tutorial on RootMotion animation network replication?
@polar pine I believe if you are not using steam what's to stop you from using an installer like installshield or a .sh script to run commands to open ports for the end user
@summer tide you want a optimized solution like Fortnite or simply replicate an animation ?
how many players can handle your game ?
why Fortnite can't use Rootmotion ? @grand kestrel
actually you can enable physics rotation during root motion
root motion is only safe in montages when networked
yup
no problem 😄
I'm tired, it's 1.30am and I'm sitting in my car waiting for a tow truck, so I'm trying to kill time
haha
Engine sputtered and died
erf :/
My life right now.. My luck sure sucks
but yeah I don't think Fortnite use plenty of rootmotion animation, but actually the Gameplay Abilities give some RootMotion node which is super efficient when you have a large scale game and you don't want to play montage on server side, so you simply need to play the rootmotion on server
to make it simple, Client play montage, server play rootmotion using a Vector Curve for example
All, I'm a little puzzle about something related to sound and MP. When a player fires, it generates a server side event that gets multicasted to all players. One of the effects of this is to play a sound effect at location of the shooting. Unfortunately, after a certain distance the players cannot hear the sound (not for attenuation reasons, because the player with the listening server can hear these sounds at the same distance).
What are my option to make shooting sounds always relevant?
Do I need to make the actor calling "play sound at location" always relevant?
it should be tied to network relevancy, along with the multicast
other than that, it's playback configuration
how do you tie a sound to network relevancy i guess is my question
right now the weapon (replicated) issues the call to sound
the multicast event that triggers the sound
so should i set the gun to always relevant?
multicast events do not trigger outside relevancy range
oh
so how can I make a sound heard even outside relevancy?
these are sounds 2km away
then you need to make the whole actor always relevant
the actor that issues the multicast?
but like 2km is quite a stretch
I wonder if forcing a net update could override that 🤔
also sound from 2km away is probably quite an event itself
so the actor with the multicast should be always relevant...?
well, yea that would be one solution
ok thank you
but like, in comparison a thunderstrike has about 5km hearing radius
so you're talking quite a bang there
it's guns in a forest
they can be heard at 750-1000m away
however right now they can't after 500m or so
making it always relevant is going to force it to use bandwidth all the time tho
even if it's way past visibility range
yes that's why i won't do that on the player
i'm thinking maybe on the bullets themselves
on begin play
I mean, sniper rifles shoot at 1km
so they just have to be always relevant anyways
I don't think you can do that on bullet itself tho
wouldn't work on automatic weapons in that case
refire delay being less than 1 tick would cause duplicate playbacks
I mean sure, you could increase the relevancy distance for loud weapons
can this be done?
should be in the actor settings
i can't even see what the default distance is
Oh sorry probably is 225000000,0
Net cull distance squared
I don't understand what this means though 😄
will google
ok so it's 15000 so 150meters
@rare cloud Not like Fortnite. Simply replicate root motion animations such as a player's all movements.
So I'v speed set to 0 - 2. I need to know what to do to replicate my player's movements. Which variable and when they need to be replicated?
anyone familiar with Playfab?
For some reason my game is trying to replicate a destroyed actor, and this causes it to crash.
what flags does it have? expand the UObject until you can see them
@thin stratus sorry, i was asleep. no, it doesn't own it. whats the best way to call it then?
In Server owned Actors you can only perform Multicasts from Server to Client
So you either need to make sure that the Client owns it (SetOwner and pass the PlayerController or something that is owned by that)
Or use another Actor that is owned
Only one client at a time can own an actor
So if two or more clients can use the actor at the same time, then you need to rethink your system
I gotcha. yeah, I thought using a interface would solve that problem
guess I was wrong. thanks. 😛
i have an actor that is replicated, placed in the level, so not spawned manually. is there a way for the actors to communicate with the server? usually those actors don't have a owning connection, so i can't really use RPC's, or is there a way?
if you expand the UObject hierarchy in locals for that Actor
you can see the flags it has
yeah, that actor wasn't destroyed
something fishy is going on, if that is the same Actor
Is there a reason why it would crash at
{
for ( int32 viewerIdx = 0; viewerIdx < ConnectionViewers.Num(); viewerIdx++ )
{
if ( Actor->IsNetRelevantFor( ConnectionViewers[viewerIdx].InViewer, ConnectionViewers[viewerIdx].ViewTarget, ConnectionViewers[viewerIdx].ViewLocation ) )
{
return true;
}
}
return false;
}```
At IsNetRelevantFor()
It's giving an access violation
@winged badger Any ideas? :o
not really, the first screen shows Tick function being null, among other things
second doesn't have RF_Destroyed
have you been playing with ReplicationGraphs?
Nope!
@yaakuro#6648 those placed actors can be marked as replicated, in that case they are owned by server, unless they are possessed by a player. All actors really belong to server and only possesed actors can belong to controlling player.
RPC works if u call from server
@yaakuro#6648 above
@winged badger what does RF_Transactional mean
@keen thorn the thing is, the actor plays a sound using an audiocomponent, then using onaudiofinished to check when it finished it. that event i like to use on the server side to inform all other actors on the clients to continue to another sound for example
but i can't use RPC somehow
just to tell on the server that the audio finished
so, I keep running into issues replicating objects that don't have an explicit owner
basically, what I'm doing is that I have some FItemStack with a NetSerializer
inside, I have an array of UItemPerks
that are instanced
ItemPerks are instantiated per-item, but they don't have a good outer
does anyone know of a good outer to give these objects so that they replicate without crashing?
how would that happen?
it just does
i had an ActorComponent as the outer
because like
replicated UObject's outer was Actor owning it
FItemStack can't replicate without being a property of a replicated actor
so if I can somehow get the object replicating the item stack during NetSerialize and set the outer for all of it's subobjects
that would fix this issue right up and I don't have to deal with changing ownership
Stack is a struct with a NetSerialize function
Perk is a uobject that doesn't really have an actor as it's outer
because it's just stored in the Stack
what creates it? CDO from editor?
Stack is replicated either because it's in an inventory or it's in a ItemStackWorldActor
an "Item Generator" which is usually instanced
the item generator is not replicated nor is it a suitable outer
@winged badger Sorry to interrupt you two, but do you know if there is a way to check if the object is nullptr before calling Actor->IsNetRelevantFor()?
IsValid
I don't know how :(
i mean you can just put a weak pointer there, and keep them alive and in sync with a combination of TArray and FFastArraySerializer callbacks
as long as they are replicated, so their NetGUID has meaning
yeah, but then who owns the object?
but the item stack has the array 😛
i can't give it to the player, because a player might not be holding the item (it might be just laying on the ground)
so that is some global manager?
no
the item stack holds the array of instanced perks
an item stack is only replicated when either in a player's inventory or as a property of a replicated actor
the problem is that the stack can pass around freely, so the owner of the perk can't be one of those objects except when it's replicating
Item and Item Stack is an interchangable term here
(technically my code makes a slight distinction, but it's irrelevant for this problem)
Item Stack has an array of Item Perk instances
Perks are UObjects that need to be replicated
ItemStack is a struct that is only replicated as a replicated property tied to an actor
the process that a player uses to get an item is they approach like a Chest
So... UHH, how do I stop replicating destroyed actors/null actors :x
and interact with it
the chest generates items with perks
creating a WorldItem actor that is replicated (and contains the Item Stack)
player interacts with the WorldItem to put the item into their inventory
Inventory is just a component on the player
perks are completely random?
yeah
they can be
they are designed to do both diablo-type random modifiers or things when gameplay events happen (i get shot, so do something to the shooter)
an Item can have any number of Perks
i just need to replicate the perks
why not just simulate? sending a seed/instructions to the client how to create the exact same perks on its side
isn't that difficult
because there is instance data in the perks that may be replicated
ie: if a perk is a killtracker
i need to replicate the number of kills that perk is tracking
for example
and if I give that item to another player, the perk should keep tracking the kills (because the tracker isn't player specific, it's item specific)
I am pretty sure it's possible to replicate a UObject without a static outer
I'm just trying to figure out how to do it
it won't replicate
bool UAttributeComponent::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
for (USolsticeBuffBase* Buff : ReplicatedBuffs)
{
if (IsValid(Buff) && Buff->IsReplicated())
{
WroteSomething |= Channel->ReplicateSubobject(Buff, *Bunch, *RepFlags);
}
}
return WroteSomething;
}
you need this bit as well
I will make this object replicate whether it likes it or not 😛
I know
I just need to figure out how to add it to the bunch during NetSerialize for my ItemStack
pretty sure that part comes with RepLayout and PropertyChangeTrackers, before NetSerialize is called
i've never seen that happen
so im guessing you... spiced up your network code
forced a net update?
flushed some dormancies?
that won't help
that's fine
@gleaming vector wondering how long till you surrender and replace that FItemStack with a full Actor
probably never
I intend to have literally thousands of items
Actor is too high of an overhead for this
then simulate
that difference between "Item" and "Item Stack" that i mentioned before is there
Item is a UDataAsset that I use to define what the item is
ItemStack is that Item + Stack Size + Instance Data (like perks)
I replicate Instance data no problem. Perks are being a bitch
oh
I dont even get a valid PackageMap
wtf
if ( Actor->IsNetRelevantFor( ConnectionViewers[viewerIdx].InViewer, ConnectionViewers[viewerIdx].ViewTarget, ConnectionViewers[viewerIdx].ViewLocation ) )
if ( Actor && Actor->IsNetRelevantFor( ConnectionViewers[viewerIdx].InViewer, ConnectionViewers[viewerIdx].ViewTarget, ConnectionViewers[viewerIdx].ViewLocation ) )
I'm just going to add this, and see what happens
hummm
UObject::Rename lets me change the owner of the object
I can pass nullptr as the new name and it preserves the name
this is a viable strategy
just change the item stack's replication owner
i do not remember good experience with Rename
Has anyone ever created their own service to start/stop Unreal Engine dedicated servers as needed based on user load? what I'm looking at doing is automatically starting up a UE4 dedicated service (same IP, new port) process per match (1v1), then when the match is over, shut down the UE4 dedicated server instance
AWS
@fossil spoke - but AWS is a host. I have a server already - they have GameLift, but GameLift is outdated to 4.18 and I'm using 4.20
I want the similar functionality of the GameLift fleets, but is there anyone else who's done it?
and/or is there a way that Unreal Engine Dedicated Server handles this for redirecting players into the new port, if it's available, rather than hard coding it.
Ok. Just before I start a trek on modular characters. I'm thinking. Players define local there player. Set some enum or int to define various ID for parts.. on join there a pseduo spec. Opportunity on join. Server tells player to send data.. so it client side loads save game and feeds several values to aet. These are value called on spawn pawn for client.. should I be worries about midgame join? All values would be stores in paper so everyone has it from@the servere
Just make sure you validate anything the client sends
@odd charm hmm.. possible to notify player pawn with onaudiofinished? then call RPC from there?
@twin juniper that issue is a few hours old but Actor isn't nullptr
you're not doing anything by modifying this code
the crash is in your own game code
but you don't have the symbols for whatever reason
I think by mistake, I disabled symbols in visual studio but never figured out how to turn it back on. @lost inlet
Do you know how to turn them on again?
when you build the DLLs locally, it should spit out PDB files alongside the DLL
which VS will load anyway
if someone else on your team built the DLLs and you don't have the symbols, then you might get something like in that screenshot
The crash doesn't occur for like 3 minutes
I can run the game for 3-5 minutes before any issues occur
There is a little yellow bar on visual studio that said "It seems to be taking a long time to load, do you want to disable symbol loading?"
I clicked it, and ever since, my debug messages have been useless.
whatever native class BP_Minion is will have a IsNetRelevantFor implementation
and that game-specific implementation is what crashes
{
// We want to see if any of the Units or Structures that our PlayerController owns are within the net relevancy distance
const AInGameDeathAlleyPlayerController* PC = Cast<AInGameDeathAlleyPlayerController>(RealViewer);
if (GetOwner() == RealViewer)
{
return true;
}
for (AUnit* MyUnit : PC->UnitsWeOwn)
{
if (IsWithinNetRelevancyDistance(MyUnit->GetActorLocation()))
{
return true;
}
}
if (IsWithinNetRelevancyDistance(PC->BaseActor->GetActorLocation()))
{
return true;
}
return Super::IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
}```
This is all I have though.
and could a unit disappear during gameplay?
there's a surprising lack of nullptr checks here
Makes sense.
It still seems strange that the debugger doesn't tell me what exactly the issue is though, like it doesn't go to the exact line
bool AUnit::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const
{
// We want to see if any of the Units or Structures that our PlayerController owns are within the net relevancy distance
if (GetOwner() == RealViewer)
{
return true;
}
const AInGameDeathAlleyPlayerController* PC = Cast<AInGameDeathAlleyPlayerController>(RealViewer);
if(PC && PC->IsValidLowLevelFast())
{
for (AUnit* MyUnit : PC->UnitsWeOwn)
{
if(MyUnit == nullptr || !MyUnit->IsValidLowLevelFast())
{
continue;
}
if (IsWithinNetRelevancyDistance(MyUnit->GetActorLocation()))
{
return true;
}
}
if(PC->BaseActor && PC->BaseActor->IsValidLowLevelFast())
{
if (IsWithinNetRelevancyDistance(PC->BaseActor->GetActorLocation()))
{
return true;
}
}
}
return Super::IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
}
Something like this maybe
well you need to build the code, which will generate symbols
also i do not like to give people exact solutions
Not sure how needed the lowlevel is
I did this```bool AUnit::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const
{
// We want to see if any of the Units or Structures that our PlayerController owns are within the net relevancy distance
const AInGameDeathAlleyPlayerController* PC = Cast<AInGameDeathAlleyPlayerController>(RealViewer);
if (IsValid(PC) && IsValid(GetOwner()))
{
if (GetOwner() == RealViewer)
{
return true;
}
for (AUnit* MyUnit : PC->UnitsWeOwn)
{
if (IsValid(MyUnit) && IsWithinNetRelevancyDistance(MyUnit->GetActorLocation()))
{
return true;
}
}
if (IsWithinNetRelevancyDistance(PC->BaseActor->GetActorLocation()))
{
return true;
}
}
return Super::IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
}```
Becuase IsValid also checks if it's not pending kill
Whatever solves your issue
I shall see soon
Help me understand this insane logic I have in my head. In the game of Destiny, people are able to seamless join into another client's party by going into a specific level or area they walk in.
But that's only possible within it's defined area or destination in Destiny.
Is it possible to have seamless integrated player joining in a dynamic area of the map?
I guess I need to draw it out before discussing about this hmm
sure its possible
I think I know the answer to this but what is the maximum player connection can you have in a single game session?
I was thinking at most 200... but that sounds insane.
that does, with replication, that is a lot to handle
alright thanks!
you need to be very careful with optimisation too, including networking
unless you split each section into a different server
so when you enter a new area, you switch servers
and i know thats how destiny do it, but destiny never has 200 connections at a time
That I know... they had something at least 32 players at a time.
Hey sswires, I just wanted to validate something with you. Is there a way to turn my symbol loading back on?
Someone make this series before? https://www.youtube.com/playlist?list=PL4vARnfO6MOiTbR6nh1qlp-zU5cizkvK6
If I GetGameTimeInSeconds within a widget blueprint, will the time be the same for all characters?
I'm trying to make a timer that keeps track of how long a player takes to get to the end of the level.
In 4.21 when I PIE without dedicated server the second player screen seems blocked, at least 3d though the FPS indicator and other stuff updates, However the first player (acting as server) screen works fine. Any ideas?
And tried to reset the project settings and didn't help. And now I just tried to create a new project from scratch and the issue is not present so it appears I screwed something in my project.
hmm, the culprit seems to be my gamestate. But even if I use the default one, "GameState" it works for a few seconds and then both clients lag for seconds repetidely. But I suspect this is a different issue.
Can someone confirm? Does PIE + ListenServer lags as hell in 4.21 with 2+ players? And also any idea why my GameState makes the second player to ignore control, HUD, etc...?
ok, I figured out it's my stuff not the the editor.
hi! I have a FPS multiplayer game I am working on. I am working on implementing grenades that you can cook and then throw but am struggling with the fpp and tpp meshes and adding impulses correctly.
Since I have two meshes, neither is the root, and so if I apply an impulse to one of the meshes, the mesh goes flying but the root doesn't. Any ideas how I can apply a force to a USceneComponent that is my root?
@strong abyss sgpretty sure you need to set a collision sphere as the root, and the meshes children of that (just like you would a projectile) and add the impulse to that sphere...
Okay cool I'll try that out. That makes sense. Thank you!
planetside 2 has some interesting networking stuff
95% of it is clientside, but when you get within distance of other people the server sends as little data as possible
it also disables sanity checks as the map isnt really loaded on the server
so lag compensation will make it look like people are warping through the floors
even if they're not
its how they manage 2400 players on one server
which is a few more than fortnite
they also have some really entertaining bugs like when the tank barrels went floppy for some reason
Are there any cross platform examples anywhere? I'm working on a cross platform game and I want to know how I should set it up and if I can get different builds/configurations to run together on a network.
Example being a mobile version with scalable graphics and a pc version being max visuals. Different controls, different UI, even possibly different actors, but probably the same or similar player controller.
How should I be approaching cross play?
@fleet bear not really mp topic
but, you should start with device profiles
cvars
As for the "networking side", well, good luck with that
its def a multi topic. I'm pretty sure that the rendering options don't matter on two builds. It's more the cross platform multi I'm curious about
honestly
if someone can get me to the point where I press a button and the result shows up on all the devices in the lobby then thats enough for me to roll with
I saw that but it runs through a web interface
They have Android and iOS setup
😃
Yeah, like I said
There's no "ez button" for cross platform
(well I never said)
The only "ez way" AFAIK...and I don't like recommending because I don't agree with their current pricing model
no but there has to be some general direction as it was plainly stated 4.20 aimed at making it more accessible
gamesparks is kind of eh
Either way, you are going to need to deploy to dedicated servers
why do you think that
AFAIK at least
I don't have to think
Everytime someone asks and I look
No information has changed
Since I am generally curious for future projects
that doesn't seem right. I should be able to be the host and have people connect to me
Ah, so you mean Direct IP?
The issue is how you're going to do the backend networking 😉
it's kind of a party game
Are you planning on creating your own custom subsystem?
if I have to
k
would prefer not to
Actually, I think @jolly siren was recently looking into this?
I don't think you understand how much is involved
i don't think you understand how small the game is...
lol
joystick, one button
Size of a game has nothing to do with the amount of work one needs to accomplish to complete said features
x and y value of player, do attack button
can I not just do simple tcp stuff
👀
hello
Good thing there's a search button on Discord
@solar flower You think you can go over your recent attempts (and success) at cross-platform p2p ?
ok, so what is fortnite doing for crossplatform that I currently don't have access to?
can we keep this to an intellectual discussion and not snarky comments
?
I'm going to accomplish my goal, I just need to find what direction to start heading in
telling me they make bookoo money doesn't answer my tech question
Also, just doing some research
are they using dedicated servers for example
Of course they are
ok, well thats not the approach I need
One 2 min research could have told you that
@fleet bear Do you want cross platform, or cross platform MP ?
both
You're aware this is immensely hard right ?
shouldn't be
there isn't a reason that this should be difficult
@fleet bear You don't control the timing of updates on all platforms, to start with
ok, well assume I don't care about that for the time being. I just need a place to start
me
Cross platform is not an UE4 problem, it's a process problem
UE4 has everything you need
When do you realistically expect to launch your game ?
when It's playable
nothing is a factor
You are going to need to do a lot of backend research then
sure
Includes engine source
Sadly we don't have Paragon source
Probably never will
We'll def not ever get Fortnite
AFAIk, those are the only two multiplayer MP games they've done
unreal tournament isn't cross?
Is it on consoles?
i thought it was
Yeah, thought it was PC only
pubg
Does Ark have crossplay ?
it's on multiple platforms
Cross platform != cross play
CrossPlatform and CrossPlay are different though
CrossPlatform = Setting up builds for different platforms
CrossPlay = having PC and Consoles playing together in same map/game
Cross platform is trivial tbh, you just need different default settings
Aye
yes, aware of this. I was under the impression ark was cross multi. I could be wrong, i don't play ark
Cross play is getting your legal team on visioconference for days with every platform seller
And pay $$$$
And develop a huge MP backend
And get Apple to release your updates on your time
And Google
google is pretty good about stuff
Here's my advice
Do it step by step
First make a PC game
Then a console game
Then try to have crossplay
the point of the game is the crossplay
Then your game is doomed
it's vr vs non vr
?
ok so I'll walk you through the game
it's called dungeon master and it plays like castle must be mine for the VR player and they are facing the hero characters played by non VR either mouse and keyboard, console, or mobile.
essentially it kind of ends up being something like clash royal in a way
sort of
so vr player plays like this
as the dungeon master
So get it working on PC first
and they don't directly interact with the other players, they just manage cool downs and set up traps and stuff
@bitter oriole
mostly there already
Finish your game on PC, ship it on PC, get feedback on PC
Then try porting it
When you're doing the porting you can think about crossplay
that makes me back step a lot does it not
Anyway I'm not arguing all day so short version : crossplay is 100x harder than it's worth as an indie
It actually has negative value as an indie because of PC hackers
it's not an argument, I'm just trying to get info back and forth quickly without all the extra bloat
it's a party game, why do I care what hackers are doing
ALSO, wait doesn't rocket league also do cross platform multi? are they using dedicated stuff?
You'll need your own servers anyway
fuck it, guess i need servers
You might no need dedicated but at least matchmaking servers
can't I just use steam
Sure, on PC
mmm theres another matchmaking service
But you want crossplay
what was it, i used it before
GameSpy ?
mmm no I think It was just online subsystem honestly.
Anyway your problem is connecting Steam accounts with Google accounts
So you'll have players create an account in your game like Fortnite does
Create your own matchmaking
Handle GDPR etc
define gdpr
Google it
he General Data Protection Regulation 2016/679 is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It also addresses the export of personal data outside the EU and EEA areas. Wikipedia
@wary willow I'm trying to implement crossplay by creating a server list using nodejs, express, mariaDB, and AWS. Then registering and connecting using that. My biggest hurdle is probing the host's NAT, which I'm looking into doing by piggybacking off Steam's port. If i can't break through the NAT, I'll just fall back to dedicated servers.
@solar flower interesting. and what kind of game are you making
@solar flower You're much better off implementing STUN protocol, or ICE if you need symmetric NAT support.
It's an easy real-time tower defense. Mostly a confidence booster for my team
@sharp pagoda I'll look into those
So just write a simple stun server.
What's symmetrical NAT?
I have one on my github I wrote for a p2p game of snake I made
@solar flower Steam's NAT traversal library is pretty robust and reliable. I agree with Xenonic above (ideally, you would have your own, platform-agnostic STUN/TURN/ICE), if you can't do that easily, best to just lean in and use Steam.
@solar flower then we have similar projects
I can't use steam for crossplay
Symmetrical NAT means you're screwed. Connection needs a TURN server hence lots of bandwidth.
I.e. corporate firewalls
In short, it means you won't receive my packets unless you send some to me first.
Yea, if neither can send packets without receiving first, that sounds like a shit show
That's how NAT works? If you want p2p, that's what you have to workaround, which is why STUN exists.
Why wouldn't it be done similar to public/private key encryption?
You have to send data outwards to open a port in your nat.
Ah, gotcha
can you call server function from a client?
Essentially all you need to do (and in your case you should do) is to write a simple server that listens for incoming connections, and when it receives two connections from different addresses send each connection the public details of the other. This way you're making two clients that want to play together aware of the connection details to each other.
interesting
hmm
what if he built his game in html5?
would that simplify his crossplay situation
can you call server function from a client?
i think you can request a call of the function from the client
Look at the chart
then why the fuck when I call a server function from a client it is not executed? I've put prints before and after the function is called and a print right at the start of the function and the one inside the function is not printed , meaning its not entering there
Verify you have ownership, did you look at the chart?
You're in one of the Server dropped cases
So you know it's either owned by someone else, is a server owned actor, or isn't owned at all.
gamesparks cross platform play
In this classroom session, we will take a hands on approach, showing you how to set up and authenticate AWS backend services with your chosen game engine. Fi...
Any reason I can't set the owner of an Actor to be the client right before calling a server RPC in order to not have it dropped?
@solar flower Well SetOwner has to happen on the server
ah, well that explains that
This is what I was trying to do...
This would all be called on a server owned actor
So there's no way to rpc on a server-owned actor?
Your code doesn't make much sense
Right, ResourceTransaction wouldn't need to be an rpc, and MiningTransaction will be dropped for clients
- SetOwner has to happen on the Server
- Server and ClientRPC don't work on a Server owned Actor
Means, HandleMineRock already needs to be on the Server
How is HandleMineRock called?
Called from an ActorComponent on the client owned Character
- Character BP gets Input, calls function on ActorComponent
- ActorComponent calls HandleMineRock every x seconds
Alright then you need to place the ServerRPC somewhere between the Input and HandleMineRock
So either when you get the Input->ServerRPC->Function in ActorComp
Or Input->FunctionInActorComp->ServerRPC
Or Input->FunctionInActorComp(As ServerRPC)
And from there you call the HandleMineRock
You can call HandleMineRock on the Client in addition in case you wish to do some FX stuff
But then you gotta filter the call with SwitchHasAuthority
So you can split what the server does and what the client does
Can you call server RPCs in an ActorComponent?
as long as the Actor's NetOwner is the PC, yes
Since you say the ActorComp is on the Character
Then yeah
Character is possessed and owned by the PC
So the Comp is basically too
Gotta mark it as Replicated though
Ah, that's what I missed before
if you do GetOwner() until you run out of owners
and the last one is the PlayerController
Guess i can break this back up
then Actor or Component can do a Server RPC
You know
You could also just pass the Class
Instead of making so many different RPCS :D
At least for the ones that works the same
I couldn't find a way to expose the variables I wanted on spawn for each
Because i'd have to cast to set the class-specific parameters
Appreciate the help with HandleMineRock
Welp, Inheritance
Gonna try the server rpc in the ActorComponent
Alright!
@thin stratus Works beautifully!
Since it's replicating I just set the RockDeposit in the server RPC to avoid all the wires
Might be wiser to just set a variable instead of that ClientRPC
A Replicated one is totally enough
@thin stratus Set it for the RockDeposit?
Yeah, why would I use the snipping tool?
ShareX instantly uploads for me
- supports gifs :P
Win + shift + S is much faster then any webservice imo
Oh so it saves the buffer to clipboard and publishes it on their server?
Yeah, but I can also just paste it
And then it uploads here
Depends on the chat you use
Neat
Quick question for you friends.
When Playing In Editor, and checking the "Run as Dedicated Server"
Is any latency in that something that might correlate to a compiled build having latency?
You shouldnt have any latency in PIE
Unless you have set latency yourself via the Net family of console commands.
In your guys' opinion, what is the best way to have persistent player state in an online game? How would I go about storing PlayerState for an indefinite time until they reconnect or server is wiped?
And say a player has a place to store items separate from their character. Where should this be stored? GameState? PlayerState? Maybe somewhere else entirely?
So far I have my ReplicationGraph for my "game" working, and Players are able to pick up items and equip/keep them in inventory
but when they log out is the PlayerState saved until the server is shut down?
I'm not very aware of whats happening behind the scenes
@fossil spoke That would be something I have to manually set? Because I consistently get latency (in 4.19) and I don't remember setting anything
What do you mean by Latency though.
I could be wrong about it being network simulated performance issues, but when I do normal PIE I run the game fine, then when I simulate it as a client, the client version always seems to have performance issues that the window marked server does not
this may be a hasty guess, but my assumption is that this is a latency issue as the only thing seemingly being changed is the "Run As Dedicated Server" box, or that the other window is a client window
(sorry for that long initial reply)
You need to describe exactly what is happening that isnt happening properly. Just saying you think something is latency doesnt help at all.
What exactly isnt working.
All you have said is that you think you have latency....
That doesnt help me help you man.
Sorry, my bad
One specific issue is that when I'm firing my weapons, my UI counters don't update in the frequency that they should, and the sound wont play as quickly as it should, like sometimes it delays playing the sound, or will seemingly not play a number of the sounds
Ok great we have something to work with.
How are these things being triggered on the Client? Via an Multicast RPC or variable Replication?
Multicast RPC
the UI is a simple binding to an int that is set to be cond -> owner only
this is also all in Blueprints, if that makes much of a difference.
(I'm also not spawning in thousands of actors, I have about 20 ai in my scene, most other actors (340 total) are static geo)
I wish I'd been able to find more answers online, but google wasn't quite helping
So the issue im going to assume is that your not getting the Clients to play cosmetic events locally when they perform an given action.
Your waiting for the Server to confirm that action before playing cosmetic events.
Take this image for example
Client fires their weapon. Sends that information to the Server.
The Server confirms and fires the weapon, but then tells each client to Play those Effects.
For other clients that wasnt the person who actually fired the weapon this is ok since they cant predict that event in any way so they must wait for the Server to let them know that happened.
This is how im assuming your doing all your stuff right now.
What you want to do instead. Is have the local client (the one that fired the weapon) Play all of the cosmetic stuff when they fire the weapon, you would check if they can fire the weapon and all that jazz and also let the server know that they want the weapon to be fired (so that the Server can confirm this action and perform the necessary operations to make it happen for everyone else and to update the state of the game if anything happened because of that weapon being fired IE: damage something)
This means that the Player who fired the weapon will get instant feedback and thus to some degree mask the fact that latency exists.
I think I'm mostly doing this.
Firing happens on the server, run through checks to make sure I can, then firing logic, but then I'm spawning the bullets (actors, not raycast) and then I'm doing the effects.
Maybe part of the issue is also the significant amount of network replicated actors being instantiated? I'm not using pooling atm
and then I'm doing the effects
If this is being done on the Server then the Client that fired the weapon wont get those effects until the RTT (Round Trip Time)
You need to Fire the Weapon on both the Local Client and the Server so that the Local Client (the player that fired the Weapon) can play the effects immediately and not have to wait for the Server.
This isnt just for playing effects, things like updating the UI that displays the current ammo etc etc is also important.
So the client should also still be responsible for their own conditionals as to whether or not they can actually fire?
Yes, for cosmetic purposes.
okay, I understand
The Server has the final say and does the important things such as applying damage to other players or entities.
The Client might still do that locally again for cosmetic reasons but the Client would never update the state of the game.
Watch this GDC talk. It will help explain as well if you have the time.
In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking. Register for GDC: http://ubm.io/2gk5K...
I'll definitely make time for it, I've honestly been meaning to watch this one for a while
Its not easy to wrap your head around immediately but once you get it, it will all make sense.
Yeah, I've been trying to do this for a while now, but I'm a designer, not a programmer xD replication is... fun
Its not a small topic.
Thanks for the advice!
👍
netcode is really half designing anyway really
the actual programming of it in unreal isn't particularly difficult
also yea that gdc vid is pretty damn valuable
I’m trying to set a projectile owner it sets fine on server but not client I can’t figure out why. Any suggestions?
Im assuming you set it as replicated already right?
Yeah
I have a master weapon which spawns it
It sets the player character to the owner of the projectile when spawning it.
oh this might be important too, are you running a listen server?
It works fine if I have a server and client but if I just run dedicated server it doesn’t work
The projectile damages the client
Do you have some code around the spawning of the projectile?
or a screencap of the BP?
what do you mean you dont?
ahh okay fair enough :v
@winged badger So, it's the quaternion.
not initialized?
Oh no, it's initialized allright, it's normalized and all
But using a quat crashes the engine inside the rep code
FRotator works fine
sigh
¯_(ツ)_/¯
with the same nonsense error you get when trying to replicate TMap, i'd wager
as long as you only transfer rotators, but don't do any math with them
you'll be fine
I guess so, though I treat FRotator as a problem waiting to happen
I'm getting some fairly nasty spikes on my Game thread. It seems to be caused by Net Tick Time Anyone know of a way to dig deeper into what might be causing these spikes?
What are the best solutions for storing persistent player data between sessions?
Ie something like player level/skill tree in an mmo
if it's going to last between game session I'd write it to a database.
Is this something that kind of goes on outside of unreal?
So I'd keep a server running independently as a database?
yeah. You would want a server for the game and read data (we use JSON strings) from an external database. That way you can spin up or down game servers to handle load and a player could join any individual server.
Is serialization built into UE4 in any way?
Yeah there are a few ways to serialize data into different formats and compress it.
Alright I'll look into it thanks
That's a pretty regular heart beat of spikes
Yep. I figured it had something to do with the update frequency.
Not sure what it is but manually handling dormancy seems to solve the issue it's just extra work 😦
humm I can't seem to access a Set Net Dormancy blueprint node. Is that not in 4.17.2?
GameSession->KickPlayer(PC, FText::FromString("Victory/Loss."));
Is there a way to "Kickplayer()" to the main menu
@twin juniper ClientReturnToMainMenuWithTextReason
ok
Then we just override ClientReturnToMainMenuWithTextReason(const FText& ReturnReason); ?
if you need custom behavior
By default, it does nothing with the FText that you pass.
It just passes it, but does nothing with it.
{
if (UGameInstance* const GameInstance = GetGameInstance())
{
GameInstance->ReturnToMainMenu();
}
else
{
UWorld* const World = GetWorld();
GEngine->HandleDisconnect(World, World->GetNetDriver());
}
}```
Right, yeah you can just override if you want to do something with it
It does nothing with it, very strange!
like display that you have been kicked
iirc there's a logic reason
with onrep, you are guaranteed to receive an update eventually when it becomes relevant
an NMC RPC fires once, and if that particular actor is out of range, it wont receive the update
@jolly siren ``` Super::ClientReturnToMainMenuWithTextReason(ReturnReason);
so it's generally preferable to have status updates tied to replication
Can I call this inside of the _Implementation function?
NMC can still be used for oneoff stuff like FX
@twin juniper Super::ClientReturnToMainMenuWithTextReason_Implementation(ReturnReason);
So, we only call the non _Implementation version when we are calling the function itself?
yes
maybe it used to be used for more
but got reduced
and it was just not worth the effort to change it into an RPC
dunno
shootergame is probably smallscale enough where it doesnt matter too much
not that I know of really
at the end of the day, all it does is send a packet with arguments to the recipients to call a function
it weighs about as much as any arguments you give it
so technically an RPC can take up more bandwidth than replicating a single variable
but generally it's fine if you just pass the arguments you absolutely need to get the desired effect
Where is the best place to do something clientside when a player quits? For some reason UnregisterPlayerWithSession isn't called for the quitting client. It's called for the server and other clients, but not the client doing the actual quitting.
It's called from APlayerState::Destroyed so I find that strange
is there any way to be sure on client side that a RPC is received before replications?
I don't know what to ask exactly . I want to implement something like TiledPosition so that the tile index of actor is synced between clients and server ever 5 seconds. and position is replicated based on tile index instead of a full FVector
is there any reason it has to be replicated exactly every five seconds?
Why not use OnRep for that, sounds like it would be suitable for this
I have to sync an byte index between client and server. server sends position by replication based on index A and client must calculate the position based index A.
if client receive position data before receiving the index A I get into trouble.
btw surely I don't want to send index along with position everytime 😉
why not omit replicating the position then? Seems pointless if it's derived from tile indices anyway
also actually why not
you could pack them in a struct and keep sending them together
consistency > bandwidth
iirc even when packing them in a struct, only the components that change actually get sent
so it shouldnt actually be that much more data being sent
assuming that you have more position updates per tile updates
I want to decrease the bandwidth . instead of packing them I could just send the world space position.
mhmm I see
😬
well the only thing I see to decrease bandwidth is omitting the world position really, because I imagine the tile index is what's actually relevant for gameplay
or maybe use less precise vectors
if you do world space updates, you might get very choppy updates anyway with 100+ units
if you just have tile indices, you can just interpolate clientside
actually I previously changed the transform replication and wrote my own and saved a little bandwidth. but I was thinking about this TiledPosition idea which is helpful for big world too.
like with 120 units I dont think you can really accurately keep worldspace in sync all the time
because it's basically constantly changing while a unit is on the move
with tile only updates, it's only once per every new tile they reach
that's probably gonna be alot less data overall
does all your gameplay code use tiles for reference?
say when you wanna attack a unit
do you tell the server to attack a specific tile or do you send a pointer to the actor you want to target?
because if you do the latter, you can probably easily afford slight inaccuracies
anyhoo, I gotta run for now, brb in 30 minutes
no I think u got it wrong.
instead of sending a Vec3 position for world position every time. I want to sent position relative to the synced tile index between client and server.which 10 bits per component is enough.
ok I am gonna go home its night 😃
hello guys, lets say i regular empty actor and i want to call rpc's on it, right now the only way i know how to do that in blueprints is to use an actor that has a valid netconnection, like the player and use it as a proxy. so in Actor A i call an rpc on the Player and do some stuff there. Is there a way to dont use the player at all and just do rpcs on Actor A?
if you're doing something complex, as having a world item with its own logic and UI
you can have it add an ActorComponent containing all required logic to the Player when he/she interacts with the Object
replicated ofc
and ActorComponents are good for encapsulating related networking code, especially in BP, they can send the RPC just as well
for doing it from Actor A you would have to set its Owner via SetOwner on server to your PC
there is no other way
well, Attaching it to PlayerPawn or PC or PS would also work, but only because that would set its Owner to your PC (also needs to be done server-side)
(indirectly set Owner, as the owner would be PlayerPawn whose Owner is the PC, and that is just fine)
Is there anyway to call a function on the client when it disconnects/quits/exits the program? APlayerController::Destroyed only looks to get hit when quitting to the main menu (not when exiting the program all together). And APlayerState::Destroyed isn't getting hit on the quitting client for any of the above scenarios.
APlayerController::Destroy and UGameEngine::PreExit might work. But seems like there should be an easier way 🤔
Maybe one of the GI notify events would do
i don't know if disconnect is a NetworkError, but EventHandleNetworkError might just cover it
any of quit/exit/dc would also require closing a current map
Yeah I was looking at EventHandleNetworkError. It does look like connection lost and connection timeout are network errors
I don't know if manually quitting is though
Oh other caveat is that I don't want to call when travelling
maybe FWorldDelegates have something for you
there should be separate broadcasts for OpenLevel and SeamlessTravel
or ClientTravel
and i believe those are all virtual as well, so you could even hook your own delegate there
Kind of weird that GameInstance::HandleNetworkError is a BlueprintImplementableEvent
Now I have to override UGameEngine::HandleNetworkFailure_NotifyGameInstance instead
ah I can bind to OnNetworkFailure nvm
If you've
ActorRef->SetNetDormancy(DORM_Initial);
What's the appropriate way to wake up the dormant actor for destruction?
ActorRef->SetNetDormancy(DORM_Awake);
GetWorld()->DestroyActor(ActorRef, true);
doesn't seem to do it.
Hey is it ok to handle weapon reloading client-side or should that happen server-side?
the actual ammo count should be updated serverside
but you can client-predict the animation
Hey, maybe dumb question.
Is it more expensive to the network to have a replicated variable or to have an RPC function call?
a variable shares the overhead with other variables on the same Actor
iirc RPCs do not, but i am not 100% on that
During matchmaking how can i get gamemodes from list of session result.. for auto joining to session based on gamemodes we select in main menu
Deathmatch or ctf mode
Anybody help...thx in advance..
something something config string
or if you only need the game mode, you could just add it as a prefix to host name
and sort the session list using that
@next warren FOnlineSessionSettings is the class you're looking for, you can add any key value pair you want in there, including the game mode name.
Greetings, just to confirm if this is valid : "open 127.0.0.1?Name=MyPlayerName"
I execute this command and each time my name is MyComputerName-UUID
Are you using an OnlineSubsystem? If you are, setting it that way won't work.
I don't use one normally