#multiplayer
1 messages ยท Page 349 of 1
tried yesterday everything, opening ports, 7777, 7778, 15000, 27015. both hosted server with own steam accounts, connecting with console command.. no success.
spacewar in steam worked fine, lobbies came instantly to list
info added also to gameengine.ini about steamsubsystem
maybe try with another appid?
hmm ill try that gotta write it up
hey can anyone give me a hand im having an issue with players no syncing with the server meaning if i host a game and i then move somewhere and then my friend spawns my postition doesnt sync with his
anything would be amainz
amazing
are you using character movement component?
yes there is animation and postions
like how do i updatre the hoster and client so they see where each other are no matter what
CharacterMovementComponent already does that. How are you moving the character?
just with keyboard AWSD
im using the default thirdperson
and i just made 3 networkplayerstart pawns which people do spawn at yes but never sync with each other
im just confused
the default thirdperson template isn't setup ootb to work with networking
is there a link you could give me that will help me to find out how to update postiions
- open your character blueprint
- send me a screenshot of what your Replication section looks like
okay, that looks fine.. Sec let me bring up the third person template
so pretty much this is what ive noticed when i click host game on pc 1 it works all well i can move around but once i connect with pc2 it puts the default spots of pc2 but on pc1 the pc2 controller looks perfect its just pc2 not updating where pc 1 is
if that makes any sense :/
how are you testing this? In the editor?
i package the project and send it to my other pc as well as my main one
and test it using steams spacewars servers thing
ahh okay I see. Is it working fine with testing multiple players in the editor? I assume you are using listen server instead of dedicated then.
okay, well that makes testing a lot easier at least.
its just pc2 cant get an update of where pc1 is at the begining
does it fix itself when pc1 moves after pc2 has joined?
but once pc2 is in game with pc1 where ever they go it works just at the start pc2 cant find pc1
no
on pc2s screen it glitches out pc1
and it means that if pc1 is in a door way and pc2 too joins the player cant get through as it makes pc1 like a ghost
but the weird thing is if they both spawn together its fine
okay i fixed it ๐
im an idiot
my hosting person was using the thridpersonchatar model
and not networkplayer
easy it works all good now ๐ Thanks @jolly siren for the support ๐
awesome, glad you got it working
Does anyone know if there is a way to release a game on steam but make it private? Like a development mode where I can control the users who can see it? I'm working on a steam multiplayer game and would love to move off of spacewars but don't want to make it public yet.
I'm 99% sure there's a way, we've done it before. I just don't k now how ๐ฆ
I can ask
yes please, that would be helpful
Does anyone know how well Unreal replicates static mesh props?
I'm thinking of having like at least 30-50 props with physics and their position/rotation replicated
That going to be an issue?
you will need to write custom solution
@neon mango you will run intro troubles with physic replication without using some custom code
because default solution just sync server position with client and if you applying big force to object it could lead to visual lag: like physic objcets will teleport from place to place on client and so son
so you are saying to roll with my own for the sake of visuals but in terms of performance?
is 50 rep props going to bog the network down?
no, you wont run into any troubles with performance, but visual side could give you sad feeling
you can just run small prototype - create tps blueprint project and add static mesh with cube, add physic support and check replicate + replicate movement thingy. Run with 2 player and you will how much it could lag
ok I'll check ito ut
@sterile pebble know of any good guides to get me started on rolling my own?
if you will apply small force to objects you can try default solution. Maybe it will work out for you. I mean, you still should try default solution with replicate movement checkbox, just because it's very easy to try and something to start
ok I'll give that a shot first. I will end up having to throw them very fast though
@sterile pebble you think the projectile class used in the Shootergame will have some good insight on that?
They must sync the projectile somehow and that projectile goes pretty fast if I remember correctly
it's not a physical object
@plain oriole ShooterGame is a very good example. Or are you looking for blueprint only?
sorry, that wasn't bp only. Looking around, as I don't do bp only.
@neon mango in case of projectile it just a simple collision that moves according to the received input and next position can be easily predicted on client and server and sync without noticable lags or something like that
@jolly siren ok no problem
@plain oriole http://shootertutorial.com/tutorials/
UPDATE:ย These are old tutorials which aren't supported in current UE4 version. They can be useful thou that's why I'm leaving them here.Here you can find all of the tutorials. You shouldย read them one by one - I'm using stuff created earlier.1.๏ฟฝ
In this first episode of creating a survival shooter, we'll create the player health class and a player blueprint llibrary I hope you enjoyed the video and d...
There are a couple to check out.
in case of physical object it's become more complicated. The problem is that physic simulation is not the same on client and server machine. It will defer and the difference can be big. This is how physx engine working. It's using random generators inside to simulate physic and some other stuff that will lead to deviation in simulation.
@jolly siren thank you
@neon mango check this articles, they are very helpful. In case of non-physical object default unreal solution is pretty good and it's easy to add custom code and sync them (like with projectile)
@plain oriole there is the multiplayer shootout example you can download from the launcher that is bp only. And there is also this, which shows how to turn the fps template into multiplayer. https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/102591-turn-the-first-person-fps-template-to-a-multiplayer-experience
gl ๐
Hello! I have a lot of questions about networking through blueprints for a third person shooter game.
Two big ones right off the bat:
- Server movement is being replicated to the client, but the mesh (or anything visible) is not. Cannot see server player.
- Client cannot move. No idea why.
I'm using local host servers and mostly Unreal's default stuff at this point. Please help.
Uh...no?
GameMode does have some additional features when compared to GameModeBase, but it's not like you 'have' to use GameMode for simple movement replication
Parent is GameMode
Are you rolling your own custom pawn or is it a character?
Extended from Character
Okay, you'd probably have to show some screenshots of how you're doing the movement code at this point
Usually the CharacterMovementComponent takes care of pretty much all of the replication for you, but that's only if you use it
Movement is replicating fine. Rendering is causing issues
@sterile pebble goodpoint. The mecahnic I'm going for is actually a lot like a projectile now that I think about it. It will be a physics object as they play around with it but they can throw it as a projectile at higher velocity. Perhaps I should have my code on toss treat the prop as a projectile? Would that be a good way of going about it though?
@civic silo "Client cannot move. No idea why."?
Sounds like movement issues, haha :p
If you could just show some screenshots of your setup, that'd probably be best. There's not really one thing to check per se, but you need to be using the built-in pawn input handling and not rolling your own custom movement logic or something of that nature
Ok. I made some custom action mappings for input, but everything else should be fine.
@civic belfry Late response. Owner of level placed bps is the server. You have to set the owner by hand to perform server and client rpcs.
So, forgive my unfamiliarity, but it appears that I should be using a PlayerController instead of just handling input in the Character itself. I think that is where some of my issue is coming from. I don't have a PlayerController listening for client input.
How do I set that up?
If I am using PIE and set clients to 2, does the world outliner show all the objects spawned on both clients? Or is it just showing the one that is in PIE?
it shows the 1st client
I'm going to return to sitting and glaring at the editor. thanks lol
Player controller for global input, character/pawn for input specific to that character/pawn is how I do it
If someone has the time, I'm slightly stumped. On begin play in my Game Mode, I am spawning an AChessboard Object. Inside the Chessboard object is a TArray of ATile objects (representing the 64 tiles of the board). For some inexplicable reason, When I run two clients, the size of the chessboard array is 128, i.e. double. The baffling part is that it's not doubling the number of pieces (AChessboard spawns them too), and the whole thing is behind an authority gate. I'm not entirely sure why the tiles are doubling, but the pieces are not.
when i use 1 client, no server, it spawns 64
do you set the size of your array somewhere?
I don't
like in the constructor?
Each time I spawn a tile, I do array.Add(Tile)
on authority?
uhm...actually, no. huh.
also, are your tiles set to replicate?
lemme check i think so.
because what it sounds like is happening is you are spawning tiles on the client, and then the server replicates the array of null objects because the objects aren't set to replicate
thus the server is giving you 64nullptrs and the client is spawning 64 actual pieces
i think you're on to something, because I do have a crash referencing null tiles.
hehe, I've made this exact mistake before ๐
I think it's the reverse though, because the crash happens on the (non) listening client
but yeah
I have this in my constructor:
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
pOccupiedBy = nullptr;
ObjectMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Object Mesh"));
RootComponent = ObjectMesh;
}```
let me try something.
I have the chessboard set to replicate, and I have the TArray inside it set to replicate
UPROPERTY(Replicated, EditAnywhere, Category = "Board")
TArray<ATile*> Board;```
could that be causing a double replication or something?
no, that should be right
trying to think of what else I am doing. heh. I am taking the chessboard object, and setting a reference to it in the Game State as well.
going to mull over thsi while I drive home :3 thanks!
@raven holly Is Xera actually on steam yet? How do you limit who can download/see it on steam? Is there a developer mode for when you don't want it to be publicly accessible yet?
@jolly siren Yes beta keys
it's in the steam backend
It's not published yet, but people can still download it etc
through steam? can they get auto updates as well with that?
yep
awesome, that is helpful. I guess I'll get more details on how to set that up when I spend my hundred
๐
thank you!
np!
Anyone come accross your game mode not working when the project is packaged? Click play in editor works fine - I've confirmed game mode / server game mode and over ride game mode are all set in project settings.
I've setup a simple print string on "post log in" for my game mode, doesnt go off when packaged/dedicated server
@tawny parcel how are you running the server
@stark dome I package the game and I have made the server.exe through a 'development server' build
And you can connect to it properly?
yea
the players connect
i can see them running around
but nothing happens, no events in gamestate/mode trigger
Do you have the proper map in game default map
I believe that's what the server uses by default
You can override it though
Hrm, nope - I had it as entry apparently. I'll try that out!
but I had Server Default Map set properly
I'll try shortly, re-running the package
@stark dome Neither worked so far, oddly enough I get this error on clients that connect after the first. The first doesn't give any errors.
You can see something is atleast trying to happen at post login, like I was trying to do
So looks like it's using the right game mode now
Print string with print to log should show on the dedicated server prompt correct
Do you need to rebuild a server.exe every time you re-package your game?
Well I package the project but that creates the playable .exe, you have to build the dedicated server .exe through VS 'development server'
I'm starting to think some references to the thirdperson player are wrong, I renamed it at one point
That's not packaging the server though. You are only packaging the client
Anyone know how to properly replicate grabbed objects? I believe I've done the standard stuff but my object keeps falling because of gravity and if I turn gravity off it will float away until it syncs back up client side.
Since the movement is replicated on the grabbed object, when the grabbed object moves it seems to sync up but if it isnt' moving that is when it succumb to physics client side.
Do you disable physics
if I do that physics handle doesn't work
Oh you are using a physics handle
should I be doing it another way?
Depends what functionality you want
The way I handled replicating that was to replicate a struct containing the grabbed location / rotation and then in an onrep grabbing it on the client
But if basic attachment without a physics handle suits your need it's much simpler
wait without physics handle?
So what I'm doing is the advanced way or the basic way?
I'm thinking if I make a NetMulticast RPC call when the server or client picks up the object then all instances of the server and client simulated dudes should do the same thing?
You could do it that way as well. Only problem is if someone joins after you pick it up
That's why the onrep is a better solution
hmmm good point
could check to toggle it on join but that seems silly
I don't understand your way though
why make a struct with grabbed location/rotation? You disable replicate via Unreal and do it yourself so you can spam the updates more often?
It only replicated the location and rotation that the object was grabbed at. One time. That allows clients to reproduce the physics handle on their end so the simulation aligns with the server
but nothing about your solution mentions a physics handle?
how do the clients know something is being grabbed?
When the struct is replicated it means that it was grabbed. You could also add a bool indicating if it was grabbed or dropped and update the physics handle appropriately
Other option is to disable physics on the clients but movement will appear jittery
Yea I don't get when you rep the struct and how that makes a handle?
the struct has a handle?
No the actor that has the struct property is the one with the physics handle
You'll also need to add the object being grabbed to the struct
I'm sorry I'm just not getting your method. I do get replicating the struct though as that alone would be better for me than depending on the rep on movement only unreal does when ticking rep movement.
but I may have to do both
as I do want the general prop to move but be really accurate when grabbed
unless the struct is enough for both?
I'll just start trying things maybe it will start to make sense
Yeah it should work. Let me know if you have issues
When you grab something update the struct
Do you know what I mean by onrep
does that mean the struct is on the object that we want to replicate not on the person grabbing?
on replication?
In the UPROPERTY instead of using Replicated you use ReplicatedUsing=FUNCTION
And that function gets called whenever the value is replicated
So inside that function you grab with the physics handle on the client
how does the client have a physisc handle?
I know what it is, but how do they have it? You just have all your clients with a physics handle?
Well what actor has your physics handle
If that actor is replicated it'll exist on that actor per client
so in my case its only one person ever that can have the handle
but the handle currently exists only on the server
client wants to make a grab? Server make the handle
server wants to make a grab? Server makes the handle
Oh you are creating it at runtime?
no it exists but the bind of the handle happens in game
Right so it exists on the client as well. You just recreate that bind in the replication notify
As long as the actor that the physics handle is on is replicated
so
Example
Server grabs object makes the bind with the handle
then starts updating the struct
client via rep notify sees the struct has updated and calls the function to make the handle as well?
Did I kind of sorta get it now?
Yup that sounds correct to me
So that struct probably needs 3 vars
Grabbed location. Grabbed rotation. Pointer to thing grabbed
is alll this happening on the characters, no code for the object correct?
On rep if that pointer is null then you call release on the handle. Else you grab the component
good point I see
This code can live wherever the physics handle is
ok
so one more point of clarity
Are you making the bind of the handle on tick?
Because I take it you want to update the struct on tick while its grabbed?
No just on the rep notify
which happens when the struct is updated right?
You only update the struct on grab/release
but then how do you know where its at when the person who grabs it moves it?
Is the thing that's grabbing it being replicated
If it's position is replicated then the object being grabbed will be aligned with it
Well that brings me right back to square one then (I think)
if you depend on Unreal's replicate movement for once its grabbed (which is what I'm doing now and having problems) how are you not having problems with physics?
You aren't for that object. Only for the thing grabbing it
If it's position is replicated then the object being grabbed will be aligned with it(edited)```
replicated as in Unreal's tick box replicated?
Along with replicating movement
How are you setting the location of the physics handle
Every tick
Right but based on what
if (PhysicsHandleActive)
{
//Once Grabbed we update this values every tick to keep the object grabbed in front of the hidden at all times.
const FVector ForwardDir = FirstPersonCameraComponent->GetForwardVector();
const FVector ProductOfGrabLocation = ForwardDir * DistanceObjectHangs;//ForwardDir * OtherItemLocation;
const FVector FinalLocation = ProductOfGrabLocation + FirstPersonCameraComponent->GetComponentLocation();// GetActorLocation();
const FVector HandleLocation = FinalLocation + FVector(0, 0, DistanceObjectHangs);
FRotator FacePlayerRot = UKismetMathLibrary::FindLookAtRotation(this->GetActorLocation(), FinalLocation);
PhysicsHandleComponent->SetTargetLocationAndRotation(FinalLocation, FacePlayerRot);//GetControlRotation()
}
}```
Perhaps you meant something else?
Why not in the rep notify like I just explained
but that wouldn't happen every tick like I need it too?
unless its about setting a bool to have it do it on tick?
You don't grab the object every tick
You will still be running that update code in tick
@stark dome So if I package the game, use the server.exe to run a dedicated server, it still does not consider itself a server? Am I supposed to run it through frontend?
On client and server
@stark dome And thank you for the help btw
@tawny parcel so you can't connect to that exe?
What do you mean it doesn't consider itself a server
yes i can, the game mode wont fire tho, onpostlogin
Hmm does it spit out which map it's loading
well in any case I just made it so that the handle gets created client side as well and now the object teleports back and forth from where I intially grabbed it and where it should be
What must be happening is that the clilent is calculating that it should be where the handle is, and I guess the handle isn't replicated?
But the handle is part of the player
and the player moves
so the handle should move with it right?
but it doesn't seem like it is
Going to try and set it to replicate component
didn't help, well I'm pooped going to call it anight and try to figure this out tomorrow, thanks for the guidance @stark dome
No problem sorry you couldn't get it working
is here anyone online who knows about advanced sessions/steam? it works on lan but not over internet using steam. people say that it should work, do i need to get own appid from steam to make it work?
i dont want to get game on steam if it doesnt work
480 should work fine. have you setup port forwarding on router and firewall?
yeah ports should be open
i tried to check openings from internetsite but those tell its not open
from these sites
yeah that site works for me. What ports did you open?
7778,7777,15000,27015
ive tried long time ago these port forwarding stuff but these sites dont work, maybe theres something in my router blocking it
but good to hear that those sites work for someone else ๐
im gonna open the router and check more if i missed something
did you setup firewall rules as well?
I'm talking about the os firewall
ok i checked that, its enabled from there
this is what router looks
and same on "outbound"
just found this one
hmm 7777 allowed now with both tcp and udp still that website shows its closed =/
Is there a reason why my object would fail to have its movement replicated if the Remote has its Simulate PHysics off and the server has its Set Simulate Physics on?
Does Replicate movement work both ways?
so client is telling server hey its not moving?
And if that is the case is there a way to have it so server controls that?
even when all firewalls are off that site dont work, there must be something on the router now
who is your provider?
I have xfinity and they give you a built in router/modem thing and I had to do some extra things to get my real cisco router working properly because of that.
telia, i live in finland
ahh okay
theres not port forwarding quide for this exact box at all
only some older zyxel boxes
how can i find out if this is some shit router?
ok probably its these routers, my friend who did also the port forwarding he has same provider and box that they give when you get the connection..
thanks for info @jolly siren
no problem
I'm trying to turn off physics for client objects and I'm getting different results. In my main project I lose replication in my sample project it does nothing aka object still have physics, I don't understand...
Does replication not pass on to inherited classes? So like, if class B inherits from A, and I set A to replicate in its constructor, do I need to implicitly tell B to replicate as well?
I'm guessing you mean you're wondering if you need to explicitly tell it to replicate?
No.
If you have additional properties on the subclass you want to replicate though, you need to manually add those
@neon mango any luck
@stark dome trying different things from simple to more complex but I can't understand the simple ๐
I can't tell if its the editor getting in the way or not?
Like if I test in editor, is the object getting its Has Authority vs Remote mixed up? As in its true for both?
nope it should simulate it properly
well I tell it for remote to disable physics in my Test Project and physics is still on for client
Basically made a test project to test this all out
seperate from my main
how are you telling it to disable physics
On the object itself I tell its static mesh on begin play to check if its remote or not
are you sure that code is being run properly
you have dedicated server checked?
no
are you spawning that object at runtime or does it exist in the level
exists in the level
I can send you the project if you like, very small
worst case scenario if your up to it but its actually like 2 GB still
is that actor set to replicate
Having an issue with C++ replication of turning on a ParticleBeam. I can do this in blueprints all day - when i enact the same client->Server->MCast RPC chain in code - i dont have the beam drawing on clients - where i can do this in blueprints same methodology no problem.
Anyone willing to take a look at this?
ty @stark dome - so i am starting in client of my Character
@neon mango make sure breplicates is true and bnetloadonclient is true
from there i am doing: ```
if (IsLocallyControlled())
TurnOnQBeam(StartPoint, ImpactPoint, true);
else
Srv_TurnOnQBeam(StartPoint, ImpactPoint, true);
Is it possible to override replication of certain variables in child classes? for example to turn it off
TurnOnQBeam is the local version
SRV is server
which calls to a multicast
the multicast runs th same client version code which does this:
UpdateBeam(StartLoc, HitLocation);
now
StartLoc & HitLocation are both passed in
i dont understand why its not spawning on the networked clients ๐ฆ
@mild zodiac - i'm going to assume no.... as any parent variable in editor is greyed out - i would assume the same for parent variable types in C++
i maybe wrong on that - i dont know C++ to its full extent
@mild zodiac DOREPLIFETIME_ACTIVE_OVERRIDE( ACharacter, RepRootMotion, false );
thats an example for how they handle it in the character
there you have it
have you added logs/breakpoints to test if that activate code is called on clients
let me throw in a debug string in ther e- to see if it is indeed MCasting truely
@stark dome https://we.tl/TCXGzTo5f2 FYI it currently only is replicated from server to client, client grab isn't replicated
bnetloadonclient was't on but turning it on did not help
so you have movement replicating from server to client?
I'm focusing on the object right now
its movement is replicated
but the client seems to want to apply its own physics to the object
which is causing the object to ethier fall, or if there is no gravity float away
so I figuerd just diable physics client side for said object entirely
but on my main project replication fails at that point
and in my test project it still has physics even with set simulate physics off
@stark dome thanks, I'll try DOREPLIFETIME_ACTIVE_OVERRIDE
I'm not sure how authority works for objects that already exist in the level
It seems like they are both the authority
My guess is that the client has authority over it during beginplay but possibly not after
Because the client is spawning it along with the map
Not sure how to handle it however
well at least thanks for confirming my sanity
my other guess was this was an editor problem
Yea I was going to do that but put it on hold in case it was a mistake I was making
@stark dome actually our points are not relevant for the most part.
I just tested outside the editor
and client runs auth and remote
listen just runs auth
but the point here is that if it does run Remote
it means its executing my Set Simulate Physics false
and yet physics is still simulating for the object
so it makes sense that the client has auth and it is a remote
but it doesn't make sense that SetSimulate false isn't doing anything.
@stark dome if I set SetSimulatePhysics off on tick it works
but that seems silly
is Unreal enabling it behind the scenes?
I think its a timing issue
quick question . Whats is the best UE4 Version for multiplayer development? 4.14 maybe?
@tall grove 4.18 ๐
i dont think so , all new release use to be plenty of bugs
4.15 felt most stable to me in a while. I'm still on 4.16
@tall grove Guess it depends on what bugs you can live with
4.18 seems to have a lot of bug fixes.
@jolly siren 4.15 is greeeeat!
still suffering some cyclical dep. bug
4.17 improves that a ton
i will wait for 4.19
it seems that it improves a ton networking
Yeah I really hope they get all the networking stuff done for 4.19 because it's going to be the best release for it in a while
They already fixed the steam voip bug so that is good
not sure what's going on with this one tho https://issues.unrealengine.com/issue/UE-45681
is it possible to run extra clients in an editor window so I have a World outliner for each one?
@jolly siren what was the VoIP bug?
hi guys, quick question about subsystem steam, I can't find game sessions, me and the hosts are not in the same region . I found on Aller's blog saying " If you enable Steam and are unable to see your buddy's server that happens to be on the other side of Earth, it is not an issue with your configuration but how Epic handles Steam sessions" , but how can this be fixed ?
@jolly siren wasn't that the one I gave you the fix for?
yeah, thank you for that ๐ I was just saying that the fix is coming in the engine in 4.19
oh really? I thought you took their commit
Ok so I have an actor that is set to replicate but when I spawn it on the server, it's only showing up on the server. Why is this happening?
ahh okay I see
If an actor has bReplicates = true and it is spawned on the server, it is automatically spawned on the clients correct?
Anyone know if there is a place where PC is guaranteed to have both it's PlayerState and HUD on the client? Dealing with race conditions.
{
bReplicates = true;
bAlwaysRelevant = true;
}```
{
ABuffObject * b = Cast<ABuffObject>(GetWorld()->SpawnActor(ABuffObject::StaticClass()));
}```
This doesn't work
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
bAlwaysRelevant = true;
}```
{
PowerExtension = Cast<APowerExtension>(GetWorld()->SpawnActor(PowerInfo->PowerExtension));
}```
This does
@jolly siren could you elaborate ๐ค
I am trying to call some code in my HUD that relies on PlayerState clientside. I could call it from PC::OnRep_PlayerState, except then I don't think that I'm guaranteed to have HUD created yet.
If I call it at HUD::BeginPlay then I'm not guaranteed to have my PlayerState yet
Begin play wont work for midle joiners neither
Oh wait hahahaha yeah hud whatever
Well what you can do is a binding communication as soon as your PS gets created execute it on the hud
I've seen hacks where people while(PS==null) cast... blah blah
So literally waiting for the PlayerState to be valid in the hud
Yeah, I've seen that too. Wasn't sure if there was a better way
The problem is that PS can get created before hud or after
since PS is dependent on replication
But still, what you need is PS, you wont call that function till PS isnt created ~
replicating character references is a bad idea?
@jolly siren still dont liking "waiting" solution, you could try it out aswell
Since that will do what you need, right?
Prolly a couple executions
All that comes to my mind is interface/binding action
But yeah you have that lil unconsistent problem
I think in ShooterGame they wait for it to be valid
Id have to check it again
So i guess its not as bad as we think
I've never seen that in shootergame, lmk if you find it
It should be under HUD cpp
Iirc
They need to get PS info as you
Cannot check it right now cause im on mobile device but all i can say is, if it is
It should be on HUD cpp
Ill look a bit later on, if i find something ill let you know
Could anyone help? I'm spawning a replicated actor on the server but none of the clients can see it
Are you 100% sure that its replicated?
I always wish it was a requirement that screenshots be shared with these types of questions
@thin stratus you were rigt a free game on steam by default has user based hosting of sessions turned off after sending a ticket to steam a week later im they enabled it and users can now start sessions
Someone is saying net relevancy is broken, can anyone shed any light on the matter
@jolly siren what about a looping timer with an Isvalid node . On valid call functionality and clear timer
@hasty adder it should actually happen way faster if you post into the private dev forum, but yeah
Yeah I didn't even know about that forum ha ๐
should i rather be replicating player id or character reference?
if i want to get the character reference of remote client
*remote character
because if i'm not mistaken, it seems that character references are not the same on client and server
am i correct?
Guys, I need help...
I have a BACKAPCK blueprint class
the components look like this
When I pickup the backpack and equip it, It works perfectly. Everyone connected sees it properly attached.
This is the attach Function
On a cooked dedicated server it works as well
When I have 2 players connected and one equips backpack everyone sees it normally
the problem is
When a player equips backpack, he sees it normally, but when another player joins the server after the player 1 has attached the backpack, the player 2 sees the backpack on the ground behind the player1 and not attached
@twin juniper you have network relevancy issue. You need to sync all the events to the new client when it connects to the game server. What is happening at your side is you have executed few functions at server and one of the client and after that another client is getting connected. So the new client which just got connected haven't executed all the functions which other clients already have.
Guys I've got a scenario. I want my player to login to a game server .
@twin juniper you use RepNotify variables for that. They execute a function when they are replicated. So you can call the equipped stuff in there and new joining players also execute it
@void canopy and?
@thin stratus the thing is, that I do... the function attachbackpack is being executed in repnotify variable
You need a database for that. Hash the pass on the client. Sent it via the connection options. Let the server check in the overridden login event (game mode) if the player is okay and accept or kick him if not
For checking you would let your server connect to a database
@twin juniper then you are using other variables in that which aren't replicated yet?
Make sure everything is valid. A struct containing all data being repnotify might help
Does InitGameState get called once per player that joins?
I thought it would get called once for the entire match but my debug logs are firing twice on a match restart and I had two players
@thin stratus I am gonna send you pictures of how it works exactly
I am gonna try something first
@thin stratus Fixed... The problem was, that I was setting the RepNotify variable, which had the Attach function in the repnotify function, in the Inventory Class which was only relevant to the server and the owning client. Now when I set the variable in the character which is relevant to everyone, it seems to be woking.
are there any good tutorials or post about getting mounts working in multy player im struggling to find much on this subject in google searches
@twin juniper awesome (:
@abstract aspen you basically swap the pawn with possess and put the old pawn either on the mount (physics off and attach) or remove it and turn on a fake model that sits on the mount
Might be easier to just use the old pawn
@thin stratus yeh the issue im having is (and i dont know if i have missed something) i recently switched to using a player controller, and im unsure if i need to migrate the entore horse controls to the player controller
I did have mount working except the horse would not move
now unable to get it to mount
Can help later. Dinner.
np ty
When having multiple pawns, your controls for each should remain inside the specific pawn
Playercontroller should only hold common controls, like open menu etc
@abstract aspen
Like the "Mount/Unmount" Button should be in the PlayerController
But movement should be in each of them (given they differ a lot)
the accual movment is located in the mount bp untill thirdperson character possess it then controlls are switched from the mount to the thirdperson which are controled by the the player controller
That's not making sense
Your PC might consume the input
Resulting in the mount not getting any
Well, if the input events are the same
You def want to move input, movement etc of the character INTO the character
i tried to take a short cut an bought the rpg inventory system and it's where my entire project took turn for the worse
Merging your project and a marketplace project takes time and a decent amount of experience
So be careful :P
So I'm using Vinterp to try and smooth out the location of a prop from its last known client location to its new replicated location from server and its not smoothing it at all.
I think the trick is nailing down the Speed of the VInterp
I thought it should be set to the speed of the object moving but I dont' think so
Hi how would I log a Object Field. Here is the code FJsonValueObject GetID = JsonParsed->GetObjectField("_id");. I just need to log it to check what the deserialization is outputting
What is the best way to approach a simple ready check before map change vote? How do you 'read' PlayerState through the server (gamemode)
The GameState has all PlayerStates. You can freely access the GameState and therefore access all connected players PlayerStates
PlayerArray <- take a look
whats best practice for spawning a replicated particle effect?
in this instance im just trying to spawn an effect at the location of a player that respawns
@vital steeple Meh, simple multicast would be easy. You can do a local and then multicast, ignoring local.
If you want to be snazzy, you can just do local sims on all in the area that can view it
just skipping the owner ~ (IsLocallyControlled()) #2 what victor said
yeah i was just wondering if theres a most efficient way of doing it
i want to learn to do it right now (through BP)
Hmm. Depends on your definition
instead of get into bad habits
What bad habits?
ive just looked back at old scripting and noticed ive done jenky stuff in the past. seems like often times i have to learn through trial and error, so my solutions can be weird
so i was just curious if there was a generally accepted best practice
Hmm, TBH that's a hard question to answer
I know a few of the MP Gods on here..and they do things differently
i'll give you a good one based on standars . . .
But yeah, there are for sure ways you shouldn't do some things.
Those are probably the easiest to answer
for example reliability, don't set particles as reliable
neither effects or irrelevant gameplay stuff
Is it possible to change the net update frequency or priority of just one object in C++ at runtime?
Thanks - just realised how obvious it was ( my macro was hiding a connector pin)
I'm looking for it and can't find it
Well shit
Also their docs don't have it listed
StaticMeshComponent is used to create an instance of a UStaticMesh.
Maybe it's called something different
god dang it, i cannot put nodes on blueprintue.com hahaha
i'll try to explain it then
@neon mango iirc, you can only do that with actors anyway
So a component wouldn't have it
So actor/class
I see, ok then
well actually
So I have to cast it then to my blueprint class I suppose?
StaticMesh ACtor thata has replication options
yet in C++ they are not there
Actor...
so cast ?
same deal anyways https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/AStaticMeshActor/index.html
StaticMeshActor is an instance of a UStaticMesh in the world.
no they are there for static mesh actor
Bro
Um
They are subclasses of AActor
So you might have to get default properties.
Yea I can see them
Or see if they are Private
I'm good
yea lol
Winner winner, chicken dinner.
@vital steeple if you want to do it super cheesy, make a function that will spawn the particle in the desired location but instead calling the particle node straight away, place some networking checks in a branch before your node. That node will need to check if you are in the server (IsServer()) and the self actor has authority (hasAuthority())... i decided that writing was... bad xD
interesting
Hello does anybody know why this "if statement" wouldnt run. It always switches back to the else statement
TSharedPtr<FJsonObject> JsonObject;
TSharedRef< TJsonReader<> > Reader = TJsonReaderFactory<>::Create(ResponseString);
if (FJsonSerializer::Deserialize(Reader, JsonObject))
{
FString GetID = JsonObject->GetStringField("ip");
UE_LOG(LogTemp, Warning, TEXT("%s"), *GetID);
}
else {
UE_LOG(LogTemp, Warning, TEXT("Didnt run if"));
}
@timid pendant Seems like a question for Programming btw
so I set hitSMActor->SetReplicateMovement(false); but when I eject on the server to check the var its till on? Who do I trust?
If I add to an array with RepNotify will RepNotify be called?
Or do I have to make a dummy array then set the Repped array to the dummy array for notify to call
I suppose I should just test for myself instead of asking
(Yeah it does work with add)
So my camera component wasn't replicating at all server to client but I enabled replicate this component on it and then it worked. But now client to server seems to still have the issue, any thoughts?
@raven holly ^ Didn't you have the same issue earlier this week? Did we figure it out? It was the PCM right?
Well this is a bit different, I can't recall my exact issue then, but this is a different type of player, on this player I actually have added a CameraComponent (as I wanted to add post process effects to the camera)
@wary willow Oh was that for Joshua or in regards to me?
So does replicate work both ways or only from server in general?
This also brings up a general confusion with how are animations even replicated in the shooter game?
I notice that their meshes are not set to be replicated
Yet the animations are working over the network
Post 17 here https://forums.unrealengine.com/development-discussion/c-gameplay-programming/25860-first-person-camera-movement-replication-problem/page2 says that replicated variables are sent from SERver to client (assuming that is true for components as well) that would explain why the camera reps to client from server but not the other way around. Is the normal way to use an RPC on tick to send the ptich of the camera? I"m not even sure how the yaw is getting set, I guess its just the rotataion of the capsule?
If GameMode creates LAN session, I shouldn't need to use ?Listen on command line, right? I'm having issues where I can't connect to LAN host, IP is correct and if I cmd ping it all is kosher. I can't think of anything else
@glossy wasp Just looked into the shooter game code to see how they do it
{
if (ensure(GameInstance.IsValid()) && GetPlayerOwner() != NULL)
{
FString const StartURL = FString::Printf(TEXT("/Game/Maps/%s?game=%s%s%s?%s=%d%s"), *GetMapName(), *GameType, GameInstance->GetIsOnline() ? TEXT("?listen") : TEXT(""), bIsLanMatch ? TEXT("?bIsLanMatch") : TEXT(""), *AShooterGameMode::GetBotsCountOptionName(), BotsCountOpt, bIsRecordingDemo ? TEXT("?DemoRec") : TEXT("") );
UE_LOG(LogTemp, Warning, TEXT("Loading Map: %s"), *StartURL);
// Game instance will handle success, failure and dialogs
GameInstance->HostGame(GetPlayerOwner(), GameType, StartURL);
}
}```
They seem to append ?listen if its lan
How would I do that from command line though? Right now I'm trying:
WindowsNoEditor<Project>.exe <Mapname>?Listen -Game
But it won't even launch the map, it goes to the start up one defined by project
This is shipping build, which maybe disables this stuff I guess
@glossy wasp Yea you can't do that with a shipping build
@neon mango replication is only ever from server to client
Yeaa..
Should I be concerned if I added a camera component to the shooter games player when its code was setup to work without one?
I'm suspecting that is why my pitch isn't replicating but not sure
@stark dome I believe I've gotten the grab replication quite well with your advice but I can't replicate pitch from client to server and that I believe is the last peice of the puzzle for this
Hmm I'm not sure of the best way to handle that
Yea most of what I read online speaks about how to get the rotation for AnimationOffsets, the ShooterGame has GetAimOffsets, but I'm not sure if that is what I need in this case?
Its just that I pick an object up, that I move up and down client side but that up and down movement isn't reflected.
Ah was there a way to force repnotify to fire from c++ even if the value isn't changed
You can just call it. When would you want it to be triggered
Oh ๐ Yeah..
I'm just confused why Yaw is being replicated ok but not pitch?
camera is not replicated fully
Yaw is, but you have to replicate pitch yourself
it does replicate, but it's not exposed to blueprints for some reason
Character
GetBaseAimRotation ?
could be yeah
Pitch is
Yeah GetBaseAimRotation has it
you have to expose it yourself
yeah so expose that ^^
so what confuses me here is, is the fact its replicated enough? I mean replication is from server to client only right? How will client rep to server what its doing?
No it's already exposed
@grand kestrel i know for a fact it doesnt replicate correctly in bp
no
I'm using it
It works for me in BP
Ok I'm still not clear as to what I need to do here?
@grand kestrel did they recently change it ?
Don't think so
That's exactly where I use it
show me?
Its not clear to me exactly how the client will get to tell the server "hey I'm looking up and down!"
if I read POVRot.Pitch wouldn't it just be the pitch the server has?
are we all having the same problem lol?
@neon mango what are you trying to do again
Client looks up and down with a grabbed object, and server doesn't reflect the looking up and down action
however server looking up and down does seem to reflect to client
Yaw is fine for both
It's not owner only
You're doing something else wrong
I use it for the offset, both the owning client and every other client can see my character's head turning, up, down, left, right
From base aim rotation
It's always worked
Aliens
Actually I'm wondering if its as simple as this lol PhysicsHandleComponent->SetTargetLocationAndRotation(HandleLocation, GetAimOffsets());
giving it a shot
For one thing
It's pointless to replicate Aim Rotator
For another, you don't need to set it on server
yeah.. you do
That's the entire point
๐ค
Replace AimRotator with GetBaseAimRotation in the anim graph
Or wherever you're using it
you must have a weird aim offset
no i know for a fact you have to do some things to replicate the aimoffset fully
-___-
how well have you tested yours?
It's working, very clearly
I wonder why you choose to question mine when mine works and yours doesn't ๐
ok ill try it for the sake of it
Instead of questioning why it's not working for you
@regal hazel Care to weigh in?
Sure, unless you've done somethign else weird
It works
@raven holly Are you trying to get the aim offset to work in multiplayer?
Yeah but that's your code
A suboptimal solution isn't flawless
Because you're replicating somethign that already is
But the pitch does
You would use the character's rotation for the yaw
my players can look side to side
๐ค
Well, I'm going back to my work this is sidetracking me
Uhhuh, hope you find the solution
For a flawless solution then
oh meh
not worried tbh
better things to worry about than cosmetic animations
only thing i should be worried about is the cost of replicating that rotator
I see you convert to 2D, do you notice much difference using that?
Replicating rotators does cost a noteworthy amount especially if you aren't compressing them
That vector2d isn't replicated so no lol
Oh true, I swear i seen it replicated ^_^ any reason you move it to vector2d?
Don't need the third axis, doesn't really matter if you use a vector or vector2d though
ok
btw I did end up figuring out my problem
Using the GetAimOffsets I added the pitch value there to my to my final location vector's Z value
@raven holly Great ๐
If you're gonna replicate rotators it can help if you round them btw
Same for vectors
That might fall under premature optimization for a lot of people though
Hello guys,
I'm struggling with an issue here... I have a multiplayer game available on steam.
It uses Unreal 4.15 (binary) ... When transitioning between maps... I use seamless travel, I really wouldn't need it if it weren't for the fact that server travel does not work on steam without seamless enabled. Using seamless travel has been a nightmare... Crashes due to dynamic materials on pawns (horrible bug, I now destroy all pawns before traveling and seems to fix it). Anyway I still get some crashes here and there, and they are always on the client side. I would really like to debug them but to test the game I have to use the packaged game... I would like to read the stack trace upon crashes but I need to activate symbol debugger...But I read that is something that is going to be removed and it is unnecessary. How can I debug crashes then?
Another question: do you guys think it is just better to use open level instead of seamless travel... Have all the clients disconnect and reconnect and solve many of the issues related to seamless travel? Or is that just a horrible solution?
Sorry can't really advise I havnt used seamless travel. What is your game ?
is there any difference to how navmesh stored with dedicated server setup?
nope
same in all worlds
@halcyon abyss to debug clients on Steam you don't have to package and upload it to steam. Package the game on each machine in Debug mode (include debug files), then from visual studio launch in 'DebugGame' mode instead of DebugGame Editor.
However if you want Engine debug symbols, you need to compile the engine from source and use that
Launcher build doesn't package them even if you selcet 'include debug files'
(in my experience anyway)
hey jamsh thanks for replying :)
I started debugging on steam due to the fact that I had issues with server travel only on steam
What i was interested in was debugging the crash dumps... is that possible with the DebugGame Package?
If you launch in 'DebugGame' and Steam is running, it should launch with Steam support no different to how it would if you DL'd it through Steam
Yeah you cna so long as it's packaged with 'Include Debug Symbols'
You should get minidumps, but you'll only be able to debug them on the machine that actually did the build - otherwise PDB's may not match up etc.
Alright thank you! I'll give it a try ASAP
np's
I can't see the options under the menu in the launch editor
i see them for another engine versio
but not for the 4.15.3
oh ok, thought i had to do it from the launcher ๐
Nah although it may also help to download Debug Symbols as well for that engine version
Also you could always launch a 'Standalone' version of the game and attach visual studio debugger to it
realised I should have asked this here:
strange question - but if my multiplayer games mode need to have two FText fields to describe them (i.e., their name, and description), where should I ideally be putting those fields?
I need to be able to display both on connected clients, but of course, the game mode does not exist on the client
I also do not want to replicate them
is the client at least aware of the game class?
okay, found a way of doing it:
https://snag.gy/re6RnE.jpg
if I enable bReplicateMovement to true in the constructor, should that be all I need for an actor to have its movement replicated or is there some other voodoo i need to do?
you also need to enable bReplicates
how well it will be replicated is another question, however
Yeah it doesnt seem to be working, and I'm a little new to networking, so not sure how to debug replication problems
@tawny parcel they aren't related to multiplayer.
Yea, so I have a call event in a rep notify
So that would be, is the repnotify reliable
reliable in what sense?
a repnotify will always be called if the replicated property is received
Oh actually I think I might know the issue thanks
np
@jolly siren could/should I use a repnotify to see if a replicated property is actually being replicated? or is there a better way to debug replication?
right now I don't think things are being replicated right in my project, and trying to figure out why/wheer
yes that is a good way to debug it
awesome thanks
sure np
aaaand think i found the problem. Heh all my pieces on my client were set to ROLE_Authority instead of Simulated
so I got a couple questions
- How should I start rebuilding my SP game to be MP (I have almost everything being done in the controllers for the two character types)
- How do I make it so that only one of those charcters uses a certain LUT
Ehm, you basically recode the game from scratch for MP. Obviously with most logic already done but you'll see yourself recoding it
That's why you start MP games with MP and not SP
Start with the base of the game.
is it not built into the CMC anymore?
I thought the character movement component replicated automatically
Yeah, but only movement like forward etc and maybe jumping
Everything unique to your game has to use replication
im pretty sure launch, jump, crouch, and movement are all replicated by default
firing a weapon is not though
Crouch idk, didn't know that's native in there
Jump is, launch alone probably too
But that's not really what makes up a game. :D
Well if you have a jump and run game maybe
But even that usually has special input, moves, interaction etc
Right but that's about how far I am at this point. The only things I have left character wise (not including the art/animation) are projectile weapons with replication and hitscan weapons with replication
and pickups
Yeah well, enter 2 players, either with or without dedicated server checked and see if everything works
CMC predicts the movement, jumping, crouching, and a bunch of other stuff that aids in the predicting of the aforementioned
You can derive from a lot of the prediction classes and add your own stuff but it's no walk in the park for someone who hasn't already been there
I added a ball to the bottom and a ball to the camera that I moved to the top (of the capsule for my characters) and they seem to function just fine so far in MP
just need to do the weapon logic and figure out how to stop the physics fuckery
Physics fuckery in MP will remain fuckery without a lot of work or poor result
like when I jump on top of a physics enabled cube, it freaks the fuck out on one client but not the other
no cheaty way to fake it huh?
sounds like the physics object isn't being replicated
should be. I have it set to replicate in details?
okay well now everything is replicating correctly, but the physics gets fucky if I jump onto a physics object
Anyone here have experience with GameSparks?
@lament kettle Instead of asking it like that. Just ask your question so anyone who does can easily answer.
@wary willow my question is, has anyone been able to use GameSparks to create servers on the fly using AWS?
Or dedicated servers in general.
My repnotify is no longer being called (even if I call it specifically from server) after I changed the variable type from a struct to an int32
This is in C++
NM the problem was PEBKAC as it usually is
I was suspecting maybe there was a generated header problem ๐
@lament kettle I was looking into that earlier this year, but never found a good solution
they dont have the AWS Sdk installed in their runtime
and AWS's web api doesn't give you control over things like GameLift
whats the point of game sparks if you cant machmake dedicated servers?
you can, but I don't know how to spin them up dynamically
if you manually bring up some servers and put your server exe
on them
you can matchmake with them
gamesparks --> callback to node js server --> aws create
but?
it kinda defeats the purpose of using gamesparks though, as you now have your own back end stuff
so at that point, why pay in full for a service you have to work around
if you are at the point where you need to dynamically spin up servers
then you have enough users for 2 cents per MAU to be a heafty amount of money
yeah i guess it is expensive
it's not that the service isn't great, I really like it
2 cents * 1mill = $20k
but if you are working around it, why are you paying for it?
true...
and not building out the specific features out yourself
GameLift is 'free' in that you only pay for the server time
and it handles pretty much all of the matchmaking
but you don't get a lot of the other backend services
So your telling me to use gamelift + my own backend for stats?
if i was a cheap
I just ran into some issues
lets not drop casual antisemitism here
and I am a moderator lol
anyway
well
what are your goals
are you looking just for server hosting and matchmaking?
Im trying to make a game where you login, and then get to play as a faction
and each "season" the faction war ends
so, you do need that back end stuff
and you get to pick a faction again
yeah i understand that
thats why i was thinking of using GameSparks
so maybe your best solution is to just make a little js layer between gamesparks and your servers
take a look at amazon game lift
you can probably use it just to manage your servers
and then write a layer between gamesparks and gamelift
it's not fully ideal, but it'll work
yeah
i dont want to create the game
that's a good idea
and then realize ic ant
yeah
if i figure it out
ill share it with you
probably make a yt tut
cool, I'd appreciate it
I ended up dropping the idea of doing dynamic servers and instead do listen servers
so you created a master server list?
nah