#multiplayer
1 messages ¡ Page 573 of 1
proper in case there are more ways than one (which I don't know)
Yeah, good point đ
i prefer manager class (like SpawnManager) that holds all spawn points
then i just go SpawnManager->GetSpawnPoints etc
wrong channel
gotcha, so I'd need to make a spawnManager(SM) actor and have GameMode (on beginplay?) find all spawn points and pass to SM, then pass a reference to SM for all PCs on beginplay?
I mean you don't need to
Any class with a world pointer (any actor, component or an object that was passed it from them) can query actors
Just do whatever works best for you
100 ways to do it, each with there own benefit/disadvantage
How much overhead is there for structs and arrays generally? For example, two Bytes(uint8) in a struct and an array full of them. I assume that a hundred of these structs in an array would be more data than just 2Bytes*100?
It would be a custom class
Maybe an actor, maybe a random UObject, maybe a component on the GameMode...
understand
Or it could not even exist at all and any world object could do it
i am looking forward to make it a component
@meager spade The size of the array would be relatively correct if I did
sizeof(ArrayName[0]) * ArrayName.Num() ?
that wouldn't account for TArray overhead
Doing sizeof(ArrayName) returns 16. the previous one returns like 32,000 which sounds insane for an array of 2 bytes.
Apparently structs that inherit from FFastArraySerializerItem are huge. Took that away and that 32,000 went to the expected 4,000
So. Is there some sort of bandwidth that does checks after an array replication or something?
Because on default settings where the limit is supposed to be 10,000b/s... This Array lags out the client for about five seconds or so. This array is just a little over 4,000 bytes I'm assuming. This Array shouldn't even take half a second to send to the client at that rate. So I don't understand the five seconds of lag afterwards?
It's 10kbits/s
So 4Kbytes is 3.2 seconds
Assuming no other traffic and no overhead
10kbps is extremely low and I found a remarkably simple game to have a large client startup time with that value
Replicating 100 int32 sized properties is already 300ms worth of optimal no overhead traffic
And I think a random Character isn't far off that
Ohh. I don't know why I processed that as bytes instead of bits in my head. That makes much more sense now... And that is a hell of a lot lower than I imagined. That explains why it sends instantly though and then lags out, if it's staggering time based on how much it already sent.
Yeah
I'm trying to possess AI with a player controller at runtime, anything I should know? because some InputComponent actions and axis bindings aren't working
I have a problem with my player,
I switched from Game Mode Base to Game Mode, now when a new player joins the game he can't move
its like the game is paused for the new player
Is anyone familiar with replication ?
Mono make sure you didnt oberwrite any event and left empty?
Or vhange game state type?
@echo snow i assume you also have a warning that GameMode is not entirely compatible with GameStateBase
as to why GameState propagates the MatchState from GameMode to clients
and OnRep_MatchState dispatches BeginPlay on the client World
so your clients could never call BeginPlay
from this you can infer a very convenient guarantee with GameMode/GameState
on clients, by the time first Actor calls BeginPlay, GameState is guaranteed to have replicated
@echo snow
Does anyone know how I should assign player controllers to specific instances of the pawns from the editor? I have a pawn in the editor I want to be my player one and another I want to be my player two. Maybe this isnt even the right way to do it in the first place?
I'm sure this seems really basic but I've been trying to figure it out for a while. Should I instead be trying to do this all programmatically?
have GameMode find those Pawns when it starts up @timber harbor
I've set some stuff up in the scene so that the first player's pawn is attached to the second players pawn in a certain way, but it always just generates new instances of the pawns when I load them up
once you have the references to them you can easily possess them
GameMode is spawned in when the game starts
Are there some things I just have to do in blueprints?
no Actor is spawned in before all pre-placed Actors are loaded
so you don't have a timing problem here
ok thank you @winged badger
HandleStartingNewPlayer
is a good place to override
(do not call Parent, just override it)
Does anyone know why changes arent replicated to other clients ?
All replications are visible to the server, but not all clients
wdym by "all replications are visible to the server" ?
If I use HandleStarting New player and just override it so it shows in BP without doing anything with it, it seems to break some logic I have.
if you override it and don't call Parent
Ah
the game won't spawn default pawns
Im creating a dynamic material and changing the bodycolor to yellow for each character that joins,
Server sees all characters that join become yellow
Individual clients see themselves as yellow but not other client characters
default implementation just calls RestartPlayer
that would then depend on how are you trying to replicate it
what sets the parameter on the DMI and how is it replicated
https://pastebin.pl/view/e24352e9
Can you please tell me if i did anything wrong
https://pastebin.pl/view/419899e0
Sorry its this one
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
there is no instance of your Client1's PlayerController anywhere except on Server and Client1
Client2, 3, 4... etc
don't have that Actor
What do you mean by that
and can't receive a Multicast over its ActorChannel
Sorry i dont quite understand
PlayerControllers replicate to owning client only
so if a server multicasts from inside the PC
that multicast only reaches the server and the owning client
GameMode is worse
Rip
it doesn't exist on any clients
What should i do ?
you should put a replicated variable for the DMI parameter
and just set the parameter value on the DMI from OnRep
(in the Pawn)
How can i do that ?
add a replicated variable?
Attaching it to the DMI
OnRep, if you don't have a DMI, create one
I have a DMI in the script
then assign it a param for color that you just replicated
that looks fine
By the way should i remove the netmulticast stuff ?
yes
{
if (!DynamicMaterial) InitializeDynamicMaterial();
if (DynamicMaterial) DynamicMaterial->SetVectorParameterValue(TEXT("BodyColor"), InCharacterTypeColor);
}```
this is almost what your OnRep_CharacterTypeColor should look like
you just need to rename it, and add CharacterTypeColor replicated variable with ReplicatedUsing
add it to GetLifetimeReplicatedProps
and set the variable on server
void APlayerController::SetCharacterType(ECharacterType InCharacterType)
{
SetCharacterType_Server(InCharacterType);
SetCharacterTypeColor_Server(GetCharacterTypeColor(InCharacterType));
}
SetCharacterType Should be like this ?
Removing the HasAuthority check ?
When my player dies and a spectator pawn is spawned in AGameMode, where is a good place to set that pawn's location to the same place that player's previous pawn was at?
I'm not sure which function is good to override for something like that
Some function that runs after the pawn has been spawned
I see FindPlayerStart
I'l have to see if I can access the previous pawn
@plucky sigil did you put the variable in the Pawn? with PC you have same problem as with Multicast
Pawn is null because PC calls BeginPlay as soon as its instantiated
then the Pawn is spawned and Possessed
if server can deretmine the color without client input
just do it OnPossessed
or OnPossess depending if its Pawn or PC
Whats the difference between the two
OnPossessed happen when client/player/controller possesed the pawn
Beginplay is the last stage before tick as far as i know
could be too late for some initializations
@winged badger OOF i think it worked
@fringe dove
Iâll continue the updates here
It appears once you solve the overlay and in game purchases you might still encounter this
When ppl try to checkout using the steam desktop app or website
From your games item store link
Is there a way to server travel such that Post Login is called again?
@neon mango no you donât use post login
I create the Server Start Game Menu and do some setup there but when the match restarts none of that gets called
You use another event
Which is better? I should never use that?
use HandleStartingNewPlayer
its called from both PostLogin and PostSeamlessTravelPlayer
And startingnewplayer
Hmm starting new player happens to quickly
Players begin play hasn't happened
Or a delay
hmmm
I bind an event to a delegate
For posession.
Then use it knowing my player is ready
But you can do this however you need for the order of operations
Starting new player is called for controllers and the gamemode logic really
Youâll likely need a timer to say fire after so many seconds after travel complete
That way you know all character refs are valid to pass on additional logic
you never need a timer
for those things
and sooner or later timers get out of hand
Yeah but I understand what he is saying
If you fire logic to check for character references on starting new player your level may be loaded but your character may not be possessed
Itâs just reality based on order of object init
HandleStartingNewPlayer is where your Pawn is usually first spawned on server
its a GameMode function, so it does happen before client's BeginPlay
if you do a lobby setup, then travel to game map
the idea is to travel seamlessly
so the PlayerStates and PlayerControllers persist during the travel
so the PlayerStates shoujld have the correct information in lobby on server
before travel even starts
and then there is no need for clients to RPC their setups to the server on game map at all
you can get around that too
just override APlayerController::GetSeamlessTravelActorList
and add its Pawn to it
then Pawn survives the level transition
(not available in BP)
Is there a function that gets called right before pawn possession, so I can store the pawn in a LastControlledPawn variable?
(That way I can get the last controlled pawn's transform for spawning the spectator pawn)
you can override SetPawn for that
Store just the transform on death in playerstate then ref it
cache the old one before you set a new one (before Super)
I don't think other players really need that last death location value. I could store in the controller I guess
That too
SetPawn runs on both Server and Client
so you don't need to replicate the cached LastPawn
Just easier if server spawning to keep server relevant stuff in gamemode
if you need it client side
If you stored it in game mode, how would you associate each transform with each player?
You already have access to playerstates there too if needed and you have a pawn array
Built in gamemode function
just keep it in the PC, its where it belongs
The server can literally get pawn loc of all clients
But yeah player controller would work good as well
The gamemode keeps each client index and netguid
The association is made that way
Your death event is likely server side anyway
Tied to âsome gamemode logicâ
I just use this event for most things and handle additional logic in gamemode/gamestate anyways
My gamemode actually updates the player start location as progress is made and clients spawning is handled there via get the player start location
When I change the collider on my character's mesh to "Query Only" all the non-server users fall through the world, the collider on my character's capsule is still fully enabled... how can I fix this?
and they spawn below the ground regardless of where the networkplayerspawn is
I just needed to disable the "Pawn" collision channel
Is there an event for the PlayerController to know when I've joined? I feel like setting things like health, mana , etc in SetPawn with if (!init) is kinda hacky
hey guys is there a way to work with ReplicationGraphs with blueprint? or possibly a marketplace item or plugin that can help?
not really
there might be a plugin
but i haven't seen one
best to learn some C++
yes I think its time lolz
@carmine citrus are you using server travel?
Handlenewplayerstart
You also have on posession
I thing there is a callback on player controller as well for pawn possessed
On posession? I'll have to check it out, I saw there was PawnLeaving
Huh?
yea
Begin play always fires on asset loading
I stopped using BeginPlay cause the controller and pawn is null
this is my first project, but its kinda annoying that everyone says that Begin play works.
But yes it doesnât mean itâs possessed yet
ok
ok
Usually in my character class I have an event setup to init vars
I spawn from gamemode and posess
Then pull from the spawned class return
Init vars
That way you control the logic flow
I want to do that, spawn from game mode, but I haven't gotten that far yet
Itâs easy
I want to have N spawn locations, and setup the characters from there. but
baby steps lol
On gamemode handle new player
Call get all actors of class playerstart on begin play of gamemode
Store a ref
Array
kk, thanks uno
On handle player start reference it
Then spawn character class at get random int of reference
Then init var from the class output ref
yep, thanks
If you want health and things to be character specific keep in the actor
yea
If you want it player specific keep in controller or playerstate
thats how i have it now
But remember it doesnât reinit
Controller is almost persistent
But thatâs good for some things
Just not handling death
Or character specific vars
Health etc
Use playerstate to feed the characters health only if you need other clients to know it
I usually only feed kills
One of the best docs
Oh nice! thanks
Why on earth does ChoosePlayerStart run BEFORE BeginPlay in GameMode???
That's really annoying as my spawn points aren't initialized
I guess I'l need to initialize them once in ChoosePlayerStart if they haven't been initialized. Kinda crap design, but I see no other choice đ
@lucid vault you need to get reference before
check if "!=" ?
What do you mean by get reference before?
@lucid vault cant you just check for if spawn points are nullptr or not?
Yeah, that's basically what I did. It just felt gross to check that in ChoosePlayerStart
well its not a shame đ
Does ChoosePlayerStart only get called on the initial spawn?
What function would you override for getting respawn points after RestartPlayer is called
According to the documentation, ChoosePlayerStart should get called on RestartPlayer, but it only gets called on initial spawn for me
as far as i know it should be called after new players initialized
so again as far as i know its normal to get called before beginplay
Hmm. I guess I should just use RestartPlayerAtPlayerStart for respawns
you using bp? show a screenshot of what you have
c++
ah ok. what i normally dont use chooseplayerstart
i normally save an array of all the player starts then use what i want from there on spawn
I just extracted my choose spawn point logic into a function to be used in ChoosePlayerStart for initial spawns and RestartPlayerAtPlayerStart for respawns
so if I need to copy data from one session to the next session, I would need to write the data to the database destroy session. Then, I would read database to apply changes to the session being joined to?
The problem I see with that would be the amount of objects created during those queries.
That is if the session being joined to was a dedicated session that only goes down one time per week.
do clients need to be packaged with all maps/game content? Each session only has one map? When a session loads its map the client will load it because its included in the client build package?
Hi guys, How would i replicate a skeletal mesh, skeletal mesh is generating in real time on server, but client does not have this.
Will it be possible, if generate skeletal meshes in server, then save all the generated meshes to a Array, and then replicate that array, and get all the meshes from that ???
generating in real time, how?
replicating skeletal mesh component is generally unadvisable, because it can cause jittering combined with CMC
its a glb file, which i get from server, then using a plugin called gilf runtime, i converts to skeletal mesh
you should teach the clients to do it
skeletal mesh asset is a lot of data to replicate
not to mention, its next to useless without animations
Can you please describe the model of replication.
I can generate them on client, it is working fine.
i can generate them on server, it is working fine.
But somehow clients cannot see each other Meshes.
I am not sure why
@winged badger Most of them are procedural animation, IK and stuff.
you'll need to generate them with the same seed
you'll need to generate them with the same seed
@winged badger what do you mean by seed ?
you need a FRandomStream generated with a replicated seed
then use that stream to generate all random in your procedural generation
or they will never match on clients and server
and since the seed is just int32, that is easy to replicate
Is there any example of this,
scroll a few hours up on #cpp , i did explain it once today in detail
if your plugin can't handle random stream though, you're in for a rewrite or just plain out of luck
okay thanks
actually it is solved, if i dont try to load the mesh very early, and do it after some times, then everything works out fine
@winged badger I did teach all the clients to do the runtime generation, that helped, thanks for your help
so I am looking at a dedicated server for login. Login server has shard selection map. If player is new load shard selections map. If player has a shard, change player to shard dedicated server. Each shard needs to spin up instances for dungeons and maps that players play on. When session is over it sets database with rewards exp ect, players return to shard map and shard map updates rewards to shards player database. Does this sound correct?
Hey, is it any place when I can put breakpoint or check why client is disconnected from local dedicated server? I saw only this in console:
[2020.09.27-09.47.34:614][176]LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
ROOKIE!
@winged badger Can components in unreal used in the same way as components in Unity ?
@plucky sigil If I read the description of a Unity Component correctly, then yes. Simple UActorComponents are non physical components, like the CharacterMovementComponent, anything that requires a world transform like a StaticMeshComponent needs to be a USceneComponent.
@kindred widget So it would be best to modularify codes into components ?
Such that each component is a modular mechanic/feature, if that object needs it, attach that component ?
Depends on your case and preference of style, but in general, sure. Some classes even use Components so as to not over complicate the class itself. Character being a good example. Instead of doing all of the movement in Character, they moved it to a component which cleans up a lot of space in a character class.
I think it's more of an OOP thing though. If you can make a component that can be attached to different objects to achieve the same goal, that's better than copy pasting the code into each class individually when you can just add that component and set some defaults. Or on much larger classes you can also compartmentalize large blocks of codebase into other objects(components) to simplify the class.
NOPE!
components being used the same way in unity as unreal.
How should they be used ?
If Unity's GameObject is the same thing as an Unreal Actor, then it's more or less the same thing.
unfortunately they are far apart.
So i should not modularify mechanics into components ?
Not sure if this guy is trolling or not.
8 years . but i appreciate the compliment
So what do you suggest ?
continue component development , it just has nothing to do with how unity does anything.
But the paradigm is the same/similar right ?
NOPE!
@keen warren
Unity GameObject description "Base class for all entities in Unity Scenes"
Unreal AActor description "Actor is the base class for an Object that can be placed or spawned in a level."
Unity Component Description "Base class for everything attached to GameObjects"
Unreal UActorComponent Description "ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors."
So how are they different
I'd be interested to know that as well, since they're explained as the exact same thing.
Are you coming from a unity background ?
Yes
ok. let me help you out. delete everything
if your build is not from source
which is roughly this big
i know what your thinking. wtf
whelp this is really the only way to produce a game for multiplayer production.
But you havent answered my question
which is the difference. i dont have time. but i will say the hierarchy doesn't work the same among many others.
the concept of adding a bunch of monobehaviors onto the single game object, that part is nearly the same.
that's like a bunch of actorcomponents
but then a scene component, is like adding a child game object
has it's own transform, etc
at the lowest level, they are the same
but it starts to diverge in certain areas, like with collision
there is a forum post somewhere like 3 or 4 years ago, when I was bitching about this
cuz i wanted to do something in unreal, that i could do in 30 seconds in unity
and never did find a solution for it
and it was because of teh components.
now, i don't work on that project anymore, so i forgot about it, until this discussion
i think scooby has smoked too many scoobie snacks.
lol
check this: (last 24 hours.) i developed a method to increase your odds of winning the lottery by 25%.
i know what your thinking wtf
...
Hello guys! Please help me out, I've been completely stuck with this problem for a few days. I'm doing replicated targeting (soulslike) and the thing is, I need to replicate setControlRotation. It works fine on the client, but other players cant see each others updated rotation. If I pass the same target, that I pass to clients setControlRotation call, it gets lots somewhere, if I pass player controller 0 index to server call, it changes everyones rotation. I've also tried getting all player controllers and looping through them and also setting init variable, still no luck. Thanks a lot!
https://blueprintue.com/blueprint/oxu3vaam/
https://blueprintue.com/blueprint/pjjvzeh2/ (the first event is Run on Server and reliable, and the second one is multicast)
help3
A quick tutorial to get you started on understanding the very basics of event replication within Unreal Engine 4's blueprint scripting system.
Please note that this is not intended to be a comprehensive explanation of how replication works, but rather a simple example to get ...
Thanks, but I can google myself! I've read docs/watched a bunch of videos and replicated some of existing functionality, but I'm new to this and I can't get my head around on how to handle controllers and setControlRotation in this example, so maybe you can point me out in the right direction instead?
wait let me re-read your post
ok so , one of the fundamental problems your facing is inside the video i posted.. so while you might be a google search master. The video gives you the answers. its only 11 minutes long take it slow. pay attention. try to understand what hes doing.
ok so based on that its been like a half hour. either you don't care. or Scooby is winning. its ok if you want Scooby to be winning. because Scooby has a nasty habit of winning lately .
someone's got a big ego.. or is trying to make up for something.. đ
big ego + schizophrenia I guess
Can someone explain to me what the difference between Client Server NetMulticast
@keen warren it didn't work btw
@neon mango Do you know if OnRep function, you need to call manually ?
Why are there people saying that you do ?
(in BP it is called on server)
but OnRep is always called on clients when a property changes
BP RepNotify is slightly different to OnRep in C++. Server will never call OnRep function in C++, but it will in Blueprint with RepNotify.
soo in C++ you only call it if you need to when you are the server.
I would like to know, if i want to set something, would i need to do it like this ?
void AMM_Character::SetCharacterType(ECharacterType InCharacterType)
{
if (HasAuthority())
{
SetCharacterType_NetMulticast(InCharacterType);
}
else
{
SetCharacterType_Server(InCharacterType);
}
}
UFUNCTION(Server, Reliable, WithValidation)
void SetCharacterType_Server(ECharacterType InCharacterType)
bool SetCharacterType_Server_Validate(ECharacterType InCharacterType)
{
return true;
}
void SetCharacterType_Server_Implementation(ECharacterType InCharacterType)
{
SetCharacterType_NetMulticast(InCharacterType);
}
UFUNCTION(NetMulticast, Reliable)
void SetCharacterType_NetMulticast(ECharacterType InCharacterType)
void SetCharacterType_NetMulticast_Implementation(ECharacterType InCharacterType)
{
// Do the stuff here
}
why not just make it a ReplicatedProp ?
Is that the right way to do things ?
ECharacterType CharacterType;
UFUNCTION()
void OnRep_CharacterType();
void SetCharacterType(ECharacterType InCharacterType);
void AMyChar::SetCharacterType(ECharacterType InCharacterType)
{
if (HasAuthority())
{
CharacterType = InCharacterType;
}
//Do your char setup here
}
void AMyChar::OnRep_CharacterType()
{
SetCharacterType(CharacterType);
}
void AMyChar::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMyChar, CharacterType);
}
then you only ever have to call SetCharacterType on the server
no multicast needed
Why not
this is the proper way.
I want to know why this is the proper way
Multicast is for one off things, like explosion effects, etc
where?
cause mostly all of them suck
And then people say
or are from newbs.
Call OnRep manually
you should never multicast critical things like this
Hello guys! Please help me out, I've been completely stuck with this problem for a few days. I'm doing replicated targeting (soulslike) and the thing is, I need to replicate setControlRotation. It works fine on the client, but other players cant see each others updated rotation. If I pass the same target, that I pass to clients setControlRotation call, it gets lots somewhere, if I pass player controller 0 index to server call, it changes everyones rotation. I've also tried getting all player controllers and looping through them and also setting init variable, still no luck. Thanks a lot!
https://blueprintue.com/blueprint/oxu3vaam/
https://blueprintue.com/blueprint/pjjvzeh2/ (the first event is Run on Server and reliable, and the second one is multicast)
@echo temple anyone?
how about if someone joins the game late?
they would not see the correct character type of that player/pawn
Lol
with a OnRep property, they will always see the correct type
is it possible to force a player to reconnect?
that would be down to your implementation
ofc its possible, but how depends on your OSS
GameSession has a kick player
I'm wanting to try DCing them and telling them to join again
you need to keep details about the previous session they were in
But automatically
then just connect like normal
Server function is only required if client needs to tell the server
so if client picks a character type, then you would need a Server RPC to call SetCharacterType
But in this case, Server is telling client what type ?
server is just setting the property
(the CharacterType to whatever InCharacterType was)
if client needs to tell server to set character type, then you need a server rpc
void ServerSetCharacterType(ECharacterType InCharacterType) { SetCharacterType(InCharacterType); }```
What if client does some action, and from their actions, it changes the character type of a client's character, then we need a server rpc ?
only if client decides he should change character type
if server does, then no need.
please read the compendium in the pinned
it explains all of this
đ
i will answer specific questions
but you need to understand the fundamental basics đ
someone's got a big ego.. or is trying to make up for something.. đ
@meager spade
?
Oh i just giggled when your logic was legit but mine made me a big ego skitzo
i never said anything about skitzo though
@meager spade I dont understand how i can change another character's character type
Its owned by different client
server has authority of everyone.
what you mean, owned by different client?
right?
Im confused
@plucky sigil Ownership simply allows a client to use that actor to talk to the server. Setting something on that client owned actor on the server will still change it on the client as well.
By the way, what i want to do is. line trace to a player and change its character type
Which will change the color of the character
/* Header File */
//The current players Character Type.
UPROPERTY(ReplicatedUsing = OnRep_CharacterType)
ECharacterType CharacterType;
//Called on clients when the above Character Type changes.
UFUNCTION()
void OnRep_CharacterType();
//This is the function that sets the character type, the meshes, etc. Runs on both client and server.
//Server calls this directly, client calls this via the OnRep.
void SetCharacterType(ECharacterType InCharacterType);
//Allows the client to ask server to change their character type.
UFUNCTION(Server, Reliable)
void ServerSetCharacterType(ECharacterType InCharacterType) { SetCharacterType(InCharacterType); }
/* CPP File */
void AMyChar::SetCharacterType(ECharacterType InCharacterType)
{
//if this was called on server, we set the CharacterType so clients can run this function via the OnRep.
if (HasAuthority())
{
CharacterType = InCharacterType;
}
//Do your char setup here, change meshes, colours etc.
}
//Called on clients.
void AMyChar::OnRep_CharacterType()
{
//Just run the above function, to setup meshes, etc.
SetCharacterType(CharacterType);
}
void AMyChar::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
//Allows the character type to replicate.
DOREPLIFETIME(AMyChar, CharacterType);
}```
so what don't you understand ?
does you code look like mine above?
FLinearColor AMM_Character::GetCharacterTypeColor(ECharacterType InCharacterType) const
{
FLinearColor Result;
switch (InCharacterType)
{
case ECharacterType::ECT_NULL:
Result = FLinearColor::Black;
break;
case ECharacterType::ECT_INNOCENT:
Result = FLinearColor::Green;
break;
case ECharacterType::ECT_IMPOSTER:
Result = FLinearColor::Yellow;
break;
case ECharacterType::ECT_DEAD:
Result = FLinearColor::Red;
break;
}
return Result;
}
void AMM_Character::ChangeCharacterType()
{
USkeletalMeshComponent* MeshComponent = FindComponentByClass<USkeletalMeshComponent>();
UMaterialInterface* Material = MeshComponent->GetMaterial(0);
const FName CharacterTypeMaterialName = "CharacterType";
if (Material->GetName() != CharacterTypeMaterialName.ToString())
{
DynamicMaterial = UMaterialInstanceDynamic::Create(Material, this, CharacterTypeMaterialName);
MeshComponent->SetMaterial(0, DynamicMaterial);
}
if (DynamicMaterial) DynamicMaterial->SetVectorParameterValue(TEXT("BodyColor"), GetCharacterTypeColor(CharacterType));
}
void AMM_Character::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMM_Character, CharacterType);
}
void AMM_Character::OnRep_CharacterType()
{
SetCharacterType(CharacterType);
}
bool AMM_Character::ServerSetCharacterType_Validate(ECharacterType InCharacterType)
{
return true;
}
void AMM_Character::ServerSetCharacterType_Implementation(ECharacterType InCharacterType)
{
SetCharacterType(InCharacterType);
}
void AMM_Character::OnInteract(AMM_Character* FromCharacter)
{
if (FromCharacter->GetCharacterType() == ECharacterType::ECT_IMPOSTER)
{
ServerSetCharacterType(ECharacterType::ECT_DEAD);
}
}
and your header
void AMM_Character::SetCharacterType(ECharacterType InCharacterType)
{
if (HasAuthority())
{
CharacterType = InCharacterType;
}
ChangeCharacterType();
}
remove that destruct for a start
always UPROPERTY UObjects
this should have UPROPERTY() above it
.
no
Or not ?
done
so i can't see anything obvious so maybe its time to start using breakpoints or logging.
I changed the multicast to server
so does it work now
btw
void AMM_Character::OnInteract(AMM_Character* FromCharacter)
{
if (FromCharacter->GetCharacterType() == ECharacterType::ECT_MURDERER)
{
ServerSetCharacterType(ECharacterType::ECT_DEAD);
}
}
you don't need _Validate nor _Implemtation in the header
https://www.thegames.dev/snaps/opera_4DxA6ZVKgU.png those can be removed from headr
and Validate is not needed anymore, unless you specify WithValidation
Is OnInteract correct
if that is called locally, yes
So it doesnt work
I tried adding breakpoints
It breaks inside the if
if (FromCharacter->GetCharacterType() == ECharacterType::ECT_MURDERER)
{
ServerSetCharacterType(ECharacterType::ECT_DEAD);
}
And thats it
did you put a breakpoint in the Server RPC?
Yep
and it never hit?
Ill rebuild solution
Murderer
ok
SimulatedProxy
why is simulated proxy calling it
Dont know
simulated proxy should never call it
you understand what Simulated, Autonomous, etc are right?
Auto is a client
to me it seems like you are calling that function
from another client
instead of the other client, asking the server to do it
but why its from simulated, i have no idea
without looking at how your OnInteract works
What do you mean by from another client
@meager spade Do you know how i can fix this
Hey, so im making a multiplayer game, and we want to different world you acess with an elevator, Is Level streaming okay for multiplayer? Otherwise, can world composition work vertically?
@plucky sigil Doesn't the CharacterType UPROPERTY need to be replicated?
Oh, it is, missed that at the bottom of the header. But in short, you should just need the client to line trace, get the character pointer, then use a locally owned actor like their own character or player controller to call a Server RPC to set that pointer's CharacterType on the server. Then when it replicates, your ReplicatedUsing function can change the material parameter or whatever.
@kindred widget @meager spade Dont worry about it i fixed it
Is there any solution for vehicle physics replication lag?
hi
Hi I want to save in my multiplayer how many wins the player has, how does that work? (if he leaves the game it should remain )
save the info in a save game object
Does it work in multiplayer to?
How anyone know how to line trace on multiplayer so it doesnt return simulated proxy
as long as all you want to do is store their wins locally it should be fine
hi, why my branch always fails? https://i.imgur.com/CioWah9.png
if i dont use the branch it all works, but i want to exclude the gunshot sound causer
are you trying to play mono and stereo audio
like audio only the player can hear
or audio only others can hear ?
audio only others can hear
because if you are id suggest using an is locally controlled node instead
thats how i handle footsteps
lemme open up ue4
what i mean is like instead of that owner == self check try replacing it with an is locally controlled node
@broken warren saving and loading is done locally so even if you do it during a multiplayer match it would only happen locally
it all depends on where you do it
id suggest that at the end of each game the player controller adds the win if the player won
tho there may be a better approach
@shrewd tinsel if you still dont understand i mean like this
true is for the local player
and false is for everyone else
i use this so i play foosteps as 2d for the player and 3d for everyone else
the is Player Controlled is because i have bots so they always play 3d audio
tho theres a much more efficient approach if your using C++
whats that?
the sound node used in shooter game
i havent integrated it yet but i plan to
that way you can setup different audio in the sound cue for the local player and the others
hey i have a problem can you solve it with me money will be given.
@stuck pilot #looking-for-talent and you should state the actual problem.
@shrewd tinsel after trying it out i managed to integrate it without any issues
Checked the pinned messages in that channel
question - What should i make un realiable in a first person shooter
and are particles automatically pooled ?
Do you know why line trace returns simulated proxy ?
I'm trying to get everyones camera to shift upwards as more people connect, it works but no one actually gets affected by it. Can somebody tell me why it's not working?
Does anyone know how to line trace in multiplayer ?>
same as cpp/bp? just replicate the variable to server?
Who you talking to ?
you
Im having the issue where
The line trace returns a simulated proxy
And i need to do something with it
But i cant
Maybe im doing it wrong ?
I have a question.
So I've already made a game where you can host a server (as a client) and have other clients join you.
I know that the other alternative is to use a dedicated server. So I had a thought...
If the host-client is not participating in the game, then he technically works as a "server". Is there any way that I can minimize the game or have it run on a console window and then simply have the host-client open up a new game and join himself as a mere client?
Don't know if this is strange thinking when I could just get into making a dedicated server instead. It just seems convenient to be able to actually initiate a dedicated server from the in-game menu that I already have.
@bitter swift absolutely, I've done similar things myself from a gamer perspective, I'd be shocked if UE4 did not permit that scenario.
@bitter swift your going to want to make a dedicated server. Which runs headless/console.
Make about 200 gigs room. And clone source files from github
Alright @keen warren thank you :)
I was gonna look into it either way.
Its going to seem complicated at first but once you really try to work with it. Its simple. And unreal supply documentation
I'm having some issues with network checksums and the player controller, is anyone around for help?
Anyone know how to fix
No owning connection for actor
yes, you are calling a Server/Client RPC on an actor which does not have a owner
Is it because of the line trace ?
no..
What do i do
find out what RPC you are sending in an actor that is not owned by a player
since i dont know how to use the unrealbot im gonna ask here i have a game that i want to add multiplayer support on via steam only thing is i know nothing about networking so i am willing to pay someone to add steam multiplayer support on blueprint to my project DM me with what you think is a fair price if intrested
What do i do after that
@chilly orchid check the pinned message in #looking-for-talent
it explains what to do
ok
Hey someone know why "Set ignore move input" doesn't work directly when the game start?
I want my pawn to be "stuck" until every user get connected and somehow I have to delay the function to make it work under dedicated server
I'm trying to create a dedicated server following Unreal Engine's own documentation. I have run into a problem when building my project's ServerTarget class with Development Server as my Solution Configuration.
The error I get says "Server targets are not currently supported from this engine distribution".
Does anyone know how to fix this error?
UE4 Dedicated Server link: https://docs.unrealengine.com/en-US/Gameplay/Networking/HowTo/DedicatedServers/index.html
PS: I previously changed my project version to source and Build the whole project in visual studio. That created the server files I needed but I wasn't able to package that project as a server after that. I got an error saying something similar about the targets.
How to set up and package a dedicated server for your project.
Does calling Client RPC on tick sucks as calling a Server function on tick too?
you have to use a source build of the engine @bitter swift
and if this is showing incorrectly the engine association might be still using the launcher version
you can change the engine association by right clicking your uproject file and selecting the source build
you could also try building it from unrealfrontend
how do you properly use "Owner no see"? I am trying to spawn an actor on the server but only visible to clients. Setting "Owner no see" doesn't work
Clients do not own other clients
@peak sentinel i don't understand your question
if you call an RPC on the client or server, it'll be called on the other end the same number of times
you can change the engine association by right clicking your uproject file and selecting the source build
@lost inlet
You mean like this, yeah?
yes
Sorry sswires, I tried to ask if I use Client RPC on the Tick(); would it affect the performance of server?
So many people told me calling a RPC in tick not a good idea
well yes unless your throttle it in some way
a high framerate client will be more of a strain on the server than a low framerate client
and the people who told you that were right
So if its a function just about graphics/visuals its fine i guess
Just gonna highlight some objects
networking in BP, rip
why does the above involve networking at all
the only thing you need to send to the server is when the interaction actually happens
thats what i do, but the previous screenshot is from interactibleactor Bp
i don't follow
either you've missed a big part of the tutorial or the tutorial is asking you to do weird things
i am kinda dizzy today, maybe i might not expressed myself in proper way, sorry
but i got the answer, thanks
not gonna use RPC on tick
Doesn't seem to strange to me? Server is handling picking of any actor, sending results to client.
well i'd hate to see your netcode then
highlighting an interactive object could happen on the client almost exclusively with nothing over the network
when you press the interaction key, the client tells the server "i'm using this" and that's the only thing that really needs client->server
i was just copying the tutorial
@lost inlet That's what I assumed it did. Looked closer and realized what it was actually doing.
That was what Tom Looman wrote about that;
"Note: Iâm replicating this to the client because we are only doing local visual updates that must run on client-side, if you are handling gameplay logic in the tick you should consider changing the blueprint to run on the server instead (or run parts on server, others on client). For now leave it as is below."
so it's actually intentionally like that? weird
It does seem like it can be handled on the client
remember, take everything you learn from a single tutorial with a pinch of salt, not everything will be a best practise
When it comes to replication its hard to find a proper "replication tutorial" in the end lol
I will learn it from the hard way anyway
Have you dug through this? http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
Yeah, without that I would already give up
well networking can be difficult, but i tend to stay on the side of network if you need to
ie. networking as little as possible, keeping RPCs as light and infrequently called as possible
@lost inlet building the project as Development Editor and Development Server seems to take a while after I changed the version. There's a lot to build now. Is this normal?
well depending on your system, it is normal for it to take a while if you're building a target for the first time
development editor and development server are different targets
I almost got the basics, there are just few topics seems harder than others to me; getting access to unique players (or their controllers) and movement events
development editor and development server are different targets
@lost inlet I'm fully aware. I have to do both according to the guide đ
also you can cut it down a bit if you disable plugins you don't use and that kind of thing
never "build solution"
oh... Build Solution is exactly what I did :S
never "build solution"
i always "build solution" when my engine crashed unexpectedly
whats wrong with it?
if you use binary build, nothing. if you use source build, everything
because it will build EVERYTHING
even stuff you don't use
How should I build it then? Only the Server.Target file?
build the game project only
I just canceled the build. Will they cancel everything it had already build? Or do I have to make a new project?
ie. have a source file from your project open and in visual studio select "Build <ProjectName>"
so if i have a badass(?) CPU and i dont care about wasting my time would that affect me or is it about something corruption of project files?
well do you use a source build or not
if you do you're wasting a lot of time
and cancelling the build won't do any harm most of the time
a development editor build from scratch on the project level with a ryzen threadripper 3960x, 64GB of RAM and on a SATA SSD takes about 10-12 minutes
lol rebuilding from engine takes a couple of hours on a regular low-end gaming pc
such a pain
my old i7 didn't take that long unless you were also building solution
my old i7 was like 25-30 mins
i had a i3 before, i feel your suffering
It may have hit some OS bottleneck, but I remember seeing 340 minutes for a build time once.
i've never had a build that long
Also found that downgrading to regular VS without VA can kill find-references/search times.
Use Rider đ
It was a rare occurrence, but 20-30 minute range was average.
Rider even handles the "_Implementation" on your functions if they are replicated
Also warns if they are not Validated + gives info about blueprint usage of that function
my Server build seems to take around 20 minutes. I hope this is normal.
After changing the project back to 4.25 I got this error message đ
Well that was expected actually đ
I'm opening it with source now. But it's taking a while
I finished packaging the dedicated server. How do I package the original game for the clients? I packaged the same project using the regular Build Target instead of targeting the server.
But it's taknig a loooong time. I feel like I'm doing something very wrong
EDIT: Nevermind. It works! I just tested it đ
Thank you @lost inlet for the aid!
HI there, I want to do a multiplayer mode where 2 team are playing against each others. Each team play on a map (map is the same, just different "instances"). I want players be able to go the enemy map when it's possible to. I have no idea how to have two map for a single game. Can anyone point me in the right direction ? I looked at level streaming but I'm not sure it is what I need. Thanks đ
@hybrid wren why won't level streaming/load level instance work?
I'm not sure if it what I need because I don't know all the possibilities. I'm new to the engine and even more to multiplayer stuff so it's hard to tell if it the right solution the first time you look at it.
Also look into using gameInstance properly. You'll need your player/game state to be the same when jumping from level to level I'm guessing
I think level streaming will fit your bill. Not sure what your exact use case is but it's the right direction, probably
ok, I'll dig deeper into the documentation of level streaming. thanks đ
Anyone have any idea how Fortnite is often able to handle 70-100 players in one area?
Have they significantly modified their engine's netcode to the point where their packet sizes (for movement, line traces etc) are significantly smaller?
Or is it just massive vertical scaling?
Or is each game actually handled by a distributed system also talking to a central server?
I've watched their replication graph video, is the only thing they're doing preserving bandwidth on their actor replication wherever possible?
The engine is definitely custom - UE4 releases are based on Fortnite's engine and yes, they preserve bandwidth as much as possible, but most of that work is on the game side, not engine side
No distributed servers, just a regular dedicated
That's insane.
Initially I thought they were rolling with the assumption that their spatial grids will take care of everything since 100 players won't drop in the same place.
But then I saw that Travis Scott event where there were so many people in 1 area
Bandwidth isn't even that much of an issue tbh, CPU is
I assume this is %95 about relevancy
I was just thinking in the context of MMOs. If I were to build an MMO server, would I have to take apart rhe server and rewrite parts of it or could I go with how the existing dedicated server is built
Assume I take care of sharding by spatial locality of players
Each shard is its own dedicated server
Most MMO style developers today go with fully instanced games anyway
Getting enough sales to populate a traditional MMO is a losing bet for all but AAA production budgets
The fact that most MMO games today are instanced is sad to hear, and also true
I thought of building just an MMO server as a hobby project without tinkering around too much with what the client actually does, but I don't wanna have to break into UE4's netcode and figure out packet compression and the like
UE4 is not a great deal for even a MMO client, you'll have to throw away all the good stuff in it
All of the networking, and thus all of the gameplay framework
It's a nice renderer I guess
Wonder what games like Ashes of Creation are doingb
They're using UE4 btw
Reckon they're using something like spatialOS?
I think if you write your own dedicated server it can easily handle 300 player in one instance đ¤
SpatialOS killed at least one game already so I wouldn't look that way tbh
And "your own dedicated server" can have 10k players
It's all about what it has to do
Let's assume it has to do nothing but handle a few Characters running around
Are there any guides on building dedicated servers?
@bitter oriole wouldn't be any bandwidth packet send/receive rate limit ?
Character is going to break down after 50 or so players
@rose egret These can be changed
The problem with UE4 isn't the engine networking stack, it's specifically stuff like Character that is way way too expensive for an MMO (almost to oepxensive for a BR already)
đ¤
Anyway MMO is a recurring joke in game dev because no one can afford the players for one
The tech isn't even the issue
Go on stranger.
Is UE4 useless then if I'm not using the netcode on Character. I guess it's easier to write a rendering engine for something like that without all the bloat rightb
If you're doing an MMO, your team of 50 network engineers should use a custom engine most of the time
I mean.. youre assuming scale.
The M in MMO is for "massive"
Ashes of creation is using stormancer as their networking backend
Powerful solution to build realtime multiplayer games.
Hero Engine made for MMOs
I think you can recreate wow more less with ue4.
Some companies edit its source code and use it
I believe so...I think the networking part is what they replacing with stormancer
Everything else probably all built in ue4 code
What, so they're ditching the entirety of CharacterMovementComponent?
I can't confirm that
I guess the problem is with CMC because of the granularity of the packets it sends
I only know they're using stormancer for their networking solution and if you look at the company that using stormancer,the game have a decent large scale player count for pvpve
Well ue4 networking is built for something like fps and moba
but there is something wrong, whole UE4 architecture is about shooter games not only networking
when you dig down to custom functions and components you need bigger support of that plugin...
I guess the problem is with CMC because of the granularity of the packets it sends
@near bison CMC simply is too advanced for MMO stuff
Yup
Squad is using UE4 and have 100 player map too.
100 with CMC is known possible with a lot of careful work. See PUBG Fortnite and others. More than that stretches CPU power, bandwidth and even gameplay
There is a reason BR games stretch out the players until half of them are dead
hi anyone here have CodeSpartan character customization system fromthe marketplace?im researching methids i can use for multiplayer character customization using FSkeletalMeshMerge
how's his method of character customization system?anyone tried it and what could be improve
if i read the code of FSkeletalMeshMerge,it doesnt support merging the material like the meshes
in CS CC,he manually set the materials based on the chosen meshes
i wanna know,how does fortnite use the fskeletalmeshmerge?
Are they not using the master pose component system?
We're using that, works pretty well. You don't get collision on the slave components but the master should cover that with it's own physics asset anyway
Also, it's fast
I actually thought the SkeletalMeshMerge thing was for editor-time, could be very wrong though.
What would be the best way to use "Convert Screen Location To World Space" on a server?
by doing it on the client, and telling the server.
And I guess my best way to prevent cheating is to look the different direction of both at a given time?
server doesn't have a screen.
Of course
I'm using this node to fire a linetrace
it's a bit shameful, but I don't know if I have a better way than this đ
Preventing cheating really depends on what you're doing? What are you trying to let the user click on, or select the world vector from the line trace for?
It's for a bullet from a third person and the mesh doesn't exactly line up. So my best guess right now is to verify the direction of the player shooting (client value) with the server character control rotation
Let me know if you have any better idea đ
There's a lot more you can do than that, but it gets complicated quickly
No reason to be afraid of something complicated
You should at the very least run the same line-trace server side to prevent players shooting through walls
The line trace is only happening on the server at the moment
And then if you want to get really advanced, start looking at lag compensation to rewind the players to their respective positions
Maybe avoid all this for now
Screen-To-World positions won't really work that well on the Server anyway
Didn't told, but my player is stationary and can only rotate
I figured, can you tell me what is your reasoning why I should "avoid all this for now"?
Cause I see no reason to not be exploring some solution
Anti-cheat stuff is difficult at the best of times, and believe me no matter what you do some players will still find a way around it.
Of course they will
So my advice would be don't worry about it too much until you need to
the goal is to put the basic
The general gist is to make sure you run any traces on the server too, to prevent shooting through walls, then also make sure that players are where they say the shooter thinks they are
How you go about that really depends on the game
I usually never rely on the screen, that why I'm curious now, don't be afraid to share some concept
So like I said, I can pretty much just look at the direction for the given time (again, my pawn is stationary)
To even put more spice right here, I don't even have to care about wall đ
In which case I wouldn't even worry about it
Generally the gist is you say to the Server "I fired a shot from position X, in direction Y, and it hit Z"
Following your logic, someone could straight up kill everyone in the level, but hey, not complaining if you don't have any other idea. I really think I can only look the direction in my case
And the server finds a way to verify all three things
Position is easy, since it's stationary - so so long as the position matches you can trust it
Direction, server also knows roughly what direction your in
very roughly by experience
The hard part is when it comes to verifying where the victim is at the time the shooter thinks they shot it
But by the sounds of it, all your tracing is server-side anyway, so it doesn't really matter
There is a decision to make between "complete safety" and "good user experience"
Had my answer, thank you đ
Yeah that too, server-side hit reg doesn't usually feel good
"complete safety" is 100% auth server that ignores the client state
"good user experience" leaves some trust to the shooting client, to a (hopefully) small extent
You can't simulate precisely on the server the state of the scene the shooter client had on their screen when shooting
Thank you, I know where I'm going with this now đ
need some hand holding please đ
why would the syntax on the Epic Online System tutorials be incorrect?
I have had this issue with game spark and now that I am testing the Epic Online System I am running into the same issue were tutorials have code that does not work or api that has been reworked or changed.
I loaded my project into android studio. I then added the EOS SDK module to the project. When following the tutorial, I hit errors in my syntax for declaring dependencies.
implementation android.appcompat.appcompat:1.1.0
implementation androidx.constraintlayout:constraintlayout:1.1.3
implementation 'androidx.security:security-crypto.."
implementation project(":EOSSDK")
implementation seems to be the function that is missing from the ndk version i am using.
there does however appear to be a function with a capital I instead. The point here is that I am new to this just as any other person using EOS for the first time. I just can not get around why we would have to follow something so outdated but a necessity for game developers. EOS talks a good one on their website about bringing all this together to help the community but right now they are wasting peoples time.
at this point I am going back to gamespark. it atleast works.
You're one channel too high for questions or concerns involving EOS
can't we use floating movement component for multiplayer games?
yea if its replicated
is it replicated?
depends on if the actor you have it attached to is set to replicate
but I tried, server side it works, but clients movement does not replicate to others
Floating movement does not have built-in replication
Like, well, any movement except character movement
is there any way to make replicated vehicle, unreal default vehicle physics replication is not work smoothly?
Not easily in current engine versions, no
As I said - any movement except character movement, does not replicate
Replicating movement is about a few weeks of work, so it's not like it's a checkbox
Replicating physics vehicles in particular is particularly difficult
using smooth sync plugin of marketplace can do that perfectly but not worked when possession changed. have any clue about it?
You probably didn't set ownership correctly when possessing
how to do that?
looks like this would be your best option or you can look at the vehicle movement code and write your physics from that
Projectile Movement
Hi again guys, I asked questions earlier about level streaming for my needs. Long story short, I want my multiplayer game to have a gamemode where 2 team are against each others and are playing in team specific levels. There is a possibility to travel to the enemy level. Currently I'm stuck, I want to spawn enemies on each levels, but to do this I have to set the Owner of the spawned actor as let's say a playerstart from a specific level. Problem is, the server can't do that because it doesn't have the level loaded. If I do load the level on the server, then every player will see each other levels. Am I missing something ? I can't find a working solution.
thank you for help
lol thank you. I learned something new. I am working on a multi player game for the first time and I was having problems with my floating pawn movement. plugged in projectile movement and now everything replicating perfectly đ
hey folks, is there any limitations on how many players can join single dedicated server?
nope, but good luck getting more than 20-30 without optimizing đ
same for AIs?
one thing I found today was the multi thread plugin. @clear sand @peak sentinel
looks very helpful, but can we do this in cpp without plugin?
[Help] Im using the network profile and im not sure exactly what the stat "game socket size send bytes" is... is that like.. all the data for all the sockets on all the meshes? or is this some kind of under the hood socket sorta thing that i shouldnt worry about
the nodes are writen in cpp
there's tutorials on youtube on how to set up a multithreaded task in C++
its not somethign that's already in blueprints .. so the plugin is nice for us scrubs
yea wish i knew about it for my first game
we were able to have 60 ai and decent frame rate. anything above that would bottle neck the main thread.
Thanks a lot mattxor
Having a hard time understanding this "not directly replicated" concept for the player array. #1 On the local client the APlayerState:PostInitalizeComponents should get null when it tries to add the PlayerState to the Player array on the gamestate since the gamestate it not created yet on the client. But when the server runs this function it should add it to the player array. Then when the gamestate is created on the local client Inside AGameState::PostInitalizeComponents it will add itself to the PlayerArray which it didnt do before. Then when the server runs the same function it won't add again since the call is AddUnique. Does that flow seem right?
Most of my confusion comes from if the GameState is created so early on the server. At what point is it replicating to clients, and when do they not get null when trying to get it.
@boreal merlin if you wanna find out when it first replicates.. maybe make a variable bool thats replicated.. and use a repnotify.. fire your logic off that on the client?
any ideas to optimize this for networking? when client has higher ping sometimes gun not firing projectiles
Is the server function set to reliable?
Hey everyone I'm trying to attach a client pawn to a PhysicsConstraintActor but I'm having issues. The client's pawn isn't able to move once I attach the physics constraint to it. It doesn't have the authority to move the constraint, even if I detach the other actor.
Should I be using "Add Force" to move the constraint? Or is there some simpler and more comprehensive way to allow my client's pawn to move the physics constraint and other attached object?
Also Im using C++
I am trying to manually spawn the characters at player starts place in the level. But the client's camera is inside the character. ```void AWhyMeGameMode::PostLogin(APlayerController* NewPlayer)
{
Super::PostLogin(NewPlayer);
if (_currentPlayerStart < _playerStarts.Num()) {
APlayerStart* playerStart = Cast<APlayerStart>(_playerStarts[_currentPlayerStart]);
AWhyMePlayerController* player = Cast<AWhyMePlayerController>(NewPlayer);
check(playerStart);
check(player);
APawn* pawn = player->GetPawn();
check(pawn);
FVector location = playerStart->GetActorLocation();
pawn->SetActorLocation(location);
player->Init();
_currentPlayerStart++;
}
}```
@carmine citrus Your better off overriding one of the PlayerStart methods.
// Spawning the player's pawn
/**
* Return the 'best' player start for this player to spawn from
* Default implementation looks for a random unoccupied spot
*
* @param Player is the controller for whom we are choosing a playerstart
* @returns AActor chosen as player start (usually a PlayerStart)
*/
UFUNCTION(BlueprintNativeEvent, Category=Game)
AActor* ChoosePlayerStart(AController* Player);
/**
* Return the specific player start actor that should be used for the next spawn
* This will either use a previously saved startactor, or calls ChoosePlayerStart
*
* @param Player The AController for whom we are choosing a Player Start
* @param IncomingName Specifies the tag of a Player Start to use
* @returns Actor chosen as player start (usually a PlayerStart)
*/
UFUNCTION(BlueprintNativeEvent, Category=Game)
AActor* FindPlayerStart(AController* Player, const FString& IncomingName = TEXT(""));```
Override their Implementation
Ah, I didn't know that was possible, thanks!
In case anyone is curious I was able to solve my problem (for now) by turning my movement commands in my playerController into server RPCs. That way my character is basically always being moved by the server.
Still kind of feeling my way through all this lol
@fossil spoke Thanks, that worked. But my character's camera is still 'stuck' inside the pawn
Is it on a SpringArm?
yea, the default setup
Check that its not colliding with something it shouldnt be.
Yea, IDK. I just reverted everything and reimplemented ChoosePlayerStart_Implementation and everything is fine. Gotta love source control
I've enable multiplayer world origin rebasing but it seems that if the server players origin is to far away the client origin rebasing docent work is there a way to fix this
[Help] I've been working with the Network Profiler a bit lately.. and i'm tryin to figure what "game socket send bytes/s" represents.. my first intuition is that its all the sockets on all the meshes? am i wrong? is it something else?
Its referring to networking sockets @strong vapor
I am about to bring our homing projectile into multiplayer testing. Is there anything I should watch out for? So far we have client side bullets which dont do anything. Hits are 100 percent server but the projectiles on the client are moving so fast it looks close enough to pass off
Hey! I'm after a bit of advice please đ I'd like to learn about how an MMO is created (mainly the backend part like how's the data stored, what data is stored where and things like that) Before you say anything this isn't another "I'M GOING TO MAKE AN MMO!!!!" I want to gain and understanding so I can create my own personal project and gain more knowledge in that area.
Use the search function and type mmo im pretty sure people talked about this a few days ago.
ok thanks do you know of an documentation on it at all please? I have googled obviously but theres no clear answers its generally pieces
There is no documentation on MMOs because the backend of a MMO is like, dozens of engineer working on it for a decade
There isn't one way to do it, there isn't one particular trick, it's just a huge pile of work
yeh i understand that. I have worked in Databases in the past and can imagine the sheer amount of work for something like WOW etc
The reason the answers are "pieces" is because, well, no one knows how to create an entire MMO server. People know the one piece they worked on.
i'm not after a hand held "put this code here and that there" more an understanding of it if that makes sense
I think you can only find separated websites of info for this... just search understanding mmo games or mmo games back-end etc...
Other forms of understanding is to go find open source mmo games
Open source MMOs that actually have players are probably not easy to find
What you're looking for in that scenario is more like unofficial community servers for commercial MMOs
Those actually have people playing
It does not matter about players... he just wants to get an understanding
Yeh im'm happy to also pull a project apart aswell to see whats what đ
I'll see what i can find thought i would ask here first to see what everyone thought đ
Players are the only reason a MMO is called a MMO
Anyone can make a multiplayer game
We're talking about MMOs - games with thousands online at a time
If we're talking about regular multiplayer games, just look at Shootergame in UE4
i think TheKiwi meant that it doesn't matter if the Opensource MMO has 10 players of a million its just for me to learn about it đ
or a*
But it does matter
If your game never has more than 10 players, you don't need MMO tech
And you probably don't have MMO tech
You don't decide you're an MMO because you feel like being one, you earn it by actually sustaining a massive amount of players
I meant that it does not need active players currently.... it can have some history that would be nice so you know you can trust it but it is also good to learn from various mmo projects... weather it failed or if it succeeded
The current player count doesn't matter, but if your open-source MMO peaked at 1000 online players, there is nothing MMO-related to learn about it
Though 1000 is probably harsh, at least 1000 is beyond what UE4 can do
But I doubt most open-source games ever peaked at 100
And this is why people tell you not to do an MMO - you're not getting 100 online players for your indie game, so you don't have MMO scale, and you don't need MMO tech, you can emulate the feel of an MMO but keep everything instanced, and you'll be fine
yeh like i said above i'm after an understanding of it, Its easy for people to say don't do it but everythings' possible to learn đ I would understand if i came in saying "I'm going to make a huge MMO" i know the reality of saying something like that...It will most likely never happen without huge funding an experienced team
But how do you plan on getting an understanding of 50 people's work over a decade ?
It's like saying you want to know how to build the Space Shuttle
i mean this in the nicest possible way I'm here to do and learn not to be told I can't do it
No one is telling you that you can't do it, just that you need to pick a topic
You can't learn how to build a Space Shuttle
You can learn how to build a model plane, or a model rocket, etc
My suggestion would be to pick a game engine and start building stuff
Some things just can't be explained, unless you have a lifetime before you
Erm...what are you talking about???
An advice i can give is I suggest learning about mmo... but it will be nice if you have experience in programming and game development and server architecture
Basically a MMO is the sum of single player game development + multiplayer game development + shared servers + massive scale
I'm just suggesting starting at game development
start building your game, when you get more than 1 player start thinking about networking. when you get more than 100 concurrent start thinking about scaling
@bitter oriole No offense, but I remember getting that attitude from you as well. That is, trying to learn something and you just telling me "don't do it. you can't do it. you're not big/rich/etc enough".
From what I get his goal of this is to understand an mmo... not to make one yet
If you are building one..then start small and just build up experience to make one...
idk @brazen ember history or experiences
The point there is no way to explain how to scale your game server from 100 to 10,000, when you don't have a game server.
And that there is multiple lives worth of experience needed
So you can't teach that stuff
first of all, that sentence is a lot better than saying "you can't do it".
i have experience in game development, server coding and architecture so I'm not asking to be taught from knowing nothing đ
Alright, so what are your actual technical questions ?
What's your current problem ?
This is how you can learn
You have something, you want more, you don't know how
although personally I disagree. When I say learn something, I don't mean "learn to completion" / "learn until I can do it". It means understand some parts of it, hopefully most of it. And that can be done for big projects as well
Hey! I'm after a bit of advice please đ I'd like to learn about how an MMO is created (mainly the backend part like how's the data stored, what data is stored where and things like that) Before you say anything this isn't another "I'M GOING TO MAKE AN MMO!!!!" I want to gain and understanding so I can create my own personal project and gain more knowledge in that area.
@brazen ember
It's not that vague.. those are keywords including back end
So answer the question if you think you know how
@brazen ember I'd say it game dependent. But like Stranger said it's mostly with a database (it's a huge subject, so read about it if you're unfamiliar with it).
@river estuary I'd agree with you, no matter what you will always learn something new ever if you think you've learnt everything there is to know
@brazen ember I'd say start designing one. That is, imagine you are making an MMO and write in a document what you think you'll need (just for the backend for now, to focus). You can include rough structures of it's built. And even if you're not sure or you're wrong - write it anyway.
Then link it here. People can take a look and recommend different approaches/fixes about it.
I agree with what msh says... experience is another way of learning it... just choose whatever methods we have said so far helps you
Experience is the only way you will learn about it
"How do you scale this very particular game to a million players ?"
@brazen ember btw, my first introduction with MMO code was wow: https://github.com/mangoszero/server
It's used by private servers (actual MMO), and it's AMAZING.
Experience is the only way you will learn about it
@bitter oriole I disagree. Experience is the best way to learn about it. the fastest and most accurate.
Alright, how do you learn how to make an MMO without working on one ?
Ask the Blizzard team for a 10-years course ?
by reading about it. Again though, remember "learn" doesn't mean you can do it. It just means you know more than you did before.
lmao
by reading I mean code and not articles. But again, I disagree with you.
thanks for the WOW link. Even being able to look at the database structure will help alot
@brazen ember Keep in mind the game is old. Design choices for old games usually never gets updated since many times it means changing the entire codebase.
So learn from it, but beware there might be better alternatives in some areas.
Overall from what I remember it though it has a great design and still relevant these days.
thanks alot!