#multiplayer
1 messages ยท Page 377 of 1
but this is !
aha.. indeed
you're right
yeah, i guess you MUST have an instigator information via which you'd filter
This is purely logical, as I really don't have more knowledge on multicast. There is this dude on facebook, that says 'dont use multicast for anything'
something has to be sent over the network
at least one bit ๐
SO, if you'd have 2 emotes. you'd use another event or feed the event with value?
I am sending an ID
Yeah, sounds correct that you send the ID of the sender as well
or ignore it if it is autonomous_proxy
ya, that could do the trick too
well, that's basically locally controlled, but then the server player would have a bug coz his char is authority
yeah, LocallyControlled sounds right
it basically checks if the pawn has a controller
and in networked games they don't have it
unless it's your own
so that could just do the trick
alright
I think I will go with that
thanks for your help
No problem.
So I'm trying to change a player from spectator to possessing a normal pawn. For some reason it doesn't work, and one of the people here mentioned something about a boolean that needs to be reset in order for possessing to be allowed. Does anyone know how to access that boolean? (using blueprints)
to get around that issue I removed the "start players as spectators" tick and changed the default pawn to be SpectatorPawn. This is my code that spawns the player:
https://owo.whats-th.is/aa93c2.png
note that if I do run the Destroy Actor node after detaching, it complains about None being accessed
what happens is that the player is unpossessed (can no longer move like a spectator) but doesn't possess the new spawned pawn
all that tested with dedicated server, however if I untick "dedicated server" everything works fine
Hello Everyone!
We are having a weird issue. We were working a a ThirdPerson project and starting to work with the multiplayer and it was working so so. But, now when we changed the computer in which we were developing to a different one (a new more beefy one) the clients are completely frozen. Only server works. If we run Dedicated Server all clients are frozen. Any Ideas ?
I was the one saying that the Boolean will block it
void AHLPlayerController::K2_ChangeStateToPlaying()
{
if (GetStateName() == NAME_Spectating)
{
AGameMode* GameMode = Cast<AGameMode>(UGameplayStatics::GetGameMode(this));
GameMode->NumSpectators--;
GameMode->NumPlayers++;
ChangeState(NAME_Playing);
PlayerState->bOnlySpectator = false;
bPlayerIsWaiting = true;
}
}
PlayerState->bOnlySpectator = false;
That's the bad one
That gets set if you do "StartPlayersAsSpectators"
And epic doesn't set it back to false
So when you try to possess
It tests if that is true or false and won't posses the new pawn if it's true
I'm calling above function to reset the Player from being a Spectator
Changing the PlayerCount properly
And resetting the booleans
That's nothing yo ucan do via BP only
And I don#t know if there is a plugin for that (i doubt it)
@SuperCuber#7818 @worn nymph
@zinc crater Sounds like you didn't push last changes
Or didn't copy all files
Check if the Input settings are still working
So check if they are still listed
and then print the AxisValue of your move axis
And see what happens
My problem is setting the sprint locally causes the client to sprint before the server
@PrintStringFTW#6597 yes, when I tried using unpossess it didnt work either
@worn nymph
Not that it's not allowed
But no one has time to download that
Make a video or so
@indigo root I wrote you why it's not working
Even with code you could use
@thin stratus as I mentioned, I changed it from being "start as spectator" to being normal, except that normal pawn is actually of type SpectatorPawn. Shouldn't that work?
Maybe I should make another type of pawn called ICantDoAnythingPawn and start the player as that..?
That should work
You also only need to call Possess
Cuase that calls Unpossess internally
ok, time to hack around ue's dumb choices ยฏ_(ใ)_/ยฏ
@thin stratus hey cedric, question about what u have used in your projects database wise.
What have you been using?
MSSQL, Oracle, MySql, Postgres..etc
Actually what ever fitted the project
Or some sort of no-sql solution like mongo?
I used MongoDB for a few things
Yeah I was just wondering because lots of people on here are trying to get me to NOT use SQLite in production. However, I'm not really convinced that SQLite is NOT a good solution for my game lol
Obviously in a large web site it wouldn't work
Thanks for the info though!
@thin stratus I created a pawn that does nothing and set it as default pawn in my Game thing, but it's still the same
like, the pawn is a data only blueprint with parent class Pawn
and as I said before, it works when I untick "dedicated server"
but I need it to work in multiplayer so that's not really an option
Something is wrong with SQLite?
@mellow cipher i dont thik so
the only issues i have been told is concurrent connections
like related to that
@mellow cipher im not so convinced though
there is a feature in sqlite where if the "concurrent" buffer is overflowed
it dumps the extra stuff to a separate file
and periodically merges it
with the main db
man i worry im fucking up
lel
Why exactly would a Server spawned actor fail to replicate unless "Always Relevant" is checked?
pretty simple setup... does not replicate to client unless I check "Always Relevant" but doesn't seem like the actor itself should always be relevant, but maybe i dont understand exactly how relevancy works
@thin stratus Thanks, will try. But already checked the copy and the originals. Will get back to you. ๐
Hey guys,
According to Rama's tutorial - https://wiki.unrealengine.com/Steam,_Using_the_Steam_SDK_During_Development#Packaging -, we have to create a file called steam_appid.txt and place my appid inside it. The thing is -- where should I create it?
binaries folder iirc
Thank you, @thin stratus. ๐
Is anyone here familiar with Snapshot Interpolation? UE doesn't use it, but I implemented my own system in UE for physics objects and am having some issues with how clients see themselves interacting with objects that are ~100ms in the past for them.
Anyone know why this is happening. I get these logs randomly so it seems
LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor [ACTOR NAME]. Function [FUNCTION NAME] will not be processed.
it means you tried a server RPC from an actor that is not owned by the clients PlayerController
for example: looting a Chest from a client
if you were to call Chest->Loot(Replicated to Server) you would get that message because your PlayerController does not own that chest
if you instead did LootChest(Replicated to Server) inside your Pawn or PlayerController then from there (once your execution is on server's copy of your Pawn/PC) you could do Chest->Loot(no need to replicate now)
I see
because then you tell the server's copy of your Pawn to loot the chest, and its ok for server's version of it to interact with other server owned actors
anything attached to your PlayerController will work - Pawn, HUD, PlayerState, Pawn's components, actors attached to your Pawn
I see
Yeah I see the issue happening with stuff spawning in the world with no clear owner
Like a weapon or powerup
Thanks
is it possible to get reference to inactive player states through blueprint?
Other than Gamesparks, what's a good matchmaking cloud service out there that easily supports UE4? Or what are some other options to be had?
Heh Gamesparks is now a "prime" example of why building your game around third party tools is bad
@grand kestrel Huh? Why's that?
Acquired by amazon
Ah, good joke actually, damn my sleepiness for not getting it
But, I don't know. Might not be a terrible thing
MSFT bought out Playfab
So it's not very surprising
What I am surprised about is there is not 3rd option
Not one that I know of off the top of my head though
hey guys, is there a way to hide actors only for the client as and when the client toggles it?
@placid vale Well yeah, only call the hide stuff locally?
@wary willow I think steam has matchmaking too
Given that CSGO has it and there should be docs about it
@thin stratus @wary willow It does have matchmaking. In short, it's about setting a player's stat or a lobby's key with a value that represents the skill level (or whatever) and other clients search for lobbies near that value or iterate through lobby members for their stat.
Is it just manipulating the existing session stuff to have matchmaking?
Or is there actually an automatic search on steam's end?
@thin stratus thanks! I have a replicated actors whose visibility I want to toggle
I ended up switching the mesh components visibility off
The lobby is search is sort of automatic. You can add a key/value filter and then search for lobbies and it will only return those which have the key/value (or just the key; or a smaller/larger value; the filtering system is quite versatile). And each lobby can have up to 20 custom keys or something.
But then you need some form of connecting to that lobby (i.e. owner's SteamID + Steam sockets / owner or server's IP:port)
I've added some prototype script in the latest UWorks involving a rough filtering and connection to sessions, but needs more work and will be moved in .cpp soon
Yeah okay, but that's all kinda doable via the Session Settings
I could never get that working when I tried. Haven't touched OSSteam since, though
Hello guys :)
I have a stange problem with a blueprint node in multiplayer. I try to get the bounds of an instancied mesh component to set a collision box origin/extent. However on a dedicated server the bounds extent is always 0 while on the clients the value is correct (!=0). And if I run the game with a player as host (not dedicated server), the server's bounds extent become correct.
Is it because the server doesn't really simulate every graphical part?
How can I fix the problem?
(I run UE4 v4.15.3)
In a child class, I'm trying to set replication of a variable that's been declared in the parent class. I'm getting an error
'ACharacterBase::bDied': cannot access protected member declared in class 'ACharacterBase'
Base
/* Pawn died previously */
UPROPERTY(Replicated, BlueprintReadOnly, Category = "Character")
bool bDied;```
Child
```void AHeatCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
ACharacter::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AHeatCharacter, CurrentWeapon);
DOREPLIFETIME(AHeatCharacter, bIsJumping);
DOREPLIFETIME(AHeatCharacter, bIsSprinting);
DOREPLIFETIME(AHeatCharacter, bIsIronsight);
DOREPLIFETIME(ACharacterBase, bDied);
DOREPLIFETIME(AHeatCharacter, bIsInVan);
}```
why isn't a protected member accessible here?
or should I just put this replication in base?
Sure enough, it worked. Anyone care to explain why? Thnx
@severe badger Hm, strange. Are you sure that you aren't simply filtering the DedicatedServer somewhere when the actual meshes get spawned?
Have you checked if the DediServer actually has InstanceMeshes spawned?
@magic crest Can't really tell why. Might be that the Macro is accessing it from the outside, so it would need to be public.
The replication should be handled in the base class anywhere though
Also UE4 uses "Super" for the parent class
So you should do Super::GetLifetimeReplicatedProps(OutLifetimeProps);
Yeah, I did. Aah, the macro thing. I thought I was calling it from the child class, so protected would be ok. Doesn't matter tho, got it fixed. I just followed the pattern from ACharacter
@thin stratus Every event is called from the server and well synchronized with clients so I don't think it's filtered. If I try to catch collision directly from the instanced static mesh component, everything works well... ๐ค
Asking this question from #cpp here too because it's relevant to mp stuff
FVector UStrafejumpMovementComponent::GetFallingLateralAcceleration(float DeltaTime)
{
// Why does this only work when player is the server?
FVector InputDir = GetLastInputVector();
// bound acceleration, falling object has minimal ability to impact acceleration
if (!HasAnimRootMotion() && FallAcceleration.SizeSquared2D() > 0.f)
{
// Do strafejump bullshit here
// .....
}
}
as mentioned in block
how to i get the last and/or consumed input direction when overriding GetFallingLateralAcceleration in CharacterMovementComponent?
not sure about the question posted but i know how to fix "// Why does this only work when player is the server?"
only the server can change variables related to the movement component but setting them on the client and then sending an RPC to the server will create the illusion on the client of smooth acceleration
same thing applies to launching characters
but the server will try to adjust the location of the client if it doesnt think the client should be there which is exactly what happened when i tried to implement strafe jumping
if ping is too high, its unplayable and the client will warp constantly
only solution is probably to modify the source to give client the authority to change their move speed
what im trying to replicate is that
in Quake, you gain in air acceleration if you hold the strafe keys and have you character at an angle to your current movement direction
i already get the math behind it and have a blueprint only version working but it's hacky af
basically in the line
// Why does this only work when player is the server?
FVector InputDir = GetLastInputVector();
how do i get whatever input vector the server has been sent is?
AirControl uses the last input sent to the sever and substuting that line with
FVector InputDir = GetAirControl(float DeltaTime, float TickAirControl, const FVector& FallAcceleration)
works on both the client and sever but I wanna get more direct because GetAirControl just returns the lateral acceleration]
which is more or less the input vector when normalized IF there are no other things causing the character to accelerate
when i get back to my desktop I'll post the full function
How does a player interact with an unowned actor in scene to call Server RPCs through UMG
Like for example, a player opens a treasure chest and changes the contents
The Player must be the one to call RPCs. The Player rearanges the chest contents, not the chest.
Why is that?
the server version of your character can freely interact with server objects
local one can't
Oh
and requirement to send a RPC is that the object you are sending it from is owned by your PlayerController
So player would need to have a component or something that you call some RPC on
That takes the target actor as param
PlayerController, Character, HUD, PlayerState, attached component, attached actor
all works
other requirement would be the actor you want to affect is replicated
Ah I was trying to reference a component on the Actor through my character
because if it doesn't have the same GUID on client and the server it will disconnect you when you send the RPC
And call RPC on the Actor component
Ok I got it then. Looks like my inventory component will need to manage box contents through its own rpcs
depending on the setup you can get away with as little as 1 replicated array of structs and 3 server RPCs
Thanks
Items are all held on itemcontainercomponents
And containers are referenced by inventorymanager
x post from blueprint, im not rly sure where to post. - Hey guys, any1 have a lot of experience with multiplayer level streaming that i could bounce a few questions off of?
ask your questions, its what the channel is for ๐
any idea why my custom jump pads wont work on a dedicated server but work fine for clients in the editor?
it runs everything up to the RPC
Are you trying to call a server RPC directly on that jump pad?
(the log should tip you off to an unowned-actor RPC call)
its called on the jump pad but it has worked up until this point
clients on listen servers never had issues
By "listen servers" do you mean in-editor?
actual listen servers with other players/computers
Hmm, I can't tell you exactly what's going on then, but you can't call a server RPC on an unowned actor.
Even on listen servers, that's just how it works.
i tried setting the rpc to reliable so ill see how that goes next time i package
Is this jump pad in the level or is it spawned (and, thus, possibly owned) by the players?
If it's present in the level and you don't change its owner, that won't have any effect.
placed in the level by default
if it worked on listen server its not an improper RPC
im assuming that reliable will fix it but its hard to believe there was any network stress considering it was a 30 tick dedicated server running on my own machine
does it working depend on ticking?
there is a bAllowTickOnDedicated server
that is false by default
with information you provided, its my only guess
i checked the blueprint for the jumppad actor and that is checked
https://www.youtube.com/watch?v=3EgdGWJMWE4&feature=youtu.be
here is footage of my issue, initially the game is being run singleplayer with just the Open Level command, and in the second half, the game level is being opened with level streaming for multiplayer and everything breaks. It has worked before with level streaming so this is a recent break, just wondering if any1 has had something similar before and knows of a fix or even a possible cause. Please PM me if you need any more information, any response is more than appreciated.
i think i might have found the cause
i have another map that has a jump pad but it was made before i made the actor for it
so its just a trigger box that runs in the level blueprint
same exact script
except
my actor has a "launch target" actor to generate the launch velocity instead of a raw value like the one in the level blueprint
might not be replicating that
Has anyone ever seen a tutorial where you take a basic project and then add the necessary multiplayer stuff so that you can package the project for you and your friend and have them connect to your server (whether it's listen or dedicated)? Because I have a thing and want to actually make it work for multiplayer testing with a friend or two.
@versed socket check the pinned resources in this channel
I did, actually, before asking. I'm not sure if any address that, though. Maybe I'm just blind.
Cedric's compendium is an okay place to start with networking
video tutorials tend to just tell you "how" and forget to explain "why"
Well yeah I've actually read Cedric_exi's thing a while back. I don't think it covered how to get a project ready to send over to your friend so he can install and connect to your thing where you can play together to test stuff.
@versed socket You could check this course: https://www.udemy.com/unrealmultiplayer/ (it's on promotion, 93% off)
I completed that course and it has everything you need to know to start making multiplayer games.
I already know about the RPCs and whatnot and I know how to implement them in C++ as well... I'm actually asking about something different here: what do I actually need to do so that my friends can download my packaged project and hop into a [listen/dedicated] server that I'm somehow hosting? How do I figure out what ports need to be opened for hosting with my thing? Is it just a simple "Open session" and then either creating a UI to input the connection details or adding the appropriate connection details to the command line?
Depends
Let's say you aren't using any Subsystem
For Internet Connection via Sessions (ServerList etc.), you are out of luck then. You'd need to fake LAN via Hamachi or so.
You can however connect directly via IP
That requires the host to open the specific port. Default is 7777
If you package your game as Development
You can still access the Console. So all you need to do is bind a console key (can be done in the Input section of the settings at the bottom)
The ListenServer then types "open MapName?listen"
While the Client does "open IP-ADDRESS"
That's all
If you however use a Subsystem like Steam, with or without own AppID (480 could lead to not finding each other!), you'd simply need one person to call "CreateSession" with a follow up of the "OpenLevel" node and also the "listen" option again.
While the client simply calls "FindSession", lists them and joins them, or blindly tries to join the first result in the array that comes back.
A DedicatedServer is a bit of another story. If we ignore that you'd need to build it via Source and then copy/paste the binaries to your packaged project, it's still a bit mรคh to get it working.
No Subsystem is still direct IP connection, so that is the same as above.
With a Subsystem, you'd probably need to setup a Session for him (in C++ it's with RegisterServer function), that does not use PRESENCE (as that server doesn't have a n account) etc.
There are tutorials/docs on that by users
do you know of any OSS matchmaking server implementations? even if they are just proof-of-concept?
Thanks for that @thin stratus!
So just to make sure I understand you right, if I wanted to take a ThirdPersonExample tutorial project but with some basic replication stuff set up properly, then I could make this happen by:
- Package the project and share a copy of the game folder with my friend(s)
- Make sure port 7777 is open for whoever wants to host
- Whoever hosts goes into the console and types "open MapName?listen"
- Everybody else does "open IP-ADDRESS:7777" in the console
And that's the bare minimum we have to do to setup online multiplayer via direct connecting!
Correct.
Anyone ever get this when creating lobby sessions?
That's normal afaik
Cause Epic doesn't have the IP/Port stuff in the Session info
They only have the p2p stuff setup
ah ok
@thin stratus Follow-up question: if I'm the listen server host and I have friends connected and playing with me... then if I do Open OtherMapName?listen, will they automatically follow me and load into that new map with me?
You are the sexiest person I have ever met in my life, @thin stratus
:P
so in my code, I use a server event on the playercontroller to spawn an actor and make the player possess it, then destroy the old actor, however when I call "get player's pawn" on the client side after that it still gives me the previous actor even though it's destroyed?
I thought playercontrollers were replicated?
Maybe my issue is that I am calling "get owning player's pawn" on a widget which is not replicated?
for reference, my code: https://owo.whats-th.is/a5d984.png
https://owo.whats-th.is/682327.png - in PlayerController
https://owo.whats-th.is/4f4148.png - in InGameHUD
Quick question guys, is there another online subsystem for Matchmaking and NAT punch-through that works with a blueprint only project other than steam?
(preferably that works with UE4 online subsystem blueprint nodes)
I just noticed that Seamless travel is disabled in PIE, anyone know any work arounds?
Launch Standalone
(Right click uproject file -> Launch Game)
@kind bay You can look up all Subsystems by just browsing the Source Code
They are in Plugin Formit and are all called OnlineSubsystemXYZ
You can also check which parts of the subsystems they implement
So I would say no
why would my project that isnt MP not build if I disable all the MP related plugins?
or it builds but crashes on run
@indigo root No, you are simply ignoring the existence of ping
hm?
You call the ServerRPC, which already takes time to reach the Server
doesnt the "create widget" node run after the rpc completes?
oh.
It runs after you issued the RPC
Everything else is happening async from that point
so I'd need to rpc back?
Correct
but widgets don't replicate right?
Correct
hm
ClientRPC in the PlayerController
But even that might not work
As the replication of the Pawn variable could take longer
than the ClientRPC
You should go to your Pawn
is there a "wait for everything to be replicated" node 
is the onpossessed event guaranteed to be called after replicaiton?
or any events for that matter
It's called after the Pawn is possessed
And the ClientRPc you call there will call in the Pawn itself
So that's kinda guaranteed to be properly timed :P
is there a good tutorial for setting up a steam dedicated server via blueprint?
ive built the server and it can be connected to via ip and works as expected but i want to do things like set a name for the server that shows up in my ingame server browser
currently it shows the default "9xxxxxxxxxx" name with 0/0 players and cant be joined by pressing the join button
but can be joined via ip
Anyone know the right command to make a dedicated server restart for multiplayer if no one is on it? i found my setup is bugged if the match ends and it goes to serve rtravel with no one on it doesnt execute and then is stuck in limbo
Blueprint if possible.
i think i tried it already but for kicks doing it again with just game modes restart game node
Guys i have a problem..
How can i get the player data ?
like i want a player list with the Player State Data and Character Data but i can only get all actors of class of state Or Character how do i like connect them ?
or how do i know what character is for what state ?
yup that did the trick
do you mean character class? what state is currently using it?
I always on possess of a character set a reference to its player state from the incoming controller thats possessing it in blueprint i use the on possess node and get playerstate and cast to the ps class and set a variable.
Oh jeah that might help thanks ๐
is it possible to avoid showing the user as playing spacewar while still using the steam subsystem?
Yes
Register the game on Steam and use the appid Valve gives you
Obviously it's $100 but you'll need that at some point anyway
ah i guess its not possible for me with this project then because it started as my "learn ue4" project so the models are imported from other games
intent is just something fun to play with friends but itd be nice to not be showing spacewar
Anyone knows why AGameModeBase::GetNetMode() returns NM_Standalone when it should be NM_ListenServer? If I use GetWorld()->GetNetMode() it does return as listen server.
That seems to only happen in AGameModeBase::PostLogin. If I check it in AGameModeBase::BeginPlay I do get NM_ListenServer.
https://www.youtube.com/watch?v=3EgdGWJMWE4&feature=youtu.be
still having this issue, if any1 has an idea would appreciate it. everything seems to work except the player character, which has its physics and collisions broken.
breaks when levels are streamed into multiplayer, rather than just OpenLevel in singleplayer
why is my server loading staticmeshes?
even tho im packaging with "Server" config
using project launcher
@cerulean rapids this seems to be very related to replication settings. ๐ค can't say anything else because we'd need more instruction about the details of your problem.
yeh it's a difficult to express im sorry. replication being the issue even if the listen server has the problem too?
i've posted on answers https://answers.unrealengine.com/questions/766648/level-streaming-physics-bug.html
Guys i use foliage in my multiplayer game and i need to remove and add instances for all players
how can i do that?
my idea was to remove it on server and multicast it to all clients to remove the instance id But i don't know how to get the instanced foliage ref..
some idea how i can do that or other ways ?
Save them in an array or so
So that the Index on all players is the same
Would be one Idea
multicast would result in inaccurate state for players that join after the multicast, as well as players that were outside the NetCulling distance, or not NetRelevant for any other reason @next falcon
by default that would be farther then 15k UU
jeah i also thaught of that problem but i don't know any other way.. ๐ฆ
Hey not entirely sure of this goes here. But does anyone know if there's a way for post processing effects to only affect one play screen in a split screen scenario?
My camera has a post processing component attached to it and right now if I enable it on one player screen it gets on both.
Any suggestions?
Hey fam, how do you join a game and start as spectator? Do you have to set the default pawn class to your spectator pawn or how can you utilize the pawn you selected for Spectator Class?
@lusty dust The GameMode has an checkbox that enables Start as Spectator
Yep, exactly where it normally is...right in front of me ๐ Thank you, sir!
was just digging through the leftover ShooterGame code in my game to implement InformAboutKill properly and found that it just calls this function on the local controller:
void OnKill() {
...
FOnlineEventParms Params;
Params.Add(TEXT("SectionId"), FVariantData((int32)0)); // unused
Params.Add(TEXT("GameplayModeId"), FVariantData((int32)1)); // @todo determine game mode (ffa v tdm)
Params.Add(TEXT("DifficultyLevelId"), FVariantData((int32)0)); // unused
Params.Add(TEXT("PlayerRoleId"), FVariantData((int32)0)); // unused
//Params.Add(TEXT("PlayerWeaponId"), FVariantData((int32)WeaponType));
Params.Add(TEXT("EnemyRoleId"), FVariantData((int32)0)); // unused
Params.Add(TEXT("EnemyWeaponId"), FVariantData((int32)0)); // untracked
Params.Add(TEXT("KillTypeId"), FVariantData((int32)0)); // unused
Params.Add(TEXT("LocationX"), FVariantData(Location.X));
Params.Add(TEXT("LocationY"), FVariantData(Location.Y));
Params.Add(TEXT("LocationZ"), FVariantData(Location.Z));
Events->TriggerEvent(*UniqueID, TEXT("KillOponent"), Params);
...
}
Can anybody @here tell me what the actual point of this is? Why would I want to trigger an event through the online subsystem?
docs pages for IOnlineEvents seems to have disappeared for some reason
So the reason for this is multiple: 1) Technical requirements for online play when using Xbox Live Online Subsystem . This is the Sectionid, GameplayModeId and others. It is a requirement because of how things get displayed in the OS outside of the game that is driven by these analytical events. 2) Events here must be associated to the correct player to do this, and thus you can ensure log-in & online play requirements by having the interface go through the OSS. The subsystem events effective go through gated authentication via user accounts to do this logging. 3) a good example of how to do data logging for your title. you could easily turn this data into a heatmap and analyze weak / hot spots of gameplay through a method as such
@glacial hamlet That all makes sense, but where would I actually receive this information? For example through steam. Hard to know anything without any docs
oh sure, so that'll come down to your OSS implementation. Basically you need to look toward a different method to get analytics I think than this. In this specific instance its to meet some xbox technical needs.
its uhh, kinda strange since you'd expect it to be part of the OSS (and it may interface with it) but they are sort of tangential...
i'm not 100% sure as I haven't done google analytics or other services yet myself
I can tell you with a platform like xbox it gets consumed by their APIs and you may be able to get that data through a backend website access but in general its consumed sort of into a black box for display to the OS.
Steam does have an event system IIRC
Look to the achievements settings on the partner Steamworks site
cool, makes sense, its gonna vary per-platform but sounds like steam gives you decent access then
hmm, thanks for the tips guys
however it looks like almost every platform doesn't even implement the IOnlineEvents interface as part of the online subsystem :\
steam returns nullptr, so its gonna go through a different interface
๐ค
feels pretty specific to xbox in this regard from my knowledge
however, thats kinda good news because its free for you to implement lol in some form or another
for what its worth ยฏ_(ใ)_/ยฏ
Basically @high heart why do you want this for ? This is used to, for example, know players on your game do 123 kill on average, etc
If you want this kind of stuff you can implement it with your own service so that you don't have any constraints
It's just possibly not accepted on XBox etc
right
I just wanted to add a little kill logger but can't use the slate one because i'm in VR. Already mostly rigged up a UMG widget for it. Was just curious about what this code was supposed to be for
seemed suspiciously useless
ah okay, so you could just pipe that structure into whatever you've worked out to display via a widget component with your UMG setup, regardless of what the interface calls are doing
ShooterGame is pretty strange overall, it does lots of stuff in really weird ways
I think it's because it's so old and no one cleaned it up since like 2014
hehe yes. we keep coming to that answer as we dive through it in certain ways, since it is still a strong basis for a project.
I'd stay away from it as a basis, more like a database of stuff that might be helpful
lol i've noticed. starting a VR project with it was a ridiculous mistake but at this point I'm in wayy too deep
The session stuff is horror
yea but it is tech requirement complete
and yea, that is one of the painful parts but easy to clean-up
I've definitely noticed some weirdness with the sessions... most notably that playercount is always 1. I've probably resolved the rest of it at this point
still, a huge pain in the ass. Is there a better sample to work off of?
not sure, there might be. their session usage is very idealized to the old school FPS style of server with drop-in / out, so late join is non-issue and no lobby
Might do better by yourself to truly understand what each piece of the mechanisms the engine provides via the session interface and then gut out their game-level logic. It's still hard to grasp what certain classes that do session work are truly meant for since there are multiple higher level wrappers around the ISessionInterface directly, some are for clients, some are for servers, etc.
Like i said I'm in pretty deep at this point with a released game. Already hacked in a VR lobby with seamless travel and additional session params and such, it's technically working... just a little quirky ๐
that old school style actually works pretty well for VR. just jump in, say hi, and wait for the host to setup/start the match
my issues with it are generally pretty obscure. most annoying is that occasionally your session will just fail to be advertised
i've looked into the advanced sessions plugin but from the looks of it it's just wrapping functionality for blueprints
(mostly)
is FUniqueNetIdRepl persistant across disconnects?
If you have a subsystem active, yes
Well depending on the subsystems
Steam for example yes
That would be the SteamID of the player
Hi,
For a game like BattleGround (Last Standing) we must use a dedicated server or is it possible to run game as listen server also we should change Onlinesubsystem to steam?
Actually, I would like to know who makes a Session in Battleground game mode?
I mean when a client makes a session and others join it so if server owner exit all game will be destroyed.
It should be technically possible to use a listen server, but I'm not sure of its feasibility on a performance level
I can't imagine a 100+ player server is a negligible thing to host, so dedicated servers are probably your best course of action
(especially with typical home upload speeds being abhorrent)
Online Subsystem isn't related to hosting, either
It's about matchmaking, not game hosting
Set it to Steam if you intend to use Steam, set it to something else if you want something else
Thank you guys so much.
Gamesparks is a dedicated server?
What help can it do for us?
It's a platform that does hosting, server-side software, also matchmaking IIRC
No idea how it meshes with UE4
Gamesparks doesn't host any servers
It's a data backend
For BR games you'll have to use Dedicated Servers
And probably cloud based hosting using Gamelift or so
Using steam or not isn't Important for that
Not entirely true gamesparks can host server instances but only if you use the realtime api and don't use unreal replication . Supports up to 50 people per instance. Not sure on scalability though or how many of these instances they allow you to use. Would have to contact support
Someone made a kit on marketplace doing just this
https://www.unrealengine.com/marketplace/fps-battle-royale-template
For real-life indie projects that aren't backed by large teams, I'd recommend simple setups like renting your own VPS and using the Steam OSS with a regular UE4 dedicated server
It's not like your average indie project is going to need 10 servers
You should probably have a plan for that if it needs be, but unless you have an editor, your Steam game is probably looking at one server's worth of players
@worn nymph You sure? I never saw any point where I could upload actual servers
Also kinda sure now that amazon bought them it will try to Integrate into gamelift
You don't upload the server . You use their api . Players make a matchmaking request then it spins up the server instance for you and connects your players together . Think its Kinda like p2p hosting but with like a socket server in the middle handling player packets back and forth
But that has nothing to do with the act of hosting
You are not spinning up a server instance on their servers
So you still need to host your server somewhere
Also i haven't seen any server spin up code in their sdk
Matchmaking is just backend data. I used these functions together with gamelift often enough now
https://answers.unrealengine.com/questions/766648/level-streaming-physics-bug.html
if any1 feels like taking a look and asking me some questions about it, would greatly appreciate it. topic is level streaming.
Friends Steam Dedicated Server seems to be on the stem servers but I want to connect as ip but it is not connected to the game IP is connected to the IP when the steam is activated when the system is disabled,
I just connect to Steama but I want to use it as IP
@thin stratus not really sure why your still arguing to be honest . you made an incorrect statement . i was just pointing out that it is indeed possible to the original poster and even showed a project that does exactly that . yet just because you cant find it in the SDK or havnt done it yourself you keep saying its not . guess you cant take being wrong . you dont host a server somewhere else gamesparks hosts it for you
" Host Server Support
A dedicated host server for handling communications between players in the selected game region supports higher player numbers than traditional PvP models."
I can't take being wrong? :D wth got into you
i think you guys are talking past each other: yes, gamesparks hosts dedicated servers for you, but they are not a dedicated UE4 servers
Exactly my point
though they are dedicated servers, just using gamesparks' own (non UE4) server software
Of course if you want to, you can use their Dedicated Servers and completely not use the ones form UE4
though if it makes sense with networking built into the engine/framework is the other thing...
With 4.19 we should get a lot of cool extras that help DedicatedServers to allow 100 players
So I doubt that it's really needed
@worn nymph Since we kinda talked past each other, I'm sorry for spreading half info there.
However I would love you not to instantly attack a person. I love learning new things and it's not that I can't take being wrong. It's simply that my point was right.
We just didn't mean the same thing.
lol how did i instantly attack you . i said at least twice that they do host servers and you kept arguing/insisting otherwise just because you couldn't find it or didnt understand it .
"Gamesparks doesn't host any servers"
your exact words how is your point right ??
you didnt say gamesparks doesnt host dedicated servers but offers a cloud based solution you said ANY servers which is not true .
and then when i explained again you still insisted oh you must have to host somewhere else . thats not the reply of someone who loves learning new things .
or you would just been like oh cool i didnt know that thanks for sharing instead you wanted to keep arguing the point posting multiple times about it
Welp, you are right :P
and sorry if my replies are coming across snappy im tired and not feeling well lol
its not intentional to attack you. and we were both just trying to help . anyways sorry .
It's fine. You are right. I put all DedicatedServers under one word.
That's why my point is actualy not right.
"Love to learn" just means that I'm not against being proven wrong. That's why I ask if you are sure. :P
Anyway. Dinnertime!
Hi I am new and I have a doubt. Can anyone help me?
just write it
I am trying to create a multiplayer game but when I find the session and open the level of the game my players doesn't replicates, I can only see the client player
I also don't know if my client joins to the host's game
And sorry for my english
Find Session should be followed by "JoinSession"
Otherwise you are probably not joining the session properly
That will already open the host map
Try to check if the Lenght of the session array is > 0
And if yes
try to get 0 from that array and join that
I think your ForEachLoop stuff is wrong
Cause you never check if there are actually session
I think that what you are saying is in the branch with the conditional "Session Found?"
@thin stratus
You are looping over the array
So you are grapping the last session in that array
If it's only one, then it's fine
But despite that
This here is enough
You don't have to do "OpenLevel" when you join
JoinSession already does that
so i have to delete the foreachloopwithbreak?
hahah
@thin stratus
@winter gale whe troubleshooting network connection logs help more then anything else
how i get them
the stuff that prints in the Output window
also gets saved in Saved/Logs folder by default
the most recent one by date is the last one^^
@thin stratus I just want to thank you again. My biggest motivation over the years with making mods and dumb scenarios in other games has always been the knowledge that I could show the dumb stuff I make to friends or others whenever I want. I just tried out that advice you gave me the other day and it worked perfectly. Knowing that I can make incremental improvements and then turn around to share it with friends and play multiplayer with them has re-invigorated my motivation and has given me extra inspiration to continue with my current project. THANK YOU
So I'm using blueprint and I want my player model to be different from everyone else's to signify that I'm a developer. What's the best way to do this? From what I've seen, there's no way to check IP/PC user name/etc. in blueprint so I'm about out of ideas.
@muted sigil If your using Steam you can grab the Advanced Sessions Plugin and use your SteamID to identify you.
@versed socket Naaaw. (: Happy to help!
XD
Im not sure why but my Clients cant see what the server does or what they see between them when they attack. Ive implemented it so they could but it does seem like its running. Any thoughts
https://pastebin.com/D55esRvt the code on it if anyone sees an isssue lemme know
can't really see much of anything off a single .cpp file
in any case, considering your Fire is a toggle
i'd wire the user input to send a ServerRPC to set some enumeration representing the firing mode on the server
then replicate that state and make clients match with OnRep function
that way you don't have to send a ServerRPC and notifications back to clients every firing interval, but only when the firing state changes
@past urchin
then your Tick can just decrement the FiringCooldown by DeltaTime and call Fire() + reset it if its < 0 , so you don't have to mess with timers either
Anyone know what decent solutions exist out there for load-balancing a single playable "world" in unreal engine, if any? Obviously I can't vertically scale forever, so I'm trying to learn if there are ways to horizontally scale the server-side aspect that are well documented etc?
[2018.03.10-20.52.16:698][ 0]LogOnline: Verbose: STEAM: Initializing Steam Game Server IP: 0x00000000 Port: 7777 SteamPort: 7778 QueryPort: 27015
[2018.03.10-20.52.16:731][ 0]LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
[2018.03.10-20.52.16:731][ 0]LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
[2018.03.10-20.52.16:732][ 0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2018.03.10-20.52.16:732][ 0]LogOnline: Warning: STEAM: Steam API failed to initialize!
[2018.03.10-20.52.16:732][ 0]LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
Anyone an idea why this would happen? Steam binaries are copied from Engine to server binaries folder
It's the only server we start
nvm
Steamappid file was missing
I thought that gets auto generated in dev builds
Doesn't seem to apply to DediServers
Guess I forgot that >.>
He says further down where the answer is marked -> "it seems to be happening becouse i use the function "set master pose component" on the server. (so fair it didn't fix the issue in my real project)."
I did comment out my SetMasterPoseComponent from BeginPlay and I do now have that issue anymore.
Is this normal?
Should this only be called on the client?
@ruby epoch - Did you ever figure out what caused your client spectating another client stutter / lag? Or anyone else know?
Yep
I kinda fix it
with manually rotation
or kinda that
I can show you how a bit later
what are some good options for hosting services to host single instance sessions with 10-12 players?
What is the correct way to do this replication ?
@winged badger What I have is a clothing system (like), I have a hat, top, bottoms and footwear. They all work when I set the mesh and material except the top and I am changing them in the order that I listed them above.
If I comment out the top mesh and material the game doesn't crash if I put it back in it does
@ruby epoch That would be great. I'm experimenting with solutions and google hasn't been of help. After you said manual rotation, i tried to apply event tick -> applying rotation via server and multicast which didn't help. Seems like that would be costly as well.
does anyone know what would happen if to one player (the host) would connect 50 players (clients)? would host crash or have bad performance or something of that sort?
Hello
Does anyone know how to make a replicated pawn movement for a Floating Pawn possessed by a player ?
because if I add network latency then it ends up moving in a loop because of the server displacing the player even though I set replicate movement off
@twin juniper depends on how well you did your networking
i had no problem with 8 players and 100ish monsters combined with a host on 500kbps connection
the problem is the way to handle that
how do you replicate the movement from the client to the server and then to the other clients without moving the base client
yes
bot how do you make it so that clients can move with a prediction and that the server doesn't always correct them when they are possessing a pawn, not a character ?
pawn or character doesn't make much of a difference
don't characters have that built-in ?
character just has a more complex movement component
allowing you to jump, crouch, swim... etc
ok
2 things that can knock you on your arse: bendwidth and reliable buffer overflow
epic seems to have doone ok with >50 players
but if its not dedicated, but player is a host?
so, how would you go about networking pawns' location possessed by players
will that one host player's game die?
Right now i'm using a RPC that runs on server
as long as you have the bandwidth to keep clients up to date, don't use RPCs when you don't have to and the host has the CPU to run all that
you would be fine
risky setup tho, if host loses connection, there is no way to recover the game
so if i do shooting, then i have to do it on client not server and then replicate to server?
for example
if your fire is a toggle (like automatic weapon)
your InputActionFire would send a Server RPC that would set the state EFiringState::Firing
server would replicate that enumeration variable
i do it with gate and then a replicate to server for Open and Close
and OnRep clients would start simulating the fire
and your InputActionFire released would send a Server RPC to set EFiringState::Idle
for example
ok
that way you'd send single RPC when firing state changes
instead of one for every bullet
@cunning stirrup i'd set bReplicatesMovement = true;
ok but then how do I send the movement from the player to the server ?
pawn or character, their movement should be replicated, no matter if they are possessed or not
that it does for you
ok so the owner hs the authority ?
i believe ConsumeInputVector() is a Server function
can't say i read the MovementComponent's code recently
like this?
first bit yes
it is on server
but with this setup you have say FiringCooldown = 2sec
you decrement it on Tick
and if your FiringState == Firing, your FiringCooldown < 0 then you call Fire() and reset the Cooldown
hmm
and as Tick executes on both clients and server
ok it works thanks a lot
so i have to do firing logic from event tick?
all the clients will automatically Fire at the cost of 1 byte replicated variable
with this setup yes, you need to check the cooldown there, and call Fire(0 if its ready
and here i have to just add the cooldown
(you decrement the cooldown by DeltaTime ofc)
ok, now you just need to implement the cooldown, and you're set
should i do it in a function instead of custom event?
Can the owner of a pawn change a OnRep variable ?
or it will fire every tick
i will add cooldown
that you do however you feel like its more readable
tbh I'do the firing using a Delay node
with just a delay here, it would fire every tick
oh does the local variable stay the same on the next call of function or it resets?
no, using a delay loop and a gate that is opened/ entered and closed using RPC
oke
when your ammo hits 0 for example
you can set FiringMode::Reloading
(its why i suggested an enumeration)
so i need to do the firing, reloading logic in OnRep?
and onrep will trigger only when variable is changed?
or it will trigger every tick
I have a problem : When using Replicate Movement, the player can move but his movements aren't being sent to the server
or make enum with OnRep that will change "Firing" and "Reloading" booleans depending on state
so the others don't see him move
only when its changed
I'm using AddMovementInput to move the pawn btw
Enum and Byte take up same space?
an Enum is a byte
i used byte
you don't have to
because im lazy to make enum
xd
and its easy for me to remember
0 = idle
1 = fire
2 = reload
by logic
you won't remember that the next time you work on it
it takes you a minute to make a blueprint enum
fair enough
but everything else is fine?
well, test it, see if it works, if it doesn't, try to find a problem, and if you can't ask here
anyone know why i cant connect to my steam dedicated server running on a vps while the vps has steam running?
closing steam on it allows me to connect via ip
but i get a connection timeout if its running
if i host it on my own machine, my friends can connect + see it in the ingame server browser while i have steam running
hello, someone one have some knoledge in c++/network here ? a problem will make me crazy af
here is my code : https://pastebin.com/TST5hPWB
i want the player to spawn a projectile and everyone one should see it
if the server fire, it's fine, client and server see it
but is client fire
only the client see the projectile
feel free to ping me if you get the solution ๐ฆ
You should only spawn on the server
Otherwise you'll duplicate the projectile on the local client anyway
how many concurrently connected users can UE4 MP have?
the free one
what is the maximum limit
can it host more than 1 server?
@vivid socket "concurrently connected users" I don't think there is a limit, pubg has 100 and that's that. More than that would mean more resources.
I am not sure what you are asking here: "can it host more than 1 server?"
i mean can i have multiple servers running with around 10-12 connections?
like csgo
for ex.
and how much does it cost
im pretty sure it isnt free
Hosting is completely up to you.
There's nothing that inherently costs money in UE4.
oh
You can host it on a null subsystem on your computer and that'd be free, but that's probably not your best option.
If you want some sort of matchmaking, you'll either need to use a third-party service (money) or write your own, which would need to be hosted on a server (money)
hmm
Yeah, there is the 5% cut of revenue, but that's not related to MP, that's sales.
To be completely honest, in that type of situation I would suggest a listen server model.
what does that mean?
You would have users host the server when they play, rather than having dedicated servers that you run
yea how to implement that
There's a lot less backend infrastructure involved with it
yea ik about it
but how to implement it
this is how community servers work in csgo
Not really, no.
In CS:GO, you have people host servers, but they are still dedicated servers (for the most part)
In a listen server model, you have one player act as the server, to whom the other players connect
i see
so when i press create, i become a server
when i press join
i join some1 else
Yeah.
but are there tuts to help doing this?
You would still probably want some type of matchmaking service, whether it's in-house or third-party, so people don't have to manually forward ports and trade IPs and stuff
UE4 supports it out of the box; look for some basic MP tutorials.
o nice
is the matchmaking good?
i'll take care of that later
thanks for your help
:)
is there a steam SDK for matchmaking?
i heard of it once
Yes, you can use Steamworks if you plan on releasing on Steam, which features matchmaking
You can also have dedicated servers but have the users pay for them, in that situation you can't really have matchmaking but it obviously depends on the type of game you are making.
I have a project where I need to share character data between servers. What's the best way to set that up in UE4?
I want to say MySQL but not sure since I am not sure what sort of data you want to share
But anything that is servers can connect to and upload/update/get data from should be good
Basic list sof inventory items, xp, that kidn of thing. Numerical data, essentially.
I think that could be ok
So from a blueprint perspective, is there some kind of MySQL node or something that I can plug an address etc in to send and receive the data?
Or maybe a higher level interface?
I don't think there is anything MySQL related but more like connect to a host, login info, and so on, I might be wrong. Just google ue4 connect to mysql blueprint
So really I'm a C/C++ programmer, and I know how to write a network interface of my own. If I can do that outside of ue4 is it going to be pretty simple to write my own rather than pay for one?
We're talking about like 20 lines of C++ here.
Or is there some more convoluted step that's going to make that not worth my effort?
Maybe security issues
Okay, thanks.
How often are you using "unreliable" ?
I don;t have much things happening in the game but If I want to play animation to all other clients via NetMulticast it's called only on server side but not to other clients
I thought that "unreliable" means that's is not guaranteed only if not overhaul or something.
alright so for playing animations I should set reliable then
otherwise it looks weird
Hi! We're making a multiplayer game where you can throw props around and are getting latency / lag transmitting all the prop positions (e.g: X, Y, Z) to players. What's the best way to deal with this?
hey guys
I recently updated my project from 4.15 to 4.18 and my steam dedicated server does not work properly
I copied the needed files for steam from steamworks and steam folder, the ones that need to go into Win64 folder in dedicated server
and when I want to start the server it gives me this error
I just click OK or X and it just closes this window and work normally
but I need to do something so this windows does not pop up
window*
Okay so i have an issue where the event is called, but when it actually runs the event, it doesnt run it. So it calls Client Destroy Battery, but when it actually runs Client Destroy Battery, it doesnt run Destroy Battery
anything like "no owning connection for..." in your output logs when it happens?
Maybe call destroy actor, AFTER setting the battery capsule's visibility as well...
Also try calling destroy actor from the server, it should destroy it
it also needs to be done in an object owned by the player controller
and replicated actors destroyed on server will get destroyed on clients, no need to do it separately
and multicasts for this are just... bad
any way to check a replicated event which player index sent it without explicitly adding it as an argument (that might be altered by malicious players)
just implemented replays in my game based on the tutorial and on playback i just get this warning and a frozen game:
LogWorld: Warning: SetActiveLevelCollection attempted to use an out of date DemoNetDriver: DemoNetDriver
what is the meaning of this? anybody @here know?
Guys please tell me what you think
Hey so finally here is the update for the tps starter pack for multiplayer kindly if you have any questions join us on discord Buy it now Gumroad : https://g...
@vivid socket thanks a lot ๐
im not sure whether i am identifying the bug right, is it possible for the "add to viewport" node to add the widget to the wrong viewport? (running 2 instances on same machine)
possible but very unlikely due to how widgets get the local player owner
can confirm that by running as seperate processes
(via editor advanced play options)
untick "run in single process"?
that removes the player count box...
hmmm? thats odd, i do that everyday
oh, do selected viewport instead of new PIE window
should give it back
the other way to confirm would be using the widget reflector, but in all likelihood its not being sent to the wrong viewport
actually ill just use "launch game"
@peak idol looks cool . love the painball splatter effect. how is the mulitplayer hosted ?
@worn nymph host and client you can go dedicated too
if I have a replicated TArray<FSomeStruct> and I change a member of one of the structs, will that be replicated? Or only if I modify the array?
heho ^^ just a quick question regarding steam , is it possible to test Steam sessions in editor ? When starting a Standalone window in editor Steam pops up and the overlay works also in my lobby i get the correct Steam name + image ... but for some reason i can't connect . Join Session reports success but no map change and the server does not report a joined player
How can we replicate the movement of a pawn from a client to the server ? The pawn is possessed by the client. I've got Replicate Movement and Actor Replicates set to true.
how to replicate a variable from gamemode to UserWidget or Character BP
Only the server has the Gamemode
you need to get that variable from the server using the server's representation of your Character BP then pass it to a replicated var
so i have to do the timer in character BP and with Time value set to replicated?
you're welcome
what is then gamemode made for may i ask
ok i will need player spawning, will ask that later when i need it
Created a system for nameplates above the player's heads. Trying to make it that they'll update when a player changes their title on the nameplate. Its not updating for other clients for some reason. I'm guessing I'm just doing something wrong. I'm casting to all the players in the server and trying to run a function on each client in the server. Is this the wrong way of doing it? Here's what I've got so far.....
@icy nacelle Use a replicated OnRep variable for the tag on the nameplate and use a RPC to send the updated name to the server so it can change the variable. Then, on the OnRep, update the nameplate
Ah thanks bud
How would I send it to the server?
I think thats the part that confuses me .
using a replicated event
RPC
creatre a custom event and set it to run on server
reliable
also if you want to check if you're the player that controls the pawn, there's the IsLocallyControlled node
@icy nacelle Did that work out ?
hey, I'm running into a weird problem where IsLocalController() returns false on clients during pawn possession. It seems to only happen on the first spawn. From what I've seen it seems like this is happening because NetMode doesn't get set until a few ms later. Does anybody @here know how to trigger something when it does get set?
GameMode::PostLogin is okay for calling RPCs on the PC
if you want to be sure Pawn is ready, try OnPossess(ed)
Thanks @cunning stirrup ill give it a go after I finish dinner :)
@winged badger I am using OnPossess(ed). The problem is that IsLocalController is wrong on the first possession. Do pawns get spawned before PostLogin for some reason?
you also have a GameMode::HandlePlayerStart you can override
and on clients Controller[0] will always be local, as its the only one
on listen server, i am not sure that is the case
on dedicated ofc, there is no local controller
I'm talking clients. but how would I even detect whether or not I'm a client at that point? Role != ROLE_Authority doesn't even work like it usually does
@high heart OnPossess is only triggered on the server if i'm right
as for pawns, they can be there before the PostLogin if they are not spawned by the controller
but pre-placed in a level, for example
pretty sure GameMode::HandlePlayerStart is where their creation starts if they are spawned by their controllers
Then the pawn is not fully possessed by the client when the event is triggered
what do you mean by that?
how can get an event in blueprint like PostLogin in the gamemode that runs when the client loads the new map with seamless travel?
doesnt seem to return anything
@graceful cave I think the C++ function you're looking for is PostSeamlessTravel in the PlayerController. I'm not aware of any blueprint hooks into that however
how can i create a C++ class that works with my current player controller blueprint?
You can expose properties and funcs with the UPROPERTY and UFUNCTION macros
that makes them visible to blueprint stuff
is there a tutorial on that
ive done 0 c++ in ue4
except copying and pasting to get a dedicated server working
but how can i create a c++ player controller class that interacts with my current blueprint playercontroller parent class?
well you gotta generate it first from within the editor
then you can make your blueprints parent class the c++ one
and it inherits whatever you put into it
as far as I know its not possible to make blueprint classes parents to C++ ones tho
@graceful cave what you're going to want to do (I think) is to override PostSeamlessTravel in a C++ class, then in your overriding function call your own UFUNCTION marked with BlueprintImplementableEvent
then in BP you can just implement the function and you're golden
trying to figure that out now but i have no idea what to actual put in this c++ class
Something like this:
void ASatansPlayerController::PostSeamlessTravel() {
Super::PostSeamlessTravel();
BP_PostSeamlessTravel();
}
then in SatansPlayerController.h
/**
* Called after this player controller has transitioned through seamless travel, but before that player is initialized
* This is called both when a new player controller is created, and when it is maintained
*/
virtual void PostSeamlessTravel() override;
UFUNCTION(BlueprintImplementableEvent, Category = Travel)
void BP_PostSeamlessTravel();
are you manually making new cpp files?
yeah
that should be correct
okay nvm then
^^^see code. that should do everything you need
oh, those go in the .h file
ohhh i see
then the first thing i posted goes in the cpp
generated.h include is missing
so the second part that goes in the header
@winged badger that's a cpp file
does that go where GeneratedBody() is?
generated.h should not be in your cpp file
@graceful cave yes it should go under the GENERATED_BODY() line. I'd also recommend adding public: just to be safe
GENERATED_BODY()
public:
then the .h code
So I also actually have a problem to solve atm
in my FPS project I have some functionality to carry around physics props
it used to work fine until I decided to simulate some lag
now the local simulation and the serverside replication clash alot when moving stuff around
I have since tried to find a way to disable the movement replication for this specific prop for the duration it's being held
ie. the server and the client moving it independently
I have tried overriding IsNetRelevantFor(...) although with no success
SetReplicateMovement(...) had no effect either
or not the desired one atleast
been there, it's a pain in the ass. presumably you're using a physics constraint or something?
yea the physics handle
is this a VR project?
nah just plain FPS
so I cant use attachments
because I wanna keep collisions
atleast not for the first person view
well, I haven't done it myself but I know @heady merlin did an excellent job of creating replicated physics attachments in this class: https://bitbucket.org/mordentral/vrexpansionplugin/src/88fc3790453c91bc4a61abfaab1dadb3b0d36982/VRExpansionPlugin/Source/VRExpansionPlugin/Private/GripMotionControllerComponent.cpp?at=Master&fileviewer=file-view-default
It's written with VR motion controllers in mind but the nitty gritty stuff should be more or less the same
i built the project and now theres only one issue
im assuming it will be fine once it is overridden in the blueprint?
going through with the potential fixes just generates a function in the cpp
VS just spits out a warning
because it is expecting stuff there
but the macro will take care of that
yeah VS doesn't know what it's talking about. shouldn't be a real issue
in general take VS warnings with a grain of salt
as long as it compiles it shouldnt matter too much
not sure if here is the right place but i am having and issue in custom event spawning in an actor and setting a variable on mycontroller. but when i get the variable after i call the custom even it is none but when it triggers again i get the first variable. Ie spawn actor A then get it i get none then spawn actor B i get Actor A on the second time.
Okay so I decided to disable replication entirely on my phys props for experimentation purposes
and for soooome reason the physics handles still jitter on movement
clientside
theoretically there shouldn't be any latency involved anymore right?
@winter plover theoretically, i'd think
i have noticed though when using those GripMotionControllers in keyboard/mouse mode i also see that jitter. maybe an artifact of the way mouse movement is
no jitter when tracking motion controllers though. perhaps @heady merlin could offer some insight here
wait, @winter plover do you get the jitter in offline mode?
I feel like the satan guy is trolling. ๐ค
1 john 3:8 I feel like the satan guy is trolling
Hey. Is there an event or notification that happens on the client which says the connection is ready to be used?
I'm trying to make an RPC call as soon as the object spawns, and calling it in beginPlay throws a warning that no owning connection on object. If I make a small delay, i avoid the warning. I'd like to know the specific moment this happens, not trying to 'guess' with a timer.
How can i make a score system like - if projectile hits something, player state of player who spawned the projectile gets +1 score?
I already have AddScore function that adds score, but i need to get the player state from projectile BP
The Projectile should have a weapon as an owner, and said weapon should have a pawn as an owner @twin juniper
Then the projectile owner
and 1 projectile
@high heart I dont get any jitter on a listen server
But I do when I disable replication entirely for my props
@twin juniper track the score in the playerstate
any damage that is inflicted you wanna keep track of which character did it
then +1 the score field in their playerstate, which you will have to subclass
Thats what he said
He just needs the owner of the projectile, and from said owner, he should get the PS, would be ideal to cache it as a good practice.
yea I dont think theres any other way really
either cache the owner or the weapon itself
which should also have an owner reference ideally
you will have to manually cache it
ie. when you shoot it, tell it who shot it
so that when it hits something you can score properly
so add a variable expose on spawn with which character spawned it and set it to self on spawnactorfromclass?
You need to set the owner on the projectile when you spawn it
something like that yea
You dont need to add any variable
It is already one that will make it for you
If you use the node "SpawnActorFromClass"
i use that node yeah
You will see an input put that says "owner"
yes
Just set the owner there