#multiplayer
1 messages ยท Page 397 of 1
why does connecting to an ipv6 address not appear to work? it just reports a network error PendingConnectionFailure
I guess a better question would be how do I check who is calling for the construction of a playerstate?
Why would my Post Login be called multiple times by one client
It shouldnt
I know that, but it is
Splitscreen?
Just one screen
But is it an coop game with multiple players
its a listen server and a client with only one player per
So its coop
coop is kind of a weird term for it but yeah
client as in not-the-listen-server right
yes
That is odd
I'm printing them and it says "BAD UNIQUE ID"
was trying to see where they were coming from
The PlayerStates Displayname is BADUNIQUEID?
the playerstates Unique Net ID
Im assuming this is in BP?
Yeah
Not an C++ game
Your not using HR are you?
probably not what is HR?
HotReload
you know what
in my main menu
I create 3 extra players for local play
is it possible they are coming with the client
Well i was thinking that
they dont come with the listen server though
which is the weird part
I'll remove the logic just to see
Im not sure what an best practices scenario is for migrating local players
I dont want them to migrate so I can move the logic to a different section
in theory
success
it was putting the local players in
๐
in case anyone looks back on this I just moved the creation of local players to the local character selection and remove them upon leaving that screen
which I probably should've done in the first place
I have an RTS game-Blueprint. I'm trying to set network relevancy to the AI pawns instead of the location of the pawn itself. I'm curious if this possible in blueprint? Essentially maybe filtering the multicast based on a collision sphere on the AI units or something to that effect. Anyone have any idea?
location of the Player controlled pawn
The only way i am aware of to fine tune the network relevancy is overriding AActor::IsNetReleavantFor() function
^
I am slighty confuse with the listen server vs dedicated server.
The switch HasAuthority behavior is different if you are a dedicated server or listen server
If I want to spawn something on all clients but not on the server, it seems like I need to add this extra blueprint logic everywhere :
if (isRemote or (hasAuthority and isNotDedicatedServer))
{
// do some stuff on the client side
}
Is that correct or am I missing something ?
hey guys, i just followed the UE4 Steam multiplayer tutorial series and that worked well except for one little problem. We tested it with 3 people and the weird thing is My Computer can Host and others can join with no problems. Each of the other 2 guys can host themselves and join each others session. But if i want to join them i do not find any sessions.... Everyone has the same project file. My firewall is also not blocking anything from Unreal or Steam. And i also have no problems with joining in varios steam games...Maybe anyone has a idea where the error might be
480
Cause 480 can give these results due to the amount of other sessions you find that aren't for your game
I wouldn't worry that much. Get yourself an ID and it should work
480 doesn't always find sessions
ok, i guess i have to move on then^^ thanks for the answers ๐
How do I prevent a timeline with setactorlocation from being jittery on clients
Interpolating instead of just setting
I am interpping
what I mean to ask is should I be doing it on the server vs client or multicasting
I use setactorlocation for some movements and the default character movement component for other movements so I get confused when dealing with the two of them network wise
Well set actor location isn't interpolating afaik
So if you use that, you need to provide the interpt locations yourself
Usually via OnRep of a Vector
works find on the listenserver
oh would i need to send the server the value via from the client like ServerSetUltTarget
fixed it
^if it's socket transform based projectile spawning, you need to force skeletal animations on dedicated servers
What is afaik?
As Far As I Know
Ohhhh thanks @wary willow
IIRC = If I Recall/Remember Correctly
Think those are the only two big abbreviations I see around here that people just assume people know.
heya folks, quick question for ya if anyone has a moment...
What's the very first class to load on client-side so that I can create a "Connecting" widget immediately?
after entering the multiplayer map
would it be the map's beginplay?
followup question: I'm currently comparing the pawn's character name to None to see when my player info has laoded - is there a good way to tell when all of the other instanced actors have finished network replicating in, without using level streaming?
loaded*
instanced probably isn't the right word there, just other actors in general
I believe your first class is the Controller, then the Map
possibly Map then Controller
ok cool
I had it on the Game State begin play, long lag in between loading in and seeing the menu
I'd even hear ambient sounds first ๐
and see the ocean and stuff, so I put a post process volume
Should be map first since there always has to be a map loaded
Yeah, you want to use Controller/PlayerState for that probably
Depends on pie or package btw
GameState is later in the chain
if I just throw it on Map begin play, will it only happen for each client individually when they log in? How can I tell it which controller to assign to
@wary willow how so?
Huh. I never knew that
why is the level loading before game state begin play then?
Go ahead and google it
wel BeginPlay() isn't a "I'm done loading" function
aah
ok that makes sense then
thanks for the clarification
hmm I guess packaged is more importanrt, but the game mode only exists on server
so where I have it is the best it can be?
as it is, the camera loads in to before a pawn is even created/possessed, at 0,0,0, then it snaps to the "Player Start" location and depending on how much map stuff there is to load in, might hang there for a bit before the Game State loads in a widget to cover the screen with a "Loading" style screen I made / player login screen
so right now I have those two areas masked with post-process volume
but this is all PIE so maybe it's fine for packaged game?
I feel like this should be done inside your Controller. There is no camera view until the controller begins as far as I know
a follow up to that would be, if I throw it on begin play in the controller, a controller only begins play at the beginning of the game, right? even when I destroy pawns and possess things, it won't be firing off again yea
inside controller you can do a GetcameraManager()->StartFade() and that'll turn the camera to black even
which then you can overlay your connecting widget on top
and it'll show the UI
BeginPlay() should only be on the initial entry.
but, if you swap between maps. I believe the Controller is persistent. So you'd have to manually call your screen fade/widget during those instances
right, testing it out now
what about being able to tell when all replicated actors have finished loading in on clients?
or at least those in close proximity
Not sure that's possible. Stuff is always trying to replicate
What about just knowing it's there to begin with
like some sort of large sphere trace on server, and compare all actors there to all actors on client until the # is the same?
or something
large meaning like 1,000 units or something
I have no clue how to check it. The Server updates if it thinks the client is dirty, but as far as I know it doens't have a list of every client and every variable to see if it's wrong.
so it can send updates based on the last time the player got an update, and it'll ensure certain things like variables eventually make it
but I don't think it has access to know, so I don't think it has the ability to check to see who's matching and who's not
yeah was thinking of just doing a timer by event every second or so, sphere trace on server, get all actors of Building type (the only one that matters in this case), then pass that # through to a Client RPC that does the same sphere trace and compares the # until they're the same?
cause that essentially worked for my "pawn loading"... just keep getting the pawn's name until it's not nothing ๐
In theory that should work. But it seems like a network heavy solution, that, for players already lagging, will cause more lag
that's spamming the network when it's trying to already send all the data about the world initially over. So it'll be rough
true
I appreciate the concern ๐ but I think it's at least worth it so players don't load in to nothing, run around, and inadvertantly fall off a cliff or into somebody else's base ๐
well there should be a function that tells you when the level gets streamed in?
yeah I'm not using level streaming tho, since it's just P2P networking, not dedicated server
In theory I could, of course
level streaming is a local thing. Doesn't realy matter?
nah it doesn't, this would be the only benefit tho
I'll try this out and see how it impacts performance just doing it like once a second or so
only while logging in
I figure with a small enough sphere trace and just an integer to pass through, it shouldn't be too costly
tbh I haven't built any map yet besides landscapes so I might end up doing level streaming, have to do more research ๐
from what I remember, basically everybody would have every streaming level that has anyone loaded into it when doing P2P, yea?
not as advantageous as dedicated servers where each client only loads in their own region? It was a while ago tho any correction would be great
I'm not sure about that to be honest. As far as I know level streaming does have that, but only relevant data is rendered.
I'm using culling on pretty much everything. I've enabled a "creative mode" to let players build infinite stuff. Gonna test it this weekend. I'll let you know how it performs ๐
But I'm not sure if that happens to clients or just the person playing as the server
if you're hosting, yes, all data has to be hosted.
right
but the other clients, I believe it's only the levels they're using
so it's the same concept. But as a Dedicated Server running, you're not playing and running the server on the same machine
and just to clarify for anyone else who might know, we're talking the difference between P2P and Dedicated Servers when using Level Streaming
I think my original reasoning was.... if the Server still has to have everything loaded in for P2P
then for performance/optimization, I need to consider that as my limit
so like, if I use level streaming, eventually, the server's gonna be unplayable
Yes. That part should be true
That's why a lot of games use a "You can't go X amount of feet away from your partner" in co-op games
oooooh
if I need to make this more of a D&D style campaign game, I could totally cheat with that
because it keeps the host from loading 2 maps at any time
No problem! have fun
@thin stratus I remember you and I talked about sessions so just a heads-up: I updated UWorks to V11, with sessions. There is definitely room for improvement here and there, but it's been stable so far.
Awesome. Thanks for the notification!
UWorks?
@meager spade A plugin I'm developing, to make Steam integration as painless as I can.
does it support party beacons etc?
I own both Uworks and Steam Parties on unreal marktet and they are both super easy to use
they both have their own support discords too which is great
so I'm spawning actors on client and suddenly I'm getting this all the time on the server:
Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client
I'm pretty sure I'm not sending any client actors over rpc's so I'm not really sure what this is about. Should I be concerned?
So the if I want to replicate this movement function I use for abilities, I would need to vinterp through an OnRep Notify right?
@agile lotus that's probably not an ideal solution. you'd be better off making your own character movement component so it works with the prediction system
It's only for attacks though
I use the character movement component for normal movement
it moves the character though, right?
yeah
setting actor location in your pawn is going to cause weirdness if prediction kicks in
maybe? probably not an airtight strategy. I have a feeling what you're doing is pretty similar to the "Boost Dodge" described over here: https://wiki.unrealengine.com/Authoritative_Networked_Character_Movement
anyways if you don't care about that and you really want to do through the pawn (you probably don't, it will be buggy) you basically just want to make sure it starts at the right time. a NetMulticast RPC would probably be faster/more reliable than waiting for a variable to replicate
the prediction system is dependent on it having all the needed information to predict the location and velocity though, so you'd do best to do it right.
that being said, I do things like teleporters in my pawn and it works just fine, you might not have any issues if it's something very simple that doesn't meaningfully affect player location
It's for things like this (this is on local play so no jitter)
the attack?
the movement of the attack and other attacks like it
well for that one in particular it looks like you could just use a LaunchCharacter. it's the same function as jump, and already works on a network
No it needs to be pauseable
as in
If an opponent is hit
the timeline is paused for a second
then continues
and it needs to go left, right, down, up, diagonals
LaunchCharacter accepts an input vector, and if you launch in the exact opposite direction you're moving you should stop moving... there may also be a networked function for stopping movement. maybe StopMovementImmediately
The problem is launch character is a one time thing
This happens over frames
Unfortunately it's just not an option, we used it in the past and it caused all sorts of problems
like constant velocity? did you try turning gravity off and/or switching to Flying mode?
Flying mode actually might get you what you want, though you won't have gravity
In my game I basically added a custom movement mode that works like walking but does not chop off the Z component of the input vectors. works great and takes full advantage of prediction
Leaving flying mode causes our pawns to go through the landing process though
ah, that's unfortunate
Yeah theres some moves that use the movement on ground
so in those cases flying wouldnt work but I can see how it would work for the above example
a custom movement mode would probably be your best bet then. something that works like walking but allows flight
if you set it up like that you can just add input vectors client side and you'll be golden, no lag on clients and perfect prediction
would probably require a c++ person though
my c++ person went MIA a couple months ago ๐
now it's up to me
but its something I can look into
thank you Slime
no problem, good luck
that doc I linked to was immensely helpful for me (https://wiki.unrealengine.com/Authoritative_Networked_Character_Movement)
Thank you for that link I'm reading it atm ๐
here's what I'm doing if you're interested:
bool UProxyWarFlyingMovementComponent::IsGliding() const {
if (MovementMode == MOVE_Custom) {
switch (CustomMovementMode) {
case EProxyWarCustomMovementMode::MOVE_Gliding:
return true;
default:
break;
}
}
return false;
}
bool UProxyWarFlyingMovementComponent::IsFalling() const {
return Super::IsFalling() || IsGliding();
}
falling now is true if i'm in my custom movement mode, so landing/physics works properly
So I could just have a custom move like your Gliding but have falling set based on when I need it
then I override ConstrainInputAcceleration so that we keep Z components during glide
FVector UProxyWarFlyingMovementComponent::ConstrainInputAcceleration(const FVector& InputAcceleration) const
{
// walking or falling pawns ignore up/down sliding
if (InputAcceleration.Z != 0.f && (IsMovingOnGround() || (IsFalling() && !bWantsToSprint)))
{
return FVector(InputAcceleration.X, InputAcceleration.Y, 0.f);
}
return InputAcceleration;
}
and for a little extra control I disable input scaling as well so I can pass in 1:1 velocity vectors instead of normalized ones. this part requires some other changes to basically override max speed
FVector UProxyWarFlyingMovementComponent::ScaleInputAcceleration(const FVector& InputAcceleration) const
{
if (IsGliding()) {
return InputAcceleration;
}
return GetMaxAcceleration() * InputAcceleration.GetClampedToMaxSize(1.0f);
}
that last part might not be totally kosher (it's definitely more heavy than the default) but I personally needed to be able to basically have infinite acceleration based on current velocity because it's a vr wingsuit
anyways yes, you may be able to get the behavior you need just by overriding IsFalling()
while in a flying mode
anyone experienced hitching when spawning actors on the server? i spawn 8-10 resource nodes (fairly small and low poly ones) that aren't very complex actors, but the server seems to hitch when they spawn. players dont experience it, but if im running the dedicated server on my machine and playing on it OR running it in PIE, its very noticeable.
I experience all kinds of problems with PIE
discrepancies between PIE and a packaged build thats for sure
@vital steeple are you delaying a frame between spawns?
Sometimes it like night and day with just a .1
well, there is no real delay i guess. they are spawned by individual parents that manage each "field", some have different spawn rates, so they would be offset in that manner
each node has a range of seconds to spawn in (spawns every 18-22 seconds) or something
but they arent forced to spawn at different times, they just get a delay from a range
no real offset delay, i should say*
and yeah ive noticed PIE is very strange. i get lots of weird results from the gpu profiler that dont exist in a packaged build
@vital steeple i've experienced stuff like that when spawning bots, I've found that there's less lag if you do it from C++ for whatever reason
possibly blueprint node introduces some overhead
Anyone here used GameLift?
Wondering how easy Integration was and getting off the ground with it is.
ok cool, thanks guys! ill nativize the blueprints and see if that helps
@meager spade Kind of the wrong question format, but yes. You don't need beacons to make parties. The term "lobby" in Steam's terminology is a bit different than in UE4 terminology. Lobbies are persistent and users can belong to any number of lobbies at the same time. What you do with that is "limited by your own imagination". I use lobbies internally for sessions and some of my customers have already made their own parties with it, some even with voice chat. I'm probably going to add a "standalone" party example in the next version.
@agile lotus Thanks! โ
without the replication graph stuff coming in 4.20, there is no way to send a multicast RPC to only a subset of clients right?
hey
hi
whats drm
drm wrap your binary game file using the steam drmtoolp on their end. basically your game binary gets uploaded to valve server, they run their drmtoolp, and you download it again and you manually replace the file
this adds a small layer of piracy protection
its small. minor obfuscation only, but it prefvent some piracy
ahh im not worried about piracy as its only friends that i trust that have it
path to\steamcmd.exe +login steamuname steampwd +drm_wrap appid "path to\gamebinary.exe" "path to \gamebinary_DRM.exe" drmtoolp 0
ok just so u know
might use it in a few yrs ๐
(path to \steamcmd.exe) +login uname pwd +run_app_build (path to\steamworks_sdk_142\sdk\tools\ContentBuilder\scripts\app_build_782640.vdf) +quit that's as simple as my .bat file is
i just run my .bat every time i want to upload a build, then go to steam pipeline page and activate it.
then you can tell your friend to restart steam and try to dl or try to manually dl it if he has it already. i usually ahve to restart my steam before a hot update will work like that
if he doesnt have yet, he can just dl it.
hope that helps
thanks
@twin juniper hey
so its just uploaded to steam, its still giving me a problem, do you want a key so you can see what i mean
working on a material rn. can you wait a few moments please
you can try to just have the user download it and for the host use create advanced session and user uses join session
that is create sesssion you can use find sessions to get array of sesion, and then join session for the one you want
sorry, working now. i will have to brb
make sure to use that make literal node for servername so you can use custom server names for your ganme. it's helpful
Have i done it right?
looks good, only th ing i can think of changing is private connections to like 100
Okay
what happens when you try it
make sure the open level node has an actual level in it that you added to packaged levels
cool
Thanks for the help dude i appreciate it
np
do I need to keep building the server in VS or is it something I only need to do once for a projejct?
like if I update the game, new package. Do I need a new server build as well?
Does anyone have a blueprint example of replicating SetActorLocation with Vinterp and timelines
@potent prairie it all depends . sometimes it will work fine other times you may encounter strange behaviour it all depends how much code has changed and which classes you edit.
although its a pain in the bum its always best to rebuild it. after the first build subsequent builds and packages go faster anyway
After getting session results from IOnlineSessionInterface::FindSessions(), is there a way to check for expired sessions in search results array that I get...
Basically, if I get sessions from findsessions, but the host destroys the session. The session is never cleared from a client, so the client can still try to connect to the session. I basically wanted a way where I could check if the session is still advertised, I found two functions in online subsystem null but both have been hardcoded to return default values. One was FindSessionById() which returns true and gives a empty result and other was PingSearchResults() which does nothing but return false.
Has anyone come across a method that can be used to determine if the session is active before joining it ?
For lan matches I was thinking of getting the IP from GetResovedConnectString(), and doing a ICMPEcho to the IP address, if the result came in a reasonable time only then should the client be allowed to join it, else the session is inactive and the user is informed that the session expired.
Does this approach work? or is there a better alternative ? I sure can't use this for steam sessions though, would have been great if there was something that worked for both...
@zenith yarrow There aren't alternatives. I recently went through the same thing with my plugin, integrating Steam. My approach consists in implementing a custom communication protocol using Steam's ISteamNetworking interface (the host always listens for queries and responds if it's alive or not, while the client does a quick query before joining).
@fleet sluice Thanks for replying, my colleague just made me realize that the ICMP echo thing wont work as the pc could respond but that does not mean the session is on...
I guess for lan i'll just have to do as my colleague suggested, keep refreshing the sessions and whenever I get updated session results I pass that to UI.
Again thanks for replying at least now I now what i'll have to do to make this work...
For LAN you can use UE4's sockets with the PLATFORM_SOCKETSUBSYSTEM macro because LAN isn't affected by NAT techniques. It's the easiest and most straightforward thing, other than frequent queries.
I'm using an unreplicated event that calls a replicated on server event which calls a replicated multicast event to a switch has auth ->server to a setactorlocation with vinterp and a timeline. How can I improve this to prevent clientside jitter on his pawn
How do dedicated servers work
They just do #wokeuplikethis #nomakeup #allnatural
That's so vague even if I wanted to help, I wouldn't know how
Um like what does that mean. Is it like a seperate comouter that handles all clients? Do u have to buy one? Im so stupid
UE4 dedicated servers are a regular game packaged with a particular configuration (they don't need rendering, audio etc.) so they're a separate [YourProject]Server.exe. They can be hosted on the same machine or on a separate machine. Most people go for virtual machines (VM) managed by Google/Amazon etc. It's like installing any other program and whether you install it on your laptop or on Google's virtual machines, it's your choice.
And yes, most providers, like Google and Amazon, charge a bit in order to let you install your UE4 server on their virtual machines. Sometimes, people refer to these VMs as servers as well, but that's just a terminology thing. VMs and UE4 servers are 2 totally different things.
Yeah, there is the server "hardware" (computer, either physical or virtual) and the UE4 server software
You can have client-hosted players (one player is the server for the game), or dedicated servers which require you to pay for server hsoting
Depending on your game and worries about cheaters you may not need a dedicated server.
A coop game for 4 ppl for example, who cares if they memory hack and ruin there fun. But something competitive you may want a dedicated server out of there hands to mess with
Thnx guys. Im starting off with a 4 player horde mode but want to make my game competitive in the future. Anyone know howm much google charge?
Most of Google's stuff is free up to a limit
Then it's usually a pay-per-usage model
I don't know about VMs in particular
Anyone know of a guide to replicate pause in multiplayer? I'm trying to achieve a triggered cutscene for all players in a dedicated server environment. It needs to pause, play the scene, than unpause for all players.
@tawny parcel in multiplayer i think your best to iterate through all controllers, and set the input to ignore and maybe adjust time dialation to slow the game (if that doesn't affect the cutscene)
Yea I was taking that approach but it seems glitchy since server and clients get a bit desynced with time dilation. My current variation is to disable input, movement and gravity which gives a pause feel and replicates more consistently
And like you mentioned shouldnt affect the cutscene as much
There should be a pause function built in
or have a bool which gets set, called say bInCinematic, and you can test various things against that
@calm hound don't think it works on multiplayer, unless you get the server to call Pause on all clients..
Ive tried the pause function but it doesnt appear to be working in multiplayer / dedicated server,
When I run the node in any form, mlticast, on server/client it does nothing
but i think a bool called bInCinematic, you can put checks wherever you don't want things to happen
cool ill check in to that
i know on the sequencer object you can chk return state but that hasnt worked either
but to just disable movement/look you could iterate through all controllers from the server and set them to ignore
yeap, i am using an iteration of that right now and it looks promising, with adding gravity scale to 0 to pause anyone in the air
if it doesn't work in multiplayer, couldn't you just make an RPC Multicast call that the server uses to call it on clients machines?
iirc GameMode has to be Pausable for pause to work as well
yeap it is
Hi everyone i'm a french 3D designer, so if you need i can do some 3d file for you, contact me
I have an issue where my background art is jittery when parrallaxed on clients
is it because both client and server are sharing a camera
@proper olive Just did a big replicated loop?
looks like it worked pretty well though
๐ yep!
@fleet sluice do you know if the hosted vms are capable of running steam advanced sessions plugin?
Hey guys I have a question, I didn't notice until now that my movement isn't working properly in an advanced session. the server moves and rotates the character, but when I create a session and join it, my character only rotates..
Literally thought I understood multiplayer lol
I have a server executed event with an input of location that goes straight to a Simple move-to node. Suggestions?
how do i replicate Gameplay Tags?
?
i was trying to do that in anim blueprint
but only the client and listen server get replicated
i thought the ability system was fully replicated including tags
If you are using #gameplay-ability-system , it should all work out yes (but no clue, never used it)
I would ask in there
But, they aren't replicated by default in BP
Because I definitely have to toggle on replication on them
How do I make sure I'm grabbing the Character Movement component of the client
and not the server
IsLocallyControlled should work @agile lotus
Client not Server though, SwitchHasAuthority
Now that I reread your question
Remote
But I think you really want locall
Not Remote
But who knows
Thanks victor appreciate it!
was getting jitter on clients when changing their speeds
What I was doing was an event that changes their speed that isnt replicated and one that is replicated to server but I wasnt checking for isLocallyControlled
isLocallyControlled would help with this case?
Yeah I'm just focused on making it smooth first
Just do IsLocally
and then change it without repping
CharMoveComp will do its thing
This means I shouldnt have addmovementinput on any replicated events then right?
Recommendations on ded server providers that would work well with Unreal?
what would cause the clients pawn to move jittery but only on listen servers screen
i had jitter in mine, i had to update to predictive replication
unfortuantely i dont understand the c code that the guy wrote, but suffice to say i used a code plugin that had the prediction written into it
i dont see jitter anymore, and if i do it's quite infrequent
i did have a serious jitter problem for a while though in my early builds
when i did, i had replicates movement turned on and physics enabled
im assuming that since the code plugin i am using predicts the movement, there's less need for checking and changing location to correct location because prediction accounts for it? not really sure. ๐
sixdof
on the marketplace
its like $15 or something
worth it
my game is a 6dof shooter lol. so for me it's really worth
you're doing like a side scroller or something right?
Yeah
yeah wont work for u
rip me
lol
honestly i don't really get it either lol
i just tried a bunch of different RPCs until it worked ๐
now i get it a little better
i use multicast for firing guns and exec on server for movement, that's basically it
right now my movement goes Custom Event (Not replicated) > Server Event (Replicated on Server) > Multicast Event (Replicated on Multicast) and all the movement stuff is in this one
but the clients only jitter on servers screen
i used to multicast movement.. not anymore
maybe thats my mistake
just use switch has auth to determine if it's a server or client
When I do that only client or only server can move
has auth -> client (then run on server) has auth -> server (exec movement) turn on replicates movement for both client and server
yeah but you gotta turn on replicates movement for the character pawn as well
unless you're not using a normal pawn
replicates and replicates movement are both enabled?
yes
and Net Load on client not sure what that does tho
it was on by default so I didn't touch it
hold on lemme see if I understand correctly
here's my old code for movement before i got sixdof which replicates automatically
so i guess if has auth is remote - you would do the movement locally , AND exec on server. the server would broadcast to other clients - instead of using your current multicast
try that
look at my code and try that out , might help ya
here's my current code for all ship movement using that code plugin. lol code plugins make the world go round. (and it has prediction and latency compensation built in :):))
try only doing add movement input to remote
and change the auth to server exec
make it similar to how i had in my second from most recent pic - try that
you might consider bunching your movement input stuff into a function too
so that the function can be called on remote and from the bottom custom event server RPC's output
will save some space and tidy it
here's an example of the movement function i use
or USED to use before i got my plugin
as you can see everythign is bunched in there for movement and all the transform stuff
saves space
and your movement input should have an axis input - and you plug that into your server exec call or function call from remote - as i had in my pic earlier
Right I do I just made that quick to see if I understood how to layout the switch has auth
ok
attempting to lay it out with my actual movement now
yeah only diff is on auth it's still a server rpc call, but no local call
so you'd just have to remove the add movement input from the auth output pin
your way may work too just depends on your resulsts
i know my way worked for me but i did have VERY slight lag
it was very minor
my lan pipe was saturated
thats probably why
anyway my code plugin prediction stuff solved it for me ๐
sorry to brag about that so much lmao
haha
so calling your Ship Thrust and ServerShip Thrust on Remote doesnt do double the movement?
or didnt
The part circled in green
@agile lotus - didn';t do double
when i ran it
if i didn't do a local move on the remote, the ship would only move on server if i did the server RPC only
and not on the client
so i had to add that in in my case
keep in mind i once had multicast movement like u
but i moved it over to server movement
and now to the plugin but when i had server movement, it needed to exec on client too so i added that local call before the server rpc on remote for the has auth node
make sure y our pawns are set to replicate and replicates movement (like you earlier said) and disable any replication for any child component as well. (any child componment in the blueprint for the char that has component replication, ddisable those)
are you talking about the default unreal 3d char movement with the 3d biped thing?
that grey thing?
i thought taht guy did auto replication
Has the icon of the stick man right?
yeah
it has a checkbox for Replicates
even though theres a Replicate Movement option
and Replicates on the character pawn
i realy never used so i can't speculate on that one. but in my example i only had it on the absolute root parent of the blueprint i use my character on . the uppermost parent
Oh okay
you shoulda try it and see
if it works out
you can see my flags on the right, i had net load on client on as well
i only set rep for the uppermost parent
the pawn itself
then for the ship mesh and actual meshes and stuff, like arrows, i turned component replicatesa off
however for my sixdof plugin
i DO have replicates movement on.
so you might need to experiment with your char movement component
you might need rep on for that actually
i had that on for my plugin
just checked.
Thanks for the help, theres the tiniest bit of jitter on the client pawn in server perspective but its alot better then it was before you showed me your movement from before plugin
I think I'm not setting movement speed properly for running/walking
but its progress
๐
hello guys, i'm getting ready a plugin for photoncloud, any interested people here?
I would be in the future when I look into dedicated servers @twin juniper
thats what its for if I remember right?
it's multiplayer realtime cloud centered server
Global cross platform multiplayer game backend as a service (SaaS, Cloud) for synchronous and asynchronous games and applications. SDKs are available for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
in that case yes
cool
my experience with unity and photon it was terrible but that was years ago . it might be better now
why was that @worn nymph ?
always bad movement issues , lag desync etc
ah, well, that depends on a lot of things, obviously the number of clients, the region, type of sync
photon is not easy to adjust with a lot of people
and not cheap either
yeah thats when i switched to unreal almost 4 years ago i think
unity network was garbage and from what i hear still is . i tried all the thirdparty alternatives. photon, raknet etc and was disappointed and at exact time i saw a demo of unreal video with 2 characters running around all movment networked synced and they dropped the monthly engine subscription so i switched and have never been back lol
hehe
i can understand
i was hired to do a moba and they used unity and appwarp, then they switched to photon
i checked that the c++ sdk for photon is much faster than the unity plugin for that
so i did a plugin for photon cloud using shiva engine and after that, the port for unreal
Hi Guys
I have a weird problem
I have a multiplayer game, normal first person stuff
When the host looks left/right, it works just fine, for the host
but the rotation is for some f*cked up reason flipped
so when turning left/right, the clients see the host turning right/left
the host sees the clients turning left/right correctly
@here does anyone have an idea why that could be?
Just got weirder
I found out rotation is replicated correctly when the character is jumping
anyone?
Has anyone seen issues with steam sessions where some players can't find the session for a while after it has been started? It doesn't have anything to do with location, because we were all in the same city.
We were testing with 4 players and 2/4 could see the session right away and 2/4 couldn't for a long time after it was started.
This is with a dedicated server.
There were 2 other sessions up at the time and they could find those. But the one that I had just started they couldn't.
Hmm it looks like Advanced Sessions might have ran into this too
Made FindSessions AllServers option search twice, once for client servers, once for dedicated, and merge the results.
(This fixes a bug and also ensures that steam works correctly, if you want to avoid the longer search time before showing results you could
search one first, fill in results, and then search the second and add them in when it is complete instead).```
I wonder what that bug is
i don't know how the ISP situation is where you're at, but here, same city could easily mean 4 different providers
One of the players who couldn't find it was on the same provider as me and I could find it.
nod
Is unreals dedicated server better than photon? Im making my game but dont know if i can matchmake and chat using the dedicated server as eadily as photon
@heady merlin Do you recall what that bug was that causes you to have to search twice for steam sessions? Is it in the ue4 issues tracking system?
ahh okay damn
One thing I didn't know about was SEARCH_DEDICATED_ONLY, not sure if that will help
not if you are unable to find it after a period of time
you sure you aren't updating the session with broken values at some point?
I do call UpdateSession to update the session info with the appropriate map/gamemode names.
But most players can find all sessions all the time. It's really only after starting a new server that some players can't. It is rare, but it is annoying.
It's like it takes a while to advertise to certain players for some reason.
its dedicated?
yes
that isn't super unexpected
really? So there is going to be different advertisement times per player?
how long are we talking here?
Yesterday we played at least 5 minutes of a match before one of the players could find it
and was that player in the same relative geographic location?
though 5 mins is a bit much
yeah in downloads
it literally changes your listed region
you can bypass region lock in app 480 with it
ahh okay, yeah we are on our own app id and not using presence since this is dedicated
I don't know steams server setup for how they dole out instances
I'll check their download region
I know they use a master server list, and that is refreshes periodically, I just don't know how they propagate to users in different parts of the world.
so i have 2 player characters, how to get a reference of the other character that is not yourself (enemy in a 1v1), for both client and server, i need to use their locations to show them on the minimap
anyone pls help?
and i have the enemy variable in my character and widget accesses it from character
@heady merlin Yeah we are all on US - Detroit for the download region
For interpolated smooth movement from A to B of player character should I use FSavedMove_Character ?
Is there any possible way to replicate movement of an actor placed in the level?
It's not a pawn, just an actor with bReplicates and bReplicateMovement turned on
I know it has to have an owner, correct?
Is it enough if I set the owner to the player pawn or some such on BeginPlay?
hey how can i set an enemy player character as a variable?
@twin juniper you need to store there location in GameState and pull from that as you won't be able to access the other players position
plus GetPlayerCharacter will only return your player at index 0 (first player) if you are not host.
so you need each player to update the GameState with there current position, and you can just pull the results from there.
i could do it by adding get all actors from class inside the game state
and it would store array of 2 locations
having an issue with movements and possessing a pawn ..
well, our scenario is an fps game, where we can use an helicopter or a boat but we seem to always get some kind of network lag.
we are possessing a pawn for boat and same for helicopter
would we need to make some sort of CopterCharacterComponent or something of the kind ?
i mean, instead of possessing a pawn ?
For interpolated smooth movement from A to B of player character should I use FSavedMove_Character ?
Guys, can anyone help, me and 3 others are from the UK and 1 of them are from the US. When we are in the game its so laggy. It shows a person running into a wall when that person isnt. Any help on reducing lag?
I'm using Advanced Sessions plugin
@humble zealot i can help you but can you please screenshare
@burnt meteor What do you want me to show
@humble zealot hey! glad you were able to get your steam game working online. if you want to reduce lag, you'll need to use movement prediction / latency compensation. it comes with the char movement component by default, but you'll want to disable replicates movement in many cases to prevent abundant network lag. instead of using replicates movement, you'll want to properly use RPC calls to get movement working. i posted a recent example in #blueprint for another friend i was helping that details how i did my early movement for my 6dof game for my ship before i transferred the movement to a code plugin i bought for a good price. you can try something similar in your movement code - use has auth and server RPCs.
ive took a break form ue4 for some time, is it possible yet to replicate a TMap ?
hah no
what do you guys use to introduce latency when testing your mp on local?
you can just spawn several objects that are replicated to add simulated latency
Or you can use the Net family of console commands.
NetPktLoss
NetPktLag
Etc etc
@ember needle
@twin juniper
never used those, will see how they work
thank you Devils
hopefully it is easy to isolate the processes you want to slow down
No worries
ah cool didnt know that
Does someone have a good place to start for throwing grenades & syncing them.
I currently grab the input from clients -> Run on Server spawn grenade
that grenade is replicated
at launch, an impulse is added to throw it but it corresponds to the data on the server which is incorrect for the player due to lag, so I'm not not sure how to add authority there...
things go sideways from there
I was thinking to disable physics except on server
and then broadcast the position that gets received and applied by clients with a tinterp like so: https://forums.unrealengine.com/filedata/fetch?id=1112091&d=1468590240
i think that will result in a grenade accelerating mid air on clients
what kind of approach would you have?
The game mode is never on the client right?
yop
I'm trying to do a black screen fade with just UMG, but the map loads too fast for the player controller
On server join
What would the earliest place I can spawn the UMG to prevent this?
I know you use slate for this @thin stratus, but is there a way to do this with umg?
Do many of you use uPNP for MP?
A quick question, I really need to create my own online subsystem for online games? or can I use null and implement my own game session?
You don't
Use Steam if you're on Steam, use PS4 if you're on PS4...
If you're not using any online service then yeah you need one for matchmaking
But you have bigger problems than the game side if that's the case
Understood, thanks @bitter oriole
@raven holly Not really. The easiest is really just hooking into the Map Loading delegates
Ok Super Noob question but how Do I get an event to run on server and all players?
@hollow pulsar use multicast RPC
Multicast is not replicating to player 2.
here's an example using multicast. you'll need to use has auth, as well. i am firing a laser here. if the exec flow is a remote auth user, it execs on server and passes that into a multicast rpc that spawns out the laser. if it's auth exec flow, it automatically goes to multicast, since it's execing from server. multicast is only called from server.
clients cant call multicast RPC
so that's why you have to have an additional RPC to get it to multicast from the server, if it's a client.
hope that helps!
so i have a event, fire laser
i have conditiosn in my game if the laser can fire.,
if the laser can fire, then i go thru that server logic based on which weapon is selected in my weapon selector.
you'll need to write your own logic for whatever you want to do in your game prior to has auth.
the logic block i gave you in the first pic is the paradigm for using multicast though.
@hollow pulsar in simple terms, Client can't use Multicast but server can, but client can send request to server, which can then run the multicast. the has authority makes sure we are not the server. if we are not authority we ask the server to send the multicast for us, but if we have authority then we can just send the multicast.
^
from the unreal doc page There are 3 primary types of replicated functions: Multicast, Server, and Client. Multicast functions should be called on the server, where they are executed, and then forwarded automatically to clients. Server functions are called by a client and then only executed on the server. Client functions are called by the server and then only execute on the owning client.
so since our clients can't say - oh look at me i wanna do a multicast i wanna make all the players do something, it's like this because it's a breach of security.
so
we have to make sure to use our server to do a multicast RPC
for security reasons
also http://cedric-neukirchen.net/2017/02/14/multiplayer-network-compendium/ is also a good read
get it?
Not really my event just doesnt seem to be going though should I send a screenshot?
yep alt prtscr ur bp and send it over by ctrl v ing in here
yeah
it should be kept local
first thing i saw is death should not be exec on server like he says
notice how my my fire left in my pic is local?
you exec on server only starting at certain points in your exec flow
unless you want everything to be exec on server
I am sure all AI Controllers are owned by the server
yeah please do because i am lost ๐
When the Zombie loses all of his health I want him to die for all players
currently he dies only for the player who shot him
right, then you are doing something wrong, cause the server owns the AI Controller which owns the pawn. If he is set to replicated, then when he die's he should be dead for all players
are you setting your AI pawn to replicated?
I have replicates and and Replicate movement on
how is the AI Dying?
so you are not tearing him off or removing his controller?
I guess not
not sure if you have too, but i do with my AI
Yeah but my print strings arent coming out at all either
what his lifespan set to once he is dead
3 seconds
think i need to see more of the blueprint to understand
{
auto AiController = Cast<ASPECAIController>(GetController());
if (AiController)
{
AiController->CleanUpPendingDeath();
}
bReplicateMovement = false;
GetWorldTimerManager().SetTimer(TimerHandleDeathAnimStop, this,
&ASPECBaseAI::DetachFromControllerPendingDestroy, 0.1f, false);
/* Disable all collision on capsule */
auto CapsuleComp = GetCapsuleComponent();
CapsuleComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
CapsuleComp->SetCollisionResponseToAllChannels(ECR_Ignore);
SetActorEnableCollision(true);
SetLifeSpan(20.f);
}```
that's how my AI dies
@hollow pulsar we can make use of the bool you set
Whats the idea?
make your dead variable replicated
with notify
make that
then inside OnRep_Dead
replace https://gyazo.com/6e10f14d77e0fb2949fe8793fc9f9b3e with ServerSetDead
give it a try
They die on screen but are alive on the server still
Sorry for pestering but this is just very confusing
you have to replicate all the vars where you have enemy AI health.
so that everyone knows the health=0 when it's called.
that's basically what i do.
except i dont use ai pawn, i use this on my main pawn. i don't currently have coop for my game.
just single, and multi with other ships (no ai)
so just try setting your vars to replicated.
thats how i handle death for my main pawn
notice the shield var is repped
i dont use notify for mine, but you can try what works for you. just keep trying things i'm sure you'll get it.
Yeah Ill just keep trying ๐
how can I force disconnect a player with a message?
@fleet raven i suppose you need to send remove player but just before you do pop a widget on there screen with the reason
how's that supposed to work though
closing the connection would prevent sending anything else
depends how you are disconnecting them
there is a an override in PlayerController which you could override and check for a message which has been set by the server for the reason of disconnect
just before they logout
or gamemode https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AGameMode/Logout/index.html
Called when a Controller with a PlayerState leaves the game or is destroyed
that might be too late tbh
gamemode is server only though
how are you forcing the disconnect?
hmm why would a dedicated server on my own pc have fewer bugs than a dedicated server remotely?
I setup a remote dedicated server and it's got several bugs that weren't appearing at all running the server locally
makes testing really difficult
I'm trying to figure out how to call a RPC on a client that I'm looking at through blueprints. So client 1 tells client 2 to execute function x. Any tips?
@static lynx on client 1 call a server RPC on an actor its player controller is net owner of, then when server receives have it call a client RPC on actor that client 2 is net owner of
Hey guys what's the best way to go about MP movement without a local stutter on clients?
Is it a simple auth check and if remote, let the server know then local movement? Or local then let the server know
Or none of the above
@sharp spire MP movement prediction is very complex. you'd better just use CharacterMovementComponent to handle that
i want to tearoff an actor and then destroy it on the server, but clients seem to receive destruction before the tearoff replicates... is the only way around this to delay the destruction on server?
how are you destroying the actor?
atm im doing
TearOff();
ForceNetUpdate();
FlushNetDormancy();
Destroy();
im assuming destroy ticks before replication... or replication checks for pending destroy and cancels or some such
Whats the best way to debug why my Dodge in my Custom MovementComponent and Replication doesnt work on a dedicated server?
AddOnScreenDebugMessage
everywhere
thats usually how i do it
just print so much stuff that half the screen is flooded with debug info
@glossy vessel
@next osprey thanks, i'm doing that already ๐
then you must just need more prints
and i still have no clue why he doesnt move if i press the button
solves every problem
ok, time to add multiplayer. Where should I start? The game will be 4 player cooperative game versus lots of bot enemies .
what do you mean where to start?
I mean, any recommended tutorial for what I want to do? 4 coop players vs. bots
blueprint
does anyone have any recommendations on what i should use and what tutorials i should follow to get a matchmaking system like paragon
and will i suffer from performance issues if i leave the matchmaking all to blueprints
how can I connect to a specific port?
using open + ip works
but how to connect to specific port? ๐
is gamespark not up to date for 4.19?
hi, i have a triggerbox that creates a widget if a specific player enters it. But the widget is displayed for all players. What do i have to change that only the player who enters the trigger sees the message?
got it. In case you come to the same problem. There is a "IsLocallyControlled" node.
Is Locally Controlled
I'm having an issue where a timeline is starting a second late on servers perspective
on clients pawn
Any way to single out the first player connected OnPostLogin on a dedicated server? I want to set a var on only the first player state connected. I'm so close!
Check if its the first one in the index of player arrays
If I have a function that is called on Event Tick that I use to do AnimNotifies for Paper2D should I replicate it?
are mouse release inputs buggy on servers? I notice that sometimes the server doesnt catch my release event. Never happens when I test in the editor though
Oh jeez.. are there any mobile solutions for wind? Speedtree and SimpleWind aren't mobile supported
turned out it was mostly a timing issue! The variable I was setting on the first player did not replicate by the time the other clients checked for it. Once I accounted for that (by moving the nodes a little further on) the gate and checking array worked
Do we know if Fortnite uses the standard UE4 movement component replication or one similar to UT with changes to how the replication works??
@fierce oriole have you checked that it also worked when players have higher latency? If not I would test that to make sure your fix still works. (Net PktLag in console to simulate)
Hi! Im currently working on a two player endless runner and wanted to start the Round with a Countdown, so i created a Timeline for it and when the Timeline ends, enable the Movement of every player. But somehow only the Server does start after 3 seconds. The client is starting after ~ 1/2 seconds. Can anyone help me? Do i correctly get the Players Controller?
Hey. For interpolated smooth movement from A to B of player character should I use FSavedMove_Character ?
Where in the engine source code is the core networking layer for player input, etc. located?
This doesn't work for the clients only for the server. Can anyone explain this to me?
This is in the BP_Character.
I could use another BP and iterate through every player and disable the Movement, but this should also work doesn't it?
actually it also doesn't work when iterating through
i think you also need to set it on the server
not just the client
for that client
@arctic willow ^
so from the server (like the gamemode) iterate through every player and disable movement?
you can do that if you want or just do a server call from beginplay
setting your movement mode
how do i do a server call from beginplay?
ah interesting, thx alot @meager spade !
Why the server rpc
Ah nvm
But still, if the actor exists on the server, it will call BeginPlay on the server too
Would only really make sense of you filter with switch has authority or?
Hey guys. I need to move and/or rotate my character from server, manually using Tick function.. What nodes should I use? SetActorRotation does not work, as well as AddMovementInput.
is replicating an FTransform going to send the full size thing?
Nah, there's a compressed version
@thin stratus i never really checked, i just figured that's why it wasn't working, but maybe there was more to it than that
@bitter oriole how do I use the compressed version? FTransform seems to have no NetSerialize method so I assume it replicates the quat and 2 vectors separately... which don't compress by default?
use case here is an actor that always interpolates towards a target transform that can change
replicate movement looks like garbage, so I replicate the interpolation target manually and do the same on a client
Yeah, replicate movement isn't nearly useful
Hey guys quick question how would I replicate an Interface?
why would you replicate an Interface?
I have an interface for dealing damage and I need to replicate it.
you don't replicate the interface, interfaces are interfaces, they are like contracts. the define what the class that implements the interface MUST have.
there should be no logic that needs to be replicated in the interface
so @hollow pulsar explain what you are trying to do, because it sounds like you are doing some weird stuff if you need to replicate an interface
thats a class not interface
Im trying to pass the data from event take damage to the server
so TakeDamage is the interface
Yes sir
like this
Yep it gets called but not on dedicated server
yeah that code will need to be executed on the server
a client can't call that code and expect it to apply damage to the zombie owned by the server
but the client can ask the server to apply the damage
unless that functions is called in a server executed event
So the client cant call take damage so how would I have the client ask the server to apply damage?
a server executed event
@hollow pulsar from the client your event will either line trace or overlap or hit. These events fire on all clients and the server. You switch has authority then execute the logic chain. Then call a replication event on remote of the switch to multicast the sounds and visual effects etc
like this?
Client logic works on remote of switch and server logic is on authority
No
that needs to be called from the server
Thatโs overly complicated
The server will automatically call the take damage event
@severe nymph no it won't cause he hasn't asked the server to call it
but he also doesn't need that in there
The server doesnโt need to be asked
He just needs whatever event to exist on the server
Overlaps hits and line trace hit results already exist on the server
You just switch has authority and chain in the take damage
Having hit, overlap event that calls a rep that calls take damage is wrong
It causes replication race events
If you test in editor change your player count to 3
Then hit or overlap
You will see the print fire from all locations without multicast
This means switch has authority should be immediately called after those events
@severe nymph i use this for applying damage, ```void ASPECInstantWeapon::DealDamage(const FHitResult& Impact, const FVector& ShootDir)
{
FPointDamageEvent PointDmg;
PointDmg.DamageTypeClass = DamageType;
PointDmg.HitInfo = Impact;
PointDmg.ShotDirection = ShootDir;
PointDmg.Damage = InstantConfig.HitDamage;
Impact.GetActor()->TakeDamage(PointDmg.Damage, PointDmg, MyPawn->Controller, this);
}``` and its run on the server, from a hitscan weapon
He is running blueprints
You are doing c++
Your scope is defined
He has to use the authority node
The has authority will allow him to decide what to do on both the client side and the server side but hit events in blueprint fire down the logic chain for all connections
When I run a dedicated server my linetrace is hitting the zombies
Its just the health is not being changed for both clients
Meaning on the clients it will print and on the server it will print
Do once is a good thing here too
Well Im still pretty confused on where I need to add the switch authority to.
Great place to start
Just remember when using blueprints that all overlaps and hits are fired on both the clients and the server
So if doonce isnโt called or switch has authority isnโt used the client and server state can become inconsistent
The client and server will execute the logic chain in parallel
So you need to decide up front that client that owns the object will have authority and replicate up to server what happens or the server will have authority do the logic and push state to clients
Rep events called from the client will only execute if they are owner of the actor and owner can only be set by the server
So the server basically passed authority to the client by setting owner and logic can be done client side and passed back to the server using rep. If itโs damage actor nodes already on switch authority nothing special has to be done as that is server side and the take damage node on the client is already replicated
I know itโs tough to get your head around but be patient and you will get it. Just keep testing and it will start to make sense.
So for a hit event on an actor I would literally do the following:
Eventonhit -> doonce -> switch has authority-> take damage
Elsewhere the on take damage event will fire
This is already server replicated and will affect that actor
On the remote branch call a replicatedserver event that calls a multicast event and in the multicast chain do particles and sounds
I hate to ask since this is pretty helpful but could I see a blueprint example?
Just a screenshot to put the words to
Let me see if I can dig one up off my phone as Iโm not near a pc.
That a pretty simple example
Server authority eat and multicast
Hit events work the same way
You can call client logic on the remote branch if needed as well to eliminate lag and branch the multicast and not bool is locally controlled
That way multicast fires for everyone else since client already received the logic
Itโs kind of up to you at that point on how responsive you want certain things to feel
Yeah Im gonna be honest I feel way in over my head here.
@hollow pulsar it's not that hard once you understand the basics of replication
Hey, anyone want to help a sibling out and test my plugin under basic circumstances in their multiplayer game? It's an object syncing plugin for whoever owns the object (client or server owned). I'm new to Unreal so I'm hoping I didn't just miss anything super blatant. I can return the favor somehow, playtest or look over all your marketing materials or something.
Easy add of a script to an object is how mine works.
Lol true that @meager spade just a bit of a bumpy road getting that foundation
@bitter lintel it a code plugin?
@twin juniper Yes. But you can put it on a Blueprint. You just put it on whatever object you want to sync across the network. Whoever owns it controls the position.
Basically just replacing the Unreal movement replication with something that can be used for client owned objects also. As well as other features.
You would drop it in your plugin folder like you would for any plugin you download from the marketplace.
Like it would automatically do rather. Then you activate it like normal. That whole process is also one of the reasons I wanted a tester, lol. The plugin is veeerry strange compared to Unity's.
it on the MP already?
No, I wanted to get someone who knew Unreal a bit more than me to drop it in their game and see if it works or if I just completely missed some obvious Unreal use case or something.
Before I submitted it. I just finished packaging it up today.
ah, where is it at? google drive? how do i get it?
i probably should have done that already, one sec
You got anything you want me to playtest at some point or now, just message me.
Happy to return the favor ๐
yeah i got a game on steam..
sweet
we'll talk about it at some pt maybe
im stil finishing the levels. tons of placement and texturing etc.
Just in case anyone ever has issues with ServerTravel , Seamlessly ( server travels but clients crashing).
Cases vary, but the fix for mine was to DESTROY all pawns before the ServerTravel call (this fixed all my crashes on clients)
If you handle spawning logic initially via OnPostLogin to get it working correctly post ServerTravel, you'll need to use HandleStartingNewPlayer instead since OnPostLogin only works once (since you only technically connect once to the game, you are only moving maps with server)
Hi guys, I need someone with deep knowledge of the charactermovementcomponent and the good will to help this poor coder. The thing is, I need to record the input that arrive in the server and then re apply it at some point to reproduce exact the same behaviour (more or less). I try to record the data which is passed when the server call Move Autonomous + the velocity and then re apply it but the result is not accurate at all. Anyone know something I need to take in consideration? or the best way to achieve this?
@wary willow so can I replace my OnPostLogin with HandleStartingNewPlayer basically on all my maps? I noticed I'm calling OnPostLogin in all my gamemodes haha
Should only be calling it on the initial map i take it
depends on your logic. As long as you understand it's basically a DoOnce on connection @potent prairie ยฏ_(ใ)_/ยฏ
But if you care about what happens everytime a player performs a ServerTravel, then yeah HSNP
Yeah I just replaced the onpostlogin with that Handle and it loaded fine
good stuff, learning new stuff daily
I fixed that issue with my game few weeks back
Hey Kaos Ive realized what I need to do and I need a bit of help if you wouldnt mind
@hollow pulsar okay sure
I need to replicate this function to the server
So the server receives the Take Damage Event
Couldn't you zoom in a bit more?
As far as I can see, it's a fire function in your Weapon
I assume you are spawning the Weapon in your Character?
Yes I am
Is the Weapon marked as Replicated?
Yes
When in the Character are you spawning it
(Need to prepare 1-2 things before we can move the fire function to the server)
These RPCs should be ServerRPCs
Not OwningClient
You want to tell the Server, in your Character, via ServerRPC to spawn the weapons
Since they are marked as Replicated, they will also spawn for the Clients then
UE4 takes care of that for you
You can save the current weapon in a Replicate Reference Varaible to access it
Given you have done these changes, you would want to make sure, that when spawning the Weapon, you specify an Owner on the Weapon when spawning
So you can also perform RPCs in the Weapon
This can be done on the SpawnActor node
For the Owner you can use "Self" or "GetController"
Up to you
@thin stratus he was having issue of client fire not damaging AI yesterday.
Once that is done, you can easily use the Replicated Weapon Variable, on the Client, to call "FireWeapon".
In "FireWeapon" you can then call a ServerRPC
Well he is not fully understanding the concept yet, as far as I can see with his ClientRPCs
I tried to explain it needed to be run on the server
So tl;dr:
- Change your EquipWeapon function to "Run On Server".
- When spawning the Weapon in your EquipWeapon function, specify the "Owner" parameter (might be hidden in the little arrow at the bottom of the SpawnActor node) by passing "self" or "GetController" into it.
- Save the ReturnValue of the SpawnActor node into a Replicated Reference Variable to your Weapon.
- When Firing in your Character, use the Variable from 3. to call "FireWeapon" on the Weapon.
- In the Weapon, in FireWeapon, check with "SwitchHasAuthority" if you are the Server or a client.
5.1. If you are a Server call the rest of the FireWeapon code to actually fire the weapon.
5.2. If you are the Client, call a RunOnServer RPC (Server_FireWeapon) which then simply calls "FireWeapon" again.
@hollow pulsar
And before blindly following that list, make sure to ask when you aren't sure why one of the points is necessarry#
Otherwise you won't learn
@thin stratus do you need to use beacons for a party system ?