#multiplayer
1 messages · Page 614 of 1
specific networking stuff
custom relevancy checks (for instance)
fancy work with data structures... and a lot of stuff you won't be able to do in BP's
not necessarily...
As Cedric said before
you can do net prediction/compensation in BP's directly
however you'll realise as you advance in the development of your project that going to C++ will be a very great idea
take a look up here https://docs.unrealengine.com/en-US/Resources/SampleGames/ARPG/BalancingBlueprintAndCPP/index.html
Describe how to make a combination Blueprint/C++ game, and decisions you might make along the way.
ok but if all I need is the client auth functions to make kicking in multiplayer more responsive and I can do it in BPs, what reason beyond that is there to go into c++?
would it just make it more efficient? I know you guys mentioned the net relevancy but i honestly don't know what that means
perfect im using seamless travel, thank you!
its in GameMode
I apolagize if it seems like i'm asking the same questions over and over, just trying to fully understand
the NumTravellingPlayers
take a look in the doc I sent
looking now
also net relevancy is something you'll have to learn eventually
is net relevancy basically "if the client is not effected by it, don't process it for them"?
kinda yeah
man i'm learning so much thank you guys for all the info
looking back at the chat, will I really only be able to have a 4 player game without c++?
and still remain effecient
oh balls i guess i gotta make the big leap to c++ then
@winged badger num travelling players is from game mode not gamemode base? so i cast to gamemode, but do i cast from the lobby gamemode where im travelling from or my games game mode where im headed?
its gamemode, no idea for gamemodebase
its less suitable for MP so never attempted to use it
ah right, damn its tough finding when the clients are ready.
@pallid mesa or @winged badger so if I want to implement c++ into my project to increase network efficiency, where could I get info on how to directly apply it?
I'm not sure where to start
ok ty
Does anyone have any recommendations on server hosting providers?
I was looking at vultr as an option.
I'm not an expert in this area but I went with AWS gamelift. I don't know if you're using blueprints or not but I got a plugin off the marketplace called "Multiplayer with blueprints" by multiplayscape. It can create and shutdown servers dynamically based on how many people are playing your game.
also has abilty to make party system, and profile system to save stats for players
Would accessing a widget variable server side cause a crash instead of a warning?
Yeah I know that, but how does it handle it?
I am getting some very weird server crashes with pretty minimal call stacks to understand whats happening, it doesnt even show an error but the server crashes, so Im wondering if widgets crash a server that way or not
I would assume attempting to access a widget variable on server would throw a warning that none was tried to access, as i have seen when accessing a particle system variable on server, another object that is client only
Makes sense, latest I could see was
GreyStone_C /Game/PersonalSpace/Stefanos/Maps/GameplayMap.GameplayMap:PersistentLevel.GreyStone_C_2147482369
Function /Game/Characters/BaseCharacter.BaseCharacter_C:ExecuteUbergraph_BaseCharacter:0086
[2021.02.02-20.17.04:071][735]LogScript: Warning: Script call stack:
Function /Game/Characters/GreyStone.GreyStone_C:ReceiveBeginPlay
Function /Game/Characters/GreyStone.GreyStone_C:ExecuteUbergraph_GreyStone
Function /Game/Characters/BaseCharacter.BaseCharacter_C:ReceiveBeginPlay
Function /Game/Characters/BaseCharacter.BaseCharacter_C:ExecuteUbergraph_BaseCharacter```
But that is still a warning
can i replicate only needed items in array? for exaple in My InstancesHealth array i have 2 item (FInstanceHealth), i want to replicate only second item, because first not changed, or vice versa
USTRUCT(BlueprintType)
struct FEUDALLANDS_API FInstanceHealth
{
GENERATED_BODY()
public:
TArray<uint8> InstanceHealth;
}
UPROPERTY(Replicated)
TArray<FInstanceHealth> InstancesHealth;
I am still trying to get basic VR multiplayer functional. I applied the VR Expansion plugin to the VR template and it worked fine. But then when I applied the Plugin to the main project in the same way, the client player does not receive input from their controllers once connected to the listen server. So there must be some diference in the 2 projects causing the problem. so I am putting a debug VR text to display various things. I currently have 1) a player ID line that is set when the pawn is spawned and is incremented in spawn order 2) Player input, ex. Left Trigger Pulled, to determine if input is even registering 3) a line reacting to the Possession events, should display "Possessed" if possesion was successful. Is there anything else I can print to this text to try to identify why the pawn is not responding.
Anyone has some good tips on increasing the mechanical stability of a physics-inspired vertical capsule movement scheme to reduce prediction errors?
By stability I mean - small changes lead to small changes, rather than small changes lead to big changes. A good example is sweeping a capsule against some geometry - the client with a slight variation in positions, which expands into a big difference in final locations, which means a big jitter
I need some help with making a simple UI Updater, im trying to find a way to make a Player class selecter that replicates that a class has been selected so others cant select it
Struct serialization already handles this for you.
It only sends the data that has changed.
@spring swift this is pretty simple. You can store an array of selected classes that is replicated and OnRep you simply update the UI to X out and make the class not selectable.
You can put that array in the GameState and have it replicate to everyone.
is steam subsystem only local when you dont pay to publish game?
No. You can use steam networked multiplayer without paying by just using the default appID 480.
yeah but when we both are in the game the widgets dont work anymore, when im on first it works for me when hes on first it works for him
That has nothing to do with steam then. That's a problem with your widget structure.
Widgets aren't replicated, they are only local.
ok i rephrased that bad..
i mean if i open the game first it connects to steam and goes on spacewar if he tries to open second then it doesnt vice versa
Are you using space war? That should work because it's an example app. You usually should package to run it you cannot run it in editor.
Or if you don't package run it in console with -game
yep i packaged it and gave it too both of us, have you tried something like this?
I haven't run spacewar myself, no. But I know others have and it works just fine.
Did you follow a tutorial to get it set up?
yep cpy and pasted ```[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"```
Hey soopnano are you having touble connecting to the Steam Subsystem?
it connects to spacewar when i open the game first but if he opens it first and i open it second it doesnt connect
Hmm
and if we both open it at the same time then it doesnt connect at all
i do not know then
hey Hold up Xero, you mean i don't have to go into the Gamemode to update the UI that everyone uses??!?!?
GameMode is server side only, so you definitely should not be updating UI there.
if u need variables for widgets store them in gamestate
widgets can get them easily just get game state, cast to your game state, get variable
Hmm, it is true but how would i replicate the buttons to all the clients? just through a custom event?
OnRep your replicated array in gamestate and send it through to your UI
You don't replicate buttons, you replicate state.
AKA you replicate an array of Enums
alright yeah that might be where im going wrong, im using Booleans to determined the buttons status
You should know which button is which class and when the array of enums gets replicated you should loop through them and update them as necessary
Ive never really used Arrays in unreal, but i have a rough understanding of the,
Or you store them in a TMap and go straight to them based on the enum key
Start out by attempting to replicate an array in gamestate of anything
Once you do that, make an OnRep function that sends the new array through to your UI
After that, make them enums
Baby steps
so i make a array of my buttons, and attempt to replicate them in gamestate, ill give that a shot first
Do not make an array of UI elements. Make an Enum that contains each button type/class
Then make an array of that Enum
I have to go to bed, but I'm sure someone else here can help you out if you get stuck. Good luck.
so are enums basically integers, but you can name each value for them?
Basically, yes.
lol meanwhile i've programmed my whole game using integers where I should've used enums, and I've just been remembering what each value is for haha
That's the whole point of Enums, to maintain readability while keeping information in a small package.
And allow you to create states.
very cool i've learned so much from this discord in just the day i've been here
Probably best to dive into a C++ course.
I would highly recommend this channel specifically. There are a lot of very knowledgeable people here that are very active.
yeah i was having a convo with some really smart guys earlier about client side replication
I need to learn c++ to incorporate client side replication in my game but I have no idea where to start.
Go to Udemy's website and look up C++ courses. They have sales for 10 dollars for those courses, and they have ones that teach you from the ground up that I also highly recommend.
ty for that i'm gonna buy it
alright i made the Enum, i have no idea how to use it tho, i made it into a array in player state as a object refrence i think lol
You can't put a price on good teaching... it's worth every penny.
^
@steel vault @spring swift does raise a good point, how would one keep track of players already selcted/in play with an enum? boolean array to work along side it?
GameState makes more sense for that array but PlayerState will work for now. Make an OnRep function so you can respond to changes now.
You simply listen to the array changing and when it does you send that array to your UI, then loop through the array and disable the button that matches that enum.
The simplest way would be to also create a TMap that uses the Enum you made as the key, and the value would be the UIButton
OnRep meaning custom event i assume?
So you go first enum in the array? Ok got it, now find the value from the TMap, ok that gives me the associated button, now disable it.
If it's in BP I believe so. I'm more accustomed to doing the OnRep in C++ but I can google it really quick.
An overview of the Network Features example level, example 1.4: Variable Replication (RepNotify).
oh fancy
So in your enum you made, make a bunch of cases for each class
so i can just set them to replicate
yep done
So now, when you click on a button locally, you send a Server RPC that updates that array by adding the button's associated enum to that array on the server.
When you do, the updated array will replicate and you will RepNotify handle it.
when a player leaves or joins the game, or joins a team or switches teams, could I use repnotify to call a custom event that will update the teamsheet/scoreboard? because right now I'm basically doing it manually
hmm okay so If I have an array of the player states in the game, and a variable in any player state changes, it will call the repnotify?
would this work if the player clicked a diffrent class? making the other one available?
If the variable is set to replicate and RepNotify is turned on, then yes, it should call that event.
PlayerState is replicated
ok so how does one connect the repnotify(i.e. the variables in the player state changing) to the actual custom event on the widget?
You could simply send a Server RPC that removes the currently selected Enum and adds the new one.
The link I posted shows you how to respond to the repnotify.
ok i will look at it thank you for all the info xero this community is great so helpful
ok, one other thing is should these RPC's be in the Game state? or the widget?
lol good thing I haven't yet then
I surely hope not.... they are a business. Where would it be free?
(copy paste of an announcement I sent in my server)
There are 4 very high quality Unreal Engine courses given away for free by Epic Games which came in partnership with GameDev.TV recently
This is the course I used to learn Unreal Engine 4 to get started myself (I gave it 4/5 or 4.5/5 iirc) :
https://www.gamedev.tv/p/learn-unreal-engine-c-developer-4-22-for-video-game-development/?product_id=1500306&coupon_code=0AE463C0
As well as some other pretty good quality courses :
https://www.gamedev.tv/p/unreal-blueprint/?product_id=1500312&coupon_code=18428DF0
https://www.gamedev.tv/p/unrealmultiplayer/?product_id=1500305&coupon_code=13E22092
https://www.gamedev.tv/p/unrealvr/?product_id=1500316&coupon_code=0187CB32
Here's more info :
https://media.discordapp.net/attachments/781964357830705185/789205083803222067/unknown.png
Learn C++ from scratch and make your first 4 video games in Ureal Engine. The online course is created in collaboration with Epic Games
Learn visual scripting in Unreal Engine Blueprint dev course. Code your first game in 100 minutes. Created in collaboration with Epic Games
Learn online game development in C++. Created in collaboration w/ Epic Games. Use Unreal for online game dev. The course covers LAN, VPN, Steam & more.
Hmm they must have received a mega grant
yes they did several months ago
Ahh did not know that. Good for them! I love those guys.
hmm okay I will look at them, I would assume it's prob not a good idea to jump from not knowing how to use c++ in ue4 at all to programming client side replication right?
the screenshot at the bottom (which was an email they sent to people in the Unreal Academy thingy) was sent to me in December I think
Cool thanks for the info.
you should start with the C++ course and then the multiplayer one
the good news is that it's literally the course you were planning to buy
but in their own website instead of Udemy
great
I've been jumping around their multiplayer stuff and it's somewhat good but it lacks of use cases (and explaining what should go where and why)
they're always more focused on the very specific use case of the projects (which in this case will be a platformer puzzle game first then a racing game)
hmmm, i cant figure out how to get this Enum to work'
the multiplayer course also has several hours on stuff completely unrelated to multilpayer (making a platformer game's mechanics, and then making an advanced UI) the former is completely useless to anyone that followed their first course c++, the latter is okayish (still 90% useless)
Specifically?
does it teach about net relevancy? I've been told that's quite important for multiplayer optimization
No. Your best bet for that nitty gritty stuff is to do everything else first.
You won't be worrying about net relevancy until your game is up and running.
I assume it would be at the very end, I didn't finish it
I've done all of those courses. They are good but you won't learn even half the stuff you learn from this channel.
yup totally
they're okayish to get yourself started and have a footing but you will find yourself with a ton of holes in your knowledge sadly
For sure.
the official documentation being more dry than the Sahara in many instances you will end up in AnswerHub, here, or watching some very obscure tutorials from 2015 and trying to extrapolate out of their niche use case
I almost feel like it will be ineffecient to try to learn from video tutorials. I would like to know exactly what I need to implement and then how to. It feels like video tutorials can't really do that. Do you guys know of anywhere to get 1 on 1 lessons?
I press button, it casts to the gamestate, there it activates a server only RPC that does somthing to the Enum
it's basically a 1 on 1 lesson as you have homework and all
Where? You can't do a server only RPC from UI, it will need to be called from GameState or PlayerState or PlayerController or the character.
you should watch it in x2 speed, follow with them a little bit (or maybe not at all, depends on whether you think you know perfectly what they're talking about or not, if not better experiment yourself)
also perhaps try checking the pinned resources
the RPC is in the gamestate so when they cast it uses the RPC from there
Good. Then it should be working
The replicated array is of the Enum type you created. Your button press simply does an add to array and adds one of the cases you created.
Enum Type - Character Classes. Enum Cases - Warrior, Mage, Hunter, etc.
btw I wanted to ask for input on the structure of my board game, to make things somewhat short, I'm making a board game as a University Project, I suggested to make it with UE4 and the 4 other members of my team accepted and followed, however they're completely new to UE4 and never used it before, so I am building the structure of the game myself and rather let them fill in the gaps or improve functionality
Awesome. Good luck.
the game itself has to have an AI, we also decided to have it be playable in multiplayer to be able to think about the AI since we can't play it IRL, it's a game where each player has multiple pawns (usually 6) and plays up to (usually 2 or 3) times per turn, where they are allowed to play a card from their hand to advance one pawn of their selection to the next empty board cell with the same card type, or decide to make a pawn go backward until they find 1 or 2 pawns in a cell and then draw 1 or 2 cards respectively
the end goal is to get all of your pawns to the end of the board
here's an image I found online about the game
Right now I have the board cells (data) generation working in the background (being called by GameModeBase on InitGameState) and the board representation itself working with a board manager that spawns random pieces from a pool and then fills the marker spots (cells) from the data
I feel like this is a pretty good approach to it but I'm kind of lost on where should the cards and pawn data be kept
I thought initially that the cards should be stored in the player controller so that other players cannot see them even with a modded client (since they would be replicated to all clients if they are on a player state or a pawn)
but the pawns would be in the player state since all players can see them
but I'm totally lost on where I should make the data assignment and then where would I handle the spawning of the actual pawns
(and showing the cards)
If you never see the other player's cards until they flip one over, then technically you don't need them replicated at all besides the number of cards and you can keep all of the information in GameMode since it's guaranteed to be server only and dish it out as necessary.
I wouldn't worry about hacking/cheating that much though if you're just doing a student project.
You can always optimize it out with anti cheating later.
I don't want to get my teammates working on the wrong spot so I'm being extra cautious on where I should implement things
Well if they are new, I would start them out with things being easier than worrying about anti cheats. But either way, GameMode still makes sense if that's what you want.
Otherwise, stick it in GameState and let everyone know about it for ease of replication.
how would the player see their own cards? (if it's in gamemode)
Client RPC from the server to tell them what they have been dealt from the game mode
I see, and then keep the information without replicating?
Indeed
No one else needs to know until they Server RPC play this card
Then it simply plays the flip animation on a card and shows the card played
sounds pretty fair, however I'm also mostly confused on where I should be putting the initialization logic
should I call everything on the InitGameState (for data)?
Again in the GameMode. You can have it completely handle the cards and state of the game if you want it all server side.
Create a random deck and assign random cards to players there.
Then when you're done Client RPC each client their deck
where would the client RPC be? controller?
Could do it from the GameState or PlayerState
Controller works too
Just depends on how deep you want to go with it
I see
how about handling "turns"
and where would be a good place to start the game? begin play?
That sounds like a GameState variable. Everyone should know whose turn it is.
ah as easy as that
Other than that you can make the rest however you see fit. Alright, I'm really going to bed now. Gnight.
thanks a lot!
I'm going to keep this in mind, I will go sleep too it's 7:22 am here 😅 nighty night !
welp i am truely garbage at this lol
i am definetly not comfertable with Enums, never used it and its confusing alot...
My pawn's root component is a capsule component - it's not marked for replication, but should it be?
I'm not seeing any issues on movement, but if a block hits the actor, it kinda goes weird.
i.e. teleports the actor etc
Enums are really simple. Just think the word is mapped to an integer.
@rocky topaz I looked over those tutorial series you linked and the more advanced multiplayer ones are locked behind a paywall
@spark owl If you're semi comfortable with the editor, you will get a lot more mileage out of just trying stuff and reading. This is only my personal opinion, but I find tutorials largely a waste of time past getting used to the editor. They placate a lot of people into simply following them to implement systems and a lot of people don't really learn from them, they just use them to put stuff in a project. Ask that same person to understand why that system works and they usually have no idea, no conceptual grasp of it. It's different to implement something that someone else has come up with than it is to go through the steps of realizing why you need each component to work as it does. Tutorials also often follow the more university like structure that is meant to simplify everything. It's teaching you to learn how to learn, so to speak. They don't so much teach best practice or good usage scenarios a lot of the time. So paying for that is even worse. You can get the same information just googling and spending the same time reading, and that's free.
Would it be possible to use Boolean’s instead of the Enum tactic. I found that hard to get my head around
I'm trying to find out how to get started implementing client side replication into my project that is only BPs right now. Have no idea where to start
@spark owl you will find custom events are your life saver
sorry not replication prediction
derp
client side prediction
complicated networking stuff
its not that complicated, its exceptionally verbose in BP though
I just don't know where the hell to get started
For what kind of system? What are you trying to predict?
there should be plenty of resources on predictive movement
all prediction works on same principles
doesn't even have to be unreal related to give you a starting point
my game is a fast paced soccer game. When player releases kick button it is super delayed so I need to have the client predict the kick and then interpolate to server state
the halo GDC talk is also good to get a basic grasp of network
yeah, if there is physics involved, you're screwed
its not deterministic
Hmm I have tried this my self too
Is the ball driven by a PMC?
PMC?
Projectile Movement Component.
2 replays of exact same scenario = 2 different results
even if the impulse is the exact same?
yes
Yep. It’s annoying
and you have none of the tools for fine control in BP
rocket league does it no?
I did try once remove all the default replication and made my own replication physics on a ball once but blueprints is just naturally cursed with physics
funny thing is you'll need the ball to travel at different speeds on owning client/server/remote clients
to eat up the lag
yeah I could see how it might create issues but would it still not be better than massive input delay?
definitely go watch https://www.youtube.com/watch?v=h47zZrqjgLc
In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking.
Register for GDC: http://ubm.io/2gk5KTU
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://twitter.com/Official_GDC
GDC talks cover a range of developmental topics including game des...
Personally, input delay is better than bad prediction.
how does rocket league do it then? "fake" physics engine?
At least with input delay, you know you haven't kicked the ball yet and you can start adjusting your gameplay to account for it. Bad prediction is what breaks console game controllers because people see themselves kick the ball on their own screen, but on the server it never happens.
so is your general opinion that i'm fucked? there's no way to make it work well? There's gotta be a way right?
well what if I restarted the project as c++?
Personally, for soccer, I'd use a PMC actor over physics anyhow.
That's not the point :P
what is a PMC?
The point is that you need to know what you are doing to solve something like this.
Projectile Movement Component.
and very well
well shit where do i learn?
Tutorials, paid Tutoring, School, learning by doing.
Also that's nothing you will learn over a few days or weeks.
Some of us are here for years and wouldn't tackle that
So start smaller maybe
And give it time
Rocket League has a group of experienced programmers that are past the point of learning the basics and can adapt to solve a problem they are facing.
You are still learning and you don't even know all the tools available to you to tackle this
Don't want to discourage you, but this is most likely too much for the start if you have so many questions.
only way for it to be a harder/worse starting point would be if it was somehow a MMO ontop
"Boy, I don't even know how to tell you that you don't even know the things you don't know. You know?"
Yeah it's like trying to build a 120 room mansion while not knowing how to get a nail into a wall.
so there is no solution to the input delay then that is feasible?
that is far from your only problem, its only the one you see right now
there is a solution that is feasible, but it requires serious skills when physics is involved
would u be able to solve something like that?
yes, but i've been programming for 15 years
could I perhaps hire you to do it?
no
there is the other side of the problem
people who can solve that kind of a problem usually have their schedules full
I would imagine so
To be fair though, like I said before, sometimes it's less about "How" and more about "Can", or "Should". Input delay is there for a reason. Travel time. You can do stuff locally on the client but that doesn't mean it'll happen that way on the server, and it may give players a bad impression about what is happening in their game.
i don't even do freelancing to begin with, maybe Cedric can offer you extra insight into that
I don't touch that stuff anymore
I had my fair share of Network, Physics Clients and it's not worth the headache haha
One thing is though that this ball should not be a physics actor to begin with
You "can't" do multiplayer with actual simulated physics in UE4, unless Chaos offers a better solution
using the PMC is a valid idea. So one has to fake the bouncing and what not via vector math
PMC doesn't handle prediction though, only interpolation iirc
i tried the bouncing with thrown grenades in MP once via the PMC
it was... not pretty out of the box
I think one thing that isn't clear with the PMC is that you have to supply an interpolated component
So the mesh basically
If we ignore the fact that the grenade spawns delayed due to being replicated that is
Predicted Actor Spawning is something I would love to have solved engine-wide ;_;
Yeah, that's why UT does it ugly
"Spawn predicted local copy. Spawn Server copy. When Server copy replicates, somehow find the local copy and destroy it." or so. can't recall
Or they interpolate the local copy to the server location or stuff like that
if you make the engine think its loaded from package
it will pair the server copy to local copy
plenty of stuff can go to shit along the way though
Yeah you can spawn it on the Client and the Server and connect them to each other as long as they are stably named.
But you are not allowed to send any packages until that is fully setup
and if you do, they will never pair
net addressing will still work
but NetGUIDs won't get ack'ed
ActorChannel won't open
Hm. I know I'm doing that with Components that are spawned runtime, Probably different for Actors.
we spawn an entire level proceduraly on server/clients separately
then network it after the fact
but none of the Actors are allowed to replicate for a client before that client and the server finished the procedural generation completely
clients don't expect a scenario where they get a package for an Actor with static NetGUID that they don't have instantiated
@winged badger @thin stratus If I wanted to learn how these things are done and works (actors net pairing etc..), where would you recommend start to reading? NetDriver or Actor class?
first step is to understand the unreal docs for actor replication flow and net addressing completely
most of the relevant engine code is in UPackageMapClient iirc
Is there somewhere I could find someone to hire to implement a system like the one I need?
it seems very specific and difficult so I imagine I couldn't find someone to do it on fivver lol
Do you mean web documentation? (https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/Actors/ReplicationFlow/index.html). I don't have good experience with UE4 web documentation. I always find more information directly in the source code.
Gonna check, thank you 🙂
yes
its not super useful as web documentation, but its a great TODO list of things to understand before you go into something like this @finite kettle
Well, #hire-a-freelancer #hire-a-studio to check if someone is offering.
Or #freelance-jobs or so to look for someone with your own post
ok I will look through them. ty
My problem involve the replication part. I haven’t been able to get that right. Right now it works for the clients only
I can’t seem to replicate it across all clients without issue
At first I tried in the player controller and had no luck. Then I extended it too the game mode
That just got over complicated
I assume I need to just tell the server to update his Boolean and then he can update everyone else’s
@thin stratus how does one post a contract job?
ty
what are you trying to replicate @spring swift ?
GameMode doesn't replicate at all, and PCs replicate only to their owning client
so if you're trying to use either to replicate a state to simulated proxies, you're doomed to fail
lol yeah im beginning to see now haha
@thin stratus could I dm you and ask some more info about my problem? I'd like to show you the game privately and see if maybe there is something else I can do to improve the issue im having
No sorry, I have no time to provide that kind of help
ok
What might be a reason to get ESocketError::SE_ECONNRESET on my FSocket? I'm using FSockets on both my client and gameservers to communicate with a master server. I never had this issue on client side. But on my gameserves sometimes (I have no idea how or when) the FSocket disconnects with the above error code. I also never witnessed it happening during the middle/end of the game, it's always happening on the startup after I connect to the socket.
Anyone know where I can find an example for how to properly extend the new UCharacterMovementComponent shipped in 4.26? I made my changes using the new info at https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/CharacterMovementComponent/index.html, but I think I'm doing something incorrectly and I'm not sure where I'm going wrong.
Considering reverting back to my custom system, but I'd prefer to use the official method for forward compatibility in later engine versions.
Whats the error
hellow people 🙂
im new to unreal and working with BP.
i want to "ServerTravel" between different Levels using the CollabViewer template.. in the documentation they only explain how to change the default_loaded map.
but i have to jump through 5 levels with 2 VR-players.
if i use "open level" as i usualy did in single player the players open the new level alone.
since i watched this:
https://www.youtube.com/watch?v=s9OOq57CkxE&t=453s&ab_channel=ElliotYun
im pretty sure that i have to add some stuff in the "gameinstance" and the "playercontroller"
but i have literally no idea what and where exactly..
maybe someone can help?
Download Tutorial Project: https://goo.gl/QkFYqk
Can anyone tell me how to make an actor that interacts with a player affect only that player's specific variables, for example i have a number that increases each second while in a specific zone and that number to increase just for that one player that entered the zone? (I am very new to multiplayer, and barley know much)
the coupon code doesn't work anymore?
it's not?
I tried adding voice chat on a dedicated server but that doesn't work, do there are extra steps than this?
I also set these variables in the configs
DefaultEngine.ini
[Voice]
bEnabled=true
[OnlineSubsystem]
bHasVoiceEnabled=true
In DefaultGame.ini
[/Script/Engine.GameSession]
bRequiresPushToTalk=false
Hello, I've been reading about overlapping and applying damage on the server vs on the client and wanted to ask for some advice.
A method I frequently see recommended is to call overlaps on both clients and on the server. This way, the players get the most immediate feedback. In this method, if an enemy dies on the server and is already dead and hidden on the client, you can just destroy it quietly.
My question arises from a case I can imagine where the enemy is killed and hidden on the client but on the server, the player missed and so the enemy is actually still alive.
Is this a problem I should be wary of? I'd appreciate any advice on the subject.
Cheers.
You need to use an OSS (Online Subsystem) and get players to join the same session or the Unreal voice chat will not work.
e.g. see 3rd paragraph on here: https://couchlearn.com/the-easy-way-to-add-voice-chat-into-your-multiplayer-unreal-engine-4-game/
Death in PVP is almost always server authoritive, but clients will usually predict their shots and play hit effects etc locally. Many games trust clients to say when they hit someone so it feels responsive, and the server will do some basic checks to ensure the client is not claiming anything crazy/cheating.
Death in PvE may be different depending on your game.
hey, sorry for bothering you again (and/or thanks to anyone that would want to answer this) but I'm not sure about how I would implement a variable saying who's turn is it
should I make a map with player IDs defined by the server with a playerstate linked to it?
there is no 0, 1, 2, 3 counter for players in a multiplayer game as far as I've managed to find out
Thanks, noggs. So I should play the flashing red animation when an enemy is hit on a client but only kill them if they're reduced to 0hp on the server?
Yes that's a good place to start.
So I guess worst case scenario is that the enemy might flash red an extra time than they should be able to on the client while the server sees if they're dead, eh?
If the client predicts they have hit, but the server says no, then it will still look to the client like they hit them (and you flash them red or whatever) but no death would happen.
And players prefer that happening now and then to waiting for the server to tell them they hit?
I guess I'm just worried about giving immediate feedback on hits but then making the clients wait to see the enemy die.
But the session system is for listen server not dedicated server no?
Because you don't use the session nodes to join a dedicated server
Like I said, you need dedicated server to create a session and the clients join it. Otherwise voice won't work.
It's a limitation of the Unreal Voice chat system.
or you could try something like Vivox
which has its own concept of chat sessions
Do you have a resource about making the dedicated create a session and joining it with a client? Right now I always joined my dedicated server with the console command
are you C++ or BP btw?
I'm sure it can. You need to call CreateSession() when your dedicated server starts. In C++ we can override GameSession::RegisterServer() but I don't know where you should do it for BP.
Follow the example in that website I linked you
worst case you could put the call to CreateSession in your GameMode perhaps..
I've read on the unreal forum that the dedicated server creates a session automatically when it does the registration so it's not needed anymore
is that right... 🤔
You'll need to reload it in some way
Unreal used to have a %game=/path/to/gamemode URL option
Not sure if that still works
Overriding the game mode should be doable
Though you can simply have your player controller detect single player and switch to displaying the menu
According to that answer it looks like you need to add the CreateSession code to your custom GameSession C++ class. But the Advanced Session plugin looks like you can call CreateSession from BP when your dedicated server map starts. (add it to the gamemode or level bp for example)
hmm ok I'll give it a try
Then change your clients to load a 'front end' map, call Find Sessions and then Join Session etc
You have to setup either Null or Steam OSS for this to work
Yes I'll try that way, I was persuaded it was only required for listen server
if NULL then your clients / server must be on LAN
definitely doesn't work for dedicated without Session - I already went through this pain 🙂
Lan? isn't a local server? I'm uploading my dedicated server on AWS
oh.. you're gonna have a lot more pain then
😅
I couldn't find a way of joining a NULL OSS server session via IP address
You don't join with IPs when you have sessions
I ended up setting up Steam OSS which was a bit fiddly
making it work with linux dedicated servers in particular
Depending on your game/use case you might not even need sessions. It might only be the Unreal voice chat that needs sessions. I evaluated the built in chat and found it was... not good.
Yeah
Ok so using CreateSession in the gamemode is not worth a try?
There's a GameSession class designed to interface with sessions at the actor level
That's the easy bit - the hard bit is configuring the OSS you want to use and getting that to work.
e.g. are you using Steam for game distribution?
oh, in that case I don't know - maybe setting up Oculus OSS is easy 🤷
and maybe the Oculus voip is good too
In any case, if I understood correctly, this requires some c++ code
No, as I said if you use the Advanced Session plugin you can just call CreateSession from your dedicated server when it starts, all in BP.
I still didn't find how I would map players to some kind of player ID to implement a turn based system, any suggestions would be appreciated ;-;
PlayerState can hold an ID that game mode gives the player
then that's it, they are mapped
ah perfect, how do I know that ID?
You could use the steam id if you have steam @rocky topaz
Or assign some random id to a player, that is remembered
I want it to be easy to understand so like I could tell in the UI that it's player 1's turn
I guess it has to be implemented in the playerstate then
and then how would I get the controller of the player from the ID or the playerstate? I couldn't figure a way to get the controller
would GetOwner work?
Hey guys.
We are using AIMoveTo to move our AIs around. Turns out, having 50 AIs, we're suffering massive lag. I wonder - how would you improve that? I mean, the issue isn't moving the AI itself, but those AIs are following players that are moving all the time, so the server is replicating its rotation so often it lags.
One idea I had, probably far from being good, is to spawn these AI and replicate their Target only (the target is the player they'll follow.) instead the entire moving mechanism, and perhaps handle movement client-side only. It's important to emphasize that Player's movement is always being replicated, hence clients would know how to move AI.
At the time of reading or assigning the ID, you will know what player you're dealing with, right? Just remember it at that step
I keep a map of SteamIDs with their PC in the gamemode, personally
@potent cradle I'm thinking about doing it on InitGameState and I'm actually not sure that PlayerControllers are visible there
I use postlogon
when is that called?
the issue is that I need to make sure I'm iterating through the clients one by one
OnLogin would execute things whenever the client logs in right?
Right
is it called when a level is loaded?
Noggs is correct in suggesting Vivox. The built in voice chat for UE4 seems to be extremely undocumented and eats up game bandwidth, whereas there are multiple examples of how to implement and use spacial voice with Vivox, and it sends the traffic through their servers to free up bandwidth for your game.
Maybe one day they will sure up the UE4 VOIP system, but right now, it's lackluster from what I can tell.
Stupid question, but I'm new here: I have successfully compiled UE4 and used it to build a dedicated server. Clients can connect from within the LAN and from without. Life is currently good.
Now, when i make changes to my project and package it.... do I need to go back and build anything from Visual Studio again or is that generally a once off?
Yes maybe it's a better choice. I saw they are paying at some point, do you have an idea of the price?
5,000 Peak Concurrent Users or ~100,000 Monthly Active Users is still free.
So basically, free.
Very unlikely any indie dev will end up exceeding that, and if you do, you should pay them anyway 😉
I haven't finished implementing their SDK into my game, but so far the options and examples they have are thorough and very good.
Interesting, I'll give it a try. Thanks!
Am I assuming correctly that a textRender component in a character pawn needs to be set to replicate as well for it to display its text properly to other clients?
is there a multicast that runs on everybody BUT the owning client?
Lemme explain: I have a movement that is triggered by user input, I trigger an RPC and that triggers a multicast so everybody sees the change.
when there is lag, the user does the input but won't see the effect until the RPC arrives and the multicast returns, so I hotwire the effect immediately and then fire the RPC. Howeeeever the RPC then returns and the owning client repeats the effect again 😦
What is the correct approach to have the player see the immediate effect and then replicate it through the network for everybody BUT the owner user?
Just check if you're the owner inside the multicast.
Hey everyone,
does anyone know, why I can't read my player controllers after a seemless travel ?
Are you not getting any player controllers or just not the one you think it should be?
@open wadi when the players enter the lobby, their controller gets saved in an array. after the seemless travel, I tried using a logic with that array, but the values couldn't be read.
I'm using the get or find (dont remember which of the 2 it was) to get a specific controller from that array
I was having a similar issue, ended up doing a Print String with the name of the controller when first created in a level. I ended up discovering that the player controller was not the same from one level to the next.
Just bumping.
Im really new, so i have no clue if that is remotely what you are experiencing, but its worth a go.
it worked! ❤️
thx
It is my understanding, which could be wrong, that player controllers only exist for the duration of the level and a new one is created when you join a new map / level.
@open wadi yeah, my whole knowledge is like 3 months old
Thanks for that information
I think Game Instance persists AND is unique to each client, so you could try adding whatever information you want to that before connecting, then getting that information and reapplying it to the new controller upon BeginPlay -- but again, i am new.. so that may be the least efficient or MOST WRONG way to do it, lol.
Someone else more knowledgeable might want to intervene here in case i am giving incorrect advice.
Ok, when my players join the dedicated server, they can each see their name above their heads properly, but other clients see the TextRender's default "Name". What might I have overlooked?
Hey! Sorry for the late reply. Mostly just curious what the optimal way to do it is, particularly when it comes to corrections and whatnot. There seems to be quite a few new elements to extend. I'll keep figuring it out, though.
DM
what did you do to it (AI)?
What you mean?
i mean it just needs its movement component to replicate movement
and it works
client doesn't need to know much else
ue4 steam subsystem spacewar failed to create session, fixes? or do i gotta publish n pay 100
is their any game thats not cracked and using their own servers + steam subsystem, use steam subsystem spacewar?
Man oh man im getting close, i got all the replications so when boolean is true for client it sets server true and other clients true, so now i need the button to work with it
Do it like this.
- Press button
- Set Bool on Server
- OnRep Bool, update things
I did try that but the Player State cant talk back to the Widget, so im trying to get the widget to take the infomation from the playerstate
but even that isnt working well
it seems tho the widget refuses to grab any info from the player states
it will happily send info
Choose whether you want the master variable to live on the player controller or player state, and have one drive the other
What's the boolean, ready?
who can help? i have error with PlayFab when i try to build WindowsServer, all was good in VS2017 but now i have error
gsdk.h(77): error C2039: 'runtime_error': is not a member of 'std'
functional(31): note: see declaration of 'std'
\gsdk.h(78): error C2504: 'runtime_error': base class undefined
\gsdk.h(79): error C2039: 'runtime_error': is not a member of 'std'
\gsdk.h(79): error C3083: 'runtime_error': the symbol to the left of a '::' must be a type
Well, I guess I know that. But since these AIs are following players that are moving constantly, we're noticing massive lag when we have like 20-30 AIs
That said, I didn't want to replicate movement.
Are they following players that are constantly moving?
yes
🤔 what now
i did spend a lot of time optimizing the AI tho
reduce down the update frequency
only tick full speed when near players, that kinda stuff
Yep, we have it at 1... Although that quite addresses the problem, they look clunky when rotaating.
1 is terrible
What you mean by 'only tick full speed'?
oh we do a lot of optimizations
i can have 150 ai in the game only use 1ms game time
if they are off screen
hm, gotcha - i believe if you have 150 on screen, then the scenario changes right? with 4 players connected and all...
uhum, gotcha - yeah, we don't have fow
and it's a zombie game so we expect to have lots of them on screen...
perhaps some gameplay changes are required
yeah but in my little pet zombie game
4 player, i have 100 zombies
and no issues
tho i cap to only 60 max in the level at once
i have had 100 for testing
so what lag are you getting? is it game lag or networking lag?, Listen server or dedicated server?
have you ran the profilers? used Insights?
How are you doing your fog of war? Line Trace style or grid style or what?
Traces
How many traces per frame do you end up running? I'm using line traces too, I had worked on a algorithm that helps tear down the amount of traces but it ended up being too unwieldy for design when the alternative is just to slam traces out and see what they hit
think its 100, but i am not sure, @tawny kernel we-wrote it
Oh that's pretty small. You must be doing some sort of optimizations on your Trace count or do you only have one vision viewpoint?
do you run your traces off-thread?
Right now I'm prototyping and run like 1,000 in thread and blueprint LOL
:/
, but yes, it'll eventually be moved to a subsystem and probably be threaded.
Even a thousand per frame in blueprint it doesn't even blink at
yeah, we do most of the calculations and traces offthread
AsyncTrace is ran off-thread
const bool bRunAsyncTraceOnWorkerThread = !!AsyncTraceCVars::RunAsyncTraceOnWorkerThread && FApp::ShouldUseThreadingForPerformance();
Yeah I'll definitely look into it if I end up needing to come up with some performance. I'm still brainstorming on how I'm going to actually use the data, this is where I'm at so far.
For gameplay purposes I do an edge crossing count to check if something is within any polygon or not
@dark edge we do a significant amount of blur
so we don't need razor sharp edges for fow
You might like the trick that I came across last night, I was having trouble getting my blur to look good on the render target,
we have a kernel blur array, basically this
TArray<float> USolsticeUtilityLibrary::CalculateBlurKernel(int32 NumberOfElements, float CurveParameter)
{
TArray<float> BlurKernel;
float Sum = 0.f;
const float e = 2.71828f;
for (int32 i = 0; i < NumberOfElements; i++)
{
float Element = FMath::Pow(e, (i * i) / (-2.f * CurveParameter * CurveParameter));
i == 0 ? Sum += Element : Sum += Element * 2.f;
BlurKernel.Add(Element);
}
for (float& Element : BlurKernel)
{
Element /= Sum;
}
return BlurKernel;
}
coming to a sum of 1
It basically uses two render targets. Each frame, Target two is copying into Target one with some decay, visibility triangles are drawn to Target one, and then Target one is blurred into copy two. Has the effect of the blur spreading out over a couple frames to get nice and soft.
so if a... texel is visible it adds the middle (highest member to its own alpha)
and 7 lower value elements for 7 texels to its left and right
then we do the same thing vertically
and multiply the 2
then apply the PP blur ontop
its trivial
PlayerState
@winged badger how do you do a vision lookup for gameplay?
you have controller and PS there (via controller)
and parent spawns the pawn
parent call of HanbdleStartingNewPlayer
its a BlueprintNativeEvent
we have actors(components) that can pierce fog of war
the worker threads throw traces for them, construct a smaller texture for that particular actor
then another worker pieces bunch of partial textures together for final RT
Do you use the fog of war data for gameplay purposes at all or just for visualization? I guess what I'm getting at is, is checking if something is visible a check versus polygons or a check versus pixels? On the cpu, not for rendering
you would never allow gamemode to assign the red team to 5th player to start with
your higher level system should limit the game to 8 players
then some RPCs fly around, GameMode has to approve of the player's selection
say 6 players join, and you have 2 spare spots, when the game starts, you can spawn 2 bots to fill the spaces.
How do you check if a monster is visible or not? Position versus pixel or position versus polygons?
GameMode will make sure the teams are balanced.
players get spawned in HandleStartingNewPlayer.
its fow component can access the fow manager/RT
which can translate the world position to pixel value on RT
MatchStarted != HandleStartingNewPlayer
I thought getting pixel data from render Target was slow as hell.
think of HandleStartingNewPlayer as a point in the game setup where engine spawns the pawn for that player
we cache it
we stash it into an array we can read easily when RT updates
No I think about it, I better not even bark up this tree because I remember that I only draw the render Target for the local player, so the true authoritative and complete source of vision data is the polygons.
for example, we have an RT, which maps buildings (for adjusting atmosphere/lights/etc)
if (MapTextureRT)
{
const int32 OffsetX = static_cast<int32>((HelperVector.X / static_cast<float>(LevelSizeX)) * MapTextureRT->SizeX);
const int32 OffsetY = static_cast<int32>((HelperVector.Y / static_cast<float>(LevelSizeY)) * MapTextureRT->SizeY) * MapTextureRT->SizeX;
const int32 Index = OffsetX + OffsetY;
if (InsideBuildingArray.Num() >= (Index + 1) && (Index + 1) >= 0)
{
return InsideBuildingArray[Index];
}
return 0;
}```
our fow managers operate independently on each machine
we just do a simple look up like this
same as minimap
no replication whatsoever tied into that system
if something is supposed to be shown or be affecting fow
it will be a networked actor
that has components to hook into fow/minimap
Yeah I understand all that and my system is probably very similar. I'm just kind of mind-blowing that you happen to use the text or data for gameplay purposes without running into blocking issues. Last time I looked into it, it was a gigantic pain in the ass to get the render Target data into the CPU for gameplay. But it's an honest you, I'm keeping my polygons as the gameplay vision data anyway.
its not really that hard
Wouldn't y'all's system be a no-go on a dedicated server? Or would you use geometry in that case
its would run pretty much the same on dedi
im trying to make this montage first play till the end on server, and then on client. What am i doing wrong? Do i have to send it to playercontroller?
except dedi wouldn't run fow calculations at all
@silent frost what is FunderBP?
is it owned by the player?
if not then you can't use Server/Client RPC's
if its replicated, you can use a multicast
okay, but its spawned before the player joins
then you need to delay it, or handle that.
but i don't get what you are doing tho
BeginPlay is called on Client and Server
so why the gate?
well, the thing is i want the animation of it to be in sync between server and client
well the plan was to start each loop with a note from the server
it doesnt have to be perfect
Any way to start an animation on the client side, from the server
its fine of its not perfect
Its supposed to be this huge pumpjack, which is animated in a loop, the players can jump up on, and the collision is handled fine by the server, but the player sees the animation from when he or she joined the server
so the animation will be completely out of sync, with the collision handled by the server.
You can probably have a float representing phase or time and have that drive the pose
Can you manually insert time into an animation in animbp?
or get the animation start position from the server?
No that'll never stay in sync, frame rate differences or slight timing differences will accumulate
oh yea
yeah that stuff is a pain
I don't know the whole time about animations but can't you just plug time into a clip manually?
we use a system to sync montages, using a catchup
but its not perfect, but pretty close, but its only really doable in C++
If you can't manually insert time into animation, f it, make a blend space with four poses
well, my game is pretty chunky, so for now im not going for perfect. But manually inserting time, in the blueprint, would mean the cvlient gets its framerate from the server somehow, on that animation?
and call the pose from the server?
but yea that sounds easier
Not frame rate, time in animation.
However you do it, have one float driving the animation on both sides.
Think of it as crankshaft angle.
and then call, an event from the server to go from one pose to the next
Or just skip the animations, rotate the crank, and ik the rest
No no no. The data going from server to client is just one number, representing how far into the loop it is.
yea, i did it in blender, and exported the animated fbx, but should probably have done it in ue4 to begin with?
There's a million ways to skin a cat,
oh, so when it joins, it gets this number
oh its constaly updated
Thank you, this makes so much sense
Yes it's just a replicated float.or you can just have a motion replicating scene component that spins, however you want to do it.
So i figured out how to drive the animation by time.
From where can i cast to the animgraph?
From the character mesh that uses the animation blueprint.
Character > Mesh > Get Anim Instance > Cast to your animBP
I still can't figure out how to replicate pausing a montage. The montage plays on all clients just fine, but then I try to pause it using the same logic and doesn't work. Works on the server, not the clients.
Been messing up my project trying to get it to work and now I only have created some more issues and will need to revert back, but want to figure out how to get them to pause before I revert my project and implement it.
I really thought this would be basic. Montage multicasts to client, which is called by the montage server event. I then have notifys that are handled by the server only. Certain notifys may trigger the montage to pause. Still running on the server, I then multicast the montage pause, but it doesn't work.
Got it working now. I guess I can't save the anim instance to a variable to use later? Wasn't getting any errors, but decided to "get anim instance" from the mesh when calling pause montage. Suddenly started working. Now to fix what I messed up, or revert project a few days.
Actors placed into a level run their begin play for server and all clients automatically when game is started?
I guess I can just print string on begin play to test, haha. And it does do both server and clients, cool. Thought I might have needed to multicast some variable sets there when I was having the montage pause problems, lol.
Why do I get no prints for Melee when I run with dedicated server? Uses the same Hit Event as Projectiles, but you can see those prints show up. Melee works fine with multiplayer when using a listen server though. Edit: Notice the awesome montage pause at the 27 second mark, which works great now, even with dedicated server. 😁
does Repnotify basically only replicate variables once they are changed? so in other words if a variable doesn't change for a long time it won't spend any proccessing/networking power replicating it?
It will always be checked but not replicated if it's not changed.
That is any replicated property not just repnotify
so what is the purpose of repnotify then? is it to connect custom events so when the variable changes it will call whatever custom event you connect to it
is there any decrease of bandwith usage by using repnotify?
The point of RepNotify is to have a function called whenever a replicated variable changes. It has nothing to do with bandwidth.
Replicated variables already aren't sent if they don't change.
Looks like I have to have this set to also refresh bones in the mesh:
Or more like this, since I need to set it dynamically from a component.
Hi! It is possible to host a lobby in a player and if that player leaves transfer the control to another?
how can i do crossplay in my game? @here
I can't find any detailed tutorials
I doubt there are any detailed tutorials. Also please don't try to tag every one in this channel or similar :P
That's HostMigration. There is a plugin on the Marketplace, but I can't comment on it being a proper solution or just some bad hack.
By default, it's not supported by UE4 and I would assume it requires a lot of engine changes to actually do it right.
Isn't that works by default?
I think he means online crossplay
Thanks! I'll find out!
Depends on what you mean with Online Crossplay
Generally speaking, nothing really stops you from connecting to a PC hosted Server with a Console.
But most subsystems are per platform
@thin stratus do u know if it is possible to combine this plugin (host migration) with epic online services?
So if you want true crossplatform play, you need a Subsystem that supports comminucating between all of them
No, I do not.
I have not used that Plugin
Neither do I believe that it's a feasible solution
You would need to research a bit, how that Plugin actually implements it
So that it's not just closing the connection and before that sending a huge save file across the net
Cause that's not really a good idea :D
Is it possible to get the number of players online and hosted sessions? I'm currently using AdvancedSessions plugin and displaying this info on the main menu would be helpful.
Alright, I'll give that a try. Cheers.
You could just sum the amount of players on the servers you find through your server browser logic
Given there is a limit on how many you can find and they are sometimes even regionlocked, that would help much :<
Hello everyone,
When I try to grab the "old PC" after the event on swap player controllers, I don't seem to be able to extarct any readable information or to communicate with it.
Does anyone know why ?
Agreed, yes. Suboptimal solution.
It's something, but not ideal by a long shot
That's what the plugin actually does 😄
It sends a huge save?
It sends everything what you mark as Savable
Author of the plugin creates some kind of "Savable" interface, where you can define how should actor data be saved/loaded. Then the plugin serialize these data and send it to the new host basically.
I explain it a little simplely, but it's basically like this
But plugin does not send the data over Unreal networking layer. It uses Steam/EOS/any kind of socket connection (you can specify which one you want use - dont know all options available) and sends data directly over the socket
@rocky topaz I don't have that on my screen it says enroll for $195
Heelo guys. There is a way to make a OnRep(repnotify) function holding two variables? I mean, the function is called when 2 variables change, instead of one.
@viscid escarp Move the two variables to a struct.
you're sure it didn't remove the coupon after you logged in?
try logging in then opening the link again
Udemy ?
It's probably the animation is not playing on the server. See this post for a fix: https://answers.unrealengine.com/questions/49935/does-animmontage-play-on-a-dedicated-server-for-th.html
I just opened it in a private tab (no cookies/account signed in whatsoever) and it says free for me
oh shit
that linked made it work
i guess the coupon code wasn't applied
ty so much
herp derp 😄
the links for the other 3 free courses can be found here #multiplayer message
bool AHVS_ItemPickup::IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer)
{
Super::IsReplicationPausedForConnection(ConnectionOwnerNetViewer);
return true;
}
this doesn't do anything?
i'm returning true, but the actor is still visible
Shouldn't the actor stop being visible if its not replicating?
Hello, I need to override the class IPConnection, do you know how can I do from a plugin?
None of these work
I want my actors to not be sent to clients
based on criteria
like if a player is hidden behind a wall, other players shouldn't see us.
...
Ok so I have 2 tick functions
one changes spring arm length depending on the velocity
the other one traces and if hits obstacle it draws an outline
in offline mode it works fine
no lag
nothing
but in multiplayer the client's sprint arm starts lagging
any help?
Not using Replication Graph are you?
If so, none of that per-actor stuff works
Was definitely playing on the server the whole time, just had to change this option from "Always Tick Pose" to "Always Tick Pose and Refresh Bones": #multiplayer message
I hate it when it is something simple like that. I tore apart my project thinking my code was wrong, but it was correct and just needed that setting.
Trouble is though anims are super expensive to evaluate and dedicated servers are usually single-threaded, so you gotta have a real good reason to enable it
My advice is don't tie gameplay to animations - especially since server-side they won't be in sync anyway
i thought notifies fire on dedicated server?
as in it runs the montage, but does not update things?
So to follow up from yesterday. I have this big oil pump, that the players can jump on. I need it to replicate movement, and the animation, so its in sync. I fixed it so, the animation is run by a float controlled by the server. And it works! but now my collision seems not to work, not even for server player. Any ideas what this could be?
I disabled Net Load on client, could this be a reason?
the collision is handled in the physics tab
Has anyone followed the Amazon Gamelift Tutorial in the pinned messages? It's pretty long (which is perfect) so I just want to know if it's worth it really?
@chrome bay nope
iirc you don't need the repgraph for isnetrelevantfor checks
I mean... I'm implementing custom relevancy behaviours and yet I am not using the rep graph
sorry was this for me?
no
ok sorry
im not using rep graph anyways lol
i dont need that
im trying to implement line of sight network relevancy checks
to combat wall hacking
I wouldn't bother in all honesty, it never really works very well in practice
You get other problems like, not being able to hear footsteps, not seeing shadows
Players suddenly "appearing" long after leaving walls etc.
net relevancy isn't usually responsive enough
It is for melee hit testing. Collision boxes are attached to the hands and if they don't move on the server, then the trace doesn't move as well. Is there a better way to set this up?
Basically just remove collision/animation from the equation entirely - and do queries based on timers
It usually feels a lot better that way too
Because another issue you might have, is if the server is only running at 20 ticks, it might not be enough timesteps to even get collision to register a hit
Just do a query in front of the player, which is timed to line up with the animation time
That way it's totally separate to the visuals, and you can tune it however you like
I need it to be very accurate hit detection. This needs to know which bone it hits.
So I need to know the path of the actual hand as it moves to hit a player.
Framerate is no problem, since it adjusts start/end based on previous and current transforms.
I mean you could hardcode that as well
Technically, yeah, but then hardcode that for infinite number of attack animations?
@chrome bay im not willing to allow potential cheating to exist lol
I am making an asset that is meant to be easy to use and universal for any skeleton.
Can't hardcode anything in it
It's more of a design thing at this point, but I wouldn't rely on animated collision boxes to do melee myself
It will exist anyway, there's no getting away from it. It's better to have a good experience for the 99% of players than make it worse on account of the 1%
Would it be better if I set that option only when it is needed? Only when the attack montage is playing.
I mean of course it would be better, haha, right?
@chrome bay but ur solution is to do nothing
and thats just not true
league of legends has no wall hacking
because they dont send data to players who are not within the fog of war area of another player
the server literally wont send data to u
Right but that's not the same as a LOS test in an FPS game
And not forgetting, LOL isn't a UE4 game either
A fog of war for a top-down game would totally make sense
What is the actual use-case here? A first-person shooter?
Any idea why this would be adding a different array element than the one that is being removed?
Or something else?
A 3rd person shooter
But not really a shooter
point is, I want to know why the following functions make no visual changes:
IsNetRelevantFor
IsReplicationPausedForConnection
Do I need to manually use OnReplicationPausedChanged
to set something as visible or not visible
but thats not the same as "not sending it"
Now if we can only "Pause" replication, then that would mean that the player would get no movement updates. However, the player would still be able to know the last known location that that player was last replicated at. For that client.
Well another thing is network relevancy takes about 5 seconds to kick in
The server won't destroy it instantly, because otherwise objects near the edge of relevancy range would be destroyed/recreated constantly and it would hammer the network
And I assume of course you haven't checked the "Always Relevant" checkbox
Time is a secondary problem if I cannot even get it to destroy it at all
Just drop a breakpoint in and see I guess
it runs fine
it fires the breakpoint
Step 1. Make an actor
Step 2. implement IsReplicationPausedForConnection
Step 3. Click play
if you do this on a character, the actor just won't replicate
but if something was replicated, and then we stop replicating it
it wont be destroyed
Was that actor placed in the world or spawned at runtime?
Placed
ah yeah, that's why
Placed actors don't get destroyed by relevancy
The actor channel closes down
But the actor remains
Got a question about replication graph. Is it something I should be designing around as early as possible, or can I implement it at a later stage when necessary? Kinda wanna hit a public release with the default just to get some test feedback, then properly look into rep graph to improve performance once I get a larger actor count in (if it's necessary, based on performance goals).
can def do it later
Awesome, that's good to hear! I would look into it right away, but it's time I should likely be putting into actually getting a public build out 😂 .
Hi, I am Trying to make a Countdown Timer using OnRep notify but the function is not executing: void ATPSGameState::OnRep_TimeLeft() { OnCountdown.Broadcast(TimeLeft); GEngine->AddOnScreenDebugMessage(-1,50.0f,FColor::Blue,TEXT("OnRep")); }
I Modify the Time variable inside GameMode
but the variable exits in GameState so it can be replicated
further more i did Kill Count exactly the same way and it works perfectly
only difference is kill count is an int32 and TimeLeft a float
Hello. The node "Set Absolute" seems to be automatically replicated.
Is there a way to disable automatic replication on certain nodes because the "Set Hidden in-game node" does the exact same thing. I'd like to do things locally ONLY, but as soon as these nodes are fired on the server, they are replicated to all clients when the actor has replication enabled. How can I set actors hidden on or change absolute transforms on clients only? https://gyazo.com/b07f9cb19a5315c8f63acc8909d28c7c
@void nest it's not the node that's replicated, it's the properties it sets
You could workaround it in C++ by disabling replication of those properties, but not in BP unfortunately
Well yes, I figured that, didn't explain it correctly. How can I disabled said properties would be the proper question I guess.
Yeah, that's what I thought, But wanted to check if there was an easier way.
Kinda sad that these properties are always force replicated. Not sure why that is, it's very important to be able to do things on the clients only IMO.
Assuming you don't need anything else on the component to replicate (and if it's not created at runtime), you can just turn off replication of the component
Otherwise, you'd have to make a subclass of that component, then override GetLifetimeReplicatedProps and use the DISABLE_REPLICATED_PRIVATE_PROPERTY() macro
I do need many replicated variables and states on the components in question though so turning it off is not an option sadly.
Ok thanks that sounds like an idea!
yeah ok in that case you'd have to subclass it and disable those properties explicitly, then use that custom component instead
Yeah. For now though I'll just disable the system on hosts. It's a culling system for optimisation, on dedicated servers it must be disabled anyway as there is no distance checking or anything. The only downside is it won't work on client hosted servers, but that's fine as we mainly run the game on dedicated servers. Thanks for the info anyway! 🙂
hey everyone i just set up EOS a few days ago and when testing P2P...I move faster than the other person when i am the client and the other person is the host...But when I am the server and he is the client he moves slower...Is movement based on a tick rate? Is it because my computer is faster than his? Can someone please give me tips
Hey guys, i've got a problem in 4.25.4.
I've got a 2players, listen server game that i want to test.
When i try to set Play Net Mode as "Play As Client", Number of Players : 2 and Run Under One Process unchecked, my client window is opened before my server window which means the client won't be able to connect and i won't be able to test anything.
I would expect the server to open first, then the client on which i would have control since this is how it worked on previous version.
Am i doing something wrong or is it just a pain to test multiplayer in 4.25.4 ?
Hey all!
My UI is only spawning on my server player, and not on any clients. Also doesn't run if I play with dedicated server check.
The above is called on the controller.
Obviously the UI code isn't firing. I've been trying to correct this issue for a couple weeks without success, googled the heck out of it, no dice. Does anyone have any ideas?
possess is server-only, you can make client rpc to call ui activation on client from it
Ah okay so literally just a custom event node that only runs on client, have '
On Possess' call that?
yeah, try it.
Yeah now I'm not getting the UI on client or server
My apologies, I get it on the server but still not the client
What is the UI for?
It's likely that there's a client side way to have the client add it with no extra replication.
The UI is just the normal game UI like... shows health, etc
Here's the code at this point
hey everyone i just set up EOS a few days ago and when testing P2P...I move faster than the other person when i am the client and the other person is the host...But when I am the server and he is the client he moves slower...Is movement based on a tick rate? Is it because my computer is faster than his? Can someone please give me tips
does it fail on client on cast because getpawn is null ?
Hmm looks like it
@violet sentinel I put a check in to see if the cast fails both characters and it does on the client, but works fine on the server. So it does fail on the client because the cast fails
Sounds like your RPC reaches the client before the replication of the Pawn in the player controller. You should make certain with an actual IsValid check.
I mean if you wanted a dirty solution, you could just check the PlayerPawn0 in the local client's HUD's tick or a few times a second on a timer. If valid, put up the correct HUD once, then remove it if it ever becomes invalid. 🤷♂️ Quite likely a better way though.
So I'm doing an IsValid on the player pawn... and yeah it's not valid for clients, but IS valid for the server
yeah, possible. let Client_AddUI call SetTimer on client that checks for GameState and Pawn validity to ensure they're replicated on client then shows UI
I made own native events firing from OnRep_Pawn to track it on client but it is not for default blueprints.
dirty but works 😄
Hello everyone, we are currently developping a multiplayer online game for a school project. The maximum number of online simultaneous players would be 8.
We are currently looking for a free solution to deploy a online dedicated server. We were wondering if it was necessary to use the gaming web services (ex: gamelift, prefab) or if it was possible to use normal remote VM's like AWS EC2, Heroku, etc...
Also we heard that cloud services often had hidden fee's linked to usage. We were wondering if the development of 8 player multiplayer game would result in high fees from these cloud services.
Thank you 🙂
Wow okay... I put on a delay and now it works
So it sounds like this is exactly what was happening
Huh.... Well now there's a separate issue.
If I play on the server, select my character, the UI shows up. If I play on the client AFTER the server has chosen his character, the UI also shows up.
But if I don't select my character on the server FIRST, the UI doesn't show up for the client.
@kindred widget @violet sentinel The heck is going on now...?
I'm trying to throw something independently without replication, and set the network setting only "relevant to owner" however it works fine when it execute once, but when there is timer to loop multiple times, client see client, server see clients, BUT clients don't see server!
@rocky topaz here is the same question 😄
ah
I mean i can use it multiple time when there is no timer, but when there is timer clients can't see server
so @mild forge @fallow quail I might recommend you using Spatial OS (but it comes with it's own Netowkring stack completely) or you can use the google cloud free trial
is waiting for replication timer correctly set?
are you sure however that you need hosting for a school project? maybe your school can provide that for you
You can use any cloud VM to host your server, no requirement for gamelift etc. If your server is modest in requirements then maybe you will pay ~$25 per month.
If you provision a larger instance and keep it running 24/7 then costs will go up of course 🙂
AWS has 'hidden' costs (pay seperately for all the services you use, bandwidth, etc, etc) but a plain VM at another host should be all inclusive.
Thanks and yes hosting is required! We are looking at many options
Nice thanks @silent valley
depending on how demanding your dedicated server is, you might even get away with a shared VPS for 5$ per month or less
Hi everyone. I am not grasping something multiplayer/replication related and need some hints/suggestions on what to look into:
- Dedicated server, clients have a log in level where they select their name and then enter the IP to connect to.
- Each client successfully logs into the dedicated server map and "remembers" their chosen name properly.
- Each Character Pawn has a TextRender over their model that shows their name correctly to themselves.
- HOWEVER, it also show every other character having the same name as their own when it NEEDS to show the other character's name.
I am certain there is something simple I am overlooking and others when learning tripped over this as well. What is common/likely reasons you can think of that I can look into?
Thanks.
make sure you replicate the variable that hold the player names
also how do you know which player is which? do you get their unique id?
player controller hold each player unique id and when you change map it stay true for the player
so you can always keep track of their name
Ooo Thanks. Those look useful and I missed noticing they existed. Thank you.
though you always save their names in the GameInstance, the rest of stuff in GameMode, including it self will be reset every time you change map/lobby
Yeah i discovered player controllers, player pawns, etc were re-created each time I changed levels/reset, etc.
I Am currently saving their names to game instance when i hit the connect button, then putting it on the player state once its created (currently). I am unsure whether Player State, Player Controller, or Player Character is best place to put that atm. Since Text Render is on Character.. maybe I ought to be storing it there instead.
Player State is the best place
so other players can access to it if you need it in some point in your game, e.g. keeping scores/achievements
@open wadi
Thank you.
I thought getting the dedicated server up and running, plus players connecting properly was hard.
Turns out grasping the basics of just showing a nameplate properly is harder for me, lol
they explain the game unreal framework very well.
Thanks i will read that. I dont want people doing the stuff for me, i wont learn that way.. but this has kept me busy for two days now trying to get it right. I will definitely read it now
yeah, sure, it's 30min video
it will be worth the time. thanks again
U can use 2d widget nameplate instead of textrender
@celest sleet and I have been working on networking for our VR game for over a month now and despite everything we've tried online, it is still not working. Is anyone able to talk with us for an hour or so and help us get it working? It's super close, but when a player joins the host, they aren't able to control their possessed pawn, no matter what we do. We're willing to pay $30 if someone can get it working.
I'll read up on that as well. Thank you.
👍
if client possesses pawn then is inputmode set correctly on client?
I read online that input mode defaults to game only, and as there is no gui, I think that is what we want
Am I wrong in my understanding in how inputmode works
My server executes a function that spawns an actor in the hand of a character. All the clients can see the actor that was spawned but the server cannot see it.
Anyone might have an idea of whats going on?
I did some tinkering and it spawns the actor but the server does not attach it to the component I want. but the client's do.
Is there a reason for this? and How can I go about fixing this?
So anytime I want a global sound, I have to tell the server to play that sound?
?
Hey, has anyone here implemented deterministic rollback in Unreal Engine before?
I have a fairly substantial budget but want to work with someone who has done this before.
P2P isn't natively supported in UE4. + Also, yes.
@long grail is it possible to wait for chaos?
What is Chaos
The new physics engine of UE4 that enables deterministic rollbacking
now... that has yet to come to the engine
is there a way to test a dedicated server so u dont have to pay for one? development only...looking for just 2 players
since the current version of chaos is still in diapers
Whats the ETA on Chaos? Development for this would start in march or april
TBA I believe, I'm still waiting for substepping to be a thing
for the time being I'm using physx
yes, you can host the server on your own
I don't see anything about it being deterministic
that's the thing, they are working on it
ah
so i am having this issue...Where if i am the client i move like 10000mph...if my friend is the client he moves super slow...I have a better spec'd machine and better internet..I get 300mbps internet he gets like 20mbps internet...anyone have an explanation as to why this is?
but yeah, it will work along a prediction system that will count with a rewind functionality where you can get deterministic rollback
which is I believe what you want
but as you saw I didn't mention "deterministic physics" anywhere
can someone please read what i wrote
patience, lil padawan
what
are you using characters? or what are you using?
client authorative physics I suppose?
wdym p2p? have you modified the engine to support p2p?
I don't want deterministic physics tbh, but appreciate the thought
just in case :) so we are aligned
i am using EOSCore plugin...hmmm..i didnt know i had to modify the engine to support p2p
Ahhh then you'd probably get a better answer in #epic-online-services
because honestly, I don't know if you do use the normal rpc/replicated variables system of vanila UE4
or something else
if you are using rpc's and client authorative physics it can happen because your clients run at a different FPSs
and I assume you aren't running your physics with substepping enabled
therefore the physics simulation will run slower when you have less fps's
guys i linked my fucking github to UE4 and I am still getting 404 not found when i try to download ue4 source to set up dedicated server
How can an actor cast to the correct player state to access a variable?
I'm trying to detect which team a player is on when it overlaps with an actor in the level
You can get a pawn's player state and cast to your PS class to get any info you need
If im not mistaken you should be able to directly access that by getting player state from your pawn reference
ah.. I was attempting to get it from the overlapping Player controller
are you saying you can get the player state from the On Component Begin Overlap node?
you can cast the other actor to your pawn class, then from that pawn get the player state
I'm starting to wonder if I'm setting this up correctly. I'm storing which team each player is on in the PlayerState. Is this correct?
Yeah storing it here makes sense
yeah I've been following that
So for a simple approach on what you do, if you cast to your Pawn class after the overlap you can get player state, cast to your player state class and get the team
It's a great overview but specific steps are round elsewhere
So.. leave out the player controller entirely from this step?
perfect guys.. that worked.. Thanks a lot
Is there a way to make it so :
Player 1 Host a Game
Player 2 Joins the lobby
If player 1 alt tab the game, the other players doesn't lag
I'm not currently looking to get a server
Hi all, is there a way to limit the number of players a server can allow to join?
either limit numpublic connections when creating session or in gamemode's prelogin