#multiplayer
1 messages Β· Page 296 of 1
It's not a matter of just using some fancy replication functions or variables. It's an entirely different wy of thinking of how to program
You have 3 possibilities. Server, Owning Client, All Other Clients. And you have to keep all three of those in mind while you program otherwise things are happening or not happening in all sort of crazy ways you'll never expect when you start "converting" and you'll end up with a spaghetti mess before ya know it
tbh my game is already a spaghetti mess
but I'll probably leave multiplayer for a later date
/game
hehe.. that's another thing I learned on this project (besides "multiplayer makes things harder") - keep the spaghetti under control (else even for a really small scope project it makes things hard to deal with near the end). I had used quite a lot of shared functions and macros which helped a lot, but on the new project I'm using collapsed nodes all the time as well, so you can just read event graphs at a glance, and commenting better.
My personal opinion is that single player is just a listen server... so it's best to just make the multiplayer way of doing things the norm. I am retarded though so ymmv
This is actually correct, but only if you have a listenserver setup. If multiplayer is handled with a dedicated one it's not working anymore. Also you may want to still keep singleplayer and multiplayer separated. Less bugs to deal with i guess.
is there anything special we are meant to do, to make the -nosteam launch option work?
if I stick that switch in, it still uses Steam like a boss
for now I'm just editing my config file manually to use SubsystemNull, but it'd be more convenient if that -nosteam option worked
I always avoid having single player just being a listen server. It can cause a lot of problems
Better to use a new gamemode and have it be void of networking. Unless you want co-op
then
that is a totally different story
one I plan on covering in my guide
I'm just planning on implementing coop
But eh
if it becomes too hard then I might just not bother. I'll investigate it at a later date once I've made singleplayer somewhat better
really basic question about multiplayer and replication. say i make a simple function to increase character speed, and there's no acceleration. as soon as you increase by X amount your character moves at that speed. in a single player game this would be smooth obviously. but in a multiplayer game, if you have the server increase the speed, would you notice the delay from pressing the button to seeing the speed increase?
and how do you mitigate that? do you just set it as the player first and then immediately set it as the server so if you go over the limit by the server, it auto corrects?
@Minimpoun#3100 problem with root motions? Why? I'm using it, working fine
@wintry flower well, this is actually a basic/non-basic question. I found that this: http://gabrielgambetta.com/fpm1.html
Helps a lot.
(And it's basically what UE4 does, behind the scenes).
So, in essence, you usually apply the speed increase at the client, and replicate it to the server.
The server processes the speed increase itself and compares the result to what the client sent, if it's within tolerance, there's no correction.
guys I can't find anywhere information about sessions... Are they Lan only? Can I host a session from home, and another friend from a city join it? Also if he can join it, do I have to keep track of hosted sessions somewhere to make my friend connect to that data source and pull all hosted sessions?
+kyojin are you using steam?
@magic gazelle i assume if you are using steam it provides this functionality, for my android game i maintain my own server list with a web service
@magic gazelle fyi there are a few different solutions to this problem on the unreal marketplace
Back to yesterday conversation I have doubtful pleasure of converting single player game to multiplayer (not on unreal), and it is the worst thing one can do
coding even simple multiplayer is like coding async applications,, and that's for simple multiplayer games,
so you either do MP from day one or don't do at all. In single threaded single player game, you can assume that things act in some order and exist
in MP you must assume, that things will not happen in any particular order, and entities in world, must be as self contained as possible (in ideal world at least), and not depend on state of another entity
and that's what makes converting sp to mp so hard, at least in my experience
we need a "make multiplayer" button.
i was going to chime in yesterday about this topic, i converted my single playaer game to multiplayer about 3 months in, and i had done multiplayer in unreal before hand
you can re-use a lot of your stuff but really you need to pull it all apart and the complexity of a lot of things go up (depending on what your game does)
you can't trust your client so you really need to build the game around that
so i +1 the statement "start MP or don't mp at all"
heh make universe. they should have released the game as a blueprint on the marketplace :p
hahaha yes
@thorn merlin I did a similar conversion and it really is a major PITA.
As in, "you should think about it from the start".
We are considering a multiplayer version of our VR game so both VR users that are online and not surfing porn can play together.
its not impossible
Our game is simple enough to rebuild as multiplayer but even with a simple game like ours, I really really dont want to try convert
but it'll be painful
I like your name
thanks it's my real name too !
π
@wintry flower Yes,you would change the number on the calling client directly. So he won't notice.
@wintry flower always handle movement on the client.
@surreal prism There is not really a "problem" with root motion and multiplayer. (Not sure if this changed, as I never use root motion and I don't follow the updates on it) Root motion used to be handled by AnimMontages. The animation would get replicated across the server, but the montage didn't. Root motion is now handled by the ABP. So, yeah you can use root motion in multiplayer, but it is more work. (At least, it used to be more work.) I always just use in place animations. There is honestly no need to use root motion. If you are making a very large multiplayer game like an MMO root motion animations would cause a lot of problems.
A look at how root-based animation is handled within Unreal Engine 4
To be honest nobody sane is using root motion in unreal to get basic locomotion working
engine is simply not made for it
I personally don't see any benefits of it
especially when the stuff from Paragon will be mainlained into engine
^
Only time root motion could be kind of nice is when doing ledge climbing systems or any type of advanced locomotion. Even then, I still would rather just do it in code and not put all my trust into an animation.
@chrome bay hey... did you manage to get network replay to work with vehicle movement component?
i saw your post in 2015 talking a bit about replication for vehicles
right now.... the replay is very jerky for the vehicles
Bloody was haha, it's basically character movement, but I rewrote from scratch and had to make it diverse enough to work with vehicles. Can't even explain the pain I hast been through.
*different vehicles I meant
Literally gave up on PhysX vehicles.. utter nightmare
not sure if there's a solution to the jerkiness
what's your main issue with it?
you're using floating ones anyway right
The problem was syncing frames / moves / timestamp etc basically, and 'replaying' PhysX is a minefield
(back in ten)
9
8
For UT3 etc, they just use client-authoritative physics and do a cheeky check to see if it gets 'too far' out of sync with the server, at which point they send a correction. It;s not great though
minutes :p
hahaha, who wouldn't
Need to learn
Haha π I cri erytim :p
I do need to write more tutorials tho.. just finding the time πΆ
Fock, still need to extend the Steam thing. But September is booked..
@chrome bay that UT3 thing.. isn't that the same thing that is being done with char prediction?
oh wait nvm. char aren't physics
so UE4 vehicle doesn't have that 'check' to deal with vehicles over network?
Am bachhh
And nah, Character properly calculates movement on client and server, and server has final say. UE4 vehicles are basically identical to UT3 ones
In UE4 / UT3, client tells server where it is and server accepts it, and server sends replicated movement back. Problem is, that stops working as soon as you introduce almost any lag at all
Didn't matter so much for UT3 since they didn't really care I guess. I'm hoping UT4 will have a better system but no idea when they'll get on to vehicles π¦
I'd love to make my hovertank project open sauceeee but I gots big plans for it
i've seen horrible things happen in Paragon when there is a slight bit of lag. Attack ships on fire off the shores of Orion and everything.
lol
@stiff wasp the video you linked is literally just bunch of physx constraints, not really related to the networking issues on vehicles
@chrome bay I should return to my components as well, would need to implement the networking on it (and tweak the collisions)
@fierce birch If you ever manage to complete / finish that it'll be awesome
it's just., mine is really specific thing for the collision parts, I have plans on having custom responses on specific colliders
it'll not be a generic solution
physics itself feel awesome though, like really stable compared to physx
I think you could get physx to do that on fixed timesteps though, but haven't bothered redoing that on later engine versions
one issue I'm debating myself with that is how it should be structured
I started doing it as physics movement component, but then I needed another class to manage the new time stepping for that
so atm I just have another one off class that does that and manages all custom physics components in the world
but it still runs once per tick, so if I wanted my custom simulation to interact, say ue4's destruction for visuals, I'd still need to sync that stuff up
it's not a huge concern though
I'll most likely also separate the network prediction code into separate class, because how ue4 does it is just silly
but would need to figure some smart way of doing that
just putting it down in the inheritance chain would be easiest, but that's not a very clean design
@fierce birch I know it was. What is your point?
I thought you linked because people were talking about ue4 vehicles networking
it's #multiplayer after all
I must have misunderstood you then, but why did you link it?
basically asking, what was your point?
Linked it in the wrong channel
was meant for a PM @fierce birch
didn't delete cause I thought someone might think its cool
Β―_(γ)_/Β―
So I have a few questions about multiplayer. Say you're making a simple game in the third person tempalte which is just people running around, and they can press a button to increase their speed (increase max walk speed in character movement component under third person character). I want to have a hud that would show each players current speed, which means I'll need access to all player characters to get that variable. However, where is the best place to store it? I know you can get an array of all player states, but you shouldn't store the speed there should you?
there are many places, for example you could store them in the gameinstance if you want to also store them between sessions
I try not to answer networking questions because I'm noob myself.. but the PlayerState would be my first thought for anything related to the player that you need to access on all machines.
hey @stiff wasp So I have been following your help with my spawn points. I have run into a probelm though. So, when I hit spawn I spawn all right.... but it spawns on every spawn point in the level
no idea why
any ideas @stiff wasp
okay, so I think the problem is in the gamemode @stiff wasp
@stiff wasp so if i try to tell it to only spawn once, it crashes
mother fucker, it only takes one tag to get my attention. Not four and a PM
i knew you were there π
ogod
dude
I already told you
how to do it. I even gave you like ten screenshots of what to do
but it does not work π¦
that is because you suck
send me a screen shot of the code
dude, what the fuck is this? This is not even close to what I told you to do
I was trying to combine it with what generic shooter did
lol okay
do i have to delete it or can i just put it to the side? π Cause, i spent a lot of time on it
delete it
π¦
so @stiff wasp
it... welll
it may have worked doing it the way you said π
so thanks
well no shit it worked
@wintry flower you could make a replicated variable on your characters, then just iterate the characters locally
players as in player characters? How do you iterate through all player characters?
get all actors of class
i was going to store it in player state and then iterate through players array
the reason why id do it on the character
is because you have to set that data anyway
or else your client and server move speeds will be different and you'll get weird glitching
can't use get all actors of class. i want the values to displayed on the hud and updated quite a bit
and the engine specifically warns you to not to use it often
you dont have to get it every frame, that said, using the state might be better, because if you used the characters, they would all have to be relevant for the data to show up
Several ways to do this, you can always make the characters register their instances with the HUD on BeginPlay.
Or you can add the Character reference to the player state and make that replicate as well.
(Also, PawnIterator isn't that bad, right?)
Since PlayerStates are replicated to all clients, that'd be a place you can put some kind of speed. I'd do that instead of iterating through characters.
this is a really noob question but if you have a variable in player state, you still have to set it to replicate as well even though playerstate itself is replicated, right?
Yes
ty all
Isn't PlayerState replicated only to owning player ?
and GameState is what is replicated to all players
How to handle clients with different version on server? Can i get game version on PreLogin?
@surreal prism it'll just outright reject them anyway, they won't be able to play together. File hashes will be different
But, AGameSession handles player rejection etc.
Also since you guise were talking about it... Player State is replicated to all players. Gamestate too.
@chrome bay Thank you π
Np's
@eternal anchor PlayerStates are replicated to all clients, and contain network game relevant information about the player, such as playername, score, etc.
Which I take it to mean that they're replicated to all clients, independent of ownership (and that's actually the case).
can anyone explain the significance of this commit - https://github.com/EpicGames/UnrealEngine/commit/cbfc3b6af5ad842ae320091db8cf9de19110deb9 Enable PLATFORM_USES_POSIX_IMCP for Android
POSIX is a standard for operating systems, mainly followed by unix systems. ICMP is an internet protocol. It appears that they added a branch saying if the platform is Android then the platform supports ICMP and it's POSIX compliant
also they might have a typo in "PLATFORM_USES_POSIX_IMCP" lol
lol
i guess im wondering if its worth it to hotfix that change into my 4.12.5 build, i do get some weird disconnect issues from android clients
im assuming that might be related but i really don't know much about icmp
Hi guys!
What is the best way to make exec commands that affect server?
For example I think about making some command that change player's team. It will be good for testing until I don't have any GUI for changing teams, it also will be easiest way to implement the GUI in future (just call the exec commands). May be this is a bad idea, but now it looks as a good one.
But as I can find there are only few classes that support exec commands: Pawn, PlayerController, CheatManager, GameMode, PlayerInput & HUD.
Some of them exists only on client, some only on server.
If I will put my commands to my PlayerInput class (for example) I will have to make some replicated function in class that exists on both sides (PlayerState for example) and only from it I can call GameMode for changing a team on the server side.
Is there are some better solutions?
You'd want to put it inside PlayerController
I tried but it worrks only on server =(
You just need to do a back and forth. It's how most all replication works
You'd have a function called ChangeTeams() right? Check for authority so if(HasAuthority() == false) it's a client, so from that expression you'd call a replicated SERVER function ServerFunction_RequestChangeTeam() or something. Which then just calls ChangeTeam() again, but now it's doing it on the SERVER so HasAuthority() would be true, so inside your ChangeTeams() function you then do whatever you need to, to change the team for the controller, let's pretend it's a variable bRedTeam (false = blue team). You set that variable to replicated, and then you use an OnRep function assigned to that variable OnRep_ChangeTeams() which then holds information for changing the team AGAIN, but this time for the client
or you could have ChangeTeams() function under the HasAuthority == true section, that calls a Client function Client_ChangeTeam() that does the client version of changing teams
Is it means that a PlayerController has copies on each client? I thought they exists only on server..
So thank you for help I will try this solution
ALL PlayerControllers exist on the Server. For CLIENTS there is only ONE PlayerController
and that is THEIR own
if you want to replicate their Team to EVERYONE on the server
Then you would use PlayerState class instead, as that's exactly what it's meant for. Because clients have EVERYONES PlayerState
so you can setup the team as a variable in Playerstate, set it to replicated, use ChangeTeam() and ServerRequest_ChangeTeam() on the player controller like I said before. But instead just change the variable inside PlayerState which will automatically replicate to everyone
IIRC, PlayerControllers can be destroyed and stuff, and PlayerState is more persistent.
(BTW).
Wow, I didn't know. I want it only from one client to server so PlayerController solution looks more suitable.
Can PlayerController be destroyed during the play? I know Pawn will be destroyed when it dead.
As, I said, I'm kind of remembering, but I think that if you disconnect, the player controller can get destroyed, while the playerstate survives when you reconnect?
Don't quote me on this, though.
You can easily check it out yourself, though.
I think PlayerController must exist when player is connected.
Player Controller is only during a single connection, it doesn't get destroyed during gameplay, and I think it transitions between levels
okay, wasn't sure on that one.
But for team changing, you don't need it to stick around after reconnecting or level transition typically
From the Answerhub: Sorry for the delay. What you might be seeing is when you call LoadMap, it will destroy the old map, and any actors in it. It will then re-create PlayerController's for any local player still in the game.
If you are using seamless travel, this shouldn't happen though, and the player controllers will transfer over. There are some details I might be leaving out, but this could be what is happening if you are not using seamless travel.
So we both were right and wrong at the same time, I guess.
Though I'm pretty sure that if the maps use different gamemodes (with different player controller classes) they will be destroyed.
that sounds about right
i'm quietly reading this channel in hopes that some day I too will do networked stuff!
is there a way to test Internet / non-LAN games by myself, aside from setting up a remote desktop PC at my mum's place and running the game there?
some way to route traffic between two machines here so that data is pretending to come from outside the network
(I want to test Steam multiplayer stuff, but I'm in the unique position where my Steam LAN games don't work, but Steam Internet games work fine)
For the player array in game state, the order of the array just depends on the order players join the game right? So the listen server will always be index 0?
@turbid stratus well, you can mess around with the system routing tables, no?
@wintry flower I wouldn't count on that.
@turbid stratus 1) you could setup a VM 2) you could rent a super cheap t1.micro t1.small instance from amazon ec2
^ you can just host game in cloud
for testing purposes it will be cheapest option I think
there are apps. There was one for old Lan games to make them work over the internet. Gimme a sec ill try google
tunngle, hamachi the sorts?
Hamachi was the one I was thinking of
doesn't he want to test internet sessions?
Hamachi emulates LAN, so that's not helping him. Problem with Steam is, that it only allows one copy of the game using steam at the same time
Even dedicated servers will need an extra account
I'm using an old laptop to test steam. Even though it's the same network, internet sessions can still be tested
VM might work too, but i doubt a VM gives enough resources to start the game at all
ahh my bad
Otherwise, having a server is the best solution, if you have a dedicated setup
If not, yeah, second PC or a good friend you can send the game to
@thin stratus not always, with steamcmd you can login anonymously and download some ids, killing floor 2 server doesn't need an account for example
True, but that would need you to have the server already registered as an app at steam, right?
So for testing, this doesn't work, or?
Chat client api?
You want to access the actual chat that you can use in the steam client?
Aye @thin stratus
Trying to see if it was possible to bring up that chat client in game
Instead of using the overlay/alt tabbing to it
So, pretty much an embedded steamchat client
This is just for friends and what not obviously. Unrelated to game MP chat client
Haven't been able to find anything on it, so it is probably not possible atm
you can't access the steam chat via API
But figured I would ask
Even via web api?
But anyway, that is probably the answer. Nope
that would count as botting according to the ssa
you are basically ordering a programm to write stuff for you and impersonate a user, even if it's just passing your stuff to the api
@wary willow i am still pretty new to multiplayer, but mini has been teaching me a lot. From what i understand you can;t do that with ue4
so does PostLogin get called before the local player controller is created?
Unraid vms + lazyploy... the only sane way to single man steam test
man the simplest shit sometimes π¦
how hard can it be to send a message to everyone's huds on join
@proud wren please, stop.
anyone know the correct way to disconnect a player in multiplayer? Right now I'm just using Quit but that doesn't seem to cause GameMode to hit LogOut
I tried calling LogOut before Quit but that didn't help
yeah I figured it would boot me back out to the main menu
and is there somewhere post login that I'm guaranteed to have a player state, hud, and local player controller? I'm trying to add join messages. I'm testing PostLogin right now but I don't think it's going to work
it won't just "boot to the main menu". You'll have to set that up yourself
... yeah
what do you mean login? Like steam, or custom login via a launcher? Also, are you doing this in BP or C++?
by login I just mean join a match. And yeah this is steam in c++
very good
I was hoping you were doing this in C++. Alright, so you have a lot more options than just join/host a session. Have you taken a look through the Docs yet? They will give some basic stuff. I am going to be away for a week, but when I get back I can run you through everything networking. In the mean time though, look through the docs and also check out http://cedric.bnslv.de/sessions-in-cpp/ and http://cedric.bnslv.de/unreal-engine-4-network-compendium-released/
mhm yeah I have my network stuff all in place and working. I was just trying to find an event for logging in where I would have the hud and things ready at.
I see
well good, less I have to explain then.
but anyways, I need to head out. I will help you when I get home if you've not already solved all your problems.
ahh PostLogin is working for other players. so you can get a message when other players join. you just don't get one when you join yourself because your local playercontroller isn't setup yet. Build finally completed so I could test.
correct
there are ways around that though
but, I need to leave before I get sucked into coding talk.
DOES any one test this?
MMO Starter Kit is available for purchase on Sellfy!
Online documentation for version 1.7
older documentation: 1.5 | 1.4 | 1.3 | 1.2 | 1.1 | 1.0
2016
Update 04/09: Animated loading screen, 4.13 port link
Update 28/07: Clans, clan chat, 4.12.5 port link
Update 06/04: A reworked Launcher, aggresive behaviour tree, ability to delete characters, 4.11 port link
Hey all, does anyone know how i would collect a list of choices from in UE4 and have it emailed to an email address like and order form type of thing.
yeah i have that
What's the best way to update a hud for a replicated variable? I have it working with repnotify but it's delayed on the client and updates way too slow π¦
@brittle slate probably with some VaRest stuff and a PHP script?
@wintry flower repnotify is called when the value gets updated. How much lag do you have?
Ah crap haha thanks π
@brittle slate so there is no easy thing build in the engine :P
If that's whaz you wanted
Really? I haven't noticed xD (sarcasm) :p
hie veyrone.. a question
Hi everyone.. a question ( sorry typo )
i have a replicated array in GameState
is there ANY reason at all they could lose synchornisation?
it seems that randomly they will.. at this point.. i'm not too sure why.. if i get both client and server to list their array
after some time they will lose the info
i just found out the cause
sigh.... someone tel lme if this is new.. coz i'm surely unaware of it.
apparenlty when a unit's Relevancy becomes false... the pointer gets removed from client's array and hence lose sync... it seems even when it become relevant once again
Could be, yeah. If client doesn't need the actor, it won't be replicated, though the gamestate should always be relevant
Didn't know that pointers of unrelevant actors get removed from relevant actors
But makes sense
@thin stratus it's weird though , because some data get lost permanently. shouldn't some states be stored locally even though they're not update. or at least when it gets reupdated , it should sync.since relevancy is about network optimisation. not local performance optimisation
If it's relevant again, it should get the lastest version of the server
it doesn't
that's the problem
after it comes relevant again , the array is still blank
so i have an array that stores unit on each team
once they become not releavnt the array index is lost forever
it becomes a null array
even after the units come back
Hm, is it important to set them to not always be relevant?
Like, would they have a big network heavy impact
Also, I'm not at my pc atm, so what other replication settings does an actor have again?
Do UPROPERTYs default to Replicated?
because it really seems like they do on my end for some reason, unless the details panel is a liar
or, oh, wait
duh
Question: is there any hooks on an actor to know when said actor got replicated?
aha
I can use ReplicatedUsing
Are the struct properties UPROPERTY()'s?
yes
(it's an FVector by the way)
void AGridManager::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(FVector, CellSize);
}
ah
First param is the class it belongs too, second params is the variable name
that explains it
really hard to find documentation on this, both the network compendium and the official docs don't seem to cover it well at all
FVector has to be a UPROPERTY() too, with either Replicated or ReplicatesUsing set π
yeah it is
cooliosauce
Best bet is to grab ShooterGame from Learn tab, it's a fully networked example in C++
ah, nice
Can learn a lot of good tricks from it
I'll keep that in mind
np'
@compact gulch I also had some issues with a replicated array of actors stored in gamestate... I was never able to figure it out, and ended up not replicating the array (it only needed to be filled at level start anyway so I just filled it using RPCs)
(the issue I was having, was: I was spawning a bunch of tiles on the server, adding them to a replicated array in GameState as they were spawned, then a client would join afterwards, and all of the tiles were there as expected, but some of them were missing from the array on the client (just null/empty slots).
@thin stratus I'm using an old laptop to test steam. Even though it's the same network, internet sessions can still be tested <-- Internet sessions how? I have a laptop too, different accounts (it's how I was intending to test), but I am unable to connect this way (despite being able to find the session fine). Yet I sent the same packaged build to my nephew on Steam and he connected over the Internet no problem.
I don't know, it just works :o host online session, find it on the other pc/laptop and join
hmm, I feel like I did try a non-LAN session but I'll give it a try
it worked, ffs
I'm sure I tried that a millennia ago. Oh well, here's to removing that "Use LAN" box from my game π
ahh actually I think I tried it when using OnlineSubsystemNull, and it didn't work iirc. Might leave the checkbox there for now in case I do more testing with null
thanks @thin stratus this makes me happy, I can continue work easily now
@turbid stratus hehe, subsystem null does not support online sessions
Due to obvious reasons, such as no masterserver to query serverlists from :P
Yea, I just hoped it'd just force the session to be LAN with subsystem null, so that I could test without explicitely setting "Use LAN"
@hybrid igloo I really like this wiki entry for that stuff. It definitely shows you how you should have written the DOREPLIFETIME, among other things π https://wiki.unrealengine.com/Replication
@turbid stratus it seems that setting it to always relevant works. but i'm a bit concern with network traffic in the long run
also i'm not entirely sure , but is this problem newly introduced in 4.13?
anyone know what's going on with this rolling ball bug? This is right after creating the project from blueprint template, nothing changed.
@ripe folio ah nice, thanks.
@wintry flower it looks like the code for possessing the actor isn't setup for dedicated server multiplayer
@wintry flower that view is typically the "i have no actor" view - now because its always player #2, perhaps its in the actors auto possession settings
yeah I have no clue π¦
i can't find what's causing it
could you possibly make a project from the template and see if you have the same issue
Add another playerstart
I just did that and it works
actually, not all the time
But I get this when it doesnt work
LogSpawn:Warning: SpawnActor failed because of collision at the spawn location [X=-230.000 Y=253.557 Z=372.001] for [PhysicsBallBP_C]
LogGameMode:Warning: Couldn't spawn Pawn of type PhysicsBallBP_C at NetworkPlayerStart
yeah i tried that and it doens't matter if i have dedicated server checked or not. on both, sometimes it fails, sometimes it doesnt
so stupid
going to bug me if i can't figure out what's wrong lol
Seems to me like it's trying to spawn 2 players at the same playerstart
i remember the advanced vehicle demo had a weird issue where it had one pawn on that map auto assuming a controller, then it would spawn them in for the other ones
This might help a bit https://answers.unrealengine.com/questions/20247/multiplayer-multiple-spawn-points.html
I notice that when you put a lot of spawn points in the scene the problem occurs less
so it's spawning your pawn on a random playerstart even if something else is spawning on it
Which is weird
yeah that's really stupid. it does seem to help a bit, but i feel like there's some other issue as well
i don't know why you never see this in the third person template. it works perfectly there.
It has something to do with the physicsballBP
If you use defaultpawn as the pawn that it should spawn it works perfectly fine
doing that for me made both players have the issue...lol
Really?
Well, if I set the spawn collision handling in the PhysicsBallBP to Always Spawn, Ignore Collisions it will sometimes spawn both players next to eachother, confirming that it sometimes uses the same playerstart
but why doesn't the same thing happen in first person and third person templates. it just doesn't make sense
not saying you're wrong it's just weird
Im looking into it right now
I have a feeling
Let me check first :p
I figured it out I think
It only works with primitive components as the root component
the checking for onoccupied playerstarts
and since the physicsballbp has a static mesh as the root, it wont do that properly
so th en you can't use a static mesh? what's the workaround
Im figuring some stuff out atm to be sure that im right about what I just said
I spoke a bit to soon I think
Im looking at the function right now in source, first it checks for a movement component, if none then it checks for a primitive root component
if none it checks for any other scene component
oh nevermind it only works with primitive components as well there
If you wanna check yourself in the source its in UWorld::EncroachingBlockingGeometry
in LevelActor.cpp
which is called by AGameMode::ChoosePlayerStart_Implementation
Basically it only works with primitive components, a workaround I guess would be do make your own implementation of chooseplayerstart
I think its exposed in Blueprint too as of now
okay i will check it out
can someone explain to me what is sent over the network with function replication? variable replication obviously just sends the data for the variable. But function rep is more of a mystery to me.
ahh I see
In other words, the function's name, and all of its parameters, are crammed together into a packet of data, and transmitted to the other machine for later execution.
hmm, so it would be intelligent to have shorter named functions
idk what their "cramming" algorithm is π
yeah most likely
lmao
I believe it's similar to the process used for packaging spam in a can.
lol
if I can a multicast from a server rpc it will execute it locally on the server right away without sending anything over the network (for the server) part right?
π
multicast executed on server will run instantaneously on the server
it will also work in singleplayer
thanks guys, that's what I was hoping π
can someone help me with a quick question
i have an actor simulating physics and i need it replicated. checking the replicate stuff doesnt do anything though, what gives?
I remember this from a while ago when I wanted to have replicated static meshes with physics
Dunno if it still applies today
Does anyone know if it's possible to replicate a variable to an object that I manually spawned on a simulated proxy?
I'm assuming not since I didn't spawn it on the server and replicate it. But really, there is a server representation of it. It's just not replicated. I handle it manually by spawning it on the simulated proxy myself.
@rough iron π
If it's not spawned on the server their netIndex wont match
but you can always create a proxy object for it and bridge all calls manually
ahh okay cool, I will look into that. Thank you π
so TBitArray can't be replicated?
is there some other way to pack bools as single bits within an array?
i.e. uint8 bInputReleased : 1;
You could just pack then using bit flags in a single uint32
or a TArray<uint32> if you need more
the usability of an array would be nice
so I would have to use bit shifting to access each "bool"?
masking
checking for the flag
something like:
bool HasFlags(int flags, int flag)
{
return (flags & flag) == flag;
}
you can check one or up to 32 xD
HasFlags(MyFlags, FLAG_1 | FLAG2 | ... | FLAG_N)
xD
so you can check multiple bools at once xD
okay, that's what I thought π
then you only have to assign a mask for each
okay sweet, that makes sense. thanks moss the boss
^^ np dude
hallo π o/
is there a reason that ue doesn't handle data packing for replicated variables at a lower level? so we don't have to do it ourselves?
perhaps that explains this on the roadmap - https://trello.com/c/DBKRIpLd/822-replication-performance-improvements
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.
@jolly siren Just to confirm you meant actually packing and not comrpession right?
i have a bit of a dumb question, but when I set the PIE to 2 player, the second player's camera spawns at 0,0 and has no input, but their body is where the second spawn point is
yes packing. For example, uint32 SomeBool : 1
any ideas?
why should we have to do that?
bool SomeBool would be nicer and then it's packed under the covers for you. Then you can do arrays of bools, etc. That is just one example.
@vivid siren "player" as in a character bp?
yeah, i think i maye have narrowed down the problem though
however the second player cannot use flight controls whereas the first can
do you have dedicated server checked? if not, the first player will be the server and the second the client
no its unchecked
i checked it and now my widget is giving errors: being added to none
lol
it's weird. with dedicated server checked, if i play with 1 player, they spawn at 0,0 with no controls. if i play with 2 players, they spawn at random spawn points with broken flight controls
i wish the multiplayer mechanics werent so unpredictable. it ruins any motivation i had for a project whenever i try to implement it
multiplayer isn't that unpredictable, given you build your game around multiplayer in the first place
yeah it's predictable if you know what you are doing
I've watched so many tutorials and asked so many questions but it never makes any sense
I don't see why my second player chooses to just not function correctly. All i'm asking him to do is spawn and use UE4s default flight controls
this is the default fp one
so why can't the second player move? dedicated server wont fix the problem
is there any special setup i have to do so that ue4 understands the second player?
how do you set things up though
so if there are to players, only one moves?
thats true
also keep in mind though you are executing that code on being play, so it executes on all instances of the actor
if I ain't wrong there
oh, thats true. i hooked up a print hello and when i start the game, the server says hello twice and the client is silent
so begin play executes server-side only?
yup
any Actors spawned after the game is started will have this called immediately.
anyhow,
you most likely want to perform what you're doing there on owning client's end
so that a widget is created locally only
right
there's a possessed event, it executes server-side
thats on server side though, so i dont want to use that, do i?
well you can have a custom event running on owning client
that is fired when the pawn is possessed
now both players have the widget, which is good
but
neither can fly now
also the second player is glitched out for the first 3 seconds, then he sort of fixes himself
set movement mode server-side
so its okay to have custom events plugged into everything for the sake of replication, right?
because at this rate there's going to be just as many custom even nodes as actual nodes
that doesn't sound right
oook so can anyone tell me if time dilation being set on 1 player will effect all players in a mp game mode ?
its client side i think. There is probably a differentiation for MP though.
hmmm some info on the forums says its server side and effects all players.
π
hate being wrong.
I could havw sworn there was global time dilation and custom time dilation for actors.
there is @granite jolt :) but the server always has authority
hrm this couldd be fun then π
so if the global was at 1.0 and the client was at 0.5, it would force the client to 1.0?
i guess so if server maintains authority
thats pretty weak but understandable
yup.. but i will find a way around it, somehow π
maybe you can hax the implementation so the server doesnt have the authority on it ?
really bork things for a laugh
or.. maybe i can hack in a way for it to temporarily hand authority to the client
hrm
wouldn't that lag like shit though?
thats my fear
i wonder if @thin stratus would know, he's pretty hot on multiplayer / networking
If the variable is not replicated and server and client have different values then rip
(i guess)
i was so hoping you weren't going to say that π¦
Just multicast the change or so
i shall try !
Hiya folks! So I'm having this really weird issue where variable replication is taking upwards of 2 seconds for the client update. There's like nothing goin on inside the project - just the third-person template with some networking stuff set up.
the code is just onEvent, cast to playerstate, decrement health by 10%
Printing the value every frame shows that the server variable updates immediately but the client variable can take almost 2 seconds at times to change.
It's literally just customevent (do on server) -> cast to playerstate -> set health
The editor's been crashing on me a lot today - maybe I buggered something up...
If I cast to PlayerState and set the variable there it takes a while to update the variable on the client, but if instead I cast to PlayerController and set a variable there it is almost instantaneous... Why would PlayerState be slow to update?
or at least, why would playerstate be slow to update clientside?
Where do you call that? And when?
Is the PlayerState maybe not yet fully initialized?
I'm calling from the Player Character pawn, and it's on a key-press event (currently just attached to jump) so I don't think it's that.
Shouldn't make a difference
That's why I'm super confused.
Yeah - just switched it back to PlayerState and there's clearly a lag between the server update and the client update.
Friggin.... The PlayerState is set to update once per second by default, whereas most actors are set to update 100 times a second by default...
I fixed it.
Hey everyone! I am just wondering if I can create multiplayer games without using the OnlineSubsystem and session. For example use an external system and join other players games via there unique net id. Possible? Any guidance for me?
You could create listen or dedicated servers but you'd still need their IP to connect
You would have your player host a game (listen server), and the joining player would enter the connection destination and voila
yeah via the console the comand join <ip> or some such thing, correcT?
I believe so.
I ask becauseI am weighing the pros/cons of using a third party back end web service like PlayFab or GameSparks.
And as far as I can tell you do not need (or maybe should not) use the online subsystem in UE4. As sessions at this point seem unneeded. I think this is the correct assumption.
But I still want to connect players together and use UE4 replication rather than reinventing the wheel with their services
How far along are you in your development? Are you considering these options at the start, or have you got something you're already into?
Minimal gameplay. Frozen development until I can assess which route to take.
So, early one yes. The first thing I did was setup the steam online subsystem. I am now just exploring other options.
The online subsystems are just that - subsystems. You still have your basic client-server architecture and variable replication (handled by tbe server version of your game).
Oh yeah of course. I plan to use UE4's client-server architecture and variable rep. I just am trying to figure out the "correct" workflow for joining servers without using the sessions provided in the online subsystems.
I need to determine what information I need to store for the player in a 3rd party DB so that other players can join their locally hosted games.
I know IP is the first and simplest option. I was just wondering if UE4 provided something else
Is there a large amount of information that is tracked from game-to-game and server-to-server? Saving persistent variables can be done locally by the server - either by use of savegame or something like sqlite
The backend service I use has the means to persist any player data that needs to stick arond
UE4 need not worry about storing any data itself. I just need to handle the game to game specific in the engine
extenral api calls will be made to store whatever else I need
or retrieve of course
I guess the heart of the problem is this; One player hosts a game. What data do others players need to just join this game. I know IP is the obvious choice. Just wondering if anything else is available.
They don't really need anything else.
The subsystems are basically just a fancy packaging for IP addresses, anyway.
Yeah, that is what I thought. I just know using something like GetWorld()->GetNetDriver()->LowLevelGetNetworkNumber()
Will returns a SteamUID
and you can type "join <steamUID>" in the console
Or something close to that.
So, I was curious if i could do something similar without using a Steam or whatever else subsystem rather than using an IP address
Nope - unless you created the netdriver yourself - in which case you'd just be creating a backend instead of picking one.
Yeah, exactly.
Okay well I huess the best bet would be to use the external matching system. Wait for the host to load the map and then fire off an event containing their NetID back to all the clients who want to connect.
All via the external service
by NetID I meant IP address
So I've about had enough of Unreals networking.
Do I seriously have to resort to this, just to have a cube simulating physics to update properly for every player?
I haven't done a lot of networking beyond tutorials but surely replication is more low level than that, you just set a scope for it
forcing a network action on every tick sounds like disaster
Well it's all I can do because this engine doesn't seem to understand how to do simple things like this
I've watched countless tutorials and read all the crap that every forum has to say on networking, and all I get is "use a clusterfuck of replicate nodes"
hmm
If you set the actual actor to replicate it shouldn't need all that.
Nope, that doesnt work either
Are you referring to the fact that the physics simulation is non-deterministic?
I guess so. The physics objects just dont update on the other players unless I use the above code
like, when theyre moved by players
incidentally moved or as in pick-up-and-move?
good network design would give authority for an object to the player holding it
then release it when they put it down
you wouldn't force 1:1 updates on the network
Try posting in the physics section - this is more a problem with the physics simulation rather than the networking.
Maybe someone there has a better solution
@vivid siren Is the actor is properly replicating movement the physics will be calculated on the server and replicated postions to the clients. I have this with just setting a few variables. I am not sure why you had to do it that way.
GameSparks afair, do not provide means for say world contruction
ie. data replication
it only provide backend services for match making,
profiles, inventories, etc
if need this you can use it, it's easier than developing your own solution for cloud
but depending on scale it might be better to rollout your own
Speaking for my self I would develop my own, but I like this area of development (;
i really want to find a way of using IP connections with steamworks
i wonder if it's as simple as changing the NetConnectionClass under the steam oss ini entry
the only reason i'd want to use the steam p2p stuff is for NAT punchthrough when hosting a listen server for something like coop
otherwise, IP connections pls
yeah so changing the NetConnectionClassName to IpConnection doesn't work with the steam OSS
it's still using steam IDs for the steamworks p2p networking
π€
Anyone know if UE4 has any lag compensation when it comes to firing a weapon?
Because currently I suffer from the issue where clients have to lead their shots in order to hit anyone
He took no damage at all
honestly it looks like you miss a lot
maybe there's some delay in the gun firing, like it waits for an animation cue?
No
do a more controlled test
The delay is latency
like shoot at him while he's not moving and time the delay until damage hits
or even better.... debug it
Alright
spit out some messages on the client for when it fires and when it receives hit confirmation
say of the gametime
But should this be happening or no
Nah this gives hosts a bad advantage
oh yeah always
you could redesign it so the client that shot has authority on who it hit
sure but will anyone bother?
I've seen people bothering yes
shadowban them
2many
UE has always used replication rather than interpolation for it's networking so leading shots is part of that method.
it's actually more accurate in terms of things but then only if you lead your shots
unless railgun
We're not really aiming for a realistic approach
even then its a trace that relies on two sets of information being static for comparison. I guess you can interp manually
take an average of the latency of both clients, work out a relative location
Pretty sure that's what UT4 is doing
you could have both the host and all the clients in the viewport provide their version of the shot and take the average
just adding that comms in will remove the host's advantage
I always thought that if Client A hits Client B on Client A's screen, it should count regardless but after a few years playing counterstrike and being dragged back into an old position that I moved away from specifically to avoid that shot, or ending up back around a corner I ducked behind, I realised that leading shots is actually a better option
what happens then is people introduce lag to freeze then enemies while not sending their own location
they run around the map tagging everyone, then they open the floodgates
read up on titanfall's network code some time, it's insane
the server changes its estimations based on the weapon used
so if client A shoots and hits B but the server knows B suddenly hit jetpacks, the server can invalidate the hit
without even doing a trace
that's hit B in A's eyes
it'll often undo damage before the consequences of it are shown on screen
so a real active simulation
one of the main reason executes have such long animations was for a similar situation
gives client B a chance to say nah I was outtie
hardly ever happens though
there is no lag comp
you have to implement it yourself
the engine won't do anything you don't tell it to
it would be hard to implement reliable lag comp the way UE4 has its animation system, in source and engines like it, it was easy because animation data could be saved for each game frame and not take up much memory
but in UE4 you might have to go with a hybrid client/server system
where the client tells the server of a hit and then the server runs some validation to check the hit could have happened
Γeah that's what I'm considering atm
I was thinking about make hte projectile fire both on the client and the server
If the client hits, check where the server bullet is
If it's closeby, register hit
Γf it's far away(meaning the client tampered with the projectile position), no hit
wouldn't that be affected by physics though and produce different results at the floating point level?
Wouldn't the difference be negligible though?
not sure. physics can be whacky in two different instances
The difference should be a few cm at most, the client projectile's scan range has to be much bigger than that anyway since the difference in client and server positions can be a few dozen cm
And I don't think there's much to go wrong with a simple projectile heading forward
But if there's a better way I'm all ears lol
I think it would be worse with a projectile in the conventional sense. Especially the projectile movement component.
Different approaches for different types of projectile I guess
Our programmers are looking through UT4's source to see what their approach was
What I was thinking was taking the hit location on the client, average the latency, apply a sort of short-distance aimbot effect. So if you hit on your screen but was 200ms behind, you are allowed to miss on the target client by a certain amount that is applied to their received hit location.
this amount is based on the average latency and a multiplier
I think I would have to do something slightly different in the case of a much slower projectile though or one that interps with an in/out easing.
A slower projectile would not really suffer from this since you'd have to lead that anyway
So basically add bullet magnetism
yeah
well I think an average of the player/enemy but you could factor it into one
That would work if the players were to be going with a consistent speed
Say if your enemy is in a vehicle you'd need more magnetism as compared to the enemy running
as long as you hit on your screen, the target can be updated appropriately and they won't notice, unless a severe discrepancy at micro-timing occured, such as ducking behind a box when a missile is coming. If it's already landed on the firing player's client, the compensation is going to look wrong
or rather... it will look like counterstrike when you get bhind a wall in time but die and get dragged out
everything is :p UE4 is open source :p
No I mean people can use that fact to cheat
Make client side modifications
Server registers a hit
Stuff like shooting through walls will be possible
I try not to worry about that as if someone wants to hack, there is always a way and in an open source engine, you are SOL for security unless you write something that negates any previous exploits. Which takes time. Which costs money. Not worth the effort unless your trying to make an eSport
I heard there were bots for Paragon during the alpha stage, I presume there still are, and that's an Epic game. You would think if anyone could stop exploits it's the people who wrote the engine
just my opinion and i'd code cheat security for the right money but im just a humble indie guy :p
Hence why making the projectile be on the server destroys the ability to alter the projectile to begin with
Only host would be able to cheat and if he did everyone would have the same advantages
I've setup steam multiplayer with blueprints, can I add "always on" voice chat just by moding the .ini files or does it require converting to c++? seems i've read conflicting versions of that.
Alright can someone hold my hand through this? I'm seriously having a lot more trouble than I think I should be having.
Yo
I need to have a physics object replicate exactly across all connected players
Whats the Best Concept for Procedurally Generated Tasks? Use a Web Server, Store them? Or Just Generate them ingame based off Time?
@vivid siren on the object, go and select reliable, and make sure it has the associated site selected for reliability
Xd Unreal Engine is off, while I wait for a Push from my Modeller XD give me a second i`ll give ya the exacte things to click on
Deselect Net Load on Client
Are you building this for a Server or Lan Based?
like Server then Players Connect?
Or Player is the Server?
Player is the server, listen server
Hmm for some reason i keep getting the feeling I`m missing to tell ya something else to do.
But you have it right on the Money
It's not working though, when I push the cube with one player, its not the same for the other
1 second
Okay so everything seems to be working now
New question guys: what's the best way to replicate the grab function i have?
here's the blueprint
i honestly have no clue which variable i should be replicating
Give m a second
I did that already
Xd @.@ Waiting for a gitpush is like waiting for a package in the mail
smashes head against wall waiting
you only have to make a Call Trigger, and that Event is Replicated across all the Clients.
Reference, the Hit Location, and such int he Function which your replicating
Do the same movement, and such, but only apply it to the "Actor" that Announced it.
so properties can be replicated to an actor before the actor's BeginPlay has happened? why just why?
okay i got it working ^.^
@jolly siren makes sense. You might want on Clients properties from server, before you start playing.
though it's not something I would rely on anywa
anyway*
@eternal anchor okay cool thank you. I just moved the caching of the component I was needing in the OnRep from BeginPlay to PostInitializeComponents and that fixed the issue.
If I have animnotify event to play a sound do I still need to multicast for other clients to hear the sound? Or will the notify just run on each individual machine and play the sound accordingly?
if the animation plays there, thats what triggers the sound
so if you've triggered the animation somehow, it should work
that's what I thought, thanks.
so good to be home
Anyone know how to join a listen server using a steam ID? Ex// 'join steam.<id>:<port>'
Getting the player steamid is easy (unique id from player state) I just thought that setting up a listen server and joining via steam id was an option.
Or do I have to use sessions?
Well if you print out the server travel link it's a bit more complicated than just the steam id. Use sessions or access the steam API directly
I want to use ClientTravel(...), but I was not sure how ot ocnstruct the travel link.
Using sessions makes getting the travel link easy, but I didnt know if they were necessary if I was using something else for match making
Sessions should work with any underlying system being used, they encapsulate the information you need to host and join games. And it would have been nice if you could just join <steamId>:<port> but steam didn't really do that
From what I remember, that used to work in UE3. That is why I was trying it now.
Dind't work for me when I tried it. Sessions are easy to use.
Yeah. I they are easy. I guess I will just go back to using sessions and skip using most of their features.
anyone know why my USkeletalMeshComponent wouldn't be replicating?
Weapons[i].Mesh3P->SetupAttachment(GetMesh(), WeaponAttachPoint);
Weapons[i].Mesh3P->RegisterComponent();
Weapons[i].Mesh3P->SetSkeletalMesh(Weapons[i].MeshAsset);
Weapons[i].Mesh3P->SetIsReplicated(true);```
hi everybody! π do any of you have some experience with the Multiplayer Shootout game? I try to make the game work over the internet, but it seems that it won't let me connect (cant find any games). There is no error message of any kind either. Can you give me some ideas how can I check the connection, or if it is working properly?
have you done the blueprint multiplayer tutorial?
other that that I have no ideas.
@halcyon finch which one are you refering to? I have done loads, but maybe I missed something
In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some server options such as changing the map or match time as well as the ability to kick players from the lobby, all of this working with Steam integration. So if you are wondering how to build a networked game through Blueprints with Steam, t...
@pliant cypress did you add an online subsystem value to your config file
and so on
you also need to add values to the defaultengine file
When creating sessions in C++, does the session need to be started after being created in order to be searchable?
Nvm, it turns out that you do not need to start the session. The reason it was not showing up was due to another error.
@halcyon finch @Adam#2406 @prisma iris Thanks guys i will look into these. I used the MP Shootout game as a foundation of my card game because it seemed to work based on the tutorial videos, but I couldn't find a way to make it work so far only locally
Guys I need to make a MMO STAT!
@sand juniper I'll have a BP plugin for you right away!
π
Making an MMO is easy. it's the gameplay and content and making it all work and making it interesting and financing it and marketing and expanding it and selling it, that's hard. Oh and the merchandise. Got to have a pewter model to sell a pre-order collectors edition with. Those are a bastard to chisel out by hand :p
Hello :), I'm relatively new to networking. I need a dedicated server for my teams game and I dont know where to start. Any suggestion and recommendations? Do I need much server programming experience?
We want to use Steam as online-subsystem
@stuck stump if you're just looking for the actual server end of it, here's a guide on how to set up a headless server. Unfortunately it involves building from source https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)
But if you mean the whole concept of a server/client relationship, that's a whole other deal. And that would most likely need at least a basic understanding of it
This page has a bunch of articles to get you going, but it's a pretty involved step to go from SP to fully multiplayer https://docs.unrealengine.com/latest/INT/Gameplay/Networking/
Setting up networked games for multiplayer.
ah the first link was just what i needed π thanks
How do I properly end a session on quit? When I create a session in PIE, stop PIE and then start PIE again it says there already exists a session
(using c++)
Yeah, but why does the session still exist when I exit PIE? I'm just curious
it shouldn't
That's what seems to be happening to me right now :/
play -> host (works) -> exit -> play -> host (fails, says Cannot create session 'Game': session already exists.)
and you are destroying the session?
no im not
lol
Thats what im saying though
Why does it still exist when I exit PiE, Im no engine expert but I was assuming that the session would automatically destroy
since when doing it in a standalone game it works fine
I can destroy it myself and it will probably work, but I wouldn't understand this part though, just curious
hey, so I am trying to map travel after a match. I am using the Server Travel node, but only the host moves. The client just gets kicked out to the menu π¦ Any idea what I might be doing wrong
Do you have seamless travel enabled?
knowing johnny he probably didn't
Anybody running into loads of random multiplayer bugs in 4.13?
Seems like half of AGameMode has been either deprecated or isn't called anymore -.-
Oh god, really?
Didnt they do a massive refactor of AGameMode?
Please tell me PostLogin still works.
^ does for me
Awesome. I'm still on 4.12 and use that function a lot
I was running through the Roadmap and notice a node that said they were doing a cleanup of AGameMode.
Ive just updated our sourcebuild to 4.13 but havent had an opportunity to thoroughly test it
But at quick glance it works fine
InitNewPlayer is no longer called, which I just found out thanks to TheJamsh
i upgraded to 4.13 this week, things seem to be working fine for me
wow initnewplayer indeed doesnt seem to be called, that was kind of important to me
I think ill have to go back and go over AGameMode now, you got me worried haha
that saved me some wtf moments when my testing gets that far
So basically, turns out they've added an override for InitNewPlayer
And all it does is call the OTHER verison of initnewplayer
But obviously because both versions exist, code still compiles
arghhhhhh
{
FUniqueNetIdRepl UniqueIdRepl(UniqueId);
return InitNewPlayer(NewPlayerController, UniqueIdRepl, Options, Portal);
}```
Like literally, why? Why not just updated the function signature and all calls to it... ugh
half of AGameMode was a bit of rage
so they didnt bother deprecating/obsoleteing the old method?
reading build output
wait never... i didn't get any sleep last night, stayed up all night watching that dumb debate lol
np's
Is there any reason GetNetMode, GetOwnerRole, IsNetMode aren't callable from Blueprint?
It's just not exported, exporting all would add quite some overhead, same applies to making all functions virtual which would impact code size and performance
Yeah I actually found it quite odd things like the role variable aren't exposed to BP when I was working with someone else, seems like basic stuff like that should be in
So I have a challenge I need to overcome when it comes to UE4's multiplayer for a project I'm working on. My target player count is roughly 200 or so, 300 at most if possible. Now, from talking with people that are working on Squad, I hear the UE4's server struggles at anything about 70-80, mostly because it's hitting one thread really hard. In trying to get around this limitation, I've come up with three possible solutions, I need to know if any of them are possible. Solution 1, which would be the ideal solution, would be to somehow spread the workload out across more cores to lessen the load on one core. Solution 2, which is assigning multiple servers on the same box to different CPU cores, and having them all control different segments of the map (eg breaking it down into 4 pieces and having 4 server instances running the calculations for each piece individually, then sending all the relavent information to the client). And finally, Solution 3, where I strategically hide segments of the game, like elaborate doors or hallways, to seamlessly travel between servers while remaining on the same map (I know the opposite is posisble, with staying on the same server but going to a different map, which wouldn't really work here). Would any of these actually work, or is there a better idea I haven't thought of to solve this problem?
Hm, for bigger player counts, you could also just trash the UE4 servers and use a Server system that is suited for it. UE4 servers were always kinda meant to be used for games of the size of UnrealTournament.
Yeah, seems to be the realization Squad is coming to as well. Ideally though, the project would stay pretty close to the UE4, since major deviations might make it difficult to keep up with engine updates or introduce issues. Not to mention, I wouldn't even know where to begin with alternative server solutions.
At the end of the day though, I'll use whatever tools I need to in order to make the game the best it can be.
If you don't know how to create such an alternative server solution (or use an existing one), you may want to find someone who knows. Otherwise this will be a pain in the ...
Learning something like this while creating a project only will discourage you to continue the game, as you will face so much try and error
anybody remembers author or link to that good multiplayr documentation (not epic one)
thanks, so many questions about multiplayer on forum time to paste this link a few times π
i thought it was Cedrick's but could not find it
one thing i like about discord is on the top right yo will see a pin, which is pinned messages per channel
in which you will find the link to this - imo it should be a little more prominent tho that a channel has pinned content
oh i see that tiny pin now.
@knotty kelp it will be costly but oodle support is coming to unreal, what caps you out after you go over 100 players? I know you need a big CPU to handle your physics or things start breaking down
if you had a master server, you could do a server migration style system where when players move to map B you could just migrate their save game to that server and have them connect to the other server - kind of like Arks dedicated server save game migration system
its a gross over simplification but thats kind of how EVE works, every "system" is a server (but really there are clusters by region)
hello
anybody knows how i can initiate a listen and set the gamemode when i open a level
on your dedicated server? or your local game client
local game client
a lot of this is when you open the map
so from your main menu, you open the map with the listen flag, and that map itself defines its game mode
and by game mode you mean what game mode class you have created correct?
yes
i'm using the openlevel with added options
i have tried it several ways
listen&game='gm'
for example
it changes the gamemode
but for some reason it's not activating the listen
even if i make it game='gm'&listen
it does the same thing
hold on loading up my project
ok
oh
this is from C++ btw
the openlevel node uses clienttravel
i remember the qstring params not being http spec caught me for a loop too
i also use ETravelType::TRAVEL_Absolute which may be a factor
i.e it could be taking the game mode of your current map and applying it over
that may be a good test
i.e setting your current one to something whacky and see it sets it to that one
like from map A
cool well hope that helps
it helped
*gives imaginary help points&
like i said 10x man
i tried it i think it works now i need to try it in steam
π
@fast zephyr I'm the author :P
hey cedric
yes now i remember it was you cedric π
it looks like there is new wave of people that are getting to "i want multiplayer" level of unreal skills
@marsh shadow Hey (:
@fast zephyr :D I hope so
it is always same trap with multiplayer, they code game in blueprints with listen server, check "replicate" then wionder why actual remote clients do not work.
it took me whole weekend and 0.7 bootle of rum to figure basic multiplayer stuff
yea, starting with a mp design is ideal imo - it really makes you segment your game logic better
its too easy to couple your designs in single player, in mp everything needs to be brokered correctly
thats how i learned, just kept beating my head against that wall until clarity eventually formed
@knotty kelp that really depends. the question is where is the bottleneck ?
If the bottleneck lies in replication of properties, RPC then you would need to spread it over multiple threads if possible,
but that's unlikely imo
Bottleneck is probably simulation itself,
my first bottle neck was cpu /w physics
turning off skeletal animations on the server helped a lot, but then again some games you can't get away with that
i would guess so to in case of many players on single server
the problem here is
that unreal game code is inhernetly single threaded
and there is no easy way to spread it over multiple cores
^^
uobjects should be thread safe
same goes for physics
you can't really make async traces without running into race conditions
SpatialOS solves this problem
but for unreal it would mean, rewriting entire UObject code to make it thread safe, and then rest of the engine -;-
it's probabaly doable for something like AI, if you can offload AI to other system and communicate with messages
but it's not going to wrk for fast paced games
I'd love a talk from the Ark server team guys
*guy & gals
actually at steam dev days I think there were be some people from the Ark team there, maybe I'll buy them all the booze for some tips
I honestly don't think there is any particular things going on
My guess would a lot of compromises had been made
well they went out the gates a year ago with 70 player support, and they have a ton of servers, it'd be interesting to hear how they've managed this
hey I got a question
I need to get the name of the player, and the name of the other person connected. So two player names. I am casting to the player state and getting the player name, which gives me the name of the player
but how do i get the name of the other guy connected?
get all actors of class (you player state object) then iterate that list somewhere
cool, thanks!
PlayerStates are replicated to everyone and are located in the GameState in the PlayerArray. That's how you would access everybody's PlayerState. Iterate through them grabbing the name from each
YES use the GameState and its PlayerState array
Don't use getallactorsof...
redirects @thorn merlin to his compendium
yes, i keep meaning to read that, im sure there are gaps in my knowledge and some bad habits π
@thin stratus hi, is it possible to do Steam voice chat (mic always on) with blueprints only or does it require c++?
@frank quartz Never used Steam Voice Chat.
It's on the list for a (still private, but hopefully soon public) steam/session example project (c++)
cool looking forward to it π
Alright thanks @thin stratus and @amber plume
I have another questions
it has been bugging me for a while
so, I when my player spawns. Only the server is possessing it. I tried using a Run On Owning Client RPC and tried using the Switch Has Authority (remote) node. Nothing seems to work
not sure why my client won't posses his pawn