#multiplayer
1 messages Β· Page 465 of 1
rn my options from people suggesting me is spatialOS
from what I see, SpatialOS is a middleware + server hosting allowing you to stich together multiple servers and doing player migration between them
any of these bigger titles actually use spatialos?
it is fairly new, so i don't imagine many games using it are published yet
from what i've heard spatial now have a free one that people can test right?
but then again, thats just guesswork
@karmic briar Be sure to do some calculations on target sales, too. If you sell 10K units, you'll be able to run on a single server
Not doing an MMO ?
A global single shard MMO, anyway
Destiny or Sea of Thieves look a bit like MMOs, but servers have 16 players max
im planning with distributed one with multiple server like with spatial handle the workload
there's one with similiar called DAT
Where do you guys find people to help you test multiplayer features? Been struggling to get people to test with which is kinda slowing down the dev side.
well i go to mmo forums and asked people there
and other discord server i have and friends
Part of why you do PR for your game as soon as it's test-play ready
Build a community, get a Discord running, have a forum or something
You want that anyway, no matter what kind of game
well i do not have one atm maybe i'll build one
Discord, Twitter, weekly gifs, monthly devblogs in text or video
And yeah a forum of some kind is still pretty nice
The Steam forums might be enough once you're close to Early Access or something
thanks stranger π
what do u guys think of this framework
at a glance... don't like "and a plan to support Unreal"
in any case, if you have 2 experienced network engineers, shouldn't you set them to doing research?
I'm curious, is there a way to override what happens when an RPC validation fails?
how much performance (ram) does a single dedicated server takes?
RAM is far from the primary performance metric, and it's impossible to say
Depends a lot on your game
And the current level
for a map like an overwatch or paladins sized map
or other asked
how much servers can i run on 1 machine?
just the average?
(5v5) player
@neon dust You need to profile it, there is zero generic answer to that
Probably 1 to 2 CPU cores and between 500MB and 5GB RAM per instance
Depends on your game and level
Minimum is 1 CPU core and I guess 200MB RAM
if you're loading an empty engine
Then you're going to load a level and it might shoot past a GB instantly
π€·
ok
ARK Survival Evolved takes 6GB+ for a single server instance
How are you supposed to implement custom replicated crouching? I am running into an issue where I have to adjust the characters mesh location upwards after reducing capsule half height (makes sense), I run that logic on the crouching client, then the server and then all other clients, works as expected, but the mesh relative location won't change on the other clients, probably due to this bug: https://answers.unrealengine.com/questions/222168/mesh-setrelativelocation-is-not-working-in-network.html Any workarounds?
Character BP
OnRep isCrouching
this is the flight for one of my spaceships, it works perfectly
however for any player who isn't the host
it's slightly
stuttery
little laggy
for the host, it's perfect
Does anyone know if Epic Online Services is going to support Oculus for cross-platform play?
Don't see any reason why not. The SDK doesn't tie you in to any existing storefront or service.
Though it might not interact with the Oculus account or friends in any way
We have released a significant update to the #SpatialOS Games Development Kit for #UnrealEngine including a new Example Project, tutorials, a port of Unrealβs βShooter Gameβ and more: https://t.co/jqzRF0c1Rc #UE4 #gamedev
Just saying
(posted 4h ago)
is spatialos easy to implement?
multiplayer isn't my specialty, not sure if i'd need to hire someone or not
@urban dew considering you still have problems with most basic networking (sorry to say, but it is true), i wouldn't expect it to be easy
nah fair enough call π
coming along nicely though, only got a couple networking bugs to fix up before multiplayer is smooth π
think additional layer of networking ontop of everything unreal comes from
better question, how long do you think roughly it'd take most competent people to set it up, so I can get an estimate on cost π
i just glanced at their demo
and i have no idea what the scope of your project is
also "most competent" people tend to be both booked and expensive
Not worried about the cost, it's all apart of budgeting, aslong as I have an estimate π
and can forward plan
still no idea on your scope
i only picked up it has to do with planets and spaceships
if used for big scale, it doesnt seem like something you can just tack on to your project
looks more like something your game needs to be designed to
You don't need Spatial
then you don't need spatial
maybe he wants a solar system for each player ?___?
might be getting it mixed up with a different playform
that creates a server upon request?
platform*
spatial is for stitching multiple dedicated servers together
and estimated time is in months
wouldnt the overhead of all that become insane
its a neat project, but not gonna hold my breath until i see a working implementation for a decently sized and complex game
is there a way to rep stuff only to a specific player? i dont want to do a rpc to a controller for every single thing and i have a lot of objects that are only visible to certain players
like for example particle systems inside a gameplay cue
i mean, the overhead is a problem yeah, but when that overhead becomes less expensive than just running stuff on the server it's an appealing option
yeah, there is a relevant to function in AActor
zale
i forget what it's actually called one sec
do you mean relevant to owner? but what if something is relevant for 2 players for example
no, it takes a viewer and returns true/false if it's relevant to that
so you can filter by like, team
or per-player
or however you wan to do it
oh wow.. that would have saved me so much trouble.. do you know what its called?
not blueprintable i guess?
https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AActor/IsNetRelevantFor/index.html
Checks to see if this actor is relevant for a specific network connection
note that using a replication graph makes that function never called
yes, because repgraph replaces it
You might not have the SteamDLLs in the Binaries folder of your Server?
The Packaged folder
dedi shouldn't use the steam client tho, no?
The message also comes up if you don't have steam installed and the binaries are missing
And you don't have Steam running on that PC right?
i don't recommend searching for a provider if you don't already know what you need
I would run your dedicated server locally or on a simple cloud service until you discover how many resources you need
most of them will cost a decent amount of money
your big 3 cloud hosting will likely cover you during development
AWS/Azure/GoogleCloud
you'll have to spend money
once you figure out how much and what resources you need, you can probably talk to a dedicated server hosting service and get a cheaper deal at scale
but, generally, when I see a question like yours, I can't help but comment about the fact you are asking the wrong question here
you want hosting, obviously, but i think a better question is where to start
there are a lot of unknowns when deciding how to host dedicated servers
really you should be asking yourself "what kind of servers do I need?"
50 players is kind of a heavy workload
50 players with vehicle, not character
Roy Awesome when you say to host locally do you mean a PC a home network? I wonder what Kind of mbps you need for that? probably top tier USA speeds?
do you know how much information you are sending when 50 players are in a server? do you know how you plan on scaling? Are you releasing the server bins?
in my case it's only 2-10
i'm really don't know from what start network support, think about spatial os
but can't setup 4.22 engine
@twin juniper so, during development, you almost never need a dedicated server until you have more players than your server size
especially for smaller projects
it's a waste of money to get a dedicated server early on
just open the port and host it on your home connection
if you start running up against bandwidth counts or processing power
that's when you start considering it
@gleaming vector i'm just finish game and test it with steam with 4 players, now first day when i'm think about dedicated server, but don't know what is best way for my.
because like, during development, you are going to make a lot of builds and are going to restart that server often
and there will be significant gaps of time where people don't play it
if you go about it this way, you will start to gather a lot of data... how much processing power you are taking up per-player... how much information you are sending across the network
as you start to understand those bits, then the selection of a server host becomes really easy
but, if you are set on picking a server provider... Azure is good
it's a fantastic starting point
since you can trivially upgrade the hardware a server is running on
you will be spending money though
@iron lotus as I said, host it on your computer to start
i'm using steam host-listen/listen and any client's connection is choppy/laggy/jittery(when moving) ; although the host sees the clients as moving smoothly... unless both host and client are on the same network. Clients move smoothly then. That's not a limitation of client-host is it? I've got something configured wrong probably?
i've never installed shooter game. I can give you a couple steam keys if you want
it's smooth unless the player moves then they backtrace or i'm not sure how to put it
I'll give you the keys without expecting anything in return. There's just an eppilepsy / trippy warning attached
also I think since 4.22 on server travel (level load) i just noticed I'm having an issue where clients will crash with fatal error has anyone experienced something similar
this is a method i use to move between levels for client-host.
you help people with information so much Roy Awesome. you deserve all the steam keys and if there's an epic store equivalent those too
im updating to 4.22.2 now i didnt notice anything in patch notes relating though
@gleaming vector Spatial Os bad way?
i haven't used it in like 3-ish years
before they even started working on the unreal gdk
it looks fine, but there are probably some major pain points
i just don't know what they are because I haven't used it
I am, however, incredibly excited by their progress
and cannot wait to have an excuse to use it
@gleaming vector what source control do you recommend? I was trying to set up GIT and was having issues so I put it off to try again later
if you have the money, perforce
i'm using plastic though, for my projects
i like it
that's a question for #source-control tho
tru
@gleaming vector after testing in local pc best way for me is azure right?
that's what I would do
but, like, it really depends on your needs, and you wont figure that out until you run locally for a while
@gleaming vector thank you
What's the best structure for me to create per player UI (like healthbars and stuff) once all the players have been connected?
I was initially just doing it in the player controller, but that doesn't work for the other players on the client
the HUD
it's client-only
can see the local player controller
best place to do that
In ShooterGame to prevent a stale pickup respawn sound from playing when a client enters relevancy, they use this bool to determine whether the sound should be played (the sound plays if the bool is false): const bool bJustSpawned = CreationTime <= (GetWorld()->GetTimeSeconds() + 5.0f); It does seem to work but I have no clue how because as far as I can see, it's not possible for the creation time to be greater than or equal to 5 seconds in the future
Any help understanding why it works would be great
Hey guys I had 2 questions: 1. If I add even a small amount of PktLag my movement gets insanely jittery but only client side, server still sees smooth movement. I fixed this a little by reducing the update rate of the character movement from 100 to 50 but it still happens when I turn or strafe quickly. On a related note, 2. I want to check if my character is rooted/stunned before actually inputting movement. I want to check this on server but asking the server if Iβm rooted and then sending the movement input creates s lot of input lag on any latency. Whatβs the best way to work this system in?
Hi anyone has any idea on how should I go about doing this.
Said I have 2 clients, and I want those clients to have a box with random letter on it, however the random outcome must be the same on both clients(hence, same text on both clients).
When client 1 click on the box, I want the box on client 1 to move up, but that same box on 2nd client to move right.
My first attempt was to random the letter on server, then pass that outcome to clients, and then clients will spawn a box with the letter that was passed down from server.
Now clients will be the owner of a spawned box.
The problem is that, when the client 1 clicked on the box, that box will move up, but I can't get the box on client 2 to do anything because it's a difference instance and don't have any connection with the box instance on client 1
My 2nd attempt was to spawn the box on server and then replicate it down to clients, now the problem is every change made on client 1 will be the same on client 2.
And I can't make the box to behave differently, because it will get corrected by the version on the server to be the same on every clients.
You have to mark the Actor as Replicated but not Replicate the Movement.
Then you have to Replicate the Text Variable, which is the easy part.
For the Movement you have to make sure you only replicate the act of moving, not the actual direction.
So when Player1 Touches the Box, it tells the Server "I TOUCHED THE BOX" and the Server tells the others that the box moved.
Then the Player2 can also move the box but with its own direction vector.
PlayerStates are recreated and copied over on SeamlessTravel or?
They aren't fully persisted, right?
been a while since i looked at that part, but arent they perisisted until you reach destination map, then copied over to new ones?
yeah, in HandleSeamlessTravelPlayer it seems like the PS follows the controller over
@thin stratus
void AGameMode::HandleSeamlessTravelPlayer(AController*& C)
{
UE_LOG(LogGameMode, Log, TEXT(">> GameMode::HandleSeamlessTravelPlayer: %s "), *C->GetName());
APlayerController* PC = Cast<APlayerController>(C);
if (PC != nullptr && PC->GetClass() != PlayerControllerClass)
//...
else
{
// clear out data that was only for the previous game
C->PlayerState->Reset();
// create a new PlayerState and copy over info; this is necessary because the old GameMode may have used a different PlayerState class
APlayerState* OldPlayerState = C->PlayerState;
C->InitPlayerState();
OldPlayerState->SeamlessTravelTo(C->PlayerState);
// we don"t need the old PlayerState anymore
//@fixme: need a way to replace PlayerStates that doesn't cause incorrect "player left the game"/"player entered the game" messages
OldPlayerState->Destroy();
}
Yeah figured as much, now I no why my TeamState survives but has trouble accessing the PlayerStates in it
Guess I have to simply remove old playerState and add new playerState on CopyProperties
That should solve my random crash >.>
if (TeamState)
{
// Remove this old playerState from the team
TeamState->RemovePlayerFromTeam(Cast<AController>(GetOwner()));
// Add the new playerState to the team
TeamState->AddPlayerToTeam(Cast<AController>(HLPlayerState->GetOwner()));
HLPlayerState->SetTeamState(TeamState);
}
I hope the owner of both PlayerStates is valid at CopyProperties, it should technically
Wait what happens if the map you're traveling to is supposed to use a different player state
I'm now worried about my stuff breaking after map change
ate there good hosting services to host cheap?
AWS being the most well known you can estimate your costs based on that and keep looking for cheaper options
This stuff changes over time anyway
ok
cause i wanna host on 1 dedicated server 100-200 players
but i donΒ΄t know if unity servers are more performant
200 players is beyond what UE4 can do
hmm
Hell, 100 players is hard enough
Mordhau had a hard time getting their servers from 48 to 64 players
Anyway, a lightweight UE4 server that works with an average CPU and 4GB RAM will cost you $25 a month
Let's say you can have 50 players on that, you can host your 200 online players for $100 a month ; if your game goes for $20 on Steam, you're making $10 per copy so it's only 10 copies per month to pay for servers
Bit of a rule of thumb : if you sell 1 000 copies, you can count on maximum 100 players at launch, maximum 50 a month later, and maximum 10 a year later
and one dedicataed player 10 years later
Yeah
Basically 200 player games need to sell 50k units to keep a healthy player base
does spatialOS help with server capacity at all? i keep hearing about it but have no idea what it actually is or what the pricing is like
Pricing isn't public so it's expensive
And it's not really about capacity, it's more about having a seamless world divided into instances that talk together, from what i understand
I mean it does a lot of things, it's a complete solution from hosting to saves
But mostly the important part is "many servers in the same world"
all ive seen are their promo videos which are obviously insanely positive and make it sound super useful, and im not near releasing anything, but i do enjoy learning so i was really curious about what makes that software different from typical servers, so thanks for the explanation
I guess if you're building Destiny, it makes a whole amount of sense
yeah, i am one of the idiots that wants to make an mmo in ue4 as my first game so it caught my attention lol
i mostly just enjoy making the systems, its really interesting to me and im not interested in game dev as a job so ive got no deadline or expectations, i just like trying to figure shit out and eventually i'd like to get something small up and running for some friends just to see if i can
server stuff is just interesting to learn about
Multiplayer is great. The basic problem with MMOs is that short of multi-million-dollar marketing, you're not getting the players that make it a MMO
well that and the fact that people who still play MMOs have probably the most ridiculous standards for games youll see anywhere, speaking as an MMO player
Anyone can come up with a nice game, and a barebones title like Sea of Thieves does have a whole lot of players
Still, if you design a MMO, you need the players
nice that they have a free tier to learn how to use it and demo before actually buying
yeah though to me it seems like if you actually want to use these 'new' features, youll be making your game from teh ground up around them
Absolutely
before you know it, theyre bankrupt and youre left without a game ^___^
F
Spatial OS did cause Unity games to get pulled offline momentarily for licensing issues
nasty
do you know of any titles to actually use it?
anything bigger i mean
specifically, using it for the big world stuff, or the distributed processing
not just as another host service
tbh i doubt it, if you have to build ground up around them then most large games that are out now probably started before it was a good option right?
probably have to wait a bit
yeah, and big publishers/devs might be vary of relying so much on a single third party for their product
i think we'll start to see some big stuff in the near future now that its getting more buzz and some time has passed
As I usually say around here, if you're not an established company with employees dedicated to online, don't do dedicated servers
And yes that does mean no MMO or competitive shooters or battle royale
if we start getting 400-player BRs then im gonna have to upgrade my pc
or live with 12 fps i guess
even with this scheme, 400 player BRs are gonna have issues when too many people end up in one location at the same time
meh
big numbers always means you have to make sacrifices elsewhere
does anyone actually want a 400-player battle royale game?
@bitter oriole is unity in this topic better?/cheaper?
hey. using steam advanced sessions, is it possible to update the player count somehow when new players join a game? players who search for games seem to always see '1' as the number of players. It would also be neat to be able to update extra settings such as current map name after server travel. I can't find a way to reference/update the online session in blueprint though (blueprint only project)
@neon dust 200 players in Unity won't be easy either and you probably will have mostly the same hosting costs
I mean, AWS is cheap
I don't even know if it's the cheapest, but $30 a month per instance is cheap
OVH has "gaming" VPS with 32GB RAM and a fast i7 going for $80 a month, I figure you can run four UE4 dedis on that
@neon dust Basically you need to think a bit about your business model here
can someone help me with a slight replication issue ? π
i have a function PlayReplicatedMontage, which can be called on client and server
now the issue is, for a client, when he its a navlink it plays the montage on the server and then the client plays it via a onrep
thing is, if PlayReplicatedMontage is called on client for say a melee attack
the onrep will cause it to play again
if i put a check in the onrep for !IsLocallyControlled() then the server initiated montage (navlink one) doesnt play on the client
i need a way to ensure it plays on OwningClient but only if owning client is not alreadying playing that montage
this is the flight for one of my spaceships, it works perfectly
however for any player who isn't the host
it's slightly
stuttery
little laggy
for the host, it's perfect
anyone know what could cause it
UKaos, Then just store the current played montage, with a timestamp how long it goes. When the onrep comes you can verify the same anim sequence is running already, and just skip the double play because timestamp will indicate it is running already.
@meager spade Just make the replicated variable ignore owner.
i did that
then it still skips owning client
as in owning client wont play vault montage locally
Call it directly when it's started from the client
You need to play it directly on the client when you hit
And have the replicated trigger set to ignore owner
Just a plain regular function call
Why wouldn't the client start it ?
cause navlink callbacks are server only
asked same question for 3 days, my blueprint must just be beyond repair :P\
and when the player hits a navlink the server plays the montage of vaulting
which needs to be played on owning client aswell
:/
So like, play it on the client
{
LocalMontage.bPlayBit = ReplicatedPlayBit;
PlayMontageSimulated(ReplicatedMontage.AnimMontage, ReplicatedMontage.PlayRate, NAME_None);
}``` this might fix it
@urban dew It looks like you're trying to move something from a client ?
it's a actor "spaceship", its designed to fly from one location to a different
the target destination does change
icejaff, it's possible. also there have been long list of reports of jittering listen server/client combos, so maybe that.
ahh
then playmontage simulated does this ```PlayMontageSimulated(UAnimMontage* Montage, float PlayRate, FName StartSection)
{
float Duration = -1.f;
UAnimInstance* AnimInstance = GetAnimInstance();
if (AnimInstance && Montage)
{
Duration = AnimInstance->Montage_Play(Montage, PlayRate);
if (Duration > 0.f)
{
LocalMontage.AnimMontage = Montage;
}
}
return Duration;```
should work
Jittering is just bad netcode
That has nothing to do with your issue
do you adjust by deltatime?
its very smooth for host no matter how many ships, but non hosts, jittery
yes
btw ReplicateMovement will do nothing for a standard actor
If you replicate location (or rotation or transform generally) and have a client move the object + tell the server about it, that can't work without some work
fyi
Because you will move the object, and then the server will replicate the location
From your point of view that will happen at time of move + ping, in time
But the location will be that of time of move, which was "ping" ago
So it will go back
then execute on server, so that way it updates the location for all?
ahh got you stranger
yeah but it really doesnt do anything (replicate movement)
void AActor::OnRep_ReplicateMovement() {} <
so whats the best way to go about fixing it? is it as simple as making "not replicated" in the function?
No
A correct implementation that works well and prevents cheating is somewhat hard to do
If you don't care about cheating, and don't have collisions with other players, it's easier
You need to think about your remote client like this : it has its own life, and might not get any network for a second or two
All your code must keep working well when net drops
Two general solutions :
- Your client does whatever the fuck he wants and has absolutely no replication for itself ("ignore owner" flag on everything rep'd), he just tells the server about it
- Your client does stuff locally, tells the server about it, and when the server replicated back, the client does processing to check if the server said something different, which is called rollback + replay
ideally the second, but im just confused how that would work for something like this as it doesn't belong to a player, i thought server updating its location, would be ideal
I use the player to replicate its spawn to the server
so you think I should set the owner of the ships?
upon spawn
I mean if the ship is something a player will control forever, yeah absolutely
oh no, its apart of an RTS, essentially, ship spawns at one of your planets, and flies to an enemy planet, and then gets destroyed
@meager spade OnRep_ReplicatedMovement() definitely does do something for a base actor class
ActorReplication.cpp: void AActor::OnRep_ReplicatedMovement()
If it didn't we'd be seeing that crop up all the time on the forums π
still a little confused, so is it hard to get this to replicate properly? or is it just a server issue?
It's not an "issue", it's something you need to think about and pick the best compromise in your network model
You could have everything happen only on the server
multiplayer iz hard
You can also have everything happen on the client and just give high-level commands to the server
And you can do a bit of both
Movement is arguably one of the most complex things to do in MP, which is a bitter pill at first since virtually any game has some kind of player-controlled movement
I'm gonna do a card trading game next guy tapping his head gif
To be honest, it's a lot of an UE4 issue too. A generic rollback / replay movement component would help.
I have something so similar to that now. I need to roll it out.. though it has it's own limitations
The general idea was to just have a system where you say "this is how to move the object" and "this is all the vars I need to do it over the network"
and the networking side of it is silently handled behind the scenes
But when I realised that collision resolution is really crappy / difficult when not using a physics engine I held off for a while
I'm just in the process of rebooting my game project, and dropping all kind of physics from the existing code is sure going to feel weird after all that time.
Probably a good feeling overall since it's always been shitty
Yeah I really wish I could get rid of the physics-reliant version I use atm. I'm basically doing what FN does at the moment, but I hate it. Spend so much time making the prediction/replay side of it work, only to get stumped by collision in the end
one thing that caught me out early on was that MoveComponent only cares about the root body when using skeletal meshes, so you have to do a fairly comprehensive engine mod to make it factor in all bodies.. but then it gets messy π¦
were they doing something with physics objects replication in this new physics system coming?
The only physics I will have in my rebooted project will be "fall vertically to the ground with one or two bounces" and god that's amazing
Not even sure I need that
@manic pine they haven't detailed specifics on that yet.. but I really frigging hope so
If PhysX allowed you to simulate just a single object in the context of the rest of the scene, it would be reasonably easy to do
But it doesn't because f*ck you that's why
Thanks PhysX
If the engines native physics engine allows you to do that though... oh the possibilities
and better performance, integration with other engine systems etc
yeah
could turn out great
actually gonna dig up my thread on that and spam it to epic devs on twitter
or it could end up much like what we have already, just with a 5% performance boost
^___^
Haha yeah most likely.. hey guys you can destroy everything but you wanna move a physics pawn in multiplayer lol gtfo
This problem has chased us since the damn 90's and we still don't have a solution ffs
we must go back to lockstep networking
well i guess thats pretty much what theyre doing with this craze over streaming games
deterministic lockstep would be cool.. if a little unresponsive for a shooter or something. Mind you a lot of games I played with that system don't really suffer as much as you'd think
Would be perfect for me though π¦
yeah and its better now than it was back then, since we usually have okay latency now
but yeah, not my first pick for any kind of fast paced game
or anything where you directly control camera with mouse really
would certainly make development a lot easier though
lockstep without client prediction = π©
but a well-synchronized poop
Small question, are you able to use both Epic's and Steam's subsystems at the same time or would I have to make two different builds? The team I'm working with is discussing the possibility of releasing on both the EGS and Steam
different builds
Well, you need some intermediate subsystem if you want both of them to talk to each other. That kind of thing doesn't come cheap (at least not until epic completes it's Epic Online Services stuff anyway)
argh
To have them working together you'd just use Steam / EGS as a distribution platform - then have your own OSS
Which is extremely expensive to support and build, but thankfully Epic are trying to make that a free thing
Just checked, Epic's online stuff has just about nothing that Steam offers so far π
That's going to be a PITA if the team wants to release on the EGS first
Right now most devs can't release on EGS either so it's not much of an issue
But yeah, Epic's will lag behind for a long time
I mean if you have negotiated an EGS release with Epic, I'm sure you can find a technical solution
If not, EOS will have most major features by the time EGS actually opens to devs
Is there a date for when they open up to devs?
Not that I know of, but "this year" IIRC
Aight well if it's this year it should be fine
The EOS roadmap has them practically beat Steam by the end of the year
For online services of course :o
Depends on how useful the server side matchmaking will be though
It's more of a "doing most of the main things" than "beating" tbh
Steam will still do much more stuff both for players and devs
@winged badger hey remember you mentioned calling SetReplicates(true); in the constructor would break my actor? I'm looking around and it seems that's how UnrealTournament sets all of its inventory / projectiles to be replicated
Would you say it just doesn't call some aspects of the function but is still fine to use?
Maybe there isn't much of a difference, but it does seem the roles getting assigned is important
Also on a UE4 wiki this line mentions it: If you want a component on your actor to replicate you should call SetReplicates(true) on the specific component in your class constructor
So it seems fine to be called in the constructor?
@bitter oriole i found the solution for earlier
i changed the function to not relpicated
and it fixed it because of component relpicates
Potentially dumb question for anyone familiar with SeamlessTravel and the SeamlessTravelActorList:
It seems I can add actors to my SeamlessTravelActorList, and then seamlessly travel to my next map...but how do I then retrieve the SeamlessTravelActorList? It doesn't seem to live on GameMode, and I'm really struggling to find any documentation on this
I'm running LineTraceSingleByChannel and something strange is going on: the server only seems to get a hit if it happens on camera. If it happens while the server is facing away from the trace, no hit registers. Any clue what's going on?
@idle blaze - are you using RPC events or SwitchHasAuth (ListenServer?)
@worthy wasp I'm using RPC, and this is in C++.
You should always pass through your start/end fvectors. 99.9% of hte time - Server will be completely out of sync with Client when it comes to transform of both actors as well components. SOME components arent even tracked by server - hence the need to pass through the args.
you can safely rely on client for hit detection - and use the server as a AUTHENTICATED hit
I was using Simple Vehicle Template. When I played the game on Dedicated Server mode it started jittering, can anyone help me with this?
@weak fog - AGameMode isnt a load-state capable class - it reinitializes on travels. FYI - UGameInstance is the ONLY class that is load-state capable in the game framework.... thus any data that you wish to save between state changes need to be mapped/retrieved into/from the UGameInstance class
Interesting, thanks. Could you clarify what you mean by using the server as an "authenticated" hit?
@idle blaze - so we do FPS shots (Called HITSCAN in trade terms) in 2 modes in multiplayer -
FIRST: FromClient -> SingleLineTrace to calculate a CLIENT driven hit
IF HIT (on client) -> ServerRPC::HitScan(FVector Start, FVector End)
SECOND: ServerRPC HitScan -> Raytrace with the passed args
now
whil this is COMPLETELY SIMPLIEFIED HERE....
do realize - you will have network lag
which is wher eyou need tos tart doing Lag Compensation
i've not gotten this far with my studdies yet....
but basically to my understanding - every player stores an array of N# of frames BACKWARDS in history of their location
on this SERVER HIT - you would calculate how many frames have passed due to lag (DONT KNOW HOW TO DO THIS YET) - and then see (ON SERVER) if the hit went through to the TARGET - where it was standing N# frames ago)
its quite indepth
again - i havent yet achieved (or even started this) study yet
and by authenticated - i should re-clarify it as Authoritative
IE: the server confirms you actually hit the person (cheat/hack-proofing)
Awesome, thanks again.
you bet - sorry its so complex - simple answer to your question is - Server is either DESYNCED or not even tracking the CameraComponent
@worthy wasp Does this mean I should totally ignore the whole TravelActorList thing? It seems like thatβs the preferred way to transfer data upon ServerTravel, but I canβt find the way to retrieve it afterword
sorry i wasnt clear enough - take the array list (Tarray AActor*) and simply store it into the gameinstance
retrieve it upon the new map load success
Yeah that's what I was thinking. Then couldn't it just be any arbitrary array at that point? Does this mean the SeamlessTravelActorList is kinda pointless?
i dont understand your thinking..... sorry.
Tarray<AActor*> ThisList = AGameModeBase::GetSeamlessTravelActorList();
YourGameInstance->SetTravelActors(ThisList);
On game map load succes s - retrieve this list.
Again - i have 0 idea what your wanting to do with this list - your original question was how to keep the list live when traveling maps - answered.
yeah I get that, sorry. It just appears in the (admittedly sparse) docs that I've found that SeamlessTravelActorList (which is a UE4 native thing, not something I made), auto-persists upon SeamlessTravel enabled GameModes
in retrospect - a seamlesstravel means that a playercontroller does NOT disconnect from the server - and reconnect upon map travel....
To my knowledge - the entire framework still lies the same - all classes re-initialize after a game map is loaded (IE: ServerTravel). Your ONLY source of persistance is with the UGameInstance class
as far as I know - even when a seamless travel happens - the playercontroller is still re-initialized upon map travel. it just doesnt disconnect/reconnect like in a NON-seamless - which is basically running AGameMode::PostLogin() - a very VITAL function towards MP Frameworks.
On a character, if I call GetMesh()->SetVisibility(false), will that character mesh become invisible for everyone? Or just locally?
just locally
sweet thanks!
a Client rpc will run on the server if the server is the owner of the actor right?
it will run as if it wasn't a rpc
Is here someone who can help me in my Project (Multiplayer - Blueprints)? i am from germany, so german people are welcome
what's the problem?
I just need someone who helps me to programm in my private project the lobby system
Anyone ever successfully overridden GetSeamlessTravelActorList? Attempting to do so but running into some problems. Seems like there's very little info on doing this
Edit: Also it's kind of a misleading name. Something like GatherSeamlessTravelActorList would be more appropriate
I plan on writing a medium post if I can get this working, just to get some info out there and save someone my struggles lol
Called on client during seamless level transitions to get the list of Actors that should be moved into the new level PlayerControllers, Role < ROLE_Authority Actors, and any non-Actors that are inside an Actor that is in the list (i.e. Object.Outer == Actor in the list) are a...
can you change the public connections inside a already launched server?
Why does this happen on listen server?
Owning player and camera references are valid... yet the output is null
@glacial pollen perhaps server is trying to run this? Server has NO ability for widgets AT ALL
Not as server.....
Yes...
No
U need to switch has auth branch
And go off cluent
Listen server is both client and server together
What are you talking about?
A listen server is ONE instance
it does not have a "remote" in that sense
(I wish it did)
Ok good luck dude
bye
Sorry u dont listen well to valid points
ONLY DEDICATED SERVERS CANNOT HANDLE GUI
Lol
I wish u were right for ur sake
Ask cedric he wrote the book
When he confirms what i said make sure u send me a bitcoin
Dude, ignoring the whole role thing. ANYONE can create a widget. EXCEPT for a dedicated server because its headless
Which is server. Fyi begin play runs as both server and client on all actors flagged for replication
NOT FOR LISTEN SERVER *
bye
UE4Editor_K1GiCEQBer.png
New users of UE:
You should be familiar with this first:
UE4 Network Compendium by Cedric "eXi' Neukirchen <---Link
I never said ur system was broke
I'm having a SINGLE issue with one actor component
Other than that, my widgets work fine on listen server
Thats from the compendium.
Same begin play event as listen server, using another widget:
Works fine
Are u switchhasauth off of beginplay?
Ill assume of course not.... then ill further explain to u that ur widget ONLY draws because BeginPlay runs in both client and server roles in a replicated actor.
but still in "standalone mode"
So ur piggybacking off of the client role of beginplay.... nothing u do purposefully
Dude, just stop
This is listen server:
it was the client
Notice Char_Mech? thats listen server, Char_Mech1 is client
This is the client
still in standalone mode
but autoconnect is turned on
so this shouldn't be happening
So the issue was this call was the listenserver's begin play for the clients copy
I realize, what he said was in line with this, however his clarification was extremely poor
i'm having an odd problem with physics on my server.. the client works properly, but the server is showing a velocity of 0 every other tick and on the other ticks it's double what it should be
here's an example of when I jump
printing the z velocity on the server
I'd much appreciate any ideas
Turns out, NotDotProduct is a friend of mine in my DM's, but due to a name change, I didn't realize this. Teaches me to be nicer.
well he was wrong though
am I understanding it correctly that a property on a character replicated with COND_SimulatedOnly will send to everyone except the client controlling it?
since that client would be autonomous
been trying to fix this for hours and im just lost
its just not changing the values at all
If anyone was wondering about my GetSeamlessTravelActorList stuff from before (or if anyone is searching this in the future), I did actually solve it. I can change levels (while swapping all 7 Framework Components) while also retaining any and all data that I want, server or client side (without using GameInstance). I plan on writing a Medium post on this soon as I wasn't able to find the proper info anywhere
hey guys, i'm trying to exclude steam from my dedicated server because i'm connecting to my servers from the IP i get in matchmaking.
the code below is what i'm using in my .Build.cs file
using UnrealBuildTool;
public class UnrealProject : ModuleRules
{
public UnrealProject(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core", "CoreUObject", "Engine"
});
PrivateDependencyModuleNames.AddRange(new string[] {
"InputCore",
"OnlineSubsystem",
"OnlineSubsystemNull"
});
if(Target.Type != TargetType.Server)
{
// Steam Integration
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux))
{
if (Target.bUsesSteam == true)
{
PrivateDependencyModuleNames.Add("OnlineSubsystemSteam");
}
}
}
}
}
and this is the code in my Server.Target.cs
using UnrealBuildTool;
using System.Collections.Generic;
[SupportedPlatforms(UnrealPlatformClass.Server)]
public class UnrealProjectServerTarget : TargetRules
{
public UnrealProjectServerTarget(TargetInfo Target) : base (Target)
{
Type = TargetType.Server;
ExtraModuleNames.Add("UnrealProject");
bUsesSteam = false;
}
}
but the server logs still give this Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
and the clients can't connect to the server by open [IP], it kicks the clients out.
any idea what could be the solution?
Is there any differences between Google Play OSS and Google OSS ? and which one provides ServerAuthkey ?
@nocturne berry someone had the same problem yesterdeay or day before
i think there was a solution involved as well
@woeful anvil thank you, what do they both do?
i tried the force net update, and switch has authority
it still didnt work :\
@winged badger i think u're refering to @woeful anvil
i saw his solution (changing the port) and i tried it.
the game tries to connect but doesn't connect :/
this has delayed my project over a day now, im so stumped
it's just not updating the value ingame at all
anyone know what could cause it
i just put some prints in to find whats going wrong
and changed to multicast
it's just not changing the value at all
@urban dew if this is a commercial project, i would seriously consider hiring a network engineer
i've actually almost finished all the important replication thing
I only have 3 more known networking bugs
"
resource point not working
planets not being destroyed
warp drive spawning, but not taking away ship count or registering as a warp planet
"
when if figure out how to fix this, it should fix problem 1 and 3
then it's more polishing, ui, and stuff
you do unreliable Server RPC, then you check Authority, which is pointless after Server RPC, after that you set a few replicated variables (with no input sent thru original RPC, so im questioning if server could have handled this without client sending anything), then you do a reliable and again Server RPC from there
i only did check authority as someone suggested it last night
1 second
as far as client goes I am firing it from the rts controller
anything connected to server RPC event executes on Server only
so authority checks and server RPCs connected to Server RPC don't make sense
and that is ticking/on a timer?
it's fired from a hud button
which gets all selected actors (rts click drag box)
then it's supposed to -70 from "Ships" variable
for every planet
and where do you sent an array of selected planets to the server?
2 pictures up in the rts controller,
it then checks if the selected actors are planets
if they are it runs the event
ResourcePoint
if I put it on multicast, it does change the value briefly before being changed back
which tells me it is an issue with the resourcepoints event
didn't cross your mind to send the entire array in one RPC?
confused? its run on the hud button being clicked so it goes hud>contoller>selected planets> planet> event
that method does work for almost all spawning methods in my game
you loop through all selected planets
and for each one you send a reliable server RPC
instead of sending one RPC with the entire array as argument
and then doing the looping server side
not owned no
Then you can't perform ServerRPCs on them anyway
world objects
and they should be owned
Actors have to be owned by the Client who's connection is executing the ServerRPC
Idk what is working and not working, maybe you just don't notice it
But a Client has to own the Actor to perform a ServerRPC
And otherway round ClientRPCs need a Client owning the Actor, otherwise there is no Client to target
Looking at how you used RPCs in the past, you are most likely using them incorrect
Could totally be that the RPC in your Screen is called by the Server somehow, and you would never notice the RPC not working properly cause well it's not even needed
therefore, do yourself a favor and hire someone who can do this full time if you plan to release before 2222
*2022
Or hire someone who explains this stuff properly to you
or does both π
i fixed it
thanks to you guys π
looked back to the replication done before
and how the client cant run the rpc
seems to of fixed the issue π
there is about 95% chance your entire network just explodes at some point
Be sure to try all of this with at least 100 PktLag while in development
Look up PktLag
but at that point I can hire someone to fix it for me π
im just trying to get it all "working"
for now
As long as you're working/testing on a single computer, you need to set PktLag to at least 25 for best-case scenario, 50 for slightly less perfect
That's just to detect really obvious issues
Then you'd use clumsy and real-world test to actually test
oh, my game is approved on steam already, I do most my tests with other players π
i run 500 when testing client side simulations π
Just giving advice here @urban dew , can't know if MP code works unless it's tested with latency
Since like half of all MP is lag compensation of sorts
I know, I really appreciate the advice stranger, you've all been a massive help over the past couple weeks π
have been learning slowly π
picked up unreal massively, multiplayer is still my massive downfall
Quick check and you are doing 2 ServerRPCs in each other again
:D So yeah, your Code will f*ck up at some point
The second RPC is again not needed
And you are again calling an RPC per Planet
Instead of one with an array
But you'll notice eventually
is this correct way for pickup to be collected on server
pickup is in level, so it's not owned by any client
Please refrain from pinging users without any direct reason
I'm working, I'll look into the chat whenever i have time
ok, sorry
I want to assign a team to a player as soon as they join the game, I'm currently doing this in the gamemode, and it does work, however, only sometimes
what would a better way to do this be?
overriding HandleStartingNewPlayer
accessing the PlayerState from the PC ref
and setting the replicated team variable inside the PlayerState
(calling the parent of HandleStartingNewPlayer in the process, ofc)
do I do the overriding in the gamemode?
yes
im not sure if its related to the override, but my HUD class isn't default being on the player anymore?
is that normal
I've been working on a moba style ability system ie: ability cooldown state persists on and after death, other players may glean information about the state of your abilities, etc. This has lead to a lot of trouble cleanly handling cooldowns. To me this says I should decouple the ability from the player character somewhat, maybe holding the current abilities in the playerstate and calling them via the playercontroller? I'd appreciate any thoughts or direction I could get here cause it's a bit tricky π
How'd you go about making an end game screen/level? Like in any multiplayer game, after the game is done. You get the widget stuff telling you how much points you have, maybe showing your rank progression etc. Would I do that in a new level, where I'd server travel over there, so the player/game states survive, and display all the info
Or would I stay in the same level, and just possess some camera thats looking away from the map, and display the widgets there
Or would I perhaps save all the data in a file at the end of the game, client travel to a new map via OpenLevel, read the file and then display the info?
@fossil plover PS is a good option]
it persists even after disconnect, its publicly available, and its owner by the PC so you can still RPC through it
So you'd save the data in a file, use Client travel, then display said data?
probably using the save game object?
quick question, replicated my lean and now my client stutters when walking
what do you mean by zorder its not widget ?
I made the movement but idk why this one does not work
any idea why my client stutters when inputting the mouse?
Hey,
I'm having troubles with replication. Let's say I have two class A (GameState) & B (An actor). They are both replicated to all clients.
On my server side, A will be created first, and then B will be created.
When a client connect to the server, I can't know if my class A will be replicated after or before my class B.
But, in my case I need the class B to be replicated after my class A. Because in my B class constructor I need to get informations about replicated variable of my A class.
Someone knows if ue4 provide us a way to solve this kind of problems pls ?
Sry if I'm not very clear, my english is not very good ^^
btw, in my case the variable I need to be replicate first is the seed of the game.
Pretty sure the GameState is created before actors spawn @idle flame
not on clients
- variables replicated of gamestate are also not replicated before actor are
@idle flame make a copy of the variable in class A, set it on server, and make it replicate only Initially
if you do that in the frame A is spawned, the variable will be there on BeignPlay on clients
@winged badger Thx, but that's not my problem. I know that if I set a variable to replicate in initially in a A class it will be there when spawned for clients.
I want to access a replicated variable in A Class from B Class on client side. But actually, when I try to access the variable of A class from B Class, B class is created first, so it can't access A class to get the variable.
Hi friends, I am saving a list of player states to my GameInstance prior to changing levels, after I change levels though the list of player states has an unexpected amount of entries and the data seems to have been erased, despite being in GameInstance
Anyone know what would cause that?
Simple example:
- Host match in main menu screen -> GameInstance now has 1 entry (the host)
- Start Match, loading into gameplay level
- GameInstance now has 2 (??) entries, both seemingly default
I suspect what I want isn't an easy thing. I'm coming here to verify if that is the situation or not.
I have a projectile, which is replicated, it has a child actor component. Which is not explicitly replicated, but obviously each replicated projectile has one. I want to replicate values on one of those child actor components to the other. I don't fully understand replication so maybe just maybe.. it is easily accomplished??
@plucky horizon can you give a concrete example?
Your question isnt exactly clear, what do you mean by you want to relpicate values on one of those child actor components to the other
So a concrete example of what you are trying to achieve would help
no
its not
Replication means replicating a variable from the server to all the clients
So if you want the values to be the same, why not set them to be the same?
I don't see a good distinction between the server sending the data to all the clients so that they all have the same data.. and "the data is the same"
If your projectile has a variable called speed that is set to 200
aside from that I'll continue writing my example
I'm getting the error ""LogModuleManager: Warning: ModuleManager: Module 'OnlineSubsystemOculus' not found - its StaticallyLinkedModuleInitializers function is null."" when deploying my project to quest, has anyone else run into a similar issue?
I have a projectile which has an actor attached to it. That actor (let's call it B as it's the second class here) spawns things(C objects) when the projectile collides with stuff. I want B to have certain variables set from the client side to multicast to all the other B's which are standins for that B. Then B would use those values in spawning the C's.
Since the B objects aren't replicated, presumably they will be slightly different (so to speak) so I need the non-default values to replicate. Whereas if they were I'd have 1 projectile and 2 B objects on every client. So I need the values to replicate, not necessarily the objects. But again I don't fully understand replication.
I feel that the initial question was A LOT easier to follow and understand than this. But you asked for it.
I'm using the oculus online subsystem plugin and it's in my build.cs file
@kind wave did u enable the plugin from the editor?
If that is still too esoteric.
Projectiles have lasers attached as components. The lasers spawn laser segments on collisions. The laser has properties for setting properties of the segments. I need the lasers to have the same property values cause it will be more performant to replicate data from there opposed to N segments since there will be far less lasers than segments.
@twin juniper yep
@twin juniper actually I don't think you can actually say replication is a server to client activity since NetMulticast is an option. Server Client is just the defacto paradigm
works both ways
well clients send to server, server sends to other clients
client doesnt technically replicate per say replication is the from server to all other clients
client just tells the server what he is doing, server handles replicating it to all other clients
Mmm I would expect that from an architectural stand point
Is there a way to migrate host in listen server
like the current host leaves and stuff
no
not built in
i think a few people here have done it though
it's not clean
so there's no plugin or any tutorial available for it?
damn that sucks
Yes lack of any kind of host migration for listen servers is a big problem. If someone could figure out a solution for this I reckon they could make a killing on the Marketplace
Do you need a server to hold the data between migrations?
This apparently got fixed but I'm still having issues with it in .22.1, the net.ShareShadowState still fixes it though
@worthy perch yeah that and don't want game getting interrupted when it switches the host of server.
Maybe @thin stratus can create it
Even restoring to a previous check point would be better than nothing
Hey,
I'm having troubles with replication. Let's say I have two class A (GameState) & B (An actor). They are both replicated to all clients.
On my server side, A will be created first, and then B will be created.
When a client connect to the server, I can't know if my class A will be replicated after or before my class B.
But, in my case I need the class B to be replicated after my class A. Because in my B class constructor I need to get informations about replicated variable of my A class. The problem is that on client B is created before A.
Someone knows if ue4 provide us a way to solve this kind of problems pls ?
Sry if I'm not very clear, my english is not very good ^^
btw, in my case the variable I need to be replicate first is the seed of the game.
i already told you the only reliable solution to this
you can alter NetPriority
but
if a packet gets lost, your game breaks
@winged badger y I saw but I also answer you ^^ Ah ok didnt understood that the first time
the alternative is clumsier
A checking if B is there client side and B checking if A is there
then when both are around, start whatever logic depends on it
That's exactly what I was doing in the tick function of both class
I was checking is the other class was replicated and if so I was doind my logic
@winged badger But do you think it's good to put logic like that in the tick function ?
its not
but
when you spawn A and B
if the same object spawns both, it can reference both A and B at that time
which means it can copy B's variable in A or the other way around
and as long as that variable (your seed) is replicated it will be available by the time A or B call BeginPlay client side
and that approach can't break
if your concern is replicating the same variable twice, it doesn't really matter, seed would be one integer, so 4 bytes per client once per game
you could also have replicated a pointer to the GS in your B, with an OnRep function
which means it can copy B's variable in A or the other way around
and as long as that variable (your seed) is replicated it will be available by the time A or B call BeginPlay client side
and that approach can't break ```
That's exatly what I was looking for THX !
So I was fiddling around, and I noticed that somehow, the server was only updating client's character position (and I suppose rotation) once every two frames. Does someone know why it is so ?
To illustrate my point, here is the Z position of a Client's controlled character falling being printed every frame:
@pliant hollow - not sure how you think its failing being printed every frame - as i see a steady stream of Server->Client the whole way there.... but I will say that it is 100% common for hte server to be desynced with local client as far as transforms go. This is nothing abnormal in any of my experiences
@pliant hollow Replication rate varies
It can actually never be updated for three seconds when the connection drops a bit
Large part of why multiplayer is so hard
hi all any one try to setup unreal server on google cloud compute?
I have set the firewall rule to all port and run the server on cloud shell, but still cant connect through internet
definitely sounds like a firewall/port issue - have you tried a TELNET from your PC to see if the port IS open?
connect fail , but I already created the rule in firewall
again - did you telnet to ensure the port @ destined IP IS ACTUALLY open?
whats your IP/PORT?
for this server
I trying to restart the instance, it can connect on port 80
but cant connect to 7777
I guess I was surprised by the lack of prediction for the character (using the velocity to keep updating), though I vaguely remember reading about that.
What I fail to understand however is why in the absolute best condition (testing with server and client on the same computer), location replication only occurs every two frames.
It's replication, it's never going to run at 60fps
@idle flame I have a body part system, that requires all body parts to be replicated before doing final calculations, so:
PlayerController : Create CharReady_REF variable
CharReady_REF_ON_REP : Tell customization menu to spawn character
BodyPartCompSystem : Create BodyParts_REF variable
BodyPart Begin Play : Add self to BodyPartCompSystem.BodyParts_REF
BodyPart Begin Play : Start CheckBodyPart_REF timer
(on client) CheckBodyPart_REF func : Loop through BodyParts_REF -> IF ALL VALID -> Set CharReady_REF in PC, which call the ON_REP function which starts the "spawning" of my "full" character
(When you spawn an actor on the server, the client in my case, will know about it, before actually getting the whole actor, which caused me pain, because I would have a reference to an actor I could not access)
For you:
PC: Create A_REF Variable
B: BeginPlay start a timer
Timer : Check if PC->A_REF is valid
If valid -> Continue initialization
A: Set PC->A_REF = self
@pliant hollow One thing I recently because aware of
Clients "Forwards momentum prediction"
Server "Interpolates between two updates"
Hence Clients will always be guessing
While server will always be "late"
Yeah, your answer made me realize that the server is probably receiving multiple packages for movements for a single character in the same frame and just playing them back to back, which makes sense and explains what I'm looking at
There is functionality for "merging" multiple updates in a single tick if I recall correctly
(character movement I think)
I hadn't realize it was a possibility, but now that I know about it, it explains some of the strange things I've been experiencing with overriding this part of charactermovement for advanced movements
Thanks, I'll take a look
@pliant hollow
bEnableServerDualMoveScopedMovementUpdates
bEnableScopedMovementUpdates
Has anyone found a workaround for the steam session not showing the right number of players when player hosted?
hey, i've got a question
i've got a rotator that i'm replicating, it replicates fine
but when setting it
//Replicate Look Rotation
if (Role == ROLE_Authority)
{
SelectFloat();
ServerSetViewRotation();
ViewRotation.Roll = SelectFloatReturn / 3.0f;
}
else
{
SelectFloat();
ServerSetViewRotation();
/* ViewRotation.Roll = SelectFloatReturn / 3.0f;*/
}```
Having an issue in multiplayer, 2nd client freezes and crashes on map start
it doesnt happen in editor testing
best way to debug it?
client freezes and wont even alt f4
Hello here! I have been looking for guides/tutorials to set up a LAN party game system from scratch in UE4 but didn't find any good resources so far. Does somebody have some advice on that? Thank you π
I know a udemy class that goes through just that, plus many other very useful multiplayer aspects + intro into working with steam, if ur willing to muster up 12 bucks or something like that for it
Ah, I'll dig into Udemy then π Thank you
...Well, if you have one I wouldn't say no XD
Mostly BP
Damn I lied, theyo nly have it in c++
Eeeek :p
I have
Well, I'm no programmer but can give a try
link?
Yeah I prefer the step by step hand-holding of tutorials, but if reverse-engineering is the only option I'll take it :p
A lot of multiplayer stuff is figure out on ur own thing
not a lot of coverage
what do you think this is? the unity community?
rofl π
I just wanna make a spectator camera option for a second computer π
so can send u the file directly
Sure π
Uploading the file as we speak, will pm it you
XD
π
Comforting.
thank you
Will this make me drop all my loot on the map?
will make you drop your pants
Indie devs have no pants.
check ur pms
searching someone for replication bp (i will pay)
@tribal shell Use #looking-for-talent if you are trying to Hire someone.
Instructions on how to use it can be found in the #more-resources channel.
I've done more testing, this is what the 2nd player looks like
their game just freezes and crashes
it only happens when I have an event handle start new player
anyone know why event handle start new player is causing this?
Can we see some code in said function?
How do I set the Online Subsystem?
I feel like my line trace should hit that firestop volume
return a valid actor
and not generate flame
but it keeps generating flame. There is a switch has authority in front of the line trace
think I got it
@plush granite you do that in the DefaultEngine.ini file
@twin juniper Dude Ive tried everything to get it to not load the native OSS on iOS
How do I do that??
plugins manager?
wow thanks
anyone know why i'd get this for my client(s) and not host
when excecuting this server travel command
or where/what do i click into to investigate?
Your accessing a index outside of the bounds of an Array.
This will typically only happen with C++ code, as the BPVM will catch that type of exception.
@twin juniper If a variable might be null or empty, always check first
that goes for arrays too
if(array.Num() > 0) use array
also I dont think server can grab player controller at index 0 in multiplayer games
pretty sure you should be casting to the player's controller and running the travel command in there from the server
or rather maybe first cast to gamemode from the overlap authority, and then the gamemode casts to the player controller and runs the travel command there?
this was working in 4.20 i haven't checked it in a while. Idk what i could've done to break it because I haven't touched it. Possibly some variable elsewhere in the character bp is trying to carry over and failing idek. Half of what you two said makes sense i'm noobie thanks. @fossil spoke @twin juniper is \containers/array.h somewhere I can click into to read what it's complaining about where is line:611 is it a line of code somewhere I'm BP
How big is your code?
If its not too much, Im sure its not hard to figure out where you are using arrays
And from 4.20 to 4.22, some engine stuff changes
You might be using something deprecated
@twin juniper
@fossil spoke how long does it have to be before I repost my question?
If its still on the page wait until its buried behind the Load Messages thing
His question is fairly buried to be honest π
it wont work if you're trying to access player controller at index 0
im confused on if i can share it or not :now :3
ill wait another hour
but god dam it im so fucked rn, no idea what is wrong
@twin juniper try it with the method I outlined. If you get the same crash, then it's a crash caused from another part of the game
relevant ?
With the overlap you can get the overlapping actor/character, cast to its controller from there, send the controller to the gamemode, gamemode calls the teleport function from the player controller
Thats how I do it
im so confused
can I do this from the gamemode or not?
because it works in editor
but not in a built client
maybe the rts controller hasnt actually spawned yet?
I would do that on the onpostogin because yeah maybe it hasnt spawned yet
Wouldnt*
Yeah add a small delay see if the crash stops
But you probably shouldnt be doing that particular function from the onpostlogin
I am trying to find out how I can authenticate players, right now in development I use device I'd,
Hello guys. I am trying to understand the whole sessions system right now and right now my goal is to be able to have a UI where you can host a Session and then have another computer find that Session after it is made, and then join it, putting them in the same level. So I notice most people do this using the steam online subsystem with a listening server, but for me I want to use a dedicated server with the null subsystem. So my question is, is this possible to do it this way rather then doin it with the steam online subsystem with listening server?
@urban dew that is not a BlueprintImplementableEvent, that is a BlueprintNativeEvent
HandleStartingNewPlayer
which means there is a default implementation in c++
and unless you feel like doing the whole thing by hand in BP you have to call parent function
@potent prairie server can always get something with GetPlayerController[0]
what depends on the type of server really, but it is better to avoid that function unless you understand exactly what it does
and once you do, you don't really need it, so there is that
Yeah I know I just think its easier to tell people not to use it at all for multiplayer games. As you said you dont really need it
its confusing enough to most without someone saying also I dont think server can grab player controller at index 0 in multiplayer games though π
two most common mistakes are: using it on dedicated server, and assuming that it will have the same return on server and client if connected to an RPC
Im used to working with ded servers thats why i said that but youre right
Hi guys. How would I go about DisableInput() on a dedicated server? calling it on client or server doesnt work either way for me
Oh, I think I got it. I failed ofc.
Anyone have issues with steam subsystem suddenly not working?
I'd appreciate any ideas
Guys does the "open [ipAddress]" console command require a session to be made? Like will I not be able to join a server using that console command if I don't create an official session using the create session node?
this only happens on my client
FPS is fine
what could be the issue?
(time dilation .25)
LogModuleManager: Warning: ModuleManager: Module 'OnlineSubsystemIOS' not found - its StaticallyLinkedModuleInitializers function is null.
I get this warning on my iOS device. This is because I unchecked enabled from the plugins manager.
I'd like to keep the "Online SubSystem iOS" plugin enabled and just have it NOT load instead, anyone know how I can do this?
im getting an issue with "event handle starting new player" the 2nd person to join the servers game freezes and crashes
does anyone have any idea how to fix, i have no idea what is causing it
the host works fine
(only host works, all other players freeze)
Hello I'm trying to activate the steam Invite UI when a button is pressed and I tried using "show invite UI" from advanced sessions but nothing happens. I'm running the game as standalone and I'm connected to steam.
@urban dew i told you what you need to do... twice
you told me about onpostlogin, im using starting new player now
it seems to work better except the freeze
im not sure what you mean by calling the parent function?
right click the node, add call to parent
and no, i didn't tell you about PostLogin
without it, this piece of code doesn't run
void AGameMode::HandleStartingNewPlayer_Implementation(APlayerController* NewPlayer)
{
// If players should start as spectators, leave them in the spectator state
if (!bStartPlayersAsSpectators && !MustSpectate(NewPlayer))
{
// If match is in progress, start the player
if (IsMatchInProgress() && PlayerCanRestart(NewPlayer))
{
RestartPlayer(NewPlayer);
}
// Check to see if we should start right away, avoids a one frame lag in single player games
else if (GetMatchState() == MatchState::WaitingToStart)
{
// Check to see if we should start the match
if (ReadyToStartMatch())
{
StartMatch();
}
}
}
}
Being a beginner with UE4 multiplayer: Epics online game service will support Player data storage ( https://trello.com/b/ZR7VrLb3/epic-online-services-roadmap ). This leads me to the question: Do you know, if it is feasable to use the object reference feature of Unreals save system for storing persistent player data on a server (e.g. with GameInstance as root) - i.e. storing UE4 save files directly in the player data storage? I'd like to avoid a manual conversion of object references -> text data (e.g. database) when saving and text data -> construct objects when loading since UE4 save system does this already very well (I've used it only locally so far).
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.
@winged badger would I add it like you did? or add it at the end of all my blueprint?
doesn't matter in this case
unless
you want to reference the Pawn via Controller, then it would be better to run the parent first
@winged badger You are an incredible human being, If I wasn't already married I would profess my love to you now
thank you so much!
That is the most vague and broad question ever asking in the history of his discord
First, you see how many players are wanting to join, when enough players, you make them join a server together.