#multiplayer
1 messages Β· Page 363 of 1
I could get 100$ from kickstarter or somewhere else but i dont have tax that steam needs
lol just don't go make a kickstarter for exactl $100 though
@twin juniper Seriously though, if you're 14 and doing your first game, don't touch multiplayer
thats only thing im interested in, i want to just play something with friends
I'm twice that age with two released games, and it's still really hard to pull off
and so other people can play it too
multiplayer isnt that hard, i have made everything work besides the connecting and hosting itself cuz steam
it doesnt work
on lan i tried and it worked just perfectly
Are you trying to use sessions?
yes
Can't do that if you're not using a subsystem AFAIK
But
you can absolutely just join to an IP directly
thats not that cool, but looks like the only option available to me
my game works great if the player is hosting the game
then i need a website with connectable ip's
the other can find the host server
its on shipping or dev build?
on shipping it doesnt work because its not on steam
but if i run "F:\UnrealEngine-4.18.1-release\Engine\Binaries\Win64\UE4Editor.exe" "F:\Unreal ProjectsServer\TheLegendsOfArthur\TheLegendsOfArthur.uproject" /Game/Assets/Maps/Lobby?listen -server -log
the other client donΒ΄t find the host
ok gotta run to kickstarter and get 100$
jk
i dont have a game ready for STEAM
i think my server its not creating the session when run in cmd like this F:\UnrealEngine-4.18.1-release\Engine\Binaries\Win64\UE4Editor.exe" "F:\Unreal ProjectsServer\TheLegendsOfArthur\TheLegendsOfArthur.uproject" /Game/Assets/Maps/Lobby?listen -server -log
You don't start Dedicated Servers with "Listen" anyway
How are Pawn remote roles defined, based on the owner PlayerController ?
i back
Hey @thin stratus , sorry to bother but you keep popping up in every search result. Would you know what the correct RemoteRole would be for a player pawn on a listen server ? It seems like it should be simulatedproxy, but UE sets it to autonomousproxy. Can't understand why and whether that's normal.
I've looked at APawn::PossessedBy, where SetAutonomousProxy() is called as soon as it's not a standalone game
sorry @thin stratus but what i have to change
Well, I found a workaround for my issue - overrode PossessedBy and set SetAutonomousProxy() only if controller is autonomous too
i creating the session in class THELEGENDSOFARTHUR_API AServerGameMode : public AGameMode
can the be the problem
and not the gamesession class
how can i make this work
i pass what i have in gamemode class to gamession class
now what i have to do when i run the server create the session
my code https://pastebin.com/ZYkvJ59G
i using null system i want convert the peer to peer system to dedicaded server
i using in same pc
yes
@thin stratus when client dies, it's camera remains at same place but server respawns, and servers pawn remains
It is onAnyDamage
When you decrease the Health of your Character to 0, it dies, or?
That means you are already on the Server, I hope, cause that should only happen on the Server
the code https://pastebin.com/SjPrdEjs
It just has 0 health, I try respawn and destroy actor
So you then create an Event in the PlayerController "RespawnPlayer"
So when the Character dies, you do "GetController", cast it to your Controller class and call the respawn
i create to pastebean
In the respawn you check if the controlled pawn is valid
Destroy it if yes
ANd in both cases spawn a new character and possess it
But then there is that problem
That client doesn't see itself die
For client when he dies he doesn't possess
@twin juniper
- You are binding the wrong Function to "DestroySession"
Oh the client just doesn't possess
SessionInterface->OnCreateSessionCompleteDelegates.AddUObject(this, &AServerGameSession::OnCreateSessionComplete);
SessionInterface->OnDestroySessionCompleteDelegates.AddUObject(this, &AServerGameSession::OnCreateSessionComplete);
Clients don't call possess
It must all happen on the Server
I had a run on server event
You are killing the Character in AnyDamage event
that IS on the Server
if not then your whole damage logic is wrong
@twin juniper
auto ExistingSession = SessionInterface->GetNamedSession(SESSION_NAME);
Come on Pedro
The destroy actor is in anydamage
"Wrong Function" is easy enough to fix
I even posted the two lines
You have CreateSession bound to DestroySession
Change that properly
And this auto ExistingSession = SessionInterface->GetNamedSession(SESSION_NAME);
Use "GameSessionName"
Instead of SESSION_NAME
Ue4 has "Game" nad "Party" predefined, which is later also needed for, e.g., Steam
And I think you also need to START the Session once it's created
Which works the same way as creating
Or all the other functions
So I have destroy actor inside event any damage and the possessing and spawning new pawn in that respawn event which is "run on server"
@twin juniper Buddy, do you understand that the Damage event should already be on the Server?
What ever you call from there, is on the Server. No need for any Run On Server events
If you are dealing damage on the Client, then you got hte problem there already
Usually you NEED to deal damage on the ServerSide
So if you call respawn, then that's also on the Server
It's on server I could say, because event any damage is on server
And Destroy Actor can be wherever you want
can put in pastebean the changes i have to make
Yes exactly @twin juniper
if possibel
And rest is:
DamageEvent -> Health minus Death -> If Health <= 0 -> Die -> Call "Respawn" FUnction on "GetController"
And in the Respawn function "GetControlledPawn" -> Is Valid? - yes -> Destroy and if valid or not, both cases, spawn new character and possess it
@twin juniper I already wrote you the changes
Then get player controller is the damaged player?
GetController
GetPlayerController would refer to the Server
GetController refers to the Controller of the Character you are in
Which you want
ok
Oh so getplayercontroller (target) - > respawn and add a "player" var which is getcontroller
No
"GetController"
Cast to your Controller class
(The one that has the Respawn event)
Get controller is damaged
And call respawn
Get player controller is the server which is target
For event to run in
Ok I will try to explain my theory in normal understandable language
Call event respawn, target is GetPlayerController and a variable "player" that is what player to possess into that new pawn that is GetController, right?
:D no
No, remove the GetPlayerController
And use "GetController" directly
Remove the "Player" Input
And just call possess directly
"GetPlayerController" is always the Controller of the player you are currently "watching" on the server that is the Server
Yes
and this is right too?
oh yes its working thanks π
helped alot
the code have look like this https://pastebin.com/nmHJ9ZpY
i canΒ΄t put work
Buddy, the main issue is that you don't follow instructions
Line 22.
Wrong function bound to DestroySession
Fix that
Line 89. wrong Session name, still
Line 128 the same
The code for finding a session is missing
But I assume you are there too searching for the wrong Session Name
Fix that
I always look in the log after compiling
Because VS is always showing like 20 errors at a time, but everything works
It says that FPaths::ProjectDir is bad xD
That :: is name needed
about this function what i have to change i only have to renove from the code SessionInterface->OnDestroySessionCompleteDelegates.AddUObject(this, &AServerGameSession::OnCreateSessionComplete);
in server gamemode project setting i have to put a new gamemodeclass
but no luck
what i doing wrong
i have to change my project settings
i make the changes but no luck
@thin stratus i make the changes and dont work
its a fork but the code its the same of my same
the link to github project https://github.com/Kammikazy/3_Steam_Multiplayer/tree/master/UnrealProject/PuzzlePlatforms/Source/PuzzlePlatforms
i make the changes you say but i canΒ΄t put work
maybe the problem its i forget the build in desolment server
So I've got a box trigger that, when overlapped, casts the overlapped actor to FirstPersonCharacter and then uses Launch Character to launch them. What's the best way to set this up for multiplayer?
@twin juniper "OnDestroySessionComplete" and you use "OnCreateSessionComplete" as a function
That's what I meant with wrong function
whats right function
yes
You even have one defined
You are just not binding it
And what do you mean with "maybe the problem its i forget the build in desolment server"
If you want to launch a standalone Dedicated Server, you need to build it with Engine Source
i using githiub source code engine
have to go
i gonna back
i go to dinner see you soon cedrick~
Yeah if you have that, then build a Development Server
That generates the .exe for the SErver in the project binaries folder
Then, after packaging for Development, you can move that file into the Binaries folder of your package project
That's the Dedicated Server you can start then
But first you should make sure that your code is proper
The stuff you posted etc. has too many mistakes
can help-me fix all my mistakes
i running my game cliente and server by cmd
i your i have to packge the server every time i want test
if possibel
You need to package, yes
i not possibel to teste with not package the game
using this "F:\UnrealEngine-4.18.1-release\Engine\Binaries\Win64\UE4Editor.exe" "F:\Unreal ProjectsServer\TheLegendsOfArthur\TheLegendsOfArthur.uproject" -game
That's only starting a standalone version through the editor
And actualy Dedicated Server can be started like that with -server -game
However usually you want to package it and then host it somewhere of course
ya
thanks forthe help
can you help-me fix the mistakes i make in the code if possibel
its so hard fix the problem
i think i solve problem
now i find the server
@thin stratus thanks bro i have good new year
have good new year for everybody
You too!
Is it fine to have no pawn by default in the GM and simply set the controller viewpoint to a spectator location until a pawn is spawned to possess?
Had a spectator pawn that seems basically redundant, as it gets destroyed as soon as the game starts anyway, and all it does is set a viewpoint position until ready to possess.
@inner iris yes that is what I do
Cool, thanks!
np
The 17 digit number for the Steam Unique ID, is that a fixed number or does ever change?
@inland sun conversion between steamID3 and steamID64 can be done rigidly. my steamID3 (the folder under Steam/userdata/) doesn't change
so I think not
Cool I did a check to find my steam ID which was the 17 digit number, was thinking of for now letting it be part of a variable to know its me to let me have privs that other players do not get lol
d
whoops
Does anyone know if there's a generalized article covering how to smoothly replicate character movement in multiplayer? I've only recently started working on multiplayer stuff and I've got to make it work on my custom character movement.
I'm not using CMC, for the record. I found it to be a little too loaded.
You mean character movement component?
yea
I just don't like how it feels. I'd like to have direct control over every aspect of the way my character moves, and when looking through the code for CMC it's just so loaded.
It also doesn't play well with physics objects in multiplayer.
I tried making CMC work for me, but in the end it feels like I'm trying to hammer an existing setup into something completely different
'loaded' is how you make it replicate well. You can inherit it and make your custom character movement component using the network framework
are you going for something like gang beast, human fall flat, or stick fight?
I'm going for Mirror's Edge style movement but in a sandbox environment
Which means that I can't really use premade rails or surfaces specifically geared for interaction of that sort
I thought using a physics object and slapping procedural interaction on top would be a more robust approach
replicate that would be extremely difficult
I'm not pro on this topic but a more common approach is using a robust movement replication method and add procedural (or physical) tweaks on client's side to make it feel less clunky
replicating every limb movement can be done but it's huge work
Any idea if there's educational material on the general principles of how movement replication works?
Also nah every limb would be just silly
great article
Thanks! I'm gonna read that.
https://www.youtube.com/watch?v=UQdkkmP7amI
gang beast does it but their entire gameplay leverages on this so the work and network load is justified
If you have Gang Beasts on Steam Early Access and want to playtest the three new stages shown in the E3 trailer (the "chute", "elevators", and "tower" stages...
np glad to help
Yeah. In my case I'm only replicating the position and rotation of the collision capsule
But I'm basically doing my movement by moving it around with impulses
Thats the general jist. I do "override" some physical stuff by doing my own friction based on the collisions of the capsule so in the end it works better than it sounds
the issue is the actual replication of the capsule.
Right now its like
crazy jerky
I think the tutorial covers exactly this π good luck
Thanks!
anyone knows if there is a way to pass argument to a server when connecting to it
like with the open console command
open localhost:7777 -argument foo
@twin juniper I've been trying to dig through the same answer your looking for
Ive got some recources of other peoples tests where they manage pretty well to replicate physics if your interested π
@twin juniper I'm interested can I join the party
too late. I just sit
?
tried to make a dad joke and failed
does anyone know how to pass argument when connecting to a dedicated server?
Most likely a stupid question but if I package my early dev build as a linux standalone, will I be able to join a hosted game session with that said player from my windows device
sorry for wierd Q lol
i have a linux dedicated server and windows client connecting to it
[2018.01.01-09.17.15:514][519]LogNet: Join request: /Game/Maps/MyClientEntryMap?Tip=Master?SplitscreenCount=1
[2018.01.01-09.17.15:519][519]LogBlueprintUserMessages: [MyGameMode_C_0] Options string:?Name=Player
does anyone know how to correctly pass an option string to a server.... it seems that it doesn' work
I'm passing Tip=Master, but the only thing i'm receiving is a Name=Player
So does FOnSessionInviteReceivedDelegate do anything ?
Is it even handled in the engine ?
Well, it's not
Quick question - is GameInstance expected to exist on clients ?
i only have server side code there, so i'd say it's server only
It's basically the class that represents your game itself
Would be bad if that's not available
@thin stratus I'm asking because, the GetGameInstance() method in GameMode gets it through the World object
Isn't World only on server ?
GameMode already is only on server
But GameInstance isn't ? Cool
GameInstance is per Game
It has 0 to do with networking/multiplayer
WEll not 0
There are c++ functions and BP events related to it
But replication wise it's not multiplayer relevant
Okay, thanks a lot !
What's the clean way to remove all clients from a server ? Like, host is leaving the game, everyone goes back to a menu
That happens automatically
So I don't need to call DestroySession ?
I tried calling it, and have the server change level after it's destroyed - that leaves client on the level, with errors spamming the console
Is it called automatically when I exit the game ?
For example if the server does "open mylevel" - the MP game is finished, but the session appears to still be alive
Oh well, I get it now. OpenLevel() is what I want
I was using ServerTravel instead on the Destroy callback
Thanks ! Actually thanking you because that was in your guide too.
Do i have to use "Create Session" node to connect to ppl i will use "connect <IP>"
so i need to only open level with "listen" parameter
For the hosting client, yes
ok and connecting is "ExecuteConsoleCommand" node with "open <IP>"
Yeah
thanks
Do i need to call DestroySession if connecting is by IP and there is no CreateSession and JoinSession?
The spring arm doesnt replicate while camera does :/
Should the listen "flag" when opening a map be ommited when opening a level just after you create a steam session?
i always use the "listen" when open level after create session
@loud sage They aren't connected
The session will create even without the listen
And the listen works without session
However the session gives you the ability to search for the game etc.
And listen is ue4 intern to actually listen for incoming connections
So it doesn't matter what order iirc
So if I understand correctly, the session is kind of telling everyone this is my game, while the listen actually allows players to connect to your game (meaning you need them both for proper functionality), or did I misunderstand?
Session
Something that describes a "game" or what ever you want to call it (can also be a group/party in other cases or a lobby room).
It holds information such as "ServerName", "IP to Connect to (P2P when using Steam)", "PlayerCount", "Ping", etc.
It's used to advertise a game and make it visible to the outside. Doesn't allow connections.
Listen Option
Let's your PC listen to incoming connection on port 7777 (or changed one if differently defined).
So it allows connections to your PC. However usually no one knows about your game, despite LAN.
A Session is not needed for this, however a Session is used to share the connection information, like explained before.
Ah, got it π Thanks! π
[2018.01.01-09.17.15:514][519]LogNet: Join request: /Game/Maps/MyClientEntryMap?Tip=Master?SplitscreenCount=1
[2018.01.01-09.17.15:519][519]LogBlueprintUserMessages: [MyGameMode_C_0] Options string:?Name=Player
Does anyone know how to correctly pass an option string to a dedicated server.... it seems that it doesn' work
I'm passing Tip=Master, but the only thing i'm receiving is a Name=Player
to be more precise, i want my client to pass an argument when connecting to dedicated server via "open level block" or "open console command"
i did find one stupid workaround
i'm setting the player name on client, and then getting the player name on server post login
and passing the data inside the player name variable, which i don't use anyways
do you think this is fine @thin stratus
Well, kinda
It only allows you one of them though
OptionsString in GameMode is the one you set when the Server loads teh map (so what ever you pass in the string on OpenLevel)
The OptionsString for the Client is not available in BP iirc
i tried the options string , but no matter what i do , i only get Name=Player
Yeah as said, the Client one is not exposed
The Options you set there are the Server ones
Ah!
interesting thing is, that if i set a Name option in Open Level, in client
then i can get this name in OnPostLogin
Yeah but that's auto assigned
In some internal function
Yo ucan't even pass Name if you join via Sessions
i will use this as a workaround for now, and maybe dig into C++ in the future
hello
I still didn't start setting up my multiplayer system, but I do want to make some preparations. what do you guys recommend to store account and character data? right now I have 1 SaveGame BP per account, with individual characters stored in their own character info Structs, like the pic. is it better to use something else?
for example, having an Account Save with individual Characters Saves?
thank you for the advice :)
What do you define as Account
I would always recommend a proper database
SaveGames are usually only for actual saving of parts of the game
And mostly used in Singleplayer
i'm currently using LE File and LE Json plugins to persist character data... but this might evolve to something completely different, perhaps a web server or a database
hmmmmmm, I see. through Data Tables and Data Curves?
No
DataTables are only to store premade data, that can't be modified during runtime
Database as in actual SQL Database
Nothing UE4 related
I see. I'll export the data to external server files. got it. thank you :)
for now I'll just store the data this way
thank you!
Anything obvious I missed that makes this go back to the previous/default level a second after it get's opened? The level's BeginPlay is empty, and the GM's OnPostLogin is only doing a reliable RPC to the controllerto add a UI widget (with a line of text), meaning I don't think anything is being called that loads the other level (my main menu)
It appears to be working just fine, opening the level....but switching back a second (maybe a litle less) after π€ I've tried changing the server default level, but it gave me the same result leading me to believe that isn't a cause
That code is okay
Hm π€ Odd
How interesting - I've created a blank testing level, and that appears to magically be working? How interesting.....and why didn't I try that before?!
Could something like a reliable RPC call not working cause an issue like this?
Reliable Multicast on PC could cause what you said
Hm, I guess that's probably the cause then. Thanks for the help (again) π
Well, for those who follow the multiplayer course on Udemy, I've got a question : https://www.udemy.com/unrealmultiplayer/learn/v4/questions/3394368
Basically, should a hosting player (listen server) interpolate a client's location between RPCs ?
This sounds pretty obvious, but trying to figure out how to interpolate on the server is a massive headache for me
Like, do we replicate the last "real" state, or an interpolated one ? What about collisions ?
@bitter oriole I haven't had the chance to jump on that course, have other things to do, but do you like it so far?
It's pretty good for an introduction
At $15 it's pretty great value
Obviously don't buy any Udemy stuff at the full price
[Looking for advice]
When I use the 'Get Player Controller' Node in a multiplayer game, what should I use as the input parameter of Player Index? I dont have any specific problem with this, just concerned about how I should be doing my multiplayer indexing generally.
GetPlayerController is not really Multiplayer suited
The Index refers to local players
In Multiplayer you always use 0
At least as long as you don't have additional splitscreen players
The returned controller depends on what instance you are on
What should I use to replace get player controller?
For example, this function determines the players Z value to create a bearing
So it uses GetActorRotation, and its target is getplayercontroller
GetController refers to the Pawns Controller
How did this fad happen anyway
What's wrong with maintaining an actual reference
I've never once been in a situation where I don't have a clear reference to what I need
Just seems like a bad practice through and through that the YouTube heroes keep feeding newbies
Is there an easy-ish way to brute force skeletal mesh ragdoll physics to replicate? I am not worrying about optimization for now, I just wanna have something that works for now.
Probably getting each bones location on the server and updating the clients to be what server has, probably in an array and such...
Thats off the top of my head tho
Do you happen to know what the easiest way to access them is?
I havent really worked with skeletons indepth before in C++
Tried poking around a bit in the source, but thus far unsuccessful
Oh wow, found this as the first link when I searched it: https://answers.unrealengine.com/questions/79791/replication-of-a-physics-ragdoll.html
I tried implementing that, but I didnt have much success with it
theres some physx stuff going on there
and I didn't get the "setGlobalPose" member
I have thought up a different approach but im not quite sure about it
so far I CAN get the location of bones
and since I only need ragdolls to be roughly in sync I could use physicshandlers to get them into place
it'd be a bit hacky but it could work
I'd only need tracking a few vital ones
root, hands feet etc
Somebody also suggested adding force to that bone's location towards the direction of the server's bone until theyre about the same...
isnt that basically what physics handlers do?
yeah pretty much, that would be the best route to go then
aight
I just wanted to know if there was an "easy" way to go about it
guess not, oh well
again this off the top of my head, havn't really tried replicating ragdoll myself so I wouldn't really know the best way...
yea its not typically a thing you needa do
but I wanna create a sorta immersive sim environment
so the location of bodies is kinda important
it doesn't have to be 100% exact, it just has to prevent extreme inconsistencies
oh right and if possible I wanna have bodies be draggable
that ones gonna be fun
the physics handler should be able to control that so it shouldn't be that bad...
Whats the default MTU
MTU?
Yeah that
Ah yeah. I think you can set it. Search Max Client Rate, that's a thing somewhere
Might lead to the source
if only physics would have the same result on every pc π
For most small props that use physics, it can all be done on the client right? Iβm sure even ragdoll simulations on most online games are done locally as they arenβt really gameplay important in many cases.
I remember seeing a Battlefield video showing that itβs possible for one player to be completely hidden by simulated props on one screen, but on another client, the prop had moved completely away
gta and games like that are mostly not in sync
I guess the same goes for many things like the small differences in emitters, different variations of a sound cue being played etc
multiplayer physics opens the door to unintended gameplay features π
Also had a question regarding ShooterGame- this quote from their docs βThe instant-hit implementation also features weapon spread. For trace/verification consistency, local client picks a random seed each time FireWeapon() is executed and passes it in every RPC and HitNotify pack.β
Wouldnβt this make it very easy for a cheater to pass on spread of 0 and the server would accept it?
Iβve instead started using a per shot spread array replicated from the server, so I think even if the client removes his spread locally, the server will be firing with the correct spread regardless when validating
Ragdolls are usually local, with collision turned off
And yes, by default shootergame doesn't do any kind of cheat prevention, so the client could send the same seed
They don't send the spread, only the seed. But if they found the required seed for a small spread, then yeh you could do that and effectively cheat
I do it a slightly craftier way
cant you seed the seeds?
No matter how many seeds the end result is always the same :p
That (in theory) is the idea behind the seed
no server gives seed for generating the seed for the spread, than the client has fast but random spread pattern, but cant cheat because the seed is not freely decide
I do something different. When a weapon is created, I initialize a replicated seed. The seed is only replicated once for that weapon. When a client fires a shot, they increment the seed and send it to the server. That seed is used for any kind of RNG. When the server recieves it, they increment their own copy of the seed and if they match, the seed is accepted. If it doesn';t match, then the client has cheated and they are instantly kicked
that what i meant with seed the seeds
as long as you cant make a script for cheating u get rid of 99.9% of the cheaters
You can make a script for any game, and any kind of game can be cheated at.
you would have to adjust your script at start of the game
Well depends, things like Cheat Engine exist
A lot of the time cheat prevention just involves firing up a program that checks certain applications aren't running
I think there's a plugin on marketplace that does exactly that
actually didnt know its used for online cheating , I used it for some stress tests
doesn't the name give a slight hint?
Only bad people would change Offline Account values that are also used in Online modes while blaming the devs for allowing it. cough
@dull jasper Some classes of cheats are pretty much impossible to eradicate though
@chrome bay very interesting! I guess by guarding as much of the most easily exploited areas of the games with checks like this, you can eliminate most of the common cheat techniques without an anti cheat 3rd party setup.
depends how much data u wunna send over the network i guess π
if there were no cheaters you could put more players in a server
@dull jasper As long as you're doing the rendering locally, for example, wall hacks are pretty much impossible to prevent
And yeah, I assume for modern games that have stats and unlocks tied to a master server + steam account for example, itβd be impossible to spoof as the server only sends down the correct versions. I remember call of duty games having tons of maxed out accounts due to the client host being able to edit the lifetime stats of all players.
Doesn't matter
As long as the player's location is stored on the PC, you can retrieve it
but you would have to do it every time u boot up a game
Or not replicate players that arenβt currently visible but that hurts gameplay more for everyone I think
When latency is involved
That's really hard to pull off, too, and would mess with texture streaming, etc
Same goes for lagswitch hacks, how are you going to prevent that ? Not easily, at least
yea that1 sux, why would any1 do this? π
For lagswitch, wouldnβt the server reject the shots as the positions of the player on server and client wouldnβt line up?
What if it's en evasive measure to get "untouchable" for one second in competitive games ?
Well on server they would be wherever the other player sees them
So theyβd still be touchable
Unless Iβm not seeing it the same way
Except with prediction, you're probably not shooting on a client where the server knows it to be
What i'm saying is, for a given network model, you're pretty much always going to find a way to game it
Donβt the simulated clients get their updates positions from the server though? And yeah definitely agree- there will always be cheating
Impossible to stop
impossible, i dunno, worth the tradeoff is something else π
Simulated clients typically get keyframes from the server and interpolate between that. So generally speaking, when the server stops getting inputs, it's common for clients to consider the movement constant
every sort of cheat is gunna cost you something
At least for a few frames
There's a reason real anti-cheat software is usually some kind of backdoor on your machine monitoring other processes
You get pretty far with dedicated servers and good security
Aimbots and wallhacks, though ? Good luck with these.
an actual robot behind a PC ....
You could create a hardware box that connects to your mouse and screen and does the autoaim itself, for what it's worth
unstoppable π
It's not even that hard
Cheating is most of why I'm never doing a competitive PVP game
tribes ascend got pretty horrible after a while
ppl would fly up 2 km. and shoot nukes down to the ground
honestly i dont see the fun
People cheat in Destiny, a console exclusive that doesn't even ranks players or anything like that
That should tell you everything about cheating
Well, the last one isn't exclusive anymore, but people cheat on console versions too
I wonder if itβs possible to monitor patterns or average accuracy over a period of time to determine if someone is cheating. Probably would result in false positives
But if the wallhacks or whatever are snapping to bone positions exactly every time, there could be some info there
I guess the cheaters could add in some slight randomization... haha
Also maybe unnatural input movements like snapping from one rotation to another with no overshoot etc
As many of the aimbots do from what Iβve seen
But yeah all this stuff is easily reversed I guess with some extra code
But snuffing out the obvious cheaters is definitely a good step forward
its not about making it impossible, its about making it hard
Dedicated servers + monitoring software on everyone's game + team looking after cheats
$$$
Yeah unfortunately the team part just goes past $$$ and brings up complexity managing workers
I wonder if the game is less ultra competitive, does the odd cheater here and there still ruin the experience?
for sure
For example in CSGO it feels very unfair to grind to get your competitive rank up to only get deranked by a cheater
But then playing something like Fortnite
If you come across 1 cheater in 10 games, itβs no big deal
Not fun but not enough to make you stop playing
Depends whatβs on the line for players I guess- how much they have put in and how much an unfair loss affects them.
play versus a player with endless health is not gunna be fun in any game π
I donβt think endless health is a common cheat with a good setup
That can be prevented along with movement hacks etc if using a dedicated server and proper validation
The main cheats would be aimbots and wallhacks
Endless health is pretty much incompetence on the developer's part
Wallhack though ? Good luck preventing it
But I mean if the player can just leave that match and join another, their experience doesnβt get ruined. If itβs a battle royale game with leaderboards and you are about to set your record, only to get aimbotted at 2nd place.. probably another story
Theyβll never be fully prevented, so itβs interesting to think about keeping the experience fun for players even around inevitable cheats from time to time
Worth mentioning : cheaters are often able to sow doubt about anti-cheat
every possible cheat allready build in
There were reports the past few days of Valve's VAC banning people based on username
Turned out to be a lie
Same goes for Destiny 2's launch - made news about PC player getting banned for having Discord
Turned out to be a lie
So they spread false rumors?
Basically
On r/linux_gaming you'll find actual self-admitted cheat developers talking about that, like VAC is banning everyone and doesn't work
Wow, as if cheating wasnβt bad enough π
THat guy π
My steam functionality stopped working on my blueprint only project. Looking for a knowledgable tech support person to help me get it back on track. Payment possible.
LogOnline:Display: STEAM: Loading Steam SDK 1.39
LogOnline:Warning: STEAM: Steam SDK 1.39 libraries not present at ../../../Engine/Binaries/ThirdParty/Steamworks/Steamv139/Win64/ or failed to load!
Any clue how i change it so it looks for SDK 1.41 instead ?
Probably not
Unless you actually have 141 there
But you shouldn't need to change anything about that for Steam to work
How could i make an mmo system to let multiple people be logged on in one server, this is just a question for future reference cause i only got ue4 recently
not really multiplayer but:
anyone knows if its safe to make rest requests directly from the client, wondering if they can find the post contents somehow inside the program
So, am I suppose to send events to spawn FROM the game mode TO the game state? I want the server/local client host to have a different pawn than the connecting client(s)
@twin vault what exactly do you mean by 'inside the program'? Do you just mean within the client?
If so, I don't see why making HTTP requests from the client wouldn't be fine
@brittle sinew yeah, i mean i have 'sensitive' stuff like a post to delete character, just passing a character ID, if someone else called that he would manage to delete someone elses character
i know there are stuff like cheat engine you can find strings in the process, but idk how hard it would be so they find out a post request content
You can't trust anything from clients
Except maybe on consoles
It may not be trivial to guess the message, but if someone does it ? Your game is dead
yep
Well, by asking 'within the client' I was basically asking if the information would be passed to the server or not
It sounds like it is :p
In that case, like @bitter oriole said, you can't trust any client information
at first i was making the request directly thinking encryption would save me but then i got suspicious something bad could happen
so, what would be an alternative to send commands to the server if im not 'playing' in a server yet?
there are those beacons right, gonna see if thats what im going for
@twin vault You need a login system
With a session system - tell the player you are logging in with user/pass, have the player return a unique identifier for that session
Then use that identifier for every request so that the server knows it's really that player
And expire the identifier some time after the last request
Pretty easy to set up, and pretty hard to break if the server is well done
Assume your encryption is broken, your players the dirtiest hackers in the world, and plan accordingly
@bitter oriole - you almost make it sound like every day humans are playing this game..... β€
LogNet: Warning: Network Failure: NULL[NetDriverCreateFailure]:
LogNet: Error: LoadMap: failed to Listen(/Game/ModularNeighborhoodPack/Maps/UEDPIE_0_Demo_Map_Main?listen) What am I missing here ( this is the listen/client server) Here are my settings
@merry hemlock - is your Maps & Modes setup correctly?
SErverMap should be Demo_Map_Main
TransMap should be something blank level (i call mine TransMap)
DefaultMap should be something like "MainScreen" (wher ethe player enters the game from... typically just a UI map for starting the game)
would that make the actual netdrivercreatefailer
this is a pre-cursor to any session joining in multiplayer - so yes its needed.
ALTERNATIVELY - hold on a sec and i'll load up my project.... there SHOULD/COULD be an entrance to your CommandLineArguments in the Multiplayer Options window your showing here....
which will load a map as well
1 sec
thanks for taking a look
so you can alternatively put in here the name of the map -
/Game/.... is your root CONTENT folder
FYI - any packaged game needs to have /Game/Maps/ for cooking
whats your connection type? Dedicated or ListenServer?
ok so firstly - you need to connect to the guy
are you doing that successfully?
actually lets back this up a bit
the "open DEMO_MAP_MAIN?listen" i assume you are trying to launch this AS THE LISTEN SERVER right?
the guy HOSTING the game?
yes - the LISTEN SERVER (the host)
in ListenServer - 1 client acts as the SERVER and the rest as CLIENTS
so at this point....
all clients should be CONNECTED to the listen server
and you should then use the node: OpenLevel()
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Game/OpenLevel/
Open Level
and your GameMode should be set to bSeamlessTravel = true;
LogNet: Warning: Network Failure: NULL[NetDriverCreateFailure]:
LogNet: Error: LoadMap: failed to Listen(/Game/ModularNeighborhoodPack/Maps/UEDPIE_0_Demo_Map_Main?listen)
LogWorld: Bringing World /Game/ModularNeighborhoodPack/Maps/UEDPIE_0_Demo_Map_Main.Demo_Map_Main up for play (max tick rate 0) at 2018.01.02-16.29.48
LogWorld: Bringing up level for play took: 0.292703
LogBlueprintUserMessages: [Alpha1_GM_C_0] Server: PlayerControllerPlayer has joined:
that's when I'm on the host and hit Play - then I type open demo_map_main?listen
maybe I'm reading the message wrong
I think that's my issue..that error is from when I BeginPlay in editor without hosting that command
i had a similar headachage with the UEDPIE_MapName
i had to setup the CommandLineArgument as i stated above
in order for hte map to show up appropriately
SORRY
thats false
hold on
Wait....is this my issue
I have a OnPost event firing on the beginplay of my game mode
but if you are just playing in the editor and having started a server yet, that OnPost wouldn't fire correctly
I'm sorry, OnPostLogin event
OnPostLogin (in game mode) is its own seperate event.....
ugh, it's still giving me the error
it should never be tied to BeginPlay() at all
it is automatically fired when a client CONNECTS to the server
so it won't fire for me?
in any case...it kicks me out when I try to open the map and listen
do I need to have ?bIsLanMatch=1listen?
Um....i'm not sure why but I think online substyem Null isn't enabled
that's the one you still need for Lan games correct @worthy wasp
yes you need a OnlineSubsystem setup for connections
;PollingIntervalInMs=20
; Uncomment the following line to use the Null Subsystem
DefaultPlatformService=Null
; Uncomment the following lines to use the Steam Subsystem
;DefaultPlatformService=Steam
;VoiceNotificationDelta=0.2
;[OnlineSubsystemSteam]
;bEnabled=true
;SteamDevAppId=480
;SteamAppId=480
;GameServerQueryPort=27015
;bRelaunchInSteam=false
;GameVersion=1.0.0.0
;bVACEnabled=1
;bAllowP2PPacketRelay=true
;P2PConnectionTimeout=90
;[/Script/OnlineSubsystemSteam.SteamNetDriver]
;NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
that will get you setup for a NULL subsystem
and you can UNCOMMENT out the things you need should you ever go to steam integeration
hmmm
okay I got it hosting let's see if I can figure out the 2nd client connecting
am I referring to it right, seeing that the server is also the client ?
no - in ListenServer - the server is the server. ONE CLIENT PLAYS AS THE SERVER (said that before)
@worthy wasp I can ping the server's IP find through windows but when hit play and then type "open IPADDRESS:Port" it just shows a black screen and says:
LogNet: Game client on port 17777, rate 10000
PIE: Play in editor start time for /Game/ModularNeighborhoodPack/Maps/Demo_Map_Main 1.086
LogBlueprintUserMessages: Late PlayInEditor Detection: Level '/Game/ModularNeighborhoodPack/Maps/Demo_Map_Main.Demo_Map_Main:PersistentLevel' has LevelScriptBlueprint '/Game/ModularNeighborhoodPack/Maps/Demo_Map_Main.Demo_Map_Main:PersistentLevel.Demo_Map_Main' with GeneratedClass '/Game/ModularNeighborhoodPack/Maps/Demo_Map_Main.Demo_Map_Main_C' with ClassG
eneratedBy '/Game/ModularNeighborhoodPack/Maps/Demo_Map_Main.Demo_Map_Main:PersistentLevel.Demo_Map_Main'
LogNet: Browse: 192.168.1.189:17777//Game/ModularNeighborhoodPack/Maps/Demo_Map_Main
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, Channels: 2, Time: 2018.01.02-22.26.25
LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL
LogNet: DestroyNamedNetDriver IpNetDriver_0 [PendingNetDriver]
LogExit: PendingNetDriver IpNetDriver_0 shut down
It keeps shutting it down it seems
Not sure why it needs to spawn two windows when I only want one (using Play in stand alone) from ListenServer
Can someone please advise which one of these two popup windows when it hit standalone game to test for networking, which one I need to use, or does it matter? (wtf is it spawning two for?)
because you have "Number of Players" set to 2..
ah
I thought that was for the server limit but now that I think about it, it's obviously not
most network tutorials for local meant splitscreen, so they set that to 2
it's how many clients to spawn when you hit play in the editor
well thank you that really clears things up, was driving me crazy
np
is it possible to use the console to send message/commands
i think I'm connected but i can't confirm
So, something is wrong with the way I'm connected to my listenserver because on my client this evaluates as TRUE
@jolly siren I am using stand-alone games and my host machine opens a map with ?listen
then on the other machine I type open IPADDRESS:Port and I can ping the machine through command prompt so I know I can connect
'
Why doesn't it just fail, WHO is it connected to if not the server?
and if it IS connecting....how does it have authority?
This only has to work ONCE
Hey, we`ve got a problem with our Multiplayer-Spawning-Logic. After we spawn actors and possess them on the gamemode ... we have absolutely no control over the movement and therefore our character seems stuck. Our HUD is also not displaying. The camera input are working, the rest not. Maybe someone of you guys have a solution, would really appreciate it π
It seems that we have no control over the pawn (just rotation)
just rotation works
@ivory merlin replication set?
crap
@stone coyote
you might have set it maybe one the rotation but not the other ones
any variable that controls the movement...otherwise how is it being sent out for other clients to see?
it worked without problem, before we started the spawn logic
how are you referencing the newly spawned characters...you might be controlling some other instance of those characters
over spawn actors
and afterwards we possess them, the PC get posted from local to the PC server version and from there to the gamemode
did you try adding a print message to when the movement event happens? and add the display name to the event, compare this to a print name of the spawned actor event to make sure the display names match
just trying now
The Pawn get`s controlled by the controller, also the input events are working
just it dont moves and the animation dont get "played"
no idea unfortunately...i can't even get my other computer to connect to a listenserver
^^ But thank your for your time π
anyone find anything wrong with this? I'm only using platform name just for simple testing
this is my beginplay of my gamestate
Okay, lol .. we fixed it. Our GameMode was just broken, the Code was right ... just created another gamemode and transfered our code into it ... and it worked -.-* Sometimes we love UE ^^
For those here who have worked on non-character multiplayer, how do you handle movement on listen servers ? Do you have pawns moving at every tick, or when the client sends a movement RPC ?
If you are doing your own movement you probably will have to apply movement every tick, but input should only be sent when stuff changes
ie. your client sends a "start moving" or "stop moving"
which you then check every tick
Yeah, thought so.
I currently update the speed / location when inputs arrive
And that just doesn't work :/
What about it doesnt work?
Well, if the client runs at 30fps, I only update it on the server at 30fps.
Plus, RPC arrive in salvos, and don't come back for a few frames... Which is to be expected in a network setting
Yea, you will want to simulate movement locally aswwell
i.e. basically apply the movement on both server and clientside
that way the delayed response wont be overly obvious
and the server will still correct if the client is way off
What I did is based on udemy's multiplayer course, which has the client simulate locally what's changed, send the input + delta time ; the server processes the inputs, updates the state and replicates to the client, which in turns ensure it's compatible with what he did.
What's wrong in that setup is that the server only updates the pawn when receiving new inputs - possibly at 10fps, or at a 60 fps average that's wildly inconsistent
I'm just not sure whether moving the simulation to the tick, just by taking the input into account, will result in the same simulation as on the client :/
well the way it should work is
you update the pawns position based on the speed you receive from your client
and keep using that per tick until you get something else
or actually technically not the speed from the client
the input data
which you then derive the speed from
prolly not a good idea to let the client give you those directly
Yeah, I've been thinking about it for some time and no matter how you do it, I guess the only reasonable way is to simulate every tick based on currently known inputs
It's just that my setup has a rollback system - when the server replicates, the client resets to that, and replays movement that wasn't received by the server yet on top of that
Which make sit super smooth for the client (that part does work really well)
I'm worried about whether I can still do that if the server simulates all the time, per tick
Thanks for the hint @winter plover - at least I'm not crazy yet
Replication is pretty nuts
I feel your pain
apparently there is no default functionality for that, so I'm trying to roughly match them up with physics handlers
with mixed results
From what i've heard, networked physics in UE4 only work in very isolated situations
PhysX being pretty unpredictable
it works fine for static meshes
but ragdolls are generally too expensive to replicate in most applications really
for how little they usually affect gameplay
it's probably why in pubg dead players turn into small boxes
but yea I'm trying to have bodies be draggable in multiplayer
so I wont have it quite as easy lol
Okay...I'm a bit baffled ...I am able to connect to my listen server but my connecting client cannot cast to the game mode...is that because he doesn't have authority?
I wouldn't say it's because they don't have authority (they're just side effects of the same general concept), but only the server has access to the GameMode.
I would suggest looking at the network compendium linked in the pinned messages; it's a really good resource for beginning in MP
lol funny you should mention that
I've read through it a couple of times - obviously there is a difference between learning and application of said learning
So the only thing I can access from a client is gamestate then....i was trying to print a variable from gamemode, that was my problem I guess
thank you @brittle sinew
@brittle sinew One question I couldn't find the answer to - BEFORE I am connected, how do I setup logic that determines if the machine should try hosting or connecting? and which blueprint should this be on?
crap, sorry for tagging you twice, that genuinely was an accident
Isnt it the gamestate that you wanna pass to the clients?
yeah that appears to work
I'm trying to figure how to do make the server automatically host and the client automatically join via blueprint but I'm not sure how to go about that
@winter plover I'm trying to remove the references to player controllers when they leave the game -- I'm removing the 2nd index item OnPostLogout but it seems to have no effect...can you advise?
that IS the 2nd index isn't it?
it's a listen server, so the first client is also the server isn't he?
which would be zero
maybe i should just do last index
idk seems unnecessarily hacky
is that the second player ? otherwise you need to remove the item
if 2 login and the 2ten one logsout you would remove the first one
I've got the listen server but he's the first playercontroller added to that list
so his index should be 0
any clients joining would be added
if the host disconnects the server dies im p sure
so your game will always only have server and 1 user?
pretty much
I will say this...it will always be LAN based
so I'm not worried about cheating whatsoever
i've read through the network compendium but I can't find the magic button to give a connecting client total authority over server
can that happen?
I dont think thats a thing UE can do
it didn't sound like it
it's a strict server/client architechture
what you describe is more of a P2P thing
it's weird
I set up a print message before and after and the index was still there
I'll try last index
Okay that makes no fucking sense
oh wait, i'm an idiot
After an hour I am no further, can someone PLEASE tell me what is wrong with this:
I have a test button fired from the server to see what the current connected client is
it baffles me....i disconnect and it works but when a new player connects, they get the name "mycontroller2"
Does OnPostLogin ALWAYS make a new player....
for starters @merry hemlock - why are you getting the LastIndex of the playercontrollers list? what if you have a client that disconnects and he is the 3rd in line of 17? This methodology is not well thought through, and far from accurate.
And i dont know how you missed the Exitiing Controller pin off hte EventLogout()..... you could take that, use a FIND node of the PlayerControllers array and simply return its index and remove it from the array..... which is 100% accurate and what you SHOULD be doing anyways.
Which, I'm discovering, is hardcoded so I should completely abandon this line of thinking
I'm only having one client connected other than the listen server
secondly - your 2nd picture is the same unthought/unplanned methodology.... getting the last index of the array
who cares?
whaat if you have 30?
and the server won't do an OnLogout so the only time that happens is when my one client disconnects
your method is unthought
This is a local based demo with only two players
he won't, he's the host
This is a local VR based tech demo
If i can make enough money I'll pay someone who knows what they are doing, I have no business doing it myself but here we are
well you've already discovered that OnLogout only happens when a client disconnects
thats the entire focus of that function
I was trying to keep my references consistent, in case the laptop I'm using as a client has a problem I don't have to shutdown the server, he can just reconnect
so when he comes back, any events I have that need to target him, can still do so
believe me, i know my bootstraps are ugly but unless you want to do this for me or give me money to hire someone who knows what they are doing, I'm going to be hear occassionally (or frequently) asking stupid questions
The network compedium is fantastic at least
so all you want it that the server takes the active player and refers to him only?
A: i wont be doing this for you - i've had to learn just as much as anyone here has had to learn - as you'll have to learn
B: I wont be giving you any money - its already a hard economy.
C: I'll help you - but you also have to want to listen & learn.
I want to be able to know who is who
@worthy wasp no problem there, i will take any and all help
if there is only you and server thats not even a question
let me be more specific
I have two computers
the VR one, that acts as the host/listen server
and the instructor one, that is a gaming laptop and the thing that facilitates the VR player's experience
so the person on the laptop hits a button and the fire changes conditions on the VR player's map
There's no real gameplay in the tradiational sense, but there are events that need to be seen by all
and some sounds i want to be played on only one of the players
What I'm trying to do isn't overly involved or complicated however, I'm still learning the in's and outs of the networking and it's obvious I'm missing some key concepts
i dont mean to throw a wiki doc at you and say to you "you need to learn"
But i'll be honest.... making a single player game = any indies childhood toy.
Making a networked version of this game = a little bit (lets be honest... alot!!!) harder.
https://docs.unrealengine.com/latest/INT/Gameplay/Networking/
Setting up networked games for multiplayer.
you already have Cedrics compendium... great resource
google search key specific topics
understand the framework classes. all described in that first link
understand that for the server - timing of classes coming to life is different than clients.
understand HOW a client connects to a server.
and what funcitons fire in what order
all in taht compendium + the first link i sent
my suggestion - dont jump in straight to steam or dedicated servers
I have no plan to do anytype of online networking
my other suggestion - dont jump into a paid gig that you have 0 experience in doing.
online networking = listen server
even if its just a local LAN
It only needs to work once
your still at that point doing networking.
if thats the case - why a listen server NETWORKED model?
I mean I just need to figure out how to make a widget fire events on the server...I can access gamestate so that should be enough, it's just some of the syntax I haven't figured out yet
if you want to understand how to sync fire state between two computers, you should read about replication and rpc stuff
By the way, thank you for taking time from your day to go over this and lay out '
I used an RPC to fire something on gamestate
i'm in no way trying to be offensive - please dont take it as such
i'd rather you get on the right foot - than be misguided
No, I sincerely appreciate it
but i'll be honest with you - THIS ISNT EASY lol
i'm 2 years in - i still come to this channel with questions all the time
http://www.thelivesimulator.com feel free to help out haha, this wasn't easy
my biggest regret is that I should have jumped into unreal sooner
i've only been at it 10 months or so but networking is a new thing
its changed so much in 2.5 years .... its hard to keep up at times
my only suggestion - keep up with the updates.
dont sit on 4.8 on your 1 project your working on
no, i'm on 4.18
i was just using an example
it's a good one to keep in mind..believe me, i have done everything the hard way and learned because of it
at least your learning.
@merry hemlock Damn that's a good idea that project. Never thought about using VR this way. Thanks for doing this.
@valid imp appreciate it....I'm probably one of the top Unreal developers in the Fire Service industry, but in the actual Unreal developer industry, I'm ranked 2nd to last, right above the grandma who figured out how to install the editor last tuesday... there's no much help in our industry....if anyone here comes from a tradiational business background, public safety is a fascinating beast from a business perspective....many concepts don't apply, it's an anachronism
You say on your site this is your company, are fire services not funded by the government in the USA ? How do you get revenue for this ? That's fantastic. I heard of training for industries (althought never saw it applied, just theoritical idea), but demonstrations to teach kids about fire is really smart.
I am just a CS student at the moment, but working later in public safety sounds far more satisfying than business.
@valid imp they are tax payer funded however 70% of all fire departments are volunteer-based, so their revenue is lacking most of the time
If you want to make sure something gets to all clients, can you just multicast it to test?
maybe look at the content example, there is a level "Network Features", with each replication type explained visual,text and documented BPs
@mild hull I'm having a bit of trouble even after studying these "ghosts" on the replication -
pretty much anyplace that says "replicates" I have ticked but it doesn't seem to be replicating
Just to make sure I didn't screw something up - Gamestate is shared meaning if you update the gamestate from one player, it should update for the other correct?
you really should open BP_HUD_Network that shows you how to look if you are the server or client
where is that drawhud called from?
gamemode in the network map
this one ?
I'm looking at the Remote Procedure Calls and I am confused about how they work with gamestate
oh you meant the event, it should be called from code for any hud class, but the important part is getowningplayer controller has auth
I can make things happen with RPC on BP's placed in the level
But when I try to update a string variable, for example, it doesn't update FROM the client to the server
I have a widget button that casts to my controller, and from there to the gamestate
widget
mycontroller
gamestate
There are no gamestate examples on that Network example I could find
it has no custom gamestate, but you need to setchange testvar to server
I guess that's what I need to review - if you change it on multicast, why does not change it on everything?
So I made some progress with replicating ragdolls, but it only works for listen servers so far
as soon as things become dedicated the ragdolls become very stiff and weird
multicast can only be executed from server, it even says so in the node when you call it
are ragdolls not calculated when running dedicated?
it will still execute locally
@mild hull I see that now, it is working....I think....I'd like to playasound...but the node says it doesn't replicate.... can I use a getlocation and spawnsoundatlocation as a workaround? I want the sound to be an UI/2D sound though
That spawn at location workaround does seem to work but it's going to be a pain to use that for 2Dsound
This works @mild hull but I don't understand why
geez that's perfect, thank you!
I seem to have the functionality I need.....simply making a widget button fire events in gamestate....now I just need to make sure I can do this in my main project and not a learning project
but thank you @mild hull ....one step closer
Designating function replication across the network
especially: If the RPC is being called from client to be executed on the server, the client must own the Actor that the RPC is being called on.
In this case, a widget created by the client is completely fine....however if that widget is created and has special variables on it...I want to make sure that those variables are drawn from and updated by the gamestate so they are all consistent....am I understanding this correctly?
practically any data I have is managed on gamestate so that should be okay
treat anything that the actual widget draws as cosmetic
any data that are set on server in a replicated variable will be know by all, but your client does not own gamestate, so you should at to your character key binds or functions that are called from the widget and those should call server rpc that are also declared in the character and those set gamestate or whatever you want to update
since I own the widget, I can use it to get to the controller, which can then access the gamestate?
@mild hull Do I need to have two player controller BP, one to handle VR player and the other to handle an instructor - i'm asking from a networking perspective...the actors that use them have their own different elements
you dont have to but it would be cleaner and for a widget to send rpc to server you would need to create it on server for the client and replicate it which defies everything a widget stands for, so its better(easier) to add all logic into the controller or pawn
you could create VR player char and observer char and spawn them based on if its server or client
that's what I'm trying to do ...i'm getting there it's a matter of handling the replication
Right now my gamemode OnPostLogin has a branch using HasAuthority --- server gets VR player and the client gets instructor....but for some reason the client wasn't being replicated even though the actor class has replication set
not sure why but my server has it's pawn turning gold (which only clients should be)
Ah...I was spawning it in the gamemode....I didn't need to spawn it because it's already a default pawn to be used in the gamemode
I am still foggy on this actually
Am I doing this wrong @mild hull ?
since you own all you will always find yourself having authority, since that never gets called on the client side, but the server will always spawn itself first, so anyone coming after that is the observer
so change the hasAuth to a bool that you set the first time
yeah
another question - if you don't have much data/logic flowing back and forth (it's basically events, not ticking) does it matter performant wise WHO is the server?
since the instructor nneeds to do a lot of button pushing, it makes more sense just to have him be the server even though that's a three year old gaming laptop and not a modern pc like my VR machine
you could set different settings for instructor
like VR has a realistic blazing fire, while you only show some cheap fire effect to know where it is
but the cpu wouldn't be a bottle neck it being the server right?
that would only matter if it was processing a lot of different players and gameplay interactions across an online network
The server pawn ends up being yellow but that is only for clients....
also, when my client joins, his pawn actor stays in the ground
@mild hull annnnd the client can't move at all
does the client char work when you use him on server?
I can move around on the main computer ...even though I'm not the right color ...
this is a custom pawn that simply inherets from default pawn....all I did was add a visible sphere as a component
but I set everything with a "replicates" tick box to replicate
do you posses correctly?
try to drag out the new player directly and not use the array
hmm...i had issues with that but it was probably because I was doing 7 things wrong elsewhere
can I plug it from new owner off OnPostLogin to any references?
yeah
hmm
I can move on the client but I am invisible apparantely - and i don't know why this function is turning my ListenServer Pawn yellow
trying to do the same thing they did in the network example
@mild hull what happens to the default pawns that are listed in the gamemode class defaults?
I'm confused ....normally you don't have to do anything but I'm using the same pawn (instructor pawn) and it's listed in the class defautls of my gamemode
actually that doesn't matter does it?
I just can't figure out why the game is making my listenserver pawn do that
and why my client is completely invisible
i also dont know since it works for me, but they either dont spawn or die faster than you can see
but you could also do it like the net example and set the spectator pawn
What does it do to spectator spawn?
i tried it with a normal pawn, gets spawned and i can use it and when i replace it in post it is gone, so that should not be your problem
I'm putting together some screenshots
I don't care how difficult networking is for me i WILL figure this shit out
so....why is my 2nd player invisible
The pawn he has obviously has a mesh
pawn root menu has replication
collision component has replication
mesh component - replication
movement component, replication
class defaults
C:\Users\blmcc\OneDrive\Pictures\Screenshots\2018-01-03_1726.png
there is no need for the components to replicate and i have no access to your c drive :D
any errors in log? are you spawning the right pawn? maybe restart ue
i've restarted a bunch and I'm running standalone due to the problems with PIE networking
I would LOVE to figure out a way to do error checking other than print strings
window-> developer tools -> Log
doies that record from standalone???
no, but the log is also written into saved/log
no errors when I do CTRL+F
Further testing reveals the following
my client cannot move THROUGH the server pawn
but the server pawn can move through him
What does that mean?
you dont see movement from either side?
I can see the server pawn move
on both of them
and you can literally see him move THROUGH the client's sphere
and when he is spawned, the actor name is InstructorPawn
when the client spawns, his actor name is InstructorPawn1
this is a listenserver just to make sure we are clear