#multiplayer
1 messages · Page 513 of 1
@polar lotus Make sure your movement speed is set correctly on all your players. I had a jitter issue where I accidentally was setting walking speed locally somewhere so it was a tad bit out of sync and caused the jitter. Your issue however kinda looks like an animation blending issue but I'm not sure why it would only show up for clients.
Anyone know if it's possible to get this value in BP (or C++ even)?
I'm trying to set up my local testing environment to be as close as possible to production, so I'd like to substitute "number of players needed to start the game" (which we get from an API on production) with this number when in local dev
possible, yes... how would require quite abit of digging
@fossil spoke yes I am. That is how I originally had it but I found that jumping still caused rubber banding problems. I'll double back and take another look. Thank you!
i'd start by looking at editor menu customization stream to figure out what that menu binds to and then how to access it from there @weak fog
is stream a technical term here, or do you mean they did a livestream on this topic?
there is a livestream on it
you can also try #editor-scripting
best chance to find someone who knows how to access it off the top of his/her head
ahh okay. tyvm!
I'm calling GetController of an AI character in a server RPC but returns null
that is a weird setup
seems to be valid on BeginPlay
that implies you are directly accessing an AIController from a client
Hmm
what if i make a function in the character that uses the controller, idk if that would make a difference
can't quite find anything on how to access an AI controller
Cast<AAIController>(Pawn->GetController()) pretty much
it won't work client side, since those aren't replicated by default
im doing it in a server rpc
you should really paste the code and explain what you're doing exactly
//AController *ControllerActor = AICharacterForMovement->GetController();
//AAIController *AIController = Cast<AAIController>(ControllerActor);
//if (!AIController)
//{
// EndAbility(CurrentSpecHandle, CurrentActorInfo, CurrentActivationInfo, true, true);
// return;
//}
//
//AIController->MoveToLocation(HitResult.ImpactPoint);
This is the server rpc
This might be a question for #gameplay-ability-system, I just remembered that AICharacterForMovement was null until I replicated it, maybe even if it's a server rpc it's not doing it with server data
since i have no idea what AICharacterForMovement is there, that code snippet doesn't give me any information
const AMXM_BaseCharacter *MXMCharacter = Cast<AMXM_BaseCharacter>(TempAbilityInstigator);
if (!MXMCharacter)
{
EndAbility(CurrentSpecHandle, CurrentActorInfo, CurrentActivationInfo, true, true);
return;
}
AMXM_AICharacterForMovement *AICharacterForMovement = MXMCharacter->AICharacterForMovement;
if (!AICharacterForMovement)
{
EndAbility(CurrentSpecHandle, CurrentActorInfo, CurrentActivationInfo, true, true);
return;
}
UPROPERTY(Replicates, BlueprintReadOnly)
const AActor* TempAbilityInstigator;
nothing thats called Temp should ever be const
but unless you paste the entire RPC i can't help you
oh snap let me remove all the comments lol
@rich ridge I have working on it with a game instance and it kinda works cause my variable "Player Name" survives the level switch but now I have another problem 😕 When I apply the name to the character, it doesn't apply it to the right person... Instead of applying the name to the server (the one that has modify the "Player Name" in the menu, it applies it to the client... its like if it doesn't know which one to to give it to... But how could I define to wich person to give it to? This is what I have done:
that TempAbilityInstigator is pretty suspicious
put a breakpoint in it, see what's what
alright
@plush lagoon the way I handle scale and character movement variables is by having a RepNotify for each of them called like “ScaleModifier” or “MaxWalkSpeedModifier” and in the RepNotify set the scale or walk speed or whatever to a constant default multiplied by the new replicated modified
Modifier*
I’m doing an RPG so buffs can shrink players by affecting the scale modifier stat for example, which gets set on server and replicated and then everyone separately sets their own
it's most likely a GAS plugin issue, I explained more details there
ahhh
thank you so much @vivid seal ^_^
Yea, i'm doing the same sht but i'm doing it based off stats and various modifiers to increase/decrease the scale depending on what your doing.
Is this correct replication for "dedicated server"?
@dapper hatch I have a C++ base class for everything so I just do this
@dapper hatch DUDE IT WORKES
WORKED
THANK YOU SO MUCH
I'm still struggling to figure out replication on setting an actors location along a spline. So I was told to use interpolation but It still looks laggy on clients. If I set my timeline to replicate and run the event onServer will that work and be optimized? https://i.gyazo.com/c7e539137ee83bf2a6f49e371373e7d3.png
@polar lotus your welcome 🙂
Who owns my gun actors if they are spawned in by the server
So to clear my question up; Is using a replicated timeline more optimal compared to using an RPC or a repNofity variable?
[2019.12.27-09.01.04:005][ 94]LogOnlineSession: Warning: STEAM: Session (GameSession) already exists, can't join twice .... how to destroy sessions properly? placed destroyed sessions every where...
Is there any additional steps to deal with in regards to the ChoosePlayerStart function inside of the gamemode class, when it comes to multiplayer spawning? The player team numbers are aligned with the spawn tags but no luck
@dapper hatch if you want to maintain names for respective characters then you need to store inside of map
Instead of single playerName variable
What's the best way to replicate "attachToComponent" ? Do I need to do that on server or can I just run it inside a multicast or what?
@rich ridge How would I do that?
@dapper hatch if you know Java it's same as that of HashMap<Key,Value>
In blueprints you can set variable type as Map
And one more thing as others pointed out yesterday that we can retain values using PlayerState by calling function CopyProperties from PlayerController, please consider that option too for retaining values after level is switched.
I want to start making a multiplayer game is how reliable are older tutorials?
Learn how to work with Maps in Blueprints.
@dapper hatch
@twin juniper older tutorial are good, the concept for multiplayer game has not changed
But you might enconter fee compilation errors because of the classes getting removed or moved to other location
In case classes got removed they got replaced with better classes
@twin juniper UE4 documentation is highly rich in information and the people also has good number of wiki pages in different aspects of multiplayer games
You just need to exploit Google to get your results
thank you.
@rich ridge How do I use the thing "Copy Property" in my player state?
is it a node?
@winged badger
asked this in cpp channel but think it might be more appropriate here
hey i have a few dumb questions:
are TSets replicated? when I google the first result from Epic's docs says "Like TMap, TSet is not replicated" but when i click the link it doesn't actually say that anywhere.
second, if they are replicated, will using .Add() a duplicate element to the set (therefore overwriting a key with an identical key) cause things like RepNotify to trigger or will it be treated as if nothing changed at all?
Sets and Maps are indeed not replicated
Array is the only container type that supports replication
im setting my timer inside game state on authority... then calling a server event inside game mode which calls an owning client event in player controller to create a widget. When i cast to game state and get the timers value on client it comes back as -1... any idea why?
the variable is set to replicate
Because the timer doesn't exist on the client, timers are local only, they aren't replicated
The handle is just a number to identify that timer on the local game instance
in most cases, if the purpose of a timer is to create a widget when its done, you don't need it running on authority, but local only
especially in case of dedicated servers
That is also true, seems like a backwards way of doing something. Client should be managing the state of their HUD locally.
No the timer needs to display on the hud
So like match starts in 5,4,3,2,1 countdown
@winged badger @chrome bay
Doesn't matter, the client should still decide to show it or not
And usually in that case you just replicate an int for the countdown
Or reuse the same int32 as the match timer
for that, the clients just need the information that timer started
they can count down 5 seconds on their own
Which is also what MatchState is for
not easy to hook into that from BP though
Hmm yeah true
Dang
So i see two solutions... get just the starting value and then countdown on clients
Or create another timer on 0.5 secs and then replicate that value to clients
there is no guarantee any corrections to the timer will be any more accurate then your initial "CountdownStarted" replication
given that, its best to let clients count down on their own, that way the 5 seconds will actually last 5 seconds, and won't be affected by any spikes in latency
Ok makes sense thanks
hi. there is something that i cannot understand
can you set the port when you host a gem in runtime?
because if you cant
how does STUN works?
i mean, with stun i can get a open port, but how can i use it if when i host a game with openlevel i cant set the port?
FURL has a port property
You can include it in the options for openlevel
Assuming you are talking about listen servers
How am I supposed to join a game server if the game server and the client are using steam? Is there a specific way or just OpenLevel would work?
So dedicated servers that are using Steam by default creates sessions? Or do I need to create the session first on the servers@jolly siren
This whole sessions thing is so irrelevant to me cause I have my own match making
And I already know the IP and Port of the server I should connect to
you can use openlevel then
It just kicks me, not sure if the client refuses to continue or the server kicks me
Look at the logs
does the server have the port open?
Yes, and when I have steam disabled on clients, it works fine
why enable steam then if you're not using it?
Same question ^
Well in future I will enable authorization etc and steam id will be used in game
then just connect through steam too and you get automatic nat punch etc
@jolly siren i checked FURL. I tried to pass it Using UnetDriver. But Unetdriver is null when i get it from GEngine. if i try to create a new oone with NewObj ir returns null again. So the main question is . how can ir host a listen server using Unedriver?
Is there any option to check for like max change in client to server
currently i have dash move, it works fine on server, but when I try multiplayer clients are being kicked back I think its some anticheat feature
i had to create a UIpNetDriver
why are you manually creating a net driver
the engine creates it automatically when you travel to a level with ?listen flag
because i need to listen a specific port set on runtime
@fleet raven because Turn
stun
you can set the net driver class you would like it to spawn in the config
that's the default
I meant more like you'd be able to derive it and do any custom things you need in there rather than making hacks like spawning it manually
yes i know
but
before extend it to make my custom unedriver
i need to know to to use it to host and join games
@fleet raven thank you!
im working on an open world multiplayer game that will be running dedicated servers i am wanting to know how to do individual saves per server so when a player joins a new server they have to make a new character like ARK and Conan does is there a way to do this in blueprints or would i need to use a database like sqlite
i would use a nosql database
in any case if each dedicated server is going to have their own savefiles i dont know whats the problem
if i create a custom unetdriver hw i add it to my config?
-NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="MobileNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
this is not working
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemMobile.MobileNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
[/Script/OnlineSubsystemMobile.MobileNetDriver]
NetConnectionClassName="MobileNetDriver"
CastleVersus is the name of the project
Anyone know of any examples of restoring an Actor Channel to an Actor thats been Torn Off?
you can't
the channel for an actor that has been closed and disposed of
you'd have to create a new actor channel for it, which would end up creating that actor anew on the client
no problem
make it dormant if you plan on opening the channel back up
that's the point of net dormancy
Yeah i was going to do that anyway.
Is there a function that gets called when dormancy changes?
I believe so, but I can't recall it off the top of my head
and I'm currently deep in editor graph code
Ill have a dig.
silly Epic went and refactored everything related to node context menus
I tend to stay well away from all the Editor nonsense 😛
I really hate tools programming lol
@gleaming vector hi. Do you know how yo add a new UIpNetDriver?
Yes
you can create a new type, and then change out which class the engine instantiates
that's done in the engine.ini
^^
if it's not recognizing the new class, are you sure you set up your script path correctly?
put that in ``` ```
so it formats it correctly in discord
back tick
`
above the tab button on us keyboards
also the ~ button
and then 3 a the end
I'm I'm muy phone
``` like this ```
Muy phone
shows up
like this
ha, sure
that works
so
your first section is where you define your drivers
second section is where you define your channel classes
you haven't overriden your driver
but you did override the channel
er
NetConnection not channel
NetConnection is not the driver
they are two different classes
OnlineSubsystemSteam has an example of overriding the driver
i am not sure your question
overriding the NetDriver/NetConnection and the like is very advanced networking
I know a few things in there but I usually just go by example
I created a new class that extended UInetDriver .but i can't find a way that the game use it instead of default UIpNetDriver
it's the in the first section of the ini that you linked
you change the ipnetdriver to your classname
I'm going yo try
Hey could anyone give me a better understanding of Random Seeds in multiplayer? I wanna make a shotgun. From what I saw on the web, a random seed with a random stream, basically makes sure that every client gets the same random values when shoots. (also the shotgun should use a VRandCone).
Is this right?
it is, its not necessary for every game type though
And if so, shouldn't seed be set somewhere in a game state or game mode?
and if you desync at any time
you'll remain desynced permanently
ah, no
should be contained within each weapon
But if every player generates a different seed, then how would it be right?
otherwise out-of-order packages become more of a problem
server generates seeds within each actor that requires one and replicates it
If you set the seed in a weapon class (shotgun) belonging to Player 1 and then Player 2 also sets his own seed, they would get different values
but they would still be synced
1 seed per shotgun
created by the server and replicated
Would you be able to give me a code example?
use seedstream
I never used seeds before
i don't have one at hand, i decided against syncing spread in my game
i have client authority for hits, validated by the server
health is synced across all clients
but hits are not replicated for simulated proxies
nvm if the shotgun entity ever becomes unrelevant for clients seedstream would desync
they have just enough information to do a fairly good guess of what the players are actually doing
and simulate that
Alright, then the Seed should be a replicated int. And on begin play of the gun I check for authorithy and if authority I set a random seed?
Or I set the seed on every shot
i would do it as part of the spawn algorithm
no, there is not
And it should be replicated
again, packet loss is problematic
Alright thanks a lot! Happy new year!
if your client doesn't get one shot worth of package
or if it becomes non-relevant
or if its a late joiner
seed will be correct, but it will be sampling a wrong element from a random stream from then on
you can't sync random streams after the fact
a random stream with same seed results in exact same sequence of numbers
but once you lose where in that sequence are you, there is no way to sync it back
@distant wave I pass the clients randseed int value in my start firing rpc (or shot fired rpc for single shot weapons)
that saves bandwidth only if you roll several randoms per shot
it is a better solution then trying one time seed replication
as that will desync sooner or later
How do you netsynch it?
@hoary lark And I still have to set the seed only if Role == ROLE_Authority?
Whoever starts the event first has to set the seed somehow
My fire function looks like this
If the role is less then authority, it calls a Server RPC (which calls the Fire function) and after I close the if statement
I do the firing logic
So I just set the seed to something random there
In the firing logic
Right? @hoary lark
Nah everything related to firing is in that function
You're ok with input delay then? If so then yes but I'm thinking you might want to change this after you experience it...
There is no input delay
If the client doesn't have hit authority, there is a delay
Look have you ever looked at the ShooterGame fire function?
That is how I have it set up
@winged badger At least no visible delay
visible or not depends on the latency
As soon as the Fire function is called it checks if you are a client and if yes, then it calls the server rpc
if its over 50ms, its visible
Basically the client tells the server to fire for him
Anyways
We were talking about seeds =)))))
Thanks for the help everybody!
i figured it out
just use a seedstream seeded with a replicated burst counter value
you only need to replicate the burstcounter value and works when things go out of relevancy range too
where can i upload stuff? i have a test project you can run
forgot to mention that the client shoots locally too
Sorry I'm tied up with NYE. If the client shoots first locally, then the client has to generate and pass the random seed to use for the event up to the server. (And if you're only telling the server to shoot for you only, there will obviously be a delay, Zlo is right but maybe the way you have it set up is different than we're interpreting)
it does not look at the project
no seed is sent to the server, both just have initial value and use burstcounter to generate the seed
On my phone rn sadly, but sounds like it'll be a pretty useless solution tbh
the client shoots, calls fireweapon, and moves burst counter up then asks server to shoot
server's shoot moves burst counter up, since its a repnotify (ignored by owner), server and remote clients fireweapon
fireweapon takes burstcounter to generate a seedstream and does a loop x10 to fire shotgun pellets
the result is the same pellets hitting the same spot on everyones screen
burstcounter is a replicated byte
Sooo basically he's just passing the seed except he reduces it to 256 possible values? I've thought of doing that too I guess
256 different patterns for shotgun blasts sounds good to me
or make it an int32 who cares a few extra bytes
you generate a seed based on how many times the weapon has shot in its lifetime
thats the "burstcounter" mechanic used in shootergame
you dont pass anything, you just simply tell the server i shot, you urself up burstcounter by one, and since server will up burstcounter too it is naturally replicated. in the repnotify everyone knows to take that integer to generate their own seed, which is the same everytime cause of how seedstream works to do the randomization of the shotgun pellets
Yeah that's great until you use it in the real world
honestly a seed just needs to be created and synched per shot, in fortnite they don't even seed the shots
sync it with burstcounter ?
no, passed in with the rpc
but burstcounter is a replicated value
you are still sending a rpc
Same difference then if it's replicated
to the server, might aswell send it with the actual shot
where it can be used at the correct time
properties don't replicate the same time
also he said server shoots in shooter game
that is wrong
Shootergame is client side shot
validated on the server
server doesn't do any traces
@half jewel Link is no longer valid
you probably wouldn't want the solution in that project anyway for a serious project if it was what I think it was. it might have been reliable over LAN games
in my solution I generate a seed with the StartShoot event and pass it to the server, that seed makes a RandomStream that will be used for the shoot event (e.g. a 3-round burst) - that stream is then (locally only) used to generate a new random seed and random stream for each bullet that the gun fires. if everything is equal on client and server, this allows for muzzle spread and projectile damage, bounce, and penetration effects to be randomized identically. if something varies, e.g. a bullet hits something on the server but not on the client, the "desync" will not propogate to the next bullet
Networking/GameMode question. When a player connects I want to reach out to an external service for some authorization/data-fetching concerns. Ideally I was thinking about implementing this in GameMode's PreLogin/Login but that doesn't look like a good place to perform an async call (or a sync call and block the execution). I was wondering if there's a obvious good place to do this sort of work? Thanks!
@chrome bay Update on that steam lobby ping thing, it wasn't working for me because it takes the game like 5-10 seconds to initialize the ping stuff. Hosting/searching before then breaks it
Yo. If my component does not have any replicated variables but have server and multicast functions, do I have to set setreplicates to true?
@median marten yes, you need replication enabled on that actor in order to use RPCs
Is there some documentation somewhere that talks about how TArrays are replicated? Does changing one value cause the server to send the whole array? Does setting an element of something (an object or struct) container in an array cause any replication? RepNotify?
Working out how to manage replication of Buffs and Debuffs on actors but scare of using just RPCs because of the potential for non-relevant actors to see incorrect buffs after becoming relevant.
Not the whole array is replicated.
Changing a value inside the array will trigger a replication
Changing a value on a UObject (actor, component...) stored through a pointer in the array will not, the object itself should replicate instead
Yeah that one didn’t make sense now that I’m rereading my question lol
So basically I should be good to go as long as what I need to trigger RepNotifies is adding or removing from the array?
Last question, I know you can get a variables old value by setting a parameter in OnRep of a reference to the variable type, is there a way I can do something similar with a RepNotify from an array that will give me what was added or removed? I’m assuming I can get the entire array and compare to current array to see which element changed but that seems kinda clumsy.
Oh, I didn't know about that.
I'm guessing it should work the same with the array and will indeed giver you the whole thing
Someone on this discord mentioned it and I’ve found a grand total of two other mentions of it on google, but supposedly yeah
For gameplay programmers writing C++ code.
What I'd do in this case - if you have an array of buffs to replicate and show on the screen with a text notification and/or animation - would be to have two arrays : the replicated one that the game code changes and use, and a display one that stores a structure with the buff itself and the display details
So you'd compare both on tick and add, remove or update the display array
Currently all the display details I would need are contained within the buff actors themselves (icon, name, description, duration) and the UI receives a dispatcher when I add or remove a buff, and then it reshuffles the displayed buffs to accommodate. I just need to make sure that delegate (which I was calling from OnRep on the clients) is being called correctly.
@hoary lark You generate the seed event and pass it to the server. How do you pass it to the server? With a server RPC?
u wil all be delt with. i wil become they and all snilvering snuckatashers will be showb their demise.
@distant wave yeah, with the same rpc that starts the shoot event
Hey everyone, I got a big problem after packaging the game it returns an error at startup.
It says something like:
LowLevelError (line 1429)
Async loading of event graph, cicle in involved.
Anyone knows what that could be?
Can someone please tell me when overlapping with a box collision component in multiplayer (works in single player), why is it possible to get an overlapping actor player controller in blueprints but not in c++.
In C++ I tried to bind overlap methods to delegates two different ways
InteractionArea->OnComponentBeginOverlap.AddDynamic(this, &AInteractiveActorBase::BeginOverlap);
TScriptDelegate<FWeakObjectPtr> OnComponentBeginOverlap;
OnComponentBeginOverlap.BindUFunction(this, "BeginOverlap");
InteractionArea->OnComponentBeginOverlap.Add(OnComponentBeginOverlap);
Could this have something to do with how overlap methods are bound to delegates (ComponentBeginOverlap, OnComponentEndOverlap)?
Overlap methods use UFUNCTION macro.
Code and Blueprint done as in picture.
cause playercontrollers only exist for the owning player and server
so if that was ran on a another client it would be nullptr, but i don't see that happening here
i think its not using your player controller class
so the cast fails
anyone know if there is a fix for this? https://forums.unrealengine.com/development-discussion/c-gameplay-programming/125708-what-does-actorchannelfailure-mean
For gameplay programmers writing C++ code.
I am working with a replicated actor that has been set as a child actor of another replicated actor via the ChildActorComponent, the child actor component is also set to replicate
Whenever I launch a client in standalone mode, I get the following error on the server Server connection received: ActorChannelFailure [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:64569, Name: IpConnection_0, Driver: GameNetDriver IpNetDriver_0, IsServer: YES, PC: bp_playercontroller_01_C_0, Owner: bp_playercontroller_01_C_0, UniqueId: NULL:DESKTOP-PSBIJ6E-D38C3FD046E99DE0220164B8798344F9
When this happens, my child actors are not replicating properly to the clients
but it works fine in PIE
looking for some assistance on updating a percentage bar for a base unit.
trying to use set percentage
i have done it before and got it working for players.. now just trying to get it working for base units
so it decreases the health correctly. and the variables are replicated just not decreasing the actual percentage bar
@tribal plover SetPercentage is in a range 0-1
So just divide the current value by the max value.
@tribal plover setpercent is from the base blueprint and others derive from it?
yes sir the second picture. I was just debugging to show it was getting changed in code.
"In Memory"
could it be that derived classes are not calling parent implementation that updates the percent?
It could be but i tested that I believe
I'd check event ticks for derived classes, they should have parent's tick called
For some reasons, when I'm trying to set color for my mesh by multicast, this doesn't work. It works without it, but only shows color on owning machine
Hey @hoary lark
I was thinking about the random seed thing
Wouldn't it be best if I set the random value in the Game Mode and on Post Login I cast to the player class and set the player s seed to the random seed generated in the game mode on begin play. This way all players would have the same seed. It wouldn't be possible to desync, right?
Whats the opposite of startsession that opens the session back up for new people to join?
update session?
Ok, I got it. The issue is - clients can't get their controllers. And the question - why? Controllers supposed to be accessible by server and owning client. That's weird
Very weird
I'll try that, cheers
So anyone implemented gamelift flexmatch to their project?
Well, I found out that pawn have special var "Player State", which gives ps without pc, but all colors are still available only on server or owning client
@distant wave you can set the start of the stream however, whenever you like, and if everything is perfect that is a clever solution. the problem is that all it takes for streams to diverge is one event being missed on client vs server.
- if your game is using StartShoot / StopShoot events, what if the client holds down the mouse button for 3.02 seconds and shoots 73 bullets out of his minigun and the server thinks he held it down for 3.01 seconds and shot 72 bullets?
- if anything is using unreliable RPCs, what if a packet gets dropped?
- if using reliable RPCs, do we REALLY want to rely on it for the entire duration of a game (it's probably safe TBH but... I don't know, feels risky nonetheless. it can just take one bad ruined experience for a player to ruin a whole session, like the CS:GO hitbox issues they had/have had for years)
No I wasn t talking about the stream
I was talking about the seed which is a static const int32
I was wondering how will the streams be synced if the players use different seeds
@hoary lark
the concept is that you need to start a new stream for a given process any time there is a chance that the state of the process could have diverged. every time you start a new stream, you need to use a new seed (or else the randomization pattern will be the same every time). whoever initiates the process must also generate and share the seed for it.
if you're building a lockstep game like an RTS, where everything has to be 100% totally repeatable, you can set one seed at the start and ... run with it
FPS games usually aren't built like that obviously as it requires everything to be reliable RPCs or TCP, usually causing frequent game hangups, etc
i think HoJo's system has a good bang for buck
if it desyncs, it will be limited to a single burst as worst-case scenario
if your desyncs, it will last the entire game @distant wave
and all your late joiners are desynced by default
good point too
the way I made mine it wouldn't even be desync'd during a burst (worst that could happen would be the example above where a server shoots a different number of bullets than a client if it doesn't receive the stopshoot due to ping or something), but if bandwidth proved to be a bit tight you could redesign it to sync some kind of seed less often somehow I'm sure
it is just 4 bytes extra
per RPC
not the first place i'd be saving the bandwidth on
i did see a guy on this channel, was obsessing about saving few bytes on one replication
could even pack it down to a short for a measly 65536 unique randomizations 
meanwhile, he was replicating FVector TargetLocation on Tick, instead of just replicating pointer to Target once
point being miniscule savings are what you do after your game hits alpha
before they just get in the way
I need animations to play on a dedicated server, but they don't seem to be. Is there any known way to do this simply? I need an attached object to move with the montage as there are traces associated with its position. The notifies do fire on the server, but it doesn't seem like any actual animation data (skeletal) is being processed.
Does anyone know if there is a way to create duplicate game sessions in STEAM? One on a lobby beacon, and one for the actual game. I want to have a beacon for a persistent party, Lobby Beacon and host game session.
Holy crap I'm at a loss on this one.
never done this myself but first google result for "unreal dedicated server animations" suggests to ensure this Optimization variable is set @bold dune https://i.gyazo.com/f78889038c83f95990fef62c6b62fd5c.png
I wanna do some Battle Royale type stuff, like tracking number of players left/determining the winner and setting the safe zone
where would I do this? in a game mode, level blueprint etc?
@pseudo iris those all sound like things that only the server should be able to change, so it should probably live in the game mode yes, since Game Mode only exists on server. However you also probably want all clients to be able to read that info for their HUD so you also need to update the Gamestate which replicates to all clients.
Level blueprint makes less sense because levels thenselves dont replicate afaik, only the actors in them and specially designated functions do.
is there documentation or tutorial you'd recommend to look into this
Plus you might want to use the same levle for different game types than battle royale
Hmm have you read the Unreal documentation online for what they call the Gameplay Framework?
it's more of a last-man standing deathmatch
with a small zone that opens when like two people are left
That tells you what each part is meant to don(gamemode, gamestate, gameinstance, etc)
The way I would set it up is to put all the rules in The game mode, have the game state be the thing that triggers and replicates level-wide information and events to clients, and then for things that happen on each specific level, have the level blueprint register event dispatchers fromthe gamestate and have the gamestate trigger those events since it receives the updates of when there are only two players left.
Thats very similar to how I implemented a sudden death mechanism where certain maps remove most of the cover when there is one minute remaining so the last minute of the game forces a frenzy of battle instead of more hide and seek.
Core systems, such as game rules, player input and controls, cameras, and user interfaces.
is this it?
I've got this for the safe zone so far
Yes. Espexially read the sections titled Game Flow Overview and Game Mode and Game State
in its blueprint
That should work fine - but make sure Is Safe variable is replicated so that when the server changes it, it will sync to all the clients for that same pawn on each client machine
how do I check that?
do I want every object that interacts with the player to "replicate"
Just click the variable and in the details panel on The side of the blueprint editor window tick the "is replicated" checkbox
Not necessarily
just the variable?
Yeah just the variable. Replicate on a variable means that whenever the server changes it that variable on that actor, then it will update that variable on the same actor on all the client machines too, if they are in range for it to consider it a relevant update
when I do this, both the server and the clients activate
Which actor does the blueprint belong to?
when one of the FPS characters goes into the box it activates for both the client
Okay but which actor is the variable inside of?
Is it in a pawn or the level blueprint or something else?
That's the plan
Good. So if we have two players, Anna amd Brea, and the server machine sets it's copy of Anna to have Is Safe = true, then if Is Safe is replicating, then it should also tell all the Clients' machines that are running the game, to update their copy of Anna to set Is Safe = true also
Meanwhile Brea is set to Is Safe= false on the server because she left the safe zone
So every client's copy of Brea should also set Is Safe to false
So then for all machines, each machine's Anna is safe and each machine's Brea is not safe
(Each machine has only those two pawns in this example)
But even if some clients are not up to date, then the clients should not be the ones to destroy any pawns. It should only be the server who gets to do that
So maybe you dont really need to replixate isSafe
right, and that'd be handled by the server, right?
The server is the only machine who needs to know
*game mode
Yes. You can technically do that functionality from anything thatnia running on the server but the Game Mode is probably the most "correct" place to instigate level-wide gameplay events which rely only on the game rules, since the game mode lives on the server and doesnt exist anywhere else.
I did most of my logic in GameState but now that I want to add more possible gameplay modes I find my gamestate class is getting really big and scattered and hard to maintain because it has all these branches going everywhere depending on whether they are doing a free for all or team game or other way of playing.
So game mode is for the server to make decisions about starting, scoring, and ending games, gamestate is for communicating that stuff to all the participants.
Gameinstance is for keeping track of settings and other stuff on each individual machine (it cannot communicate with the network). Gameinstance is not an actor so it is not destroyed when a level is unloaded.
So gamemode is server only
Gamestate is for everyone
And gameinstance is private to each machine
Game mode can boss the gamestate around though so that is probably the right way to do things
i see
Now that i understand what youre trying to do a little better...
Then I think you dont habe to go through the gamemode and its rules to cause this effect
Because the safety zone effect is not about which game mode youre playing but which level youre playing on
would I wanna put like, a time limit counter variable in game mode
What youre doing should work fine on the level blueprint
Yeah time limit should live on the game mode or the game state.
right
bc what I wanted to do was have multiple zone areas
and activate a random one
So when it comes time to activate a safe zone, you will need the gamestate to trigger a reliable multicast event. Then this event runs on the gamestates of all the other machines on the network pf the game, and you can pass a parameter to them to tell them which safe zone is activated. Then the server and the clients will all acticate the same safe zone.
When everybody outsidd the safe zone gets killed, it is because the server checks who the server has marked safe in the server's level blueprint. So when you run that logic you must either do it from the game mode or pass it through an Authority switch or isServer branch first to prevent clients from killing things that only the server should decide to kill
That way client machines only kill pawns that the server told them are dead (Because pawns replicate)
This is only important because a client might be lagged and think its copynof the same pawn is outside the sage zone and kill it, onlynto find out a 10th of a second later that the server says that pawn made it inside the safe zone just in time and should not be dead after all
Network multiplayer makes everything 10 times more complicated. Splitscreen multiplayer only 3 times more complicated :)
Because on splitscreen you have multiple players but only one machine and only one copy of each actor and level to think about
But in network multiplayer you have to think about each copy of each actor on each machine.
that makes sense
seems like if you're making a game with online you basically have to do all of blueprints from the ground up to be replicated
You dont have to network every actor but you habe to think about how it fits in with everything and when you should enforce the server's version of reality on everyone else
Yes thats right
If you try to retrofit it, it is about the same effort as building it again from the ground up
Unless you have way more stuff that doesnt need to be networked than that does need it
Like visual effects and menu widgets etc
Those tend not to care whats going on except in the local computer
if it was single player would it still work?
Yeah thats the nice thing
right
If you blueprint something for multiplayer, then run it as single player, then everything behaves as the one single cpmputer being the server
So if it works on the server in multiplayer, it will work in single player
"Listen server" means the comouter is both the server and a client
Dedicated server is a little different since it doesnt participate as a player itself. Therefore doesnt need graphics or sounds to be played on its end
It just runs the game mode and the level and waits for players to connect as it is running its stuff.
But it doesn't join as a player. It is safe to guess you are using a listen server approach
i'm, uh, not sure what i'm ujsing honestly
So single player is the same as listen server
i think I might restart the project and do it while looking at that framework page
Ok
I really appreciate your help though 🙂
Really you can do almost everything that should affect all players globally, from the Gamestate
and yes if something should happen to the level you can do it in the level blueprint.
For my sudden death timer making the walls disappear, my server gamestate calls reliable multicast to all the clients' gamestates. From there they call an event dispatcher I created named SuddenDeath
In the Beginplay of level blueprints that have a sudden death mechanism, they grab the GameState and register that event dispatcher to a custom event in the same level blueprint
That event is what makes the walls disappear
In that way, everyone's walls begin disappearing at the same time.
Additionally I use a timeline to move the walls because timeline nodes replicate so eveb if there is lag, the walls stay in sync and end their disappearing motionat the same time.
Your situation is slightly simpler because you arent moving anything over time just turning force fields on/off
When your timer goes off you can just loop through every pawn on the server's game mode and if they arent marked Safe then kill them.
Very simple!
And since it is the game mode you dont have to check anything or replicate anything.
When the replixated pawns are killed they will disappear on the clients upon the next network relplication (which happens several times per second but not nearly as fads as your framerate)
If you want a special effect to hapoen when they die you can put it in the pawn's Apply Damage event handler (happens only in server) or in their Destruct event (happens on all machines)
ahhh
so I decided to start from scratch, and start with making the fps character shoot with multicast
but its not shooting up or down
only directly forward
it's also not calling for the client
nvm fixed it
Sorry for the late reply @winged badger @hoary lark
Last time zlo said: i did see a guy on this channel, was obsessing about saving few bytes on one replication
It is important to save as much as possible because you can't spend so much money on ONE dedicated server
So it is better to make the game better, not spend more money on servers
I could be wrong, but I don't think netbandwidth is particularly expensive.
I adds up to the price, and you would also want nice specs if your game requires them
And it isn t expensive for one server
But you need more
Anyways, Zlo or HoJo said that my method for seeds wouldn't be good for late joiners because they could desync. How would they desync if they have the same seed? It doesn't matter when they join. If the seed is set on Begin Play of the game mode, it means that it will stick on the server until a new map is opened. Only then it would change. On Post Login is called for every player joining the game, so I don't see how they desync
Maybe I got the concept wrong, but all the players getting the same set of random values (stream) would only work if they have the same seed, otherwise what is the point?
Also @hoary lark said: the concept is that you need to start a new stream for a given process any time there is a chance that the state of the process could have diverged. every time you start a new stream, you need to use a new seed (or else the randomization pattern will be the same every time). whoever initiates the process must also generate and share the seed for it.
What you says only makes sense IF let's say: Player A shoots his shotgun and generates a seed of 12345 for example and then player B shoots his shotgun and also gets the seed 12345. This way they would have the same pattern each and everytime thsy shoot.
But if Player A shoots and generates a different seed than player B
Then using streams and seeds would make no sense would it?
And I got another question
If that is the case (where they both generate the same seed) how would I do that? In C++ a static const only changes once and shares its value with all of instances of the class. Would I have to generate the seed if there is authority?
This is what I don't understand. How to make them get the same seed. The only method I think would work is with game modes.
Anyways, this is how it makes sense to me, if I am mistaken please tell me.
Thank you for your time!
On first quick read my suspicion is that you don't know how random streams work in general (or you're just misapplying your knowledge somehow). I'll be at my pc a bit later
@distant wave an FRandomStream is an object which generates a sequence of random numbers. You always create a stream using a seed value. The seed value sets the sequence, it is like a DNA, you can clone streams by using the same seed, or use a different seed and get a totally different stream. Creating two FRandomStreams with the same seed means they will generate the exact same sequence of numbers.
all you can do with an FRandomStream is pull out the next number. As long as every player starts the stream at the same time, and all pull out the exact same quantity of numbers for each event in the game, they will all continue to pull out the same numbers.
however if anybody ever pulls out a different quantity of numbers, e.g. if one client misses receipt of any events for any reason, they will no longer be in sync.
and all your late joiners would not be in sync by default, as others would had used the seed to pull next number N times by then, and the late joiner would be pulling its very first
hey does anyone here use a simple login system for their game to uniquely identify someone for early testing, before you can use the steam or epic API?
Hello everyone
I'm trying to implement replicated function, but I'm getting an error that there is missing module
I've already included "OnlineSubsystem" module, but it seems like RPC functions need another module
can someone help?
No modules are required to make an rpc function and online subsystems are for including features like steam integration. You're getting something mixed up
They happen when you don't define the methods you need to define too
You forgot to write WithValidation
yeah but I defined it in cpp
You're making a server rpc, it needs a validate method and the implementation method in your cpp file, do you have a guide to follow?
Oh good call from midsoft
It is Server, Reliable, WithValidation
okay
Though I have some vague memory of someone saying that is no longer required in 424? Maybe a fake memory
@hoary lark Well yes, it makes sense, but for that to happen when Player 1 shoots and generates a seed of 12345 for example, all the other players must generate the same seed right?
btw I did as you've suggested
@clear cave sometimes, it happens that when I define the ServerRPC_Validate in C++, I accidentally define it as a void and not as a bool, Idk if that is the case
But it is worth checking
No no
I said sometimes i forget it is a bool
And i get errors
Don t think it is your case
Show us your cpp
@distant wave sorry for "what" to happen are you thinking of?
Sometimes, it happens that instead of
bool AClass::ServerRPC_Validate()
I write void AClass...
ah no it's not the case
You didn t write _Implememtation
wut?
ReadyStatius_Implementation
void AMainPlayerState::ReadyStatus_Implememtation(bool bIsReady)
no 😦
What
error
Can you show me the cpp
Also you did keep the WithValidation in the h file right?
Probably just missing validate too
Yea
In the cpp
ReadyStatus_Implementation_Validate?
Argument
@hoary lark I replied earlier to your last message: @HoJo Well yes, it makes sense, but for that to happen when Player 1 shoots and generates a seed of 12345 for example, all the other players must generate the same seed right?
like with _Implementaion and _Validate?
Please go read the docs it's all in that https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html
Designating function replication across the network
Okay
For server function the validation thing is kinda like an anticheat
If it returns false it disconnnects the client that called it
Afraid I'm not sure what you're asking though. In my last message I gave an example how two Rand streams can go out of sync... Has nothing to do with generating seeds on different machines...
oh man thank you
actually I'm so stupid
I was following https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html this guide
Designating function replication across the network
I mean that if Player A generates seed 12345, player B must also have seed 12345 this is how they get the same pattern @hoary lark
Right
?
Np
Actually I could make all this stuff in BP without any problems
just I wanted to make it in C++
Yeah That statement is correct @distant wave
Alright
So then how will it happen
How will all the players get the seed from the player that shot his shotgun?
Via an int or short or byte number passed to the server and down to other clients in shoot RPCs
And set their seed to that player s seed
Everyone creates a random stream object for the shoot event to use for its duration using that seed
Yes
Wait
Well yes
They create a random stream object
And when you do that you need to pass in a seed as an argument
But they will pass their own seed
Idk man a code example would be extremely useful @hoary lark
they will pass in the seed they were told to use
The person who initiates an event picks the seed to use. It can be randomly generated or an incrementing int, doesn't matter as long as it keeps changing to get different random number streams
Ok, I almost solved my problem (thanks for the help, guys), but there's an issue with the server. If I run game in listen-server mode, from server perspective it works fine, but from client's perspective pawn, that server possessed in, looks not painted, and others looks fine. I don't know, I tried to fix that but it doesn't work
P.S: Stop ignoring me!
So basically the shooting client will pick the seed. They have to do this because they are going to shoot before the server does
Unfortunately I'm in North America and I have a very busy day tomorrow but tomorrow night might be able to 😄
Just to try once more before sleep though: Sequence of events is:
Player shoots. They randomly generate a seed. They use it to create a random stream. They use that stream to create muzzle spread.
They RPC "Shoot with seed 12345" to the server. The server shoots and also generates a random stream with the same seed and uses that stream to create muzzle spread.
The server multicasts "Shoot with seed 12345" and all clients (except the owner) do the same thing, create a random stream with that seed and use it to create muzzle spread with the shooting
Ah ok my fire function looks like this:
void AClass::Fire()
{
if (Role < ROLE_Authority)
{
ServerFire();
}
// Fire code: line trace, damage etc.
}
void AClass::ServerFire_Implementation()
{
Fire();
}
bool AClass::ServerFire_Validate()
{
return true;
}
@hoary lark
I guess I generate the seed and stuff in that "//Fire code"
Then I make a Server RPC with an int32 parameter and I call it after I generate the seed and the parameter will be the seed I created which is a static const int32 replicated
The server rpc calls a multicastrpc with a parameter int32 and will input that seed
Am I right @hoary lark
Also it should be a replicated static const int32 right?
is this a dedicated server?
if so ensure you have animations turned on if your tracing using the player 😄
I'm late to the party, but I believe the shootergame example does the whole random seed propagation you are talking about @distant wave
So it might be a good reference if you run into trouble
so does UT4
Hasn't that project been dead for a few years already? Has anyone tried to run it on newer engine versions?
Seems like it would be a great reference for a lot of things
Alright thanks
can a mobile game host a session and a windows game join that session ?
I can host on windows and join on mobile, but I can't join on windows when mobile hosts
@distant wave yeah you pretty much have it except the seed has no need of being static const (well it could be const I guess but it really doesn't matter, it's just a number that gets passed across via RPC and immediately used to create a random stream and that's it)
And the seed isn't a replicated variable. It's just a local variable
That gets passed across the network and used for this "event" in this function only. It has a life time of approximately 80ms (more or less depending on ping lol)
I'll try to whip up example pseudocode in a few hours
Hello everyone,
There is so much conflicting information online about would composition & multiplayer origin rebasing online on a dedicated server. The docs say it is not supported but make no mention of the multiplayer rebase option in project settings. There are conflicting information about if this button will actually allow you to run a PUBG sized map and fix float precision. Has anyone got this working or is it something you need to know c++ to get working?
@hoary lark Thanks a lot for your help!
@distant wave I haven't doublechecked these much but
https://gist.github.com/HomerJohnston/ddcb21b3a272eb9fa3135e3b0ba9d927 and
https://gist.github.com/HomerJohnston/3c5b3e22e7322844fb8be8a8d9020096
No worries
is there a way to change the fog/sun light/etc on individual clients? Like if a player enters a building, you can disable the fog just for that one player and not the rest that are connected?
Usually to do stuff just for individual players you need to check if IsLocallyControlled
Ah nice
had to grab the fog actor from the character on beginplay, not sure if thats the best way to do it though
Depends, how many of that character type is gonna be in the level?
shouldnt be much, game will only have 4 players max
begin play will run on every player instance each time a player joins right? So i probably shouldnt do that on begin play
Is there a way to disable rotation replication in the default character setup while keeping the movement replication?
@obtuse forum i have hosted on LG ThinQ V30 android smartphone and joined successfully over wifi (no online subsystem) from windows 8.1 PC
@peak star thanks, ill try again tomorrow.
Can anyone help me with this annoying issue
@polar lotus Just ask you question, instead of asking to ask.
Ok
My gun will not properly attach to my player
for some reason, sometimes only the sphere component attaches
..
@polar lotus What's the code you used to attach the weapon? and where do you call This function? attaching is as simple as
WEAPONRIGHT->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "WEAPONRIGHT");
the event is actually an interface
My weapon does thos
this
WeaponOwnerBoundsOverlapped is supposed to represent the weapon that the player is overlapping and can pick up
Hi can anyone please tell me why this fails on client and succeds on server and how to make it not fail on client.
This is an AI BP btw.
show what calls it
or where it's called
Is the ChoosePlayerStart function the appropriate place to setup match round spawning? I'm getting legitimate data when giving the player a player start, but it doesnt actually work when in multiplayer
double check to make sure that the event play is being called on the server. If you're unsure, then you could always make an event within that BP, to execute on the server and just call it within your sequence
Thanks for helping oput Herbie
the other parts of the sequence replicate only that cast fails
im guessing thats due to them being components of a replicated actor
but thats just a guess i dont have enough context to tell.
it's part of the dynamic combat system plugin, I'm trying to replicate this and am almost done but can't figure this out
ah, im unfamiliar with that. Im guessing the variable you're setting isnt part of the system?
but something you made?
it is part of the system but It wasn't made with replication in mind I guess
Any Spatialos pros here?
@vale ermine They have an office here in Guangzhou, I met a couple of them, but I'm not one 😉
That is awesome! I have tried thier example project and got everything working. I am just wondering if it is developed enough to use for a release.
Yes it's being heavily used here in China
NetEase / Nostos is the most recent example I can think of
Spatialos is the only cross server communication solution I have found. I need to host many dedicated servers for different maps and have the players on each map be able to interact with each other if they are on the same map but different servers. That way I can scale the player load better per map.
I browsed some of their documentation and training videos, seems like a good solution. As far as I know it's being heavily used and extensively developed, but again, this is secondhand information I got from people working in Improbable office here
Currently, they are on 4.22 release and I need them to update to 4.24. 4.24 got some paper2d improvements I need to scale better using paper2d.
Yes, their branch is a bit behind Epic main branch, but they should update regularly
I could make the changes myself. I might just do that.
A side comment on a tangent, It's unexpected to me to see there is absolutely no indie development here in China. It's only big companies with mobile or multiplayer development, no PC single player and no indie development.
They know what sells.
What's the best way to display a player list? Update it constantly on Tick? Is there some kind of OnRep I can bind to instead? My use case is in the pre game lobby I want to display the list of players in the lobby
Maybe just PlayerState's BeginPlay
I have a small problem with the following.
I have a lever with 2 animations.
I could use a Statemachine to control the state of the lever, but that seems a bit like an overkill.
My current problem is that not all the players see the lever being pulled.
If I use NetMulticast and host player pulls the lever then all players see it happening but when a client pulls it, the server doesn't see it.
Any suggestions how to solve this replication problem?
Anyone noticing some strange issues in 4.24.1 where the listen server host / default PIE characters has a very different collision response compared to playing as a client?
Other players and enemies act as if they have no collision (to certain channels such as other pawns, various objects and linetraces) but only if playing as the server host, any clients or playing in PIE with the dedicated server tickbox checked works as it did before
Strangely if I move near the origin it all seems to work fine again
100K units isn't too far from the origin is it? That's where the collision went all wrong when playing as the server host
Maybe it was just a strange fluke and I just need to keep all my meshes close to the origin if possible
Having an issue with player spawn, specifically players not going to their assigned spawn.
Player 0, on team 0, getting assigned team0(blue) spawn: https://gyazo.com/70db5cea3d296505d91d60d1735c3d9b
Player 1, on team 1, getting assigned team1(red) spawn: https://gyazo.com/3e063645d7a3253a3474f451f246b6fb
character actor being created at that spawn location, then possessed by the player:
spiderman meme https://gyazo.com/fae2d1e4a1ff19caa81c4deefce54e3c
Hey Guys Anyone here in this chat xD
From my home i have 2 pcs with different steam accounts When im create Server i can see it and join normal ...
When im sending the game to my friends they Cant find my server and i cant see their servers
What address is your server advertising?
Its internet address (the one of your router), or its local address?
I'm not all that familiar with Steam sessions. Surely there's still an address involved somewhere
Im trying to figure the Issue i've opened Ports tried to Recreate the codes samething
Hmmm
How is it that you create your server?
Do you have to pass an address or port at all?
I have this issue with friends that have very restricted internet settings
@ebon nimbus In Other Game like human fall flat or Satisfactory i can create session normally
@earnest igloo Im using Advanced Session
Well thats cool, those are fully developed games that have handled connection issues.
This is the problem 😛
my game still in 0.0.0.0.0.0.0.0.0.0.1 Alpha Stage
but i need to fix this issue to Step on next level
Then dont throw anecdotal evidence when people are trying to help. How many people have you tested? Have they all experienced this issue?
Sorry i havent got what you mean exactly here " Then dont throw anecdotal evidence when people are trying to help " and my friends are 3 tried to create Session and me tried to create session no one could found
You're all behind routers I presume?
Yes Everyone using Router true
But different countries
now i asked them to try to join each other
Are you and your friends using the same download region on steam @odd iron ?
No is that Effect ?
If not try that
i was thinking about it but i said its for download xD
That was the issue for me and some other guys I've talked to. This is only when using Spacewar ofc
And when you Get your Game ID its will change right ?
Ok Cool
I believe so
i will check now thanks for info
Np. Hope it works
now its showing 1/-1 slots Server without name Xd
Could you send a screenshot of your code ?
Sure
This one for Finding the session
This one creating session
This one for joining
ah when they joining to 1/-1 server its redirect them to mainmenu for somehow
Is there a way to have multiple sessions active at once - a party session for a party system, lobby session for lobby and separate game session?
Unreal Engine only seems to support "PartySession" and "GameSession"
@odd iron Could you send a picture of the server list?
ingame
What do you mean with 1/-1 server?
Not Advanced one ?
No. Maybe that could be it?
Can Found the session from other region the players ?
i will check it
@steady aspen Nope
not working
This is the Code
Is the host and join server called from the same widget blueprint?
Join session in Steam_instance
i mean in instance i call it Steam_inst
ah no sorry i have it in Serverlist Child
Server = Blueprint Session Result
Try having the join and host session code in the same blueprint like the gameinstance or something
The host in game instance
but the problem in find session its not finding the servers i think join session will not fix it
since its working in LAN and in Steam with local connection
i will try to create session normal
btw do i need to install some API in game content Binaries/win64 because i just have steam_appid.txt and shipping.exe there nothing else
maybe something missing or
I dont see why it wont work if you have the same download region and the code looks right
tomorrow i will try again with my 2nd pc and i will connect it to my phone internet not home wifi
and i will see if its will find it
can somebody tell me how to replicate AI Controller BPS by any chance? I don't know how to pass this along to Client.
it returns "none" on client
You cant, AIControllers only exist on the Server
but how do I pass the info to the client :S
Through the Pawn it possesses?
What info do you want on the AIController that the Client needs to know?
stop all movement including montages
Call that on the Server...
Are you using BehaviorTrees?
yep
Well you should be calling a function that tells your AI to stop moving through the behaviour tree instead
In which case asking how to stop a Pawn from moving would belong in the #gameplay-ai channel
👍
🥳
No
You could combine those variables into a Struct and replicate the Struct instead.
That might be a workaround for you.
I've set up my game so that i can dynamically level stream but i'm having issues with the levels replicating to clients
in c++, i'm calling AddStreamingLevel on the client (after the server has added the level)
but i believe my problem is that the server does not get a message from the client that it has loaded the level. so the level is loaded on the client, i can see it and everything, but the server does not replicate any actors in that level to the client
does anybody know what i might be missing?
i came across this:
but i'm not using the AddLevel method of the UWorld object, i'm using AddStreamingLevel
is there a message i can have the client send to the server to say it has loaded that level?
Hey folks,
quick question, hope sbdy can help.
I am playing around with mp at the moment to test some things.
Well so currently I tested everything locally and all players got replicated, but once i start using steam subsystem to launch an djoin a session it is not working anymore.
Is there anything I am missing?
I am also certain that the server I join in with a second machine is the same as the one i created (checked it via server name)
can anyone help with replicating firing? I posted stuff in blueprint but no one's respondigng
if anyone has experience with online fps stuff please discord message me
@median elbow You should be keeping a reference to your dynamic level streaming object so you can add it to the list of StreamingLevels on all the clients when you need to.
does anyone know how to make an online character get hurt by a line trace?
like it's not affecting the player at all, but it will affect other actors
thanks @granite jolt
i'm actually doing that
the level loads fine and i can see it on the client
its just that no actors in the room replicates
and i get these warning, like FNetGUIDCache::SupportsObject and something about addinstancedcomponent and stuff
the entry level stream works, where the player starts, and everything replicates fine there
its just a problem when i jump through a portal to another level stream (level is streamed and loaded before going through the portal), then nothing replicates
i think it might have to do with relevancy
Is Presence required for starting listen servers through Steam?
anyone?
i'm gonna move on from this because I have a basic line trace that works. i'll come back later
how do i make it so when a player dies they become a spectator?
Is it possible to set control rotation on the client side through blueprints
Hi can anyone tell me why the first client always breaks in PIE???
not only is the camera offse but I also can't control the character
this is BP replication btw
@pseudo iris I just use a set view target with blend node
And @pseudo iris I can help with the line traces
I've been trying to make it so I have a separate child actor fires line traces
so I can have multiple weapons easier
but idk how to make it replicate right
Yeah
That's the same as my setup
Lemme just load up unreal so I can send screenshots
that's similar to what I have
ok so i use a custom event replicated to owning client because the weapon is owned by the player
and i plug in the values start , end and actors to ignore
what actors do you plug into the start?
can I see what you have on the player end please?
and the trace start and end is just a pure function that i use to save time
i have it firing but I cant get it to rotate
do you use an interface between the weapon and the player ?
no
i do
after failing multiple times i looked through some shooter examples and found that an interface is almost always necessary
what did you do for the interface?
this is what i looks like on the child gun that the player actually uses
i made an interface that has the functions. Fire and reload
in my setup the i dont touch the child blueprints unless i want to make a custom weapon or add stuff
in my interface fire has only one variable which is a bool to tell the weapon weather if to start firing or not
the gun parent's eventgraph looks like this
could I see how you did it please?
I was following a tutorial but it wasn't for online MP
those are the functions i use in the player to tell the weapon to start firing and to stop
the target pin is for the weapon
so how could I modify my code to work like this
that's how i call it
well first you would have to make an interface
between your main weapon BP and the character
in the interface?
both run on server
no
in the character BP
one to the weapon to start firing and one to tell it to stop
done
the gun parent
do I want object or class reference
ahh ok
now set the input up like this in your character bp
hey guys... question on audio lag with multiplayer. Right now I have an interface that is implemented on my character for doing a line trace to the ground, detecting surface type and playing the correct audio "landing" sound when jumping. This is triggered via the animation blueprint when the landing animation touches the ground. Problem is when i introduce lag the client hears the landing far after it visually happens
Any idea's on how to play it locally right away, but have other clients hear it when the server gets it?
current weapon is a reference to the weapon your character is currently holding or carrying
do I wanna call this action?
i call the line trace from within the weapon
how do you get the camera though
because my character already has lots of code in it
i set the owner of the weapon to the character
like so?
so i just use this
nope
the input action fire should be connected directly to the is valid nodes
and the server stop firing and server start firing are the events that should be at the other end of the is valid nodes
in the screenshot main character bp refers to your player BP
what's server start fire on your end?
lemme screenshot the whole setup
what about switching authority tho