#multiplayer
1 messages ยท Page 466 of 1
if you put your cursor over it, it tells you, i cant remember which is which
but one is when they have a controller asigned
you can't override engine implementation of PostLogin from BP
you can HandleStartingNewPlayer
HandleStartingNewPlayer is called after PostLogin and after SeamlessTravel
PostLogin is not called after seamless travel
HandleSeamlessTravelPlayer is called instead
I uh, I'm trying to create a lock-on the continuously get's the opponent's location and rotates the camera to follow it
atm I have this
My issue is that player 2 is locked onto their own location, and it's only their initial location, player one is also only locked on to the initial location
@main halo Not sure if this is what you meant but it's not working .
I also realized there was a little bit of redundancy in the blueprint before so it's now only two custom events
It's a bit hard to tell what's going on, but the LockOn event needs to replace "Opponent location" with"Get actor location" of the "player pawn".
Can i use a mysql database for Matchmaking?
@main halo what if I get rid of the variable and combine the two events?
cause this is what it looks like right now
the opponent location event was redundant so I removed it
So that the logic in "set player pawn" is included in "Lock On"? No, getting the player array and looping it is unnecessary to do. Is this like a 2d fighting game? The characters will always have the other "locked on", or can the player choose the target, somehow?
well it's a fighting game, just not 2d
think of the naruto games
probably the easiest way to explain it
oh, or devil may cry
and yeah it's only 2 players
but I don't know if I want them to always be locked on
I'll figure that out later, just trying to get all the core systems working for now.
wry.
Okay, so what you want to do is to setup the logic for the characters to set their target - the opponent in one event. Honestly, I would just use tab or something - that can be replaced later. So pressing Tab - the opponent is selected as a target.
Then, during the lockOn event, get the target actor location.
i'd just set the Target pointers at the time of spawning them and mark them replicated
this is ridiculously convoluted
2 players and no intention of ever being more?
I mean
In the future I had hoped to increase it but I'm sure I can burn that bridge when I get to it
you add a team variable to your PlayerState
integer, name, color doesn't matter as long as it varies by team
you have a pointer (or array of them for 2+ players) of enemy players in whatever class it fits most naturaly, APlayerCameraManager perhaps
it queries the GameState, gets its PlayerArray and adds the pointers to the Pawns that don't have the same team ID
now you have an easily accessible array of enemies
you can implement GetTargetedEnemy() function that in 2 players just returns the first element in the enemy array
in more then 2 you can do things like InputKeyTab->Increment Target Index-> TargetIndex = TargetIndex % NumberOfEnemies and have the GetTargetEnemy() return EnemyArray[TargetIndex], works with just 2 players just fine
as those are Actor poitners, GetActorLocation returns their current location at all times
well, good luck deciphering it, i am off to bed
lol, g'night, and thank you
@elfin veldt my man is bringing up naruto games as an example when he can just say mortal kombat
what a champ
how do you guys handle replicating visual side effects of players operating their weapons to other players? such as anim montages being triggered on the weapon or the player, or particle effects, or sounds
RepNotify int to trigger muzzleflash / gunshot start sound / firing anim montage
Then in my case I can replicate a single repnotify vector (either blocking hit impact point or trace end) and then the remote clients can create the beam fx / impact fx themselves
Because my anims aren't tied to the weapon / fx they should play
I mean I could fire a generic notify
And have the weapon play fx through that
But it's easier to just do it explicitly in the weap I find
Are your weapons their own class?
yeah
It's the same amount of data sent though anyway (an int). Either the onrep triggers only the anim montage and the anim calls the weap fx or I just call them all together
It shouldn't make a difference
Is there a reason UnrealTournament stores health as an int32 but most examples (including ShooterGame) use floats?
I guess cheaper to replicate and doesn't need the accuracy of a float?
what class handles spawning? (looking to make 1st player spawn at x and 2nd at y .. ect)
@supple crypt the world handles it GetWorld()->SpawnActor<ClassToSpawn>();
What I mean in a multiplayer game what class is handeling the spawning gamemode, playercontroller as example
ok i got a question
Ah for players, usually the gamemode would spawn them
At least that's how I do it
so im working on a project with @magic harness and was wondering if there was a short term thing using a extra pc for back end
On post login, I have a ref to the controller so the GM can decide what / where to spawn
that maybe we could use for testing features in game
I cant override Online Subsystem in DefaultEngine.ini, and according to the documentation, this is the order of the configuration hierarchy, with values in later files in the hierarchy overriding earlier values:
- Engine/Config/Base.ini
- Engine/Config/BaseEngine.ini
- Engine/Config/[Platform]/[Platform]Engine.ini
- [ProjectDirectory]/Config/DefaultEngine.ini
- [ProjectDirectory]/Config/[Platform]/[Platform]Engine.ini
- [ProjectDirectory]/Saved/Config/[Platform]/Engine.ini
Therefore if I add this to [ProjectDirectory]/Config/DefaultEngine.ini,
DefaultPlatformService=Null```
The resulting default platform online subsystem service should be Null, but its not.
???
What's the best way to replicate Projectiles from the client using BP?
Does anyone know how to run and set up the dedicated server for the ShooterGame project?
Yes
Hi guys I been using unreal for a bit now I wanted to jump into learning how multiplayer works do you guys know of any series that is worth watching for this ? and also is there a place like gumroad(a site for professional artists to sell their products/ tutorials) for blueprints?
Is there a way to get a timestamp from when a specific client joined in any of the native stuff?
(say, from their pawn or controller or state)
can someone explain me, what is difference between this, and if i change myEvent to Run On Server?
how i see, there is no difference, i have same result in both cases
Run On Server means that the Event will be called by the Server.
By way of an RPC
Since your already gating it behind an Switch Has Authority (which will typically mean the Server) you will not see a difference.
so at the end, that can be same thing?
theyre not the same thing, no
its really just a macro
if you double click it you can see what it does
and make your own if u wanted to
okay, i understand it's not a same thing but result at the end is similar?
yeah usually like he said means the server
cool, thnx
hey guys how can I use tags for dedicated servers so the player can search servers with specific gamemode? I'm using advanced sessions plugin
Unrelated to the above question (sorry):
Aside from using "Advanced Sessions" plugin's "Extra Settings" function, is there an easy way to set the server name in blueprint with just a variable?
I tried this (passing a variable through upon creation and then text binding it to the variable in the ServerList BP) but it doesn't work (null). Assumedly some sort of "X doesn't exist on Y" issue.
Hello, I have another unrelated question :)
How reliable is the "ownership" in RPCs? Let's say I have Suicide server-only function on a PlayerController, can the attacker fake the RPC call for other PCs or will the network layer figure out it's fake? I wonder how does Unreal do "authentication" for RPCs, I guess an open TCP connection could work for reliable messages, but then unreliable messages could be spoofed? I'm trying to figure out just what I can expect from the network layer.
it cant
you don't have other clients PCs
and even if you somehow managed to fake one, server wouldn't assign them a NetGUID
yeah exactly. server-side would reject it anyway if it doesn't think that client owns the object
and the server decides who owns what btw, setting the owner client-side won't do anything
And how does the server know that? RPCs have some sort of envelope that could be faked, unless it contains some auth info.
because the server determines who owns what
that envelope does contain a GUID
it won't accept an RPC from a client if the server doesn't see the client as the owner
which you don't know if you don't own the PC as far as server is concerned
also, GUID's are unique to each connection
ok, I see. so GUID gets established when a client first connects to a server
only way you could expose yourself to such an attack
is by setting bOnlyRelevantToOwner = false on the PC
even then it wouldn't work
yeah, the connection wouldn't match
well, if the traffic is unencrypted and you're sitting on a network element, you can collect GUIDs from passing packets
you can if you're sitting next to the server
GUID's are unique to each connection, so unless your sniffing between the wall socket and the server, you can't get the GUID's used for other connections
Actor A might have NetGUID 'X' for Client A, but NetGUID 'Y' for Client B
As a client you have no way of finding out
It's a long way between the wall socket and the server ๐ Or if your player is on a free-wifi he's essentially giving up his traffic for free. But yeah, spoofing GUID would need more deliberate attempts than just downloading a cheat program. Thank you both for the answers
Hey guys simple question: How do you modify the extra settings of a session in advanced sessions plugin? I cannot even get a reference to the session I'm in.
I'm trying to change the extra sessions whenever a new player joins
There should be an UpdateSession node
@thin stratus hm.. I tried running this node on game mode blueprint but I'm given this error even though I'm 100% sure I'm in a session
any idea why?
hi all, anyone know where can download examples and get resource for replication graph
seems their documentation is not in details
@thin stratus Does update session work to update number of players in server?
My lobby session never updates number of players, perhaps this could be a solution
That happens automatically usually
I see, it does happen for dedicated servers, but not for my player hosted ones
I was wondering if I'm missing some call somewhere
Is bAllowJoinInProgress working? If i set it to false players can never join, what does it count as "In Progress"? after StartMatch?
i guess i will use steam's SetLobbyJoinable() for now
I think it counts as In Progress once you start the session?
@plush granite What do you mean it should be null? If you set it to Null, the base class is used as far as I understand.
@plush granite What do you mean with "the resulting default platform online subsystem service should be Null"?
So there are a bunch of Online Subsystems Modules
OnlineSubsystemFacebook
OnlineSubsystemGooglePlay
OnlineSubsystemIOS
OnlineSubsystemSteam
OnlineSubsystemAmazon
OnlineSubsystemGoogle
OnlineSubsystemOculus
OnlineSubsystemTwitch
OnlineSubsystemNull
The game will load the OnlineSubsystem specified in
DefaultPlatformService=<HERE>```
@lime skiff
So therefore if I write
DefaultPlatformService=Null```
in [ProjectFolder]/Config/DefaultEngine.ini
It should set the DefaultPlatformService to OnlineSubsystemNull
but it does not.
I've verified this by dumping the GEngineIni config at runtime
For anyone else thats interested in helping here is the original question: https://answers.unrealengine.com/questions/899395/cannot-override-online-subsystem-in-defaultenginei.html
@plush granite did you update your PublicDependencyModuleNames thingy in your build.cs file?
No, I dont think it matters?
sure it does
How
if u want to use the online subsystem
you have to tell it
its not there by default
the online subsystem is loaded by default
no its not
You just have to add the online subsystem in general -
I mean, I might be wrong of course
but its worth a shot
pretty sure youre wrong
Well
it aint black magic
What platforms are you targetting?
using Null
I havent done any platform specific code
What operating systems does your project support
Whatever the default is, since I havent changed anything in regards to that
Did you change the DefaultPlatformService in DefaultEngine.ini ?
To Null yes
[OnlineSubsystem]
DefaultPlatformService=Null
Either way, the stuff in the build.cs is the only difference I can see between urs and mine
so was worth noting
Is there a reason you changed the DefaultPlatformService? Did you change it because it was something you didnt want it to be?
No its just that before I headed into using steam, I wanted to test out the Null one
Both worked
im gonna give what you said a try
but i think ive already tried it
i hope you're right xD
In ShooterGame when a weapon is unequipped, they simply detach it in place and call SetHiddenInGame on the weapon mesh, it works great but how does it manage to not collide with anything or otherwise interrupt gameplay if it's only being hidden in place?
For example, I had a weapon that had a light attached, and the light of course stays active, so it's just a light floating in space until re-equipped
Of course it's trivial to also hide the light, but I wonder if this is the way most games do unequipping?
Trying to find if SetHiddenInGame actually affects collision too which would make sense- then the unequipped weapon truly wouldn't accidently absorb bullets or block pathways
Hidden in game doesn't affect collision, you can disable it yourself if you feel the need to. Shooter game is a very bare example I wouldn't follow it closely, just use it to see how they did certain things then do them the way you think they should be done
Ok thanks!
I guess I never accidently bumped into the weapons then
Scares me to think of loads of hidden items floating in space around the map ๐
Will make sure to disable collision on them too or move them to a point outside the map when detaching
Just do SetActorEnableCollision(false)
Perfect!
Iirc they do indeed block projectiles so it's definitely needed
Ah yeah they ignore collision on the mesh other than traces and projectiles
thanks!!
Np
For a health component, since it doesn't have the concept of a role and using GetOwnerRole() == ROLE_Authority returns false for clients, would it be the best option to instead of setting replicated health values on begin play within the component, to move those to a function and have the owning client actor call them on the server?
Or is there some other way to check if on the server's version of a component?
Maybe GetOwner()->GetRemoteRole() == ROLE_Authority
But that would then return false if the listen server host
Would RemoteRole in the case of a listen server client case always be the server?
Looks like the CMC does something like this CharacterOwner->Role == ROLE_Authority. Ah I guess GetOwner()->Role == ROLE_Authority works fine!
Hey guys ๐ Anyone have an idea what would be causing this animation jitter on multiplayer? https://gfycat.com/understatedsociablecanvasback
Anything from the hogwarts to westeros could be causing the jitter
welcome to multiplayer
It looks like you just have a mismatch in values between the server and client
i.e. you are setting your movement speed differently on the client and it's constantly being corrected
Didnt you run into an issue where your values were not mismatched, yet didnt work on listen servers
cuz cpc crap
Kyle
you mean the no interp between moves?
And also no anim interp between net updates?
Yeah, it seems it does it in every other scenario
But not for listen server hosts
How did you solve that?
I've scoured the internet and most of Epic's responses are, it's hard to solve or not a priority atm
You can solve it by:
Well basically solving it correctly would mean doing your own interp in a modified CMC
I'm too dumb for that
But if you have a low player game and bandwidth to spare you can increase the client send rate and also disable move combining
It seems really fucking weird that its not a priority? it basically means making a multiplayer game without dedicated servers is not ideal at all
Yep
Many forum posts complaining about it
Best to submit a bug report to show Epic that it'd be of use
Honestly seeing how they do it in every other case it seems trivial
Blend from last update and extrapolate if the next update is late
I am guessing they just had more important things to focus on
like fortnite?
Yep
yeah
probably got 90% of their staff on that shit
even the janitors are pitching in
What someone said before would be great- having dedicated servers automatically being created behind the scenes even playing in a listen setting
That'd mean all multiplayer sessions would work the same
And there wouldn't be these weird edge cases
Hold up though
If you want an object, that is not a character to move on the server
like say...
just a regular actor, thats like an airplane
you'd need to interp that shit by urself
no?
Yes
CMC does a lot of amazing stuff
But it's bloated
With the power comes great bloat
cmc is flawed up the anus
and the option to use any of the other collision components
I'm probably out of my element here, but what's cmc?
character movement component
Divo here is probably thinking we are some mad geniuses talking about complicated networking
well when you said CPC I was like... is that some sorta procedure call that's different from an RPC?
haha
k
clearly photoshopped
fake news
@grizzled stirrup there is a udemy course that I think teaches intern in ue4 c++ in detail
they do it with a car that is a pawn
interp
*
Yeah but I don't trust that guy at all haha
sam?
So the things they are teaching often is not the way Epic or a dev used to working with the engine would do it.
Yeah it probably does
I'd just always favor something like the tom looman course which is full of really good examples
But yeah no interp
It's basic but he does things the "right" way in terms of how Epic do things
jus the multiplayer aspect
yeah... but
he barely dives into anything
where is the real useful stuff
Also
I think the Sam course is epic approved
no?
I know most of their stuff is
I did the whole Sam course and it's good but he stops basically at the edge of a cliff and never ties things up
Yeah
It's rare to find any good info
The best place would be honestly the CMC source and and extract what you can
or UT code
Yes
Have you considered the advanced steam session?
No but I heard it's good
is it c++ or blueprint
yeah
you don't need C++
also 111 euros
jesus
looks like its just steam party though
I'd definitely recommend looking into this one, it got some great stuff - https://www.unrealengine.com/marketplace/en-US/slug/matchmaking-server-function
In blueprint, I have a multicast RPC with a breakpoint on it. It triggers only once. But if I attach a Print String node at the RPC function, it says:
Client1: Hello
Server: Hello
So breakpoint in blueprint editor only trigger once, even if the RPC is called on multiple clients?
The server wouldnt trigger the rpc would it?
It's a listen server
ah
hey @grizzled stirrup and @twin juniper I was reading your conversation I'm currently going over the steam integration series from epic what do you guys recommend after that to understand more of the multiplayer aspect?
What steam integration series are you refering to? @hoary sandal
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 M...
One thing you could do is download the free advanced steam session plugin
Its all blueprints
And try to study it
@twin juniper cool thanks also @grizzled stirrup mentioned these two sites called UT and CMC but when I do I search on those I get a lot of results that have nothing to do with unreal, could you give me more details to find them?
character movement component and unreal tournament
Two good code sources to learn from
oh my bad I thought those were sites, yeah I'll definitely have a look at unreal tournament, what is the thing that is good to learn from the character movement when It comes to multiplayer that got me a bit confused
Honestly unless you are having specific interp problems you should be able to just use it
You shouldn't need to read it / know how it works ideally
no no what I meant to say is that I failed to see the connection or how are these two related
Oh they are just two good sources of interp code
is it because I need to understand locomotion in a multiplayer environment?
They have elegant solutions to interpolating characters and objects around
So that everything appears smooth from all perspectives
Yeah I can confirm when I try playing on a dedicated server with default movement component, there will be little hitches and such when moving forward or tapping sprint over and over and stuff like that
its one of those things I only really noticed when I set up my own ded server. It won't hitch around if I'm doing a local server
well, to get sprinting to work properly with character move component, I think you'd have to make it a custom saved move
if try just to change the speed locally and then RPC that change request to the server, it will not rollback properly if that's needed
sort of like how they switch to crouch mode
"The main issue is that if a client is corrected back in time to before the Teleport was triggered, that client won't know to retrigger the Teleport as they repeat their pending move list, and the Teleport will appear to have been lost on the client side. This will make the game feel unresponsive in certain cases, especially in bad network conditions."
replace teleport with sprinting and I think you'd basically have the same issue
cause say you have move 1, move 2, sprint, move 3...and let's say move 1 gets rejected, if sprint isn't a saved move, the rollback playback would be move 2, move 3, and there's no sprint in there
although the saved moves do save velocity, but I'm not sure that would quite work properly without also making sprint a move
The big problem with just changing speed from outside of the CMC is, that it won't happen on the same frame for everyone.
Means if the Client sets MaxWalkSpeed to 1000 (from 600) and sends an RPC to let the Server do the same, it is already async.
This might look smooth on a low ping, because the RPC didn't take long enough to violate the SQRT(3) limit.
But if you have a higher ping, then the client might move several frames with a higher movement speed.
Same goes for stopping the sprinting.
The SavedMove isn't even the big point here, of course it's required so that the Client knows it sprinted several moves back and can simulate that behavior.
However the actual big point is that the client needs to send the Sprinting as a MoveFlag to the Server, similar as to how Jumping is done.
That way, Server and Client will perform it in the same Timestamp.
Man, struggled through GameSparks + GameLift with barely any documentation to get a proper matchmaking service up and running.
GameSparks gets bought, changes pricing that sh*ts on indie devs.
Now I have to go through the same struggle with PlayFab and Azure. Why do all these services have barely any documentation and if they have it's outdated and no forum posts.
You think UE4 has shitty documentation? Even without the docs and the wiki we have a better documentation than these third party services >.>
"We support Windows and Linux builds. Just choose it when uploading your Game Server Build in the Container dropdown."
There is no Container Dropdown in the newest version of that page.
If anyone already went through the process of using PlayFab and it's internal Server System with Linux, let me know -.-*
Yeah, I just use Gamelift atm but it is also shit
a lot of documentation where they assume you know some small tiddbit but they never explain it
MP isn't really beginner friendly
There is so much to learn, at some point documentation isn't the answer
Gafferongames etc are really good sources of general knowledge of MP
@ivory portal Currently going through GameLift integration myself. This is exactly how I explained it to a colleague lol. Small important tiddbits that arent documented but stop you in your tracks until you work it out lol
@bitter oriole Is that related to my text?
@ivory portal @fossil spoke Yeah took me a while to get this working, but the documentation on the features etc. was still a lot better than what I face with PlayFab atm
Sadly it's my client's decision what service to use >.>
Yeah i have nothing to compare to with GameLift. The documentation is ok. Just those little things that could have saved alot of time messing around that really ended up being really small things
Na, I'm just annoyed at PlayFab :P @bitter oriole
Yeah I see that now
@fossil spoke The thing that took the longest with GameLift was understanding their REST API cause it was just opened up when I was using it
The UE4 integration as well as the Build Upload process is relatively okay
+- the Install.bat stuff, but it's kinda logical that UE4 needs some preinstalled stuff to work
Second thing that threw me off was the missing certificate not allowing communication with GameSparks >.>
The Client one?
I tried making my own plugin as that didn't exist 1-2 years ago. But only for a small prototype for a client.
Yeah its not as bad as i thought once you get your head around it
Its probably alot better now than back then
I even just stopped integrating myself and just started using a plugin from the marketplace. Sometimes I code my own stuff a bit but at the moment the plugin does most of the integration
I took a look at one of the plugins that was about but it wasnt as well put together as id have liked. I ended up just goivg with my own integration
If you are just using C++, you can use their SDK and that's it.
The Plugins are only really relevant if you are doing BP work
Yeah pretty much.
anyone here done networked physics (simple physics) and got any tips or links, thanks :D
i saw a video of how rocket league did their netcode, but need some guidance on how to do their client prediction with physics
since rocket league use ue3
rocket league has an extremely specific setup that lets them do it
there is no generic implementation for client-predicted physics
also overwatch did similar style
It's a losing battle and a problem that hasn't been solved since the 90's
hmm
fortnite uses client-auth for all it's vehicles
character movement does client prediction, because it's kinematic
do u have good doc on a client auth model?
vehicles are not simulated?
like how to anti cheat in client auth
it's an unsolvable problem, unless you have a very limited use of physics like rocket league does and can afford to rewind/replay the entire simulation
the client just tells the server hey im here, and client goes ok, i believe you?
and also how to do prediction for other clients...
no idea. Epic didn't go into specific details when I asked them about the anti cheat
server*
for obvious reasons anyone who has implemented good anti-cheat doesn't talk about it
:( secrets hmm
then again i have never seen rubber banding whilst on a vehicle
but i have whilst running
i guess ure right, this is a lost battle, just gotta find something that works...
fortnite is 100% client auth vehicle physics. The FPhysicsReplication system smooths out a lot of the bumps for remote players, but it's confirmed
it's not
Hehe
๐
basic client-auth physics means sending physics state to the server, and server sending that state to all clients
the server can do some basic validty checks
yeah. thing is anyone who has done good anti-cheat isn't going to talk about it, that would defeat the point ๐
oh i just did a lookup, the FPhysicsReplication does some snapping so stuff become more deterministic in sync... is it right
there's no determinism, it's just updating the physics scene with the latest available update from the server
it utterly sucks I'm not going to lie
networked physics is a nightmare
i guess these day they anti cheat my smpling, since a cheater will keep cheating, missing out 1-2 cheats wont hurt
but unfortunately there's just no way to simulate an object within the context of a physics scene without updating the rest of the scene too
So the only way is to change the entire scene and save it's state
and rollback/forward as required
In an ideal world, you would be able to simulate an individual object in the scene, and accumulate contact resolution/forces against other objects and apply at your discretion
But that kind of defeats the point of a physics engine
What I always wondered, isn't that the same problem you'd run into if you replay the CMC movement and in the meantime there is a block between where the char started and where it is now?
yeah exactly the same
there's not really anything you can do about it
CMC has the advantage of being relatively simple movement / shape etc
I've done kinematic movement for vehicles
Anything with an even remotely complex shape becomes a nightmare for collision resolution
@thin stratus it will be adjusted at some point later
The only way you can simulate this is indeed putting everything that is simulated (physics or not) into a bucket
this very issue is the bane of my existence
And having all of them react to the world being rewinded
As in, you'd basically need to, at all times, recreate the whole game scene from a timestamp
Every single object has to have a state saved for that
Physics alone might not even be enough or? Cause non-physics stuff could be spawned in the meantime
yeah that's why characters still go a bit crazy when two laggy players walk into each other
rocket league save state for all vehicles, and replay physics for all...
yeah but rocket league only ever has a maximum of nine physics objects, so it's easy
certainly much simplified scene yes
full networked physics i dont think is ever possible with player input
not without deterministic lockstep.. which in a modern world isn't gonna happen ๐ฆ
unless we break speed of light
pretty much. when the internet is one big lan connection we'll be fine ๐
I'm hoping the upcoming physics engine at least gives us the option to move objects independently of the rest of the scene, but somehow I doubt it will
yeah so far they're only talking about destruction, which is a bit annoying.. but i guess it's a good marketing appetiser
they said it was made with networking in mind, in one of their more detailed talks, but did not talk much on how
so much secret
is there even a theoretical way of making a good networked implementation
(for general purposes)
not really. I've tried it so many times. The best approach I think you could hope for is to create an immediatte physics scene for each object, and copy main scene data into it, run the immediatte sim then copy back to the main scene
I started on that, then when articulations and such became involved it became a total cluster of pain
A generic client-auth implementation is straight forward enough I would say
Hell I have that already, just without the anti-cheat part
yeah it really is... also there's the question of what does the server do while it's waiting for client packets
just re-sim with old inputs probably and round them down to zero over time, but the desync server-side would be awful I expect
lot's of tuning still required depending on the game
yeah i mean for purely cosmetic purposes we could do a fixed timestep thing across all sims
at least if we could simulate objects individually in the primary scene and accumulate forces and contacts, you wouldn't need to copy soooo much data around
So games like Human Fall Flat are all client auth?
it'll still have some issues with contact between player-controlled objects - but it'd be an acceptable starting point I feel
How do they go around the sim problem?
It's basically a 3D "puzzle" game
Where everything is physics based
Or they just don't care about lag xD
hard to say how well the MP stuff works without actually playign the game though
watching trailers or gameplay isnt all that telling usually
If you see multiple minutes/hours of coop gameplay, it's really not broken
Which you'd expect it to be
Same with something like Gang Beasts
engine?
Although they have sync problems iirc
Unity for Gang beasts
No idea about fall flat atm
Apparently also Unity
that does look quite well implemented
oh, seems like it skips lag compensation entirely
send input to server, wait for result
probably deterministic lockstep maybe
lot's of RTS's and such still using that kind of thing
but yeah the caveat is the huge input lag usually
i think it just sends everything...
prolly just some mild interpolation on clients
yeah
The work was all about optimisation, particularly compressing the stream of information that would synchronise the state of the world for each connected player. He read Glenn Fiedlerโs Gaffer On Games blog for generic tricks that reduced the information needed to describe the rotation of objects. He reduced the amount of shards and rubble that glass and walls would shatter into. And he really needed to fiddle around with how objects sleep.
so hes not running anything on the clients
fortnite's anti-cheat is a joke, i think anti-cheat is really just a lost cause cause people will always find a way to cheat
Modern anti-cheat relies on actual anti-cheat, a good server architecture, a report and ban system
No such thing as just one anticheat software
It's not a lost cause - CS Go has has great success at combating cheating, and they basically guarantee that regular players never see a cheater
Of course it's a huge amount of work
yeah the report and ban part of anti cheat is probably the most effective bit I think
but you need so much support for it
Yeah, Valve has a report -> jury -> ban loop that works very well, creates trust, and is the perfect foundation for deep learning
Is there anyone who has experience with Online Subsystems? I'm can't override the online subsystem on iOS. Please anyone
I've been stuck on this for a week now
does any1 know how to create a custom launcher for a game?
I want to create a game for mac,linux and windows with opengl shaders
Why do you need a launcher ?
Aren't you going to release your game on Steam, or Itch, or GOG or Epic or ... ?
idk, just want to make my game extra special?
Special how ? What will your launcher do ?
just launch and maybe give some patch notes on the side
Does it has to update your game too ?
Because a launcher that launches is like, 100% waste of time for you and players
Launchers exist to update games outside of Steam / etc
So I think I found a bug in the way UE4 loads config files?
In the docs (Which last update was 4.9) https://docs.unrealengine.com/en-US/Programming/Basics/ConfigurationFiles/index.html
The file hierarchy for config files is wrong,
but its not only wrong for UE4 4.22.2, Its wrong for 4.9 too (the last time this page was updated)
If you take a look at
static void GetSourceIniHierarchyFilenames(const TCHAR* InBaseIniName, const TCHAR* InPlatformName, const TCHAR* EngineConfigDir, const TCHAR* SourceConfigDir, FConfigFileHierarchy& OutHierarchy, bool bRequireDefaultIni)```
in `UnrealEngine\Engine\Source\Runtime\Core\Private\Misc\ConfigCacheIni.cpp`
you will see that the file hierarchy is actually like this:
1. Engine/Config/Base.ini
2. Engine/Config/BaseEngine.ini
3. [ProjectDirectory]/Config/DefaultEngine.ini
4. Engine/Config/[Platform]/[Platform]Engine.ini
5. [ProjectDirectory]/Config/[Platform]/[Platform]Engine.ini
6. [ProjectDirectory]/Saved/Config/[Platform]/Engine.ini
So basically switching 3 with 4
so
[ProjectDirectory]/Config/DefaultEngine.ini
is going to get overwritten by
Engine/Config/[Platform]/[Platform]Engine.ini
Solved my problem! ๐
it looks cool!
I am doing a multiplayer game and I have a problem with synchronizing SERVER and CLIENT sides of Character, Controller and PlayerState.
Sometimes functions I have to be in the BeginPlay of the Character but after the PlayerState run into its BeginPlay. For this I am trying to Sync the three main classes of the player but the problem is that in Server side of the Character I cannot access the controller so my component (the SynchronizerComponent) cannot go in the Controller.
Do you have an object that is created before these three and can be accessible from the three of them Server and Client side?
Does anyone know how to set up multiplayer via HTML5? (WebSockets)
@stone sentinel if I understand your question, Iโd suggest putting it in Possess for authority and PawnClientRestart for clients, since youโll have access to the controller and the character at that point
In your character class, that is
with c++ there are better options
OnRep_PlayerState, OnRep_Controller, SetPawn override
yeah, it will push new updates @bitter oriole
guys can someone help me understand when this function gets called for the HUD class? I am having trouble understanding it. AHUD::DrawHUD
the api says this but I don't understand it "The Main Draw loop for the hud. Gets called before any messaging. Should be subclassed"
@timid moss that function is going to be called every frame for your player, so any drawing you need to do would go in a subclass under that DrawHUD function
@thick shale Ok. So then what is the difference between that and Tick is then? Whats so special about DrawHUD?
DrawHUD will only happen locally for that player where Tick will be called in each world that actor is in
so all clients that see it, and the server will all run tick
so what would be the advantage of using DrawHUD though?
if it helps on performance then I guess i just dont see how it does
that it only runs for the current player, on their machine. So it makes it useful for cosmetic stuff like UI.
The server and all other clients dont have to worry about running anything in there
it would be a waste if everyone you were playing with also had to run UI code that only you would see
so thats where the performance benefit comes in
ok i see now thats really cool! i thought the hud class only existed on the client though anyway.
right, since it exists only on the client, and you know the DrawHUD function will run every frame, you can do all your UI stuff in there without having to worry about gating it to the local player
but what i am confused about is since the hud class only exists on a client. Then even if you did use Tick instead it wouldnt matter right? because if you are a client you only have your HUD class that runs Tick and no one else's. And same for every other client. And the server wouldn't have any HUD class at all, so no unnessisary HUD class's tick wont run there either.
yeah I thought so too
but my HUD's begin play runs on the server
so I dunno anymore
wut
my life is a lie. I saw this graph which made sense to me but now you just confused me
HUD is local only
well technically
HUD is not replicated
and HUD does not tick on dedicated servers
playercontroller is server and owning client only
so if u'd want the hud to tick on dedicated servers
would you use playercontrollers SetHUD or whatever its called
override that one?
why would you want it ticking on dedicated server?
its purely local and should not care for the server nor should the server care for it
but it does tick for every player right?
no
well the thing is
In my HUD'S tick function, I have an if statement, which is true once a variable in game state is true, and that variable turns true once all players have finished loading into the map, so the timer starts at the same time for everyone
you saying this wont work?
its local
its spawned when the player controller is created
if you want to do stuff when the game starts
bind it to the gamemode state changed or something to initialize the hud
gamestate*
As long as the player can access the game state from the huds tick
then its not an issue
yup I understand now what you mean, was confused for a moment
Random question
If I have a fairly lightweight multiplayer game, for testing purposes, would it be fine to act as the dedicated server + play as the client
Just asking because Im not sure if it would be skewed or something
Could anyone answer a quick question for me? I am using seamless travel to move multiple players to a new level, the game mode for that new level has Event Handle Starting New Player but this doesn't get triggered for each of the new clients, only the listen server
Anyone know why that is?
I have this RPC call trying to cause it to init the player controller on each of the clients
but only the listen server's client gets it successfully
It does successfully create call restart player on each controller, so the issue is with the owning client RPC it would seem
Hey guys - I'm trying to setup a multiplayer game hosted by a PC, that mobile users can join. Is there anything I should be doing specifically to get this working properly or is it the same as any multiplayer setup? Would the only subsystem option be through IP?
@lament cloak If you call SetActorLocation from the Server, then the location would get replicated just by normal property replication
but the client would report it likely as a misprediction, yeah
wait, but if you override RestartPlayer in GameMode then you could specify the starting spot there, and then it would just spawn at the correct location
rather than spawning it wherever and then setting the location immediatelya fter that
well, so the default implementation calls RestartPlayerAtPlayerStart, which does actually check if you already have a pawn
it only spawns a new pawn if there isn't already one
same thing if you instead call RestartPlayerAtTransform, I guess
sure, no problem
To host a game that an Android will connect to, would it be best to use 'Create Session' or is there another method for opening an IP listen-server?
Or just an 'Open Level' node with 'listen'
that is weird
Is mobile multiplayer just undocumented and lacking in Unreal? Can't seem to find anything accept for lots of confused people wondering why it's so difficult.
I think you should just be able to run a standalone build on your PC and then have the mobile device connect to the local IP, assuming the device is on your WiFi and your router forwards the ports
if the mobile device is gonna host the game, then I have no idea about that
So I'm following this wiki to replicate UObject: https://wiki.unrealengine.com/index.php?title=Replication#Advanced:_Generic_replication_of_Actor_Subobjects
But is it possible to replicate UObject, when their outer is Actor Component, which is owned by Actor?
I haven't tried it, but I'd guess it would work as long as the actor, actor component, and uobject as a property are all set to replicate
because if an actor isn't replicated, then its components wouldn't be either
Will there be some extra setup required?
For example, in the guide I linked, there needs additional code to replicate UObject.
Also... How can I tell if it is or it is not replicating?
Is there a good way to test..? I'm just getting nullptr for the UObject now.
I think you'd just a.) set bReplicates = true; in the Actor constructor then b.) call SetIsReplicated(true) on the component when you create it after spawning the component and then c.) in your ActorComponent you'd set that UPROPERTY as replicates. d.) implement GetLifetimeReplicatedProps in the ActorComponent
probably? I haven't tried it
one way to figure out if replication is happening is to declare a custom ReplicatedUsing function, cause then you could put a breakpoint in that function when it gets called to see if its replicating it
like
Yep, I'm using the ReplicatedUsing method. That should be a reliable way hopefully.
For UObject replication, the wiki said additional code like this is needed:
bool AReplicatedActor::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
if (Subobject != nullptr)
{
WroteSomething |= Channel->ReplicateSubobject(Subobject, *Bunch, *RepFlags);
}
return WroteSomething;
}
I'm feeling really wonky doing this ๐
right but in this case the subobject isn't on the replicated actor, it's on the actor component, right?
Yes. And... Due to the gameplay, the subobject's outer can be changed from / to an Actor, or an Actor Component.
well, ActorComponent also has a ReplicatedSubobjects function, so maybe if you did that?
what are you trying to do exactly, anyway?
I'm building an inventory system. I have a UItemInfo class which inherits from UObject.
It can either be set into an AItem Actor class if the item is out in the world, or be added into a UInventory Actor Component class if the item is picked up.
If Actor Component has a ReplicatedSubobjects function then it sounds like the missing piece.
I was also suggested to use a plain struct for Item Info.
But that seems to strip away its reflection features so I'm not too sure.
would the CDO of the UItemInfo be enough, or like do you make different instances dynamically at run time with different potential properties?
UItemInfo has multiple subclasses for different "concrete" item classes.
Some subclasses have properties that change at run time.
I'm not familiar with CDO either ๐
ah, so like if all of the UItemInfos were strictly defined in the editor, you could just store TSubclassOf<UItemInfo> and then only need to replicate that, which wouldn't require anything fancy I don't think
but if the properties change at runtime and you could have like multiple instances of the same item with different properties, that wouldn't really work
CDO is the class default object, so it's like the template object that you can instantiate objects from at runtime
Yes.
I think properties change at run time. For example, a weapon item's damage can increase / decrease.
yeah, so then you do need the actual unique instances
I think so.
Setting up components for replication across the network
It's describing my exact case omg
( Last sentence )
But it's not telling me how to implement all three methods
I think that's talking about the Actor replicating a generic subobject, not the component
also I can't find that InstantiateReplicatorForSubObject function anywhere, don't think it exists anymore
OnSubobjectCreatedFromReplication is defined in AActor
Right.
So how can I find docs / tutorials / info on replicating subobjects in a component?
Especially that I'm replicating a TArray of subobjects ( the array of items ).
basically
you look into Actor/ActorComponent source code after reading the tutorials that are surprisingly accurate this time around
"replicating subobjects unreal'
my buffs are UObjects, i keep them alive by tossing them into a non replicated array, i use struct inheriting from FFastArraySerializerItem that has a weak pointer to buff to manage them and client side callbacks to add/remove/modify them if needed
and they themselves replicate
Yeah... I didn't expect to need to study source code building inventory system.
It's a bit beyond my coding skill :()
But I'll try.
Oh wow that's so much information I haven't studied yet.
the client side callbacks are more then a little handy
Keeping objects alive, serialization, weak pointer
void PreReplicatedRemove(const struct FMissionContainer& InArraySerializer);
void PostReplicatedAdd(const struct FMissionContainer& InArraySerializer);
void PostReplicatedChange(const struct FMissionContainer& InArraySerializer);
void FMissionStatus::PreReplicatedRemove(const struct FMissionContainer& InArraySerializer)
{
InArraySerializer.Owner->HandleMissionRemoved(*this);
}
void FMissionStatus::PostReplicatedAdd(const struct FMissionContainer& InArraySerializer)
{
InArraySerializer.Owner->HandleMissionAdded(*this);
}
void FMissionStatus::PostReplicatedChange(const struct FMissionContainer& InArraySerializer)
{
InArraySerializer.Owner->HandleMissionUpdated(*this);
}
with normal replicated TArray, i'd have to back it up and compare to figure what got added/changed/removed
which is a pain in the arse
you can see a full example of implementing a FFastArraySerializer in NetSerialization.h header
I kinda see what you mean there.
It looks like a lot of custom engineering on your side. Do you know that it'll work from the start?
What if it's not possible at all?
i was sure its possible before i started because... its how unreal network works
i generally dislike having a struct manage a lifetime of a UObject derived object instance
so weak pointer there was a no brainer
but with that setup i have to use an array to keep them alive
as nothing had a strong ref to those buffs
So the array is solely for the purpose of keeping objects alive?
And unnecessary otherwise?
and i do access them for recalculation of attributes via that array as well
but
say my buff changed server side
i mark the struct managing it dirty
i get a postreplicatedchange callback client side
i call HandleBuffChanged from there
and i do have a pointer to the changed buff
i access the buff, i figure out what attributes its affecting
and i recalculate only those attributes
Owww I don't even know what dirty really is...
i did run into a nasty caveat
my buffs and my BuffContainer are in an ActorComponent
and server side its constructing them, passing itself as Outer
but when they replicate the Actor owning the component is Outer
:()
I just want my inventory with a bunch of abstract item info object to work on a multiplayer ๐ญ
depending on what your items do, UOBject might be too heavy
my buffs handle the entire UX aside from just modifying attributes
and being able to wire custom logic to them in BP was a requirement
most inventories can get away with just structs
I do want my inventory system to be as versatile as possible.
So my UItemInfo has properties that change, has subclasses, has functions that'll spawn its Actor form, and has functions that duplicate itself.
I'd like it to be available in BP cuz who knows what I'll need later.
You mean, C++ struct and not UStruct?
USTRUCT
Does UStruct support inheritance?
here is a tip
virtual UWorld* GetWorld() const override;
UWorld* UItemInfo::GetWorld() const
{
if (HasAnyFlags(RF_ClassDefaultObject)
{
return nullptor;
}
return IsValid(GetOuter()) ? GetOuter()->GetWorld() : nullptr;
}
This allows a UObject to Get World?
they do, but their functions and operators aren't exposed to BP
GetOuter()->GetWorld() is undefined on a CDO
this allows you to call static functions in UObject derived BP
Oh, that seems to be handy ๐ฎ
basically
as soon as you right click in the BP event graph
unreal calls GetWorld() on the CDO
if that doesn't error out, even if it gets a NULL back
it lets you go on with functions requiring world context
Gotcha ๐ฏ
Hey, trying to make a cross platform experience, where one player is VR and the other is on an iPad,
What is the right way to set this up, im opening a map as listen on the Host side, and connect <IP> for the client side,
The setup works fine in editor, but when i try to test it on iPad or Mac Editor with a Windows Editor host i get : TravelFailure LoadMapFailure
im expecting the experience to run on LAN
anyone ?
@grim axle is it that there's a map name mismatch?
the net connection will boot the clients if the map they're trying to load isn't loaded on the server
it becomes a problem if you're running through the editor, because it adds a PIE prefix to the map name
so for example if your editor thinks it loaded something with PIE and then your client on the other computer is trying to load the same level without the PIE prefix, it will kick you
most likely if you run the host in a standalone build, rather through the editor, it should fix that
if that's the problem, looking at the log more closely should verify it
I think the log message is "ServerUpdateLevelVisibility() ignored non-existant package..."
though I looked at the code again more closely and I guess as long as the package exists, it maybe is fine and won't kick you, hmm
the problem I had was because I was using package name aliases because I was using LoadLevelInstance
I just call Connect <LocalIP> and it joins the session and opens the map for the client, so there is no where im supplying a map name there
have a look at the log
ive posted them here
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1625231-cross-platform-windows-ios
Hey,
Im trying to create an experience where one person plays in VR and the other person is using an iPad, i want these players to connect to the same multiplayer.
@copper mango so i tried standalone PC and iPad build, and the crash happens after this line
Assertion failed: GetType() == FName(u"IOS") [File:/Users/build/Build/++UE4/Sync/Engine/Plugins/Online/IOS/OnlineSubsystemIOS/Source/Private/OnlineSubsystemIOSTypes.h] [Line: 10]
@grim axle Just to make sure stuff isn't mixed up: Connect <LocalIP> doesn't exist. It's open <ipaddress>. Further this does not join a Session, it only connects to the Server.
I'm sure you are more or less aware of that, just making sure that no one gets confused by wrong namings
When connecting to other instances of your game, you should never use PIE.
Standalone or Packaged Versions of your game should be used.
Further, what Engine Version are you running on? @grim axle
In 4.22 the file doesn't have these lines anymore
I am using 4.22.2
Yeah, im sorry for that, its open and not connect
So, after further testing today, i got my code to work cross platform across Mac Windows & Android builds with Find Session Join Session Create Session, but still failing to do so for iOS
these nodes always seem to fail for iOS, not able to get them to work
the nodes are always entering the 'Failure' execution line
Weird part is that the Source Code of 4.22 has no Line 10 in OnlineSubsystemIOSTypes.h
hi guys so I have a peer to peer session that acts as a steam party where the host is hosting a party and the other clients are people joining his party. When the host finds a game session, I want to send this blueprint session result variable to the other clients. I've tried sending it as a parameter or replicating it but everytime the client gets the variable as NULL and it can't join that game. What am I supposed to do? This should be trivial for every multiplayer game with party system.
also I'm getting the blueprint session result (the session) from Find Advanced Sessions blueprint
For a typical multiplayer first person shooter setup that isn't "true fps" (player just sees their first person viewmodel) and other clients see a third person character model, is this achieved simply by putting both the first person and third person models in a single character controller and then making only the respective parts visible to each client?
Yeah
You add two meshesComponents onto the Character
One already exists by default if you use the Character class as a base
Then you can use "OwnerOnlySee"
And "OwnerNoSee"
which are two booleans on the Mesh Component
Awesome, thank you
@copper mango thanks for the reply about mobile multiplayer. I have a feeling my issue is with the port forwarding.
hey eXi, saw some posts from you on my search for mobile multiplayer setup. Trying to get a PC hosting and an Android as client. Did you ever find a solid way to achieve this? I've tried direct IP but I can't seem to connect. I think it's port forwarding but I'm having a hard time cracking that, so I was wondering if there was a mobile online subsystem that worked well.
Do you have a router and setup the port forwarding?
I tried following some tutorials but found a lot of conflicting info. I added UDP to port 7777 in my firewall.
Inbound Rules
If you have any info on clear methods I would very much appreciate it
If it's a firewall setting you may want to setup both directions. Also 7777 may not be enough, enable 7778 as well. And i'm not sure whether it's udp only or tcp, i usually enable both TCP and UDP.
7777 is enough
If your router doesn't have nat loopback, you wont be able to use your routers external ip.
@plush granite I can connect if I'm testing in editor with 127.0.0.1
yea thats not your local ip
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : XXXXXX
Temporary IPv6 Address. . . . . . : XXXXXX
Link-local IPv6 Address . . . . . : XXXXX
IPv4 Address. . . . . . . . . . . : 192.168.0.9 <---- HERE
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : XXXXX
192.168.0.1```
I should know this though, hah.
Model of router and NAT loopback?
exactly
So if I'm going to demo this I'd have to know the router of the place I'll be?
a lot of modern routers dont support for "security reasons"
Oy
well
ServerIP = IP == MyRoutersIP ? LocalIP : PublicIP
You know ternary operator?
if (IP == MyRoutersIP)
ServerIP = LocalIP;
else
ServerIP = PublicIP;```
I do now! Copy that.
If you're going to demo your project on any random place, just bring a laptop and use a wifi usb spot you will connect to with your android, and it should be fine.
It's better not to rely on 'random place' network because it is likely wont work.
I literally just setup a mobile multiplayer the past few days
@rotund sapphire Awesome, great idea.
The next problem you're likely to run into is Online Subsystems
Yeah, so I don't need matchmaking or anything at all really, other than the ability to host the Android
It's not a game, I'm essentially streaming video and audio from server into a level populated by the Android
Once you compile a dedicated server out of your project you should be able to connect to it without online sessions. That is for advanced gameplay features and such.
So with just 'open IP'?
I followed this guide (https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux) and ran into all sorts of errors. Is there a better one?
no thats the best you're gonna get
@plush granite How does it know the IP?
So once dedicated server is up and running, all Android has to do is connect to same network and do an Open Level?
Which guide?
The one that you linked
I'll go through it again today
Brotchvorger what errors? You can bring those questions to #packaging maybe.
It was awhile ago but I'll run through it again today and post there if I have any issues. Thanks Robert.
I need ARCore capabilities, so I should just build the ARCore branch for the dedicated server yeah?
But if you can get your project to compile properly, then from there it should be rather easy to add the new targets and shoot a profile from project launcher which will cook you a game or server of your choosing.
Sorry, how do you mean 'new targets'?
Anything the server depends on will be required for the server. I'm not familiar with the ARCore stuff. :)
https://d26ilriwvtzlb.cloudfront.net/0/04/Testserver.png Those targets. One for a client build, other is for the dedicated server.
Ah, I don't know much about that. Is that covered in the guide?
@tribal solstice This helped me to start a dedicated server for testing a game. https://allarsblog.com/2015/11/05/support-dedicated-servers/
This document covers the bare basics on how to get your Unreal Engine 4 game project able to build both Windows and Linux dedicated server builds, using just a Windows machine for compiling. Requirements For 4.9.X or older, you need Visual Studio Community Edition 2013 For 4.10
Actually you may be enough to output a dedicated server only. And just cook the game from editor menus it should be alright. But i found it more consistent for me to use one single launcher profile that can output either a client or a server.
@steep grail Thanks!
Robert - I'm still a bit lost but I'll go through the guides and hopefully will understand.
it is a lot of info and steps but it will help you out
Appreciate it!
@rotund sapphire When you say to use a wifi usb spot do you mean an adaptor like this (https://www.amazon.com/Alfa-AWUSO36NH-Wireless-Long-Rang-Network/dp/B0035APGP6)?
You can experiment with the shootergame project, it should be possible to output a client and server out of it.
COol
I've checked that product and it's website but it doesnt really tells about access point features. But i just found you a better article, https://www.tp-link.com/us/support/faq/2021/ you can perhaps use this feature in windows 10 and your built in wifi just fine. See if that work and provides you access to your running dedicated server instance. Not sure about which IP you will access, but perhaps a ipconfig gives you a hint.
How to set up a Mobile Hotspot or Soft AP on Windows 10?
This could help too https://superuser.com/a/1229057
Thanks a ton. It's just a wifi long-range adaptor. Not sure if that's the same as what you're referring to.
There's one line in the ShooterGame pickup that is really confusing me, any help understanding it would be really appreciated:
const bool bJustSpawned = CreationTime <= (GetWorld()->GetTimeSeconds() + 5.0f);
if (RespawnSound && !bJustSpawned)
{
// Play sound
}
So it's to prevent stale sounds from triggering when clients come into relevancy range
However I don't understand the conditional check, to me it reads: If the creation time (on the client, since it'd be created when coming into relevancy right?) of this pickup is greater than or equal to 5 seconds into the future, play the sound
@grand kestrel Creation time is not set explicitly in the pickup and this logic is ran whenever the pickup is respawned
Just a little sound that plays when it's respawned
Ah right
I just find the conditional check contradictory unless I'm missing something
I guess the !bJustSpawned part doesn't make sense
Ohhhh
So this pickup coming into relevancy for a new client, will creation time be 0?
Haven't checked for sure
AKA this will never matter unless it's the start of the match
It's a decent assumption
I thought it was to prevent a stale sound playing but this makes more sense
Thanks a lot
Check creation time to see if replicated and where it's set to know for sure
I'd look for you but not at PC
CreationTime = (World ? World->GetTimeSeconds() : 0.f);
It's not replicated
So if the client can call UWorld* const World = GetWorld(); then it will be set to the current world time
Where's that run
Ah there we go
No prob
lately how many players have people been able to get in these dedicated servers with ue4?
@twin juniper well 50-100 should be very doable, but you probably have to use the replication graph stuff
I have not done so myself, though, not working on that big of a game
Can i replicate just a texture ? that is being dynamically changed by a scene capture component 2d, which is present only on server side
anyone watched this talk about networked physics?
from the Game Developers Conference vault
Everyone whose ever tried it ๐
Deterministic Lockstep isn't an option in UE4
hoping the new physics engine gives us new options
hey there so im trying to start a timer in my game state class by overriding the defaulttimer function. however match in progress returns false if im launching the game from my game menu, if launched directly it returns matchinprogress true this is the function. any idea? https://cdn.discordapp.com/attachments/312984711720992768/583430064977346573/Desktop_Screenshot_2019.05.30_-_00.46.42.26.png
@chrome bay the guy seems to highly recommend for snapshot tho :p
They do but you don't have that level of control over the physics engine
UE essentially uses State Sync. The simulation runs on each client, and each gets state updates from the server
That's it though, there's no more advance than that - and the states can still go out of sync because client may simulate something the server doesn't know about
The engines support for networked physics as a whole is a trash fire, but unfortunately that's because it's an "off-the-shelf" engine that needs to work for a variety of scenarios, and Epic aren't building any physics-heavy multiplayer games right now
any physics-heavy network game is going to need some level of bespoke implementation
anyone figure out how to get non jitter movement with the movement component? Tried several different things now in c++ and still getting jitters when i play online
You can try throttling the networking - by simulating packet timing and other distrubances, so that would help you a bit in testing and figuring out the source of the jittering straight in the editor.
Jitter with Character Movement shouldn't happen that often
jitter with your own movement will if you don't have prediction and replay
Well unfortunately setting max walk speed in blueprint isnt enough anymore. It worked fine back in 4.20 but some recent update changed the component a bit
so ive tried doing the c++ stuff, helped a little but still noticable hitches
You probably have to save the max walk speed for replay (not something the engine does by default IIRC) - and make sure it's being set at the same time on server and client
It'll never be 100% perfect if the walk speed changes bases on arbitrary conditions
could be if it's driven by input
yeah that replay thing I was messing around for a while, I must have done it wrong
@copper mango Thanks . For some reason i was thinking ue4 supported 150 to 200 players
It has no limit on the players but the amount of work the engine has to do is a lot
You must find ways on limit on the work, there you can expand on the user count
Also, a beefy enough server and on well divided maps you can have thousands of players (not in one place at once but all in one game)
i have a problem with local multiplayer where if i press the sprint button with player 1 it works fine but with player 2 it puts player 2's screen on player 1's screen until i press the sprint button on player 1
Hello guys, i need help with xsolla plugin for my multiplayer game . Do you maybe know how to skip the token authentication and make the player spawn ?
@rotund sapphire about how many with abd without optimization
we're experiencing a problem where when a player connects, in that player's beginplay on the (listen)server, the character's playerstate is for some reason pointing to another player. anyone seen that before? more info here: https://udn.unrealengine.com/questions/503420/playerstate-inconsistency-during-beginplay.html
Players BeginPlay?
@mint jolt What Player?
What class are we talking about
I'm 90% sure that neither the PlayerController, nor the Character/Pawn is guaranteed to have a valid PlayerState on BeginPlay
Thirdpersoncharacterโs beginplay, sorry
Both have a specific function you use to make sure it's valid
Yeah that's totally wrong
BeginPlay Characters aren't possessed
They have no Player Assigned until they are possessed
Use the PossessedEvent
Ah!
Or utilize C++ with OnRepPlayerState
Does the above happen on the server?
PossessedBy happens on the Server
C++ has lots more functions you can override to handle this
Makes it a lot cleaner
If you use BPs only you'd use OnPossessed and if needed somehow use a custom PlayerState veariable to mimic the OnRep
Yeah weโre in cpp land. Thanks weโll try that!
Yeah then you want to utilize:
PossessedBy for the SERVER for Controller and PlayerState.
OnRep_PlayerState for all Clients for the PlayerState
OnRep_Controller for the owning client for the Controller
Then you are on the save side afaik
@mint jolt
All Clients as well as owning Client does not entail ListenServers
(in C++)
I guess what threw us was that the player state looked corrupted, rather than null. Maybe itโs cloned or something.
It should def not be usable on BeginPlay
It's a common mistake that I sometimes also run into
Specially since BP lack the additional functions
Hi, any can advice for how to implement persistent item where the Character can Pick item and add to inventory and can modify stats like Durability
what is the best solution. Struct? Actor for pickableitem and after pick item, destroy this actor and replicate the struct to the inventory item?
Guys, if you wanted 2 clients to run different game modes in multiplayer, at the same time, do you need 2 separate game modes and feed data through the game instance, or is there a way to have 2 game modes communicate?
2 game mode instances in one world is not supported at all
so what are my options?
i have to have 2 game modes
that or maybe have a big modular main game mode
ok what about interfaces
like if had a game mode implement 2 interfaces
that would work ye?
Hello I am getting a network mismatch error joining from my client to a linux server. It was working fine until we switched to 4.22
Warning: GetObjectFromNetGUID: Network checksum mismatch. FullNetGUIDPath: [9]/Game/Levels/Alaska/Alaska_Ver_1.[7]Alaska_Ver_1.[5]PersistentLevel.[93]BP_Soldier_2, 1671717527, 3212134777
Theres the error ^
I know mismatch could be caused by different game versions but the client and server were always built on the same commit with jenkins
@west rapids can you give an example of what you'd need 2 game modes in one level for? Maybe there is another way
Aight lets say I want to run a top down management game, managing players on the ground that have to complete objectives set
so essencially thats 1 player that basically playes an RTS
and however many that play fps
I wouldn't have a problem if i didn't have to feed score and such
you can leave an Actor to store your data
unless 1 gamestate is enough
but this is happening in the same level
2 different game modes?
game instance would work for me
that's not going to work
even if i stream 2 levels through
game instance would work for me
yeah i'm just trying to figure it out before i realize i got an enitre class to reparrent
So... how would a player decide if they were playing in rts mode or fps mode?
i find shoveling data through GI to be super inelegant
same way you pick sides in a game
outside in a lobby
but they would share the same persistent lvl
so why the two GameModes?
yeah i know that GI is the "garbage can"
cuz i wanna be able to run both fps module or rts module in standalone
that or i need to separate walls of code
for that you just need to run 2 different classes of PC
with checkers
with same basic interface
i don't have issue with controller or state
and override about 2/3rds of the GameMode without calling Super::
ooooh
yes
great idea
xcellent
btw why do u super hate GI data transfer? thats what the thing is there for
afaik thats the only thing persisting through sessions
afaik thats the only thing persisting through sessions
unless u talk about some custom cfg on disk
and yet, PlayerState can remember your name and basic info even through hard travel
i dunno, moving inventory for example, I've seen several solutions, most just say store an array in GI and pass it down the line
how much overhead would u rly be saving yourself if you go the harder route
you can implement in 10 minutes tops without knowing anything about unreal
it also makes you want to cry after you look at your GI few months into development
and then again refactor is always an option, just a pain in the arse, thats why i wanna set up classes proper
yeah i figure itd be a garbage can pretty quick
the only solution is to never start
dunno man feels like a bit of comp vs inheritance
going too much either way is just wasting time
breakpoint APlayerState::CopyProperties when playing from DebugEditor from VS
aight
its what gets called to keep your PlayerName, ID and such even through hard travel
basically copies it from old PS into a new one
callstack should tell you all you need to know
never though of hooking in through there
and as for 2 GMs - that is sucidial
thats why i was askin for ideas ๐