#multiplayer
1 messages · Page 477 of 1
there needs to be some check from the server, always
So the Client says when and where to drive and where they are
the Server accepts it (which should already happen in the Vehicle Movement Comp)
And sends it the simulated clients
And then you just need to make sure that the Movement of the Vehicle is not marked as replicated
cause otherwise it will be overridden by the server again
which you don't want
Not sure if that all stays in sync though, cause as said, physics aren't deterministic
Might be that the Car on the Server drives agains a stone and flips and the one on the client doesn't
and then the Client will correct the Server next frame :P could look a bit laggy sometimes
in short for a client authorative approach ~ always trust but verify
If you really don't care about cheating then don't verify but at least make sure you know how you could verify if neede
Also, eXi, your explanation could be pinned, it was great
I would like to verify, I might not care too much at the moment but still want to prevent it if possible
and who is to say they won't develop an E-league for my awesome game!
Thank you for all the help and advice guys
I am looking into setting this up
Would rather write a blog entry one day
And maybe even support that with proper code example :P
Oh btw, you have the Run Dedicated Server ticked under play settings in PIE right @limber mortar
@thin stratus or update the compendium with stuff like this
Also, one little thing: my game doesn't work in PIE like it does my dedicated server
That is usually not normal. There are a few things where I would say that it could show differences and it's good to test packaged builds, but if you do everything correctly, it should work in PIE and packaged.
Thanks for that
You never know why it's fixed between PIE and package build, you could just be lucky that it doesn't occure
that has always bugged me
I don't think the compendium is appropiate for that kind of information. But still, if you do plan on doing that you would be the internet hero, since there is almost no code examples on movement replication aside a couple experiments.
You I know. I've been through replicating HoverMovement
It does work like PIE and on the server
Wasn't funny
Sadly my only reference is the CMC and that is not really the best resource
Would need to figure out a better system first
Well if you strip out all the bs from the cmc it does the basics
But maybe it's enough to just break down the CMC into all the replication parts (and cut away the Root Motion stuff no one needs)
we said the same thing, yeah
hehe
the thing is pie/dedi server is that if you are simulating multiple clients on PIE, they are instant and on the same machine, and errors in replication are still there but you might not notice them due to how fast everything gets checked and reset by the server, at least that is my experiance with it
Too fast connection can actually cause weird stuff
oh that makes a lot of sense
I had people connect so fast that BeginPlay hasn't called yet
So I had to force it in PIE
But that's really rare and even then it shouldn't cause many issues
single process on?
Think so
Hah, I had that begin play thing as well
turn it off and try again, also be careful with HR
Not really caring about that as we usually just make it work in PIE to a point where the logic works and then push out a test build anyway
well where I work at we are having 2 bugs we can't replicate in the engine at all
Which are?
they are related to attachments and cmc being dormant on unpossess
it's long and weird
If I get permission by my studio I'll post it in lounge, it's quite hilarious
Sounds annoying. Idk what is more annoying, not being able to reproduce a bug
^
Or finding it on the issues page as "unresolved"
why not both
I have one that is not fixed yet I think. lemme quickly check before I go to bed
LOVELY
MOVED TO 4.24
(╯°□°)╯︵ ┻━┻
I am still on broken 4.15 unreal tournament replication, and its a nightmare when I cant reproduce what I see in the replay system AT all in the editor
UT has so many coding errors
And I love when issues are fixed after 4.15
They literally try to cast the GameState to a GameMode at some point
and I just shrug
Ik, my fav thing is where GameMode sometimes slips up and actually succesefully casts to a client
o__O
hahahahah
Guess these controllers don't need restarting
They also have a bug in their Respawn Countdown.
It's a repNotify that is constantly set to the same value
Gotta hand one thing to Epic for UT tho, they have a veery cool and neat UTLocalMsg system
The first time it shows "You can respawn in x seconds"
The ongoing times it says "Press fire to respawn" even though you need to wait
I've been through my fair share of UT bugs xD
ULocalMessage is a UDK thing Tapa, it's been there for a long time
anyway, g2g to bed!
from GM you can broadcast messages, which would display text, but they also have On Client PC recieve fuction which fires on the client and you can
I could spend the night speaking, but people need to go to sleep hehe
ah nvm then
good night!
well, I was the supporting helper here, but thanks ;p
You gave me useful information
and I believe that test with the physics being applied while not in possession of the pawn helped eliminate some potential causes too and it was not a test I had run yet
Yeah that stuff can tell you if your issue is due to user input or the actor setup to begin with
Great logic to follow
I'm having issues with an anim notify not consistently firing on the server. The animation is correctly played on all clients/server. What could cause this?
Is said anim notify exactly near the end of the animation?
There are many, but the specific ones I care about are near the middle
when does this occur, when playing in PIE as only dedicated clients
or when your server has a viewport
It doesn't happen to the owning client (when no dedicated server), but other clients will experience the issue
When running as a dedicated server, it occurs for everyone
Sometimes it does fire though
Hmm, it may actually be firing correctly, but the debugger may be messed up
I may actually have a casting issue
No, it's not a casting issue. 😦
Let me get a video of what I'm seeing
All 4 anim notifies should get played (but what I care about it Weapon Collision and End Collision)
Now I'll get a video of local listening server
I'm trying to pull some info off of UNetConnection to do a bit of optimization. I'm basically using the APlayerController::GetNetConnection() function and from there:
if (PC)
{
UNetConnection* NetConn = PC->GetNetConnection();
if (NetConn)
{
InBytes = NetConn->InBytes;
InBytesPerSecond = NetConn->InBytesPerSecond;
OutBytes = NetConn->OutBytes;
OutBytesPerSecond = NetConn->OutBytesPerSecond;
InTotalPackets = NetConn->InTotalPackets;
InTotalPacketsLost = NetConn->InTotalPacketsLost;
RemoteSaturation = NetConn->RemoteSaturation;
StatPeriod = NetConn->StatPeriod;
return true;
}
else
{
return false;
}
}```
This works on connected clients, but not on the server. Does UNetConnection only exist on the client?
Here it is without dedicated server on the listening server
Here is a picture of the animation being played (it's part of a montage with 3 total attacks)
@twilit swift , are you calling that from the player state?
Or gamestate
I'm actually calling it from GameInstance.
Then I believe it makes sense that it is returning null, since that is the servers copy of your player controller
Hmm... ok. So, is there a UNetConnection for the server?
That would depend if that player controller is owned by a listening client
If you're just trying to access that information, you could just do an RPC with that data to the server
But maybe I'm not fully understanding what you're trying to achieve
I'm trying to get these stats during runtime in a shipping build. I want to see the stats on each client as well as on the server and see what's causing bad spikes in network traffic, etc.
@flint rose put some print strings on those events, as pawn owner might fail on non authoritive clients
eg owning
https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/APlayerController/NetConnection/index.html
It seems according to this link, there's no NetConnection for the player controller associated with the server. Am I wrong here? Is there another player controller I should be accessing to get to the data for the server?
The net connection this controller is communicating on, nullptr for local players on server
And yeah, the active oringe blueprint wires
dont always show the correct thing
so always have print strings and breakpoints
I'm still seeing inconsistency within the debug messages
@twilit swift , I think your best bet with my limited knowledge would be to send a reliable message to the server with this data
You could easily set them as variables on the player controller and make them replicated
And the server could get access to them directly from the player controller
My concern there is that if they're replicated variables then the stats would be the same for all clients and the server. It seems to me that there should be more data moving through the server than a connected client. Maybe I'm confused.
the inconsistencies are wierd. But in your case actually debuging with draw debug spheres on the location of the blade would be the most helpful thing
I don't want to code something to pass the data along and then find out that there's actually a TON more data moving through the server than I'm printing out.
A Debug sphere?
The weapon should have little to do with the anim notifies firing.
The animation is played on the character mesh
no yeah, I am just pointing out a useful debug thing
Ah.
Have you looked at the conditions of the anim notify blend spaces
This is within a montage, not a blend space
Is there something similar for montages?
so you are startign the montage from the char bp?
From C++ in the Character class
and that stuff is replicated right
The server is then sent a message to multicast
The animation
It's important that the server plays the animation due to the root motion
Else the character would constantly be getting thrown back to it's original location
@flint rose Should animations always play on server, or just multicast if they don't involve root motion?
ok are you using repnotify toplay the montage
@glad sedge , if you ahve root motion, you should play on the server. If not, I wouldn't play it on the server to save CPU
Cool.
I'm doing something like this: animInstance->Montage_Play(MontageToPlay, 1.f, EMontagePlayReturnType::MontageLength, 0, true);
So to recap, visually everythingworks, the rep notifes always fire but inconsitently(timings)
or som rep notifies dont fire
try doing them in the montage
Previously they were in the montage because I wanted to see if it would make a difference
ah
and have you tried putting these animations inside the anim BP
and relying on a blend
I don't think it would work with the root motion unfortunately
how so
How do I enable root motion on a blend?
Server root motion should only be donee through montages
tough cookie
Yep
I could send messages from the client to the server to enable/disable weapon collision. But that's a bad idea
And latency could be hard to deal with
I could also use timers
u tested with ping?
I don't see issues with anything under 200ms
cool stuff
I havent worked with animations in a loong time
but cant you access the root motion settings of the mesh from the character?
Root motion settings exist in the animations themselves
But you need to tell the character to ignore its movement controller while it is happening
Perhaps #animation would know more
last thing I can suggest it to try to play the montage trough the Anim BP
The AnimInstance is the BP
Ah, I thought you are playing it from the character pawn
void AComboCombatActionCharacter::PlayMontageInMesh(UAnimMontage* MontageToPlay) {
UAnimInstance* animInstance = GetMesh()->GetAnimInstance();
TextColor = FColor::Green;
animInstance->Montage_Play(MontageToPlay, 1.f, EMontagePlayReturnType::MontageLength, 0, true);
}
I see, ok then as a hail mary, try creating a boolean on the pawn, which is rep notify
in the rep notify play the montage
But otherwise I am out of ideas man...
Yeah. Me too. 😦
The montage is definitely playing
Just not all 4 notifies are firing on server
I'll get at least 1 every time
I'm only using 1 slot
Maybe it's just a bug within UE
Thank you for all the time brainstorming with me. I appreciate it
anytime
Hmm, I guess I could allow the client to say, "hey, I hit this character", and then validate it on the server. But of course, this can add to issues with latency
I mean yeah, there are many ways to fix the issue with external stuff, but you want to get the notifies to work...
Ultimately my goal is to just make the other player take damage
In a perfect as possible way
In my game, you can block and attack other players so making it as precise as possible is important
So I guess that idea would work. If they have high ping, it's going to suck regardless
Is there a solution out of the box that would allow direct remote connections to a server on my localmachine that doesn't allow the remote clients access to this computer's IP address?
A proxy or something similar
Or would any solution that involves content being served from the local machine necessarily open it to bad actors?
i am absolute trash at multiplayer
question, is there anything wrong with spawning and possessing players through the game instance????
i think my game might be at the point of no return. ive pulled apart the player spawning system so much that idk whats what lol
whats your reasoning behind doing so
normally I wouldnt touch my game instance for anything other than simple data saves n such, but that is just me
well the instance is on the clients side right?. spawn a player and possess it through the client
what drives you to do the spawning yourself
typically when a play joins, GM is called, a player controller is assigned and then a pawn is spawned and possessed at a player start
well, i am attempting to create a player class selector
I see
I did an 8 week prototype for an esports mp game
the way I handled it there
was that my default pawn class was dummy pawn with a camera and no controls
I spawn that and set view target to my player class selector
player chooses its class locally, and the server ( i think it was GM) spawned it and possesed it
so I was actually using spawned actors in the level
and GM
Do your thing in GM and game state
well i did at one point manage to get players spawning in my level fine, but ive pulled that apart XD
can u explain the gamestate???
Game State is where you store your logic
ive tried to use it but really cant figure that one out
which you want the PLAYER to have access to
can u cast to the gamemode from the state?
GameMode is your MOTHERSHIP, it has all the rules and figures stuff out and tells GameState what/how when to do(if it concerns the players)
yes you can
hmm ok
but because GameMode only exists on the server
GameState cast to GameMode will only succeed on the Authoritve version
meaning the server version of the game sate
ok yeah
thats when replication comes into play
lol, replication and physics is a pain, just saying
you can replicate events, so that if GM tells GS something, then GS can say, hey, server version of ME has that info, now Ill share it with the rest of the clients (multicast)
yeah, tell me about it, somehow I always end up making multiplayer games with physics...
lol
just one last thing
if i was able to spawn the player through the game mode, how will i be able to tell the server that "This client" is the possessor of that player character? because ive tried using the player Index and man i cant figure it out
thats why you actually do it from the client and UP
at least I do it that way
because I am lazy to sort indexes and stuff
so scroll up to what I explained at first
because remember
every client
has player starte
player controller
and pawn
both on the client
and on the server
and since the server is the owner
you as the client acan request stuff to be done on the server version of you
so from you as a pawn or you as a PC (the client) you can say, hey run this event on my server version, from which I can get game state and run the custom event wihch will sucessefully assign me e a new pawn
and you are passing your player controller reference along the way
that make sense?
enjoy ya sleep
ok i did it but i also didnt??? its successfully spawning and possessing apparently but nothing is happening to the client
has anyone made a game with a character selector before??? if you are you able to show me how you had done it??? im still stuck on this on
So what is the first thing I need to worry about if the game functions perfectly correct in multiplayer mode while in standalone on the editor but has all kinds of problems when I make a dev build.
Well, look at the problems one by one
And make sure to configure your game with PktLag set to like 50, so that the editor behaves somewhat like a real game
Bad netcode might work perfectly fine in editor
Google pktlag, you'll find a full article
It seems like the issue is because sometimes it takes longer for the player state to actually exist before I set the variables in the player state
I feel like maybe I need to do a function where I absolutely make sure everything exists before I allow the player to properly load
Question regarding replication of Velocity in UE4
I inherited the custom movement component class and overidden calc velocity and phys falling to do some custom acceleration and velocity modifications. I was wonder if there is a way to properly replicate the velocity modifications without having to clip input from changing the max speed value?
I figured I could just modify the velocity in the class and it should replicate but its not the case.
@velvet parcel UE4 has these functions in C++ usually.
PlayerState exists on PlayerController and Pawn.
Both classes have an OnRep for the Client, which calls if the PlayerState is available (can also call when it's destroyed).
Which is the place you would access the PlayerState on the Client if needed.
For the Server you can use InitPlayerState on the PlayerController
As well as I guess Possessed on the Pawn
BeginPlay on Pawn is 100% too early and on PlayerController I would say it can be too early if you are unlucky, don't know the timing there.
@fluid prawn Velocity isn't replicated.
Client performs a Move, ends up with new Location (and thus new Velocity). Client tells Server to perform the same Move, passing the new location with it.
Server performs move, ends up with new Location (and this new Velocity). Server compares Location with the one the Client send and sends a correction if needed.
CalcVelocity is called on Server, owning Client and I'm pretty sure also on the Simulated Clients.
So if you modify Velocity there, it should be okay.
And now a question from my side: Anyone done some good, reliable weapon spread?
Currently have a Replicated Random Seed that gets set when the Weapon is spawned and I haven't done much thinking about utilizing it yet.
Right now it's just used to pull some random values for the Spread when FireTransform is requested. However if Client/Server/Simulated don't shoot the exact same amount of times, the Spread will go async I assume.
Any better solution?
@thin stratus I replicate a Random Integer, which OnRep uses to seed the next random stream value.
The Integer is set by the Server after a shot is fired, to seed the next shot.
Right, but the what about client Prediction then?
The Client can't wait on the Server for that
Right now I have:
- Client Presses Fire
-> Client fires (FX only) - Client tells Server to fire
-> Server fires (Damage & FX on ListenServer) - BurstInt replicates
-> Simulated Clients fire (FX only)
And the three -> have to produce the same spread. Simulated isn't THAT important, but at least the LocalClient and the Server have to do the same
And I'm a bit against having the Client tell the Server what Spread to use
Let me double check, im pretty sure it was for Spread, might not have been.
The whole idea of having the shot not go exactly where you aim but randomly offset is called WeaponSpread or?
Not that there is a more often used term that I forgot
Ah sorry not for spread, using it for a random projectile movement related thing.
In my case it doesnt need to be predicted as it already has the value before another needs to be calculated.
Yeah but its not for shooting. Its for rebounds of projectiles. The previous rebound calculates the new value for the next one.
Is there anyone around who has worked with xbox live and UE4 that could DM me to discuss an issue i'm having?
@thin stratus regarding weapon spread, can you not have the server seed rand and give that seed out to everyone? then everyone will (or should) see the same spread? Might want to seed it every so often to account for packet loss etc and people getting out of sync but that should work?
that way if the spread is calculated using rand then if clients and host all have the same seed per player per weapon per time frame (or something) then it should be the same across all with only the server dictating it?
That's what I'm doing minus the refreshing of the seed
But I feel like this isn't the best solution
A lot of peeps write that Random Spread is pretty much shit for skill-based games
Which I can guess is true, I would much rather have a predictable spread like a weapon in CS
yeah, a lot of games have a set spread rate/direction
I would love to see an implementation of that though ;-;
Does ShooterGame have that?
i don't think so
(╯°□°)╯︵ ┻━┻
What does UT do?
been a long time since i played UT
Not sure what UT does. They have like WeaponStates for Burst fire
That's where I find spread values
Will look into the fire functions now of the weapons
doing a system like counter strike though, would it not just be a pitch & yaw increment per shot?
with some kind of timeline or curve to help control how much?
like longer you are shooting for the harder it is to keep the gun steady so the more recoil it has? might be a nice touch
Idk, Spread is the only term that comes to mind
Aim at point. Press fire. Shot goes a little bit next to it due to spread
Or Weapon Spray?
.>
Use a lookup maybe?
Create some sort of tool to build the lookup
Cycle through the lookup
you could use lissajous curves
In this Coding Challenge, I visualize a "Lissajous Curve Table" with Processing (Java). 🔗http://thecodingtrain.com/CodingChallenges/116-lissajous.html 🎥 Liss...
as a way of calculating an offset
might be a bit extreme
a much simpler method would be a (very small) pitch/yaw offset to rotate the shot by every shot so when you fire the actual line trace is rotated slightly
and have a counter that's replicated to keep things in check
FRotator AUTWeapon::GetAdjustedAim_Implementation(FVector StartFireLoc)
{
FRotator BaseAim = GetBaseFireRotation();
GuessPlayerTarget(StartFireLoc, BaseAim.Vector());
if (Spread.IsValidIndex(CurrentFireMode) && Spread[CurrentFireMode] > 0.0f)
{
// add in any spread
FRotationMatrix Mat(BaseAim);
FVector X, Y, Z;
Mat.GetScaledAxes(X, Y, Z);
NetSynchRandomSeed();
float RandY = 0.5f * (FMath::FRand() + FMath::FRand() - 1.f);
float RandZ = FMath::Sqrt(0.25f - FMath::Square(RandY)) * (FMath::FRand() + FMath::FRand() - 1.f);
return (X + RandY * Spread[CurrentFireMode] * Y + FMath::Clamp(RandZ * VerticalSpreadScaling, -1.f*MaxVerticalSpread, MaxVerticalSpread) * Spread[CurrentFireMode] * Z).Rotation();
}
else
{
return BaseAim;
}
}
That's what UT does
Now the guesswork is what is NetSyncRandomSeed
void AUTWeapon::NetSynchRandomSeed()
{
AUTPlayerController* OwningPlayer = UTOwner ? Cast<AUTPlayerController>(UTOwner->GetController()) : NULL;
if (OwningPlayer && UTOwner)
{
FMath::RandInit(10000.f*UTOwner->GetCurrentSynchTime(bNetDelayedShot));
}
}
It's not even setting anything?
@thin stratus i kinda did spread based on a predictable randomness value and a seeded stream
It should technically be in a way that if you are standing still and you are shooting at a wall it sohuld always produce the exact same pattern
But still random sort of
The pattern shouldn't be a curved line for example
Like the AK47 in CS slowly spreads upwards and then to the top right and at max it goes pretty wild between above left&right of the actual crosshair
And having that synced between Server and at least Local Client. Sigh, can this be less annoying xD
issue with randomness, is well randomness
CS is recoil that you're thinking of though?
that's the recoil pattern of the AK?
i think?
been a long time since i played CS
Recoil is the gun moving and actively offsetting the crosshair
The spread happens even if you hold the weapon steady
Ah RandInit in the UT call sets it to be used by all rand functions
Good to know
you can try to cheat by syncing a random seed for that
yeah but still the pattern would be random just synched to the server
if you want predictable recoil
you cant really use random
I do have a random seed replicated atm, but that adds too much randomness, as the weapon being fired again after stopping should produce the same spread.
I would need to reset the stream i guess
{
AIrisPlayerPawn* OwnerActor = Weapon->GetPawnOwner();
bool bIsAiming = IsAiming();
float StanceScale = 1.0f;
float SpeedSpread = 0.0f;
float RotationSpread = 0.0f;
float StanceScale = 1.0f;
float SpreadScale = bUseSpreadMultiplier ? SpreadMultiplier : 1.f;
bool bInAir = OwnerActor->GetCharacterMovement()->IsFalling();
if (bInAir)
{
StanceScale = SpreadParams.Spread_Jump_M;
}
else if (OwnerActor->GetCharacterMovement()->IsCrouching())
{
StanceScale = SpreadParams.Spread_Crouch_M;
}
if (bInAir)
{
SpeedSpread = FMath::Abs<float>(OwnerActor->GetVelocity().Z) * SpreadParams.Speed_M;
}
else
{
const float Speed = bIsAiming ? SpreadParams.SpeedAiming : SpreadParams.Speed_M;
float PlayerSpeed = OwnerActor->GetVelocity().Size();
SpeedSpread = PlayerSpeed * Speed;
}
StanceScale *= bIsAiming ? SpreadParams.Spread_Aiming_M : 1.0f;
return (SpeedSpread + RotationSpread + Spread) * StanceScale * StanceScale * SpreadScale;
}```
i did something kinda like this
which gives a predictable spread
yeah, any desyncs due to packet loss would be permanent
if you don't reset the stream
ut4 synchs the key via the movement component
Yeah they do lots of funky shizzle
So if I have a Repl or at least synced random seed for the weapon
i personally wouild seed a stream
Let's say I use 1000 for the weapon at all times, cause I kind want the spread to be teh same
I could, every time the weapon starts firing, reset the stream
And just hope it doesn't desync until the weapon stops
as long as server/client both reset the stream
Yeah that anyway
I was more worried about it desyncing over time
But if the spread resets every time you restart the fire logic
I mean if it desyncs in the time of firing 50 bullets without stopping
So pulling 50 random values in one go
Then I#m unlucky I guess
i tested with 100 bullets and resynching the seed everytime a shot is fired (as its done local and no rpc's involved apart from movement component ones)
and it was consistent even with pkt lag and loss
Right, then the only last thing to solve is having this work with the simulated clients. Guess I just want to replicate the start and stop fire event
And then let the Simulated client go crazy all by themselves
FMath::RandInit( this is like the std equivalent srand null init
Yeah it's a global init
So they don't have to pass the seed into it the whole time. I actually use a RandomStream though
Seed -> RandomStream -> Rand(RandomStream)
same
Thanks for the input y'all!
UPROPERTY(ReplicatedUsing = OnRep_ReplicatedTransform) is their an equivalent in BP
just onrep variables, now BP's onrep are limited
since you can't have the old value as a parameter
but they do get called on the server aswell
I used Rep Notify FTransform would that be equivalent
yes but with the implications I said
I feel like they should just pass the old value by default for BPs
I actually use a RandomStream though Seed -> RandomStream -> Rand(RandomStream)
I don't really know how a randomstream serializes so can't tell benefits of that aside having the seed by hand
Freaking limitations
oh yeah. Totally, you can't do some stuff in BP's because of that
A RandomStream is basically just a disconnected stream of random values
You can have multiple ones
Instead of applying the seed to the whole FRand
oh okay so it's more like a design decision rather than a performance one
all clear, hehe
Yeah I can reset the RandomSeed without resetting other random values that should stay totally random
I kinda like that more than RandInit
indeed, I've used both but I thought we were speaking about performance
either way sometimes is fun looking at how data serializes
how can i set dedicated port on gameLift?
im initializing gamelift sdk like this with specific port
if (GetWorld() != nullptr && GetWorld()->IsServer())
{
params->port = GetWorld()->URL.Port;
}
else
{
params->port = 7777;
}
but how i see from logs on machine, dedicated server is running on 7777
still
any hint here?
When are you setting it?
If you set it to early before the NetDriver has rolled the port over it wont work.
in constructo of specific gameMode
You can't set it after the game instance has started up
It has to be done via command line.
Assuming you're using Steam, look at FOnlineSubsystemSteam::InitSteamworksServer()
If you want to tell the process what port to use sure. But for use with GameLift your processes should start at port 7777 and then they will be rolled over as more processes are added.
@real yacht You should be telling the GameLiftProcessParams the port its to use when you actually initialise the new process with GaneLift
AWS has an example you can look at in their documentation.
Steam gets the ports from command line. If you don't give it the correct ones to use (it won't find them automatically regardless of what gamelift does) - then you won't be able to find the session IIRC. It certainly won't advertise properly.
Should be super straightforward to get gamelift to pass options to the command line based on port
That'll be why then
If you are using Steam, the ports have to be passed to the command line. Should be easy to do though
Use the Unreal Engine plugin with your game server project.
There is a full code sample that shows you how to setup the ProcessParams
yep, but port is hardcoded on 7777
The first one should
7777 is the default
Then your next one on the fleet would use 7778
7779...7780
etc etc
As more Servers appear on the Fleet
You mentioned your setting it in the constructor?
I dont know why your doing that.
Thats not how you need to be setting up the call to ProcessReady.
Which is where you pass the ProcessParams to GameLift
but in this AWS example, when gameMode is instantiated, sdk is initialized
with params, right
?
Its a barebones example. I wouldnt use that in a project...
so, where should i initialize sdk? what do you suggest?
Our GameLift integration is a GameInstance Subsystem.
We initialize it on PostLoadMapWithWorld on the first level that is loaded.
I have not fully looked into the subject, but is there a particular reason why you don't just use the command line?
Or does GameLift work better with the PostLoadMapWithWorld .
For GameLift specifically if your Fleets are running many many instances, you dont want to have to manually write out all those command line args telling them to change port.
PostLoadMapWithWorld is also called after the NetDriver has resolved the processes new port.
So therefore your Port should already have rolled over if necessary.
Oh, so in this case, your instance tells GameLift?
Yes
Oooh, interesting. I had planned to go the other way, from master to server instance.
You have a master server?
Not yet, but I plan to.
What are you using GameLift for then?
I was more just asking about the general fleet management approach to things. Sorry if I was unclear on that.
Right
Yeah i really didnt want to have to manually tell gamelift what to assign each instances port.
So this worked out for us.
Its important to wait for the NetDriver though, otherwise it will just use the default 7777 port for all instances.
I hadn't thought of doing it that way, but it does sound easier.
I found that out the hard way.
PostLoadMapWithWorld bound in the GameInstance::Init with just a bool to gate it from trying to initalize gamelift again during subsequent level transitions works great.
The first call to PostLoadMapWithWorld occurs after the NetDriver has rolled the port, thats the important bit.
Alright, thanks. I will save this for later.
👍
@fossil spoke how did you get on with Subsystem over a uobject manager ?
i like the fact they are exposed to bp's by default
issue is, you cant create a BP of the subsystem
Yeah they are convenient as.
still wish you could create a bp from it, and it not create 4 instances
tips and tricks, give it a watch https://www.twitch.tv/videos/365415189
How does one again access Camera Location on Simulated_Proxies on Clients?
Trying to Simulate LineTraces but having trouble getting the trace start location that is for the local player the camera (typical crosshair)
Hi slackers,
I'm wondering how best to do a spectator mode for when my players run out of lives or under other circumstances (triggered dynamically, basically) given that the engine already appears to have spectator stuff built in?
I want my spectator mode to be a little more than just a free camera
like with the ability to view individual players
although i can actually just add that functionality to the spectator pawn 🤔
so im working on some ai but i think my questions better here... maybe. im trying to make sure an animation is accurate between client and server. whats the best way to call/replicate the anim so that it lines up properly?
Hmm, you can't really. Normally you just drive anims from some other replicated properties
Trying to sync anims though is pretty much a losing battle
fair enough
trying to get some melee stabby stuff using weapon traces. kind of important to be at least close
I guess it's no different to playing a fire animation really
well im not good at much so its all above me really
like theres a dozen ways and places to call an animation but each ones a bit different and some are straight up broken
also, do sockets update during animation? i can attach stuff to a socket, but if i spawn a projectile or something it seems to come from the original socket location
They should do so long as they're the child of an animated bone
i had an idea for the most disgusting hack ive ever seen for multiplayer replication
unreal engine will NOT replicate structs if they are done by pointer
but in some cases, you want to use pointers for multiple reasons
so what about using a TArray (replicated), of size 1, with a custom allocator, and trick the pointer
if it works it works 🤣
i need to try it
could be a great feature to build a MP game that uses optimized structure-of-arrays for its "components"
😢 😢
I can't figure out how to implement online multiplayer feature for Android. 😭 😭
What would be the advantage of using Improbable.IO's SpatialOS over the default UE4' multiplayer? Any idea?
@sour river MMOs
anything that has to do with big persistent worlds
It's just optimization right? Having thousands of synchronized objects and players with low latency?
I am sure its much more complex, but yeah
Haven't read too much on it, but I think its more like: Having thousands of objects on the server, and cleverly sending stuff the actor needs
@sour river its about sharding and really big worlds
spatial OS is designed for supermassive worlds, deployed in the cloud
in a way that the servers automatically balance
but ill comment one thing. you do NOT need spatial OS
even if making an mmo
unreal can handle 100 people in one server just fine
200 people if you try hard enough, with super lightweight players
and if you do some truly tryhardness, you can write the server yourself
and handle several thousand players in one server
world of warcraft handled 2000-3000 people with one server
in 2005
with 2005 tech
pirate server Elysium (world of warcraft) could hit 7000 people in a single machine
and thats a pirate server with crappy code
It seems like they are trying to implement more and more clever ways to maximize player count as well
e.g. the Replication Graph
yeah, but the thing is that unreal internals for replication are really not that optimized
too oop, not very multithreaded, and poor memory management
we run into this issues in PUBG
@jade gazelle replication graph is great for an mmo, but just running the game logic will trash cpu real hard on a servre in unreal
How does PUBG do its bullets?
Is a bullet just a linetrace that increments in space by velocity/timestep each frame?
I wonder why the default projectile movement uses the component move with sweep thing when that is the most expensive possible way to do a projectile
@fleet raven my thoughts too. You'd think thered be a line trace option or something.
holy hell im going to die soon lol
Isn't a sweep more multi-directional so to speak, and therefore that is the reason why?
ok so ive managed to get the spawning system up and running using the player postlogin i think its called. but my problem now is the character selector. ive moved the selector back to the main menu and you select there, and when you join it spawns the pawn and make you take control of the class u selected, at least thats what i want it to do, right now when you spawn u spawn as the server's pawn class and not the one u selected
sorry for the long question
wait, better question, is there a way to access a certain players instance from the server???\
is this spawn thing in a different level?
no
all on the same level
so i have the data in the players instance on what class they have selected
but right now the gamemode is spawing and possesing the players for them, and using the servers selected class aswell
I might be mistacen, but the GM should have an ovveridable function called Get Default Pawn for Controller
or something simmilar
oh i think its called get default pawn class and controller?
can you check, I dont have my editor in front of me
yeah i did, we were both wrong just worded diffrently
only uses class sadly, it wont let you get the boolean set inside the instance
can you SS?
SS?
screenshot
oh sorry
i would asume no lol
i think ive messed with somthing with that name once
google search has failed vus far
on the left side of your editor, where you have your variables and functions
yes?
on top of the functions area, you have the option to override inherited functions
its a dropdown
ohhhhh i see
and is there something like what we mentioned
perfect
so this is where you would have your class selection thing
this gets called so it knows what to put in the player start
This however isnt going to help you if the pawn is already spawned
if the client has already spawned a pawn I mean
which you cant not do
afaik
hence why yesterday I said that I would have a dummy pawn by default
i did mess with that and what u suggested
this function you just found out is mainly used for new map inits and respawns
its used for lots of things but in your case that how it might help you
but i ran into the problem when the client couldn't communicate with the GM and it completely stopped the whole thing, so i added some stuff to the GS and that failed and then it went burning in flasmes
but i did learn how they communicate lol
ok so i think i know how i can do this now
there is a big caveat here tho
GM,GS, and everything except the game instance get flushed(cleared/reset) when you load a new map
hence you should save chosen classes in per player machine ID in the instance
yeah
as for stuff in the same map once already spawned
u use GS to spawn the new pawn in the player start you need, then poses it(whilst saving that exact pawn/class data) so that upon respawns or new map travels
the same pawn is spawned by default
me neither 😄
fair
hmm
ok ill explain how badly im doing this
i have some bools in my instance that are set to true of false depending on what class u select
now
the gamemode for the players has a tick even that plays and has the same bools in there and they are pretty much clones of the one in the instance. and these bools are then taken to that function in the GM and they are checked there to see what character u are
hmm why on tick tho
but right now it seems to be making the players spectators which is my fail safe when no class is possible
idk
lol
i did try begin play but it only updated once
or maybe is isnt?
wait it should work with begin play because u said they reset when a level is loaded
its the same one i think, the players are all spawning as the same class but from a diffrent cause
from what i can tell it isnt me messing up the bools
just ran a test and it will only spawn as 1 class and not change like it used to so ive done goofed
does that look alright to you?
yes, but it is kida useless
lol i know
you can cycle which one is true and just output that
i think anyways
how are you transfering the data from GI to GM?
it goes from GI to the GC to the GM
i feel it has to do somthing with that transfer
do you think there might be a easier way??
the GI isnt replicated
when you are setting the data to the GI, are you running the event on server?
no im running it from a widget which is from the client
but technically your not on a server then so you are i guess?
well so
lol am i screwed XD
your issue is that the GM currently receives false on everything
because you are writing to your client's GI
and GM can only read what is on the Server's GI
you should move this to your PC
and from the widget
cast to the PC and run the event on server
player controller
oh lol
ok but wont it loose those values when the game switches to the next level???
well if you copy the exact code over to the PC
it shouldnt
as you are just doing the thing from your PC instead of the widget
but you are still casting to the GI
so it will set those values from the widget to the PC
the widget will just thell the PC, hey run this event so that that variable is set to true on the GI
ok
ok so now i have the wigdet telling the PC to tell the GI what class it is, and when the player spawn the GI tells the PC and then tells the GM what class it is?
lol i just realised a mistake
well, the PC should only tell the GI the class upon selection afterwards, its the reverse, and remember that GM will always be initiated before the PC
ooo yum
This will help you alot when it comes to which/where/how/when/in what order
ok
gl tho, gotta sleep, somehow its 4 in the morning, AGAIN...
is it cheaper to replicate AActor* var or FRotator var ?
what actually gets sent for replicated pointer variables ? some magic id that the client will use to find that replicated actor ???? 🤔
Aww, I wish MrTapa didn't go to bed. 😦 I wanted to show him my mad scientist solution from the problem we were discussing yesterday. 😦
Welp, he be awake now 😃
@flint rose
FRotator var should always be cheaper no?
its all a bunch of 1 and 0 s anyway
(╯°□°)╯︵ ┻━┻
hey guys i packaged my game and portforwarded my computer but i still can't get someone outside of my network to connect to my game, i can connect just fine with localhost but none of my friends can
basically this issue
@high current @twin juniper If it's only about the AActor* var vs FRotator and not about all the additional stuff an Actor might replicate on their own, then I would say the actor is cheaper.
Cause the Rotator has 3 floats, which is 4 bytes each and the Actor is the already said int32 value that should also be 4 bytes, so 4 vs 12 bytes
However comparing that is kinda weird, as I don't see a point at which this would matter (Rotator vs Actor)
welp, clearly I need to update my byte math, thanks for the clarification
If you are thinking about Replicating the Actor and getting the Rotation from the RepMovement instead of just replicating the Rotator, then the Rotator would be cheaper
Cause the rotation has to replicate anyway, inside of the actor, then you would be at already 4 floats + all the crap the actor might replicate
And if you just replicate the Actor GUID that wont help as you still need to get the updated value of the rotator
I dont even know if you can replicate just the GUID and then search for it locally, that sounds like a waste
@willow fox what is your NAT type, I have been able to get public connection as a listen host to work on some routers with a simple port forward, and on other (older ones) I had to set the hosting PC to be the DMZ host
How do delegates and multi work - is it based on where the delegate is bound?
I.e. if the delegate is bound on the server, it'll fire on the server?
is it possible that server side spawns something like a bomb and client side cant see it? cuz basically when server(assume server side is a player computer) do a job all clients should see the result, is it correct?
Depends on where you are spawning it from
if you are spawning from game mode, it will never be visible to other clients as game mode doesn't physically exist for them
If you spawn it with like the game state, then both server and client will see it
i have a Car that can shoot and put bombs. when i shoot it works fine for both sides, but when i put bombs server can see the client spawned a bomb(client can see it too), but when server spawns the bomb only server itself can see it. FYI i have a projectile and bomb class that both spawns in the Car.cpp and its surprising that projectile works fine but bomb doesnt, and its getting exiting when client cant see the servers actions. it would be reasonable if the opposite happens
@high current it was helpful information thanks.
well you would want to multicast this to the relevant actors. What I like doing is using RepNotifys, like a boolean, every time the bool gets changed, the RepNotify function will execute and that is where I would put my spawning actor logic
👌
The Class you are in has 0 to do with who sees the spawned actor @high current @brittle karma
You can spawn in GameMode and GameState. It's more important that you spawn replicated Actors only on the Server.
But the class, as long as it exists on the Server, really doesn't matter
If the Server can see an Actor but the Client can't, then you most liekyl didn't mark it replicated
@thin stratus i set the flags true{ SetReplicates(true) } for the Bomb class and yes they exist on the server. but why client cant see the server's action? shouldnt client see all the actions and updates from server?
What is an "Action"?
spawning bombs
Yeah it should also happen on the Client
As long as you aren't doing anything that would prevent that
You should also maybe check if the Bomb even exists on the Client
Maybe it does and you can't see it
Or it exploded right when spawned or so
so it means there is something wrong with the code i wrote, thanks.
Wait, spawning from GM replicates to clients in UE
I avoid doing it since it didn't in UT
And what if the spawned actor doesnt replicate
Then it won't replicate to the Client no matter where you spawn it
Aight I see, so the net driver spawns the actor for clients, and not the action itself from GM (as that never happens on clients). Yeah makes sense, I have dealth with non-replicated actors mostly, thats where the confusion comes from
I'll tone down helping in #multiplayer as it seems I have a few wrong practices...
Is anyone around who's worked with steam dedicated servers?
@high current Don't worry, just make sure you double check what you tell people
I don't know everything either
@wise depot Lots of people I guess, but the ones that have took a lot of damage from it and don't want to deal with it again ;<
yeah i did it about a year ago when our project was on 4.18 and it was working fine
now we're on 4.22.3 and its all fucked again
steam server with unreal is a nightmare tbh
4.14* rather
4.14 to 4.22 jump must be a nightmare all around
I once updated like 11 or so versions and it all worked
Still not trusting it
(minus the obviously deprecated functions)
You can't downgrade o.o
You can if you copy paste everything manually
Uff
And when the copy paste itself crashes the editor, its fun
oh god
Just santiy checking - NetMultiCast means calling a function on both Server + Client, yeah?
if you're calling it from server, yes
Yeah, only from server.
Okay cool - just some late night sanity checks.
Hmm anyone test dedicated server from the one comp, and have your input actions take over from each other?
seems like someone's been using GetPlayerController[0] on dedi again
Hmm
hmm maaaaaaybe, but I don't think so
Is that a feature you want or a bug
Though I do think I'm setting one pawn to two PCs. heh
(player controllers.)
Which would explain it.
why is USceneComponent::AttachChildren replicated ...?
would it not be far more sensible for the AttachParent of components to replicate?
then they could attach themselves
with in PIE testing
the awkwardness with windows might had ninjaed your focus tho
to make my life more interesting 😦
yeah.
the current way prints errors when you attach non-replicated components and makes my component that changes its attachment itself cause ensures
the FNetGUIDCache object not supported?
yep
though that is not actually the current problem, it's just one I noticed in the past
if so, SetNetAddressable() on the component will solve your issue
When dealing with MP, always get the controller from its relevance to the actor you are tinkering with @glad sedge
any one know how to stop an actor spawned by the server player from showing to all clients, when the clients spawn the actor only they can see it, but with the server player i can't seem to stop it from showing
my current problem is that I have an actor that changes its own attachment inside OnRep_Stuff, and then triggers this ensure https://cdn.discordapp.com/attachments/453306818198896737/601034972022964224/unknown.png
if you get a name mismatch after you SetNetAddressable() you'll get a NetGUID mismatch
which will disconnect the client
@grizzled bay is your actor replicated
like I don't want its attachment to be set by replication ever
only my OnRep should change it
as in get the PlayerController locally from the actor I'm controlling ?
@glad sedge for example if you are dealing with a pawn, you can get the controller of the pawn, instead of just spamming GetPlayerController [0]
the actor is spawned in the player controller and has replication turn off, but i have also tried using replication and also using set only owner see on the actor which is misbehaving @high current
if you dont need to replicate the actor itself then dont, and you can spawn your actor using the Switch Has AuthorityNode
been going in circles for while trying to stop it showing on clients, but even if i stop the server from seeing it, clients still can, has been a pain
yeah I don't get the playercontroller that way
And you are still facing the issue where the input can be hijacked from another client(window)?
I'll tell you in 2 seconds
@fleet raven the AttachParent has to be replicated as well for that children replication to work
Yeah, it's still an issue but I think I know why it's doing it.
the thing is I want to manage the attachment myself all of the time, replication should never mess with it
since I need to save off the previous transform and start interpolating when it changes
you could probably workaround it in PostNetReceive but it would be ugly
night
actually
the component being attached is not even replicated at all
so wtf 🤔
now I'm confused how it's hitting the ensure
i had locally spawned meshes attached to a replicated skeletal mesh
and on occasion, during root montages, skeletal mesh would suddenly decide to replicate its attachements
on clients, every attached mesh would just fall off

is it registered?
yeah definitely
shrug that would trigger it
it runs after beginplay
mfw reading code I wrote a year ago and have no idea what I was doing
Hey, If i read my stuff from last Thursday idk whats going on... So, a year aint bad
anyway i solved my earlier issue. I guess the actor being spawned by the host player just always made the actor it spawned replicate, so turning that off on the new actor seemed to work, still other issues, but least one hurdle down
You need to uncheck 'bReplicates' in the blueprint of the object you're spawning
I.e. whatever is plugged in to 'Class'
good to know why it was doing it, changing that in the class kind of ruins the rest of the building system though, but thanks for letting me know
my current issue is working out why set static mesh returns true and works fine when the client executes it from server, but returns false if the server player executes it
np's, I don't know the system of course - but what i can say is spawning the actor as replicated then marking it to not be replicated probably still creates the actor channel, which is a bit of a waste. If you can avoid it somehow it's probably best to. You get a bit more control over that in C++ but.. yolo
Perhaps if you invert your logic, mark isReplicated as false by default, create a bool like shouldReplicate or so, expose that on spawn and set its default to true, link it with the inReplicates of the SetReplicate node (which also is should be on that begin play).
That way you can spare the actor from creating its Rep channel when you spawn it like that in your screenshot, and the rest of your system should work
Idk if spawning an actor as not replicated, and replicating it on begin play would spawn it for everyone else tho
okay, i used what you said, to do it that way i would change it to replicates only at the time it is actually built
that should keep everything working the same
yeah it does
🎊
thanks
If I wanted to include a handful of classes only with Server builds, is it simply a matter of creating a separate module and adding something like this to my project build file?
and then making sure to wrap all usage with the server preprocessor in my main classes?
I guess it should work, so long as you don't have BP's or any serialized assets based on or referencing those classes
I guess best way is to just try compiling and see what happens
But yeah with that setup that module won't be included unless it's a server build
It's mainly for AI stuff that is all calculated on the server, none of its ever replicated or exposed to the client so I figured it makes sense to just exclude it entirely from client builds
I know the default UE workflow is kind of just include everything for both client and server and then filter use by role, netmode, etc.
but i kind of want to hide some stuff from the client
entirely
Should be fine, but if you have any assets or BP's referencing that stuff they'll just break
It'll should be obvious when you try to build it though, as it won't package or cook
I guess that's probably the best way to find out, haha
Will test is out later when I get home
Yeah for sure, hard to speculate really 😄 Like if you had a pawn that referenced a default AI controller for example, and that AI controller doesn't exist in the client build, the build will fail.
thats what I was just thinking about
because while the AI controller would ever be on the server, the NPC that uses that controller is on both
and is replicated obviously
Even if the controller isn't used, if there's a BP of it, or the gamemode has a reference to it etc, client won't package
Even if it does somehow package you might get mismatched checksums for assets and not be able to connect etc.
well the CPP references I think would all have to be wrapped with the WITH_SERVER_CODE preproc
in order to compile client builds without error
not sure how BPs would be handled though
What I mean is assets won't care about pre processor stuff
If any asset exists in the project that references 'AIController' and you try to package without that CPP class, it'll fail to cook assets
I'll have to test it out, right now I'm just filtering everything block by block with the preprocessors which works fine, but is tedious
was thinking it would be easier to just have entire classes allocated to server only
but maybe that causes its own problems like youre saying
Yeah, it seems like more trouble than it's worth tbh
the term premature optimization comes to mind 😄
but I'm always guilty of that so yolo
hah. well it's not really about optimization so much as just maintaining a clear defining line between the server and the client, and only exposing to the client the bare minimum information they need
where is the best place to implement health system so it can be replicated on clients? (Game Mode, Game Instance. player class itself?)
on whatever actor takes damage I would guess
data locality isn't really much different in MP to SP
@brittle karma I would say Player State/Pawn combo, but that is just me
pawn for me
I find it easier with player states when I have to do UI stuff for example to display health for others
aha, thanks @chrome bay @high current
Depends on the game I guess, but you lose a lot of flexibility and the like putting it there
The way I do it is by having the health logic inside the pawn, and player state is just always updated with the newest health info of its pawn
What's a simple way to allow only one players pawn through a collision of a mesh and block the others...Im blank lol
Use MoveIgnoreActors
Thx for that happy gaming
Still not sure how to get the Camera Location on Simulated Clients
Need this to simulate weapon fire
Close to just making a replicated FVector ..
@thin stratus Pretty sure that's the only way
I mean the camera doesn't even exist remotely
Except on your own PlayCont obviously
The Component itself exists
But yeah I repl the location now manually
I'm doing enough optimized things to allow that
The component exists for a remote, non-local-player player controller on a client ?
Oh yeah of course it does
Since it's on the pawn
But it's very likely not updated accurately
update on the struct hack
it works
it actually works
with it i can actually implement a fairly good ECS system in unreal that does support editor and replication
🎊
so is it true theres no effective way to adjust a characters movement speed in bp for multiplayer?
found a vid that does it in C++ because the bp one has a lot of network issues
@high current , I figured out my issue with anim notifies if you're interested lol
sure
@steady briar hmmmmmmmm 🤔
if your character us properly replicated, the movement speed is just a value which should change on all clients
I extracted all the notification times for each animation in a montage, and created timers when the montage is played on the server to enable/disable the weapon collision. It's ugly, but it works
@high current i think its a prediction problem in the movement component or something, i dunno i skimmed a vid and found examples of how to see that it doesnt actually work and the only fix in c++. something to do with... int... 8bit... something i dunno im really dumb <_<
sounds ridiculous but crazier things have happened so lets wait for someone else to confirm or deny this
maybe post the video as well
ok just saying im not trying to make an mmo, ive ignored this guys vids for a long time until i was like... meh i got nothing else to do (seems to be some good stuff) but ya heres the 2 im talking about
In this video we discuss why you can't build a sprint ability in BP that will work in multiplayer. We also upgrade our project to 4.22 and the latest OWS plu...
In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent. We start fr...
@flint rose haha, yeah if it works it works... I would have used a timeline, and just launched the events on the specific time tho
Sorry for my nubness, what is a timeline?
Ah, I see.
Just looked it up
Well, it works, if I need something more complicated I'll switch it over.
basically a timeline is curves that can update multiple values as they go. just Add Timeline and double click it, add some values and u should see new outputs
Yeah, I suggested it because its easier to set up, functions entirely the same for your intent
My only problem now is it seems my weapon is only colliding with other characters weapons
Hmm, actually it may be network related.
When I don't run a dedicated server, the collision appears to be fine
@steady briar skimmed the video, the guy just seems to have issues with ping and lag
:D, as we all do
for a blueprint solution what I would do is that I would lerp the speed change(if needed),and at the same time fiddle with the prediction tolerance of the character movement, based on how much the speed difference is
well its all above me. setting a bool i can do. anything else...... no idea
well in that case, I would say, don't worry about it, that's advanced stuff, make sure your logic works, I don't think this prediction miss match will cause you much problems in your current phase of development
ok well i can do more than just set a bool but ya once it becomes a deeper issue im not smart enough to fix it myself
ill ignore it for now but at least when i do run into that whole situation i have some references
Ill look into his C++ method in a bit tho
and bash my head at the wall cause I dont fully understand C++
ya i can follow blueprint that i dont understand myself yet. like i get the general idea. i couldnt get it to print Hello World in C++
so i am working on making my building system work with multiplayer. I am using a class containing multiple meshes, this gets spawned by the server using spawn actor, that actor is set to replicate after it is spawned, and then has it's static mesh changed to the correct mesh (the static mesh also has replication enabled)
The problem however is that even though it is meant to replicate, clients are unable to see anything except the default mesh unless they are the ones who told the server to spawn it. this means that the server sees all changed by itself and other clients fine, clients can't see non default actors from the server or other clients, so if the server places a ramp, they can run up it or collide with it but only see it as a floor
I have tried all kinds of different ways of replication, the closest i got was calling the set static mesh on each client using multi cast after the actor has been spawned, but that results in a noticeable period of time when the client can see a floor before it changes. not sure if anyone has any ideas, but any help would be appreciated
Sounds like your event for change the mesh isnt multicast-ed
have you tried using a rep notify (OnRep)
to change the SM, instead of replicating the actual SM
yeah it spawns as a ghost per player first, so may have somthing to do with that, seems like it may be trying to use it's own build or somthing
the change itself was only happening on server or multi cast
also I am assuming that you have tried setting the SM to be replicatable and just running the change mesh event on the server?
and CPP or BP based?
blueprint
i have tried it many ways the default way is running the set SM on the server sustom event when the actor is created, but i have also made that call a seperate multi cast event, checking for authority all all that
it is possible the clients ghost is interfering some how so i guess that is my next step
Anyone had any luck with Epic Online Services?
I'm trying to implement the ticketing system but I can't POST a request to the http url
I haven't used it much but I have a bit of experience with HTTP
What is the response code you are receiving?
LogHttp: Warning: 00000212AF098180: request failed, libcurl error: 65 (Send failed since rewinding of the data stream failed) This is what I get
Ah, so it's not sending a request at all
might be you not following redirects correctly