#multiplayer
1 messages · Page 329 of 1
Ive tried begin play from the character, a custom event in the game instance, and begin play from the level
heh
I guess basically I've been trying to trigger an event on the creation of something (like a character or map) and that does multiples for each player
Do you mean a get player array from gamestate?
So, do you know exactly how many "multiples" of each character are occuring?
If you only ask from the server, it will only count the server PCs currently connected
Also, let me check, pretty sure there's even a simple GetConnectedPlayers
Or GetNumPlayers
that's it
That should be in GameMode
Had to look at my project real quick
Its a summation kindof. I can't think of a proper mathematical term for it... but if I had three players it always gets triggered once for the current player, twice for the next player loaded on the client, and three times for the third player loading in. If that makes sense, lol
Each time a player loads it redoes all of the code, lol
Sort of, there are technically multiples of each actors in the game
One for the server, one for the client
each client
@wary willow GetCurrentPlayers() is broken
@twin juniper Are you sure? Pretty sure I used it in 4.14 and it worked
it always returns 0
Honestly I've tried a bunch of things and its a huge mess. I'm going to just clean it up and work it out on paper to see if I can learn what I'm missing here
Depending on what your goal is. There are likely options. So context would help :9
True, the goal is to make a health bar for each member of the party, similar to dragon age. I really just need to figure out how to reference each players name and health, then create and update the widgets associated with their health bars
So the widget will add and update the panel for each party member when it's created
yep
Each panel should be linked to each player. I would approach this much like you would a score board
So let's see where your at. Do you have a separate widget for the single player That'l be added to the scroll box or whatever of another widget?
Yep, I have seperate widgets that get added into a vertical box
Ok so the problem is purely you want it to create the widgets and add children just once
Yeah, basically
But your getting multiples.
yep.
Ok this sounds like how and where the widgets are born
Yeah, I dont think I understand when and where I should be calling whatever creates these widgets
Because rl realistically it should all be on the controller as it can request the playerer array and then iterate on that
And t stays local to that player and doesn't tell other players to update there widget because he is so to speak
If that is fine and dandy here is one thing I always forgot to do. If I'm building a list of widgets to add as children clear children and arrays before running your logic
So it rebuilds with current
I dunno if this will be helpful but I have a old old video of sorting scores which involves building arrays from such info
Managed to get scores sorted, might be bugs in here? not sure.
I'll give it a try. I definitly agree, I'm just missing something basic here. I don't know what I'm missing, so I can't explain it well.
why is it that when i send a UInstancedStaticMeshComponent* to a ClientRPC it becomes nullptr
i even tested it
if(mycomponent != nullptr)
The component still needs to exist on the client at the time you send it; passing it as a parameter simply allows you to refer to the same object on both settings
If it doesn't exist in both settings, you'll get a nullptr
And from a quick search online, it appears ISMC doesn't support replication
yea
but ive seen people be able to call UpdateInstanceTransform()
and set the scale to 0
on a per instance basis
so what do you propose they did?
Basically, how can I update the scale of the instance for all clients if i am unable to access the ismc
If the components are on a replicated actor, you could use the actor as an intermediary to have them access their local components
I actually got around that by replicating the actor with ISMCs, but instead of replicating I use RPC trough controller(which has reference to said ism actor) to drive the transforms
but then again I have a system in place where server controls the local ISM actors anyway
Does this mean that everything in GameState is automatically replicated? Even variables?
If an item is set in gamestate to replicate I believe it replicates to clients unlike a character where that means it's replicated to server
Check exi guide it's pinned to chan
only default variables, you need to set custom variables replicated too
^ exi's guide will probably answer 99% of your questions
thanks
Hi everyone... Are there any "best practices" on how to do multiplayer? Any resources for that?
- Check the pinned messages.
- Do it from the start if you can, try and get things working with a dedicated server in PIE even if you're going to use listen servers.
Ok, will look into that, but there aren't any example cases like "how to replicate a widget" or "how to replicate a animation" or "how to replicate a actor with child actors" and stuff?
@hasty adder variables are only ever replicated down. You have to use RPCs to send info to the server
@twin juniper if you replicate state and then base your anims/widget off the state, then you have "replicated a widget"
As for the child actor thing.... depends on if those are just part of the actor or attached later.
Well I do replicate the state of the anim, but sometimes it replicates the anim and sometimes it doesn't and this is very very confusing
I can debug and fix singleplayer-issues pretty fast after 1 year of experience, but multiplayer is really something you have your wrap your head around
Yeah. All I'm saying though is that you can't really directly replicate those.
So its a lot easier to just replicate the state which you can derive the clientside stuff from. I guess anims aren't fully clientside, but still. Replication of actor state should solve that.
So if you never see, say, walk backwards anim on simulated proxies, then that means that you're not replicating some bit of state that the animBP uses to play that anim
If you're looking at adding MP to a project, I recommend making a practice project
I have issues with my motion controller grabbing animBP and this only depends on one state, the "grip state". I don't know if motion controller replication is also troublesome with their animations, because I know that you have to replicate the motion controllers manually which I did.
Can you post some screenshots/snippets?
I guess I can't and that's the bad thing =/ My boss wouldn't like me to show snippets of our current project, because it will be part of an expo soon (and no, I didn't sign any NDA, but I can see his point)
Singleplayer-wise everything works fine. I guess I have to study all those multiplayer-related stuff again and restructure the things that do not fit right now
SO you didn't build teh game from the ground up with Multiplayer in mind?
Well if you've got the grip state set to replicate, try having a function that runs on server that the owning client calls when they grip or release, then set the variable both on the OC and the server.
If you haven't already.
@wary willow well my boss did not tell me that it will have multiplayer in it, so I did not have multiplayer in mind when I started it
You can, of course, just set that server-side... but if you don't want ping to factor in you should set it on both.
If I had known, then I would have build it from the ground up with MP in mind
Currently it's 01:34 at my place and I don't have VR at home, so I can not try and test things. But I would like to read up some stuff, like those "best practices" to evaluate on how to restructure my mistakes
Just to make things clear again, because I'm a bit confused:
"Replicated" Variables and "(Component) Replicates" are used to transfer information from the server towards the client and not vice versa?
If the client wants to send it's information towards the server it needs to use a RPC. Is that correct?
Component and actor replication flags, AFAIK, just allow for the properties of those to be replicated- each var needs to also be marked for replication. At that point, its sever -> client (always)
Hmm. Anybody used RestartPlayer in gamemode? I try to do this
But nothing happens. I read that it should destroy pawn and spawn a new one like the fresh start
I user ResetPlayers bp node
@plain flume, it's a single player game ? why use PlayerCharacter 0 ?
I mean your function is ok for player 0 but only this one x)
make sure you call it server side
GM only exist on server side
hmm, isn't PlayerCharacter 0 always the default one unless it's a local multiplayer game
in Multiplayer everybody is player 0
and it is a multiplayer 😃
Should Multicast go throught one function, like Shoot() which will lead to another functions, or should each function be multicasted on its way?
@woeful garden One function is enough
So If I have a turn-based multiplayer setup and I want to tell the next client that it's his round (via a custom reliable event run on the server inside of my gamestate), then I can set some custom "my turn" boolean-variable which is replicated and inside of my pawn/player controller to "true", because the clients will get the replicated data anyway. I don't need to multicast this, do I?
@plain flume No, you have no guarantees of a certain pawn being index 0, you're probably thinking of player controllers on clients
Is this function on the client or server?
I know that a lot of people say that the local pawn is index 0 or something similar, but that's not true. Usually that'll be true for 99% of the time before pawns are reset, but that's just due to a timing thing, there's no guarantee of that.
Additionally, since you're already in the character, why not use this? Or is this a static function? It can't be static, you're using this on the first line :p
Hmm but you could get the local player controller index 0 and then get the controlled pawn. So you will always get the desired local pawn, don't you?
If you're on the client, yes
But I'm confused as to why any of this is necessary since we're already in the character 😄
What might be the reason, that my client is able to "click" a button via widget interaction and show the "pressed"-state but not actually firing the connected event?
Hey guys who is really interested in multiplayer blueprint?
I guess I am xD
Spawn widgets to the character owner controller so it is nice and local to them like it should be 😃
Hmm can you reassign the owner of a 3D widget?
Because I would like to have one 3D widget in world space which shows the players current data (which works, but it doesn't receive input)
@twin juniper ?
I think I know what you mean
And if so, just use a collision overlap?
which will get the reference, and in turn the controller for that player
I did something similar in my 1v1 VR game
@wary willow yeah, sounds reasonable. But doesn't that also override the owner if both players overlap the collision? Or can you sort it out by checking for locally controlled?
@twin juniper Well, you didn't say two players could overlap it
but, I am sure you could figure out the logic
Well they can 😅 they are free to move around
Sorry for not mentioning it
I will look into the ownership then :) thanks
Oh 3D widget
normally the dedicated server and the clients will be the same project?
the same game
Yep, if you need to insert special things into the server only you can check for UE_SERVER I believe, or you can separate it out into modules
Having separate projects just leads to versioning hell though
Do we have some kind of debug to view NetCullDistance in level?
Right now i'm only guessing, test and retest and retest ☹
so when u set a component to replicate
what exactly is it replicating
or enabling
don't replicated primitive values (integers, floats, bools etc) replicate just fine without any authority checking or RPCs?
@tough gyro when you run stuff as a server and have values replicated, then they will get send to the clients. If you run stuff as a client you will need RPCs to bring the desired values/information to the server so the server can replicate them
nothing will replicate by itself
@twin juniper Well your actor needs to have "replicated" checked as well as your components. If you do not replicate components, then the changes made on the server side will not be visible for the clients, because the server determines who sees and knows what. Sure the clients will also load the actors and components, but if you shoot a box which is not checked as replicating, then the box will for example fly away on the server but the server will not tell the clients that the box got shoot and hence moved
i know that
but what exactly does component replication do
it replicates the specific component when the actor is also set to "replicated"
if your actor is replicating but one component is not, then the changes of this non-replicating component will not reach the clients
@twin juniper or what do you want to know?
yeah i know all of that xd
how is component replication diff from actor replication
why would u do it on a component instead of the base actor
to keep things modular and to only replicate the things which you want to have replicated. Maybe you have an actor with many components and you don't need every component to be replicated. Every replicated information is netload and the less netload the better the performance
If your actor is not that complex and you need the components to replicate, then just check everything as replicated ^^
@stone lintel You can just apply a collision sphere to your actors that has netculldistance/2 set to radius for the spheres
Hey how do multicast functions work with network relavancy? Is it actually for ALL connected users? Or only connected users which are also relavant?
The latter
that's what i thought.
so really, we only want to use multicast functions in very specific situations and limit their use as much as possible.
I guess you could say that, but I mean it's not like they have a direct alternative (replicated variables with RepNotifys can sometimes serve the same purpose, but not always)
Any idea why all the clients just freeze when i add this to code? If i remove the function, everything works.
the bAreWeDead works if i force the boolean to change. But the characters ain't doing anything, except the server 😃
anyone here know how i can properly replicate this? It works now on the server, and the server sees the client rotate, but the client doesnt see itself rotate
@elder ravine I guess your pawn has "replicates" checked? You run the second event on the server but maybe you have to multicast it from the server to the/all client(s) to get it to work?
You mean i need to Check the Replicate on my Bp_PlayerCharacter? which is my pawn
i think its not checked atm
yes. I guess pawns/charakters are replicated by default but checking those checkboxes is always a good idea
okay ima try that right now
and everytime i try to multicast the second event, then the Client Camera glitches into the map
even with Reliable unchecked
Multicasting inside of the pawn is better I guess
Never did a multicast inside of a PC, I think
TLDR: don't do it
@twin juniper so i need to move all of this logic in my BP_PlayerCharacter, which is the pawn
whats the issue multicasting in PlayerController?
The PlayerController only exists on the server and the relevant client, not all clients
When you multicast on it, best case scenario is only one client receives the RPC.
LethalClips, if i send you my project, in a zip via Dropbox
could you fix it for me?
What usually happens is the controller freaks out and depossesses its pawn
I'll compensate you for it ofcourse
"Fix" the project is pretty open-ended 😄
xDDDD
well i mean like, just get the replication to work xD
currently the server sees everything
but client wont see own rotation
@elder ravine I know that multiplayer-stuff is tedious, but I would recommend you to wrap your head around those topics ^^
@twin juniper ye im trying xD
Just curious, I see your pawn is a character in the top tab, why not use the CharacterMovementComponent?
It does all this stuff automatically
I don't know multiplayer-stuff that good as well, but I'm also trying ^^ Learning by doing and fail faster to learn from your mistakes 😉
what could the CharacterMovementComponent solve for me in this instance? What im trying to build is a topdown shooter, in which you control the character with WSDA, and the player always looks at the mouse position
How could i fix this with CharacterMovementComponent?
@elder ravine I guess the CharacterMovementComponent handles most of the replication by itself
thanks for the advice @twin juniper
Yeah, it handles pretty much all of the replication for you
ohhh
It should already be there since you have a character :p
Unless you named something that wasn't a character a character
no i didnt do that
ye i see the componnent here, and i clicked it
this is where i can change stuff liek movement speed n things
i dont see anything in the CharacterMovementComponent that makes the player always look at the mouse location
Well no, it won't fix everything for you instantly
But making use of it will be much easier
IIRC you can just set your controller's rotation on the client and have the change propagate to all clients, since you have a proxy on the pawn
You can keep all of your current look at logic, you just need to use the CMC to do the actual movement and replication
Well, you don't need to, but it would help 😄
I know you've been on it a while—if you really try and can't get it, feel free to send the project over and I'll give you a little direction, don't worry about paying or anything
Not even C++. 😉
C#
*.cs files are C#
Unreal's UBT, the Unreal Build Tool, reads C# files that describe modules of code.
Targets, too.
Which are different.
You have some *.target.cs file that is using the older SetupBinaries method
You should open the file and look at the SetupBinaries method.
See what it's doing in there.
That will help to inform what you need to instead add to the ExtraModuleNames array.
ShooterGame is ark survival evolved's game name
There you go. Remove that whole method, and just do ExtraModuleNames.Add("FinalShooter");.
In the constructor.
That's what it's telling you to do.
Replace that whole method with doing the equivalent, in the constructor, using ExtraModuleNames.
The whole SetupBinaries method needs to be removed.
The whole entire method.
The whole thing is deprecated.
S'alright. This is C# but it should look very, very similar to C++.
And a lot of knowledge transfers.
Yes, that's right.
Your formatting is all over the damn place, but otherwise, that's right.
NP
Hey guys, quick question. I have a basic RPC setup:
When the server fires Client_AddItem it all works
but when a client fires Client_AddItem, Server_AddItem is never executed
the actor is set to replicate and the Client_AddItem is requested from a widget
Got the issue! appearently the blueprint didnt recieve the correct owner
Anyone tried netprofiling their game?
mine's pretty bad
The spikes are random actors replicating random variables that have nothing to do with the actor that's replicated
For example the player controller is replicating the weapon spread when it's not referencing it in any way..
I have no idea why
@inner iris i think some of the server tutorial is old now
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
[SupportedPlatforms(UnrealPlatformClass.Server)]
public class ScoreboardServerTarget : TargetRules
{
public ScoreboardServerTarget(TargetInfo Target)
{
Type = TargetType.Server;
bUsesSteam = true;
}
//
// TargetRules interface.
//
public override void SetupBinaries
(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("Scoreboard");
}
}
Not sure if your had this one, but this works now. Just change the Scoreboard to something you have
Thanks @plain flume
The person who wrote the guide originally was kind enough to help me out- needed a delete / refresh and also was able to replace the Server.target.cs with the one from the updated 4.16 ShooterGame and it all worked nicely
The final script looks like this:
using System.Collections.Generic;
[SupportedPlatforms(UnrealPlatformClass.Server)]
public class FinalShooterServerTarget : TargetRules
{
public FinalShooterServerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Server;
bUsesSteam = false;
ExtraModuleNames.Add("FinalShooter");
}
}
Anyway all working on an Amazon EC2 instance- small victory but feels great!
Aah good thing you got it working :).
I asked this yesterday, but there was no answers. I try to use variable replication in C++, but when ever i type the GetLifeTimeReplicatedProps() function and set my replicated variables to there, all characters are just staying in one place. Even the server. Here you can see that spawned client ain't dropping down, it just floats. In Blueprints, everything works. Any idea what to do?
Try calling Super::GetLifetimeReplicatedProps
When you're overriding an engine function, 95% of the time you'll want to call the parent function or stuff will go awry quickly
Aah. Right. Thanks! That did the trick.
My function is being looped by multicast, which is called on PlayerInput IE_Pressed, should Inputs be replicated?
i managed to get the server working
but i cant connect with a client
following a wiki tutorial
is using open level still the way to do it
nothing happens
trying from the standalone
Using an address as the level name seems super sketch.
But I am not familiar.
Though I'd believe it - that's probably ancient sacred and inviolable legacy from the earliest days of Unreal.
So... I can't answer you but I'd be suspicious of arbitrarly passing anything other than a path to a level asset to "level name".
(While also not at all being surprised if passing things that are not, in fact, the names of levels to "level name" is actually allowed.)
how can i set a timer on the server, to do something on clients. For some reason, when I make a change to a instance static mesh, and make changes to an instance (for example, set scale to 0,0,0), the client will update collision. However, the mesh itself will not change on clients. Second, if I try to do a multicast and pass the component as a param, it returns nullptr. Lastly, if I do it as a Client RPC then it works fine and removes the instance on the client (but only if its removed on the server first). My last issue is that after removing it I need to be able to change the scale back to 1,1,1 after X time. Any ideas? Help would be greatly appreciated. I have been dealing with this issue for about 2 weeks now. 😦
@twin vault - a few things - open level isn't the way to do it with onlinesubsystemsteam - you can do it with open using onlinesubsystemnull tho
if you're testing steam you have to have seperate computers for sever and client
oh
to do it with steam, you have to auth it against steam, and register a session, then that will let you search it out on the client, and join the session to connect
not sure if i'm misinterpreting this wiki, but im also not sure if its possible to do dedicated steam servers 100% in blueprints
@night jay you sure it isn't referencing it by being the owner? https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/OwningConnections/
An overview of the role of the server in multiplayer.
(attachment sets ownership automatically too)
@fringe dove I'll look into it, thanks!
void UVeritexFoliageInstance::Client_DespawnFoliage_Implementation(int32 Item)
{
FTransform OutTransform;
GetInstanceTransform(Item, OutTransform);
FVector Location = OutTransform.GetLocation();
FQuat Rotation = OutTransform.GetRotation();
FVector Scale = FVector(0, 0, 0);
FTransform NewTransform = FTransform(Rotation, Location, Scale);
UpdateInstanceTransform(Item, NewTransform, false, true, true);
}
bool UVeritexFoliageInstance::Client_DespawnFoliage_Validate(int32 Item)
{
return true;
}```
why does this work
but not this
void UVeritexFoliageInstance::Client_RespawnFoliage_Implementation(int32 Item)
{
FTransform OutTransform;
GetInstanceTransform(Item, OutTransform);
FVector Location = OutTransform.GetLocation();
FQuat Rotation = OutTransform.GetRotation();
FVector Scale = FVector(1, 1, 1);
FTransform NewTransform = FTransform(Rotation, Location, Scale);
UpdateInstanceTransform(Item, NewTransform, false, true, true);
}
bool UVeritexFoliageInstance::Client_RespawnFoliage_Validate(int32 Item)
{
return true;
}```
It can scale down, but not up?
How does UE4 handle IPV6 addresses? When executing the console command Open "some ipv6 address" it gives the following error: "Name may not contain the following characters: :" seems kind of weird as ':' is required for any Ipv6 address?
I did find in UE's source code that they want to list ipv6 addresses surrounded by square bracks like [ipv6-address], but then I still get a host name resolution failed error (code 48) and the following reported remote address: "Sending hello. [UNetConnection] RemoteAddr: 0.0.0.0:7777, Name: IpConnection_4, " suggesting it still uses ipv4
ipv4 or ipv6?
I looked at some patch notes and they do mention ipv6 multiple times
it might be possible
i dont see why u would want to do it that way though
unless u are running a strictly ipv6 network
because as far as i understand, ipv6 is still not the standard.
It's just a secondary alternative.
hmm, still; quite a few people will have ipv6 so it feels weird to not include them in the final product. I've been assigned an ipv6 address myself as well, which makes testing kind of annoying if it doesn't support it 😛
yeah
u should be able to do it locally though
like if u have a local copy of your project
just use your local computers setup
and setup ipv4 on lan
lol
if u are using OnlineSubsystemNull its setup to only work on LAN
Lol.
@brittle sinew So good news by the way
I've been able to fully replicate the instance component
IT ALL WORKS
HOLLLY CRAP
How do u smooth nrotation over a network
its not like velocity witch can be predicted is it
"witch"
Whatever drives it if it's in the anim bp. But if it's a one off I think your executing on server the animation. I drive all mine with bools anyway so not sure about the others ways
I like to think everyone has the copy of your anim bp. And will know if your walking or is falling etc... So if I'm replicating a change in a bool then there copy of my animBP will change its state accordingly on there side so as long as I replicate the bool change right
Anyone can point me in the direction where i can get info on how to allow player transitions between say map1 and map2 and map2 is a dungeon instance sort of thing? But still allow players to stay on map1 who dont want to goto map2
@unreal bison Haven't used it but try take a look at AGameMode::SendPlayer
Maybe it's what you're looking for,, maybe 😃
It turns out it's deprecated on 4.14,, u must use ClientTravel directly
Ok im not the best coder but ill take a gander at that
Can the server run multiple maps though?
I don't think level streaming works over steam, but correct me if I'm wrong
It works everywhere?
Only streaming levels for certain clients
You would need to stream it as the server too
Yes, and I guess that's fine if it's dedicated
Yea you would have to use a dedicated server
Just like how world comp works
If the host leaves a map bad stuff happens
@twin juniper Level streaming has nothing to do with Steam.
I actually came here to talk about dedicated because of the redundancy I have to write because of a client running the server
@warm pagoda No you're right, I was thinking of something else
Maybe client travel to different servers? Maybe that doesn't behave well with Steam server browser stuff?
No you can't find other sessions when you're connected to one
And it always seems to take a good while before a player has registered as "not in session" with steam
(I didn't mean server browser, but the joining a friend's server via Steam interface thing.)
UE4 steam online subsystem sucks #UseUWorks
Ah
Oh, yeah no that only works if you're not in a session already
But I got the invitation to work
And you can invite while you're in a session
uworks is ok if your game only needs steam and never anything else
since the point of an online subsystem is to abstract out the platform specifics
i ended up just modifying the existing steam OSS a bunch
like removing the P2P for dedicated because that's a thing for some reason
Tick is called on every instance of an Actor regardless of network authority
Ah what's a good place to start with C++ and networking? Most of the tuts I see are from way earlier versions
@glad sedge Shooter game is the best example for C++ networking, and for a start maybe Exi's compendium can help you, it's a pinned message you should check it out
@stone lintel the FPS or the twin stick ?
@glad sedge The FPS
I don't see much in the way of C++ implementation - must just be with BPs? Though it's not overly complex.
@glad sedge Do you understand Blueprints and networking? There's nothing more to find out with C++ about networking, at least the simple part of networking
Well I understand BPs, but networking is new to me.
I would recommend understanding network using Blueprints, at least at the beginning
if that's your case
and I'm working within C++ so I was wondering if there's any big differences.
Yeah might be an idea
I like the GenericShooter project, take a look
kk thanks
Oh, now I'm not sure. GenericShooter is at $65 now, so see if that's worth for you. 😛
Definitely start with the compendium, you shouldn't have to use C++ to understand UE4 networking. Good luck =}
oh wow, this is great
you should be able to do every basic networking stuff inside BP, even create and find Steam sessions. But you'll find the need of C++ when you feel limited about what's available to you in BP. At this point, you should be familiar with UE4 networking.
hey guys i've wasted too much time trying to learn how to implement Voice chats in ue4 made games >>> do u have any tutorials that can help me ?
How reliable is multiplayer-testing in the editor compared to "real" testing with a packaged version and locally connected pcs, assuming that the clients always finds the server? Which information are reliable from the editor multiplayer and which information are not? Are there any experiences?
@mental glacier look up proteus multiplayer template. He has voip implemented and you can look into the project files to understand how it works
Does nobody know the answer to my question? =/
From what I saw, there can be a lot of differences between a dedicated server and a server hosted on a client
So it depends on the way you're testing your multiplayer
The whole replication thing is kinda tricky and works differently (assuming it works at all) in both scenarios
Don't trust in editor. Least build it out to test internally
Has anybody here created a node.js master server so that the player can request a server list from it. Im learning how to do this with the VA Rest plugin
I've done simple webdev stuff like that, setting up a basic REST API shouldn't be that difficult
Yeah, you could do it any number of ways really
Tho "real" programmers would scoff at how I report my heartbeats 😃
Url embedded parameters lol
I like Sails, it even has blueprints 
Reminds me is there a way in blueprint to get the port the null oss has picked if the default is taken?
I try to avoid unneeded plugins 😃
hmmm whats the process for replicating projectiles?
U spawn them on the server obviously, but then how to u handle clients seeing it?
If it's a replicated actor, you're pretty much done
Other than prediction and smoothing if that's something you want to implement
Make sure the relevant components are replicated as well
Hmmm
I cant get it to smooth on the clients
Second i get homing target it gets jottery af
hmm
jittery*
Okay i am an idiot
I forgot to replicate the target
So the missle was trying to go one way on the client and another way on the server
lmao
Hi, does anyone know if in general it'd be better to use multicast rpcs or repnotify with a min and net freq of 20?
(for cases where either way would work of course)
@wet lion we use multicast if we want replicate something which is not persistent through game for example in a case like visual effects this (animation, particles, etc) because it's only affect clients who are network relevant at the moment multicast is broadcasted. On the other hand use RepNotify if the replicated variable is persistent through game, so if there's a client who's not in network relevant at the moment, he will get the replicated variable later if he becomes relevant again through RepNotify. For example you could use this for a variable like bIsDoorOpen
so a pickup should still be repnotify right? cause if not an actor not net relevant would otherwise then see the pick up
if it had previously been picked up by someone else
Meaning, even though once picked up the pickup goes away, it might need a repnotify picked up to then destroy itself
assume a unique not respawning pickup
AFAIK if you destroy the pickup actor in server with bForceNetUpdate = true it will get destroyed on client as well if server is the owner of that pickup actor
@stone lintel I'm trying to figure out the best approach for a scenario in whic a pawn can pick up an object.
But the object takes time to pick up (i.e. pick up button held for x seconds) and picking up can be aborted.
While a player is interacting with the object, no other player can interact with it.
I can think of this approach:
A: Start Interaction:
1- local controller, on some key press, calls "StartInteraction" on local pawn. This is an RPC->Server.
2- server pawn checks if an internal var "OverlappingObject" is valid.
3- if it is, it sets a repnotify "InteractorID" in the server version of the object being interacted with. [see note]
4- all versions of the object (server and client) do something based on the event.
B: End Interaction:
1- If local controller releases the key, it calls "EndInteraction" on local pawn. This is an RPC->Server.
2- server pawn sets a repnotify "InteractorID" in the server version of the object being interacted with to a sentinel meaning "none".[see note]
3- all versions of the object (server and client) do something based on the event.
C: Interaction Complete:
1- If x time goes by in the server from when Start Interaction happened, server version of the object sends Multicast RPC
2- all verions of the object (server and client) do something based on event, followed by destroying themselves.
[NOTE] I would set an int ID instead of the pawn itself. Then each client would iterate over GameState->PlayerArray to find the right PlayerState
based off the ID and from the PlayerState grab the right pawn (my player states have a local ref to their pawn and a custom ID).
This is cause otherwise I think sending a pawn ref over an rpc makes no sense. Since the pawn will not directly match a client's version of that
pawn.
My questions are:
1- Does this seem sensible? Or am I overengineering? Or getting something wrong?
2- Would it make sense to replace A.3 and B.2 with multicasts plus each version of the object having it's own local bool "IsBeingInteractedWith"
so as to prevent another player interacting with it while another player is already interacting?
disregard the bold. it is cause in A.3 and B.2 I put a "***" to mark the note below
There
wait give me time to read, i'll try to help
yeah yeah no problem. Thanks!
ow this is the exact same method of interaction which i'm creating right now
however the way i do it, PlayerPressAndHold->Set bInteracting is true -> Server will calculate the progress as long as it's not EndInteraction same like you it's RPC. The calculation progress is inside Tick() but on server side,, if it's done.. destroy the actor.. and replicate new item for that client
i will assume you have some kind of replicated inventory right?
as of now not, but most probably yes at some point
So in this case would you do multicast or repnotify for steps A.3 and B.2?
i prefer server use bIsBeingInteractedWith to prevent other interact the same object.. since you;re already checking it in A.2
no need to replicate who's interacting the current object.. server simply reject that client can't interact with this actor because APickupActor::bIsBeingInteractedWith is true
the moment client call StartInteraction, server simply check if this client can interact? if not reject
Btw 0XFEDE, make sure you set the variable beinginteractedwith when you check it
at least that's how i handle it,, but i'm not sure if it's your intention
I did not get that last part. You mean the InteractorID? it's a repnotify so in StartInteraction(int PawnID) the code would do IntreactorID = PawnID followed by OnRep_InteractorID()
CMIIW you use InteractorID to prevent other interacting with same actor, is that right?
yeah, but also cause the local version of the object will trigger an event on the local version of the pawn interacting too. That is why I use an id as opposed to a bool
to know specifically which pawn
does the event only affect the client who's doing the interaction or every client needs to know?
every
cause I have a progress bar that shows up above the player doing the interaction
what I mentioned in my explanation works so far... but I was just wondering if it made sense
or if I overcomplicated it or missed something
Okey if it's already working then there's no problem 😃
However if you're wondering ..
about how other people would do
right but maybe I was supposed to use an multicast instead... I don't know. All I read is that RPC is more expensive than repnotify. But then I also tested and to get a good response time with repnotify, the minum net freq and min net freq has to be 20 at least in my project
and also with rpc that it can be missed due to net culling distance, relevance etc.
but yeah I'm interested in how others would do it 😃
i only need this replicated variables, [(Replicated)CurrentProgress this is on actor, (ReplicatedUsing = OnRep_Interacting)bInteracting this is on pawn]
that's how i would do because it's the exact same interaction method which i'm creating right now, and there' progress bar as well
right so you show the bar to everyone onrep_isbeingInteractedWith right?
not with bInteract
but with CurrentProgress it's not OnRep
bInteracting is for playing the animation
for the progress bar, a replicated variable AInteractionActor::CurrentProgress is enough
right
in my case, each client does the progress on their own. The server only says when the interaction starts and when it ends. So the computing of time is local for the bar, for cosmetic reasons and to save bandwidth. But it is still authoritative cause the server says when x seconds finally are up.
oh i see
yeah cause I was first repnotifying the progress and noticed depending on ping times and whatnot it wasn't very smooth sometimes
I guess I could also try doing local passage of time but based off the gameState's server time
but either way, just on local tick with delta time works well for me. But like I said, regardless of the local time, the server does tell the thing when the time is up
then yes, if it's working no problem then i thought you're still trying to figure it out
not as in figuring out cause it did not work. But more as in, to learn more and make sure I am doing it in a sensible way.
hey I'm like half way through compendium and I have a small q
is a lot of network functions based inside GameState ?
what is the question?
if you should put net functions inside game state?
gamestate by default has an update frequency of 10 (a pawn has 100 for comparison and I've found that for smooth replication you need at least 20 in both net and min net)
so that is something to keep in mind for replicated vars. For RPCs I don't think it affects
@stone lintel btw do you know if ticking is a requirement for rpc and replication? Cause I made a class (another one, not the one we were talking about) and in the constructor I set canevertick to false. But if I make a BP subclass of the c++ class I see that in BP the "start with tick enabled" is true anyway. As if it didn't really care about the c++ constructor. And even if I turn off the checkbox in BP, at runtime the actor replicates just fine.
This is cause if ticking is not necessary I might as well turn it off
@wet lion yes if we don't need to use tick we should turn it off
for BP i'm not really sure
but is ticking needed for replication?
Haven't figured that out from the source code yet
I think it might not be needed. That it uses a different timer and dispatcher for replication and rpcs
AFAIK tick is not required for replication, bCanEverTick is only for AActor::Tick() function to be called
gotcha
i think based on this
/**
* Primary Actor tick function, which calls TickActor().
* Tick functions can be configured to control whether ticking is enabled, at what time during a frame the update occurs, and to set up tick dependencies.
* @see https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/FTickFunction/
* @see AddTickPrerequisiteActor(), AddTickPrerequisiteComponent()
*/
UPROPERTY(EditDefaultsOnly, Category="Tick")
struct FActorTickFunction PrimaryActorTick;
If it's a dedicated server, I don't have to worry about PC being server do I?
Ah do I have to declare _Implementation in my header or not? I'm getting two conflicting tuts here
@glad sedge if your function derived from parent, you declare FunctionName_Implementation in header, if not you only define in .cpp
So Character, for example, is derived from Actor and therefore would require it being in the header?
what i mean is if you have a RPC function which is something like UFUNCTION(Server, Reliable, WithValidation) virtual void ServerRPC(),, you define the ServerRPC_Implementation in .cpp.. but if the subclass wants to override you declare virtual void ServerRPC_Implementation in .h file and define in .cpp as well
ok I think I understand
Btw, anyone knows if there's any html code tag like [Code] blablba [/Code] in discord?
@Skifferz#3154 , @glad sedge use 3 ` on both side of your code
coolioo
So I have a different gamemode and playercontroller in my main menu and a different gamemode and playercontroller in my game
How do I make use of Seamless travel when these 2 are persisting during it
@hasty adder Yeah, I know that you shouldn't trust the editor with multiplayer, but it's so damn tedious to package the game, transfer it to another pc and then try to play and test stuff out parallel on your own.... That's why I want to know which information is reliable and which isn't
If an ios game had 2 player real time multiplayer would it lag?
@keen basalt depends on how many ressources are required and if your device is powerful enough for that
@keen basalt you would have to test it on the device you want to develop it for to know for sure. If it doesn't lag, then you can proceed and add stuff if you like. If it lags, then try to make things smarter so it doesn't require that many ressources. To test if 2 player realtime multiplayer doesn't lag you can just put these 2 players in a empty map with the minimal amount of interaction/input to evaluate it
what do u mean resources?
@keen basalt your software needs ressources to work. It need's cpu power, gpu power, disk space and RAM etc to work properly. If you create something which is very beatiful to say it bluntly then it will most likely use a lot of gpu power for all those textures and shaders. But if you have many things to process like many many AI-driven pawns, Logic or events, then your program will use a lot of cpu power, etc.
no, it means on how you program it
Wait what?
@keen basalt it depends on how you program or structure it. A small size program can run like shit if you program it very very poorly. But a gigantic game can run like butter if you program and test it really really well
@keen basalt for example. Try to make a "small" 5 minutes game but only use texture with 4k resolution or with very very complex shaders and a lot of transparency ^^ Then your project/game is small but will most likely run like shit xD
@keen basalt "it depends on how you program/structure/do it"
@keen basalt just because your idea is "like something" doesn't mean that it will run similarly
it can run better, similar or worse
so how would I make it program to the best it can be?
@keen basalt create a good and solid multiplayer-system, replicate only the information which need to be replicated and test your game according to the ressources needed (cpu, gpu, ram, netload), so you know where you can improve the performance if you need a better performance or to make it more shiny if you still have performance. It depends on what you want to achieve
this is all new to me where would u suggest I start?
Netprofiler?
i mean this https://docs.unrealengine.com/latest/INT/Gameplay/Tools/NetworkProfiler/ only if you have no idea if it's exist
Tool for displaying network traffic and performance information captured at runtime.
@keen basalt How well do you know UE4 in general? I think it would be best for you to start creating a small singleplayer game and use a profiler to get to know which things require what ressources
yeah already done that of course
to me it sounds like the whole thing needs resources
@keen basalt welcome to digital era
someone got the .3 release notes?
.2*
nvm got em
weird they didnt shop up at first
What are possible reasons that two connected PCs can ping each other but can not join a session today when it worked fine yesterday.... I didn't touch the session system at all... so wtf?
their internet crashed at the same time?
they both subscribed to the same network at the same time and it expired?
then what?
I can ping the other PC but I can suddenly not find it's session which is wierd...
whys can't it find its session?
dunno... restarting all PCs...
so how does 1 simply make splitscreen on the same camera?
@keen basalt I never did something like this but you could place two cameras into your world each with their own render target and put those rendertarget into a widget which you can put onto your screen. Inside of the widget you can then decide where you want your splitscreen to be, like top and bottom or left and right
would this work like glow hockey?
.... "it depends on how you do it" ... like we already told you. You have to figure out how glow hockey does it so you can recreate it. There is no easy "Works Like XYZ"-Button in any engine
Wtf is glow hockey
nvm that so what are all the tools I would need for online multiplayer so I can put it all together?
it's an ios app
The blueprint editor and a brain
Question for you network guys
all this can be done in blueprint huh?
Most of it should be able to
would I need to pay for Web hosting?
If your sticking too 10kb/sec per player, and u have a strong line of 100mb/sec up and down, what type of player connection do u recon u could hold with 10% veriance factor?
Just out of curiosity, the UNetDriver will not throttle as there is master server control
I'd recommend following some multiplayer guides
@keen basalt very very very many things can be done in BP, but with C++ you have full control if you want to create your very own fancy stuff
The whole point of the blueprint editor is so it's a visual experience making it seem easier
Its writing C++ for you.
That's why I like it so much
do i need to spend money on anything or?
Cuz this is online multiplayer were talking about
I guess
If so, then you shouldn't need to spend money on hosting
oh thank god
You will need to find a way to communicate with the other client
Maybe Bluetooth, or local connection within your Wi-Fi
Well
idk
Server to server? what?
Server is the base running everything.
The client interacts with the server
Saying "I fired" or something
Then it verifies you hit on server side
That means I'm gonna need hosting or base the whole connection of the host with the better internet?
Uhm, depends
Stupid phone
Well, since it's UE4 I've had issues running it on Linux-based operation systems like Ubuntu
what's linux
🤦
I'm new to this
Its widely used for server operation systems
Whyd you choose that?
How is it possible that "Find Session" gives you an empty Session and telling you it a "Success"?
is it the best?
I'll check it out
You might need a Windows based server
I'd recommend using local multiplayer for now... And get better with everything
ye guess ur right
but the time will come and when it does
Will using Linux involve having to do coding?
It really widely depends on what you want.
A basic 1v1 no lag real time multiplayer game
Do you want a login server that verifies your connection and saves states?
Yep
An online multiplayer is not basic
Then you'd need to make an authentication server, which I'm not sure is possible in blueprint editor
You'll have to look at sending data to the authentication server which could possibly be done with the VaRest plugin or else using C++
But it does.
Grrr
It's pretty important for anything custom especially with multiplayer
Just hope you can find a public plugin and a public authentication server
@keen basalt if c++ doesn't exist you would never have used soooo many programs including ue4... check your level of expectation
But I doubt that exists
Fuck there is no hope
most likely the way is to learn the stuff and get to know how the system works
Yes yes yes
Only solutions
Anything is learnable- you'll then have the benefit of fully understanding how it works
So you can change it later on
Uhhh learn
You are learning to code using the blueprint editor
That word
Minus the syntax
We all want perfectly functional and networked games but it requires more than the stuff Epic has already set up
Which is a lot
Find it and stop complaining then
I can't I need ur big brains to guide me in the right direction
that doesn't involve code
Nooo
@keen basalt Here you have the solution to all your problems https://docs.unrealengine.com/latest/INT/ And now stop complaining
Also a good site: https://www.google.com
I restart my systems again.... I don't get why my sessions can not be found....
Eckz ur missing a quadrant of your puzzle
@keen basalt Noooo don't be like that,, don't give up.. go find plugin for blueprint
Depends on experience and stuff
@keen basalt I'm rooting youuu
if 100 bucks per hour is a "normal" rate for freelancing I really should start doing that xD
they probs stall time to get their hours up so that's a no go
Morpho you'd be filthy stinkin rich
Ok... can now someone please help me with my session problem? I start getting mad here..... Why the hell does "Find Session" do the "On Success" route, giving me one Found Session which is empty and therefore can not be joined?!
@twin juniper Happened to me as well,, have u tried disable your firewall just for testing purpose. Is OSSNull or Steam?
Yesterday this did not happen... I have no firewall active and I didn't touch the session system in any way, so the OSS isn't null.
so you're using OnlineSubsystemSteam
Maybe u put your "on success" trigger set at the wrong time so when u start find session it sets it off automatically
This is just a suggestion for u to check if that's the case
@stone lintel indeed, it was set to steam... I changed it to LAN now and will rebuild it
@stone lintel but why wasn't that an issue yesterday? o.O
I will assume you're checking Success/Failure on delegate callback not on function return
it's happened to me once, but it turns out in my case the culprit is DefaultEngine.ini which i hv no idea why it was resetted
@stone lintel I use Proteus 2.3 Multiplayer Template and the "Find Session" is inside of a Macro
so every setting related to networking like NetDriver, OnlineSubsystem , etc disappeared
the DefaultEngine.ini is as it should be, nothing changed there
@twin juniper oh if you're using plugin i'm not sure i can help 😄 you should try contact the creator
yes oke it's template but still you should try talk to the creator
Ok it works now after I set the OSS to LAN.... But what the fuck? Why did it work the days and weeks before when it was set to Steam?
There are so many things that I don't really get according to Multiplayer Development....
Heya! Please, tell me, why can I recieve this error when try to create multipayer session?
LogScriptCore:Warning: Script Msg: CreateSession - Invalid player state
Is it necessary to compile a new dedicated server build on each client build update? I just packaged a new version of the client with updated settings but was still able to join and deal damage to another outdated client.
Hi guys, i ask you because i try to recreate a lobby session like call of duty, the player press on a button and he search a lobby when he stay other players and after all conditions set on true, one guys host the game for all other players
i made a system with a menu and the players choose to host a session or find fessions, when he finds sessions he can join the ésevers", i have a idea but i'm not sure. Its possible to create a lobby with all players and i look who have the best ping and after that this choosen player host a sessions and all other players in the lobby autojoin the host but i'm not sure
Can anyone tell me why "Get controlled pawn" inside my playercontroller will return nothing when I run it on my client?
server returns pawn fine
event that is calling Get Controlled Pawn is "Run on Owner"
Is it possible it's a timing issue?
I call the event after the pawn has been spawning and the controller posseses it
Can you somehow bind an event when a PC posseses something?
That's still probably the issue; even if you call the RPC after you spawn the pawn on the server you have no guarantee it'll replicate to the client before the RPC reaches
OnRep_Pawn
Not available in BP though, unfortunately
You could always just have a BlueprintImplementableEvent that you call in a C++ version of it, little workaround
dont know enough c++ to do that I am afraid 😦
So far all my adventures into visual studio has ended up in errors and crashes 😛
Well, if it's really something you need it's not that difficult 😄
Declaring a method and calling it from another one, I can show you if needed
I installed visual studio, but it installed in chinese, and wouldn't give me language options 😦
so it can't be as hard as having half the messages / errors in chinese.
so you can do it!
would be awesome if you could 😃 Would appreciate some help. So far 85% of my problems seems to be that blueprints that needs to reference the pawn gets their references before its replicated, as you said
btw, does Visual Studio 2015 still work for 4.16?
I believe so
Cool. In case you dont have time @brittle sinew do you have any tutorial/documentation for me to look at?
I think the specific topic might be a bit niche for a tutorial, but here's one on BlueprintImplementableEvents https://wiki.unrealengine.com/Blueprints,_Empower_Your_Entire_Team_With_BlueprintImplementableEvent
My guess is that you extend the playercontroller and create a BP callable event when onrep_pawn functions
I have the Introduction to C++ in UE4 udemy/somethingsomething course
I just dont have the time to dive into a new programming language at this point in time
Yeah, I get that
Basically what you'll do is make a C++ child of APlayerController and reparent your BP one to that
(make sure to back up/have source control before trying a reparent)
running the entire project in my dropbox, guess I will be fine 😃
worst case, my playercontroller have like.. 3 events with logic attached.. I will rebuild in case this goes wrong
please get source control! 😃
^
Yeah normally I would.. Had some very bad experience with last time though
was using GIT
restoring old points kept undeleting a large amount of files
that wasnt in the commits I was reverting to
so each time I had to revert back to an older commit, it also included 25 minutes of cleaning up the project
never understood why.. I have used GIT lots of times on other types of projects(like websites, rest api's etc.)
perforce seems to be really fast and nice
so... Just spitballing before diving into this.. Would this be totally out of the water?
`.h:
UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "onPawnPossesed"))
void onPawnPossesed();
.cpp:
void MyCustomPlayerController::OnRep_Pawn()
{
Super::OnRep_Pawn();
//========================
// BP Interface
this->onPawnPossesed();
//========================
}`
What would be the corrent way to get the PlayerName variable from different Player Controllers so it shows in every Character Properly? In PostLogin i set variable called PlayerName inside the joined Player Controller. In Player Character i now just simply have MyController->GetPlayerName() and set that as the name. But the problem is i think that it will always take the self controller so every person is named the same. I would somehow need to get the name from the client controller.
*other clients
Delicious, put that into playerstates as they are replicated on all clients
@native moth that's...pretty much exactly how you would do it :p
player controllers are not
Make sure to override the OnRep_Pawn though
Didnt I override it there? 😛
interesting..
Man... I just cant wrap my head around how/why you would need a header file ^^ I guess I am just a peasent web programmer 😄
I'm with you somewhat, they make sense to me but then I realize that basically no other language has them
If I were to pass a reference to my pawn into the BP event, how would I go about that?
I just can't stand duck typed languages (which is pretty much everything else major)
I believe you can just pass it as a parameter like normal
void onPawnPossesed(APawn* Pawn);```
this->onPawnPossesed(Pawn);
Not 100% what the pawn variable is called 😛
"AYourCharacter* Pawn = Cast(GetCharacter());
GetCharacter() not GetPawn(), it will work :)))"
guess GetCharacter() could return it
If you have a character, yes
in this case I do, but would nice to make it return the parent class(pawn) instead
@native moth I still need to learn networking, but you're getting out there and doin' this stuff! you're a hero!
Problem is, I teamed up with one my collegues who is a pretty bad-ass artist, saying I could easily match his tempo with the game logic
Then I started hitting how complicated replication can get 😦
I want to make a great multiplayer game; I'm a looooooooooooooong way off
Same here man. Thank the heavens for people like Lethal and Cedric that can help us in the right direction 😃
@native moth How would i change PlayerState, i can only Get stuff from it, but cannot put anything
i originally planned to put those in there
*set anything i mean
haha, gotta love C++. Added a C++ class and had to restart the project to build project files. Now I get build errors when I open it 😄
Wait, what did you do when you "built project files"?
Added an Player Controller c++ class with the wizard
Got an error saying "Couldnt generate project files"
Quick google said to close down project, right click on project files and press "Generate Visual Studio project files"
Here, try this
Delete your Intermediate and Binaries folders, alongside the .sln file
Once you've done that, then try to generate VS files
UnrealBuildTool Exception: ERROR: Expecting at least one ProjectTarget to be associated with project 'D:\Apps\Dropbox\Public\3D\2_Work\TPS_Highrise\Intermediate\ProjectFiles\TPS_Highrise.vcxproj' in the TargetProjects list
🤔
Never had anything like that happen to me before
I do that project clearing method regularly too
I just deleted the files that c++ wizard creates. Gonna try doing it again
Have some experience cleaning out C++ of projects because build errors was happening far to often
Oh, did you delete the whole Source folder by chance?
Well it shouldn't be empty 😮
guess that it was the source of the problem
ba dum tiss
haha, didnt even see that one
😄
So yeah, now its compling
@plain flume give me a sec to have a look
So I can see you have the same problem as me
you can get the player name, but you cant set it
"playerController has a PlayerState which has a PlayerName. you can get the name in blueprint, but you cant set the name, because SetPlayerName() isn't exposed to blueprints.
you could make your own PlayerName string variable in a playerController blueprint, and set it to replicated or rep_notify."
alternatively, make a your own playerstate bp and make a new variable called "PlayerNickname" or something
and set that to replicated
@brittle sinew I have made a c++ class, got the code in. Do I do anything to compile it or get it ready to be extended in BP?
Well you need to compile it, yes
Right clikc on your project on the right side and hit build
It doesn't seem wrong, what are you erroring out on?
You might need to forward declare APawn, but other than that I don't see anything
Well, the one you have highlighted is pretty self-explanatory, put public: or protected: above the method
Public is accessible from anywhere, protected only from subclasses
The rest of your errors are in the .cpp, I'd have to see that
Well, some of them
😄
`// Fill out your copyright notice in the Description page of Project Settings.
#include "TPS_PlayerController.h"
void TPS_PlayerController::OnRep_Pawn()
{
Super::OnRep_Pawn();
//BP Interface
this->onPawnPossesed(GetPawn);
}`
Forgot the A prefix on your class name
Additionally, stick an #include "GameFramework/Pawn.h" at the top of your cpp
Okay, so the only think left is "Argument type "APawn (AController::)() const" ins incompatiable with paramater of type "APawn"
and "A private function cannot be BlueprintImplementableEvent!", even though I have put public: infront of them
guess I dont need to reference the pawn anyways... Can just use "Get possed pawn" inside BP
Yeah, that would work too
so only thing I didnt get it was you ment regarding to putting public infront of the method
Could you show your header now?
`// Override OnRep_Pawn
virtual void OnRep_Pawn() override;
// Blueprint Interface
UFUNCTION(BlueprintImplementableEvent, meta = (FriendlyName = "onPawnPossesed"))
void onPawnPossesed();`
Where did you put public?
tried public: UFUNCTION, got some errors. Guess that wasnt the method, so I tried infront of void onPawn, still got the error. Deleted it and started googling
Try putting it on a new line before both of them (only one is needed, I meant one public: above the functions)
Shouldn't be giving you any errors
// Blueprint Interface public: UFUNCTION(BlueprintImplementableEvent, meta = (FriendlyName = "onPawnPossesed")) public: void onPawnPossesed();
Throws the error: Unrecognized type 'public' - type must be a UCLASS, USTRUCT or UENUM
arhh
new line..
same issue
Could you take a full SS of the header now?
Yeah, that's the issue
It's between the UFUNCTION and the function
You only need one
Anything below that will be public until you have another specifier
cool, got that stuff out of the way. Now I just get UnrealHeaderTool fail 😛
When it comes to destroying actors, is there specific way to handle it?
like anything extra that needs to go on except the sever destroying it
the actor youre destroying needs to be replicated for it to work on all clients
else the actor will only get destroyed server side
@brittle sinew this stuff is pulling my hair out... Guess I will to figure something else out
Appreciate the help 😃 Will stick to BP - c++ is just too time comsuning when I cant support it myself... yet!
Also thank you zpanzer
Im getting AI pawns popping in now hmm
guessing its net cull distance?
might be, not that experienced it networking yet
@native moth sorry, was afk for a bit, though I've never really seen a UHT error like that :/
figured out it was because FriendlyName: is now DisplayName:
anyways - keeps throwing errors
so I will try something else inside BP. simply cannot wrap my head around C++ and how its supposed to work ^^ '
Oh 😦
If you throw up a quick error log I might be able to see what's up, haha, but I get it's just a cycle either way
yeah problem is if I spend so much time getting this working and will have to extend it later on... I cannot do it my self
I will become way to dependent on people taking my hand and writing the code for me. Will slow me way to much down. Appreciate the help - I really do
I understand that yeah, but everybody has to learn at some point, and I think it becomes much easier once you get to a certain point
I mean you don't have to learn, I get that also :p
BP works fine for most of the time
yeah, but I will have to do that in a seperate project where I dont have too much stuff I can fuck up 😛
Will try and clean my project from C++ stuff now so I dont get crazy errors later on
@brittle sinew couldnt leave it... Tried a completly blank C++ project. Same code
everything works
in unity is there an easy way to get a reference to the local player?
i need to run commands from the player script, but if i'm the client and i'm the second player in the hierarchy, simply searching for gameobjects with player doesn't really work since it'll return the host's player prefab
Hello guys ! one of you know how make a dedicated server browsers ?
@grim swan It's doable but apparently a massive pain in the butt
I was reading up on it. It's like something you'd use instead of the sub systems yeah?
Yes
I want to create a dedicated server and players show a list servers and they can connect to them
If you know Minecraft, Half-life, Css, etc. I cant to recreate the system of server, because actually i have a system with a host players with the BPnode createSessions, and i show the list server with a BPnode Findsessions, but it's not good for my game lol, i want a dedicated server and players can connect to them by a server list, you know what i mean ? i'm sorry for my english i'm french
Is it even possible to implement non-rubberbandy movement without creating a custom character movement component?
I have to be missing something
AHA! server and client aren't doing the exact same move
hey so i know BeginPlay() is called every time a client makes that actor net relavent but what about
when they login/out does it get called every time they login?
Nevermind, still got work to do
Can I use steams p2p for android and ios?
@twin juniper everytime they login to server for the first time,, YES, bRelaunchInSteam AFAIK only works in shipping build if you have ur own AppId
hey all. been a while since i worked with sessions, having a weird issue. create session on one PC fine, find session on another PC, and join it. blueprint fires "joined successfully", but doesn't change maps to the server map, then times out after 60 seconds. tested with both onlinesubsystemSteamand Null. thinking it might be a port issue, but anyone have any ideas?
Log files for issue i'm having above. created fresh project on 4.16.2 using twin stick shooter (c++) as a template. i'm using the advanced sessions plugin, but same issue using standard session nodes.
Also includes my DefaultEngine.ini, and Build/Target cs files to make sure i'm not derping completely and missing something. I have the steam OSS enabled in plugins as well
Server see's nothing at all when client connects, client sends "Hello" then times out a minute later... is this just some sort of funky port/network issue i'm having, or something else?
Single process multiplayer PIE launches the client via the default map before it connects to the server, is there a way to check in the default map if it is en route to another map or server?
I mean non- single process actually
@orchid cairn Not sure if the same issue, but I had an issue where when creating a server it wasn't calling Listen(). But only if I created the server using ServerTravel, if I used Open it was fine (Both had ?listen parsed in to their URL). The "fix" was to call Listen directly after creating the session and all was well
I have no idea what the ramifications are of that but so far it appears to be working fine
@regal hazel - cheers for the reply. did some more investigating and it looks like it might actually be an issue with VMware Workstation Pro 12's virtual network adapters... for some reason it doesn't play nice with UDP packets (although how i'm only noticing in this particular case is crazy all on its own)... since VMware likes to get into every nook and cranny on a system, i'm in the middle of formatting my dev box now (needed to do it anyway) to see how we go then. was able to get the exact same code working on different machines in the office, never thought my actual system would be the culprit.
the only other bug i had was the well known "OSS Steam doesn't like LAN Games" and "OSS Null doesn't like non LAN games", but we deal with that through UI 😃
i have a UPROPERTY variable stored in a Character that's a pointer to another object in the world UPROPERTY(Replicated) ASpecialThing* Thing;. ASpecialThing has a very short network relevancy range (about 5meters). You can see how the problem starts, if some players are not in range of this actor it will NEVER be relevant to them, unless they get in range! However on the Character it is set on Thing is always relevant to that player which makes sense.
How to make Thing network relevant to anyone near the player that has it set to begin with?
If I use a physics handler to move another actor, what should I use to update the actor's transform?
Hey guys, would you guys know why one of my players sometimes spawns at 0,0,0? I am using blueprints.
one or more spawns blocked by something, or maybe not enough spawns ?
b-b-but i set it to 'ignore collision, always spawn'
sorry if i sound thick
i'm only trying to spawn 2 players, and i have 2 player starts
they are well up in the air
most of the time it works
but your players have collision with eachother right?
so set it to adjust position but always spawn
that way when the stupid built in spawn selector decides its a good idea to put both players in the same spawn, they will be adjusted properly
one spawn can fit 5 adjusted players (with the 5th trapped inside the 4 surrounding players)
ooh, is there a way i coculd set whicch one spawns where
rather than using this workaround?
does thatr equire c++?
has a stupid bug where it spawns the player in the same spawn even though there are plenty open ones, its c++
ooh
dang
wish i could get ++ to work
well, i set ti to adjust position, always spawn
and no change
pooh 😦 must be something else then
i was having the same problem u wer, and i spent almost 3 centuries trying to fix ChoosePlayerStart till i just gave up and set collision to adjust and it worked for me
if i had 6 players and only 1 spawn, the 6th player always spawned at 0,0,0
ooh
i have 2 spawns 2 players
does that make a diff?
i thought it justassigned a player to one of them randomly
that should have 10 players spawn properly
with the 11th at 0,0,0
idk why it wont work for you
o boi the flying project. i remember all the trouble i had with that