#multiplayer
1 messages ยท Page 604 of 1
Oh I see, maybe I should just make a new enum that mirrors it
you kinda can
as there are wrapper blueprint pure functions for those
IsServer
and such
these are kinda wrappers, there isn't one for Autonomous or Simulated tho
oh wait
those are roles, ignore me
networking in BP sucks :S
! IsServer ๐
ListenServer is actually a PITA
cause you have to handle two cases
Server and Locally Controlled also
Dedicated Server is far simpler in terms of logic
ENetModeBP ULowLevelFunctionLibrary::GetNetMode( AActor* Actor )
{
if ( !Actor || Actor == nullptr ) return ENetModeBP::NMBP_MAX;
auto NetMode = Actor->GetNetMode();
if ( NetMode == ENetMode::NM_Client ) return ENetModeBP::NMBP_Client;
if ( NetMode == ENetMode::NM_Standalone ) return ENetModeBP::NMBP_Standalone;
if ( NetMode == ENetMode::NM_DedicatedServer ) return ENetModeBP::NMBP_DedicatedServer;
if ( NetMode == ENetMode::NM_ListenServer ) return ENetModeBP::NMBP_ListenServer;
return ENetModeBP::NMBP_MAX;
}
Lol
๐
I bet there's a cleaner way (converting to a byte and and trying to see if you can get the corresponding one in the other enum?)
Is there any way to make WasRecentlyRendered() happen in clients too? I want to set a tick interval when any connected player stops rendering actor, but its always happening when authority renders the actor, doesnt work for clients
So basically if my actor is not being rendered by anyone I want to set a tick interval
@potent cradle you can also convert that to a auto switch
take in actor, and have diff exec pins based on netmode
{
if ( !Actor || Actor == nullptr )
{
return ENetModeBP::NM_Max;
}
return static_cast<ENetModeBP>(static_cast<uint8>(Actor->GetNetMode()));
}``` possibly lol
Which hosting platform is the most affordable and easy to setup for a dedicated BR server (not self hosting btw)?
ExpandEnumAsExecs="Parameter"
For BlueprintCallable functions, this indicates that one input execution pin should be created for each entry in the enum used by the parameter. That the named parameter must be of an enumerated type recognized by the Engine via the UENUM tag.
``` even more clean @meager spade @potent cradle
i did mention that
oh, didn't scroll up
it doesn't mention that function has to have enum parameter by ref
for it to work
but that node is typically to verbose to be useful
I've done my best to comprehend this, but it's escaping me
this indicates that one input execution pin should be created for each entry in the enum used by the parameter
This one
The UENUM thingie I added I think
make the enum class ENetModeBP : uint8
did TEnumAsByte not work?
It did ๐
so?
Oh no
Sorry, I'm mixing things up
It didn't
I stopped at this point
Didn't quite comprehend how to continue
void ULowLevelFunctionLibrary::GetNetMode(AActor* Actor, ENetModeBP& OutMode)
{
if ( !Actor || Actor == nullptr )
{
OutMode = ENetModeBP::NM_Max;
return;
}
OutMode = static_cast<ENetModeBP>(static_cast<uint8>(Actor->GetNetMode()));
}
would make like a switch node
with different output exec's based on netmode
LowLevelFunctionLibrary.gen.cpp(101): [C2664] 'void ULowLevelFunctionLibrary::GetNetModeSwitch(AActor *,ENetModeBP &)': cannot convert argument 2 from 'TEnumAsByte<ENetModeBP>' to 'ENetModeBP &'
๐ค
TEnumAsByte is a wrapper to expose non-UENUMs to BP
its not to be used with actual UENUMs
Hmm, but then if I remove the UENUM declaration, I wouldn't be able to pass it through the other function I had anymore I believe, correct?
ENetModeBP ULowLevelFunctionLibrary::GetNetMode( AActor* Actor )
{
if ( !Actor || Actor == nullptr )
{
return ENetModeBP::MAX;
}
return static_cast<ENetModeBP>(static_cast<uint8>(Actor->GetNetMode()));
}
This would no longer work, and I kinda like the format of this function.
For the same reason as this
cannot convert argument 2 from 'TEnumAsByte<ENetModeBP>' to 'ENetModeBP &'
implies you wrapped your UENUM into TEnumAsByte
Its obviously a very wrong topic to use but is there somebody familiar with AWS Cloudformation and GameLift?
Hello. it is okay to replicate the transform of actor in event tick ?
Hello
Does anyone know how to request current ping so that I can call a server spawn and pass in the delay to compensate for the Ping?
That depends. Are you doing something beyond what Replicate Movement does?
Playerstate contains a ping variable.
I'm doing Impulse
and It didn't work at the replicate movement
You're trying to do replicated physics movement?
How ?
It's pretty complex but checking replicate movement and replicate physics to autonomous proxies, it should at least work.
If you're using add impulse to move the object around, then you're using physics.
Are you doing the impulse on tick?
If so, you should be using add Force instead.
Impulse is used for one-off things like launching or hitting something. Force is used for continuous forces.
I want to mark this variable as replicated in PawnMovement class but I dont want to make changes in this class, is there any other way around?
What I read from stackoverflow says if you need to use same variable you need to set that variable in base class as private so you can declare it in your parent one without hiding it, but velocity is public and it must be
Should be multiplied by 4 to get the actual ping @uncut schooner
@peak sentinel why do you need that replicated?
Velocity should be local only and calculated locally.
Okay then good to know, client was always on zero with velocity
Depending on what type of movement you're trying to do, it can be important to replicate velocity. Say, if you were making a high-speed racing game. It would definitely be important.
@idontunderstandcppijustpretend#9334
What are you trying to do anyway?
I am trying to replicate UFloatingPawnMovement and everything is almost done but velocity is not working as I intended
Prorably I made a mistake somewhere else
what reason would you replicate velocity? You could pass the velocity via RPC, but you would not replicate that propery
property*
I migrated a system from somewhere else and edited it for myself and I was in assumption of I need to replicate it in order to make it work with the system but I was wrong
I am already passing with RPCs but in that RPC client velocity always returns 0, prorably I am making a mistake like setting that velocity in wrong line etc.
Oh, hi thanks everyone
I want to move a projectile further along its simulation on the server to align clients one
It works hardcoded
Tying things to compensate for lag
@wind oasis sorry wrong reply
If you want to replicate movement on tick rather use inbuilt replicate and set frequency to 60
@wind oasis
You need them to be synced with ping ect?
Maybe try the Velocity for impulses
its also built in
Ill show you
I found it
This wont solve the delay but will probably solve the other issue, like the speed synced
it is good ?
If you call that on the server it will impulse then but I think replicating using the setting is better
Go to class defualts
try make the 60 250
So it does it even if there are more frames
also change the values to rounded 2 places
Good luck
Did you tick replicate movement?
Yes
Has anyone gotten VOIP working smoothly? The mic cuts out really bad for everyone. I set the mic threshold to -1 and tested on an empty map, same issue
If you get right up to the microphone, it sounds fine. So it is a mic sensitivity problem
Either the mic threshold isn't taking effect, or -1 is not the value I need. I will try with an extreme value such as -100 and see if that helps. I'm doubtful though
@lucid vault I had no luck getting it to work well on 4.25.3
In the end I switched to Vivox which has been very good.
@silent valley Do you have a positional audio setup?
yes, vivox has one positional channel available
I too have been trying to get voip working and will switch to vivox as well
@wind oasis
Is it like a mesh that needs to be replicated?
You have to make it the root object
I find the documentation for Vivox vague and confusing. I've enabled the plugin, but I'm not sure what it means when it says to select a user ID and login. Where do I actually login? Somewhere in code?
Appears so. Additional token info can be found here:
https://docs.unrealengine.com/Attachments/ProductionPipelines/VivoxPlugin/VivoxIntegrationGuide/UE4.21 Access Token Dev Guide.pdf
the Vivox plugin distributed with UE4 targets a much older version of the SDK and can't be used with newer accounts
that's why Vivox has their own UE4 plugin
@lucid vault yeah ignore the docs, follow the guides on the Vivox dev portal. They have a version of Shooter game which is a great place to start.
I copied a bunch of code out of the game instance class they setup to get me started.
Outdated docs bite again
Always
I love getting my info from 4.8 docs before all the cine work done. It's my favorite ๐
Am I missing something? I am in a multiplayer game and I want to show and hide some actors locally only, I am using 'set actor hidden in game' connected to a widget button click, however when I do a print string debug on client 1, it returns data from client 4! I don't want this to replicate but be local only. It doesn't work btw
Do I need some kind of 'client only' flag? I thought this would run locally only by default.
In fact it always seems to give me a 'hello' message from client 4
meh fixed looked like just related to parent/child hierarchy. But weird I got a message from wrong client
have to investigate
@twin juniper If that printed from client 4, then the click was on client 4.
@silent valley I'm assuming you don't want to use your Steam username to login to Vivox as it's not unique. Would it make sense to use your Steam ID?
I can't login to Vivox in Init() of GameInstance, because my PlayerController is null inside that method. I require the PC to get the uniqueID loaded by Steam. And since the PC is null, I can't bind a delegate to the PlayerState's unique ID.
Where is a good place to run this login code once where I have access to the SteamID/uniqueID of the player state?
UE_LOG only prints for server, right?
No.
It logs to whatever context its being called in.
If its being called by the Server it will Log on the Server. If its being called by a Client, it will Log on that Client.
Understood, thank you
Hi all, is that a way to package dedicated server with Client, as I want make offline mode for my multiplayer game. so the player device run a dedicated server and client, then I dont need to rewrite all the code and blueprint for single player
Do you mean a listen server?
no , even you run listen server, some logic only only in client will not run
thanks maybe I can run as listen server then just move "client only logic'' in offline mode
Maybe, I don't know much but what you described it sounds a lot like a listen server so I just wanted to point that out
You could also have a main menu that actually allows you to connect to the server and go to your offline mode
is it true that world composition is not compatible with multiplayer ?
@silent valley @steel vault I fixed the VOIP sensitivity issue with two commands:
voice.MicNoiseGateThreshold = 0.01
voice.SilenceDetectionThreshold = 0.01
The mic picks up everything, now I simply need to solve the low quality / stuttering issue.
"simply" ๐คก
Nice. I assume some of it has to do with flooding the buffer with voip information which is probably another reason why using Vivox to separate voice info out is a good idea.
Hey guys,i have one question regarding the server processes, I am using gamelift, and i have deployed a server with 5 processess in it, to handle the different game session in one instances, problem is when i want to get the game session they all return same ipAddress, which is wrong, as all the player joins same Map, even though they are on different game session.
any one has thoughts about this ?
Thanks a ton, will check it out
@thin stratus , Thanks bro
the values its returning are close...
But not on point
Would anyone happen to know why when I pass a float "PawnYawValue" from client->server, it converts for example -90 to 270?
Yes but it's yielding different result when printed the same way on client and server
the server is handling it differently
Hmmm
Why are you fetching or sending that value
Yaw is replicated on pawns out of the box
Like the values read differently but probably mean the same value on rotation
It seems to be replicating fine, but the issue is I need to compare the clients value and the server value
and it would be hard to compare if they're in different format
Yeah makes sense
I can just do some math to convert them. Server seems to use 0-360 while client uses 0-180, 0 to -180
Ok checking
Appreciate the help
Alright, I'll try that. Also I found this: https://answers.unrealengine.com/questions/954138/client-and-server-rotation-are-calculated-differen.html
Okay, the values are sync'd up properly. I really appreciate your help ๐ @uncut schooner
Cool @austere snow
Each server process would usually run on a different port to allow multiple connections. Not sure about Gamelift specifics though.
@silent valley
each server is running on different port i need to get the port on which server is listening and pass it to the aws sdk i guess, anyone have better understanding feel free to message
I'd expect it to be the other way around. Gamelift tells each instance what port it should run on?
well its not instance, it is one isntance and has multiple processes, so IP remains same just the port changes
i see in my server that it has different ports , each process. but when i request a session it returns the same ip address
Ah... According to the docs FProcessParameters has a port parameter you set from game. Make sure each process registers a unique FProcessParameters.
do i have to pass different port for each process
?
or is it being handled by FURL:urlconfig.defaultPort() ?
what does this method will return ?
this is the question i am kind of stuck with
Idk what the urlconfig stuff is, but if you know what ports you are using the. Just pass it in. Or can you read it back from unreal for each process?
do you know how to get listening port for server , because server is listening to correct, its just the aws does not know about this
Return the URL of this level, which may possibly exist on a remote machine.
Is there a time variable I can get that is synced between server and client?
Again, you need to multiply this by 4. The variable even tells you to if you hover it iirc
And of course turn it into an integer first in case the value exceeds uint8
GetServerWorldTimeSeconds
Thank you!
@silent valley for dedicated server it does not return anything
Idk then ,sorry. Search the code for 'port' ๐
yeah, doing that,
Thanks for your help
Any Ideas why the Run on owning side works and the Multicast not? I tried many different ways. Ps: it is an actor component and every Player controlls an other actor with this component but only the one with the same ID will react.
In debug mode I see that the Variable will not be set correctly on the server
Ok one step further now server replicates to all clients but client only updates on hisself
Is this maybe an overriding problem from the server because the server will override the variable with his own?
@austere snow They're not really out of sync. Most anything that uses rotations either unwinds them, or the rotation's winding doesn't matter. When a server sends a rotator, it compresses it down into the smallest form it can manage, and when it uncompresses it on the client, it ends up 'normalized', or more correctly the winding on the rotator is taken out. Actual rotators are -180 to 180 on all axis, even pitch. Most times pitch never goes above or below 90 or -90, but it still can. anything above 180 will get wrapped around to the negative side. But when they're send to clients and compressed, they take away the negative side and compress them from 0-360 to get the data a byte or so smaller. On uncompression, it just does 0-360 without normalizing it, but the rotator is still the same.
@warm leaf First off, when using tick in a replicated actor and doing networking on it, much like beginplay I'd recommend a switch. Right now you're making all instances of that object try to make an owning client RPC. So the client version will do something, and then the server version will tell it to overwrite that. Judging by your earlier post, I'd assume that it's not even running the RPC from the server. You said this was in an actor component?
jea it is an actor component and thanks for the help (event tick is only for Testing ๐ )
The component itself is set to replicate and the actor that it's a part of is replicating as well?
Can I ask what you're generally trying to do?
If I understand right, you want to move something on a client, and have that movement update for all other clients?
jea but only one specific actor should react (the one with the same ID as the player)
Is it possible that you could set the actor with the moving component to be owned by a client? It would make that very simple.
You wouldn't need IDs then.
No I found nothing on the Internet
Thats the reason for IDs
Wait. Do you mean somethink like this?
This only works for Actors not for Actor Components
and what do you think GetOwner does from ActorComponent scope?
Maybe I have to make multiple Location variables on the server so they cant override each other
ok. but in which way this will help me?
oh I know this Document but it only helped a bit for my specific problem
Is there anyone who has the time and could help me with the Unreal engine? I am a beginner in c++. I have created multiplayer to play with my friends and I would like to make a shooting game. If theres anyone who could help me please message me
the workaround works in theory but the variable dont get set on the Server
@queen mortar If you're looking for a tutor, I'd suggest the job board. Otherwise you're better off with reading a lot of the pinned material or asking specific questions that people can help with.
@kindred widget okay thanks
@warm leaf never send a reliable RPC on tick
and never send a reliable Multicast on tick either
Heya, hope you're having a great holidays.
I wanted to make an Multiplayer(LAN+WAN) game for android.
I was successful with normal LAN connection but I was wondering how can I do it like one device creates a HOTSPOT and other Devices joins it [Like other games Mini militia, Among Us]
And also want to host sessions through WAN. (On PC its simple through Steam OSS or Direct IP) but what can I do for Android to achieve it(Maybe Google OSS?)?
I searched a lot but couldn't find any good tutorial or doc or other resources.
Can someone give me some clue or show me a way to achieve it?
EOS should work but I didnt tried yet, I am in doubt too @gaunt steeple
It allows you to create a P2P session on ios and android
@peak sentinel I thought about it too, but was not successful with that yet. I was wondering isn't there any other ways?
Default OSS system also should work by default but you need to make some changes manually, afaik
the NULL?
I mean every other way passes through default OSS
yeah
But I have zero knowledge about it, just heard it works
But the there is an EOS plugin in marketplace, I asked in their discord channel and the developers of the plugin told me that EOS works with p2p android
I'm already using NULL which is working fine with LAN but not with Hotspot LAN or WAN. and I have no clue what to modify
Thanks for the suggestion but right now I don't want to spend on any external plugin because I want that for Learning purpose and do it manually.
Its free actually
Its handling the auth system for you and automates some other stuff, which is I guess could be helpful for p2p
But free version does not provide support, you are limited with documentation
But since its christmas, developers are on holiday and they created a community support section in their discord, so meanwhile you have the chance I would say try it out
Is the WAN for Android also available in free version? Ok I'll check that out
Yeah everything is included except blueprint and support by developers
That's nice
is there a way to check whether a particular actor has been network culled due to having exceeded the 'Net Cull Distance Squared'?
check where?
anywhere lol
i just want to know if the actor is still being replicated on remote clients for example
well it does, its just not having its properties replicated anymore until it comes back into range
at least thats what seems to happen
only if its static
what do you mean by that
loasded from package
has to have static NetGUID not to get destroyed when not relevant
btw
if you need to check if something is relevant on client
you're doing something wrong
Is EOS reliable enough to use for logging in, parties etc. or would another system like playfab or so be preferred?
@soft relic playfab for parties is messy, if i were you i would use eos or steam for parties and stuff like that because it is much easier to implement and to wrap your head around it
anyways on with my question, i have my character go ragdoll when they die, on the client of the character that dies the ragdoll works fine but on the other clients it shows in slow motion, could it be that the network is trying to replicate the ragdoll?
you should not replicate the ragdoll, it should only be done locally
but apart from that, no idea why its going slowmo
yes i know, i just unchecked "replicate physics to autonomos proxyes" and its still in slow mo so i guess that wasnt the issue
man this thing has really got me stumped, what could cause the physics simulation to be slower on other clients?
Sorry to ask so many times but I realy dont know why it is not sending the variable properly to the server (I read many documentations and also my normal replication process dont worked)
Multicast works on server but the replication to all dont work on client
u dont replicate variables with functions if that is what you are asking
u mark a variable to be replicated in the uproperty and override the GetLifetimeReplicatedProps
what are you trying to achieve exactly?
replicate the Location of the actor so every client can see it
does it use physics?
nope
u need to be more specific
it is an actor controlled by a player through eventdispatcher
what does this actor do
move 100 units
so it moves 100 units when you interact with it?
jes
how do you enable the push model? i assume it is some .ini file value somewhere but i cant find anything about it
assuming the server has authority over that actor all you have to do is do a server function without multicast and set its position
and that actor also needs to be replicated in the BP
you gotta go inside the BP and tick "replicates"
ok i will try thx for the help
It is replicated
Is there a way to replicate data only to specific players?
there is, but it's not easy
either you have a special Team Actor or something, and override IsRelevantFor
Could you elaborate on "Team Actor"?
an actor which the gamemode spawns for each team
and is only replicated to that team
Does anyone know how often the server updates the position and rotation of the character in the CMC? For instance if the client is running 240 fps, does the server then update the character's position and rotation at 240 fps too? Or does the server have like a cap at 60 fps?
@meager spade I'm guessing you can't override IsRelevantFor in BP, right?
So by accident the dimensions of my game maps are absolutely huge. I thought this wouldn't be a problem since all my meshes have huge dimensions as well so it's not like the level is more dense it just has large unreal dimensions. Problem is I am running into issues with net cull distance.
I donโt think so, BP can only do very basic replication. I donโt recommend doing much networking in BP
My velocity variable works on everywhere, but when I try to do
if(GetOwnerRole == ROLE_SimulatedProxy)
{
Print(Velocity)
}```
its returning zero. There are more functions and lines of code but I tried to explain as simplified, I am basically trying to set some variables as Velocity, like VariableA = Velocity and VariableB = Velocity but only on SimulatedProxy its always returning zero. Am I making a mistake with proxies or my code sucks?
SimulateMovement() is running on each tick as locally without relying on any role. And UpdateServerState() is being run on server. Both prints / sets correct velocity values. Only SimulatedProxy does not work
need a bit more background here, "Velocity" is a replicated var?
and I would add breakpoints to anything that manipulates the velocity variable
I tried to print every function instead of breakpoints, still couldnt get used to IDE breakpoints. Nothing is manipulating along the way, it just becomes zero on SimulatedProxy. Velocity is not replicated, its coming from PawnMovement, the class I am working on is a child of UFloatingPawnMovement
So velocity is being manipulated by only FloatingPawnMovement and other base classes, any replicated function I made is not interfering it
But, I have some variables getting values from Velocity, like a struct that stores server data*. ServerState.Velocity = Velocity; and ClientStartTime = Velocity -- ServerState.Velocity returns correct values, but ClientStartTime is not and I am not setting Velocity along the way. And its only being manipulated by FloatingPawnMovement's functions, but in any case it cant be zero. But when I change the ServerState, an on rep function is triggering, and if I am SimulatedProxy, a function I selected is triggering from that OnRep function. And when I try to print Velocity its 0
Actually just realized, its becoming zero on OnRep functions. Prorably because its not a replicated variable, right?
Velocity should not be a replicated prop though, it changes too frequently for a rep prop
Yeah, iirc you told me that before, also in CMC its not replicated. I thought it was only returning zero for SimulatedProxy but looks like its same for any non-authority connection
I'll look through CMC to see how client receives client data, to see if I can find something helpful
it does it via Unreliable RPC's
Hey guys, Is it possible to tap into Unreal handshaking process, so we can check the state of the connections directly from unreal's code
think thi bp is depricated but can't tell https://www.youtube.com/watch?v=WPVuMFotWJ0. Its the get unique device id blueprint, if it is whats the alternative, right now i think maybe ill useI guid instead but don't know if thatll cause any problems just looking for the best way to do unique player identification without having to use any sort of database out of ue
What is the Get Unique Device ID Node in Unreal Engine 4
Source Files: https://github.com/MWadstein/wtf-hdi-files
Hello everyone. I'm new to multiplayer, just trying to wrap my head around the concept of replication.
I'm just gonna post what [I think] I know about the topic, and I'd appreciate it if y'all would tell me if I'm wrong anywhere and how.
So, replication matters only in multiplayer games, and it is the way that UE coordinates a variable value between remote players so that they both see the same value when they go to read it.
Just going to say this to you. You'll need to understand the concept of client-side prediction aswell. An article that helped me understand this is this: https://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html
okay cool
I don't even know what the word predication means lol. I'll have to look that one up.
oh... you meant to type prediction?
lol good luck. I'm not really good with defining words so I don't want to give you any wrong definition
?
Look at the URL...
hehe. okay, I know what that word means ๐
If he is new to multiplayer, dont throw a complex thing like CSP at him...
Dont worry about CSP until you understand the basics of Replication.
okay... so, I'll just continue with what I was saying for now (I'm still gonna bookmark that link for later though, potato)
Yea It's good to keep
Can I recommend you a tutorial?
Just explains the "idea", not diving into blueprints and making game templates
@covert rampart If you havent read the Network Compendium in the Pinned Messages, i highly recommend you do that first.
https://youtu.be/TEojA3VBXG8 its compatible with compendium, after the reading you can take a look at this too
Does anyone know why this may be happening?
Client is absorbing remote function ServerFire on actor BP_TestWeapon_C_0 because RemoteRole is ROLE_None
For some reason, damage can't be dealt to other game clients
well the answer is right there
its RemoteRole is None
weapons should be spawned on server, replicated, and have it owner set to the Player who has the gun.
Oops, that's a stupid mistake on my part ๐คฆโโ๏ธ
does anyone know how to leave a session using the built in ue4 subsystem
@inner sand I believe you just map travel out
got it, if i want to move all players through like a map lobby system is there a good way to do that without having them leving the session
Loading a game saved in a steam multiplayer, do I have to create a session prior loading the game? I assume a session need to exist.
no
game saves are not managed by steam, there's nothing stopping you from loading your save file regardless of your session state
Then how do you continue multiplayer gameplay after loading a multiplayer game
@hollow eagle
I think I've answered this for you multiple times - there's no single way to do it, but one way would be to have the host load whatever save data it needs and then replicate that data to clients when they join.
Is there any tutorials or example projects or docs to get more info on this?
My loading would be very similar to the grounded game's multiplayer loading, i assume
There's nothing special about loading in multiplayer, you just load your save normally
as far as replicating that data goes... lots of ways to do it, depends on how big the data is. Depending on the game you may not need to send much manually if most of the "saved" actors are replicated anyway
Ok you said replicate that data to clients when they join, so that means a session has to exist, otherwise clients can't join
a session existing is completely irrelevant to loading the game, you're talking about two completely different things.
Yes, you want a session to host a multiplayer game. The host doesn't need to have a session to load the game, but you can do both things at the same time if you want.
all "loading a save" means is reading the save file from disk and deserializing whatever data is in it
what you do with that data is completely up to you
yes you told me that before
I think I need to do both things at the same time to solve my issue
That's fine, as I said - you can do whatever you want in terms of loading a save. If you tie that to the host opening a session that's up to you.
I assume when loading a level in multiplayer I also have to use the special param with OpenLevel
Testing this is hard since it requires two pc and two steam account..
you can test on a single PC if you use online subsystem null.
can even test multiple clients from the editor
Question, having some trouble with destroy session node players persist even after it is called and are not disconnected, it is being called on the game instance but is being called by the listen server, can it not be run in the game instance whatsoever or is do I need additional steps alongside destroy game session to disconnect players
I think I found a good solution to replicate a non player actor that is controlled by the player. Add this code to your player and in get all actors of class the actor you want to replicate๐ค hope this will help some of you
@warm leaf Is the robot a character class?
Hi all, anybody good with replication ? i am testing something and i am getting all kinds of interesting results, except the result i want to get ๐
this does not run on CLIENT, if it has been triggered on server side.... but it runs ok on client and server if its triggered on client side
could anybody explain why? btw. it is inside player controller bp...
like... when i mouseover a grey cube in Client1, then it is changed to red on Client1 and on Server too. But if i mouseover grey cube on Server, it is only marked red on Server, but not on Client1
@keen linden The issue here is the pointers you're trying to RPC. The Component could maybe be networked, but the material definitely should not be. And technically this isn't replication, although actual replication would suit you much better here. What is your actual end goal? Do you just want it to turn red on all clients when ANY person mouses over it?
@kindred widget thanks for the reply. I am testing how things should be replicated. Yes in this case i am trying to mark an element i mouseover with different color, but thats just test ...
so... i am trying to change a certain object property (in this case color), and make all clients know about it...
what would be good approach for this situation? to create a function "changeMyColor" inside an object, and call that function instead of trying to assign material?
and yes, by color i mean material, my mistake...
i am not trying to replicate the material, it does exist on all instances... i am trying to replicate the information that material has changed..
To try to simplify things for learning, the best way to manage most replication is to replicate properties and let clients do the cosmetics based on those properties. For instance in your case. You could make a ServerRPC from your controller that simply sets a moused over actor/component pointer on the server. Note that this would only work for Actors that are replicated, or ActorComponents that are replicated and inside of a replicating actor. So you send that pointer from the client to the server. If it's valid on the server, you might call a function(Likely an interface function to simplify this among all classes you might mouse over) that tells that object that something is mousing over it. In the server side of the RPC, you would get the current mouse over object, if it's valid, tell it to stop it's mouse over, then apply the mouse over to the newly sent pointer if it's valid. That's all just in the player controller.
Then in your actual component/actor, the function you call on it would affect it. This would be best done by setting a replicated variable. Create a repnotify variable and inside of the repnotify, you would affect the material individually on all clients based on the variable replicated, like a boolean.
hm but thats what i was trying to do.. "to let client change the matrial" by calling function SetMaterial, that is the funciton of the Actor or not?
basically i understand it like my issue is that the actor is not replicated
but in actor i can only see this, regarding replication:
and thats movement, not material
@keen linden Do you want your mouse over to happen at the actor level? Also simplifies it a little bit.
@keen linden Here, try something like this.
This is the controller class. Just a simple server RPC for your actors to use to update their own mouse over.
This is a simple actor class, set to replicate on the right side, simple mouse over event that calls the local player controller on this client to use it for RPCing, to set that bool at the top.
Inside of the same actor is a repnotify function, which uses the replicated bool to choose a material to apply to the local static mesh component in this actor.
In the end, the only networking is a single RPC sent to server, and then a bool variable replicated to all clients. The clients do all of their own work based on that boolean.
thanks looking at it
ye u do what i was thinking, u declare function "change my material" inside actor, and then call it "on rep notify" (i think it could be also called directly, but who knows)
i was trying to change actor from outside on purpose, to see how to replicate such thing.. but probably it is not possible
like.. i was trying to achieve the same thing, but only using the controller, without code placed into the actor
thats because i detect what actor i am mouseover currently, so i could have the logic outside of the actor itself, based on it's type or so
The issue is that even in single player, you really should let actors change their own components. Take for example a simple mouse over example without networking. The controller wouldn't do anything. It would just exist. Actors themselves would fire MouseOver events and do their own thing on their own components like changing materials, or showing and hiding specific components, etc.
Even with a line trace from the cursor in the controller, all you'd really do is call an interface function on these objects to make them do their own thing.
@kindred widget valuable info thanks
Hello, I have a problem. If I host a server (Listen Server) and a client want to connect it has no input. But if I load the map on startup it works. I think this is a posses issue or something like that. This is my OnPostLogin Event https://prnt.sc/wbkzp9
In multiplayer where the server is a client, I assume the only solution to the server closing if the host leaves is to not use client servers? (e.g to go the dedicated route) - Unity dev of 5 years moving over to unreal and have been using photon networking.
In unreal server who is client is called Listen server ...
What do you exactly mean by close?
Unreal has very robust multiplayer framework, so photon is not used here.
I meant client hosted, sorry I shoulda been clear
So yeah instead of a client, using just a dedicated is the option?
But our game is a little 2-5 multiplayer game. Is not a listen server better here?
I assume the only solution to the server closing if the host leaves is to not use client servers? (e.g to go the dedicated route) @little sable can you explain more about this.
I've been experimenting with networking where one of the clients is the host essentially, instead of building a dedicated client to host the games. If that host client closes, all connected clients are disconnected as the instance no longer exists
There is no Host Migration built into Unreal so yes no option out of the box. Although it is possible to roll your own solution.
That's what I thought, Thanks ๐
You can make host migration above p2p framework... Requires a lot of work
For my "first" project i'll probably just go down the dedicated route until I decide wether to stick with the engine or regress to Unity. Thanks for the input, much appreciated.
Yeah, avoid fighting the engine at all costs if you're a small team!
@little sable https://youtube.com/watch?v=-6WC3MqEh3M
Its in a form of a plugin, but im not releasing it yet cuz its impossible to use without proper documentation. Plus needs lots of polish since rn im using a bunch of delays instead of proper checks and things can easily fall apart.
โค Discord : https://discord.io/RetailRoyale
โค Twitter : https://twitter.com/RetailRoyale
Unreal networking is fantastic compared to Unity IMO. I was previously working in Unity but the networking was a mess. Unreal has networking built in from the core.
Unity networking is pretty horrible, but i've been working with it for a few years, so i've kinda gotten used to it. @rich ridge that looks quite interesting, saving the state remotely and doing an auto-rehost/rejoin looks like a good solution]
How do I specify what types of information associated with an actor I want to replicate based on distance? For example let's say player 1 swings and sword and kills player 2. I want everyone in the whole map to know player 2 has died. But I only want people within x metres to see the animation (since it's too far away past that anyway).
(I say remotely as whilst doing it locally would work for alot of cases, remote will be better for anti-cheat)
You can extend it above p2p framework.. like epic online services
There is a distance culling in actor class. It should do the trick.
As another example in my projects I have some structures which I want everyone in my whole map to see (with LODs on the mesh). I found I needed to check 'always relevant' to prevent these flickering in and out of existence on clients. But I have some data attached to them which I only want players close up to know about and I can't seem to detach this data from their inherited 'always relevant' status
Look into Replication Graph it has finer grained controls over actor relevancy
Very advanced ^
Although generally it's tied to an Actor and you can't split state easily without using another actor, or the GameState class instead
Hello everyone, I'm working on a gun system. It's working well on the host, but not on the client, what's wrong? (the line just doesn't trace). I had some issues because I can't get a reference to the game mode on the client, I'm just making a reference on the game state to the shoot function which is on the game mode. This screen is on the PC
And this is on the GM
@wise bridge GameMode doesn't exist on client.. if you try to acces GameMode on clients you will get null.
So need to rethink on your logic
That's why I'm using the gamestate, it's just a link to the gameMode actually I just want it to work, and move it after properly, shouldn't change anything no?
This is your gun system for a character right??
Yes
Why does your gun system need dependency of GameState or GameMode?
Gun system is a system for player to attack other player...
GameMode or GameState is for entire game not for player.
So why you are hooking game system inside of your mini gun system.
When to use FNetQuantize? Is it for packing/compressing FVectors? And is there any disadvantages or using it?
I thought it was better to do it there, so the position isn't biased with too much latency
To make the system server sided and not client sided
There is a simple approach for gun fire.
When user clicks mouse button to fire gun..
Do RPC to server.. and server will do line trace and spawn projectile actor for gun fire.. simple...
I guess you are injecting GameMode or GameState to avoid RPC isn't it...
So I just remove my mutlicast replication on the GM
Yes.
That's the way I learned to do it, people said it was the best for replication yes
Gun fire is specific to a particular player... So do server RPC in player controller.
Usually people do multicast in GameState not GameMode.
Ok I gonna try this, telling you if that's working later
@wise bridge check the pinned network compendium
GameMode only exists on server, does not replicate and can not handle any replicated functions.
putting Firing in the GameState is pretty silly also, complete break of encapsulation
What's encapsulation?
So I should just do it on the player controller? The point is that I don't want to do a client sided game, as there's a lot of issues on that
It's an actor
then why does that not have all your firing stuff?
your player or playercontroller simply calls Weapon->Fire when input is pressed
your weapon keeps all its logic
as long as you set the owner of the weapon to the player, it can do RPC calls
I was going for another logic at the begining of my system, but that's true
benefit of this is
Maybe you have a laser weapon? or a Rocket Launcher, or a crossbow, etc
by calling a Fire function on a weapon base class, you can handle multiple different weapons
Actually I just want to get a basic gun ^^
but its also future proofing ๐
but sure, if you want just a simple gun, do it in the Player Character not controller
cause you can not multicast from the Player Controller
(you can, but it won't work as expected)
eh?
when client presses input, you call a server RPC to fire weapon
if you want it non client side firing
No its a normal actor
Hi everyone! I've been studying client-side prediction and understand the concept on how to do it but implementing it has been tricky. Is there any source code I can study or look at. I think the character has cps but I have no idea where it actually is in the source code.
Also I'm not sure if the best way to send movement updates is through RPCs.
My clients movement in game looks fine to the server, but on the clients end they are rubberbanding constantly. I am using a very basic movement script. Movement is replicated in the character movement component. Anyone know why my client would be rubberbanding?
are u using pawn or character
character @vital heron
yea im not sure
it works fine in the editor, but when i try and play multiplayer on steam the client is laggy
weird, characters should be able to handle this
i was experiencing the same, when server was setting position of the player via SimpleMoveToLocation , character has been moved on client, but it was not doing animations correctly... so it was kinda rubberbanding... while on the server, movement was all ok
yea Ima leave it to these guys to handle your problem better. if it was a pawn I could've helped more since I have a lot of experience with them
yhea @keen linden i tried the simplemovetolocation aswell but the server just saw it as setting a location and didnt actually load in the movement animations and rotations
very weird
thats not weird, client should move itself, then animations will go ok
so probably your issue is similar, check who is moving what (by debug strings or something)
Hey all, new to the discord is this an OK place to post a question about Sessions and Steam?
*not to derail the current conversation. Apologies if not.
@harsh fiber probably wrong place for the question itself (could ask in general) ๐ but i think this channel is ok for steam, sessions and other MP stuff
I see, TY
Quick shotgun Q then: I have a game that is using OnlineSubSystemSteam (not sockets) and when I call EndSession the associated OnEnd delegates aren't getting called because the session never ends. Anyone have an idea off hand as to what would be preventing this session from ending? Or a good debug practice to find out why?
@harsh fiber i never tried steam, i only work with dedicated, so maybe someone else will respond you soon
@harsh fiber could try by enabling some more verbose logging. Not sure out of my head which log categories they use though
Let's say I want an AI character to move from point A to point B in a deterministic way. Is there a way to transfer this into input into character movement component for smooth replication?
all AI are simulated proxies on clients
they don't need input for smooth replication
that is required only for the prediction on autonomous proxy and nowhere else
Anyone know what I might be missing from an include or something? I keep getting this unresolved external symbol error when trying to mark a property as dirty for my push model:
In here:
is there any ufunction specifier magic out there to prevent reentrancy issues on RPCs? you can get something working on dedicated server, but then on listen server your client RPCs can have immediate side effects while you are in the middle of a loop etc. It would be nice if client and server RPCs could be marked to only get dispatched on the next tick on listen servers instead of immediately
@unkempt tiger its missing dependency in build.cs
link error is never a missing include
@fringe dove no
Aye I figured the same from some googling, still didn't manage to find the module name I need though
it should not require a separate dependency
as engine uses it quite a bit, it should be in Engine
Actor, ActorComponent and PlayerState all use it
Yeah, I looked at PlayerState and copied their style of usage
Which makes me scratch my head even more furiously as to why it wouldn't compile
the entire header is wrapped in #if WITH_PUSH_MODEL
you just need to enable it for your project somewhere
Best I could find was this console command which probably wont ever help the link error
wdym by setter?
does anyone know how to properly close bp session, simply destroying session or opening level on server seems to do nothing
How can I get an AI to follow another character in a replicated way, not relying on a navmesh? Basically I want to move in 3d space. Since all my obstacles are rooted to the ground I decided to use a navmesh for pathfinding and I move a 'dummy' AI character on the XY axis, which works fine (avoids obstacles). I have an AI character that spawns one of these 'dummies' on begin play, and I basically want to follow the dummy's XY coordinates (in a replicated way) as well as have some z axis variation which I define myself.
hey folks, is there a way to Set a Material Collection Parameter in a single player?
4.26
4.26 all you need to do is set a CVar to use push model
This?
yes
@unkempt tiger You will always need to include the modules ur using
It's a common mistake, so don't feel bad
๐
:D
Thanks, I'ma add it and give that a try, it's the first time I ever needed to tweak that modules line E: it worked! thanks ๐
I have a question myself that may have been caused by something stupid
For some reason, my server rpc is unable to deal damage to clients
It somehow breaks before damage can be dealth
And with more debugging, it looks like it's failing to raycast
raycast for bullets?
raycasting for bullets is amazing, so efficient
Running some more debug sessions
print all the logs
I used to spawn actual actors as bullets. For pistols it was somewhat fine but when you get guns like smgs and assault rifles is where it gets bad.
Ok I will stop getting off topic
That's tough
that stuff is still on topic :D
I did the same, then I moved to structs instead of actors
@chrome bay very kindly provided me with some hot guidance
Is it not possible to raycast via a server rpc?
I've never really understood structs, I need to research them more
shouldn't it?
they are essentially classes, only their uses/intentions are usually different
It should, I'm still debugging to find out why
I'm thinking that the player cam manager isn't replicated
while classes kind of linger around in your session and do prominent work, structs are more commonly used to aggregate data
@clever plinth An RPC is simply a mechanism to call code on a remote machine. It has no bearing on the ability of the code to perform certain actions (such as a Raycast).
oh thank you so much!
so structs are kinda classes but they are used more to store data
structs can still declare and define functions etc. In native CPP, they are identical to classes, with the only difference that their members are by default public, while classes are by default private (or protected? Idr)
I'm not sure why this is happening then, LineTraceSingleByChannel called on the server rpc is returning false
server might not have the same position as player
Make sure that its inputs are valid.
if you are using Animations
yes but for your linetrace, where are you tracing from
oh.
The PlayerCameraManager
Just the location of the cam manager
It maybe completely different to the Client.
PCM is not replicated
The CameraManager is not something you want to trace from.
but it can get client side updates to the server, but they are not all the time (meaning they can be different)
If you want to use the PCM, it has a function for getting the current ViewTarget camera location.
Gotcha
This is whats updated, from what Kaos said
Yeah, ALS does all the cam stuff via pcm, which is a real pain
So, GetActorEyesViewPoint would work?
ALS sounds like a Plugin that isnt Multiplayer ready.
Its advanced locomotion and it really isn't
Right
well it has really bad networking
epic tutorial bad?
๐คทโโ๏ธ
looks like Epic tutorial ๐
Most plugins are pretty bad
That's annoying
well, i do see a lot of people in #cpp making plugins, that are really struggling with basics still
Eitherway, you need to find a method for ensuring that the Server gets the most valid, up to date location for where to start and end the LineTrace.
Thanks for ur help Devils and Kaos ๐
Alternatively, you could send the start location with the RPC.
That is a really good idea
Nope
I decided against it cuz u can get away with using horrid animations in a tpp game
Also, ALS comes with a bunch of free anims so that's why I went w/ it
fairly sure you can get quite a few anims out of paragon assets
im not sure pluygins like ALS, SmoothSync... are any good for anything really
they are not standalone systems, they integrate with the rest of your game is my understanding
and as such, they also force you down a particular road, which makes them of very limited use for learning as well
I dont know about ALS but SmoothSync is really not any good, also it doesnt follow correct coding conventions for unreal
What is SmoothSync anyway?
A plugin that made for replicating physics/movement - for non-characters
ALS has to be a pretty good implementation since its developer is now working for Epic :-)
that... means nothing
fair enough, but I did look at it and it seems well put together
not trying to hate on the dev or anything, but just in general someone working for epic doesn't have any bearing on their personal endeavors outside of that work
and it sounds like ALS just wasn't originally built with multiplayer in mind, so quality is irrelevant
Isnt ALS root-motion based btw? As far as I know its not a good thing for replication
One-time root motion animations are okay but locomotion with root motion is dangerous, as far as I read from here
I dont think it is from what I could tell
@clever plinth did you consider things like lag compensation?
How would I replicate time that shows on HUD for all players?
Replicate an int32 that represents seconds?
Does it run on each player or server only
Let's say I have a sky system with time. I take the time and show it on hud for all players
Are AGameSession and UOnlineSessionClient used in the Session interface in the oss?
I admin the server for ALS. It's a great plugin to teach you the basics of animation blueprints and decision trees for animation. I use plugins like that to learn the basics and even some of the more advanced topics and then cherry pick from them and write my own system.
didn't say the animations were bad
but the replication/networking side is abysmal ๐
at least when i last looked at ALS3 and 4
Yes that I can agree with 100% haha
the guy who made ALS he is good with AnimBP and animations, etc. But people have different skill sets.
i am crap at AnimBP and animations
Same. It's a great guideline for everything outside of multiplayer for locomotion
@summer tide Replicated variables are Set by the Server and have their value updated on Clients.
In your case, the Server would set the time of day (in seconds?) and each Client would then know the same time as the Server.
I got that part thanks.
PlayerCameraManager exists on server too. but it doesn't replicate the player's local view to server.
So I ended up using TargetActor from GAS module... actually all my gameplay is via GAS.
Yeah, that makes sense now ๐
Using advanced steam sessions.
My 'Update Session' node is returning as a failure every time i call start game. This BP is in my gameinstance. Anyone know why?
Does anyone know about Steam friend invites? our invites get sent, received, player can accept the invite, but it does nothing after that.... lobby creation an joining is working just fine
an there is literally nothing about this online
you do need to connect to the host via unreal after joining the lobby from an invite
or after the game itself starts, if you're already in a lobby
@thin stratus Still haven't solved it but I did find how to change log verbosity
[Core.Log]
LogOnline=VeryVerbose
in DefaultEngine.ini
hey guys i wanna ask have anyone here have experience implementing this ?
Describes methods to achieve more performant Animation Blueprints through optimization techniques.
the c++ part
i cant get it to compile
is there an equivalent for set physics angular velocity that works in multiplayer?
smoothsync is decent, it's a component that replicates movement in a client auth fashioned way... it simply works
I've also found smoothsync useful
It's great for replicating movement of non-character class AI
Are there ways to 'brute force' smoother replication at close range? Pretty much I have two movement modes, the first is needed only at close range but it doesn't replicate as well
Force net update?
Is that exposed to BP?
Yes
Could also play with these
Not sure if you can change those with BP, but should be easy enough to wrap in a C++ function library if you need it
These are
Here is how I am handling my movement and I'm wondering if there is a smoother way to do it. I don't understand CMC completely
The 'following' mesh is an actor I spawn on begin play, that smoothly pathfinds on the ground. The point is this way I can have vertical axis movement as well, whereas pathfinding on its own does not allow that
The update to your server is being done on tick, so that's not the issue. It's the server that is not replicating frequently enough to the other clients, based on what you're saying.
So when that movement mode is active that needs more frequent replication, update the replication parameters on the server for that pawn.
Oh, that sounds like a different problem entirely
Compared to this
But the system I have looks ok, there is some jitter but very slight. Need to eliminate it though
Try this
Start with increasing Net Update Frequency
on the CMC or the actor?
The CMC has a bunch of replication/update variables, but I'm not sure those are relevant right now
net update frequency is 100
@potent cradle your UE4 looks different? Does UE4 support themes too??
Try 150, but 100 should be fine already. Actually, I wonder if maybe you just have issues with your logic somewhere
Are you playing as dedicated server?
Try listen server to see if it's smooth
That will at least show you how it looks on the server
๐
He also has a plugin for cleaner blueprint node connections/lines
on the server it's smooth aye
Nice
I've often had jitter like that when there were a bunch of corrections or mismatches of the CMC between server and client
That is to say, things like max speed not being the same on server/client
Or the movement mode not being the same
Etc.
As a debug, perhaps run a print on a timer with a bunch of important variables like max speed and movement mode. See if there's a discrepancy, it'll show you the print on server + client, then you compare
(switch back to dedicated server for this)
Looks like my move direction is only getting set on server
On my begin play I spawn an actor, not on server, however the actor is replicated and moves using nav movement
Replicating movement as like the class defaikt too? For that actor bp
Does anyone know if it is possible to design a multiplayer game with blueprints where the players can be in different maps at the same time? Like an mmo where people are in different continents, dungeons, towns, buildings etc?
I'm assuming then that level streaming wont work well for this either?
Alright. Thanks ๐
So I have this really weird replication bug.. it seems that a certain UPROPERTY() in my struct is being received by the client all wrong
The UPROPERTY in question is this WeaponEquipTarget
Logs show that the server sends it as a nullptr
However the client received it as a valid AActor* pointer? what?
These are the Replication and OnRep functions, I don't see what I could be missing
UPROPERTY(Replicated)
structs don't ned Replicated
I thought I had to add the NotReplicated specifier when I dont want to replicate things
Right, that's what I thought
my bad, i didn't know this fact.
Sometimes it'd be the other way around too: the server would send a valid AActor* pointer and the client would receive a nullptr. In this case I thought it was a relevancy issue - but nothing afaik explains the reverse scenario...
Could it maybe be some internal delta serialization related working of the engine that's spazzing out? 
Perhaps its a matter of ordering struct members from biggest size to smallest size 
I think I know what the problem is...
I took a closer look at the logs and organized replication and onrep lines side by side on sublime... and saw that packet 47 and packet 48 never actually made it to the client. And it was those packets in which the weapon equip target value changed. Could it be that UE4 decided to just merge what should have made it in packet 47/48 into packet 49?
Even though I specifically added the Atomic specifier?
I built my netcode so that it's resilient to missed packets (like packet 47, 48) so things stay in sync
But I did so under the assumption that no merging of values will take place when some packets fail to arrive...
If I have a server RPC is IsServer() check inside it useless?
you should do auth check inside of server events and rpcs... if not hackers can try and force them to run on the client....
Where would I set the subclass for my game's UGameUserSettings
@clever plinth look at the shootergame project
Yessir, I have been
DefaultEngine.ini
[/Script/Engine.Engine]
GameUserSettingsClassName=/Script/ShooterGame.ShooterGameUserSettings
Oh, so it's configured
yeah, it may be settable from UI too
np
What is signigficance of this class??
@rich ridge Game Settings ๐คทโโ๏ธ
In perspective of multiplayer.
Oh shoot, I forgot that this was the multiplayer channel
๐คฆโโ๏ธ
@rich ridge That's my bad
no worries I was asking for my own knowledge if its related to multiplayer somehow.
How difficult is setting up a dedicated server? I have some logic that only works on client (although it replicates fine), would this be an issue without dedicated server?
I don't really understand the whole 'hosting' thing, I have a pawn possess command that allows clients only to possess other unpossessed pawns at will but does not run on server. Does 'host' as as a kind of client and server at the same time?
You need source build of Engine
wot that mean
Is it hard to learn? I am going to have max 4 players, maybe 5 if its smoother than expected
It's not hard.. just follow instructions and you should be good to go
Do you care if the main host can technically cheat? Like is your game designed to be played with friends or is it competitive?
Friendly but would rather not have cheating
On YouTube you can find a lot of good tutorial building dedicated servers
If you want to keep everyone from cheating then you need to host servers yourself, and use dedicated servers.
Nowadays UE4 development has become easy
If you want people to host stuff themselves, dedicated or listenserver, you have to be aware that the host can cheat things.
yes a lot of stuff I am very reliant on predesigned code @rich ridge eg character movement replication is all done for me
I actually know very little
What does it mean to host something myself
You have to pay for server space.
You become the admin of your game servers and you spin the dedicated servers on cloud like AWS, azure, etc
And you pay the cost of server hosting
So this is me but my idea of hosting a game was like
I build a pylon outside my house
Pylon??
If you game is small, and you want people to host themselves, don't care so much about cheat prevention. If we're talking like a couple of friends chilling with an RPG, they're going to police themselves. Listenserver setup is also a lot easier for this in the end because it doesn't require your users to download and setup a second piece of software just to play with each other.
^
What about anti cheat failsafes
so that maybe julian assange can cheat
but not the average player
I mean definitely still do good programming. Don't let clients fuck with server stuff. Server alone should have authority. But just be aware that the host themselves can still memory hack or whatever, just like in any single player game. Most people who play games with friends are pretty aware of this though.
You still want the tools in place for the responsible one in the group to host and keep the group troll from being able to ruin things, but the main host is still going to have access to the server.
I could add some random checks to troll people
Like if someone's health changes unexpectedly they insta die
or turn into a goat for the rest of the game
Anyone got any good source code to learn client side prediction?
I have a System which sets Variables on the server only... they get replicated to all clients all good and games... but how do I "hide" them from other clients...
For example the Server sets Player 1 Money to 100
And then all Players "know" that Player 1 has 100 Money
How would I change that ?
just make it replicate to owner only
Is there any reason why I can't set the current active player (possess/unposses) inside the UMG widget? I want the game to switch to the second player after a certain time as passed, but posses and unposses don't seem to work inside the event graph for my widget
For some reason it doesn't seem possible at all to posses or unposses the pawns I have in my game (they are spawned in at run time)
However, possessing them directly after the "Create Player" event on construction works fine. Is there any way to circumvent this?
Possess and Unposses are not functions of UUserWidget
also
the widgets/UI is local, and you really need to run possession logic on server
Also don't try to Server RPC from the widget.
Just incase you try that one for the possess call.
calling Possess will Unpossess the previous Pawn automatically, too
Hey Zlo, you do AI stuff, right?
on occasion, Kaos does most AI stuff
Do you know where the magical key is hidden to enable NavMeshWalking? Everyone on forums is like "Use this! It's magical! Paragon uses it, blah blah.".
CMC, MovementMode
Tried changing the CMC's movement mode to that. No change in performance, and the AI debug thing still shows "Walking" as the movement mode.
the search for floor is a little bit cheaper
with 150 AI its about 1ms difference though
as nav trace is significantly simpler then a capsule sweep
and its done on Tick
Is the AI debug thing showing up as "MovementMode:Walking" normal, then?
no
the 2 are mutually exclusive
note that its not for every game
with our isometric camera, there are no real drawbacks
but for FPS AI walking 30 UU above ground would look silly
I don't know why this thing isn't changing then. I'm setting it as a default and on beginplay. ๐ฆ
probably something overwriting it later on
after you pass the set on BeginPlay
verify it while on a breakpoint, and put data breakpoint to catch what changes it
It's changed right after it's set on beginplay. It's NavMeshWalking = true directly after the set, but even the tick after that it's false. I have no idea what could be setting this, because this is a super simple AI.
so while on a breakpoint where you verify its true
set the data breakpoint on the value
and examine the callstack after it hits
that is the most efficient technique for catching undesired changes
I need a C++ base class for that, don't I?
good idea to have those
Like I said, this thing is incredibly simple. Right now it's nothing but a death, small beginplay, and a simple behavior tree.
and yet something is ninja changing your movement mode
doesn't matter how simple it is
Something to do with the default AI controller. Only happens when using SpawnAIFromClass even with no behavior tree. SpawnActorFromClass stays on the correct movement mode.
Way ahead of you. Already spawned the AI controller manually and whatnot. The moment the AI is possessed, the movement mode can't seem to be changed. Even made a new controller class and disable tick, etc.
Hello again everyone. I have a question about authority and replication of ABPs.
I have created a blendspace head look for my first person character. It works perfectly on local. The head and body blend nicely. However, I cannot figure out how to get this to replicate to the other clients.
- Does every aspect of a player pawn ABP replicate always?
- Does the player controller not replicate? Is there a way to fake it?
@sly violet AnimBlueprints are local only. Where you're setting Pitch, try to use BaseAimRotation instead of ControlRotation.
I will give that a shot, thank you
Leave a mention if you have any trouble past that.
100% that was the issue. Thank you @kindred widget
Are there any drawbacks of using client authoritative movement other than cheating? (And yes I do know about client prediction and custom movement component)
Setting AI behavior and restarting their logic, would that need to run on server only? I've an AI when I interact with it, it follows me.
@summer tide All AI Logic is serverside, usually.
Really depends on what those actors are doing. You're really going to need to look into the replication graph for that sort of thing. Default replication will probably choke and die on that. I have to assume that it's possible though, I assume that there's at least that many actors in a Fortnite match.
Fortnite has 50k
push model replication will make that more achievable
Btw while talking about that subject, is lockstep (i dont know what it is, just heard from reddit lol) mandatory for RTS in Unreal?
Hmm ๐ค I think I asked the wrong question. Is lockstep even possible in unreal?
You could implement lockstep networking. I don't know why you would unless you absolutely had to though...
for an RTS it can be useful but you're going to have a hell of a time trying to implement it
you still need repgraph if you want to go over a few thousand
and push model will certainly help
you will have a hard time implementing lockstep
since you need to break some assumptions inside of the engine and the gameplay framework
and good luck keeping things deterministic if you use the built-in physics
and I'm sure chaos is too
is it really? huh
it's why dave ratti is doing cool shit with physics rollback
neat, wasn't aware that was one of the reasons to go to chaos
Thanks for the infos
Was really hoping chaos was deterministic. I need networked physics to work for me without trying too hard lol
hello everyone,
I want to make a sample Steam IAP, but I don't know from where. Can anyone help me with an example/the tutorial for IAP on steam?
It would be great to have a tutorial on IAP on steam
@small dove the oss docs are pretty useful once u get the hang of em,
I remember I had to stick to that, and you get the patterns after a few hours of trial and error
Definitely make a test project to test out the functionality u are interested in
So I'm using root motion for everything. The server walk animations appear faster. Any idea why?
This is what I did in bp
can anyone please let me know about extending the world Bound Limit , as i have map of 40kmsq , and thats still nothing compared to other map sizes like witcher which is 136 square kilometers in size , and DAYZ which is 225kmsq and if there is anyway just let me know , even if i have to change engine code thanks:)
I think there's a check box for it. In world settings...
I think you also have to enable world composition
@summer tide i already checked that , and the one in project settings too , it only helped a little bit but i was still facing issues
Did you check this one? https://gyazo.com/6bebfe93ff465e2e388a169dfbbd1091
@summer tide yes this one , this is the one i checked
but after i checked it didn't do much
How does your level details look like? It has a square box on its center.
yeah it has a square box at the center , but my map is much bigger than that
i want to know how i can increase range/size of that box to fit the size of my map
You can't. The origin rebase option moves the origin as you move out of the box. DayZ and Witcher both use proprietary game engines not UE4.
okay thats fine , but there might be a way to like sort change it to my map size , say source code changing? , because even after enabling world origin rebasing i could still notice jittering in movement of my character
there might be a way to sort of 'personalize" like other engines can be ? i mean ue4 is pretty powerful , the thing is how do we do it ? is there way to change the world bound settings through engine code settings ?
UE4 is a 32bit engine. That's why.
That square box is the recommended for world composition and means 32 bit precision
whats the difference between 32bit engins and 64 bit engines
Twice the bits!
okay so cant we change engine code to make the bounds bigger ? even if its 32 bit and will it work ? , and i think this is a question for so many out there
That box is restricted by 32bit. Maybe UE5 will be 64bits and that box will be double the size. Also you can't just change a value or some code to convert an engine from 32 to 64 bit. It was architect that way.